shithub: opus

Download patch

ref: d17bc2e8cb2e5e43a1bbd1a0d17ae49ce7e3c365
parent: cb9471c07cfc21108a0736ff7e891789a2b5b1d4
author: Jean-Marc Valin <[email protected]>
date: Thu Oct 27 12:46:34 EDT 2011

Make CBR code a bit less aggressive about low rate

--- a/src/opus_encoder.c
+++ b/src/opus_encoder.c
@@ -897,7 +897,7 @@
         {
            st->silk_mode.maxBits = (st->silk_mode.bitRate * frame_size / (st->Fs * 8))*8;
            /* Reduce the initial target to make it easier to reach the CBR rate */
-           st->silk_mode.bitRate = 1;
+           st->silk_mode.bitRate = IMAX(1, st->silk_mode.bitRate-2000);
         }
         if (redundancy)
            st->silk_mode.maxBits -= st->silk_mode.maxBits/(1 + frame_size/(st->Fs/200));