#include "avcodec.h"#include "dsputil.h"#include "bitstream.h"

Go to the source code of this file.
Data Structures | |
| struct | DVBSubCLUT |
| struct | DVBSubObjectDisplay |
| struct | DVBSubObject |
| struct | DVBSubRegionDisplay |
| struct | DVBSubRegion |
| struct | DVBSubContext |
| struct | DVBSubParseContext |
Defines | |
| #define | DVBSUB_PAGE_SEGMENT 0x10 |
| #define | DVBSUB_REGION_SEGMENT 0x11 |
| #define | DVBSUB_CLUT_SEGMENT 0x12 |
| #define | DVBSUB_OBJECT_SEGMENT 0x13 |
| #define | DVBSUB_DISPLAY_SEGMENT 0x80 |
| #define | RGBA(r, g, b, a) (((a) << 24) | ((r) << 16) | ((g) << 8) | (b)) |
| #define | SCALEBITS 10 |
| #define | ONE_HALF (1 << (SCALEBITS - 1)) |
| #define | FIX(x) ((int) ((x) * (1<<SCALEBITS) + 0.5)) |
| #define | YUV_TO_RGB1_CCIR(cb1, cr1) |
| #define | YUV_TO_RGB2_CCIR(r, g, b, y1) |
| #define | PARSE_BUF_SIZE (65536) |
Functions | |
| static DVBSubObject * | get_object (DVBSubContext *ctx, int object_id) |
| static DVBSubCLUT * | get_clut (DVBSubContext *ctx, int clut_id) |
| static DVBSubRegion * | get_region (DVBSubContext *ctx, int region_id) |
| static void | delete_region_display_list (DVBSubContext *ctx, DVBSubRegion *region) |
| static void | delete_state (DVBSubContext *ctx) |
| static int | dvbsub_init_decoder (AVCodecContext *avctx) |
| static int | dvbsub_close_decoder (AVCodecContext *avctx) |
| static int | dvbsub_read_2bit_string (uint8_t *destbuf, int dbuf_len, uint8_t **srcbuf, int buf_size, int non_mod, uint8_t *map_table) |
| static int | dvbsub_read_4bit_string (uint8_t *destbuf, int dbuf_len, uint8_t **srcbuf, int buf_size, int non_mod, uint8_t *map_table) |
| static int | dvbsub_read_8bit_string (uint8_t *destbuf, int dbuf_len, uint8_t **srcbuf, int buf_size, int non_mod, uint8_t *map_table) |
| static void | dvbsub_parse_pixel_data_block (AVCodecContext *avctx, DVBSubObjectDisplay *display, uint8_t *buf, int buf_size, int top_bottom, int non_mod) |
| static void | dvbsub_parse_object_segment (AVCodecContext *avctx, uint8_t *buf, int buf_size) |
| static void | dvbsub_parse_clut_segment (AVCodecContext *avctx, uint8_t *buf, int buf_size) |
| static void | dvbsub_parse_region_segment (AVCodecContext *avctx, uint8_t *buf, int buf_size) |
| static void | dvbsub_parse_page_segment (AVCodecContext *avctx, uint8_t *buf, int buf_size) |
| static int | dvbsub_display_end_segment (AVCodecContext *avctx, uint8_t *buf, int buf_size, AVSubtitle *sub) |
| static int | dvbsub_decode (AVCodecContext *avctx, void *data, int *data_size, uint8_t *buf, int buf_size) |
| static int | dvbsub_parse_init (AVCodecParserContext *s) |
| static int | dvbsub_parse (AVCodecParserContext *s, AVCodecContext *avctx, uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size) |
| static void | dvbsub_parse_close (AVCodecParserContext *s) |
Variables | |
| static unsigned char * | cm |
| static DVBSubCLUT | default_clut |
| AVCodec | dvbsub_decoder |
| AVCodecParser | dvbsub_parser |
| #define DVBSUB_CLUT_SEGMENT 0x12 |
| #define DVBSUB_DISPLAY_SEGMENT 0x80 |
| #define DVBSUB_OBJECT_SEGMENT 0x13 |
| #define DVBSUB_PAGE_SEGMENT 0x10 |
| #define DVBSUB_REGION_SEGMENT 0x11 |
| #define FIX | ( | x | ) | ((int) ((x) * (1<<SCALEBITS) + 0.5)) |
Definition at line 899 of file dvbsubdec.c.
| #define ONE_HALF (1 << (SCALEBITS - 1)) |
Definition at line 898 of file dvbsubdec.c.
| #define PARSE_BUF_SIZE (65536) |
Definition at line 151 of file dvbsubdec.c.
Referenced by dvbsub_init_decoder(), and dvbsub_parse_clut_segment().
| #define SCALEBITS 10 |
Definition at line 897 of file dvbsubdec.c.
| #define YUV_TO_RGB1_CCIR | ( | cb1, | |||
| cr1 | ) |
Value:
{\
cb = (cb1) - 128;\
cr = (cr1) - 128;\
r_add = FIX(1.40200*255.0/224.0) * cr + ONE_HALF;\
g_add = - FIX(0.34414*255.0/224.0) * cb - FIX(0.71414*255.0/224.0) * cr + \
ONE_HALF;\
b_add = FIX(1.77200*255.0/224.0) * cb + ONE_HALF;\
}
Definition at line 901 of file dvbsubdec.c.
Referenced by dvbsub_parse_clut_segment().
| static void delete_region_display_list | ( | DVBSubContext * | ctx, | |
| DVBSubRegion * | region | |||
| ) | [static] |
Definition at line 263 of file dvbsubdec.c.
References av_free(), DVBSubObject::display_list, DVBSubRegion::display_list, get_object(), DVBSubObject::next, NULL, DVBSubObjectDisplay::object_id, DVBSubContext::object_list, DVBSubObjectDisplay::object_list_next, and DVBSubObjectDisplay::region_list_next.
Referenced by delete_state(), and dvbsub_parse_region_segment().

