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

Correct MD5 sum calculation for non-whole byte bit depths #193

Merged
merged 1 commit into from Dec 22, 2022

Conversation

ktmf01
Copy link
Collaborator

@ktmf01 ktmf01 commented Nov 10, 2022

As suggested by Josh Coalson

@JeromeMartinez
Copy link
Collaborator

Doesn't it change the computing? I understand that with e.g. 10-bit 11 1111 0001 (decimal negative 15):

  • Before (zero padding): 0000 0011 1111 0001
  • After (sign extended): 1111 1111 1111 0001

I actually never handled content with non-whole byte bit depths, wondering what is the code in libflac.

@ktmf01
Copy link
Collaborator Author

ktmf01 commented Nov 10, 2022

Yes, it changes the computation. The problem is that what is in the current draft is wrong :)

It does make perfect sense though, because the sign extending keeps the value the same. With zero padding negative numbers become positive, with sign-extending the number remains -15 in your example.

Copy link
Collaborator

@JeromeMartinez JeromeMartinez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is that what is in the current draft is wrong :)

Good catch!

@retokromer retokromer merged commit e81fcd9 into ietf-wg-cellar:master Dec 22, 2022
@ktmf01 ktmf01 deleted the fix-md5sum-padding branch January 8, 2024 19:04
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.

None yet

3 participants