MythTV  master
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
fsurround_decoder::Impl Class Reference
Collaboration diagram for fsurround_decoder::Impl:
[legend]

Public Member Functions

 Impl (unsigned blocksize=8192)
 
 ~Impl ()
 
float ** getInputBuffers ()
 
float ** getOutputBuffers ()
 
void decode (float center_width, float dimension, float adaption_rate)
 
void flush ()
 
void sample_rate (unsigned int srate)
 
void surround_coefficients (float a, float b)
 
void phase_mode (unsigned mode)
 
void steering_mode (bool mode)
 
void separation (float front, float rear)
 

Private Member Functions

void add_output (InputBufs input1, InputBufs input2, float center_width, float dimension, float adaption_rate, bool=false)
 
void block_decode (InputBufs input1, InputBufs input2, OutputBufs output, float center_width, float dimension, float adaption_rate)
 
void apply_filter (cfloat *signal, const float *flt, float *target)
 Filter the complex source signal in the frequency domain and add it to the time domain target signal. More...
 

Static Private Member Functions

static cfloat polar (float a, float p)
 
static float amplitude (AVComplexFloat z)
 
static float phase (AVComplexFloat z)
 
static float clamp_unit_mag (float x)
 Clamp the input to the interval [-1, 1], i.e. clamp the magnitude to the unit interval [0, 1]. More...
 
static double get_yfs (double ampDiff, double phaseDiff)
 
static double get_xfs (double ampDiff, double yfs)
 

Private Attributes

size_t m_n
 
size_t m_halfN
 
AVTXContext * m_fftContext {nullptr}
 
av_tx_fn m_fft {nullptr}
 
AVTXContext * m_ifftContext {nullptr}
 
av_tx_fn m_ifft {nullptr}
 
AVComplexFloat * m_dftL {nullptr}
 
AVComplexFloat * m_dftR {nullptr}
 
AVComplexFloat * m_src {nullptr}
 Used only in apply_filter. More...
 
std::vector< cfloatm_frontL
 
std::vector< cfloatm_frontR
 
std::vector< cfloatm_avg
 
std::vector< cfloatm_surL
 
std::vector< cfloatm_surR
 
std::vector< cfloatm_trueavg
 
std::vector< float > m_xFs
 
std::vector< float > m_yFs
 
std::vector< float > m_wnd
 
std::array< std::vector< float >, 6 > m_filter
 
std::array< std::vector< float >, 2 > m_inbuf
 
std::array< std::vector< float >, 6 > m_outbuf
 
float m_surroundHigh {0.0F}
 
float m_surroundLow {0.0F}
 
float m_surroundBalance {0.0F}
 
float m_surroundLevel {0.0F}
 
float m_phaseOffsetL {0.0F}
 
float m_phaseOffsetR {0.0F}
 
float m_frontSeparation {0.0F}
 
float m_rearSeparation {0.0F}
 
bool m_linearSteering {false}
 
cfloat m_a
 
cfloat m_b
 
cfloat m_c
 
cfloat m_d
 
cfloat m_e
 
cfloat m_f
 
cfloat m_g
 
cfloat m_h
 
int m_currentBuf
 
InputBufs m_inbufs {}
 
OutputBufs m_outbufs {}
 

Static Private Attributes

static constexpr float kScale {1.0F}
 

Detailed Description

Definition at line 44 of file freesurround_decoder.cpp.

Constructor & Destructor Documentation

◆ Impl()

fsurround_decoder::Impl::Impl ( unsigned  blocksize = 8192)
inlineexplicit

Definition at line 48 of file freesurround_decoder.cpp.

◆ ~Impl()

fsurround_decoder::Impl::~Impl ( )
inline

Definition at line 91 of file freesurround_decoder.cpp.

Member Function Documentation

◆ getInputBuffers()

float** fsurround_decoder::Impl::getInputBuffers ( )
inline

Definition at line 99 of file freesurround_decoder.cpp.

Referenced by fsurround_decoder::getInputBuffers().

◆ getOutputBuffers()

float** fsurround_decoder::Impl::getOutputBuffers ( )
inline

Definition at line 106 of file freesurround_decoder.cpp.

Referenced by fsurround_decoder::getOutputBuffers().