| static void delete_state | ( | DVBSubContext * | ctx | ) | [static] |
Definition at line 308 of file dvbsubdec.c.
References av_free(), av_log(), AV_LOG_ERROR, DVBSubContext::clut_list, delete_region_display_list(), DVBSubCLUT::next, DVBSubRegion::next, NULL, DVBSubContext::object_list, DVBSubRegion::pbuf, and DVBSubContext::region_list.
Referenced by dvbsub_close_decoder(), and dvbsub_parse_page_segment().

| static int dvbsub_close_decoder | ( | AVCodecContext * | avctx | ) | [static] |
Definition at line 415 of file dvbsubdec.c.
References av_free(), delete_state(), DVBSubContext::display_list, DVBSubRegionDisplay::next, NULL, and AVCodecContext::priv_data.

| static int dvbsub_decode | ( | AVCodecContext * | avctx, | |
| void * | data, | |||
| int * | data_size, | |||
| uint8_t * | buf, | |||
| int | buf_size | |||
| ) | [static] |
Definition at line 1370 of file dvbsubdec.c.
References DVBSubContext::ancillary_id, av_log(), AV_LOG_INFO, BE_16, DVBSubContext::composition_id, DVBSUB_CLUT_SEGMENT, dvbsub_display_end_segment(), DVBSUB_DISPLAY_SEGMENT, DVBSUB_OBJECT_SEGMENT, DVBSUB_PAGE_SEGMENT, dvbsub_parse_clut_segment(), dvbsub_parse_object_segment(), dvbsub_parse_page_segment(), dvbsub_parse_region_segment(), DVBSUB_REGION_SEGMENT, and AVCodecContext::priv_data.

| static int dvbsub_display_end_segment | ( | AVCodecContext * | avctx, | |
| uint8_t * | buf, | |||
| int | buf_size, | |||
| AVSubtitle * | sub | |||
| ) | [static] |
Definition at line 1294 of file dvbsubdec.c.
References av_malloc(), av_mallocz(), DVBSubRegion::buf_size, DVBSubRegion::clut, DVBSubCLUT::clut16, DVBSubCLUT::clut256, DVBSubCLUT::clut4, DVBSubRegion::depth, DVBSubContext::display_list, DVBSubContext::display_list_size, AVSubtitle::end_display_time, AVSubtitle::format, get_clut(), get_region(), DVBSubRegion::height, memcpy, DVBSubRegionDisplay::next, NULL, AVSubtitle::num_rects, DVBSubRegion::pbuf, AVCodecContext::priv_data, AVSubtitle::rects, DVBSubRegionDisplay::region_id, AVSubtitle::start_display_time, DVBSubContext::time_out, DVBSubRegion::width, AVSubtitleRect::x, DVBSubRegionDisplay::x_pos, and DVBSubRegionDisplay::y_pos.
Referenced by dvbsub_decode().

