#ifndef AVCODEC_AACENC_H
#define AVCODEC_AACENC_H
#include "libavutil/float_dsp.h"
#include "avcodec.h"
#include "put_bits.h"
#include "aac.h"
#include "audio_frame_queue.h"
#include "psymodel.h"
typedef enum AACCoder {
AAC_CODER_FAAC = 0,
AAC_CODER_ANMR,
AAC_CODER_TWOLOOP,
AAC_CODER_FAST,
AAC_CODER_NB,
}AACCoder;
typedef struct AACEncOptions {
int stereo_mode;
int aac_coder;
} AACEncOptions;
struct AACEncContext;
typedef struct AACCoefficientsEncoder {
void (*search_for_quantizers)(AVCodecContext *avctx, struct AACEncContext *s,
SingleChannelElement *sce, const float lambda);
void (*encode_window_bands_info)(struct AACEncContext *s, SingleChannelElement *sce,
int win, int group_len, const float lambda);
void (*quantize_and_encode_band)(struct AACEncContext *s, PutBitContext *pb, const float *in, int size,
int scale_idx, int cb, const float lambda);
void (*search_for_ms)(struct AACEncContext *s, ChannelElement *cpe, const float lambda);
} AACCoefficientsEncoder;
extern AACCoefficientsEncoder ff_aac_coders[];
typedef struct AACEncContext {
AVClass *av_class;
AACEncOptions options;
PutBitContext pb;
FFTContext mdct1024;
FFTContext mdct128;
AVFloatDSPContext *fdsp;
float *planar_samples[6];
int samplerate_index;
int channels;
const uint8_t *chan_map;
ChannelElement *cpe;
FFPsyContext psy;
struct FFPsyPreprocessContext* psypp;
AACCoefficientsEncoder *coder;
int cur_channel;
int last_frame;
float lambda;
AudioFrameQueue afq;
DECLARE_ALIGNED(16, int, qcoefs)[96];
DECLARE_ALIGNED(32, float, scoefs)[1024];
struct {
float *samples;
} buffer;
} AACEncContext;
extern float ff_aac_pow34sf_tab[428];
void ff_aac_coder_init_mips(AACEncContext *c);
#endif