From b87ff3449662e4f6b8415471dd4b7c76f06fbcda Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Fri, 13 Jan 2012 22:13:51 +0100 Subject: vc1: implement vc1 field interlaced dxva2 decoding Tested-by: Gwenole Beauchesne Signed-off-by: Michael Niedermayer --- libavcodec/dxva2_vc1.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'libavcodec/dxva2_vc1.c') diff --git a/libavcodec/dxva2_vc1.c b/libavcodec/dxva2_vc1.c index e47db4d9c1..ed4836dc8b 100644 --- a/libavcodec/dxva2_vc1.c +++ b/libavcodec/dxva2_vc1.c @@ -68,7 +68,7 @@ static void fill_picture_parameters(AVCodecContext *avctx, pp->bPicStructure |= 0x01; if (s->picture_structure & PICT_BOTTOM_FIELD) pp->bPicStructure |= 0x02; - pp->bSecondField = v->interlace && v->fcm != ILACE_FIELD && !s->first_field; + pp->bSecondField = v->interlace && v->fcm == ILACE_FIELD && v->second_field; pp->bPicIntra = s->pict_type == AV_PICTURE_TYPE_I || v->bi_type; pp->bPicBackwardPrediction = s->pict_type == AV_PICTURE_TYPE_B && !v->bi_type; pp->bBidirectionalAveragingMode = (1 << 7) | @@ -183,8 +183,11 @@ static int commit_bitstream_and_slice_buffer(AVCodecContext *avctx, result = data_size <= dxva_size ? 0 : -1; if (!result) { - if (start_code_size > 0) + if (start_code_size > 0) { memcpy(dxva_data, start_code, start_code_size); + if (v->second_field) + dxva_data[3] = 0x0c; + } memcpy(dxva_data + start_code_size, ctx_pic->bitstream + slice->dwSliceDataLocation, slice_size); if (padding > 0) -- cgit v1.2.3