Libav  0.7.1
Data Structures | Defines | Typedefs | Functions | Variables
libavcodec/ac3enc.h File Reference

AC-3 encoder & E-AC-3 encoder common header. More...

#include <stdint.h>
#include "ac3.h"
#include "ac3dsp.h"
#include "avcodec.h"
#include "dsputil.h"
#include "put_bits.h"
#include "fft.h"

Go to the source code of this file.

Data Structures

struct  AC3MDCTContext
struct  AC3EncOptions
 Encoding Options used by AVOption. More...
struct  AC3Block
 Data for a single audio block. More...
struct  AC3EncodeContext
 AC-3 encoder private context. More...

Defines

#define OFFSET(param)   offsetof(AC3EncodeContext, options.param)
#define AC3ENC_PARAM   (AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM)
#define AC3ENC_TYPE_AC3_FIXED   0
#define AC3ENC_TYPE_AC3   1
#define AC3ENC_TYPE_EAC3   2
#define AC3_NAME(x)   ff_ac3_fixed_ ## x
#define MAC_COEF(d, a, b)   MAC64(d,a,b)

Typedefs

typedef int16_t SampleType
typedef int32_t CoefType
typedef int64_t CoefSumType
typedef struct AC3MDCTContext AC3MDCTContext
typedef struct AC3EncOptions AC3EncOptions
 Encoding Options used by AVOption.
typedef struct AC3Block AC3Block
 Data for a single audio block.
typedef struct AC3EncodeContext AC3EncodeContext
 AC-3 encoder private context.

Functions

int ff_ac3_encode_init (AVCodecContext *avctx)
 Initialize the encoder.
int ff_ac3_encode_frame (AVCodecContext *avctx, unsigned char *frame, int buf_size, void *data)
 Encode a single AC-3 frame.
int ff_ac3_encode_close (AVCodecContext *avctx)
 Finalize encoding and free any memory allocated by the encoder.
void ff_ac3_fixed_mdct_end (AC3MDCTContext *mdct)
void ff_ac3_float_mdct_end (AC3MDCTContext *mdct)
 Finalize MDCT and free allocated memory.
int ff_ac3_fixed_mdct_init (AVCodecContext *avctx, AC3MDCTContext *mdct, int nbits)
int ff_ac3_float_mdct_init (AVCodecContext *avctx, AC3MDCTContext *mdct, int nbits)
 Initialize MDCT tables.
void ff_ac3_fixed_apply_window (DSPContext *dsp, SampleType *output, const SampleType *input, const SampleType *window, unsigned int len)
void ff_ac3_float_apply_window (DSPContext *dsp, SampleType *output, const SampleType *input, const SampleType *window, unsigned int len)
int ff_ac3_fixed_normalize_samples (AC3EncodeContext *s)
void ff_ac3_fixed_scale_coefficients (AC3EncodeContext *s)
void ff_ac3_float_scale_coefficients (AC3EncodeContext *s)
 Scale MDCT coefficients from float to 24-bit fixed-point.
int ff_ac3_fixed_allocate_sample_buffers (AC3EncodeContext *s)
int ff_ac3_float_allocate_sample_buffers (AC3EncodeContext *s)
void ff_ac3_fixed_deinterleave_input_samples (AC3EncodeContext *s, const SampleType *samples)
void ff_ac3_float_deinterleave_input_samples (AC3EncodeContext *s, const SampleType *samples)
void ff_ac3_fixed_apply_mdct (AC3EncodeContext *s)
void ff_ac3_float_apply_mdct (AC3EncodeContext *s)
void ff_ac3_fixed_apply_channel_coupling (AC3EncodeContext *s)
void ff_ac3_float_apply_channel_coupling (AC3EncodeContext *s)
void ff_ac3_fixed_compute_rematrixing_strategy (AC3EncodeContext *s)
void ff_ac3_float_compute_rematrixing_strategy (AC3EncodeContext *s)

Variables

