diff mbox series

[FFmpeg-devel,v2,11/24] avcodec/cavs: Only keep what is needed from IDCTDSP-API

Message ID AS8P250MB0744444936A77C9E9CC130908F2D9@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM
State Accepted
Commit 250d556343d4886a01f288480f9d3e9a2e0a33b0
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. The rest of the IDCTDSP-API
is unused as cavs has its own idct.

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

Patch

diff --git a/libavcodec/cavs.c b/libavcodec/cavs.c
index 6d54e8eae5..fdd577f7fb 100644
--- a/libavcodec/cavs.c
+++ b/libavcodec/cavs.c
@@ -792,15 +792,14 @@  int ff_cavs_init_top_lines(AVSContext *h)
 av_cold int ff_cavs_init(AVCodecContext *avctx)
 {
     AVSContext *h = avctx->priv_data;
+    uint8_t permutation[64];
 
     ff_blockdsp_init(&h->bdsp);
     ff_h264chroma_init(&h->h264chroma, 8);
-    ff_idctdsp_init(&h->idsp, avctx);
     ff_videodsp_init(&h->vdsp, 8);
     ff_cavsdsp_init(&h->cdsp);
-    ff_init_scantable_permutation(h->idsp.idct_permutation,
-                                  h->cdsp.idct_perm);
-    ff_init_scantable(h->idsp.idct_permutation, &h->scantable, ff_zigzag_direct);
+    ff_init_scantable_permutation(permutation, h->cdsp.idct_perm);
+    ff_permute_scantable(h->permutated_scantable, ff_zigzag_direct, permutation);
 
     h->avctx       = avctx;
     avctx->pix_fmt = AV_PIX_FMT_YUV420P;
diff --git a/libavcodec/cavs.h b/libavcodec/cavs.h
index cbc163fb4d..244c322b35 100644
--- a/libavcodec/cavs.h
+++ b/libavcodec/cavs.h
@@ -22,12 +22,16 @@ 
 #ifndef AVCODEC_CAVS_H
 #define AVCODEC_CAVS_H
 
+#include <stddef.h>
+#include <stdint.h>
+
+#include "libavutil/frame.h"
 #include "libavutil/mem_internal.h"
 
+#include "avcodec.h"
 #include "cavsdsp.h"
 #include "blockdsp.h"
 #include "h264chroma.h"
-#include "idctdsp.h"
 #include "get_bits.h"
 #include "videodsp.h"
 
@@ -166,7 +170,6 @@  typedef struct AVSContext {
     AVCodecContext *avctx;
     BlockDSPContext bdsp;
     H264ChromaContext h264chroma;
-    IDCTDSPContext idsp;
     VideoDSPContext vdsp;
     CAVSDSPContext  cdsp;
     GetBitContext gb;
@@ -220,7 +223,7 @@  typedef struct AVSContext {
     int qp_fixed;
     int pic_qp_fixed;
     int cbp;
-    ScanTable scantable;
+    uint8_t permutated_scantable[64];
 
     /** intra prediction is done with un-deblocked samples
      they are saved here before deblocking the MB  */
diff --git a/libavcodec/cavsdec.c b/libavcodec/cavsdec.c
index 3e8be65968..b1fa9a981d 100644
--- a/libavcodec/cavsdec.c
+++ b/libavcodec/cavsdec.c
@@ -521,7 +521,7 @@  static inline int dequant(AVSContext *h, int16_t *level_buf, uint8_t *run_buf,
 {
     int round = 1 << (shift - 1);
     int pos = -1;
-    const uint8_t *scantab = h->scantable.permutated;
+    const uint8_t *scantab = h->permutated_scantable;
 
     /* inverse scan and dequantization */
     while (--coeff_num >= 0) {