Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.xiph.org/xiph/opus.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Marc Valin <jmvalin@jmvalin.ca>2023-12-02 02:52:19 +0300
committerJean-Marc Valin <jmvalin@jmvalin.ca>2023-12-02 02:52:19 +0300
commit8a5b7f49524841d9bf39d76e957e7917d73a81aa (patch)
tree71d4a919d9c64c521a6085afe459629cfb35c56f
parentc7bfc72d072dda08adb4f233a0cf84ee83b3a1a5 (diff)
Tuning the NLSF quant mu as a function of bitrate
-rw-r--r--silk/process_NLSFs.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/silk/process_NLSFs.c b/silk/process_NLSFs.c
index d1308095..8266eabb 100644
--- a/silk/process_NLSFs.c
+++ b/silk/process_NLSFs.c
@@ -53,8 +53,10 @@ void silk_process_NLSFs(
/***********************/
/* Calculate mu values */
/***********************/
- /* NLSF_mu = 0.003 - 0.0015 * psEnc->speech_activity; */
- NLSF_mu_Q20 = silk_SMLAWB( SILK_FIX_CONST( 0.003, 20 ), SILK_FIX_CONST( -0.001, 28 ), psEncC->speech_activity_Q8 );
+ /* NLSF_mu = base_mu - 0.0015 * psEnc->speech_activity;
+ where base_mu depends on the target SNR (empirical fit) */
+ NLSF_mu_Q20 = silk_DIV32( SILK_FIX_CONST( 5., 20 ), silk_max_32( 300, psEncC->SNR_dB_Q7 - 300 ) );
+ NLSF_mu_Q20 = silk_SMLAWB( NLSF_mu_Q20, SILK_FIX_CONST( -0.001, 28 ), psEncC->speech_activity_Q8 );
if( psEncC->nb_subfr == 2 ) {
/* Multiply by 1.5 for 10 ms packets */
NLSF_mu_Q20 = silk_ADD_RSHIFT( NLSF_mu_Q20, NLSF_mu_Q20, 1 );