2 #include "AudioConfig.h"
4 #define INT24_MAX 0x7FFFFF
23 memcpy(&value, ptr, 4);
46 #if defined(USE_INT24_FROM_INT)
55 inline void set(
const int32_t &in) {
57 value = INT24_MAX << 8;
58 }
else if (in<-INT24_MAX){
59 value = -(INT24_MAX << 8);
70 int24_4bytes_t& operator=(
const float& other){
71 set(((int32_t)other));
79 explicit operator float() {
83 explicit operator int64_t() {
87 int24_4bytes_t& operator +=(int32_t valueA){
88 int32_t temp =
toInt();
94 int24_4bytes_t& operator -=(int32_t valueA){
95 int32_t temp =
toInt();
111 return static_cast<int16_t
>(
toInt() >> 8) ;
116 return static_cast<int32_t
>(
toInt() << 8);
122 void setAndScale16(int16_t i16) {
127 int16_t getAndScale16() {
128 return static_cast<int16_t
>(value >> 16);
139 #ifdef USE_TYPETRAITS
143 template<>
class numeric_limits<
audio_tools::int24_4bytes_t> {