ERIS CORE

◆ applyGainThenAdd2()

static void applyGainThenAdd2 ( int16_t *  data,
const int16_t *  in,
int32_t  mult 
)
static

Definition at line 21 of file eris_mixer_ext.cpp.

22 {
23  uint32_t *dst = (uint32_t *)data;
24  const uint32_t *src = (uint32_t *)in;
25  const uint32_t *end = (uint32_t *)(data + AUDIO_BLOCK_SAMPLES);
26 
27  if (mult == 65536) {
28  do {
29  uint32_t tmp32 = *dst;
30  *dst++ = signed_add_16_and_16(tmp32, *src++);
31  tmp32 = *dst;
32  *dst++ = signed_add_16_and_16(tmp32, *src++);
33  } while (dst < end);
34  } else {
35  do {
36  uint32_t tmp32 = *src++; // read 2 samples from *data
37  int32_t val1 = signed_multiply_32x16b(mult, tmp32);
38  int32_t val2 = signed_multiply_32x16t(mult, tmp32);
39  val1 = signed_saturate_rshift(val1, 16, 0);
40  val2 = signed_saturate_rshift(val2, 16, 0);
41  tmp32 = pack_16b_16b(val2, val1);
42  uint32_t tmp32b = *dst;
43  *dst++ = signed_add_16_and_16(tmp32, tmp32b);
44  } while (dst < end);
45  }
46 }

Referenced by AudioMixer8::update().

+ Here is the caller graph for this function: