[FFmpeg-devel] [RFC] AAC Encoder

Diego Biurrun diego
Mon Aug 11 20:07:22 CEST 2008


On Mon, Aug 11, 2008 at 12:18:03PM +0300, Kostya wrote:
> Here's my implementation of AAC encoder.
> 
> --- libavcodec/aacenc.c	(revision 0)
> +++ libavcodec/aacenc.c	(revision 0)
> @@ -0,0 +1,729 @@
> +
> +/**
> + * Make AAC audio config object.
> + * @see 1.6.2.1

I think chapter names are preferred to numbers.

> +    if(ff_aac_psy_init(&s->psy, avctx, AAC_PSY_3GPP, aac_chan_configs[avctx->channels-1][0], 0, s->swb_sizes1024, s->swb_num1024, s->swb_sizes128, s->swb_num128) < 0){

Maybe you could break some of these loooong lines, same in other places.

> +/**
> + * Encode information about codebooks used for scalefactor bands coding.

I think you mean "band coding".

> +/**
> + * Write some auxiliary information about created AAC file.

about the

> +AVCodec aac_encoder = {
> +    "aac",
> +    CODEC_TYPE_AUDIO,
> +    CODEC_ID_AAC,
> +    sizeof(AACEncContext),
> +    aac_encode_init,
> +    aac_encode_frame,
> +    aac_encode_end,
> +    .capabilities = CODEC_CAP_SMALL_LAST_FRAME,

codec long name missing

> --- libavcodec/aacpsy.c	(revision 0)
> +++ libavcodec/aacpsy.c	(revision 0)
> @@ -0,0 +1,455 @@
> +
> +/**
> + * Produce integer coefficients from scalefactors provided by model.

by the

> --- libavcodec/aacpsy.h	(revision 0)
> +++ libavcodec/aacpsy.h	(revision 0)
> @@ -0,0 +1,145 @@
> +
> +enum AACPsyModelType{
> +    AAC_PSY_NULL,              ///< do nothing on frequencies
> +    AAC_PSY_NULL8,             ///< do nothing on frequencies but work with short windows

with frequencies

> +/**
> + * Cleanup model context at the end.
> + *
> + * @param ctx model context
> + */
> +void ff_aac_psy_end(AACPsyContext *ctx);
> +#endif /* FFMPEG_AACPSY_H */
> +

nit: This would look less cramped if you put the empty line before
instead of after the #endif.

Diego




More information about the ffmpeg-devel mailing list