[FFmpeg-devel] [PATCH] Added integer 32 bits support to wavpack

Laurent Aimar fenrir
Sat May 2 00:04:21 CEST 2009


On Fri, May 01, 2009, Michael Niedermayer wrote:
> > > > @@ -424,6 +429,18 @@ static inline int wv_unpack_stereo(WavpackContext *s, GetBitContext *gb, void *d
> > > >          if(s->joint)
> > > >              L += (R -= (L >> 1));
> > > >          crc = (crc * 3 + L) * 3 + R;
> > > > +        if(s->extra_bits){
> > > > +            L <<= s->extra_bits;
> > > > +            R <<= s->extra_bits;
> > > > +
> > > > +            if(s->got_extra){
> > > > +                L |= get_bits(&s->gb_extra, s->extra_bits);
> > > > +                crc_extra = crc_extra * 9 + (L&0xffff) * 3 + ((L>>16)&0xffff);
> > > 
> > > the second & can be avoided if the >> is unsigned
> >  Something like (uin32_t)L >> 16 (or (unsigned)L) ?
> 
> (unsigned)L
> if thats not correct then the int L is likely wrong too
> 
> 
> > 
> >  I think it is more obfuscated and it's the job of the compilo to remove
> > it if unneeded.
> 
> suggestions for better compilers are welcome ...
 For the record, gcc -S (Debian 4.3.3-3) does generate the exact same
assembly output files using either the 0xffff mask or the unsigned cast...

-- 
fenrir



More information about the ffmpeg-devel mailing list