Go to the documentation of this file.
33 #define DVBSUB_PAGE_SEGMENT 0x10
34 #define DVBSUB_REGION_SEGMENT 0x11
35 #define DVBSUB_CLUT_SEGMENT 0x12
36 #define DVBSUB_OBJECT_SEGMENT 0x13
37 #define DVBSUB_DISPLAYDEFINITION_SEGMENT 0x14
38 #define DVBSUB_DISPLAY_SEGMENT 0x80
40 #define cm (ff_crop_tab + MAX_NEG_CROP)
42 #define RGBA(r,g,b,a) (((unsigned)(a) << 24) | ((r) << 16) | ((g) << 8) | (b))
149 while (ptr && ptr->
id != object_id) {
160 while (ptr && ptr->
id != clut_id) {
171 while (ptr && ptr->
id != region_id) {
189 obj_disp_ptr = &
object->display_list;
190 obj_disp = *obj_disp_ptr;
192 while (obj_disp && obj_disp != display) {
194 obj_disp = *obj_disp_ptr;
201 obj2_ptr = &
ctx->object_list;
204 while (obj2 !=
object) {
206 obj2_ptr = &obj2->
next;
210 *obj2_ptr = obj2->
next;
226 while (
ctx->clut_list) {
237 while (
ctx->object_list) {
240 ctx->object_list =
object->next;
248 while (
ctx->region_list) {
251 ctx->region_list = region->
next;
262 int i,
r,
g,
b,
a = 0;
273 for (
i = 1;
i < 16;
i++) {
275 r = (
i & 1) ? 255 : 0;
276 g = (
i & 2) ? 255 : 0;
277 b = (
i & 4) ? 255 : 0;
279 r = (
i & 1) ? 127 : 0;
280 g = (
i & 2) ? 127 : 0;
281 b = (
i & 4) ? 127 : 0;
287 for (
i = 1;
i < 256;
i++) {
289 r = (
i & 1) ? 255 : 0;
290 g = (
i & 2) ? 255 : 0;
291 b = (
i & 4) ? 255 : 0;
296 r = ((
i & 1) ? 85 : 0) + ((
i & 0x10) ? 170 : 0);
297 g = ((
i & 2) ? 85 : 0) + ((
i & 0x20) ? 170 : 0);
298 b = ((
i & 4) ? 85 : 0) + ((
i & 0x40) ? 170 : 0);
302 r = ((
i & 1) ? 85 : 0) + ((
i & 0x10) ? 170 : 0);
303 g = ((
i & 2) ? 85 : 0) + ((
i & 0x20) ? 170 : 0);
304 b = ((
i & 4) ? 85 : 0) + ((
i & 0x40) ? 170 : 0);
308 r = 127 + ((
i & 1) ? 43 : 0) + ((
i & 0x10) ? 85 : 0);
309 g = 127 + ((
i & 2) ? 43 : 0) + ((
i & 0x20) ? 85 : 0);
310 b = 127 + ((
i & 4) ? 43 : 0) + ((
i & 0x40) ? 85 : 0);
314 r = ((
i & 1) ? 43 : 0) + ((
i & 0x10) ? 85 : 0);
315 g = ((
i & 2) ? 43 : 0) + ((
i & 0x20) ? 85 : 0);
316 b = ((
i & 4) ? 43 : 0) + ((
i & 0x40) ? 85 : 0);
330 if (
ctx->substream < 0) {
331 ctx->composition_id = -1;
332 ctx->ancillary_id = -1;
335 ctx->composition_id = -1;
336 ctx->ancillary_id = -1;
369 while (
ctx->display_list) {
370 display =
ctx->display_list;
371 ctx->display_list = display->
next;
380 uint8_t *destbuf,
int dbuf_len,
381 const uint8_t **srcbuf,
int buf_size,
382 int non_mod, uint8_t *map_table,
int x_pos)
388 int pixels_read = x_pos;
394 while (
get_bits_count(&gb) < buf_size << 3 && pixels_read < dbuf_len) {
398 if (non_mod != 1 ||
bits != 1) {
400 *destbuf++ = map_table[
bits];
411 if (non_mod == 1 &&
bits == 1)
412 pixels_read += run_length;
416 while (run_length-- > 0 && pixels_read < dbuf_len) {
429 if (non_mod == 1 &&
bits == 1)
430 pixels_read += run_length;
434 while (run_length-- > 0 && pixels_read < dbuf_len) {
439 }
else if (
bits == 3) {
443 if (non_mod == 1 &&
bits == 1)
444 pixels_read += run_length;
448 while (run_length-- > 0 && pixels_read < dbuf_len) {
453 }
else if (
bits == 1) {
459 while (run_length-- > 0 && pixels_read < dbuf_len) {
488 const uint8_t **srcbuf,
int buf_size,
489 int non_mod, uint8_t *map_table,
int x_pos)
495 int pixels_read = x_pos;
501 while (
get_bits_count(&gb) < buf_size << 3 && pixels_read < dbuf_len) {
505 if (non_mod != 1 ||
bits != 1) {
507 *destbuf++ = map_table[
bits];
517 if (run_length == 0) {
529 while (run_length-- > 0 && pixels_read < dbuf_len) {
539 if (non_mod == 1 &&
bits == 1)
540 pixels_read += run_length;
544 while (run_length-- > 0 && pixels_read < dbuf_len) {
555 if (non_mod == 1 &&
bits == 1)
556 pixels_read += run_length;
560 while (run_length-- > 0 && pixels_read < dbuf_len) {
565 }
else if (
bits == 3) {
569 if (non_mod == 1 &&
bits == 1)
570 pixels_read += run_length;
574 while (run_length-- > 0 && pixels_read < dbuf_len) {
579 }
else if (
bits == 1) {
585 while (run_length-- > 0 && pixels_read < dbuf_len) {
611 uint8_t *destbuf,
int dbuf_len,
612 const uint8_t **srcbuf,
int buf_size,
613 int non_mod, uint8_t *map_table,
int x_pos)
615 const uint8_t *sbuf_end = (*srcbuf) + buf_size;
618 int pixels_read = x_pos;
622 while (*srcbuf < sbuf_end && pixels_read < dbuf_len) {
626 if (non_mod != 1 ||
bits != 1) {
628 *destbuf++ = map_table[
bits];
635 run_length =
bits & 0x7f;
636 if ((
bits & 0x80) == 0) {
637 if (run_length == 0) {
645 if (non_mod == 1 &&
bits == 1)
646 pixels_read += run_length;
650 while (run_length-- > 0 && pixels_read < dbuf_len) {
666 uint8_t
list[256] = {0};
667 uint8_t list_inv[256];
668 int counttab[256] = {0};
669 int (*counttab2)[256] =
ctx->clut_count2;
673 memset(
ctx->clut_count2, 0 ,
sizeof(
ctx->clut_count2));
675 #define V(x,y) rect->data[0][(x) + (y)*stride]
676 for (y = 0; y<
h; y++) {
677 for (x = 0; x<
w; x++) {
679 int vl = x ?
V(x-1,y) + 1 : 0;
680 int vr = x+1<
w ?
V(x+1,y) + 1 : 0;
681 int vt = y ?
V(x,y-1) + 1 : 0;
682 int vb = y+1<
h ?
V(x,y+1) + 1 : 0;
683 counttab[v-1] += !!((v!=vl) + (v!=vr) + (v!=vt) + (v!=vb));
684 counttab2[vl][v-1] ++;
685 counttab2[vr][v-1] ++;
686 counttab2[vt][v-1] ++;
687 counttab2[vb][v-1] ++;
690 #define L(x,y) list[d[(x) + (y)*stride]]
692 for (
i = 0;
i<256;
i++) {
693 counttab2[
i+1][
i] = 0;
695 for (
i = 0;
i<256;
i++) {
699 for (x = 0; x < 256; x++) {
703 scorev += counttab2[0][x];
704 for (y = 0; y < 256; y++) {
705 scorev +=
list[y] * counttab2[y+1][x];
709 int score = 1024LL*scorev / counttab[x];
710 if (score > bestscore) {
719 list_inv[
i ] = bestv;
723 for (
i--;
i >= 0;
i--) {
724 int v =
i * 255 / count;
738 const uint32_t *clut_table;
740 int offset_x=0, offset_y=0;
745 offset_x = display_def->
x;
746 offset_y = display_def->
y;
754 for (display =
ctx->display_list; display; display = display->
next) {
756 if (region && region->
dirty)
760 if (
ctx->compute_edt == 0) {
785 for (display =
ctx->display_list; display; display = display->
next) {
808 switch (region->
depth) {
810 clut_table = clut->
clut4;
817 clut_table = clut->
clut16;
822 if (!
rect->data[1]) {
826 memcpy(
rect->data[1], clut_table, (1 << region->
depth) *
sizeof(*clut_table));
829 if (!
rect->data[0]) {
865 const uint8_t *buf,
int buf_size,
int top_bottom,
int non_mod)
870 const uint8_t *buf_end = buf + buf_size;
875 uint8_t map2to4[] = { 0x0, 0x7, 0x8, 0xf};
876 uint8_t map2to8[] = {0x00, 0x77, 0x88, 0xff};
877 uint8_t map4to8[] = {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
878 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff};
882 ff_dlog(avctx,
"DVB pixel block size %d, %s field:\n", buf_size,
883 top_bottom ?
"bottom" :
"top");
885 for (
i = 0;
i < buf_size;
i++) {
904 x_pos = display->
x_pos;
905 y_pos = display->
y_pos;
909 while (buf < buf_end) {
910 if ((*buf!=0xf0 && x_pos >= region->
width) || y_pos >= region->
height) {
917 if (region->
depth == 8)
919 else if (region->
depth == 4)
925 region->
width, &buf, buf_end - buf,
926 non_mod, map_table, x_pos);
929 if (region->
depth < 4) {
934 if (region->
depth == 8)
940 region->
width, &buf, buf_end - buf,
941 non_mod, map_table, x_pos);
944 if (region->
depth < 8) {
950 region->
width, &buf, buf_end - buf,
951 non_mod,
NULL, x_pos);
955 map2to4[0] = (*buf) >> 4;
956 map2to4[1] = (*buf++) & 0
xf;
957 map2to4[2] = (*buf) >> 4;
958 map2to4[3] = (*buf++) & 0
xf;
961 for (
i = 0;
i < 4;
i++)
965 for (
i = 0;
i < 16;
i++)
970 x_pos = display->
x_pos;
978 if (
ctx->compute_clut != -2)
983 const uint8_t *buf,
int buf_size)
987 const uint8_t *buf_end = buf + buf_size;
991 int top_field_len, bottom_field_len;
993 int coding_method, non_modifying_color;
1003 coding_method = ((*buf) >> 2) & 3;
1004 non_modifying_color = ((*buf++) >> 1) & 1;
1006 if (coding_method == 0) {
1009 bottom_field_len =
AV_RB16(buf);
1012 if (buf + top_field_len + bottom_field_len > buf_end) {
1013 av_log(avctx,
AV_LOG_ERROR,
"Field data size %d+%d too large\n", top_field_len, bottom_field_len);
1018 const uint8_t *
block = buf;
1019 int bfl = bottom_field_len;
1022 non_modifying_color);
1024 if (bottom_field_len > 0)
1025 block = buf + top_field_len;
1027 bfl = top_field_len;
1030 non_modifying_color);
1032 }
else if (coding_method == 1) {
1035 }
else if (coding_method == 2) {
1047 const uint8_t *buf,
int buf_size)
1051 const uint8_t *buf_end = buf + buf_size;
1057 int r,
g,
b, r_add, g_add, b_add;
1059 ff_dlog(avctx,
"DVB clut packet:\n");
1061 for (
i=0;
i < buf_size;
i++) {
1085 ctx->clut_list = clut;
1092 while (buf + 4 < buf_end) {
1095 depth = (*buf) & 0xe0;
1110 cr = (((buf[0] & 3) << 2) | ((buf[1] >> 6) & 3)) << 4;
1111 cb = (buf[1] << 2) & 0xf0;
1112 alpha = (buf[1] << 6) & 0xc0;
1123 ff_dlog(avctx,
"clut %d := (%d,%d,%d,%d)\n", entry_id,
r,
g,
b,
alpha);
1124 if (!!(depth & 0x80) + !!(depth & 0x40) + !!(depth & 0x20) > 1) {
1125 ff_dlog(avctx,
"More than one bit level marked: %x\n", depth);
1130 if (depth & 0x80 && entry_id < 4)
1132 else if (depth & 0x40 && entry_id < 16)
1134 else if (depth & 0x20)
1144 const uint8_t *buf,
int buf_size)
1148 const uint8_t *buf_end = buf + buf_size;
1149 int region_id, object_id;
1169 region->
id = region_id;
1172 region->
next =
ctx->region_list;
1173 ctx->region_list = region;
1177 fill = ((*buf++) >> 3) & 1;
1185 if (
ret >= 0 && region->
width * region->
height * 2 > 320 * 1024 * 8) {
1200 if (!region->
pbuf) {
1211 region->
depth = 1 << (((*buf++) >> 2) & 7);
1212 if (region->
depth < 2 || region->
depth > 8) {
1216 region->
clut = *buf++;
1218 if (region->
depth == 8) {
1224 if (region->
depth == 4)
1225 region->
bgcolor = (((*buf++) >> 4) & 15);
1227 region->
bgcolor = (((*buf++) >> 2) & 3);
1239 while (buf + 5 < buf_end) {
1250 object->id = object_id;
1251 object->next =
ctx->object_list;
1252 ctx->object_list = object;
1255 object->
type = (*buf) >> 6;
1276 if ((object->
type == 1 || object->
type == 2) && buf+1 < buf_end) {
1285 object->display_list = display;
1292 const uint8_t *buf,
int buf_size,
AVSubtitle *sub,
int *got_output)
1298 const uint8_t *buf_end = buf + buf_size;
1309 page_state = ((*buf++) >> 2) & 3;
1315 ctx->time_out = timeout;
1318 ff_dlog(avctx,
"Page time out %ds, state %d\n",
ctx->time_out, page_state);
1320 if (
ctx->compute_edt == 1)
1323 if (page_state == 1 || page_state == 2) {
1329 tmp_display_list =
ctx->display_list;
1332 while (buf + 5 < buf_end) {
1336 display =
ctx->display_list;
1337 while (display && display->
region_id != region_id) {
1338 display = display->
next;
1345 display = tmp_display_list;
1346 tmp_ptr = &tmp_display_list;
1348 while (display && display->
region_id != region_id) {
1349 tmp_ptr = &display->
next;
1350 display = display->
next;
1366 *tmp_ptr = display->
next;
1368 display->
next =
ctx->display_list;
1369 ctx->display_list = display;
1371 ff_dlog(avctx,
"Region %d, (%d,%d)\n", region_id, display->
x_pos, display->
y_pos);
1374 while (tmp_display_list) {
1375 display = tmp_display_list;
1377 tmp_display_list = display->
next;
1391 int dds_version, info_byte;
1396 info_byte = bytestream_get_byte(&buf);
1397 dds_version = info_byte >> 4;
1398 if (display_def && display_def->
version == dds_version)
1402 display_def =
av_mallocz(
sizeof(*display_def));
1405 ctx->display_definition = display_def;
1408 display_def->
version = dds_version;
1411 display_def->
width = bytestream_get_be16(&buf) + 1;
1412 display_def->
height = bytestream_get_be16(&buf) + 1;
1419 if (info_byte & 1<<3) {
1423 display_def->
x = bytestream_get_be16(&buf);
1424 display_def->
width = bytestream_get_be16(&buf) - display_def->
x + 1;
1425 display_def->
y = bytestream_get_be16(&buf);
1426 display_def->
height = bytestream_get_be16(&buf) - display_def->
y + 1;
1433 int buf_size,
AVSubtitle *sub,
int *got_output)
1437 if (
ctx->compute_edt == 0)
1443 int *got_sub_ptr,
const AVPacket *avpkt)
1445 const uint8_t *buf = avpkt->
data;
1446 int buf_size = avpkt->
size;
1448 const uint8_t *p, *p_end;
1454 int got_segment = 0;
1457 ff_dlog(avctx,
"DVB sub packet:\n");
1459 for (
i=0;
i < buf_size;
i++) {
1468 if (buf_size <= 6 || *buf != 0x0f) {
1469 ff_dlog(avctx,
"incomplete or broken packet");
1474 p_end = buf + buf_size;
1476 while (p_end - p >= 6 && *p == 0x0f) {
1478 segment_type = *p++;
1485 av_log(avctx,
AV_LOG_DEBUG,
"segment_type:%d page_id:%d segment_length:%d\n", segment_type, page_id, segment_length);
1488 if (p_end - p < segment_length) {
1489 ff_dlog(avctx,
"incomplete or broken packet");
1494 if (page_id ==
ctx->composition_id || page_id ==
ctx->ancillary_id ||
1495 ctx->composition_id == -1 ||
ctx->ancillary_id == -1) {
1497 switch (segment_type) {
1508 if (
ret < 0)
goto end;
1522 if (got_segment == 15 && !got_dds && !avctx->
width && !avctx->
height) {
1530 ff_dlog(avctx,
"Subtitling segment type 0x%x, page id %d, length %d\n",
1531 segment_type, page_id, segment_length);
1538 p += segment_length;
1542 if (got_segment == 15) {
1551 if (
ctx->compute_edt == 1)
1558 #define DS AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_SUBTITLE_PARAM
1559 #define OFFSET(x) offsetof(DVBSubContext, x)
1561 {
"compute_edt",
"compute end of time using pts or timeout",
OFFSET(compute_edt),
AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1,
DS},
1562 {
"compute_clut",
"compute clut when not available(-1) or only once (-2) or always(1) or never(0)",
OFFSET(compute_clut),
AV_OPT_TYPE_BOOL, {.i64 = -1}, -2, 1,
DS},
#define AV_LOG_WARNING
Something somehow does not look correct.
#define DVBSUB_DISPLAY_SEGMENT
static void delete_cluts(DVBSubContext *ctx)
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
static double cb(void *priv, double x, double y)
static const AVClass dvbsubdec_class
static DVBSubRegion * get_region(DVBSubContext *ctx, int region_id)
#define AV_TIME_BASE_Q
Internal time base represented as fractional value.
static int dvbsub_parse_region_segment(AVCodecContext *avctx, const uint8_t *buf, int buf_size)
static int get_bits_count(const GetBitContext *s)
int compute_edt
if 1 end display time calculated using pts if 0 (Default) calculated using time out
static const AVOption options[]
#define DVBSUB_PAGE_SEGMENT
DVBSubObjectDisplay * display_list
#define YUV_TO_RGB1_CCIR(cb1, cr1)
static void delete_objects(DVBSubContext *ctx)
int ff_set_dimensions(AVCodecContext *s, int width, int height)
Check that the provided frame dimensions are valid and set them on the codec context.
DVBSubRegionDisplay * display_list
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
void * av_memdup(const void *p, size_t size)
Duplicate a buffer with av_malloc().
static void compute_default_clut(DVBSubContext *ctx, uint8_t *clut, AVSubtitleRect *rect, int w, int h)
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
AVCodec p
The public AVCodec.
static DVBSubObject * get_object(DVBSubContext *ctx, int object_id)
int av_image_check_size2(unsigned int w, unsigned int h, int64_t max_pixels, enum AVPixelFormat pix_fmt, int log_offset, void *log_ctx)
Check if the given dimension of an image is valid, meaning that all bytes of a plane of an image with...
@ AV_CODEC_ID_DVB_SUBTITLE
DVBSubRegion * region_list
static int ff_thread_once(char *control, void(*routine)(void))
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static int dvbsub_decode(AVCodecContext *avctx, AVSubtitle *sub, int *got_sub_ptr, const AVPacket *avpkt)
#define DVBSUB_DISPLAYDEFINITION_SEGMENT
DVBSubObjectDisplay * display_list
#define av_assert0(cond)
assert() equivalent, that is always enabled.
struct DVBSubObjectDisplay * region_list_next
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
int64_t pts
Same as packet pts, in AV_TIME_BASE.
#define DVBSUB_CLUT_SEGMENT
int64_t max_pixels
The number of pixels per image to maximally accept.
#define CODEC_LONG_NAME(str)
static void delete_regions(DVBSubContext *ctx)
#define DVBSUB_OBJECT_SEGMENT
static int save_subtitle_set(AVCodecContext *avctx, AVSubtitle *sub, int *got_output)
#define LIBAVUTIL_VERSION_INT
Describe the class of an AVClass context structure.
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
static int dvbsub_parse_display_definition_segment(AVCodecContext *avctx, const uint8_t *buf, int buf_size)
static av_cold int dvbsub_close_decoder(AVCodecContext *avctx)
Rational number (pair of numerator and denominator).
static int dvbsub_parse_clut_segment(AVCodecContext *avctx, const uint8_t *buf, int buf_size)
const char * av_default_item_name(void *ptr)
Return the context name.
static unsigned int get_bits1(GetBitContext *s)
static void dvbsub_parse_pixel_data_block(AVCodecContext *avctx, DVBSubObjectDisplay *display, const uint8_t *buf, int buf_size, int top_bottom, int non_mod)
#define DVBSUB_REGION_SEGMENT
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining list
#define YUV_TO_RGB2_CCIR(r, g, b, y1)
static int dvbsub_parse_object_segment(AVCodecContext *avctx, const uint8_t *buf, int buf_size)
static int dvbsub_read_2bit_string(AVCodecContext *avctx, uint8_t *destbuf, int dbuf_len, const uint8_t **srcbuf, int buf_size, int non_mod, uint8_t *map_table, int x_pos)
struct DVBSubRegion * next
static int dvbsub_display_end_segment(AVCodecContext *avctx, const uint8_t *buf, int buf_size, AVSubtitle *sub, int *got_output)
const FFCodec ff_dvbsub_decoder
int(* init)(AVBSFContext *ctx)
static av_cold void init_default_clut(void)
#define AV_NOPTS_VALUE
Undefined timestamp value.
void avpriv_report_missing_feature(void *avc, const char *msg,...) av_printf_format(2
Log a generic warning message about a missing feature.
DVBSubDisplayDefinition * display_definition
uint32_t end_display_time
static DVBSubCLUT * get_clut(DVBSubContext *ctx, int clut_id)
#define FF_COMPLIANCE_NORMAL
The reader does not expect b to be semantically here and if the code is changed by maybe adding a a division or other the signedness will almost certainly be mistaken To avoid this confusion a new type was SUINT is the C unsigned type but it holds a signed int to use the same example SUINT a
static void delete_region_display_list(DVBSubContext *ctx, DVBSubRegion *region)
@ SUBTITLE_BITMAP
A bitmap, pict will be set.
#define AV_LOG_INFO
Standard information.
#define i(width, name, range_min, range_max)
struct DVBSubObject * next
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
#define xf(width, name, var, range_min, range_max, subs,...)
#define FF_DEBUG_STARTCODE
static av_cold int dvbsub_init_decoder(AVCodecContext *avctx)
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
const char * name
Name of the codec implementation.
void * av_calloc(size_t nmemb, size_t size)
@ AV_PIX_FMT_PAL8
8 bits with AV_PIX_FMT_RGB32 palette
#define FFSWAP(type, a, b)
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
int strict_std_compliance
strictly follow the standard (MPEG-4, ...).
uint8_t computed_clut[4 *256]
main external API structure.
@ AV_OPT_TYPE_INT
Underlying C type is int.
static DVBSubCLUT default_clut
#define FF_CODEC_DECODE_SUB_CB(func)
int clut_count2[257][256]
#define avpriv_request_sample(...)
struct DVBSubObjectDisplay * object_list_next
static const int16_t alpha[]
DVBSubObject * object_list
This structure stores compressed data.
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
static double cr(void *priv, double x, double y)
static int dvbsub_read_8bit_string(AVCodecContext *avctx, uint8_t *destbuf, int dbuf_len, const uint8_t **srcbuf, int buf_size, int non_mod, uint8_t *map_table, int x_pos)
static int dvbsub_read_4bit_string(AVCodecContext *avctx, uint8_t *destbuf, int dbuf_len, const uint8_t **srcbuf, int buf_size, int non_mod, uint8_t *map_table, int x_pos)
int width
picture width / height.
The exact code depends on how similar the blocks are and how related they are to the block
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
static int dvbsub_parse_page_segment(AVCodecContext *avctx, const uint8_t *buf, int buf_size, AVSubtitle *sub, int *got_output)
struct DVBSubRegionDisplay * next
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_WB32 unsigned int_TMPL AV_WB24 unsigned int_TMPL AV_RB16