OLD | NEW |
1 /*********************************************************************** | 1 /*********************************************************************** |
2 Copyright (c) 2006-2011, Skype Limited. All rights reserved. | 2 Copyright (c) 2006-2011, Skype Limited. All rights reserved. |
3 Redistribution and use in source and binary forms, with or without | 3 Redistribution and use in source and binary forms, with or without |
4 modification, are permitted provided that the following conditions | 4 modification, are permitted provided that the following conditions |
5 are met: | 5 are met: |
6 - Redistributions of source code must retain the above copyright notice, | 6 - Redistributions of source code must retain the above copyright notice, |
7 this list of conditions and the following disclaimer. | 7 this list of conditions and the following disclaimer. |
8 - Redistributions in binary form must reproduce the above copyright | 8 - Redistributions in binary form must reproduce the above copyright |
9 notice, this list of conditions and the following disclaimer in the | 9 notice, this list of conditions and the following disclaimer in the |
10 documentation and/or other materials provided with the distribution. | 10 documentation and/or other materials provided with the distribution. |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 SNR_adj_dB_Q7 = silk_SMLAWB( SNR_adj_dB_Q7, | 192 SNR_adj_dB_Q7 = silk_SMLAWB( SNR_adj_dB_Q7, |
193 silk_SMLAWB( SILK_FIX_CONST( 6.0, 9 ), -SILK_FIX_CONST( 0.4, 18 ), p
sEnc->sCmn.SNR_dB_Q7 ), | 193 silk_SMLAWB( SILK_FIX_CONST( 6.0, 9 ), -SILK_FIX_CONST( 0.4, 18 ), p
sEnc->sCmn.SNR_dB_Q7 ), |
194 SILK_FIX_CONST( 1.0, 14 ) - psEncCtrl->input_quality_Q14 ); | 194 SILK_FIX_CONST( 1.0, 14 ) - psEncCtrl->input_quality_Q14 ); |
195 } | 195 } |
196 | 196 |
197 /*************************/ | 197 /*************************/ |
198 /* SPARSENESS PROCESSING */ | 198 /* SPARSENESS PROCESSING */ |
199 /*************************/ | 199 /*************************/ |
200 /* Set quantizer offset */ | 200 /* Set quantizer offset */ |
201 if( psEnc->sCmn.indices.signalType == TYPE_VOICED ) { | 201 if( psEnc->sCmn.indices.signalType == TYPE_VOICED ) { |
202 /* Initally set to 0; may be overruled in process_gains(..) */ | 202 /* Initially set to 0; may be overruled in process_gains(..) */ |
203 psEnc->sCmn.indices.quantOffsetType = 0; | 203 psEnc->sCmn.indices.quantOffsetType = 0; |
204 psEncCtrl->sparseness_Q8 = 0; | 204 psEncCtrl->sparseness_Q8 = 0; |
205 } else { | 205 } else { |
206 /* Sparseness measure, based on relative fluctuations of energy per 2 mi
lliseconds */ | 206 /* Sparseness measure, based on relative fluctuations of energy per 2 mi
lliseconds */ |
207 nSamples = silk_LSHIFT( psEnc->sCmn.fs_kHz, 1 ); | 207 nSamples = silk_LSHIFT( psEnc->sCmn.fs_kHz, 1 ); |
208 energy_variation_Q7 = 0; | 208 energy_variation_Q7 = 0; |
209 log_energy_prev_Q7 = 0; | 209 log_energy_prev_Q7 = 0; |
210 pitch_res_ptr = pitch_res; | 210 pitch_res_ptr = pitch_res; |
211 for( k = 0; k < silk_SMULBB( SUB_FRAME_LENGTH_MS, psEnc->sCmn.nb_subfr )
/ 2; k++ ) { | 211 for( k = 0; k < silk_SMULBB( SUB_FRAME_LENGTH_MS, psEnc->sCmn.nb_subfr )
/ 2; k++ ) { |
212 silk_sum_sqr_shift( &nrg, &scale, pitch_res_ptr, nSamples ); | 212 silk_sum_sqr_shift( &nrg, &scale, pitch_res_ptr, nSamples ); |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
431 psShapeSt->HarmShapeGain_smth_Q16 = | 431 psShapeSt->HarmShapeGain_smth_Q16 = |
432 silk_SMLAWB( psShapeSt->HarmShapeGain_smth_Q16, HarmShapeGain_Q16 -
psShapeSt->HarmShapeGain_smth_Q16, SILK_FIX_CONST( SUBFR_SMTH_COEF, 16 ) ); | 432 silk_SMLAWB( psShapeSt->HarmShapeGain_smth_Q16, HarmShapeGain_Q16 -
psShapeSt->HarmShapeGain_smth_Q16, SILK_FIX_CONST( SUBFR_SMTH_COEF, 16 ) ); |
433 psShapeSt->Tilt_smth_Q16 = | 433 psShapeSt->Tilt_smth_Q16 = |
434 silk_SMLAWB( psShapeSt->Tilt_smth_Q16, Tilt_Q16 -
psShapeSt->Tilt_smth_Q16, SILK_FIX_CONST( SUBFR_SMTH_COEF, 16 ) ); | 434 silk_SMLAWB( psShapeSt->Tilt_smth_Q16, Tilt_Q16 -
psShapeSt->Tilt_smth_Q16, SILK_FIX_CONST( SUBFR_SMTH_COEF, 16 ) ); |
435 | 435 |
436 psEncCtrl->HarmBoost_Q14[ k ] = ( opus_int )silk_RSHIFT_ROUND( psSha
peSt->HarmBoost_smth_Q16, 2 ); | 436 psEncCtrl->HarmBoost_Q14[ k ] = ( opus_int )silk_RSHIFT_ROUND( psSha
peSt->HarmBoost_smth_Q16, 2 ); |
437 psEncCtrl->HarmShapeGain_Q14[ k ] = ( opus_int )silk_RSHIFT_ROUND( psSha
peSt->HarmShapeGain_smth_Q16, 2 ); | 437 psEncCtrl->HarmShapeGain_Q14[ k ] = ( opus_int )silk_RSHIFT_ROUND( psSha
peSt->HarmShapeGain_smth_Q16, 2 ); |
438 psEncCtrl->Tilt_Q14[ k ] = ( opus_int )silk_RSHIFT_ROUND( psSha
peSt->Tilt_smth_Q16, 2 ); | 438 psEncCtrl->Tilt_Q14[ k ] = ( opus_int )silk_RSHIFT_ROUND( psSha
peSt->Tilt_smth_Q16, 2 ); |
439 } | 439 } |
440 } | 440 } |
OLD | NEW |