ReactOS  0.4.14-dev-815-ge410a12
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)
 

Macro Definition Documentation

◆ 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.