summaryrefslogtreecommitdiff
path: root/gst-libs
diff options
context:
space:
mode:
authorSreerenj Balachandran <sreerenj.balachandran@intel.com>2017-06-09 14:02:20 -0700
committerVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2017-06-13 16:51:52 +0200
commit595f8b7d4baf118eb6b7bf0efbcf02ce0fead225 (patch)
tree559490de7a3f0086f3a33f77ca0b4edcb5325d37 /gst-libs
parenteee8a781735bfa1a69f35631bf907aaa7b5deec0 (diff)
libs: encoder: Fix the quality level clamping
Change the hard-coded range of quality-level from {1-8} to {1-7}, since it is the range Intel Open source driver supports. Also perform the range clamping only if the user provided quality-level is greater than the max-range suppored by the driver, because there could be non-intel drivers giving lower value than the hard-coded max value 7. https://bugzilla.gnome.org/show_bug.cgi?id=783567
Diffstat (limited to 'gst-libs')
-rw-r--r--gst-libs/gst/vaapi/gstvaapiencoder.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapiencoder.c b/gst-libs/gst/vaapi/gstvaapiencoder.c
index fb2d5dd8..4aeccc5b 100644
--- a/gst-libs/gst/vaapi/gstvaapiencoder.c
+++ b/gst-libs/gst/vaapi/gstvaapiencoder.c
@@ -188,9 +188,10 @@ gst_vaapi_encoder_properties_get_default (const GstVaapiEncoderClass * klass)
GST_VAAPI_ENCODER_PROPERTIES_APPEND (props,
GST_VAAPI_ENCODER_PROP_QUALITY_LEVEL,
g_param_spec_uint ("quality-level",
- "Quality Level",
- "Encoding Quality Level ", 1, 8,
- 4, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+ "Quality Level", "Encoding Quality Level "
+ "(lower value means higher-quality/slow-encode, "
+ " higher value means lower-quality/fast-encode)",
+ 1, 7, 4, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
return props;
}
@@ -840,8 +841,7 @@ gst_vaapi_encoder_reconfigure_internal (GstVaapiEncoder * encoder)
if (get_config_attribute (encoder, VAConfigAttribEncQualityRange,
&quality_level_max) && quality_level_max > 0) {
GST_VAAPI_ENCODER_QUALITY_LEVEL (encoder) =
- gst_util_uint64_scale_int_ceil (GST_VAAPI_ENCODER_QUALITY_LEVEL
- (encoder), quality_level_max, 8);
+ CLAMP (GST_VAAPI_ENCODER_QUALITY_LEVEL (encoder), 1, quality_level_max);
} else {
GST_VAAPI_ENCODER_QUALITY_LEVEL (encoder) = 0;
}