aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-01-04 04:16:46 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-01-04 04:16:46 +0100
commita881b9aa08af79b4fb15b912842e203a732fa9af (patch)
treea4d61177bb9419e6cbc97e0b990e3d821bb5c628
parent958e3119743169f64de0152ccecf2a10113b901d (diff)
downloadffmpeg-a881b9aa08af79b4fb15b912842e203a732fa9af.tar.gz
avcodec/rv30: cleanup rpr handling
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/rv30.c6
-rw-r--r--libavcodec/rv34.h2
2 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/rv30.c b/libavcodec/rv30.c
index 9e27270c78..6c65afb83f 100644
--- a/libavcodec/rv30.c
+++ b/libavcodec/rv30.c
@@ -50,7 +50,7 @@ static int rv30_parse_slice_header(RV34DecContext *r, GetBitContext *gb, SliceIn
si->quant = get_bits(gb, 5);
skip_bits1(gb);
si->pts = get_bits(gb, 13);
- rpr = get_bits(gb, r->rpr);
+ rpr = get_bits(gb, av_log2(r->max_rpr) + 1);
if(rpr){
if (avctx->extradata_size < rpr * 2 + 8) {
av_log(avctx, AV_LOG_ERROR,
@@ -260,8 +260,8 @@ static av_cold int rv30_decode_init(AVCodecContext *avctx)
av_log(avctx, AV_LOG_ERROR, "Extradata is too small.\n");
return -1;
}
- r->rpr = (avctx->extradata[1] & 7) >> 1;
- r->rpr = FFMIN(r->rpr + 1, 3);
+
+ r->max_rpr = avctx->extradata[1] & 7;
r->parse_slice_header = rv30_parse_slice_header;
r->decode_intra_types = rv30_decode_intra_types;
diff --git a/libavcodec/rv34.h b/libavcodec/rv34.h
index 475f17a496..870164c6e5 100644
--- a/libavcodec/rv34.h
+++ b/libavcodec/rv34.h
@@ -102,7 +102,7 @@ typedef struct RV34DecContext{
int dmv[4][2]; ///< differential motion vectors for the current macroblock
int rv30; ///< indicates which RV variasnt is currently decoded
- int rpr; ///< one field size in RV30 slice header
+ int max_rpr;
int cur_pts, last_pts, next_pts;
int scaled_weight;