theoraenc: do not automatically override quality when using target bitrate

If both quality and bitrate are set, libtheora will try to meet
both constraints, causing it to prefer emitting a smaller number
of good frames, to emitting the full number of frames that would
not meet the requested quality. This causes a slideshow effect
when the bitrate is low and the quality is high. And the default
theoraenc is high (48/63).

So only set quality when it is requested, and leave it unset
otherwise.

https://bugzilla.gnome.org/show_bug.cgi?id=658443
This commit is contained in:
Vincent Penquerc'h 2011-09-07 11:06:44 +01:00 committed by Sebastian Dröge
parent 07e118ff24
commit cea0ac790f

View file

@ -508,7 +508,13 @@ theora_enc_reset (GstTheoraEnc * enc)
GST_OBJECT_LOCK (enc);
enc->info.target_bitrate = enc->video_bitrate;
enc->info.quality = enc->video_quality;
if (enc->quality_changed) {
enc->info.quality = enc->video_quality;
} else {
if (enc->video_bitrate == 0) {
enc->info.quality = enc->video_quality;
}
}
enc->bitrate_changed = FALSE;
enc->quality_changed = FALSE;
GST_OBJECT_UNLOCK (enc);