diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2015-08-11 09:08:12 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2015-08-11 09:08:12 +0000 |
| commit | 017d2d27bfbcd97ada407212e925b280ff3482b5 (patch) | |
| tree | 2a832873a52ee7c8546b6262be58f41d1bdd480e /src/plugins/Ui/qsui/inlines.h | |
| parent | 22cf3c55368be9361b43eb002e7a2fb7f2868ac2 (diff) | |
| download | qmmp-017d2d27bfbcd97ada407212e925b280ff3482b5.tar.gz qmmp-017d2d27bfbcd97ada407212e925b280ff3482b5.tar.bz2 qmmp-017d2d27bfbcd97ada407212e925b280ff3482b5.zip | |
added qsui plugin
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@5367 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/Ui/qsui/inlines.h')
| -rw-r--r-- | src/plugins/Ui/qsui/inlines.h | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/src/plugins/Ui/qsui/inlines.h b/src/plugins/Ui/qsui/inlines.h new file mode 100644 index 000000000..39b81bd57 --- /dev/null +++ b/src/plugins/Ui/qsui/inlines.h @@ -0,0 +1,57 @@ +// Copyright (c) 2000-2001 Brad Hughes <bhughes@trolltech.com> +// +// Use, modification and distribution is allowed without limitation, +// warranty, or liability of any kind. +// + +#ifndef INLINES_H +#define INLINES_H + +#include "fft.h" + +// *fast* convenience functions +static inline void calc_freq(short* dest, short *src) +{ + static fft_state *state = NULL; + float tmp_out[257]; + int i; + + if (!state) + state = fft_init(); + + fft_perform(src, tmp_out, state); + + for (i = 0; i < 256; i++) + dest[i] = ((int) sqrt(tmp_out[i + 1])) >> 8; +} + +static inline void stereo16_from_multichannel(register short *l, + register short *r, + register short *s, + long cnt, int chan) +{ + while (cnt > 0) + { + l[0] = s[0]; + r[0] = s[1]; + s += chan; + l++; + r++; + cnt--; + } +} + +static inline void mono16_from_multichannel(register short *l, + register short *s, + long cnt, int chan) +{ + while (cnt > 0) + { + l[0] = s[0]; + s += chan; + l++; + cnt--; + } +} + +#endif // INLINES_H |
