43static constexpr float m3db = 1.0F/std::numbers::sqrt2;
44static constexpr float m6db = 0.5;
73int channel_select = -1;
80 LOG(VB_AUDIO, LOG_DEBUG,
81 QString(
"FreeSurround::FreeSurround rate %1 moviemode %2")
82 .arg(srate).arg(moviemode));
112 if (channel_select>=6)
114 LOG(VB_AUDIO, LOG_DEBUG,
115 QString(
"FreeSurround::FreeSurround channel_select %1")
116 .arg(channel_select));
118 LOG(VB_AUDIO, LOG_DEBUG, QString(
"FreeSurround::FreeSurround done"));
134 LOG(VB_AUDIO, LOG_DEBUG, QString(
"FreeSurround::~FreeSurround"));
138 LOG(VB_AUDIO, LOG_DEBUG, QString(
"FreeSurround::~FreeSurround done"));
147 auto *
samples = (
float *)buffer;
162 for (i = 0; i <
numFrames && ic < bs; i++,ic++)
173 float *lt = &inputs[0][ic];
174 float *rt = &inputs[1][ic];
187 for (i = 0; i <
numFrames && ic < bs; i++,ic++)
201 for (i = 0; i <
numFrames && ic < bs; i++,ic++)
215 float *lt = &inputs[0][ic];
216 float *rt = &inputs[1][ic];
229 for (i = 0; i <
numFrames && ic < bs; i++,ic++)
248 for (i = 0; i <
numFrames && ic < bs; i++,ic++)
301 LOG(VB_AUDIO | VB_TIMESTAMP, LOG_DEBUG,
302 QString(
"FreeSurround::putFrames %1 #ch %2 used %3 generated %4")
311 maxFrames = std::min(maxFrames, oc);
313 auto *
output = (
float *)buffer;
324 for (
uint i = 0; i < maxFrames; i++)
346 float *l = &outputs[0][outindex];
347 float *c = &outputs[1][outindex];
348 float *r = &outputs[2][outindex];
349 float *ls = &outputs[3][outindex];
350 float *rs = &outputs[4][outindex];
351 float *lfe = &outputs[5][outindex];
352 for (
uint i = 0; i < maxFrames; i++)
371 for (
uint i = 0; i < maxFrames; i++)
384 LOG(VB_AUDIO | VB_TIMESTAMP, LOG_DEBUG,
385 QString(
"FreeSurround::receiveFrames %1").arg(maxFrames));
399 catch(
const std::exception& ex)
401 LOG(VB_AUDIO, LOG_DEBUG,
402 QString(
"FreeSurround::process_block exception: %1").arg(ex.what()));
406 LOG(VB_AUDIO, LOG_DEBUG,
407 QString(
"FreeSurround::process_block exception: unknown"));
uint frameLatency() const
@ SurroundModeActiveSimple
@ SurroundModeActiveLinear
@ SurroundModePassiveHall
static uint framesPerBlock()
SurroundMode m_surroundMode
struct FreeSurround::fsurround_params m_params
uint receiveFrames(void *buffer, uint maxFrames)
class fsurround_decoder * m_decoder
FreeSurround(uint srate, bool moviemode, SurroundMode mode)
uint numUnprocessedFrames() const
uint putFrames(void *buffer, uint numFrames, uint numChannels)
float ** getInputBuffers()
void steering_mode(bool mode)
void decode(float center_width=1, float dimension=0, float adaption_rate=1)
void separation(float front, float rear)
void surround_coefficients(float a, float b)
void sample_rate(unsigned int samplerate)
float ** getOutputBuffers()
void phase_mode(unsigned mode)
static const std::array< const uint64_t, 4 > samples
static constexpr unsigned default_block_size
static constexpr float m6db
static constexpr float m3db
static constexpr uint16_t SURROUND_BUFSIZE
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
std::vector< float > m_ls
std::vector< float > m_rcs
std::vector< float > m_cs
std::vector< float > m_lfe
std::vector< float > m_rrs
std::vector< float > m_lcs
std::vector< float > m_rs
void resize(unsigned int s)
std::vector< float > m_rls