Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

mad.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  mad_bitptr
struct  mad_frame
struct  mad_decoder

Defines

#define SIZEOF_INT   4
#define SIZEOF_LONG   4
#define SIZEOF_LONG_LONG   8
#define MAD_VERSION_MAJOR   0
#define MAD_VERSION_MINOR   13
#define MAD_VERSION_PATCH   0
#define MAD_VERSION_EXTRA   " (beta)"
#define MAD_VERSION_STRINGIZE(str)   #str
#define MAD_VERSION_STRING(num)   MAD_VERSION_STRINGIZE(num)
#define MAD_VERSION
#define MAD_PUBLISHYEAR   "2000-2001"
#define MAD_AUTHOR   "Robert Leslie"
#define MAD_EMAIL   "rob@mars.org"
#define MAD_F_FRACBITS   28
#define MAD_F(x)   ((mad_fixed_t) (x##L))
#define MAD_F_MIN   ((mad_fixed_t) -0x80000000L)
#define MAD_F_MAX   ((mad_fixed_t) +0x7fffffffL)
#define MAD_F_ONE   MAD_F(0x10000000)
#define mad_f_tofixed(x)
#define mad_f_todouble(x)
#define mad_f_intpart(x)   ((x) >> MAD_F_FRACBITS)
#define mad_f_fracpart(x)   ((x) & ((1L << MAD_F_FRACBITS) - 1))
#define mad_f_fromint(x)   ((x) << MAD_F_FRACBITS)
#define mad_f_add(x, y)   ((x) + (y))
#define mad_f_sub(x, y)   ((x) - (y))
#define mad_f_mul(x, y)
#define MAD_F_ML0(hi, lo, x, y)   ((lo) = mad_f_mul((x), (y)))
#define MAD_F_MLA(hi, lo, x, y)   ((lo) += mad_f_mul((x), (y)))
#define MAD_F_MLZ(hi, lo)   ((void) (hi), (mad_fixed_t) (lo))
#define mad_f_scale64(hi, lo)
#define MAD_F_SCALEBITS   MAD_F_FRACBITS
#define mad_bit_finish(bitptr)
#define mad_bit_bitsleft(bitptr)   ((bitptr)->left)
#define MAD_TIMER_RESOLUTION   352800000UL
#define mad_timer_reset(timer)   (*(timer) = mad_timer_zero)
#define mad_timer_sign(timer)   mad_timer_compare((timer), mad_timer_zero)
#define MAD_BUFFER_GUARD   8
#define MAD_BUFFER_MDLEN   (511 + 2048 + MAD_BUFFER_GUARD)
#define MAD_RECOVERABLE(error)   ((error) & 0xff00)
#define mad_stream_options(stream, opts)   ((stream)->options = (opts))
#define MAD_NCHANNELS(header)   ((header)->mode ? 2 : 1)
#define MAD_NSBSAMPLES(header)
#define mad_header_finish(header)
#define mad_synth_finish(synth)
#define mad_decoder_options(decoder, opts)   ((decoder)->options = (opts))

Typedefs

typedef signed int mad_fixed_t
typedef signed int mad_fixed64hi_t
typedef unsigned int mad_fixed64lo_t

Enumerations

