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_END_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)
617 int pixels_read = x_pos;
624 bits = bytestream2_get_byteu(gb);
627 if (non_mod != 1 ||
bits != 1) {
629 *destbuf++ = map_table[
bits];
635 bits = bytestream2_get_byte(gb);
636 run_length =
bits & 0x7f;
637 if ((
bits & 0x80) == 0) {
638 if (run_length == 0) {
645 bits = bytestream2_get_byte(gb);
647 if (non_mod == 1 &&
bits == 1)
648 pixels_read += run_length;
652 while (run_length-- > 0 && pixels_read < dbuf_len) {
660 if (bytestream2_get_byte(gb))
664 if (!bytestream2_peek_byte(gb))
665 bytestream2_get_byte(gb);
673 uint8_t
list[256] = {0};
674 uint8_t list_inv[256];
675 int counttab[256] = {0};
676 int (*counttab2)[256] =
ctx->clut_count2;
680 memset(
ctx->clut_count2, 0 ,
sizeof(
ctx->clut_count2));
682 #define V(x,y) rect->data[0][(x) + (y)*stride]
683 for (y = 0; y<
h; y++) {
684 for (x = 0; x<
w; x++) {
686 int vl = x ?
V(x-1,y) + 1 : 0;
687 int vr = x+1<
w ?
V(x+1,y) + 1 : 0;
688 int vt = y ?
V(x,y-1) + 1 : 0;
689 int vb = y+1<
h ?
V(x,y+1) + 1 : 0;
690 counttab[v-1] += !!((v!=vl) + (v!=vr) + (v!=vt) + (v!=vb));
691 counttab2[vl][v-1] ++;
692 counttab2[vr][v-1] ++;
693 counttab2[vt][v-1] ++;
694 counttab2[vb][v-1] ++;
697 #define L(x,y) list[d[(x) + (y)*stride]]
699 for (
i = 0;
i<256;
i++) {
700 counttab2[
i+1][
i] = 0;
702 for (
i = 0;
i<256;
i++) {
706 for (x = 0; x < 256; x++) {
710 scorev += counttab2[0][x];
711 for (y = 0; y < 256; y++) {
712 scorev +=
list[y] * counttab2[y+1][x];
716 int score = 1024LL*scorev / counttab[x];
717 if (score > bestscore) {
726 list_inv[
i ] = bestv;
730 for (
i--;
i >= 0;
i--) {
731 int v =
i * 255 / count;
745 const uint32_t *clut_table;
747 int offset_x=0, offset_y=0;
752 offset_x = display_def->
x;
753 offset_y = display_def->
y;
761 for (display =
ctx->display_list; display; display = display->
next) {
763 if (region && region->
dirty)
767 if (
ctx->compute_edt == 0) {
792 for (display =
ctx->display_list; display; display = display->
next) {
815 switch (region->
depth) {
817 clut_table = clut->
clut4;
824 clut_table = clut->
clut16;
829 if (!
rect->data[1]) {
833 memcpy(
rect->data[1], clut_table, (1 << region->
depth) *
sizeof(*clut_table));
836 if (!
rect->data[0]) {
872 const uint8_t *buf,
int buf_size,
int top_bottom,
int non_mod)
877 const uint8_t *buf_end = buf + buf_size;
882 uint8_t map2to4[] = { 0x0, 0x7, 0x8, 0xf};
883 uint8_t map2to8[] = {0x00, 0x77, 0x88, 0xff};
884 uint8_t map4to8[] = {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
885 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff};
889 ff_dlog(avctx,
"DVB pixel block size %d, %s field:\n", buf_size,
890 top_bottom ?
"bottom" :
"top");
892 for (
i = 0;
i < buf_size;
i++) {
911 x_pos = display->
x_pos;
912 y_pos = display->
y_pos;
916 while (buf < buf_end) {
917 if ((*buf!=0xf0 && x_pos >= region->
width) || y_pos >= region->
height) {
924 if (region->
depth == 8)
926 else if (region->
depth == 4)
932 region->
width, &buf, buf_end - buf,
933 non_mod, map_table, x_pos);
936 if (region->
depth < 4) {
941 if (region->
depth == 8)
947 region->
width, &buf, buf_end - buf,
948 non_mod, map_table, x_pos);
951 if (region->
depth < 8) {
957 region->
width, &buf, buf_end - buf,
958 non_mod,
NULL, x_pos);
962 map2to4[0] = (*buf) >> 4;
963 map2to4[1] = (*buf++) & 0
xf;
964 map2to4[2] = (*buf) >> 4;
965 map2to4[3] = (*buf++) & 0
xf;
968 for (
i = 0;
i < 4;
i++)
972 for (
i = 0;
i < 16;
i++)
977 x_pos = display->
x_pos;
985 if (
ctx->compute_clut != -2)
990 const uint8_t *buf,
int buf_size)
994 const uint8_t *buf_end = buf + buf_size;
998 int top_field_len, bottom_field_len;
1000 int coding_method, non_modifying_color;
1010 coding_method = ((*buf) >> 2) & 3;
1011 non_modifying_color = ((*buf++) >> 1) & 1;
1013 if (coding_method == 0) {
1016 bottom_field_len =
AV_RB16(buf);
1019 if (buf + top_field_len + bottom_field_len > buf_end) {
1020 av_log(avctx,
AV_LOG_ERROR,
"Field data size %d+%d too large\n", top_field_len, bottom_field_len);
1025 const uint8_t *
block = buf;
1026 int bfl = bottom_field_len;
1029 non_modifying_color);
1031 if (bottom_field_len > 0)
1032 block = buf + top_field_len;
1034 bfl = top_field_len;
1037 non_modifying_color);
1039 }
else if (coding_method == 1) {
1042 }
else if (coding_method == 2) {
1054 const uint8_t *buf,
int buf_size)
1058 const uint8_t *buf_end = buf + buf_size;
1064 int r,
g,
b, r_add, g_add, b_add;
1066 ff_dlog(avctx,
"DVB clut packet:\n");
1068 for (
i=0;
i < buf_size;
i++) {
1092 ctx->clut_list = clut;
1099 while (buf + 4 < buf_end) {
1102 depth = (*buf) & 0xe0;
1117 cr = (((buf[0] & 3) << 2) | ((buf[1] >> 6) & 3)) << 4;
1118 cb = (buf[1] << 2) & 0xf0;
1119 alpha = (buf[1] << 6) & 0xc0;
1130 ff_dlog(avctx,
"clut %d := (%d,%d,%d,%d)\n", entry_id,
r,
g,
b,
alpha);
1131 if (!!(depth & 0x80) + !!(depth & 0x40) + !!(depth & 0x20) > 1) {
1132 ff_dlog(avctx,
"More than one bit level marked: %x\n", depth);
1137 if (depth & 0x80 && entry_id < 4)
1139 else if (depth & 0x40 && entry_id < 16)
1141 else if (depth & 0x20)
1151 const uint8_t *buf,
int buf_size)
1155 const uint8_t *buf_end = buf + buf_size;
1156 int region_id, object_id;
1176 region->
id = region_id;
1179 region->
next =
ctx->region_list;
1180 ctx->region_list = region;
1184 fill = ((*buf++) >> 3) & 1;
1192 if (
ret >= 0 && region->
width * region->
height * 2 > 320 * 1024 * 8) {
1207 if (!region->
pbuf) {
1218 region->
depth = 1 << (((*buf++) >> 2) & 7);
1219 if (region->
depth < 2 || region->
depth > 8) {
1223 region->
clut = *buf++;
1225 if (region->
depth == 8) {
1231 if (region->
depth == 4)
1232 region->
bgcolor = (((*buf++) >> 4) & 15);
1234 region->
bgcolor = (((*buf++) >> 2) & 3);
1246 while (buf + 5 < buf_end) {
1257 object->id = object_id;
1258 object->next =
ctx->object_list;
1259 ctx->object_list = object;
1262 object->
type = (*buf) >> 6;
1283 if ((object->
type == 1 || object->
type == 2) && buf+1 < buf_end) {
1292 object->display_list = display;
1299 const uint8_t *buf,
int buf_size,
AVSubtitle *sub,
int *got_output)
1305 const uint8_t *buf_end = buf + buf_size;
1316 page_state = ((*buf++) >> 2) & 3;
1322 ctx->time_out = timeout;
1325 ff_dlog(avctx,
"Page time out %ds, state %d\n",
ctx->time_out, page_state);
1327 if (
ctx->compute_edt == 1)
1330 if (page_state == 1 || page_state == 2) {
1336 tmp_display_list =
ctx->display_list;
1339 while (buf + 5 < buf_end) {
1343 display =
ctx->display_list;
1344 while (display && display->
region_id != region_id) {
1345 display = display->
next;
1352 display = tmp_display_list;
1353 tmp_ptr = &tmp_display_list;
1355 while (display && display->
region_id != region_id) {
1356 tmp_ptr = &display->
next;
1357 display = display->
next;
1373 *tmp_ptr = display->
next;
1375 display->
next =
ctx->display_list;
1376 ctx->display_list = display;
1378 ff_dlog(avctx,
"Region %d, (%d,%d)\n", region_id, display->
x_pos, display->
y_pos);
1381 while (tmp_display_list) {
1382 display = tmp_display_list;
1384 tmp_display_list = display->
next;
1398 int dds_version, info_byte;
1403 info_byte = bytestream_get_byte(&buf);
1404 dds_version = info_byte >> 4;
1405 if (display_def && display_def->
version == dds_version)
1409 display_def =
av_mallocz(
sizeof(*display_def));
1412 ctx->display_definition = display_def;
1415 display_def->
version = dds_version;
1418 display_def->
width = bytestream_get_be16(&buf) + 1;
1419 display_def->
height = bytestream_get_be16(&buf) + 1;
1426 if (info_byte & 1<<3) {
1430 display_def->
x = bytestream_get_be16(&buf);
1431 display_def->
width = bytestream_get_be16(&buf) - display_def->
x + 1;
1432 display_def->
y = bytestream_get_be16(&buf);
1433 display_def->
height = bytestream_get_be16(&buf) - display_def->
y + 1;
1440 int buf_size,
AVSubtitle *sub,
int *got_output)
1444 if (
ctx->compute_edt == 0)
1450 int *got_sub_ptr,
const AVPacket *avpkt)
1452 const uint8_t *buf = avpkt->
data;
1453 int buf_size = avpkt->
size;
1455 const uint8_t *p, *p_end;
1464 int got_end_display = 0;
1465 int got_displaydef = 0;
1467 ff_dlog(avctx,
"DVB sub packet:\n");
1469 for (
i=0;
i < buf_size;
i++) {
1478 if (buf_size <= 6 || *buf != 0x0f) {
1479 ff_dlog(avctx,
"incomplete or broken packet");
1484 p_end = buf + buf_size;
1486 while (p_end - p >= 6 && *p == 0x0f) {
1488 segment_type = *p++;
1495 av_log(avctx,
AV_LOG_DEBUG,
"segment_type:%d page_id:%d segment_length:%d\n", segment_type, page_id, segment_length);
1498 if (p_end - p < segment_length) {
1499 ff_dlog(avctx,
"incomplete or broken packet");
1504 if (page_id ==
ctx->composition_id || page_id ==
ctx->ancillary_id ||
1505 ctx->composition_id == -1 ||
ctx->ancillary_id == -1) {
1507 switch (segment_type) {
1518 if (
ret < 0)
goto end;
1531 got_end_display = 1;
1534 ff_dlog(avctx,
"Subtitling segment type 0x%x, page id %d, length %d\n",
1535 segment_type, page_id, segment_length);
1542 p += segment_length;
1547 if (got_page && got_region && got_object) {
1549 if (!got_displaydef && !avctx->
width && !avctx->
height) {
1557 if (!got_end_display) {
1566 if (
ctx->compute_edt == 1)
1573 #define DS AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_SUBTITLE_PARAM
1574 #define OFFSET(x) offsetof(DVBSubContext, x)
1576 {
"compute_edt",
"compute end of time using pts or timeout",
OFFSET(compute_edt),
AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1,
DS},
1577 {
"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.
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 av_always_inline int bytestream2_get_bytes_left(const GetByteContext *g)
static double cb(void *priv, double x, double y)
#define DVBSUB_END_DISPLAY_SEGMENT
static av_always_inline int bytestream2_tell(const GetByteContext *g)
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 av_cold void close(AVCodecParserContext *s)
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
#define xf(width, name, var, range_min, range_max, subs,...)
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
Out-of-band global headers that may be used by some codecs.
#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.
static av_always_inline void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size)
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