Libav
|
00001 /* 00002 * AAC encoder 00003 * Copyright (C) 2008 Konstantin Shishkov 00004 * 00005 * This file is part of FFmpeg. 00006 * 00007 * FFmpeg is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU Lesser General Public 00009 * License as published by the Free Software Foundation; either 00010 * version 2.1 of the License, or (at your option) any later version. 00011 * 00012 * FFmpeg is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 * Lesser General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU Lesser General Public 00018 * License along with FFmpeg; if not, write to the Free Software 00019 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 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 struct AACEncContext; 00034 00035 typedef struct AACCoefficientsEncoder { 00036 void (*search_for_quantizers)(AVCodecContext *avctx, struct AACEncContext *s, 00037 SingleChannelElement *sce, const float lambda); 00038 void (*encode_window_bands_info)(struct AACEncContext *s, SingleChannelElement *sce, 00039 int win, int group_len, const float lambda); 00040 void (*quantize_and_encode_band)(struct AACEncContext *s, PutBitContext *pb, const float *in, int size, 00041 int scale_idx, int cb, const float lambda); 00042 void (*search_for_ms)(struct AACEncContext *s, ChannelElement *cpe, const float lambda); 00043 } AACCoefficientsEncoder; 00044 00045 extern AACCoefficientsEncoder ff_aac_coders[]; 00046 00050 typedef struct AACEncContext { 00051 PutBitContext pb; 00052 FFTContext mdct1024; 00053 FFTContext mdct128; 00054 DSPContext dsp; 00055 DECLARE_ALIGNED(16, FFTSample, output)[2048]; 00056 int16_t* samples; 00057 00058 int samplerate_index; 00059 00060 ChannelElement *cpe; 00061 FFPsyContext psy; 00062 struct FFPsyPreprocessContext* psypp; 00063 AACCoefficientsEncoder *coder; 00064 int cur_channel; 00065 int last_frame; 00066 float lambda; 00067 DECLARE_ALIGNED(16, int, qcoefs)[96]; 00068 DECLARE_ALIGNED(16, float, scoefs)[1024]; 00069 } AACEncContext; 00070 00071 #endif /* AVCODEC_AACENC_H */