diff options
author | Koen Vos <koenvos@users.noreply.github.com> | 2016-06-02 22:35:58 +0800 |
---|---|---|
committer | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2016-07-19 16:11:19 -0400 |
commit | 3af77bf4256cc0c69c99b3c384f6b47e5c9b3fd6 (patch) | |
tree | dd207990cb7b35c0945f6eed766653cb16dc1dfe /silk/VQ_WMat_EC.c | |
parent | 2799c53cedf68cacd0744c7bf3ded16f50e6cc67 (diff) | |
download | opus-3af77bf4256cc0c69c99b3c384f6b47e5c9b3fd6.tar.gz |
avoid double if statement for finding best quantized LTP coefs
Diffstat (limited to 'silk/VQ_WMat_EC.c')
-rw-r--r-- | silk/VQ_WMat_EC.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/silk/VQ_WMat_EC.c b/silk/VQ_WMat_EC.c index 703b398e..2f3aa82a 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; /* In things go really bad, at least *ind is set to something safe. */ *ind = 0; @@ -105,8 +104,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 ); |