summaryrefslogtreecommitdiff
path: root/silk/quant_LTP_gains.c
diff options
context:
space:
mode:
authorKoen Vos <koenvos@users.noreply.github.com>2016-06-01 13:14:32 +0800
committerJean-Marc Valin <jmvalin@jmvalin.ca>2016-07-19 16:11:09 -0400
commitf06774c64072e09936e262a1bfbad54b9a15e42f (patch)
tree35b4987df71d511c9ef7a9f612f1b72cc798ab88 /silk/quant_LTP_gains.c
parent07691f15d428ce56b4f7ddb4fcf6df2d703cb83f (diff)
downloadopus-f06774c64072e09936e262a1bfbad54b9a15e42f.tar.gz
more conservative scaling of LTP corrs; remove assert that checks for negative residual energy; discard CB entries leading to such negative energies
Diffstat (limited to 'silk/quant_LTP_gains.c')
-rw-r--r--silk/quant_LTP_gains.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/silk/quant_LTP_gains.c b/silk/quant_LTP_gains.c
index 23f85695..6fd28d20 100644
--- a/silk/quant_LTP_gains.c
+++ b/silk/quant_LTP_gains.c
@@ -32,13 +32,13 @@ POSSIBILITY OF SUCH DAMAGE.
#include "main.h"
void silk_quant_LTP_gains(
- opus_int16 B_Q14[ MAX_NB_SUBFR * LTP_ORDER ], /* O Quantized LTP gains */
+ opus_int16 B_Q14[ MAX_NB_SUBFR * LTP_ORDER ], /* O Quantized LTP gains */
opus_int8 cbk_index[ MAX_NB_SUBFR ], /* O Codebook Index */
opus_int8 *periodicity_index, /* O Periodicity Index */
- opus_int *pred_gain_dB_Q7, /* O LTP prediction gain */
+ opus_int *pred_gain_dB_Q7, /* O LTP prediction gain */
const opus_int32 XX_Q17[ MAX_NB_SUBFR*LTP_ORDER*LTP_ORDER ], /* I Correlation matrix in Q18 */
- const opus_int32 xX_Q17[ MAX_NB_SUBFR*LTP_ORDER*LTP_ORDER ], /* I Correlation vector in Q18 */
- const opus_int subfr_len, /* I Number of samples per subframe */
+ const opus_int32 xX_Q17[ MAX_NB_SUBFR*LTP_ORDER ], /* I Correlation vector in Q18 */
+ const opus_int subfr_len, /* I Number of samples per subframe */
const opus_int nb_subfr, /* I Number of subframes */
int arch /* I Run-time architecture */
)
@@ -47,7 +47,6 @@ void silk_quant_LTP_gains(
opus_int8 temp_idx[ MAX_NB_SUBFR ];
const opus_uint8 *cl_ptr_Q5;
const opus_int8 *cbk_ptr_Q7;
- const opus_int16 *b_Q14_ptr;
const opus_int32 *XX_Q17_ptr, *xX_Q17_ptr;
opus_int32 res_nrg_Q15_subfr, res_nrg_Q15, rate_dist_Q7_subfr, rate_dist_Q7, min_rate_dist_Q7;
@@ -61,31 +60,29 @@ void silk_quant_LTP_gains(
cbk_ptr_Q7 = silk_LTP_vq_ptrs_Q7[ k ];
cbk_size = silk_LTP_vq_sizes[ k ];
- /* Set up pointer to first subframe */
+ /* Set up pointers to first subframe */
XX_Q17_ptr = XX_Q17;
xX_Q17_ptr = xX_Q17;
- b_Q14_ptr = B_Q14;
res_nrg_Q15 = 0;
rate_dist_Q7 = 0;
for( j = 0; j < nb_subfr; j++ ) {
silk_VQ_WMat_EC(
&temp_idx[ j ], /* O index of best codebook vector */
- &res_nrg_Q15_subfr, /* O residual energy */
+ &res_nrg_Q15_subfr, /* O residual energy */
&rate_dist_Q7_subfr, /* O best weighted quantization error + mu * rate */
XX_Q17_ptr, /* I correlation matrix */
- xX_Q17_ptr, /* I correlation vector */
+ xX_Q17_ptr, /* I correlation vector */
cbk_ptr_Q7, /* I codebook */
cl_ptr_Q5, /* I code length for each codebook vector */
- subfr_len, /* I number of samples per subframe */
+ subfr_len, /* I number of samples per subframe */
cbk_size, /* I number of vectors in codebook */
arch /* I Run-time architecture */
);
- res_nrg_Q15 = silk_ADD_POS_SAT32( res_nrg_Q15, res_nrg_Q15_subfr );
+ res_nrg_Q15 = silk_ADD_POS_SAT32( res_nrg_Q15, res_nrg_Q15_subfr );
rate_dist_Q7 = silk_ADD_POS_SAT32( rate_dist_Q7, rate_dist_Q7_subfr );
- b_Q14_ptr += LTP_ORDER;
XX_Q17_ptr += LTP_ORDER * LTP_ORDER;
xX_Q17_ptr += LTP_ORDER;
}
@@ -112,4 +109,3 @@ void silk_quant_LTP_gains(
*pred_gain_dB_Q7 = (opus_int)silk_SMULBB( -3, silk_lin2log( res_nrg_Q15 ) - ( 15 << 7 ) );
}
-