zenilib  0.5.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
alBuffer.c File Reference
#include "config.h"
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include <limits.h>
#include "alMain.h"
#include "alu.h"
#include "alError.h"
#include "alBuffer.h"
#include "alThunk.h"

Go to the source code of this file.

Macros

#define DECL_TEMPLATE(T)
 
#define DECL_TEMPLATE(T)
 
#define DECL_TEMPLATE(T)
 
#define DECL_TEMPLATE(T)
 
#define DECL_TEMPLATE(T1, T2)
 
#define DECL_TEMPLATE(T)
 
#define DECL_TEMPLATE(T)
 
#define DECL_TEMPLATE(T)
 

Typedefs

typedef ALubyte ALalaw
 
typedef ALubyte ALima4
 
typedef ALubyte ALmulaw
 

Functions

AL_API void AL_APIENTRY alBuffer3f (ALuint buffer, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3)
 
AL_API void AL_APIENTRY alBuffer3i (ALuint buffer, ALenum param, ALint value1, ALint value2, ALint value3)
 
AL_API ALvoid AL_APIENTRY alBufferData (ALuint buffer, ALenum format, const ALvoid *data, ALsizei size, ALsizei freq)
 
AL_API void AL_APIENTRY alBufferf (ALuint buffer, ALenum param, ALfloat value)
 
AL_API void AL_APIENTRY alBufferfv (ALuint buffer, ALenum param, const ALfloat *values)
 
AL_API void AL_APIENTRY alBufferi (ALuint buffer, ALenum param, ALint value)
 
AL_API void AL_APIENTRY alBufferiv (ALuint buffer, ALenum param, const ALint *values)
 
AL_API void AL_APIENTRY alBufferSamplesSOFT (ALuint buffer, ALuint samplerate, ALenum internalformat, ALsizei samples, ALenum channels, ALenum type, const ALvoid *data)
 
AL_API ALvoid AL_APIENTRY alBufferSubDataSOFT (ALuint buffer, ALenum format, const ALvoid *data, ALsizei offset, ALsizei length)
 
AL_API void AL_APIENTRY alBufferSubSamplesSOFT (ALuint buffer, ALsizei offset, ALsizei samples, ALenum channels, ALenum type, const ALvoid *data)
 
AL_API ALvoid AL_APIENTRY alDeleteBuffers (ALsizei n, const ALuint *buffers)
 
AL_API ALvoid AL_APIENTRY alGenBuffers (ALsizei n, ALuint *buffers)
 
AL_API void AL_APIENTRY alGetBuffer3f (ALuint buffer, ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3)
 
AL_API void AL_APIENTRY alGetBuffer3i (ALuint buffer, ALenum param, ALint *value1, ALint *value2, ALint *value3)
 
AL_API ALvoid AL_APIENTRY alGetBufferf (ALuint buffer, ALenum param, ALfloat *value)
 
AL_API void AL_APIENTRY alGetBufferfv (ALuint buffer, ALenum param, ALfloat *values)
 
AL_API ALvoid AL_APIENTRY alGetBufferi (ALuint buffer, ALenum param, ALint *value)
 
AL_API void AL_APIENTRY alGetBufferiv (ALuint buffer, ALenum param, ALint *values)
 
AL_API void AL_APIENTRY alGetBufferSamplesSOFT (ALuint buffer, ALsizei offset, ALsizei samples, ALenum channels, ALenum type, ALvoid *data)
 
AL_API ALboolean AL_APIENTRY alIsBuffer (ALuint buffer)
 
AL_API ALboolean AL_APIENTRY alIsBufferFormatSupportedSOFT (ALenum format)
 
ALuint BytesFromFmt (enum FmtType type)
 
ALuint BytesFromUserFmt (enum UserFmtType type)
 
ALuint ChannelsFromFmt (enum FmtChannels chans)
 
ALuint ChannelsFromUserFmt (enum UserFmtChannels chans)
 
static __inline ALalaw Conv_ALalaw_ALalaw (ALalaw val)
 
static __inline ALbyte3 Conv_ALbyte3_ALbyte3 (ALbyte3 val)
 
static __inline ALbyte Conv_ALbyte_ALalaw (ALalaw val)
 
static __inline ALbyte Conv_ALbyte_ALbyte (ALbyte val)
 
static __inline ALbyte Conv_ALbyte_ALbyte3 (ALbyte3 val)
 
static __inline ALbyte Conv_ALbyte_ALdouble (ALdouble val)
 
static __inline ALbyte Conv_ALbyte_ALfloat (ALfloat val)
 
static __inline ALbyte Conv_ALbyte_ALint (ALint val)
 
static __inline ALbyte Conv_ALbyte_ALmulaw (ALmulaw val)
 
static __inline ALbyte Conv_ALbyte_ALshort (ALshort val)
 
static __inline ALbyte Conv_ALbyte_ALubyte (ALubyte val)
 
static __inline ALbyte Conv_ALbyte_ALubyte3 (ALubyte3 val)
 
static __inline ALbyte Conv_ALbyte_ALuint (ALuint val)
 
static __inline ALbyte Conv_ALbyte_ALushort (ALushort val)
 
static __inline ALdouble Conv_ALdouble_ALalaw (ALalaw val)
 
static __inline ALdouble Conv_ALdouble_ALbyte (ALbyte val)
 
static __inline ALdouble Conv_ALdouble_ALbyte3 (ALbyte3 val)
 
static __inline ALdouble Conv_ALdouble_ALdouble (ALdouble val)
 
static __inline ALdouble Conv_ALdouble_ALfloat (ALfloat val)
 
