Clean up more space/tab mismatches in AudioCommon, Common, and VideoCommon.

Not planning to touch Core since it's the most actively changed part of the project.
This commit is contained in:
lioncash 2013-03-19 21:51:12 -04:00
parent 0e3d8e2e9f
commit edd9d0e0ef
91 changed files with 2151 additions and 2169 deletions

View File

@ -248,11 +248,11 @@ void matrix_decode(const float *in, const int k, const int il,
const int kr = (k + olddelay) % _dlbuflen; const int kr = (k + olddelay) % _dlbuflen;
float l_gain = (_l_fwr + _r_fwr) / (1 + _l_fwr + _l_fwr); float l_gain = (_l_fwr + _r_fwr) / (1 + _l_fwr + _l_fwr);
float r_gain = (_l_fwr + _r_fwr) / (1 + _r_fwr + _r_fwr); float r_gain = (_l_fwr + _r_fwr) / (1 + _r_fwr + _r_fwr);
/* The 2nd axis has strong gain fluctuations, and therefore require // The 2nd axis has strong gain fluctuations, and therefore require
limits. The factor corresponds to the 1 / amplification of (Lt // limits. The factor corresponds to the 1 / amplification of (Lt
- Rt) when (Lt, Rt) is strongly correlated. (e.g. during // - Rt) when (Lt, Rt) is strongly correlated. (e.g. during
dialogues). It should be bigger than -12 dB to prevent // dialogues). It should be bigger than -12 dB to prevent
distortion. */ // distortion.
float lmr_lim_fwr = _lmr_fwr > M9_03DB * _lpr_fwr ? _lmr_fwr : M9_03DB * _lpr_fwr; 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 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); 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) if (decode_rear)
{ {
_lr[kr] = _rr[kr] = (l_agc - r_agc) * (float)M_SQRT1_2; _lr[kr] = _rr[kr] = (l_agc - r_agc) * (float)M_SQRT1_2;
/* Stereo rear channel is steered with the same AGC steering as // Stereo rear channel is steered with the same AGC steering as
the decoding matrix. Note this requires a fast updating AGC // the decoding matrix. Note this requires a fast updating AGC
at the order of 20 ms (which is the case here). */ // at the order of 20 ms (which is the case here).
_lr[kr] *= (_l_fwr + _l_fwr) / (1 + _l_fwr + _r_fwr); _lr[kr] *= (_l_fwr + _l_fwr) / (1 + _l_fwr + _r_fwr);
_rr[kr] *= (_r_fwr + _r_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; _rf[k] = (lpr_agc - lmr_agc) * (float)M_SQRT1_2;
/*** CENTER FRONT CANCELLATION ***/ /*** CENTER FRONT CANCELLATION ***/
/* A heuristic approach exploits that Lt + Rt gain contains the // A heuristic approach exploits that Lt + Rt gain contains the
information about Lt, Rt correlation. This effectively reshapes // information about Lt, Rt correlation. This effectively reshapes
the front and rear "cones" to concentrate Lt + Rt to C and // the front and rear "cones" to concentrate Lt + Rt to C and
introduce Lt - Rt in L, R. */ // introduce Lt - Rt in L, R.
/* 0.67677 is the empirical lower bound for lpr_gain. */ /* 0.67677 is the empirical lower bound for lpr_gain. */
c_gain = 8 * (*_adapt_lpr_gain - 0.67677f); c_gain = 8 * (*_adapt_lpr_gain - 0.67677f);
c_gain = c_gain > 0 ? c_gain : 0; c_gain = c_gain > 0 ? c_gain : 0;
/* c_gain should not be too high, not even reaching full // c_gain should not be too high, not even reaching full
cancellation (~ 0.50 - 0.55 at current AGC implementation), or // cancellation (~ 0.50 - 0.55 at current AGC implementation), or
the center will sound too narrow. */ // the center will sound too narrow. */
c_gain = MATCOMPGAIN / (1 + c_gain * c_gain); c_gain = MATCOMPGAIN / (1 + c_gain * c_gain);
c_agc_cfk = c_gain * _cf[k]; c_agc_cfk = c_gain * _cf[k];
_lf[k] -= c_agc_cfk; _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) 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 int cfg_delay = 0;
static const unsigned int fmt_freq = 48000; static const unsigned int fmt_freq = 48000;
static const unsigned int fmt_nchannels = 2; // input channels static const unsigned int fmt_nchannels = 2; // input channels

View File

@ -99,7 +99,6 @@ unsigned int CMixer::Mix(short* samples, unsigned int numSamples)
if ((m_indexR2 & INDEX_MASK) == (m_indexW & INDEX_MASK)) //..if it exists if ((m_indexR2 & INDEX_MASK) == (m_indexW & INDEX_MASK)) //..if it exists
m_indexR2 = m_indexR; m_indexR2 = m_indexR;
s16 l1 = Common::swap16(m_buffer[m_indexR & INDEX_MASK]); //current s16 l1 = Common::swap16(m_buffer[m_indexR & INDEX_MASK]); //current
s16 l2 = Common::swap16(m_buffer[m_indexR2 & INDEX_MASK]); //next s16 l2 = Common::swap16(m_buffer[m_indexR2 & INDEX_MASK]); //next
int sampleL = ((l1 << 16) + (l2 - l1) * (u16)frac) >> 16; int sampleL = ((l1 << 16) + (l2 - l1) * (u16)frac) >> 16;
@ -116,8 +115,6 @@ unsigned int CMixer::Mix(short* samples, unsigned int numSamples)
} }
} }
} else { } else {
numLeft = 0; numLeft = 0;
} }

