| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 | 43 |
| 44 /* Compute reflection coefficients from input signal */ | 44 /* Compute reflection coefficients from input signal */ |
| 45 void silk_burg_modified( | 45 void silk_burg_modified( |
| 46 opus_int32 *res_nrg, /* O Residual energy
*/ | 46 opus_int32 *res_nrg, /* O Residual energy
*/ |
| 47 opus_int *res_nrg_Q, /* O Residual energy Q va
lue */ | 47 opus_int *res_nrg_Q, /* O Residual energy Q va
lue */ |
| 48 opus_int32 A_Q16[], /* O Prediction coefficie
nts (length order) */ | 48 opus_int32 A_Q16[], /* O Prediction coefficie
nts (length order) */ |
| 49 const opus_int16 x[], /* I Input signal, length
: nb_subfr * ( D + subfr_length ) */ | 49 const opus_int16 x[], /* I Input signal, length
: nb_subfr * ( D + subfr_length ) */ |
| 50 const opus_int32 minInvGain_Q30, /* I Inverse of max predi
ction gain */ | 50 const opus_int32 minInvGain_Q30, /* I Inverse of max predi
ction gain */ |
| 51 const opus_int subfr_length, /* I Input signal subfram
e length (incl. D preceding samples) */ | 51 const opus_int subfr_length, /* I Input signal subfram
e length (incl. D preceding samples) */ |
| 52 const opus_int nb_subfr, /* I Number of subframes
stacked in x */ | 52 const opus_int nb_subfr, /* I Number of subframes
stacked in x */ |
| 53 const opus_int D /* I Order
*/ | 53 const opus_int D, /* I Order
*/ |
| 54 int arch /* I Run-time architectur
e */ |
| 54 ) | 55 ) |
| 55 { | 56 { |
| 56 opus_int k, n, s, lz, rshifts, rshifts_extra, reached_max_gain; | 57 opus_int k, n, s, lz, rshifts, rshifts_extra, reached_max_gain; |
| 57 opus_int32 C0, num, nrg, rc_Q31, invGain_Q30, Atmp_QA, Atmp1, tmp1, tm
p2, x1, x2; | 58 opus_int32 C0, num, nrg, rc_Q31, invGain_Q30, Atmp_QA, Atmp1, tmp1, tm
p2, x1, x2; |
| 58 const opus_int16 *x_ptr; | 59 const opus_int16 *x_ptr; |
| 59 opus_int32 C_first_row[ SILK_MAX_ORDER_LPC ]; | 60 opus_int32 C_first_row[ SILK_MAX_ORDER_LPC ]; |
| 60 opus_int32 C_last_row[ SILK_MAX_ORDER_LPC ]; | 61 opus_int32 C_last_row[ SILK_MAX_ORDER_LPC ]; |
| 61 opus_int32 Af_QA[ SILK_MAX_ORDER_LPC ]; | 62 opus_int32 Af_QA[ SILK_MAX_ORDER_LPC ]; |
| 62 opus_int32 CAf[ SILK_MAX_ORDER_LPC + 1 ]; | 63 opus_int32 CAf[ SILK_MAX_ORDER_LPC + 1 ]; |
| 63 opus_int32 CAb[ SILK_MAX_ORDER_LPC + 1 ]; | 64 opus_int32 CAb[ SILK_MAX_ORDER_LPC + 1 ]; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 91 for( n = 1; n < D + 1; n++ ) { | 92 for( n = 1; n < D + 1; n++ ) { |
| 92 C_first_row[ n - 1 ] += (opus_int32)silk_RSHIFT64( | 93 C_first_row[ n - 1 ] += (opus_int32)silk_RSHIFT64( |
| 93 silk_inner_prod16_aligned_64( x_ptr, x_ptr + n, subfr_length
- n ), rshifts ); | 94 silk_inner_prod16_aligned_64( x_ptr, x_ptr + n, subfr_length
- n ), rshifts ); |
| 94 } | 95 } |
| 95 } | 96 } |
| 96 } else { | 97 } else { |
| 97 for( s = 0; s < nb_subfr; s++ ) { | 98 for( s = 0; s < nb_subfr; s++ ) { |
| 98 int i; | 99 int i; |
| 99 opus_int32 d; | 100 opus_int32 d; |
| 100 x_ptr = x + s * subfr_length; | 101 x_ptr = x + s * subfr_length; |
| 101 celt_pitch_xcorr(x_ptr, x_ptr + 1, xcorr, subfr_length - D, D ); | 102 celt_pitch_xcorr(x_ptr, x_ptr + 1, xcorr, subfr_length - D, D, arch
); |
| 102 for( n = 1; n < D + 1; n++ ) { | 103 for( n = 1; n < D + 1; n++ ) { |
| 103 for ( i = n + subfr_length - D, d = 0; i < subfr_length; i++ ) | 104 for ( i = n + subfr_length - D, d = 0; i < subfr_length; i++ ) |
| 104 d = MAC16_16( d, x_ptr[ i ], x_ptr[ i - n ] ); | 105 d = MAC16_16( d, x_ptr[ i ], x_ptr[ i - n ] ); |
| 105 xcorr[ n - 1 ] += d; | 106 xcorr[ n - 1 ] += d; |
| 106 } | 107 } |
| 107 for( n = 1; n < D + 1; n++ ) { | 108 for( n = 1; n < D + 1; n++ ) { |
| 108 C_first_row[ n - 1 ] += silk_LSHIFT32( xcorr[ n - 1 ], -rshifts
); | 109 C_first_row[ n - 1 ] += silk_LSHIFT32( xcorr[ n - 1 ], -rshifts
); |
| 109 } | 110 } |
| 110 } | 111 } |
| 111 } | 112 } |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 for( k = 0; k < D; k++ ) { | 270 for( k = 0; k < D; k++ ) { |
| 270 Atmp1 = silk_RSHIFT_ROUND( Af_QA[ k ], QA - 16 );
/* Q16 */ | 271 Atmp1 = silk_RSHIFT_ROUND( Af_QA[ k ], QA - 16 );
/* Q16 */ |
| 271 nrg = silk_SMLAWW( nrg, CAf[ k + 1 ], Atmp1 );
/* Q( -rshifts ) */ | 272 nrg = silk_SMLAWW( nrg, CAf[ k + 1 ], Atmp1 );
/* Q( -rshifts ) */ |
| 272 tmp1 = silk_SMLAWW( tmp1, Atmp1, Atmp1 );
/* Q16 */ | 273 tmp1 = silk_SMLAWW( tmp1, Atmp1, Atmp1 );
/* Q16 */ |
| 273 A_Q16[ k ] = -Atmp1; | 274 A_Q16[ k ] = -Atmp1; |
| 274 } | 275 } |
| 275 *res_nrg = silk_SMLAWW( nrg, silk_SMMUL( SILK_FIX_CONST( FIND_LPC_COND_F
AC, 32 ), C0 ), -tmp1 );/* Q( -rshifts ) */ | 276 *res_nrg = silk_SMLAWW( nrg, silk_SMMUL( SILK_FIX_CONST( FIND_LPC_COND_F
AC, 32 ), C0 ), -tmp1 );/* Q( -rshifts ) */ |
| 276 *res_nrg_Q = -rshifts; | 277 *res_nrg_Q = -rshifts; |
| 277 } | 278 } |
| 278 } | 279 } |
| OLD | NEW |