Lines Matching refs:tone
1427 static void qdm2_fft_generate_tone(QDM2Context *q, FFTTone *tone) in qdm2_fft_generate_tone() argument
1434 tone->phase += tone->phase_shift; in qdm2_fft_generate_tone()
1437 level = fft_tone_envelope_table[tone->duration][tone->time_index] * tone->level; in qdm2_fft_generate_tone()
1438 c.im = level * sin(tone->phase * iscale); in qdm2_fft_generate_tone()
1439 c.re = level * cos(tone->phase * iscale); in qdm2_fft_generate_tone()
1442 if (tone->duration >= 3 || tone->cutoff >= 3) { in qdm2_fft_generate_tone()
1443 tone->complex[0].im += c.im; in qdm2_fft_generate_tone()
1444 tone->complex[0].re += c.re; in qdm2_fft_generate_tone()
1445 tone->complex[1].im -= c.im; in qdm2_fft_generate_tone()
1446 tone->complex[1].re -= c.re; in qdm2_fft_generate_tone()
1448 f[1] = -tone->table[4]; in qdm2_fft_generate_tone()
1449 f[0] = tone->table[3] - tone->table[0]; in qdm2_fft_generate_tone()
1450 f[2] = 1.0 - tone->table[2] - tone->table[3]; in qdm2_fft_generate_tone()
1451 f[3] = tone->table[1] + tone->table[4] - 1.0; in qdm2_fft_generate_tone()
1452 f[4] = tone->table[0] - tone->table[1]; in qdm2_fft_generate_tone()
1453 f[5] = tone->table[2]; in qdm2_fft_generate_tone()
1455 tone->complex[fft_cutoff_index_table[tone->cutoff][i]].re += in qdm2_fft_generate_tone()
1457 tone->complex[fft_cutoff_index_table[tone->cutoff][i]].im += in qdm2_fft_generate_tone()
1458 c.im * ((tone->cutoff <= i) ? -f[i] : f[i]); in qdm2_fft_generate_tone()
1461 tone->complex[i].re += c.re * f[i + 2]; in qdm2_fft_generate_tone()
1462 tone->complex[i].im += c.im * f[i + 2]; in qdm2_fft_generate_tone()
1467 if (++tone->time_index < ((1 << (5 - tone->duration)) - 1)) { in qdm2_fft_generate_tone()
1468 memcpy(&q->fft_tones[q->fft_tone_end], tone, sizeof(FFTTone)); in qdm2_fft_generate_tone()
1514 FFTTone tone; in qdm2_fft_tone_synthesizer() local
1525 tone.cutoff = offset; in qdm2_fft_tone_synthesizer()
1527 tone.cutoff = (offset >= 60) ? 3 : 2; in qdm2_fft_tone_synthesizer()
1529 …tone.level = (q->fft_coefs[j].exp < 0) ? 0.0 : fft_tone_level_table[q->superblocktype_2_3 ? 0 : 1]… in qdm2_fft_tone_synthesizer()
1530 tone.complex = &q->fft.complex[ch][offset]; in qdm2_fft_tone_synthesizer()
1531 … tone.table = fft_tone_sample_table[i][q->fft_coefs[j].offset - (offset << four_i)]; in qdm2_fft_tone_synthesizer()
1532 tone.phase = 64 * q->fft_coefs[j].phase - (offset << 8) - 128; in qdm2_fft_tone_synthesizer()
1533 tone.phase_shift = (2 * q->fft_coefs[j].offset + 1) << (7 - four_i); in qdm2_fft_tone_synthesizer()
1534 tone.duration = i; in qdm2_fft_tone_synthesizer()
1535 tone.time_index = 0; in qdm2_fft_tone_synthesizer()
1537 qdm2_fft_generate_tone(q, &tone); in qdm2_fft_tone_synthesizer()