cocos2d/cocos/audio/android/audio_utils/include/audio_utils/primitives.h
static inline int16_t clamp16(int32_t sample)
{
    if ((sample>>15) ^ (sample>>31))
        sample = 0x7FFF ^ (sample>>31);
    return sample;
}
/**
 * Clamp (aka hard limit or clip) a signed 32-bit sample to 16-bit range.
 */
Clamp (aka hard limit or clip) a signed 32-bit sample to 16-bit range.
Clamp ( aka hard limit or clip ) a signed 32 - bit sample to 16 - bit range .
static inline int16_t clamp16(int32_t sample)
{
    if ((sample>>15) ^ (sample>>31))
        sample = 0x7FFF ^ (sample>>31);
    return sample;
}
static inline int16_t clamp16 ( int32_t sample ) { if ( ( sample >> 15 ) ^ ( sample >> 31 ) ) sample = 0x7FFF ^ ( sample >> 31 ) ; return sample ; }
Clamp (aka hard limit or clip) a signed 32-bit sample to 16-bit range.
Clamp ( aka hard limit or clip ) a signed 32 - bit sample to 16 - bit range .