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 "avcodec.h"
00026 #include "put_bits.h"
00027 #include "dsputil.h"
00028 
00029 #include "aac.h"
00030 
00031 #include "psymodel.h"
00032 
00033 #define AAC_CODER_NB 4
00034 
00035 typedef struct AACEncOptions {
00036     int stereo_mode;
00037     int aac_coder;
00038 } AACEncOptions;
00039 
00040 struct AACEncContext;
00041 
00042 typedef struct AACCoefficientsEncoder {
00043     void (*search_for_quantizers)(AVCodecContext *avctx, struct AACEncContext *s,
00044                                   SingleChannelElement *sce, const float lambda);
00045     void (*encode_window_bands_info)(struct AACEncContext *s, SingleChannelElement *sce,
00046                                      int win, int group_len, const float lambda);
00047     void (*quantize_and_encode_band)(struct AACEncContext *s, PutBitContext *pb, const float *in, int size,
00048                                      int scale_idx, int cb, const float lambda);
00049     void (*search_for_ms)(struct AACEncContext *s, ChannelElement *cpe, const float lambda);
00050 } AACCoefficientsEncoder;
00051 
00052 extern AACCoefficientsEncoder ff_aac_coders[];
00053 
00057 typedef struct AACEncContext {
00058     AVClass *av_class;
00059     AACEncOptions options;                       
00060     PutBitContext pb;
00061     FFTContext mdct1024;                         
00062     FFTContext mdct128;                          
00063     DSPContext  dsp;
00064     int16_t *samples;                            
00065 
00066     int samplerate_index;                        
00067     const uint8_t *chan_map;                     
00068 
00069     ChannelElement *cpe;                         
00070     FFPsyContext psy;
00071     struct FFPsyPreprocessContext* psypp;
00072     AACCoefficientsEncoder *coder;
00073     int cur_channel;
00074     int last_frame;
00075     float lambda;
00076     DECLARE_ALIGNED(16, int,   qcoefs)[96];      
00077     DECLARE_ALIGNED(32, float, scoefs)[1024];    
00078 } AACEncContext;
00079 
00080 #endif