mathops.h | mathops.h | |||
---|---|---|---|---|
skipping to change at line 121 | skipping to change at line 121 | |||
#ifndef OVERRIDE_CELT_ILOG2 | #ifndef OVERRIDE_CELT_ILOG2 | |||
/** Integer log in base2. Undefined for zero and negative numbers */ | /** Integer log in base2. Undefined for zero and negative numbers */ | |||
static inline opus_int16 celt_ilog2(opus_int32 x) | static inline opus_int16 celt_ilog2(opus_int32 x) | |||
{ | { | |||
celt_assert2(x>0, "celt_ilog2() only defined for strictly positive numbe rs"); | celt_assert2(x>0, "celt_ilog2() only defined for strictly positive numbe rs"); | |||
return EC_ILOG(x)-1; | return EC_ILOG(x)-1; | |||
} | } | |||
#endif | #endif | |||
#ifndef OVERRIDE_CELT_MAXABS16 | #ifndef OVERRIDE_CELT_MAXABS16 | |||
static inline opus_val16 celt_maxabs16(opus_val16 *x, int len) | static inline opus_val32 celt_maxabs16(const opus_val16 *x, int len) | |||
{ | { | |||
int i; | int i; | |||
opus_val16 maxval = 0; | opus_val16 maxval = 0; | |||
opus_val16 minval = 0; | ||||
for (i=0;i<len;i++) | for (i=0;i<len;i++) | |||
maxval = MAX16(maxval, ABS16(x[i])); | { | |||
return maxval; | maxval = MAX16(maxval, x[i]); | |||
minval = MIN16(minval, x[i]); | ||||
} | ||||
return MAX32(EXTEND32(maxval),-EXTEND32(minval)); | ||||
} | } | |||
#endif | #endif | |||
#ifndef OVERRIDE_CELT_MAXABS32 | #ifndef OVERRIDE_CELT_MAXABS32 | |||
static inline opus_val32 celt_maxabs32(opus_val32 *x, int len) | static inline opus_val32 celt_maxabs32(opus_val32 *x, int len) | |||
{ | { | |||
int i; | int i; | |||
opus_val32 maxval = 0; | opus_val32 maxval = 0; | |||
for (i=0;i<len;i++) | for (i=0;i<len;i++) | |||
maxval = MAX32(maxval, ABS32(x[i])); | maxval = MAX32(maxval, ABS32(x[i])); | |||
End of changes. 3 change blocks. | ||||
3 lines changed or deleted | 7 lines changed or added | |||
This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ |