[FFmpeg-devel] [PATCH] libmp3lame: 32 bit encoding

Carl Eugen Hoyos cehoyos at ag.or.at
Sat Apr 16 11:22:42 CEST 2011


Peter Belkner <pbelkner <at> snafu.de> writes:

> the patch enables libmp3lame to encode at 32 bit. This is especially 
> useful if audio is fed from SoX (http://sox.sourceforge.net/) into 
> FFmpeg because SoX works at 32 bit and hence no additional 
> re-quantization is needed.

Does every supported lame version support 32bit encoding?

> +    if (AV_SAMPLE_FMT_S16 == avctx->sample_fmt) {
> +        s->s32_data.left = NULL;
> +        s->s32_data.right = NULL;

This looks unneeded.

> +    } else {
> +        s->s32_data.left = av_malloc(avctx->frame_size * sizeof(long));

And I suspect this is wrong. (long has different sizes on different platforms,
or am I wrong?)

> +        s->s32_data.right = av_malloc(avctx->frame_size * sizeof(long));

> +        if (NULL == s->s32_data.left || NULL == s->s32_data.right)
> +            return -1;

There is an error code for out_of_memory, please use it.

Carl Eugen



More information about the ffmpeg-devel mailing list