[FFmpeg-cvslog] lavc/qsvdec: add function ff_qsv_map_picstruct()

Zhong Li git at videolan.org
Tue Aug 20 08:39:35 EEST 2019


ffmpeg | branch: master | Zhong Li <zhong.li at intel.com> | Tue Aug 13 14:11:07 2019 +0800| [f115a2b7635d9e47b1299661ddaa6ac2386e9db1] | committer: Zhong Li

lavc/qsvdec: add function ff_qsv_map_picstruct()

Signed-off-by: Zhong Li <zhong.li at intel.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f115a2b7635d9e47b1299661ddaa6ac2386e9db1
---

 libavcodec/qsv.c          | 18 ++++++++++++++++++
 libavcodec/qsv_internal.h |  2 ++
 2 files changed, 20 insertions(+)

diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c
index 986d4f6022..437ef7ca75 100644
--- a/libavcodec/qsv.c
+++ b/libavcodec/qsv.c
@@ -245,6 +245,24 @@ int ff_qsv_find_surface_idx(QSVFramesContext *ctx, QSVFrame *frame)
     return AVERROR_BUG;
 }
 
+enum AVFieldOrder ff_qsv_map_picstruct(int mfx_pic_struct)
+{
+    enum AVFieldOrder field = AV_FIELD_UNKNOWN;
+    switch (mfx_pic_struct & 0xF) {
+    case MFX_PICSTRUCT_PROGRESSIVE:
+        field = AV_FIELD_PROGRESSIVE;
+        break;
+    case MFX_PICSTRUCT_FIELD_TFF:
+        field = AV_FIELD_TT;
+        break;
+    case MFX_PICSTRUCT_FIELD_BFF:
+        field = AV_FIELD_BB;
+        break;
+    }
+
+    return field;
+}
+
 enum AVPictureType ff_qsv_map_pictype(int mfx_pic_type)
 {
     enum AVPictureType type;
diff --git a/libavcodec/qsv_internal.h b/libavcodec/qsv_internal.h
index b63a7d6a31..f701ceec8d 100644
--- a/libavcodec/qsv_internal.h
+++ b/libavcodec/qsv_internal.h
@@ -95,6 +95,8 @@ int ff_qsv_level_to_mfx(enum AVCodecID codec_id, int level);
 int ff_qsv_map_pixfmt(enum AVPixelFormat format, uint32_t *fourcc);
 enum AVPictureType ff_qsv_map_pictype(int mfx_pic_type);
 
+enum AVFieldOrder ff_qsv_map_picstruct(int mfx_pic_struct);
+
 int ff_qsv_init_internal_session(AVCodecContext *avctx, mfxSession *session,
                                  const char *load_plugins);
 



More information about the ffmpeg-cvslog mailing list