X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fcelp_math.c;h=090b9d82074d0e97e9f6f00cdf9fce991fe0db64;hb=c9a96ec3c7b515ed3cfaf6614ed75da03b63512e;hp=d85277f2097adc32e11e2b79ee2310ae09a7f9e3;hpb=de2cfb744a207cc09bc961c859d7ae91cb6192b4;p=ffmpeg diff --git a/libavcodec/celp_math.c b/libavcodec/celp_math.c index d85277f2097..090b9d82074 100644 --- a/libavcodec/celp_math.c +++ b/libavcodec/celp_math.c @@ -22,8 +22,8 @@ #include #include -#include +#include "libavutil/avassert.h" #include "avcodec.h" #include "mathops.h" #include "celp_math.h" @@ -80,7 +80,7 @@ int16_t ff_cos(uint16_t arg) uint8_t offset= arg; uint8_t ind = arg >> 8; - assert(arg < 0x4000); + av_assert2(arg < 0x4000); return FFMAX(base_cos[ind] + ((slope_cos[ind] * offset) >> 12), -0x8000); } @@ -91,7 +91,7 @@ int ff_exp2(uint16_t power) uint16_t frac_dx; int result; - assert(power <= 0x7fff); + av_assert2(power <= 0x7fff); frac_x0 = power >> 10; frac_dx = (power & 0x03ff) << 5; @@ -140,7 +140,7 @@ int16_t ff_cos(uint16_t arg) uint8_t offset= arg; uint8_t ind = arg >> 8; - assert(arg <= 0x3fff); + av_assert2(arg <= 0x3fff); return tab_cos[ind] + (offset * (tab_cos[ind+1] - tab_cos[ind]) >> 8); } @@ -149,7 +149,7 @@ int ff_exp2(uint16_t power) { unsigned int result= exp2a[power>>10] + 0x10000; - assert(power <= 0x7fff); + av_assert2(power <= 0x7fff); result= (result<<3) + ((result*exp2b[(power>>5)&31])>>17); return result + ((result*(power&31)*89)>>22); @@ -218,3 +218,11 @@ float ff_dot_productf(const float* a, const float* b, int length) return sum; } + +void ff_celp_math_init(CELPMContext *c) +{ + c->dot_productf = ff_dot_productf; + + if(HAVE_MIPSFPU) + ff_celp_math_init_mips(c); +}