[FFmpeg-devel] [PATCH] Some cleanups for libavcodec/alac.c

Vitor Sessak vitor1001
Tue Jul 10 05:54:01 CEST 2007


Hi

Michael Niedermayer wrote:
> Hi
> 
> On Fri, Jul 06, 2007 at 03:18:45PM +0200, Vitor Sessak wrote:
>> Hi,
>>
>> These are my first patches to clean up the ALAC decoder. There are four 
>> of them:
>>
>> alac1.diff: Use proper bytestream functions
> 
> see below
> 
> 
>> alac2.diff: Port some useful comments from newest version on David 
>> Hammerton's page
> 
> ok

Applied.

> 
> 
>> alac3.diff: Remove some duplicated code
> 
> see below
> 
> 
>> alac4.diff: Prepare to remove more duplicated code (first chunk of 
>> Matthieu's patch)
> 
> ok (without the trailing whitespace)

I will apply this after alac3.diff to give revision history a logical 
sequence.

  > i think its safer to check the validity of setinfo_max_samples_per_frame
> before storing it into the struct
> also *ptr++ looks fine to me

I also like *ptr++, but I think to mix with bytestream_get_be?? it is 
slightly less clear than bytestream_put_byte. But I'm not radical about 
that. New patch attached.

> > -        /* 2^result = something to do with output waiting.
> > -         * perhaps matters if we read > 1 frame in a pass?
> > -         */
> > -        get_bits(&alac->gb, 4);
> >  
> > -        get_bits(&alac->gb, 12); /* unknown, skip 12 bits */
> > -        hassize = get_bits(&alac->gb, 1); /* the output sample size is stored soon */
> > -        wasted_bytes = get_bits(&alac->gb, 2); /* unknown ? */
> > +    /* 2^result = something to do with output waiting.
> > +     * perhaps matters if we read > 1 frame in a pass?
> > +     */
> > +    get_bits(&alac->gb, 4);
> > +    get_bits(&alac->gb, 12); /* unknown, skip 12 bits */
> > +    /* the output sample size is stored soon */
> > +    hassize = get_bits(&alac->gb, 1);
> >  
> > +    wasted_bytes = get_bits(&alac->gb, 2); /* unknown ? */
> cosmetic

Sorry, I thought that "don't mix cosmetical with functional" didn't 
apply when it would break indentation. Fixed in new patch.

-Vitor
-------------- next part --------------
A non-text attachment was scrubbed...
Name: alac1_2.diff
Type: text/x-patch
Size: 1999 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070710/a02529f1/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: alac3_2.diff
Type: text/x-patch
Size: 2959 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070710/a02529f1/attachment-0001.bin>



More information about the ffmpeg-devel mailing list