diff options
author | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2011-10-20 08:39:41 +0400 |
---|---|---|
committer | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2011-10-20 08:39:41 +0400 |
commit | 294bfec27b82f879e3c3004d31bb91bcb34014f4 (patch) | |
tree | 94a6332cc1df41ec84b453ef76ee8118b95bfd8f /silk/float/inner_product_FLP.c | |
parent | dbf2ea841e5b022f0b6d15a606dd7288f25c35dd (diff) |
Implements hard CBR for SILK
This is achieved by running the encoding process in a loop and
padding when we don't reach the exact rate. It also implements
VBR-with-cap, which means we no longer need to artificially decrease
the SILK bandwidth when it's close to the cap.
Diffstat (limited to 'silk/float/inner_product_FLP.c')
-rw-r--r-- | silk/float/inner_product_FLP.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/silk/float/inner_product_FLP.c b/silk/float/inner_product_FLP.c index 4ed56a35..a8f04d73 100644 --- a/silk/float/inner_product_FLP.c +++ b/silk/float/inner_product_FLP.c @@ -42,18 +42,18 @@ double silk_inner_product_FLP( /* O result */ double result; /* 4x unrolled loop */ - result = 0.0f; + result = 0.0; dataSize4 = dataSize & 0xFFFC; for( i = 0; i < dataSize4; i += 4 ) { - result += data1[ i + 0 ] * data2[ i + 0 ] + - data1[ i + 1 ] * data2[ i + 1 ] + - data1[ i + 2 ] * data2[ i + 2 ] + - data1[ i + 3 ] * data2[ i + 3 ]; + result += data1[ i + 0 ] * (double)data2[ i + 0 ] + + data1[ i + 1 ] * (double)data2[ i + 1 ] + + data1[ i + 2 ] * (double)data2[ i + 2 ] + + data1[ i + 3 ] * (double)data2[ i + 3 ]; } /* add any remaining products */ for( ; i < dataSize; i++ ) { - result += data1[ i ] * data2[ i ]; + result += data1[ i ] * (double)data2[ i ]; } return result; |