ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinha...@outlook.com> | 
Wed Apr 30 12:11:31 2025 +0200| [ca36689b39f28900692a1177d13421f3e09c4894] | 
committer: Andreas Rheinhardt

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.rheinha...@outlook.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ca36689b39f28900692a1177d13421f3e09c4894
---

 libavcodec/mpeg4videodec.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c
index e21f1d24a2..5d675d2a78 100644
--- a/libavcodec/mpeg4videodec.c
+++ b/libavcodec/mpeg4videodec.c
@@ -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;

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to