summaryrefslogtreecommitdiff
path: root/libavcodec/rv10.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-01-04 04:15:22 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-01-04 04:15:22 +0100
commit958e3119743169f64de0152ccecf2a10113b901d (patch)
treecaec0cfdb0bfffcfee9fc7829b8cd2f100e88a74 /libavcodec/rv10.c
parentadc09a353c5ff467fdc924373e2ee1faf703b3b3 (diff)
downloadffmpeg-958e3119743169f64de0152ccecf2a10113b901d.tar.gz
avcodec/rv10: cleanup rpr handling
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/rv10.c')
-rw-r--r--libavcodec/rv10.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libavcodec/rv10.c b/libavcodec/rv10.c
index 4d48a49f3c..fc3fb722f8 100644
--- a/libavcodec/rv10.c
+++ b/libavcodec/rv10.c
@@ -300,7 +300,7 @@ static int rv20_decode_picture_header(RVDecContext *rv)
{
MpegEncContext *s = &rv->m;
int seq, mb_pos, i, ret;
- int rpr_bits;
+ int rpr_max;
i = get_bits(&s->gb, 2);
switch(i) {
@@ -341,10 +341,10 @@ static int rv20_decode_picture_header(RVDecContext *rv)
else
seq = get_bits(&s->gb, 13) << 2;
- rpr_bits = s->avctx->extradata[1] & 7;
- if (rpr_bits) {
+ rpr_max = s->avctx->extradata[1] & 7;
+ if (rpr_max) {
int f, new_w, new_h;
- rpr_bits = FFMIN((rpr_bits >> 1) + 1, 3);
+ int rpr_bits = av_log2(rpr_max) + 1;
f = get_bits(&s->gb, rpr_bits);
@@ -387,7 +387,7 @@ static int rv20_decode_picture_header(RVDecContext *rv)
}
if (s->avctx->debug & FF_DEBUG_PICT_INFO) {
- av_log(s->avctx, AV_LOG_DEBUG, "F %d/%d\n", f, rpr_bits);
+ av_log(s->avctx, AV_LOG_DEBUG, "F %d/%d/%d\n", f, rpr_bits, rpr_max);
}
}
if (av_image_check_size(s->width, s->height, 0, s->avctx) < 0)