aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/Include
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2017-01-16 07:45:07 -0800
committerChris Robinson <[email protected]>2017-01-16 08:06:25 -0800
commitcbb796bf31cd3acfba0ce35e71a51d03e7e26021 (patch)
tree0264bcb03f58e8dee89ee383d61da0bf4e7469d1 /OpenAL32/Include
parent9f23d17333c8faaa0a2b7a86df33c41874a929a5 (diff)
Use ALsizei for sizes and offsets with the mixer
Unsigned 32-bit offsets actually have some potential overhead on 64-bit targets for pointer/array accesses due to rules on integer wrapping. No idea how much impact it has in practice, but it's nice to be correct about it.
Diffstat (limited to 'OpenAL32/Include')
-rw-r--r--OpenAL32/Include/alMain.h10
-rw-r--r--OpenAL32/Include/alu.h26
2 files changed, 18 insertions, 18 deletions
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h
index 975dd11e..fca98be9 100644
--- a/OpenAL32/Include/alMain.h
+++ b/OpenAL32/Include/alMain.h
@@ -562,7 +562,7 @@ enum RenderMode {
typedef ALfloat ChannelConfig[MAX_AMBI_COEFFS];
typedef struct BFChannelConfig {
ALfloat Scale;
- ALuint Index;
+ ALsizei Index;
} BFChannelConfig;
typedef union AmbiConfig {
@@ -584,7 +584,7 @@ typedef struct HrtfState {
typedef struct HrtfParams {
alignas(16) ALfloat Coeffs[HRIR_LENGTH][2];
- ALuint Delay[2];
+ ALsizei Delay[2];
} HrtfParams;
@@ -593,7 +593,7 @@ typedef struct HrtfParams {
* to be a sensible size, however, as it constrains the max stepping value used
* for mixing, as well as the maximum number of samples per mixing iteration.
*/
-#define BUFFERSIZE (2048u)
+#define BUFFERSIZE 2048
struct ALCdevice_struct
{
@@ -645,8 +645,8 @@ struct ALCdevice_struct
/* HRTF filter state for dry buffer content */
alignas(16) ALfloat Values[9][HRIR_LENGTH][2];
alignas(16) ALfloat Coeffs[9][HRIR_LENGTH][2];
- ALuint Offset;
- ALuint IrSize;
+ ALsizei Offset;
+ ALsizei IrSize;
} Hrtf;
/* UHJ encoder state */
diff --git a/OpenAL32/Include/alu.h b/OpenAL32/Include/alu.h
index ae8645fa..cd2170cf 100644
--- a/OpenAL32/Include/alu.h
+++ b/OpenAL32/Include/alu.h
@@ -115,7 +115,7 @@ typedef struct MixHrtfParams {
HrtfParams *Current;
struct {
alignas(16) ALfloat Coeffs[HRIR_LENGTH][2];
- ALint Delay[2];
+ ALsizei Delay[2];
} Steps;
} MixHrtfParams;
@@ -152,21 +152,21 @@ typedef const ALfloat* (*ResamplerFunc)(const BsincState *state,
const ALfloat *restrict src, ALuint frac, ALuint increment, ALfloat *restrict dst, ALuint dstlen
);
-typedef void (*MixerFunc)(const ALfloat *data, ALuint OutChans,
+typedef void (*MixerFunc)(const ALfloat *data, ALsizei OutChans,
ALfloat (*restrict OutBuffer)[BUFFERSIZE], ALfloat *CurrentGains,
- const ALfloat *TargetGains, ALuint Counter, ALuint OutPos,
- ALuint BufferSize);
+ const ALfloat *TargetGains, ALsizei Counter, ALsizei OutPos,
+ ALsizei BufferSize);
typedef void (*RowMixerFunc)(ALfloat *OutBuffer, const ALfloat *gains,
- const ALfloat (*restrict data)[BUFFERSIZE], ALuint InChans,
- ALuint InPos, ALuint BufferSize);
-typedef void (*HrtfMixerFunc)(ALfloat (*restrict OutBuffer)[BUFFERSIZE], ALuint lidx, ALuint ridx,
- const ALfloat *data, ALuint Counter, ALuint Offset, ALuint OutPos,
- const ALuint IrSize, const MixHrtfParams *hrtfparams,
- HrtfState *hrtfstate, ALuint BufferSize);
+ const ALfloat (*restrict data)[BUFFERSIZE], ALsizei InChans,
+ ALsizei InPos, ALsizei BufferSize);
+typedef void (*HrtfMixerFunc)(ALfloat (*restrict OutBuffer)[BUFFERSIZE], ALsizei lidx, ALsizei ridx,
+ const ALfloat *data, ALsizei Counter, ALsizei Offset, ALsizei OutPos,
+ const ALsizei IrSize, const MixHrtfParams *hrtfparams,
+ HrtfState *hrtfstate, ALsizei BufferSize);
typedef void (*HrtfDirectMixerFunc)(ALfloat (*restrict OutBuffer)[BUFFERSIZE],
- ALuint lidx, ALuint ridx, const ALfloat *data, ALuint Offset,
- const ALuint IrSize, ALfloat (*restrict Coeffs)[2],
- ALfloat (*restrict Values)[2], ALuint BufferSize);
+ ALsizei lidx, ALsizei ridx, const ALfloat *data, ALsizei Offset,
+ const ALsizei IrSize, ALfloat (*restrict Coeffs)[2],
+ ALfloat (*restrict Values)[2], ALsizei BufferSize);
#define GAIN_MIX_MAX (16.0f) /* +24dB */