Audacity 3.2.0
|
Implements EBU-R128 loudness measurement. More...
#include <EBUR128.h>
Public Member Functions | |
EBUR128 (double rate, size_t channels) | |
EBUR128 (const EBUR128 &)=delete | |
EBUR128 (EBUR128 &&)=delete | |
~EBUR128 ()=default | |
void | ProcessSampleFromChannel (float x_in, size_t channel) const |
void | NextSample () |
double | IntegrativeLoudness () |
double | IntegrativeLoudnessToLUFS (double loudness) |
Static Public Member Functions | |
static ArrayOf< Biquad > | CalcWeightingFilter (double fs) |
Private Member Functions | |
void | HistogramSums (size_t start_idx, double &sum_v, long int &sum_c) const |
void | AddBlockToHistogram (size_t validLen) |
Private Attributes | |
ArrayOf< long int > | mLoudnessHist |
Doubles | mBlockRingBuffer |
size_t | mSampleCount { 0 } |
size_t | mBlockRingPos { 0 } |
size_t | mBlockRingSize { 0 } |
const size_t | mChannelCount |
const double | mRate |
const size_t | mBlockSize |
const size_t | mBlockOverlap |
ArrayOf< ArrayOf< Biquad > > | mWeightingFilter |
Static Private Attributes | |
static constexpr size_t | HIST_BIN_COUNT = 65536 |
static constexpr double | GAMMA_A = (-70.0 + 0.691) / 10.0 |
EBU R128 absolute threshold. More... | |
EBUR128::EBUR128 | ( | double | rate, |
size_t | channels | ||
) |
Definition at line 14 of file EBUR128.cpp.
References CalcWeightingFilter(), HIST_BIN_COUNT, mBlockRingBuffer, mBlockSize, mChannelCount, mLoudnessHist, mRate, mWeightingFilter, and ArrayOf< X >::reinit().
|
delete |
|
delete |
|
default |
|
private |
Process new full block. Incomplete blocks shall be discarded according to the EBU R128 specification there is usually no need to call this on the last block. However, allow to override the block size if the audio to be processed is shorter than one block.
Definition at line 167 of file EBUR128.cpp.
References GAMMA_A, HIST_BIN_COUNT, mBlockRingBuffer, mBlockRingSize, mBlockSize, mLoudnessHist, and fast_float::round().
Referenced by IntegrativeLoudness(), and NextSample().
Definition at line 42 of file EBUR128.cpp.
References Biquad::A1, Biquad::A2, Biquad::B0, Biquad::B1, Biquad::B2, crypto::anonymous_namespace{SHA256.cpp}::K, and M_PI.
Referenced by EBUR128().
|
private |
Definition at line 149 of file EBUR128.cpp.
References GAMMA_A, HIST_BIN_COUNT, and mLoudnessHist.
Referenced by IntegrativeLoudness().
double EBUR128::IntegrativeLoudness | ( | ) |
Definition at line 115 of file EBUR128.cpp.
References AddBlockToHistogram(), GAMMA_A, HIST_BIN_COUNT, HistogramSums(), mBlockRingSize, and fast_float::round().
|
inline |
void EBUR128::NextSample | ( | ) |
Definition at line 98 of file EBUR128.cpp.
References AddBlockToHistogram(), mBlockOverlap, mBlockRingPos, mBlockRingSize, mBlockSize, and mSampleCount.
Referenced by LoudnessBase::AnalyseBufferBlock().
void EBUR128::ProcessSampleFromChannel | ( | float | x_in, |
size_t | channel | ||
) | const |
Definition at line 83 of file EBUR128.cpp.
References mBlockRingBuffer, mBlockRingPos, and mWeightingFilter.
Referenced by LoudnessBase::AnalyseBufferBlock().
|
staticconstexprprivate |
EBU R128 absolute threshold.
Definition at line 42 of file EBUR128.h.
Referenced by AddBlockToHistogram(), HistogramSums(), and IntegrativeLoudness().
|
staticconstexprprivate |
Definition at line 40 of file EBUR128.h.
Referenced by AddBlockToHistogram(), EBUR128(), HistogramSums(), and IntegrativeLoudness().
|
private |
Definition at line 51 of file EBUR128.h.
Referenced by NextSample().
|
private |
Definition at line 44 of file EBUR128.h.
Referenced by AddBlockToHistogram(), EBUR128(), and ProcessSampleFromChannel().
|
private |
Definition at line 46 of file EBUR128.h.
Referenced by NextSample(), and ProcessSampleFromChannel().
|
private |
Definition at line 47 of file EBUR128.h.
Referenced by AddBlockToHistogram(), IntegrativeLoudness(), and NextSample().
|
private |
Definition at line 50 of file EBUR128.h.
Referenced by AddBlockToHistogram(), EBUR128(), and NextSample().
|
private |
|
private |
Definition at line 43 of file EBUR128.h.
Referenced by AddBlockToHistogram(), EBUR128(), and HistogramSums().
|
private |
|
private |
Definition at line 45 of file EBUR128.h.
Referenced by NextSample().
This is be an array of arrays of the type mWeightingFilter[CHANNEL][FILTER] with CHANNEL = LEFT/RIGHT (0/1) and FILTER = HSF/HPF (0/1)
Definition at line 57 of file EBUR128.h.
Referenced by EBUR128(), and ProcessSampleFromChannel().