Skip to main content

ReadingThresholds

Struct ReadingThresholds 

Source
pub struct ReadingThresholds {
Show 56 fields pub sharp_shelf_db: f64, pub full_band: f64, pub natural_limit: f64, pub inner_shelf_db: f64, pub high_step_db: f64, pub clear_db: f64, pub min_windows: usize, pub min_seconds: f64, pub few_seconds_over: f64, pub consistent_share: f64, pub transcode_share: f64, pub cluster_hz: f64, pub ceiling: f64, pub mixed_share: f64, pub lower_rate_edges: Vec<f64>, pub other_rate_edges: Vec<RateEdge>, pub mono_correlation: f64, pub mono_side_db: f64, pub confidence_cap: f64, pub quiet_dbfs: f64, pub high_bitrate_kbps: u32, pub profiles: Vec<EncoderProfile>, pub aac_grid_z: f64, pub aac_grid_segments_agreeing: usize, pub mp3_grid_z: f64, pub mp3_grid_segments_agreeing: usize, pub uncut_grid_segments_agreeing: usize, pub mp2_grid_z: f64, pub mp2_all_agreeing_grid_z: f64, pub mp2_uncut_grid_z: f64, pub mp2_grid_segments_agreeing: usize, pub vorbis_grid_z: f64, pub vorbis_grid_segments_agreeing: usize, pub wma_grid_z: f64, pub wma_grid_segments_agreeing: usize, pub ac3_grid_z: f64, pub ac3_grid_segments_agreeing: usize, pub part_grid_z: f64, pub part_grid_segments: usize, pub lone_grid_z: f64, pub block_phase_segments: usize, pub other_rate_aac_z: f64, pub mp3_whole_steps: usize, pub mp3_whole_steps_segments: usize, pub aac_whole_steps: usize, pub aac_whole_steps_segments: usize, pub opus_grid_frames: usize, pub opus_uncut_frames: usize, pub opus_shifted_frames: usize, pub opus_shifted_uncut_frames: usize, pub opus_unfiltered_frames: usize, pub opus_short_frames: usize, pub opus_short_uncut_frames: usize, pub fraunhofer_steps: FraunhoferSteps, pub opus_hybrid_steps: usize, pub opus_hybrid_share: f64,
}
Expand description

Thresholds the measures are read with.

A reading is quick, so these can be swept over audio measured once.

No value is checked against a range. One outside what its field describes, or not a number, gives a reading that means nothing, and no panic.

Fields§

§sharp_shelf_db: f64

Least drop in dB across the cutoff for an encoder’s low-pass.

A smaller drop is a natural roll-off.

§full_band: f64

Fraction of the top from which a cutoff counts as full band.

A cutoff at or above this fraction of the band’s top counts as reaching it. Set below MeasureThresholds::full_band, it counts as full some windows that measuring never searched for inner steps.

§natural_limit: f64

Fraction of the top under which a gentle roll-off is not judged.

Content that rolls off gently below it is band-limited by nature, and the reading says it cannot tell.

§inner_shelf_db: f64

Least inner step in dB that reads as a band-limited layer.

A step of at least this size inside a full band is a band-limited layer under it.

§high_step_db: f64

Least step in dB at a top-bitrate cutoff that casts doubt.

Such a step under a band that reaches the top reads as something the analyzer cannot tell, which costs an honest file nothing. Honest spectra step by a decibel or two there.

§clear_db: f64

Height in dB over the cutoff line that makes a band content.

The band above a step is content only at this height or more. Nearer the line it is the recording’s noise floor, hiss or dither.

§min_windows: usize

Fewest non-silent windows a reading needs.

§min_seconds: f64

Fewest seconds of non-silent audio a reading needs.

§few_seconds_over: f64

Seconds past min_seconds with little to go on.

Within this many seconds over min_seconds a reading says it has little to go on. There each second moves the shares its rules compare by about 2.5 percent, so a few odd seconds can tip it.

§consistent_share: f64

Share of windows at the top of the band for consistent content.

At least this share of windows must reach the top for the content to be consistent with its claim.

§transcode_share: f64

Share of windows that stop at one encoder cutoff for a transcode.

§cluster_hz: f64

Distance in Hz at which a cutoff still shares the common one.

§ceiling: f64

Percentile of a lossy file’s cutoffs read as its encoder’s ceiling.

§mixed_share: f64

Share of windows each of two sources has for mixed sources.

§lower_rate_edges: Vec<f64>

Band tops in Hz of the sample rates audio is commonly made at.

Content that stops with a cliff at one, in a file whose band reaches past it, was made at that rate.

§other_rate_edges: Vec<RateEdge>

Band edges of rates some old equipment recorded at.

They are left out of lower_rate_edges because they sit on encoder cutoffs (18.9 kHz beside 192 kbps MP3’s). A cliff at one reads as that encoder, with a limitation naming the rate.

§mono_correlation: f64

Correlation above which two channels hold the same audio.

