[xiph-commits] r16484 - trunk/theora/lib
xiphmont at svn.xiph.org
xiphmont at svn.xiph.org
Tue Aug 18 15:39:29 PDT 2009
Author: xiphmont
Date: 2009-08-18 15:39:28 -0700 (Tue, 18 Aug 2009)
New Revision: 16484
Modified:
trunk/theora/lib/rate.c
Log:
The code in select_qi that looks for budget underflow and
force-reduces the log_qtarget was predicated on "if drop frames are
enabled and not infinite-buffer two pass mode". This was primarily
driven by use cases at the time and is subtly inappropriate.
Modify the predication to 'if we don't have a minimum quality level';
this allows proper behavior in the case where we have a minimum
quality level but aren't using 'soft-target'. Otherwise, lambda could
still drop to min when we were trying to force a minimum qi, which
results in what look like 'waterfalls' as SKIP triggers on large
number of blocks but the quantizer is still very fine.
Modified: trunk/theora/lib/rate.c
===================================================================
--- trunk/theora/lib/rate.c 2009-08-18 21:56:31 UTC (rev 16483)
+++ trunk/theora/lib/rate.c 2009-08-18 22:39:28 UTC (rev 16484)
@@ -672,7 +672,11 @@
next buf_delay frames.
However, we could bust the budget on the very next frame, so check for that
here, if we're not using a soft target.*/
- if(!_enc->rc.cap_underflow||_enc->rc.drop_frames){
+ /* Disabled when our minimum qi > 0; if we saturate log_qtarget to
+ to the maximum possible size when we have a minimum qi, the
+ resulting lambda will interact very strangely with SKIP. The
+ resulting artifacts look like waterfalls. */
+ if(_enc->state.info.quality==0){
ogg_int64_t log_hard_limit;
/*Compute the maximum number of bits we can use in the next frame.
Allow 50% of the rate for a single frame for prediction error.
@@ -704,6 +708,8 @@
ogg_int64_t log_scale;
int dropped;
dropped=0;
+ /* Drop frames also disabled for now in the case of infinite-buffer
+ two-pass mode */
if(!_enc->rc.drop_frames||_enc->rc.twopass&&_enc->rc.frame_metrics==NULL){
_droppable=0;
}
More information about the commits
mailing list