#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 [] |
Definition in file aaccoder.c.
#define TRELLIS_STAGES 121 |
#define TRELLIS_STATES 256 |
static void abs_pow34_v | ( | float * | out, | |
const float * | in, | |||
const int | size | |||
) | [static] |
Definition at line 85 of file aaccoder.c.
Referenced by encode_window_bands_info(), quantize_and_encode_band_cost(), search_for_ms(), search_for_quantizers_anmr(), search_for_quantizers_faac(), and search_for_quantizers_twoloop().
static void encode_window_bands_info | ( | AACEncContext * | s, | |
SingleChannelElement * | sce, | |||
int | win, | |||
int | group_len, | |||
const float | lambda | |||
) | [static] |
static av_always_inline int quant | ( | float | coef, | |
const float | Q | |||
) | [static] |
Quantize one coefficient.
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.
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] |
Definition at line 245 of file aaccoder.c.
Referenced by encode_window_bands_info(), search_for_ms(), search_for_quantizers_anmr(), search_for_quantizers_faac(), and search_for_quantizers_twoloop().
static void quantize_bands | ( | int(*) | out[2], | |
const float * | in, | |||
const float * | scaled, | |||
int | size, | |||
float | Q34, | |||
int | is_signed, | |||
int | maxval | |||
) | [static] |
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.
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.
Initial value:
{ { search_for_quantizers_faac, encode_window_bands_info, quantize_and_encode_band, search_for_ms, }, { search_for_quantizers_anmr, encode_window_bands_info, quantize_and_encode_band, search_for_ms, }, { search_for_quantizers_twoloop, encode_window_bands_info, quantize_and_encode_band, search_for_ms, }, { search_for_quantizers_fast, encode_window_bands_info, quantize_and_encode_band, search_for_ms, }, }
Definition at line 936 of file aaccoder.c.
Referenced by aac_encode_init().
const uint8_t* run_value_bits[2] [static] |
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 }
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 }
Definition at line 49 of file aaccoder.c.