[FFmpeg-devel] [PATCH] MLP/TrueHD decoder

Aurelien Jacobs aurel
Sun Oct 14 01:49:28 CEST 2007


On Fri, 12 Oct 2007 13:29:46 +0100
"Ian Caulfield" <ian.caulfield at gmail.com> wrote:

> Hi all,
> 
> I've been working for a while on reverse engineering the MLP audio
> stream format, and writing my own decoder. I've finally got to a point
> where I have something ready for review. I'm going to try to get the
> documentation I've produced on the format up on the multimediawiki as
> well.

Great.

> I've attached the code as two patches - the first adds a parser, the
> second the actual decoder.
> 
> +static inline int mlp_samplerate(int in)
> +{
> +    int rate;
> +
> +    if (in == 0xF)
> +        return 0;
> +
> +    if (in & 8)
> +        rate = 44100;
> +    else
> +        rate = 48000;
> +
> +    rate <<= in & 7;
> +
> +    return rate;
> +}

I would simplify this:
    if (in == 0xF)
        return 0;
    return (in & 8 ? 44100 : 48000) << (in & 7);

> +static int mlp_decode_end(AVCodecContext *avctx)
> +{
> +    return 0;
> +}

It does nothing, so remove it.

Aurel




More information about the ffmpeg-devel mailing list