DSPark 1.8.0
Header-only C++20 DSP for real-time and offline audio
Loading...
Searching...
No Matches
dspark::OfflinePeakCompressor< T > Class Template Referencefinal

Complete-file peak compressor with a positive reduction-dB control. More...

#include <OfflinePeakCompressor.h>

Classes

struct  Options
 
class  Plan
 Immutable source-bound sparse gain plan; positions are int64 source frames. More...
 
struct  PlanResult
 
struct  Report
 
struct  Result
 

Public Types

enum class  Reason : std::uint8_t {
  Compressed , CrestLimited , ResolutionLimited , ProtectedPeaks ,
  ZeroAmount , NoSignal , AllExcluded , NoCorrection
}
 

Public Member Functions

PlanResult makePlan (OfflineAudioSource< T > &source, const typename OfflineTransientAnalyzer< T >::Analysis &analysis, const Options &options={}, const OfflineJobOptions &jobOptions={}) const
 Reuses a transient map and measures the actual stage PCM. Three bounded scans measure sustained headroom, count holds and fill them. All scans verify the analysis fingerprint. A positive amount requires an attack map; zero amount accepts energy-only analysis and skips these scans.
 
PlanResult analyze (OfflineAudioSource< T > &source, const Options &options={}, const OfflineJobOptions &job={}) const
 Complete-source analysis and planning; retains only sparse automation.
 
Result render (OfflineAudioSource< T > &source, const Plan &plan, OfflineAudioSink< T > &sink, const OfflineJobOptions &job={}) const
 Verifies and renders transactionally; reports the actual final peak reduction.
 
template<int MaxChannels>
Result run (const AudioBuffer< T, MaxChannels > &input, AudioBuffer< T, MaxChannels > &output, double sampleRate, const Options &options={}, const OfflineJobOptions &job={}) const
 Owning convenience render; aliases are safe and failures preserve output.
 

Detailed Description

template<FloatType T>
class dspark::OfflinePeakCompressor< T >

Complete-file peak compressor with a positive reduction-dB control.

Definition at line 48 of file OfflinePeakCompressor.h.

Member Enumeration Documentation

◆ Reason

template<FloatType T>
enum class dspark::OfflinePeakCompressor::Reason : std::uint8_t
strong
Enumerator
Compressed 
CrestLimited 
ResolutionLimited 
ProtectedPeaks 
ZeroAmount 
NoSignal 
AllExcluded 
NoCorrection 

Definition at line 58 of file OfflinePeakCompressor.h.

Member Function Documentation

◆ analyze()

template<FloatType T>
PlanResult dspark::OfflinePeakCompressor< T >::analyze ( OfflineAudioSource< T > &  source,
const Options &  options = {},
const OfflineJobOptions &  job = {} 
) const
inline

Complete-source analysis and planning; retains only sparse automation.

Definition at line 273 of file OfflinePeakCompressor.h.

◆ makePlan()

template<FloatType T>
PlanResult dspark::OfflinePeakCompressor< T >::makePlan ( OfflineAudioSource< T > &  source,
const typename OfflineTransientAnalyzer< T >::Analysis &  analysis,
const Options &  options = {},
const OfflineJobOptions &  jobOptions = {} 
) const
inline

Reuses a transient map and measures the actual stage PCM. Three bounded scans measure sustained headroom, count holds and fill them. All scans verify the analysis fingerprint. A positive amount requires an attack map; zero amount accepts energy-only analysis and skips these scans.

Definition at line 160 of file OfflinePeakCompressor.h.

◆ render()

template<FloatType T>
Result dspark::OfflinePeakCompressor< T >::render ( OfflineAudioSource< T > &  source,
const Plan &  plan,
OfflineAudioSink< T > &  sink,
const OfflineJobOptions &  job = {} 
) const
inline

Verifies and renders transactionally; reports the actual final peak reduction.

Definition at line 302 of file OfflinePeakCompressor.h.

◆ run()

template<FloatType T>
template<int MaxChannels>
Result dspark::OfflinePeakCompressor< T >::run ( const AudioBuffer< T, MaxChannels > &  input,
AudioBuffer< T, MaxChannels > &  output,
double  sampleRate,
const Options &  options = {},
const OfflineJobOptions &  job = {} 
) const
inline

Owning convenience render; aliases are safe and failures preserve output.

Definition at line 365 of file OfflinePeakCompressor.h.


The documentation for this class was generated from the following file: