00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef AVCODEC_AACENC_H
00023 #define AVCODEC_AACENC_H
00024
00025 #include "libavutil/float_dsp.h"
00026 #include "avcodec.h"
00027 #include "put_bits.h"
00028 #include "dsputil.h"
00029
00030 #include "aac.h"
00031 #include "audio_frame_queue.h"
00032 #include "psymodel.h"
00033
00034 #define AAC_CODER_NB 4
00035
00036 typedef struct AACEncOptions {
00037 int stereo_mode;
00038 int aac_coder;
00039 } AACEncOptions;
00040
00041 struct AACEncContext;
00042
00043 typedef struct AACCoefficientsEncoder {
00044 void (*search_for_quantizers)(AVCodecContext *avctx, struct AACEncContext *s,
00045 SingleChannelElement *sce, const float lambda);
00046 void (*encode_window_bands_info)(struct AACEncContext *s, SingleChannelElement *sce,
00047 int win, int group_len, const float lambda);
00048 void (*quantize_and_encode_band)(struct AACEncContext *s, PutBitContext *pb, const float *in, int size,
00049 int scale_idx, int cb, const float lambda);
00050 void (*search_for_ms)(struct AACEncContext *s, ChannelElement *cpe, const float lambda);
00051 } AACCoefficientsEncoder;
00052
00053 extern AACCoefficientsEncoder ff_aac_coders[];
00054
00058 typedef struct AACEncContext {
00059 AVClass *av_class;
00060 AACEncOptions options;
00061 PutBitContext pb;
00062 FFTContext mdct1024;
00063 FFTContext mdct128;
00064 DSPContext dsp;
00065 AVFloatDSPContext fdsp;
00066 float *planar_samples[6];
00067
00068 int samplerate_index;
00069 int channels;
00070 const uint8_t *chan_map;
00071
00072 ChannelElement *cpe;
00073 FFPsyContext psy;
00074 struct FFPsyPreprocessContext* psypp;
00075 AACCoefficientsEncoder *coder;
00076 int cur_channel;
00077 int last_frame;
00078 float lambda;
00079 AudioFrameQueue afq;
00080 DECLARE_ALIGNED(16, int, qcoefs)[96];
00081 DECLARE_ALIGNED(32, float, scoefs)[1024];
00082
00083 struct {
00084 float *samples;
00085 } buffer;
00086 } AACEncContext;
00087
00088 extern float ff_aac_pow34sf_tab[428];
00089
00090 #endif