aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2024-04-28 20:56:45 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2024-06-12 12:02:14 +0200
commit1f5c64cbdc9e270495850c988e901391bc63c5d0 (patch)
treeb6fcc69c91a07dcba144ae2b9d840fc273e8e363
parent9bb35cfa4d7f8f85ddd59d032a0777af2482d66f (diff)
downloadffmpeg-1f5c64cbdc9e270495850c988e901391bc63c5d0.tar.gz
avcodec/mpeg12dec: Don't initialize inter_scantable
MPEG-1/2 only needs one scantable and therefore all code already uses the intra one. So stop initializing the inter one altogether. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-rw-r--r--libavcodec/mpeg12dec.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
index 851d8d9a77..9673bde764 100644
--- a/libavcodec/mpeg12dec.c
+++ b/libavcodec/mpeg12dec.c
@@ -1256,13 +1256,10 @@ static int mpeg_decode_picture_coding_extension(Mpeg1Context *s1)
s->chroma_420_type = get_bits1(&s->gb);
s->progressive_frame = get_bits1(&s->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);
- } 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);
- }
+ // We only initialize intra_scantable, as both scantables always coincide
+ // and all code therefore only uses the intra one.
+ ff_init_scantable(s->idsp.idct_permutation, &s->intra_scantable,
+ s->alternate_scan ? ff_alternate_vertical_scan : ff_zigzag_direct);
/* composite display not parsed */
ff_dlog(s->avctx, "intra_dc_precision=%d\n", s->intra_dc_precision);