summaryrefslogtreecommitdiff
path: root/libavcodec/vc1.c
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2012-01-13 18:41:21 +0100
committerKostya Shishkov <kostya.shishkov@gmail.com>2012-01-23 19:04:14 +0100
commit7662a532fbb83d5b3e559a7da58254e56cae3157 (patch)
treef05b6e6ddf222f8e26a942a575660b2d54b64021 /libavcodec/vc1.c
parent50a3f9a4bd7498d3cb2b12bac0ca6f562cbb8a73 (diff)
vc1: don't read the interpfrm and bfraction elements for interlaced frames
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>
Diffstat (limited to 'libavcodec/vc1.c')
-rw-r--r--libavcodec/vc1.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/libavcodec/vc1.c b/libavcodec/vc1.c
index d728f9beb4..0a70062893 100644
--- a/libavcodec/vc1.c
+++ b/libavcodec/vc1.c
@@ -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 */
+ }
}
}