FFmpeg
Loading...
Searching...
No Matches
dvbsubenc.c File Reference
#include "avcodec.h"
#include "bytestream.h"
#include "codec_internal.h"
#include "libavutil/colorspace.h"
#include "libavutil/opt.h"

Go to the source code of this file.

Data Structures

struct  DVBSubtitleContext
 

Macros

#define PUTBITS2(val)
 
#define PUTBITS4(val)
 
#define OFFSET(x)
 
#define SE   AV_OPT_FLAG_SUBTITLE_PARAM | AV_OPT_FLAG_ENCODING_PARAM
 

Functions

static int dvb_encode_rle2 (uint8_t **pq, int buf_size, const uint8_t *bitmap, int linesize, int w, int h)
 
static int dvb_encode_rle4 (uint8_t **pq, int buf_size, const uint8_t *bitmap, int linesize, int w, int h)
 
static int dvb_encode_rle8 (uint8_t **pq, int buf_size, const uint8_t *bitmap, int linesize, int w, int h)
 
static int dvbsub_encode (AVCodecContext *avctx, uint8_t *outbuf, int buf_size, const AVSubtitle *h)
 

Variables

static const AVOption options []
 
static const AVClass dvbsubenc_class
 
const FFCodec ff_dvbsub_encoder
 

Macro Definition Documentation

◆ PUTBITS2

#define PUTBITS2 ( val)
Value:
{\
bitbuf |= (val) << bitcnt;\
bitcnt -= 2;\
if (bitcnt < 0) {\
bitcnt = 6;\
*q++ = bitbuf;\
bitbuf = 0;\
}\
}
static double val(void *priv, double ch)
Definition aeval.c:77

Definition at line 33 of file dvbsubenc.c.

Referenced by dvb_encode_rle2().

◆ PUTBITS4

#define PUTBITS4 ( val)
Value:
{\
bitbuf |= (val) << bitcnt;\
bitcnt -= 4;\
if (bitcnt < 0) {\
bitcnt = 4;\
*q++ = bitbuf;\
bitbuf = 0;\
}\
}

Definition at line 127 of file dvbsubenc.c.

Referenced by dvb_encode_rle4().

◆ OFFSET

#define OFFSET ( x)
Value:

Definition at line 530 of file dvbsubenc.c.

◆ SE

Function Documentation

◆ dvb_encode_rle2()

static int dvb_encode_rle2 ( uint8_t ** pq,
int buf_size,
const uint8_t * bitmap,
int linesize,
int w,
int h )
static

Definition at line 44 of file dvbsubenc.c.

Referenced by dvbsub_encode().

◆ dvb_encode_rle4()

static int dvb_encode_rle4 ( uint8_t ** pq,
int buf_size,
const uint8_t * bitmap,
int linesize,
int w,
int h )
static

Definition at line 139 of file dvbsubenc.c.

Referenced by dvbsub_encode().

◆ dvb_encode_rle8()

static int dvb_encode_rle8 ( uint8_t ** pq,
int buf_size,
const uint8_t * bitmap,
int linesize,
int w,
int h )
static

Definition at line 214 of file dvbsubenc.c.

Referenced by dvbsub_encode().

◆ dvbsub_encode()

static int dvbsub_encode ( AVCodecContext * avctx,
uint8_t * outbuf,
int buf_size,
const AVSubtitle * h )
static

Definition at line 276 of file dvbsubenc.c.

Variable Documentation

◆ options

const AVOption options[]
static
Initial value:
= {
{"min_bpp", "minimum bits-per-pixel for subtitle colors (2, 4 or 8)", OFFSET(min_bpp), AV_OPT_TYPE_INT, {.i64 = 4}, 2, 8, SE},
{ NULL },
}
#define NULL
Definition coverity.c:32
#define SE
Definition dvbsubenc.c:531
#define OFFSET(x)
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition opt.h:258

Definition at line 532 of file dvbsubenc.c.

◆ dvbsubenc_class

const AVClass dvbsubenc_class
static
Initial value:
= {
.class_name = "DVBSUB subtitle encoder",
.item_name = av_default_item_name,
.option = options,
}
const char * av_default_item_name(void *ptr)
Return the context name.
Definition log.c:241
#define LIBAVUTIL_VERSION_INT
Definition version.h:85

Definition at line 537 of file dvbsubenc.c.

◆ ff_dvbsub_encoder

const FFCodec ff_dvbsub_encoder
Initial value:
= {
.p.name = "dvbsub",
CODEC_LONG_NAME("DVB subtitles"),
.priv_data_size = sizeof(DVBSubtitleContext),
.p.priv_class = &dvbsubenc_class,
}
#define FF_CODEC_ENCODE_SUB_CB(func)
#define CODEC_LONG_NAME(str)
static int dvbsub_encode(AVCodecContext *avctx, uint8_t *outbuf, int buf_size, const AVSubtitle *h)
Definition dvbsubenc.c:276
static const AVClass dvbsubenc_class
Definition dvbsubenc.c:537
@ AV_CODEC_ID_DVB_SUBTITLE
Definition codec_id.h:567
@ AVMEDIA_TYPE_SUBTITLE
Definition avutil.h:203

Definition at line 544 of file dvbsubenc.c.