flac.c File Reference


Detailed Description

FLAC (Free Lossless Audio Codec) decoder.

Author:
Alex Beregszaszi
For more information on the FLAC format, visit: http://flac.sourceforge.net/

This decoder can be used in 1 of 2 ways: Either raw FLAC data can be fed through, starting from the initial 'fLaC' signature; or by passing the 34-byte streaminfo structure through avctx->extradata[_size] followed by data starting with the 0xFFF8 marker.

Definition in file flac.c.

Go to the source code of this file.

Classes

struct  FLACContext

Enumerations

enum  decorrelation_type { INDEPENDENT, LEFT_SIDE, RIGHT_SIDE, MID_SIDE }

Functions

static int64_t get_utf8 (GetBitContext *gb)
static void metadata_streaminfo (FLACContext *s)
static void allocate_buffers (FLACContext *s)
static int metadata_parse (FLACContext *s)
 Parse a list of metadata blocks.
static int flac_decode_init (AVCodecContext *avctx)
static void dump_headers (FLACContext *s)
static int decode_residuals (FLACContext *s, int channel, int pred_order)
static int decode_subframe_fixed (FLACContext *s, int channel, int pred_order)
static int decode_subframe_lpc (FLACContext *s, int channel, int pred_order)
static int decode_subframe (FLACContext *s, int channel)
static int decode_frame (FLACContext *s, int alloc_data_size)
static int flac_decode_frame (AVCodecContext *avctx, void *data, int *data_size, uint8_t *buf, int buf_size)
static int flac_decode_close (AVCodecContext *avctx)
static void flac_flush (AVCodecContext *avctx)

Variables

static int sample_rate_table []
static int sample_size_table []
static int blocksize_table []
AVCodec flac_decoder


Enumeration Type Documentation

Enumerator:
INDEPENDENT 
LEFT_SIDE 
RIGHT_SIDE 
MID_SIDE 

Definition at line 51 of file flac.c.


Function Documentation

static int64_t get_utf8 ( GetBitContext gb  )  [static]

Definition at line 91 of file flac.c.

Referenced by decode_frame().

static void metadata_streaminfo ( FLACContext s  )  [static]

Definition at line 146 of file flac.c.

Referenced by flac_decode_init(), and metadata_parse().

static void allocate_buffers ( FLACContext s  )  [static]

Definition at line 129 of file flac.c.

static int metadata_parse ( FLACContext s  )  [static]

Parse a list of metadata blocks.

This list of blocks must begin with the fLaC marker.

Parameters:
s the flac decoding context containing the gb bit reader used to parse metadata
Returns:
1 if some metadata was read, 0 if no fLaC marker was found

Definition at line 177 of file flac.c.

Referenced by flac_decode_frame(), and flac_decode_init().

static int flac_decode_init ( AVCodecContext avctx  )  [static]

Definition at line 101 of file flac.c.

static void dump_headers ( FLACContext s  )  [static]

Definition at line 120 of file flac.c.

Referenced by metadata_streaminfo().

static int decode_residuals ( FLACContext s,
int  channel,
int  pred_order 
) [static]

Definition at line 214 of file flac.c.

Referenced by decode_subframe_fixed(), and decode_subframe_lpc().

static int decode_subframe_fixed ( FLACContext s,
int  channel,
int  pred_order 
) [static]

Definition at line 260 of file flac.c.

Referenced by decode_subframe().

static int decode_subframe_lpc ( FLACContext s,
int  channel,
int  pred_order 
) [static]

Definition at line 313 of file flac.c.

Referenced by decode_subframe(), and shorten_decode_frame().

static int decode_subframe ( FLACContext s,
int  channel 
) [inline, static]

Definition at line 394 of file flac.c.

Referenced by decode_frame().

static int decode_frame ( FLACContext s,
int  alloc_data_size 
) [static]

Definition at line 480 of file flac.c.

static int flac_decode_frame ( AVCodecContext avctx,
void *  data,
int *  data_size,
uint8_t *  buf,
int  buf_size 
) [static]

Definition at line 590 of file flac.c.

static int flac_decode_close ( AVCodecContext avctx  )  [static]

Definition at line 739 of file flac.c.

static void flac_flush ( AVCodecContext avctx  )  [static]

Definition at line 753 of file flac.c.


Variable Documentation

int sample_rate_table[] [static]

Initial value:

{ 0, 0, 0, 0,
  8000, 16000, 22050, 24000, 32000, 44100, 48000, 96000,
  0, 0, 0, 0 }

Definition at line 78 of file flac.c.

Referenced by decode_frame().

int sample_size_table[] [static]

Initial value:

{ 0, 8, 12, 0, 16, 20, 24, 0 }

Definition at line 83 of file flac.c.

Referenced by decode_frame().

int blocksize_table[] [static]

Initial value:

 {
     0,    192, 576<<0, 576<<1, 576<<2, 576<<3,      0,      0,
256<<0, 256<<1, 256<<2, 256<<3, 256<<4, 256<<5, 256<<6, 256<<7
}

Definition at line 86 of file flac.c.

Referenced by decode_frame().

Initial value:

Definition at line 760 of file flac.c.


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