MP3Internals.cpp File Reference

Go to the source code of this file.

Classes

struct  bandInfoStruct

Functions

unsigned ComputeFrameSize (unsigned bitrate, unsigned samplingFreq, Boolean usePadding, Boolean isMPEG2, unsigned char layer)
static unsigned updateSideInfoSizes (MP3SideInfo &sideInfo, Boolean isMPEG2, unsigned char const *mainDataPtr, unsigned allowedNumBits, unsigned &part23Length0a, unsigned &part23Length0aTruncation, unsigned &part23Length0b, unsigned &part23Length0bTruncation, unsigned &part23Length1a, unsigned &part23Length1aTruncation, unsigned &part23Length1b, unsigned &part23Length1bTruncation)
Boolean GetADUInfoFromMP3Frame (unsigned char const *framePtr, unsigned totFrameSize, unsigned &hdr, unsigned &frameSize, MP3SideInfo &sideInfo, unsigned &sideInfoSize, unsigned &backpointer, unsigned &aduSize)
static void getSideInfo1 (MP3FrameParams &fr, MP3SideInfo &si, int stereo, int ms_stereo, long sfreq, int)
static void getSideInfo2 (MP3FrameParams &fr, MP3SideInfo &si, int stereo, int ms_stereo, long sfreq, int)
static void putSideInfo1 (BitVector &bv, MP3SideInfo const &si, Boolean isStereo)
static void putSideInfo2 (BitVector &bv, MP3SideInfo const &si, Boolean isStereo)
static void PutMP3SideInfoIntoFrame (MP3SideInfo const &si, MP3FrameParams const &fr, unsigned char *framePtr)
Boolean ZeroOutMP3SideInfo (unsigned char *framePtr, unsigned totFrameSize, unsigned newBackpointer)
static unsigned MP3BitrateToBitrateIndex (unsigned bitrate, Boolean isMPEG2)
static void outputHeader (unsigned char *toPtr, unsigned hdr)
static void assignADUBackpointer (MP3FrameParams const &fr, unsigned aduSize, MP3SideInfo &sideInfo, unsigned &availableBytesForBackpointer)
unsigned TranscodeMP3ADU (unsigned char const *fromPtr, unsigned fromSize, unsigned toBitrate, unsigned char *toPtr, unsigned toMaxSize, unsigned &availableBytesForBackpointer)

Variables

static unsigned live_tabsel [2][3][16]
static long live_freqs [] = { 44100, 48000, 32000, 22050, 24000, 16000, 11025, 12000, 8000, 0 }
static struct bandInfoStruct const bandInfo [7]
unsigned int n_slen2 [512]
unsigned int i_slen2 [256]


Function Documentation

unsigned ComputeFrameSize ( unsigned  bitrate,
unsigned  samplingFreq,
Boolean  usePadding,
Boolean  isMPEG2,
unsigned char  layer 
)

Definition at line 219 of file MP3Internals.cpp.

static unsigned updateSideInfoSizes ( MP3SideInfo &  sideInfo,
Boolean  isMPEG2,
unsigned char const *  mainDataPtr,
unsigned  allowedNumBits,
unsigned &  part23Length0a,
unsigned &  part23Length0aTruncation,
unsigned &  part23Length0b,
unsigned &  part23Length0bTruncation,
unsigned &  part23Length1a,
unsigned &  part23Length1aTruncation,
unsigned &  part23Length1b,
unsigned &  part23Length1bTruncation 
) [static]

Definition at line 234 of file MP3Internals.cpp.

Referenced by TranscodeMP3ADU().

Boolean GetADUInfoFromMP3Frame ( unsigned char const *  framePtr,
unsigned  totFrameSize,
unsigned &  hdr,
unsigned &  frameSize,
MP3SideInfo &  sideInfo,
unsigned &  sideInfoSize,
unsigned &  backpointer,
unsigned &  aduSize 
)

Definition at line 303 of file MP3Internals.cpp.

Referenced by SegmentQueue::sqAfterGettingCommon(), and TranscodeMP3ADU().

