Libav
Data Structures | Defines | Typedefs | Functions

libavcodec/psymodel.h File Reference

#include "avcodec.h"

Go to the source code of this file.

Data Structures

struct  FFPsyBand
 single band psychoacoustic information More...
struct  FFPsyWindowInfo
 windowing related information More...
struct  FFPsyContext
 context used by psychoacoustic model More...
struct  FFPsyModel
 codec-specific psychoacoustic model implementation More...

Defines

#define PSY_MAX_BANDS   128
 maximum possible number of bands

Typedefs

typedef struct FFPsyBand FFPsyBand
 single band psychoacoustic information
typedef struct FFPsyWindowInfo FFPsyWindowInfo
 windowing related information
typedef struct FFPsyContext FFPsyContext
 context used by psychoacoustic model
typedef struct FFPsyModel FFPsyModel
 codec-specific psychoacoustic model implementation

Functions

av_cold int ff_psy_init (FFPsyContext *ctx, AVCodecContext *avctx, int num_lens, const uint8_t **bands, const int *num_bands)
 Initialize psychoacoustic model.
FFPsyWindowInfo ff_psy_suggest_window (FFPsyContext *ctx, const int16_t *audio, const int16_t *la, int channel, int prev_type)
 Suggest window sequence for channel.
void ff_psy_set_band_info (FFPsyContext *ctx, int channel, const float *coeffs, FFPsyWindowInfo *wi)
 Perform psychoacoustic analysis and set band info (threshold, energy).
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.

Define Documentation

#define PSY_MAX_BANDS   128

Typedef Documentation

typedef struct FFPsyBand FFPsyBand

single band psychoacoustic information

typedef struct FFPsyContext FFPsyContext

context used by psychoacoustic model

typedef struct FFPsyModel FFPsyModel

codec-specific psychoacoustic model implementation

windowing related information


Function Documentation

av_cold void ff_psy_end ( FFPsyContext ctx)

Cleanup model context at the end.

Parameters:
ctxmodel context

Definition at line 61 of file psymodel.c.

Referenced by aac_encode_end().

av_cold int ff_psy_init ( FFPsyContext ctx,
AVCodecContext avctx,
int  num_lens,
const uint8_t **  bands,
const int *  num_bands 
)

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
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 101 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 118 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 79 of file psymodel.c.

Referenced by aac_encode_init().

void ff_psy_set_band_info ( FFPsyContext ctx,
int  channel,
const float *  coeffs,
FFPsyWindowInfo wi 
)

Perform psychoacoustic analysis and set band info (threshold, energy).

Parameters:
ctxmodel context
channelaudio channel number
coeffspointer to the transformed coefficients
wiwindow information

Definition at line 55 of file psymodel.c.

Referenced by aac_encode_frame().

FFPsyWindowInfo ff_psy_suggest_window ( FFPsyContext ctx,
const int16_t *  audio,
const int16_t *  la,
int  channel,
int  prev_type 
)

Suggest window sequence for channel.

Parameters:
ctxmodel context
audiosamples for the current frame
lalookahead samples (NULL when unavailable)
channelnumber of channel element to analyze
prev_typeprevious window type
Returns:
suggested window information in a structure

Definition at line 48 of file psymodel.c.

Referenced by aac_encode_frame().