ReactOS  0.4.15-dev-489-g75a0787
sample.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define REAL_TO_SHORT(x)   (short)(x)
 
#define REAL_TO_S32(x)   (int32_t)(x)
 
#define REAL_PLUS_32767   32767.0
 
#define REAL_MINUS_32768   -32768.0
 
#define REAL_PLUS_S32   2147483647.0
 
#define REAL_MINUS_S32   -2147483648.0
 
#define WRITE_SHORT_SAMPLE(samples, sum, clip)
 
#define WRITE_SHORT_SAMPLE_ACCURATE(samples, sum, clip)
 
#define WRITE_S32_SAMPLE(samples, sum, clip)
 
#define WRITE_8BIT_SAMPLE(samples, sum, clip)
 
#define WRITE_REAL_SAMPLE(samples, sum, clip)   *(samples) = ((real)1./SHORT_SCALE)*(sum)
 
#define CONV_SU32(s)
 
#define CONV_SU16(s)   (uint16_t)((int32_t)(s)+32768)
 
#define CONV_SU8(s)   (uint8_t)((int16_t)s+128)
 
#define CONV_US32(u)
 
#define CONV_US16(s)   (int16_t)((int32_t)s-32768)
 
#define CONV_US8(s)   (int8_t)((int16_t)s-128)
 
#define DROP4BYTE(w, r)   {(w)[0]=(r)[1]; (w)[1]=(r)[2]; (w)[2]=(r)[3];}
 
#define ADD4BYTE(w, r)   {(w)[0]=0; (w)[1]=(r)[0]; (w)[2]=(r)[1]; (w)[3]=(r)[2];}
 

Macro Definition Documentation

◆ ADD4BYTE

#define ADD4BYTE (   w,
  r 
)    {(w)[0]=0; (w)[1]=(r)[0]; (w)[2]=(r)[1]; (w)[3]=(r)[2];}

Definition at line 192 of file sample.h.

◆ CONV_SU16

#define CONV_SU16 (   s)    (uint16_t)((int32_t)(s)+32768)

Definition at line 164 of file sample.h.

◆ CONV_SU32

#define CONV_SU32 (   s)
Value:
( (s >= 0) \
? ((uint32_t)s + (uint32_t)2147483648UL) \
: (s == -2147483647-1 /* Work around to prevent a non-conformant MSVC warning/error */ \
? 0 /* Separate because negation would overflow. */ \
: (uint32_t)2147483648UL - (uint32_t)(-s) ) \
)
GLdouble s
Definition: gl.h:2039
UINT32 uint32_t
Definition: types.h:75
#define uint32_t
Definition: nsiface.idl:61
#define UL
Definition: tui.h:82

Definition at line 155 of file sample.h.

◆ CONV_SU8

#define CONV_SU8 (   s)    (uint8_t)((int16_t)s+128)

Definition at line 167 of file sample.h.

◆ CONV_US16

#define CONV_US16 (   s)    (int16_t)((int32_t)s-32768)

Definition at line 179 of file sample.h.

◆ CONV_US32

#define CONV_US32 (   u)
Value:
( (u >= 2147483648UL) \
? (int32_t)((uint32_t)u - (uint32_t)2147483648UL) \
: ((u == 0) \
? (int32_t)-2147483648UL \
: -(int32_t)((uint32_t)2147483648UL - u) ) \
)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Definition: glfuncs.h:240
#define int32_t
Definition: nsiface.idl:56
INT32 int32_t
Definition: types.h:71
UINT32 uint32_t
Definition: types.h:75
#define uint32_t
Definition: nsiface.idl:61
#define UL
Definition: tui.h:82

Definition at line 170 of file sample.h.

◆ CONV_US8

#define CONV_US8 (   s)    (int8_t)((int16_t)s-128)

Definition at line 182 of file sample.h.

◆ DROP4BYTE

#define DROP4BYTE (   w,
  r 
)    {(w)[0]=(r)[1]; (w)[1]=(r)[2]; (w)[2]=(r)[3];}

Definition at line 191 of file sample.h.

◆ REAL_MINUS_32768

#define REAL_MINUS_32768   -32768.0

Definition at line 80 of file sample.h.

◆ REAL_MINUS_S32

#define REAL_MINUS_S32   -2147483648.0

Definition at line 86 of file sample.h.

