aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/Visual/analyzer/inlines.h
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2010-10-08 18:06:38 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2010-10-08 18:06:38 +0000
commitc4749f20a5ad31ed8c68c11547120a0d1da45a8f (patch)
tree805248511deeea91f7da2d2881f9afefe9f21b1a /src/plugins/Visual/analyzer/inlines.h
parent767150cfe9403eb432ea82377664abda214d6e04 (diff)
downloadqmmp-c4749f20a5ad31ed8c68c11547120a0d1da45a8f.tar.gz
qmmp-c4749f20a5ad31ed8c68c11547120a0d1da45a8f.tar.bz2
qmmp-c4749f20a5ad31ed8c68c11547120a0d1da45a8f.zip
dynamic buffer size
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@1928 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/Visual/analyzer/inlines.h')
-rw-r--r--src/plugins/Visual/analyzer/inlines.h93
1 files changed, 8 insertions, 85 deletions
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--;
}
}