| 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 18 matching lines...) Expand all Loading... |
| 29 #include "config.h" | 29 #include "config.h" |
| 30 #endif | 30 #endif |
| 31 | 31 |
| 32 #include "main_FLP.h" | 32 #include "main_FLP.h" |
| 33 #include "tuning_parameters.h" | 33 #include "tuning_parameters.h" |
| 34 | 34 |
| 35 /* Compute gain to make warped filter coefficients have a zero mean log frequenc
y response on a */ | 35 /* Compute gain to make warped filter coefficients have a zero mean log frequenc
y response on a */ |
| 36 /* non-warped frequency scale. (So that it can be implemented with a minimum-pha
se monic filter.) */ | 36 /* non-warped frequency scale. (So that it can be implemented with a minimum-pha
se monic filter.) */ |
| 37 /* Note: A monic filter is one with the first coefficient equal to 1.0. In Silk
we omit the first */ | 37 /* Note: A monic filter is one with the first coefficient equal to 1.0. In Silk
we omit the first */ |
| 38 /* coefficient in an array of coefficients, for monic filters.
*/ | 38 /* coefficient in an array of coefficients, for monic filters.
*/ |
| 39 static inline silk_float warped_gain( | 39 static OPUS_INLINE silk_float warped_gain( |
| 40 const silk_float *coefs, | 40 const silk_float *coefs, |
| 41 silk_float lambda, | 41 silk_float lambda, |
| 42 opus_int order | 42 opus_int order |
| 43 ) { | 43 ) { |
| 44 opus_int i; | 44 opus_int i; |
| 45 silk_float gain; | 45 silk_float gain; |
| 46 | 46 |
| 47 lambda = -lambda; | 47 lambda = -lambda; |
| 48 gain = coefs[ order - 1 ]; | 48 gain = coefs[ order - 1 ]; |
| 49 for( i = order - 2; i >= 0; i-- ) { | 49 for( i = order - 2; i >= 0; i-- ) { |
| 50 gain = lambda * gain + coefs[ i ]; | 50 gain = lambda * gain + coefs[ i ]; |
| 51 } | 51 } |
| 52 return (silk_float)( 1.0f / ( 1.0f - lambda * gain ) ); | 52 return (silk_float)( 1.0f / ( 1.0f - lambda * gain ) ); |
| 53 } | 53 } |
| 54 | 54 |
| 55 /* Convert warped filter coefficients to monic pseudo-warped coefficients and li
mit maximum */ | 55 /* Convert warped filter coefficients to monic pseudo-warped coefficients and li
mit maximum */ |
| 56 /* amplitude of monic warped coefficients by using bandwidth expansion on the tr
ue coefficients */ | 56 /* amplitude of monic warped coefficients by using bandwidth expansion on the tr
ue coefficients */ |
| 57 static inline void warped_true2monic_coefs( | 57 static OPUS_INLINE void warped_true2monic_coefs( |
| 58 silk_float *coefs_syn, | 58 silk_float *coefs_syn, |
| 59 silk_float *coefs_ana, | 59 silk_float *coefs_ana, |
| 60 silk_float lambda, | 60 silk_float lambda, |
| 61 silk_float limit, | 61 silk_float limit, |
| 62 opus_int order | 62 opus_int order |
| 63 ) { | 63 ) { |
| 64 opus_int i, iter, ind = 0; | 64 opus_int i, iter, ind = 0; |
| 65 silk_float tmp, maxabs, chirp, gain_syn, gain_ana; | 65 silk_float tmp, maxabs, chirp, gain_syn, gain_ana; |
| 66 | 66 |
| 67 /* Convert to monic coefficients */ | 67 /* Convert to monic coefficients */ |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 /*************************/ | 356 /*************************/ |
| 357 for( k = 0; k < psEnc->sCmn.nb_subfr; k++ ) { | 357 for( k = 0; k < psEnc->sCmn.nb_subfr; k++ ) { |
| 358 psShapeSt->HarmBoost_smth += SUBFR_SMTH_COEF * ( HarmBoost - psShape
St->HarmBoost_smth ); | 358 psShapeSt->HarmBoost_smth += SUBFR_SMTH_COEF * ( HarmBoost - psShape
St->HarmBoost_smth ); |
| 359 psEncCtrl->HarmBoost[ k ] = psShapeSt->HarmBoost_smth; | 359 psEncCtrl->HarmBoost[ k ] = psShapeSt->HarmBoost_smth; |
| 360 psShapeSt->HarmShapeGain_smth += SUBFR_SMTH_COEF * ( HarmShapeGain - psS
hapeSt->HarmShapeGain_smth ); | 360 psShapeSt->HarmShapeGain_smth += SUBFR_SMTH_COEF * ( HarmShapeGain - psS
hapeSt->HarmShapeGain_smth ); |
| 361 psEncCtrl->HarmShapeGain[ k ] = psShapeSt->HarmShapeGain_smth; | 361 psEncCtrl->HarmShapeGain[ k ] = psShapeSt->HarmShapeGain_smth; |
| 362 psShapeSt->Tilt_smth += SUBFR_SMTH_COEF * ( Tilt - psShapeSt->T
ilt_smth ); | 362 psShapeSt->Tilt_smth += SUBFR_SMTH_COEF * ( Tilt - psShapeSt->T
ilt_smth ); |
| 363 psEncCtrl->Tilt[ k ] = psShapeSt->Tilt_smth; | 363 psEncCtrl->Tilt[ k ] = psShapeSt->Tilt_smth; |
| 364 } | 364 } |
| 365 } | 365 } |
| OLD | NEW |