mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-15 03:34:56 +00:00
99eb31e263
* qatar/master: (25 commits) Replace custom DEBUG preprocessor trickery by the standard one. vorbis: Remove non-compiling debug statement. vorbis: Remove pointless DEBUG #ifdef around debug output macros. cook: Remove non-compiling debug output. Remove pointless #ifdefs around function declarations in a header. Replace #ifdef + av_log() combinations by av_dlog(). Replace custom debug output functions by av_dlog(). cook: Remove unused debug functions. Remove stray extra arguments from av_dlog() invocations. targa: fix big-endian build v4l2: remove one forgotten use of AVFormatParameters.pix_fmt. vfwcap: add a framerate private option. v4l2: add a framerate private option. libdc1394: add a framerate private option. fbdev: add a framerate private option. bktr: add a framerate private option. oma: check avio_read() return value nutdec: remove unused variable Remove unused variables swscale: allocate larger buffer to handle altivec overreads. ... Conflicts: ffmpeg.c libavcodec/dca.c libavcodec/dirac.c libavcodec/error_resilience.c libavcodec/h264.c libavcodec/mpeg12.c libavcodec/mpeg4videodec.c libavcodec/mpegvideo.c libavcodec/mpegvideo_enc.c libavcodec/pthread.c libavcodec/rv10.c libavcodec/s302m.c libavcodec/shorten.c libavcodec/truemotion2.c libavcodec/utils.c libavdevice/dv1394.c libavdevice/fbdev.c libavdevice/libdc1394.c libavdevice/v4l2.c libavformat/4xm.c libavformat/apetag.c libavformat/asfdec.c libavformat/avidec.c libavformat/mmf.c libavformat/mpeg.c libavformat/mpegenc.c libavformat/mpegts.c libavformat/oggdec.c libavformat/oggparseogm.c libavformat/rl2.c libavformat/rmdec.c libavformat/rpl.c libavformat/rtpdec_latm.c libavformat/sauce.c libavformat/sol.c libswscale/utils.c tests/ref/vsynth1/error tests/ref/vsynth2/error Merged-by: Michael Niedermayer <michaelni@gmx.at>
77 lines
2.7 KiB
C
77 lines
2.7 KiB
C
/*
|
|
* AAC encoder
|
|
* Copyright (C) 2008 Konstantin Shishkov
|
|
*
|
|
* This file is part of FFmpeg.
|
|
*
|
|
* FFmpeg is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
* License as published by the Free Software Foundation; either
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
*
|
|
* FFmpeg is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
* Lesser General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
* License along with FFmpeg; if not, write to the Free Software
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
*/
|
|
|
|
#ifndef AVCODEC_AACENC_H
|
|
#define AVCODEC_AACENC_H
|
|
|
|
#include "avcodec.h"
|
|
#include "put_bits.h"
|
|
#include "dsputil.h"
|
|
|
|
#include "aac.h"
|
|
|
|
#include "psymodel.h"
|
|
|
|
typedef struct AACEncOptions {
|
|
int stereo_mode;
|
|
} 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[];
|
|
|
|
/**
|
|
* AAC encoder context
|
|
*/
|
|
typedef struct AACEncContext {
|
|
AVClass *av_class;
|
|
AACEncOptions options; ///< encoding options
|
|
PutBitContext pb;
|
|
FFTContext mdct1024; ///< long (1024 samples) frame transform context
|
|
FFTContext mdct128; ///< short (128 samples) frame transform context
|
|
DSPContext dsp;
|
|
int16_t *samples; ///< saved preprocessed input
|
|
|
|
int samplerate_index; ///< MPEG-4 samplerate index
|
|
|
|
ChannelElement *cpe; ///< channel elements
|
|
FFPsyContext psy;
|
|
struct FFPsyPreprocessContext* psypp;
|
|
AACCoefficientsEncoder *coder;
|
|
int cur_channel;
|
|
int last_frame;
|
|
float lambda;
|
|
DECLARE_ALIGNED(16, int, qcoefs)[96]; ///< quantized coefficients
|
|
DECLARE_ALIGNED(32, float, scoefs)[1024]; ///< scaled coefficients
|
|
} AACEncContext;
|
|
|
|
#endif /* AVCODEC_AACENC_H */
|