Commit b6402278 authored by Jerome Borsboom's avatar Jerome Borsboom Committed by Carl Eugen Hoyos

avcodec/vc1: fix decoding of old WMV3 format

The position of the second MV predicitor candidate is slightly different
for the old WMV3 format indicated by RES_RTM_FLAG. This patch fixes
decoding of niceday.wmv on the samples server.

Fixes: #6641
Signed-off-by: 's avatarJerome Borsboom <jerome.borsboom@carpalis.nl>
parent 96740ec6
...@@ -379,11 +379,6 @@ int ff_vc1_decode_sequence_header(AVCodecContext *avctx, VC1Context *v, GetBitCo ...@@ -379,11 +379,6 @@ int ff_vc1_decode_sequence_header(AVCodecContext *avctx, VC1Context *v, GetBitCo
} else { } else {
v->res_rtm_flag = get_bits1(gb); //reserved v->res_rtm_flag = get_bits1(gb); //reserved
} }
if (!v->res_rtm_flag) {
av_log(avctx, AV_LOG_ERROR,
"Old WMV3 version detected, some frames may be decoded incorrectly\n");
//return -1;
}
//TODO: figure out what they mean (always 0x402F) //TODO: figure out what they mean (always 0x402F)
if (!v->res_fasttx) if (!v->res_fasttx)
skip_bits(gb, 16); skip_bits(gb, 16);
......
...@@ -275,7 +275,10 @@ void ff_vc1_pred_mv(VC1Context *v, int n, int dmv_x, int dmv_y, ...@@ -275,7 +275,10 @@ void ff_vc1_pred_mv(VC1Context *v, int n, int dmv_x, int dmv_y,
//in 4-MV mode different blocks have different B predictor position //in 4-MV mode different blocks have different B predictor position
switch (n) { switch (n) {
case 0: case 0:
off = (s->mb_x > 0) ? -1 : 1; if (v->res_rtm_flag)
off = s->mb_x ? -1 : 1;
else
off = s->mb_x ? -1 : 2 * s->mb_width - wrap - 1;
break; break;
case 1: case 1:
off = (s->mb_x == (s->mb_width - 1)) ? -1 : 1; off = (s->mb_x == (s->mb_width - 1)) ? -1 : 1;
......
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