+ // we will overwrite it later during decoding
+ av_frame_free(&h->cur_pic.f);
+
+ ff_h264dsp_init(&h->h264dsp, 8, 1);
+ ff_h264chroma_init(&h->h264chroma, 8);
+ ff_h264qpel_init(&h->h264qpel, 8);
+ ff_h264_pred_init(&h->hpc, AV_CODEC_ID_SVQ3, 8, 1);
+ ff_videodsp_init(&h->vdsp, 8);
+
+ memset(h->pps.scaling_matrix4, 16, 6 * 16 * sizeof(uint8_t));
+ memset(h->pps.scaling_matrix8, 16, 2 * 64 * sizeof(uint8_t));
+
+ h->sps.bit_depth_luma = 8;
+ h->chroma_format_idc = 1;
+
+ ff_hpeldsp_init(&s->hdsp, avctx->flags);
+ ff_tpeldsp_init(&s->tdsp);
+
+ sl = h->slice_ctx;
+