shithub: opus

Download patch

ref: 7a047ea09676f92253b54c7e45be520a1fea52f1
parent: 45f111058301102d1244a03b67110a8f0c45b89a
author: Jean-Marc Valin <[email protected]>
date: Wed Oct 21 20:23:56 EDT 2009

prevent busting at ridiculously low bit-rate VBR

--- a/libcelt/celt.c
+++ b/libcelt/celt.c
@@ -770,7 +770,9 @@
       celt_int32 vbr_bound, max_allowed;
 
       vbr_bound = st->vbr_rate;
-      max_allowed = (st->vbr_rate + vbr_bound - st->vbr_reservoir)>>(BITRES+3); 
+      max_allowed = (st->vbr_rate + vbr_bound - st->vbr_reservoir)>>(BITRES+3);
+      if (max_allowed < 4)
+         max_allowed = 4;
       if (max_allowed < nbCompressedBytes)
          nbCompressedBytes = max_allowed;
    }