It applies together with a side channel at or below mono_side_db.

§mono_side_db: f64

Side-to-mid level in dB at or below which channels match.

At or below this level of the side channel relative to the mid channel, the two channels hold the same audio.

§confidence_cap: f64

Highest confidence a reading has, from 0 to 1.

A reading by a grid has this confidence itself, so a cap that is negative or not a number is the confidence of such a reading.

§quiet_dbfs: f64

Median window level in dBFS under which a file is quiet.

A quiet file makes a reading less sure.

§high_bitrate_kbps: u32

Bitrate in kbit/s from which a cutoff may be a filter.

Profiles at this bitrate and above cut where some recordings are filtered when they are made, so a sharp shelf there reads as something the analyzer cannot tell, never as a transcode.

§profiles: Vec<EncoderProfile>

Cutoffs of common lossy encoder settings, lowest first.

§aac_grid_z: f64

Robust z over which the AAC scan finds a frame grid.

It is compared with CodecScan::z. A lower value finds more grids in decodes that hide them, such as clipped ones, and finds them in more lossless files whose counts happen to dip at one offset.

§aac_grid_segments_agreeing: usize

Fewest segments that put their lowest count at the file’s offset, for an AAC grid.

It is compared with CodecScan::segments_agreeing. A decode carries one grid from start to end, so every segment finds it at the same offset. The segments of a lossless file can agree on an offset too, so agreement alone is no grid: it only narrows what the z threshold finds. A file that holds a lossy section only in part falls short, and so does a Vorbis decode, whose grid the AAC scan finds at an offset that moves between segments.

§mp3_grid_z: f64

Robust z over which the MP3 scan finds a frame grid.

It is compared with CodecScan::z, as aac_grid_z is.

§mp3_grid_segments_agreeing: usize

Fewest segments that put their lowest count at the file’s offset, for an MP3 grid.

It is compared with CodecScan::segments_agreeing, as aac_grid_segments_agreeing is.

§uncut_grid_segments_agreeing: usize

Fewest segments that agree, for a grid in part of the file at an uncut decode’s offset.

An encoder’s delay puts the grid of its decode at a fixed offset when the start was not cut (Family), a libvorbis stream’s long blocks sit at one place within each 128 samples, and an AC-3 stream’s first block starts at the first sample. Fewer segments than the codec’s own threshold asks for (aac_grid_segments_agreeing and those of MP3, Vorbis and AC-3) show a grid in part of the file there, with the same z, as the segments of a lossless file rarely agree on that one offset.

§mp2_grid_z: f64

Robust z over which the MP2 scan finds a frame grid.

It is compared with CodecScan::z of Scan::mp2.

§mp2_all_agreeing_grid_z: f64

Robust z over which an MP2 count every segment agrees on finds a frame grid.

The MP2 scan counts at 32 phases, so three segments share one by chance far more often than three share an offset of another codec’s grid, and four far less often than three.

§mp2_uncut_grid_z: f64

Robust z over which an MP2 count at an uncut decode’s phase finds a frame grid.

An MP2 decode whose start was not cut has its count at one phase of the 32, which the segments of a lossless file rarely agree on. An MP3 decode’s count can sit there too, so it applies where MP3’s quantizer steps show in no segment.

§mp2_grid_segments_agreeing: usize

Fewest segments that put their lowest count at the file’s phase, for an MP2 grid.

It is compared with CodecScan::segments_agreeing, as mp3_grid_segments_agreeing is.

§vorbis_grid_z: f64

Robust z over which the Vorbis scan finds a frame grid.

It is compared with CodecScan::z of Scan::vorbis.

§vorbis_grid_segments_agreeing: usize

Fewest segments whose lowest count sits a whole number of steps from the file’s offset.

A Vorbis stream’s short blocks move its long ones by 128 samples each, so its segments rarely share an offset and always share one modulo 128. It is compared with the segments of CodecScan::segment_offset that do.

§wma_grid_z: f64

Robust z over which the WMA scan finds a frame grid.

It is compared with CodecScan::z of Scan::wma.

§wma_grid_segments_agreeing: usize

Fewest segments that put their lowest count at the file’s offset, for a WMA grid.

It is compared with CodecScan::segments_agreeing, as mp3_grid_segments_agreeing is.

§ac3_grid_z: f64

Robust z over which the AC-3 scan finds a frame grid.

It is compared with CodecScan::z of Scan::ac3.

§ac3_grid_segments_agreeing: usize

Fewest segments that put their lowest count at the file’s offset, for an AC-3 grid.

It is compared with CodecScan::segments_agreeing, as mp3_grid_segments_agreeing is.

§part_grid_z: f64

Robust z a segment’s own count passes to show a grid in part of the file.

It is compared with each of CodecScan::segment_z whose segment puts its lowest count at the file’s offset, where no grid shows in the file as a whole.

§part_grid_segments: usize

Fewest segments that pass part_grid_z, for a grid in part of the file, one at least.

§lone_grid_z: f64