static __inline ALdouble Conv_ALdouble_ALint (ALint val)
 
static __inline ALdouble Conv_ALdouble_ALmulaw (ALmulaw val)
 
static __inline ALdouble Conv_ALdouble_ALshort (ALshort val)
 
static __inline ALdouble Conv_ALdouble_ALubyte (ALubyte val)
 
static __inline ALdouble Conv_ALdouble_ALubyte3 (ALubyte3 val)
 
static __inline ALdouble Conv_ALdouble_ALuint (ALuint val)
 
static __inline ALdouble Conv_ALdouble_ALushort (ALushort val)
 
static __inline ALfloat Conv_ALfloat_ALalaw (ALalaw val)
 
static __inline ALfloat Conv_ALfloat_ALbyte (ALbyte val)
 
static __inline ALfloat Conv_ALfloat_ALbyte3 (ALbyte3 val)
 
static __inline ALfloat Conv_ALfloat_ALdouble (ALdouble val)
 
static __inline ALfloat Conv_ALfloat_ALfloat (ALfloat val)
 
static __inline ALfloat Conv_ALfloat_ALint (ALint val)
 
static __inline ALfloat Conv_ALfloat_ALmulaw (ALmulaw val)
 
static __inline ALfloat Conv_ALfloat_ALshort (ALshort val)
 
static __inline ALfloat Conv_ALfloat_ALubyte (ALubyte val)
 
static __inline ALfloat Conv_ALfloat_ALubyte3 (ALubyte3 val)
 
static __inline ALfloat Conv_ALfloat_ALuint (ALuint val)
 
static __inline ALfloat Conv_ALfloat_ALushort (ALushort val)
 
static __inline ALint Conv_ALint_ALalaw (ALalaw val)
 
static __inline ALint Conv_ALint_ALbyte (ALbyte val)
 
static __inline ALint Conv_ALint_ALbyte3 (ALbyte3 val)
 
static __inline ALint Conv_ALint_ALdouble (ALdouble val)
 
static __inline ALint Conv_ALint_ALfloat (ALfloat val)
 
static __inline ALint Conv_ALint_ALint (ALint val)
 
static __inline ALint Conv_ALint_ALmulaw (ALmulaw val)
 
static __inline ALint Conv_ALint_ALshort (ALshort val)
 
static __inline ALint Conv_ALint_ALubyte (ALubyte val)
 
static __inline ALint Conv_ALint_ALubyte3 (ALubyte3 val)
 
static __inline ALint Conv_ALint_ALuint (ALuint val)
 
static __inline ALint Conv_ALint_ALushort (ALushort val)
 
static __inline ALmulaw Conv_ALmulaw_ALmulaw (ALmulaw val)
 
static __inline ALshort Conv_ALshort_ALalaw (ALalaw val)
 
static __inline ALshort Conv_ALshort_ALbyte (ALbyte val)
 
static __inline ALshort Conv_ALshort_ALbyte3 (ALbyte3 val)
 
static __inline ALshort Conv_ALshort_ALdouble (ALdouble val)
 
static __inline ALshort Conv_ALshort_ALfloat (ALfloat val)
 
static __inline ALshort Conv_ALshort_ALint (ALint val)
 
static __inline ALshort Conv_ALshort_ALmulaw (ALmulaw val)
 
static __inline ALshort Conv_ALshort_ALshort (ALshort val)
 
static __inline ALshort Conv_ALshort_ALubyte (ALubyte val)
 
static __inline ALshort Conv_ALshort_ALubyte3 (ALubyte3 val)
 
static __inline ALshort Conv_ALshort_ALuint (ALuint val)
 
static __inline ALshort Conv_ALshort_ALushort (ALushort val)
 
static __inline ALubyte3 Conv_ALubyte3_ALubyte3 (ALubyte3 val)
 
static __inline ALubyte Conv_ALubyte_ALalaw (ALalaw val)
 
static __inline ALubyte Conv_ALubyte_ALbyte (ALbyte val)
 
static __inline ALubyte Conv_ALubyte_ALbyte3 (ALbyte3 val)
 
static __inline ALubyte Conv_ALubyte_ALdouble (ALdouble val)
 
static __inline ALubyte Conv_ALubyte_ALfloat (ALfloat val)
 
static __inline ALubyte Conv_ALubyte_ALint (ALint val)
 
static __inline ALubyte Conv_ALubyte_ALmulaw (ALmulaw val)
 
static __inline ALubyte Conv_ALubyte_ALshort (ALshort val)
 
static __inline ALubyte Conv_ALubyte_ALubyte (ALubyte val)
 
static __inline ALubyte Conv_ALubyte_ALubyte3 (ALubyte3 val)
 
static __inline ALubyte Conv_ALubyte_ALuint (ALuint val)
 
static __inline ALubyte Conv_ALubyte_ALushort (ALushort val)
 
static __inline ALuint Conv_ALuint_ALalaw (ALalaw val)
 
static __inline ALuint Conv_ALuint_ALbyte (ALbyte val)
 
static __inline ALuint Conv_ALuint_ALbyte3 (ALbyte3 val)
 
static __inline ALuint Conv_ALuint_ALdouble (ALdouble val)
 
static __inline ALuint Conv_ALuint_ALfloat (ALfloat val)
 
static __inline ALuint Conv_ALuint_ALint (ALint val)
 
static __inline ALuint Conv_ALuint_ALmulaw (ALmulaw val)
 
static __inline ALuint Conv_ALuint_ALshort (ALshort val)
 
static __inline ALuint Conv_ALuint_ALubyte (ALubyte val)
 
