43static const float m3db = 0.7071067811865476F;
44static const float m6db = 0.5;
71int channel_select = -1;
78 LOG(VB_AUDIO, LOG_DEBUG,
79 QString(
"FreeSurround::FreeSurround rate %1 moviemode %2")
80 .arg(srate).arg(moviemode));
110 if (channel_select>=6)
112 LOG(VB_AUDIO, LOG_DEBUG,
113 QString(
"FreeSurround::FreeSurround channel_select %1")
114 .arg(channel_select));
116 LOG(VB_AUDIO, LOG_DEBUG, QString(
"FreeSurround::FreeSurround done"));
132 LOG(VB_AUDIO, LOG_DEBUG, QString(
"FreeSurround::~FreeSurround"));
136 LOG(VB_AUDIO, LOG_DEBUG, QString(
"FreeSurround::~FreeSurround done"));
145 auto *
samples = (
float *)buffer;
160 for (i = 0; i <
numFrames && ic < bs; i++,ic++)
171 float *lt = &inputs[0][ic];
172 float *rt = &inputs[1][ic];
185 for (i = 0; i <
numFrames && ic < bs; i++,ic++)
199 for (i = 0; i <
numFrames && ic < bs; i++,ic++)
213 float *lt = &inputs[0][ic];
214 float *rt = &inputs[1][ic];
227 for (i = 0; i <
numFrames && ic < bs; i++,ic++)
246 for (i = 0; i <
numFrames && ic < bs; i++,ic++)
299 LOG(VB_AUDIO | VB_TIMESTAMP, LOG_DEBUG,
300 QString(
"FreeSurround::putFrames %1 #ch %2 used %3 generated %4")
309 maxFrames = std::min(maxFrames, oc);
311 auto *
output = (
float *)buffer;
322 for (
uint i = 0; i < maxFrames; i++)
344 float *l = &outputs[0][outindex];
345 float *c = &outputs[1][outindex];
346 float *r = &outputs[2][outindex];
347 float *ls = &outputs[3][outindex];
348 float *rs = &outputs[4][outindex];
349 float *lfe = &outputs[5][outindex];
350 for (
uint i = 0; i < maxFrames; i++)
369 for (
uint i = 0; i < maxFrames; i++)
382 LOG(VB_AUDIO | VB_TIMESTAMP, LOG_DEBUG,
383 QString(
"FreeSurround::receiveFrames %1").arg(maxFrames));
397 catch(
const std::exception& ex)
399 LOG(VB_AUDIO, LOG_DEBUG,
400 QString(
"FreeSurround::process_block exception: %1").arg(ex.what()));
404 LOG(VB_AUDIO, LOG_DEBUG,
405 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 const unsigned default_block_size
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