FFmpeg
Functions | Variables
pcxenc.c File Reference
#include "avcodec.h"
#include "bytestream.h"
#include "libavutil/imgutils.h"
#include "encode.h"
#include "internal.h"

Go to the source code of this file.

Functions

static int pcx_rle_encode (uint8_t *dst, int dst_size, const uint8_t *src, int src_plane_size, int nplanes)
 PCX run-length encoder. More...
 
static int pcx_encode_frame (AVCodecContext *avctx, AVPacket *pkt, const AVFrame *frame, int *got_packet)
 

Variables

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

Detailed Description

PCX image encoder

Author
Daniel Verkamp
See also
http://bespin.org/~qz/pc-gpe/pcx.txt

Definition in file pcxenc.c.

Function Documentation

◆ pcx_rle_encode()

static int pcx_rle_encode ( uint8_t *  dst,
int  dst_size,
const uint8_t *  src,
int  src_plane_size,
int  nplanes 
)
static

PCX run-length encoder.

Parameters
dstoutput buffer
dst_sizesize of output buffer
srcinput buffer
src_plane_sizesize of one plane of input buffer in bytes
nplanesnumber of planes in input buffer
Returns
number of bytes written to dst or -1 on error
Bug:
will not work for nplanes != 1 && bpp != 8

Definition at line 47 of file pcxenc.c.

Referenced by pcx_encode_frame().

◆ pcx_encode_frame()

static int pcx_encode_frame ( AVCodecContext avctx,
AVPacket pkt,
const AVFrame frame,
int got_packet 
)
static

Definition at line 87 of file pcxenc.c.

Variable Documentation

◆ monoblack_pal

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

Definition at line 35 of file pcxenc.c.

Referenced by pcx_encode_frame().

◆ ff_pcx_encoder

const AVCodec ff_pcx_encoder
Initial value:

Definition at line 195 of file pcxenc.c.

FF_CODEC_CAP_INIT_THREADSAFE
#define FF_CODEC_CAP_INIT_THREADSAFE
The codec does not modify any global variables in the init function, allowing to call the init functi...
Definition: internal.h:42
AVPixelFormat
AVPixelFormat
Pixel format.
Definition: pixfmt.h:64
AV_PIX_FMT_BGR8
@ AV_PIX_FMT_BGR8
packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb)
Definition: pixfmt.h:83
AV_PIX_FMT_MONOBLACK
@ 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:76
AV_PIX_FMT_RGB8
@ AV_PIX_FMT_RGB8
packed RGB 3:3:2, 8bpp, (msb)2R 3G 3B(lsb)
Definition: pixfmt.h:86
AV_PIX_FMT_GRAY8
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
Definition: pixfmt.h:74
AV_PIX_FMT_BGR4_BYTE
@ AV_PIX_FMT_BGR4_BYTE
packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb)
Definition: pixfmt.h:85
AV_PIX_FMT_RGB24
@ AV_PIX_FMT_RGB24
packed RGB 8:8:8, 24bpp, RGBRGB...
Definition: pixfmt.h:68
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:117
AV_CODEC_ID_PCX
@ AV_CODEC_ID_PCX
Definition: codec_id.h:159
AV_PIX_FMT_RGB4_BYTE
@ AV_PIX_FMT_RGB4_BYTE
packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb)
Definition: pixfmt.h:88
AV_PIX_FMT_PAL8
@ AV_PIX_FMT_PAL8
8 bits with AV_PIX_FMT_RGB32 palette
Definition: pixfmt.h:77
AV_PIX_FMT_NONE
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:65
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
pcx_encode_frame
static int pcx_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *frame, int *got_packet)
Definition: pcxenc.c:87