[FFmpeg-devel] [PATCH] ALAC Encoder

Diego Biurrun diego
Sun Aug 17 12:35:24 CEST 2008


On Sun, Aug 17, 2008 at 04:14:43AM +0530, Jai Menon wrote:
> 
> The attached ALAC encoder was written as part of GSoC and mentored by Justin 
> Ruggles. I'm posting it for inclusion into FFmpeg-svn.

Build system part is OK, some comments and nits below.

> --- libavcodec/alacenc.c	(revision 0)
> +++ libavcodec/alacenc.c	(revision 0)
> @@ -0,0 +1,459 @@
> +
> +#define DEFAULT_FRAME_SIZE        4096
> +#define DEFAULT_SAMPLE_SIZE       16
> +#define MAX_CHANNELS              8
> +#define ALAC_EXTRADATA_SIZE       36
> +#define ALAC_FRAME_HEADER_SIZE    55
> +#define ALAC_FRAME_FOOTER_SIZE    3
> +
> +#define ALAC_ESCAPE_CODE          0x1FF
> +#define ALAC_MAX_LPC_ORDER        30
> +#define DEFAULT_MAX_PRED_ORDER    6
> +#define DEFAULT_MIN_PRED_ORDER    4
> +#define ALAC_MAX_LPC_PRECISION    9
> +#define ALAC_MAX_LPC_SHIFT        9

I think the constants would look better right-aligned.

> +    opt_order = ff_lpc_calc_coefs(&s->dspctx, s->sample_buf[ch], s->avctx->frame_size, DEFAULT_MIN_PRED_ORDER, DEFAULT_MAX_PRED_ORDER,
> +                                   ALAC_MAX_LPC_PRECISION, coefs, shift, 1, ORDER_METHOD_EST, ALAC_MAX_LPC_SHIFT, 1);

That's a looooooooooooooooooooong line.

> +    // generalised linear predictor

generaliZed

We speak international English around here ;-)

> +AVCodec alac_encoder = {
> +    "alac",
> +    .long_name = "ALAC (Apple Lossless Audio Codec)",

NULL_IF_CONFIG_SMALL

Diego




More information about the ffmpeg-devel mailing list