diff mbox series

[FFmpeg-devel,03/22] avcodec/eatgq: Don't use IDCTDSP-API unnecessarily

Message ID AS8P250MB07444A3E01B609C3D26975B58F2A9@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM
State Superseded
Headers show
Series [FFmpeg-devel,01/22] 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. 20, 2022, 8:45 a.m. UTC
The eatgq decoder uses a custom IDCT and actually does not
use the IDCTDSP API at all. Somehow it was nevertheless
used to simply apply the identity permutation on ff_zigzag_direct.
This commit stops doing so.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 configure          | 2 +-
 libavcodec/eatgq.c | 7 +------
 2 files changed, 2 insertions(+), 7 deletions(-)
diff mbox series

Patch

diff --git a/configure b/configure
index 16b2084945..84d7be8bfe 100755
--- a/configure
+++ b/configure
@@ -2821,7 +2821,7 @@  dxv_decoder_select="lzf texturedsp"
 eac3_decoder_select="ac3_decoder"
 eac3_encoder_select="ac3_encoder"
 eamad_decoder_select="aandcttables blockdsp bswapdsp"
-eatgq_decoder_select="aandcttables idctdsp"
+eatgq_decoder_select="aandcttables"
 eatqi_decoder_select="aandcttables blockdsp bswapdsp idctdsp"
 exr_decoder_deps="zlib"
 exr_encoder_deps="zlib"
diff --git a/libavcodec/eatgq.c b/libavcodec/eatgq.c
index a6c3e72f85..e8d66418b9 100644
--- a/libavcodec/eatgq.c
+++ b/libavcodec/eatgq.c
@@ -39,12 +39,10 @@ 
 #include "decode.h"
 #include "eaidct.h"
 #include "get_bits.h"
-#include "idctdsp.h"
 
 typedef struct TgqContext {
     AVCodecContext *avctx;
     int width, height;
-    ScanTable scantable;
     int qtable[64];
     DECLARE_ALIGNED(16, int16_t, block)[6][64];
     GetByteContext gb;
@@ -53,10 +51,7 @@  typedef struct TgqContext {
 static av_cold int tgq_decode_init(AVCodecContext *avctx)
 {
     TgqContext *s = avctx->priv_data;
-    uint8_t idct_permutation[64];
     s->avctx = avctx;
-    ff_init_scantable_permutation(idct_permutation, FF_IDCT_PERM_NONE);
-    ff_init_scantable(idct_permutation, &s->scantable, ff_zigzag_direct);
     avctx->framerate = (AVRational){ 15, 1 };
     avctx->pix_fmt   = AV_PIX_FMT_YUV420P;
     return 0;
@@ -64,7 +59,7 @@  static av_cold int tgq_decode_init(AVCodecContext *avctx)
 
 static void tgq_decode_block(TgqContext *s, int16_t block[64], GetBitContext *gb)
 {
-    uint8_t *perm = s->scantable.permutated;
+    const uint8_t *perm = ff_zigzag_direct;
     int i, j, value;
     block[0] = get_sbits(gb, 8) * s->qtable[0];
     for (i = 1; i < 64;) {