Go to the documentation of this file.
32 #define DVBSUB_PAGE_SEGMENT 0x10
33 #define DVBSUB_REGION_SEGMENT 0x11
34 #define DVBSUB_CLUT_SEGMENT 0x12
35 #define DVBSUB_OBJECT_SEGMENT 0x13
36 #define DVBSUB_DISPLAYDEFINITION_SEGMENT 0x14
37 #define DVBSUB_DISPLAY_SEGMENT 0x80
39 #define cm (ff_crop_tab + MAX_NEG_CROP)
41 #define RGBA(r,g,b,a) (((unsigned)(a) << 24) | ((r) << 16) | ((g) << 8) | (b))
148 while (ptr && ptr->
id != object_id) {
159 while (ptr && ptr->
id != clut_id) {
170 while (ptr && ptr->
id != region_id) {
188 obj_disp_ptr = &
object->display_list;
189 obj_disp = *obj_disp_ptr;
191 while (obj_disp && obj_disp != display) {
193 obj_disp = *obj_disp_ptr;
200 obj2_ptr = &
ctx->object_list;
203 while (obj2 !=
object) {
205 obj2_ptr = &obj2->
next;
209 *obj2_ptr = obj2->
next;
225 while (
ctx->clut_list) {
236 while (
ctx->object_list) {
239 ctx->object_list =
object->next;
247 while (
ctx->region_list) {
250 ctx->region_list = region->
next;
261 int i,
r,
g,
b,
a = 0;
272 for (
i = 1;
i < 16;
i++) {
274 r = (
i & 1) ? 255 : 0;
275 g = (
i & 2) ? 255 : 0;
276 b = (
i & 4) ? 255 : 0;
278 r = (
i & 1) ? 127 : 0;
279 g = (
i & 2) ? 127 : 0;
280 b = (
i & 4) ? 127 : 0;
286 for (
i = 1;
i < 256;
i++) {
288 r = (
i & 1) ? 255 : 0;
289 g = (
i & 2) ? 255 : 0;
290 b = (
i & 4) ? 255 : 0;
295 r = ((
i & 1) ? 85 : 0) + ((
i & 0x10) ? 170 : 0);
296 g = ((
i & 2) ? 85 : 0) + ((
i & 0x20) ? 170 : 0);
297 b = ((
i & 4) ? 85 : 0) + ((
i & 0x40) ? 170 : 0);
301 r = ((
i & 1) ? 85 : 0) + ((
i & 0x10) ? 170 : 0);
302 g = ((
i & 2) ? 85 : 0) + ((
i & 0x20) ? 170 : 0);
303 b = ((
i & 4) ? 85 : 0) + ((
i & 0x40) ? 170 : 0);
307 r = 127 + ((
i & 1) ? 43 : 0) + ((
i & 0x10) ? 85 : 0);
308 g = 127 + ((
i & 2) ? 43 : 0) + ((
i & 0x20) ? 85 : 0);
309 b = 127 + ((
i & 4) ? 43 : 0) + ((
i & 0x40) ? 85 : 0);
313 r = ((
i & 1) ? 43 : 0) + ((
i & 0x10) ? 85 : 0);
314 g = ((
i & 2) ? 43 : 0) + ((
i & 0x20) ? 85 : 0);
315 b = ((
i & 4) ? 43 : 0) + ((
i & 0x40) ? 85 : 0);
329 if (
ctx->substream < 0) {
330 ctx->composition_id = -1;
331 ctx->ancillary_id = -1;
334 ctx->composition_id = -1;
335 ctx->ancillary_id = -1;
368 while (
ctx->display_list) {
369 display =
ctx->display_list;
370 ctx->display_list = display->
next;
379 uint8_t *destbuf,
int dbuf_len,
380 const uint8_t **srcbuf,
int buf_size,
381 int non_mod, uint8_t *map_table,
int x_pos)
387 int pixels_read = x_pos;
393 while (
get_bits_count(&gb) < buf_size << 3 && pixels_read < dbuf_len) {
397 if (non_mod != 1 ||
bits != 1) {
399 *destbuf++ = map_table[
bits];
410 if (non_mod == 1 &&
bits == 1)
411 pixels_read += run_length;
415 while (run_length-- > 0 && pixels_read < dbuf_len) {
428 if (non_mod == 1 &&
bits == 1)
429 pixels_read += run_length;
433 while (run_length-- > 0 && pixels_read < dbuf_len) {
438 }
else if (
bits == 3) {
442 if (non_mod == 1 &&
bits == 1)
443 pixels_read += run_length;
447 while (run_length-- > 0 && pixels_read < dbuf_len) {
452 }
else if (
bits == 1) {
458 while (run_length-- > 0 && pixels_read < dbuf_len) {
487 const uint8_t **srcbuf,
int buf_size,
488 int non_mod, uint8_t *map_table,
int x_pos)
494 int pixels_read = x_pos;
500 while (
get_bits_count(&gb) < buf_size << 3 && pixels_read < dbuf_len) {
504 if (non_mod != 1 ||
bits != 1) {
506 *destbuf++ = map_table[
bits];
516 if (run_length == 0) {
528 while (run_length-- > 0 && pixels_read < dbuf_len) {
538 if (non_mod == 1 &&
bits == 1)
539 pixels_read += run_length;
543 while (run_length-- > 0 && pixels_read < dbuf_len) {
554 if (non_mod == 1 &&
bits == 1)
555 pixels_read += run_length;
559 while (run_length-- > 0 && pixels_read < dbuf_len) {
564 }
else if (
bits == 3) {
568 if (non_mod == 1 &&
bits == 1)
569 pixels_read += run_length;
573 while (run_length-- > 0 && pixels_read < dbuf_len) {
578 }
else if (
bits == 1) {
584 while (run_length-- > 0 && pixels_read < dbuf_len) {
610 uint8_t *destbuf,
int dbuf_len,
611 const uint8_t **srcbuf,
int buf_size,
612 int non_mod, uint8_t *map_table,
int x_pos)
614 const uint8_t *sbuf_end = (*srcbuf) + buf_size;
617 int pixels_read = x_pos;
621 while (*srcbuf < sbuf_end && pixels_read < dbuf_len) {
625 if (non_mod != 1 ||
bits != 1) {
627 *destbuf++ = map_table[
bits];
634 run_length =
bits & 0x7f;
635 if ((
bits & 0x80) == 0) {
636 if (run_length == 0) {
644 if (non_mod == 1 &&
bits == 1)
645 pixels_read += run_length;
649 while (run_length-- > 0 && pixels_read < dbuf_len) {
665 uint8_t
list[256] = {0};
666 uint8_t list_inv[256];
667 int counttab[256] = {0};
668 int (*counttab2)[256] =
ctx->clut_count2;
672 memset(
ctx->clut_count2, 0 ,
sizeof(
ctx->clut_count2));
674 #define V(x,y) rect->data[0][(x) + (y)*stride]
675 for (y = 0; y<
h; y++) {
676 for (x = 0; x<
w; x++) {
678 int vl = x ?
V(x-1,y) + 1 : 0;
679 int vr = x+1<
w ?
V(x+1,y) + 1 : 0;
680 int vt = y ?
V(x,y-1) + 1 : 0;
681 int vb = y+1<
h ?
V(x,y+1) + 1 : 0;
682 counttab[v-1] += !!((v!=vl) + (v!=vr) + (v!=vt) + (v!=vb));
683 counttab2[vl][v-1] ++;
684 counttab2[vr][v-1] ++;
685 counttab2[vt][v-1] ++;
686 counttab2[vb][v-1] ++;
689 #define L(x,y) list[d[(x) + (y)*stride]]
691 for (
i = 0;
i<256;
i++) {
692 counttab2[
i+1][
i] = 0;
694 for (
i = 0;
i<256;
i++) {
698 for (x = 0; x < 256; x++) {
702 scorev += counttab2[0][x];
703 for (y = 0; y < 256; y++) {
704 scorev +=
list[y] * counttab2[y+1][x];
708 int score = 1024LL*scorev / counttab[x];
709 if (score > bestscore) {
718 list_inv[
i ] = bestv;
722 for (
i--;
i >= 0;
i--) {
723 int v =
i * 255 / count;
737 const uint32_t *clut_table;
739 int offset_x=0, offset_y=0;
744 offset_x = display_def->
x;
745 offset_y = display_def->
y;
749 if (
sub->num_rects) {
753 for (display =
ctx->display_list; display; display = display->
next) {
755 if (region && region->
dirty)
759 if (
ctx->compute_edt == 0) {
760 sub->end_display_time =
ctx->time_out * 1000;
766 if (
sub->num_rects > 0) {
774 for (
i = 0;
i <
sub->num_rects;
i++) {
776 if (!
sub->rects[
i]) {
784 for (display =
ctx->display_list; display; display = display->
next) {
807 switch (region->
depth) {
809 clut_table = clut->
clut4;
816 clut_table = clut->
clut16;
821 if (!
rect->data[1]) {
825 memcpy(
rect->data[1], clut_table, (1 << region->
depth) *
sizeof(*clut_table));
828 if (!
rect->data[0]) {
849 for (
i=0;
i <
sub->num_rects;
i++) {
864 const uint8_t *buf,
int buf_size,
int top_bottom,
int non_mod)
869 const uint8_t *buf_end = buf + buf_size;
874 uint8_t map2to4[] = { 0x0, 0x7, 0x8, 0xf};
875 uint8_t map2to8[] = {0x00, 0x77, 0x88, 0xff};
876 uint8_t map4to8[] = {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
877 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff};
881 ff_dlog(avctx,
"DVB pixel block size %d, %s field:\n", buf_size,
882 top_bottom ?
"bottom" :
"top");
884 for (
i = 0;
i < buf_size;
i++) {
903 x_pos = display->
x_pos;
904 y_pos = display->
y_pos;
908 while (buf < buf_end) {
909 if ((*buf!=0xf0 && x_pos >= region->
width) || y_pos >= region->
height) {
916 if (region->
depth == 8)
918 else if (region->
depth == 4)
924 region->
width, &buf, buf_end - buf,
925 non_mod, map_table, x_pos);
928 if (region->
depth < 4) {
933 if (region->
depth == 8)
939 region->
width, &buf, buf_end - buf,
940 non_mod, map_table, x_pos);
943 if (region->
depth < 8) {
949 region->
width, &buf, buf_end - buf,
950 non_mod,
NULL, x_pos);
954 map2to4[0] = (*buf) >> 4;
955 map2to4[1] = (*buf++) & 0
xf;
956 map2to4[2] = (*buf) >> 4;
957 map2to4[3] = (*buf++) & 0
xf;
960 for (
i = 0;
i < 4;
i++)
964 for (
i = 0;
i < 16;
i++)
969 x_pos = display->
x_pos;
977 if (
ctx->compute_clut != -2)
982 const uint8_t *buf,
int buf_size)
986 const uint8_t *buf_end = buf + buf_size;
990 int top_field_len, bottom_field_len;
992 int coding_method, non_modifying_color;
1002 coding_method = ((*buf) >> 2) & 3;
1003 non_modifying_color = ((*buf++) >> 1) & 1;
1005 if (coding_method == 0) {
1008 bottom_field_len =
AV_RB16(buf);
1011 if (buf + top_field_len + bottom_field_len > buf_end) {
1012 av_log(avctx,
AV_LOG_ERROR,
"Field data size %d+%d too large\n", top_field_len, bottom_field_len);
1017 const uint8_t *
block = buf;
1018 int bfl = bottom_field_len;
1021 non_modifying_color);
1023 if (bottom_field_len > 0)
1024 block = buf + top_field_len;
1026 bfl = top_field_len;
1029 non_modifying_color);
1031 }
else if (coding_method == 1) {
1034 }
else if (coding_method == 2) {
1046 const uint8_t *buf,
int buf_size)
1050 const uint8_t *buf_end = buf + buf_size;
1056 int r,
g,
b, r_add, g_add, b_add;
1058 ff_dlog(avctx,
"DVB clut packet:\n");
1060 for (
i=0;
i < buf_size;
i++) {
1084 ctx->clut_list = clut;
1091 while (buf + 4 < buf_end) {
1094 depth = (*buf) & 0xe0;
1109 cr = (((buf[0] & 3) << 2) | ((buf[1] >> 6) & 3)) << 4;
1110 cb = (buf[1] << 2) & 0xf0;
1111 alpha = (buf[1] << 6) & 0xc0;
1122 ff_dlog(avctx,
"clut %d := (%d,%d,%d,%d)\n", entry_id,
r,
g,
b,
alpha);
1123 if (!!(depth & 0x80) + !!(depth & 0x40) + !!(depth & 0x20) > 1) {
1124 ff_dlog(avctx,
"More than one bit level marked: %x\n", depth);
1129 if (depth & 0x80 && entry_id < 4)
1131 else if (depth & 0x40 && entry_id < 16)
1133 else if (depth & 0x20)
1143 const uint8_t *buf,
int buf_size)
1147 const uint8_t *buf_end = buf + buf_size;
1148 int region_id, object_id;
1168 region->
id = region_id;
1171 region->
next =
ctx->region_list;
1172 ctx->region_list = region;
1176 fill = ((*buf++) >> 3) & 1;
1184 if (
ret >= 0 && region->
width * region->
height * 2 > 320 * 1024 * 8) {
1199 if (!region->
pbuf) {
1210 region->
depth = 1 << (((*buf++) >> 2) & 7);
1211 if (region->
depth < 2 || region->
depth > 8) {
1215 region->
clut = *buf++;
1217 if (region->
depth == 8) {
1223 if (region->
depth == 4)
1224 region->
bgcolor = (((*buf++) >> 4) & 15);
1226 region->
bgcolor = (((*buf++) >> 2) & 3);
1238 while (buf + 5 < buf_end) {
1249 object->id = object_id;
1250 object->next =
ctx->object_list;
1251 ctx->object_list = object;
1254 object->
type = (*buf) >> 6;
1275 if ((object->
type == 1 || object->
type == 2) && buf+1 < buf_end) {
1284 object->display_list = display;
1291 const uint8_t *buf,
int buf_size,
AVSubtitle *
sub,
int *got_output)
1297 const uint8_t *buf_end = buf + buf_size;
1308 page_state = ((*buf++) >> 2) & 3;
1314 ctx->time_out = timeout;
1317 ff_dlog(avctx,
"Page time out %ds, state %d\n",
ctx->time_out, page_state);
1319 if (
ctx->compute_edt == 1)
1322 if (page_state == 1 || page_state == 2) {
1328 tmp_display_list =
ctx->display_list;
1331 while (buf + 5 < buf_end) {
1335 display =
ctx->display_list;
1336 while (display && display->
region_id != region_id) {
1337 display = display->
next;
1344 display = tmp_display_list;
1345 tmp_ptr = &tmp_display_list;
1347 while (display && display->
region_id != region_id) {
1348 tmp_ptr = &display->
next;
1349 display = display->
next;
1365 *tmp_ptr = display->
next;
1367 display->
next =
ctx->display_list;
1368 ctx->display_list = display;
1370 ff_dlog(avctx,
"Region %d, (%d,%d)\n", region_id, display->
x_pos, display->
y_pos);
1373 while (tmp_display_list) {
1374 display = tmp_display_list;
1376 tmp_display_list = display->
next;
1390 int dds_version, info_byte;
1395 info_byte = bytestream_get_byte(&buf);
1396 dds_version = info_byte >> 4;
1397 if (display_def && display_def->
version == dds_version)
1401 display_def =
av_mallocz(
sizeof(*display_def));
1404 ctx->display_definition = display_def;
1407 display_def->
version = dds_version;
1410 display_def->
width = bytestream_get_be16(&buf) + 1;
1411 display_def->
height = bytestream_get_be16(&buf) + 1;
1418 if (info_byte & 1<<3) {
1422 display_def->
x = bytestream_get_be16(&buf);
1423 display_def->
width = bytestream_get_be16(&buf) - display_def->
x + 1;
1424 display_def->
y = bytestream_get_be16(&buf);
1425 display_def->
height = bytestream_get_be16(&buf) - display_def->
y + 1;
1436 if (
ctx->compute_edt == 0)
1442 int *got_sub_ptr,
const AVPacket *avpkt)
1444 const uint8_t *buf = avpkt->
data;
1445 int buf_size = avpkt->
size;
1447 const uint8_t *p, *p_end;
1453 int got_segment = 0;
1456 ff_dlog(avctx,
"DVB sub packet:\n");
1458 for (
i=0;
i < buf_size;
i++) {
1467 if (buf_size <= 6 || *buf != 0x0f) {
1468 ff_dlog(avctx,
"incomplete or broken packet");
1473 p_end = buf + buf_size;
1475 while (p_end - p >= 6 && *p == 0x0f) {
1477 segment_type = *p++;
1484 av_log(avctx,
AV_LOG_DEBUG,
"segment_type:%d page_id:%d segment_length:%d\n", segment_type, page_id, segment_length);
1487 if (p_end - p < segment_length) {
1488 ff_dlog(avctx,
"incomplete or broken packet");
1493 if (page_id ==
ctx->composition_id || page_id ==
ctx->ancillary_id ||
1494 ctx->composition_id == -1 ||
ctx->ancillary_id == -1) {
1496 switch (segment_type) {
1507 if (
ret < 0)
goto end;
1521 if (got_segment == 15 && !got_dds && !avctx->
width && !avctx->
height) {
1529 ff_dlog(avctx,
"Subtitling segment type 0x%x, page id %d, length %d\n",
1530 segment_type, page_id, segment_length);
1537 p += segment_length;
1541 if (got_segment == 15) {
1550 if (
ctx->compute_edt == 1)
1557 #define DS AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_SUBTITLE_PARAM
1558 #define OFFSET(x) offsetof(DVBSubContext, x)
1560 {
"compute_edt",
"compute end of time using pts or timeout",
OFFSET(compute_edt),
AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1,
DS},
1561 {
"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 float sub(float src0, float src1)
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)
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.
#define DVBSUB_CLUT_SEGMENT
int64_t max_pixels
The number of pixels per image to maximally accept.
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
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
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
static DVBSubCLUT * get_clut(DVBSubContext *ctx, int clut_id)
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
#define FF_COMPLIANCE_NORMAL
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
#define FF_CODEC_CAP_INIT_THREADSAFE
The codec does not modify any global variables in the init function, allowing to call the init functi...
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.
static DVBSubCLUT default_clut
#define FF_CODEC_DECODE_SUB_CB(func)
int clut_count2[257][256]
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.
#define avpriv_request_sample(...)
struct DVBSubObjectDisplay * object_list_next
static const int16_t alpha[]
DVBSubObject * object_list
This structure stores compressed data.
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