static __inline ALuint Conv_ALuint_ALubyte3 (ALubyte3 val)
 
static __inline ALuint Conv_ALuint_ALuint (ALuint val)
 
static __inline ALuint Conv_ALuint_ALushort (ALushort val)
 
static __inline ALushort Conv_ALushort_ALalaw (ALalaw val)
 
static __inline ALushort Conv_ALushort_ALbyte (ALbyte val)
 
static __inline ALushort Conv_ALushort_ALbyte3 (ALbyte3 val)
 
static __inline ALushort Conv_ALushort_ALdouble (ALdouble val)
 
static __inline ALushort Conv_ALushort_ALfloat (ALfloat val)
 
static __inline ALushort Conv_ALushort_ALint (ALint val)
 
static __inline ALushort Conv_ALushort_ALmulaw (ALmulaw val)
 
static __inline ALushort Conv_ALushort_ALshort (ALshort val)
 
static __inline ALushort Conv_ALushort_ALubyte (ALubyte val)
 
static __inline ALushort Conv_ALushort_ALubyte3 (ALubyte3 val)
 
static __inline ALushort Conv_ALushort_ALuint (ALuint val)
 
static __inline ALushort Conv_ALushort_ALushort (ALushort val)
 
static void Convert_ALima4_ALima4 (ALima4 *dst, const ALima4 *src, ALuint numchans, ALuint numblocks)
 
static void ConvertData (ALvoid *dst, enum UserFmtType dstType, const ALvoid *src, enum UserFmtType srcType, ALsizei numchans, ALsizei len)
 
static __inline ALshort DecodeALaw (ALalaw val)
 
static __inline ALint DecodeByte3 (ALbyte3 val)
 
static void DecodeIMA4Block (ALshort *dst, const ALima4 *src, ALint numchans)
 
static __inline ALshort DecodeMuLaw (ALmulaw val)
 
static __inline ALint DecodeUByte3 (ALubyte3 val)
 
static ALboolean DecomposeFormat (ALenum format, enum FmtChannels *chans, enum FmtType *type)
 
static ALboolean DecomposeUserFormat (ALenum format, enum UserFmtChannels *chans, enum UserFmtType *type)
 
static ALalaw EncodeALaw (ALshort val)
 
static __inline ALbyte3 EncodeByte3 (ALint val)
 
static void EncodeIMA4Block (ALima4 *dst, const ALshort *src, ALint *sample, ALint *index, ALint numchans)
 
static ALmulaw EncodeMuLaw (ALshort val)
 
static __inline ALubyte3 EncodeUByte3 (ALint val)
 
static ALboolean IsValidChannels (ALenum channels)
 
static ALboolean IsValidType (ALenum type)
 
static ALenum LoadData (ALbuffer *ALBuf, ALuint freq, ALenum NewFormat, ALsizei frames, enum UserFmtChannels chans, enum UserFmtType type, const ALvoid *data, ALboolean storesrc)
 
ALvoid ReleaseALBuffers (ALCdevice *device)
 

Variables

static const int aLawClip = 32635
 
static const char aLawCompressTable [128]
 
static const ALshort aLawDecompressionTable [256]
 
ALbyte ALbyte3_size_is_not_3 [(sizeof(ALbyte3)==sizeof(ALbyte[3]))?1:-1]
 
ALbyte ALubyte3_size_is_not_3 [(sizeof(ALubyte3)==sizeof(ALubyte[3]))?1:-1]
 
static const int IMA4Codeword [16]
 
static const int IMA4Index_adjust [16]
 
static const int IMAStep_size [89]
 
static const int muLawBias = 0x84
 
static const int muLawClip = 32635
 
static const char muLawCompressTable [256]
 
static const ALshort muLawDecompressionTable [256]
 

Macro Definition Documentation

