|
|
@ -429,7 +429,7 @@ static int dvbsub_close_decoder(AVCodecContext *avctx) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static int dvbsub_read_2bit_string(uint8_t *destbuf, int dbuf_len, |
|
|
|
static int dvbsub_read_2bit_string(uint8_t *destbuf, int dbuf_len, |
|
|
|
uint8_t **srcbuf, int buf_size, |
|
|
|
const uint8_t **srcbuf, int buf_size, |
|
|
|
int non_mod, uint8_t *map_table) |
|
|
|
int non_mod, uint8_t *map_table) |
|
|
|
{ |
|
|
|
{ |
|
|
|
GetBitContext gb; |
|
|
|
GetBitContext gb; |
|
|
@ -534,7 +534,7 @@ static int dvbsub_read_2bit_string(uint8_t *destbuf, int dbuf_len, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static int dvbsub_read_4bit_string(uint8_t *destbuf, int dbuf_len, |
|
|
|
static int dvbsub_read_4bit_string(uint8_t *destbuf, int dbuf_len, |
|
|
|
uint8_t **srcbuf, int buf_size, |
|
|
|
const uint8_t **srcbuf, int buf_size, |
|
|
|
int non_mod, uint8_t *map_table) |
|
|
|
int non_mod, uint8_t *map_table) |
|
|
|
{ |
|
|
|
{ |
|
|
|
GetBitContext gb; |
|
|
|
GetBitContext gb; |
|
|
@ -655,10 +655,10 @@ static int dvbsub_read_4bit_string(uint8_t *destbuf, int dbuf_len, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static int dvbsub_read_8bit_string(uint8_t *destbuf, int dbuf_len, |
|
|
|
static int dvbsub_read_8bit_string(uint8_t *destbuf, int dbuf_len, |
|
|
|
uint8_t **srcbuf, int buf_size, |
|
|
|
const uint8_t **srcbuf, int buf_size, |
|
|
|
int non_mod, uint8_t *map_table) |
|
|
|
int non_mod, uint8_t *map_table) |
|
|
|
{ |
|
|
|
{ |
|
|
|
uint8_t *sbuf_end = (*srcbuf) + buf_size; |
|
|
|
const uint8_t *sbuf_end = (*srcbuf) + buf_size; |
|
|
|
int bits; |
|
|
|
int bits; |
|
|
|
int run_length; |
|
|
|
int run_length; |
|
|
|
int pixels_read = 0; |
|
|
|
int pixels_read = 0; |
|
|
@ -714,12 +714,12 @@ static int dvbsub_read_8bit_string(uint8_t *destbuf, int dbuf_len, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void dvbsub_parse_pixel_data_block(AVCodecContext *avctx, DVBSubObjectDisplay *display, |
|
|
|
static void dvbsub_parse_pixel_data_block(AVCodecContext *avctx, DVBSubObjectDisplay *display, |
|
|
|
uint8_t *buf, int buf_size, int top_bottom, int non_mod) |
|
|
|
const uint8_t *buf, int buf_size, int top_bottom, int non_mod) |
|
|
|
{ |
|
|
|
{ |
|
|
|
DVBSubContext *ctx = (DVBSubContext*) avctx->priv_data; |
|
|
|
DVBSubContext *ctx = (DVBSubContext*) avctx->priv_data; |
|
|
|
|
|
|
|
|
|
|
|
DVBSubRegion *region = get_region(ctx, display->region_id); |
|
|
|
DVBSubRegion *region = get_region(ctx, display->region_id); |
|
|
|
uint8_t *buf_end = buf + buf_size; |
|
|
|
const uint8_t *buf_end = buf + buf_size; |
|
|
|
uint8_t *pbuf; |
|
|
|
uint8_t *pbuf; |
|
|
|
int x_pos, y_pos; |
|
|
|
int x_pos, y_pos; |
|
|
|
int i; |
|
|
|
int i; |
|
|
@ -833,12 +833,12 @@ static void dvbsub_parse_pixel_data_block(AVCodecContext *avctx, DVBSubObjectDis |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static void dvbsub_parse_object_segment(AVCodecContext *avctx, |
|
|
|
static void dvbsub_parse_object_segment(AVCodecContext *avctx, |
|
|
|
uint8_t *buf, int buf_size) |
|
|
|
const uint8_t *buf, int buf_size) |
|
|
|
{ |
|
|
|
{ |
|
|
|
DVBSubContext *ctx = (DVBSubContext*) avctx->priv_data; |
|
|
|
DVBSubContext *ctx = (DVBSubContext*) avctx->priv_data; |
|
|
|
|
|
|
|
|
|
|
|
uint8_t *buf_end = buf + buf_size; |
|
|
|
const uint8_t *buf_end = buf + buf_size; |
|
|
|
uint8_t *block; |
|
|
|
const uint8_t *block; |
|
|
|
int object_id; |
|
|
|
int object_id; |
|
|
|
DVBSubObject *object; |
|
|
|
DVBSubObject *object; |
|
|
|
DVBSubObjectDisplay *display; |
|
|
|
DVBSubObjectDisplay *display; |
|
|
@ -892,11 +892,11 @@ static void dvbsub_parse_object_segment(AVCodecContext *avctx, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static void dvbsub_parse_clut_segment(AVCodecContext *avctx, |
|
|
|
static void dvbsub_parse_clut_segment(AVCodecContext *avctx, |
|
|
|
uint8_t *buf, int buf_size) |
|
|
|
const uint8_t *buf, int buf_size) |
|
|
|
{ |
|
|
|
{ |
|
|
|
DVBSubContext *ctx = (DVBSubContext*) avctx->priv_data; |
|
|
|
DVBSubContext *ctx = (DVBSubContext*) avctx->priv_data; |
|
|
|
|
|
|
|
|
|
|
|
uint8_t *buf_end = buf + buf_size; |
|
|
|
const uint8_t *buf_end = buf + buf_size; |
|
|
|
int clut_id; |
|
|
|
int clut_id; |
|
|
|
DVBSubCLUT *clut; |
|
|
|
DVBSubCLUT *clut; |
|
|
|
int entry_id, depth , full_range; |
|
|
|
int entry_id, depth , full_range; |
|
|
@ -982,11 +982,11 @@ static void dvbsub_parse_clut_segment(AVCodecContext *avctx, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void dvbsub_parse_region_segment(AVCodecContext *avctx, |
|
|
|
static void dvbsub_parse_region_segment(AVCodecContext *avctx, |
|
|
|
uint8_t *buf, int buf_size) |
|
|
|
const uint8_t *buf, int buf_size) |
|
|
|
{ |
|
|
|
{ |
|
|
|
DVBSubContext *ctx = (DVBSubContext*) avctx->priv_data; |
|
|
|
DVBSubContext *ctx = (DVBSubContext*) avctx->priv_data; |
|
|
|
|
|
|
|
|
|
|
|
uint8_t *buf_end = buf + buf_size; |
|
|
|
const uint8_t *buf_end = buf + buf_size; |
|
|
|
int region_id, object_id; |
|
|
|
int region_id, object_id; |
|
|
|
DVBSubRegion *region; |
|
|
|
DVBSubRegion *region; |
|
|
|
DVBSubObject *object; |
|
|
|
DVBSubObject *object; |
|
|
@ -1098,13 +1098,13 @@ static void dvbsub_parse_region_segment(AVCodecContext *avctx, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static void dvbsub_parse_page_segment(AVCodecContext *avctx, |
|
|
|
static void dvbsub_parse_page_segment(AVCodecContext *avctx, |
|
|
|
uint8_t *buf, int buf_size) |
|
|
|
const uint8_t *buf, int buf_size) |
|
|
|
{ |
|
|
|
{ |
|
|
|
DVBSubContext *ctx = (DVBSubContext*) avctx->priv_data; |
|
|
|
DVBSubContext *ctx = (DVBSubContext*) avctx->priv_data; |
|
|
|
DVBSubRegionDisplay *display; |
|
|
|
DVBSubRegionDisplay *display; |
|
|
|
DVBSubRegionDisplay *tmp_display_list, **tmp_ptr; |
|
|
|
DVBSubRegionDisplay *tmp_display_list, **tmp_ptr; |
|
|
|
|
|
|
|
|
|
|
|
uint8_t *buf_end = buf + buf_size; |
|
|
|
const uint8_t *buf_end = buf + buf_size; |
|
|
|
int region_id; |
|
|
|
int region_id; |
|
|
|
int page_state; |
|
|
|
int page_state; |
|
|
|
|
|
|
|
|
|
|
@ -1265,7 +1265,7 @@ static void save_display_set(DVBSubContext *ctx) |
|
|
|
} |
|
|
|
} |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
static int dvbsub_display_end_segment(AVCodecContext *avctx, uint8_t *buf, |
|
|
|
static int dvbsub_display_end_segment(AVCodecContext *avctx, const uint8_t *buf, |
|
|
|
int buf_size, AVSubtitle *sub) |
|
|
|
int buf_size, AVSubtitle *sub) |
|
|
|
{ |
|
|
|
{ |
|
|
|
DVBSubContext *ctx = (DVBSubContext*) avctx->priv_data; |
|
|
|
DVBSubContext *ctx = (DVBSubContext*) avctx->priv_data; |
|
|
@ -1341,11 +1341,11 @@ static int dvbsub_display_end_segment(AVCodecContext *avctx, uint8_t *buf, |
|
|
|
|
|
|
|
|
|
|
|
static int dvbsub_decode(AVCodecContext *avctx, |
|
|
|
static int dvbsub_decode(AVCodecContext *avctx, |
|
|
|
void *data, int *data_size, |
|
|
|
void *data, int *data_size, |
|
|
|
uint8_t *buf, int buf_size) |
|
|
|
const uint8_t *buf, int buf_size) |
|
|
|
{ |
|
|
|
{ |
|
|
|
DVBSubContext *ctx = (DVBSubContext*) avctx->priv_data; |
|
|
|
DVBSubContext *ctx = (DVBSubContext*) avctx->priv_data; |
|
|
|
AVSubtitle *sub = (AVSubtitle*) data; |
|
|
|
AVSubtitle *sub = (AVSubtitle*) data; |
|
|
|
uint8_t *p, *p_end; |
|
|
|
const uint8_t *p, *p_end; |
|
|
|
int segment_type; |
|
|
|
int segment_type; |
|
|
|
int page_id; |
|
|
|
int page_id; |
|
|
|
int segment_length; |
|
|
|
int segment_length; |
|
|
|