mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-14 13:21:28 +00:00
libs: encoder: h265: no need to check the high compression tune.
The h265 encoder just support tune mode: (0): none - None (3): low-power - Low power mode So, no need to check and set the high compression parameters. And by the way, the current ensure_tuning_high_compression manner of choosing the hightest profile idc as the best compression profile is not correct. Unlike h264, in h265 the higher profile idc number does not mean it has more compression tools, and so it has better compression performance. It may even be un-compatible with the lower profile idc. For example, the SCREEN_CONTENT_CODING profile with idc 9 is not compatible with 3D_MAIN profile with idc 8. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/348>
This commit is contained in:
parent
19903e1afc
commit
abea5e81c8
1 changed files with 0 additions and 40 deletions
|
@ -1249,44 +1249,6 @@ error_unsupported_level:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Derives the minimum tier from the active coding tools */
|
|
||||||
/* Enable "high-compression" tuning options */
|
|
||||||
static gboolean
|
|
||||||
ensure_tuning_high_compression (GstVaapiEncoderH265 * encoder)
|
|
||||||
{
|
|
||||||
guint8 profile_idc;
|
|
||||||
|
|
||||||
if (!ensure_hw_profile_limits (encoder))
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
profile_idc = encoder->hw_max_profile_idc;
|
|
||||||
if (encoder->max_profile_idc && encoder->max_profile_idc < profile_idc)
|
|
||||||
profile_idc = encoder->max_profile_idc;
|
|
||||||
|
|
||||||
/* Tuning options */
|
|
||||||
if (!encoder->num_bframes)
|
|
||||||
encoder->num_bframes = 3;
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Ensure tuning options */
|
|
||||||
static gboolean
|
|
||||||
ensure_tuning (GstVaapiEncoderH265 * encoder)
|
|
||||||
{
|
|
||||||
gboolean success;
|
|
||||||
|
|
||||||
switch (GST_VAAPI_ENCODER_TUNE (encoder)) {
|
|
||||||
case GST_VAAPI_ENCODER_TUNE_HIGH_COMPRESSION:
|
|
||||||
success = ensure_tuning_high_compression (encoder);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
success = TRUE;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return success;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Handle new GOP starts */
|
/* Handle new GOP starts */
|
||||||
static void
|
static void
|
||||||
reset_gop_start (GstVaapiEncoderH265 * encoder)
|
reset_gop_start (GstVaapiEncoderH265 * encoder)
|
||||||
|
@ -2327,8 +2289,6 @@ ensure_profile_tier_level (GstVaapiEncoderH265 * encoder)
|
||||||
const GstVaapiTierH265 tier = encoder->tier;
|
const GstVaapiTierH265 tier = encoder->tier;
|
||||||
const GstVaapiLevelH265 level = encoder->level;
|
const GstVaapiLevelH265 level = encoder->level;
|
||||||
|
|
||||||
ensure_tuning (encoder);
|
|
||||||
|
|
||||||
if (!ensure_profile (encoder) || !ensure_profile_limits (encoder))
|
if (!ensure_profile (encoder) || !ensure_profile_limits (encoder))
|
||||||
return GST_VAAPI_ENCODER_STATUS_ERROR_UNSUPPORTED_PROFILE;
|
return GST_VAAPI_ENCODER_STATUS_ERROR_UNSUPPORTED_PROFILE;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue