yotarok / flacenc-rs

FLAC encoder written in Rust
Apache License 2.0
22 stars 3 forks source link

Fixed encoder error when encoding WAV 8/24-bit input. #216

Closed yotarok closed 2 months ago

yotarok commented 2 months ago

By specification, WAV file stores numbers in unsigned format with some offset values added when bits-per-sample is less than (or equal to) 8.

For 24-bit, some parser functions had assert-statement to verify bits_per_sample <= MAX_BITS_PER_SAMPLE that is 24. However, this assumption is wrong for SubFrames of side-channels.

For fixing this bug, this commits does:

  1. perform u8+offset to i8 in HoundSource.
  2. MD5 check is introduced to "flacenc-bin"
  3. integration test now can output intermediate file to a specified directory for debugging.
  4. a test added for arrayutils::le_bytes_to_i32s (found out not to be a bug of this function, though)
  5. changed assert-statement to check bits_per_sample <= MAX_BITS_PER_SAMPLE + 1