diff options
author | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2016-07-25 00:40:44 +0300 |
---|---|---|
committer | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2016-07-25 04:35:24 +0300 |
commit | 1a37d4e15ccb189373dac9fb7b3d3e028051b121 (patch) | |
tree | 3ff61fb4a1f2935fe439781cabb497c6771ec013 /celt/celt_decoder.c | |
parent | e32cd2729ea5db22071768c2468cb78454541138 (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.c | 6 |
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; } |