#define DECL_TEMPLATE (   T)
Value:
static __inline ALmulaw Conv_ALmulaw_##T(T val) \
{ return EncodeMuLaw(Conv_ALshort_##T(val)); }
GLuint const GLfloat * val
Definition: glew.h:2715
ALubyte ALmulaw
Definition: alBuffer.c:1022
static ALmulaw EncodeMuLaw(ALshort val)
Definition: alBuffer.c:1037

Definition at line 1820 of file alBuffer.c.

#define DECL_TEMPLATE (   T)
Value:
static __inline ALalaw Conv_ALalaw_##T(T val) \
{ return EncodeALaw(Conv_ALshort_##T(val)); }
GLuint const GLfloat * val
Definition: glew.h:2715
ALubyte ALalaw
Definition: alBuffer.c:1023
static ALalaw EncodeALaw(ALshort val)
Definition: alBuffer.c:1062

Definition at line 1820 of file alBuffer.c.

#define DECL_TEMPLATE (   T)
Value:
static __inline ALbyte3 Conv_ALbyte3_##T(T val) \
{ return EncodeByte3(Conv_ALint_##T(val)>>8); }
GLuint const GLfloat * val
Definition: glew.h:2715
static __inline ALbyte3 EncodeByte3(ALint val)
Definition: alBuffer.c:1213

Definition at line 1820 of file alBuffer.c.

#define DECL_TEMPLATE (   T)
Value:
static __inline ALubyte3 Conv_ALubyte3_##T(T val) \
{ return EncodeUByte3(Conv_ALuint_##T(val)>>8); }
GLuint const GLfloat * val
Definition: glew.h:2715
static __inline ALubyte3 EncodeUByte3(ALint val)
Definition: alBuffer.c:1234

Definition at line 1820 of file alBuffer.c.

#define DECL_TEMPLATE (   T1,
  T2 
)
Value:
static void Convert_##T1##_##T2(T1 *dst, const T2 *src, ALuint numchans, \
{ \
for(i = 0;i < len;i++) \
{ \
for(j = 0;j < numchans;j++) \
*(dst++) = Conv_##T1##_##T2(*(src++)); \
} \
}
int32_t j
Definition: e_log.c:102
GLenum GLsizei len
Definition: glew.h:7035
GLenum GLenum dst
Definition: glew.h:2396
for(;;)
unsigned int ALuint
Definition: al.h:59
GLenum src
Definition: glew.h:2396
int i
Definition: pngrutil.c:1377

Definition at line 1820 of file alBuffer.c.

#define DECL_TEMPLATE (   T)
Value:
static void Convert_##T##_ALima4(T *dst, const ALima4 *src, ALuint numchans, \
{ \
ALshort tmp[65*MaxChannels]; /* Max samples an IMA4 frame can be */ \
ALuint i, j, k; \
\
i = 0; \
while(i < len) \
{ \
DecodeIMA4Block(tmp, src, numchans); \
src += 36*numchans; \
for(j = 0;j < 65 && i < len;j++,i++) \
{ \
for(k = 0;k < numchans;k++) \
*(dst++) = Conv_##T##_ALshort(tmp[j*numchans + k]); \
} \
} \
}
static void DecodeIMA4Block(ALshort *dst, const ALima4 *src, ALint numchans)
Definition: alBuffer.c:1088
int32_t k
Definition: e_log.c:102
int32_t j
Definition: e_log.c:102
short ALshort
Definition: al.h:50
ALubyte ALima4
Definition: alBuffer.c:1024
GLenum GLsizei len
Definition: glew.h:7035
GLenum GLenum dst
Definition: glew.h:2396
for(;;)
unsigned int ALuint
Definition: al.h:59
GLenum src
Definition: glew.h:2396
int i
Definition: pngrutil.c:1377
while(1)

Definition at line 1820 of file alBuffer.c.

#define DECL_TEMPLATE (   T)
Value:
static void Convert_ALima4_##T(ALima4 *dst, const T *src, ALuint numchans, \
{ \
ALshort tmp[65*MaxChannels]; /* Max samples an IMA4 frame can be */ \
ALint sample[MaxChannels] = {0,0,0,0,0,0,0,0}; \
ALint index[MaxChannels] = {0,0,0,0,0,0,0,0}; \
for(i = 0;i < len;i += 65) \
{ \
for(j = 0;j < 65*numchans;j++) \
tmp[j] = Conv_ALshort_##T(*(src++)); \
EncodeIMA4Block(dst, tmp, sample, index, numchans); \
dst += 36*numchans; \
} \
}
static void EncodeIMA4Block(ALima4 *dst, const ALshort *src, ALint *sample, ALint *index, ALint numchans)
Definition: alBuffer.c:1138
int ALint
Definition: al.h:56
int32_t j
Definition: e_log.c:102
short ALshort
Definition: al.h:50
ALubyte ALima4
Definition: alBuffer.c:1024
GLenum GLsizei len
Definition: glew.h:7035
GLenum GLenum dst
Definition: glew.h:2396
for(;;)
GLuint index
Definition: glew.h:1800
unsigned int ALuint
Definition: al.h:59
GLenum src
Definition: glew.h:2396
int i
Definition: pngrutil.c:1377

Definition at line 1820 of file alBuffer.c.

#define DECL_TEMPLATE (   T)

Definition at line 1820 of file alBuffer.c.

Typedef Documentation

typedef ALubyte ALalaw

Definition at line 1023 of file alBuffer.c.

typedef ALubyte ALima4

Definition at line 1024 of file alBuffer.c.

typedef ALubyte ALmulaw

Definition at line 1022 of file alBuffer.c.

Function Documentation

AL_API void AL_APIENTRY alBuffer3f ( ALuint  buffer,
ALenum  param,
ALfloat  value1,
ALfloat  value2,
ALfloat  value3 
)
AL_API void AL_APIENTRY alBuffer3i ( ALuint  buffer,
ALenum  param,
ALint  value1,
ALint  value2,
ALint  value3 
)
AL_API void AL_APIENTRY alBufferf ( ALuint  buffer,
ALenum  param,
ALfloat  value 
)
AL_API void AL_APIENTRY alBufferSamplesSOFT ( ALuint  buffer,
ALuint  samplerate,
ALenum  internalformat,
ALsizei  samples,
ALenum  channels,
ALenum  type,
const ALvoid data 
)
AL_API void AL_APIENTRY alGetBuffer3f ( ALuint  buffer,
ALenum  param,
ALfloat value1,
ALfloat value2,
ALfloat value3 
)
AL_API void AL_APIENTRY alGetBuffer3i ( ALuint  buffer,
ALenum  param,
ALint value1,
ALint value2,
ALint value3 
)
AL_API ALboolean AL_APIENTRY alIsBuffer ( ALuint  buffer)

Verify a handle is a valid Buffer

Definition at line 272 of file alBuffer.c.

References AL_FALSE, AL_TRUE, ALCcontext_DecRef(), ALCcontext_struct::Device, GetContextRef(), and LookupBuffer.

Referenced by LoadSound().

AL_API ALboolean AL_APIENTRY alIsBufferFormatSupportedSOFT ( ALenum  format)

Definition at line 594 of file alBuffer.c.

References AL_FALSE, ALCcontext_DecRef(), DecomposeFormat(), GetContextRef(), and ret.

ALuint BytesFromFmt ( enum FmtType  type)
static __inline ALalaw Conv_ALalaw_ALalaw ( ALalaw  val)
static

Definition at line 1530 of file alBuffer.c.

static __inline ALbyte3 Conv_ALbyte3_ALbyte3 ( ALbyte3  val)
static

Definition at line 1551 of file alBuffer.c.

static __inline ALbyte Conv_ALbyte_ALalaw ( ALalaw  val)
static

Definition at line 1275 of file alBuffer.c.

References Conv_ALbyte_ALshort(), and DecodeALaw().

static __inline ALbyte Conv_ALbyte_ALbyte ( ALbyte  val)
static

Definition at line 1249 of file alBuffer.c.

static __inline ALbyte Conv_ALbyte_ALbyte3 ( ALbyte3  val)
static

Definition at line 1277 of file alBuffer.c.

References DecodeByte3().

static __inline ALbyte Conv_ALbyte_ALdouble ( ALdouble  val)
static

Definition at line 1267 of file alBuffer.c.

static __inline ALbyte Conv_ALbyte_ALfloat ( ALfloat  val)
static

Definition at line 1261 of file alBuffer.c.

static __inline ALbyte Conv_ALbyte_ALint ( ALint  val)
static

Definition at line 1257 of file alBuffer.c.

static __inline ALbyte Conv_ALbyte_ALmulaw ( ALmulaw  val)
static

Definition at line 1273 of file alBuffer.c.

References Conv_ALbyte_ALshort(), and DecodeMuLaw().

static __inline ALbyte Conv_ALbyte_ALshort ( ALshort  val)
static

Definition at line 1253 of file alBuffer.c.

Referenced by Conv_ALbyte_ALalaw(), and Conv_ALbyte_ALmulaw().

static __inline ALbyte Conv_ALbyte_ALubyte ( ALubyte  val)
static

Definition at line 1251 of file alBuffer.c.

static __inline ALbyte Conv_ALbyte_ALubyte3 ( ALubyte3  val)
static

Definition at line 1279 of file alBuffer.c.

References DecodeUByte3().

static __inline ALbyte Conv_ALbyte_ALuint ( ALuint  val)
static

Definition at line 1259 of file alBuffer.c.

static __inline ALbyte Conv_ALbyte_ALushort ( ALushort  val)
static

Definition at line 1255 of file alBuffer.c.

static __inline ALdouble Conv_ALdouble_ALalaw ( ALalaw  val)
static

Definition at line 1490 of file alBuffer.c.

References Conv_ALdouble_ALshort(), and DecodeALaw().

static __inline ALdouble Conv_ALdouble_ALbyte ( ALbyte  val)
static

Definition at line 1472 of file alBuffer.c.

static __inline ALdouble Conv_ALdouble_ALbyte3 ( ALbyte3  val)
static

Definition at line 1492 of file alBuffer.c.

References DecodeByte3().

static __inline ALdouble Conv_ALdouble_ALdouble ( ALdouble  val)
static

Definition at line 1486 of file alBuffer.c.

static __inline ALdouble Conv_ALdouble_ALfloat ( ALfloat  val)
static

Definition at line 1484 of file alBuffer.c.

static __inline ALdouble Conv_ALdouble_ALint ( ALint  val)
static

Definition at line 1480 of file alBuffer.c.

static __inline ALdouble Conv_ALdouble_ALmulaw ( ALmulaw  val)
static

Definition at line 1488 of file alBuffer.c.

References Conv_ALdouble_ALshort(), and DecodeMuLaw().

static __inline ALdouble Conv_ALdouble_ALshort ( ALshort  val)
static

Definition at line 1476 of file alBuffer.c.

Referenced by Conv_ALdouble_ALalaw(), and Conv_ALdouble_ALmulaw().

static __inline ALdouble Conv_ALdouble_ALubyte ( ALubyte  val)
static

Definition at line 1474 of file alBuffer.c.

static __inline ALdouble Conv_ALdouble_ALubyte3 ( ALubyte3  val)
static

Definition at line 1494 of file alBuffer.c.

References DecodeUByte3().

static __inline ALdouble Conv_ALdouble_ALuint ( ALuint  val)
static

Definition at line 1482 of file alBuffer.c.

References u.

static __inline ALdouble Conv_ALdouble_ALushort ( ALushort  val)
static

Definition at line 1478 of file alBuffer.c.

static __inline ALfloat Conv_ALfloat_ALalaw ( ALalaw  val)
static

Definition at line 1465 of file alBuffer.c.

References Conv_ALfloat_ALshort(), and DecodeALaw().

static __inline ALfloat Conv_ALfloat_ALbyte ( ALbyte  val)
static

Definition at line 1447 of file alBuffer.c.

static __inline ALfloat Conv_ALfloat_ALbyte3 ( ALbyte3  val)
static

Definition at line 1467 of file alBuffer.c.

References DecodeByte3().

static __inline ALfloat Conv_ALfloat_ALdouble ( ALdouble  val)
static

Definition at line 1461 of file alBuffer.c.

static __inline ALfloat Conv_ALfloat_ALfloat ( ALfloat  val)
static

Definition at line 1459 of file alBuffer.c.

static __inline ALfloat Conv_ALfloat_ALint ( ALint  val)
static

Definition at line 1455 of file alBuffer.c.

static __inline ALfloat Conv_ALfloat_ALmulaw ( ALmulaw  val)
static

Definition at line 1463 of file alBuffer.c.

References Conv_ALfloat_ALshort(), and DecodeMuLaw().

static __inline ALfloat Conv_ALfloat_ALshort ( ALshort  val)
static

Definition at line 1451 of file alBuffer.c.

Referenced by Conv_ALfloat_ALalaw(), and Conv_ALfloat_ALmulaw().

static __inline ALfloat Conv_ALfloat_ALubyte ( ALubyte  val)
static

Definition at line 1449 of file alBuffer.c.

static __inline ALfloat Conv_ALfloat_ALubyte3 ( ALubyte3  val)
static

Definition at line 1469 of file alBuffer.c.

References DecodeUByte3().

static __inline ALfloat Conv_ALfloat_ALuint ( ALuint  val)
static

Definition at line 1457 of file alBuffer.c.

References u.

static __inline ALfloat Conv_ALfloat_ALushort ( ALushort  val)
static

Definition at line 1453 of file alBuffer.c.

static __inline ALint Conv_ALint_ALalaw ( ALalaw  val)
static

Definition at line 1407 of file alBuffer.c.

References Conv_ALint_ALshort(), and DecodeALaw().

static __inline ALint Conv_ALint_ALbyte ( ALbyte  val)
static

Definition at line 1381 of file alBuffer.c.

static __inline ALint Conv_ALint_ALbyte3 ( ALbyte3  val)
static

Definition at line 1409 of file alBuffer.c.

References DecodeByte3().

static __inline ALint Conv_ALint_ALdouble ( ALdouble  val)
static

Definition at line 1399 of file alBuffer.c.

static __inline ALint Conv_ALint_ALfloat ( ALfloat  val)
static

Definition at line 1393 of file alBuffer.c.

static __inline ALint Conv_ALint_ALint ( ALint  val)
static

Definition at line 1389 of file alBuffer.c.

static __inline ALint Conv_ALint_ALmulaw ( ALmulaw  val)
static

Definition at line 1405 of file alBuffer.c.

References Conv_ALint_ALshort(), and DecodeMuLaw().

static __inline ALint Conv_ALint_ALshort ( ALshort  val)
static

Definition at line 1385 of file alBuffer.c.

Referenced by Conv_ALint_ALalaw(), and Conv_ALint_ALmulaw().

static __inline ALint Conv_ALint_ALubyte ( ALubyte  val)
static

Definition at line 1383 of file alBuffer.c.

static __inline ALint Conv_ALint_ALubyte3 ( ALubyte3  val)
static

Definition at line 1411 of file alBuffer.c.

References DecodeUByte3().

static __inline ALint Conv_ALint_ALuint ( ALuint  val)
static

Definition at line 1391 of file alBuffer.c.

References u.

static __inline ALint Conv_ALint_ALushort ( ALushort  val)
static

Definition at line 1387 of file alBuffer.c.

static __inline ALmulaw Conv_ALmulaw_ALmulaw ( ALmulaw  val)
static

Definition at line 1509 of file alBuffer.c.

static __inline ALshort Conv_ALshort_ALalaw ( ALalaw  val)
static

Definition at line 1341 of file alBuffer.c.

References Conv_ALshort_ALshort(), and DecodeALaw().

static __inline ALshort Conv_ALshort_ALbyte ( ALbyte  val)
static

Definition at line 1315 of file alBuffer.c.

static __inline ALshort Conv_ALshort_ALbyte3 ( ALbyte3  val)
static

Definition at line 1343 of file alBuffer.c.

References DecodeByte3().

static __inline ALshort Conv_ALshort_ALdouble ( ALdouble  val)
static

Definition at line 1333 of file alBuffer.c.

static __inline ALshort Conv_ALshort_ALfloat ( ALfloat  val)
static

Definition at line 1327 of file alBuffer.c.

static __inline ALshort Conv_ALshort_ALint ( ALint  val)
static

Definition at line 1323 of file alBuffer.c.

static __inline ALshort Conv_ALshort_ALmulaw ( ALmulaw  val)
static

Definition at line 1339 of file alBuffer.c.

References Conv_ALshort_ALshort(), and DecodeMuLaw().

static __inline ALshort Conv_ALshort_ALshort ( ALshort  val)
static

Definition at line 1319 of file alBuffer.c.

Referenced by Conv_ALshort_ALalaw(), and Conv_ALshort_ALmulaw().

static __inline ALshort Conv_ALshort_ALubyte ( ALubyte  val)
static

Definition at line 1317 of file alBuffer.c.

static __inline ALshort Conv_ALshort_ALubyte3 ( ALubyte3  val)
static

Definition at line 1345 of file alBuffer.c.

References DecodeUByte3().

static __inline ALshort Conv_ALshort_ALuint ( ALuint  val)
static

Definition at line 1325 of file alBuffer.c.

static __inline ALshort Conv_ALshort_ALushort ( ALushort  val)
static

Definition at line 1321 of file alBuffer.c.

static __inline ALubyte3 Conv_ALubyte3_ALubyte3 ( ALubyte3  val)
static

Definition at line 1572 of file alBuffer.c.

static __inline ALubyte Conv_ALubyte_ALalaw ( ALalaw  val)
static

Definition at line 1308 of file alBuffer.c.

References Conv_ALubyte_ALshort(), and DecodeALaw().

static __inline ALubyte Conv_ALubyte_ALbyte ( ALbyte  val)
static

Definition at line 1282 of file alBuffer.c.

static __inline ALubyte Conv_ALubyte_ALbyte3 ( ALbyte3  val)
static

Definition at line 1310 of file alBuffer.c.

References DecodeByte3().

static __inline ALubyte Conv_ALubyte_ALdouble ( ALdouble  val)
static

Definition at line 1300 of file alBuffer.c.

static __inline ALubyte Conv_ALubyte_ALfloat ( ALfloat  val)
static

Definition at line 1294 of file alBuffer.c.

static __inline ALubyte Conv_ALubyte_ALint ( ALint  val)
static

Definition at line 1290 of file alBuffer.c.

static __inline ALubyte Conv_ALubyte_ALmulaw ( ALmulaw  val)
static

Definition at line 1306 of file alBuffer.c.

References Conv_ALubyte_ALshort(), and DecodeMuLaw().

static __inline ALubyte Conv_ALubyte_ALshort ( ALshort  val)
static

Definition at line 1286 of file alBuffer.c.

Referenced by Conv_ALubyte_ALalaw(), and Conv_ALubyte_ALmulaw().

static __inline ALubyte Conv_ALubyte_ALubyte ( ALubyte  val)
static

Definition at line 1284 of file alBuffer.c.

static __inline ALubyte Conv_ALubyte_ALubyte3 ( ALubyte3  val)
static

Definition at line 1312 of file alBuffer.c.

References DecodeUByte3().

static __inline ALubyte Conv_ALubyte_ALuint ( ALuint  val)
static

Definition at line 1292 of file alBuffer.c.

static __inline ALubyte Conv_ALubyte_ALushort ( ALushort  val)
static

Definition at line 1288 of file alBuffer.c.

static __inline ALuint Conv_ALuint_ALalaw ( ALalaw  val)
static

Definition at line 1440 of file alBuffer.c.

References Conv_ALuint_ALshort(), and DecodeALaw().

static __inline ALuint Conv_ALuint_ALbyte ( ALbyte  val)
static

Definition at line 1414 of file alBuffer.c.

static __inline ALuint Conv_ALuint_ALbyte3 ( ALbyte3  val)
static

Definition at line 1442 of file alBuffer.c.

References DecodeByte3().

static __inline ALuint Conv_ALuint_ALdouble ( ALdouble  val)
static

Definition at line 1432 of file alBuffer.c.

References u.

static __inline ALuint Conv_ALuint_ALfloat ( ALfloat  val)
static

Definition at line 1426 of file alBuffer.c.

References u.

static __inline ALuint Conv_ALuint_ALint ( ALint  val)
static

Definition at line 1422 of file alBuffer.c.

References u.

static __inline ALuint Conv_ALuint_ALmulaw ( ALmulaw  val)
static

Definition at line 1438 of file alBuffer.c.

References Conv_ALuint_ALshort(), and DecodeMuLaw().

static __inline ALuint Conv_ALuint_ALshort ( ALshort  val)
static

Definition at line 1418 of file alBuffer.c.

Referenced by Conv_ALuint_ALalaw(), and Conv_ALuint_ALmulaw().

static __inline ALuint Conv_ALuint_ALubyte ( ALubyte  val)
static

Definition at line 1416 of file alBuffer.c.

static __inline ALuint Conv_ALuint_ALubyte3 ( ALubyte3  val)
static

Definition at line 1444 of file alBuffer.c.

References DecodeUByte3().

static __inline ALuint Conv_ALuint_ALuint ( ALuint  val)
static

Definition at line 1424 of file alBuffer.c.

static __inline ALuint Conv_ALuint_ALushort ( ALushort  val)
static

Definition at line 1420 of file alBuffer.c.

static __inline ALushort Conv_ALushort_ALalaw ( ALalaw  val)
static

Definition at line 1374 of file alBuffer.c.

References Conv_ALushort_ALshort(), and DecodeALaw().

static __inline ALushort Conv_ALushort_ALbyte ( ALbyte  val)
static

Definition at line 1348 of file alBuffer.c.

static __inline ALushort Conv_ALushort_ALbyte3 ( ALbyte3  val)
static

Definition at line 1376 of file alBuffer.c.

References DecodeByte3().

static __inline ALushort Conv_ALushort_ALdouble ( ALdouble  val)
static

Definition at line 1366 of file alBuffer.c.

static __inline ALushort Conv_ALushort_ALfloat ( ALfloat  val)
static

Definition at line 1360 of file alBuffer.c.

static __inline ALushort Conv_ALushort_ALint ( ALint  val)
static

Definition at line 1356 of file alBuffer.c.

static __inline ALushort Conv_ALushort_ALmulaw ( ALmulaw  val)
static

Definition at line 1372 of file alBuffer.c.

References Conv_ALushort_ALshort(), and DecodeMuLaw().

static __inline ALushort Conv_ALushort_ALshort ( ALshort  val)
static

Definition at line 1352 of file alBuffer.c.

Referenced by Conv_ALushort_ALalaw(), and Conv_ALushort_ALmulaw().

static __inline ALushort Conv_ALushort_ALubyte ( ALubyte  val)
static

Definition at line 1350 of file alBuffer.c.

static __inline ALushort Conv_ALushort_ALubyte3 ( ALubyte3  val)
static

Definition at line 1378 of file alBuffer.c.

References DecodeUByte3().

static __inline ALushort Conv_ALushort_ALuint ( ALuint  val)
static

Definition at line 1358 of file alBuffer.c.

static __inline ALushort Conv_ALushort_ALushort ( ALushort  val)
static

Definition at line 1354 of file alBuffer.c.

static void Convert_ALima4_ALima4 ( ALima4 dst,
const ALima4 src,
ALuint  numchans,
ALuint  numblocks 
)
static

Definition at line 1812 of file alBuffer.c.

References memcpy.

static void ConvertData ( ALvoid dst,
enum UserFmtType  dstType,
const ALvoid src,
enum UserFmtType  srcType,
ALsizei  numchans,
ALsizei  len 
)
static
static void DecodeIMA4Block ( ALshort dst,
const ALima4 src,
ALint  numchans 
)
static

Definition at line 1088 of file alBuffer.c.

References clampi(), IMA4Codeword, IMA4Index_adjust, IMAStep_size, j, k, MaxChannels, and nibble().

static ALalaw EncodeALaw ( ALshort  val)
static

Definition at line 1062 of file alBuffer.c.

References aLawClip, aLawCompressTable, maxi(), mini(), and sign.

static __inline ALbyte3 EncodeByte3 ( ALint  val)
static

Definition at line 1213 of file alBuffer.c.

References IS_LITTLE_ENDIAN, and ret.

static void EncodeIMA4Block ( ALima4 dst,
const ALshort src,
ALint sample,
ALint index,
ALint  numchans 
)
static

Definition at line 1138 of file alBuffer.c.

References clampi(), IMA4Codeword, IMA4Index_adjust, IMAStep_size, j, k, mini(), and nibble().

static ALmulaw EncodeMuLaw ( ALshort  val)
static

Definition at line 1037 of file alBuffer.c.

References maxi(), mini(), muLawBias, muLawClip, muLawCompressTable, and sign.

static __inline ALubyte3 EncodeUByte3 ( ALint  val)
static

Definition at line 1234 of file alBuffer.c.

References IS_LITTLE_ENDIAN, and ret.

static ALboolean IsValidChannels ( ALenum  channels)
static
static ALenum LoadData ( ALbuffer ALBuf,
ALuint  freq,
ALenum  NewFormat,
ALsizei  frames,
enum UserFmtChannels  chans,
enum UserFmtType  type,
const ALvoid data,
ALboolean  storesrc 
)
static

OpenAL cross platform audio library Copyright (C) 1999-2007 by authors. 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 1939 of file alBuffer.c.

References AL_FALSE, AL_INVALID_ENUM, AL_INVALID_OPERATION, AL_NO_ERROR, AL_OUT_OF_MEMORY, BytesFromFmt(), ChannelsFromFmt(), ChannelsFromUserFmt(), ConvertData(), ALbuffer::data, DecomposeFormat(), ALbuffer::FmtChannels, ALbuffer::FmtType, ALbuffer::Format, FrameSizeFromUserFmt(), ALbuffer::Frequency, ALbuffer::lock, ALbuffer::LoopEnd, ALbuffer::LoopStart, NULL, ALbuffer::OriginalChannels, ALbuffer::OriginalSize, ALbuffer::OriginalType, realloc, ALbuffer::ref, ALbuffer::SampleLen, UserFmtIMA4, WriteLock(), and WriteUnlock().

Referenced by alBufferData(), and alBufferSamplesSOFT().

ALvoid ReleaseALBuffers ( ALCdevice device)

Variable Documentation

const int aLawClip = 32635
static

Definition at line 170 of file alBuffer.c.

Referenced by EncodeALaw().

const char aLawCompressTable[128]
static
Initial value:
= {
1,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,
5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7
}

Definition at line 171 of file alBuffer.c.

Referenced by EncodeALaw().

const ALshort aLawDecompressionTable[256]
static

Definition at line 134 of file alBuffer.c.

Referenced by DecodeALaw().

ALbyte ALbyte3_size_is_not_3[(sizeof(ALbyte3)==sizeof(ALbyte[3]))?1:-1]
ALbyte ALubyte3_size_is_not_3[(sizeof(ALubyte3)==sizeof(ALubyte[3]))?1:-1]
const int IMA4Codeword[16]
static
Initial value:
= {
1, 3, 5, 7, 9, 11, 13, 15,
-1,-3,-5,-7,-9,-11,-13,-15,
}

Definition at line 61 of file alBuffer.c.

Referenced by DecodeIMA4Block(), and EncodeIMA4Block().

const int IMA4Index_adjust[16]
static
Initial value:
= {
-1,-1,-1,-1, 2, 4, 6, 8,
-1,-1,-1,-1, 2, 4, 6, 8
}

Definition at line 67 of file alBuffer.c.

Referenced by DecodeIMA4Block(), and EncodeIMA4Block().

const int IMAStep_size[89]
static
Initial value:
= {
7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 19,
21, 23, 25, 28, 31, 34, 37, 41, 45, 50, 55,
60, 66, 73, 80, 88, 97, 107, 118, 130, 143, 157,
173, 190, 209, 230, 253, 279, 307, 337, 371, 408, 449,
494, 544, 598, 658, 724, 796, 876, 963, 1060, 1166, 1282,
1411, 1552, 1707, 1878, 2066, 2272, 2499, 2749, 3024, 3327, 3660,
4026, 4428, 4871, 5358, 5894, 6484, 7132, 7845, 8630, 9493,10442,
11487,12635,13899,15289,16818,18500,20350,22358,24633,27086,29794,
32767
}

Definition at line 48 of file alBuffer.c.

Referenced by DecodeIMA4Block(), and EncodeIMA4Block().

const int muLawBias = 0x84
static

Definition at line 110 of file alBuffer.c.

Referenced by EncodeMuLaw().

const int muLawClip = 32635
static

Definition at line 111 of file alBuffer.c.

Referenced by EncodeMuLaw().

const char muLawCompressTable[256]
static
Initial value:
= {
0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,
4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7
}

Definition at line 112 of file alBuffer.c.

Referenced by EncodeMuLaw().

const ALshort muLawDecompressionTable[256]
static

Definition at line 74 of file alBuffer.c.

Referenced by DecodeMuLaw().