OpenCore  1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
coder.h File Reference
#include "mp3common.h"

Go to the source code of this file.

Data Structures

struct  _BitStreamInfo
 
struct  _FrameHeader
 
struct  _SideInfoSub
 
struct  _SideInfo
 
struct  CriticalBandInfo
 
struct  _DequantInfo
 
struct  _HuffmanInfo
 
struct  _HuffTabLookup
 
struct  _IMDCTInfo
 
struct  _BlockCount
 
struct  _ScaleFactorInfoSub
 
struct  _ScaleFactorJS
 
struct  _ScaleFactorInfo
 
struct  _SubbandInfo
 

Macros

#define ASSERT(x)
 
#define MAX(a, b)
 
#define MIN(a, b)
 
#define CLIP_2N(y, n)
 
#define SIBYTES_MPEG1_MONO   17
 
#define SIBYTES_MPEG1_STEREO   32
 
#define SIBYTES_MPEG2_MONO   9
 
#define SIBYTES_MPEG2_STEREO   17
 
#define POW43_FRACBITS_LOW   22
 
#define POW43_FRACBITS_HIGH   12
 
#define DQ_FRACBITS_OUT   25 /* number of fraction bits in output of dequant */
 
#define IMDCT_SCALE   2 /* additional scaling (by sqrt(2)) for fast IMDCT36 */
 
#define HUFF_PAIRTABS   32
 
#define BLOCK_SIZE   18
 
#define NBANDS   32
 
#define MAX_REORDER_SAMPS   ((192-126)*3) /* largest critical band for short blocks (see sfBandTable) */
 
#define VBUF_LENGTH   (17 * 2 * NBANDS) /* for double-sized vbuf FIFO */
 
#define SetBitstreamPointer   STATNAME(SetBitstreamPointer)
 
#define GetBits   STATNAME(GetBits)
 
#define CalcBitsUsed   STATNAME(CalcBitsUsed)
 
#define DequantChannel   STATNAME(DequantChannel)
 
#define MidSideProc   STATNAME(MidSideProc)
 
#define IntensityProcMPEG1   STATNAME(IntensityProcMPEG1)
 
#define IntensityProcMPEG2   STATNAME(IntensityProcMPEG2)
 
#define PolyphaseMono   STATNAME(PolyphaseMono)
 
#define PolyphaseStereo   STATNAME(PolyphaseStereo)
 
#define FDCT32   STATNAME(FDCT32)
 
#define ISFMpeg1   STATNAME(ISFMpeg1)
 
#define ISFMpeg2   STATNAME(ISFMpeg2)
 
#define ISFIIP   STATNAME(ISFIIP)
 
#define uniqueIDTab   STATNAME(uniqueIDTab)
 
#define coef32   STATNAME(coef32)
 
#define polyCoef   STATNAME(polyCoef)
 
#define csa   STATNAME(csa)
 
#define imdctWin   STATNAME(imdctWin)
 
#define huffTable   STATNAME(huffTable)
 
#define huffTabOffset   STATNAME(huffTabOffset)
 
#define huffTabLookup   STATNAME(huffTabLookup)
 
#define quadTable   STATNAME(quadTable)
 
#define quadTabOffset   STATNAME(quadTabOffset)
 
#define quadTabMaxBits   STATNAME(quadTabMaxBits)
 

Typedefs

typedef struct _BitStreamInfo BitStreamInfo
 
typedef struct _FrameHeader FrameHeader
 
typedef struct _SideInfoSub SideInfoSub
 
typedef struct _SideInfo SideInfo
 
typedef struct _DequantInfo DequantInfo
 
typedef struct _HuffmanInfo HuffmanInfo
 
typedef enum _HuffTabType HuffTabType
 
typedef struct _HuffTabLookup HuffTabLookup
 
typedef struct _IMDCTInfo IMDCTInfo
 
typedef struct _BlockCount BlockCount
 
typedef struct _ScaleFactorInfoSub ScaleFactorInfoSub
 
typedef struct _ScaleFactorJS ScaleFactorJS
 
typedef struct _ScaleFactorInfo ScaleFactorInfo
 
typedef struct _SubbandInfo SubbandInfo
 

Enumerations

enum  StereoMode { Stereo = 0x00 , Joint = 0x01 , Dual = 0x02 , Mono = 0x03 }
 
enum  _HuffTabType {
  noBits , oneShot , loopNoLinbits , loopLinbits ,
  quadA , quadB , invalidTab
}
 

