]> git.sesse.net Git - ffmpeg/commitdiff
dxva2_h264: fix signaling of mbaff frames
authorHendrik Leppkes <h.leppkes@gmail.com>
Mon, 27 Feb 2012 16:21:16 +0000 (17:21 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 24 Jun 2012 01:22:31 +0000 (03:22 +0200)
The MBAFF flag may only be signaled if we're actually dealing with
a full frame, and not singular fields, as it can happen in mixed content.

Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/dxva2_h264.c

index 3bda097cc478b74a0729860df33e9211c928fd31..6114a77f5a23601b41465d162754dd8334a9c9b7 100644 (file)
@@ -93,7 +93,8 @@ static void fill_picture_parameters(struct dxva_context *ctx, const H264Context
     pp->num_ref_frames                = h->sps.ref_frame_count;
 
     pp->wBitFields                    = ((s->picture_structure != PICT_FRAME) <<  0) |
-                                        (h->sps.mb_aff                        <<  1) |
+                                        ((h->sps.mb_aff &&
+                                        (s->picture_structure == PICT_FRAME)) <<  1) |
                                         (h->sps.residual_color_transform_flag <<  2) |
                                         /* sp_for_switch_flag (not implemented by FFmpeg) */
                                         (0                                    <<  3) |