[FFmpeg-cvslog] avcodec/intrax8: Don't pretend to need more than one int16_t[64]
Andreas Rheinhardt
git at videolan.org
Thu Jul 3 21:55:38 EEST 2025
ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Mon Jun 16 00:10:45 2025 +0200| [aa4a5b1e330673e9ccaf8bfba46faa84c356dce7] | committer: Andreas Rheinhardt
avcodec/intrax8: Don't pretend to need more than one int16_t[64]
Intrax8 needs only a single block.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=aa4a5b1e330673e9ccaf8bfba46faa84c356dce7
---
libavcodec/intrax8.c | 16 ++++++++--------
libavcodec/intrax8.h | 4 ++--
libavcodec/vc1dec.c | 2 +-
libavcodec/wmv2dec.c | 2 +-
4 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/libavcodec/intrax8.c b/libavcodec/intrax8.c
index 684f15d904..89b70e5902 100644
--- a/libavcodec/intrax8.c
+++ b/libavcodec/intrax8.c
@@ -437,7 +437,7 @@ static void x8_ac_compensation(IntraX8Context *const w, const int direction,
const int dc_level)
{
int t;
-#define B(x,y) w->block[0][w->idct_permutation[(x) + (y) * 8]]
+#define B(x,y) w->block[w->idct_permutation[(x) + (y) * 8]]
#define T(x) ((x) * dc_level + 0x8000) >> 16;
switch (direction) {
case 0:
@@ -530,7 +530,7 @@ static int x8_decode_intra_mb(IntraX8Context *const w, const int chroma)
int sign;
av_assert2(w->orient < 12);
- w->bdsp.clear_block(w->block[0]);
+ w->bdsp.clear_block(w->block);
if (chroma)
dc_mode = 2;
@@ -591,7 +591,7 @@ static int x8_decode_intra_mb(IntraX8Context *const w, const int chroma)
if (use_quant_matrix)
level = (level * quant_table[pos]) >> 8;
- w->block[0][scantable[pos]] = level;
+ w->block[scantable[pos]] = level;
} while (!final);
} else { // DC only
if (w->flat_dc && ((unsigned) (dc_level + 1)) < 3) { // [-1; 1]
@@ -613,9 +613,9 @@ static int x8_decode_intra_mb(IntraX8Context *const w, const int chroma)
zeros_only = dc_level == 0;
}
if (!chroma)
- w->block[0][0] = dc_level * w->quant;
+ w->block[0] = dc_level * w->quant;
else
- w->block[0][0] = dc_level * w->quant_dc_chroma;
+ w->block[0] = dc_level * w->quant_dc_chroma;
// there is !zero_only check in the original, but dc_level check is enough
if ((unsigned int) (dc_level + 1) >= 3 && (w->edges & 3) != 3) {
@@ -624,7 +624,7 @@ static int x8_decode_intra_mb(IntraX8Context *const w, const int chroma)
* -> 01'10' 10'10' 00'00' 00'01' 01'11' 11'00 => 0x6A017C */
direction = (0x6A017C >> (w->orient * 2)) & 3;
if (direction != 3) {
- x8_ac_compensation(w, direction, w->block[0][0]);
+ x8_ac_compensation(w, direction, w->block[0]);
}
}
@@ -639,7 +639,7 @@ static int x8_decode_intra_mb(IntraX8Context *const w, const int chroma)
if (!zeros_only)
w->wdsp.idct_add(w->dest[chroma],
w->frame->linesize[!!chroma],
- w->block[0]);
+ w->block);
block_placed:
if (!chroma)
@@ -678,7 +678,7 @@ static void x8_init_block_index(IntraX8Context *w, AVFrame *frame)
av_cold int ff_intrax8_common_init(AVCodecContext *avctx,
IntraX8Context *w,
- int16_t (*block)[64],
+ int16_t block[64],
int mb_width, int mb_height)
{
static AVOnce init_static_once = AV_ONCE_INIT;
diff --git a/libavcodec/intrax8.h b/libavcodec/intrax8.h
index 38ad09c837..2ec90963a8 100644
--- a/libavcodec/intrax8.h
+++ b/libavcodec/intrax8.h
@@ -38,7 +38,7 @@ typedef struct IntraX8Context {
WMV2DSPContext wdsp;
uint8_t idct_permutation[64];
AVCodecContext *avctx;
- int16_t (*block)[64];
+ int16_t *block;
// set by the caller codec
IntraX8DSPContext dsp;
@@ -82,7 +82,7 @@ typedef struct IntraX8Context {
*/
int ff_intrax8_common_init(AVCodecContext *avctx,
IntraX8Context *w,
- int16_t (*block)[64],
+ int16_t block[64],
int mb_width, int mb_height);
/**
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index 97174d10e3..8bcc7c60df 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -420,7 +420,7 @@ static av_cold int vc1_decode_init_alloc_tables(VC1Context *v)
return AVERROR(ENOMEM);
}
- ret = ff_intrax8_common_init(s->avctx, &v->x8, s->block,
+ ret = ff_intrax8_common_init(s->avctx, &v->x8, s->block[0],
s->mb_width, s->mb_height);
if (ret < 0)
return ret;
diff --git a/libavcodec/wmv2dec.c b/libavcodec/wmv2dec.c
index 964d6a4c06..301c786633 100644
--- a/libavcodec/wmv2dec.c
+++ b/libavcodec/wmv2dec.c
@@ -581,7 +581,7 @@ static av_cold int wmv2_decode_init(AVCodecContext *avctx)
decode_ext_header(w);
- return ff_intrax8_common_init(avctx, &w->x8, s->block,
+ return ff_intrax8_common_init(avctx, &w->x8, s->block[0],
s->mb_width, s->mb_height);
}
More information about the ffmpeg-cvslog
mailing list