diff options
author | Vitor Sessak <vitor1001@gmail.com> | 2008-07-06 10:32:29 +0000 |
---|---|---|
committer | Vitor Sessak <vitor1001@gmail.com> | 2008-07-06 10:32:29 +0000 |
commit | a5f0f504dfd70e4838502e4f85c08aa20900c382 (patch) | |
tree | 74752ccdbd86fe8d4890e949d59cff255cce530d /libavcodec | |
parent | a03a6db1af963ab8901ac4d9f5c2dd563b389d00 (diff) | |
download | ffmpeg-a5f0f504dfd70e4838502e4f85c08aa20900c382.tar.gz |
Another use of scalar_product_float()
Originally committed as revision 14088 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/ra288.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/libavcodec/ra288.c b/libavcodec/ra288.c index 5fb41bf4e9..7702a3c350 100644 --- a/libavcodec/ra288.c +++ b/libavcodec/ra288.c @@ -69,13 +69,12 @@ static void decode(Real288_internal *glob, float gain, int cb_coef) sumsum = exp(sum * 0.1151292546497) * gain; /* pow(10.0,sum/20)*f */ - sum = 0; for (x=0; x < 5; x++) { buffer[x] = codetable[cb_coef][x] * sumsum; - sum += buffer[x] * buffer[x]; } - sum /= 5; + sum = scalar_product_float(buffer, buffer, 5) / 5; + if (sum < 1) sum = 1; |