Robust z one segment’s own count passes to show a grid in part of the file by itself.

It applies where the file’s offset is one an uncut decode has, as uncut_grid_segments_agreeing does. One segment of a lossless file can stand far out at some offset, and rarely at that one.

The scan at the other rate takes one such segment too, for a decode converted afterwards.

§block_phase_segments: usize

Fewest segments whose subband count is lowest at a block-aligned phase, for a grid.

It is compared with the segments of Scan::mp2 whose phase is one an uncut MP3 or Vorbis decode has. Their blocks start a whole number of the filterbank’s 32 samples apart, so every segment’s count is lowest at the same phase, however little it stands out. The reading names Vorbis where a segment sits at the phase only its decodes have, and MP3 otherwise.

It is compared too with the segments at the phase an uncut MP2 decode has, which read as MP2 where MP3’s quantizer steps show in none.

§other_rate_aac_z: f64

Robust z over which the AAC scan at the other rate finds a frame grid.

It is compared with the z of OtherRate::aac and of OtherRate::aac_sine, with the agreement aac_grid_segments_agreeing asks for. Decodes of other codecs dip further at the other rate than lossless files do at their own, so it stands over aac_grid_z.

§mp3_whole_steps: usize

Fewest scalefactor bands on whole steps in a segment, for an MP3 grid.

It is compared with each of Mp3Steps::segment_whole, the bands on whole steps of MP3’s quantizer, where no count stands out enough for a grid: as many segments as mp3_grid_segments_agreeing must reach it, one at least. A band of lossless audio lands on a whole step by chance a few times in a file.

§mp3_whole_steps_segments: usize

Fewest segments that reach mp3_whole_steps, for an MP3 grid in part of the file.

One at least. It applies where fewer segments reach it than a grid in the whole file asks for. One segment is enough where its lowest count is at the file’s offset and that offset is one an uncut decode has.

§aac_whole_steps: usize

Fewest scalefactor bands on whole steps in a segment, for an AAC grid.

It is compared with each of AacSteps::segment_whole, the bands on whole steps of AAC’s quantizer, under each window. The steps show a grid no count stands out enough for, and name the window of one a count found.

§aac_whole_steps_segments: usize

Fewest segments that reach aac_whole_steps, for an AAC grid, one at least.

§opus_grid_frames: usize

Fewest frames on Opus’s lattice at one offset, for an Opus grid.

It is compared with OpusScan::frames, the count over the four segments. A frame of lossless audio lands on the lattice by chance at some offset in some files, never at the same offset often.

§opus_uncut_frames: usize

Fewest frames on Opus’s lattice in the windows, for an Opus grid.

It is compared with OpusScan::uncut_frames, the count on the one grid a decode has when nothing was cut from its start.

§opus_shifted_frames: usize

Fewest frames on Opus’s lattice at another level, at one offset.

It is compared with OpusShifted::frames, the count over the four segments, where neither count at the decoder’s own level makes an Opus grid. The search for the level gives chance more frames than opus_grid_frames meets.

§opus_shifted_uncut_frames: usize

Fewest frames on Opus’s lattice at another level in the windows.

It is compared with OpusShifted::uncut_frames, as opus_shifted_frames is with its count.

§opus_unfiltered_frames: usize

Fewest frames on Opus’s lattice once the pitch post-filter is taken off, in the windows.

It is compared with OpusUnfiltered::frames, where no count at the decoder’s level, at another level or of frames under 20 ms makes an Opus grid. The search for the filter gives chance more frames than opus_uncut_frames meets.

§opus_short_frames: usize

Fewest frames under 20 ms on Opus’s lattice at one offset.

It is compared with OpusShort::frames of each length, the count over the four segments, where no count of 20 ms frames makes an Opus grid.

§opus_short_uncut_frames: usize

Fewest frames under 20 ms on Opus’s lattice in the windows.

It is compared with OpusShort::uncut_frames of each length, as opus_short_frames is with its count.

§fraunhofer_steps: FraunhoferSteps

Weights that read an MP3 grid at offset 1 as Fraunhofer’s encoder.

§opus_hybrid_steps: usize

Fewest different pairs of steps among Opus’s hybrid frames.

It is compared with OpusHybrid::steps and with OpusHybrid::uncut_steps, where no other count makes an Opus grid. The frames counted must meet opus_hybrid_share too.

§opus_hybrid_share: f64

Fewest hybrid frames as a share of the frames tested, from 0 to 1.

The two bands a hybrid frame is tested on land on the lattice by chance in a few frames of a hundred, which in a long file is more pairs of steps than opus_hybrid_steps.

Trait Implementations§

Source§

impl Clone for ReadingThresholds

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ReadingThresholds

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ReadingThresholds

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for ReadingThresholds

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for ReadingThresholds

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for ReadingThresholds

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for ReadingThresholds

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<F, T> IntoSample<T> for F
where T: FromSample<F>,

Source§

fn into_sample(self) -> T

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more