diff options
author | Max Kellermann <max@duempel.org> | 2013-02-01 13:50:10 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-02-01 14:10:27 +0100 |
commit | ef99d6ce3d9b82cb249ae08b390049a6f9cd9d56 (patch) | |
tree | 7e41014940911702613ee76f7305a2e4d0724f8c /src/PcmUtils.hxx | |
parent | 0ac06d77f1d47398808935418153a14d1d858860 (diff) |
PcmUtils: remove pcm_range(), use PcmClamp() instead
Diffstat (limited to 'src/PcmUtils.hxx')
-rw-r--r-- | src/PcmUtils.hxx | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/src/PcmUtils.hxx b/src/PcmUtils.hxx index 7c7173d8..d77c4194 100644 --- a/src/PcmUtils.hxx +++ b/src/PcmUtils.hxx @@ -42,30 +42,6 @@ pcm_end_pointer(const T *p, size_t size) * Check if the value is within the range of the provided bit size, * and caps it if necessary. */ -static inline int32_t -pcm_range(int32_t sample, unsigned bits) -{ - if (gcc_unlikely(sample < (-1 << (bits - 1)))) - return -1 << (bits - 1); - if (gcc_unlikely(sample >= (1 << (bits - 1)))) - return (1 << (bits - 1)) - 1; - return sample; -} - -/** - * Check if the value is within the range of the provided bit size, - * and caps it if necessary. - */ -static inline int64_t -pcm_range_64(int64_t sample, unsigned bits) -{ - if (gcc_unlikely(sample < ((int64_t)-1 << (bits - 1)))) - return (int64_t)-1 << (bits - 1); - if (gcc_unlikely(sample >= ((int64_t)1 << (bits - 1)))) - return ((int64_t)1 << (bits - 1)) - 1; - return sample; -} - template<typename T, typename U, unsigned bits> gcc_const static inline T |