aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2019-12-11 01:20:00 -0800
committerChris Robinson <[email protected]>2019-12-11 01:20:00 -0800
commit7d0c01050ae9acfe0121ce80475d657953689ec9 (patch)
tree06b4406cfa039ed81a8b40e84ce13713d9028461
parent4867f93a34226be5d7d78e2f58f1413fc88816e4 (diff)
Fix MHR limits
-rw-r--r--alc/hrtf.cpp16
-rw-r--r--utils/makemhr/makemhr.cpp10
2 files changed, 9 insertions, 17 deletions
diff --git a/alc/hrtf.cpp b/alc/hrtf.cpp
index d61e6d0b..d773b47c 100644
--- a/alc/hrtf.cpp
+++ b/alc/hrtf.cpp
@@ -73,7 +73,6 @@ struct LoadedHrtf {
* the makemhr utility.
*/
#define MIN_IR_SIZE (8)
-#define MAX_IR_SIZE (512)
#define MOD_IR_SIZE (2)
#define MIN_FD_COUNT (1)
@@ -622,10 +621,9 @@ std::unique_ptr<HrtfStore> LoadHrtf00(std::istream &data, const char *filename)
}
ALboolean failed{AL_FALSE};
- if(irSize < MIN_IR_SIZE || irSize > MAX_IR_SIZE || (irSize%MOD_IR_SIZE))
+ if(irSize < MIN_IR_SIZE || irSize > HRIR_LENGTH)
{
- ERR("Unsupported HRIR size: irSize=%d (%d to %d by %d)\n",
- irSize, MIN_IR_SIZE, MAX_IR_SIZE, MOD_IR_SIZE);
+ ERR("Unsupported HRIR size, irSize=%d (%d to %d)\n", irSize, MIN_IR_SIZE, HRIR_LENGTH);
failed = AL_TRUE;
}
if(evCount < MIN_EV_COUNT || evCount > MAX_EV_COUNT)
@@ -739,10 +737,9 @@ std::unique_ptr<HrtfStore> LoadHrtf01(std::istream &data, const char *filename)
}
ALboolean failed{AL_FALSE};
- if(irSize < MIN_IR_SIZE || irSize > MAX_IR_SIZE || (irSize%MOD_IR_SIZE))
+ if(irSize < MIN_IR_SIZE || irSize > HRIR_LENGTH)
{
- ERR("Unsupported HRIR size: irSize=%d (%d to %d by %d)\n",
- irSize, MIN_IR_SIZE, MAX_IR_SIZE, MOD_IR_SIZE);
+ ERR("Unsupported HRIR size, irSize=%d (%d to %d)\n", irSize, MIN_IR_SIZE, HRIR_LENGTH);
failed = AL_TRUE;
}
if(evCount < MIN_EV_COUNT || evCount > MAX_EV_COUNT)
@@ -856,10 +853,9 @@ std::unique_ptr<HrtfStore> LoadHrtf02(std::istream &data, const char *filename)
failed = AL_TRUE;
}
- if(irSize < MIN_IR_SIZE || irSize > MAX_IR_SIZE || (irSize%MOD_IR_SIZE))
+ if(irSize < MIN_IR_SIZE || irSize > HRIR_LENGTH)
{
- ERR("Unsupported HRIR size: irSize=%d (%d to %d by %d)\n",
- irSize, MIN_IR_SIZE, MAX_IR_SIZE, MOD_IR_SIZE);
+ ERR("Unsupported HRIR size, irSize=%d (%d to %d)\n", irSize, MIN_IR_SIZE, HRIR_LENGTH);
failed = AL_TRUE;
}
if(fdCount < 1 || fdCount > MAX_FD_COUNT)
diff --git a/utils/makemhr/makemhr.cpp b/utils/makemhr/makemhr.cpp
index f10083a5..ef756708 100644
--- a/utils/makemhr/makemhr.cpp
+++ b/utils/makemhr/makemhr.cpp
@@ -128,16 +128,12 @@ enum HeadModelT {
// The limits to the truncation window size on the command line.
#define MIN_TRUNCSIZE (16)
-#define MAX_TRUNCSIZE (512)
+#define MAX_TRUNCSIZE (128)
// The limits to the custom head radius on the command line.
#define MIN_CUSTOM_RADIUS (0.05)
#define MAX_CUSTOM_RADIUS (0.15)
-// The truncation window size must be a multiple of the below value to allow
-// for vectorized convolution.
-#define MOD_TRUNCSIZE (8)
-
// The defaults for the command line options.
#define DEFAULT_FFTSIZE (65536)
#define DEFAULT_EQUALIZE (1)
@@ -1510,9 +1506,9 @@ int main(int argc, char *argv[])
case 'w':
truncSize = static_cast<uint>(strtoul(optarg, &end, 10));
- if(end[0] != '\0' || truncSize < MIN_TRUNCSIZE || truncSize > MAX_TRUNCSIZE || (truncSize%MOD_TRUNCSIZE))
+ if(end[0] != '\0' || truncSize < MIN_TRUNCSIZE || truncSize > MAX_TRUNCSIZE)
{
- fprintf(stderr, "\nError: Got unexpected value \"%s\" for option -%c, expected multiple of %u between %u to %u.\n", optarg, opt, MOD_TRUNCSIZE, MIN_TRUNCSIZE, MAX_TRUNCSIZE);
+ fprintf(stderr, "\nError: Got unexpected value \"%s\" for option -%c, expected between %u to %u.\n", optarg, opt, MIN_TRUNCSIZE, MAX_TRUNCSIZE);
exit(EXIT_FAILURE);
}
break;