int poc_lsb;
int delta_poc_bottom;
int delta_poc[2];
+ int curr_pic_num;
+ int max_pic_num;
} H264SliceContext;
/**
H264POCContext poc;
- /**
- * frame_num for frames or 2 * frame_num + 1 for field pics.
- */
- int curr_pic_num;
-
- /**
- * max_frame_num or 2 * max_frame_num for field pics.
- */
- int max_pic_num;
-
H264Picture *short_ref[32];
H264Picture *long_ref[32];
H264Picture *delayed_pic[MAX_DELAYED_PIC_COUNT + 2]; // FIXME size?
h264_initialise_ref_list(h, sl);
for (list = 0; list < sl->list_count; list++) {
- int pred = h->curr_pic_num;
+ int pred = sl->curr_pic_num;
for (index = 0; index < sl->nb_ref_modifications[list]; index++) {
unsigned int modification_of_pic_nums_idc = sl->ref_modifications[list][index].op;
const unsigned int abs_diff_pic_num = val + 1;
int frame_num;
- if (abs_diff_pic_num > h->max_pic_num) {
+ if (abs_diff_pic_num > sl->max_pic_num) {
av_log(h->avctx, AV_LOG_ERROR,
"abs_diff_pic_num overflow\n");
return AVERROR_INVALIDDATA;
pred -= abs_diff_pic_num;
else
pred += abs_diff_pic_num;
- pred &= h->max_pic_num - 1;
+ pred &= sl->max_pic_num - 1;
frame_num = pic_num_extract(h, pred, &pic_structure);
mmco[i].opcode = opcode;
if (opcode == MMCO_SHORT2UNUSED || opcode == MMCO_SHORT2LONG) {
mmco[i].short_pic_num =
- (h->curr_pic_num - get_ue_golomb(gb) - 1) &
- (h->max_pic_num - 1);
+ (sl->curr_pic_num - get_ue_golomb(gb) - 1) &
+ (sl->max_pic_num - 1);
#if 0
if (mmco[i].short_pic_num >= h->short_ref_count ||
!h->short_ref[mmco[i].short_pic_num]) {
memcpy(&h->poc, &h1->poc, sizeof(h->poc));
- h->curr_pic_num = h1->curr_pic_num;
- h->max_pic_num = h1->max_pic_num;
-
memcpy(h->short_ref, h1->short_ref, sizeof(h->short_ref));
memcpy(h->long_ref, h1->long_ref, sizeof(h->long_ref));
memcpy(h->delayed_pic, h1->delayed_pic, sizeof(h->delayed_pic));
return 0;
}
-static int h264_slice_header_parse(H264Context *h, H264SliceContext *sl,
+static int h264_slice_header_parse(const H264Context *h, H264SliceContext *sl,
const H2645NAL *nal)
{
const SPS *sps;
sl->mb_field_decoding_flag = picture_structure != PICT_FRAME;
if (picture_structure == PICT_FRAME) {
- h->curr_pic_num = sl->frame_num;
- h->max_pic_num = 1 << sps->log2_max_frame_num;
+ sl->curr_pic_num = sl->frame_num;
+ sl->max_pic_num = 1 << sps->log2_max_frame_num;
} else {
- h->curr_pic_num = 2 * sl->frame_num + 1;
- h->max_pic_num = 1 << (sps->log2_max_frame_num + 1);
+ sl->curr_pic_num = 2 * sl->frame_num + 1;
+ sl->max_pic_num = 1 << (sps->log2_max_frame_num + 1);
}
if (nal->type == NAL_IDR_SLICE)