◆ decode()

void fsurround_decoder::Impl::decode ( float  center_width,
float  dimension,
float  adaption_rate 
)
inline

Definition at line 121 of file freesurround_decoder.cpp.

Referenced by fsurround_decoder::decode().

◆ flush()

void fsurround_decoder::Impl::flush ( )
inline

Definition at line 133 of file freesurround_decoder.cpp.

Referenced by fsurround_decoder::flush().

◆ sample_rate()

void fsurround_decoder::Impl::sample_rate ( unsigned int  srate)
inline

Definition at line 143 of file freesurround_decoder.cpp.

Referenced by Impl(), and fsurround_decoder::sample_rate().

◆ surround_coefficients()

void fsurround_decoder::Impl::surround_coefficients ( float  a,
float  b 
)
inline

Definition at line 155 of file freesurround_decoder.cpp.

Referenced by Impl(), and fsurround_decoder::surround_coefficients().

◆ phase_mode()

void fsurround_decoder::Impl::phase_mode ( unsigned  mode)
inline

Definition at line 172 of file freesurround_decoder.cpp.

Referenced by Impl(), and fsurround_decoder::phase_mode().

◆ steering_mode()

void fsurround_decoder::Impl::steering_mode ( bool  mode)
inline

Definition at line 179 of file freesurround_decoder.cpp.

Referenced by Impl(), and fsurround_decoder::steering_mode().

◆ separation()

void fsurround_decoder::Impl::separation ( float  front,
float  rear 
)
inline

Definition at line 182 of file freesurround_decoder.cpp.

Referenced by Impl(), and fsurround_decoder::separation().

◆ polar()

static cfloat fsurround_decoder::Impl::polar ( float  a,
float  p 
)
inlinestaticprivate

Definition at line 189 of file freesurround_decoder.cpp.

Referenced by block_decode().

◆ amplitude()

static float fsurround_decoder::Impl::amplitude ( AVComplexFloat  z)
inlinestaticprivate

Definition at line 190 of file freesurround_decoder.cpp.

Referenced by block_decode().

◆ phase()

static float fsurround_decoder::Impl::phase ( AVComplexFloat  z)
inlinestaticprivate

Definition at line 191 of file freesurround_decoder.cpp.

Referenced by block_decode().

◆ clamp_unit_mag()

static float fsurround_decoder::Impl::clamp_unit_mag ( float  x)
inlinestaticprivate

Clamp the input to the interval [-1, 1], i.e. clamp the magnitude to the unit interval [0, 1].

Definition at line 194 of file freesurround_decoder.cpp.

Referenced by block_decode().

◆ add_output()

void fsurround_decoder::Impl::add_output ( InputBufs  input1,
InputBufs  input2,
float  center_width,
float  dimension,
float  adaption_rate,
bool  = false 
)
inlineprivate

Definition at line 197 of file freesurround_decoder.cpp.

Referenced by decode().

◆ block_decode()

void fsurround_decoder::Impl::block_decode ( InputBufs  input1,
InputBufs  input2,
OutputBufs  output,
float  center_width,
float  dimension,
float  adaption_rate 
)
inlineprivate

Definition at line 204 of file freesurround_decoder.cpp.

Referenced by add_output().

◆ get_yfs()

static double fsurround_decoder::Impl::get_yfs ( double  ampDiff,
double  phaseDiff 
)
inlinestaticprivate

Definition at line 337 of file freesurround_decoder.cpp.

Referenced by block_decode().

◆ get_xfs()

static double fsurround_decoder::Impl::get_xfs ( double  ampDiff,
double  yfs 
)
inlinestaticprivate

Definition at line 350 of file freesurround_decoder.cpp.

Referenced by block_decode().

◆ apply_filter()

void fsurround_decoder::Impl::apply_filter ( cfloat signal,
const float *  flt,
float *  target 
)
inlineprivate

Filter the complex source signal in the frequency domain and add it to the time domain target signal.

Parameters
[in]signalThe signal, in the frequency domain, to be filtered.
[in]fltThe filter, in the frequency domain, to be applied.
[out]targetThe signal, in the time domain, to which the filtered signal is added

Definition at line 393 of file freesurround_decoder.cpp.

Referenced by block_decode().

