FastLED 3.9.15
Loading...
Searching...
No Matches

◆ PolyphaseMono()

void fl::third_party::PolyphaseMono ( short * pcm,
int32_t * vbuf,
const int32_t * coefBase )

Definition at line 130 of file polyphase.hpp.

131{
132 int i;
133 const int32_t *coef;
134 int32_t *vb1;
135 int vLo, vHi, c1, c2;
136 Word64 sum1L, sum2L, rndVal;
137
138 rndVal = (Word64)( (i64)1 << (DEF_NFRACBITS - 1 + (32 - CSHIFT)) );
139
140 /* special case, output sample 0 */
141 coef = coefBase;
142 vb1 = vbuf;
143 sum1L = rndVal;
144
145 MC0M(0)
146 MC0M(1)
147 MC0M(2)
148 MC0M(3)
149 MC0M(4)
150 MC0M(5)
151 MC0M(6)
152 MC0M(7)
153
154 *(pcm + 0) = ClipToShort((int)SAR64(sum1L, (32-CSHIFT)), DEF_NFRACBITS);
155
156 /* special case, output sample 16 */
157 coef = coefBase + 256;
158 vb1 = vbuf + 64*16;
159 sum1L = rndVal;
160
161 MC1M(0)
162 MC1M(1)
163 MC1M(2)
164 MC1M(3)
165 MC1M(4)
166 MC1M(5)
167 MC1M(6)
168 MC1M(7)
169
170 *(pcm + 16) = ClipToShort((int)SAR64(sum1L, (32-CSHIFT)), DEF_NFRACBITS);
171
172 /* main convolution loop: sum1L = samples 1, 2, 3, ... 15 sum2L = samples 31, 30, ... 17 */
173 coef = coefBase + 16;
174 vb1 = vbuf + 64;
175 pcm++;
176
177 /* right now, the compiler creates bad asm from this... */
178 for (i = 15; i > 0; i--) {
179 sum1L = sum2L = rndVal;
180
181 MC2M(0)
182 MC2M(1)
183 MC2M(2)
184 MC2M(3)
185 MC2M(4)
186 MC2M(5)
187 MC2M(6)
188 MC2M(7)
189
190 vb1 += 64;
191 *(pcm) = ClipToShort((int)SAR64(sum1L, (32-CSHIFT)), DEF_NFRACBITS);
192 *(pcm + 2*i) = ClipToShort((int)SAR64(sum2L, (32-CSHIFT)), DEF_NFRACBITS);
193 pcm++;
194 }
195}
static __inline short ClipToShort(int x, int fracBits) FL_NOEXCEPT
Definition polyphase.hpp:74
fl::i64 i64
Definition coder.h:222
fl::i32 int32_t
Definition coder.h:220
long long Word64
Definition assembly.h:498
__inline Word64 SAR64(Word64 x, int n) FL_NOEXCEPT
Shift right.
Definition assembly.h:564
#define MC1M(x)
Definition polyphase.hpp:96
#define DEF_NFRACBITS
Definition polyphase.hpp:71
#define MC0M(x)
Definition polyphase.hpp:90
#define CSHIFT
Definition polyphase.hpp:72
#define MC2M(x)

References ClipToShort(), CSHIFT, DEF_NFRACBITS, FL_NOEXCEPT, MC0M, MC1M, MC2M, and SAR64().

Referenced by Subband().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: