shithub: opus

Download patch

ref: e45509294c0f965762cbb8e050157895480a28b7
parent: 8259492a7db58cd9c24f514546215098765caa26
author: Jean-Marc Valin <[email protected]>
date: Tue Jul 30 01:12:46 EDT 2013

Better handling of the dynalloc cap for CBR/CVBR

--- a/celt/celt_encoder.c
+++ b/celt/celt_encoder.c
@@ -974,7 +974,9 @@
          if ((!vbr || (constrained_vbr&&!isTransient))
                && (tot_boost+boost_bits)>>BITRES>>3 > effectiveBytes/4)
          {
-            offsets[i] = 0;
+            opus_int32 cap = ((effectiveBytes/4)<<BITRES<<3);
+            offsets[i] = cap-tot_boost;
+            tot_boost = cap;
             break;
          } else {
             offsets[i] = boost;