diff mbox series

[FFmpeg-devel,42/57] avcodec/mpeg4videodec: Don't initialize unused stuff

Message ID GV1P250MB07372A46AF235B09B5A860BF8FC02@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM
State New
Headers show
Series [FFmpeg-devel,01/57] avcodec/vc1: Combine identical checks | expand

Commit Message

Andreas Rheinhardt June 12, 2024, 1:48 p.m. UTC
Only the intra scantable is used for studio profile.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/mpeg4videodec.c | 17 ++---------------
 1 file changed, 2 insertions(+), 15 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c
index f1b542cebf..18329132aa 100644
--- a/libavcodec/mpeg4videodec.c
+++ b/libavcodec/mpeg4videodec.c
@@ -3430,21 +3430,8 @@  static int decode_studio_vop_header(Mpeg4DecContext *ctx, GetBitContext *gb)
         s->q_scale_type = get_bits1(gb);
     }
 
-    if (s->alternate_scan) {
-        ff_init_scantable(s->idsp.idct_permutation, &s->inter_scantable,   ff_alternate_vertical_scan);
-        ff_init_scantable(s->idsp.idct_permutation, &s->intra_scantable,   ff_alternate_vertical_scan);
-        ff_permute_scantable(s->permutated_intra_h_scantable, ff_alternate_vertical_scan,
-                             s->idsp.idct_permutation);
-        ff_permute_scantable(s->permutated_intra_v_scantable, ff_alternate_vertical_scan,
-                             s->idsp.idct_permutation);
-    } else {
-        ff_init_scantable(s->idsp.idct_permutation, &s->inter_scantable,   ff_zigzag_direct);
-        ff_init_scantable(s->idsp.idct_permutation, &s->intra_scantable,   ff_zigzag_direct);
-        ff_permute_scantable(s->permutated_intra_h_scantable, ff_alternate_horizontal_scan,
-                             s->idsp.idct_permutation);
-        ff_permute_scantable(s->permutated_intra_v_scantable, ff_alternate_vertical_scan,
-                             s->idsp.idct_permutation);
-    }
+    ff_init_scantable(s->idsp.idct_permutation, &s->intra_scantable,
+                      s->alternate_scan ? ff_alternate_vertical_scan : ff_zigzag_direct);
 
     mpeg4_load_default_matrices(s);