psymodel.c File Reference
#include "avcodec.h"
#include "psymodel.h"
#include "iirfilter.h"

Go to the source code of this file.

Data Structures

struct  FFPsyPreprocessContext

Macros

#define FILT_ORDER   4

Typedefs

typedef struct
FFPsyPreprocessContext 
FFPsyPreprocessContext

Functions

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.
FFPsyChannelGroupff_psy_find_group (FFPsyContext *ctx, int channel)
 Determine what group a channel belongs to.
av_cold void ff_psy_end (FFPsyContext *ctx)
 Cleanup model context at the end.
av_cold struct
FFPsyPreprocessContext
ff_psy_preprocess_init (AVCodecContext *avctx)
 psychoacoustic model audio preprocessing initialization
void ff_psy_preprocess (struct FFPsyPreprocessContext *ctx, const int16_t *audio, int16_t *dest, int tag, int channels)
 Preprocess several channel in audio frame in order to compress it better.
av_cold void ff_psy_preprocess_end (struct FFPsyPreprocessContext *ctx)
 Cleanup audio preprocessing module.

Variables

const FFPsyModel ff_aac_psy_model

Macro Definition Documentation

#define FILT_ORDER   4

Definition at line 90 of file psymodel.c.

Referenced by ff_psy_preprocess_init().

Typedef Documentation

Function Documentation

av_cold void ff_psy_end ( FFPsyContext ctx)

Cleanup model context at the end.

Parameters
ctxmodel context

Definition at line 73 of file psymodel.c.

Referenced by aac_encode_end().

FFPsyChannelGroup* ff_psy_find_group ( FFPsyContext ctx,
int  channel 
)

Determine what group a channel belongs to.

Parameters
ctxpsymodel context
channelchannel to locate the group for
Returns
pointer to the FFPsyChannelGroup this channel belongs to

Definition at line 63 of file psymodel.c.

Referenced by psy_3gpp_analyze().

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.

Parameters
ctxmodel context
avctxcodec context
num_lensnumber of possible frame lengths
bandsscalefactor band lengths for all frame lengths
num_bandsnumber of scalefactor bands for all frame lengths
num_groupsnumber of channel groups
group_maparray with # of channels in group - 1, for each group
Returns
zero if successful, a negative value if not

Definition at line 28 of file psymodel.c.

Referenced by aac_encode_init().

void ff_psy_preprocess ( struct FFPsyPreprocessContext ctx,
const int16_t *  audio,
int16_t *  dest,
int  tag,
int  channels 
)

Preprocess several channel in audio frame in order to compress it better.

Parameters
ctxpreprocessing context
audiosamples to preprocess
destplace to put filtered samples
tagchannel number
channelsnumber of channel to preprocess (some additional work may be done on stereo pair)

Definition at line 115 of file psymodel.c.

Referenced by aac_encode_frame().

av_cold void ff_psy_preprocess_end ( struct FFPsyPreprocessContext ctx)

Cleanup audio preprocessing module.

Definition at line 132 of file psymodel.c.

Referenced by aac_encode_end().

av_cold struct FFPsyPreprocessContext* ff_psy_preprocess_init ( AVCodecContext avctx)
read

psychoacoustic model audio preprocessing initialization

Definition at line 92 of file psymodel.c.

Referenced by aac_encode_init().

Variable Documentation

const FFPsyModel ff_aac_psy_model

Definition at line 928 of file aacpsy.c.

Referenced by ff_psy_init().