aboutsummaryrefslogtreecommitdiff
path: root/celt
diff options
context:
space:
mode:
authorGregory Maxwell <greg@xiph.org>2012-05-05 23:12:50 -0400
committerGregory Maxwell <greg@xiph.org>2012-05-05 23:12:50 -0400
commit37e135677afb86a7b0136d038e534553e34e243e (patch)
tree7b9444ebc08b45326a93977de71b895692eeff95 /celt
parenta403d5f7b5163abcb934aa18e4fc29799f3c7875 (diff)
downloadlibopus-37e135677afb86a7b0136d038e534553e34e243e.tar.gz
Avoid the unnecessary resynth averaging on intensity switch when encoding.
Prevents some arithmetic on uninitialized memory that may contain nans.
Diffstat (limited to 'celt')
-rw-r--r--celt/bands.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/celt/bands.c b/celt/bands.c
index ff15adcb..ebe04aee 100644
--- a/celt/bands.c
+++ b/celt/bands.c
@@ -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)
{