Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1832)

Side by Side Diff: silk/float/LPC_analysis_filter_FLP.c

Issue 107243004: Updating Opus to release 1.1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/opus
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « silk/fixed/solve_LS_FIX.c ('k') | silk/float/SigProc_FLP.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 22 matching lines...) Expand all
33 #include "main_FLP.h" 33 #include "main_FLP.h"
34 34
35 /************************************************/ 35 /************************************************/
36 /* LPC analysis filter */ 36 /* LPC analysis filter */
37 /* NB! State is kept internally and the */ 37 /* NB! State is kept internally and the */
38 /* filter always starts with zero state */ 38 /* filter always starts with zero state */
39 /* first Order output samples are set to zero */ 39 /* first Order output samples are set to zero */
40 /************************************************/ 40 /************************************************/
41 41
42 /* 16th order LPC analysis filter, does not write first 16 samples */ 42 /* 16th order LPC analysis filter, does not write first 16 samples */
43 static inline void silk_LPC_analysis_filter16_FLP( 43 static OPUS_INLINE void silk_LPC_analysis_filter16_FLP(
44 silk_float r_LPC[], /* O LPC residual si gnal */ 44 silk_float r_LPC[], /* O LPC residual si gnal */
45 const silk_float PredCoef[], /* I LPC coefficient s */ 45 const silk_float PredCoef[], /* I LPC coefficient s */
46 const silk_float s[], /* I Input signal */ 46 const silk_float s[], /* I Input signal */
47 const opus_int length /* I Length of input signal */ 47 const opus_int length /* I Length of input signal */
48 ) 48 )
49 { 49 {
50 opus_int ix; 50 opus_int ix;
51 silk_float LPC_pred; 51 silk_float LPC_pred;
52 const silk_float *s_ptr; 52 const silk_float *s_ptr;
53 53
(...skipping 17 matching lines...) Expand all
71 s_ptr[ -13 ] * PredCoef[ 13 ] + 71 s_ptr[ -13 ] * PredCoef[ 13 ] +
72 s_ptr[ -14 ] * PredCoef[ 14 ] + 72 s_ptr[ -14 ] * PredCoef[ 14 ] +
73 s_ptr[ -15 ] * PredCoef[ 15 ]; 73 s_ptr[ -15 ] * PredCoef[ 15 ];
74 74
75 /* prediction error */ 75 /* prediction error */
76 r_LPC[ix] = s_ptr[ 1 ] - LPC_pred; 76 r_LPC[ix] = s_ptr[ 1 ] - LPC_pred;
77 } 77 }
78 } 78 }
79 79
80 /* 12th order LPC analysis filter, does not write first 12 samples */ 80 /* 12th order LPC analysis filter, does not write first 12 samples */
81 static inline void silk_LPC_analysis_filter12_FLP( 81 static OPUS_INLINE void silk_LPC_analysis_filter12_FLP(
82 silk_float r_LPC[], /* O LPC residual si gnal */ 82 silk_float r_LPC[], /* O LPC residual si gnal */
83 const silk_float PredCoef[], /* I LPC coefficient s */ 83 const silk_float PredCoef[], /* I LPC coefficient s */
84 const silk_float s[], /* I Input signal */ 84 const silk_float s[], /* I Input signal */
85 const opus_int length /* I Length of input signal */ 85 const opus_int length /* I Length of input signal */
86 ) 86 )
87 { 87 {
88 opus_int ix; 88 opus_int ix;
89 silk_float LPC_pred; 89 silk_float LPC_pred;
90 const silk_float *s_ptr; 90 const silk_float *s_ptr;
91 91
(...skipping 13 matching lines...) Expand all
105 s_ptr[ -9 ] * PredCoef[ 9 ] + 105 s_ptr[ -9 ] * PredCoef[ 9 ] +
106 s_ptr[ -10 ] * PredCoef[ 10 ] + 106 s_ptr[ -10 ] * PredCoef[ 10 ] +
107 s_ptr[ -11 ] * PredCoef[ 11 ]; 107 s_ptr[ -11 ] * PredCoef[ 11 ];
108 108
109 /* prediction error */ 109 /* prediction error */
110 r_LPC[ix] = s_ptr[ 1 ] - LPC_pred; 110 r_LPC[ix] = s_ptr[ 1 ] - LPC_pred;
111 } 111 }
112 } 112 }
113 113
114 /* 10th order LPC analysis filter, does not write first 10 samples */ 114 /* 10th order LPC analysis filter, does not write first 10 samples */
115 static inline void silk_LPC_analysis_filter10_FLP( 115 static OPUS_INLINE void silk_LPC_analysis_filter10_FLP(
116 silk_float r_LPC[], /* O LPC residual si gnal */ 116 silk_float r_LPC[], /* O LPC residual si gnal */
117 const silk_float PredCoef[], /* I LPC coefficient s */ 117 const silk_float PredCoef[], /* I LPC coefficient s */
118 const silk_float s[], /* I Input signal */ 118 const silk_float s[], /* I Input signal */
119 const opus_int length /* I Length of input signal */ 119 const opus_int length /* I Length of input signal */
120 ) 120 )
121 { 121 {
122 opus_int ix; 122 opus_int ix;
123 silk_float LPC_pred; 123 silk_float LPC_pred;
124 const silk_float *s_ptr; 124 const silk_float *s_ptr;
125 125
(...skipping 11 matching lines...) Expand all
137 s_ptr[ -7 ] * PredCoef[ 7 ] + 137 s_ptr[ -7 ] * PredCoef[ 7 ] +
138 s_ptr[ -8 ] * PredCoef[ 8 ] + 138 s_ptr[ -8 ] * PredCoef[ 8 ] +
139 s_ptr[ -9 ] * PredCoef[ 9 ]; 139 s_ptr[ -9 ] * PredCoef[ 9 ];
140 140
141 /* prediction error */ 141 /* prediction error */
142 r_LPC[ix] = s_ptr[ 1 ] - LPC_pred; 142 r_LPC[ix] = s_ptr[ 1 ] - LPC_pred;
143 } 143 }
144 } 144 }
145 145
146 /* 8th order LPC analysis filter, does not write first 8 samples */ 146 /* 8th order LPC analysis filter, does not write first 8 samples */
147 static inline void silk_LPC_analysis_filter8_FLP( 147 static OPUS_INLINE void silk_LPC_analysis_filter8_FLP(
148 silk_float r_LPC[], /* O LPC residual si gnal */ 148 silk_float r_LPC[], /* O LPC residual si gnal */
149 const silk_float PredCoef[], /* I LPC coefficient s */ 149 const silk_float PredCoef[], /* I LPC coefficient s */
150 const silk_float s[], /* I Input signal */ 150 const silk_float s[], /* I Input signal */
151 const opus_int length /* I Length of input signal */ 151 const opus_int length /* I Length of input signal */
152 ) 152 )
153 { 153 {
154 opus_int ix; 154 opus_int ix;
155 silk_float LPC_pred; 155 silk_float LPC_pred;
156 const silk_float *s_ptr; 156 const silk_float *s_ptr;
157 157
158 for( ix = 8; ix < length; ix++ ) { 158 for( ix = 8; ix < length; ix++ ) {
159 s_ptr = &s[ix - 1]; 159 s_ptr = &s[ix - 1];
160 160
161 /* short-term prediction */ 161 /* short-term prediction */
162 LPC_pred = s_ptr[ 0 ] * PredCoef[ 0 ] + 162 LPC_pred = s_ptr[ 0 ] * PredCoef[ 0 ] +
163 s_ptr[ -1 ] * PredCoef[ 1 ] + 163 s_ptr[ -1 ] * PredCoef[ 1 ] +
164 s_ptr[ -2 ] * PredCoef[ 2 ] + 164 s_ptr[ -2 ] * PredCoef[ 2 ] +
165 s_ptr[ -3 ] * PredCoef[ 3 ] + 165 s_ptr[ -3 ] * PredCoef[ 3 ] +
166 s_ptr[ -4 ] * PredCoef[ 4 ] + 166 s_ptr[ -4 ] * PredCoef[ 4 ] +
167 s_ptr[ -5 ] * PredCoef[ 5 ] + 167 s_ptr[ -5 ] * PredCoef[ 5 ] +
168 s_ptr[ -6 ] * PredCoef[ 6 ] + 168 s_ptr[ -6 ] * PredCoef[ 6 ] +
169 s_ptr[ -7 ] * PredCoef[ 7 ]; 169 s_ptr[ -7 ] * PredCoef[ 7 ];
170 170
171 /* prediction error */ 171 /* prediction error */
172 r_LPC[ix] = s_ptr[ 1 ] - LPC_pred; 172 r_LPC[ix] = s_ptr[ 1 ] - LPC_pred;
173 } 173 }
174 } 174 }
175 175
176 /* 6th order LPC analysis filter, does not write first 6 samples */ 176 /* 6th order LPC analysis filter, does not write first 6 samples */
177 static inline void silk_LPC_analysis_filter6_FLP( 177 static OPUS_INLINE void silk_LPC_analysis_filter6_FLP(
178 silk_float r_LPC[], /* O LPC residual si gnal */ 178 silk_float r_LPC[], /* O LPC residual si gnal */
179 const silk_float PredCoef[], /* I LPC coefficient s */ 179 const silk_float PredCoef[], /* I LPC coefficient s */
180 const silk_float s[], /* I Input signal */ 180 const silk_float s[], /* I Input signal */
181 const opus_int length /* I Length of input signal */ 181 const opus_int length /* I Length of input signal */
182 ) 182 )
183 { 183 {
184 opus_int ix; 184 opus_int ix;
185 silk_float LPC_pred; 185 silk_float LPC_pred;
186 const silk_float *s_ptr; 186 const silk_float *s_ptr;
187 187
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 240
241 default: 241 default:
242 silk_assert( 0 ); 242 silk_assert( 0 );
243 break; 243 break;
244 } 244 }
245 245
246 /* Set first Order output samples to zero */ 246 /* Set first Order output samples to zero */
247 silk_memset( r_LPC, 0, Order * sizeof( silk_float ) ); 247 silk_memset( r_LPC, 0, Order * sizeof( silk_float ) );
248 } 248 }
249 249
OLDNEW
« no previous file with comments | « silk/fixed/solve_LS_FIX.c ('k') | silk/float/SigProc_FLP.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698