@@ -140,8 +140,6 @@ static inline uint32_t pack8(uint32_t val) {
140
140
return ((val & 0xff000000 ) >> 16 ) | ((val & 0xff00 ) >> 8 );
141
141
}
142
142
143
- #define LIKELY (x ) (__builtin_expect(!!(x), 1))
144
- #define UNLIKELY (x ) (__builtin_expect(!!(x), 0))
145
143
static void mix_one_voice (audiomixer_mixer_obj_t * self ,
146
144
audiomixer_mixervoice_obj_t * voice , bool voices_active ,
147
145
uint32_t * word_buffer , uint32_t length ) {
@@ -172,8 +170,8 @@ static void mix_one_voice(audiomixer_mixer_obj_t* self,
172
170
173
171
// First active voice gets copied over verbatim.
174
172
if (!voices_active ) {
175
- if (LIKELY (self -> bits_per_sample == 16 )) {
176
- if (LIKELY (self -> samples_signed )) {
173
+ if (MP_LIKELY (self -> bits_per_sample == 16 )) {
174
+ if (MP_LIKELY (self -> samples_signed )) {
177
175
for (uint32_t i = 0 ; i < n ; i ++ ) {
178
176
uint32_t v = src [i ];
179
177
word_buffer [i ] = mult16signed (v , level );
@@ -190,16 +188,16 @@ static void mix_one_voice(audiomixer_mixer_obj_t* self,
190
188
uint16_t * hsrc = (uint16_t * )src ;
191
189
for (uint32_t i = 0 ; i < n * 2 ; i ++ ) {
192
190
uint32_t word = unpack8 (hsrc [i ]);
193
- if (LIKELY (!self -> samples_signed )) {
191
+ if (MP_LIKELY (!self -> samples_signed )) {
194
192
word = tosigned16 (word );
195
193
}
196
194
word = mult16signed (word , level );
197
195
hword_buffer [i ] = pack8 (word );
198
196
}
199
197
}
200
198
} else {
201
- if (LIKELY (self -> bits_per_sample == 16 )) {
202
- if (LIKELY (self -> samples_signed )) {
199
+ if (MP_LIKELY (self -> bits_per_sample == 16 )) {
200
+ if (MP_LIKELY (self -> samples_signed )) {
203
201
for (uint32_t i = 0 ; i < n ; i ++ ) {
204
202
uint32_t word = src [i ];
205
203
word_buffer [i ] = add16signed (mult16signed (word , level ), word_buffer [i ]);
@@ -216,7 +214,7 @@ static void mix_one_voice(audiomixer_mixer_obj_t* self,
216
214
uint16_t * hsrc = (uint16_t * )src ;
217
215
for (uint32_t i = 0 ; i < n * 2 ; i ++ ) {
218
216
uint32_t word = unpack8 (hsrc [i ]);
219
- if (LIKELY (!self -> samples_signed )) {
217
+ if (MP_LIKELY (!self -> samples_signed )) {
220
218
word = tosigned16 (word );
221
219
}
222
220
word = mult16signed (word , level );
0 commit comments