Audacity 3.2.0
|
#include <CompressorProcessor.h>
Classes | |
struct | FrameStats |
Public Member Functions | |
CompressorProcessor (const DynamicRangeProcessorSettings &settings={ CompressorSettings {} }) | |
CompressorProcessor (const CompressorProcessor &other)=delete | |
~CompressorProcessor () | |
void | ApplySettingsIfNeeded (const DynamicRangeProcessorSettings &settings) |
void | Init (int sampleRate, int numChannels, int blockSize) |
void | Reinit () |
const DynamicRangeProcessorSettings & | GetSettings () const |
void | Process (const float *const *inBlock, float *const *outBlock, int blockLen) |
const std::vector< std::vector< float > > & | GetDelayedInput () const |
const FrameStats & | GetLastFrameStats () const |
float | EvaluateTransferFunction (float inputDb) const |
Static Public Member Functions | |
static float | GetMaxCompressionDb (const DynamicRangeProcessorSettings &settings) |
static float | GetMakeupGainDb (const DynamicRangeProcessorSettings &settings) |
static float | EvaluateTransferFunction (const DynamicRangeProcessorSettings &settings, float inputDb) |
Private Member Functions | |
void | UpdateEnvelope (const float *const *inBlock, int blockLen) |
void | CopyWithDelay (const float *const *inBlock, int blockLen) |
void | ApplyEnvelope (float *const *outBlock, int blockLen, float &delayedInputMax, int &delayedInputMaxIndex) |
bool | Initialized () const |
Private Attributes | |
const std::unique_ptr< DanielRudrich::GainReductionComputer > | mGainReductionComputer |
const std::unique_ptr< DanielRudrich::LookAheadGainReduction > | mLookAheadGainReduction |
DynamicRangeProcessorSettings | mSettings |
int | mSampleRate = 0 |
int | mNumChannels = 0 |
int | mBlockSize = 0 |
std::array< float, maxBlockSize > | mEnvelope |
std::vector< std::vector< float > > | mDelayedInput |
FrameStats | mLastFrameStats |
Static Private Attributes | |
static constexpr auto | maxBlockSize = 512 |
Definition at line 25 of file CompressorProcessor.h.
CompressorProcessor::CompressorProcessor | ( | const DynamicRangeProcessorSettings & | settings = { CompressorSettings {} } | ) |
Definition at line 42 of file CompressorProcessor.cpp.
|
delete |
|
default |
|
private |
Definition at line 181 of file CompressorProcessor.cpp.
References mDelayedInput, mEnvelope, mGainReductionComputer, mLookAheadGainReduction, and mNumChannels.
Referenced by Process().
void CompressorProcessor::ApplySettingsIfNeeded | ( | const DynamicRangeProcessorSettings & | settings | ) |
Definition at line 54 of file CompressorProcessor.cpp.
References GetMakeupGainDb(), DynamicRangeProcessorSettings::lookaheadMs, mGainReductionComputer, mLookAheadGainReduction, mSettings, Reinit(), and settings().
Referenced by CompressorInstance::InstanceProcess().
|
private |
Definition at line 174 of file CompressorProcessor.cpp.
References staffpad::vo::copy(), mDelayedInput, mLookAheadGainReduction, and mNumChannels.
Referenced by Process().
|
static |
Definition at line 34 of file CompressorProcessor.cpp.
References DanielRudrich::GainReductionComputer::getCharacteristicSample(), GetMakeupGainDb(), and settings().
Referenced by anonymous_namespace{DynamicRangeProcessorTransferFunctionPanel.cpp}::DrawTransferFunction(), and GetMaxCompressionDb().
float CompressorProcessor::EvaluateTransferFunction | ( | float | inputDb | ) | const |
Definition at line 142 of file CompressorProcessor.cpp.
References mGainReductionComputer.
const std::vector< std::vector< float > > & CompressorProcessor::GetDelayedInput | ( | ) | const |
Definition at line 131 of file CompressorProcessor.cpp.
References mDelayedInput.
const CompressorProcessor::FrameStats & CompressorProcessor::GetLastFrameStats | ( | ) | const |
|
static |
Audacity: A Digital Audio Editor
Matthieu Hodgkinson
Definition at line 19 of file CompressorProcessor.cpp.
References settings().
Referenced by ApplySettingsIfNeeded(), EvaluateTransferFunction(), and anonymous_namespace{CompressorInstance.cpp}::GetOutputDb().
|
static |
Definition at line 25 of file CompressorProcessor.cpp.
References EvaluateTransferFunction(), and settings().
Referenced by DynamicRangeProcessorEditor::PopulateOrExchange(), and TEST_CASE().
const DynamicRangeProcessorSettings & CompressorProcessor::GetSettings | ( | ) | const |
Definition at line 86 of file CompressorProcessor.cpp.
References mSettings.
void CompressorProcessor::Init | ( | int | sampleRate, |
int | numChannels, | ||
int | blockSize | ||
) |
Definition at line 78 of file CompressorProcessor.cpp.
References maxBlockSize, mBlockSize, min(), mNumChannels, mSampleRate, Reinit(), and anonymous_namespace{ClipSegmentTest.cpp}::sampleRate.
|
private |
Definition at line 232 of file CompressorProcessor.cpp.
References mBlockSize, mNumChannels, and mSampleRate.
Referenced by Process(), and Reinit().
void CompressorProcessor::Process | ( | const float *const * | inBlock, |
float *const * | outBlock, | ||
int | blockLen | ||
) |
Definition at line 91 of file CompressorProcessor.cpp.
References ApplyEnvelope(), CopyWithDelay(), CompressorProcessor::FrameStats::dbGainOfMaxInputSample, FastLog2(), Initialized(), log2ToDb, CompressorProcessor::FrameStats::maxInputSampleDb, mBlockSize, mEnvelope, min(), mLastFrameStats, mNumChannels, and UpdateEnvelope().
Referenced by CompressorInstance::InstanceProcess().
void CompressorProcessor::Reinit | ( | ) |
Definition at line 209 of file CompressorProcessor.cpp.
References compressorMaxLookaheadMs, Initialized(), limiterMaxLookaheadMs, DynamicRangeProcessorSettings::lookaheadMs, mBlockSize, mDelayedInput, mEnvelope, mGainReductionComputer, mLookAheadGainReduction, mNumChannels, mSampleRate, and mSettings.
Referenced by ApplySettingsIfNeeded(), and Init().
|
private |
Definition at line 147 of file CompressorProcessor.cpp.
References DynamicRangeProcessorSettings::lookaheadMs, mEnvelope, mGainReductionComputer, mLookAheadGainReduction, mNumChannels, and mSettings.
Referenced by Process().
|
staticconstexprprivate |
Definition at line 66 of file CompressorProcessor.h.
Referenced by Init().
|
private |
Definition at line 75 of file CompressorProcessor.h.
Referenced by Init(), Initialized(), Process(), and Reinit().
|
private |
Definition at line 78 of file CompressorProcessor.h.
Referenced by ApplyEnvelope(), CopyWithDelay(), GetDelayedInput(), and Reinit().
|
private |
Definition at line 76 of file CompressorProcessor.h.
Referenced by ApplyEnvelope(), Process(), Reinit(), and UpdateEnvelope().
|
private |
Definition at line 69 of file CompressorProcessor.h.
Referenced by ApplyEnvelope(), ApplySettingsIfNeeded(), EvaluateTransferFunction(), Reinit(), and UpdateEnvelope().
|
private |
Definition at line 83 of file CompressorProcessor.h.
Referenced by GetLastFrameStats(), and Process().
|
private |
Definition at line 71 of file CompressorProcessor.h.
Referenced by ApplyEnvelope(), ApplySettingsIfNeeded(), CopyWithDelay(), Reinit(), and UpdateEnvelope().
|
private |
Definition at line 74 of file CompressorProcessor.h.
Referenced by ApplyEnvelope(), CopyWithDelay(), Init(), Initialized(), Process(), Reinit(), and UpdateEnvelope().
|
private |
Definition at line 73 of file CompressorProcessor.h.
Referenced by Init(), Initialized(), and Reinit().
|
private |
Definition at line 72 of file CompressorProcessor.h.
Referenced by ApplySettingsIfNeeded(), GetSettings(), Reinit(), and UpdateEnvelope().