plugin: encode: Add H265 main-444 profile.
authorHe Junyan <junyan.he@hotmail.com>
Fri, 21 Jun 2019 16:44:25 +0000 (00:44 +0800)
committerVíctor Manuel Jáquez Leal <vjaquez@igalia.com>
Fri, 17 Jan 2020 11:02:44 +0000 (11:02 +0000)
Expose the main-444 profile to h265enc caps, when the upstream
chooses to use VUYA as input, we choose main 4:4:4 profile to encode
the frames.

gst-libs/gst/vaapi/gstvaapiencoder.c
gst-libs/gst/vaapi/gstvaapiencoder_h265.c
gst-libs/gst/vaapi/gstvaapiutils_h265.c
gst/vaapi/gstvaapiencode_h265.c

index 690caf7..771a82b 100644 (file)
@@ -677,7 +677,8 @@ is_chroma_type_supported (GstVaapiEncoder * encoder)
 
   if (cip->chroma_type != GST_VAAPI_CHROMA_TYPE_YUV420 &&
       cip->chroma_type != GST_VAAPI_CHROMA_TYPE_YUV422 &&
-      cip->chroma_type != GST_VAAPI_CHROMA_TYPE_YUV420_10BPP)
+      cip->chroma_type != GST_VAAPI_CHROMA_TYPE_YUV420_10BPP &&
+      cip->chroma_type != GST_VAAPI_CHROMA_TYPE_YUV444)
     goto unsupported;
 
   if (!get_config_attribute (encoder, VAConfigAttribRTFormat, &format))
index 9914237..8f5cd91 100644 (file)
@@ -1082,6 +1082,8 @@ ensure_profile (GstVaapiEncoderH265 * encoder)
 
   if (format == GST_VIDEO_FORMAT_P010_10LE)
     profile = GST_VAAPI_PROFILE_H265_MAIN10;
+  else if (format == GST_VIDEO_FORMAT_VUYA)
+    profile = GST_VAAPI_PROFILE_H265_MAIN_444;
 
   encoder->profile = profile;
   encoder->profile_idc = gst_vaapi_utils_h265_get_profile_idc (profile);
index 5b3bef1..2c078e8 100644 (file)
@@ -40,6 +40,7 @@ static const struct map gst_vaapi_h265_profile_map[] = {
   { GST_VAAPI_PROFILE_H265_MAIN,                 "main"                 },
   { GST_VAAPI_PROFILE_H265_MAIN10,               "main-10"              },
   { GST_VAAPI_PROFILE_H265_MAIN_STILL_PICTURE,   "main-still-picture"   },
+  { GST_VAAPI_PROFILE_H265_MAIN_444,             "main-444"             },
   { 0, NULL }
 /* *INDENT-ON* */
 };
index a3325e6..67a319c 100644 (file)
@@ -65,7 +65,7 @@ static const char gst_vaapiencode_h265_sink_caps_str[] =
 /* *INDENT-OFF* */
 static const char gst_vaapiencode_h265_src_caps_str[] =
   GST_CODEC_CAPS ", "
-  "profile = (string) { main, main-10 }";
+  "profile = (string) { main, main-10, main-444 }";
 /* *INDENT-ON* */
 
 /* *INDENT-OFF* */