summaryrefslogtreecommitdiff
path: root/celt/bands.c
diff options
context:
space:
mode:
authorJean-Marc Valin <jmvalin@jmvalin.ca>2013-06-17 16:37:41 -0400
committerJean-Marc Valin <jmvalin@jmvalin.ca>2013-06-17 16:37:41 -0400
commitb9176a4c3e6f0b8cbe4a309afbe117069b9d32e5 (patch)
treee6102c4692a25f6a9f1ac618fe9a6ad44301cc51 /celt/bands.c
parentff31b79016082034330263ee14ab995bc9c7101d (diff)
downloadopus-b9176a4c3e6f0b8cbe4a309afbe117069b9d32e5.tar.gz
Makes dual_inner_prod() more generic to increase its use
Diffstat (limited to 'celt/bands.c')
-rw-r--r--celt/bands.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/celt/bands.c b/celt/bands.c
index f55a8fe0..93bd0bc7 100644
--- a/celt/bands.c
+++ b/celt/bands.c
@@ -41,6 +41,7 @@
#include "mathops.h"
#include "rate.h"
#include "quant_bands.h"
+#include "pitch.h"
int hysteresis_decision(opus_val16 val, const opus_val16 *thresholds, const opus_val16 *hysteresis, int N, int prev)
{
@@ -383,11 +384,7 @@ static void stereo_merge(celt_norm *X, celt_norm *Y, opus_val16 mid, int N)
opus_val32 t, lgain, rgain;
/* Compute the norm of X+Y and X-Y as |X|^2 + |Y|^2 +/- sum(xy) */
- for (j=0;j<N;j++)
- {
- xp = MAC16_16(xp, X[j], Y[j]);
- side = MAC16_16(side, Y[j], Y[j]);
- }
+ dual_inner_prod(Y, X, Y, N, &xp, &side);
/* Compensating for the mid normalization */
xp = MULT16_32_Q15(mid, xp);
/* mid and side are in Q15, not Q14 like X and Y */