shithub: opus

Download patch

ref: 59618a5fa202799b98720f2289227edb06a0f9c4
parent: c1acbe08185125ae688e5fbfb862320652ddd1a1
author: Jean-Marc Valin <jmvalin@jmvalin.ca>
date: Mon Nov 16 18:03:17 EST 2015

Quality: removes VBR attenuation at low bitrate

Turns out that even low bitrates benefit from VBR

--- a/celt/celt_encoder.c
+++ b/celt/celt_encoder.c
@@ -1279,21 +1279,11 @@
       /*printf("%f %d\n", maxDepth, floor_depth);*/
    }
 
-   if ((!has_surround_mask||lfe) && (constrained_vbr || bitrate<64000))
+   /* Make VBR less aggressive for constrained VBR because we can't keep a higher bitrate
+      for long. Needs tuning. */
+   if ((!has_surround_mask||lfe) && constrained_vbr)
    {
-      opus_val16 rate_factor = Q15ONE;
-      if (bitrate < 64000)
-      {
-#ifdef FIXED_POINT
-         rate_factor = MAX16(0,(bitrate-32000));
-#else
-         rate_factor = MAX16(0,(1.f/32768)*(bitrate-32000));
-#endif
-      }
-      if (constrained_vbr)
-         rate_factor = MIN16(rate_factor, QCONST16(0.67f, 15));
-      target = base_target + (opus_int32)MULT16_32_Q15(rate_factor, target-base_target);
-
+      target = base_target + (opus_int32)MULT16_32_Q15(QCONST16(0.67f, 15), target-base_target);
    }
 
    if (!has_surround_mask && tf_estimate < QCONST16(.2f, 14))