From c4749f20a5ad31ed8c68c11547120a0d1da45a8f Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Fri, 8 Oct 2010 18:06:38 +0000 Subject: dynamic buffer size git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@1928 90c681e8-e032-0410-971d-27865f9a5e38 --- src/plugins/Visual/analyzer/inlines.h | 93 +++-------------------------------- 1 file changed, 8 insertions(+), 85 deletions(-) (limited to 'src/plugins/Visual/analyzer/inlines.h') diff --git a/src/plugins/Visual/analyzer/inlines.h b/src/plugins/Visual/analyzer/inlines.h index e2c48d019..39b81bd57 100644 --- a/src/plugins/Visual/analyzer/inlines.h +++ b/src/plugins/Visual/analyzer/inlines.h @@ -10,8 +10,7 @@ #include "fft.h" // *fast* convenience functions -static inline void -calc_freq(short* dest, short *src) +static inline void calc_freq(short* dest, short *src) { static fft_state *state = NULL; float tmp_out[257]; @@ -26,27 +25,6 @@ calc_freq(short* dest, short *src) dest[i] = ((int) sqrt(tmp_out[i + 1])) >> 8; } -static inline void -calc_mono_freq(short dest[2][256], short src[2][512], int nch) -{ - int i; - short *d, *sl, *sr, tmp[512]; - - if (nch == 1) - calc_freq(dest[0], src[0]); - else - { - d = tmp; - sl = src[0]; - sr = src[1]; - for (i = 0; i < 512; i++) - { - *(d++) = (*(sl++) + *(sr++)) >> 1; - } - calc_freq(dest[0], tmp); - } -} - static inline void stereo16_from_multichannel(register short *l, register short *r, register short *s, @@ -63,71 +41,16 @@ static inline void stereo16_from_multichannel(register short *l, } } - -static inline void stereo16_from_stereopcm16(register short *l, - register short *r, - register short *s, - long cnt) -{ - while (cnt >= 4l) - { - l[0] = s[0]; - r[0] = s[1]; - l[1] = s[2]; - r[1] = s[3]; - l[2] = s[4]; - r[2] = s[5]; - l[3] = s[6]; - r[3] = s[7]; - l += 4; - r += 4; - s += 8; - cnt -= 4l; - } - - if (cnt > 0l) - { - l[0] = s[0]; - r[0] = s[1]; - if (cnt > 1l) - { - l[1] = s[2]; - r[1] = s[3]; - if (cnt > 2l) - { - l[2] = s[4]; - r[2] = s[5]; - } - } - } -} - -static inline void mono16_from_monopcm16(register short *l, - register short *s, - long cnt) +static inline void mono16_from_multichannel(register short *l, + register short *s, + long cnt, int chan) { - while (cnt >= 4l) - { - l[0] = s[0]; - l[1] = s[1]; - l[2] = s[2]; - l[3] = s[3]; - l += 4; - s += 4; - cnt -= 4l; - } - - if (cnt > 0l) + while (cnt > 0) { l[0] = s[0]; - if (cnt > 1l) - { - l[1] = s[1]; - if (cnt > 2l) - { - l[2] = s[2]; - } - } + s += chan; + l++; + cnt--; } } -- cgit v1.2.3-13-gbd6f