shithub: opus

Download patch

ref: f2729ded66feac2ca5b6acbb52137b076d29e9ef
parent: fac68ce189a768b4f18bba88d33c10b5cec11649
author: Jean-Marc Valin <[email protected]>
date: Fri Nov 2 14:47:47 EDT 2012

Fixes a fixed-point divide-by-zero issue

--- a/celt/celt.c
+++ b/celt/celt.c
@@ -372,7 +372,7 @@
       }
 #endif
 
-      mean=EPSILON;
+      mean=0;
       mem0=0;
       /*  Grouping by two to reduce complexity */
       len/=2;
@@ -407,7 +407,7 @@
          ratio */
 
       /* Inverse of the mean energy in Q15+6 */
-      norm = SHL32(EXTEND32(len),6+14)/SHR32(mean,1);
+      norm = SHL32(EXTEND32(len),6+14)/ADD32(EPSILON,SHR32(mean,1));
       /* Compute harmonic mean discarding the unreliable boundaries
          The data is smooth, so we only take 1/4th of the samples */
       unmask=0;