Skip to content

Commit

Permalink
Merge pull request #150 from hoene/symetrical-center-mismatch
Browse files Browse the repository at this point in the history
Symmetrical center mismatch
  • Loading branch information
hoene authored Jan 24, 2021
2 parents 332a82e + 17030a9 commit 99ee33d
Showing 1 changed file with 19 additions and 12 deletions.
31 changes: 19 additions & 12 deletions src/hrtf/interpolate.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,13 @@ MYSOFA_EXPORT float *mysofa_interpolate(struct MYSOFA_HRTF *hrtf,
hrtf->SourcePosition.values + neighborhood[0] * hrtf->C);
d6[1] = distance(cordinate,
hrtf->SourcePosition.values + neighborhood[1] * hrtf->C);
if (d6[0] < d6[1])
use[0] = 1;
else
use[1] = 1;

if (!fequals(d6[0], d6[1])) {
if (d6[0] < d6[1])
use[0] = 1;
else
use[1] = 1;
}
} else if (neighborhood[0] >= 0) {
d6[0] = distance(cordinate,
hrtf->SourcePosition.values + neighborhood[0] * hrtf->C);
Expand All @@ -66,10 +69,12 @@ MYSOFA_EXPORT float *mysofa_interpolate(struct MYSOFA_HRTF *hrtf,
hrtf->SourcePosition.values + neighborhood[2] * hrtf->C);
d6[3] = distance(cordinate,
hrtf->SourcePosition.values + neighborhood[3] * hrtf->C);
if (d6[2] < d6[3])
use[2] = 1;
else
use[3] = 1;
if (!fequals(d6[2], d6[3])) {
if (d6[2] < d6[3])
use[2] = 1;
else
use[3] = 1;
}
} else if (neighborhood[2] >= 0) {
d6[2] = distance(cordinate,
hrtf->SourcePosition.values + neighborhood[2] * hrtf->C);
Expand All @@ -85,10 +90,12 @@ MYSOFA_EXPORT float *mysofa_interpolate(struct MYSOFA_HRTF *hrtf,
hrtf->SourcePosition.values + neighborhood[4] * hrtf->C);
d6[5] = distance(cordinate,
hrtf->SourcePosition.values + neighborhood[5] * hrtf->C);
if (d6[4] < d6[5])
use[4] = 1;
else
use[5] = 1;
if (!fequals(d6[4], d6[5])) {
if (d6[4] < d6[5])
use[4] = 1;
else
use[5] = 1;
}
} else if (neighborhood[4] >= 0) {
d6[4] = distance(cordinate,
hrtf->SourcePosition.values + neighborhood[4] * hrtf->C);
Expand Down

0 comments on commit 99ee33d

Please sign in to comment.