| 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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 } | 168 } |
| 169 } | 169 } |
| 170 | 170 |
| 171 /***********************************************/ | 171 /***********************************************/ |
| 172 /* Floating-point Silk LTP quantiation wrapper */ | 172 /* Floating-point Silk LTP quantiation wrapper */ |
| 173 /***********************************************/ | 173 /***********************************************/ |
| 174 void silk_quant_LTP_gains_FLP( | 174 void silk_quant_LTP_gains_FLP( |
| 175 silk_float B[ MAX_NB_SUBFR * LTP_ORDER ], /* I/O
(Un-)quantized LTP gains */ | 175 silk_float B[ MAX_NB_SUBFR * LTP_ORDER ], /* I/O
(Un-)quantized LTP gains */ |
| 176 opus_int8 cbk_index[ MAX_NB_SUBFR ], /* O
Codebook index */ | 176 opus_int8 cbk_index[ MAX_NB_SUBFR ], /* O
Codebook index */ |
| 177 opus_int8 *periodicity_index, /* O
Periodicity index */ | 177 opus_int8 *periodicity_index, /* O
Periodicity index */ |
| 178 opus_int32 *sum_log_gain_Q7, /* I/O
Cumulative max prediction gain */ |
| 178 const silk_float W[ MAX_NB_SUBFR * LTP_ORDER * LTP_ORDER ], /
* I Error weights */ | 179 const silk_float W[ MAX_NB_SUBFR * LTP_ORDER * LTP_ORDER ], /
* I Error weights */ |
| 179 const opus_int mu_Q10, /* I
Mu value (R/D tradeoff) */ | 180 const opus_int mu_Q10, /* I
Mu value (R/D tradeoff) */ |
| 180 const opus_int lowComplexity, /* I
Flag for low complexity */ | 181 const opus_int lowComplexity, /* I
Flag for low complexity */ |
| 181 const opus_int nb_subfr /* I
number of subframes */ | 182 const opus_int nb_subfr /* I
number of subframes */ |
| 182 ) | 183 ) |
| 183 { | 184 { |
| 184 opus_int i; | 185 opus_int i; |
| 185 opus_int16 B_Q14[ MAX_NB_SUBFR * LTP_ORDER ]; | 186 opus_int16 B_Q14[ MAX_NB_SUBFR * LTP_ORDER ]; |
| 186 opus_int32 W_Q18[ MAX_NB_SUBFR*LTP_ORDER*LTP_ORDER ]; | 187 opus_int32 W_Q18[ MAX_NB_SUBFR*LTP_ORDER*LTP_ORDER ]; |
| 187 | 188 |
| 188 for( i = 0; i < nb_subfr * LTP_ORDER; i++ ) { | 189 for( i = 0; i < nb_subfr * LTP_ORDER; i++ ) { |
| 189 B_Q14[ i ] = (opus_int16)silk_float2int( B[ i ] * 16384.0f ); | 190 B_Q14[ i ] = (opus_int16)silk_float2int( B[ i ] * 16384.0f ); |
| 190 } | 191 } |
| 191 for( i = 0; i < nb_subfr * LTP_ORDER * LTP_ORDER; i++ ) { | 192 for( i = 0; i < nb_subfr * LTP_ORDER * LTP_ORDER; i++ ) { |
| 192 W_Q18[ i ] = (opus_int32)silk_float2int( W[ i ] * 262144.0f ); | 193 W_Q18[ i ] = (opus_int32)silk_float2int( W[ i ] * 262144.0f ); |
| 193 } | 194 } |
| 194 | 195 |
| 195 silk_quant_LTP_gains( B_Q14, cbk_index, periodicity_index, W_Q18, mu_Q10, lo
wComplexity, nb_subfr ); | 196 silk_quant_LTP_gains( B_Q14, cbk_index, periodicity_index, sum_log_gain_Q7,
W_Q18, mu_Q10, lowComplexity, nb_subfr ); |
| 196 | 197 |
| 197 for( i = 0; i < nb_subfr * LTP_ORDER; i++ ) { | 198 for( i = 0; i < nb_subfr * LTP_ORDER; i++ ) { |
| 198 B[ i ] = (silk_float)B_Q14[ i ] * ( 1.0f / 16384.0f ); | 199 B[ i ] = (silk_float)B_Q14[ i ] * ( 1.0f / 16384.0f ); |
| 199 } | 200 } |
| 200 } | 201 } |
| OLD | NEW |