static void getSideInfo1 ( MP3FrameParams &  fr,
MP3SideInfo &  si,
int  stereo,
int  ms_stereo,
long  sfreq,
int   
) [static]

Definition at line 346 of file MP3Internals.cpp.

static void getSideInfo2 ( MP3FrameParams &  fr,
MP3SideInfo &  si,
int  stereo,
int  ms_stereo,
long  sfreq,
int   
) [static]

Definition at line 429 of file MP3Internals.cpp.

static void putSideInfo1 ( BitVector &  bv,
MP3SideInfo const &  si,
Boolean  isStereo 
) [static]

Definition at line 536 of file MP3Internals.cpp.

Referenced by PutMP3SideInfoIntoFrame().

static void putSideInfo2 ( BitVector &  bv,
MP3SideInfo const &  si,
Boolean  isStereo 
) [static]

Definition at line 582 of file MP3Internals.cpp.

Referenced by PutMP3SideInfoIntoFrame().

static void PutMP3SideInfoIntoFrame ( MP3SideInfo const &  si,
MP3FrameParams const &  fr,
unsigned char *  framePtr 
) [static]

Definition at line 621 of file MP3Internals.cpp.

Referenced by TranscodeMP3ADU(), and ZeroOutMP3SideInfo().

Boolean ZeroOutMP3SideInfo ( unsigned char *  framePtr,
unsigned  totFrameSize,
unsigned  newBackpointer 
)

Definition at line 636 of file MP3Internals.cpp.

Referenced by SegmentQueue::insertDummyBeforeTail().

static unsigned MP3BitrateToBitrateIndex ( unsigned  bitrate,
Boolean  isMPEG2 
) [static]

Definition at line 664 of file MP3Internals.cpp.

Referenced by TranscodeMP3ADU().

static void outputHeader ( unsigned char *  toPtr,
unsigned  hdr 
) [static]

Definition at line 675 of file MP3Internals.cpp.

Referenced by TranscodeMP3ADU().

static void assignADUBackpointer ( MP3FrameParams const &  fr,
unsigned  aduSize,
MP3SideInfo &  sideInfo,
unsigned &  availableBytesForBackpointer 
) [static]

Definition at line 682 of file MP3Internals.cpp.

Referenced by TranscodeMP3ADU().

unsigned TranscodeMP3ADU ( unsigned char const *  fromPtr,
unsigned  fromSize,
unsigned  toBitrate,
unsigned char *  toPtr,
unsigned  toMaxSize,
unsigned &  availableBytesForBackpointer 
)

Definition at line 707 of file MP3Internals.cpp.


Variable Documentation

unsigned live_tabsel[2][3][16] [static]

Initial value:

 {
   { {32,32,64,96,128,160,192,224,256,288,320,352,384,416,448,448},
     {32,32,48,56, 64, 80, 96,112,128,160,192,224,256,320,384,384},
     {32,32,40,48, 56, 64, 80, 96,112,128,160,192,224,256,320,320} },

   { {32,32,48,56,64,80,96,112,128,144,160,176,192,224,256,256},
     {8,8,16,24,32,40,48,56,64,80,96,112,128,144,160,160},
     {8,8,16,24,32,40,48,56,64,80,96,112,128,144,160,160} }
}

Definition at line 30 of file MP3Internals.cpp.

Referenced by MP3BitrateToBitrateIndex().

long live_freqs[] = { 44100, 48000, 32000, 22050, 24000, 16000, 11025, 12000, 8000, 0 } [static]

Definition at line 42 of file MP3Internals.cpp.

struct bandInfoStruct const bandInfo[7] [static]

Definition at line 51 of file MP3Internals.cpp.

unsigned int n_slen2[512]

Definition at line 91 of file MP3Internals.cpp.

unsigned int i_slen2[256]

Definition at line 92 of file MP3Internals.cpp.


Generated on Sat Dec 18 05:15:54 2010 for MythTV by  doxygen 1.5.5