FFmpeg
Loading...
Searching...
No Matches
bmpenc.c File Reference
#include "config.h"
#include "libavutil/avassert.h"
#include "libavutil/imgutils_internal.h"
#include "avcodec.h"
#include "bytestream.h"
#include "bmp.h"
#include "codec_internal.h"
#include "encode.h"

Go to the source code of this file.

Macros

#define SIZE_BITMAPFILEHEADER   14
 
#define SIZE_BITMAPINFOHEADER   40
 

Functions

static av_cold int bmp_encode_init (AVCodecContext *avctx)
 
static int bmp_encode_frame (AVCodecContext *avctx, AVPacket *pkt, const AVFrame *pict, int *got_packet)
 

Variables

static const uint32_t monoblack_pal [] = { 0x000000, 0xFFFFFF }
 
static const uint32_t rgb565_masks [] = { 0xF800, 0x07E0, 0x001F }
 
static const uint32_t rgb444_masks [] = { 0x0F00, 0x00F0, 0x000F }
 
const FFCodec ff_bmp_encoder
 

Macro Definition Documentation

◆ SIZE_BITMAPFILEHEADER

#define SIZE_BITMAPFILEHEADER   14

Referenced by bmp_encode_frame().

◆ SIZE_BITMAPINFOHEADER

#define SIZE_BITMAPINFOHEADER   40

Referenced by bmp_encode_frame().

Function Documentation

◆ bmp_encode_init()

static av_cold int bmp_encode_init ( AVCodecContext * avctx)
static

Definition at line 37 of file bmpenc.c.

◆ bmp_encode_frame()

static int bmp_encode_frame ( AVCodecContext * avctx,
AVPacket * pkt,
const AVFrame * pict,
int * got_packet )
static

Definition at line 66 of file bmpenc.c.

Variable Documentation

◆ monoblack_pal

const uint32_t monoblack_pal[] = { 0x000000, 0xFFFFFF }
static

Definition at line 33 of file bmpenc.c.

Referenced by bmp_encode_frame(), and pcx_encode_frame().

◆ rgb565_masks

const uint32_t rgb565_masks[] = { 0xF800, 0x07E0, 0x001F }
static

Definition at line 34 of file bmpenc.c.

Referenced by bmp_encode_frame().

◆ rgb444_masks

const uint32_t rgb444_masks[] = { 0x0F00, 0x00F0, 0x000F }
static

Definition at line 35 of file bmpenc.c.

Referenced by bmp_encode_frame().

◆ ff_bmp_encoder

const FFCodec ff_bmp_encoder
Initial value:
= {
.p.name = "bmp",
CODEC_LONG_NAME("BMP (Windows and OS/2 bitmap)"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_BMP,
.init = bmp_encode_init,
}
static av_cold int bmp_encode_init(AVCodecContext *avctx)
Definition bmpenc.c:37
static int bmp_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *pict, int *got_packet)
Definition bmpenc.c:66
#define CODEC_PIXFMTS(...)
#define FF_CODEC_ENCODE_CB(func)
#define CODEC_LONG_NAME(str)
#define AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE
This encoder can reorder user opaque values from input AVFrames and return them with corresponding ou...
Definition codec.h:147
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition codec.h:49
@ AV_CODEC_ID_BMP
Definition codec_id.h:128
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200
@ AV_PIX_FMT_MONOBLACK
Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb.
Definition pixfmt.h:83
@ AV_PIX_FMT_BGRA
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
Definition pixfmt.h:102
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
Definition pixfmt.h:81
@ AV_PIX_FMT_RGB8
packed RGB 3:3:2, 8bpp, (msb)3R 3G 2B(lsb)
Definition pixfmt.h:93
@ AV_PIX_FMT_BGR8
packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb)
Definition pixfmt.h:90
@ AV_PIX_FMT_RGB4_BYTE
packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb)
Definition pixfmt.h:95
@ AV_PIX_FMT_BGR4_BYTE
packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb)
Definition pixfmt.h:92
@ AV_PIX_FMT_PAL8
8 bits with AV_PIX_FMT_RGB32 palette
Definition pixfmt.h:84
@ AV_PIX_FMT_BGR24
packed RGB 8:8:8, 24bpp, BGRBGR...
Definition pixfmt.h:76
#define AV_PIX_FMT_RGB565
Definition pixfmt.h:532
#define AV_PIX_FMT_RGB444
Definition pixfmt.h:534
#define AV_PIX_FMT_RGB555
Definition pixfmt.h:533

Definition at line 159 of file bmpenc.c.