Commit d2f119a1 authored by Alberto Delmás's avatar Alberto Delmás Committed by Anton Khirnov

VC1: Support dynamic dimension changes

Fixes SA00072, SA00073, SA10150, SA10151, Issue2076

Improves SA10153
Signed-off-by: 's avatarAnton Khirnov <anton@khirnov.net>
parent a18e04bc
...@@ -453,9 +453,6 @@ static int decode_sequence_header_adv(VC1Context *v, GetBitContext *gb) ...@@ -453,9 +453,6 @@ static int decode_sequence_header_adv(VC1Context *v, GetBitContext *gb)
v->finterpflag = get_bits1(gb); v->finterpflag = get_bits1(gb);
skip_bits1(gb); // reserved 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, av_log(v->s.avctx, AV_LOG_DEBUG,
"Advanced Profile level %i:\nfrmrtq_postproc=%i, bitrtq_postproc=%i\n" "Advanced Profile level %i:\nfrmrtq_postproc=%i, bitrtq_postproc=%i\n"
"LoopFilter=%i, ChromaFormat=%i, Pulldown=%i, Interlace: %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) ...@@ -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 if(get_bits1(gb)) { //Display Info - decoding is not affected by it
int w, h, ar = 0; int w, h, ar = 0;
av_log(v->s.avctx, AV_LOG_DEBUG, "Display extended info:\n"); av_log(v->s.avctx, AV_LOG_DEBUG, "Display extended info:\n");
v->s.avctx->width = w = get_bits(gb, 14) + 1; w = get_bits(gb, 14) + 1;
v->s.avctx->height = h = 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); av_log(v->s.avctx, AV_LOG_DEBUG, "Display dimensions: %ix%i\n", w, h);
if(get_bits1(gb)) if(get_bits1(gb))
ar = get_bits(gb, 4); ar = get_bits(gb, 4);
...@@ -485,6 +482,12 @@ static int decode_sequence_header_adv(VC1Context *v, GetBitContext *gb) ...@@ -485,6 +482,12 @@ static int decode_sequence_header_adv(VC1Context *v, GetBitContext *gb)
w = get_bits(gb, 8) + 1; w = get_bits(gb, 8) + 1;
h = get_bits(gb, 8) + 1; h = get_bits(gb, 8) + 1;
v->s.avctx->sample_aspect_ratio = (AVRational){w, h}; 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); 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 * ...@@ -552,8 +555,8 @@ int vc1_decode_entry_point(AVCodecContext *avctx, VC1Context *v, GetBitContext *
} }
if(get_bits1(gb)){ if(get_bits1(gb)){
avctx->coded_width = (get_bits(gb, 12)+1)<<1; avctx->width = avctx->coded_width = (get_bits(gb, 12)+1)<<1;
avctx->coded_height = (get_bits(gb, 12)+1)<<1; avctx->height = avctx->coded_height = (get_bits(gb, 12)+1)<<1;
} }
if(v->extended_mv) if(v->extended_mv)
v->extended_dmv = get_bits1(gb); v->extended_dmv = get_bits1(gb);
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment