diff mbox series

[FFmpeg-devel,v2,14/24] avcodec/intrax8: Only keep what is used from ScanTable

Message ID AS8P250MB0744E7447C885B59CDACEC298F2D9@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM
State Accepted
Commit ec2b07db79dbbd58329bf5ec19ecf867b21a38b7
Headers show
Series [FFmpeg-devel,v2,01/24] configure: Add idctdsp dependency to codecs that need it | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Andreas Rheinhardt Oct. 21, 2022, 8:12 p.m. UTC
Namely ScanTable.permutated.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/intrax8.c | 15 ++++++++-------
 libavcodec/intrax8.h |  3 +--
 2 files changed, 9 insertions(+), 9 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/intrax8.c b/libavcodec/intrax8.c
index f88baf8daf..d6668338fb 100644
--- a/libavcodec/intrax8.c
+++ b/libavcodec/intrax8.c
@@ -25,6 +25,7 @@ 
 #include "libavutil/thread.h"
 #include "avcodec.h"
 #include "get_bits.h"
+#include "idctdsp.h"
 #include "msmpeg4data.h"
 #include "intrax8huf.h"
 #include "intrax8.h"
@@ -576,7 +577,7 @@  static int x8_decode_intra_mb(IntraX8Context *const w, const int chroma)
         x8_select_ac_table(w, ac_mode);
         /* scantable_selector[12] = { 0, 2, 0, 1, 1, 1, 0, 2, 2, 0, 1, 2 }; <-
          * -> 10'01' 00'10' 10'00' 01'01' 01'00' 10'00 => 0x928548 */
-        scantable = w->scantable[(0x928548 >> (2 * w->orient)) & 3].permutated;
+        scantable = w->permutated_scantable[(0x928548 >> (2 * w->orient)) & 3];
         pos       = 0;
         do {
             n++;
@@ -714,12 +715,12 @@  av_cold int ff_intrax8_common_init(AVCodecContext *avctx,
     ff_init_scantable_permutation(w->idct_permutation,
                                   w->wdsp.idct_perm);
 
-    ff_init_scantable(w->idct_permutation, &w->scantable[0],
-                      ff_wmv1_scantable[0]);
-    ff_init_scantable(w->idct_permutation, &w->scantable[1],
-                      ff_wmv1_scantable[2]);
-    ff_init_scantable(w->idct_permutation, &w->scantable[2],
-                      ff_wmv1_scantable[3]);
+    ff_permute_scantable(w->permutated_scantable[0], ff_wmv1_scantable[0],
+                         w->idct_permutation);
+    ff_permute_scantable(w->permutated_scantable[1], ff_wmv1_scantable[2],
+                         w->idct_permutation);
+    ff_permute_scantable(w->permutated_scantable[2], ff_wmv1_scantable[3],
+                         w->idct_permutation);
 
     ff_intrax8dsp_init(&w->dsp);
     ff_blockdsp_init(&w->bdsp);
diff --git a/libavcodec/intrax8.h b/libavcodec/intrax8.h
index 9ef2fc3dd3..8e22361f1f 100644
--- a/libavcodec/intrax8.h
+++ b/libavcodec/intrax8.h
@@ -21,7 +21,6 @@ 
 
 #include "blockdsp.h"
 #include "get_bits.h"
-#include "idctdsp.h"
 #include "intrax8dsp.h"
 #include "wmv2dsp.h"
 #include "mpegpicture.h"
@@ -35,7 +34,7 @@  typedef struct IntraX8Context {
 
     // set by ff_intrax8_common_init
     uint8_t *prediction_table; // 2 * (mb_w * 2)
-    ScanTable scantable[3];
+    uint8_t permutated_scantable[3][64];
     WMV2DSPContext wdsp;
     uint8_t idct_permutation[64];
     AVCodecContext *avctx;