Commit feaa4002 authored by Hendrik Leppkes's avatar Hendrik Leppkes Committed by Kostya Shishkov

vc1: always read the bfraction element for interlaced fields

Previously, it would not be read if refdist_flag was not set, however
according to the spec and the reference decoder, it should always be read.
Signed-off-by: 's avatarKostya Shishkov <kostya.shishkov@gmail.com>
parent 7de9af65
...@@ -894,13 +894,12 @@ int vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb) ...@@ -894,13 +894,12 @@ int vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb)
if (v->field_mode) { if (v->field_mode) {
if (!v->refdist_flag) if (!v->refdist_flag)
v->refdist = 0; v->refdist = 0;
else { else if ((v->s.pict_type != AV_PICTURE_TYPE_B) && (v->s.pict_type != AV_PICTURE_TYPE_BI)) {
if ((v->s.pict_type != AV_PICTURE_TYPE_B)
&& (v->s.pict_type != AV_PICTURE_TYPE_BI)) {
v->refdist = get_bits(gb, 2); v->refdist = get_bits(gb, 2);
if (v->refdist == 3) if (v->refdist == 3)
v->refdist += get_unary(gb, 0, 16); v->refdist += get_unary(gb, 0, 16);
} else { }
if ((v->s.pict_type == AV_PICTURE_TYPE_B) || (v->s.pict_type == AV_PICTURE_TYPE_BI)) {
v->bfraction_lut_index = get_vlc2(gb, ff_vc1_bfraction_vlc.table, VC1_BFRACTION_VLC_BITS, 1); v->bfraction_lut_index = get_vlc2(gb, ff_vc1_bfraction_vlc.table, VC1_BFRACTION_VLC_BITS, 1);
v->bfraction = ff_vc1_bfraction_lut[v->bfraction_lut_index]; v->bfraction = ff_vc1_bfraction_lut[v->bfraction_lut_index];
v->frfd = (v->bfraction * v->refdist) >> 8; v->frfd = (v->bfraction * v->refdist) >> 8;
...@@ -908,7 +907,6 @@ int vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb) ...@@ -908,7 +907,6 @@ int vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb)
if (v->brfd < 0) if (v->brfd < 0)
v->brfd = 0; v->brfd = 0;
} }
}
goto parse_common_info; goto parse_common_info;
} }
if (v->fcm == PROGRESSIVE) { if (v->fcm == PROGRESSIVE) {
......
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