Member Data Documentation

◆ m_n

size_t fsurround_decoder::Impl::m_n
private

Definition at line 418 of file freesurround_decoder.cpp.

Referenced by apply_filter(), flush(), Impl(), and sample_rate().

◆ m_halfN

size_t fsurround_decoder::Impl::m_halfN
private

◆ kScale

constexpr float fsurround_decoder::Impl::kScale {1.0F}
staticconstexprprivate

Definition at line 420 of file freesurround_decoder.cpp.

Referenced by Impl().

◆ m_fftContext

AVTXContext* fsurround_decoder::Impl::m_fftContext {nullptr}
private

Definition at line 421 of file freesurround_decoder.cpp.

Referenced by block_decode(), Impl(), and ~Impl().

◆ m_fft

av_tx_fn fsurround_decoder::Impl::m_fft {nullptr}
private

Definition at line 422 of file freesurround_decoder.cpp.

Referenced by block_decode(), and Impl().

◆ m_ifftContext

AVTXContext* fsurround_decoder::Impl::m_ifftContext {nullptr}
private

Definition at line 423 of file freesurround_decoder.cpp.

Referenced by apply_filter(), Impl(), and ~Impl().

◆ m_ifft

av_tx_fn fsurround_decoder::Impl::m_ifft {nullptr}
private

Definition at line 424 of file freesurround_decoder.cpp.

Referenced by apply_filter(), and Impl().

◆ m_dftL

AVComplexFloat* fsurround_decoder::Impl::m_dftL {nullptr}
private

Definition at line 426 of file freesurround_decoder.cpp.

Referenced by block_decode(), and ~Impl().

◆ m_dftR

AVComplexFloat* fsurround_decoder::Impl::m_dftR {nullptr}
private

Definition at line 427 of file freesurround_decoder.cpp.

Referenced by block_decode(), and ~Impl().

◆ m_src

AVComplexFloat* fsurround_decoder::Impl::m_src {nullptr}
private

Used only in apply_filter.

Definition at line 428 of file freesurround_decoder.cpp.

Referenced by apply_filter(), and ~Impl().

◆ m_frontL

std::vector<cfloat> fsurround_decoder::Impl::m_frontL
private

Definition at line 430 of file freesurround_decoder.cpp.

Referenced by block_decode(), and Impl().

◆ m_frontR

std::vector<cfloat> fsurround_decoder::Impl::m_frontR
private

Definition at line 430 of file freesurround_decoder.cpp.

Referenced by block_decode(), and Impl().

◆ m_avg

std::vector<cfloat> fsurround_decoder::Impl::m_avg
private

Definition at line 430 of file freesurround_decoder.cpp.

Referenced by block_decode(), and Impl().

◆ m_surL

std::vector<cfloat> fsurround_decoder::Impl::m_surL
private

Definition at line 430 of file freesurround_decoder.cpp.

Referenced by block_decode(), and Impl().

◆ m_surR

std::vector<cfloat> fsurround_decoder::Impl::m_surR
private

Definition at line 430 of file freesurround_decoder.cpp.

Referenced by block_decode(), and Impl().

◆ m_trueavg

std::vector<cfloat> fsurround_decoder::Impl::m_trueavg
private

Definition at line 431 of file freesurround_decoder.cpp.

Referenced by block_decode(), and Impl().

◆ m_xFs

std::vector<float> fsurround_decoder::Impl::m_xFs
private

Definition at line 432 of file freesurround_decoder.cpp.

Referenced by block_decode(), and Impl().

◆ m_yFs

std::vector<float> fsurround_decoder::Impl::m_yFs
private

Definition at line 432 of file freesurround_decoder.cpp.

Referenced by block_decode(), and Impl().

◆ m_wnd

std::vector<float> fsurround_decoder::Impl::m_wnd
private

Definition at line 433 of file freesurround_decoder.cpp.

Referenced by apply_filter(), block_decode(), and Impl().

◆ m_filter

std::array<std::vector<float>,6> fsurround_decoder::Impl::m_filter
private

Definition at line 434 of file freesurround_decoder.cpp.

Referenced by block_decode(), Impl(), and sample_rate().

◆ m_inbuf

std::array<std::vector<float>,2> fsurround_decoder::Impl::m_inbuf
private

