[FFmpeg-cvslog] avcodec/speedhqdec: Only keep what is used from ScanTable

Andreas Rheinhardt git at videolan.org
Mon Oct 24 02:41:41 EEST 2022


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Thu Oct 20 05:55:53 2022 +0200| [da93e4fb277789b35e95d1e3fa4cabe8c3daa971] | committer: Andreas Rheinhardt

avcodec/speedhqdec: Only keep what is used from ScanTable

Namely ScanTable.permutated.

Reviewed-by: Peter Ross <pross at xvid.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=da93e4fb277789b35e95d1e3fa4cabe8c3daa971
---

 libavcodec/speedhqdec.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/libavcodec/speedhqdec.c b/libavcodec/speedhqdec.c
index acca437bd5..5378b987dc 100644
--- a/libavcodec/speedhqdec.c
+++ b/libavcodec/speedhqdec.c
@@ -53,7 +53,7 @@
 typedef struct SHQContext {
     BlockDSPContext bdsp;
     IDCTDSPContext idsp;
-    ScanTable intra_scantable;
+    uint8_t permutated_intra_scantable[64];
     int quant_matrix[64];
     enum { SHQ_SUBSAMPLING_420, SHQ_SUBSAMPLING_422, SHQ_SUBSAMPLING_444 }
         subsampling;
@@ -137,7 +137,7 @@ static inline int decode_alpha_block(const SHQContext *s, GetBitContext *gb, uin
 static inline int decode_dct_block(const SHQContext *s, GetBitContext *gb, int last_dc[4], int component, uint8_t *dest, int linesize)
 {
     const int *quant_matrix = s->quant_matrix;
-    const uint8_t *scantable = s->intra_scantable.permutated;
+    const uint8_t *scantable = s->permutated_intra_scantable;
     LOCAL_ALIGNED_32(int16_t, block, [64]);
     int dc_offset;
 
@@ -581,7 +581,8 @@ static av_cold int speedhq_decode_init(AVCodecContext *avctx)
 
     ff_blockdsp_init(&s->bdsp);
     ff_idctdsp_init(&s->idsp, avctx);
-    ff_init_scantable(s->idsp.idct_permutation, &s->intra_scantable, ff_zigzag_direct);
+    ff_permute_scantable(s->permutated_intra_scantable, ff_zigzag_direct,
+                         s->idsp.idct_permutation);
 
     switch (avctx->codec_tag) {
     case MKTAG('S', 'H', 'Q', '0'):



More information about the ffmpeg-cvslog mailing list