summaryrefslogtreecommitdiff
path: root/libavcodec/vc1.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-01-27 01:42:53 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-01-27 02:09:58 +0100
commit01fcbdf9cedcf14418b5886205261e532167f949 (patch)
tree8022d29d337142d81b3a05a0927a5ec90a67b25f /libavcodec/vc1.c
parenta8ae00b68cb9895f4a819950dbc740bc8fc7c1e1 (diff)
parent9adf25c1cf78dbf1d71bf386c49dc74cb8a60df0 (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: smacker: Sanity check huffman tables found in the headers. smacker: remove dead store qdm2: Check data block size for bytes to bits overflow. mxfdec: Fix files with essence containers larger than 2 GiB. mxfdec: Employ correct printf conversion specifiers for POSIX int types. vc1: always read the bfraction element for interlaced fields fate: add XWD image regression test lavf: prevent infinite loops while flushing in avformat_find_stream_info matroskadec: Pad AAC extradata. ismindex: Fix build on mingw Conflicts: libavformat/mxfdec.c libavformat/utils.c tests/lavf-regression.sh Merged-by: Michael Niedermayer <michaelni@gmx.at>
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 64884fcc50..a012967e3e 100644
--- a/libavcodec/vc1.c
+++ b/libavcodec/vc1.c
@@ -901,20 +901,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;
}