vp8enc: Fix quality to (constant) quantizer mapping

This now allows to select all possible quantizers between
0 and 63.

See bug #641405.
This commit is contained in:
Alexey Fisher 2011-05-18 13:18:58 +02:00 committed by Sebastian Dröge
parent b04b596c61
commit a9ea882307

View file

@ -242,7 +242,7 @@ gst_vp8_enc_class_init (GstVP8EncClass * klass)
g_object_class_install_property (gobject_class, PROP_QUALITY,
g_param_spec_double ("quality", "Quality",
"Quality",
"Quality. This parameter set constant quantizer.",
0, 10.0, DEFAULT_QUALITY,
(GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
@ -508,8 +508,8 @@ gst_vp8_enc_set_format (GstBaseVideoEncoder * base_video_encoder,
if (encoder->bitrate) {
cfg.rc_target_bitrate = encoder->bitrate / 1000;
} else {
cfg.rc_min_quantizer = 63 - encoder->quality * 5.0;
cfg.rc_max_quantizer = 63 - encoder->quality * 5.0;
cfg.rc_min_quantizer = (gint) (63 - encoder->quality * 6.2);
cfg.rc_max_quantizer = (gint) (63 - encoder->quality * 6.2);
cfg.rc_target_bitrate = encoder->bitrate;
}