@@ -14,6 +14,22 @@ namespace audio_tools {
14
14
15
15
16
16
enum Base46Logic { NoCR, CRforFrame, CRforWrite };
17
+ static char encoding_table[] = {
18
+ ' A' , ' B' , ' C' , ' D' , ' E' , ' F' , ' G' , ' H' , ' I' , ' J' , ' K' , ' L' , ' M' ,
19
+ ' N' , ' O' , ' P' , ' Q' , ' R' , ' S' , ' T' , ' U' , ' V' , ' W' , ' X' , ' Y' , ' Z' ,
20
+ ' a' , ' b' , ' c' , ' d' , ' e' , ' f' , ' g' , ' h' , ' i' , ' j' , ' k' , ' l' , ' m' ,
21
+ ' n' , ' o' , ' p' , ' q' , ' r' , ' s' , ' t' , ' u' , ' v' , ' w' , ' x' , ' y' , ' z' ,
22
+ ' 0' , ' 1' , ' 2' , ' 3' , ' 4' , ' 5' , ' 6' , ' 7' , ' 8' , ' 9' , ' +' , ' /' };
23
+ static int mod_table[] = {0 , 2 , 1 };
24
+
25
+ static const int B64index[256 ] = {
26
+ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
27
+ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
28
+ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 62 , 63 , 62 , 62 , 63 , 52 , 53 , 54 , 55 , 56 , 57 ,
29
+ 58 , 59 , 60 , 61 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 2 , 3 , 4 , 5 , 6 ,
30
+ 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 , 17 , 18 , 19 , 20 , 21 , 22 , 23 , 24 ,
31
+ 25 , 0 , 0 , 0 , 0 , 63 , 0 , 26 , 27 , 28 , 29 , 30 , 31 , 32 , 33 , 34 , 35 , 36 ,
32
+ 37 , 38 , 39 , 40 , 41 , 42 , 43 , 44 , 45 , 46 , 47 , 48 , 49 , 50 , 51 };
17
33
18
34
/* *
19
35
* @brief DecoderBase64 - Converts a Base64 encoded Stream into the original
@@ -89,7 +105,6 @@ class DecoderBase64 : public AudioDecoder {
89
105
Vector<uint8_t > result;
90
106
RingBuffer<uint8_t > buffer{1500 };
91
107
AudioInfo info;
92
- static const int B64index[256 ];
93
108
94
109
void decodeLine (uint8_t *data, size_t byteCount) {
95
110
LOGD (" decode: %d" , (int )byteCount);
@@ -157,14 +172,6 @@ class DecoderBase64 : public AudioDecoder {
157
172
}
158
173
};
159
174
160
- const int DecoderBase64::B64index[256 ] = {
161
- 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
162
- 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
163
- 0 , 0 , 0 , 0 , 0 , 0 , 0 , 62 , 63 , 62 , 62 , 63 , 52 , 53 , 54 , 55 , 56 , 57 ,
164
- 58 , 59 , 60 , 61 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 2 , 3 , 4 , 5 , 6 ,
165
- 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 , 17 , 18 , 19 , 20 , 21 , 22 , 23 , 24 ,
166
- 25 , 0 , 0 , 0 , 0 , 63 , 0 , 26 , 27 , 28 , 29 , 30 , 31 , 32 , 33 , 34 , 35 , 36 ,
167
- 37 , 38 , 39 , 40 , 41 , 42 , 43 , 44 , 45 , 46 , 47 , 48 , 49 , 50 , 51 };
168
175
169
176
/* *
170
177
* @brief EncoderBase64s - Encodes the input data into a Base64 string.
@@ -258,8 +265,6 @@ class EncoderBase64 : public AudioEncoder {
258
265
Vector<uint8_t > ret;
259
266
AudioInfo info;
260
267
int frame_size;
261
- static char encoding_table[64 ];
262
- static int mod_table[3 ];
263
268
264
269
void flush () {
265
270
#if defined(ESP32)
@@ -305,12 +310,4 @@ class EncoderBase64 : public AudioEncoder {
305
310
}
306
311
};
307
312
308
- char EncoderBase64::encoding_table[] = {
309
- ' A' , ' B' , ' C' , ' D' , ' E' , ' F' , ' G' , ' H' , ' I' , ' J' , ' K' , ' L' , ' M' ,
310
- ' N' , ' O' , ' P' , ' Q' , ' R' , ' S' , ' T' , ' U' , ' V' , ' W' , ' X' , ' Y' , ' Z' ,
311
- ' a' , ' b' , ' c' , ' d' , ' e' , ' f' , ' g' , ' h' , ' i' , ' j' , ' k' , ' l' , ' m' ,
312
- ' n' , ' o' , ' p' , ' q' , ' r' , ' s' , ' t' , ' u' , ' v' , ' w' , ' x' , ' y' , ' z' ,
313
- ' 0' , ' 1' , ' 2' , ' 3' , ' 4' , ' 5' , ' 6' , ' 7' , ' 8' , ' 9' , ' +' , ' /' };
314
- int EncoderBase64::mod_table[] = {0 , 2 , 1 };
315
-
316
313
} // namespace audio_tools
0 commit comments