diff mbox series

[FFmpeg-devel,v2,02/24] avcodec/eamad: Don't use IDCTDSP-API unnecessarily

Message ID AS8P250MB074465553452CB04E2E8F27C8F2D9@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM
State Accepted
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
The eamad 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/eamad.c | 8 +-------
 2 files changed, 2 insertions(+), 8 deletions(-)

Comments

Peter Ross Oct. 22, 2022, 12:07 a.m. UTC | #1
On Fri, Oct 21, 2022 at 10:12:38PM +0200, Andreas Rheinhardt wrote:
> The eamad 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.

i think this dates back to when libavcodec only had one big dsp module.
this patch set looks good.

-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)
diff mbox series

Patch

diff --git a/configure b/configure
index bb61e9a0b8..16b2084945 100755
--- a/configure
+++ b/configure
@@ -2820,7 +2820,7 @@  dxa_decoder_deps="zlib"
 dxv_decoder_select="lzf texturedsp"
 eac3_decoder_select="ac3_decoder"
 eac3_encoder_select="ac3_encoder"
-eamad_decoder_select="aandcttables blockdsp bswapdsp idctdsp"
+eamad_decoder_select="aandcttables blockdsp bswapdsp"
 eatgq_decoder_select="aandcttables idctdsp"
 eatqi_decoder_select="aandcttables blockdsp bswapdsp idctdsp"
 exr_decoder_deps="zlib"
diff --git a/libavcodec/eamad.c b/libavcodec/eamad.c
index 2a5aac912d..de8f488f65 100644
--- a/libavcodec/eamad.c
+++ b/libavcodec/eamad.c
@@ -39,7 +39,6 @@ 
 #include "get_bits.h"
 #include "aandcttab.h"
 #include "eaidct.h"
-#include "idctdsp.h"
 #include "mpeg12data.h"
 #include "mpeg12vlc.h"
 
@@ -52,13 +51,11 @@  typedef struct MadContext {
     AVCodecContext *avctx;
     BlockDSPContext bdsp;
     BswapDSPContext bbdsp;
-    IDCTDSPContext idsp;
     AVFrame *last_frame;
     GetBitContext gb;
     void *bitstream_buf;
     unsigned int bitstream_buf_size;
     DECLARE_ALIGNED(32, int16_t, block)[64];
-    ScanTable scantable;
     uint16_t quant_matrix[64];
     int mb_x;
     int mb_y;
@@ -71,9 +68,6 @@  static av_cold int decode_init(AVCodecContext *avctx)
     avctx->pix_fmt = AV_PIX_FMT_YUV420P;
     ff_blockdsp_init(&s->bdsp);
     ff_bswapdsp_init(&s->bbdsp);
-    ff_idctdsp_init(&s->idsp, avctx);
-    ff_init_scantable_permutation(s->idsp.idct_permutation, FF_IDCT_PERM_NONE);
-    ff_init_scantable(s->idsp.idct_permutation, &s->scantable, ff_zigzag_direct);
     ff_mpeg12_init_vlcs();
 
     s->last_frame = av_frame_alloc();
@@ -135,7 +129,7 @@  static inline int decode_block_intra(MadContext *s, int16_t * block)
 {
     int level, i, j, run;
     RLTable *rl = &ff_rl_mpeg1;
-    const uint8_t *scantable = s->scantable.permutated;
+    const uint8_t *scantable = ff_zigzag_direct;
     int16_t *quant_matrix = s->quant_matrix;
 
     block[0] = (128 + get_sbits(&s->gb, 8)) * quant_matrix[0];