Logo Search packages:      
Sourcecode: blender version File versions  Download package

ac3enc.c File Reference


Detailed Description

The simplest AC3 encoder.

Definition in file ac3enc.c.

#include "avcodec.h"
#include "bitstream.h"
#include "crc.h"
#include "ac3.h"
#include "ac3tab.h"

Go to the source code of this file.

Classes

struct  AC3EncodeContext
struct  IComplex

Defines

#define BF(pre, pim, qre, qim, pre1, pim1, qre1, qim1)
#define CMUL(pre, pim, are, aim, bre, bim)
#define CRC16_POLY   ((1 << 0) | (1 << 2) | (1 << 15) | (1 << 16))
#define EXP_DIFF_THRESHOLD   1000
#define MDCT_NBITS   9
#define MUL16(a, b)   ((a) * (b))
#define N   (1 << MDCT_NBITS)
#define SNR_INC1   4

Functions

void ac3_common_init (void)
static int AC3_encode_close (AVCodecContext *avctx)
static int AC3_encode_frame (AVCodecContext *avctx, unsigned char *frame, int buf_size, void *data)
static int AC3_encode_init (AVCodecContext *avctx)
void ac3_parametric_bit_allocation (AC3BitAllocParameters *s, uint8_t *bap, int8_t *exp, int start, int end, int snroffset, int fgain, int is_lfe, int deltbae, int deltnseg, uint8_t *deltoffst, uint8_t *deltlen, uint8_t *deltba)
static int asym_quant (int c, int e, int qbits)
static int bit_alloc (AC3EncodeContext *s, uint8_t bap[NB_BLOCKS][AC3_MAX_CHANNELS][N/2], uint8_t encoded_exp[NB_BLOCKS][AC3_MAX_CHANNELS][N/2], uint8_t exp_strategy[NB_BLOCKS][AC3_MAX_CHANNELS], int frame_bits, int csnroffst, int fsnroffst)
static int calc_exp_diff (uint8_t *exp1, uint8_t *exp2, int n)
static int calc_lowcomp (int a, int b0, int b1, int bin)
static int calc_lowcomp1 (int a, int b0, int b1)
static int compute_bit_allocation (AC3EncodeContext *s, uint8_t bap[NB_BLOCKS][AC3_MAX_CHANNELS][N/2], uint8_t encoded_exp[NB_BLOCKS][AC3_MAX_CHANNELS][N/2], uint8_t exp_strategy[NB_BLOCKS][AC3_MAX_CHANNELS], int frame_bits)
static void compute_exp_strategy (uint8_t exp_strategy[NB_BLOCKS][AC3_MAX_CHANNELS], uint8_t exp[NB_BLOCKS][AC3_MAX_CHANNELS][N/2], int ch, int is_lfe)
static int compute_mantissa_size (AC3EncodeContext *s, uint8_t *m, int nb_coefs)
static int encode_exp (uint8_t encoded_exp[N/2], uint8_t exp[N/2], int nb_exps, int exp_strategy)
static void exponent_min (uint8_t exp[N/2], uint8_t exp1[N/2], int n)
static void fft (IComplex *z, int ln)
static void fft_init (int ln)
static int16_t fix15 (float a)
static int log2_tab (int16_t *tab, int n)
static void lshift_tab (int16_t *tab, int n, int lshift)
static void mdct512 (int32_t *out, int16_t *in)
static unsigned int mul_poly (unsigned int a, unsigned int b, unsigned int poly)
static void output_audio_block (AC3EncodeContext *s, uint8_t exp_strategy[AC3_MAX_CHANNELS], uint8_t encoded_exp[AC3_MAX_CHANNELS][N/2], uint8_t bap[AC3_MAX_CHANNELS][N/2], int32_t mdct_coefs[AC3_MAX_CHANNELS][N/2], int8_t global_exp[AC3_MAX_CHANNELS], int block_num)
static int output_frame_end (AC3EncodeContext *s)
static void output_frame_header (AC3EncodeContext *s, unsigned char *frame)
static unsigned int pow_poly (unsigned int a, unsigned int n, unsigned int poly)
static int sym_quant (int c, int e, int levels)

Variables

AVCodec ac3_encoder


Generated by  Doxygen 1.6.0   Back to index