Functions

void SetBitstreamPointer (BitStreamInfo *bsi, int nBytes, unsigned char *buf)
 
unsigned int GetBits (BitStreamInfo *bsi, int nBits)
 
int CalcBitsUsed (BitStreamInfo *bsi, unsigned char *startBuf, int startOffset)
 
int DequantChannel (int *sampleBuf, int *workBuf, int *nonZeroBound, FrameHeader *fh, SideInfoSub *sis, ScaleFactorInfoSub *sfis, CriticalBandInfo *cbi)
 
void MidSideProc (int x[MAX_NCHAN][MAX_NSAMP], int nSamps, int mOut[2])
 
void IntensityProcMPEG1 (int x[MAX_NCHAN][MAX_NSAMP], int nSamps, FrameHeader *fh, ScaleFactorInfoSub *sfis, CriticalBandInfo *cbi, int midSideFlag, int mixFlag, int mOut[2])
 
void IntensityProcMPEG2 (int x[MAX_NCHAN][MAX_NSAMP], int nSamps, FrameHeader *fh, ScaleFactorInfoSub *sfis, CriticalBandInfo *cbi, ScaleFactorJS *sfjs, int midSideFlag, int mixFlag, int mOut[2])
 
void FDCT32 (int *x, int *d, int offset, int oddBlock, int gb)
 
void PolyphaseMono (short *pcm, int *vbuf, const int *coefBase)
 
void PolyphaseStereo (short *pcm, int *vbuf, const int *coefBase)
 

Variables

const HuffTabLookup huffTabLookup [HUFF_PAIRTABS]
 
const int huffTabOffset [HUFF_PAIRTABS]
 
const unsigned short huffTable []
 
const unsigned char quadTable [64+16]
 
const int quadTabOffset [2]
 
const int quadTabMaxBits [2]
 
const int imdctWin [4][36]
 
const int ISFMpeg1 [2][7]
 
const int ISFMpeg2 [2][2][16]
 
const int ISFIIP [2][2]
 
const int csa [8][2]
 
const int coef32 [31]
 
const int polyCoef [264]
 

Macro Definition Documentation

◆ ASSERT

#define ASSERT ( x)
Value:
/* do nothing */

Definition at line 55 of file coder.h.

◆ BLOCK_SIZE

#define BLOCK_SIZE   18

Definition at line 87 of file coder.h.

◆ CalcBitsUsed

#define CalcBitsUsed   STATNAME(CalcBitsUsed)

Definition at line 95 of file coder.h.

◆ CLIP_2N

#define CLIP_2N ( y,
n )
Value:
{ \
int sign = (y) >> 31; \
if (sign != (y) >> (n)) { \
(y) = sign ^ ((1 << (n)) - 1); \
} \
}
UINT16 y
Definition BmfFile.h:84

Definition at line 67 of file coder.h.

◆ coef32

#define coef32   STATNAME(coef32)

Definition at line 108 of file coder.h.

◆ csa

#define csa   STATNAME(csa)

Definition at line 110 of file coder.h.

◆ DequantChannel

#define DequantChannel   STATNAME(DequantChannel)

Definition at line 96 of file coder.h.

◆ DQ_FRACBITS_OUT

#define DQ_FRACBITS_OUT   25 /* number of fraction bits in output of dequant */

Definition at line 83 of file coder.h.

◆ FDCT32

#define FDCT32   STATNAME(FDCT32)

Definition at line 102 of file coder.h.

◆ GetBits

#define GetBits   STATNAME(GetBits)

Definition at line 94 of file coder.h.

◆ HUFF_PAIRTABS

#define HUFF_PAIRTABS   32

Definition at line 86 of file coder.h.

◆ huffTable

#define huffTable   STATNAME(huffTable)

Definition at line 113 of file coder.h.

◆ huffTabLookup

#define huffTabLookup   STATNAME(huffTabLookup)

Definition at line 115 of file coder.h.

◆ huffTabOffset

#define huffTabOffset   STATNAME(huffTabOffset)

Definition at line 114 of file coder.h.

◆ IMDCT_SCALE

#define IMDCT_SCALE   2 /* additional scaling (by sqrt(2)) for fast IMDCT36 */

Definition at line 84 of file coder.h.

◆ imdctWin

#define imdctWin   STATNAME(imdctWin)

Definition at line 111 of file coder.h.

◆ IntensityProcMPEG1

#define IntensityProcMPEG1   STATNAME(IntensityProcMPEG1)

Definition at line 98 of file coder.h.

◆ IntensityProcMPEG2

#define IntensityProcMPEG2   STATNAME(IntensityProcMPEG2)

Definition at line 99 of file coder.h.

◆ ISFIIP

#define ISFIIP   STATNAME(ISFIIP)

Definition at line 106 of file coder.h.

◆ ISFMpeg1

#define ISFMpeg1   STATNAME(ISFMpeg1)

Definition at line 104 of file coder.h.

◆ ISFMpeg2

#define ISFMpeg2   STATNAME(ISFMpeg2)

Definition at line 105 of file coder.h.

◆ MAX

#define MAX ( a,
b )
Value:
((a) > (b) ? (a) : (b))

Definition at line 59 of file coder.h.

◆ MAX_REORDER_SAMPS

#define MAX_REORDER_SAMPS   ((192-126)*3) /* largest critical band for short blocks (see sfBandTable) */

Definition at line 89 of file coder.h.

◆ MidSideProc

#define MidSideProc   STATNAME(MidSideProc)

Definition at line 97 of file coder.h.

◆ MIN

#define MIN ( a,
b )
Value:
((a) < (b) ? (a) : (b))

Definition at line 63 of file coder.h.

◆ NBANDS

#define NBANDS   32

Definition at line 88 of file coder.h.

◆ polyCoef

#define polyCoef   STATNAME(polyCoef)

Definition at line 109 of file coder.h.

◆ PolyphaseMono

#define PolyphaseMono   STATNAME(PolyphaseMono)

Definition at line 100 of file coder.h.

◆ PolyphaseStereo

#define PolyphaseStereo   STATNAME(PolyphaseStereo)

Definition at line 101 of file coder.h.

◆ POW43_FRACBITS_HIGH

#define POW43_FRACBITS_HIGH   12

Definition at line 81 of file coder.h.

◆ POW43_FRACBITS_LOW

#define POW43_FRACBITS_LOW   22

Definition at line 80 of file coder.h.

◆ quadTable

#define quadTable   STATNAME(quadTable)

Definition at line 116 of file coder.h.

◆ quadTabMaxBits

#define quadTabMaxBits   STATNAME(quadTabMaxBits)

Definition at line 118 of file coder.h.

◆ quadTabOffset

#define quadTabOffset   STATNAME(quadTabOffset)

Definition at line 117 of file coder.h.

◆ SetBitstreamPointer

#define SetBitstreamPointer   STATNAME(SetBitstreamPointer)

Definition at line 93 of file coder.h.

◆ SIBYTES_MPEG1_MONO

#define SIBYTES_MPEG1_MONO   17

Definition at line 74 of file coder.h.

◆ SIBYTES_MPEG1_STEREO

#define SIBYTES_MPEG1_STEREO   32

Definition at line 75 of file coder.h.

◆ SIBYTES_MPEG2_MONO

#define SIBYTES_MPEG2_MONO   9

Definition at line 76 of file coder.h.

◆ SIBYTES_MPEG2_STEREO

#define SIBYTES_MPEG2_STEREO   17

Definition at line 77 of file coder.h.

◆ uniqueIDTab

#define uniqueIDTab   STATNAME(uniqueIDTab)

Definition at line 107 of file coder.h.

◆ VBUF_LENGTH

#define VBUF_LENGTH   (17 * 2 * NBANDS) /* for double-sized vbuf FIFO */

Definition at line 90 of file coder.h.

Typedef Documentation

◆ BitStreamInfo

typedef struct _BitStreamInfo BitStreamInfo

◆ BlockCount

typedef struct _BlockCount BlockCount

◆ DequantInfo

typedef struct _DequantInfo DequantInfo

◆ FrameHeader

typedef struct _FrameHeader FrameHeader

◆ HuffmanInfo

typedef struct _HuffmanInfo HuffmanInfo

◆ HuffTabLookup

typedef struct _HuffTabLookup HuffTabLookup

◆ HuffTabType

typedef enum _HuffTabType HuffTabType

◆ IMDCTInfo

typedef struct _IMDCTInfo IMDCTInfo

◆ ScaleFactorInfo

◆ ScaleFactorInfoSub

◆ ScaleFactorJS

typedef struct _ScaleFactorJS ScaleFactorJS

◆ SideInfo

typedef struct _SideInfo SideInfo

◆ SideInfoSub