| static int dvbsub_init_decoder | ( | AVCodecContext * | avctx | ) | [static] |
Definition at line 340 of file dvbsubdec.c.
References a, DVBSubContext::ancillary_id, b, DVBSubCLUT::clut16, DVBSubCLUT::clut256, DVBSubCLUT::clut4, cm, DVBSubContext::composition_id, cropTbl, DVBSubCLUT::id, MAX_NEG_CROP, DVBSubCLUT::next, NULL, AVCodecContext::priv_data, r, RGBA, and AVCodecContext::sub_id.
| static int dvbsub_parse | ( | AVCodecParserContext * | s, | |
| AVCodecContext * | avctx, | |||
| uint8_t ** | poutbuf, | |||
| int * | poutbuf_size, | |||
| const uint8_t * | buf, | |||
| int | buf_size | |||
| ) | [static] |
Definition at line 1486 of file dvbsubdec.c.
References av_log(), AV_LOG_ERROR, AV_LOG_INFO, AV_NOPTS_VALUE, BE_16, AVCodecParserContext::cur_frame_pts, AVCodecParserContext::cur_frame_start_index, AVCodecParserContext::fetch_timestamp, DVBSubParseContext::in_packet, AVCodecParserContext::last_pts, memcpy, NULL, DVBSubParseContext::packet_buf, DVBSubParseContext::packet_index, DVBSubParseContext::packet_start, PARSE_BUF_SIZE, AVCodecParserContext::priv_data, and AVCodecParserContext::pts.

| static void dvbsub_parse_close | ( | AVCodecParserContext * | s | ) | [static] |
Definition at line 1621 of file dvbsubdec.c.
References av_freep(), DVBSubParseContext::packet_buf, and AVCodecParserContext::priv_data.

| static void dvbsub_parse_clut_segment | ( | AVCodecContext * | avctx, | |
| uint8_t * | buf, | |||
| int | buf_size | |||
| ) | [static] |
Definition at line 920 of file dvbsubdec.c.
References av_log(), AV_LOG_ERROR, AV_LOG_INFO, av_malloc(), b, cb, DVBSubContext::clut_list, get_clut(), memcpy, NULL, AVCodecContext::priv_data, r, RGBA, YUV_TO_RGB1_CCIR, and YUV_TO_RGB2_CCIR.
Referenced by dvbsub_decode().

| static int dvbsub_parse_init | ( | AVCodecParserContext * | s | ) | [static] |
Definition at line 1478 of file dvbsubdec.c.
References av_malloc(), DVBSubParseContext::packet_buf, PARSE_BUF_SIZE, and AVCodecParserContext::priv_data.

| static void dvbsub_parse_object_segment | ( | AVCodecContext * | avctx, | |
| uint8_t * | buf, | |||
| int | buf_size | |||
| ) | [static] |
Definition at line 838 of file dvbsubdec.c.
References av_log(), AV_LOG_ERROR, BE_16, dvbsub_parse_pixel_data_block(), get_object(), and AVCodecContext::priv_data.
Referenced by dvbsub_decode().

| static void dvbsub_parse_page_segment | ( | AVCodecContext * | avctx, | |
| uint8_t * | buf, | |||
| int | buf_size | |||
| ) | [static] |
Definition at line 1125 of file dvbsubdec.c.
References av_free(), av_log(), AV_LOG_INFO, av_mallocz(), BE_16, delete_state(), DVBSubContext::display_list, DVBSubContext::display_list_size, NULL, AVCodecContext::priv_data, and DVBSubContext::time_out.
Referenced by dvbsub_decode().

| static void dvbsub_parse_pixel_data_block | ( | AVCodecContext * | avctx, | |
| DVBSubObjectDisplay * | display, | |||
| uint8_t * | buf, | |||
| int | buf_size, | |||
| int | top_bottom, | |||
| int | non_mod | |||
| ) | [static] |
Definition at line 718 of file dvbsubdec.c.
References av_log(), AV_LOG_ERROR, AV_LOG_INFO, dvbsub_read_2bit_string(), dvbsub_read_4bit_string(), dvbsub_read_8bit_string(), get_region(), NULL, AVCodecContext::priv_data, DVBSubObjectDisplay::region_id, DVBSubObjectDisplay::x_pos, and DVBSubObjectDisplay::y_pos.
Referenced by dvbsub_parse_object_segment().

| static void dvbsub_parse_region_segment | ( | AVCodecContext * | avctx, | |
| uint8_t * | buf, | |||
| int | buf_size | |||
| ) | [static] |
Definition at line 1012 of file dvbsubdec.c.
References av_free(), av_log(), AV_LOG_INFO, av_malloc(), av_mallocz(), BE_16, delete_region_display_list(), get_object(), get_region(), NULL, DVBSubContext::object_list, AVCodecContext::priv_data, DVBSubContext::region_list, DVBSubObject::type, and DVBSubRegion::width.
Referenced by dvbsub_decode().

