msdkh265enc: Add profile main10 still picture for hevc
authorMengkejiergeli Ba <mengkejiergeli.ba@intel.com>
Wed, 15 Sep 2021 08:32:02 +0000 (16:32 +0800)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Sat, 18 Sep 2021 06:04:56 +0000 (06:04 +0000)
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2524>

sys/msdk/gstmsdkh265enc.c
sys/msdk/gstmsdkh265enc.h

index 7fc5968..bd8914f 100644 (file)
@@ -96,7 +96,7 @@ enum
 #define PROP_DBLK_IDC_DEFAULT           0
 
 #define RAW_FORMATS "NV12, I420, YV12, YUY2, UYVY, BGRA, BGR10A2_LE, P010_10LE, VUYA"
-#define PROFILES    "main, main-10, main-444, main-still-picture"
+#define PROFILES    "main, main-10, main-444, main-still-picture, main-10-still-picture"
 #define COMMON_FORMAT "{ " RAW_FORMATS " }"
 #define PRFOLIE_STR   "{ " PROFILES " }"
 
@@ -326,7 +326,15 @@ gst_msdkh265enc_configure (GstMsdkEnc * encoder)
       encoder->param.mfx.CodecProfile = MFX_PROFILE_HEVC_MAIN10;
     else if (!strcmp (h265enc->profile_name, "main-still-picture"))
       encoder->param.mfx.CodecProfile = MFX_PROFILE_HEVC_MAINSP;
-    else if (!strcmp (h265enc->profile_name, "main-444") ||
+    else if (!strcmp (h265enc->profile_name, "main-10-still-picture")) {
+      encoder->param.mfx.CodecProfile = MFX_PROFILE_HEVC_MAIN10;
+      h265enc->ext_param.Header.BufferId = MFX_EXTBUFF_HEVC_PARAM;
+      h265enc->ext_param.Header.BufferSz = sizeof (h265enc->ext_param);
+      h265enc->ext_param.GeneralConstraintFlags =
+          MFX_HEVC_CONSTR_REXT_ONE_PICTURE_ONLY;
+      gst_msdkenc_add_extra_param (encoder,
+          (mfxExtBuffer *) & h265enc->ext_param);
+    } else if (!strcmp (h265enc->profile_name, "main-444") ||
         !strcmp (h265enc->profile_name, "main-422-10") ||
         !strcmp (h265enc->profile_name, "main-444-10") ||
         !strcmp (h265enc->profile_name, "main-12"))
index 9cb30fc..f4f06f7 100644 (file)
@@ -71,6 +71,7 @@ struct _GstMsdkH265Enc
   guint dblk_idc;
 
   mfxExtHEVCTiles ext_tiles;
+  mfxExtHEVCParam ext_param;
   /* roi[0] for current ROI and roi[1] for previous ROI */
   mfxExtEncoderROI roi[2];