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

◆ IMDCT12x3()

static int32_t fl::third_party::IMDCT12x3 ( int32_t * xCurr,
int32_t * xPrev,
int32_t * y,
int32_t btPrev,
int32_t blockIdx,
int32_t gb )
static

Definition at line 551 of file imdct.hpp.

552{
553 int32_t i, es, mOut;
554 int32_t yLo, xBuf[18], xPrevWin[18]; /* need temp buffer for reordering short blocks */
555 const int32_t *wp;
556
557 es = 0;
558 /* 7 gb is always adequate for accumulator loop + idct12 + window + overlap */
559 if (gb < 7) {
560 es = 7 - gb;
561 for (i = 0; i < 18; i+=2) {
562 xCurr[i+0] >>= es;
563 xCurr[i+1] >>= es;
564 *xPrev++ >>= es;
565 }
566 xPrev -= 9;
567 }
568
569 /* requires 4 input guard bits for each imdct12 */
570 imdct12(xCurr + 0, xBuf + 0);
571 imdct12(xCurr + 1, xBuf + 6);
572 imdct12(xCurr + 2, xBuf + 12);
573
574 /* window previous from last time */
575 WinPrevious(xPrev, xPrevWin, btPrev);
576
577 /* could unroll this for speed, minimum loads (short blocks usually rare, so doesn't make much overall difference)
578 * xPrevWin[i] << 2 still has 1 gb always, max gain of windowed xBuf stuff also < 1.0 and gain the sign bit
579 * so y calculations won't overflow
580 */
581 wp = imdctWin[2];
582 mOut = 0;
583 for (i = 0; i < 3; i++) {
584 yLo = (xPrevWin[ 0+i] * 4L);
585 mOut |= FASTABS(yLo); y[( 0+i)*NBANDS] = yLo;
586 yLo = (xPrevWin[ 3+i] * 4L);
587 mOut |= FASTABS(yLo); y[( 3+i)*NBANDS] = yLo;
588 yLo = (xPrevWin[ 6+i] * 4L) + (MULSHIFT32(wp[0+i], xBuf[3+i]));
589 mOut |= FASTABS(yLo); y[( 6+i)*NBANDS] = yLo;
590 yLo = (xPrevWin[ 9+i] * 4L) + (MULSHIFT32(wp[3+i], xBuf[5-i]));
591 mOut |= FASTABS(yLo); y[( 9+i)*NBANDS] = yLo;
592 yLo = (xPrevWin[12+i] * 4L) + (MULSHIFT32(wp[6+i], xBuf[2-i]) + MULSHIFT32(wp[0+i], xBuf[(6+3)+i]));
593 mOut |= FASTABS(yLo); y[(12+i)*NBANDS] = yLo;
594 yLo = (xPrevWin[15+i] * 4L) + (MULSHIFT32(wp[9+i], xBuf[0+i]) + MULSHIFT32(wp[3+i], xBuf[(6+5)-i]));
595 mOut |= FASTABS(yLo); y[(15+i)*NBANDS] = yLo;
596 }
597
598 /* save previous (unwindowed) for overlap - only need samples 6-8, 12-17 */
599 for (i = 6; i < 9; i++)
600 *xPrev++ = xBuf[i] >> 2;
601 for (i = 12; i < 18; i++)
602 *xPrev++ = xBuf[i] >> 2;
603
604 xPrev -= 9;
605 mOut |= FreqInvertRescale(y, xPrev, blockIdx, es);
606
607 return mOut;
608}
int y
Definition simple.h:93
#define NBANDS
Definition coder.h:107
static int32_t FreqInvertRescale(int32_t *y, int32_t *xPrev, int32_t blockIdx, int32_t es) FL_NOEXCEPT
Definition imdct.hpp:195
__inline int32_t MULSHIFT32(int32_t x, int32_t y) FL_NOEXCEPT
Multiply together two 32-bit numbers and return the top 32-bits of the result.
Definition assembly.h:503
__inline int32_t FASTABS(int32_t x) FL_NOEXCEPT
Absolute value of x.
Definition assembly.h:513
static void WinPrevious(int32_t *xPrev, int32_t *xPrevWin, int32_t btPrev) FL_NOEXCEPT
Definition imdct.hpp:141
const int32_t imdctWin[4][36]
Definition trigtabs.hpp:107
fl::i32 int32_t
Definition coder.h:220
static __inline void imdct12(int32_t *x, int32_t *out) FL_NOEXCEPT
Definition imdct.hpp:485

References FASTABS(), FL_NOEXCEPT, FreqInvertRescale(), imdct12(), imdctWin, MULSHIFT32(), NBANDS, WinPrevious(), and fl::y.

Referenced by HybridTransform().

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