FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
aaccoder.c File Reference

AAC coefficients encoder. More...

#include "libavutil/libm.h"
#include <float.h>
#include "libavutil/mathematics.h"
#include "avcodec.h"
#include "put_bits.h"
#include "aac.h"
#include "aacenc.h"
#include "aactab.h"

Go to the source code of this file.

Data Structures

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

Macros

#define NOISE_LOW_LIMIT   4000
 Frequency in Hz for lower limit of noise substitution. More...
 
#define CB_TOT   12
 Total number of usable codebooks. More...
 
#define CB_TOT_ALL   15
 Total number of codebooks, including special ones. More...
 
#define QUANTIZE_AND_ENCODE_BAND_COST_FUNC(NAME, BT_ZERO, BT_UNSIGNED, BT_PAIR, BT_ESC, BT_NOISE, BT_STEREO)
 
#define quantize_and_encode_band_cost(s, pb, in, scaled, size, scale_idx, cb, lambda, uplim, bits)
 
#define TRELLIS_STAGES   121
 
#define TRELLIS_STATES   (SCALE_MAX_DIFF+1)
 

Functions

static av_always_inline int quant (float coef, const float Q)
 Quantize one coefficient. More...
 
static void quantize_bands (int *out, 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 av_always_inline float quantize_and_encode_band_cost_template (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, int BT_ZERO, int BT_UNSIGNED, int BT_PAIR, int BT_ESC, int BT_NOISE, int BT_STEREO)
 Calculate rate distortion cost for quantizing with given codebook. More...
 
static float quantize_and_encode_band_cost_NONE (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 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 float find_max_val (int group_len, int swb_size, const float *scaled)
 
static int find_min_book (float maxval, int sf)
 
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. More...
 
static void codebook_trellis_rate (AACEncContext *s, SingleChannelElement *sce, int win, int group_len, const float lambda)
 
static av_always_inline uint8_t coef2minsf (float coef)
 Return the minimum scalefactor where the quantized coef does not clip. More...
 
static av_always_inline uint8_t coef2maxsf (float coef)
 Return the maximum scalefactor where the quantized coef is not zero. More...
 
static void set_special_band_scalefactors (AACEncContext *s, SingleChannelElement *sce)
 
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 More...
 
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 More...
 
static const uint8_t run_value_bits_short [16]
 bits needed to code codebook run value for short windows More...
 
static const uint8_t *const run_value_bits [2]
 
static const uint8_t aac_cb_out_map [CB_TOT_ALL] = {0,1,2,3,4,5,6,7,8,9,10,11,13,14,15}
 Map to convert values from BandCodingPath index to a codebook index. More...
 
static const uint8_t aac_cb_in_map [CB_TOT_ALL+1] = {0,1,2,3,4,5,6,7,8,9,10,11,0,12,13,14}
 Inverse map to convert from codebooks to BandCodingPath indices. More...
 
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}
 
static float(*const quantize_and_encode_band_cost_arr [])(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)
 
AACCoefficientsEncoder ff_aac_coders [AAC_CODER_NB]
 

Detailed Description

AAC coefficients encoder.

Definition in file aaccoder.c.

Macro Definition Documentation

#define NOISE_LOW_LIMIT   4000

Frequency in Hz for lower limit of noise substitution.

Definition at line 44 of file aaccoder.c.

Referenced by search_for_quantizers_twoloop().

#define CB_TOT   12

Total number of usable codebooks.

Definition at line 47 of file aaccoder.c.

#define CB_TOT_ALL   15

Total number of codebooks, including special ones.

Definition at line 50 of file aaccoder.c.

Referenced by codebook_trellis_rate(), and encode_window_bands_info().

#define QUANTIZE_AND_ENCODE_BAND_COST_FUNC (   NAME,
  BT_ZERO,
  BT_UNSIGNED,
  BT_PAIR,
  BT_ESC,
  BT_NOISE,
  BT_STEREO 
)
Value:
static float quantize_and_encode_band_cost_ ## NAME( \
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) { \
s, pb, in, scaled, size, scale_idx, \
BT_ESC ? ESC_BT : cb, lambda, uplim, bits, \
BT_ZERO, BT_UNSIGNED, BT_PAIR, BT_ESC, BT_NOISE, BT_STEREO); \
}
const char * s
Definition: avisynth_c.h:631
static double cb(void *priv, double x, double y)
Definition: vf_geq.c:97
AAC encoder context.
Definition: aacenc.h:65
uint8_t bits
Definition: crc.c:295
ptrdiff_t size
Definition: opengl_enc.c:101
static av_always_inline float quantize_and_encode_band_cost_template(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, int BT_ZERO, int BT_UNSIGNED, int BT_PAIR, int BT_ESC, int BT_NOISE, int BT_STEREO)
Calculate rate distortion cost for quantizing with given codebook.
Definition: aaccoder.c:118
return
uint8_t pi<< 24) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_U8, uint8_t,(*(constuint8_t *) pi-0x80)*(1.0f/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_U8, uint8_t,(*(constuint8_t *) pi-0x80)*(1.0/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S16, int16_t,(*(constint16_t *) pi >>8)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S16, int16_t,*(constint16_t *) pi *(1.0f/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S16, int16_t,*(constint16_t *) pi *(1.0/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S32, int32_t,(*(constint32_t *) pi >>24)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S32, int32_t,*(constint32_t *) pi *(1.0f/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S32, int32_t,*(constint32_t *) pi *(1.0/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_FLT, float, av_clip_uint8(lrintf(*(constfloat *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_FLT, float, av_clip_int16(lrintf(*(constfloat *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_FLT, float, av_clipl_int32(llrintf(*(constfloat *) pi *(1U<< 31)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_DBL, double, av_clip_uint8(lrint(*(constdouble *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_DBL, double, av_clip_int16(lrint(*(constdouble *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_DBL, double, av_clipl_int32(llrint(*(constdouble *) pi *(1U<< 31))))#defineSET_CONV_FUNC_GROUP(ofmt, ifmt) staticvoidset_generic_function(AudioConvert *ac){}voidff_audio_convert_free(AudioConvert **ac){if(!*ac) return;ff_dither_free(&(*ac) ->dc);av_freep(ac);}AudioConvert *ff_audio_convert_alloc(AVAudioResampleContext *avr, enumAVSampleFormatout_fmt, enumAVSampleFormatin_fmt, intchannels, intsample_rate, intapply_map){AudioConvert *ac;intin_planar, out_planar;ac=av_mallocz(sizeof(*ac));if(!ac) returnNULL;ac->avr=avr;ac->out_fmt=out_fmt;ac->in_fmt=in_fmt;ac->channels=channels;ac->apply_map=apply_map;if(avr->dither_method!=AV_RESAMPLE_DITHER_NONE &&av_get_packed_sample_fmt(out_fmt)==AV_SAMPLE_FMT_S16 &&av_get_bytes_per_sample(in_fmt)>2){ac->dc=ff_dither_alloc(avr, out_fmt, in_fmt, channels, sample_rate, apply_map);if(!ac->dc){av_free(ac);returnNULL;}returnac;}in_planar=ff_sample_fmt_is_planar(in_fmt, channels);out_planar=ff_sample_fmt_is_planar(out_fmt, channels);if(in_planar==out_planar){ac->func_type=CONV_FUNC_TYPE_FLAT;ac->planes=in_planar?ac->channels:1;}elseif(in_planar) ac->func_type=CONV_FUNC_TYPE_INTERLEAVE;elseac->func_type=CONV_FUNC_TYPE_DEINTERLEAVE;set_generic_function(ac);if(ARCH_AARCH64) ff_audio_convert_init_aarch64(ac);if(ARCH_ARM) ff_audio_convert_init_arm(ac);if(ARCH_X86) ff_audio_convert_init_x86(ac);returnac;}intff_audio_convert(AudioConvert *ac, AudioData *out, AudioData *in){intuse_generic=1;intlen=in->nb_samples;intp;if(ac->dc){av_log(ac->avr, AV_LOG_TRACE,"%dsamples-audio_convert:%sto%s(dithered)\n", len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt));returnff_convert_dither(ac-> in
Spectral data are coded with an escape sequence.
Definition: aac.h:78

Definition at line 230 of file aaccoder.c.

#define quantize_and_encode_band_cost (   s,
  pb,
  in,
  scaled,
  size,
  scale_idx,
  cb,
  lambda,
  uplim,
  bits 
)
Value:
s, pb, in, scaled, size, scale_idx, cb, \
lambda, uplim, bits)
const char * s
Definition: avisynth_c.h:631
static double cb(void *priv, double x, double y)
Definition: vf_geq.c:97
uint8_t bits
Definition: crc.c:295
ptrdiff_t size
Definition: opengl_enc.c:101
uint8_t pi<< 24) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_U8, uint8_t,(*(constuint8_t *) pi-0x80)*(1.0f/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_U8, uint8_t,(*(constuint8_t *) pi-0x80)*(1.0/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S16, int16_t,(*(constint16_t *) pi >>8)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S16, int16_t,*(constint16_t *) pi *(1.0f/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S16, int16_t,*(constint16_t *) pi *(1.0/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S32, int32_t,(*(constint32_t *) pi >>24)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S32, int32_t,*(constint32_t *) pi *(1.0f/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S32, int32_t,*(constint32_t *) pi *(1.0/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_FLT, float, av_clip_uint8(lrintf(*(constfloat *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_FLT, float, av_clip_int16(lrintf(*(constfloat *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_FLT, float, av_clipl_int32(llrintf(*(constfloat *) pi *(1U<< 31)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_DBL, double, av_clip_uint8(lrint(*(constdouble *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_DBL, double, av_clip_int16(lrint(*(constdouble *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_DBL, double, av_clipl_int32(llrint(*(constdouble *) pi *(1U<< 31))))#defineSET_CONV_FUNC_GROUP(ofmt, ifmt) staticvoidset_generic_function(AudioConvert *ac){}voidff_audio_convert_free(AudioConvert **ac){if(!*ac) return;ff_dither_free(&(*ac) ->dc);av_freep(ac);}AudioConvert *ff_audio_convert_alloc(AVAudioResampleContext *avr, enumAVSampleFormatout_fmt, enumAVSampleFormatin_fmt, intchannels, intsample_rate, intapply_map){AudioConvert *ac;intin_planar, out_planar;ac=av_mallocz(sizeof(*ac));if(!ac) returnNULL;ac->avr=avr;ac->out_fmt=out_fmt;ac->in_fmt=in_fmt;ac->channels=channels;ac->apply_map=apply_map;if(avr->dither_method!=AV_RESAMPLE_DITHER_NONE &&av_get_packed_sample_fmt(out_fmt)==AV_SAMPLE_FMT_S16 &&av_get_bytes_per_sample(in_fmt)>2){ac->dc=ff_dither_alloc(avr, out_fmt, in_fmt, channels, sample_rate, apply_map);if(!ac->dc){av_free(ac);returnNULL;}returnac;}in_planar=ff_sample_fmt_is_planar(in_fmt, channels);out_planar=ff_sample_fmt_is_planar(out_fmt, channels);if(in_planar==out_planar){ac->func_type=CONV_FUNC_TYPE_FLAT;ac->planes=in_planar?ac->channels:1;}elseif(in_planar) ac->func_type=CONV_FUNC_TYPE_INTERLEAVE;elseac->func_type=CONV_FUNC_TYPE_DEINTERLEAVE;set_generic_function(ac);if(ARCH_AARCH64) ff_audio_convert_init_aarch64(ac);if(ARCH_ARM) ff_audio_convert_init_arm(ac);if(ARCH_X86) ff_audio_convert_init_x86(ac);returnac;}intff_audio_convert(AudioConvert *ac, AudioData *out, AudioData *in){intuse_generic=1;intlen=in->nb_samples;intp;if(ac->dc){av_log(ac->avr, AV_LOG_TRACE,"%dsamples-audio_convert:%sto%s(dithered)\n", len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt));returnff_convert_dither(ac-> in
static float(*const quantize_and_encode_band_cost_arr[])(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)
Definition: aaccoder.c:252

Definition at line 276 of file aaccoder.c.

Referenced by quantize_and_encode_band(), and quantize_band_cost().

#define TRELLIS_STAGES   121

Definition at line 595 of file aaccoder.c.

Referenced by search_for_quantizers_anmr().

#define TRELLIS_STATES   (SCALE_MAX_DIFF+1)

Definition at line 596 of file aaccoder.c.

Referenced by search_for_quantizers_anmr().

Function Documentation

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

Referenced by quantize_and_encode_band_cost_template(), and search_for_quantizers_faac().

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

Definition at line 85 of file aaccoder.c.

Referenced by quantize_and_encode_band_cost_template().

static void abs_pow34_v ( float *  out,
const float *  in,
const int  size 
)
static
static av_always_inline float quantize_and_encode_band_cost_template ( 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,
int  BT_ZERO,
int  BT_UNSIGNED,
int  BT_PAIR,
int  BT_ESC,
int  BT_NOISE,
int  BT_STEREO 
)
static

Calculate rate distortion cost for quantizing with given codebook.

Returns
quantization distortion

Definition at line 118 of file aaccoder.c.

static float quantize_and_encode_band_cost_NONE ( 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

Definition at line 221 of file aaccoder.c.

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_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 292 of file aaccoder.c.

static float find_max_val ( int  group_len,
int  swb_size,
const float *  scaled 
)
static

Definition at line 300 of file aaccoder.c.

Referenced by search_for_quantizers_anmr(), and search_for_quantizers_twoloop().

static int find_min_book ( float  maxval,
int  sf 
)
static

Definition at line 311 of file aaccoder.c.

Referenced by search_for_quantizers_anmr(), and search_for_quantizers_twoloop().

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 338 of file aaccoder.c.

static void codebook_trellis_rate ( AACEncContext s,
SingleChannelElement sce,
int  win,
int  group_len,
const float  lambda 
)
static

Definition at line 448 of file aaccoder.c.

static av_always_inline uint8_t coef2minsf ( float  coef)
static

Return the minimum scalefactor where the quantized coef does not clip.

Definition at line 581 of file aaccoder.c.

Referenced by search_for_quantizers_anmr().

static av_always_inline uint8_t coef2maxsf ( float  coef)
static

Return the maximum scalefactor where the quantized coef is not zero.

Definition at line 586 of file aaccoder.c.

Referenced by search_for_quantizers_anmr().

static void set_special_band_scalefactors ( AACEncContext s,
SingleChannelElement sce 
)
static

Definition at line 598 of file aaccoder.c.

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

Definition at line 635 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

Band type will be determined by the twoloop algorithm

Definition at line 788 of file aaccoder.c.

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

Definition at line 957 of file aaccoder.c.

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

Definition at line 1124 of file aaccoder.c.

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

Definition at line 1158 of file aaccoder.c.

Variable Documentation

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 53 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 61 of file aaccoder.c.

const uint8_t* const run_value_bits[2]
static
Initial value:
= {
}
static const uint8_t run_value_bits_long[64]
bits needed to code codebook run value for long windows
Definition: aaccoder.c:53
static const uint8_t run_value_bits_short[16]
bits needed to code codebook run value for short windows
Definition: aaccoder.c:61

Definition at line 65 of file aaccoder.c.

Referenced by codebook_trellis_rate(), and encode_window_bands_info().

const uint8_t aac_cb_out_map[CB_TOT_ALL] = {0,1,2,3,4,5,6,7,8,9,10,11,13,14,15}
static

Map to convert values from BandCodingPath index to a codebook index.

Definition at line 70 of file aaccoder.c.

Referenced by codebook_trellis_rate(), and encode_window_bands_info().

const uint8_t aac_cb_in_map[CB_TOT_ALL+1] = {0,1,2,3,4,5,6,7,8,9,10,11,0,12,13,14}
static

Inverse map to convert from codebooks to BandCodingPath indices.

Definition at line 72 of file aaccoder.c.

Referenced by codebook_trellis_rate(), and encode_window_bands_info().

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

Definition at line 110 of file aaccoder.c.

Referenced by quantize_and_encode_band_cost_template().

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

Definition at line 111 of file aaccoder.c.

Referenced by quantize_and_encode_band_cost_template().

float(*const quantize_and_encode_band_cost_arr[])(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
Initial value:
= {
quantize_and_encode_band_cost_ZERO,
quantize_and_encode_band_cost_SQUAD,
quantize_and_encode_band_cost_SQUAD,
quantize_and_encode_band_cost_UQUAD,
quantize_and_encode_band_cost_UQUAD,
quantize_and_encode_band_cost_SPAIR,
quantize_and_encode_band_cost_SPAIR,
quantize_and_encode_band_cost_UPAIR,
quantize_and_encode_band_cost_UPAIR,
quantize_and_encode_band_cost_UPAIR,
quantize_and_encode_band_cost_UPAIR,
quantize_and_encode_band_cost_ESC,
quantize_and_encode_band_cost_NOISE,
quantize_and_encode_band_cost_STEREO,
quantize_and_encode_band_cost_STEREO,
}
static float quantize_and_encode_band_cost_NONE(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)
Definition: aaccoder.c:221

Definition at line 252 of file aaccoder.c.

Initial value:
= {
},
},
},
},
}
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.
Definition: aaccoder.c:338
static void search_for_quantizers_fast(AVCodecContext *avctx, AACEncContext *s, SingleChannelElement *sce, const float lambda)
Definition: aaccoder.c:1124
static void search_for_ms(AACEncContext *s, ChannelElement *cpe, const float lambda)
Definition: aaccoder.c:1158
static void search_for_quantizers_anmr(AVCodecContext *avctx, AACEncContext *s, SingleChannelElement *sce, const float lambda)
Definition: aaccoder.c:635
static void quantize_and_encode_band(struct AACEncContext *s, PutBitContext *pb, const float *in, int size, int scale_idx, int cb, const float lambda)
Definition: aaccoder.c:292
static void codebook_trellis_rate(AACEncContext *s, SingleChannelElement *sce, int win, int group_len, const float lambda)
Definition: aaccoder.c:448
static void search_for_quantizers_faac(AVCodecContext *avctx, AACEncContext *s, SingleChannelElement *sce, const float lambda)
Definition: aaccoder.c:957
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
Definition: aaccoder.c:788

Definition at line 1219 of file aaccoder.c.

Referenced by aac_encode_init().