Mercurial > libavcodec.hg
diff celp_math.c @ 8090:1c07635d7334 libavcodec
Add ff_dot_productf() to celp_math.{c,h}
Part of the QCELP patch by Kenan Gillet, kenan.gillet gmail com
author | vitor |
---|---|
date | Thu, 30 Oct 2008 21:04:17 +0000 |
parents | ecb1962c12f3 |
children | 7818ed859f66 |
line wrap: on
line diff
--- a/celp_math.c Thu Oct 30 21:00:01 2008 +0000 +++ b/celp_math.c Thu Oct 30 21:04:17 2008 +0000 @@ -195,3 +195,14 @@ return (power_int << 15) + value; } + +float ff_dot_productf(const float* a, const float* b, int length) +{ + float sum = 0; + int i; + + for(i=0; i<length; i++) + sum += a[i] * b[i]; + + return sum; +}