diff options
Diffstat (limited to 'apps/tdspeed.h')
-rw-r--r-- | apps/tdspeed.h | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/apps/tdspeed.h b/apps/tdspeed.h index 1a3df126f7..2fd9498448 100644 --- a/apps/tdspeed.h +++ b/apps/tdspeed.h | |||
@@ -23,15 +23,28 @@ | |||
23 | #ifndef _TDSPEED_H | 23 | #ifndef _TDSPEED_H |
24 | #define _TDSPEED_H | 24 | #define _TDSPEED_H |
25 | 25 | ||
26 | #include "dsp.h" | ||
27 | /* for the precision #defines: */ | ||
28 | #include "pitchscreen.h" | ||
29 | |||
26 | #define TDSPEED_OUTBUFSIZE 4096 | 30 | #define TDSPEED_OUTBUFSIZE 4096 |
27 | 31 | ||
32 | /* some #define functions to get the pitch, stretch and speed values based on */ | ||
33 | /* two known values. Remember that params are alphabetical. */ | ||
34 | #define GET_SPEED(pitch, stretch) \ | ||
35 | ((pitch * stretch + PITCH_SPEED_100 / 2L) / PITCH_SPEED_100) | ||
36 | #define GET_PITCH(speed, stretch) \ | ||
37 | ((speed * PITCH_SPEED_100 + stretch / 2L) / stretch) | ||
38 | #define GET_STRETCH(pitch, speed) \ | ||
39 | ((speed * PITCH_SPEED_100 + pitch / 2L) / pitch) | ||
40 | |||
28 | void tdspeed_init(void); | 41 | void tdspeed_init(void); |
29 | bool tdspeed_config(int samplerate, bool stereo, int factor); | 42 | bool tdspeed_config(int samplerate, bool stereo, int32_t factor); |
30 | long tdspeed_est_output_size(void); | 43 | long tdspeed_est_output_size(void); |
31 | long tdspeed_est_input_size(long size); | 44 | long tdspeed_est_input_size(long size); |
32 | int tdspeed_doit(int32_t *src[], int count); | 45 | int tdspeed_doit(int32_t *src[], int count); |
33 | 46 | ||
34 | #define STRETCH_MAX 250 | 47 | #define STRETCH_MAX (250L * PITCH_SPEED_PRECISION) /* 250% */ |
35 | #define STRETCH_MIN 35 | 48 | #define STRETCH_MIN (35L * PITCH_SPEED_PRECISION) /* 35% */ |
36 | 49 | ||
37 | #endif | 50 | #endif |