forge
Explore
Log in

Don't you dare go Hollow

M2 fixtures: drop comments added by the migration; commit Cargo.lock with ec-testkit dev-dep edges

Browse files at this commit

3627f59f6019cdbac6fbcfb6a183dbf30f37385cAhmet Kaan GümüşParent: d00c1d6
Cargo.lockmodified+7 -0
@@ -446,6 +446,7 @@ name = "ec-dts"
446446 version = "0.1.0"
447447 dependencies = [
448448 "ec-core",
449+ "ec-testkit",
449450 ]
450451
451452 [[package]]
@@ -481,6 +482,7 @@ name = "ec-flac"
481482 version = "0.1.0"
482483 dependencies = [
483484 "ec-core",
485+ "ec-testkit",
484486 ]
485487
486488 [[package]]
@@ -581,6 +583,7 @@ version = "0.1.0"
581583 dependencies = [
582584 "ec-core",
583585 "ec-dsp",
586+ "ec-testkit",
584587 "wide",
585588 ]
586589
@@ -634,6 +637,7 @@ dependencies = [
634637 "ec-core",
635638 "ec-dsp",
636639 "ec-ogg",
640+ "ec-testkit",
637641 "rustfft",
638642 "tracking-allocator",
639643 "wide",
@@ -646,6 +650,7 @@ dependencies = [
646650 "ec-core",
647651 "ec-mp4",
648652 "ec-riff",
653+ "ec-testkit",
649654 ]
650655
651656 [[package]]
@@ -716,6 +721,7 @@ version = "0.1.0"
716721 dependencies = [
717722 "ec-core",
718723 "ec-matroska",
724+ "ec-testkit",
719725 ]
720726
721727 [[package]]
@@ -739,6 +745,7 @@ dependencies = [
739745 "ec-core",
740746 "ec-dsp",
741747 "ec-ogg",
748+ "ec-testkit",
742749 ]
743750
744751 [[package]]
crates/ec-dts/tests/fate_vectors.rsmodified+0 -2
@@ -4,8 +4,6 @@
44 //! kHz, alone and with XCH), the core inside XBR and XLL (DTS-HD) streams and
55 //! a DTS-ES elementary stream.
66 //!
7-//! The samples live in `open/fate/dts` under the fixtures root; a missing one
8-//! fails.
97
108 use std::path::Path;
119
crates/ec-dts/tests/ffmpeg_exact.rsmodified+0 -2
@@ -6,8 +6,6 @@
66 //! The fixtures are made with ffmpeg's own DTS encoder (`-c:a dca -strict
77 //! -2`): stereo and mono tones, a mono sweep at 32 kHz, 5.1 tones at 44.1
88 //! 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.
119 //!
1210 //! The 14-bit and little-endian stream layouts are derived from the same
1311 //! fixtures here and must decode to identical samples.
crates/ec-flac/tests/xiph_vectors.rsmodified+0 -2
@@ -5,8 +5,6 @@
55 //! [`ec_flac::decode::DecodedStream::to_pcm_bytes`] writes) and the two buffers
66 //! must be identical. Lossless codec, no tolerance.
77 //!
8-//! The corpus is fetched by `scripts/fixtures.sh`; without it every test here
9-//! fails.
108 //!
119 //! Run the tables:
1210 //! cargo test -p ec-flac --release --test xiph_vectors -- --nocapture
crates/ec-mp3/tests/mp2_matrix.rsmodified+0 -1
@@ -6,7 +6,6 @@
66 //! mode, the joint-stereo bound, CRC-protected frames and Layer I -- things no
77 //! encoder here produces. The oracle is `ffmpeg -c:a mp2 -i x.mp2 -f f32le`.
88 //!
9-//! ffmpeg is needed.
109 //!
1110 //! cargo test -p ec-mp3 --release --test mp2_matrix -- --nocapture
1211
crates/ec-opus/tests/conformance.rsmodified+1 -14
@@ -2621,22 +2621,10 @@ fn hybrid_shapes_roundtrip() {
26212621 assert!(toc.stereo);
26222622 }
26232623
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.
26362624 #[test]
26372625 fn opus_compare_err_pinned_against_c() {
26382626 let _timing = timing_shared();
2639- const N: usize = 48000 * 4; // 4 s per channel
2627+ const N: usize = 48000 * 4;
26402628 let t: Vec<f64> = (0..N).map(|i| i as f64 / 48000.0).collect();
26412629
26422630 let base = |c: usize| -> Vec<f64> {
@@ -2669,7 +2657,6 @@ fn opus_compare_err_pinned_against_c() {
26692657 let b0 = base(0);
26702658 let b1 = base(1);
26712659
2672- // Case 1: identical -> zero error, Q=100 (exact, no tolerance).
26732660 let a = stereo(&b0, &b1);
26742661 let err_id = opus_compare_err(&a, &a, 2);
26752662 let q_id = opus_compare(&a, &a, 2);
crates/ec-pcm-ext/tests/oracle.rsmodified+0 -1
@@ -1,7 +1,6 @@
11 //! Bit-exact oracle: fixtures are generated with ffmpeg from synthetic lavfi
22 //! sources, decoded here and by ffmpeg (`-f s16le`), and must match exactly.
33 //!
4-//! Needs ffmpeg; a missing one fails.
54
65 use std::fs::File;
76 use std::io::BufReader;
crates/ec-truehd/tests/it/atmos_synth.rsmodified+0 -5
@@ -1,7 +1,5 @@
11 //! Atmos backward compatibility, tested on a synthetic 4-substream stream.
22 //!
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,
53 //! [`with_object_substream`] rebuilds it with a 4th directory entry: the
64 //! object-audio substream, here a run of [`FILLER_WORDS`] stand-in words
75 //! appended after substream 2's coded data. The rebuilt access unit is:
@@ -30,7 +28,6 @@
3028 //! `ffmpeg -f truehd -i <path> -f s32le` can be compared against this
3129 //! decoder's output (ffmpeg decodes the same 8-channel presentation).
3230 //!
33-//! Needs `open/fate/truehd/atmos.thd`.
3431
3532 use std::path::Path;
3633
@@ -40,7 +37,6 @@ use ec_truehd::sync::AccessUnitHeader;
4037
4138 use crate::common::raw_access_units;
4239
43-/// Access units taken from the start of the sample: 1 s of 48 kHz audio, one
4440 /// major sync among them.
4541 const AUS: usize = 1200;
4642 /// Length of the object-audio stand-in, in 16-bit words.
@@ -49,7 +45,6 @@ const FILLER_WORDS: u16 = 4;
4945 const MAX_AU_WORDS: usize = 0x0FFF;
5046 const MAJOR_SYNC_LEN: usize = 28;
5147
52-/// The first [`AUS`] access units of the open 7.1 TrueHD sample.
5348 fn truehd_access_units() -> Vec<Vec<u8>> {
5449 let data =
5550 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 @@
11 //! 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`.
42 //!
53 //! The committed fixtures are made with ffmpeg's own TrueHD encoder
64 //! (`-c:a truehd -strict -2`): 2.0 and 5.1 at 16-bit (s16p input) and 24-bit
75 //! (s32p input), 48 kHz. The file name carries the channel count: `2ch` or `51`.
86 //!
97 //! 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.
128
139 use std::fs::File;
1410 use std::io::BufReader;
@@ -151,8 +147,6 @@ fn fixtures_are_bit_exact_against_ffmpeg() {
151147 }
152148 }
153149
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.
156150 #[test]
157151 fn atmos_71_is_bit_exact_against_ffmpeg() {
158152 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-
41 use crate::common::raw_access_units;
52
63 #[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-
71 use ec_truehd::{TrueHdDecoder, TrueHdEncoder, frame_length};
82
93 use crate::common::raw_access_units;