Definition at line 435 of file freesurround_decoder.cpp.

Referenced by decode(), flush(), getInputBuffers(), and Impl().

◆ m_outbuf

std::array<std::vector<float>,6> fsurround_decoder::Impl::m_outbuf
private

Definition at line 436 of file freesurround_decoder.cpp.

Referenced by add_output(), flush(), getOutputBuffers(), and Impl().

◆ m_surroundHigh

float fsurround_decoder::Impl::m_surroundHigh {0.0F}
private

Definition at line 438 of file freesurround_decoder.cpp.

Referenced by surround_coefficients().

◆ m_surroundLow

float fsurround_decoder::Impl::m_surroundLow {0.0F}
private

Definition at line 439 of file freesurround_decoder.cpp.

Referenced by surround_coefficients().

◆ m_surroundBalance

float fsurround_decoder::Impl::m_surroundBalance {0.0F}
private

Definition at line 440 of file freesurround_decoder.cpp.

Referenced by block_decode(), and surround_coefficients().

◆ m_surroundLevel

float fsurround_decoder::Impl::m_surroundLevel {0.0F}
private

Definition at line 441 of file freesurround_decoder.cpp.

Referenced by block_decode(), and surround_coefficients().

◆ m_phaseOffsetL

float fsurround_decoder::Impl::m_phaseOffsetL {0.0F}
private

Definition at line 442 of file freesurround_decoder.cpp.

Referenced by block_decode(), and phase_mode().

◆ m_phaseOffsetR

float fsurround_decoder::Impl::m_phaseOffsetR {0.0F}
private

Definition at line 443 of file freesurround_decoder.cpp.

Referenced by block_decode(), and phase_mode().

◆ m_frontSeparation

float fsurround_decoder::Impl::m_frontSeparation {0.0F}
private

Definition at line 444 of file freesurround_decoder.cpp.

Referenced by block_decode(), and separation().

◆ m_rearSeparation

float fsurround_decoder::Impl::m_rearSeparation {0.0F}
private

Definition at line 445 of file freesurround_decoder.cpp.

Referenced by block_decode(), and separation().

◆ m_linearSteering

bool fsurround_decoder::Impl::m_linearSteering {false}
private

Definition at line 446 of file freesurround_decoder.cpp.

Referenced by block_decode(), and steering_mode().

◆ m_a

cfloat fsurround_decoder::Impl::m_a
private

Definition at line 447 of file freesurround_decoder.cpp.

Referenced by surround_coefficients().

◆ m_b

cfloat fsurround_decoder::Impl::m_b
private

Definition at line 447 of file freesurround_decoder.cpp.

Referenced by surround_coefficients().

◆ m_c

cfloat fsurround_decoder::Impl::m_c
private

Definition at line 447 of file freesurround_decoder.cpp.

Referenced by surround_coefficients().

◆ m_d

cfloat fsurround_decoder::Impl::m_d
private

Definition at line 447 of file freesurround_decoder.cpp.

Referenced by surround_coefficients().

◆ m_e

cfloat fsurround_decoder::Impl::m_e
private

Definition at line 447 of file freesurround_decoder.cpp.

Referenced by surround_coefficients().

◆ m_f

cfloat fsurround_decoder::Impl::m_f
private

Definition at line 447 of file freesurround_decoder.cpp.

Referenced by surround_coefficients().

◆ m_g

cfloat fsurround_decoder::Impl::m_g
private

Definition at line 447 of file freesurround_decoder.cpp.

Referenced by surround_coefficients().

◆ m_h

cfloat fsurround_decoder::Impl::m_h
private

Definition at line 447 of file freesurround_decoder.cpp.

Referenced by surround_coefficients().

◆ m_currentBuf

int fsurround_decoder::Impl::m_currentBuf
private

◆ m_inbufs

InputBufs fsurround_decoder::Impl::m_inbufs {}
private

Definition at line 449 of file freesurround_decoder.cpp.

Referenced by getInputBuffers(), and Impl().

◆ m_outbufs

OutputBufs fsurround_decoder::Impl::m_outbufs {}
private

Definition at line 450 of file freesurround_decoder.cpp.

Referenced by getOutputBuffers(), and Impl().


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