summaryrefslogtreecommitdiff
path: root/libavcodec/vc1.c
diff options
context:
space:
mode:
authorAlberto Delmás <adelmas@gmail.com>2011-08-27 19:37:26 +0200
committerAnton Khirnov <anton@khirnov.net>2011-08-31 13:11:23 +0200
commitd2f119a1f2d2d72b0001fcdf2cc051b022bf6528 (patch)
treeb1967e1c53ac5d79858e5a15a7908ac82ed3c799 /libavcodec/vc1.c
parenta18e04bcf989a9d7f5629c573f9d70f8a020c7a7 (diff)
VC1: Support dynamic dimension changes
Fixes SA00072, SA00073, SA10150, SA10151, Issue2076 Improves SA10153 Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'libavcodec/vc1.c')
-rw-r--r--libavcodec/vc1.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/libavcodec/vc1.c b/libavcodec/vc1.c
index c3649ac383..870feaaa76 100644
--- a/libavcodec/vc1.c
+++ b/libavcodec/vc1.c
@@ -453,9 +453,6 @@ static int decode_sequence_header_adv(VC1Context *v, GetBitContext *gb)
v->finterpflag = get_bits1(gb);
skip_bits1(gb); // reserved
- v->s.h_edge_pos = v->s.avctx->coded_width;
- v->s.v_edge_pos = v->s.avctx->coded_height;
-
av_log(v->s.avctx, AV_LOG_DEBUG,
"Advanced Profile level %i:\nfrmrtq_postproc=%i, bitrtq_postproc=%i\n"
"LoopFilter=%i, ChromaFormat=%i, Pulldown=%i, Interlace: %i\n"
@@ -474,8 +471,8 @@ static int decode_sequence_header_adv(VC1Context *v, GetBitContext *gb)
if(get_bits1(gb)) { //Display Info - decoding is not affected by it
int w, h, ar = 0;
av_log(v->s.avctx, AV_LOG_DEBUG, "Display extended info:\n");
- v->s.avctx->width = w = get_bits(gb, 14) + 1;
- v->s.avctx->height = h = get_bits(gb, 14) + 1;
+ w = get_bits(gb, 14) + 1;
+ h = get_bits(gb, 14) + 1;
av_log(v->s.avctx, AV_LOG_DEBUG, "Display dimensions: %ix%i\n", w, h);
if(get_bits1(gb))
ar = get_bits(gb, 4);
@@ -485,6 +482,12 @@ static int decode_sequence_header_adv(VC1Context *v, GetBitContext *gb)
w = get_bits(gb, 8) + 1;
h = get_bits(gb, 8) + 1;
v->s.avctx->sample_aspect_ratio = (AVRational){w, h};
+ } else {
+ av_reduce(&v->s.avctx->sample_aspect_ratio.num,
+ &v->s.avctx->sample_aspect_ratio.den,
+ v->s.avctx->height * w,
+ v->s.avctx->width * h,
+ 1<<30);
}
av_log(v->s.avctx, AV_LOG_DEBUG, "Aspect: %i:%i\n", v->s.avctx->sample_aspect_ratio.num, v->s.avctx->sample_aspect_ratio.den);
@@ -552,8 +555,8 @@ int vc1_decode_entry_point(AVCodecContext *avctx, VC1Context *v, GetBitContext *
}
if(get_bits1(gb)){
- avctx->coded_width = (get_bits(gb, 12)+1)<<1;
- avctx->coded_height = (get_bits(gb, 12)+1)<<1;
+ avctx->width = avctx->coded_width = (get_bits(gb, 12)+1)<<1;
+ avctx->height = avctx->coded_height = (get_bits(gb, 12)+1)<<1;
}
if(v->extended_mv)
v->extended_dmv = get_bits1(gb);