shithub: opus

Download patch

ref: d60816f76d2efcb5058874c9bcd440b79781ce68
parent: 3af77bf4256cc0c69c99b3c384f6b47e5c9b3fd6
author: Koen Vos <[email protected]>
date: Thu Jun 2 19:03:27 EDT 2016

comment about reduced codelength component in LTP quantizer error metric

--- a/silk/VQ_WMat_EC.c
+++ b/silk/VQ_WMat_EC.c
@@ -65,7 +65,7 @@
     *ind = 0;
     for( k = 0; k < L; k++ ) {
         /* Weighted rate */
-        /* Quantization error: 1 - 2* xX * cb + cb' * XX * cb */
+        /* Quantization error: 1 - 2 * xX * cb + cb' * XX * cb */
         sum1_Q15 = SILK_FIX_CONST( 1.001, 15 );
 
         /* first row of XX_Q17 */
@@ -107,7 +107,8 @@
         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 );
+            /* In the following line we reduce the codelength component by half ("-1"); seems to slghtly improve quality */
+            bits_tot_Q8 = silk_ADD_LSHIFT32( bits_res_Q8, cl_Q5[ k ], 3-1 );
             if( bits_tot_Q8 <= *rate_dist_Q8 ) {
                 *rate_dist_Q8 = bits_tot_Q8;
                 *res_nrg_Q15 = sum1_Q15;