◆ REAL_PLUS_32767

#define REAL_PLUS_32767   32767.0

Definition at line 77 of file sample.h.

◆ REAL_PLUS_S32

#define REAL_PLUS_S32   2147483647.0

Definition at line 83 of file sample.h.

◆ REAL_TO_S32

#define REAL_TO_S32 (   x)    (int32_t)(x)

Definition at line 72 of file sample.h.

◆ REAL_TO_SHORT

#define REAL_TO_SHORT (   x)    (short)(x)

Definition at line 62 of file sample.h.

◆ WRITE_8BIT_SAMPLE

#define WRITE_8BIT_SAMPLE (   samples,
  sum,
  clip 
)
Value:
{ \
int16_t write_8bit_tmp; \
if( (sum) > REAL_PLUS_32767) { write_8bit_tmp = 0x7fff; (clip)++; } \
else if( (sum) < REAL_MINUS_32768) { write_8bit_tmp = -0x8000; (clip)++; } \
else { write_8bit_tmp = REAL_TO_SHORT(sum); } \
*(samples) = fr->conv16to8[write_8bit_tmp>>AUSHIFT]; \
}
GLsizei samples
Definition: glext.h:7006
#define REAL_MINUS_32768
Definition: sample.h:80
static int sum(int x_, int y_)
Definition: ptr2_test.cpp:35
#define REAL_PLUS_32767
Definition: sample.h:77
#define AUSHIFT
#define REAL_TO_SHORT(x)
Definition: sample.h:62

Definition at line 142 of file sample.h.

◆ WRITE_REAL_SAMPLE

#define WRITE_REAL_SAMPLE (   samples,
  sum,
  clip 
)    *(samples) = ((real)1./SHORT_SCALE)*(sum)

Definition at line 151 of file sample.h.

◆ WRITE_S32_SAMPLE

#define WRITE_S32_SAMPLE (   samples,
  sum,
  clip 
)
Value:
{ \
real tmpsum = REAL_MUL((sum),S32_RESCALE); \
if( tmpsum > REAL_PLUS_S32 ){ *(samples) = 0x7fffffff; (clip)++; } \
else if( tmpsum < REAL_MINUS_S32 ) { *(samples) = -0x7fffffff-1; (clip)++; } \
else { *(samples) = REAL_TO_S32(tmpsum); } \
}
GLsizei samples
Definition: glext.h:7006
#define REAL_MUL(x, y)
#define REAL_MINUS_S32
Definition: sample.h:86
#define REAL_PLUS_S32
Definition: sample.h:83
static int sum(int x_, int y_)
Definition: ptr2_test.cpp:35
#define S32_RESCALE
#define REAL_TO_S32(x)
Definition: sample.h:72

Definition at line 133 of file sample.h.

◆ WRITE_SHORT_SAMPLE

#define WRITE_SHORT_SAMPLE (   samples,
  sum,
  clip 
)
Value:
if( (sum) > REAL_PLUS_32767) { *(samples) = 0x7fff; (clip)++; } \
else if( (sum) < REAL_MINUS_32768) { *(samples) = -0x8000; (clip)++; } \
else { *(samples) = REAL_TO_SHORT(sum); }
GLsizei samples
Definition: glext.h:7006
#define REAL_MINUS_32768
Definition: sample.h:80
static int sum(int x_, int y_)
Definition: ptr2_test.cpp:35
#define REAL_PLUS_32767
Definition: sample.h:77
#define REAL_TO_SHORT(x)
Definition: sample.h:62

Definition at line 114 of file sample.h.

◆ WRITE_SHORT_SAMPLE_ACCURATE

#define WRITE_SHORT_SAMPLE_ACCURATE (   samples,
  sum,
  clip 
)
Value:
if( (sum) > REAL_PLUS_32767) { *(samples) = 0x7fff; (clip)++; } \
else if( (sum) < REAL_MINUS_32768) { *(samples) = -0x8000; (clip)++; } \
else { *(samples) = REAL_TO_SHORT_ACCURATE(sum); }
GLsizei samples
Definition: glext.h:7006
#define REAL_MINUS_32768
Definition: sample.h:80
static int sum(int x_, int y_)
Definition: ptr2_test.cpp:35
#define REAL_PLUS_32767
Definition: sample.h:77

Definition at line 121 of file sample.h.