| static int dvbsub_read_2bit_string | ( | uint8_t * | destbuf, | |
| int | dbuf_len, | |||
| uint8_t ** | srcbuf, | |||
| int | buf_size, | |||
| int | non_mod, | |||
| uint8_t * | map_table | |||
| ) | [static] |
Definition at line 433 of file dvbsubdec.c.
References av_log(), AV_LOG_ERROR, bits, get_bits(), get_bits_count(), init_get_bits(), and NULL.
Referenced by dvbsub_parse_pixel_data_block().

| static int dvbsub_read_4bit_string | ( | uint8_t * | destbuf, | |
| int | dbuf_len, | |||
| uint8_t ** | srcbuf, | |||
| int | buf_size, | |||
| int | non_mod, | |||
| uint8_t * | map_table | |||
| ) | [static] |
Definition at line 538 of file dvbsubdec.c.
References av_log(), AV_LOG_ERROR, bits, get_bits(), get_bits_count(), init_get_bits(), and NULL.
Referenced by dvbsub_parse_pixel_data_block().

| static int dvbsub_read_8bit_string | ( | uint8_t * | destbuf, | |
| int | dbuf_len, | |||
| uint8_t ** | srcbuf, | |||
| int | buf_size, | |||
| int | non_mod, | |||
| uint8_t * | map_table | |||
| ) | [static] |
Definition at line 659 of file dvbsubdec.c.
References av_log(), AV_LOG_ERROR, bits, and NULL.
Referenced by dvbsub_parse_pixel_data_block().

| static DVBSubCLUT* get_clut | ( | DVBSubContext * | ctx, | |
| int | clut_id | |||
| ) | [static] |
Definition at line 241 of file dvbsubdec.c.
References DVBSubContext::clut_list, DVBSubCLUT::id, DVBSubCLUT::next, and NULL.
Referenced by dvbsub_display_end_segment(), and dvbsub_parse_clut_segment().
| static DVBSubObject* get_object | ( | DVBSubContext * | ctx, | |
| int | object_id | |||
| ) | [static] |
Definition at line 230 of file dvbsubdec.c.
References DVBSubObject::id, DVBSubObject::next, NULL, and DVBSubContext::object_list.
Referenced by delete_region_display_list(), dvbsub_parse_object_segment(), and dvbsub_parse_region_segment().
| static DVBSubRegion* get_region | ( | DVBSubContext * | ctx, | |
| int | region_id | |||
| ) | [static] |
Definition at line 252 of file dvbsubdec.c.
References DVBSubRegion::id, DVBSubRegion::next, NULL, and DVBSubContext::region_list.
Referenced by dvbsub_display_end_segment(), dvbsub_parse_pixel_data_block(), and dvbsub_parse_region_segment().
unsigned char* cm [static] |
Definition at line 33 of file dvbsubdec.c.
Referenced by add_pixels_clamped2_c(), add_pixels_clamped4_c(), add_pixels_clamped_c(), deinterlace_line(), deinterlace_line_inplace(), dvbsub_init_decoder(), ff_h264_idct8_add_c(), ff_idct_put_mlib(), ff_jref_idct1_add(), ff_jref_idct1_put(), h_block_filter(), idct(), idct4col(), idct4col_add(), idct_add(), idct_internal(), idct_put(), idctSparseColAdd(), idctSparseColPut(), img_convert_init(), parse_tiff_ifd(), pred16x16_plane_compat_c(), pred8x8_plane_c(), put_pixels_clamped2_c(), put_pixels_clamped4_c(), put_pixels_clamped_c(), step_two(), svq3_add_idct_c(), v_block_filter(), wmv2_mspel8_h_lowpass(), and wmv2_mspel8_v_lowpass().
DVBSubCLUT default_clut [static] |
Definition at line 163 of file dvbsubdec.c.
Initial value:
{
"dvbsub",
CODEC_TYPE_SUBTITLE,
CODEC_ID_DVB_SUBTITLE,
sizeof(DVBSubContext),
dvbsub_init_decoder,
NULL,
dvbsub_close_decoder,
dvbsub_decode,
}
Definition at line 1454 of file dvbsubdec.c.
Referenced by avcodec_register_all().
Initial value:
{
{ CODEC_ID_DVB_SUBTITLE },
sizeof(DVBSubParseContext),
dvbsub_parse_init,
dvbsub_parse,
dvbsub_parse_close,
}
Definition at line 1627 of file dvbsubdec.c.
Referenced by avcodec_register_all().
1.5.5