typedef struct _SideInfoSub SideInfoSub

◆ SubbandInfo

typedef struct _SubbandInfo SubbandInfo

Enumeration Type Documentation

◆ _HuffTabType

Enumerator
noBits 
oneShot 
loopNoLinbits 
loopLinbits 
quadA 
quadB 
invalidTab 

Definition at line 196 of file coder.h.

◆ StereoMode

enum StereoMode
Enumerator
Stereo 
Joint 
Dual 
Mono 

Definition at line 121 of file coder.h.

Function Documentation

◆ CalcBitsUsed()

int CalcBitsUsed ( BitStreamInfo * bsi,
unsigned char * startBuf,
int startOffset )

Definition at line 165 of file bitstream.c.

◆ DequantChannel()

int DequantChannel ( int * sampleBuf,
int * workBuf,
int * nonZeroBound,
FrameHeader * fh,
SideInfoSub * sis,
ScaleFactorInfoSub * sfis,
CriticalBandInfo * cbi )

Definition at line 244 of file dqchan.c.

◆ FDCT32()

void FDCT32 ( int * x,
int * d,
int offset,
int oddBlock,
int gb )

Definition at line 144 of file dct32.c.

◆ GetBits()

unsigned int GetBits ( BitStreamInfo * bsi,
int nBits )

Definition at line 129 of file bitstream.c.

◆ IntensityProcMPEG1()

void IntensityProcMPEG1 ( int x[MAX_NCHAN][MAX_NSAMP],
int nSamps,
FrameHeader * fh,
ScaleFactorInfoSub * sfis,
CriticalBandInfo * cbi,
int midSideFlag,
int mixFlag,
int mOut[2] )

Definition at line 106 of file stproc.c.

◆ IntensityProcMPEG2()

void IntensityProcMPEG2 ( int x[MAX_NCHAN][MAX_NSAMP],
int nSamps,
FrameHeader * fh,
ScaleFactorInfoSub * sfis,
CriticalBandInfo * cbi,
ScaleFactorJS * sfjs,
int midSideFlag,
int mixFlag,
int mOut[2] )

Definition at line 212 of file stproc.c.

◆ MidSideProc()

void MidSideProc ( int x[MAX_NCHAN][MAX_NSAMP],
int nSamps,
int mOut[2] )

Definition at line 64 of file stproc.c.

◆ PolyphaseMono()

void PolyphaseMono ( short * pcm,
int * vbuf,
const int * coefBase )

Definition at line 112 of file polyphase.c.

◆ PolyphaseStereo()

void PolyphaseStereo ( short * pcm,
int * vbuf,
const int * coefBase )

Definition at line 225 of file polyphase.c.

◆ SetBitstreamPointer()

void SetBitstreamPointer ( BitStreamInfo * bsi,
int nBytes,
unsigned char * buf )

Definition at line 60 of file bitstream.c.

Variable Documentation

◆ coef32

const int coef32[31]
extern

Definition at line 248 of file trigtabs.c.

◆ csa

const int csa[8][2]
extern

Definition at line 225 of file trigtabs.c.

◆ huffTable

const unsigned short huffTable[]
extern

Definition at line 77 of file hufftabs.c.

◆ huffTabLookup

const HuffTabLookup huffTabLookup[HUFF_PAIRTABS]
extern

Definition at line 699 of file hufftabs.c.

◆ huffTabOffset

const int huffTabOffset[HUFF_PAIRTABS]
extern

Definition at line 664 of file hufftabs.c.

◆ imdctWin

const int imdctWin[4][36]
extern

Definition at line 103 of file trigtabs.c.

◆ ISFIIP

const int ISFIIP[2][2]
extern

Definition at line 214 of file trigtabs.c.

◆ ISFMpeg1

const int ISFMpeg1[2][7]
extern

Definition at line 160 of file trigtabs.c.

◆ ISFMpeg2

const int ISFMpeg2[2][2][16]
extern

Definition at line 182 of file trigtabs.c.

◆ polyCoef

const int polyCoef[264]
extern

Definition at line 278 of file trigtabs.c.

◆ quadTable

const unsigned char quadTable[64+16]
extern

Definition at line 739 of file hufftabs.c.

◆ quadTabMaxBits

const int quadTabMaxBits[2]
extern

Definition at line 755 of file hufftabs.c.

◆ quadTabOffset

const int quadTabOffset[2]
extern

Definition at line 754 of file hufftabs.c.