#include "avcodec.h"
#include "aactab.h"
#include "psymodel.h"
Go to the source code of this file.
Data Structures | |
struct | AacPsyBand |
information for single band used by 3GPP TS26.403-inspired psychoacoustic model More... | |
struct | AacPsyChannel |
single/pair channel context for psychoacoustic model More... | |
struct | AacPsyCoeffs |
psychoacoustic model frame type-dependent coefficients More... | |
struct | AacPsyContext |
3GPP TS26.403-inspired psychoacoustic model specific data More... | |
struct | PsyLamePreset |
LAME psy model preset struct. More... | |
Defines | |
#define | ATH_ADD 4 |
Functions | |
static float | lame_calc_attack_threshold (int bitrate) |
calculates the attack threshold for ABR from the above table for the LAME psy model | |
static void | lame_window_init (AacPsyContext *ctx, AVCodecContext *avctx) |
LAME psy model specific initialization. | |
static av_cold float | calc_bark (float f) |
Calculate Bark value for given line. | |
static av_cold float | ath (float f, float add) |
Calculate ATH value for given frequency. | |
static av_cold int | psy_3gpp_init (FFPsyContext *ctx) |
static float | iir_filter (int in, float state[2]) |
IIR filter used in block switching decision. | |
static av_unused FFPsyWindowInfo | psy_3gpp_window (FFPsyContext *ctx, const int16_t *audio, const int16_t *la, int channel, int prev_type) |
Tell encoder which window types to use. | |
static int | calc_bit_demand (AacPsyContext *ctx, float pe, int bits, int size, int short_window) |
static float | calc_pe_3gpp (AacPsyBand *band) |
static float | calc_reduction_3gpp (float a, float desired_pe, float pe, float active_lines) |
static float | calc_reduced_thr_3gpp (AacPsyBand *band, float min_snr, float reduction) |
static void | psy_3gpp_analyze_channel (FFPsyContext *ctx, int channel, const float *coefs, const FFPsyWindowInfo *wi) |
Calculate band thresholds as suggested in 3GPP TS26.403. | |
static void | psy_3gpp_analyze (FFPsyContext *ctx, int channel, const float **coeffs, const FFPsyWindowInfo *wi) |
static av_cold void | psy_3gpp_end (FFPsyContext *apc) |
static void | lame_apply_block_type (AacPsyChannel *ctx, FFPsyWindowInfo *wi, int uselongblock) |
static FFPsyWindowInfo | psy_lame_window (FFPsyContext *ctx, const int16_t *audio, const int16_t *la, int channel, int prev_type) |
Variables | |
static const PsyLamePreset | psy_abr_map [] |
LAME psy model preset table for ABR. | |
static const PsyLamePreset | psy_vbr_map [] |
LAME psy model preset table for constant quality. | |
static const float | psy_fir_coeffs [] |
LAME psy model FIR coefficient table. | |
static const uint8_t | window_grouping [9] |
window grouping information stored as bits (0 - new group, 1 - group continues) | |
const FFPsyModel | ff_aac_psy_model |
#define | PSY_3GPP_THR_SPREAD_HI 1.5f |
constants for 3GPP AAC psychoacoustic model | |
#define | PSY_3GPP_THR_SPREAD_LOW 3.0f |
#define | PSY_3GPP_EN_SPREAD_HI_L1 2.0f |
#define | PSY_3GPP_EN_SPREAD_HI_L2 1.5f |
#define | PSY_3GPP_EN_SPREAD_HI_S 1.5f |
#define | PSY_3GPP_EN_SPREAD_LOW_L 3.0f |
#define | PSY_3GPP_EN_SPREAD_LOW_S 2.0f |
#define | PSY_3GPP_RPEMIN 0.01f |
#define | PSY_3GPP_RPELEV 2.0f |
#define | PSY_3GPP_C1 3.0f |
#define | PSY_3GPP_C2 1.3219281f |
#define | PSY_3GPP_C3 0.55935729f |
#define | PSY_SNR_1DB 7.9432821e-1f |
#define | PSY_SNR_25DB 3.1622776e-3f |
#define | PSY_3GPP_SAVE_SLOPE_L -0.46666667f |
#define | PSY_3GPP_SAVE_SLOPE_S -0.36363637f |
#define | PSY_3GPP_SAVE_ADD_L -0.84285712f |
#define | PSY_3GPP_SAVE_ADD_S -0.75f |
#define | PSY_3GPP_SPEND_SLOPE_L 0.66666669f |
#define | PSY_3GPP_SPEND_SLOPE_S 0.81818181f |
#define | PSY_3GPP_SPEND_ADD_L -0.35f |
#define | PSY_3GPP_SPEND_ADD_S -0.26111111f |
#define | PSY_3GPP_CLIP_LO_L 0.2f |
#define | PSY_3GPP_CLIP_LO_S 0.2f |
#define | PSY_3GPP_CLIP_HI_L 0.95f |
#define | PSY_3GPP_CLIP_HI_S 0.75f |
#define | PSY_3GPP_AH_THR_LONG 0.5f |
#define | PSY_3GPP_AH_THR_SHORT 0.63f |
#define | PSY_3GPP_BITS_TO_PE(bits) ((bits) * 1.18f) |
#define | PSY_LAME_FIR_LEN 21 |
LAME psy model FIR order. | |
#define | AAC_BLOCK_SIZE_LONG 1024 |
long block size | |
#define | AAC_BLOCK_SIZE_SHORT 128 |
short block size | |
#define | AAC_NUM_BLOCKS_SHORT 8 |
number of blocks in a short sequence | |
#define | PSY_LAME_NUM_SUBBLOCKS 3 |
Number of sub-blocks in each short block. | |
enum | { PSY_3GPP_AH_NONE, PSY_3GPP_AH_INACTIVE, PSY_3GPP_AH_ACTIVE } |
Definition in file aacpsy.c.
#define AAC_BLOCK_SIZE_LONG 1024 |
#define AAC_NUM_BLOCKS_SHORT 8 |
number of blocks in a short sequence
Definition at line 92 of file aacpsy.c.
Referenced by lame_window_init(), and psy_lame_window().
#define ATH_ADD 4 |
#define PSY_3GPP_C1 3.0f |
#define PSY_3GPP_C2 1.3219281f |
#define PSY_3GPP_C3 0.55935729f |
#define PSY_3GPP_CLIP_HI_L 0.95f |
#define PSY_3GPP_CLIP_HI_S 0.75f |
#define PSY_3GPP_CLIP_LO_L 0.2f |
#define PSY_3GPP_CLIP_LO_S 0.2f |
#define PSY_3GPP_EN_SPREAD_HI_L1 2.0f |
#define PSY_3GPP_EN_SPREAD_HI_S 1.5f |
#define PSY_3GPP_EN_SPREAD_LOW_L 3.0f |
#define PSY_3GPP_EN_SPREAD_LOW_S 2.0f |
#define PSY_3GPP_SAVE_ADD_L -0.84285712f |
#define PSY_3GPP_SAVE_ADD_S -0.75f |
#define PSY_3GPP_SAVE_SLOPE_L -0.46666667f |
#define PSY_3GPP_SAVE_SLOPE_S -0.36363637f |
#define PSY_3GPP_SPEND_ADD_L -0.35f |
#define PSY_3GPP_SPEND_ADD_S -0.26111111f |
#define PSY_3GPP_SPEND_SLOPE_L 0.66666669f |
#define PSY_3GPP_SPEND_SLOPE_S 0.81818181f |
#define PSY_3GPP_THR_SPREAD_HI 1.5f |
constants for 3GPP AAC psychoacoustic model
Definition at line 41 of file aacpsy.c.
Referenced by psy_3gpp_init().
#define PSY_3GPP_THR_SPREAD_LOW 3.0f |
#define PSY_LAME_NUM_SUBBLOCKS 3 |
Number of sub-blocks in each short block.
Definition at line 93 of file aacpsy.c.
Referenced by lame_window_init().
#define PSY_SNR_1DB 7.9432821e-1f |
#define PSY_SNR_25DB 3.1622776e-3f |
anonymous enum |
static av_cold float ath | ( | float | f, | |
float | add | |||
) | [static] |
Calculate ATH value for given frequency.
Borrowed from Lame.
Definition at line 280 of file aacpsy.c.
Referenced by psy_3gpp_init().
static av_cold float calc_bark | ( | float | f | ) | [static] |
Calculate Bark value for given line.
Definition at line 270 of file aacpsy.c.
Referenced by psy_3gpp_init().
static int calc_bit_demand | ( | AacPsyContext * | ctx, | |
float | pe, | |||
int | bits, | |||
int | size, | |||
int | short_window | |||
) | [static] |
static float calc_pe_3gpp | ( | AacPsyBand * | band | ) | [static] |
static float calc_reduced_thr_3gpp | ( | AacPsyBand * | band, | |
float | min_snr, | |||
float | reduction | |||
) | [static] |
static float calc_reduction_3gpp | ( | float | a, | |
float | desired_pe, | |||
float | pe, | |||
float | active_lines | |||
) | [static] |
static float iir_filter | ( | int | in, | |
float | state[2] | |||
) | [static] |
static void lame_apply_block_type | ( | AacPsyChannel * | ctx, | |
FFPsyWindowInfo * | wi, | |||
int | uselongblock | |||
) | [static] |
static float lame_calc_attack_threshold | ( | int | bitrate | ) | [static] |
calculates the attack threshold for ABR from the above table for the LAME psy model
Definition at line 221 of file aacpsy.c.
Referenced by lame_window_init().
static void lame_window_init | ( | AacPsyContext * | ctx, | |
AVCodecContext * | avctx | |||
) | [static] |
LAME psy model specific initialization.
Definition at line 251 of file aacpsy.c.
Referenced by psy_3gpp_init().
static void psy_3gpp_analyze | ( | FFPsyContext * | ctx, | |
int | channel, | |||
const float ** | coeffs, | |||
const FFPsyWindowInfo * | wi | |||
) | [static] |
static void psy_3gpp_analyze_channel | ( | FFPsyContext * | ctx, | |
int | channel, | |||
const float * | coefs, | |||
const FFPsyWindowInfo * | wi | |||
) | [static] |
Calculate band thresholds as suggested in 3GPP TS26.403.
Definition at line 560 of file aacpsy.c.
Referenced by psy_3gpp_analyze().
static av_cold void psy_3gpp_end | ( | FFPsyContext * | apc | ) | [static] |
static av_cold int psy_3gpp_init | ( | FFPsyContext * | ctx | ) | [static] |
static av_unused FFPsyWindowInfo psy_3gpp_window | ( | FFPsyContext * | ctx, | |
const int16_t * | audio, | |||
const int16_t * | la, | |||
int | channel, | |||
int | prev_type | |||
) | [static] |
static FFPsyWindowInfo psy_lame_window | ( | FFPsyContext * | ctx, | |
const int16_t * | audio, | |||
const int16_t * | la, | |||
int | channel, | |||
int | prev_type | |||
) | [static] |
const FFPsyModel ff_aac_psy_model |
Initial value:
{ .name = "3GPP TS 26.403-inspired model", .init = psy_3gpp_init, .window = psy_lame_window, .analyze = psy_3gpp_analyze, .end = psy_3gpp_end, }
const PsyLamePreset psy_abr_map[] [static] |
const float psy_fir_coeffs[] [static] |
const PsyLamePreset psy_vbr_map[] [static] |
const uint8_t window_grouping[9] [static] |
Initial value:
{ 0xB6, 0x6C, 0xD8, 0xB2, 0x66, 0xC6, 0x96, 0x36, 0x36 }
Definition at line 372 of file aacpsy.c.
Referenced by psy_3gpp_window().