static void adjust_jnd(int samplerate_index, const int32_t in[512], int32_t out_cb[256]) { int32_t power[256]; cplx32 out[256]; int32_t out_cb_unnorm[256]; int32_t denom; const int32_t ca_cb = -1114; const int32_t cs_cb = 928; int i, j; fft(in, out); for (j = 0; j < 256; j++) { power[j] = add_cb(get_cb(out[j].re), get_cb(out[j].im)); out_cb_unnorm[j] = -2047; /* and can only grow */ } for (i = 0; i < AUBANDS; i++) { denom = ca_cb; /* and can only grow */ for (j = 0; j < 256; j++) denom = add_cb(denom, power[j] + auf[samplerate_index][i][j]); for (j = 0; j < 256; j++) out_cb_unnorm[j] = add_cb(out_cb_unnorm[j], -denom + auf[samplerate_index][i][j]); } for (j = 0; j < 256; j++) out_cb[j] = add_cb(out_cb[j], -out_cb_unnorm[j] - ca_cb - cs_cb); }
int ZPClient::test_callback(do_something_callback cb) { printf("client - test_cb - \n"); sp<ProcessState> proc(ProcessState::self()); add_cb(cb); do_something(); ProcessState::self()->startThreadPool(); IPCThreadState::self()->joinThreadPool(); return 0; }
static void nullbe_pread(struct device* dev, void* buf, size_t size, off64_t offset, dev_callback_t cb, void* cookie) { add_cb(dev, cb, cookie, size); }