29 const uint8_t **
bands,
const int* num_bands,
30 int num_groups,
const uint8_t *group_map,
int cutoff)
38 ctx->num_bands =
av_memdup(num_bands, num_lens *
sizeof(
ctx->num_bands[0]));
39 ctx->cutoff = cutoff ? cutoff : avctx->
cutoff;
41 if (!
ctx->ch || !
ctx->group || !
ctx->bands || !
ctx->num_bands) {
47 for (
i = 0;
i < num_groups;
i++) {
52 ctx->group[
i].num_ch = group_map[
i] + 1;
53 for (j = 0; j <
ctx->group[
i].num_ch * 2; j++)
54 ctx->group[
i].ch[j] = &
ctx->ch[k++];
57 switch (
ctx->avctx->codec_id) {
63 return ctx->model->init(
ctx);
72 ch +=
ctx->group[
i++].num_ch;
74 return &
ctx->group[
i-1];
79 if (
ctx->model &&
ctx->model->end)
const FFPsyModel ff_aac_psy_model
static const float bands[]
static AVFormatContext * ctx
Libavcodec external API header.
#define i(width, name, range_min, range_max)
channel
Use these values when setting the channel map with ebur128_set_channel().
void * av_memdup(const void *p, size_t size)
Duplicate a buffer with av_malloc().
void * av_calloc(size_t nmemb, size_t size)
Memory handling functions.
FFPsyChannelGroup * ff_psy_find_group(FFPsyContext *ctx, int channel)
Determine what group a channel belongs to.
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, int cutoff)
Initialize psychoacoustic model.
av_cold void ff_psy_end(FFPsyContext *ctx)
Cleanup model context at the end.
int nb_channels
Number of channels in this layout.
main external API structure.
AVChannelLayout ch_layout
Audio channel layout.
int cutoff
Audio cutoff bandwidth (0 means "automatic")
psychoacoustic information for an arbitrary group of channels
context used by psychoacoustic model
codec-specific psychoacoustic model implementation