summaryrefslogtreecommitdiff
path: root/libavcodec/vc1.c
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2012-01-13 18:43:08 +0100
committerKostya Shishkov <kostya.shishkov@gmail.com>2012-01-26 15:19:27 +0100
commitfeaa40020b59e8abb2c70f2944a12cb068ab2850 (patch)
treec33714b1d1550d107032f4374fb5e6bd4daef9a4 /libavcodec/vc1.c
parent7de9af65c737baca4bea7d11695118673c9a1451 (diff)
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: Kostya Shishkov <kostya.shishkov@gmail.com>
Diffstat (limited to 'libavcodec/vc1.c')
-rw-r--r--libavcodec/vc1.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/libavcodec/vc1.c b/libavcodec/vc1.c
index 0a70062893..1394f2cd4b 100644
--- a/libavcodec/vc1.c
+++ b/libavcodec/vc1.c
@@ -894,20 +894,18 @@ int vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb)
if (v->field_mode) {
if (!v->refdist_flag)
v->refdist = 0;
- else {
- if ((v->s.pict_type != AV_PICTURE_TYPE_B)
- && (v->s.pict_type != AV_PICTURE_TYPE_BI)) {
- v->refdist = get_bits(gb, 2);
- if (v->refdist == 3)
- v->refdist += get_unary(gb, 0, 16);
- } else {
- 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->frfd = (v->bfraction * v->refdist) >> 8;
- v->brfd = v->refdist - v->frfd - 1;
- if (v->brfd < 0)
- v->brfd = 0;
- }
+ else if ((v->s.pict_type != AV_PICTURE_TYPE_B) && (v->s.pict_type != AV_PICTURE_TYPE_BI)) {
+ v->refdist = get_bits(gb, 2);
+ if (v->refdist == 3)
+ v->refdist += get_unary(gb, 0, 16);
+ }
+ 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 = ff_vc1_bfraction_lut[v->bfraction_lut_index];
+ v->frfd = (v->bfraction * v->refdist) >> 8;
+ v->brfd = v->refdist - v->frfd - 1;
+ if (v->brfd < 0)
+ v->brfd = 0;
}
goto parse_common_info;
}