libavcodec/aaccoder.c File Reference

AAC coefficients encoder. More...

#include "avcodec.h"
#include "put_bits.h"
#include "aac.h"
#include "aacenc.h"
#include "aactab.h"
#include "libavutil/libm.h"

Go to the source code of this file.

Data Structures

struct  BandCodingPath
 structure used in optimal codebook search More...
struct  TrellisPath

Defines

#define TRELLIS_STAGES   121
#define TRELLIS_STATES   256

Functions

static av_always_inline int quant (float coef, const float Q)
 Quantize one coefficient.
static void quantize_bands (int(*out)[2], const float *in, const float *scaled, int size, float Q34, int is_signed, int maxval)
static void abs_pow34_v (float *out, const float *in, const int size)
static float quantize_and_encode_band_cost (struct AACEncContext *s, PutBitContext *pb, const float *in, const float *scaled, int size, int scale_idx, int cb, const float lambda, const float uplim, int *bits)
 Calculate rate distortion cost for quantizing with given codebook.
static float quantize_band_cost (struct AACEncContext *s, const float *in, const float *scaled, int size, int scale_idx, int cb, const float lambda, const float uplim, int *bits)
static void quantize_and_encode_band (struct AACEncContext *s, PutBitContext *pb, const float *in, int size, int scale_idx, int cb, const float lambda)
static void encode_window_bands_info (AACEncContext *s, SingleChannelElement *sce, int win, int group_len, const float lambda)
 Encode band info for single window group bands.
static void search_for_quantizers_anmr (AVCodecContext *avctx, AACEncContext *s, SingleChannelElement *sce, const float lambda)
static void search_for_quantizers_twoloop (AVCodecContext *avctx, AACEncContext *s, SingleChannelElement *sce, const float lambda)
 two-loop quantizers search taken from ISO 13818-7 Appendix C
static void search_for_quantizers_faac (AVCodecContext *avctx, AACEncContext *s, SingleChannelElement *sce, const float lambda)
static void search_for_quantizers_fast (AVCodecContext *avctx, AACEncContext *s, SingleChannelElement *sce, const float lambda)
static void search_for_ms (AACEncContext *s, ChannelElement *cpe, const float lambda)

Variables

static const uint8_t run_value_bits_long [64]
 bits needed to code codebook run value for long windows
static const uint8_t run_value_bits_short [16]
 bits needed to code codebook run value for short windows
static const uint8_t * run_value_bits [2]
static const uint8_t aac_cb_range [12] = {0, 3, 3, 3, 3, 9, 9, 8, 8, 13, 13, 17}
static const uint8_t aac_cb_maxval [12] = {0, 1, 1, 2, 2, 4, 4, 7, 7, 12, 12, 16}
AACCoefficientsEncoder ff_aac_coders []


Detailed Description

AAC coefficients encoder.

Definition in file aaccoder.c.


Define Documentation

#define TRELLIS_STAGES   121

Definition at line 383 of file aaccoder.c.

Referenced by search_for_quantizers_anmr().

#define TRELLIS_STATES   256

Definition at line 384 of file aaccoder.c.

Referenced by search_for_quantizers_anmr().


Function Documentation

static void abs_pow34_v ( float *  out,
const float *  in,
const int  size 
) [static]

static void encode_window_bands_info ( AACEncContext s,
SingleChannelElement sce,
int  win,
int  group_len,
const float  lambda 
) [static]

Encode band info for single window group bands.

Definition at line 274 of file aaccoder.c.

static av_always_inline int quant ( float  coef,
const float  Q 
) [static]

Quantize one coefficient.

Returns:
absolute value of the quantized coefficient
See also:
3GPP TS26.403 5.6.2 "Scalefactor determination"

Definition at line 63 of file aaccoder.c.

static void quantize_and_encode_band ( struct AACEncContext s,
PutBitContext pb,
const float *  in,
int  size,
int  scale_idx,
int  cb,
const float  lambda 
) [static]

Definition at line 254 of file aaccoder.c.

static float quantize_and_encode_band_cost ( struct AACEncContext s,
PutBitContext pb,
const float *  in,
const float *  scaled,
int  size,
int  scale_idx,
int  cb,
const float  lambda,
const float  uplim,
int *  bits 
) [static]

Calculate rate distortion cost for quantizing with given codebook.

Returns:
quantization distortion

Definition at line 104 of file aaccoder.c.

Referenced by quantize_and_encode_band(), and quantize_band_cost().

static float quantize_band_cost ( struct AACEncContext s,
const float *  in,
const float *  scaled,
int  size,
int  scale_idx,
int  cb,
const float  lambda,
const float  uplim,
int *  bits 
) [static]

static void quantize_bands ( int(*)  out[2],
const float *  in,
const float *  scaled,
int  size,
float  Q34,
int  is_signed,
int  maxval 
) [static]

Definition at line 69 of file aaccoder.c.

Referenced by quantize_and_encode_band_cost().

static void search_for_ms ( AACEncContext s,
ChannelElement cpe,
const float  lambda 
) [static]

Definition at line 875 of file aaccoder.c.

static void search_for_quantizers_anmr ( AVCodecContext avctx,
AACEncContext s,
SingleChannelElement sce,
const float  lambda 
) [static]

Definition at line 386 of file aaccoder.c.

static void search_for_quantizers_faac ( AVCodecContext avctx,
AACEncContext s,
SingleChannelElement sce,
const float  lambda 
) [static]

Definition at line 672 of file aaccoder.c.

static void search_for_quantizers_fast ( AVCodecContext avctx,
AACEncContext s,
SingleChannelElement sce,
const float  lambda 
) [static]

Definition at line 840 of file aaccoder.c.

static void search_for_quantizers_twoloop ( AVCodecContext avctx,
AACEncContext s,
SingleChannelElement sce,
const float  lambda 
) [static]

two-loop quantizers search taken from ISO 13818-7 Appendix C

Definition at line 533 of file aaccoder.c.


Variable Documentation

const uint8_t aac_cb_maxval[12] = {0, 1, 1, 2, 2, 4, 4, 7, 7, 12, 12, 16} [static]

Definition at line 97 of file aaccoder.c.

const uint8_t aac_cb_range[12] = {0, 3, 3, 3, 3, 9, 9, 8, 8, 13, 13, 17} [static]

Definition at line 96 of file aaccoder.c.

const uint8_t* run_value_bits[2] [static]

Initial value:

Definition at line 53 of file aaccoder.c.

Referenced by encode_window_bands_info().

const uint8_t run_value_bits_long[64] [static]

Initial value:

 {
     5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,
     5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5,  5, 10,
    10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
    10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 15
}
bits needed to code codebook run value for long windows

Definition at line 41 of file aaccoder.c.

const uint8_t run_value_bits_short[16] [static]

Initial value:

 {
    3, 3, 3, 3, 3, 3, 3, 6, 6, 6, 6, 6, 6, 6, 6, 9
}
bits needed to code codebook run value for short windows

Definition at line 49 of file aaccoder.c.


Generated on Fri Oct 26 02:36:50 2012 for FFmpeg by  doxygen 1.5.8