Struct ebur128::EbuR128 [−][src]
pub struct EbuR128 { /* fields omitted */ }
Expand description
EBU R128 loudness analyzer.
Implementations
Create a new instance with the given configuration.
Get the configured channel types.
Get the configured maximum window duration in ms.
Get the configured maximum history in ms.
Set channel type.
The default is:
- 0 ->
Left
- 1 ->
Right
- 2 ->
Center
- 3 ->
Unused
- 4 ->
LeftSurround
- 5 ->
RightSurround
- _ ->
Unused
Set channel types.
The default is:
- 0 ->
Left
- 1 ->
Right
- 2 ->
Center
- 3 ->
Unused
- 4 ->
LeftSurround
- 5 ->
RightSurround
- _ ->
Unused
Change library parameters.
Note that the channel map will be reset when setting a different number of channels. The current unfinished block will be lost.
Set the maximum window duration.
Set the maximum duration in ms that will be used for
EbuR128::loudness_window
. Note that this
destroys the current content of the audio buffer.
Set the maximum history.
Set the maximum history in ms that will be stored for loudness integration. More history provides more accurate results, but requires more resources.
Applies to EbuR128::loudness_range
and
EbuR128::loudness_global
when
Mode::HISTOGRAM
is not set.
Default is ULONG_MAX
(at least ~50 days). Minimum is 3000ms for Mode::LRA
and 400ms
for Mode::M
.
Add interleaved frames to be processed.
Add interleaved frames to be processed.
Add interleaved frames to be processed.
Add interleaved frames to be processed.
Add planar frames to be processed.
Add planar frames to be processed.
Add planar frames to be processed.
Add planar frames to be processed.
Add interleaved frames to warmup filters, but not be considered for measurements.
See EbuR128::loudness_global_multiple
for example usage.
Add interleaved frames to warmup filters, but not be considered for measurements.
See EbuR128::loudness_global_multiple
for example usage.
Add interleaved frames to warmup filters, but not be considered for measurements.
See EbuR128::loudness_global_multiple
for example usage.
Add interleaved frames to warmup filters, but not be considered for measurements.
See EbuR128::loudness_global_multiple
for example usage.
Add planar frames to warmup filters, but not be considered for measurements.
See EbuR128::loudness_global_multiple
for example usage.
Add planar frames to warmup filters, but not be considered for measurements.
See EbuR128::loudness_global_multiple
for example usage.
Add planar frames to warmup filters, but not be considered for measurements.
See EbuR128::loudness_global_multiple
for example usage.
Add planar frames to warmup filters, but not be considered for measurements.
See EbuR128::loudness_global_multiple
for example usage.
Get global integrated loudness in LUFS.
Get global integrated loudness in LUFS across multiple instances.
This can be used to allow parallel iteration of long signals, assuming some care is taken:
- Divide input-signal up in “chunks” of even 100ms samples. Make chunks overlap by 400ms, for example (0-10s, 9.6-20s, 19.6-30s, …)
- The first chunk is processed as normal. Then in parallel, for each remaining chunk, create a new instance of
EbuR128
, and in parallel:- Feed the first 100ms of the chunk (these are samples overlapping with last chunk) through
seed_frames_*
function. This is sufficient to make filter-states in each instance what they would have been if a single analyzer would have reached this point. - Process the remaining samples of each chunk through the analyzer
- Feed the first 100ms of the chunk (these are samples overlapping with last chunk) through
- Call
EbuR128::loudness_global_multiple
over all the chunks to get the global loudness
Get momentary loudness (last 400ms) in LUFS.
Get short-term loudness (last 3s) in LUFS.
Get loudness of the specified window in LUFS.
window must not be larger than the current window. The current window can be changed by
calling EbuR128::set_max_window
.
Get loudness range (LRA) of programme in LU.
Calculates loudness range according to EBU 3342.
pub fn loudness_range_multiple<'a>(
iter: impl IntoIterator<Item = &'a Self>
) -> Result<f64, Error>
pub fn loudness_range_multiple<'a>(
iter: impl IntoIterator<Item = &'a Self>
) -> Result<f64, Error>
Get loudness range (LRA) of programme in LU across multiple instances.
Calculates loudness range according to EBU 3342.
Get maximum sample peak from all frames that have been processed.
The equation to convert to dBFS is: 20 * log10(out)
Get maximum sample peak from the last call to
EbuR128::add_frames
.
The equation to convert to dBFS is: 20 * log10(out)
Get maximum true peak from all frames that have been processed.
Uses an implementation defined algorithm to calculate the true peak. Do not try to compare resulting values across different versions of the library, as the algorithm may change.
The current implementation uses a custom polyphase FIR interpolator to calculate true peak. Will oversample 4x for sample rates < 96000 Hz, 2x for sample rates < 192000 Hz and leave the signal unchanged for 192000 Hz.
The equation to convert to dBTP is: 20 * log10(out)
Get maximum true peak from the last call to
EbuR128::add_frames
.
Uses an implementation defined algorithm to calculate the true peak. Do not try to compare resulting values across different versions of the library, as the algorithm may change.
The current implementation uses a custom polyphase FIR interpolator to calculate true peak. Will oversample 4x for sample rates < 96000 Hz, 2x for sample rates < 192000 Hz and leave the signal unchanged for 192000 Hz.
The equation to convert to dBTP is: 20 * log10(out)
Get relative threshold in LUFS.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for EbuR128
impl UnwindSafe for EbuR128