lavf/deinterlace_qsv: set specific field for repeat
authorLinjie Fu <linjie.fu@intel.com>
Fri, 8 Mar 2019 15:34:01 +0000 (23:34 +0800)
committerZhong Li <zhong.li@intel.com>
Fri, 8 Mar 2019 07:08:16 +0000 (15:08 +0800)
Set specific field for repeat in PicStruct if the frame has repeat
flag.

Match the CheckInputPicStruct in MSDK.

Fix #7701.

Signed-off-by: Linjie Fu <linjie.fu@intel.com>
Signed-off-by: Zhong Li <zhong.li@intel.com>
libavfilter/vf_deinterlace_qsv.c

index d6b02e9..bee10c2 100644 (file)
@@ -419,9 +419,11 @@ static int submit_frame(AVFilterContext *ctx, AVFrame *frame,
     qf->surface.Info.PicStruct = !qf->frame->interlaced_frame ? MFX_PICSTRUCT_PROGRESSIVE :
                                  (qf->frame->top_field_first ? MFX_PICSTRUCT_FIELD_TFF :
                                                            MFX_PICSTRUCT_FIELD_BFF);
-    if (qf->frame->repeat_pict == 1)
+    if (qf->frame->repeat_pict == 1) {
         qf->surface.Info.PicStruct |= MFX_PICSTRUCT_FIELD_REPEATED;
-    else if (qf->frame->repeat_pict == 2)
+        qf->surface.Info.PicStruct |= qf->frame->top_field_first ? MFX_PICSTRUCT_FIELD_TFF :
+                                                            MFX_PICSTRUCT_FIELD_BFF;
+    } else if (qf->frame->repeat_pict == 2)
         qf->surface.Info.PicStruct |= MFX_PICSTRUCT_FRAME_DOUBLING;
     else if (qf->frame->repeat_pict == 4)
         qf->surface.Info.PicStruct |= MFX_PICSTRUCT_FRAME_TRIPLING;