We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 866d860 commit 8a9980fCopy full SHA for 8a9980f
celt/bands.c
@@ -389,14 +389,15 @@ static void intensity_stereo(const CELTMode *m, celt_norm * OPUS_RESTRICT X, con
389
left = VSHR32(bandE[i],shift);
390
right = VSHR32(bandE[i+m->nbEBands],shift);
391
norm = EPSILON + celt_sqrt(EPSILON+MULT16_16(left,left)+MULT16_16(right,right));
392
- a1 = DIV32_16(SHL32(EXTEND32(left),14),norm);
393
- a2 = DIV32_16(SHL32(EXTEND32(right),14),norm);
+#ifdef FIXED_POINT
+ left = MIN32(left, norm-1);
394
+ right = MIN32(right, norm-1);
395
+#endif
396
+ a1 = DIV32_16(SHL32(EXTEND32(left),15),norm);
397
+ a2 = DIV32_16(SHL32(EXTEND32(right),15),norm);
398
for (j=0;j<N;j++)
399
{
- opus_val16 r, l;
- l = EXTRACT16(PSHR32(X[j], NORM_SHIFT-14));
- r = EXTRACT16(PSHR32(Y[j], NORM_SHIFT-14));
- X[j] = PSHR32(MAC16_16(MULT16_16(a1, l), a2, r), 28-NORM_SHIFT);
400
+ X[j] = ADD32(MULT16_32_Q15(a1, X[j]), MULT16_32_Q15(a2, Y[j]));
401
/* Side is not encoded, no need to calculate */
402
}
403
0 commit comments