Reindent to four spaces
Add support for more than 8 bits per sample

It is C only, thus slower than with 8 bit input.
Add license