File tree Expand file tree Collapse file tree 2 files changed +13
-12
lines changed Expand file tree Collapse file tree 2 files changed +13
-12
lines changed Original file line number Diff line number Diff line change @@ -13,31 +13,31 @@ namespace audio_tools {
13
13
* @copyright GPLv3
14
14
*
15
15
*/
16
- class int24_t {
16
+ class int24x_t {
17
17
public:
18
- int24_t () {
18
+ int24x_t () {
19
19
value[0 ] = 0 ;
20
20
value[1 ] = 0 ;
21
21
value[2 ] = 0 ;
22
22
}
23
23
24
- int24_t (void *ptr) {
24
+ int24x_t (void *ptr) {
25
25
memcpy (value, ptr, 3 );
26
26
}
27
27
28
- int24_t (const int16_t &in) {
28
+ int24x_t (const int16_t &in) {
29
29
value[2 ] = in > 0 ? 0 : 0xFF ;
30
30
value[1 ] = (in >> 8 ) & 0xFF ;
31
31
value[0 ] = in & 0xFF ;
32
32
}
33
33
34
- int24_t (const int32_t &in) {
34
+ int24x_t (const int32_t &in) {
35
35
set (in);
36
36
}
37
37
38
38
#if defined(STM32) || defined(ESP32C3)
39
39
40
- int24_t (const int &in) {
40
+ int24x_t (const int &in) {
41
41
set (in);
42
42
}
43
43
@@ -49,12 +49,12 @@ class int24_t {
49
49
value[0 ] = in & 0xFF ;
50
50
}
51
51
52
- int24_t & operator =(const int24_t & other){
52
+ int24x_t & operator =(const int24x_t & other){
53
53
set (other);
54
54
return *this ;
55
55
}
56
56
57
- int24_t & operator =(const float & other){
57
+ int24x_t & operator =(const float & other){
58
58
set ((int32_t )other);
59
59
return *this ;
60
60
}
@@ -63,14 +63,14 @@ class int24_t {
63
63
return toInt ();
64
64
}
65
65
66
- int24_t & operator +=(int32_t value){
66
+ int24x_t & operator +=(int32_t value){
67
67
int32_t temp = toInt ();
68
68
temp += value;
69
69
set (temp);
70
70
return *this ;
71
71
}
72
72
73
- int24_t & operator -=(int32_t value){
73
+ int24x_t & operator -=(int32_t value){
74
74
int32_t temp = toInt ();
75
75
temp -= value;
76
76
set (temp);
Original file line number Diff line number Diff line change 10
10
*/
11
11
#pragma once
12
12
#include " AudioCodecs/AudioEncoded.h"
13
+ #include " AudioBasic/Int24x.h"
13
14
#include " openaptx.h"
14
15
15
16
/* *
@@ -105,7 +106,7 @@ class APTXDecoder : public AudioDecoder {
105
106
int samples = written / 3 ;
106
107
LOGI (" written: %d" , written);
107
108
LOGI (" samples: %d" , samples);
108
- int24_t *p_int24 = (int24_t *)output_buffer.data ();
109
+ int24x_t *p_int24 = (int24x_t *)output_buffer.data ();
109
110
int16_t *p_int16 = (int16_t *)output_buffer.data ();
110
111
for (int j = 0 ; j < samples; j++) {
111
112
p_int16[j] = p_int24[j].getAndScale16 ();
@@ -298,7 +299,7 @@ class APTXEncoder : public AudioEncoder {
298
299
protected:
299
300
bool is_hd;
300
301
AudioInfo info;
301
- Vector<int24_t > input_buffer{4 * 2 };
302
+ Vector<int24x_t > input_buffer{4 * 2 };
302
303
Vector<uint8_t > output_buffer;
303
304
int input_pos = 0 ;
304
305
int output_pos = 0 ;
You can’t perform that action at this time.
0 commit comments