Fixes a surround bug on loud signal
authorJean-Marc Valin <jmvalin@jmvalin.ca>
Tue, 23 May 2017 07:32:18 +0000 (03:32 -0400)
committerJean-Marc Valin <jmvalin@jmvalin.ca>
Tue, 23 May 2017 07:32:18 +0000 (03:32 -0400)
The constant was copied from the analysis code which uses +/-1 as float
scaling, but surround_analysis() uses +/-32767.

src/opus_multistream_encoder.c

index e82a57a..e56ad7f 100644 (file)
@@ -304,7 +304,7 @@ void surround_analysis(const CELTMode *celt_mode, const void *pcm, opus_val16 *b
          sum = celt_inner_prod(in, in, frame_size+overlap, 0);
          /* This should filter out both NaNs and ridiculous signals that could
             cause NaNs further down. */
-         if (!(sum < 1e9f) || celt_isnan(sum))
+         if (!(sum < 1e18f) || celt_isnan(sum))
          {
             OPUS_CLEAR(in, frame_size+overlap);
             preemph_mem[c] = 0;