changeset 11829:582c0687fc63 libavcodec

libvorbis: Disable strict bitrate management when not requested This is 3 times faster in a quick benchmark
author conrad
date Fri, 04 Jun 2010 22:40:40 +0000
parents 474766be9e4d
children 8a545fab1a90
files libvorbis.c
diffstat 1 files changed, 4 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/libvorbis.c	Fri Jun 04 22:40:36 2010 +0000
+++ b/libvorbis.c	Fri Jun 04 22:40:40 2010 +0000
@@ -68,11 +68,10 @@
                 avccontext->sample_rate, minrate, avccontext->bit_rate, maxrate))
             return -1;
 
-#ifdef OGGVORBIS_VBR_BY_ESTIMATE
-        /* variable bitrate by estimate */
-        if(vorbis_encode_ctl(vi, OV_ECTL_RATEMANAGE2_SET, NULL))
-            return -1;
-#endif
+        /* variable bitrate by estimate, disable slow rate management */
+        if(minrate == -1 && maxrate == -1)
+            if(vorbis_encode_ctl(vi, OV_ECTL_RATEMANAGE2_SET, NULL))
+                return -1;
     }
 
     /* cutoff frequency */