MP3InternalsHuffman.cpp File Reference

Go to the source code of this file.

Classes

struct  huffcodetab

Functions

void updateSideInfoForHuffman (MP3SideInfo &sideInfo, Boolean isMPEG2, unsigned char const *mainDataPtr, unsigned p23L0, unsigned p23L1, unsigned &part23Length0a, unsigned &part23Length0aTruncation, unsigned &part23Length0b, unsigned &part23Length0bTruncation, unsigned &part23Length1a, unsigned &part23Length1aTruncation, unsigned &part23Length1b, unsigned &part23Length1bTruncation)
static void rsf_getline (char *line, unsigned max, unsigned char **fi)
static void rsfscanf (unsigned char **fi, unsigned int *v)
static int read_decoder_table (unsigned char *fi)
static void initialize_huffman ()
static unsigned rsf_get_scale_factors_1 (MP3SideInfo::gr_info_s_t *gr_info)
static unsigned rsf_get_scale_factors_2 (MP3SideInfo::gr_info_s_t *gr_info)
static unsigned getScaleFactorsLength (MP3SideInfo::gr_info_s_t *gr, Boolean isMPEG2)
static int rsf_huffman_decoder (BitVector &bv, struct huffcodetab const *h, int *x, int *y, int *v, int *w)
void MP3HuffmanDecode (MP3SideInfo::gr_info_s_t *gr, int isMPEG2, unsigned char const *fromBasePtr, unsigned fromBitOffset, unsigned fromLength, unsigned &scaleFactorsLength, MP3HuffmanEncodingInfo &hei)
int getNextSample (unsigned char const *&fromPtr)
static void rsf_huffman_encoder (BitVector &bv, struct huffcodetab *h, int x, int y, int v, int w)
unsigned MP3HuffmanEncode (MP3SideInfo::gr_info_s_t const *gr, unsigned char const *fromPtr, unsigned char *toPtr, unsigned toBitOffset, unsigned numHuffBits)
static Boolean lookupHuffmanTableEntry (struct huffcodetab const *h, HUFFBITS bits, unsigned bitsLength, unsigned char &xy)
static void buildHuffmanEncodingTable (struct huffcodetab *h)
static void lookupXYandPutBits (BitVector &bv, struct huffcodetab const *h, unsigned char xy)
static void putLinbits (BitVector &bv, struct huffcodetab const *h, HUFFBITS bits)
FILE * OpenTableFile (name) char *name

Variables

static unsigned debugCount = 0
static struct huffcodetab rsf_ht [HTN]
static unsigned char const slen [2][16]
static unsigned char const stab [3][6][4]
unsigned n_slen2 []
unsigned i_slen2 []
HUFFBITS dmask = 1 << (SIZEOF_HUFFBITS*8-1)
unsigned int hs = SIZEOF_HUFFBITS*8

Function Documentation

void updateSideInfoForHuffman ( MP3SideInfo &  sideInfo,
Boolean  isMPEG2,
unsigned char const *  mainDataPtr,
unsigned  p23L0,
unsigned  p23L1,
unsigned &  part23Length0a,
unsigned &  part23Length0aTruncation,
unsigned &  part23Length0b,
unsigned &  part23Length0bTruncation,
unsigned &  part23Length1a,
unsigned &  part23Length1aTruncation,
unsigned &  part23Length1b,
unsigned &  part23Length1bTruncation 
)

Definition at line 45 of file MP3InternalsHuffman.cpp.

Referenced by updateSideInfoSizes().

static void rsf_getline ( char *  line,
unsigned  max,
unsigned char **  fi 
) [static]

Definition at line 312 of file MP3InternalsHuffman.cpp.

Referenced by read_decoder_table().

static void rsfscanf ( unsigned char **  fi,
unsigned int *  v 
) [static]

Definition at line 324 of file MP3InternalsHuffman.cpp.

Referenced by read_decoder_table().

static int read_decoder_table ( unsigned char *  fi  )  [static]

Definition at line 360 of file MP3InternalsHuffman.cpp.

Referenced by initialize_huffman().

static void initialize_huffman (  )  [static]

Definition at line 440 of file MP3InternalsHuffman.cpp.

Referenced by MP3HuffmanDecode(), and MP3HuffmanEncode().

static unsigned rsf_get_scale_factors_1 ( MP3SideInfo::gr_info_s_t *  gr_info  )  [static]

Definition at line 468 of file MP3InternalsHuffman.cpp.

Referenced by getScaleFactorsLength().

static unsigned rsf_get_scale_factors_2 ( MP3SideInfo::gr_info_s_t *  gr_info  )  [static]

Definition at line 522 of file MP3InternalsHuffman.cpp.

Referenced by getScaleFactorsLength().

