return 0;
}
- int ff_generate_sliding_window_mmcos(const H264Context *h,
- H264SliceContext *sl)
+ static void generate_sliding_window_mmcos(H264Context *h)
{
- MMCO *mmco = sl->mmco;
- int nb_mmco = 0, i = 0;
+ MMCO *mmco = h->mmco;
+ int nb_mmco = 0;
- assert(h->long_ref_count + h->short_ref_count <= h->ps.sps->ref_frame_count);
-
if (h->short_ref_count &&
- h->long_ref_count + h->short_ref_count == h->ps.sps->ref_frame_count &&
+ h->long_ref_count + h->short_ref_count >= h->ps.sps->ref_frame_count &&
!(FIELD_PICTURE(h) && !h->first_field && h->cur_pic_ptr->reference)) {
mmco[0].opcode = MMCO_SHORT2UNUSED;
mmco[0].short_pic_num = h->short_ref[h->short_ref_count - 1]->frame_num;
}
}
- sl->nb_mmco = nb_mmco;
-
- return 0;
+ h->nb_mmco = nb_mmco;
}
- int ff_h264_execute_ref_pic_marking(H264Context *h, MMCO *mmco, int mmco_count)
+ int ff_h264_execute_ref_pic_marking(H264Context *h)
{
+ MMCO *mmco = h->mmco;
+ int mmco_count;
int i, av_uninit(j);
+ int pps_ref_count[2] = {0};
int current_ref_assigned = 0, err = 0;
H264Picture *av_uninit(pic);
(pps->weighted_bipred_idc == 1 &&
sl->slice_type_nos == AV_PICTURE_TYPE_B))
ff_h264_pred_weight_table(&sl->gb, sps, sl->ref_count,
- sl->slice_type_nos, &sl->pwt);
+ sl->slice_type_nos, &sl->pwt, h->avctx);
+ sl->explicit_ref_marking = 0;
if (h->nal_ref_idc) {
ret = ff_h264_decode_ref_pic_marking(h, sl, &sl->gb);
if (ret < 0 && (h->avctx->err_recognition & AV_EF_EXPLODE))