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;
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 is28 /// 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 a29 /// 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 compares30+/// 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-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 = 0151 // 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's152 // 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 DDP153+ // 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 loud154 // 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 in155 // (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: the101 /// 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 at102 /// 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 not103 /// `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 Plus104+/// 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 printed105 /// 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), while106 /// 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 tables107 /// 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; enhanced40 //! gain-adaptive quantizers) and spectral extension are decoded; enhanced
41 //! coupling and dependent substreams above 5.1 are refused by name rather than41 //! 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, the42 //! 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 within43+//! 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 of44 //! 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 frame4 //! 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 is6 //! 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 stream436 // 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, whose437+ // 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 4438 // 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 ask589 /// 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 carries479 /// `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 a15 //! - [`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's18+//! **Clean room.** Written from the published ALAC format description; the reference
19 //! decoder sources were not read. Samples are returned shifted into their PCM19 //! 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 as20+//! 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). A41+ /// 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 this71+ /// 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 form317+ /// 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 AV111 //! 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 what12 //! 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 picture14+//! 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 range15 //! 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 untagged129+ // 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 SD130 // 1080p file is HD material and an untagged 480p one came off SD
131 // material, and guessing the other way is a visible green/magenta131 // 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 is165 // 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 writes166+ // 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 luminance292 /// 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 zero293 /// 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 family1228 /// 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 (x2641229+ /// 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 test1230 /// 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 lands1231 /// 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 LAME242+ /// 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 a245 /// 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 fill183 /// 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 expect184+ /// 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 fill199 /// 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 output200+/// 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 what486 /// `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 gets674 // 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 i32675 // 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`] and12 //! 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 way14 //! [`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 broken17 //! 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 tests265 /// 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-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 a200 /// 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 a201+/// 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 a50+/// 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 — but482+ // Not a bit-exactness check — that is the the oracle conformance test — but
483 // the invariant that makes rate-distortion decisions meaningful: fewer483 // 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 the5 //! conformant decoder produces. The forward path and the quantizer are the
6 //! encoder's own choice; what makes them correct is that they invert the6 //! 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 the10 //! 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 advertises4 //! This is not optional plumbing. radeonsi advertises
5 //! `VA_ENC_PACKED_HEADER_SEQUENCE | PICTURE | SLICE` and then writes none of5 //! `VA_ENC_PACKED_HEADER_SEQUENCE | PICTURE | SLICE` and then writes none of
6 //! them itself: without these, the coded buffer comes back holding slice data6 //! 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 with7+//! 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). Every8 //! "Invalid data found when processing input" (measured, 2026-08-14). Every
9 //! field below therefore has to agree with the `VAEnc*ParameterBuffer` the9 //! 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 the10 //! 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 same1175 // `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 LAME1176+ // 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 rate1177 // 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 out1564 out
1565 }1565 }
1566 1566
1567- /// A file with the three things nothing generated by ffmpeg carries: a1567+ /// 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 header659+/// 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's383 /// 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 delay385 /// 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: change388 /// `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 by392+/// 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 encoder393 /// 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 place400+/// 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 copied401+/// 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 four402 /// 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 a403+/// 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 — the404 /// tag that parses and is then ignored, which is worse than useless — the
405 /// gapless information would be present and unusable. The rest of the405 /// 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 whose409 /// 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 decodes410 /// 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 0441 0
442 };442 };
443- // The LAME "bitrate" byte: a VBR stream reports its mean rate, a CBR one443+ // 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 present459 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, unstated465 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 them4 //! 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 of5+//! 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 sum6 //! 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 before7 //! 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 ID3v26 //! - [`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 bit7+//! 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 that9 //! - [`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. Rather17 //! 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 the20+//! 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 sum21 //! 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 measured23 //! 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 through3 //! `scripts/mp3-tables/` feeds frames whose spectrum it chooses through
4-//! ffmpeg and least-squares fits the 512 window taps to the PCM that comes4+//! 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 the5 //! 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 analysis6 //! decoder that was measured. The same taps serve the encoder's analysis
7 //! filterbank (scaled by 1/32), which reconstructs to -85 dB -- the7 //! 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, never332 // 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 the333 // 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 only334 // 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 a335+ // 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 is336 // 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 the134 /// 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, Theora137+/// 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 is138 /// 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 the139 /// 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 measured34 //! **Why the incumbent encoder collapsed above ~128-165 kbps** (the measured
35 //! record this crate replaces; edith `engine/Cargo.toml:124-140` and35 //! record this crate replaces; edith `engine/Cargo.toml:124-140` and
36 //! `export.rs:1834`): its packets above that rate were decodable only by its36 //! `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 its37+//! *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 with38 //! 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 a39 //! the content. That signature — self-consistent, world-divergent, at a
40 //! *bits-per-band* threshold — is a shared encode/decode convention error in40 //! *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 allocation51 //! 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 own53 //! every packet is range-state-exact against this crate's own
54-//! RFC-vector-verified decoder, and libopus (via ffmpeg) plus the reference54+//! 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 across55 //! `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-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 255392 /// 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 of393 /// 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 own394+/// 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 out395 /// `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 than396 /// 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 through580 // 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 once218 /// 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 an219 /// 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 has220 /// interior page mark, not a front offset: subtracting it from what has
221- /// already been decoded would blame ordinary block-to-block lag on a221+ /// 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's222 /// 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 — an223 /// worth of real audio. Every later packet passes through untouched — an
224 /// interior page's granule is not a per-page ceiling (see224 /// 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 of50 /// 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 format51+/// 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 the556 // A Xing/Info header states the frame count exactly; without one the
557- // duration is the bitrate estimate ffmpeg also falls back to, which is557+ // 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's562 // 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. Both563 // 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 delay567+ // 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 first568 // 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 past569 // 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 no570 // 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 the608 // 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 one609 // file's size over its *average* frame is the estimate — the same one
610- // ffmpeg prints "estimating duration from bitrate" about. Averaged rather610+ // the oracle prints "estimating duration from bitrate" about. Averaged rather
611 // than taken off the first frame, which on a real encode is nothing like611 // 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 flags686+ // 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-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 by127 /// 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-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 a29 // 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 mirrors31 // 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 ever34 // 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 failed97 // libva allocates display state inside vaGetDisplayDRM, so a failed
98 // initialize still has to be terminated or that state leaks. This98 // 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.
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 read4 //! 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 on5+//! 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 was6 //! 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 the9 //! and `complexity` fields, `.encode(&pcm, frame_size, &mut out)` — from the
10 //! `ec-opus` CELT encoder, which is range-exact against the family's10 //! `ec-opus` CELT encoder, which is range-exact against the family's
11-//! RFC-vector-verified decoder and libopus-verified at every rate up to11+//! 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 the12 //! 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/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 LAME33+ /// 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 the35 /// [`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"),