fixed-point: fixing two overflows that didn't really affect quality

This commit is contained in:
Jean-Marc Valin 2009-07-01 09:59:21 -04:00
parent 7c422653f3
commit cd29b02773
3 changed files with 16 additions and 6 deletions

View file

@ -233,6 +233,8 @@ int compute_pitch_gain(const CELTMode *m, const celt_norm_t *X, const celt_norm_
Sxy = MAC16_16(Sxy, X[j], P[j]);
Sxx = MAC16_16(Sxx, X[j], X[j]);
}
Sxy = SHR32(Sxy,2);
Sxx = SHR32(Sxx,2);
/* No negative gain allowed */
if (Sxy < 0)
Sxy = 0;