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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 rate0_Q5 = rates_Q5[ ind_tmp + NLSF_QUANT_MAX_AMPLITUDE ]; | 114 rate0_Q5 = rates_Q5[ ind_tmp + NLSF_QUANT_MAX_AMPLITUDE ]; |
115 rate1_Q5 = rates_Q5[ ind_tmp + 1 + NLSF_QUANT_MAX_AMPLITUDE ]; | 115 rate1_Q5 = rates_Q5[ ind_tmp + 1 + NLSF_QUANT_MAX_AMPLITUDE ]; |
116 } | 116 } |
117 RD_tmp_Q25 = RD_Q25[ j ]; | 117 RD_tmp_Q25 = RD_Q25[ j ]; |
118 diff_Q10 = silk_SUB16( in_Q10, out0_Q10 ); | 118 diff_Q10 = silk_SUB16( in_Q10, out0_Q10 ); |
119 RD_Q25[ j ] = silk_SMLABB( silk_MLA( RD_tmp_Q25, silk_SMUL
BB( diff_Q10, diff_Q10 ), w_Q5[ i ] ), mu_Q20, rate0_Q5 ); | 119 RD_Q25[ j ] = silk_SMLABB( silk_MLA( RD_tmp_Q25, silk_SMUL
BB( diff_Q10, diff_Q10 ), w_Q5[ i ] ), mu_Q20, rate0_Q5 ); |
120 diff_Q10 = silk_SUB16( in_Q10, out1_Q10 ); | 120 diff_Q10 = silk_SUB16( in_Q10, out1_Q10 ); |
121 RD_Q25[ j + nStates ] = silk_SMLABB( silk_MLA( RD_tmp_Q25, silk_SMUL
BB( diff_Q10, diff_Q10 ), w_Q5[ i ] ), mu_Q20, rate1_Q5 ); | 121 RD_Q25[ j + nStates ] = silk_SMLABB( silk_MLA( RD_tmp_Q25, silk_SMUL
BB( diff_Q10, diff_Q10 ), w_Q5[ i ] ), mu_Q20, rate1_Q5 ); |
122 } | 122 } |
123 | 123 |
124 if( nStates < NLSF_QUANT_DEL_DEC_STATES ) { | 124 if( nStates <= ( NLSF_QUANT_DEL_DEC_STATES >> 1 ) ) { |
125 /* double number of states and copy */ | 125 /* double number of states and copy */ |
126 for( j = 0; j < nStates; j++ ) { | 126 for( j = 0; j < nStates; j++ ) { |
127 ind[ j + nStates ][ i ] = ind[ j ][ i ] + 1; | 127 ind[ j + nStates ][ i ] = ind[ j ][ i ] + 1; |
128 } | 128 } |
129 nStates = silk_LSHIFT( nStates, 1 ); | 129 nStates = silk_LSHIFT( nStates, 1 ); |
130 for( j = nStates; j < NLSF_QUANT_DEL_DEC_STATES; j++ ) { | 130 for( j = nStates; j < NLSF_QUANT_DEL_DEC_STATES; j++ ) { |
131 ind[ j ][ i ] = ind[ j - nStates ][ i ]; | 131 ind[ j ][ i ] = ind[ j - nStates ][ i ]; |
132 } | 132 } |
133 } else if( i > 0 ) { | 133 } else if( i > 0 ) { |
134 /* sort lower and upper half of RD_Q25, pairwise */ | 134 /* sort lower and upper half of RD_Q25, pairwise */ |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 for( j = 0; j < order; j++ ) { | 198 for( j = 0; j < order; j++ ) { |
199 indices[ j ] = ind[ ind_tmp & ( NLSF_QUANT_DEL_DEC_STATES - 1 ) ][ j ]; | 199 indices[ j ] = ind[ ind_tmp & ( NLSF_QUANT_DEL_DEC_STATES - 1 ) ][ j ]; |
200 silk_assert( indices[ j ] >= -NLSF_QUANT_MAX_AMPLITUDE_EXT ); | 200 silk_assert( indices[ j ] >= -NLSF_QUANT_MAX_AMPLITUDE_EXT ); |
201 silk_assert( indices[ j ] <= NLSF_QUANT_MAX_AMPLITUDE_EXT ); | 201 silk_assert( indices[ j ] <= NLSF_QUANT_MAX_AMPLITUDE_EXT ); |
202 } | 202 } |
203 indices[ 0 ] += silk_RSHIFT( ind_tmp, NLSF_QUANT_DEL_DEC_STATES_LOG2 ); | 203 indices[ 0 ] += silk_RSHIFT( ind_tmp, NLSF_QUANT_DEL_DEC_STATES_LOG2 ); |
204 silk_assert( indices[ 0 ] <= NLSF_QUANT_MAX_AMPLITUDE_EXT ); | 204 silk_assert( indices[ 0 ] <= NLSF_QUANT_MAX_AMPLITUDE_EXT ); |
205 silk_assert( min_Q25 >= 0 ); | 205 silk_assert( min_Q25 >= 0 ); |
206 return min_Q25; | 206 return min_Q25; |
207 } | 207 } |
OLD | NEW |