enum  mad_units {
  MAD_UNITS_HOURS = -2, MAD_UNITS_MINUTES = -1, MAD_UNITS_SECONDS = 0, MAD_UNITS_DECISECONDS = 10,
  MAD_UNITS_CENTISECONDS = 100, MAD_UNITS_MILLISECONDS = 1000, MAD_UNITS_8000_HZ = 8000, MAD_UNITS_11025_HZ = 11025,
  MAD_UNITS_12000_HZ = 12000, MAD_UNITS_16000_HZ = 16000, MAD_UNITS_22050_HZ = 22050, MAD_UNITS_24000_HZ = 24000,
  MAD_UNITS_32000_HZ = 32000, MAD_UNITS_44100_HZ = 44100, MAD_UNITS_48000_HZ = 48000, MAD_UNITS_24_FPS = 24,
  MAD_UNITS_25_FPS = 25, MAD_UNITS_30_FPS = 30, MAD_UNITS_48_FPS = 48, MAD_UNITS_50_FPS = 50,
  MAD_UNITS_60_FPS = 60, MAD_UNITS_75_FPS = 75, MAD_UNITS_23_976_FPS = -24, MAD_UNITS_24_975_FPS = -25,
  MAD_UNITS_29_97_FPS = -30, MAD_UNITS_47_952_FPS = -48, MAD_UNITS_49_95_FPS = -50, MAD_UNITS_59_94_FPS = -60
}
enum  mad_error {
  MAD_ERROR_BUFLEN = 0x0001, MAD_ERROR_BUFPTR = 0x0002, MAD_ERROR_NOMEM = 0x0031, MAD_ERROR_LOSTSYNC = 0x0101,
  MAD_ERROR_BADLAYER = 0x0102, MAD_ERROR_BADBITRATE = 0x0103, MAD_ERROR_BADSAMPLERATE = 0x0104, MAD_ERROR_BADEMPHASIS = 0x0105,
  MAD_ERROR_BADCRC = 0x0201, MAD_ERROR_BADBITALLOC = 0x0211, MAD_ERROR_BADSCALEFACTOR = 0x0221, MAD_ERROR_BADFRAMELEN = 0x0231,
  MAD_ERROR_BADBIGVALUES = 0x0232, MAD_ERROR_BADBLOCKTYPE = 0x0233, MAD_ERROR_BADSCFSI = 0x0234, MAD_ERROR_BADDATAPTR = 0x0235,
  MAD_ERROR_BADPART3LEN = 0x0236, MAD_ERROR_BADHUFFTABLE = 0x0237, MAD_ERROR_BADHUFFDATA = 0x0238, MAD_ERROR_BADSTEREO = 0x0239
}
enum  { MAD_OPTION_IGNORECRC = 0x0001, MAD_OPTION_HALFSAMPLERATE = 0x0002 }
enum  mad_layer { MAD_LAYER_I = 1, MAD_LAYER_II = 2, MAD_LAYER_III = 3 }
enum  mad_mode { MAD_MODE_SINGLE_CHANNEL = 0, MAD_MODE_DUAL_CHANNEL = 1, MAD_MODE_JOINT_STEREO = 2, MAD_MODE_STEREO = 3 }
enum  mad_emphasis { MAD_EMPHASIS_NONE = 0, MAD_EMPHASIS_50_15_US = 1, MAD_EMPHASIS_CCITT_J_17 = 3 }
enum  {
  MAD_FLAG_NPRIVATE_III = 0x0007, MAD_FLAG_INCOMPLETE = 0x0008, MAD_FLAG_PROTECTION = 0x0010, MAD_FLAG_COPYRIGHT = 0x0020,
  MAD_FLAG_ORIGINAL = 0x0040, MAD_FLAG_PADDING = 0x0080, MAD_FLAG_I_STEREO = 0x0100, MAD_FLAG_MS_STEREO = 0x0200,
  MAD_FLAG_FREEFORMAT = 0x0400, MAD_FLAG_LSF_EXT = 0x1000, MAD_FLAG_MC_EXT = 0x2000, MAD_FLAG_MPEG_2_5_EXT = 0x4000
}
enum  { MAD_PRIVATE_HEADER = 0x0100, MAD_PRIVATE_III = 0x001f }
enum  mad_decoder_mode { MAD_DECODER_MODE_SYNC = 0, MAD_DECODER_MODE_ASYNC }
enum  mad_flow { MAD_FLOW_CONTINUE = 0x0000, MAD_FLOW_STOP = 0x0010, MAD_FLOW_BREAK = 0x0011, MAD_FLOW_IGNORE = 0x0020 }

Functions

