avcodec/mpeg4videodec: Set [yd]c_scale_table during init

It does not change lateron.
(If we were to add short header support later, it would involve
a branch in mpeg4_decode_block() anyway and we would then
hardcode the dc_scaler value of eight there; the *_scale_tables
would stay the same.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt
2025-04-30 12:11:31 +02:00
parent 476c70164e
commit ca36689b39

View File

@ -1344,6 +1344,7 @@ static inline int mpeg4_decode_block(Mpeg4DecContext *ctx, int16_t *block,
// Note intra & rvlc should be optimized away if this is inlined
if (intra) {
// FIXME add short header support
if (use_intra_dc_vlc) {
/* DC coef */
if (s->partitioned_frame) {
@ -3407,10 +3408,6 @@ end:
s->picture_number++; // better than pic number==0 always ;)
// FIXME add short header support
s->y_dc_scale_table = ff_mpeg4_y_dc_scale_table;
s->c_dc_scale_table = ff_mpeg4_c_dc_scale_table;
if (s->workaround_bugs & FF_BUG_EDGE) {
s->h_edge_pos = s->width;
s->v_edge_pos = s->height;
@ -3884,6 +3881,9 @@ static av_cold int decode_init(AVCodecContext *avctx)
// so we can already set dct_unquantize_inter here once and for all.
s->dct_unquantize_inter = unquant_dsp_ctx.dct_unquantize_mpeg2_inter;
s->y_dc_scale_table = ff_mpeg4_y_dc_scale_table;
s->c_dc_scale_table = ff_mpeg4_c_dc_scale_table;
s->h263_pred = 1;
s->low_delay = 0; /* default, might be overridden in the vol header during header parsing */
s->decode_mb = mpeg4_decode_mb;