erikd/libsndfile — pull request #64 by mtolly (2014-05-07 03:20:49+00:00)
Title: Fix decoding of IMA4 AIFF-C, closes #2

This fixes a bug in decoding IMA4-compressed AIFF-C files. The predictor value used to decode each block is a 16-bit signed number stored in an `int` (because it can go outside the 16-bit range and is then clamped back into it), but it was not being sign-extended correctly, so a negative predictor became a positive `int`.

This is probably not my last commit in this area -- I've been dealing with this format for a bit and it appears Apple changed a detail of the decoding algorithm at some point in a sort-of-backwards-compatible way (see my contribution at http://sed.free.fr/aifc2wav.html), but this gets the "original" algorithm working.