mad_fixed_t mad_f_abs (mad_fixed_t)
void mad_bit_init (struct mad_bitptr *, unsigned char const *)
unsigned int mad_bit_length (struct mad_bitptr const *, struct mad_bitptr const *)
unsigned char const * mad_bit_nextbyte (struct mad_bitptr const *)
void mad_bit_skip (struct mad_bitptr *, unsigned int)
unsigned long mad_bit_read (struct mad_bitptr *, unsigned int)
void mad_bit_write (struct mad_bitptr *, unsigned int, unsigned long)
unsigned short mad_bit_crc (struct mad_bitptr, unsigned int, unsigned short)
int mad_timer_compare (mad_timer_t, mad_timer_t)
void mad_timer_negate (mad_timer_t *)
mad_timer_t mad_timer_abs (mad_timer_t)
void mad_timer_set (mad_timer_t *, unsigned long, unsigned long, unsigned long)
void mad_timer_add (mad_timer_t *, mad_timer_t)
void mad_timer_multiply (mad_timer_t *, signed long)
signed long mad_timer_count (mad_timer_t, enum mad_units)
unsigned long mad_timer_fraction (mad_timer_t, unsigned long)
void mad_timer_string (mad_timer_t, char *, char const *, enum mad_units, enum mad_units, unsigned long)
void mad_stream_init (struct mad_stream *)
void mad_stream_finish (struct mad_stream *)
void mad_stream_buffer (struct mad_stream *, unsigned char const *, unsigned long)
void mad_stream_skip (struct mad_stream *, unsigned long)
int mad_stream_sync (struct mad_stream *)
void mad_header_init (struct mad_header *)
int mad_header_decode (struct mad_header *, struct mad_stream *)
void mad_frame_init (struct mad_frame *)
void mad_frame_finish (struct mad_frame *)
int mad_frame_decode (struct mad_frame *, struct mad_stream *)
void mad_frame_mute (struct mad_frame *)
void mad_synth_init (struct mad_synth *)
void mad_synth_mute (struct mad_synth *)
void mad_synth_frame (struct mad_synth *, struct mad_frame const *)
void mad_decoder_init (struct mad_decoder *, void *, enum mad_flow(*)(void *, struct mad_stream *), enum mad_flow(*)(void *, struct mad_header const *), enum mad_flow(*)(void *, struct mad_frame *), enum mad_flow(*)(void *, struct mad_header const *, struct mad_pcm *), enum mad_flow(*)(void *, struct mad_stream *, struct mad_frame *), enum mad_flow(*)(void *, void *, unsigned int *))
int mad_decoder_finish (struct mad_decoder *)
int mad_decoder_run (struct mad_decoder *, enum mad_decoder_mode)
int mad_decoder_message (struct mad_decoder *, void *, unsigned int *)

Variables

char const mad_version []
char const mad_copyright []
char const mad_author []
char const mad_build []
mad_timer_t const mad_timer_zero


Define Documentation

#define MAD_AUTHOR   "Robert Leslie"
 

Definition at line 46 of file mad.h.

#define mad_bit_bitsleft bitptr   )     ((bitptr)->left)
 

Definition at line 469 of file mad.h.

#define mad_bit_finish bitptr   ) 
 

Definition at line 464 of file mad.h.

#define MAD_BUFFER_GUARD   8
 

Definition at line 567 of file mad.h.

Referenced by LibMadPlugin::read().

#define MAD_BUFFER_MDLEN   (511 + 2048 + MAD_BUFFER_GUARD)
 

Definition at line 568 of file mad.h.

#define mad_decoder_options decoder,
opts   )     ((decoder)->options = (opts))
 

Definition at line 824 of file mad.h.

#define MAD_EMAIL   "rob@mars.org"
 

Definition at line 47 of file mad.h.

#define MAD_F  )     ((mad_fixed_t) (x##L))
 

Definition at line 99 of file mad.h.

#define mad_f_add x,
y   )     ((x) + (y))
 

Definition at line 130 of file mad.h.

#define MAD_F_FRACBITS   28
 

Definition at line 96 of file mad.h.

#define mad_f_fracpart  )     ((x) & ((1L << MAD_F_FRACBITS) - 1))
 

Definition at line 125 of file mad.h.

#define mad_f_fromint  )     ((x) << MAD_F_FRACBITS)
 

Definition at line 128 of file mad.h.

#define mad_f_intpart  )     ((x) >> MAD_F_FRACBITS)
 

Definition at line 124 of file mad.h.

#define MAD_F_MAX   ((mad_fixed_t) +0x7fffffffL)
 

Definition at line 115 of file mad.h.

#define MAD_F_MIN   ((mad_fixed_t) -0x80000000L)
 

Definition at line 114 of file mad.h.

