37 #define FAAC_DELAY_SAMPLES 1024
49 #if FF_API_OLD_ENCODE_AUDIO
71 faacEncConfigurationPtr faac_cfg;
72 unsigned long samples_input, max_bytes_output;
84 &samples_input, &max_bytes_output);
92 faac_cfg = faacEncGetCurrentConfiguration(s->
faac_handle);
93 if (faac_cfg->version != FAAC_CFG_VERSION) {
94 av_log(avctx,
AV_LOG_ERROR,
"wrong libfaac version (compiled for: %d, using %d)\n", FAAC_CFG_VERSION, faac_cfg->version);
102 faac_cfg->aacObjectType =
MAIN;
106 faac_cfg->aacObjectType = LOW;
109 faac_cfg->aacObjectType = SSR;
112 faac_cfg->aacObjectType = LTP;
119 faac_cfg->mpegVersion = MPEG4;
120 faac_cfg->useTns = 0;
121 faac_cfg->allowMidside = 1;
123 faac_cfg->bandWidth = avctx->
cutoff;
125 faac_cfg->bitRate = 0;
128 faac_cfg->outputFormat = 1;
129 faac_cfg->inputFormat = FAAC_INPUT_16BIT;
136 #if FF_API_OLD_ENCODE_AUDIO
149 unsigned long decoder_specific_info_size;
151 if (!faacEncGetDecoderSpecificInfo(s->
faac_handle, &buffer,
152 &decoder_specific_info_size)) {
160 faac_cfg->outputFormat = 0;
165 if (!faacEncSetConfiguration(s->
faac_handle, faac_cfg)) {
181 const AVFrame *frame,
int *got_packet_ptr)
184 int bytes_written, ret;
185 int num_samples = frame ? frame->
nb_samples : 0;
193 bytes_written = faacEncEncode(s->
faac_handle, samples,
196 if (bytes_written < 0) {
198 return bytes_written;
214 avpkt->
size = bytes_written;
faacEncHandle faac_handle
void * av_malloc(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
This structure describes decoded (raw) audio or video data.
#define AV_CH_LAYOUT_SURROUND
static av_cold int Faac_encode_init(AVCodecContext *avctx)
AVFrame * coded_frame
the picture in the bitstream
#define AV_CH_LAYOUT_4POINT0
#define AV_CH_LAYOUT_STEREO
void av_freep(void *arg)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
#define CODEC_FLAG_QSCALE
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
static av_cold int Faac_encode_close(AVCodecContext *avctx)
AVCodec ff_libfaac_encoder
int duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
static int Faac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)
static int init(AVCodecParserContext *s)
#define CODEC_CAP_SMALL_LAST_FRAME
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
#define FAAC_DELAY_SAMPLES
void av_log(void *avcl, int level, const char *fmt,...)
const char * name
Name of the codec implementation.
int ff_af_queue_add(AudioFrameQueue *afq, const AVFrame *f)
Add a frame to the queue.
AVFrame * avcodec_alloc_frame(void)
Allocate an AVFrame and set its fields to default values.
int bit_rate
the average bitrate
audio channel layout utility functions
static const uint64_t faac_channel_layouts[]
int ff_alloc_packet(AVPacket *avpkt, int size)
Check AVPacket size and/or allocate data.
#define AV_CH_LAYOUT_5POINT1_BACK
#define FF_PROFILE_AAC_SSR
int frame_size
Number of samples per channel in an audio frame.
int sample_rate
samples per second
#define FF_PROFILE_AAC_MAIN
main external API structure.
static void close(AVCodecParserContext *s)
#define FF_INPUT_BUFFER_PADDING_SIZE
#define AV_CH_LAYOUT_5POINT0_BACK
#define CODEC_FLAG_GLOBAL_HEADER
int global_quality
Global quality for codecs which cannot change it per frame.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
#define FF_PROFILE_AAC_LOW
static const AVProfile profiles[]
common internal api header.
common internal and external API header
AVSampleFormat
Audio Sample Formats.
static const int channel_maps[][6]
int cutoff
Audio cutoff bandwidth (0 means "automatic")
struct FaacAudioContext FaacAudioContext
#define FF_PROFILE_AAC_LTP
void ff_af_queue_init(AVCodecContext *avctx, AudioFrameQueue *afq)
Initialize AudioFrameQueue.
void ff_af_queue_remove(AudioFrameQueue *afq, int nb_samples, int64_t *pts, int *duration)
Remove frame(s) from the queue.
int channels
number of audio channels
void ff_af_queue_close(AudioFrameQueue *afq)
Close AudioFrameQueue.
#define AV_CH_LAYOUT_MONO
This structure stores compressed data.
int nb_samples
number of audio samples (per channel) described by this frame
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
#define FF_PROFILE_UNKNOWN