summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorThom Johansen <thomj@rockbox.org>2007-11-29 23:49:43 +0000
committerThom Johansen <thomj@rockbox.org>2007-11-29 23:49:43 +0000
commitfeb75d43c8e06430d90b3d53478884c80fb7305a (patch)
tree150d7f314efc53d2269aa1af41d8080c1dd29c98 /apps
parent658747827f767610054e0d0144cd9d6b24595a02 (diff)
downloadrockbox-feb75d43c8e06430d90b3d53478884c80fb7305a.tar.gz
rockbox-feb75d43c8e06430d90b3d53478884c80fb7305a.zip
Remove unneeded files.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15848 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/codecs/libspeex/medfilter.c101
-rw-r--r--apps/codecs/libspeex/medfilter.h51
2 files changed, 0 insertions, 152 deletions
diff --git a/apps/codecs/libspeex/medfilter.c b/apps/codecs/libspeex/medfilter.c
deleted file mode 100644
index 57f403f00a..0000000000
--- a/apps/codecs/libspeex/medfilter.c
+++ /dev/null
@@ -1,101 +0,0 @@
1/* Copyright (C) 2004 Jean-Marc Valin
2 File medfilter.c
3 Median filter
4
5
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions
8 are met:
9
10 - Redistributions of source code must retain the above copyright
11 notice, this list of conditions and the following disclaimer.
12
13 - Redistributions in binary form must reproduce the above copyright
14 notice, this list of conditions and the following disclaimer in the
15 documentation and/or other materials provided with the distribution.
16
17 - Neither the name of the Xiph.org Foundation nor the names of its
18 contributors may be used to endorse or promote products derived from
19 this software without specific prior written permission.
20
21 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
25 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
26 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
27 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
28 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
31 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32
33*/
34
35#ifdef HAVE_CONFIG_H
36#include "config-speex.h"
37#endif
38
39#include "medfilter.h"
40#include "arch.h"
41
42MedianFilter *median_filter_new(int N)
43{
44 MedianFilter *f = (MedianFilter*)speex_alloc(sizeof(MedianFilter));
45 f->N = N;
46 f->ids = (int*)speex_alloc(sizeof(int)*N);
47 f->val = (float*)speex_alloc(sizeof(float)*N);
48 f->filled = 0;
49 return f;
50}
51
52void median_filter_update(MedianFilter *f, float val)
53{
54 int i=0;
55 int insert = 0;
56 while (insert<f->filled && f->val[insert] < val)
57 {
58 insert++;
59 }
60 if (f->filled == f->N)
61 {
62 int remove;
63 for (remove=0;remove<f->N;remove++)
64 if (f->ids[remove] == 0)
65 break;
66 if (insert>remove)
67 insert--;
68 if (insert > remove)
69 {
70 for (i=remove;i<insert;i++)
71 {
72 f->val[i] = f->val[i+1];
73 f->ids[i] = f->ids[i+1];
74 }
75 } else if (insert < remove)
76 {
77 for (i=remove;i>insert;i--)
78 {
79 f->val[i] = f->val[i-1];
80 f->ids[i] = f->ids[i-1];
81 }
82 }
83 for (i=0;i<f->filled;i++)
84 f->ids[i]--;
85 } else {
86 for (i=f->filled;i>insert;i--)
87 {
88 f->val[i] = f->val[i-1];
89 f->ids[i] = f->ids[i-1];
90 }
91 f->filled++;
92 }
93 f->val[insert]=val;
94 f->ids[insert]=f->filled-1;
95}
96
97float median_filter_get(MedianFilter *f)
98{
99 return f->val[f->filled>>1];
100}
101
diff --git a/apps/codecs/libspeex/medfilter.h b/apps/codecs/libspeex/medfilter.h
deleted file mode 100644
index 718869c3db..0000000000
--- a/apps/codecs/libspeex/medfilter.h
+++ /dev/null
@@ -1,51 +0,0 @@
1/* Copyright (C) 2004 Jean-Marc Valin */
2/**
3 @file medfilter.h
4 @brief Median filter
5*/
6/*
7 Redistribution and use in source and binary forms, with or without
8 modification, are permitted provided that the following conditions
9 are met:
10
11 - Redistributions of source code must retain the above copyright
12 notice, this list of conditions and the following disclaimer.
13
14 - Redistributions in binary form must reproduce the above copyright
15 notice, this list of conditions and the following disclaimer in the
16 documentation and/or other materials provided with the distribution.
17
18 - Neither the name of the Xiph.org Foundation nor the names of its
19 contributors may be used to endorse or promote products derived from
20 this software without specific prior written permission.
21
22 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
26 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
27 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
28 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
29 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
30 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
31 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33
34*/
35
36#ifndef MEDFILTER_H
37#define MEDFILTER_H
38
39/** Median filter. */
40typedef struct {
41 int N;
42 int filled;
43 int *ids;
44 float *val;
45} MedianFilter;
46
47MedianFilter *median_filter_new(int N);
48void median_filter_update(MedianFilter *f, float val);
49float median_filter_get(MedianFilter *f);
50
51#endif