#define MAD_F_ML0 hi,
lo,
x,
y   )     ((lo) = mad_f_mul((x), (y)))
 

Definition at line 417 of file mad.h.

#define MAD_F_MLA hi,
lo,
x,
y   )     ((lo) += mad_f_mul((x), (y)))
 

Definition at line 418 of file mad.h.

#define MAD_F_MLZ hi,
lo   )     ((void) (hi), (mad_fixed_t) (lo))
 

Definition at line 419 of file mad.h.

#define mad_f_mul x,
y   ) 
 

Value:

({ mad_fixed64hi_t __hi;  \
       mad_fixed64lo_t __lo;  \
       MAD_F_MLX(__hi, __lo, (x), (y));  \
       mad_f_scale64(__hi, __lo);  \
    })

Definition at line 408 of file mad.h.

#define MAD_F_ONE   MAD_F(0x10000000)
 

Definition at line 117 of file mad.h.

#define mad_f_scale64 hi,
lo   ) 
 

Value:

((mad_fixed_t)  \
     (((hi) << (32 - MAD_F_SCALEBITS)) |  \
      ((lo) >> MAD_F_SCALEBITS)))

Definition at line 437 of file mad.h.

#define MAD_F_SCALEBITS   MAD_F_FRACBITS
 

Definition at line 442 of file mad.h.

#define mad_f_sub x,
y   )     ((x) - (y))
 

Definition at line 131 of file mad.h.

#define mad_f_todouble  ) 
 

Value:

((double)  \
                                 ((x) / (double) (1L << MAD_F_FRACBITS)))

Definition at line 121 of file mad.h.

#define mad_f_tofixed  ) 
 

Value:

((mad_fixed_t)  \
                                 ((x) * (double) (1L << MAD_F_FRACBITS) + 0.5))

Definition at line 119 of file mad.h.

#define mad_header_finish header   ) 
 

Definition at line 724 of file mad.h.

#define MAD_NCHANNELS header   )     ((header)->mode ? 2 : 1)
 

Definition at line 693 of file mad.h.

#define MAD_NSBSAMPLES header   ) 
 

Value:

((header)->layer == MAD_LAYER_I ? 12 :  \
   (((header)->layer == MAD_LAYER_III &&  \
     ((header)->flags & MAD_FLAG_LSF_EXT)) ? 18 : 36))

Definition at line 694 of file mad.h.

#define MAD_PUBLISHYEAR   "2000-2001"
 

Definition at line 45 of file mad.h.

#define MAD_RECOVERABLE error   )     ((error) & 0xff00)
 

Definition at line 596 of file mad.h.

Referenced by LibMadPlugin::decode().

#define mad_stream_options stream,
opts   )     ((stream)->options = (opts))
 

Definition at line 634 of file mad.h.

#define mad_synth_finish synth   ) 
 

Definition at line 758 of file mad.h.

Referenced by LibMadPlugin::close().

#define mad_timer_reset timer   )     (*(timer) = mad_timer_zero)
 

Definition at line 542 of file mad.h.

#define MAD_TIMER_RESOLUTION   352800000UL
 

Definition at line 492 of file mad.h.

#define mad_timer_sign timer   )     mad_timer_compare((timer), mad_timer_zero)
 

Definition at line 546 of file mad.h.

#define MAD_VERSION
 

Value:

Definition at line 40 of file mad.h.

#define MAD_VERSION_EXTRA   " (beta)"
 

Definition at line 35 of file mad.h.

#define MAD_VERSION_MAJOR   0
 

Definition at line 32 of file mad.h.

#define MAD_VERSION_MINOR   13
 

Definition at line 33 of file mad.h.

#define MAD_VERSION_PATCH   0
 

Definition at line 34 of file mad.h.

#define MAD_VERSION_STRING num   )     MAD_VERSION_STRINGIZE(num)
 

Definition at line 38 of file mad.h.

#define MAD_VERSION_STRINGIZE str   )     #str
 

Definition at line 37 of file mad.h.

#define SIZEOF_INT   4
 

Definition at line 23 of file mad.h.

#define SIZEOF_LONG   4
 

Definition at line 24 of file mad.h.

#define SIZEOF_LONG_LONG   8
 

Definition at line 25 of file mad.h.


