29 #define WS_MAX_CHANNELS 32
30 #define INF_TS 0x7FFFFFFFFFFFFFFF
107 #define LCG_A 1284865837
108 #define LCG_C 4150755663
109 #define LCG_AI 849225893
119 uint32_t
a,
c,
t = *
s;
153 for (j = 0; j < 7; j++) {
173 if (b < (uint64_t)1 << 32) {
175 return ((a / b) << 32) | ((a %
b) << 32) /
b;
177 if (b < (uint64_t)1 << 48) {
178 for (i = 0; i < 4; i++) {
180 r = (r << 16) | (a / b);
185 for (i = 63; i >= 0; i--) {
186 if (a >= (uint64_t)1 << 63 || a << 1 >=
b) {
187 r |= (uint64_t)1 << i;
199 uint64_t dt2 = dt & 1 ?
200 dt * ((dt - 1) >> 1) : (dt >> 1) * (dt - 1);
210 for (i = 0; i < ws->
nb_inter; i++) {
228 int64_t pink_ts_next = ts & ~(
PINK_UNIT - 1);
248 int64_t dphi1, dphi2, dt, cur_ts = -0x8000000000000000;
262 for (i = 0; i < ws->
nb_inter; i++) {
264 if (edata_end - edata < 24)
277 if (edata_end - edata < 20)
288 in->
ddphi = (dphi2 - dphi1) / dt;
289 if (phi & 0x80000000) {
295 in->
phi0 = (uint64_t)phi << 33;
299 if (edata_end - edata < 8)
308 in->
amp0 = (int64_t)a1 << 32;
309 in->
damp = (((int64_t)a2 << 32) - ((int64_t)a1 << 32)) / dt;
311 if (edata != edata_end)
323 "This implementation is limited to %d channels.\n",
338 ws->
sin[i] = floor(32767 *
sin(2 *
M_PI * i / (1 << SIN_BITS)));
362 uint32_t
c, all_ch = 0;
392 for (c = in->
channels, cv = channels; c; c >>= 1, cv++)
397 for (c = all_ch, cv = channels;
c; c >>= 1, cv++)
410 for (i = ws->
next_inter; i < ws->nb_inter; i++) {
438 if (packet->
size != 12)
452 memset(channels, 0, avc->
channels *
sizeof(*channels));
457 *(pcm++) = channels[
c] >> 16;