summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKoen Vos <koenvos@users.noreply.github.com>2016-06-02 22:35:58 +0800
committerJean-Marc Valin <jmvalin@jmvalin.ca>2016-06-02 15:13:36 -0400
commitd7e92559c9a4790f2ba62ae757a088febdb9f07a (patch)
treeb464216ed62b2fbe9598b6ed6f46c97c96c5405b
parent15249203eec01e1f63c38bf42ec875d501e56cb8 (diff)
downloadopus-d7e92559c9a4790f2ba62ae757a088febdb9f07a.tar.gz
avoid double if statement for finding best quantized LTP coefs
-rw-r--r--silk/VQ_WMat_EC.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/silk/VQ_WMat_EC.c b/silk/VQ_WMat_EC.c
index 966d7c36..f16ca827 100644
--- a/silk/VQ_WMat_EC.c
+++ b/silk/VQ_WMat_EC.c
@@ -47,7 +47,7 @@ void silk_VQ_WMat_EC_c(
opus_int k;
const opus_int8 *cb_row_Q7;
opus_int32 neg_xX_Q24[ 5 ];
- opus_int32 sum1_Q15, sum2_Q24, sum1_best_Q15;
+ opus_int32 sum1_Q15, sum2_Q24;
opus_int32 bits_res_Q8, bits_tot_Q8;
/* Negate and convert to new Q domain */
@@ -60,7 +60,6 @@ void silk_VQ_WMat_EC_c(
/* Loop over codebook */
*rate_dist_Q8 = silk_int32_MAX;
*res_nrg_Q15 = silk_int32_MAX;
- sum1_best_Q15 = silk_int32_MAX;
cb_row_Q7 = cb_Q7;
for( k = 0; k < L; k++ ) {
/* Weighted rate */
@@ -103,8 +102,7 @@ void silk_VQ_WMat_EC_c(
sum1_Q15 = silk_SMLAWB( sum1_Q15, sum2_Q24, cb_row_Q7[ 4 ] );
/* find best */
- if( sum1_Q15 <= sum1_best_Q15 && sum1_Q15 >= 0 ) {
- sum1_best_Q15 = sum1_Q15;
+ if( sum1_Q15 >= 0 ) {
/* Translate residual energy to bits using high-rate assumption (6 dB ==> 1 bit/sample) */
bits_res_Q8 = silk_SMULBB( subfr_len, silk_lin2log( sum1_Q15 ) - (15 << 7) );
bits_tot_Q8 = silk_ADD_LSHIFT32( bits_res_Q8, cl_Q5[ k ], 2 );