hvirtual/quicktime/ffmpeg/libavcodec/flac.c File Reference

#include <limits.h>
#include "avcodec.h"
#include "bitstream.h"
#include "golomb.h"
#include <assert.h>

Include dependency graph for flac.c:

Go to the source code of this file.

Data Structures

struct  FLACContext

Defines

#define MAX_CHANNELS   8
#define MAX_BLOCKSIZE   65535
#define FLAC_STREAMINFO_SIZE   34
#define METADATA_TYPE_STREAMINFO   0

Enumerations

enum  decorrelation_type { INDEPENDENT, LEFT_SIDE, RIGHT_SIDE, MID_SIDE }

Functions

static int64_t get_utf8 (GetBitContext *gb)
static int get_crc8 (const uint8_t *buf, int count)
static void metadata_streaminfo (FLACContext *s)
static void dump_headers (FLACContext *s)
static int flac_decode_init (AVCodecContext *avctx)
static void allocate_buffers (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)
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 []
static const uint8_t table_crc8 [256]
AVCodec flac_decoder


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.


Define Documentation

#define FLAC_STREAMINFO_SIZE   34

Definition at line 45 of file flac.c.

Referenced by flac_decode_init().

#define MAX_BLOCKSIZE   65535

Definition at line 44 of file flac.c.

#define MAX_CHANNELS   8

Definition at line 43 of file flac.c.

#define METADATA_TYPE_STREAMINFO   0

Definition at line 72 of file flac.c.

Referenced by flac_decode_frame().


Enumeration Type Documentation

Enumerator:
INDEPENDENT 
LEFT_SIDE 
RIGHT_SIDE 
MID_SIDE 

Definition at line 47 of file flac.c.


Function Documentation

static void allocate_buffers ( FLACContext s  )  [static]

static int decode_frame ( FLACContext s  )  [static]

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

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

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

Definition at line 290 of file flac.c.

References av_log(), AV_LOG_ERROR, FLACContext::avctx, FLACContext::blocksize, FLACContext::curr_bps, decode_residuals(), FLACContext::decoded, FLACContext::gb, and get_sbits().

Referenced by decode_subframe().

Here is the call graph for this function:

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

static void dump_headers ( FLACContext s  )  [static]

static int flac_decode_close ( AVCodecContext avctx  )  [static]

Definition at line 793 of file flac.c.

References av_freep(), FLACContext::bitstream, FLACContext::channels, FLACContext::decoded, AVCodecContext::priv_data, and s.

Here is the call graph for this function:

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

static int flac_decode_init ( AVCodecContext avctx  )  [static]

static void flac_flush ( AVCodecContext avctx  )  [static]

static int get_crc8 ( const uint8_t *  buf,
int  count 
) [static]

Definition at line 169 of file flac.c.

References table_crc8.

Referenced by decode_frame().

static int64_t get_utf8 ( GetBitContext gb  )  [static]

Definition at line 122 of file flac.c.

References bytes, get_bits(), and get_bits1().

Referenced by decode_frame().

Here is the call graph for this function:

static void metadata_streaminfo ( FLACContext s  )  [static]


Variable Documentation

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 82 of file flac.c.

Referenced by decode_frame().

Initial value:

Definition at line 814 of file flac.c.

Referenced by avcodec_register_all().

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 74 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 79 of file flac.c.

Referenced by decode_frame().

const uint8_t table_crc8[256] [static]

Definition at line 87 of file flac.c.

Referenced by get_crc8().


Generated on Mon Apr 28 14:04:03 2008 for Cinelerra by  doxygen 1.5.5