M2 fixtures: drop comments added by the migration; commit Cargo.lock with ec-testkit dev-dep edges
Browse files at this commit3627f59f6019cdbac6fbcfb6a183dbf30f37385cParent: d00c1d611 changed files +8 -42
- Cargo.lock +7 -0
- crates/ec-dts/tests/fate_vectors.rs +0 -2
- crates/ec-dts/tests/ffmpeg_exact.rs +0 -2
- crates/ec-flac/tests/xiph_vectors.rs +0 -2
- crates/ec-mp3/tests/mp2_matrix.rs +0 -1
- crates/ec-opus/tests/conformance.rs +1 -14
- crates/ec-pcm-ext/tests/oracle.rs +0 -1
- crates/ec-truehd/tests/it/atmos_synth.rs +0 -5
- crates/ec-truehd/tests/it/fixture_exact.rs +0 -6
- crates/ec-truehd/tests/it/library.rs +0 -3
- crates/ec-truehd/tests/it/oracle.rs +0 -6
Cargo.lockmodified+7 -0
| @@ -446,6 +446,7 @@ name = "ec-dts" | |||
| 446 | version = "0.1.0" | 446 | version = "0.1.0" |
| 447 | dependencies = [ | 447 | dependencies = [ |
| 448 | "ec-core", | 448 | "ec-core", |
| 449 | + "ec-testkit", | ||
| 449 | ] | 450 | ] |
| 450 | 451 | ||
| 451 | [[package]] | 452 | [[package]] |
| @@ -481,6 +482,7 @@ name = "ec-flac" | |||
| 481 | version = "0.1.0" | 482 | version = "0.1.0" |
| 482 | dependencies = [ | 483 | dependencies = [ |
| 483 | "ec-core", | 484 | "ec-core", |
| 485 | + "ec-testkit", | ||
| 484 | ] | 486 | ] |
| 485 | 487 | ||
| 486 | [[package]] | 488 | [[package]] |
| @@ -581,6 +583,7 @@ version = "0.1.0" | |||
| 581 | dependencies = [ | 583 | dependencies = [ |
| 582 | "ec-core", | 584 | "ec-core", |
| 583 | "ec-dsp", | 585 | "ec-dsp", |
| 586 | + "ec-testkit", | ||
| 584 | "wide", | 587 | "wide", |
| 585 | ] | 588 | ] |
| 586 | 589 | ||
| @@ -634,6 +637,7 @@ dependencies = [ | |||
| 634 | "ec-core", | 637 | "ec-core", |
| 635 | "ec-dsp", | 638 | "ec-dsp", |
| 636 | "ec-ogg", | 639 | "ec-ogg", |
| 640 | + "ec-testkit", | ||
| 637 | "rustfft", | 641 | "rustfft", |
| 638 | "tracking-allocator", | 642 | "tracking-allocator", |
| 639 | "wide", | 643 | "wide", |
| @@ -646,6 +650,7 @@ dependencies = [ | |||
| 646 | "ec-core", | 650 | "ec-core", |
| 647 | "ec-mp4", | 651 | "ec-mp4", |
| 648 | "ec-riff", | 652 | "ec-riff", |
| 653 | + "ec-testkit", | ||
| 649 | ] | 654 | ] |
| 650 | 655 | ||
| 651 | [[package]] | 656 | [[package]] |
| @@ -716,6 +721,7 @@ version = "0.1.0" | |||
| 716 | dependencies = [ | 721 | dependencies = [ |
| 717 | "ec-core", | 722 | "ec-core", |
| 718 | "ec-matroska", | 723 | "ec-matroska", |
| 724 | + "ec-testkit", | ||
| 719 | ] | 725 | ] |
| 720 | 726 | ||
| 721 | [[package]] | 727 | [[package]] |
| @@ -739,6 +745,7 @@ dependencies = [ | |||
| 739 | "ec-core", | 745 | "ec-core", |
| 740 | "ec-dsp", | 746 | "ec-dsp", |
| 741 | "ec-ogg", | 747 | "ec-ogg", |
| 748 | + "ec-testkit", | ||
| 742 | ] | 749 | ] |
| 743 | 750 | ||
| 744 | [[package]] | 751 | [[package]] |
crates/ec-dts/tests/fate_vectors.rsmodified+0 -2
| @@ -4,8 +4,6 @@ | |||
| 4 | //! kHz, alone and with XCH), the core inside XBR and XLL (DTS-HD) streams and | 4 | //! kHz, alone and with XCH), the core inside XBR and XLL (DTS-HD) streams and |
| 5 | //! a DTS-ES elementary stream. | 5 | //! a DTS-ES elementary stream. |
| 6 | //! | 6 | //! |
| 7 | -//! The samples live in `open/fate/dts` under the fixtures root; a missing one | ||
| 8 | -//! fails. | ||
| 9 | 7 | ||
| 10 | use std::path::Path; | 8 | use std::path::Path; |
| 11 | 9 | ||
crates/ec-dts/tests/ffmpeg_exact.rsmodified+0 -2
| @@ -6,8 +6,6 @@ | |||
| 6 | //! The fixtures are made with ffmpeg's own DTS encoder (`-c:a dca -strict | 6 | //! The fixtures are made with ffmpeg's own DTS encoder (`-c:a dca -strict |
| 7 | //! -2`): stereo and mono tones, a mono sweep at 32 kHz, 5.1 tones at 44.1 | 7 | //! -2`): stereo and mono tones, a mono sweep at 32 kHz, 5.1 tones at 44.1 |
| 8 | //! kHz and 5.1 noise with ADPCM at 48 kHz. Each is decoded here and by | 8 | //! kHz and 5.1 noise with ADPCM at 48 kHz. Each is decoded here and by |
| 9 | -//! ffmpeg and every 24-bit sample must be equal. A missing fixture or ffmpeg | ||
| 10 | -//! fails. | ||
| 11 | //! | 9 | //! |
| 12 | //! The 14-bit and little-endian stream layouts are derived from the same | 10 | //! The 14-bit and little-endian stream layouts are derived from the same |
| 13 | //! fixtures here and must decode to identical samples. | 11 | //! fixtures here and must decode to identical samples. |
crates/ec-flac/tests/xiph_vectors.rsmodified+0 -2
| @@ -5,8 +5,6 @@ | |||
| 5 | //! [`ec_flac::decode::DecodedStream::to_pcm_bytes`] writes) and the two buffers | 5 | //! [`ec_flac::decode::DecodedStream::to_pcm_bytes`] writes) and the two buffers |
| 6 | //! must be identical. Lossless codec, no tolerance. | 6 | //! must be identical. Lossless codec, no tolerance. |
| 7 | //! | 7 | //! |
| 8 | -//! The corpus is fetched by `scripts/fixtures.sh`; without it every test here | ||
| 9 | -//! fails. | ||
| 10 | //! | 8 | //! |
| 11 | //! Run the tables: | 9 | //! Run the tables: |
| 12 | //! cargo test -p ec-flac --release --test xiph_vectors -- --nocapture | 10 | //! cargo test -p ec-flac --release --test xiph_vectors -- --nocapture |
crates/ec-mp3/tests/mp2_matrix.rsmodified+0 -1
| @@ -6,7 +6,6 @@ | |||
| 6 | //! mode, the joint-stereo bound, CRC-protected frames and Layer I -- things no | 6 | //! mode, the joint-stereo bound, CRC-protected frames and Layer I -- things no |
| 7 | //! encoder here produces. The oracle is `ffmpeg -c:a mp2 -i x.mp2 -f f32le`. | 7 | //! encoder here produces. The oracle is `ffmpeg -c:a mp2 -i x.mp2 -f f32le`. |
| 8 | //! | 8 | //! |
| 9 | -//! ffmpeg is needed. | ||
| 10 | //! | 9 | //! |
| 11 | //! cargo test -p ec-mp3 --release --test mp2_matrix -- --nocapture | 10 | //! cargo test -p ec-mp3 --release --test mp2_matrix -- --nocapture |
| 12 | 11 | ||
crates/ec-opus/tests/conformance.rsmodified+1 -14
| @@ -2621,22 +2621,10 @@ fn hybrid_shapes_roundtrip() { | |||
| 2621 | assert!(toc.stereo); | 2621 | assert!(toc.stereo); |
| 2622 | } | 2622 | } |
| 2623 | 2623 | ||
| 2624 | -/// Self-contained regression guard for `opus_compare_err` / `opus_compare`. | ||
| 2625 | -/// | ||
| 2626 | -/// The pinned numbers below were cross-validated against the reference C | ||
| 2627 | -/// `opus_compare` tool (built from `opus_compare.c`) on byte-identical raw | ||
| 2628 | -/// PCM, so they encode the spectral error algorithm's expected output, not | ||
| 2629 | -/// any particular codec. Two cases: | ||
| 2630 | -/// * identical signals -> C err=0.000000, Q=100.0 (exact) | ||
| 2631 | -/// * mild perturbation -> C err=4.444987, Q=-593.31 (exact to 6 dp) | ||
| 2632 | -/// | ||
| 2633 | -/// The perturbation case sits in the practical error range (same band as the | ||
| 2634 | -/// real-audio validation pairs); the identical case pins the zero-error path | ||
| 2635 | -/// with no floating-point tolerance. No audio files or external tools needed. | ||
| 2636 | #[test] | 2624 | #[test] |
| 2637 | fn opus_compare_err_pinned_against_c() { | 2625 | fn opus_compare_err_pinned_against_c() { |
| 2638 | let _timing = timing_shared(); | 2626 | let _timing = timing_shared(); |
| 2639 | - const N: usize = 48000 * 4; // 4 s per channel | 2627 | + const N: usize = 48000 * 4; |
| 2640 | let t: Vec<f64> = (0..N).map(|i| i as f64 / 48000.0).collect(); | 2628 | let t: Vec<f64> = (0..N).map(|i| i as f64 / 48000.0).collect(); |
| 2641 | 2629 | ||
| 2642 | let base = |c: usize| -> Vec<f64> { | 2630 | let base = |c: usize| -> Vec<f64> { |
| @@ -2669,7 +2657,6 @@ fn opus_compare_err_pinned_against_c() { | |||
| 2669 | let b0 = base(0); | 2657 | let b0 = base(0); |
| 2670 | let b1 = base(1); | 2658 | let b1 = base(1); |
| 2671 | 2659 | ||
| 2672 | - // Case 1: identical -> zero error, Q=100 (exact, no tolerance). | ||
| 2673 | let a = stereo(&b0, &b1); | 2660 | let a = stereo(&b0, &b1); |
| 2674 | let err_id = opus_compare_err(&a, &a, 2); | 2661 | let err_id = opus_compare_err(&a, &a, 2); |
| 2675 | let q_id = opus_compare(&a, &a, 2); | 2662 | let q_id = opus_compare(&a, &a, 2); |
crates/ec-pcm-ext/tests/oracle.rsmodified+0 -1
| @@ -1,7 +1,6 @@ | |||
| 1 | //! Bit-exact oracle: fixtures are generated with ffmpeg from synthetic lavfi | 1 | //! Bit-exact oracle: fixtures are generated with ffmpeg from synthetic lavfi |
| 2 | //! sources, decoded here and by ffmpeg (`-f s16le`), and must match exactly. | 2 | //! sources, decoded here and by ffmpeg (`-f s16le`), and must match exactly. |
| 3 | //! | 3 | //! |
| 4 | -//! Needs ffmpeg; a missing one fails. | ||
| 5 | 4 | ||
| 6 | use std::fs::File; | 5 | use std::fs::File; |
| 7 | use std::io::BufReader; | 6 | use std::io::BufReader; |
crates/ec-truehd/tests/it/atmos_synth.rsmodified+0 -5
| @@ -1,7 +1,5 @@ | |||
| 1 | //! Atmos backward compatibility, tested on a synthetic 4-substream stream. | 1 | //! Atmos backward compatibility, tested on a synthetic 4-substream stream. |
| 2 | //! | 2 | //! |
| 3 | -//! The stream is built from the open 7.1 TrueHD sample's own access units (the | ||
| 4 | -//! first [`AUS`], 3 substreams each). For every access unit, | ||
| 5 | //! [`with_object_substream`] rebuilds it with a 4th directory entry: the | 3 | //! [`with_object_substream`] rebuilds it with a 4th directory entry: the |
| 6 | //! object-audio substream, here a run of [`FILLER_WORDS`] stand-in words | 4 | //! object-audio substream, here a run of [`FILLER_WORDS`] stand-in words |
| 7 | //! appended after substream 2's coded data. The rebuilt access unit is: | 5 | //! appended after substream 2's coded data. The rebuilt access unit is: |
| @@ -30,7 +28,6 @@ | |||
| 30 | //! `ffmpeg -f truehd -i <path> -f s32le` can be compared against this | 28 | //! `ffmpeg -f truehd -i <path> -f s32le` can be compared against this |
| 31 | //! decoder's output (ffmpeg decodes the same 8-channel presentation). | 29 | //! decoder's output (ffmpeg decodes the same 8-channel presentation). |
| 32 | //! | 30 | //! |
| 33 | -//! Needs `open/fate/truehd/atmos.thd`. | ||
| 34 | 31 | ||
| 35 | use std::path::Path; | 32 | use std::path::Path; |
| 36 | 33 | ||
| @@ -40,7 +37,6 @@ use ec_truehd::sync::AccessUnitHeader; | |||
| 40 | 37 | ||
| 41 | use crate::common::raw_access_units; | 38 | use crate::common::raw_access_units; |
| 42 | 39 | ||
| 43 | -/// Access units taken from the start of the sample: 1 s of 48 kHz audio, one | ||
| 44 | /// major sync among them. | 40 | /// major sync among them. |
| 45 | const AUS: usize = 1200; | 41 | const AUS: usize = 1200; |
| 46 | /// Length of the object-audio stand-in, in 16-bit words. | 42 | /// Length of the object-audio stand-in, in 16-bit words. |
| @@ -49,7 +45,6 @@ const FILLER_WORDS: u16 = 4; | |||
| 49 | const MAX_AU_WORDS: usize = 0x0FFF; | 45 | const MAX_AU_WORDS: usize = 0x0FFF; |
| 50 | const MAJOR_SYNC_LEN: usize = 28; | 46 | const MAJOR_SYNC_LEN: usize = 28; |
| 51 | 47 | ||
| 52 | -/// The first [`AUS`] access units of the open 7.1 TrueHD sample. | ||
| 53 | fn truehd_access_units() -> Vec<Vec<u8>> { | 48 | fn truehd_access_units() -> Vec<Vec<u8>> { |
| 54 | let data = | 49 | let data = |
| 55 | std::fs::read(ec_testkit::fixture("open/fate/truehd/atmos.thd")).expect("read atmos.thd"); | 50 | std::fs::read(ec_testkit::fixture("open/fate/truehd/atmos.thd")).expect("read atmos.thd"); |
crates/ec-truehd/tests/it/fixture_exact.rsmodified+0 -6
| @@ -1,14 +1,10 @@ | |||
| 1 | //! Sample-for-sample equality with ffmpeg's TrueHD decoder on the committed | 1 | //! Sample-for-sample equality with ffmpeg's TrueHD decoder on the committed |
| 2 | -//! fixtures in `crates/ec-truehd/fixtures/`, and on the open 7.1 sample | ||
| 3 | -//! `open/fate/truehd/atmos.thd`. | ||
| 4 | //! | 2 | //! |
| 5 | //! The committed fixtures are made with ffmpeg's own TrueHD encoder | 3 | //! The committed fixtures are made with ffmpeg's own TrueHD encoder |
| 6 | //! (`-c:a truehd -strict -2`): 2.0 and 5.1 at 16-bit (s16p input) and 24-bit | 4 | //! (`-c:a truehd -strict -2`): 2.0 and 5.1 at 16-bit (s16p input) and 24-bit |
| 7 | //! (s32p input), 48 kHz. The file name carries the channel count: `2ch` or `51`. | 5 | //! (s32p input), 48 kHz. The file name carries the channel count: `2ch` or `51`. |
| 8 | //! | 6 | //! |
| 9 | //! Each file is decoded here and by ffmpeg (`-f s32le`), and every sample must | 7 | //! Each file is decoded here and by ffmpeg (`-f s32le`), and every sample must |
| 10 | -//! be equal. Lossless decoding has no tolerance. A missing fixture or ffmpeg | ||
| 11 | -//! fails. | ||
| 12 | 8 | ||
| 13 | use std::fs::File; | 9 | use std::fs::File; |
| 14 | use std::io::BufReader; | 10 | use std::io::BufReader; |
| @@ -151,8 +147,6 @@ fn fixtures_are_bit_exact_against_ffmpeg() { | |||
| 151 | } | 147 | } |
| 152 | } | 148 | } |
| 153 | 149 | ||
| 154 | -/// The open 7.1 TrueHD sample, decoded from its raw access units and compared | ||
| 155 | -/// sample-for-sample with ffmpeg's decode of the whole file. | ||
| 156 | #[test] | 150 | #[test] |
| 157 | fn atmos_71_is_bit_exact_against_ffmpeg() { | 151 | fn atmos_71_is_bit_exact_against_ffmpeg() { |
| 158 | let path = ec_testkit::fixture("open/fate/truehd/atmos.thd"); | 152 | let path = ec_testkit::fixture("open/fate/truehd/atmos.thd"); |
crates/ec-truehd/tests/it/library.rsmodified+0 -3
| @@ -1,6 +1,3 @@ | |||
| 1 | -//! The open 7.1 TrueHD sample walked access unit by access unit: the units | ||
| 2 | -//! tile the file exactly and their count matches ffprobe's packet count. | ||
| 3 | - | ||
| 4 | use crate::common::raw_access_units; | 1 | use crate::common::raw_access_units; |
| 5 | 2 | ||
| 6 | #[test] | 3 | #[test] |
crates/ec-truehd/tests/it/oracle.rsmodified+0 -6
| @@ -1,9 +1,3 @@ | |||
| 1 | -//! Bit-exactness against an external decoder: the first 60 s of the open | ||
| 2 | -//! 7.1 TrueHD sample (3 substreams, noise type 1 matrices), and externally | ||
| 3 | -//! encoded MLP/TrueHD streams (mono, stereo, 5.1 pink noise — every codebook, | ||
| 4 | -//! matrices with the 2-channel noise generator, two substreams). Both need | ||
| 5 | -//! `ffmpeg`; a missing one fails. | ||
| 6 | - | ||
| 7 | use ec_truehd::{TrueHdDecoder, TrueHdEncoder, frame_length}; | 1 | use ec_truehd::{TrueHdDecoder, TrueHdEncoder, frame_length}; |
| 8 | 2 | ||
| 9 | use crate::common::raw_access_units; | 3 | use crate::common::raw_access_units; |