const int64_t ff_ac3_channel_layouts [19]
 List of supported channel layouts.

Detailed Description

AC-3 encoder & E-AC-3 encoder common header.

Definition in file ac3enc.h.


Define Documentation

#define AC3_NAME (   x)    ff_ac3_fixed_ ## x

Definition at line 57 of file ac3enc.h.

Definition at line 44 of file ac3enc.h.

#define AC3ENC_TYPE_AC3   1

Definition at line 47 of file ac3enc.h.

#define AC3ENC_TYPE_AC3_FIXED   0

Definition at line 46 of file ac3enc.h.

#define AC3ENC_TYPE_EAC3   2

Definition at line 48 of file ac3enc.h.

#define MAC_COEF (   d,
  a,
  b 
)    MAC64(d,a,b)

Definition at line 58 of file ac3enc.h.

Referenced by apply_channel_coupling(), and compute_rematrixing_strategy().

#define OFFSET (   param)    offsetof(AC3EncodeContext, options.param)

Definition at line 43 of file ac3enc.h.


Typedef Documentation

typedef struct AC3Block AC3Block

Data for a single audio block.

AC-3 encoder private context.

typedef struct AC3EncOptions AC3EncOptions

Encoding Options used by AVOption.

typedef int64_t CoefSumType

Definition at line 61 of file ac3enc.h.

typedef int32_t CoefType

Definition at line 60 of file ac3enc.h.

typedef int16_t SampleType

Definition at line 59 of file ac3enc.h.


Function Documentation

Finalize encoding and free any memory allocated by the encoder.

Definition at line 1932 of file ac3enc.c.

Referenced by ff_ac3_encode_init().

int ff_ac3_encode_frame ( AVCodecContext avctx,
unsigned char *  frame,
int  buf_size,
void *  data 
)

Encode a single AC-3 frame.

Definition at line 1881 of file ac3enc.c.

Initialize the encoder.

Definition at line 2315 of file ac3enc.c.

Referenced by ac3_fixed_encode_init().

Referenced by ff_ac3_encode_init().

Referenced by ff_ac3_encode_init().

Referenced by ff_ac3_encode_init().

void ff_ac3_fixed_apply_window ( DSPContext dsp,
SampleType output,
const SampleType input,
const SampleType window,
unsigned int  len 
)

Referenced by ff_ac3_encode_init().

Referenced by ff_ac3_encode_init().

Referenced by ff_ac3_encode_init().

Referenced by ff_ac3_encode_init().

int ff_ac3_fixed_mdct_init ( AVCodecContext avctx,
AC3MDCTContext mdct,
int  nbits 
)

Referenced by ff_ac3_encode_init().

Referenced by ff_ac3_encode_init().

Referenced by ff_ac3_encode_init().

Referenced by ff_ac3_encode_init().

Referenced by ff_ac3_encode_init().

Referenced by ff_ac3_encode_init().

void ff_ac3_float_apply_window ( DSPContext dsp,
SampleType output,
const SampleType input,
const SampleType window,
unsigned int  len 
)

Referenced by ff_ac3_encode_init().

Referenced by ff_ac3_encode_init().

Referenced by ff_ac3_encode_init().

Finalize MDCT and free allocated memory.

Definition at line 48 of file ac3enc_float.c.

Referenced by ff_ac3_encode_init().

int ff_ac3_float_mdct_init ( AVCodecContext avctx,
AC3MDCTContext mdct,
int  nbits 
)

Initialize MDCT tables.

Parameters:
nbitslog2(MDCT size)

Definition at line 59 of file ac3enc_float.c.

Referenced by ff_ac3_encode_init().

Scale MDCT coefficients from float to 24-bit fixed-point.

Definition at line 96 of file ac3enc_float.c.

Referenced by ff_ac3_encode_init().


Variable Documentation

const int64_t ff_ac3_channel_layouts[19]

List of supported channel layouts.

Definition at line 80 of file ac3enc.c.