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

◆ Subband()

int fl::third_party::Subband ( MP3DecInfo * mp3DecInfo,
short * pcmBuf )

Definition at line 65 of file subband.hpp.

66{
67 int b;
68 IMDCTInfo *mi;
69 SubbandInfo *sbi;
70
71 /* validate pointers */
72 if (!mp3DecInfo || !mp3DecInfo->HuffmanInfoPS || !mp3DecInfo->IMDCTInfoPS || !mp3DecInfo->SubbandInfoPS)
73 return -1;
74
75 mi = (IMDCTInfo *)(mp3DecInfo->IMDCTInfoPS);
76 sbi = (SubbandInfo*)(mp3DecInfo->SubbandInfoPS);
77
78 if (mp3DecInfo->nChans == 2) {
79 /* stereo */
80 for (b = 0; b < BLOCK_SIZE; b++) {
81 FDCT32(mi->outBuf[0][b], sbi->vbuf + 0*32, sbi->vindex, (b & 0x01), mi->gb[0]);
82 FDCT32(mi->outBuf[1][b], sbi->vbuf + 1*32, sbi->vindex, (b & 0x01), mi->gb[1]);
83 PolyphaseStereo(pcmBuf, sbi->vbuf + sbi->vindex + VBUF_LENGTH * (b & 0x01), polyCoef);
84 sbi->vindex = (sbi->vindex - (b & 0x01)) & 7;
85 pcmBuf += (2 * NBANDS);
86 }
87 } else {
88 /* mono */
89 for (b = 0; b < BLOCK_SIZE; b++) {
90 FDCT32(mi->outBuf[0][b], sbi->vbuf + 0*32, sbi->vindex, (b & 0x01), mi->gb[0]);
91 PolyphaseMono(pcmBuf, sbi->vbuf + sbi->vindex + VBUF_LENGTH * (b & 0x01), polyCoef);
92 sbi->vindex = (sbi->vindex - (b & 0x01)) & 7;
93 pcmBuf += NBANDS;
94 }
95 }
96
97 return 0;
98}
#define VBUF_LENGTH
Definition coder.h:109
#define NBANDS
Definition coder.h:107
#define BLOCK_SIZE
Definition coder.h:106
void * IMDCTInfoPS
Definition mp3common.h:73
void * HuffmanInfoPS
Definition mp3common.h:71
void * SubbandInfoPS
Definition mp3common.h:74
struct fl::third_party::_IMDCTInfo IMDCTInfo
void FDCT32(int32_t *x, int32_t *d, int32_t offset, int32_t oddBlock, int32_t gb) FL_NOEXCEPT
Definition dct32.hpp:151
struct fl::third_party::_SubbandInfo SubbandInfo
const int32_t polyCoef[264]
Definition trigtabs.hpp:282
void PolyphaseMono(short *pcm, int32_t *vbuf, const int32_t *coefBase)
void PolyphaseStereo(short *pcm, int32_t *vbuf, const int32_t *coefBase)
int32_t outBuf[MAX_NCHAN][BLOCK_SIZE][NBANDS]
Definition coder.h:237
int32_t gb[MAX_NCHAN]
Definition coder.h:242
int32_t vbuf[MAX_NCHAN *VBUF_LENGTH]
Definition coder.h:279

References BLOCK_SIZE, FDCT32(), FL_NOEXCEPT, fl::third_party::_IMDCTInfo::gb, NBANDS, fl::third_party::_IMDCTInfo::outBuf, polyCoef, PolyphaseMono(), PolyphaseStereo(), fl::third_party::_SubbandInfo::vbuf, VBUF_LENGTH, and fl::third_party::_SubbandInfo::vindex.

Referenced by MP3Decode().

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