FreeSurround::FreeSurround(uint srate, bool moviemode, SurroundMode smode) : srate(srate), open_(false), initialized_(false), bufs(NULL), decoder(0), in_count(0), out_count(0), processed(true), processed_size(0), surround_mode(smode), latency_frames(0) { LOG(VB_AUDIO, LOG_DEBUG, QString("FreeSurround::FreeSurround rate %1 moviemode %2") .arg(srate).arg(moviemode)); if (moviemode) { params.phasemode = 1; params.center_width = 25; params.dimension = 0.5; } else { params.center_width = 65; params.dimension = 0.3; } switch (surround_mode) { case SurroundModeActiveSimple: params.steering = 0; break; case SurroundModeActiveLinear: params.steering = 1; latency_frames = block_size/2; break; default: break; } bufs = (buffers*)bp.acquire((void*)1); open(); #ifdef SPEAKERTEST channel_select++; if (channel_select>=6) channel_select = 0; LOG(VB_AUDIO, LOG_DEBUG, QString("FreeSurround::FreeSurround channel_select %1") .arg(channel_select)); #endif LOG(VB_AUDIO, LOG_DEBUG, QString("FreeSurround::FreeSurround done")); }
// load the lib and initialize the interface void FreeSurround::open() { if (!decoder) { decoder = (fsurround_decoder*)dp.acquire((void*)1); decoder->flush(); if (bufs) bufs->clear(); decoder->sample_rate(srate); } SetParams(); }
FreeSurround::FreeSurround(uint srate, bool moviemode, SurroundMode smode) : srate(srate), open_(false), initialized_(false), //bufs(NULL), int16bufs(NULL), decoder(0), in_count(0), out_count(0), processed(true), surround_mode(smode) { VERBOSE(QString("FreeSurround::FreeSurround rate %1 moviemode %2").arg(srate).arg(moviemode)); if (moviemode) { params.phasemode = 1; params.center_width = 0; params.gain = 1.0; } else { params.center_width = 70; // for 50, gain should be about 1.9, c/lr about 2.7 // for 70, gain should be about 3.1, c/lr about 1.5 params.gain = 3.1; } switch (surround_mode) { case SurroundModeActiveSimple: params.steering = 0; //bufs = (buffers*)bp.acquire((void*)1); break; case SurroundModeActiveLinear: params.steering = 1; //bufs = (buffers*)bp.acquire((void*)1); break; default: //int16bufs = (int16buffers*)bp16.acquire((void*)1); break; } int16bufs = (int16buffers*)bp16.acquire((void*)1); open(); #ifdef SPEAKERTEST channel_select++; if (channel_select>=6) channel_select = 0; VERBOSE(QString("FreeSurround::FreeSurround channel_select %1").arg(channel_select)); #endif VERBOSE(QString("FreeSurround::FreeSurround done")); }