Browse Source

indeo4: expand allowed quantiser range

Indeo 4 has quantiser range 0-31 instead of 0-23 for Indeo 5, and clipping
quantiser leads to incorrect quantisation and DC prediction on low-quality
videos.

This fixes bug 259.
tags/n2.0
Kostya Shishkov 12 years ago
parent
commit
33f64fd5d5
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      libavcodec/ivi_common.c

+ 5
- 1
libavcodec/ivi_common.c View File

@@ -418,7 +418,11 @@ static int ivi_decode_blocks(GetBitContext *gb, IVIBandDesc *band, IVITile *tile
cbp = mb->cbp;
buf_offs = mb->buf_offs;

quant = av_clip(band->glob_quant + mb->q_delta, 0, 23);
quant = band->glob_quant + mb->q_delta;
if (avctx->codec_id == AV_CODEC_ID_INDEO4)
quant = av_clip(quant, 0, 31);
else
quant = av_clip(quant, 0, 23);

base_tab = is_intra ? band->intra_base : band->inter_base;
scale_tab = is_intra ? band->intra_scale : band->inter_scale;


Loading…
Cancel
Save