Commit d07159e9 authored by maxim's avatar maxim

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.


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@23569 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 1986eb1b
...@@ -364,6 +364,8 @@ int ff_ivi_decode_blocks(GetBitContext *gb, IVIBandDesc *band, IVITile *tile) ...@@ -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; base_tab = is_intra ? band->intra_base : band->inter_base;
scale_tab = is_intra ? band->intra_scale : band->inter_scale; scale_tab = is_intra ? band->intra_scale : band->inter_scale;
if (scale_tab)
quant = scale_tab[quant];
if (!is_intra) { if (!is_intra) {
mv_x = mb->mv_x; mv_x = mb->mv_x;
...@@ -415,7 +417,7 @@ int ff_ivi_decode_blocks(GetBitContext *gb, IVIBandDesc *band, IVITile *tile) ...@@ -415,7 +417,7 @@ int ff_ivi_decode_blocks(GetBitContext *gb, IVIBandDesc *band, IVITile *tile)
if (IVI_DEBUG && !val) if (IVI_DEBUG && !val)
av_log(NULL, AV_LOG_ERROR, "Val = 0 encountered!\n"); 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) if (q > 1)
val = val * q + FFSIGN(val) * (((q ^ 1) - 1) >> 1); val = val * q + FFSIGN(val) * (((q ^ 1) - 1) >> 1);
trvec[pos] = val; trvec[pos] = val;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment