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:
authorFelicia Lim <flim@google.com>2019-05-31 23:58:44 +0300
committerFelicia Lim <flim@google.com>2019-06-01 00:13:03 +0300
commit3ebf4ad86de2469572f7fa2bd6451469e7867c8f (patch)
tree972c330a89c870444e44c01963a2130cb7c67bfe /silk/CNG.c
parent86e5f5ea56529d688568929d036574a93311e82a (diff)
Silk CNG adapts faster to received packets with lower gains
Diffstat (limited to 'silk/CNG.c')
-rw-r--r--silk/CNG.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/silk/CNG.c b/silk/CNG.c
index ef8e38df..2a910099 100644
--- a/silk/CNG.c
+++ b/silk/CNG.c
@@ -118,6 +118,10 @@ void silk_CNG(
/* Smooth gains */
for( i = 0; i < psDec->nb_subfr; i++ ) {
psCNG->CNG_smth_Gain_Q16 += silk_SMULWB( psDecCtrl->Gains_Q16[ i ] - psCNG->CNG_smth_Gain_Q16, CNG_GAIN_SMTH_Q16 );
+ /* If the smoothed gain is 3 dB greater than this subframe's gain, use this subframe's gain to adapt faster. */
+ if( silk_SMULWW( psCNG->CNG_smth_Gain_Q16, CNG_GAIN_SMTH_THRESHOLD_Q16 ) > psDecCtrl->Gains_Q16[ i ] ) {
+ psCNG->CNG_smth_Gain_Q16 = psDecCtrl->Gains_Q16[ i ];
+ }
}
}