#include "libavutil/opt.h"
#include "avcodec.h"
#include "put_bits.h"
#include "dsputil.h"
#include "mpeg4audio.h"
#include "kbdwin.h"
#include "sinewin.h"
#include "aac.h"
#include "aactab.h"
#include "aacenc.h"
#include "psymodel.h"
Go to the source code of this file.
Defines | |
#define | AAC_MAX_CHANNELS 6 |
#define | AACENC_FLAGS AV_OPT_FLAG_ENCODING_PARAM | AV_OPT_FLAG_AUDIO_PARAM |
Functions | |
static void | put_audio_specific_config (AVCodecContext *avctx) |
Make AAC audio config object. | |
static av_cold int | aac_encode_init (AVCodecContext *avctx) |
static void | apply_window_and_mdct (AVCodecContext *avctx, AACEncContext *s, SingleChannelElement *sce, short *audio) |
static void | put_ics_info (AACEncContext *s, IndividualChannelStream *info) |
Encode ics_info element. | |
static void | encode_ms_info (PutBitContext *pb, ChannelElement *cpe) |
Encode MS data. | |
static void | adjust_frame_information (AACEncContext *apc, ChannelElement *cpe, int chans) |
Produce integer coefficients from scalefactors provided by the model. | |
static void | encode_band_info (AACEncContext *s, SingleChannelElement *sce) |
Encode scalefactor band coding type. | |
static void | encode_scale_factors (AVCodecContext *avctx, AACEncContext *s, SingleChannelElement *sce) |
Encode scalefactors. | |
static void | encode_pulses (AACEncContext *s, Pulse *pulse) |
Encode pulse data. | |
static void | encode_spectral_coeffs (AACEncContext *s, SingleChannelElement *sce) |
Encode spectral coefficients processed by psychoacoustic model. | |
static int | encode_individual_channel (AVCodecContext *avctx, AACEncContext *s, SingleChannelElement *sce, int common_window) |
Encode one channel of audio data. | |
static void | put_bitstream_info (AVCodecContext *avctx, AACEncContext *s, const char *name) |
Write some auxiliary information about the created AAC file. | |
static int | aac_encode_frame (AVCodecContext *avctx, uint8_t *frame, int buf_size, void *data) |
static av_cold int | aac_encode_end (AVCodecContext *avctx) |
Variables | |
static const uint8_t | swb_size_1024_96 [] |
static const uint8_t | swb_size_1024_64 [] |
static const uint8_t | swb_size_1024_48 [] |
static const uint8_t | swb_size_1024_32 [] |
static const uint8_t | swb_size_1024_24 [] |
static const uint8_t | swb_size_1024_16 [] |
static const uint8_t | swb_size_1024_8 [] |
static const uint8_t * | swb_size_1024 [] |
static const uint8_t | swb_size_128_96 [] |
static const uint8_t | swb_size_128_48 [] |
static const uint8_t | swb_size_128_24 [] |
static const uint8_t | swb_size_128_16 [] |
static const uint8_t | swb_size_128_8 [] |
static const uint8_t * | swb_size_128 [] |
static const uint8_t | aac_chan_configs [6][5] |
default channel configurations | |
static const uint8_t | channel_maps [][AAC_MAX_CHANNELS] |
static const AVOption | aacenc_options [] |
static const AVClass | aacenc_class |
AVCodec | ff_aac_encoder |
Definition in file aacenc.c.
#define AAC_MAX_CHANNELS 6 |
#define AACENC_FLAGS AV_OPT_FLAG_ENCODING_PARAM | AV_OPT_FLAG_AUDIO_PARAM |
static av_cold int aac_encode_end | ( | AVCodecContext * | avctx | ) | [static] |
static int aac_encode_frame | ( | AVCodecContext * | avctx, | |
uint8_t * | frame, | |||
int | buf_size, | |||
void * | data | |||
) | [static] |
static av_cold int aac_encode_init | ( | AVCodecContext * | avctx | ) | [static] |
static void adjust_frame_information | ( | AACEncContext * | apc, | |
ChannelElement * | cpe, | |||
int | chans | |||
) | [static] |
Produce integer coefficients from scalefactors provided by the model.
Definition at line 320 of file aacenc.c.
Referenced by aac_encode_frame().
static void apply_window_and_mdct | ( | AVCodecContext * | avctx, | |
AACEncContext * | s, | |||
SingleChannelElement * | sce, | |||
short * | audio | |||
) | [static] |
Definition at line 232 of file aacenc.c.
Referenced by aac_encode_frame(), encode_superframe(), and vorbis_encode_frame().
static void encode_band_info | ( | AACEncContext * | s, | |
SingleChannelElement * | sce | |||
) | [static] |
Encode scalefactor band coding type.
Definition at line 382 of file aacenc.c.
Referenced by encode_individual_channel().
static int encode_individual_channel | ( | AVCodecContext * | avctx, | |
AACEncContext * | s, | |||
SingleChannelElement * | sce, | |||
int | common_window | |||
) | [static] |
Encode one channel of audio data.
Definition at line 459 of file aacenc.c.
Referenced by aac_encode_frame().
static void encode_ms_info | ( | PutBitContext * | pb, | |
ChannelElement * | cpe | |||
) | [static] |
Encode MS data.
Definition at line 306 of file aacenc.c.
Referenced by aac_encode_frame().
static void encode_pulses | ( | AACEncContext * | s, | |
Pulse * | pulse | |||
) | [static] |
Encode pulse data.
Definition at line 415 of file aacenc.c.
Referenced by encode_individual_channel().
static void encode_scale_factors | ( | AVCodecContext * | avctx, | |
AACEncContext * | s, | |||
SingleChannelElement * | sce | |||
) | [static] |
Encode scalefactors.
Definition at line 393 of file aacenc.c.
Referenced by encode_individual_channel().
static void encode_spectral_coeffs | ( | AACEncContext * | s, | |
SingleChannelElement * | sce | |||
) | [static] |
Encode spectral coefficients processed by psychoacoustic model.
Definition at line 434 of file aacenc.c.
Referenced by encode_individual_channel().
static void put_audio_specific_config | ( | AVCodecContext * | avctx | ) | [static] |
Make AAC audio config object.
Definition at line 151 of file aacenc.c.
Referenced by aac_encode_init().
static void put_bitstream_info | ( | AVCodecContext * | avctx, | |
AACEncContext * | s, | |||
const char * | name | |||
) | [static] |
Write some auxiliary information about the created AAC file.
Definition at line 478 of file aacenc.c.
Referenced by aac_encode_frame().
static void put_ics_info | ( | AACEncContext * | s, | |
IndividualChannelStream * | info | |||
) | [static] |
Encode ics_info element.
Definition at line 285 of file aacenc.c.
Referenced by aac_encode_frame(), and encode_individual_channel().
const uint8_t aac_chan_configs[6][5] [static] |
Initial value:
{ {1, TYPE_SCE}, {1, TYPE_CPE}, {2, TYPE_SCE, TYPE_CPE}, {3, TYPE_SCE, TYPE_CPE, TYPE_SCE}, {3, TYPE_SCE, TYPE_CPE, TYPE_CPE}, {4, TYPE_SCE, TYPE_CPE, TYPE_CPE, TYPE_LFE}, }
Definition at line 129 of file aacenc.c.
Referenced by aac_encode_frame(), and aac_encode_init().
const AVClass aacenc_class [static] |
Initial value:
{ "AAC encoder", av_default_item_name, aacenc_options, LIBAVUTIL_VERSION_INT, }
const AVOption aacenc_options[] [static] |
Initial value:
{ {"stereo_mode", "Stereo coding method", 0x42, FF_OPT_TYPE_INT, {.dbl = 0}, -1, 1, AACENC_FLAGS, "stereo_mode"}, {"auto", "Selected by the Encoder", 0, FF_OPT_TYPE_CONST, {.dbl = -1 }, INT_MIN, INT_MAX, AACENC_FLAGS, "stereo_mode"}, {"ms_off", "Disable Mid/Side coding", 0, FF_OPT_TYPE_CONST, {.dbl = 0 }, INT_MIN, INT_MAX, AACENC_FLAGS, "stereo_mode"}, {"ms_force", "Force Mid/Side for the whole frame if possible", 0, FF_OPT_TYPE_CONST, {.dbl = 1 }, INT_MIN, INT_MAX, AACENC_FLAGS, "stereo_mode"}, {NULL} }
const uint8_t channel_maps[][AAC_MAX_CHANNELS] [static] |
Initial value:
{ { 0 }, { 0, 1 }, { 2, 0, 1 }, { 2, 0, 1, 3 }, { 2, 0, 1, 3, 4 }, { 2, 0, 1, 4, 5, 3 }, }
Definition at line 138 of file aacenc.c.
Referenced by aac_encode_frame(), and Faac_encode_init().
Initial value:
{ "aac", AVMEDIA_TYPE_AUDIO, CODEC_ID_AAC, sizeof(AACEncContext), aac_encode_init, aac_encode_frame, aac_encode_end, .capabilities = CODEC_CAP_SMALL_LAST_FRAME | CODEC_CAP_DELAY | CODEC_CAP_EXPERIMENTAL, .sample_fmts = (const enum AVSampleFormat[]){AV_SAMPLE_FMT_S16,AV_SAMPLE_FMT_NONE}, .long_name = NULL_IF_CONFIG_SMALL("Advanced Audio Coding"), .priv_class = &aacenc_class, }
const uint8_t* swb_size_1024[] [static] |
Initial value:
{ swb_size_1024_96, swb_size_1024_96, swb_size_1024_64, swb_size_1024_48, swb_size_1024_48, swb_size_1024_32, swb_size_1024_24, swb_size_1024_24, swb_size_1024_16, swb_size_1024_16, swb_size_1024_16, swb_size_1024_8 }
Definition at line 92 of file aacenc.c.
Referenced by aac_encode_init().
const uint8_t swb_size_1024_16[] [static] |
const uint8_t swb_size_1024_24[] [static] |
const uint8_t swb_size_1024_32[] [static] |
const uint8_t swb_size_1024_48[] [static] |
const uint8_t swb_size_1024_64[] [static] |
const uint8_t swb_size_1024_8[] [static] |
const uint8_t swb_size_1024_96[] [static] |
const uint8_t* swb_size_128[] [static] |
Initial value:
{ swb_size_128_96, swb_size_128_96, swb_size_128_96, swb_size_128_48, swb_size_128_48, swb_size_128_48, swb_size_128_24, swb_size_128_24, swb_size_128_16, swb_size_128_16, swb_size_128_16, swb_size_128_8 }
Definition at line 119 of file aacenc.c.
Referenced by aac_encode_init().
const uint8_t swb_size_128_16[] [static] |
const uint8_t swb_size_128_24[] [static] |
const uint8_t swb_size_128_48[] [static] |
const uint8_t swb_size_128_8[] [static] |
const uint8_t swb_size_128_96[] [static] |