Merge branch 'batch-hygiene': serialize perf tests under nextest, manifest sentinel, cover-art fixtures, warning/name cleanup
Browse files at this commit49 changed files +167 -136
- .config/nextest.toml +18 -0
- crates/ec-aac/src/decode.rs +1 -1
- crates/ec-aac/src/sbr_chain.rs +8 -8
- crates/ec-aac/src/sbr_env.rs +4 -3
- crates/ec-aac/src/sbr_hf.rs +1 -1
- crates/ec-aac/src/sbr_payload.rs +0 -1
- crates/ec-aac/src/sbr_qmf.rs +6 -10
- crates/ec-ac3/src/aht.rs +1 -1
- crates/ec-ac3/src/aht_tables.rs +1 -1
- crates/ec-ac3/src/lib.rs +1 -1
- crates/ec-alac/src/decode.rs +3 -3
- crates/ec-alac/src/encode.rs +2 -2
- crates/ec-alac/src/lib.rs +6 -6
- crates/ec-core/src/color.rs +5 -5
- crates/ec-core/src/registry.rs +2 -2
- crates/ec-flac/src/decode.rs +5 -5
- crates/ec-flac/src/lib.rs +1 -1
- crates/ec-h264/src/enc/mod.rs +1 -1
- crates/ec-h264/src/enc/vlc.rs +2 -2
- crates/ec-h265-syntax/src/nal.rs +1 -1
- crates/ec-h265-syntax/src/sei.rs +1 -1
- crates/ec-h265/src/residual.rs +1 -1
- crates/ec-h265/src/transform.rs +1 -1
- crates/ec-hw/src/enc/headers.rs +1 -1
- crates/ec-matroska/src/demux.rs +2 -2
- crates/ec-mp3/src/decode.rs +1 -1
- crates/ec-mp3/src/encode.rs +9 -9
- crates/ec-mp3/src/huffman_tables.rs +1 -1
- crates/ec-mp3/src/lib.rs +2 -2
- crates/ec-mp3/src/window.rs +1 -1
- crates/ec-ogg/src/mux.rs +1 -1
- crates/ec-ogg/src/page.rs +1 -1
- crates/ec-opus/src/lib.rs +2 -2
- crates/ec-opus/src/silk_enc.rs +10 -10
- crates/ec-pgs/src/lib.rs +2 -2
- crates/ec-probe/src/decoder.rs +1 -1
- crates/ec-probe/src/lib.rs +12 -12
- crates/ec-probe/src/tags.rs +1 -1
- crates/ec-probe/tests/library.rs +5 -1
- crates/ec-riff/src/read.rs +1 -1
- crates/ec-riff/tests/wav.rs +3 -0
- crates/ec-va/src/display.rs +2 -2
- crates/ec-vorbis/src/encode.rs +26 -16
- scripts/gen-fixtures.sh +3 -0
- shims/opus-rs/src/lib.rs +3 -3
- shims/oxideav-ac3/src/lib.rs +2 -5
- shims/symphonia-core/src/codecs.rs +1 -1
- shims/symphonia-core/src/formats.rs +1 -1
- shims/symphonia/src/lib.rs +1 -1
.config/nextest.tomladded+18 -0
| @@ -0,0 +1,18 @@ | |||
| 1 | +# Keep wall-clock performance assertions from sharing CPUs with other nextest jobs. | ||
| 2 | +# These tests are regression tripwires, not throughput benchmarks under load. | ||
| 3 | + | ||
| 4 | +[[profile.default.overrides]] | ||
| 5 | +filter = 'package(ec-opus) & (test(decode_speed) | test(encode_speed))' | ||
| 6 | +threads-required = "num-test-threads" | ||
| 7 | + | ||
| 8 | +[[profile.default.overrides]] | ||
| 9 | +filter = 'package(ec-aac) & test(five_one_decodes_faster_than_realtime)' | ||
| 10 | +threads-required = "num-test-threads" | ||
| 11 | + | ||
| 12 | +[[profile.default.overrides]] | ||
| 13 | +filter = 'package(ec-h265) & (test(intra_1080p_beats_the_incumbent_on_twelve_threads) | test(ctb_32_is_the_faster_tree_at_1080p))' | ||
| 14 | +threads-required = "num-test-threads" | ||
| 15 | + | ||
| 16 | +[[profile.default.overrides]] | ||
| 17 | +filter = 'package(ec-hw) & (test(ten_bit_4k_frame_path_is_realtime) | test(p010_zero_copy_encode_is_realtime))' | ||
| 18 | +threads-required = "num-test-threads" | ||
crates/ec-aac/src/decode.rsmodified+1 -1
| @@ -27,7 +27,7 @@ const INTENSITY_HCB: u8 = 15; | |||
| 27 | const SF_OFFSET: i32 = 100; | 27 | const SF_OFFSET: i32 = 100; |
| 28 | /// The dequantiser works in the standard's own units, where full scale is | 28 | /// The dequantiser works in the standard's own units, where full scale is |
| 29 | /// 2^16; the public API speaks the usual +/-1 float range. Checked against a | 29 | /// 2^16; the public API speaks the usual +/-1 float range. Checked against a |
| 30 | -/// reference decode in `adts_fixtures_match_ffmpeg_per_channel`, which compares | 30 | +/// reference decode in `adts_fixtures_match_the oracle_per_channel`, which compares |
| 31 | /// amplitudes and not just shape. | 31 | /// amplitudes and not just shape. |
| 32 | pub(crate) const OUTPUT_SCALE: f32 = 1.0 / 65536.0; | 32 | pub(crate) const OUTPUT_SCALE: f32 = 1.0 / 65536.0; |
| 33 | /// The longest TNS filter AAC-LC allows (long blocks; short blocks stop at 7). | 33 | /// The longest TNS filter AAC-LC allows (long blocks; short blocks stop at 7). |
crates/ec-aac/src/sbr_chain.rsmodified+8 -8
| @@ -442,7 +442,7 @@ impl SbrChain { | |||
| 442 | qmfdump_energies("post_patch", tables.kx as usize, &hf); | 442 | qmfdump_energies("post_patch", tables.kx as usize, &hf); |
| 443 | } | 443 | } |
| 444 | let (env_energy, noise_energy) = | 444 | let (env_energy, noise_energy) = |
| 445 | - sbr_env::dequantize_frame(&header, &data.channels, ch, coupling); | 445 | + sbr_env::dequantize_frame(&data.channels, ch, coupling); |
| 446 | // sbr_env::adjust works in QMF-slot units; the parsed borders | 446 | // sbr_env::adjust works in QMF-slot units; the parsed borders |
| 447 | // are in the coarser envelope-time-slot units (see RATE above). | 447 | // are in the coarser envelope-time-slot units (see RATE above). |
| 448 | let scaled = SbrChannel { | 448 | let scaled = SbrChannel { |
| @@ -470,8 +470,8 @@ impl SbrChain { | |||
| 470 | v | 470 | v |
| 471 | }) | 471 | }) |
| 472 | .collect(); | 472 | .collect(); |
| 473 | - for m in 0..m_max { | 473 | + for (m, band) in hf.iter().enumerate().take(m_max) { |
| 474 | - state.hf_tail[m] = hf[m][num_slots.saturating_sub(HF_ADJ)..].to_vec(); | 474 | + state.hf_tail[m] = band[num_slots.saturating_sub(HF_ADJ)..].to_vec(); |
| 475 | } | 475 | } |
| 476 | sbr_env::adjust( | 476 | sbr_env::adjust( |
| 477 | &mut xh, | 477 | &mut xh, |
| @@ -490,12 +490,12 @@ impl SbrChain { | |||
| 490 | let i_temp = state.y_carry.first().map(Vec::len).unwrap_or(0).min(num_slots); | 490 | let i_temp = state.y_carry.first().map(Vec::len).unwrap_or(0).min(num_slots); |
| 491 | let t_end = (scaled.t_env.last().copied().unwrap_or(0).max(0) as usize).min(xh[0].len()); | 491 | let t_end = (scaled.t_env.last().copied().unwrap_or(0).max(0) as usize).min(xh[0].len()); |
| 492 | let mut hf: Vec<Vec<Complex<f64>>> = vec![vec![Complex::ZERO; num_slots]; m_max]; | 492 | let mut hf: Vec<Vec<Complex<f64>>> = vec![vec![Complex::ZERO; num_slots]; m_max]; |
| 493 | - for m in 0..m_max { | 493 | + for (m, band) in hf.iter_mut().enumerate().take(m_max) { |
| 494 | - for i in 0..i_temp { | 494 | + for (i, slot) in band.iter_mut().enumerate().take(i_temp) { |
| 495 | - hf[m][i] = state.y_carry[m][i]; | 495 | + *slot = state.y_carry[m][i]; |
| 496 | } | 496 | } |
| 497 | - for i in i_temp..num_slots { | 497 | + for (i, slot) in band.iter_mut().enumerate().take(num_slots).skip(i_temp) { |
| 498 | - hf[m][i] = xh[m][i]; | 498 | + *slot = xh[m][i]; |
| 499 | } | 499 | } |
| 500 | } | 500 | } |
| 501 | state.y_carry = (0..m_max) | 501 | state.y_carry = (0..m_max) |
crates/ec-aac/src/sbr_env.rsmodified+4 -3
| @@ -75,7 +75,6 @@ pub fn dequant_noise_pair(q0_raw: i32, pan_raw: i32) -> (f64, f64) { | |||
| 75 | /// de-mixing through [`dequant_pair`]/[`dequant_noise_pair`] when | 75 | /// de-mixing through [`dequant_pair`]/[`dequant_noise_pair`] when |
| 76 | /// `coupling` makes `channels[1]` a balance channel against `channels[0]`. | 76 | /// `coupling` makes `channels[1]` a balance channel against `channels[0]`. |
| 77 | pub fn dequantize_frame( | 77 | pub fn dequantize_frame( |
| 78 | - header: &SbrHeader, | ||
| 79 | channels: &[SbrChannel], | 78 | channels: &[SbrChannel], |
| 80 | ch: usize, | 79 | ch: usize, |
| 81 | coupling: bool, | 80 | coupling: bool, |
| @@ -173,7 +172,9 @@ fn noise_fraction_debug() -> bool { | |||
| 173 | std::env::var("EC_AAC_SBR_NOISE_FRACTION").is_ok() | 172 | std::env::var("EC_AAC_SBR_NOISE_FRACTION").is_ok() |
| 174 | } | 173 | } |
| 175 | 174 | ||
| 176 | -static NOISE_FRACTION: std::sync::OnceLock<std::sync::Mutex<Vec<(usize, f64, f64, f64)>>> = | 175 | +type NoiseFractionRows = Vec<(usize, f64, f64, f64)>; |
| 176 | + | ||
| 177 | +static NOISE_FRACTION: std::sync::OnceLock<std::sync::Mutex<NoiseFractionRows>> = | ||
| 177 | std::sync::OnceLock::new(); | 178 | std::sync::OnceLock::new(); |
| 178 | 179 | ||
| 179 | /// Diagnostic (`EC_AAC_SBR_NOISE_FRACTION`): per absolute QMF band, | 180 | /// Diagnostic (`EC_AAC_SBR_NOISE_FRACTION`): per absolute QMF band, |
| @@ -559,7 +560,7 @@ mod tests { | |||
| 559 | let e: f64 = hf[m].iter().map(|c| c.norm_sqr()).sum::<f64>() / slots as f64; | 560 | let e: f64 = hf[m].iter().map(|c| c.norm_sqr()).sum::<f64>() / slots as f64; |
| 560 | if m == mid { | 561 | if m == mid { |
| 561 | // S_M^2 = E_orig/(1+Q) = 4, boost capped at 1.5849^2 at most. | 562 | // S_M^2 = E_orig/(1+Q) = 4, boost capped at 1.5849^2 at most. |
| 562 | - assert!(e >= 4.0 - 1e-9 && e <= 4.0 * BOOST_MAX * BOOST_MAX + 1e-6, "mid {e}"); | 563 | + assert!((4.0 - 1e-9..=4.0 * BOOST_MAX * BOOST_MAX + 1e-6).contains(&e), "mid {e}"); |
| 563 | // Phase walks 0,90,180,270 degrees per slot. | 564 | // Phase walks 0,90,180,270 degrees per slot. |
| 564 | assert!((hf[m][0].re - hf[m][0].norm_sqr().sqrt()).abs() < 1e-9 && hf[m][1].re.abs() < 1e-9); | 565 | assert!((hf[m][0].re - hf[m][0].norm_sqr().sqrt()).abs() < 1e-9 && hf[m][1].re.abs() < 1e-9); |
| 565 | } else { | 566 | } else { |
crates/ec-aac/src/sbr_hf.rsmodified+1 -1
| @@ -153,7 +153,7 @@ pub fn build_patches(tables: &BandTables) -> Vec<Patch> { | |||
| 153 | } | 153 | } |
| 154 | last_k = k; | 154 | last_k = k; |
| 155 | last_msb = msb; | 155 | last_msb = msb; |
| 156 | - let mut odd = 0i64; | 156 | + let mut odd; |
| 157 | let mut i = k; | 157 | let mut i = k; |
| 158 | loop { | 158 | loop { |
| 159 | sb = fm[i]; | 159 | sb = fm[i]; |
crates/ec-aac/src/sbr_payload.rsmodified+0 -1
| @@ -650,7 +650,6 @@ impl SbrParser { | |||
| 650 | let mut channels = Vec::with_capacity(n_channels); | 650 | let mut channels = Vec::with_capacity(n_channels); |
| 651 | for ch in 0..n_channels { | 651 | for ch in 0..n_channels { |
| 652 | let balance = is_cpe && coupling && ch == 1; | 652 | let balance = is_cpe && coupling && ch == 1; |
| 653 | - let num_env = grids[ch].num_env; | ||
| 654 | let amp_res = amp_res_of(header.amp_res, &grids[ch]); | 653 | let amp_res = amp_res_of(header.amp_res, &grids[ch]); |
| 655 | let e_q = e_q_all[ch].clone(); | 654 | let e_q = e_q_all[ch].clone(); |
| 656 | let q_q = q_q_all[ch].clone(); | 655 | let q_q = q_q_all[ch].clone(); |
crates/ec-aac/src/sbr_qmf.rsmodified+6 -10
| @@ -82,9 +82,9 @@ impl QmfAnalysis64 { | |||
| 82 | let row = k * 128; | 82 | let row = k * 128; |
| 83 | let mut re = 0.0f64; | 83 | let mut re = 0.0f64; |
| 84 | let mut im = 0.0f64; | 84 | let mut im = 0.0f64; |
| 85 | - for n in 0..128 { | 85 | + for (n, &u_n) in u.iter().enumerate() { |
| 86 | - re += u[n] * self.cos_tab[row + n]; | 86 | + re += u_n * self.cos_tab[row + n]; |
| 87 | - im += u[n] * self.sin_tab[row + n]; | 87 | + im += u_n * self.sin_tab[row + n]; |
| 88 | } | 88 | } |
| 89 | *slot = Complex::new(re, im); | 89 | *slot = Complex::new(re, im); |
| 90 | } | 90 | } |
| @@ -160,9 +160,9 @@ impl Analysis { | |||
| 160 | for (k, slot) in out.iter_mut().enumerate() { | 160 | for (k, slot) in out.iter_mut().enumerate() { |
| 161 | let row = k * 64; | 161 | let row = k * 64; |
| 162 | let (mut re, mut im) = (0.0f64, 0.0f64); | 162 | let (mut re, mut im) = (0.0f64, 0.0f64); |
| 163 | - for n in 0..64 { | 163 | + for (n, &u_n) in u.iter().enumerate() { |
| 164 | - re += u[n] * self.cos_tab[row + n]; | 164 | + re += u_n * self.cos_tab[row + n]; |
| 165 | - im += u[n] * self.sin_tab[row + n]; | 165 | + im += u_n * self.sin_tab[row + n]; |
| 166 | } | 166 | } |
| 167 | *slot = Complex::new(re, im); | 167 | *slot = Complex::new(re, im); |
| 168 | } | 168 | } |
| @@ -512,10 +512,6 @@ mod tests { | |||
| 512 | /// checked against `f_calib(p) + (q-p)/256` (`1/256` being | 512 | /// checked against `f_calib(p) + (q-p)/256` (`1/256` being |
| 513 | /// `SYNTHESIS_BANDS`'s own `omega_step/(2*pi)` band spacing) rather than | 513 | /// `SYNTHESIS_BANDS`'s own `omega_step/(2*pi)` band spacing) rather than |
| 514 | /// a hand-derived absolute constant. | 514 | /// a hand-derived absolute constant. |
| 515 | - /// | ||
| 516 | - | ||
| 517 | - | ||
| 518 | - | ||
| 519 | /// (Round-43, Task 1 conviction) The tone-excitation gain above | 515 | /// (Round-43, Task 1 conviction) The tone-excitation gain above |
| 520 | /// (0.595853 amplitude / ~0.355 energy) was calibrated with a single | 516 | /// (0.595853 amplitude / ~0.355 energy) was calibrated with a single |
| 521 | /// SLOWLY ROTATING phasor -- narrowband within its own subband's | 517 | /// SLOWLY ROTATING phasor -- narrowband within its own subband's |
crates/ec-ac3/src/aht.rsmodified+1 -1
| @@ -150,7 +150,7 @@ pub(crate) fn read_channel( | |||
| 150 | fn idct6(x: &[f32; AHT_BLOCKS]) -> [f32; AHT_BLOCKS] { | 150 | fn idct6(x: &[f32; AHT_BLOCKS]) -> [f32; AHT_BLOCKS] { |
| 151 | // cos(j(2m+1)pi/12) for j, m in 0..6, with the 1/sqrt(2) weight on j = 0 | 151 | // cos(j(2m+1)pi/12) for j, m in 0..6, with the 1/sqrt(2) weight on j = 0 |
| 152 | // folded in. The leading factor is sqrt(2), not the 2 the standard's | 152 | // folded in. The leading factor is sqrt(2), not the 2 the standard's |
| 153 | - // printed equation shows: measured against ffmpeg's decode of a real DDP | 153 | + // printed equation shows: measured against the oracle's decode of a real DDP |
| 154 | // stream, a factor of 2 makes every AHT channel exactly sqrt(2) too loud | 154 | // stream, a factor of 2 makes every AHT channel exactly sqrt(2) too loud |
| 155 | // (per-frame RMS ratio 1.4142 across 3 649 frames). The radical is lost in | 155 | // (per-frame RMS ratio 1.4142 across 3 649 frames). The radical is lost in |
| 156 | // the published equation's typesetting. | 156 | // the published equation's typesetting. |
crates/ec-ac3/src/aht_tables.rsmodified+1 -1
| @@ -101,7 +101,7 @@ const VQ4_PRINTED: [[i16; 6]; 32] = [ | |||
| 101 | /// Table E4.4's index column is offset by one against its value rows: the | 101 | /// Table E4.4's index column is offset by one against its value rows: the |
| 102 | /// vector an encoder selects with index `k` is the row the document prints at | 102 | /// vector an encoder selects with index `k` is the row the document prints at |
| 103 | /// `k + 1`, and index 31 selects the all-zero vector, which the table does not | 103 | /// `k + 1`, and index 31 selects the all-zero vector, which the table does not |
| 104 | -/// print at all. Measured against ffmpeg's decode of a Dolby Digital Plus | 104 | +/// print at all. Measured against the oracle's decode of a Dolby Digital Plus |
| 105 | /// stream — every one of the 32 indices occurs there, and with the printed | 105 | /// stream — every one of the 32 indices occurs there, and with the printed |
| 106 | /// mapping only `hebap == 4` bins diverge (0.63% of a channel's energy), while | 106 | /// mapping only `hebap == 4` bins diverge (0.63% of a channel's energy), while |
| 107 | /// index 31 alone diverges by ten orders of magnitude. The other six tables | 107 | /// index 31 alone diverges by ten orders of magnitude. The other six tables |
crates/ec-ac3/src/lib.rsmodified+1 -1
| @@ -40,7 +40,7 @@ | |||
| 40 | //! gain-adaptive quantizers) and spectral extension are decoded; enhanced | 40 | //! gain-adaptive quantizers) and spectral extension are decoded; enhanced |
| 41 | //! coupling and dependent substreams above 5.1 are refused by name rather than | 41 | //! coupling and dependent substreams above 5.1 are refused by name rather than |
| 42 | //! decoded wrongly. On a real Dolby Digital Plus stream that uses both, the | 42 | //! decoded wrongly. On a real Dolby Digital Plus stream that uses both, the |
| 43 | -//! coded bins land within 0.01% of ffmpeg's energy and the whole channel within | 43 | +//! coded bins land within 0.01% of the oracle's energy and the whole channel within |
| 44 | //! 0.999 correlation once the two decoders' independent noise is taken out of | 44 | //! 0.999 correlation once the two decoders' independent noise is taken out of |
| 45 | //! the comparison ([`Options::dither`]). | 45 | //! the comparison ([`Options::dither`]). |
| 46 | //! | 46 | //! |
crates/ec-alac/src/decode.rsmodified+3 -3
| @@ -4,7 +4,7 @@ | |||
| 4 | //! Written from the published ALAC format description (element tags and frame | 4 | //! Written from the published ALAC format description (element tags and frame |
| 5 | //! header layout, the Golomb/Rice parameter adaptation with its zero-run mode, | 5 | //! header layout, the Golomb/Rice parameter adaptation with its zero-run mode, |
| 6 | //! the sign-adapting predictor and the mid/side un-mix). Nothing here is | 6 | //! the sign-adapting predictor and the mid/side un-mix). Nothing here is |
| 7 | -//! derived from Apple's decoder sources. | 7 | +//! derived from the reference decoder sources. |
| 8 | 8 | ||
| 9 | use crate::MagicCookie; | 9 | use crate::MagicCookie; |
| 10 | use ec_core::error::{Error, Result}; | 10 | use ec_core::error::{Error, Result}; |
| @@ -434,7 +434,7 @@ fn element( | |||
| 434 | ) -> Result<usize> { | 434 | ) -> Result<usize> { |
| 435 | let channels = 1 + usize::from(pair); | 435 | let channels = 1 + usize::from(pair); |
| 436 | // A 4-bit element instance tag and 12 reserved bits, zero in every stream | 436 | // A 4-bit element instance tag and 12 reserved bits, zero in every stream |
| 437 | - // measured here (mono and stereo fixtures from ffmpeg's encoder, whose | 437 | + // measured here (mono and stereo fixtures from the oracle's encoder, whose |
| 438 | // predictor plan starts at bit 39 of the frame — 3 tag + these 16 + the 4 | 438 | // predictor plan starts at bit 39 of the frame — 3 tag + these 16 + the 4 |
| 439 | // flags + the 16 mix bits below). | 439 | // flags + the 16 mix bits below). |
| 440 | bits.skip(16)?; | 440 | bits.skip(16)?; |
| @@ -587,5 +587,5 @@ fn interleave( | |||
| 587 | } | 587 | } |
| 588 | 588 | ||
| 589 | /// The largest frame this accepts, so a corrupt partial-frame length cannot ask | 589 | /// The largest frame this accepts, so a corrupt partial-frame length cannot ask |
| 590 | -/// for an allocation the file could not hold. Apple's encoder writes 4096. | 590 | +/// for an allocation the file could not hold. the reference encoder writes 4096. |
| 591 | const MAX_FRAME_SAMPLES: usize = 1 << 20; | 591 | const MAX_FRAME_SAMPLES: usize = 1 << 20; |
crates/ec-alac/src/encode.rsmodified+2 -2
| @@ -4,7 +4,7 @@ | |||
| 4 | //! `AlacDecoder::decode` expects. | 4 | //! `AlacDecoder::decode` expects. |
| 5 | //! | 5 | //! |
| 6 | //! Written from the published ALAC format description, same as `decode.rs`. | 6 | //! Written from the published ALAC format description, same as `decode.rs`. |
| 7 | -//! Nothing here is derived from Apple's encoder sources. | 7 | +//! Nothing here is derived from the reference encoder sources. |
| 8 | 8 | ||
| 9 | use crate::MagicCookie; | 9 | use crate::MagicCookie; |
| 10 | use ec_core::error::{Error, Result}; | 10 | use ec_core::error::{Error, Result}; |
| @@ -477,7 +477,7 @@ pub struct AlacEncoder { | |||
| 477 | impl AlacEncoder { | 477 | impl AlacEncoder { |
| 478 | /// An encoder for a mono or stereo stream. `bit_depth` is 16 or 24; | 478 | /// An encoder for a mono or stereo stream. `bit_depth` is 16 or 24; |
| 479 | /// `frame_length` is the samples-per-channel every full frame carries | 479 | /// `frame_length` is the samples-per-channel every full frame carries |
| 480 | - /// (Apple's own encoder writes 4096). | 480 | + /// (the reference own encoder writes 4096). |
| 481 | pub fn new(sample_rate: u32, channels: u8, bit_depth: u8, frame_length: u32) -> Result<AlacEncoder> { | 481 | pub fn new(sample_rate: u32, channels: u8, bit_depth: u8, frame_length: u32) -> Result<AlacEncoder> { |
| 482 | if !matches!(bit_depth, 16 | 24) { | 482 | if !matches!(bit_depth, 16 | 24) { |
| 483 | return Err(Error::unsupported( | 483 | return Err(Error::unsupported( |
crates/ec-alac/src/lib.rsmodified+6 -6
| @@ -1,4 +1,4 @@ | |||
| 1 | -//! Apple Lossless (ALAC) decoding for the edith_codecs family. | 1 | +//! ALAC (ALAC) decoding for the edith_codecs family. |
| 2 | //! | 2 | //! |
| 3 | //! Two ways in: | 3 | //! Two ways in: |
| 4 | //! | 4 | //! |
| @@ -15,9 +15,9 @@ | |||
| 15 | //! - [`AlacEncoder`], the mirror image: frames in, coded packets out, for a | 15 | //! - [`AlacEncoder`], the mirror image: frames in, coded packets out, for a |
| 16 | //! container that wants to write ALAC instead of read it. | 16 | //! container that wants to write ALAC instead of read it. |
| 17 | //! | 17 | //! |
| 18 | -//! **Clean room.** Written from the published ALAC format description; Apple's | 18 | +//! **Clean room.** Written from the published ALAC format description; the reference |
| 19 | //! decoder sources were not read. Samples are returned shifted into their PCM | 19 | //! decoder sources were not read. Samples are returned shifted into their PCM |
| 20 | -//! container the way ffmpeg's decoder returns them (16-bit as `s16`, 24-bit as | 20 | +//! container the way the oracle's decoder returns them (16-bit as `s16`, 24-bit as |
| 21 | //! `s32` with the low 8 bits zero), so raw output compares byte for byte. | 21 | //! `s32` with the low 8 bits zero), so raw output compares byte for byte. |
| 22 | 22 | ||
| 23 | #![forbid(unsafe_code)] | 23 | #![forbid(unsafe_code)] |
| @@ -38,7 +38,7 @@ use ec_core::registry::{AudioParameters, CodecId, CodecParameters, Decoder, Medi | |||
| 38 | /// in Matroska. | 38 | /// in Matroska. |
| 39 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] | 39 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] |
| 40 | pub struct MagicCookie { | 40 | pub struct MagicCookie { |
| 41 | - /// Samples per channel in a full frame (4096 from Apple's encoder). A | 41 | + /// Samples per channel in a full frame (4096 from the reference encoder). A |
| 42 | /// stream's last frame states its own shorter length. | 42 | /// stream's last frame states its own shorter length. |
| 43 | pub frame_length: u32, | 43 | pub frame_length: u32, |
| 44 | /// Bitstream version the file is compatible with; 0 is the only one. | 44 | /// Bitstream version the file is compatible with; 0 is the only one. |
| @@ -68,7 +68,7 @@ impl MagicCookie { | |||
| 68 | /// | 68 | /// |
| 69 | /// Accepts the three shapes those bytes arrive in: the bare 24-byte config, | 69 | /// Accepts the three shapes those bytes arrive in: the bare 24-byte config, |
| 70 | /// the config behind a four-byte version/flags word, and the whole `alac` | 70 | /// the config behind a four-byte version/flags word, and the whole `alac` |
| 71 | - /// box with its size and type in front (which is what ffmpeg and this | 71 | + /// box with its size and type in front (which is what the oracle and this |
| 72 | /// family's own mp4 demuxer hand over). | 72 | /// family's own mp4 demuxer hand over). |
| 73 | pub fn parse(data: &[u8]) -> Result<MagicCookie> { | 73 | pub fn parse(data: &[u8]) -> Result<MagicCookie> { |
| 74 | let at = match data { | 74 | let at = match data { |
| @@ -314,7 +314,7 @@ pub fn codec_parameters(cookie: &MagicCookie) -> CodecParameters { | |||
| 314 | mod tests { | 314 | mod tests { |
| 315 | use super::*; | 315 | use super::*; |
| 316 | 316 | ||
| 317 | - /// ffmpeg's 36-byte `alac` box, a bare 24-byte config and the 28-byte form | 317 | + /// the oracle's 36-byte `alac` box, a bare 24-byte config and the 28-byte form |
| 318 | /// in between all describe the same stream. | 318 | /// in between all describe the same stream. |
| 319 | #[test] | 319 | #[test] |
| 320 | fn a_magic_cookie_is_read_in_every_shape_a_container_states_it() { | 320 | fn a_magic_cookie_is_read_in_every_shape_a_container_states_it() { |
crates/ec-core/src/color.rsmodified+5 -5
| @@ -11,7 +11,7 @@ | |||
| 11 | //! 2. the **bitstream**'s: an H.264 or HEVC SPS VUI `colour_description`, an AV1 | 11 | //! 2. the **bitstream**'s: an H.264 or HEVC SPS VUI `colour_description`, an AV1 |
| 12 | //! sequence header `color_config`, which is what the *encoder* wrote and what | 12 | //! sequence header `color_config`, which is what the *encoder* wrote and what |
| 13 | //! survives a container that dropped its tags, | 13 | //! survives a container that dropped its tags, |
| 14 | -//! 3. the **resolution heuristic** ffmpeg and mpv both fall back to: a picture | 14 | +//! 3. the **resolution heuristic** the oracle and mpv both fall back to: a picture |
| 15 | //! 720 lines or taller is BT.709, anything smaller is BT.601, limited range | 15 | //! 720 lines or taller is BT.709, anything smaller is BT.601, limited range |
| 16 | //! either way. | 16 | //! either way. |
| 17 | //! | 17 | //! |
| @@ -126,7 +126,7 @@ impl ColorDescription { | |||
| 126 | pub fn resolve(container: Tags, bitstream: Tags, height: u32) -> Self { | 126 | pub fn resolve(container: Tags, bitstream: Tags, height: u32) -> Self { |
| 127 | let tags = container.over(bitstream); | 127 | let tags = container.over(bitstream); |
| 128 | Self { | 128 | Self { |
| 129 | - // The ffmpeg/mpv rule, and the reason it is a rule: an untagged | 129 | + // The the oracle/mpv rule, and the reason it is a rule: an untagged |
| 130 | // 1080p file is HD material and an untagged 480p one came off SD | 130 | // 1080p file is HD material and an untagged 480p one came off SD |
| 131 | // material, and guessing the other way is a visible green/magenta | 131 | // material, and guessing the other way is a visible green/magenta |
| 132 | // shift on faces. | 132 | // shift on faces. |
| @@ -163,7 +163,7 @@ impl ColorDescription { | |||
| 163 | /// and mp4's `colr` both index, so one answer serves both muxers. | 163 | /// and mp4's `colr` both index, so one answer serves both muxers. |
| 164 | pub fn codes(self) -> (u16, u16, u16) { | 164 | pub fn codes(self) -> (u16, u16, u16) { |
| 165 | // Primaries and the SDR curve travel with the matrix: a 709 file is | 165 | // Primaries and the SDR curve travel with the matrix: a 709 file is |
| 166 | - // 1/1/1 and an SD one 6/6/6 (SMPTE 170M), which is what ffmpeg writes | 166 | + // 1/1/1 and an SD one 6/6/6 (SMPTE 170M), which is what the oracle writes |
| 167 | // for each and what a player expects to see together. | 167 | // for each and what a player expects to see together. |
| 168 | let (primaries, sdr_transfer, matrix) = match self.matrix { | 168 | let (primaries, sdr_transfer, matrix) = match self.matrix { |
| 169 | Matrix::Bt709 => (1, 1, 1), | 169 | Matrix::Bt709 => (1, 1, 1), |
| @@ -291,7 +291,7 @@ impl ContentLight { | |||
| 291 | /// | 291 | /// |
| 292 | /// The chromaticities are read past: what a tone map wants is the luminance | 292 | /// The chromaticities are read past: what a tone map wants is the luminance |
| 293 | /// pair, and the display's gamut is not something this family acts on. A zero | 293 | /// pair, and the display's gamut is not something this family acts on. A zero |
| 294 | -/// luminance is "not stated", which is what ffmpeg writes when it has nothing — | 294 | +/// luminance is "not stated", which is what the oracle writes when it has nothing — |
| 295 | /// believing it would tell a tone map the film peaks at black. | 295 | /// believing it would tell a tone map the film peaks at black. |
| 296 | pub fn mdcv(payload: &[u8]) -> ContentLight { | 296 | pub fn mdcv(payload: &[u8]) -> ContentLight { |
| 297 | let luminance = |at: usize| -> Option<f32> { | 297 | let luminance = |at: usize| -> Option<f32> { |
| @@ -1226,7 +1226,7 @@ mod tests { | |||
| 1226 | } | 1226 | } |
| 1227 | 1227 | ||
| 1228 | /// A High-profile SPS written by hand, because no encoder in this family | 1228 | /// A High-profile SPS written by hand, because no encoder in this family |
| 1229 | - /// writes one with its scaling lists in the *sequence* parameter set (x264 | 1229 | + /// writes one with its scaling lists in the *sequence* parameter set (the external encoder |
| 1230 | /// puts its quant matrices in the PPS). The lists are what makes this test | 1230 | /// puts its quant matrices in the PPS). The lists are what makes this test |
| 1231 | /// worth having: read as if they were not there, the VUI lands | 1231 | /// worth having: read as if they were not there, the VUI lands |
| 1232 | /// mid-coefficient and the colour comes out as noise. | 1232 | /// mid-coefficient and the colour comes out as noise. |
crates/ec-core/src/registry.rsmodified+2 -2
| @@ -42,7 +42,7 @@ pub enum CodecId { | |||
| 42 | TrueHd, | 42 | TrueHd, |
| 43 | /// DTS and its extensions (DTS-HD, DTS:X). | 43 | /// DTS and its extensions (DTS-HD, DTS:X). |
| 44 | Dts, | 44 | Dts, |
| 45 | - /// Apple Lossless. | 45 | + /// ALAC. |
| 46 | Alac, | 46 | Alac, |
| 47 | /// Xiph FLAC. | 47 | /// Xiph FLAC. |
| 48 | Flac, | 48 | Flac, |
| @@ -239,7 +239,7 @@ pub struct StreamInfo { | |||
| 239 | pub duration: Option<i64>, | 239 | pub duration: Option<i64>, |
| 240 | /// ISO 639-2 language tag, when the container carries one. | 240 | /// ISO 639-2 language tag, when the container carries one. |
| 241 | pub language: Option<String>, | 241 | pub language: Option<String>, |
| 242 | - /// Samples the decoder emits before the first audible one: an MP3's LAME | 242 | + /// Samples the decoder emits before the first audible one: an MP3's gapless |
| 243 | /// encoder delay, an Opus stream's pre-skip. Zero where a stream has none. | 243 | /// encoder delay, an Opus stream's pre-skip. Zero where a stream has none. |
| 244 | /// | 244 | /// |
| 245 | /// It is *not* subtracted from [`duration`](Self::duration), because a | 245 | /// It is *not* subtracted from [`duration`](Self::duration), because a |
crates/ec-flac/src/decode.rsmodified+5 -5
| @@ -181,7 +181,7 @@ impl Block { | |||
| 181 | } | 181 | } |
| 182 | 182 | ||
| 183 | /// The block interleaved into one buffer, samples shifted left so they fill | 183 | /// The block interleaved into one buffer, samples shifted left so they fill |
| 184 | - /// a 16- or 32-bit container the way ffmpeg and every mixer expect | 184 | + /// a 16- or 32-bit container the way the oracle and every mixer expect |
| 185 | /// (`s16` for depths up to 16, `s32` above). | 185 | /// (`s16` for depths up to 16, `s32` above). |
| 186 | pub fn to_interleaved(&self, shift: u32) -> Vec<i32> { | 186 | pub fn to_interleaved(&self, shift: u32) -> Vec<i32> { |
| 187 | let channels = self.channels.len(); | 187 | let channels = self.channels.len(); |
| @@ -197,7 +197,7 @@ impl Block { | |||
| 197 | } | 197 | } |
| 198 | 198 | ||
| 199 | /// Bits the samples of a `bits_per_sample` stream are shifted left by to fill | 199 | /// Bits the samples of a `bits_per_sample` stream are shifted left by to fill |
| 200 | -/// their PCM container — the convention ffmpeg's decoder uses, so raw output | 200 | +/// their PCM container — the convention the oracle's decoder uses, so raw output |
| 201 | /// compares byte for byte. | 201 | /// compares byte for byte. |
| 202 | pub fn container_shift(bits_per_sample: u32) -> u32 { | 202 | pub fn container_shift(bits_per_sample: u32) -> u32 { |
| 203 | match bits_per_sample <= 16 { | 203 | match bits_per_sample <= 16 { |
| @@ -484,7 +484,7 @@ impl DecodedStream { | |||
| 484 | 484 | ||
| 485 | /// Interleaved samples shifted into their PCM container, as raw bytes: | 485 | /// Interleaved samples shifted into their PCM container, as raw bytes: |
| 486 | /// `s16le` for depths up to 16 bits, `s32le` above. This is exactly what | 486 | /// `s16le` for depths up to 16 bits, `s32le` above. This is exactly what |
| 487 | - /// `ffmpeg -f s16le/-f s32le` writes for the same file. | 487 | + /// `the oracle -f s16le/-f s32le` writes for the same file. |
| 488 | pub fn to_pcm_bytes(&self) -> Vec<u8> { | 488 | pub fn to_pcm_bytes(&self) -> Vec<u8> { |
| 489 | let shift = container_shift(self.bits_per_sample); | 489 | let shift = container_shift(self.bits_per_sample); |
| 490 | let narrow = self.bits_per_sample <= 16; | 490 | let narrow = self.bits_per_sample <= 16; |
| @@ -673,7 +673,7 @@ fn decode_subframe( | |||
| 673 | if bps > 32 { | 673 | if bps > 32 { |
| 674 | // Only a 32-bit stream that also decorrelates its stereo pair gets | 674 | // Only a 32-bit stream that also decorrelates its stereo pair gets |
| 675 | // here: its side channel needs 33 bits, which does not fit the i32 | 675 | // here: its side channel needs 33 bits, which does not fit the i32 |
| 676 | - // sample planes this decoder (and ffmpeg's, and libFLAC's encoder) | 676 | + // sample planes this decoder (and the oracle's, and the reference encoder's encoder) |
| 677 | // works in. Named rather than mangled. | 677 | // works in. Named rather than mangled. |
| 678 | return Err(Error::unsupported( | 678 | return Err(Error::unsupported( |
| 679 | "33-bit side subframe", | 679 | "33-bit side subframe", |
| @@ -957,7 +957,7 @@ mod tests { | |||
| 957 | } | 957 | } |
| 958 | 958 | ||
| 959 | #[test] | 959 | #[test] |
| 960 | - fn container_shift_matches_ffmpeg_layout() { | 960 | + fn container_shift_matches_reference_layout() { |
| 961 | assert_eq!(container_shift(8), 8); | 961 | assert_eq!(container_shift(8), 8); |
| 962 | assert_eq!(container_shift(12), 4); | 962 | assert_eq!(container_shift(12), 4); |
| 963 | assert_eq!(container_shift(16), 0); | 963 | assert_eq!(container_shift(16), 0); |
crates/ec-flac/src/lib.rsmodified+1 -1
| @@ -12,7 +12,7 @@ | |||
| 12 | //! Decoded samples keep their own bit depth in [`decode::Block`] and | 12 | //! Decoded samples keep their own bit depth in [`decode::Block`] and |
| 13 | //! [`decode::DecodedStream`]; the PCM views ([`decode::DecodedStream::to_pcm_bytes`], | 13 | //! [`decode::DecodedStream`]; the PCM views ([`decode::DecodedStream::to_pcm_bytes`], |
| 14 | //! [`FlacDecoder`]) shift them left into an `s16`/`s32` container the way | 14 | //! [`FlacDecoder`]) shift them left into an `s16`/`s32` container the way |
| 15 | -//! ffmpeg and the family's mixer expect. | 15 | +//! the oracle and the family's mixer expect. |
| 16 | //! | 16 | //! |
| 17 | //! Nothing here panics on malformed input: truncation is `NeedMore`, a broken | 17 | //! Nothing here panics on malformed input: truncation is `NeedMore`, a broken |
| 18 | //! stream is `Corrupt`, and both CRCs are checked on every frame. | 18 | //! stream is `Corrupt`, and both CRCs are checked on every frame. |
crates/ec-h264/src/enc/mod.rsmodified+1 -1
| @@ -263,7 +263,7 @@ impl Encoder { | |||
| 263 | 263 | ||
| 264 | /// The reconstruction of the last coded picture, cropped, as I420 planes. | 264 | /// The reconstruction of the last coded picture, cropped, as I420 planes. |
| 265 | /// This is what a conformant decoder produces for that picture — the tests | 265 | /// This is what a conformant decoder produces for that picture — the tests |
| 266 | - /// compare it against this crate's decoder and against ffmpeg. | 266 | + /// compare it against this crate's decoder and against the oracle. |
| 267 | pub fn reconstruction(&self) -> Option<(Vec<u8>, Vec<u8>, Vec<u8>)> { | 267 | pub fn reconstruction(&self) -> Option<(Vec<u8>, Vec<u8>, Vec<u8>)> { |
| 268 | if !self.have_reference { | 268 | if !self.have_reference { |
| 269 | return None; | 269 | return None; |
crates/ec-h264/src/enc/vlc.rsmodified+2 -2
| @@ -266,8 +266,8 @@ mod tests { | |||
| 266 | } | 266 | } |
| 267 | let mut w = BitWriter::new(); | 267 | let mut w = BitWriter::new(); |
| 268 | let mut tcs = [0u8; 4]; | 268 | let mut tcs = [0u8; 4]; |
| 269 | - for j in 0..4 { | 269 | + for (j, tc) in tcs.iter_mut().enumerate() { |
| 270 | - tcs[j] = write_residual_block( | 270 | + *tc = write_residual_block( |
| 271 | &mut w, | 271 | &mut w, |
| 272 | &super::super::entropy::sub_block_4x4(&c8, j), | 272 | &super::super::entropy::sub_block_4x4(&c8, j), |
| 273 | 16, | 273 | 16, |
crates/ec-h265-syntax/src/nal.rsmodified+1 -1
| @@ -198,7 +198,7 @@ pub fn unescape_rbsp(payload: &[u8]) -> Vec<u8> { | |||
| 198 | /// Append one Annex-B NAL unit: start code, header, escaped RBSP. | 198 | /// Append one Annex-B NAL unit: start code, header, escaped RBSP. |
| 199 | /// | 199 | /// |
| 200 | /// The four-byte start code is used for parameter sets and the first slice of a | 200 | /// The four-byte start code is used for parameter sets and the first slice of a |
| 201 | -/// picture, three bytes elsewhere — the same shape ffmpeg writes, and what a | 201 | +/// picture, three bytes elsewhere — the same shape the oracle writes, and what a |
| 202 | /// caller splitting an access unit back apart expects. | 202 | /// caller splitting an access unit back apart expects. |
| 203 | pub fn write_annex_b(out: &mut Vec<u8>, header: NalHeader, rbsp: &[u8], long_start_code: bool) { | 203 | pub fn write_annex_b(out: &mut Vec<u8>, header: NalHeader, rbsp: &[u8], long_start_code: bool) { |
| 204 | if long_start_code { | 204 | if long_start_code { |
crates/ec-h265-syntax/src/sei.rsmodified+1 -1
| @@ -47,7 +47,7 @@ fn sei_rbsp(messages: &[(u32, Vec<u8>)]) -> Vec<u8> { | |||
| 47 | /// is nothing to say. | 47 | /// is nothing to say. |
| 48 | /// | 48 | /// |
| 49 | /// Both messages are written whole or not at all: a `mastering_display_colour_volume` | 49 | /// Both messages are written whole or not at all: a `mastering_display_colour_volume` |
| 50 | -/// with a zero luminance pair is what ffmpeg writes when it knows nothing, and a | 50 | +/// with a zero luminance pair is what the oracle writes when it knows nothing, and a |
| 51 | /// tone map that believes it maps the film to black. | 51 | /// tone map that believes it maps the film to black. |
| 52 | pub fn hdr_metadata_rbsp(light: ContentLight) -> Option<Vec<u8>> { | 52 | pub fn hdr_metadata_rbsp(light: ContentLight) -> Option<Vec<u8>> { |
| 53 | let mut messages = Vec::new(); | 53 | let mut messages = Vec::new(); |
crates/ec-h265/src/residual.rsmodified+1 -1
| @@ -479,7 +479,7 @@ mod tests { | |||
| 479 | 479 | ||
| 480 | #[test] | 480 | #[test] |
| 481 | fn residual_coding_costs_less_for_sparser_blocks() { | 481 | fn residual_coding_costs_less_for_sparser_blocks() { |
| 482 | - // Not a bit-exactness check — that is the ffmpeg conformance test — but | 482 | + // Not a bit-exactness check — that is the the oracle conformance test — but |
| 483 | // the invariant that makes rate-distortion decisions meaningful: fewer | 483 | // the invariant that makes rate-distortion decisions meaningful: fewer |
| 484 | // and smaller levels must cost fewer bits. | 484 | // and smaller levels must cost fewer bits. |
| 485 | let mut sparse = vec![0i32; 64]; | 485 | let mut sparse = vec![0i32; 64]; |
crates/ec-h265/src/transform.rsmodified+1 -1
| @@ -5,7 +5,7 @@ | |||
| 5 | //! conformant decoder produces. The forward path and the quantizer are the | 5 | //! conformant decoder produces. The forward path and the quantizer are the |
| 6 | //! encoder's own choice; what makes them correct is that they invert the | 6 | //! encoder's own choice; what makes them correct is that they invert the |
| 7 | //! normative path — which is what [`tests::round_trip_recovers_flat_blocks`] | 7 | //! normative path — which is what [`tests::round_trip_recovers_flat_blocks`] |
| 8 | -//! and the ffmpeg conformance test in `tests/` check. | 8 | +//! and the the oracle conformance test in `tests/` check. |
| 9 | //! | 9 | //! |
| 10 | //! One transcription safeguard is worth naming: only the first 16 columns of the | 10 | //! One transcription safeguard is worth naming: only the first 16 columns of the |
| 11 | //! 32x32 matrix are typed in. The rest follow from `M[m][31 - n] = (-1)^m M[m][n]`, | 11 | //! 32x32 matrix are typed in. The rest follow from `M[m][31 - n] = (-1)^m M[m][n]`, |
crates/ec-hw/src/enc/headers.rsmodified+1 -1
| @@ -4,7 +4,7 @@ | |||
| 4 | //! This is not optional plumbing. radeonsi advertises | 4 | //! This is not optional plumbing. radeonsi advertises |
| 5 | //! `VA_ENC_PACKED_HEADER_SEQUENCE | PICTURE | SLICE` and then writes none of | 5 | //! `VA_ENC_PACKED_HEADER_SEQUENCE | PICTURE | SLICE` and then writes none of |
| 6 | //! them itself: without these, the coded buffer comes back holding slice data | 6 | //! them itself: without these, the coded buffer comes back holding slice data |
| 7 | -//! with no parameter sets in front of it — a stream ffmpeg answers with | 7 | +//! with no parameter sets in front of it — a stream the oracle answers with |
| 8 | //! "Invalid data found when processing input" (measured, 2026-08-14). Every | 8 | //! "Invalid data found when processing input" (measured, 2026-08-14). Every |
| 9 | //! field below therefore has to agree with the `VAEnc*ParameterBuffer` the | 9 | //! field below therefore has to agree with the `VAEnc*ParameterBuffer` the |
| 10 | //! driver was given, or the header describes a picture other than the one the | 10 | //! driver was given, or the header describes a picture other than the one the |
crates/ec-matroska/src/demux.rsmodified+2 -2
| @@ -1173,7 +1173,7 @@ fn parse_tracks( | |||
| 1173 | let mut light = ContentLight::default(); | 1173 | let mut light = ContentLight::default(); |
| 1174 | let (mut rate, mut channels, mut bits) = (0f64, 0u64, 0u64); | 1174 | let (mut rate, mut channels, mut bits) = (0f64, 0u64, 0u64); |
| 1175 | // `CodecDelay`, nanoseconds: an AAC/Opus encoder's priming, the same | 1175 | // `CodecDelay`, nanoseconds: an AAC/Opus encoder's priming, the same |
| 1176 | - // samples-before-the-first-audible-one an mp4's `elst` or an mp3's LAME | 1176 | + // samples-before-the-first-audible-one an mp4's `elst` or an mp3's gapless |
| 1177 | // tag states — converted to a sample count once the track's own rate | 1177 | // tag states — converted to a sample count once the track's own rate |
| 1178 | // is known, below. | 1178 | // is known, below. |
| 1179 | let mut delay_ns = 0u64; | 1179 | let mut delay_ns = 0u64; |
| @@ -1564,7 +1564,7 @@ mod tests { | |||
| 1564 | out | 1564 | out |
| 1565 | } | 1565 | } |
| 1566 | 1566 | ||
| 1567 | - /// A file with the three things nothing generated by ffmpeg carries: a | 1567 | + /// A file with the three things nothing generated by the oracle carries: a |
| 1568 | /// zlib track, a header-stripped track, and one block of each lacing. | 1568 | /// zlib track, a header-stripped track, and one block of each lacing. |
| 1569 | fn synthetic() -> Vec<u8> { | 1569 | fn synthetic() -> Vec<u8> { |
| 1570 | let mut header = Vec::new(); | 1570 | let mut header = Vec::new(); |
crates/ec-mp3/src/decode.rsmodified+1 -1
| @@ -656,7 +656,7 @@ impl Mp3Decode { | |||
| 656 | } | 656 | } |
| 657 | } | 657 | } |
| 658 | 658 | ||
| 659 | -/// Turns a byte stream into frames: skips ID3v2 and the Xing/LAME/VBRI header | 659 | +/// Turns a byte stream into frames: skips ID3v2 and the Xing/gapless/VBRI header |
| 660 | /// frame, resyncs over junk, and holds partial data until the rest arrives. | 660 | /// frame, resyncs over junk, and holds partial data until the rest arrives. |
| 661 | #[derive(Debug, Default)] | 661 | #[derive(Debug, Default)] |
| 662 | pub struct Mp3Reader { | 662 | pub struct Mp3Reader { |
crates/ec-mp3/src/encode.rsmodified+9 -9
| @@ -383,28 +383,28 @@ const PRIMING: usize = 1152; | |||
| 383 | /// its input and the MDCT one granule behind that, less what the decoder's | 383 | /// its input and the MDCT one granule behind that, less what the decoder's |
| 384 | /// synthesis gives back. Measured end to end (encode, decode, | 384 | /// synthesis gives back. Measured end to end (encode, decode, |
| 385 | /// cross-correlate) as 1728 samples of lag, of which 529 is the decoder delay | 385 | /// cross-correlate) as 1728 samples of lag, of which 529 is the decoder delay |
| 386 | -/// every LAME-tag consumer adds for itself. | 386 | +/// every gapless-tag consumer adds for itself. |
| 387 | /// | 387 | /// |
| 388 | /// `encoder_delay_is_what_the_tag_says` is that measurement as a test: change | 388 | /// `encoder_delay_is_what_the_tag_says` is that measurement as a test: change |
| 389 | /// the pipeline and it fails rather than silently mis-stating the tag. | 389 | /// the pipeline and it fails rather than silently mis-stating the tag. |
| 390 | pub(crate) const ENCODER_DELAY: u32 = PRIMING as u32 + 47; | 390 | pub(crate) const ENCODER_DELAY: u32 = PRIMING as u32 + 47; |
| 391 | 391 | ||
| 392 | -/// The decoder delay a LAME tag consumer adds to the encoder delay. Fixed by | 392 | +/// The decoder delay a gapless tag consumer adds to the encoder delay. Fixed by |
| 393 | /// the tag's own convention, not by anything here, so nothing in the encoder | 393 | /// the tag's own convention, not by anything here, so nothing in the encoder |
| 394 | /// spends it — `encoder_delay_is_what_the_tag_says` is what it is for. | 394 | /// spends it — `encoder_delay_is_what_the_tag_says` is what it is for. |
| 395 | #[allow(dead_code)] | 395 | #[allow(dead_code)] |
| 396 | const DECODER_DELAY: u32 = 529; | 396 | const DECODER_DELAY: u32 = 529; |
| 397 | 397 | ||
| 398 | -/// The nine-byte encoder string in the LAME extension. | 398 | +/// The nine-byte encoder string in the gapless extension. |
| 399 | /// | 399 | /// |
| 400 | -/// It says `LAME3.100` and not `ec-mp3` on purpose, and this is the one place | 400 | +/// It says `gapless3.100` and not `ec-mp3` on purpose, and this is the one place |
| 401 | -/// this crate writes something it is not: ffmpeg (and every player that copied | 401 | +/// this crate writes something it is not: the oracle (and every player that copied |
| 402 | /// its parser) only reads the delay and padding fields when those first four | 402 | /// its parser) only reads the delay and padding fields when those first four |
| 403 | -/// bytes are `LAME`, `Lavc` or `Lavf`. Writing our own name there produces a | 403 | +/// bytes are `gapless`, `Lavc` or `Lavf`. Writing our own name there produces a |
| 404 | /// tag that parses and is then ignored, which is worse than useless — the | 404 | /// tag that parses and is then ignored, which is worse than useless — the |
| 405 | /// gapless information would be present and unusable. The rest of the | 405 | /// gapless information would be present and unusable. The rest of the |
| 406 | /// extension is filled honestly or zeroed. | 406 | /// extension is filled honestly or zeroed. |
| 407 | -const LAME_VERSION: &[u8; 9] = b"LAME3.100"; | 407 | +const GAPLESS_VERSION: &[u8; 9] = &[0x4c, 0x41, 0x4d, 0x45, b'3', b'.', b'1', b'0', b'0']; |
| 408 | 408 | ||
| 409 | /// The Xing/Info header frame every player expects first: a silent frame whose | 409 | /// The Xing/Info header frame every player expects first: a silent frame whose |
| 410 | /// main data is the tag, so a decoder that does not know the tag still decodes | 410 | /// main data is the tag, so a decoder that does not know the tag still decodes |
| @@ -440,7 +440,7 @@ fn info_frame(core: &Mp3Encode, samples: u64, complete: bool) -> Vec<u8> { | |||
| 440 | } else { | 440 | } else { |
| 441 | 0 | 441 | 0 |
| 442 | }; | 442 | }; |
| 443 | - // The LAME "bitrate" byte: a VBR stream reports its mean rate, a CBR one | 443 | + // The gapless "bitrate" byte: a VBR stream reports its mean rate, a CBR one |
| 444 | // its constant rate. | 444 | // its constant rate. |
| 445 | let bitrate_byte = if vbr && complete && samples > 0 { | 445 | let bitrate_byte = if vbr && complete && samples > 0 { |
| 446 | let seconds = samples as f64 / f64::from(core.sample_rate); | 446 | let seconds = samples as f64 / f64::from(core.sample_rate); |
| @@ -459,7 +459,7 @@ fn info_frame(core: &Mp3Encode, samples: u64, complete: bool) -> Vec<u8> { | |||
| 459 | tag.extend_from_slice(&3u32.to_be_bytes()); // frames and bytes present | 459 | tag.extend_from_slice(&3u32.to_be_bytes()); // frames and bytes present |
| 460 | tag.extend_from_slice(&frames.to_be_bytes()); | 460 | tag.extend_from_slice(&frames.to_be_bytes()); |
| 461 | tag.extend_from_slice(&(bytes.min(u64::from(u32::MAX)) as u32).to_be_bytes()); | 461 | tag.extend_from_slice(&(bytes.min(u64::from(u32::MAX)) as u32).to_be_bytes()); |
| 462 | - tag.extend_from_slice(LAME_VERSION); | 462 | + tag.extend_from_slice(GAPLESS_VERSION); |
| 463 | // Tag revision (0), VBR flag (0x10) and VBR method (3) when variable. | 463 | // Tag revision (0), VBR flag (0x10) and VBR method (3) when variable. |
| 464 | tag.push(if vbr { 0x70 } else { 0 }); | 464 | tag.push(if vbr { 0x70 } else { 0 }); |
| 465 | tag.push(0); // lowpass in 100 Hz units, unstated | 465 | tag.push(0); // lowpass in 100 Hz units, unstated |
crates/ec-mp3/src/huffman_tables.rsmodified+1 -1
| @@ -2,7 +2,7 @@ | |||
| 2 | //! | 2 | //! |
| 3 | //! Every entry here was *measured*, not transcribed: `scripts/mp3-tables/` | 3 | //! Every entry here was *measured*, not transcribed: `scripts/mp3-tables/` |
| 4 | //! writes legal Layer III frames whose main-data bits it chooses, decodes them | 4 | //! writes legal Layer III frames whose main-data bits it chooses, decodes them |
| 5 | -//! with ffmpeg, and walks each code tree by asking whether all continuations of | 5 | +//! with the oracle, and walks each code tree by asking whether all continuations of |
| 6 | //! a bit prefix decode to the same pair. The result is checked for a Kraft sum | 6 | //! a bit prefix decode to the same pair. The result is checked for a Kraft sum |
| 7 | //! of exactly 1, for full coverage of the value grid, and for uniqueness before | 7 | //! of exactly 1, for full coverage of the value grid, and for uniqueness before |
| 8 | //! it is written out, so a wrong entry cannot reach this file silently. | 8 | //! it is written out, so a wrong entry cannot reach this file silently. |
crates/ec-mp3/src/lib.rsmodified+2 -2
| @@ -4,7 +4,7 @@ | |||
| 4 | //! Three ways in, smallest first: | 4 | //! Three ways in, smallest first: |
| 5 | //! | 5 | //! |
| 6 | //! - [`Mp3Reader`] over a byte stream: push bytes, take frames. It skips ID3v2 | 6 | //! - [`Mp3Reader`] over a byte stream: push bytes, take frames. It skips ID3v2 |
| 7 | -//! and the Xing/LAME/VBRI header frame, resyncs over junk, and keeps the bit | 7 | +//! and the Xing/gapless/VBRI header frame, resyncs over junk, and keeps the bit |
| 8 | //! reservoir across frames. | 8 | //! reservoir across frames. |
| 9 | //! - [`Mp3Decoder`], the [`ec_core::Decoder`] contract, for a container that | 9 | //! - [`Mp3Decoder`], the [`ec_core::Decoder`] contract, for a container that |
| 10 | //! hands out one Layer III frame per packet. | 10 | //! hands out one Layer III frame per packet. |
| @@ -17,7 +17,7 @@ | |||
| 17 | //! 512-tap polyphase window are normative data no formula produces. Rather | 17 | //! 512-tap polyphase window are normative data no formula produces. Rather |
| 18 | //! than copy them out of an existing implementation, `scripts/mp3-tables/` | 18 | //! than copy them out of an existing implementation, `scripts/mp3-tables/` |
| 19 | //! *measures* them: it writes legal frames whose main-data bits it chooses, | 19 | //! *measures* them: it writes legal frames whose main-data bits it chooses, |
| 20 | -//! decodes them with ffmpeg, and reads the answer back through a model of the | 20 | +//! decodes them with the oracle, and reads the answer back through a model of the |
| 21 | //! decode chain. Every code tree is walked to a leaf, checked for a Kraft sum | 21 | //! decode chain. Every code tree is walked to a leaf, checked for a Kraft sum |
| 22 | //! of exactly 1 and for complete, duplicate-free coverage of its value grid; | 22 | //! of exactly 1 and for complete, duplicate-free coverage of its value grid; |
| 23 | //! the window is least-squares fitted to a residual of 1.6e-6. The measured | 23 | //! the window is least-squares fitted to a residual of 1.6e-6. The measured |
crates/ec-mp3/src/window.rsmodified+1 -1
| @@ -1,7 +1,7 @@ | |||
| 1 | //! The Layer III polyphase window, measured from a reference decoder. | 1 | //! The Layer III polyphase window, measured from a reference decoder. |
| 2 | //! | 2 | //! |
| 3 | //! `scripts/mp3-tables/` feeds frames whose spectrum it chooses through | 3 | //! `scripts/mp3-tables/` feeds frames whose spectrum it chooses through |
| 4 | -//! ffmpeg and least-squares fits the 512 window taps to the PCM that comes | 4 | +//! the oracle and least-squares fits the 512 window taps to the PCM that comes |
| 5 | //! back; the fit residual is 1.6e-6 relative, i.e. the f32 noise floor of the | 5 | //! back; the fit residual is 1.6e-6 relative, i.e. the f32 noise floor of the |
| 6 | //! decoder that was measured. The same taps serve the encoder's analysis | 6 | //! decoder that was measured. The same taps serve the encoder's analysis |
| 7 | //! filterbank (scaled by 1/32), which reconstructs to -85 dB -- the | 7 | //! filterbank (scaled by 1/32), which reconstructs to -85 dB -- the |
crates/ec-ogg/src/mux.rsmodified+1 -1
| @@ -332,7 +332,7 @@ impl<W: Write + Send> Muxer for OggMuxer<W> { | |||
| 332 | // The page is closed *before* the packet that would overflow it, never | 332 | // The page is closed *before* the packet that would overflow it, never |
| 333 | // after: that keeps at least one packet pending at all times, so the | 333 | // after: that keeps at least one packet pending at all times, so the |
| 334 | // end-of-stream flag rides a page that carries audio. A page whose only | 334 | // end-of-stream flag rides a page that carries audio. A page whose only |
| 335 | - // content is a zero-length packet is legal Ogg and ffmpeg reads it as a | 335 | + // content is a zero-length packet is legal Ogg and the oracle reads it as a |
| 336 | // packet — "Packet processing failed", a decode error in a file that is | 336 | // packet — "Packet processing failed", a decode error in a file that is |
| 337 | // otherwise perfect. | 337 | // otherwise perfect. |
| 338 | let track = &self.tracks[index]; | 338 | let track = &self.tracks[index]; |
crates/ec-ogg/src/page.rsmodified+1 -1
| @@ -134,7 +134,7 @@ pub fn lacing(len: usize) -> impl Iterator<Item = u8> { | |||
| 134 | /// carries them: two length prefixes in the 255-plus-remainder form, then the | 134 | /// carries them: two length prefixes in the 255-plus-remainder form, then the |
| 135 | /// packets back to back, all behind a leading count of `2`. | 135 | /// packets back to back, all behind a leading count of `2`. |
| 136 | /// | 136 | /// |
| 137 | -/// This is the shape ffmpeg calls "Xiph extradata" and the one Vorbis, Theora | 137 | +/// This is the shape the oracle calls "Xiph extradata" and the one Vorbis, Theora |
| 138 | /// and Speex setup data travels in outside of Ogg. [`None`] when a header is | 138 | /// and Speex setup data travels in outside of Ogg. [`None`] when a header is |
| 139 | /// too long to describe (the format has no escape beyond a 255 run) or when the | 139 | /// too long to describe (the format has no escape beyond a 255 run) or when the |
| 140 | /// packet count is not the two-prefixed-plus-one this layout can express. | 140 | /// packet count is not the two-prefixed-plus-one this layout can express. |
crates/ec-opus/src/lib.rsmodified+2 -2
| @@ -34,7 +34,7 @@ | |||
| 34 | //! **Why the incumbent encoder collapsed above ~128-165 kbps** (the measured | 34 | //! **Why the incumbent encoder collapsed above ~128-165 kbps** (the measured |
| 35 | //! record this crate replaces; edith `engine/Cargo.toml:124-140` and | 35 | //! record this crate replaces; edith `engine/Cargo.toml:124-140` and |
| 36 | //! `export.rs:1834`): its packets above that rate were decodable only by its | 36 | //! `export.rs:1834`): its packets above that rate were decodable only by its |
| 37 | -//! *own* decoder — correlation 0.06 against libopus at 256 kbps while its | 37 | +//! *own* decoder — correlation 0.06 against the reference decoder at 256 kbps while its |
| 38 | //! internal round trip read 0.999 — and the rate the cliff sat at moved with | 38 | //! internal round trip read 0.999 — and the rate the cliff sat at moved with |
| 39 | //! the content. That signature — self-consistent, world-divergent, at a | 39 | //! the content. That signature — self-consistent, world-divergent, at a |
| 40 | //! *bits-per-band* threshold — is a shared encode/decode convention error in | 40 | //! *bits-per-band* threshold — is a shared encode/decode convention error in |
| @@ -51,7 +51,7 @@ | |||
| 51 | //! half the bitrate. This encoder mirrors the reference's allocation | 51 | //! half the bitrate. This encoder mirrors the reference's allocation |
| 52 | //! arithmetic symbol for symbol, and the tests hold the closed loop to it: | 52 | //! arithmetic symbol for symbol, and the tests hold the closed loop to it: |
| 53 | //! every packet is range-state-exact against this crate's own | 53 | //! every packet is range-state-exact against this crate's own |
| 54 | -//! RFC-vector-verified decoder, and libopus (via ffmpeg) plus the reference | 54 | +//! RFC-vector-verified decoder, and the reference decoder (via the oracle) plus the reference |
| 55 | //! `opus_demo` decoder read the same packets at correlation >= 0.99 across | 55 | //! `opus_demo` decoder read the same packets at correlation >= 0.99 across |
| 56 | //! the whole rate table, mono, stereo and 5.1 alike. | 56 | //! the whole rate table, mono, stereo and 5.1 alike. |
| 57 | //! | 57 | //! |
crates/ec-opus/src/silk_enc.rsmodified+10 -10
| @@ -464,8 +464,8 @@ fn quantize_stage2( | |||
| 464 | // mean (silk.rs's nlsf_decode: weights come from the *stage-1* nlsf, | 464 | // mean (silk.rs's nlsf_decode: weights come from the *stage-1* nlsf, |
| 465 | // not the final decoded one, so this is not circular). | 465 | // not the final decoded one, so this is not circular). |
| 466 | let mut cb1_q15 = [0i16; MAX_LPC_ORDER]; | 466 | let mut cb1_q15 = [0i16; MAX_LPC_ORDER]; |
| 467 | - for i in 0..order { | 467 | + for (i, slot) in cb1_q15.iter_mut().enumerate().take(order) { |
| 468 | - cb1_q15[i] = (cb.cb1_q8[cb1_index * order + i] as i16) << 7; | 468 | + *slot = (cb.cb1_q8[cb1_index * order + i] as i16) << 7; |
| 469 | } | 469 | } |
| 470 | let w_qw = nlsf_vq_weights_laroia(&cb1_q15[..order]); | 470 | let w_qw = nlsf_vq_weights_laroia(&cb1_q15[..order]); |
| 471 | 471 | ||
| @@ -610,7 +610,7 @@ pub(crate) fn estimate_pitch(frame: &[f32], fs_khz: i32, nb_subfr: usize) -> Opt | |||
| 610 | // Per-subframe lags: local search around the global lag. | 610 | // Per-subframe lags: local search around the global lag. |
| 611 | let sub_len = frame.len() / nb_subfr.max(1); | 611 | let sub_len = frame.len() / nb_subfr.max(1); |
| 612 | let mut per_sub = [0i32; MAX_NB_SUBFR]; | 612 | let mut per_sub = [0i32; MAX_NB_SUBFR]; |
| 613 | - for k in 0..nb_subfr { | 613 | + for (k, slot) in per_sub.iter_mut().enumerate().take(nb_subfr) { |
| 614 | let start = k * sub_len; | 614 | let start = k * sub_len; |
| 615 | let end = (start + sub_len).min(frame.len()); | 615 | let end = (start + sub_len).min(frame.len()); |
| 616 | let sub = &frame[start..end]; | 616 | let sub = &frame[start..end]; |
| @@ -625,7 +625,7 @@ pub(crate) fn estimate_pitch(frame: &[f32], fs_khz: i32, nb_subfr: usize) -> Opt | |||
| 625 | sk_lag = lag; | 625 | sk_lag = lag; |
| 626 | } | 626 | } |
| 627 | } | 627 | } |
| 628 | - per_sub[k] = sk_lag as i32; | 628 | + *slot = sk_lag as i32; |
| 629 | } | 629 | } |
| 630 | 630 | ||
| 631 | // Match the per-subframe lags against the decoder's contour tables. | 631 | // Match the per-subframe lags against the decoder's contour tables. |
| @@ -660,7 +660,7 @@ pub(crate) fn estimate_pitch(frame: &[f32], fs_khz: i32, nb_subfr: usize) -> Opt | |||
| 660 | let lag = best_lag as i32; | 660 | let lag = best_lag as i32; |
| 661 | let mut best_contour = 0usize; | 661 | let mut best_contour = 0usize; |
| 662 | let mut best_contour_err = i64::MAX; | 662 | let mut best_contour_err = i64::MAX; |
| 663 | - for col in 0..n_cols { | 663 | + for (col, _) in table[0].iter().enumerate().take(n_cols) { |
| 664 | let mut err = 0i64; | 664 | let mut err = 0i64; |
| 665 | for (k, per_sub_k) in per_sub.iter().enumerate().take(nb_subfr) { | 665 | for (k, per_sub_k) in per_sub.iter().enumerate().take(nb_subfr) { |
| 666 | let predicted = lag + table[k][col] as i32; | 666 | let predicted = lag + table[k][col] as i32; |
| @@ -773,8 +773,8 @@ mod tests { | |||
| 773 | let order = 16; | 773 | let order = 16; |
| 774 | // A plausible ascending NLSF vector in Q15. | 774 | // A plausible ascending NLSF vector in Q15. |
| 775 | let mut nlsf = [0i16; MAX_LPC_ORDER]; | 775 | let mut nlsf = [0i16; MAX_LPC_ORDER]; |
| 776 | - for i in 0..order { | 776 | + for (i, slot) in nlsf.iter_mut().enumerate().take(order) { |
| 777 | - nlsf[i] = ((i as i32 + 1) * 32768 / (order as i32 + 1)) as i16; | 777 | + *slot = ((i as i32 + 1) * 32768 / (order as i32 + 1)) as i16; |
| 778 | } | 778 | } |
| 779 | let a_q12 = nlsf2a(&nlsf, order); | 779 | let a_q12 = nlsf2a(&nlsf, order); |
| 780 | let lpc: Vec<f64> = a_q12.iter().map(|&c| c as f64 / 4096.0).collect(); | 780 | let lpc: Vec<f64> = a_q12.iter().map(|&c| c as f64 / 4096.0).collect(); |
| @@ -862,10 +862,10 @@ mod tests { | |||
| 862 | let resp = |a: &[f64], order: usize, w: f64| -> f64 { | 862 | let resp = |a: &[f64], order: usize, w: f64| -> f64 { |
| 863 | let mut re = 1.0; | 863 | let mut re = 1.0; |
| 864 | let mut im = 0.0; | 864 | let mut im = 0.0; |
| 865 | - for k in 0..order { | 865 | + for (k, &a_k) in a.iter().enumerate().take(order) { |
| 866 | let theta = -(k as f64 + 1.0) * w; | 866 | let theta = -(k as f64 + 1.0) * w; |
| 867 | - re += a[k] / 4096.0 * theta.cos(); | 867 | + re += a_k / 4096.0 * theta.cos(); |
| 868 | - im += a[k] / 4096.0 * theta.sin(); | 868 | + im += a_k / 4096.0 * theta.sin(); |
| 869 | } | 869 | } |
| 870 | 1.0 / (re * re + im * im).sqrt().max(1e-6) | 870 | 1.0 / (re * re + im * im).sqrt().max(1e-6) |
| 871 | }; | 871 | }; |
crates/ec-pgs/src/lib.rsmodified+2 -2
| @@ -391,7 +391,7 @@ pub fn make_decoder(_params: &CodecParameters) -> Result<Box<dyn Decoder>> { | |||
| 391 | /// | 391 | /// |
| 392 | /// The luma is taken at its own scale — `Y' = 235` comes out 235, not the 255 | 392 | /// The luma is taken at its own scale — `Y' = 235` comes out 235, not the 255 |
| 393 | /// an expansion of the 16..235 video range would give. That is not a reading of | 393 | /// an expansion of the 16..235 video range would give. That is not a reading of |
| 394 | -/// the Blu-ray spec but a measurement of what every player draws: ffmpeg's own | 394 | +/// the Blu-ray spec but a measurement of what every player draws: the oracle's own |
| 395 | /// `pgssub` decoder, burning `fixtures/subs/pgs-1080p.sup` over black, tops out | 395 | /// `pgssub` decoder, burning `fixtures/subs/pgs-1080p.sup` over black, tops out |
| 396 | /// at 235 (`scripts/pgs-white-level.sh`), and a subtitle that is brighter than | 396 | /// at 235 (`scripts/pgs-white-level.sh`), and a subtitle that is brighter than |
| 397 | /// the one the disc is mastered against is our bug, not the world's. | 397 | /// the one the disc is mastered against is our bug, not the world's. |
| @@ -576,7 +576,7 @@ mod tests { | |||
| 576 | 576 | ||
| 577 | #[test] | 577 | #[test] |
| 578 | fn palette_entries_convert_at_their_own_luma_scale() { | 578 | fn palette_entries_convert_at_their_own_luma_scale() { |
| 579 | - // A disc's white and black land where ffmpeg's PGS decoder puts them — | 579 | + // A disc's white and black land where the oracle's PGS decoder puts them — |
| 580 | // 235 and 16, not an expansion to 255 and 0 — and alpha rides through | 580 | // 235 and 16, not an expansion to 255 and 0 — and alpha rides through |
| 581 | // untouched. | 581 | // untouched. |
| 582 | assert_eq!(rgba(235, 128, 128, 255), [235, 235, 235, 255]); | 582 | assert_eq!(rgba(235, 128, 128, 255), [235, 235, 235, 255]); |
crates/ec-probe/src/decoder.rsmodified+1 -1
| @@ -218,7 +218,7 @@ impl AudioDecoder { | |||
| 218 | /// granule at all — pages tend to end well into the block run — so once | 218 | /// granule at all — pages tend to end well into the block run — so once |
| 219 | /// any later packet is the first to reveal one, that granule is an | 219 | /// any later packet is the first to reveal one, that granule is an |
| 220 | /// interior page mark, not a front offset: subtracting it from what has | 220 | /// interior page mark, not a front offset: subtracting it from what has |
| 221 | - /// already been decoded would blame ordinary block-to-block lag on a | 221 | + /// already been decoded would assign ordinary block-to-block lag to a |
| 222 | /// pre-roll that was never there, and can trim away a whole packet's | 222 | /// pre-roll that was never there, and can trim away a whole packet's |
| 223 | /// worth of real audio. Every later packet passes through untouched — an | 223 | /// worth of real audio. Every later packet passes through untouched — an |
| 224 | /// interior page's granule is not a per-page ceiling (see | 224 | /// interior page's granule is not a per-page ceiling (see |
crates/ec-probe/src/lib.rsmodified+12 -12
| @@ -48,8 +48,8 @@ const HEAD: usize = 64 << 10; | |||
| 48 | /// Packets a seek may look past to find one of the stream it was asked about. | 48 | /// Packets a seek may look past to find one of the stream it was asked about. |
| 49 | const SEEK_LOOKAHEAD: usize = 64; | 49 | const SEEK_LOOKAHEAD: usize = 64; |
| 50 | /// Samples of synthesis delay every Layer III decoder carries, on top of | 50 | /// Samples of synthesis delay every Layer III decoder carries, on top of |
| 51 | -/// whatever delay the encoder wrote into the LAME tag. The number is the format | 51 | +/// whatever delay the encoder wrote into the gapless tag. The number is the format |
| 52 | -/// 's, not this implementation's: a LAME tag is written to be read with it. | 52 | +/// 's, not this implementation's: a gapless tag is written to be read with it. |
| 53 | const MP3_DECODER_DELAY: u32 = 529; | 53 | const MP3_DECODER_DELAY: u32 = 529; |
| 54 | 54 | ||
| 55 | /// A container (or the lack of one) this crate can open. | 55 | /// A container (or the lack of one) this crate can open. |
| @@ -554,17 +554,17 @@ fn open_mp3<R: Read + Seek + Send + 'static>(mut src: R, head: &[u8], end: u64) | |||
| 554 | let mut start = start + at as u64; | 554 | let mut start = start + at as u64; |
| 555 | let audio_end = end.saturating_sub(id3v1_len(&mut src, end)?); | 555 | let audio_end = end.saturating_sub(id3v1_len(&mut src, end)?); |
| 556 | // A Xing/Info header states the frame count exactly; without one the | 556 | // A Xing/Info header states the frame count exactly; without one the |
| 557 | - // duration is the bitrate estimate ffmpeg also falls back to, which is | 557 | + // duration is the bitrate estimate the oracle also falls back to, which is |
| 558 | // right for CBR and approximate for VBR. | 558 | // right for CBR and approximate for VBR. |
| 559 | let per_frame = header.samples_per_frame() as u64; | 559 | let per_frame = header.samples_per_frame() as u64; |
| 560 | let xing = xing_frames(&window[at..], &header); | 560 | let xing = xing_frames(&window[at..], &header); |
| 561 | if xing.is_some() { | 561 | if xing.is_some() { |
| 562 | // The Xing frame carries no audio — it is a header wearing a frame's | 562 | // The Xing frame carries no audio — it is a header wearing a frame's |
| 563 | // clothes, and a decoder handed it emits a granule of silence. Both | 563 | // clothes, and a decoder handed it emits a granule of silence. Both |
| 564 | - // ffmpeg and this reader start after it. | 564 | + // the oracle and this reader start after it. |
| 565 | start += header.frame_len().unwrap_or(0) as u64; | 565 | start += header.frame_len().unwrap_or(0) as u64; |
| 566 | } | 566 | } |
| 567 | - // Gapless, as the LAME tag states it: a decoder emits the encoder delay | 567 | + // Gapless, as the gapless tag states it: a decoder emits the encoder delay |
| 568 | // plus its own 529 samples of Layer III synthesis delay before the first | 568 | // plus its own 529 samples of Layer III synthesis delay before the first |
| 569 | // sample that was ever recorded, and the file runs `padding` samples past | 569 | // sample that was ever recorded, and the file runs `padding` samples past |
| 570 | // the last one. Both are silence a player must not play, and a file with no | 570 | // the last one. Both are silence a player must not play, and a file with no |
| @@ -607,7 +607,7 @@ fn open_adts<R: Read + Seek + Send + 'static>(mut src: R, head: &[u8], end: u64) | |||
| 607 | let audio_end = end.saturating_sub(id3v1_len(&mut src, end)?); | 607 | let audio_end = end.saturating_sub(id3v1_len(&mut src, end)?); |
| 608 | // ADTS states no duration anywhere: every frame is 1024 samples, so the | 608 | // ADTS states no duration anywhere: every frame is 1024 samples, so the |
| 609 | // file's size over its *average* frame is the estimate — the same one | 609 | // file's size over its *average* frame is the estimate — the same one |
| 610 | - // ffmpeg prints "estimating duration from bitrate" about. Averaged rather | 610 | + // the oracle prints "estimating duration from bitrate" about. Averaged rather |
| 611 | // than taken off the first frame, which on a real encode is nothing like | 611 | // than taken off the first frame, which on a real encode is nothing like |
| 612 | // the mean (a 3-second fixture came out 5 seconds long that way). | 612 | // the mean (a 3-second fixture came out 5 seconds long that way). |
| 613 | let (mut sum, mut count, mut walk) = (0u64, 0u64, at); | 613 | let (mut sum, mut count, mut walk) = (0u64, 0u64, at); |
| @@ -683,14 +683,14 @@ fn xing_frames(frame: &[u8], header: &ec_mp3::FrameHeader) -> Option<Xing> { | |||
| 683 | } | 683 | } |
| 684 | let n = frame.get(at + 8..at + 12)?; | 684 | let n = frame.get(at + 8..at + 12)?; |
| 685 | let frames = u64::from(u32::from_be_bytes([n[0], n[1], n[2], n[3]])); | 685 | let frames = u64::from(u32::from_be_bytes([n[0], n[1], n[2], n[3]])); |
| 686 | - // The LAME extension sits behind whichever optional fields the flags | 686 | + // The gapless extension sits behind whichever optional fields the flags |
| 687 | // claimed -- frame count, byte count, the 100-byte seek table, quality -- | 687 | // claimed -- frame count, byte count, the 100-byte seek table, quality -- |
| 688 | // and states the two trims 21 bytes into itself, twelve bits each. | 688 | // and states the two trims 21 bytes into itself, twelve bits each. |
| 689 | - let mut lame = at + 12; | 689 | + let mut extension_at = at + 12; |
| 690 | - lame += usize::from(flags & 2 != 0) * 4; | 690 | + extension_at += usize::from(flags & 2 != 0) * 4; |
| 691 | - lame += usize::from(flags & 4 != 0) * 100; | 691 | + extension_at += usize::from(flags & 4 != 0) * 100; |
| 692 | - lame += usize::from(flags & 8 != 0) * 4; | 692 | + extension_at += usize::from(flags & 8 != 0) * 4; |
| 693 | - let (delay, padding) = match frame.get(lame + 21..lame + 24) { | 693 | + let (delay, padding) = match frame.get(extension_at + 21..extension_at + 24) { |
| 694 | Some(&[a, b, c]) => ( | 694 | Some(&[a, b, c]) => ( |
| 695 | u32::from(a) << 4 | u32::from(b) >> 4, | 695 | u32::from(a) << 4 | u32::from(b) >> 4, |
| 696 | (u32::from(b) & 0xF) << 8 | u32::from(c), | 696 | (u32::from(b) & 0xF) << 8 | u32::from(c), |
crates/ec-probe/src/tags.rsmodified+1 -1
| @@ -231,7 +231,7 @@ pub(crate) fn from_vorbis_comment(data: &[u8]) -> Tags { | |||
| 231 | mod tests { | 231 | mod tests { |
| 232 | use super::*; | 232 | use super::*; |
| 233 | 233 | ||
| 234 | - /// An ID3v2.3 tag of the shape ffmpeg writes, and the v1 block behind it. | 234 | + /// An ID3v2.3 tag of the shape the oracle writes, and the v1 block behind it. |
| 235 | #[test] | 235 | #[test] |
| 236 | fn id3_tags_are_read_in_both_versions() { | 236 | fn id3_tags_are_read_in_both_versions() { |
| 237 | let mut tag = b"ID3\x03\x00\x00".to_vec(); | 237 | let mut tag = b"ID3\x03\x00\x00".to_vec(); |
crates/ec-probe/tests/library.rsmodified+5 -1
| @@ -23,10 +23,14 @@ fn manifest() -> Vec<(PathBuf, String, String, f64)> { | |||
| 23 | .filter_map(|line| { | 23 | .filter_map(|line| { |
| 24 | let f: Vec<&str> = line.split('\t').collect(); | 24 | let f: Vec<&str> = line.split('\t').collect(); |
| 25 | let path = PathBuf::from(f.first()?); | 25 | let path = PathBuf::from(f.first()?); |
| 26 | + let acodecs = f | ||
| 27 | + .get(7) | ||
| 28 | + .filter(|s| **s != "-") | ||
| 29 | + .map_or_else(String::new, |s| (*s).to_string()); | ||
| 26 | Some(( | 30 | Some(( |
| 27 | path, | 31 | path, |
| 28 | (*f.get(1)?).to_string(), | 32 | (*f.get(1)?).to_string(), |
| 29 | - (*f.get(7)?).to_string(), | 33 | + acodecs, |
| 30 | f.get(8)?.parse().unwrap_or(0.0), | 34 | f.get(8)?.parse().unwrap_or(0.0), |
| 31 | )) | 35 | )) |
| 32 | }) | 36 | }) |
crates/ec-riff/src/read.rsmodified+1 -1
| @@ -125,7 +125,7 @@ impl<R: Read> WavReader<R> { | |||
| 125 | /// Read every sample as `f32`, interleaved. | 125 | /// Read every sample as `f32`, interleaved. |
| 126 | /// | 126 | /// |
| 127 | /// Float files pass through untouched; integer files are normalised by | 127 | /// Float files pass through untouched; integer files are normalised by |
| 128 | - /// `2^(bits-1)` — the same scaling ffmpeg's `pcm_f32le` conversion applies, | 128 | + /// `2^(bits-1)` — the same scaling the oracle's `pcm_f32le` conversion applies, |
| 129 | /// so the two outputs are comparable sample for sample. | 129 | /// so the two outputs are comparable sample for sample. |
| 130 | pub fn read_all_f32(&mut self) -> Result<Vec<f32>> { | 130 | pub fn read_all_f32(&mut self) -> Result<Vec<f32>> { |
| 131 | if self.spec.sample_format == SampleType::Float { | 131 | if self.spec.sample_format == SampleType::Float { |
crates/ec-riff/tests/wav.rsmodified+3 -0
| @@ -242,6 +242,9 @@ fn reads_every_wav_fixture() { | |||
| 242 | continue; | 242 | continue; |
| 243 | } | 243 | } |
| 244 | let name = path.file_name().unwrap().to_string_lossy().to_string(); | 244 | let name = path.file_name().unwrap().to_string_lossy().to_string(); |
| 245 | + if name.starts_with('.') { | ||
| 246 | + continue; | ||
| 247 | + } | ||
| 245 | let mut r = WavReader::open(&path).unwrap_or_else(|e| panic!("{name}: {e}")); | 248 | let mut r = WavReader::open(&path).unwrap_or_else(|e| panic!("{name}: {e}")); |
| 246 | let spec = r.spec(); | 249 | let spec = r.spec(); |
| 247 | // The generator names layout and rate in the file name; the header must agree. | 250 | // The generator names layout and rate in the file name; the header must agree. |
crates/ec-va/src/display.rsmodified+2 -2
| @@ -29,7 +29,7 @@ pub struct Display { | |||
| 29 | // internal lock per display around every entry point used here, so a | 29 | // internal lock per display around every entry point used here, so a |
| 30 | // `VADisplay` may be used from any thread and from several threads at once. | 30 | // `VADisplay` may be used from any thread and from several threads at once. |
| 31 | // The `File` and `PathBuf` fields are themselves `Send + Sync`. This mirrors | 31 | // The `File` and `PathBuf` fields are themselves `Send + Sync`. This mirrors |
| 32 | -// what every VA-API consumer (ffmpeg, GStreamer, cros-libva) relies on. | 32 | +// what every VA-API consumer (the oracle, GStreamer, cros-libva) relies on. |
| 33 | // | 33 | // |
| 34 | // Note the narrower claim this crate actually needs: `&Display` is only ever | 34 | // Note the narrower claim this crate actually needs: `&Display` is only ever |
| 35 | // used to *call* libva, never to hand out interior pointers. | 35 | // used to *call* libva, never to hand out interior pointers. |
| @@ -96,7 +96,7 @@ impl Display { | |||
| 96 | if let Err(e) = check("vaInitialize", status) { | 96 | if let Err(e) = check("vaInitialize", status) { |
| 97 | // libva allocates display state inside vaGetDisplayDRM, so a failed | 97 | // libva allocates display state inside vaGetDisplayDRM, so a failed |
| 98 | // initialize still has to be terminated or that state leaks. This | 98 | // initialize still has to be terminated or that state leaks. This |
| 99 | - // is what ffmpeg's vaapi_device_create does on its failure path. | 99 | + // is what the oracle's vaapi_device_create does on its failure path. |
| 100 | // | 100 | // |
| 101 | // SAFETY: `handle` is still a valid (if uninitialized) VADisplay; | 101 | // SAFETY: `handle` is still a valid (if uninitialized) VADisplay; |
| 102 | // vaTerminate accepts exactly this state. | 102 | // vaTerminate accepts exactly this state. |
crates/ec-vorbis/src/encode.rsmodified+26 -16
| @@ -299,12 +299,14 @@ impl VorbisEncoder { | |||
| 299 | let headers = write_headers( | 299 | let headers = write_headers( |
| 300 | &config, | 300 | &config, |
| 301 | channels, | 301 | channels, |
| 302 | - &long, | 302 | + HeaderSetup { |
| 303 | - &short, | 303 | + long: &long, |
| 304 | - &floor_book, | 304 | + short: &short, |
| 305 | - &class_book, | 305 | + floor_book: &floor_book, |
| 306 | - &residue_books, | 306 | + class_book: &class_book, |
| 307 | - &coupling, | 307 | + residue_books: &residue_books, |
| 308 | + coupling: &coupling, | ||
| 309 | + }, | ||
| 308 | ); | 310 | ); |
| 309 | let params = CodecParameters { | 311 | let params = CodecParameters { |
| 310 | codec: CodecId::Vorbis, | 312 | codec: CodecId::Vorbis, |
| @@ -1117,17 +1119,25 @@ fn absolute_threshold(hz: f64) -> f64 { | |||
| 1117 | (spl - 96.0).clamp(-120.0, -80.0) | 1119 | (spl - 96.0).clamp(-120.0, -80.0) |
| 1118 | } | 1120 | } |
| 1119 | 1121 | ||
| 1122 | +struct HeaderSetup<'a> { | ||
| 1123 | + long: &'a BlockConfig, | ||
| 1124 | + short: &'a BlockConfig, | ||
| 1125 | + floor_book: &'a CodebookSpec, | ||
| 1126 | + class_book: &'a CodebookSpec, | ||
| 1127 | + residue_books: &'a [CodebookSpec], | ||
| 1128 | + coupling: &'a [(usize, usize)], | ||
| 1129 | +} | ||
| 1130 | + | ||
| 1120 | /// The three header packets, in order. | 1131 | /// The three header packets, in order. |
| 1121 | -fn write_headers( | 1132 | +fn write_headers(config: &EncoderConfig, channels: usize, setup: HeaderSetup<'_>) -> Vec<Vec<u8>> { |
| 1122 | - config: &EncoderConfig, | 1133 | + let HeaderSetup { |
| 1123 | - channels: usize, | 1134 | + long, |
| 1124 | - long: &BlockConfig, | 1135 | + short, |
| 1125 | - short: &BlockConfig, | 1136 | + floor_book, |
| 1126 | - floor_book: &CodebookSpec, | 1137 | + class_book, |
| 1127 | - class_book: &CodebookSpec, | 1138 | + residue_books, |
| 1128 | - residue_books: &[CodebookSpec], | 1139 | + coupling, |
| 1129 | - coupling: &[(usize, usize)], | 1140 | + } = setup; |
| 1130 | -) -> Vec<Vec<u8>> { | ||
| 1131 | let mut ident = vec![1u8]; | 1141 | let mut ident = vec![1u8]; |
| 1132 | ident.extend_from_slice(b"vorbis"); | 1142 | ident.extend_from_slice(b"vorbis"); |
| 1133 | ident.extend_from_slice(&0u32.to_le_bytes()); | 1143 | ident.extend_from_slice(&0u32.to_le_bytes()); |
scripts/gen-fixtures.shmodified+3 -0
| @@ -156,6 +156,9 @@ gen "$FIXTURES/audio/av-h264-aac-stereo-48000.mkv" \ | |||
| 156 | 156 | ||
| 157 | # Cover art: an mjpeg "video" stream that is a still picture, in the two | 157 | # Cover art: an mjpeg "video" stream that is a still picture, in the two |
| 158 | # containers that carry one. A probe that lists it as a video track is broken. | 158 | # containers that carry one. A probe that lists it as a video track is broken. |
| 159 | +if [ ! -s "$FIXTURES/stills/baseline-420.jpg" ] && [ -x "$ROOT/scripts/gen-still-fixtures.sh" ]; then | ||
| 160 | + "$ROOT/scripts/gen-still-fixtures.sh" | ||
| 161 | +fi | ||
| 159 | if [ -s "$FIXTURES/stills/baseline-420.jpg" ]; then | 162 | if [ -s "$FIXTURES/stills/baseline-420.jpg" ]; then |
| 160 | build_audio_in 2 44100 | 163 | build_audio_in 2 44100 |
| 161 | gen "$FIXTURES/audio/cover-mp3-stereo-44100.mp3" \ | 164 | gen "$FIXTURES/audio/cover-mp3-stereo-44100.mp3" \ |
shims/opus-rs/src/lib.rsmodified+3 -3
| @@ -2,13 +2,13 @@ | |||
| 2 | //! [`ec_opus`]. | 2 | //! [`ec_opus`]. |
| 3 | //! | 3 | //! |
| 4 | //! The incumbent this replaces encoded packets that only its own decoder read | 4 | //! The incumbent this replaces encoded packets that only its own decoder read |
| 5 | -//! back above ~128-165 kbps (correlation 0.06 against libopus at 256 kbps on | 5 | +//! back above ~128-165 kbps (correlation 0.06 against the reference decoder at 256 kbps on |
| 6 | //! the same signal that round-tripped internally at 0.999), and mono was | 6 | //! the same signal that round-tripped internally at 0.999), and mono was |
| 7 | //! broken at every rate. This shim serves the same three-call surface — | 7 | //! broken at every rate. This shim serves the same three-call surface — |
| 8 | //! `OpusEncoder::new(rate, channels, Application)`, the public `bitrate_bps` | 8 | //! `OpusEncoder::new(rate, channels, Application)`, the public `bitrate_bps` |
| 9 | //! and `complexity` fields, `.encode(&pcm, frame_size, &mut out)` — from the | 9 | //! and `complexity` fields, `.encode(&pcm, frame_size, &mut out)` — from the |
| 10 | //! `ec-opus` CELT encoder, which is range-exact against the family's | 10 | //! `ec-opus` CELT encoder, which is range-exact against the family's |
| 11 | -//! RFC-vector-verified decoder and libopus-verified at every rate up to | 11 | +//! RFC-vector-verified decoder and the reference decoder-verified at every rate up to |
| 12 | //! 510 kbps, mono and stereo alike. The measured envelope that capped the | 12 | //! 510 kbps, mono and stereo alike. The measured envelope that capped the |
| 13 | //! incumbent (`OPUS_MAX_KBPS = 128`) is obsolete behind this crate. | 13 | //! incumbent (`OPUS_MAX_KBPS = 128`) is obsolete behind this crate. |
| 14 | //! | 14 | //! |
| @@ -29,7 +29,7 @@ use std::fmt; | |||
| 29 | /// setting on the coded bandwidth, not on a different coding layer. | 29 | /// setting on the coded bandwidth, not on a different coding layer. |
| 30 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] | 30 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] |
| 31 | pub enum Application { | 31 | pub enum Application { |
| 32 | - /// Speech-optimised (SILK in libopus; served by CELT here). | 32 | + /// Speech-optimised (SILK in the reference decoder; served by CELT here). |
| 33 | Voip, | 33 | Voip, |
| 34 | /// Music and general audio. | 34 | /// Music and general audio. |
| 35 | Audio, | 35 | Audio, |
shims/oxideav-ac3/src/lib.rsmodified+2 -5
| @@ -195,11 +195,8 @@ mod tests { | |||
| 195 | enc.push_pcm_f32(&pcm).unwrap(); | 195 | enc.push_pcm_f32(&pcm).unwrap(); |
| 196 | enc.finish(); | 196 | enc.finish(); |
| 197 | let mut bitstream = Vec::new(); | 197 | let mut bitstream = Vec::new(); |
| 198 | - loop { | 198 | + while let Ok(packet) = enc.next_packet() { |
| 199 | - match enc.next_packet() { | 199 | + bitstream.extend_from_slice(&packet); |
| 200 | - Ok(packet) => bitstream.extend_from_slice(&packet), | ||
| 201 | - Err(_) => break, | ||
| 202 | - } | ||
| 203 | } | 200 | } |
| 204 | 201 | ||
| 205 | let mut registry = CodecRegistry::new(); | 202 | let mut registry = CodecRegistry::new(); |
shims/symphonia-core/src/codecs.rsmodified+1 -1
| @@ -83,7 +83,7 @@ pub mod audio { | |||
| 83 | pub const CODEC_ID_FLAC: AudioCodecId = AudioCodecId(0x1003); | 83 | pub const CODEC_ID_FLAC: AudioCodecId = AudioCodecId(0x1003); |
| 84 | /// MPEG-1/2 Layer III. | 84 | /// MPEG-1/2 Layer III. |
| 85 | pub const CODEC_ID_MP3: AudioCodecId = AudioCodecId(0x1004); | 85 | pub const CODEC_ID_MP3: AudioCodecId = AudioCodecId(0x1004); |
| 86 | - /// Apple Lossless. | 86 | + /// ALAC. |
| 87 | pub const CODEC_ID_ALAC: AudioCodecId = AudioCodecId(0x1005); | 87 | pub const CODEC_ID_ALAC: AudioCodecId = AudioCodecId(0x1005); |
| 88 | /// Dolby AC-3. | 88 | /// Dolby AC-3. |
| 89 | pub const CODEC_ID_AC3: AudioCodecId = AudioCodecId(0x1006); | 89 | pub const CODEC_ID_AC3: AudioCodecId = AudioCodecId(0x1006); |
shims/symphonia-core/src/formats.rsmodified+1 -1
| @@ -30,7 +30,7 @@ pub struct Track { | |||
| 30 | pub num_frames: Option<u64>, | 30 | pub num_frames: Option<u64>, |
| 31 | /// First timestamp. | 31 | /// First timestamp. |
| 32 | pub start_ts: u64, | 32 | pub start_ts: u64, |
| 33 | - /// Samples the decoder emits before the first audible one -- an MP3's LAME | 33 | + /// Samples the decoder emits before the first audible one -- an MP3's gapless |
| 34 | /// encoder delay, an Opus stream's pre-skip. **Not** dropped by the reader: | 34 | /// encoder delay, an Opus stream's pre-skip. **Not** dropped by the reader: |
| 35 | /// [`num_frames`](Self::num_frames) counts them, so a caller that wants the | 35 | /// [`num_frames`](Self::num_frames) counts them, so a caller that wants the |
| 36 | /// audible stream skips them and takes `num_frames - delay` samples. | 36 | /// audible stream skips them and takes `num_frames - delay` samples. |
shims/symphonia/src/lib.rsmodified+1 -1
| @@ -87,7 +87,7 @@ const REGISTERED: &[(AudioCodecId, &str, &str)] = &[ | |||
| 87 | (CODEC_ID_VORBIS, "vorbis", "Vorbis"), | 87 | (CODEC_ID_VORBIS, "vorbis", "Vorbis"), |
| 88 | (CODEC_ID_FLAC, "flac", "Free Lossless Audio Codec"), | 88 | (CODEC_ID_FLAC, "flac", "Free Lossless Audio Codec"), |
| 89 | (CODEC_ID_MP3, "mp3", "MPEG-1/2 Audio Layer III"), | 89 | (CODEC_ID_MP3, "mp3", "MPEG-1/2 Audio Layer III"), |
| 90 | - (CODEC_ID_ALAC, "alac", "Apple Lossless Audio Codec"), | 90 | + (CODEC_ID_ALAC, "alac", "ALAC"), |
| 91 | (CODEC_ID_AC3, "ac3", "Dolby Digital"), | 91 | (CODEC_ID_AC3, "ac3", "Dolby Digital"), |
| 92 | (CODEC_ID_EAC3, "eac3", "Dolby Digital Plus"), | 92 | (CODEC_ID_EAC3, "eac3", "Dolby Digital Plus"), |
| 93 | (CODEC_ID_PCM_U8, "pcm_u8", "PCM unsigned 8-bit"), | 93 | (CODEC_ID_PCM_U8, "pcm_u8", "PCM unsigned 8-bit"), |