Typedef Documentation

typedef signed int mad_fixed64hi_t
 

Definition at line 64 of file mad.h.

typedef unsigned int mad_fixed64lo_t
 

Definition at line 65 of file mad.h.

typedef signed int mad_fixed_t
 

Definition at line 62 of file mad.h.


Enumeration Type Documentation

anonymous enum
 

Enumeration values:
MAD_OPTION_IGNORECRC 
MAD_OPTION_HALFSAMPLERATE 

Definition at line 621 of file mad.h.

anonymous enum
 

Enumeration values:
MAD_FLAG_NPRIVATE_III 
MAD_FLAG_INCOMPLETE 
MAD_FLAG_PROTECTION 
MAD_FLAG_COPYRIGHT 
MAD_FLAG_ORIGINAL 
MAD_FLAG_PADDING 
MAD_FLAG_I_STEREO 
MAD_FLAG_MS_STEREO 
MAD_FLAG_FREEFORMAT 
MAD_FLAG_LSF_EXT 
MAD_FLAG_MC_EXT 
MAD_FLAG_MPEG_2_5_EXT 

Definition at line 699 of file mad.h.

anonymous enum
 

Enumeration values:
MAD_PRIVATE_HEADER 
MAD_PRIVATE_III 

Definition at line 717 of file mad.h.

enum mad_decoder_mode
 

Enumeration values:
MAD_DECODER_MODE_SYNC 
MAD_DECODER_MODE_ASYNC 

Definition at line 771 of file mad.h.

enum mad_emphasis
 

Enumeration values:
MAD_EMPHASIS_NONE 
MAD_EMPHASIS_50_15_US 
MAD_EMPHASIS_CCITT_J_17 

Definition at line 662 of file mad.h.

enum mad_error
 

Enumeration values:
MAD_ERROR_BUFLEN 
MAD_ERROR_BUFPTR 
MAD_ERROR_NOMEM 
MAD_ERROR_LOSTSYNC 
MAD_ERROR_BADLAYER 
MAD_ERROR_BADBITRATE 
MAD_ERROR_BADSAMPLERATE 
MAD_ERROR_BADEMPHASIS 
MAD_ERROR_BADCRC 
MAD_ERROR_BADBITALLOC 
MAD_ERROR_BADSCALEFACTOR 
MAD_ERROR_BADFRAMELEN 
MAD_ERROR_BADBIGVALUES 
MAD_ERROR_BADBLOCKTYPE 
MAD_ERROR_BADSCFSI 
MAD_ERROR_BADDATAPTR 
MAD_ERROR_BADPART3LEN 
MAD_ERROR_BADHUFFTABLE 
MAD_ERROR_BADHUFFDATA 
MAD_ERROR_BADSTEREO 

Definition at line 570 of file mad.h.

enum mad_flow
 

Enumeration values:
MAD_FLOW_CONTINUE 
MAD_FLOW_STOP 
MAD_FLOW_BREAK 
MAD_FLOW_IGNORE 

Definition at line 776 of file mad.h.

enum mad_layer
 

Enumeration values:
MAD_LAYER_I 
MAD_LAYER_II 
MAD_LAYER_III 

Definition at line 649 of file mad.h.

enum mad_mode
 

Enumeration values:
MAD_MODE_SINGLE_CHANNEL 
MAD_MODE_DUAL_CHANNEL 
MAD_MODE_JOINT_STEREO 
MAD_MODE_STEREO 

Definition at line 655 of file mad.h.

enum mad_units
 

Enumeration values:
MAD_UNITS_HOURS 
MAD_UNITS_MINUTES 
MAD_UNITS_SECONDS 
MAD_UNITS_DECISECONDS 
MAD_UNITS_CENTISECONDS 
MAD_UNITS_MILLISECONDS 
MAD_UNITS_8000_HZ 
MAD_UNITS_11025_HZ 
MAD_UNITS_12000_HZ 
MAD_UNITS_16000_HZ 
MAD_UNITS_22050_HZ 
MAD_UNITS_24000_HZ 
MAD_UNITS_32000_HZ 
MAD_UNITS_44100_HZ 
MAD_UNITS_48000_HZ 
MAD_UNITS_24_FPS 
MAD_UNITS_25_FPS 
MAD_UNITS_30_FPS 
MAD_UNITS_48_FPS 
MAD_UNITS_50_FPS 
MAD_UNITS_60_FPS 
MAD_UNITS_75_FPS 
MAD_UNITS_23_976_FPS 
MAD_UNITS_24_975_FPS 
MAD_UNITS_29_97_FPS 
MAD_UNITS_47_952_FPS 
MAD_UNITS_49_95_FPS 
MAD_UNITS_59_94_FPS 

