@@ -1690,7 +1690,7 @@ static int h264_slice_header_parse(const H264Context *h, H264SliceContext *sl,
unsigned int slice_type, tmp, i;
int field_pic_flag, bottom_field_flag;
int first_slice = sl == h->slice_ctx && !h->current_slice;
- int picture_structure;
+ int picture_structure, pos;
if (first_slice)
av_assert0(!h->setup_finished);
@@ -1781,6 +1781,7 @@ static int h264_slice_header_parse(const H264Context *h, H264SliceContext *sl,
sl->poc_lsb = 0;
sl->delta_poc_bottom = 0;
+ pos = get_bits_left(&sl->gb);
if (sps->poc_type == 0) {
sl->poc_lsb = get_bits(&sl->gb, sps->log2_max_poc_lsb);
@@ -1795,6 +1796,7 @@ static int h264_slice_header_parse(const H264Context *h, H264SliceContext *sl,
if (pps->pic_order_present == 1 && picture_structure == PICT_FRAME)
sl->delta_poc[1] = get_se_golomb(&sl->gb);
}
+ sl->pic_order_cnt_bit_size = pos - get_bits_left(&sl->gb);
sl->redundant_pic_count = 0;
if (pps->redundant_pic_cnt_present)
@@ -1834,9 +1836,11 @@ static int h264_slice_header_parse(const H264Context *h, H264SliceContext *sl,
sl->explicit_ref_marking = 0;
if (nal->ref_idc) {
+ pos = get_bits_left(&sl->gb);
ret = ff_h264_decode_ref_pic_marking(sl, &sl->gb, nal, h->avctx);
if (ret < 0 && (h->avctx->err_recognition & AV_EF_EXPLODE))
return AVERROR_INVALIDDATA;
+ sl->ref_pic_marking_bit_size = pos - get_bits_left(&sl->gb);
}
if (sl->slice_type_nos != AV_PICTURE_TYPE_I && pps->cabac) {
@@ -324,6 +324,7 @@ typedef struct H264SliceContext {
MMCO mmco[H264_MAX_MMCO_COUNT];
int nb_mmco;
int explicit_ref_marking;
+ int ref_pic_marking_bit_size;
int frame_num;
int idr_pic_id;
@@ -332,6 +333,7 @@ typedef struct H264SliceContext {
int delta_poc[2];
int curr_pic_num;
int max_pic_num;
+ int pic_order_cnt_bit_size;
} H264SliceContext;
/**