frame.c File Reference

Implementation of the mad_frame and mad_header methods. More...

#include "global.h"
#include <stdlib.h>
#include "bit.h"
#include "stream.h"
#include "frame.h"
#include "timer.h"
#include "layer12.h"
#include "layer3.h"

Include dependency graph for frame.c:

Go to the source code of this file.

Functions

void mad_header_init (struct mad_header *header)
 Initializes a newly created mad_header structure.
void mad_frame_init (struct mad_frame *frame)
 Initializes a frame struct.
void mad_frame_finish (struct mad_frame *frame)
 Deallocates any dynamic memory associated with frame.
static int decode_header (struct mad_header *header, struct mad_stream *stream)
 Reads header data and following CRC word.
static int free_bitrate (struct mad_stream *stream, struct mad_header const *header)
 Attempts to discover the bitstream's free bitrate.
int mad_header_decode (struct mad_header *header, struct mad_stream *stream)
 Reads the next frame header from the stream.
int mad_frame_decode (struct mad_frame *frame, struct mad_stream *stream)
 Decodes a single frame from a bitstream.
void mad_frame_mute (struct mad_frame *frame)
 Zeroes all subband values so the frame becomes silent.

Variables

static unsigned long const bitrate_table [5][15]
static unsigned int const samplerate_table [3] = { 44100, 48000, 32000 }
static int(*const decoder_table [3])(struct mad_stream *, struct mad_frame *)


Detailed Description

Implementation of the mad_frame and mad_header methods.

Definition in file frame.c.


Function Documentation

static int decode_header ( struct mad_header header,
struct mad_stream stream 
) [static]

static int free_bitrate ( struct mad_stream stream,
struct mad_header const *  header 
) [static]

int mad_frame_decode ( struct mad_frame frame,
struct mad_stream stream 
)

void mad_frame_finish ( struct mad_frame frame  ) 

Deallocates any dynamic memory associated with frame.

Definition at line 105 of file frame.c.

References mad_frame::header, mad_header_finish, and mad_frame::overlap.

Referenced by run_sync().

void mad_frame_init ( struct mad_frame frame  ) 

Initializes a frame struct.

Definition at line 92 of file frame.c.

References mad_frame::header, mad_frame_mute(), mad_header_init(), mad_frame::options, and mad_frame::overlap.

Referenced by run_sync().

Here is the call graph for this function:

void mad_frame_mute ( struct mad_frame frame  ) 

Zeroes all subband values so the frame becomes silent.

Definition at line 479 of file frame.c.

References mad_frame::overlap, s, and mad_frame::sbsample.

Referenced by error_default(), and mad_frame_init().

int mad_header_decode ( struct mad_header header,
struct mad_stream stream 
)

void mad_header_init ( struct mad_header header  ) 


Variable Documentation

unsigned long const bitrate_table[5][15] [static]

Initial value:

 {
  
  { 0,  32000,  64000,  96000, 128000, 160000, 192000, 224000,  
       256000, 288000, 320000, 352000, 384000, 416000, 448000 },
  { 0,  32000,  48000,  56000,  64000,  80000,  96000, 112000,  
       128000, 160000, 192000, 224000, 256000, 320000, 384000 },
  { 0,  32000,  40000,  48000,  56000,  64000,  80000,  96000,  
       112000, 128000, 160000, 192000, 224000, 256000, 320000 },

  
  { 0,  32000,  48000,  56000,  64000,  80000,  96000, 112000,  
       128000, 144000, 160000, 176000, 192000, 224000, 256000 },
  { 0,   8000,  16000,  24000,  32000,  40000,  48000,  56000,  
        64000,  80000,  96000, 112000, 128000, 144000, 160000 } 
}

Definition at line 41 of file frame.c.

Referenced by decode_header().

int(*const decoder_table[3])(struct mad_stream *, struct mad_frame *) [static]

Initial value:

Referenced by mad_frame_decode().

unsigned int const samplerate_table[3] = { 44100, 48000, 32000 } [static]

Definition at line 58 of file frame.c.

Referenced by decode_header().


Generated on Tue Jun 10 12:14:17 2008 for libmad by  doxygen 1.5.5