Avoid the unnecessary resynth averaging on intensity switch when encoding.
authorGregory Maxwell <greg@xiph.org>
Sun, 6 May 2012 03:12:50 +0000 (23:12 -0400)
committerGregory Maxwell <greg@xiph.org>
Sun, 6 May 2012 03:12:50 +0000 (23:12 -0400)
Prevents some arithmetic on uninitialized memory that may contain nans.

celt/bands.c

index ff15adc..ebe04ae 100644 (file)
@@ -1267,8 +1267,9 @@ void quant_all_bands(int encode, const CELTMode *m, int start, int end,
 
          /* Switch off dual stereo to do intensity */
          dual_stereo = 0;
-         for (j=M*eBands[start];j<M*eBands[i];j++)
-            norm[j] = HALF32(norm[j]+norm2[j]);
+         if (resynth)
+            for (j=M*eBands[start];j<M*eBands[i];j++)
+               norm[j] = HALF32(norm[j]+norm2[j]);
       }
       if (dual_stereo)
       {