View File

@ -295,7 +295,6 @@ void OpenALStream::SoundLoop()
{ {
ERROR_LOG(AUDIO, "Error occurred while buffering float32 data: %08x", err); ERROR_LOG(AUDIO, "Error occurred while buffering float32 data: %08x", err);
} }
} }
#endif #endif
if (!float32_capable) if (!float32_capable)
@ -308,7 +307,6 @@ void OpenALStream::SoundLoop()
stereo[i * 2 + 1] = (short)((float)sampleBuffer[i * 2 + 1] * (1 << 16)); stereo[i * 2 + 1] = (short)((float)sampleBuffer[i * 2 + 1] * (1 << 16));
} }
alBufferData(uiBufferTemp[iBuffersFilled], AL_FORMAT_STEREO16, stereo, nSamples * 2 * 2, ulFrequency); alBufferData(uiBufferTemp[iBuffersFilled], AL_FORMAT_STEREO16, stereo, nSamples * 2 * 2, ulFrequency);
} }
} }

View File

@ -39,10 +39,11 @@ namespace FPURoundMode
void SetSIMDMode(u32 mode); void SetSIMDMode(u32 mode);
/* /*
There are two different flavors of float to int conversion: * There are two different flavors of float to int conversion:
_mm_cvtps_epi32() and _mm_cvttps_epi32(). The first rounds * _mm_cvtps_epi32() and _mm_cvttps_epi32().
according to the MXCSR rounding bits. The second one always *
uses round towards zero. * The first rounds according to the MXCSR rounding bits.
* The second one always uses round towards zero.
*/ */
void SaveSIMDState(); void SaveSIMDState();
void LoadSIMDState(); void LoadSIMDState();

View File

@ -262,11 +262,13 @@ u64 GetCRC32(const u8 *src, int len, u32 samples)
} }
/* NOTE: This hash function is used for custom texture loading/dumping, so /*
it should not be changed, which would require all custom textures to be * NOTE: This hash function is used for custom texture loading/dumping, so
recalculated for their new hash values. If the hashing function is * it should not be changed, which would require all custom textures to be
changed, make sure this one is still used when the legacy parameter is * recalculated for their new hash values. If the hashing function is
true. */ * changed, make sure this one is still used when the legacy parameter is
* true.
*/
u64 GetHashHiresTexture(const u8 *src, int len, u32 samples) u64 GetHashHiresTexture(const u8 *src, int len, u32 samples)
{ {
const u64 m = 0xc6a4a7935bd1e995; const u64 m = 0xc6a4a7935bd1e995;
@ -453,9 +455,11 @@ u64 GetMurmurHash3(const u8* src, int len, u32 samples)
return *((u64 *)&out); return *((u64 *)&out);
} }
/* FIXME: The old 32-bit version of this hash made different hashes than the /*
64-bit version. Until someone can make a new version of the 32-bit one that * FIXME: The old 32-bit version of this hash made different hashes than the
makes identical hashes, this is just a c/p of the 64-bit one. */ * 64-bit version. Until someone can make a new version of the 32-bit one that
* makes identical hashes, this is just a c/p of the 64-bit one.
*/
u64 GetHashHiresTexture(const u8 *src, int len, u32 samples) u64 GetHashHiresTexture(const u8 *src, int len, u32 samples)
{ {
const u64 m = 0xc6a4a7935bd1e995ULL; const u64 m = 0xc6a4a7935bd1e995ULL;

View File

@ -155,9 +155,7 @@ void FreeAlignedMemory(void* ptr)
if (ptr) if (ptr)
{ {
#ifdef _WIN32 #ifdef _WIN32
_aligned_free(ptr); _aligned_free(ptr);
#else #else
free(ptr); free(ptr);
#endif #endif

View File

@ -107,7 +107,6 @@ bool DefaultMsgHandler(const char* caption, const char* text, bool yes_no, int S
if (Style == WARNING) STYLE = MB_ICONWARNING; if (Style == WARNING) STYLE = MB_ICONWARNING;
return IDYES == MessageBox(0, UTF8ToTStr(text).c_str(), UTF8ToTStr(caption).c_str(), STYLE | (yes_no ? MB_YESNO : MB_OK)); return IDYES == MessageBox(0, UTF8ToTStr(text).c_str(), UTF8ToTStr(caption).c_str(), STYLE | (yes_no ? MB_YESNO : MB_OK));
#else #else
printf("%s\n", text); printf("%s\n", text);
return true; return true;

View File

@ -462,7 +462,6 @@ void STACKALIGN GatherPipeBursted()
ProcessFifoAllDistance(); ProcessFifoAllDistance();
waitingForPEInterruptDisable = false; waitingForPEInterruptDisable = false;
} }
} }
return; return;
} }

