summaryrefslogtreecommitdiff
path: root/libavcodec/ivi_common.c
diff options
context:
space:
mode:
authorMaxim Poliakovski <max_pole@gmx.de>2010-06-10 17:31:12 +0000
committerMaxim Poliakovski <max_pole@gmx.de>2010-06-10 17:31:12 +0000
commit79d46cbea6c30c11de8da9ca64ac293b773966e2 (patch)
tree7055ce542c781075aa7e81e93efbc4a6d808b473 /libavcodec/ivi_common.c
parentc1b85795cb03b5afb2368d11604bd28f17f5f697 (diff)
Quant changes only once per MB so move the corresponding scale factor assignment
out of the block decoding loop. Indeo4 doesn't use any scale table but the quant level itself as scale. Therefore access scale table only if its pointer != NULL. Originally committed as revision 23569 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/ivi_common.c')
-rw-r--r--libavcodec/ivi_common.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/ivi_common.c b/libavcodec/ivi_common.c
index 6a493661d3..f0a3a49464 100644
--- a/libavcodec/ivi_common.c
+++ b/libavcodec/ivi_common.c
@@ -364,6 +364,8 @@ int ff_ivi_decode_blocks(GetBitContext *gb, IVIBandDesc *band, IVITile *tile)
base_tab = is_intra ? band->intra_base : band->inter_base;
scale_tab = is_intra ? band->intra_scale : band->inter_scale;
+ if (scale_tab)
+ quant = scale_tab[quant];
if (!is_intra) {
mv_x = mb->mv_x;
@@ -415,7 +417,7 @@ int ff_ivi_decode_blocks(GetBitContext *gb, IVIBandDesc *band, IVITile *tile)
if (IVI_DEBUG && !val)
av_log(NULL, AV_LOG_ERROR, "Val = 0 encountered!\n");
- q = (base_tab[pos] * scale_tab[quant]) >> 9;
+ q = (base_tab[pos] * quant) >> 9;
if (q > 1)
val = val * q + FFSIGN(val) * (((q ^ 1) - 1) >> 1);
trvec[pos] = val;