diff mbox series

[FFmpeg-devel,36/57] avcodec/mpeg12dec: Don't initialize inter tables for IPU

Message ID AS8P250MB07443203E6E9139338D758668F1B2@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM
State Superseded
Headers show
Series [FFmpeg-devel,01/14] avcodec/get_buffer: Remove redundant check | expand

Commit Message

Andreas Rheinhardt April 29, 2024, 9:14 p.m. UTC
IPU is intra-only.

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

Patch

diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
index e3f2dd8af7..097e4ba19a 100644
--- a/libavcodec/mpeg12dec.c
+++ b/libavcodec/mpeg12dec.c
@@ -2751,13 +2751,8 @@  static int ipu_decode_frame(AVCodecContext *avctx, AVFrame *frame,
     m->intra_vlc_format = !!(s->flags & 0x20);
     m->alternate_scan = !!(s->flags & 0x10);
 
-    if (s->flags & 0x10) {
-        ff_init_scantable(m->idsp.idct_permutation, &m->inter_scantable, ff_alternate_vertical_scan);
-        ff_init_scantable(m->idsp.idct_permutation, &m->intra_scantable, ff_alternate_vertical_scan);
-    } else {
-        ff_init_scantable(m->idsp.idct_permutation, &m->inter_scantable, ff_zigzag_direct);
-        ff_init_scantable(m->idsp.idct_permutation, &m->intra_scantable, ff_zigzag_direct);
-    }
+    ff_init_scantable(m->idsp.idct_permutation, &m->intra_scantable,
+                      s->flags & 0x10 ? ff_alternate_vertical_scan : ff_zigzag_direct);
 
     m->last_dc[0] = m->last_dc[1] = m->last_dc[2] = 1 << (7 + (s->flags & 3));
     m->qscale = 1;
@@ -2846,13 +2841,6 @@  static av_cold int ipu_decode_init(AVCodecContext *avctx)
         m->chroma_intra_matrix[j] = v;
     }
 
-    for (int i = 0; i < 64; i++) {
-        int j = m->idsp.idct_permutation[i];
-        int v = ff_mpeg1_default_non_intra_matrix[i];
-        m->inter_matrix[j]        = v;
-        m->chroma_inter_matrix[j] = v;
-    }
-
     return 0;
 }