37 faacEncConfigurationPtr faac_cfg;
38 unsigned long samples_input, max_bytes_output;
48 &samples_input, &max_bytes_output);
51 faac_cfg = faacEncGetCurrentConfiguration(s->
faac_handle);
52 if (faac_cfg->version != FAAC_CFG_VERSION) {
53 av_log(avctx,
AV_LOG_ERROR,
"wrong libfaac version (compiled for: %d, using %d)\n", FAAC_CFG_VERSION, faac_cfg->version);
61 faac_cfg->aacObjectType =
MAIN;
65 faac_cfg->aacObjectType = LOW;
68 faac_cfg->aacObjectType = SSR;
71 faac_cfg->aacObjectType = LTP;
78 faac_cfg->mpegVersion = MPEG4;
80 faac_cfg->allowMidside = 1;
82 faac_cfg->bandWidth = avctx->
cutoff;
84 faac_cfg->bitRate = 0;
87 faac_cfg->outputFormat = 1;
88 faac_cfg->inputFormat = FAAC_INPUT_16BIT;
100 unsigned long decoder_specific_info_size;
102 if (!faacEncGetDecoderSpecificInfo(s->
faac_handle, &buffer,
103 &decoder_specific_info_size)) {
107 faac_cfg->outputFormat = 0;
111 #define free please_use_av_free
114 if (!faacEncSetConfiguration(s->
faac_handle, faac_cfg)) {
123 unsigned char *frame,
int buf_size,
void *
data)
127 int num_samples = data ? avctx->
frame_size : 0;
135 return bytes_written;
faacEncHandle faac_handle
static int Faac_encode_frame(AVCodecContext *avctx, unsigned char *frame, int buf_size, void *data)
static av_cold int Faac_encode_init(AVCodecContext *avctx)
AVFrame * coded_frame
the picture in the bitstream
#define FF_PROFILE_AAC_MAIN
void av_freep(void *arg)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
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
#define FF_PROFILE_AAC_LTP
static int init(AVCodecParserContext *s)
#define CODEC_CAP_SMALL_LAST_FRAME
Codec can be fed a final frame with a smaller size.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
void av_log(void *avcl, int level, const char *fmt,...)
const char * name
Name of the codec implementation.
AVFrame * avcodec_alloc_frame(void)
Allocate an AVFrame and set its fields to default values.
int bit_rate
the average bitrate
#define FF_PROFILE_AAC_LOW
#define FF_PROFILE_UNKNOWN
int frame_size
Samples per packet, initialized when calling 'init'.
int sample_rate
samples per second
main external API structure.
static void close(AVCodecParserContext *s)
#define CODEC_FLAG_QSCALE
Use fixed qscale.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define FF_PROFILE_AAC_SSR
void * av_malloc(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
#define CODEC_FLAG_GLOBAL_HEADER
Place global headers in extradata instead of every keyframe.
#define FF_INPUT_BUFFER_PADDING_SIZE
Required number of additionally allocated bytes at the end of the input bitstream for decoding...
int global_quality
Global quality for codecs which cannot change it per frame.
static const AVProfile profiles[]
AVSampleFormat
all in native-endian format
int cutoff
Audio cutoff bandwidth (0 means "automatic")
struct FaacAudioContext FaacAudioContext
int channels
number of audio channels
int key_frame
1 -> keyframe, 0-> not
#define FF_QP2LAMBDA
factor to convert from H.263 QP to lambda
#define CODEC_CAP_DELAY
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...