OSDN Git Service

dxva2_vc1: set bfraction in slice info according to spec
authorHendrik Leppkes <h.leppkes@gmail.com>
Thu, 12 Dec 2013 20:12:49 +0000 (21:12 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 1 Jan 2014 01:57:23 +0000 (02:57 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/dxva2_vc1.c

index 6ff5765..33309b1 100644 (file)
@@ -148,7 +148,7 @@ static void fill_slice(AVCodecContext *avctx, DXVA_SliceInfo *slice,
     slice->dwSliceBitsInBuffer = 8 * size;
     slice->dwSliceDataLocation = position;
     slice->bStartCodeBitOffset = 0;
-    slice->bReservedBits       = 0;
+    slice->bReservedBits       = (s->pict_type == AV_PICTURE_TYPE_B && !v->bi_type) ? v->bfraction_lut_index + 9 : 0;
     slice->wMBbitOffset        = get_bits_count(&s->gb);
     slice->wNumberMBsInSlice   = s->mb_width * s->mb_height; /* XXX We assume 1 slice */
     slice->wQuantizerScaleCode = v->pq;