[FFmpeg-cvslog] avcodec/rv30: fix switching back to the original resolution
Michael Niedermayer
git at videolan.org
Mon Aug 17 03:01:07 CEST 2015
ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Mon Aug 17 01:50:20 2015 +0200| [7f769ae41e0dca0f538ad6bdad5f9471fd5ee87f] | committer: Michael Niedermayer
avcodec/rv30: fix switching back to the original resolution
Fixes part of Ticket1388
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7f769ae41e0dca0f538ad6bdad5f9471fd5ee87f
---
libavcodec/rv30.c | 6 ++++++
libavcodec/rv34.h | 2 ++
2 files changed, 8 insertions(+)
diff --git a/libavcodec/rv30.c b/libavcodec/rv30.c
index f8c7ed4..3b9868c 100644
--- a/libavcodec/rv30.c
+++ b/libavcodec/rv30.c
@@ -67,6 +67,9 @@ static int rv30_parse_slice_header(RV34DecContext *r, GetBitContext *gb, SliceIn
w = r->s.avctx->extradata[6 + rpr*2] << 2;
h = r->s.avctx->extradata[7 + rpr*2] << 2;
+ } else {
+ w = r->orig_width;
+ h = r->orig_height;
}
si->width = w;
si->height = h;
@@ -259,6 +262,9 @@ static av_cold int rv30_decode_init(AVCodecContext *avctx)
RV34DecContext *r = avctx->priv_data;
int ret;
+ r->orig_width = avctx->coded_width;
+ r->orig_height = avctx->coded_height;
+
if (avctx->extradata_size < 2) {
av_log(avctx, AV_LOG_ERROR, "Extradata is too small.\n");
return AVERROR(EINVAL);
diff --git a/libavcodec/rv34.h b/libavcodec/rv34.h
index 870164c..e2f40c8 100644
--- a/libavcodec/rv34.h
+++ b/libavcodec/rv34.h
@@ -109,6 +109,8 @@ typedef struct RV34DecContext{
int weight1, weight2; ///< B frame distance fractions (0.14) used in motion compensation
int mv_weight1, mv_weight2;
+ int orig_width, orig_height;
+
uint16_t *cbp_luma; ///< CBP values for luma subblocks
uint8_t *cbp_chroma; ///< CBP values for chroma subblocks
uint16_t *deblock_coefs; ///< deblock coefficients for each macroblock
More information about the ffmpeg-cvslog
mailing list