diff options
Diffstat (limited to 'lib/rbcodec/codecs/libayumi/ayumi.h')
-rw-r--r-- | lib/rbcodec/codecs/libayumi/ayumi.h | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/lib/rbcodec/codecs/libayumi/ayumi.h b/lib/rbcodec/codecs/libayumi/ayumi.h new file mode 100644 index 0000000000..66d767797e --- /dev/null +++ b/lib/rbcodec/codecs/libayumi/ayumi.h | |||
@@ -0,0 +1,72 @@ | |||
1 | /* Author: Peter Sovietov */ | ||
2 | |||
3 | #ifndef AYUMI_H | ||
4 | #define AYUMI_H | ||
5 | |||
6 | enum { | ||
7 | TONE_CHANNELS = 3, | ||
8 | DECIMATE_FACTOR = 8, | ||
9 | FIR_SIZE = 192, | ||
10 | DC_FILTER_SIZE = 1024 | ||
11 | }; | ||
12 | |||
13 | struct tone_channel { | ||
14 | int tone_period; | ||
15 | int tone_counter; | ||
16 | int tone; | ||
17 | int t_off; | ||
18 | int n_off; | ||
19 | int e_on; | ||
20 | int volume; | ||
21 | double pan_left; | ||
22 | double pan_right; | ||
23 | }; | ||
24 | |||
25 | struct interpolator { | ||
26 | double c[4]; | ||
27 | double y[4]; | ||
28 | }; | ||
29 | |||
30 | struct dc_filter { | ||
31 | double sum; | ||
32 | double delay[DC_FILTER_SIZE]; | ||
33 | }; | ||
34 | |||
35 | struct ayumi { | ||
36 | struct tone_channel channels[TONE_CHANNELS]; | ||
37 | int noise_period; | ||
38 | int noise_counter; | ||
39 | int noise; | ||
40 | int envelope_counter; | ||
41 | int envelope_period; | ||
42 | int envelope_shape; | ||
43 | int envelope_segment; | ||
44 | int envelope; | ||
45 | const double* dac_table; | ||
46 | double step; | ||
47 | double x; | ||
48 | struct interpolator interpolator_left; | ||
49 | struct interpolator interpolator_right; | ||
50 | double fir_left[FIR_SIZE * 2]; | ||
51 | double fir_right[FIR_SIZE * 2]; | ||
52 | int fir_index; | ||
53 | struct dc_filter dc_left; | ||
54 | struct dc_filter dc_right; | ||
55 | int dc_index; | ||
56 | double left; | ||
57 | double right; | ||
58 | }; | ||
59 | |||
60 | int ayumi_configure(struct ayumi* ay, int is_ym, double clock_rate, int sr); | ||
61 | void ayumi_set_pan(struct ayumi* ay, int index, double pan, int is_eqp); | ||
62 | void ayumi_set_tone(struct ayumi* ay, int index, int period); | ||
63 | void ayumi_set_noise(struct ayumi* ay, int period); | ||
64 | void ayumi_set_mixer(struct ayumi* ay, int index, int t_off, int n_off, int e_on); | ||
65 | void ayumi_set_volume(struct ayumi* ay, int index, int volume); | ||
66 | void ayumi_set_envelope(struct ayumi* ay, int period); | ||
67 | void ayumi_set_envelope_shape(struct ayumi* ay, int shape); | ||
68 | void ayumi_process(struct ayumi* ay); | ||
69 | void ayumi_seek(struct ayumi* ay); | ||
70 | void ayumi_remove_dc(struct ayumi* ay); | ||
71 | |||
72 | #endif | ||