Definition at line 494 of file mad.h.


Function Documentation

unsigned short mad_bit_crc struct  mad_bitptr,
unsigned  int,
unsigned  short
 

void mad_bit_init struct mad_bitptr ,
unsigned char const * 
 

unsigned int mad_bit_length struct mad_bitptr const *  ,
struct mad_bitptr const * 
 

unsigned char const* mad_bit_nextbyte struct mad_bitptr const *   ) 
 

unsigned long mad_bit_read struct mad_bitptr ,
unsigned  int
 

void mad_bit_skip struct mad_bitptr ,
unsigned  int
 

void mad_bit_write struct mad_bitptr ,
unsigned  int,
unsigned  long
 

int mad_decoder_finish struct mad_decoder  ) 
 

void mad_decoder_init struct mad_decoder ,
void *  ,
enum   mad_flow(*)(void *, struct mad_stream *),
enum   mad_flow(*)(void *, struct mad_header const *),
enum   mad_flow(*)(void *, struct mad_frame *),
enum   mad_flow(*)(void *, struct mad_header const *, struct mad_pcm *),
enum   mad_flow(*)(void *, struct mad_stream *, struct mad_frame *),
enum   mad_flow(*)(void *, void *, unsigned int *)
 

int mad_decoder_message struct mad_decoder ,
void *  ,
unsigned int * 
 

int mad_decoder_run struct mad_decoder ,
enum  mad_decoder_mode
 

mad_fixed_t mad_f_abs mad_fixed_t   ) 
 

int mad_frame_decode struct mad_frame ,
struct mad_stream
 

void mad_frame_finish struct mad_frame  ) 
 

void mad_frame_init struct mad_frame  ) 
 

void mad_frame_mute struct mad_frame  ) 
 

int mad_header_decode struct mad_header ,
struct mad_stream
 

void mad_header_init struct mad_header  ) 
 

void mad_stream_buffer struct mad_stream ,
unsigned char const *  ,
unsigned  long
 

Referenced by LibMadPlugin::read().

void mad_stream_finish struct mad_stream  ) 
 

Referenced by LibMadPlugin::close().

void mad_stream_init struct mad_stream  ) 
 

Referenced by LibMadPlugin::open().

void mad_stream_skip struct mad_stream ,
unsigned  long
 

int mad_stream_sync struct mad_stream  ) 
 

void mad_synth_frame struct mad_synth ,
struct mad_frame const * 
 

Referenced by LibMadPlugin::decode().

void mad_synth_init struct mad_synth  ) 
 

Referenced by LibMadPlugin::open().

void mad_synth_mute struct mad_synth  ) 
 

mad_timer_t mad_timer_abs mad_timer_t   ) 
 

void mad_timer_add mad_timer_t ,
mad_timer_t 
 

int mad_timer_compare mad_timer_t  ,
mad_timer_t 
 

signed long mad_timer_count mad_timer_t  ,
enum  mad_units
 

unsigned long mad_timer_fraction mad_timer_t  ,
unsigned  long
 

void mad_timer_multiply mad_timer_t ,
signed  long
 

void mad_timer_negate mad_timer_t  ) 
 

void mad_timer_set mad_timer_t ,
unsigned  long,
unsigned  long,
unsigned  long
 

void mad_timer_string mad_timer_t  ,
char *  ,
char const *  ,
enum  mad_units,
enum  mad_units,
unsigned  long
 


Variable Documentation

char const mad_author[]
 

char const mad_build[]
 

char const mad_copyright[]
 

mad_timer_t const mad_timer_zero
 

char const mad_version[]
 


Generated on Sat Nov 5 16:24:28 2005 for OPIE by  doxygen 1.4.2