[FFmpeg-cvslog] lavc/qsv: add support for decoding & encoding 10bit 4:4:4 content

Haihao Xiang git at videolan.org
Mon Oct 10 06:15:26 EEST 2022


ffmpeg | branch: master | Haihao Xiang <haihao.xiang at intel.com> | Thu Oct  6 15:35:36 2022 +0800| [1898dbddd5dcf2d3e955b84eeafa91862988dbfa] | committer: Haihao Xiang

lavc/qsv: add support for decoding & encoding 10bit 4:4:4 content

AV_PIX_FMT_XV30 is used in FFmpeg and MFX_FOURCC_Y410 is used in the
SDK.

Signed-off-by: Haihao Xiang <haihao.xiang at intel.com>

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

 libavcodec/qsv.c         | 9 +++++++++
 libavcodec/qsvdec.c      | 2 ++
 libavcodec/qsvenc_hevc.c | 1 +
 libavcodec/qsvenc_vp9.c  | 1 +
 4 files changed, 13 insertions(+)

diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c
index 4e11b33a7d..f38c617fc3 100644
--- a/libavcodec/qsv.c
+++ b/libavcodec/qsv.c
@@ -212,6 +212,7 @@ enum AVPixelFormat ff_qsv_map_fourcc(uint32_t fourcc)
     case MFX_FOURCC_YUY2: return AV_PIX_FMT_YUYV422;
     case MFX_FOURCC_Y210: return AV_PIX_FMT_Y210;
     case MFX_FOURCC_AYUV: return AV_PIX_FMT_VUYX;
+    case MFX_FOURCC_Y410: return AV_PIX_FMT_XV30;
 #endif
     }
     return AV_PIX_FMT_NONE;
@@ -254,6 +255,10 @@ int ff_qsv_map_pixfmt(enum AVPixelFormat format, uint32_t *fourcc, uint16_t *shi
         *fourcc = MFX_FOURCC_AYUV;
         *shift = 0;
         return AV_PIX_FMT_VUYX;
+    case AV_PIX_FMT_XV30:
+        *fourcc = MFX_FOURCC_Y410;
+        *shift = 0;
+        return AV_PIX_FMT_XV30;
 #endif
     default:
         return AVERROR(ENOSYS);
@@ -298,6 +303,10 @@ int ff_qsv_map_frame_to_surface(const AVFrame *frame, mfxFrameSurface1 *surface)
         surface->Data.A = frame->data[0] + 3;
         break;
 
+    case AV_PIX_FMT_XV30:
+        surface->Data.U = frame->data[0];
+        break;
+
     default:
         return AVERROR(ENOSYS);
     }
diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c
index 0254a394bd..912d58965a 100644
--- a/libavcodec/qsvdec.c
+++ b/libavcodec/qsvdec.c
@@ -142,6 +142,7 @@ static int qsv_get_continuous_buffer(AVCodecContext *avctx, AVFrame *frame,
         break;
     case AV_PIX_FMT_Y210:
     case AV_PIX_FMT_VUYX:
+    case AV_PIX_FMT_XV30:
         frame->linesize[0] = 4 * FFALIGN(avctx->width, 128);
         break;
     default:
@@ -1043,6 +1044,7 @@ const FFCodec ff_##x##_qsv_decoder = { \
                                                     AV_PIX_FMT_YUYV422, \
                                                     AV_PIX_FMT_Y210, \
                                                     AV_PIX_FMT_VUYX, \
+                                                    AV_PIX_FMT_XV30, \
                                                     AV_PIX_FMT_QSV, \
                                                     AV_PIX_FMT_NONE }, \
     .hw_configs     = qsv_hw_configs, \
diff --git a/libavcodec/qsvenc_hevc.c b/libavcodec/qsvenc_hevc.c
index a5bf915954..1e1574a6f2 100644
--- a/libavcodec/qsvenc_hevc.c
+++ b/libavcodec/qsvenc_hevc.c
@@ -316,6 +316,7 @@ const FFCodec ff_hevc_qsv_encoder = {
                                                     AV_PIX_FMT_BGRA,
                                                     AV_PIX_FMT_X2RGB10,
                                                     AV_PIX_FMT_VUYX,
+                                                    AV_PIX_FMT_XV30,
                                                     AV_PIX_FMT_NONE },
     .p.priv_class   = &class,
     .defaults       = qsv_enc_defaults,
diff --git a/libavcodec/qsvenc_vp9.c b/libavcodec/qsvenc_vp9.c
index 044a882d1a..d0340ef94b 100644
--- a/libavcodec/qsvenc_vp9.c
+++ b/libavcodec/qsvenc_vp9.c
@@ -115,6 +115,7 @@ const FFCodec ff_vp9_qsv_encoder = {
                                                     AV_PIX_FMT_P010,
                                                     AV_PIX_FMT_VUYX,
                                                     AV_PIX_FMT_QSV,
+                                                    AV_PIX_FMT_XV30,
                                                     AV_PIX_FMT_NONE },
     .p.priv_class   = &class,
     .defaults       = qsv_enc_defaults,



More information about the ffmpeg-cvslog mailing list