pa_mix_info *m = streams + i;
int32_t v, lo, hi, cv = m->linear[channel].i;
- if (PA_UNLIKELY(cv <= 0))
- continue;
+ if (PA_LIKELY(cv > 0)) {
- /* Multiplying the 32bit volume factor with the
- * 16bit sample might result in an 48bit value. We
- * want to do without 64 bit integers and hence do
- * the multiplication independently for the HI and
- * LO part of the volume. */
+ /* Multiplying the 32bit volume factor with the
+ * 16bit sample might result in an 48bit value. We
+ * want to do without 64 bit integers and hence do
+ * the multiplication independently for the HI and
+ * LO part of the volume. */
- hi = cv >> 16;
- lo = cv & 0xFFFF;
-
- v = *((int16_t*) m->ptr);
- v = ((v * lo) >> 16) + (v * hi);
- sum += v;
+ hi = cv >> 16;
+ lo = cv & 0xFFFF;
+ v = *((int16_t*) m->ptr);
+ v = ((v * lo) >> 16) + (v * hi);
+ sum += v;
+ }
m->ptr = (uint8_t*) m->ptr + sizeof(int16_t);
}
pa_mix_info *m = streams + i;
int32_t v, lo, hi, cv = m->linear[channel].i;
- if (PA_UNLIKELY(cv <= 0))
- continue;
-
- hi = cv >> 16;
- lo = cv & 0xFFFF;
+ if (PA_LIKELY(cv > 0)) {
- v = PA_INT16_SWAP(*((int16_t*) m->ptr));
- v = ((v * lo) >> 16) + (v * hi);
- sum += v;
+ hi = cv >> 16;
+ lo = cv & 0xFFFF;
+ v = PA_INT16_SWAP(*((int16_t*) m->ptr));
+ v = ((v * lo) >> 16) + (v * hi);
+ sum += v;
+ }
m->ptr = (uint8_t*) m->ptr + sizeof(int16_t);
}
int32_t cv = m->linear[channel].i;
int64_t v;
- if (PA_UNLIKELY(cv <= 0))
- continue;
-
- v = *((int32_t*) m->ptr);
- v = (v * cv) >> 16;
- sum += v;
+ if (PA_LIKELY(cv > 0)) {
+ v = *((int32_t*) m->ptr);
+ v = (v * cv) >> 16;
+ sum += v;
+ }
m->ptr = (uint8_t*) m->ptr + sizeof(int32_t);
}
int32_t cv = m->linear[channel].i;
int64_t v;
- if (PA_UNLIKELY(cv <= 0))
- continue;
-
- v = PA_INT32_SWAP(*((int32_t*) m->ptr));
- v = (v * cv) >> 16;
- sum += v;
+ if (PA_LIKELY(cv > 0)) {
+ v = PA_INT32_SWAP(*((int32_t*) m->ptr));
+ v = (v * cv) >> 16;
+ sum += v;
+ }
m->ptr = (uint8_t*) m->ptr + sizeof(int32_t);
}
int32_t cv = m->linear[channel].i;
int64_t v;
- if (PA_UNLIKELY(cv <= 0))
- continue;
-
- v = (int32_t) (PA_READ24NE(m->ptr) << 8);
- v = (v * cv) >> 16;
- sum += v;
+ if (PA_LIKELY(cv > 0)) {
+ v = (int32_t) (PA_READ24NE(m->ptr) << 8);
+ v = (v * cv) >> 16;
+ sum += v;
+ }
m->ptr = (uint8_t*) m->ptr + 3;
}
int32_t cv = m->linear[channel].i;
int64_t v;
- if (PA_UNLIKELY(cv <= 0))
- continue;
-
- v = (int32_t) (PA_READ24RE(m->ptr) << 8);
- v = (v * cv) >> 16;
- sum += v;
+ if (PA_LIKELY(cv > 0)) {
+ v = (int32_t) (PA_READ24RE(m->ptr) << 8);
+ v = (v * cv) >> 16;
+ sum += v;
+ }
m->ptr = (uint8_t*) m->ptr + 3;
}
int32_t cv = m->linear[channel].i;
int64_t v;
- if (PA_UNLIKELY(cv <= 0))
- continue;
-
- v = (int32_t) (*((uint32_t*)m->ptr) << 8);
- v = (v * cv) >> 16;
- sum += v;
+ if (PA_LIKELY(cv > 0)) {
+ v = (int32_t) (*((uint32_t*)m->ptr) << 8);
+ v = (v * cv) >> 16;
+ sum += v;
+ }
m->ptr = (uint8_t*) m->ptr + sizeof(int32_t);
}
int32_t cv = m->linear[channel].i;
int64_t v;
- if (PA_UNLIKELY(cv <= 0))
- continue;
-
- v = (int32_t) (PA_UINT32_SWAP(*((uint32_t*) m->ptr)) << 8);
- v = (v * cv) >> 16;
- sum += v;
+ if (PA_LIKELY(cv > 0)) {
+ v = (int32_t) (PA_UINT32_SWAP(*((uint32_t*) m->ptr)) << 8);
+ v = (v * cv) >> 16;
+ sum += v;
+ }
m->ptr = (uint8_t*) m->ptr + 3;
}
pa_mix_info *m = streams + i;
int32_t v, cv = m->linear[channel].i;
- if (PA_UNLIKELY(cv <= 0))
- continue;
-
- v = (int32_t) *((uint8_t*) m->ptr) - 0x80;
- v = (v * cv) >> 16;
- sum += v;
+ if (PA_LIKELY(cv > 0)) {
+ v = (int32_t) *((uint8_t*) m->ptr) - 0x80;
+ v = (v * cv) >> 16;
+ sum += v;
+ }
m->ptr = (uint8_t*) m->ptr + 1;
}
pa_mix_info *m = streams + i;
int32_t v, hi, lo, cv = m->linear[channel].i;
- if (PA_UNLIKELY(cv <= 0))
- continue;
-
- hi = cv >> 16;
- lo = cv & 0xFFFF;
+ if (PA_LIKELY(cv > 0)) {
- v = (int32_t) st_ulaw2linear16(*((uint8_t*) m->ptr));
- v = ((v * lo) >> 16) + (v * hi);
- sum += v;
+ hi = cv >> 16;
+ lo = cv & 0xFFFF;
+ v = (int32_t) st_ulaw2linear16(*((uint8_t*) m->ptr));
+ v = ((v * lo) >> 16) + (v * hi);
+ sum += v;
+ }
m->ptr = (uint8_t*) m->ptr + 1;
}
pa_mix_info *m = streams + i;
int32_t v, hi, lo, cv = m->linear[channel].i;
- if (PA_UNLIKELY(cv <= 0))
- continue;
+ if (PA_LIKELY(cv > 0)) {
- hi = cv >> 16;
- lo = cv & 0xFFFF;
-
- v = (int32_t) st_alaw2linear16(*((uint8_t*) m->ptr));
- v = ((v * lo) >> 16) + (v * hi);
- sum += v;
+ hi = cv >> 16;
+ lo = cv & 0xFFFF;
+ v = (int32_t) st_alaw2linear16(*((uint8_t*) m->ptr));
+ v = ((v * lo) >> 16) + (v * hi);
+ sum += v;
+ }
m->ptr = (uint8_t*) m->ptr + 1;
}
pa_mix_info *m = streams + i;
float v, cv = m->linear[channel].f;
- if (PA_UNLIKELY(cv <= 0))
- continue;
-
- v = *((float*) m->ptr);
- v *= cv;
- sum += v;
+ if (PA_LIKELY(cv > 0)) {
+ v = *((float*) m->ptr);
+ v *= cv;
+ sum += v;
+ }
m->ptr = (uint8_t*) m->ptr + sizeof(float);
}
pa_mix_info *m = streams + i;
float v, cv = m->linear[channel].f;
- if (PA_UNLIKELY(cv <= 0))
- continue;
-
- v = PA_FLOAT32_SWAP(*(float*) m->ptr);
- v *= cv;
- sum += v;
+ if (PA_LIKELY(cv > 0)) {
+ v = PA_FLOAT32_SWAP(*(float*) m->ptr);
+ v *= cv;
+ sum += v;
+ }
m->ptr = (uint8_t*) m->ptr + sizeof(float);
}