Skip to content

Commit

Permalink
vc1: don't read the interpfrm and bfraction elements for interlaced f…
Browse files Browse the repository at this point in the history
…rames

This matches the spec as well as the reference decoder, and fixes a bug
with interlaced frame decoding.

Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
  • Loading branch information
Nevcairiel authored and Kostya Shishkov committed Jan 23, 2012
1 parent 50a3f9a commit 7662a53
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions libavcodec/vc1.c
Original file line number Diff line number Diff line change
Expand Up @@ -911,13 +911,15 @@ int vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb)
}
goto parse_common_info;
}
if (v->finterpflag)
v->interpfrm = get_bits1(gb);
if (v->s.pict_type == AV_PICTURE_TYPE_B) {
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];
if (v->bfraction == 0) {
v->s.pict_type = AV_PICTURE_TYPE_BI; /* XXX: should not happen here */
if (v->fcm == PROGRESSIVE) {
if (v->finterpflag)
v->interpfrm = get_bits1(gb);
if (v->s.pict_type == AV_PICTURE_TYPE_B) {
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];
if (v->bfraction == 0) {
v->s.pict_type = AV_PICTURE_TYPE_BI; /* XXX: should not happen here */
}
}
}

Expand Down

0 comments on commit 7662a53

Please sign in to comment.