![]() |
RSeries astromech firmware
|
#include "Arduino.h"
#include "assert.h"
Go to the source code of this file.
Classes | |
struct | MP3FrameInfo |
struct | SFBandTable |
struct | BitStreamInfo |
struct | FrameHeader |
struct | SideInfoSub |
struct | SideInfo |
struct | CriticalBandInfo_t |
struct | DequantInfo |
struct | HuffmanInfo |
struct | HuffTabLookup |
struct | IMDCTInfo |
struct | BlockCount |
struct | ScaleFactorInfoSub |
struct | ScaleFactorJS |
struct | SubbandInfo |
struct | MP3DecInfo |
Typedefs | |
typedef struct MP3FrameInfo | MP3FrameInfo_t |
typedef struct SFBandTable | SFBandTable_t |
typedef struct BitStreamInfo | BitStreamInfo_t |
typedef struct FrameHeader | FrameHeader_t |
typedef struct SideInfoSub | SideInfoSub_t |
typedef struct SideInfo | SideInfo_t |
typedef struct DequantInfo | DequantInfo_t |
typedef struct HuffmanInfo | HuffmanInfo_t |
typedef enum HuffTabType | HuffTabType_t |
typedef struct HuffTabLookup | HuffTabLookup_t |
typedef struct IMDCTInfo | IMDCTInfo_t |
typedef struct BlockCount | BlockCount_t |
typedef struct ScaleFactorInfoSub | ScaleFactorInfoSub_t |
typedef struct ScaleFactorJS | ScaleFactorJS_t |
typedef struct SubbandInfo | SubbandInfo_t |
typedef struct MP3DecInfo | MP3DecInfo_t |
Enumerations | |
enum | { ERR_MP3_NONE = 0, ERR_MP3_INDATA_UNDERFLOW = -1, ERR_MP3_MAINDATA_UNDERFLOW = -2, ERR_MP3_FREE_BITRATE_SYNC = -3, ERR_MP3_OUT_OF_MEMORY = -4, ERR_MP3_NULL_POINTER = -5, ERR_MP3_INVALID_FRAMEHEADER = -6, ERR_MP3_INVALID_SIDEINFO = -7, ERR_MP3_INVALID_SCALEFACT = -8, ERR_MP3_INVALID_HUFFCODES = -9, ERR_MP3_INVALID_DEQUANTIZE = -10, ERR_MP3_INVALID_IMDCT = -11, ERR_MP3_INVALID_SUBBAND = -12, ERR_UNKNOWN = -9999 } |
enum | StereoMode_t { Stereo = 0x00, Joint = 0x01, Dual = 0x02, Mono = 0x03 } |
enum | MPEGVersion_t { MPEG1 = 0, MPEG2 = 1, MPEG25 = 2 } |
enum | HuffTabType { noBits, oneShot, loopNoLinbits, loopLinbits, quadA, quadB, invalidTab } |
Functions | |
bool | MP3Decoder_AllocateBuffers (void) |
void | MP3Decoder_FreeBuffers () |
int | MP3Decode (unsigned char *inbuf, int *bytesLeft, short *outbuf, int useSize) |
void | MP3GetLastFrameInfo () |
int | MP3GetNextFrameInfo (unsigned char *buf) |
int | MP3FindSyncWord (unsigned char *buf, int nBytes) |
int | MP3GetSampRate () |
int | MP3GetChannels () |
int | MP3GetBitsPerSample () |
int | MP3GetBitrate () |
int | MP3GetOutputSamps () |
int | MP3GetDecodedSamps () |
void | MP3Decoder_ClearBuffer (void) |
void | PolyphaseMono (short *pcm, int *vbuf, const uint32_t *coefBase) |
void | PolyphaseStereo (short *pcm, int *vbuf, const uint32_t *coefBase) |
void | SetBitstreamPointer (BitStreamInfo_t *bsi, int nBytes, unsigned char *buf) |
unsigned int | GetBits (BitStreamInfo_t *bsi, int nBits) |
int | CalcBitsUsed (BitStreamInfo_t *bsi, unsigned char *startBuf, int startOffset) |
int | DequantChannel (int *sampleBuf, int *workBuf, int *nonZeroBound, SideInfoSub_t *sis, ScaleFactorInfoSub_t *sfis, CriticalBandInfo_t *cbi) |
void | MidSideProc (int x[m_MAX_NCHAN][m_MAX_NSAMP], int nSamps, int mOut[2]) |
void | IntensityProcMPEG1 (int x[m_MAX_NCHAN][m_MAX_NSAMP], int nSamps, ScaleFactorInfoSub_t *sfis, CriticalBandInfo_t *cbi, int midSideFlag, int mixFlag, int mOut[2]) |
void | IntensityProcMPEG2 (int x[m_MAX_NCHAN][m_MAX_NSAMP], int nSamps, ScaleFactorInfoSub_t *sfis, CriticalBandInfo_t *cbi, ScaleFactorJS_t *sfjs, int midSideFlag, int mixFlag, int mOut[2]) |
void | FDCT32 (int *x, int *d, int offset, int oddBlock, int gb) |
void | FreeBuffers () |
int | CheckPadBit () |
int | UnpackFrameHeader (unsigned char *buf) |
int | UnpackSideInfo (unsigned char *buf) |
int | DecodeHuffman (unsigned char *buf, int *bitOffset, int huffBlockBits, int gr, int ch) |
int | MP3Dequantize (int gr) |
int | IMDCT (int gr, int ch) |
int | UnpackScaleFactors (unsigned char *buf, int *bitOffset, int bitsAvail, int gr, int ch) |
int | Subband (short *pcmBuf) |
short | ClipToShort (int x, int fracBits) |
void | RefillBitstreamCache (BitStreamInfo_t *bsi) |
void | UnpackSFMPEG1 (BitStreamInfo_t *bsi, SideInfoSub_t *sis, ScaleFactorInfoSub_t *sfis, int *scfsi, int gr, ScaleFactorInfoSub_t *sfisGr0) |
void | UnpackSFMPEG2 (BitStreamInfo_t *bsi, SideInfoSub_t *sis, ScaleFactorInfoSub_t *sfis, int gr, int ch, int modeExt, ScaleFactorJS_t *sfjs) |
int | MP3FindFreeSync (unsigned char *buf, unsigned char firstFH[4], int nBytes) |
void | MP3ClearBadFrame (short *outbuf) |
int | DecodeHuffmanPairs (int *xy, int nVals, int tabIdx, int bitsLeft, unsigned char *buf, int bitOffset) |
int | DecodeHuffmanQuads (int *vwxy, int nVals, int tabIdx, int bitsLeft, unsigned char *buf, int bitOffset) |
int | DequantBlock (int *inbuf, int *outbuf, int num, int scale) |
void | AntiAlias (int *x, int nBfly) |
void | WinPrevious (int *xPrev, int *xPrevWin, int btPrev) |
int | FreqInvertRescale (int *y, int *xPrev, int blockIdx, int es) |
void | idct9 (int *x) |
int | IMDCT36 (int *xCurr, int *xPrev, int *y, int btCurr, int btPrev, int blockIdx, int gb) |
void | imdct12 (int *x, int *out) |
int | IMDCT12x3 (int *xCurr, int *xPrev, int *y, int btPrev, int blockIdx, int gb) |
int | HybridTransform (int *xCurr, int *xPrev, int y[m_BLOCK_SIZE][m_NBANDS], SideInfoSub_t *sis, BlockCount_t *bc) |
uint64_t | SAR64 (uint64_t x, int n) |
int | MULSHIFT32 (int x, int y) |
uint64_t | MADD64 (uint64_t sum64, int x, int y) |
int | CLZ (int x) |
uint64_t | xSAR64 (uint64_t x, int n) |
int | FASTABS (int x) |
Variables | |
const int | c9_0 = 0x6ed9eba1 |
const int | c9_1 = 0x620dbe8b |
const int | c9_2 = 0x163a1a7e |
const int | c9_3 = 0x5246dd49 |
const int | c9_4 = 0x7e0e2e32 |
const int | c3_0 = 0x6ed9eba1 |
const int | c6 [3] = { 0x7ba3751d, 0x5a82799a, 0x2120fb83 } |
const uint32_t | c18 [9] = { 0x7f834ed0, 0x7ba3751d, 0x7401e4c1, 0x68d9f964, 0x5a82799a, 0x496af3e2, 0x36185aee, 0x2120fb83, 0x0b27eb5c} |
const char | m_SFLenTab [16][2] |
const char | NRTab [6][3][4] |
const char | preTab [22] = { 0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,2,2,3,3,3,2,0 } |
const int pow14[4] | PROGMEM |
const uint16_t | m_HUFF_OFFSET_01 = 0 |
const uint16_t | m_HUFF_OFFSET_02 = 9 + m_HUFF_OFFSET_01 |
const uint16_t | m_HUFF_OFFSET_03 = 65 + m_HUFF_OFFSET_02 |
const uint16_t | m_HUFF_OFFSET_05 = 65 + m_HUFF_OFFSET_03 |
const uint16_t | m_HUFF_OFFSET_06 =257 + m_HUFF_OFFSET_05 |
const uint16_t | m_HUFF_OFFSET_07 =129 + m_HUFF_OFFSET_06 |
const uint16_t | m_HUFF_OFFSET_08 =110 + m_HUFF_OFFSET_07 |
const uint16_t | m_HUFF_OFFSET_09 =280 + m_HUFF_OFFSET_08 |
const uint16_t | m_HUFF_OFFSET_10 = 93 + m_HUFF_OFFSET_09 |
const uint16_t | m_HUFF_OFFSET_11 =320 + m_HUFF_OFFSET_10 |
const uint16_t | m_HUFF_OFFSET_12 =296 + m_HUFF_OFFSET_11 |
const uint16_t | m_HUFF_OFFSET_13 =185 + m_HUFF_OFFSET_12 |
const uint16_t | m_HUFF_OFFSET_15 =497 + m_HUFF_OFFSET_13 |
const uint16_t | m_HUFF_OFFSET_16 =580 + m_HUFF_OFFSET_15 |
const uint16_t | m_HUFF_OFFSET_24 =651 + m_HUFF_OFFSET_16 |
const short | bitsPerSlotTab [3] = { 32, 8, 8 } |
const unsigned char | uniqueIDTab [8] = {0x5f, 0x4b, 0x43, 0x5f, 0x5f, 0x4a, 0x52, 0x5f} |
typedef struct BitStreamInfo BitStreamInfo_t |
typedef struct BlockCount BlockCount_t |
typedef struct DequantInfo DequantInfo_t |
typedef struct FrameHeader FrameHeader_t |
typedef struct HuffmanInfo HuffmanInfo_t |
typedef struct HuffTabLookup HuffTabLookup_t |
typedef enum HuffTabType HuffTabType_t |
typedef struct IMDCTInfo IMDCTInfo_t |
typedef struct MP3DecInfo MP3DecInfo_t |
typedef struct MP3FrameInfo MP3FrameInfo_t |
typedef struct ScaleFactorInfoSub ScaleFactorInfoSub_t |
typedef struct ScaleFactorJS ScaleFactorJS_t |
typedef struct SFBandTable SFBandTable_t |
typedef struct SideInfo SideInfo_t |
typedef struct SideInfoSub SideInfoSub_t |
typedef struct SubbandInfo SubbandInfo_t |
anonymous enum |
enum HuffTabType |
enum MPEGVersion_t |
enum StereoMode_t |
void AntiAlias | ( | int * | x, |
int | nBfly | ||
) |
int CalcBitsUsed | ( | BitStreamInfo_t * | bsi, |
unsigned char * | startBuf, | ||
int | startOffset | ||
) |
int CheckPadBit | ( | ) |
short ClipToShort | ( | int | x, |
int | fracBits | ||
) |
|
inline |
int DecodeHuffman | ( | unsigned char * | buf, |
int * | bitOffset, | ||
int | huffBlockBits, | ||
int | gr, | ||
int | ch | ||
) |
int DecodeHuffmanPairs | ( | int * | xy, |
int | nVals, | ||
int | tabIdx, | ||
int | bitsLeft, | ||
unsigned char * | buf, | ||
int | bitOffset | ||
) |
int DecodeHuffmanQuads | ( | int * | vwxy, |
int | nVals, | ||
int | tabIdx, | ||
int | bitsLeft, | ||
unsigned char * | buf, | ||
int | bitOffset | ||
) |
int DequantBlock | ( | int * | inbuf, |
int * | outbuf, | ||
int | num, | ||
int | scale | ||
) |
int DequantChannel | ( | int * | sampleBuf, |
int * | workBuf, | ||
int * | nonZeroBound, | ||
SideInfoSub_t * | sis, | ||
ScaleFactorInfoSub_t * | sfis, | ||
CriticalBandInfo_t * | cbi | ||
) |
|
inline |
void FDCT32 | ( | int * | x, |
int * | d, | ||
int | offset, | ||
int | oddBlock, | ||
int | gb | ||
) |
void FreeBuffers | ( | ) |
int FreqInvertRescale | ( | int * | y, |
int * | xPrev, | ||
int | blockIdx, | ||
int | es | ||
) |
unsigned int GetBits | ( | BitStreamInfo_t * | bsi, |
int | nBits | ||
) |
int HybridTransform | ( | int * | xCurr, |
int * | xPrev, | ||
int | y[m_BLOCK_SIZE][m_NBANDS], | ||
SideInfoSub_t * | sis, | ||
BlockCount_t * | bc | ||
) |
void idct9 | ( | int * | x | ) |
int IMDCT | ( | int | gr, |
int | ch | ||
) |
void imdct12 | ( | int * | x, |
int * | out | ||
) |
int IMDCT12x3 | ( | int * | xCurr, |
int * | xPrev, | ||
int * | y, | ||
int | btPrev, | ||
int | blockIdx, | ||
int | gb | ||
) |
int IMDCT36 | ( | int * | xCurr, |
int * | xPrev, | ||
int * | y, | ||
int | btCurr, | ||
int | btPrev, | ||
int | blockIdx, | ||
int | gb | ||
) |
void IntensityProcMPEG1 | ( | int | x[m_MAX_NCHAN][m_MAX_NSAMP], |
int | nSamps, | ||
ScaleFactorInfoSub_t * | sfis, | ||
CriticalBandInfo_t * | cbi, | ||
int | midSideFlag, | ||
int | mixFlag, | ||
int | mOut[2] | ||
) |
void IntensityProcMPEG2 | ( | int | x[m_MAX_NCHAN][m_MAX_NSAMP], |
int | nSamps, | ||
ScaleFactorInfoSub_t * | sfis, | ||
CriticalBandInfo_t * | cbi, | ||
ScaleFactorJS_t * | sfjs, | ||
int | midSideFlag, | ||
int | mixFlag, | ||
int | mOut[2] | ||
) |
|
inline |
void MidSideProc | ( | int | x[m_MAX_NCHAN][m_MAX_NSAMP], |
int | nSamps, | ||
int | mOut[2] | ||
) |
void MP3ClearBadFrame | ( | short * | outbuf | ) |
int MP3Decode | ( | unsigned char * | inbuf, |
int * | bytesLeft, | ||
short * | outbuf, | ||
int | useSize | ||
) |
bool MP3Decoder_AllocateBuffers | ( | void | ) |
void MP3Decoder_ClearBuffer | ( | void | ) |
void MP3Decoder_FreeBuffers | ( | ) |
int MP3Dequantize | ( | int | gr | ) |
int MP3FindFreeSync | ( | unsigned char * | buf, |
unsigned char | firstFH[4], | ||
int | nBytes | ||
) |
int MP3FindSyncWord | ( | unsigned char * | buf, |
int | nBytes | ||
) |
int MP3GetBitrate | ( | ) |
int MP3GetBitsPerSample | ( | ) |
int MP3GetChannels | ( | ) |
int MP3GetDecodedSamps | ( | ) |
void MP3GetLastFrameInfo | ( | ) |
int MP3GetNextFrameInfo | ( | unsigned char * | buf | ) |
int MP3GetOutputSamps | ( | ) |
int MP3GetSampRate | ( | ) |
|
inline |
void PolyphaseMono | ( | short * | pcm, |
int * | vbuf, | ||
const uint32_t * | coefBase | ||
) |
void PolyphaseStereo | ( | short * | pcm, |
int * | vbuf, | ||
const uint32_t * | coefBase | ||
) |
void RefillBitstreamCache | ( | BitStreamInfo_t * | bsi | ) |
|
inline |
void SetBitstreamPointer | ( | BitStreamInfo_t * | bsi, |
int | nBytes, | ||
unsigned char * | buf | ||
) |
int Subband | ( | short * | pcmBuf | ) |
int UnpackFrameHeader | ( | unsigned char * | buf | ) |
int UnpackScaleFactors | ( | unsigned char * | buf, |
int * | bitOffset, | ||
int | bitsAvail, | ||
int | gr, | ||
int | ch | ||
) |
void UnpackSFMPEG1 | ( | BitStreamInfo_t * | bsi, |
SideInfoSub_t * | sis, | ||
ScaleFactorInfoSub_t * | sfis, | ||
int * | scfsi, | ||
int | gr, | ||
ScaleFactorInfoSub_t * | sfisGr0 | ||
) |
void UnpackSFMPEG2 | ( | BitStreamInfo_t * | bsi, |
SideInfoSub_t * | sis, | ||
ScaleFactorInfoSub_t * | sfis, | ||
int | gr, | ||
int | ch, | ||
int | modeExt, | ||
ScaleFactorJS_t * | sfjs | ||
) |
int UnpackSideInfo | ( | unsigned char * | buf | ) |
void WinPrevious | ( | int * | xPrev, |
int * | xPrevWin, | ||
int | btPrev | ||
) |
|
inline |
const short bitsPerSlotTab[3] = { 32, 8, 8 } |
const uint32_t c18[9] = { 0x7f834ed0, 0x7ba3751d, 0x7401e4c1, 0x68d9f964, 0x5a82799a, 0x496af3e2, 0x36185aee, 0x2120fb83, 0x0b27eb5c} |
const int c3_0 = 0x6ed9eba1 |
const int c6[3] = { 0x7ba3751d, 0x5a82799a, 0x2120fb83 } |
const int c9_0 = 0x6ed9eba1 |
const int c9_1 = 0x620dbe8b |
const int c9_2 = 0x163a1a7e |
const int c9_3 = 0x5246dd49 |
const int c9_4 = 0x7e0e2e32 |
const uint16_t m_HUFF_OFFSET_01 = 0 |
const uint16_t m_HUFF_OFFSET_02 = 9 + m_HUFF_OFFSET_01 |
const uint16_t m_HUFF_OFFSET_03 = 65 + m_HUFF_OFFSET_02 |
const uint16_t m_HUFF_OFFSET_05 = 65 + m_HUFF_OFFSET_03 |
const uint16_t m_HUFF_OFFSET_06 =257 + m_HUFF_OFFSET_05 |
const uint16_t m_HUFF_OFFSET_07 =129 + m_HUFF_OFFSET_06 |
const uint16_t m_HUFF_OFFSET_08 =110 + m_HUFF_OFFSET_07 |
const uint16_t m_HUFF_OFFSET_09 =280 + m_HUFF_OFFSET_08 |
const uint16_t m_HUFF_OFFSET_10 = 93 + m_HUFF_OFFSET_09 |
const uint16_t m_HUFF_OFFSET_11 =320 + m_HUFF_OFFSET_10 |
const uint16_t m_HUFF_OFFSET_12 =296 + m_HUFF_OFFSET_11 |
const uint16_t m_HUFF_OFFSET_13 =185 + m_HUFF_OFFSET_12 |
const uint16_t m_HUFF_OFFSET_15 =497 + m_HUFF_OFFSET_13 |
const uint16_t m_HUFF_OFFSET_16 =580 + m_HUFF_OFFSET_15 |
const uint16_t m_HUFF_OFFSET_24 =651 + m_HUFF_OFFSET_16 |
const char m_SFLenTab[16][2] |
const char NRTab[6][3][4] |
const char preTab[22] = { 0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,2,2,3,3,3,2,0 } |
static const ServoSequence SeqPanelLongHarlemShake PROGMEM |
const unsigned char uniqueIDTab[8] = {0x5f, 0x4b, 0x43, 0x5f, 0x5f, 0x4a, 0x52, 0x5f} |