summaryrefslogtreecommitdiff
path: root/Source/Core/AudioCommon/Src/DPL2Decoder.cpp
diff options
context:
space:
mode:
authorskidau <skidau@gmail.com>2013-03-27 13:19:23 +1100
committerskidau <skidau@gmail.com>2013-03-27 13:19:23 +1100
commit7784fa4c67cc8d2545f45694d83805e7e89cd583 (patch)
tree7724133aabe971ec417d1dea0977a525bb8debfb /Source/Core/AudioCommon/Src/DPL2Decoder.cpp
parentd33c19b0cd2bae982c8d35e86a9d3551f9e5c72f (diff)
parent5cea0d9defeaa23e7af94adf7615a44fb2c9c173 (diff)
Merge branch 'master' into wii-network
# By Ryan Houdek (185) and others # Via degasus (12) and others * master: (625 commits) Revert "Don't open/close file for every file operation." as it was crashing PokePark in Windows builds. Array overrun fixed in VertexShaderCache for the DX11 plugin. Fixed DSPTool build. Windows build fix Go back to assuming every HID device is a wiimote on Windows. Fixed issue 6117. Unfixed issue 6031. VideoSoftware: Improve fog range adjustment by using less magic and more comments. revert RasterFont for VideoSoftware ogl: fix virtual xfb Windows build fix from web interface... Adjusted the audio loop criteria, using >= on the Wii and == on GC. This fixes the audio static that occurred in Wii games after hours of play. Forced the exception check only for ARAM DMA transfers. Removed the Eternal Darkness boot hack and replaced it with an exception check. VideoSoftware: Implement fog range adjustment, fixing issue 6147. implement 4xSSAA for OGL move ogl-only settings into backend Fix description of disable fog, and move it to enhancements tab. Reverted rd76ca5783743 as it was made obsolete by r1d550f4496e4. Removed the tracking of the FIFO Writes as it was made obsolete by r1d550f4496e4. Forced the external exception check to occur sooner by changing the downcount. Mark the Direct3D9 backend deprecated. Prefer D3D11 and OpenGL over D3D9 by default. ... Conflicts: CMakeLists.txt Source/Core/Common/Common.vcxproj.filters Source/Core/Common/Src/CommonPaths.h Source/Core/Core/Core.vcxproj.filters Source/Core/Core/Src/Core.cpp Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp Source/VSProps/Dolphin.Win32.props Source/VSProps/Dolphin.x64.props
Diffstat (limited to 'Source/Core/AudioCommon/Src/DPL2Decoder.cpp')
-rw-r--r--Source/Core/AudioCommon/Src/DPL2Decoder.cpp52
1 files changed, 26 insertions, 26 deletions
diff --git a/Source/Core/AudioCommon/Src/DPL2Decoder.cpp b/Source/Core/AudioCommon/Src/DPL2Decoder.cpp
index 6a63f696de..c33333fb47 100644
--- a/Source/Core/AudioCommon/Src/DPL2Decoder.cpp
+++ b/Source/Core/AudioCommon/Src/DPL2Decoder.cpp
@@ -130,15 +130,15 @@ returns 0 if OK, -1 if fail
*/
float* design_fir(unsigned int *n, float* fc, float opt)
{
- unsigned int o = *n & 1; // Indicator for odd filter length
- unsigned int end = ((*n + 1) >> 1) - o; // Loop end
- unsigned int i; // Loop index
+ unsigned int o = *n & 1; // Indicator for odd filter length
+ unsigned int end = ((*n + 1) >> 1) - o; // Loop end
+ unsigned int i; // Loop index
- float k1 = 2 * float(M_PI); // 2*pi*fc1
- float k2 = 0.5f * (float)(1 - o);// Constant used if the filter has even length
- float g = 0.0f; // Gain
- float t1; // Temporary variables
- float fc1; // Cutoff frequencies
+ float k1 = 2 * float(M_PI); // 2*pi*fc1
+ float k2 = 0.5f * (float)(1 - o); // Constant used if the filter has even length
+ float g = 0.0f; // Gain
+ float t1; // Temporary variables
+ float fc1; // Cutoff frequencies
// Sanity check
if(*n==0) return NULL;
@@ -241,18 +241,18 @@ void matrix_decode(const float *in, const int k, const int il,
float *_rr, float *_cf)
{
static const float M9_03DB = 0.3535533906f;
- static const float MATAGCTRIG = 8.0f; /* (Fuzzy) AGC trigger */
- static const float MATAGCDECAY = 1.0f; /* AGC baseline decay rate (1/samp.) */
+ static const float MATAGCTRIG = 8.0f; /* (Fuzzy) AGC trigger */
+ static const float MATAGCDECAY = 1.0f; /* AGC baseline decay rate (1/samp.) */
static const float MATCOMPGAIN = 0.37f; /* Cross talk compensation gain, 0.50 - 0.55 is full cancellation. */
const int kr = (k + olddelay) % _dlbuflen;
float l_gain = (_l_fwr + _r_fwr) / (1 + _l_fwr + _l_fwr);
float r_gain = (_l_fwr + _r_fwr) / (1 + _r_fwr + _r_fwr);
- /* The 2nd axis has strong gain fluctuations, and therefore require
- limits. The factor corresponds to the 1 / amplification of (Lt
- - Rt) when (Lt, Rt) is strongly correlated. (e.g. during
- dialogues). It should be bigger than -12 dB to prevent
- distortion. */
+ // The 2nd axis has strong gain fluctuations, and therefore require
+ // limits. The factor corresponds to the 1 / amplification of (Lt
+ // - Rt) when (Lt, Rt) is strongly correlated. (e.g. during
+ // dialogues). It should be bigger than -12 dB to prevent
+ // distortion.
float lmr_lim_fwr = _lmr_fwr > M9_03DB * _lpr_fwr ? _lmr_fwr : M9_03DB * _lpr_fwr;
float lpr_gain = (_lpr_fwr + lmr_lim_fwr) / (1 + _lpr_fwr + _lpr_fwr);
float lmr_gain = (_lpr_fwr + lmr_lim_fwr) / (1 + lmr_lim_fwr + lmr_lim_fwr);
@@ -275,9 +275,9 @@ void matrix_decode(const float *in, const int k, const int il,
if (decode_rear)
{
_lr[kr] = _rr[kr] = (l_agc - r_agc) * (float)M_SQRT1_2;
- /* Stereo rear channel is steered with the same AGC steering as
- the decoding matrix. Note this requires a fast updating AGC
- at the order of 20 ms (which is the case here). */
+ // Stereo rear channel is steered with the same AGC steering as
+ // the decoding matrix. Note this requires a fast updating AGC
+ // at the order of 20 ms (which is the case here).
_lr[kr] *= (_l_fwr + _l_fwr) / (1 + _l_fwr + _r_fwr);
_rr[kr] *= (_r_fwr + _r_fwr) / (1 + _l_fwr + _r_fwr);
}
@@ -298,16 +298,16 @@ void matrix_decode(const float *in, const int k, const int il,
_rf[k] = (lpr_agc - lmr_agc) * (float)M_SQRT1_2;
/*** CENTER FRONT CANCELLATION ***/
- /* A heuristic approach exploits that Lt + Rt gain contains the
- information about Lt, Rt correlation. This effectively reshapes
- the front and rear "cones" to concentrate Lt + Rt to C and
- introduce Lt - Rt in L, R. */
+ // A heuristic approach exploits that Lt + Rt gain contains the
+ // information about Lt, Rt correlation. This effectively reshapes
+ // the front and rear "cones" to concentrate Lt + Rt to C and
+ // introduce Lt - Rt in L, R.
/* 0.67677 is the empirical lower bound for lpr_gain. */
c_gain = 8 * (*_adapt_lpr_gain - 0.67677f);
c_gain = c_gain > 0 ? c_gain : 0;
- /* c_gain should not be too high, not even reaching full
- cancellation (~ 0.50 - 0.55 at current AGC implementation), or
- the center will sound too narrow. */
+ // c_gain should not be too high, not even reaching full
+ // cancellation (~ 0.50 - 0.55 at current AGC implementation), or
+ // the center will sound too narrow. */
c_gain = MATCOMPGAIN / (1 + c_gain * c_gain);
c_agc_cfk = c_gain * _cf[k];
_lf[k] -= c_agc_cfk;
@@ -317,7 +317,7 @@ void matrix_decode(const float *in, const int k, const int il,
void dpl2decode(float *samples, int numsamples, float *out)
{
- static const unsigned int FWRDURATION = 240; /* FWR average duration (samples) */
+ static const unsigned int FWRDURATION = 240; // FWR average duration (samples)
static const int cfg_delay = 0;
static const unsigned int fmt_freq = 48000;
static const unsigned int fmt_nchannels = 2; // input channels