mirror of
https://github.com/xiph/opus.git
synced 2025-05-28 06:09:15 +00:00
celt_maxabs16() now returns an opus_val32 to avoid problems with -32768
This commit is contained in:
parent
359306985b
commit
b7bd4c20ac
5 changed files with 10 additions and 10 deletions
|
@ -44,7 +44,7 @@
|
|||
unsigned isqrt32(opus_uint32 _val);
|
||||
|
||||
#ifndef OVERRIDE_CELT_MAXABS16
|
||||
static inline opus_val16 celt_maxabs16(const opus_val16 *x, int len)
|
||||
static inline opus_val32 celt_maxabs16(const opus_val16 *x, int len)
|
||||
{
|
||||
int i;
|
||||
opus_val16 maxval = 0;
|
||||
|
@ -54,7 +54,7 @@ static inline opus_val16 celt_maxabs16(const opus_val16 *x, int len)
|
|||
maxval = MAX16(maxval, x[i]);
|
||||
minval = MIN16(minval, x[i]);
|
||||
}
|
||||
return MAX16(maxval,-minval);
|
||||
return MAX32(EXTEND32(maxval),-EXTEND32(minval));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue