Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Aug 28, 2024
Merged

Conversation

yotarok
Copy link
Owner

@yotarok yotarok commented Aug 28, 2024

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

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`
@yotarok yotarok merged commit d01448d into main Aug 28, 2024
5 checks passed
@yotarok yotarok deleted the fix_b24_b8 branch August 28, 2024 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant