[FFmpeg-cvslog] avcodec/intrax8: Only keep what is used from ScanTable
Andreas Rheinhardt
git at videolan.org
Mon Oct 24 02:41:31 EEST 2022
ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Thu Oct 20 05:48:30 2022 +0200| [ec2b07db79dbbd58329bf5ec19ecf867b21a38b7] | committer: Andreas Rheinhardt
avcodec/intrax8: 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=ec2b07db79dbbd58329bf5ec19ecf867b21a38b7
---
libavcodec/intrax8.c | 15 ++++++++-------
libavcodec/intrax8.h | 3 +--
2 files changed, 9 insertions(+), 9 deletions(-)
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;
More information about the ffmpeg-cvslog
mailing list