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.