Lines Matching refs:sample

62 /* 16 bit signed sample, native endianness, stored in 32-bits */
80 static INLINE INT32 MAP_ClipAndConvertToShort(MAP_Sample sample) {
81 if (sample < -32768) {
84 else if (sample > 32767) {
87 return (INT32) sample;
91 static INLINE INT32 MAP_ClipAndConvertToShort_Swapped(MAP_Sample sample) {
92 if (sample < -32768) {
95 else if (sample > 32767) {
98 return (INT32) (INT16) MAP_SWAP16BIT(sample);
101 static INLINE INT8 MAP_ClipAndConvertToByte(MAP_Sample sample) {
102 if (sample < -32768) {
105 else if (sample > 32767) {
108 return (INT8) (sample >> 8);
112 static INLINE UINT8 MAP_ClipAndConvertToUByte(MAP_Sample sample) {
113 if (sample < -32768) {
116 else if (sample > 32767) {
119 return (UINT8) ((sample >> 8) + 128);
125 #define MAP_SAMPLE2LE_SHORT(sample) (sample)
126 #define MAP_SAMPLE2LE_SHORT_CLIP(sample) MAP_ClipAndConvertToShort(sample)
129 #define MAP_SAMPLE2LE_SHORT(sample) (INT16) MAP_SWAP16BIT(sample)
130 #define MAP_SAMPLE2LE_SHORT_CLIP(sample) MAP_ClipAndConvertToShort_Swapped(sample)
136 #define MAP_SAMPLE2BE_SHORT(sample) (sample)
137 #define MAP_SAMPLE2BE_SHORT_CLIP(sample) MAP_ClipAndConvertToShort(sample)
140 #define MAP_SAMPLE2BE_SHORT(sample) ((INT16) MAP_SWAP16BIT(sample))
141 #define MAP_SAMPLE2BE_SHORT_CLIP(sample) MAP_ClipAndConvertToShort_Swapped(sample)
147 #define MAP_SAMPLE2UINT8(sample) ((UINT8) ((((MAP_Sample) (sample)) >> 8) + 128))
148 #define MAP_SAMPLE2INT8(sample) ((INT8) (((MAP_Sample) (sample)) >> 8))
149 #define MAP_SAMPLE2UINT8_CLIP(sample) MAP_ClipAndConvertToUByte(sample)
150 #define MAP_SAMPLE2INT8_CLIP(sample) MAP_ClipAndConvertToByte(sample)
175 * conversion size=2,3,4: the order of bytes in a sample is reversed (endianness)
176 * for sign conversion of a 24-bit sample stored in 32bits, 4 should be passed
240 /* aply the gain to one sample */
243 sample = TO_SAMPLE(*INPUT); \
245 sample = (MAP_Sample) (sample * FACTOR); \
247 (*OUTPUT) = FROM_SAMPLE(sample); \
325 MAP_Sample sample;