Go to the documentation of this file.
44 static const float m3db = 0.7071067811865476F;
45 static const float m6db = 0.5;
72 int channel_select = -1;
79 LOG(VB_AUDIO, LOG_DEBUG,
80 QString(
"FreeSurround::FreeSurround rate %1 moviemode %2")
81 .arg(srate).arg(moviemode));
111 if (channel_select>=6)
113 LOG(VB_AUDIO, LOG_DEBUG,
114 QString(
"FreeSurround::FreeSurround channel_select %1")
115 .arg(channel_select));
117 LOG(VB_AUDIO, LOG_DEBUG, QString(
"FreeSurround::FreeSurround done"));
133 center_width(center_width),
140 LOG(VB_AUDIO, LOG_DEBUG, QString(
"FreeSurround::~FreeSurround"));
144 LOG(VB_AUDIO, LOG_DEBUG, QString(
"FreeSurround::~FreeSurround done"));
153 auto *
samples = (
float *)buffer;
157 float *lt = &inputs[0][ic];
158 float *rt = &inputs[1][ic];
172 for (i = 0; i <
numFrames && ic < bs; i++,ic++)
194 for (i = 0; i <
numFrames && ic < bs; i++,ic++)
208 for (i = 0; i <
numFrames && ic < bs; i++,ic++)
233 for (i = 0; i <
numFrames && ic < bs; i++,ic++)
252 for (i = 0; i <
numFrames && ic < bs; i++,ic++)
305 LOG(VB_AUDIO | VB_TIMESTAMP, LOG_DEBUG,
306 QString(
"FreeSurround::putFrames %1 #ch %2 used %3 generated %4")
315 if (maxFrames > oc) maxFrames = oc;
317 auto *
output = (
float *)buffer;
328 for (
uint i = 0; i < maxFrames; i++)
350 float *l = &outputs[0][outindex];
351 float *c = &outputs[1][outindex];
352 float *r = &outputs[2][outindex];
353 float *ls = &outputs[3][outindex];
354 float *rs = &outputs[4][outindex];
355 float *lfe = &outputs[5][outindex];
356 for (
uint i = 0; i < maxFrames; i++)
375 for (
uint i = 0; i < maxFrames; i++)
388 LOG(VB_AUDIO | VB_TIMESTAMP, LOG_DEBUG,
389 QString(
"FreeSurround::receiveFrames %1").arg(maxFrames));
@ SurroundModeActiveLinear
void sample_rate(unsigned int samplerate)
std::vector< float > m_rcs
std::vector< float > m_rs
class fsurround_decoder * m_decoder
@ SurroundModeActiveSimple
std::vector< float > m_lfe
@ SurroundModePassiveHall
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
static constexpr uint16_t SURROUND_BUFSIZE
void decode(float center_width=1, float dimension=0, float adaption_rate=1)
uint putFrames(void *buffer, uint numFrames, uint numChannels)
uint numUnprocessedFrames() const
void separation(float front, float rear)
SurroundMode m_surroundMode
void surround_coefficients(float a, float b)
std::vector< float > m_rls
std::vector< float > m_rrs
fsurround_params(int32_t center_width=100, int32_t dimension=0)
static uint framesPerBlock()
uint frameLatency() const
std::vector< float > m_lcs
static const unsigned default_block_size
void steering_mode(bool mode)
void resize(unsigned int s)
void phase_mode(unsigned mode)
float ** getOutputBuffers()
FreeSurround(uint srate, bool moviemode, SurroundMode mode)
std::vector< float > m_ls
uint receiveFrames(void *buffer, uint maxFrames)
static const std::array< const uint64_t, 4 > samples
float ** getInputBuffers()
struct FreeSurround::fsurround_params m_params
std::vector< float > m_cs