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

◆ FreqInvertRescale()

static int32_t fl::third_party::FreqInvertRescale ( int32_t * y,
int32_t * xPrev,
int32_t blockIdx,
int32_t es )
static

Definition at line 195 of file imdct.hpp.

196{
197 int32_t i;
198 int32_t d, mOut;
199 int32_t y0, y1, y2, y3, y4, y5, y6, y7, y8;
200
201 if (es == 0) {
202 /* fast case - frequency invert only (no rescaling) - can fuse into overlap-add for speed, if desired */
203 if (blockIdx & 0x01) {
204 y += NBANDS;
205 y0 = *y; y += 2*NBANDS;
206 y1 = *y; y += 2*NBANDS;
207 y2 = *y; y += 2*NBANDS;
208 y3 = *y; y += 2*NBANDS;
209 y4 = *y; y += 2*NBANDS;
210 y5 = *y; y += 2*NBANDS;
211 y6 = *y; y += 2*NBANDS;
212 y7 = *y; y += 2*NBANDS;
213 y8 = *y; y += 2*NBANDS;
214
215 y -= 18*NBANDS;
216 *y = -y0; y += 2*NBANDS;
217 *y = -y1; y += 2*NBANDS;
218 *y = -y2; y += 2*NBANDS;
219 *y = -y3; y += 2*NBANDS;
220 *y = -y4; y += 2*NBANDS;
221 *y = -y5; y += 2*NBANDS;
222 *y = -y6; y += 2*NBANDS;
223 *y = -y7; y += 2*NBANDS;
224 *y = -y8; y += 2*NBANDS;
225 }
226 return 0;
227 } else {
228 /* undo pre-IMDCT scaling, clipping if necessary */
229 mOut = 0;
230 if (blockIdx & 0x01) {
231 /* frequency invert */
232 for (i = 0; i < 18; i+=2) {
233 d = *y; CLIP_2N(d, 31 - es); *y = static_cast<int>(static_cast<unsigned int>(d) << es); mOut |= FASTABS(*y); y += NBANDS;
234 d = -*y; CLIP_2N(d, 31 - es); *y = static_cast<int>(static_cast<unsigned int>(d) << es); mOut |= FASTABS(*y); y += NBANDS;
235 d = *xPrev; CLIP_2N(d, 31 - es); *xPrev++ = static_cast<int>(static_cast<unsigned int>(d) << es);
236 }
237 } else {
238 for (i = 0; i < 18; i+=2) {
239 d = *y; CLIP_2N(d, 31 - es); *y = static_cast<int>(static_cast<unsigned int>(d) << es); mOut |= FASTABS(*y); y += NBANDS;
240 d = *y; CLIP_2N(d, 31 - es); *y = static_cast<int>(static_cast<unsigned int>(d) << es); mOut |= FASTABS(*y); y += NBANDS;
241 d = *xPrev; CLIP_2N(d, 31 - es); *xPrev++ = static_cast<int>(static_cast<unsigned int>(d) << es);
242 }
243 }
244 return mOut;
245 }
246}
int y
Definition simple.h:93
#define NBANDS
Definition coder.h:107
#define CLIP_2N(y, n)
Definition coder.h:89
__inline int32_t FASTABS(int32_t x) FL_NOEXCEPT
Absolute value of x.
Definition assembly.h:513
fl::i32 int32_t
Definition coder.h:220

References CLIP_2N, FASTABS(), FL_NOEXCEPT, NBANDS, and fl::y.

Referenced by IMDCT12x3(), and IMDCT36().

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