summaryrefslogtreecommitdiff
path: root/gst-libs
diff options
context:
space:
mode:
authorHe Junyan <junyan.he@intel.com>2020-07-02 23:33:31 +0800
committerHe Junyan <junyan.he@intel.com>2020-07-30 17:41:53 +0800
commit579aa4cab1910d87c548b195dead6583b3704529 (patch)
treeb40767f737e2013abb5e9442365480abeaa82dae /gst-libs
parentdaecc5bfa1e7141e504cd021fd7a63a518be7aec (diff)
libs: encoder: h265: No need to check hw_max_profile.
In h265, higher profile idc number does not mean better compression performance and may be not compatible with the lower profile idc. So, it is not suitable to find the heighest idc for hw to ensure the compatibility. On the other side, when the entrypoint of the selected profile is valid, it means the hw really support this profile, no need to check it again. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/349>
Diffstat (limited to 'gst-libs')
-rw-r--r--gst-libs/gst/vaapi/gstvaapiencoder_h265.c38
1 files changed, 0 insertions, 38 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapiencoder_h265.c b/gst-libs/gst/vaapi/gstvaapiencoder_h265.c
index 0e0a766d05..17e7a4d138 100644
--- a/gst-libs/gst/vaapi/gstvaapiencoder_h265.c
+++ b/gst-libs/gst/vaapi/gstvaapiencoder_h265.c
@@ -98,7 +98,6 @@ struct _GstVaapiEncoderH265
GstVaapiEntrypoint entrypoint;
guint8 profile_idc;
guint8 max_profile_idc;
- guint8 hw_max_profile_idc;
guint8 level_idc;
guint32 idr_period;
guint32 init_qp;
@@ -1058,37 +1057,6 @@ _check_vps_sps_pps_status (GstVaapiEncoderH265 * encoder,
}
}
-/* Determines the largest supported profile by the underlying hardware */
-static gboolean
-ensure_hw_profile_limits (GstVaapiEncoderH265 * encoder)
-{
- GstVaapiDisplay *const display = GST_VAAPI_ENCODER_DISPLAY (encoder);
- GArray *profiles;
- guint i, profile_idc, max_profile_idc;
-
- if (encoder->hw_max_profile_idc)
- return TRUE;
-
- profiles = gst_vaapi_display_get_encode_profiles (display);
- if (!profiles)
- return FALSE;
-
- max_profile_idc = 0;
- for (i = 0; i < profiles->len; i++) {
- const GstVaapiProfile profile =
- g_array_index (profiles, GstVaapiProfile, i);
- profile_idc = gst_vaapi_utils_h265_get_profile_idc (profile);
- if (!profile_idc)
- continue;
- if (max_profile_idc < profile_idc)
- max_profile_idc = profile_idc;
- }
- g_array_unref (profiles);
-
- encoder->hw_max_profile_idc = max_profile_idc;
- return TRUE;
-}
-
/* Derives the profile supported by the underlying hardware */
static gboolean
ensure_hw_profile (GstVaapiEncoderH265 * encoder)
@@ -2300,12 +2268,6 @@ ensure_profile_tier_level (GstVaapiEncoderH265 * encoder)
return GST_VAAPI_ENCODER_STATUS_ERROR_UNSUPPORTED_PROFILE;
}
- /* Check HW constraints */
- if (!ensure_hw_profile_limits (encoder))
- return GST_VAAPI_ENCODER_STATUS_ERROR_UNSUPPORTED_PROFILE;
- if (encoder->profile_idc > encoder->hw_max_profile_idc)
- return GST_VAAPI_ENCODER_STATUS_ERROR_UNSUPPORTED_PROFILE;
-
/* Ensure bitrate if not set already and derive the right level to use */
ensure_bitrate (encoder);