forge
Explore
Log in

Don't you dare go Hollow

Neutralize third-party source names

Browse files at this commit

17d6cb2caef13d536efb1f0e6865551d14ab4ff4Ahmet Kaan GümüşParent: 380bb54
  • docs
    • neutralize third-party source names
Show full message
docs: neutralize third-party source names
crates/ec-aac/src/decode.rsmodified+1 -1
@@ -27,7 +27,7 @@ const INTENSITY_HCB: u8 = 15;
2727 const SF_OFFSET: i32 = 100;
2828 /// The dequantiser works in the standard's own units, where full scale is
2929 /// 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
3131 /// amplitudes and not just shape.
3232 pub(crate) const OUTPUT_SCALE: f32 = 1.0 / 65536.0;
3333 /// The longest TNS filter AAC-LC allows (long blocks; short blocks stop at 7).
crates/ec-ac3/src/aht.rsmodified+1 -1
@@ -150,7 +150,7 @@ pub(crate) fn read_channel(
150150 fn idct6(x: &[f32; AHT_BLOCKS]) -> [f32; AHT_BLOCKS] {
151151 // cos(j(2m+1)pi/12) for j, m in 0..6, with the 1/sqrt(2) weight on j = 0
152152 // 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
154154 // stream, a factor of 2 makes every AHT channel exactly sqrt(2) too loud
155155 // (per-frame RMS ratio 1.4142 across 3 649 frames). The radical is lost in
156156 // the published equation's typesetting.
crates/ec-ac3/src/aht_tables.rsmodified+1 -1
@@ -101,7 +101,7 @@ const VQ4_PRINTED: [[i16; 6]; 32] = [
101101 /// Table E4.4's index column is offset by one against its value rows: the
102102 /// vector an encoder selects with index `k` is the row the document prints at
103103 /// `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
105105 /// stream — every one of the 32 indices occurs there, and with the printed
106106 /// mapping only `hebap == 4` bins diverge (0.63% of a channel's energy), while
107107 /// 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 @@
4040 //! gain-adaptive quantizers) and spectral extension are decoded; enhanced
4141 //! coupling and dependent substreams above 5.1 are refused by name rather than
4242 //! 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
4444 //! 0.999 correlation once the two decoders' independent noise is taken out of
4545 //! the comparison ([`Options::dither`]).
4646 //!
crates/ec-alac/src/decode.rsmodified+3 -3
@@ -4,7 +4,7 @@
44 //! Written from the published ALAC format description (element tags and frame
55 //! header layout, the Golomb/Rice parameter adaptation with its zero-run mode,
66 //! 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.
88
99 use crate::MagicCookie;
1010 use ec_core::error::{Error, Result};
@@ -434,7 +434,7 @@ fn element(
434434 ) -> Result<usize> {
435435 let channels = 1 + usize::from(pair);
436436 // 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
438438 // predictor plan starts at bit 39 of the frame — 3 tag + these 16 + the 4
439439 // flags + the 16 mix bits below).
440440 bits.skip(16)?;
@@ -587,5 +587,5 @@ fn interleave(
587587 }
588588
589589 /// 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.
591591 const MAX_FRAME_SAMPLES: usize = 1 << 20;
crates/ec-alac/src/encode.rsmodified+2 -2
@@ -4,7 +4,7 @@
44 //! `AlacDecoder::decode` expects.
55 //!
66 //! 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.
88
99 use crate::MagicCookie;
1010 use ec_core::error::{Error, Result};
@@ -477,7 +477,7 @@ pub struct AlacEncoder {
477477 impl AlacEncoder {
478478 /// An encoder for a mono or stereo stream. `bit_depth` is 16 or 24;
479479 /// `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).
481481 pub fn new(sample_rate: u32, channels: u8, bit_depth: u8, frame_length: u32) -> Result<AlacEncoder> {
482482 if !matches!(bit_depth, 16 | 24) {
483483 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.
22 //!
33 //! Two ways in:
44 //!
@@ -15,9 +15,9 @@
1515 //! - [`AlacEncoder`], the mirror image: frames in, coded packets out, for a
1616 //! container that wants to write ALAC instead of read it.
1717 //!
18-//! **Clean room.** Written from the published ALAC format description; Apple's
18+//! **Clean room.** Written from the published ALAC format description; the reference
1919 //! 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
2121 //! `s32` with the low 8 bits zero), so raw output compares byte for byte.
2222
2323 #![forbid(unsafe_code)]
@@ -38,7 +38,7 @@ use ec_core::registry::{AudioParameters, CodecId, CodecParameters, Decoder, Medi
3838 /// in Matroska.
3939 #[derive(Debug, Clone, Copy, PartialEq, Eq)]
4040 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
4242 /// stream's last frame states its own shorter length.
4343 pub frame_length: u32,
4444 /// Bitstream version the file is compatible with; 0 is the only one.
@@ -68,7 +68,7 @@ impl MagicCookie {
6868 ///
6969 /// Accepts the three shapes those bytes arrive in: the bare 24-byte config,
7070 /// 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
7272 /// family's own mp4 demuxer hand over).
7373 pub fn parse(data: &[u8]) -> Result<MagicCookie> {
7474 let at = match data {
@@ -314,7 +314,7 @@ pub fn codec_parameters(cookie: &MagicCookie) -> CodecParameters {
314314 mod tests {
315315 use super::*;
316316
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
318318 /// in between all describe the same stream.
319319 #[test]
320320 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 @@
1111 //! 2. the **bitstream**'s: an H.264 or HEVC SPS VUI `colour_description`, an AV1
1212 //! sequence header `color_config`, which is what the *encoder* wrote and what
1313 //! 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
1515 //! 720 lines or taller is BT.709, anything smaller is BT.601, limited range
1616 //! either way.
1717 //!
@@ -126,7 +126,7 @@ impl ColorDescription {
126126 pub fn resolve(container: Tags, bitstream: Tags, height: u32) -> Self {
127127 let tags = container.over(bitstream);
128128 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
130130 // 1080p file is HD material and an untagged 480p one came off SD
131131 // material, and guessing the other way is a visible green/magenta
132132 // shift on faces.
@@ -163,7 +163,7 @@ impl ColorDescription {
163163 /// and mp4's `colr` both index, so one answer serves both muxers.
164164 pub fn codes(self) -> (u16, u16, u16) {
165165 // 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
167167 // for each and what a player expects to see together.
168168 let (primaries, sdr_transfer, matrix) = match self.matrix {
169169 Matrix::Bt709 => (1, 1, 1),
@@ -291,7 +291,7 @@ impl ContentLight {
291291 ///
292292 /// The chromaticities are read past: what a tone map wants is the luminance
293293 /// 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 —
295295 /// believing it would tell a tone map the film peaks at black.
296296 pub fn mdcv(payload: &[u8]) -> ContentLight {
297297 let luminance = |at: usize| -> Option<f32> {
@@ -1226,7 +1226,7 @@ mod tests {
12261226 }
12271227
12281228 /// 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
12301230 /// puts its quant matrices in the PPS). The lists are what makes this test
12311231 /// worth having: read as if they were not there, the VUI lands
12321232 /// mid-coefficient and the colour comes out as noise.
crates/ec-core/src/registry.rsmodified+2 -2
@@ -42,7 +42,7 @@ pub enum CodecId {
4242 TrueHd,
4343 /// DTS and its extensions (DTS-HD, DTS:X).
4444 Dts,
45- /// Apple Lossless.
45+ /// ALAC.
4646 Alac,
4747 /// Xiph FLAC.
4848 Flac,
@@ -239,7 +239,7 @@ pub struct StreamInfo {
239239 pub duration: Option<i64>,
240240 /// ISO 639-2 language tag, when the container carries one.
241241 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
243243 /// encoder delay, an Opus stream's pre-skip. Zero where a stream has none.
244244 ///
245245 /// It is *not* subtracted from [`duration`](Self::duration), because a
crates/ec-flac/src/decode.rsmodified+5 -5
@@ -181,7 +181,7 @@ impl Block {
181181 }
182182
183183 /// 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
185185 /// (`s16` for depths up to 16, `s32` above).
186186 pub fn to_interleaved(&self, shift: u32) -> Vec<i32> {
187187 let channels = self.channels.len();
@@ -197,7 +197,7 @@ impl Block {
197197 }
198198
199199 /// 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
201201 /// compares byte for byte.
202202 pub fn container_shift(bits_per_sample: u32) -> u32 {
203203 match bits_per_sample <= 16 {
@@ -484,7 +484,7 @@ impl DecodedStream {
484484
485485 /// Interleaved samples shifted into their PCM container, as raw bytes:
486486 /// `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.
488488 pub fn to_pcm_bytes(&self) -> Vec<u8> {
489489 let shift = container_shift(self.bits_per_sample);
490490 let narrow = self.bits_per_sample <= 16;
@@ -673,7 +673,7 @@ fn decode_subframe(
673673 if bps > 32 {
674674 // Only a 32-bit stream that also decorrelates its stereo pair gets
675675 // 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)
677677 // works in. Named rather than mangled.
678678 return Err(Error::unsupported(
679679 "33-bit side subframe",
@@ -957,7 +957,7 @@ mod tests {
957957 }
958958
959959 #[test]
960- fn container_shift_matches_ffmpeg_layout() {
960+ fn container_shift_matches_reference_layout() {
961961 assert_eq!(container_shift(8), 8);
962962 assert_eq!(container_shift(12), 4);
963963 assert_eq!(container_shift(16), 0);
crates/ec-flac/src/lib.rsmodified+1 -1
@@ -12,7 +12,7 @@
1212 //! Decoded samples keep their own bit depth in [`decode::Block`] and
1313 //! [`decode::DecodedStream`]; the PCM views ([`decode::DecodedStream::to_pcm_bytes`],
1414 //! [`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.
1616 //!
1717 //! Nothing here panics on malformed input: truncation is `NeedMore`, a broken
1818 //! 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 {
263263
264264 /// The reconstruction of the last coded picture, cropped, as I420 planes.
265265 /// 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.
267267 pub fn reconstruction(&self) -> Option<(Vec<u8>, Vec<u8>, Vec<u8>)> {
268268 if !self.have_reference {
269269 return None;
crates/ec-h265-syntax/src/nal.rsmodified+1 -1
@@ -198,7 +198,7 @@ pub fn unescape_rbsp(payload: &[u8]) -> Vec<u8> {
198198 /// Append one Annex-B NAL unit: start code, header, escaped RBSP.
199199 ///
200200 /// 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
202202 /// caller splitting an access unit back apart expects.
203203 pub fn write_annex_b(out: &mut Vec<u8>, header: NalHeader, rbsp: &[u8], long_start_code: bool) {
204204 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> {
4747 /// is nothing to say.
4848 ///
4949 /// 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
5151 /// tone map that believes it maps the film to black.
5252 pub fn hdr_metadata_rbsp(light: ContentLight) -> Option<Vec<u8>> {
5353 let mut messages = Vec::new();
crates/ec-h265/src/residual.rsmodified+1 -1
@@ -479,7 +479,7 @@ mod tests {
479479
480480 #[test]
481481 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
483483 // the invariant that makes rate-distortion decisions meaningful: fewer
484484 // and smaller levels must cost fewer bits.
485485 let mut sparse = vec![0i32; 64];
crates/ec-h265/src/transform.rsmodified+1 -1
@@ -5,7 +5,7 @@
55 //! conformant decoder produces. The forward path and the quantizer are the
66 //! encoder's own choice; what makes them correct is that they invert the
77 //! 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.
99 //!
1010 //! One transcription safeguard is worth naming: only the first 16 columns of the
1111 //! 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 @@
44 //! This is not optional plumbing. radeonsi advertises
55 //! `VA_ENC_PACKED_HEADER_SEQUENCE | PICTURE | SLICE` and then writes none of
66 //! 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
88 //! "Invalid data found when processing input" (measured, 2026-08-14). Every
99 //! field below therefore has to agree with the `VAEnc*ParameterBuffer` the
1010 //! 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(
11731173 let mut light = ContentLight::default();
11741174 let (mut rate, mut channels, mut bits) = (0f64, 0u64, 0u64);
11751175 // `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
11771177 // tag states — converted to a sample count once the track's own rate
11781178 // is known, below.
11791179 let mut delay_ns = 0u64;
@@ -1564,7 +1564,7 @@ mod tests {
15641564 out
15651565 }
15661566
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
15681568 /// zlib track, a header-stripped track, and one block of each lacing.
15691569 fn synthetic() -> Vec<u8> {
15701570 let mut header = Vec::new();
crates/ec-mp3/src/decode.rsmodified+1 -1
@@ -656,7 +656,7 @@ impl Mp3Decode {
656656 }
657657 }
658658
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
660660 /// frame, resyncs over junk, and holds partial data until the rest arrives.
661661 #[derive(Debug, Default)]
662662 pub struct Mp3Reader {
crates/ec-mp3/src/encode.rsmodified+9 -9
@@ -383,28 +383,28 @@ const PRIMING: usize = 1152;
383383 /// its input and the MDCT one granule behind that, less what the decoder's
384384 /// synthesis gives back. Measured end to end (encode, decode,
385385 /// 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.
387387 ///
388388 /// `encoder_delay_is_what_the_tag_says` is that measurement as a test: change
389389 /// the pipeline and it fails rather than silently mis-stating the tag.
390390 pub(crate) const ENCODER_DELAY: u32 = PRIMING as u32 + 47;
391391
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
393393 /// the tag's own convention, not by anything here, so nothing in the encoder
394394 /// spends it — `encoder_delay_is_what_the_tag_says` is what it is for.
395395 #[allow(dead_code)]
396396 const DECODER_DELAY: u32 = 529;
397397
398-/// The nine-byte encoder string in the LAME extension.
398+/// The nine-byte encoder string in the gapless extension.
399399 ///
400-/// It says `LAME3.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
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: the oracle (and every player that copied
402402 /// 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
404404 /// tag that parses and is then ignored, which is worse than useless — the
405405 /// gapless information would be present and unusable. The rest of the
406406 /// 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'];
408408
409409 /// The Xing/Info header frame every player expects first: a silent frame whose
410410 /// 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> {
440440 } else {
441441 0
442442 };
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
444444 // its constant rate.
445445 let bitrate_byte = if vbr && complete && samples > 0 {
446446 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> {
459459 tag.extend_from_slice(&3u32.to_be_bytes()); // frames and bytes present
460460 tag.extend_from_slice(&frames.to_be_bytes());
461461 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);
463463 // Tag revision (0), VBR flag (0x10) and VBR method (3) when variable.
464464 tag.push(if vbr { 0x70 } else { 0 });
465465 tag.push(0); // lowpass in 100 Hz units, unstated
crates/ec-mp3/src/huffman_tables.rsmodified+1 -1
@@ -2,7 +2,7 @@
22 //!
33 //! Every entry here was *measured*, not transcribed: `scripts/mp3-tables/`
44 //! 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
66 //! a bit prefix decode to the same pair. The result is checked for a Kraft sum
77 //! of exactly 1, for full coverage of the value grid, and for uniqueness before
88 //! 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 @@
44 //! Three ways in, smallest first:
55 //!
66 //! - [`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
88 //! reservoir across frames.
99 //! - [`Mp3Decoder`], the [`ec_core::Decoder`] contract, for a container that
1010 //! hands out one Layer III frame per packet.
@@ -17,7 +17,7 @@
1717 //! 512-tap polyphase window are normative data no formula produces. Rather
1818 //! than copy them out of an existing implementation, `scripts/mp3-tables/`
1919 //! *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
2121 //! decode chain. Every code tree is walked to a leaf, checked for a Kraft sum
2222 //! of exactly 1 and for complete, duplicate-free coverage of its value grid;
2323 //! 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 @@
11 //! The Layer III polyphase window, measured from a reference decoder.
22 //!
33 //! `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
55 //! back; the fit residual is 1.6e-6 relative, i.e. the f32 noise floor of the
66 //! decoder that was measured. The same taps serve the encoder's analysis
77 //! 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> {
332332 // The page is closed *before* the packet that would overflow it, never
333333 // after: that keeps at least one packet pending at all times, so the
334334 // 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
336336 // packet — "Packet processing failed", a decode error in a file that is
337337 // otherwise perfect.
338338 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> {
134134 /// carries them: two length prefixes in the 255-plus-remainder form, then the
135135 /// packets back to back, all behind a leading count of `2`.
136136 ///
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
138138 /// and Speex setup data travels in outside of Ogg. [`None`] when a header is
139139 /// too long to describe (the format has no escape beyond a 255 run) or when the
140140 /// 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 @@
3434 //! **Why the incumbent encoder collapsed above ~128-165 kbps** (the measured
3535 //! record this crate replaces; edith `engine/Cargo.toml:124-140` and
3636 //! `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
3838 //! internal round trip read 0.999 — and the rate the cliff sat at moved with
3939 //! the content. That signature — self-consistent, world-divergent, at a
4040 //! *bits-per-band* threshold — is a shared encode/decode convention error in
@@ -51,7 +51,7 @@
5151 //! half the bitrate. This encoder mirrors the reference's allocation
5252 //! arithmetic symbol for symbol, and the tests hold the closed loop to it:
5353 //! 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
5555 //! `opus_demo` decoder read the same packets at correlation >= 0.99 across
5656 //! the whole rate table, mono, stereo and 5.1 alike.
5757 //!
crates/ec-pgs/src/lib.rsmodified+2 -2
@@ -391,7 +391,7 @@ pub fn make_decoder(_params: &CodecParameters) -> Result<Box<dyn Decoder>> {
391391 ///
392392 /// The luma is taken at its own scale — `Y' = 235` comes out 235, not the 255
393393 /// 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
395395 /// `pgssub` decoder, burning `fixtures/subs/pgs-1080p.sup` over black, tops out
396396 /// at 235 (`scripts/pgs-white-level.sh`), and a subtitle that is brighter than
397397 /// the one the disc is mastered against is our bug, not the world's.
@@ -576,7 +576,7 @@ mod tests {
576576
577577 #[test]
578578 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 —
580580 // 235 and 16, not an expansion to 255 and 0 — and alpha rides through
581581 // untouched.
582582 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 {
218218 /// granule at all — pages tend to end well into the block run — so once
219219 /// any later packet is the first to reveal one, that granule is an
220220 /// 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
222222 /// pre-roll that was never there, and can trim away a whole packet's
223223 /// worth of real audio. Every later packet passes through untouched — an
224224 /// 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;
4848 /// Packets a seek may look past to find one of the stream it was asked about.
4949 const SEEK_LOOKAHEAD: usize = 64;
5050 /// 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
52-/// 's, not this implementation's: a LAME tag is written to be read with it.
51+/// whatever delay the encoder wrote into the gapless tag. The number is the format
52+/// 's, not this implementation's: a gapless tag is written to be read with it.
5353 const MP3_DECODER_DELAY: u32 = 529;
5454
5555 /// 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)
554554 let mut start = start + at as u64;
555555 let audio_end = end.saturating_sub(id3v1_len(&mut src, end)?);
556556 // 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
558558 // right for CBR and approximate for VBR.
559559 let per_frame = header.samples_per_frame() as u64;
560560 let xing = xing_frames(&window[at..], &header);
561561 if xing.is_some() {
562562 // The Xing frame carries no audio — it is a header wearing a frame's
563563 // 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.
565565 start += header.frame_len().unwrap_or(0) as u64;
566566 }
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
568568 // plus its own 529 samples of Layer III synthesis delay before the first
569569 // sample that was ever recorded, and the file runs `padding` samples past
570570 // 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)
607607 let audio_end = end.saturating_sub(id3v1_len(&mut src, end)?);
608608 // ADTS states no duration anywhere: every frame is 1024 samples, so the
609609 // 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
611611 // than taken off the first frame, which on a real encode is nothing like
612612 // the mean (a 3-second fixture came out 5 seconds long that way).
613613 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> {
683683 }
684684 let n = frame.get(at + 8..at + 12)?;
685685 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
687687 // claimed -- frame count, byte count, the 100-byte seek table, quality --
688688 // and states the two trims 21 bytes into itself, twelve bits each.
689- let mut lame = at + 12;
690- lame += usize::from(flags & 2 != 0) * 4;
691- lame += usize::from(flags & 4 != 0) * 100;
692- lame += usize::from(flags & 8 != 0) * 4;
693- let (delay, padding) = match frame.get(lame + 21..lame + 24) {
689+ let mut extension_at = at + 12;
690+ extension_at += usize::from(flags & 2 != 0) * 4;
691+ extension_at += usize::from(flags & 4 != 0) * 100;
692+ extension_at += usize::from(flags & 8 != 0) * 4;
693+ let (delay, padding) = match frame.get(extension_at + 21..extension_at + 24) {
694694 Some(&[a, b, c]) => (
695695 u32::from(a) << 4 | u32::from(b) >> 4,
696696 (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 {
231231 mod tests {
232232 use super::*;
233233
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.
235235 #[test]
236236 fn id3_tags_are_read_in_both_versions() {
237237 let mut tag = b"ID3\x03\x00\x00".to_vec();
crates/ec-riff/src/read.rsmodified+1 -1
@@ -125,7 +125,7 @@ impl<R: Read> WavReader<R> {
125125 /// Read every sample as `f32`, interleaved.
126126 ///
127127 /// 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,
129129 /// so the two outputs are comparable sample for sample.
130130 pub fn read_all_f32(&mut self) -> Result<Vec<f32>> {
131131 if self.spec.sample_format == SampleType::Float {
crates/ec-va/src/display.rsmodified+2 -2
@@ -29,7 +29,7 @@ pub struct Display {
2929 // internal lock per display around every entry point used here, so a
3030 // `VADisplay` may be used from any thread and from several threads at once.
3131 // 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.
3333 //
3434 // Note the narrower claim this crate actually needs: `&Display` is only ever
3535 // used to *call* libva, never to hand out interior pointers.
@@ -96,7 +96,7 @@ impl Display {
9696 if let Err(e) = check("vaInitialize", status) {
9797 // libva allocates display state inside vaGetDisplayDRM, so a failed
9898 // 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.
100100 //
101101 // SAFETY: `handle` is still a valid (if uninitialized) VADisplay;
102102 // vaTerminate accepts exactly this state.
shims/opus-rs/src/lib.rsmodified+3 -3
@@ -2,13 +2,13 @@
22 //! [`ec_opus`].
33 //!
44 //! 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
66 //! the same signal that round-tripped internally at 0.999), and mono was
77 //! broken at every rate. This shim serves the same three-call surface —
88 //! `OpusEncoder::new(rate, channels, Application)`, the public `bitrate_bps`
99 //! and `complexity` fields, `.encode(&pcm, frame_size, &mut out)` — from the
1010 //! `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
1212 //! 510 kbps, mono and stereo alike. The measured envelope that capped the
1313 //! incumbent (`OPUS_MAX_KBPS = 128`) is obsolete behind this crate.
1414 //!
@@ -29,7 +29,7 @@ use std::fmt;
2929 /// setting on the coded bandwidth, not on a different coding layer.
3030 #[derive(Debug, Clone, Copy, PartialEq, Eq)]
3131 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).
3333 Voip,
3434 /// Music and general audio.
3535 Audio,
shims/symphonia-core/src/codecs.rsmodified+1 -1
@@ -83,7 +83,7 @@ pub mod audio {
8383 pub const CODEC_ID_FLAC: AudioCodecId = AudioCodecId(0x1003);
8484 /// MPEG-1/2 Layer III.
8585 pub const CODEC_ID_MP3: AudioCodecId = AudioCodecId(0x1004);
86- /// Apple Lossless.
86+ /// ALAC.
8787 pub const CODEC_ID_ALAC: AudioCodecId = AudioCodecId(0x1005);
8888 /// Dolby AC-3.
8989 pub const CODEC_ID_AC3: AudioCodecId = AudioCodecId(0x1006);
shims/symphonia-core/src/formats.rsmodified+1 -1
@@ -30,7 +30,7 @@ pub struct Track {
3030 pub num_frames: Option<u64>,
3131 /// First timestamp.
3232 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
3434 /// encoder delay, an Opus stream's pre-skip. **Not** dropped by the reader:
3535 /// [`num_frames`](Self::num_frames) counts them, so a caller that wants the
3636 /// 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)] = &[
8787 (CODEC_ID_VORBIS, "vorbis", "Vorbis"),
8888 (CODEC_ID_FLAC, "flac", "Free Lossless Audio Codec"),
8989 (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"),
9191 (CODEC_ID_AC3, "ac3", "Dolby Digital"),
9292 (CODEC_ID_EAC3, "eac3", "Dolby Digital Plus"),
9393 (CODEC_ID_PCM_U8, "pcm_u8", "PCM unsigned 8-bit"),