View File

@ -695,10 +695,8 @@ PC_TexFormat TexDecoder_Decode_real(u8 *dst, const u8 *src, int width, int heigh
for (int y = 0; y < height; y += 4) for (int y = 0; y < height; y += 4)
for (int x = 0, yStep = (y / 4) * Wsteps8; x < width; x += 8, yStep++) for (int x = 0, yStep = (y / 4) * Wsteps8; x < width; x += 8, yStep++)
for (int iy = 0, xStep = 4 * yStep; iy < 4; iy++, xStep++) for (int iy = 0, xStep = 4 * yStep; iy < 4; iy++, xStep++)
{
((u64*)(dst + (y + iy) * width + x))[0] = ((u64*)(src + 8 * xStep))[0]; ((u64*)(dst + (y + iy) * width + x))[0] = ((u64*)(src + 8 * xStep))[0];
} }
}
return PC_TEX_FMT_I8; return PC_TEX_FMT_I8;
case GX_TF_C8: case GX_TF_C8:
if (tlutfmt == 2) if (tlutfmt == 2)
@ -739,7 +737,6 @@ PC_TexFormat TexDecoder_Decode_real(u8 *dst, const u8 *src, int width, int heigh
for(int j = 0; j < 4; j++) for(int j = 0; j < 4; j++)
*ptr++ = Common::swap16(*s++); *ptr++ = Common::swap16(*s++);
} }
} }
return PC_TEX_FMT_IA8; return PC_TEX_FMT_IA8;
case GX_TF_C14X2: case GX_TF_C14X2:
@ -782,10 +779,9 @@ PC_TexFormat TexDecoder_Decode_real(u8 *dst, const u8 *src, int width, int heigh
} }
return PC_TEX_FMT_BGRA32; return PC_TEX_FMT_BGRA32;
case GX_TF_RGBA8: // speed critical case GX_TF_RGBA8: // speed critical
{
{ {
for (int y = 0; y < height; y += 4) for (int y = 0; y < height; y += 4)
{
for (int x = 0, yStep = (y / 4) * Wsteps4; x < width; x += 4, yStep++) for (int x = 0, yStep = (y / 4) * Wsteps4; x < width; x += 4, yStep++)
{ {
const u8* src2 = src + 64 * yStep; const u8* src2 = src + 64 * yStep;
@ -873,7 +869,6 @@ PC_TexFormat TexDecoder_Decode_RGBA(u32 * dst, const u8 * src, int width, int he
for (int x = 0, yStep = (y / 8) * Wsteps8; x < width; x += 8,yStep++) for (int x = 0, yStep = (y / 8) * Wsteps8; x < width; x += 8,yStep++)
for (int iy = 0, xStep = 8 * yStep; iy < 8; iy++,xStep++) for (int iy = 0, xStep = 8 * yStep; iy < 8; iy++,xStep++)
decodebytesC4IA8_To_RGBA(dst + (y + iy) * width + x, src + 4 * xStep, tlutaddr); decodebytesC4IA8_To_RGBA(dst + (y + iy) * width + x, src + 4 * xStep, tlutaddr);
} }
else else
{ {
@ -936,7 +931,6 @@ PC_TexFormat TexDecoder_Decode_RGBA(u32 * dst, const u8 * src, int width, int he
for (int x = 0, yStep = (y / 4) * Wsteps8; x < width; x += 8, yStep++) for (int x = 0, yStep = (y / 4) * Wsteps8; x < width; x += 8, yStep++)
for (int iy = 0, xStep = 4 * yStep; iy < 4; iy++, xStep++) for (int iy = 0, xStep = 4 * yStep; iy < 4; iy++, xStep++)
decodebytesC8IA8_To_RGBA(dst + (y + iy) * width + x, src + 8 * xStep, tlutaddr); decodebytesC8IA8_To_RGBA(dst + (y + iy) * width + x, src + 8 * xStep, tlutaddr);
} }
else else
{ {

View File

@ -54,7 +54,6 @@ public:
static void SetColorMatrix(const float* pmatrix); static void SetColorMatrix(const float* pmatrix);
static void InvalidateXFRange(int start, int end); static void InvalidateXFRange(int start, int end);
static void SetMaterialColorChanged(int index); static void SetMaterialColorChanged(int index);
}; };

View File

@ -103,7 +103,6 @@ void WriteSwizzler(char*& p, u32 format, API_TYPE ApiType)
WRITE(p, "Texture2D Tex0 : register(t0);\n"); WRITE(p, "Texture2D Tex0 : register(t0);\n");
} }
if (ApiType == API_OPENGL) if (ApiType == API_OPENGL)
{ {
WRITE(p, " out float4 ocol0;\n"); WRITE(p, " out float4 ocol0;\n");

View File

@ -202,7 +202,6 @@ const char *GenerateVertexShaderCode(u32 components, API_TYPE ApiType)
if (g_ActiveConfig.backend_info.bSupportsGLSLUBO) if (g_ActiveConfig.backend_info.bSupportsGLSLUBO)
WRITE(p, "};\n"); WRITE(p, "};\n");
p = GenerateVSOutputStruct(p, components, ApiType); p = GenerateVSOutputStruct(p, components, ApiType);
if(ApiType == API_OPENGL) if(ApiType == API_OPENGL)
@ -335,8 +334,6 @@ const char *GenerateVertexShaderCode(u32 components, API_TYPE ApiType)
if (!(components & VB_HAS_NRM0)) if (!(components & VB_HAS_NRM0))
WRITE(p, "float3 _norm0 = float3(0.0f, 0.0f, 0.0f);\n"); WRITE(p, "float3 _norm0 = float3(0.0f, 0.0f, 0.0f);\n");
WRITE(p, "o.pos = float4(dot(" I_PROJECTION"[0], pos), dot(" I_PROJECTION"[1], pos), dot(" I_PROJECTION"[2], pos), dot(" I_PROJECTION"[3], pos));\n"); WRITE(p, "o.pos = float4(dot(" I_PROJECTION"[0], pos), dot(" I_PROJECTION"[1], pos), dot(" I_PROJECTION"[2], pos), dot(" I_PROJECTION"[3], pos));\n");
WRITE(p, "float4 mat, lacc;\n" WRITE(p, "float4 mat, lacc;\n"

View File

@ -43,7 +43,7 @@ public:
static void Dirty(); static void Dirty();
static void Shutdown(); static void Shutdown();
static void DoState(PointerWrap &p); static void DoState(PointerWrap &p);
;
// constant management // constant management
static void SetConstants(); static void SetConstants();

View File

@ -539,7 +539,6 @@ void CompileAndRunDisplayList(u32 address, u32 size, CachedDisplayList *dl)
if (cmd_byte & 0x80) if (cmd_byte & 0x80)
{ {
// load vertices (use computed vertex size from FifoCommandRunnable above) // load vertices (use computed vertex size from FifoCommandRunnable above)
u16 numVertices = DataReadU16(); u16 numVertices = DataReadU16();
if(numVertices > 0) if(numVertices > 0)
{ {
@ -577,7 +576,6 @@ void CompileAndRunDisplayList(u32 address, u32 size, CachedDisplayList *dl)
} }
} }
} }
} }
else else
{ {
@ -764,10 +762,9 @@ bool HandleDisplayList(u32 address, u32 size)
vdl.VATUsed = dlvatused; vdl.VATUsed = dlvatused;
vdl.count = 1; vdl.count = 1;
DLCache::dl_map[dl_id] = vdl; DLCache::dl_map[dl_id] = vdl;
} }
return true;
return true;
} }
void IncrementCheckContextId() void IncrementCheckContextId()