static unsigned getScaleFactorsLength ( MP3SideInfo::gr_info_s_t *  gr,
Boolean  isMPEG2 
) [static]

Definition at line 556 of file MP3InternalsHuffman.cpp.

Referenced by MP3HuffmanDecode().

static int rsf_huffman_decoder ( BitVector &  bv,
struct huffcodetab const *  h,
int *  x,
int *  y,
int *  v,
int *  w 
) [static]

Definition at line 637 of file MP3InternalsHuffman.cpp.

Referenced by MP3HuffmanDecode().

void MP3HuffmanDecode ( MP3SideInfo::gr_info_s_t *  gr,
int  isMPEG2,
unsigned char const *  fromBasePtr,
unsigned  fromBitOffset,
unsigned  fromLength,
unsigned &  scaleFactorsLength,
MP3HuffmanEncodingInfo &  hei 
)

Definition at line 566 of file MP3InternalsHuffman.cpp.

Referenced by updateSideInfoForHuffman().

int getNextSample ( unsigned char const *&  fromPtr  )  [inline]

Definition at line 720 of file MP3InternalsHuffman.cpp.

Referenced by MP3HuffmanEncode().

static void rsf_huffman_encoder ( BitVector &  bv,
struct huffcodetab h,
int  x,
int  y,
int  v,
int  w 
) [static]

Definition at line 870 of file MP3InternalsHuffman.cpp.

Referenced by MP3HuffmanEncode().

unsigned MP3HuffmanEncode ( MP3SideInfo::gr_info_s_t const *  gr,
unsigned char const *  fromPtr,
unsigned char *  toPtr,
unsigned  toBitOffset,
unsigned  numHuffBits 
)

Definition at line 740 of file MP3InternalsHuffman.cpp.

static Boolean lookupHuffmanTableEntry ( struct huffcodetab const *  h,
HUFFBITS  bits,
unsigned  bitsLength,
unsigned char &  xy 
) [static]

Definition at line 789 of file MP3InternalsHuffman.cpp.

Referenced by buildHuffmanEncodingTable().

static void buildHuffmanEncodingTable ( struct huffcodetab h  )  [static]

Definition at line 824 of file MP3InternalsHuffman.cpp.

Referenced by rsf_huffman_encoder().

static void lookupXYandPutBits ( BitVector &  bv,
struct huffcodetab const *  h,
unsigned char  xy 
) [static]

Definition at line 853 of file MP3InternalsHuffman.cpp.

Referenced by rsf_huffman_encoder().

static void putLinbits ( BitVector &  bv,
struct huffcodetab const *  h,
HUFFBITS  bits 
) [static]

Definition at line 865 of file MP3InternalsHuffman.cpp.

Referenced by rsf_huffman_encoder().

FILE* OpenTableFile ( name   ) 

Variable Documentation

unsigned debugCount = 0 [static]

Definition at line 41 of file MP3InternalsHuffman.cpp.

struct huffcodetab rsf_ht[HTN] [static]

Definition at line 355 of file MP3InternalsHuffman.cpp.

Referenced by MP3HuffmanDecode(), MP3HuffmanEncode(), and read_decoder_table().

unsigned char const slen[2][16] [static]
Initial value:
 {
  {0, 0, 0, 0, 3, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4},
  {0, 1, 2, 3, 0, 1, 2, 3, 1, 2, 3, 1, 2, 3, 2, 3}
}

Definition at line 454 of file MP3InternalsHuffman.cpp.

Referenced by MSocketDevice::writeBlock().

unsigned char const stab[3][6][4] [static]
Initial value:
 {
  { { 6, 5, 5,5 } , { 6, 5, 7,3 } , { 11,10,0,0} ,
    { 7, 7, 7,0 } , { 6, 6, 6,3 } , {  8, 8,5,0} } ,
  { { 9, 9, 9,9 } , { 9, 9,12,6 } , { 18,18,0,0} ,
    {12,12,12,0 } , {12, 9, 9,6 } , { 15,12,9,0} } ,
  { { 6, 9, 9,9 } , { 6, 9,12,6 } , { 15,18,0,0} ,
    { 6,15,12,0 } , { 6,12, 9,6 } , {  6,18,9,0} }
}

Definition at line 459 of file MP3InternalsHuffman.cpp.

unsigned n_slen2[]

Definition at line 91 of file MP3Internals.cpp.

unsigned i_slen2[]

Definition at line 92 of file MP3Internals.cpp.

HUFFBITS dmask = 1 << (SIZEOF_HUFFBITS*8-1)

Definition at line 633 of file MP3InternalsHuffman.cpp.

unsigned int hs = SIZEOF_HUFFBITS*8
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends
Generated on Tue May 22 06:41:45 2012 for MythTV by  doxygen 1.6.3