This avoids relying on ff_update_duplicate_context() to copy these fields to the slice contexts.
Unified · Split
| @@ -826,6 +826,11 @@ av_cold void ff_h263_encode_init(MPVMainEncContext *const m) · 825 unmodified lines | ||
| 826 | 826 | |
| 827 | 827 | s->me.mv_penalty = ff_h263_get_mv_penalty(); // FIXME exact table for MSMPEG4 & H.263+ |
| 828 | 828 | |
| 829 | + ff_h263dsp_init(&s->h263dsp); | |
| 830 | + | |
| 831 | + if (s->codec_id == AV_CODEC_ID_MPEG4) | |
| 832 | + return; | |
| 833 | + | |
| 829 | 834 | s->intra_ac_vlc_length =s->inter_ac_vlc_length = uni_h263_inter_rl_len; |
| 830 | 835 | s->intra_ac_vlc_last_length=s->inter_ac_vlc_last_length= uni_h263_inter_rl_len + 128*64; |
| 831 | 836 | if(s->h263_aic){ |
| @@ -842,8 +847,6 @@ av_cold void ff_h263_encode_init(MPVMainEncContext *const m) · 10 unmodified lines | ||
| 842 | 847 | |
| 843 | 848 | // use fcodes >1 only for MPEG-4 & H.263 & H.263+ FIXME |
| 844 | 849 | switch(s->codec_id){ |
| 845 | − case AV_CODEC_ID_MPEG4: | |
| 846 | − break; | |
| 847 | 850 | case AV_CODEC_ID_H263P: |
| 848 | 851 | if(s->umvplus) |
| 849 | 852 | m->fcode_tab = umv_fcode_tab + MAX_MV; |
| @@ -875,8 +878,6 @@ av_cold void ff_h263_encode_init(MPVMainEncContext *const m) · 25 unmodified lines | ||
| 875 | 878 | m->encode_picture_header = h263_encode_picture_header; |
| 876 | 879 | if (!s->encode_mb) |
| 877 | 880 | s->encode_mb = h263_encode_mb; |
| 878 | − | |
| 879 | − ff_h263dsp_init(&s->h263dsp); | |
| 880 | 881 | } |
| 881 | 882 | |
| 882 | 883 | void ff_h263_encode_mba(MpegEncContext *s) |
| @@ -1305,6 +1305,19 @@ static av_cold int encode_init(AVCodecContext *avctx) · 1304 unmodified lines | ||
| 1305 | 1305 | m->encode_picture_header = mpeg4_encode_picture_header; |
| 1306 | 1306 | s->encode_mb = mpeg4_encode_mb; |
| 1307 | 1307 | |
| 1308 | + m->fcode_tab = fcode_tab + MAX_MV; | |
| 1309 | + | |
| 1310 | + s->min_qcoeff = -2048; | |
| 1311 | + s->max_qcoeff = 2047; | |
| 1312 | + s->intra_ac_vlc_length = uni_mpeg4_intra_rl_len; | |
| 1313 | + s->intra_ac_vlc_last_length = uni_mpeg4_intra_rl_len + 128 * 64; | |
| 1314 | + s->inter_ac_vlc_length = uni_mpeg4_inter_rl_len; | |
| 1315 | + s->inter_ac_vlc_last_length = uni_mpeg4_inter_rl_len + 128 * 64; | |
| 1316 | + s->luma_dc_vlc_length = uni_DCtab_lum_len; | |
| 1317 | + s->ac_esc_length = 7 + 2 + 1 + 6 + 1 + 12 + 1; | |
| 1318 | + s->y_dc_scale_table = ff_mpeg4_y_dc_scale_table; | |
| 1319 | + s->c_dc_scale_table = ff_mpeg4_c_dc_scale_table; | |
| 1320 | + | |
| 1308 | 1321 | ff_qpeldsp_init(&s->qdsp); |
| 1309 | 1322 | if ((ret = ff_mpv_encode_init(avctx)) < 0) |
| 1310 | 1323 | return ret; |
| @@ -1322,19 +1335,6 @@ static av_cold int encode_init(AVCodecContext *avctx) · 11 unmodified lines | ||
| 1322 | 1335 | |
| 1323 | 1336 | m4->time_increment_bits = av_log2(avctx->time_base.den - 1) + 1; |
| 1324 | 1337 | |
| 1325 | − m->fcode_tab = fcode_tab + MAX_MV; | |
| 1326 | − | |
| 1327 | − s->min_qcoeff = -2048; | |
| 1328 | − s->max_qcoeff = 2047; | |
| 1329 | − s->intra_ac_vlc_length = uni_mpeg4_intra_rl_len; | |
| 1330 | − s->intra_ac_vlc_last_length = uni_mpeg4_intra_rl_len + 128 * 64; | |
| 1331 | − s->inter_ac_vlc_length = uni_mpeg4_inter_rl_len; | |
| 1332 | − s->inter_ac_vlc_last_length = uni_mpeg4_inter_rl_len + 128 * 64; | |
| 1333 | − s->luma_dc_vlc_length = uni_DCtab_lum_len; | |
| 1334 | − s->ac_esc_length = 7 + 2 + 1 + 6 + 1 + 12 + 1; | |
| 1335 | − s->y_dc_scale_table = ff_mpeg4_y_dc_scale_table; | |
| 1336 | − s->c_dc_scale_table = ff_mpeg4_c_dc_scale_table; | |
| 1337 | − | |
| 1338 | 1338 | if (s->avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER) { |
| 1339 | 1339 | s->avctx->extradata = av_malloc(1024); |
| 1340 | 1340 | if (!s->avctx->extradata) |