aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/vp3.c
diff options
context:
space:
mode:
authorMike Melanson <mike@multimedia.cx>2003-05-11 02:51:07 +0000
committerMike Melanson <mike@multimedia.cx>2003-05-11 02:51:07 +0000
commit463d086bb573e7544ec11efca847ca8e7989a4ba (patch)
treef23ad7cf699d1d7adf2ec96c6f28571336e7f8d2 /libavcodec/vp3.c
parent892fc83e88a20f9543c6c5be3626712be7a2e6f2 (diff)
downloadffmpeg-463d086bb573e7544ec11efca847ca8e7989a4ba.tar.gz
get those permutations straight
Originally committed as revision 1850 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/vp3.c')
-rw-r--r--libavcodec/vp3.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c
index 461be0918a..894e7679be 100644
--- a/libavcodec/vp3.c
+++ b/libavcodec/vp3.c
@@ -862,7 +862,7 @@ static void init_dequantizer(Vp3DecodeContext *s)
* the dequantization phase */
for (i = 1; i < 64; i++) {
- j = quant_index[i];
+ j = zigzag_index[i];
s->intra_y_dequant[j] = vp31_intra_y_dequant[i] * quality_scale / 100;
if (s->intra_y_dequant[j] < MIN_DEQUANT_VAL)
@@ -2065,6 +2065,7 @@ static void render_fragments(Vp3DecodeContext *s,
int j;
int16_t *dequantizer;
DCTELEM dequant_block[64];
+ DCTELEM dequant_block_permuted[64];
unsigned char *output_plane;
unsigned char *last_plane;
unsigned char *golden_plane;
@@ -2155,9 +2156,12 @@ static void render_fragments(Vp3DecodeContext *s,
i, s->all_fragments[i].coding_method,
s->all_fragments[i].coeffs[0], dequantizer[0]);
for (j = 0; j < 64; j++)
- dequant_block[dequant_index[j]] =
+ dequant_block[dezigzag_index[j]] =
s->all_fragments[i].coeffs[j] *
dequantizer[j];
+ for (j = 0; j < 64; j++)
+ dequant_block_permuted[s->dsp.idct_permutation[j]] =
+ dequant_block[j];
debug_idct("dequantized block:\n");
for (m = 0; m < 8; m++) {
@@ -2171,14 +2175,14 @@ static void render_fragments(Vp3DecodeContext *s,
/* invert DCT and place (or add) in final output */
if (s->all_fragments[i].coding_method == MODE_INTRA) {
- dequant_block[0] += 1024;
+ dequant_block_permuted[0] += 1024;
s->dsp.idct_put(
output_plane + s->all_fragments[i].first_pixel,
- stride, dequant_block);
+ stride, dequant_block_permuted);
} else {
s->dsp.idct_add(
output_plane + s->all_fragments[i].first_pixel,
- stride, dequant_block);
+ stride, dequant_block_permuted);
}
debug_idct("block after idct_%s():\n",
@@ -2363,7 +2367,7 @@ static int vp3_decode_init(AVCodecContext *avctx)
/* build quantization table */
for (i = 0; i < 64; i++)
- quant_index[dequant_index[i]] = i;
+ zigzag_index[dezigzag_index[i]] = i;
/* work out the block mapping tables */
s->superblock_fragments = av_malloc(s->superblock_count * 16 * sizeof(int));