22 #ifndef AVCODEC_PSYMODEL_H
23 #define AVCODEC_PSYMODEL_H
28 #define PSY_MAX_BANDS 128
30 #define PSY_MAX_CHANS 20
32 #define AAC_CUTOFF(s) (s->bit_rate ? FFMIN3(4000 + s->bit_rate/8, 12000 + s->bit_rate/32, s->sample_rate / 2) : (s->sample_rate / 2))
143 const uint8_t **bands,
const int *num_bands,
144 int num_groups,
const uint8_t *group_map);
#define PSY_MAX_BANDS
maximum possible number of bands
int num_groups
number of channel groups
static const int16_t coeffs[28]
int grouping[8]
window grouping (for e.g. AAC)
uint8_t ** bands
scalefactor band sizes for possible frame sizes
FFPsyChannelGroup * group
channel group information
FFPsyBand psy_bands[PSY_MAX_BANDS]
channel bands information
av_cold void ff_psy_preprocess_end(struct FFPsyPreprocessContext *ctx)
Cleanup audio preprocessing module.
psychoacoustic information for an arbitrary group of channels
av_cold int ff_psy_init(FFPsyContext *ctx, AVCodecContext *avctx, int num_lens, const uint8_t **bands, const int *num_bands, int num_groups, const uint8_t *group_map)
Initialize psychoacoustic model.
int * num_bands
number of scalefactor bands for possible frame sizes
int * window_sizes
sequence of window sizes inside one frame (for eg. WMA)
int size
size of the bitresevoir in bits
context used by psychoacoustic model
single band psychoacoustic information
single channel psychoacoustic information
FFPsyChannel * ch[PSY_MAX_CHANS]
pointers to the individual channels in the group
int num_windows
number of windows in a frame
Libavcodec external API header.
codec-specific psychoacoustic model implementation
void(* analyze)(FFPsyContext *ctx, int channel, const float **coeffs, const FFPsyWindowInfo *wi)
Perform psychoacoustic analysis and set band info (threshold, energy) for a group of channels...
uint8_t num_ch
number of channels in this group
struct FFPsyModel * model
encoder-specific model functions
float entropy
total PE for this channel
typedef void(RENAME(mix_any_func_type))
FFPsyWindowInfo(* window)(FFPsyContext *ctx, const float *audio, const float *la, int channel, int prev_type)
Suggest window sequence for channel.
FFPsyChannelGroup * ff_psy_find_group(FFPsyContext *ctx, int channel)
Determine what group a channel belongs to.
main external API structure.
void * model_priv_data
psychoacoustic model implementation private data
int bits
number of bits used in the bitresevoir
void(* end)(FFPsyContext *apc)
#define PSY_MAX_CHANS
maximum number of channels
int window_shape
window shape (sine/KBD/whatever)
struct FFPsyContext::@80 bitres
uint8_t coupling[PSY_MAX_BANDS]
allow coupling for this band in the group
windowing related information
av_cold struct FFPsyPreprocessContext * ff_psy_preprocess_init(AVCodecContext *avctx)
psychoacoustic model audio preprocessing initialization
void ff_psy_preprocess(struct FFPsyPreprocessContext *ctx, float **audio, int channels)
Preprocess several channel in audio frame in order to compress it better.
int num_lens
number of scalefactor band sets
FFPsyChannel * ch
single channel information
int(* init)(FFPsyContext *apc)
AVCodecContext * avctx
encoder context
av_cold void ff_psy_end(FFPsyContext *ctx)
Cleanup model context at the end.
int window_type[3]
window type (short/long/transitional, etc.) - current, previous and next