[FFmpeg-devel] [PATCH, RFC] lavf/deinterlace_qsv: set TFF or BFF together with progressive

Linjie Fu linjie.fu at intel.com
Fri Feb 15 21:50:18 EET 2019


Currently, BFF or TFF will not be set if the frame is progressive.
This will break the Input PicStruct check in MSDK because of absence of
the specific PicStruct check for:
MFX_PICSTRUCT_PROGRESSIVE | MFX_PICSTRUCT_FIELD_REPEATED

Set PicStruct to MFX_PICSTRUCT_FIELD_TFF or MFX_PICSTRUCT_FIELD_BFF to
match the CheckInputPicStruct in MSDK.

Fix #7701.

Signed-off-by: Linjie Fu <linjie.fu at intel.com>
---
Is it acceptable to add the TFF or BFF to PicStruct according to the
attribute of the input frames, even if it's not interlaced?
Or it should be fixed in MSDK level to support more PicStruct?

 libavfilter/vf_deinterlace_qsv.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavfilter/vf_deinterlace_qsv.c b/libavfilter/vf_deinterlace_qsv.c
index d6b02e98c5..f03d65f029 100644
--- a/libavfilter/vf_deinterlace_qsv.c
+++ b/libavfilter/vf_deinterlace_qsv.c
@@ -417,8 +417,9 @@ static int submit_frame(AVFilterContext *ctx, AVFrame *frame,
     qf->surface.Info.CropH  = qf->frame->height;
 
     qf->surface.Info.PicStruct = !qf->frame->interlaced_frame ? MFX_PICSTRUCT_PROGRESSIVE :
-                                 (qf->frame->top_field_first ? MFX_PICSTRUCT_FIELD_TFF :
-                                                           MFX_PICSTRUCT_FIELD_BFF);
+                                                                MFX_PICSTRUCT_UNKNOWN;
+    qf->surface.Info.PicStruct |= qf->frame->top_field_first ? MFX_PICSTRUCT_FIELD_TFF :
+                                                               MFX_PICSTRUCT_FIELD_BFF;
     if (qf->frame->repeat_pict == 1)
         qf->surface.Info.PicStruct |= MFX_PICSTRUCT_FIELD_REPEATED;
     else if (qf->frame->repeat_pict == 2)
-- 
2.17.1



More information about the ffmpeg-devel mailing list