zenilib
0.5.3.0
|
#include "config.h"
#include <stdlib.h>
#include <ctype.h>
#include "AL/al.h"
#include "AL/alc.h"
#include "alMain.h"
#include "alSource.h"
#include "alu.h"
#include "hrtf_tables.inc"
Go to the source code of this file.
Macros | |
#define | MAX_AZ_COUNT (128) |
#define | MAX_EV_COUNT (128) |
#define | MAX_IR_SIZE (128) |
#define | MIN_AZ_COUNT (1) |
#define | MIN_EV_COUNT (5) |
#define | MIN_IR_SIZE (8) |
#define | MOD_IR_SIZE (8) |
#define | PATH_MAX 4096 |
Functions | |
static void | CalcAzIndices (const struct Hrtf *Hrtf, ALuint evidx, ALfloat az, ALuint *azidx, ALfloat *azmu) |
static void | CalcEvIndices (const struct Hrtf *Hrtf, ALfloat ev, ALuint *evidx, ALfloat *evmu) |
ALfloat | CalcHrtfDelta (ALfloat oldGain, ALfloat newGain, const ALfloat olddir[3], const ALfloat newdir[3]) |
void | FreeHrtfs (void) |
struct Hrtf * | GetHrtf (ALCdevice *device) |
ALuint | GetHrtfIrSize (const struct Hrtf *Hrtf) |
void | GetLerpedHrtfCoeffs (const struct Hrtf *Hrtf, ALfloat elevation, ALfloat azimuth, ALfloat gain, ALfloat(*coeffs)[2], ALuint *delays) |
ALuint | GetMovingHrtfCoeffs (const struct Hrtf *Hrtf, ALfloat elevation, ALfloat azimuth, ALfloat gain, ALfloat delta, ALint counter, ALfloat(*coeffs)[2], ALuint *delays, ALfloat(*coeffStep)[2], ALint *delayStep) |
static struct Hrtf * | LoadHrtf (ALuint deviceRate) |
static struct Hrtf * | LoadHrtf00 (FILE *f, ALuint deviceRate) |
static struct Hrtf * | LoadHrtf01 (FILE *f, ALuint deviceRate) |
Variables | |
static struct Hrtf * | LoadedHrtfs = NULL |
static const ALchar | magicMarker00 [8] = "MinPHR00" |
static const ALchar | magicMarker01 [8] = "MinPHR01" |
#define MAX_AZ_COUNT (128) |
Definition at line 47 of file hrtf.c.
Referenced by LoadHrtf00(), and LoadHrtf01().
#define MAX_EV_COUNT (128) |
Definition at line 44 of file hrtf.c.
Referenced by LoadHrtf00(), and LoadHrtf01().
#define MAX_IR_SIZE (128) |
Definition at line 40 of file hrtf.c.
Referenced by LoadHrtf00(), and LoadHrtf01().
#define MIN_AZ_COUNT (1) |
Definition at line 46 of file hrtf.c.
Referenced by LoadHrtf00(), and LoadHrtf01().
#define MIN_EV_COUNT (5) |
Definition at line 43 of file hrtf.c.
Referenced by LoadHrtf00(), and LoadHrtf01().
#define MIN_IR_SIZE (8) |
Definition at line 39 of file hrtf.c.
Referenced by LoadHrtf00(), and LoadHrtf01().
#define MOD_IR_SIZE (8) |
Definition at line 41 of file hrtf.c.
Referenced by LoadHrtf00(), and LoadHrtf01().
#define PATH_MAX 4096 |
OpenAL cross platform audio library Copyright (C) 2011 by Chris Robinson This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details.
You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. Or go to http://www.gnu.org/copyleft/lgpl.html
Definition at line 34 of file hrtf.c.
Referenced by LoadHrtf(), and SDL_RWFromFile().
|
static |
Definition at line 93 of file hrtf.c.
References F_PI, and fastf2u().
Referenced by GetLerpedHrtfCoeffs(), and GetMovingHrtfCoeffs().
|
static |
Definition at line 81 of file hrtf.c.
References F_PI, F_PI_2, fastf2u(), and minu().
Referenced by GetLerpedHrtfCoeffs(), and GetMovingHrtfCoeffs().
struct Hrtf* GetHrtf | ( | ALCdevice * | device | ) |
Definition at line 762 of file hrtf.c.
References DevFmtChannelsString(), DevFmtStereo, ERR, ALCdevice_struct::FmtChans, ALCdevice_struct::Frequency, LoadedHrtfs, LoadHrtf(), and NULL.
Referenced by UpdateDeviceParams().
Definition at line 801 of file hrtf.c.
Referenced by CalcNonAttnSourceParams(), and CalcSourceParams().
void GetLerpedHrtfCoeffs | ( | const struct Hrtf * | Hrtf, |
ALfloat | elevation, | ||
ALfloat | azimuth, | ||
ALfloat | gain, | ||
ALfloat(*) | coeffs[2], | ||
ALuint * | delays | ||
) |
Definition at line 140 of file hrtf.c.
References CalcAzIndices(), CalcEvIndices(), fastf2u(), HRTFDELAY_BITS, and i.
Referenced by CalcNonAttnSourceParams(), and CalcSourceParams().
ALuint GetMovingHrtfCoeffs | ( | const struct Hrtf * | Hrtf, |
ALfloat | elevation, | ||
ALfloat | azimuth, | ||
ALfloat | gain, | ||
ALfloat | delta, | ||
ALint | counter, | ||
ALfloat(*) | coeffs[2], | ||
ALuint * | delays, | ||
ALfloat(*) | coeffStep[2], | ||
ALint * | delayStep | ||
) |
Definition at line 232 of file hrtf.c.
References CalcAzIndices(), CalcEvIndices(), fastf2i(), fastf2u(), HRIR_LENGTH, HRTFDELAY_BITS, i, and maxf().
Referenced by CalcSourceParams().
|
static |
Definition at line 665 of file hrtf.c.
References ConfigValueStr(), DevFmtChannelsString(), DevFmtStereo, ERR, i, LoadedHrtfs, LoadHrtf00(), LoadHrtf01(), magicMarker00, magicMarker01, minu(), NULL, PATH_MAX, and TRACE.
Referenced by GetHrtf().
|
static |
Definition at line 353 of file hrtf.c.
References AL_FALSE, AL_TRUE, ERR, free, i, j, malloc, MAX_AZ_COUNT, MAX_EV_COUNT, MAX_IR_SIZE, MIN_AZ_COUNT, MIN_EV_COUNT, MIN_IR_SIZE, MOD_IR_SIZE, NULL, and SRC_HISTORY_LENGTH.
Referenced by LoadHrtf().
|
static |
Definition at line 520 of file hrtf.c.
References AL_FALSE, AL_TRUE, ERR, free, i, j, malloc, MAX_AZ_COUNT, MAX_EV_COUNT, MAX_IR_SIZE, MIN_AZ_COUNT, MIN_EV_COUNT, MIN_IR_SIZE, MOD_IR_SIZE, NULL, and SRC_HISTORY_LENGTH.
Referenced by LoadHrtf().
|
static |
Definition at line 75 of file hrtf.c.
Referenced by GetHrtf(), and LoadHrtf().
Definition at line 62 of file hrtf.c.
Referenced by LoadHrtf().
Definition at line 63 of file hrtf.c.
Referenced by LoadHrtf().