![]() |
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 | Initialize () |
void | ProcessSampleFromChannel (float x_in, size_t channel) |
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) |
void | AddBlockToHistogram (size_t validLen) |
Private Attributes | |
ArrayOf< long int > | mLoudnessHist |
Doubles | mBlockRingBuffer |
size_t | mSampleCount |
size_t | mBlockRingPos |
size_t | mBlockRingSize |
size_t | mBlockSize |
size_t | mBlockOverlap |
size_t | mChannelCount |
double | mRate |
ArrayOf< ArrayOf< Biquad > > | mWeightingFilter |
Static Private Attributes | |
static const 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, mBlockOverlap, 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 172 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 48 of file EBUR128.cpp.
References Biquad::A1, Biquad::A2, Biquad::B0, Biquad::B1, Biquad::B2, and M_PI.
Referenced by EBUR128().
|
private |
Definition at line 154 of file EBUR128.cpp.
References GAMMA_A, HIST_BIN_COUNT, and mLoudnessHist.
Referenced by IntegrativeLoudness().
void EBUR128::Initialize | ( | ) |
Definition at line 27 of file EBUR128.cpp.
References HIST_BIN_COUNT, mBlockRingPos, mBlockRingSize, mChannelCount, mLoudnessHist, mSampleCount, and mWeightingFilter.
double EBUR128::IntegrativeLoudness | ( | ) |
Definition at line 121 of file EBUR128.cpp.
References AddBlockToHistogram(), GAMMA_A, HIST_BIN_COUNT, HistogramSums(), mBlockRingSize, and fast_float::round().
|
inline |
void EBUR128::NextSample | ( | ) |
Definition at line 104 of file EBUR128.cpp.
References AddBlockToHistogram(), mBlockOverlap, mBlockRingPos, mBlockRingSize, mBlockSize, and mSampleCount.
void EBUR128::ProcessSampleFromChannel | ( | float | x_in, |
size_t | channel | ||
) |
Definition at line 89 of file EBUR128.cpp.
References mBlockRingBuffer, mBlockRingPos, and mWeightingFilter.
|
staticconstexprprivate |
EBU R128 absolute threshold.
Definition at line 43 of file EBUR128.h.
Referenced by AddBlockToHistogram(), HistogramSums(), and IntegrativeLoudness().
|
staticprivate |
Definition at line 41 of file EBUR128.h.
Referenced by AddBlockToHistogram(), EBUR128(), HistogramSums(), Initialize(), and IntegrativeLoudness().
|
private |
Definition at line 50 of file EBUR128.h.
Referenced by EBUR128(), and NextSample().
|
private |
Definition at line 45 of file EBUR128.h.
Referenced by AddBlockToHistogram(), EBUR128(), and ProcessSampleFromChannel().
|
private |
Definition at line 47 of file EBUR128.h.
Referenced by Initialize(), NextSample(), and ProcessSampleFromChannel().
|
private |
Definition at line 48 of file EBUR128.h.
Referenced by AddBlockToHistogram(), Initialize(), IntegrativeLoudness(), and NextSample().
|
private |
Definition at line 49 of file EBUR128.h.
Referenced by AddBlockToHistogram(), EBUR128(), and NextSample().
|
private |
Definition at line 51 of file EBUR128.h.
Referenced by EBUR128(), and Initialize().
|
private |
Definition at line 44 of file EBUR128.h.
Referenced by AddBlockToHistogram(), EBUR128(), HistogramSums(), and Initialize().
|
private |
Definition at line 46 of file EBUR128.h.
Referenced by Initialize(), and 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 58 of file EBUR128.h.
Referenced by EBUR128(), Initialize(), and ProcessSampleFromChannel().