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

Michael Niedermayer michaelni
Fri May 1 15:44:09 CEST 2009


On Fri, May 01, 2009 at 01:49:37PM +0200, Laurent Aimar wrote:
>  The attached patch completes the support for files with INT32INFO chunk
> with non zero sent_bits.

[...]
> @@ -344,6 +348,7 @@ static inline int wv_unpack_stereo(WavpackContext *s, GetBitContext *gb, void *d
>      int A, B, L, L2, R, R2, bit;
>      int pos = 0;
>      uint32_t crc = 0xFFFFFFFF;
> +    uint32_t crc_extra = 0xFFFFFFFF;
>      int16_t *dst16 = dst;
>      int32_t *dst32 = dst;
>  

> @@ -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


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Many things microsoft did are stupid, but not doing something just because
microsoft did it is even more stupid. If everything ms did were stupid they
would be bankrupt already.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090501/bf6c915a/attachment.pgp>



More information about the ffmpeg-devel mailing list