Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.xiph.org/xiph/opus.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Marc Valin <jmvalin@jmvalin.ca>2016-07-25 00:40:44 +0300
committerJean-Marc Valin <jmvalin@jmvalin.ca>2016-07-25 04:35:24 +0300
commit1a37d4e15ccb189373dac9fb7b3d3e028051b121 (patch)
tree3ff61fb4a1f2935fe439781cabb497c6771ec013 /celt/celt_decoder.c
parente32cd2729ea5db22071768c2468cb78454541138 (diff)
Saturate MDCT output post-TDAC rather than pre-
Gives us a tighter bound on the pitch postfilter input to avoid overflows
Diffstat (limited to 'celt/celt_decoder.c')
-rw-r--r--celt/celt_decoder.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/celt/celt_decoder.c b/celt/celt_decoder.c
index 6f7b34d3..0d9364d8 100644
--- a/celt/celt_decoder.c
+++ b/celt/celt_decoder.c
@@ -345,6 +345,12 @@ void celt_synthesis(const CELTMode *mode, celt_norm *X, celt_sig * out_syn[],
clt_mdct_backward(&mode->mdct, &freq[b], out_syn[c]+NB*b, mode->window, overlap, shift, B, arch);
} while (++c<CC);
}
+ /* Saturate IMDCT output so that we can't overflow in the pitch postfilter
+ or in the */
+ c=0; do {
+ for (i=0;i<N;i++)
+ out_syn[c][i] = SATURATE(out_syn[c][i], SIG_SAT);
+ } while (++c<CC);
RESTORE_STACK;
}