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

IETF test cases - 1 of 64 FAIL (63 of 64 PASS) in frame.TestFrameHash (decoding audio samples) #60

Closed
7 tasks done
mewmew opened this issue Oct 24, 2023 · 5 comments
Closed
7 tasks done
Labels

Comments

@mewmew
Copy link
Member

mewmew commented Oct 24, 2023

This issue is a follow-up on #54 (which handles FLAC stream decoding). In particular, this issue handles issues of FLAC audio sample decoding (e.g. mismatch between expected audio samples and decoded audio samples).

The IETF flac-test-files repository contains 64 FLAC files, published by @ktmf01, which help exercise corner cases of the FLAC decoder.

When adding these test cases to the test suite, 7 of 64 FLAC files resulted in audio sample decoding failures, namely:

    --- FAIL: TestFrameHash/../testdata/flac-test-files/subset/16_-_partition_order_8_containing_escaped_partitions.flac (0.05s)
    --- FAIL: TestFrameHash/../testdata/flac-test-files/subset/22_-_12_bit_per_sample.flac (3.24s)
    --- FAIL: TestFrameHash/../testdata/flac-test-files/subset/32_-_high_resolution_audio,_partition_order_8_containing_escaped_partitions.flac (0.14s)
    --- FAIL: TestFrameHash/../testdata/flac-test-files/subset/37_-_20_bit_per_sample.flac (11.43s)
    --- FAIL: TestFrameHash/../testdata/flac-test-files/subset/62_-_predictor_overflow_check,_20-bit.flac (1.63s)
    --- FAIL: TestFrameHash/../testdata/flac-test-files/subset/63_-_predictor_overflow_check,_24-bit.flac (0.01s)
    --- FAIL: TestFrameHash/../testdata/flac-test-files/subset/64_-_rice_partitions_with_escape_code_zero.flac (0.01s)

This issue tracks the resolution of the identified decoding issues.

  • 16_-_partition_order_8_containing_escaped_partitions.flac
  • 22_-_12_bit_per_sample.flac
  • 32_-_high_resolution_audio,_partition_order_8_containing_escaped_partitions.flac
  • 37_-_20_bit_per_sample.flac
  • 62_-_predictor_overflow_check,_20-bit.flac
  • 63_-_predictor_overflow_check,_24-bit.flac
  • 64_-_rice_partitions_with_escape_code_zero.flac

To reproduce, run:

go test -v github.com/mewkiz/flac/frame

Remember to initiate the submodule for IETF test cases in the testdata/flac-test-files directory:

git submodule update --init --recursive
mewmew added a commit that referenced this issue Oct 24, 2023
…and 20 bit)

This fixes IETF test cases 22, 37 and 62.

Updates #60.
@mewmew mewmew changed the title IETF test cases - 7 of 64 FAIL (57 of 64 PASS) in frame.TestFrameHash (decoding audio samples) IETF test cases - 4 of 64 FAIL (60 of 64 PASS) in frame.TestFrameHash (decoding audio samples) Oct 24, 2023
@mewmew
Copy link
Member Author

mewmew commented Oct 24, 2023

MD5 mismatches for decoded audio samples:

=== FAIL   TestFrameHash/../testdata/flac-test-files/subset/16_-_partition_order_8_containing_escaped_partitions.flac
MD5 checksum mismatch for decoded audio samples; expected d0e1313950dc04b749c53cd349251bed, got 1d1380204d7eb5b138fe884178e9b67d

=== FAIL   TestFrameHash/../testdata/flac-test-files/subset/32_-_high_resolution_audio,_partition_order_8_containing_escaped_partitions.flac
MD5 checksum mismatch for decoded audio samples; expected 88c57117179b46e784643de9f20c1917, got b7377fd70228aed730cbb00e55dbafab

=== FAIL   TestFrameHash/../testdata/flac-test-files/subset/63_-_predictor_overflow_check,_24-bit.flac
MD5 checksum mismatch for decoded audio samples; expected e4e4a6b3a672a849a3e2157c11ad23c6, got a0343afaaaa6229266d78ccf3175eb8d

=== FAIL   TestFrameHash/../testdata/flac-test-files/subset/64_-_rice_partitions_with_escape_code_zero.flac
MD5 checksum mismatch for decoded audio samples; expected 0885019a14d23a6759404c96f525a9d4, got ef5f7a4d27bd066acf31c7a68d5758df

@mewmew
Copy link
Member Author

mewmew commented Oct 24, 2023

mewkiz/flac audio samples for IETF test case subset/16 - ...flac
test_case_16_go

FLAC reference audio samples for IETF test case subset/16 - ...flac
test_case_16_ref

@mewmew mewmew added the bug label Oct 24, 2023
@mewmew mewmew changed the title IETF test cases - 4 of 64 FAIL (60 of 64 PASS) in frame.TestFrameHash (decoding audio samples) IETF test cases - 1 of 64 FAIL (63 of 64 PASS) in frame.TestFrameHash (decoding audio samples) Oct 24, 2023
@mewmew
Copy link
Member Author

mewmew commented Oct 24, 2023

The last remaining test case that's failing is 63 - predictor overflow check, 24-bit.flac.

mewkiz/flac audio samples for IETF test case subset/63 - ...flac
test_case_63_go

FLAC reference audio samples for IETF test case subset/63 - ...flac
test_case_63_ref

From the IETF test case README:

  • File 61, 62 and 63 are signals with rather extreme
    characteristics that might trigger overflow if a decoder
    uses 32-bit integers to calculate the predictor where 64-bit
    integers are appropriate

@mewmew
Copy link
Member Author

mewmew commented Oct 24, 2023

Fixed by @MarkKremer in #61.

@mewmew
Copy link
Member Author

mewmew commented Oct 24, 2023

(from: #61 (comment))

The v1.0.9 release has now been tagged.

Very happy to see that the audio samples of the IETF test cases are now correctly decoded by mewkiz/flac.

Cheerful regards,
Henry & Robin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant