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

#include "avcodec.h"
#include "bitstream.h"
#include "mpegaudio.h"
#include "mpegaudiotab.h"

Include dependency graph for mpegaudio.c:

Go to the source code of this file.

Data Structures

struct  MpegAudioContext

Defines

#define FRAC_BITS   15
#define WFRAC_BITS   14
#define MUL(a, b)   (((int64_t)(a) * (int64_t)(b)) >> FRAC_BITS)
#define FIX(a)   ((int)((a) * (1 << FRAC_BITS)))
#define SAMPLES_BUF_SIZE   4096
#define P   15
#define WSHIFT   (WFRAC_BITS + 15 - FRAC_BITS)
#define SB_NOTALLOCATED   0
#define SB_ALLOCATED   1
#define SB_NOMORE   2

Functions

static int MPA_encode_init (AVCodecContext *avctx)
static void idct32 (int *out, int *tab)
static void filter (MpegAudioContext *s, int ch, short *samples, int incr)
static void compute_scale_factors (unsigned char scale_code[SBLIMIT], unsigned char scale_factors[SBLIMIT][3], int sb_samples[3][12][SBLIMIT], int sblimit)
static void psycho_acoustic_model (MpegAudioContext *s, short smr[SBLIMIT])
static void compute_bit_allocation (MpegAudioContext *s, short smr1[MPA_MAX_CHANNELS][SBLIMIT], unsigned char bit_alloc[MPA_MAX_CHANNELS][SBLIMIT], int *padding)
static void encode_frame (MpegAudioContext *s, unsigned char bit_alloc[MPA_MAX_CHANNELS][SBLIMIT], int padding)
static int MPA_encode_frame (AVCodecContext *avctx, unsigned char *frame, int buf_size, void *data)
static int MPA_encode_close (AVCodecContext *avctx)


Detailed Description

The simplest mpeg audio layer 2 encoder.

Definition in file mpegaudio.c.


Define Documentation

#define FIX ( a   )     ((int)((a) * (1 << FRAC_BITS)))

Definition at line 34 of file mpegaudio.c.

#define FRAC_BITS   15

#define MUL ( a,
b   )     (((int64_t)(a) * (int64_t)(b)) >> FRAC_BITS)

Definition at line 33 of file mpegaudio.c.

#define P   15

#define SAMPLES_BUF_SIZE   4096

Definition at line 36 of file mpegaudio.c.

Referenced by filter().

#define SB_ALLOCATED   1

Definition at line 497 of file mpegaudio.c.

Referenced by compute_bit_allocation().

#define SB_NOMORE   2

Definition at line 498 of file mpegaudio.c.

Referenced by compute_bit_allocation().

#define SB_NOTALLOCATED   0

Definition at line 496 of file mpegaudio.c.

Referenced by compute_bit_allocation().

#define WFRAC_BITS   14

Definition at line 32 of file mpegaudio.c.

Referenced by ff_mpa_synth_init(), and MPA_encode_init().

#define WSHIFT   (WFRAC_BITS + 15 - FRAC_BITS)

Definition at line 308 of file mpegaudio.c.

Referenced by filter().


Function Documentation

static void compute_bit_allocation ( MpegAudioContext s,
short  smr1[MPA_MAX_CHANNELS][SBLIMIT],
unsigned char  bit_alloc[MPA_MAX_CHANNELS][SBLIMIT],
int *  padding 
) [static]

static void compute_scale_factors ( unsigned char  scale_code[SBLIMIT],
unsigned char  scale_factors[SBLIMIT][3],
int  sb_samples[3][12][SBLIMIT],
int  sblimit 
) [static]

Definition at line 367 of file mpegaudio.c.

References scale_diff_table, and scale_factor_table.

Referenced by MPA_encode_frame().

static void encode_frame ( MpegAudioContext s,
unsigned char  bit_alloc[MPA_MAX_CHANNELS][SBLIMIT],
int  padding 
) [static]

static void filter ( MpegAudioContext s,
int  ch,
short *  samples,
int  incr 
) [static]

static void idct32 ( int *  out,
int *  tab 
) [static]

Definition at line 189 of file mpegaudio.c.

References bitinv32, costab32, FIX, MUL, SQRT2, t, and t1.

Referenced by filter().

static int MPA_encode_close ( AVCodecContext avctx  )  [static]

Definition at line 782 of file mpegaudio.c.

References av_freep(), and AVCodecContext::coded_frame.

Here is the call graph for this function:

static int MPA_encode_frame ( AVCodecContext avctx,
unsigned char *  frame,
int  buf_size,
void *  data 
) [static]

static int MPA_encode_init ( AVCodecContext avctx  )  [static]

static void psycho_acoustic_model ( MpegAudioContext s,
short  smr[SBLIMIT] 
) [static]

Definition at line 486 of file mpegaudio.c.

References fixed_smr, and MpegAudioContext::sblimit.

Referenced by MPA_encode_frame().


Generated on Mon Apr 28 14:05:16 2008 for Cinelerra by  doxygen 1.5.5