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 21 matching lines...) Expand all Loading... |
32 #include "SigProc_FLP.h" | 32 #include "SigProc_FLP.h" |
33 | 33 |
34 /* step up function, converts reflection coefficients to prediction coefficients
*/ | 34 /* step up function, converts reflection coefficients to prediction coefficients
*/ |
35 void silk_k2a_FLP( | 35 void silk_k2a_FLP( |
36 silk_float *A, /* O prediction coefficients [or
der] */ | 36 silk_float *A, /* O prediction coefficients [or
der] */ |
37 const silk_float *rc, /* I reflection coefficients [or
der] */ | 37 const silk_float *rc, /* I reflection coefficients [or
der] */ |
38 opus_int32 order /* I prediction order
*/ | 38 opus_int32 order /* I prediction order
*/ |
39 ) | 39 ) |
40 { | 40 { |
41 opus_int k, n; | 41 opus_int k, n; |
42 silk_float Atmp[ SILK_MAX_ORDER_LPC ]; | 42 silk_float rck, tmp1, tmp2; |
43 | 43 |
44 for( k = 0; k < order; k++ ) { | 44 for( k = 0; k < order; k++ ) { |
45 for( n = 0; n < k; n++ ) { | 45 rck = rc[ k ]; |
46 Atmp[ n ] = A[ n ]; | 46 for( n = 0; n < (k + 1) >> 1; n++ ) { |
| 47 tmp1 = A[ n ]; |
| 48 tmp2 = A[ k - n - 1 ]; |
| 49 A[ n ] = tmp1 + tmp2 * rck; |
| 50 A[ k - n - 1 ] = tmp2 + tmp1 * rck; |
47 } | 51 } |
48 for( n = 0; n < k; n++ ) { | 52 A[ k ] = -rck; |
49 A[ n ] += Atmp[ k - n - 1 ] * rc[ k ]; | |
50 } | |
51 A[ k ] = -rc[ k ]; | |
52 } | 53 } |
53 } | 54 } |
OLD | NEW |