summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKostya Shishkov <kostya.shishkov@gmail.com>2008-12-23 18:27:06 +0000
committerKostya Shishkov <kostya.shishkov@gmail.com>2008-12-23 18:27:06 +0000
commitffedb5c19a2a0f57d686c40b01395befe9f38e67 (patch)
treeebdec94ee75c0f0477b6cc85fed377dbe55d1ceb
parent2d76bf391ac7aed0d02c93658fecb0ab2bc4e915 (diff)
downloadffmpeg-ffedb5c19a2a0f57d686c40b01395befe9f38e67.tar.gz
352l: correct calculating number of bits for storing macroblock offset in RV3/4
Originally committed as revision 16293 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavcodec/rv34.c2
-rw-r--r--libavcodec/rv34data.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/rv34.c b/libavcodec/rv34.c
index 7792cad565..294824edb1 100644
--- a/libavcodec/rv34.c
+++ b/libavcodec/rv34.c
@@ -367,7 +367,7 @@ int ff_rv34_get_start_offset(GetBitContext *gb, int mb_size)
{
int i;
for(i = 0; i < 5; i++)
- if(rv34_mb_max_sizes[i] > mb_size)
+ if(rv34_mb_max_sizes[i] >= mb_size - 1)
break;
return rv34_mb_bits_sizes[i];
}
diff --git a/libavcodec/rv34data.h b/libavcodec/rv34data.h
index e4862a3ba0..95e5572df7 100644
--- a/libavcodec/rv34data.h
+++ b/libavcodec/rv34data.h
@@ -138,7 +138,7 @@ static const uint8_t rv34_dquant_tab[2][32]={
* maximum number of macroblocks for each of the possible slice offset sizes
* @todo This is the same as ff_mba_max, maybe use it instead.
*/
-static const uint16_t rv34_mb_max_sizes[6] = { 0x2F, 0x68, 0x18B, 0x62F, 0x18BF, 0x23FF };
+static const uint16_t rv34_mb_max_sizes[6] = { 0x2F, 0x62, 0x18B, 0x62F, 0x18BF, 0x23FF };
/**
* bits needed to code the slice offset for the given size
* @todo This is the same as ff_mba_length, maybe use it instead.