summaryrefslogtreecommitdiff
path: root/mbest.h
diff options
context:
space:
mode:
authorerdgeist@erdgeist.org <erdgeist@bauklotz.fritz.box>2019-07-04 23:26:09 +0200
committererdgeist@erdgeist.org <erdgeist@bauklotz.fritz.box>2019-07-04 23:26:09 +0200
commitf02dfce6e6c34b3d8a7b8a0e784b506178e331fa (patch)
tree45556e6104242d4702689760433d7321ae74ec17 /mbest.h
stripdown of version 0.9
Diffstat (limited to 'mbest.h')
-rw-r--r--mbest.h59
1 files changed, 59 insertions, 0 deletions
diff --git a/mbest.h b/mbest.h
new file mode 100644
index 0000000..fb7664f
--- /dev/null
+++ b/mbest.h
@@ -0,0 +1,59 @@
1/*---------------------------------------------------------------------------*\
2
3 FILE........: mbest.h
4 AUTHOR......: David Rowe
5 DATE CREATED: Jan 2017
6
7 Multistage vector quantiser search algorithm that keeps multiple
8 candidates from each stage.
9
10\*---------------------------------------------------------------------------*/
11
12/*
13 Copyright David Rowe 2017
14
15 All rights reserved.
16
17 This program is free software; you can redistribute it and/or modify
18 it under the terms of the GNU Lesser General Public License version 2.1, as
19 published by the Free Software Foundation. This program is
20 distributed in the hope that it will be useful, but WITHOUT ANY
21 WARRANTY; without even the implied warranty of MERCHANTABILITY or
22 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 License for more details.
24
25 You should have received a copy of the GNU Lesser General Public License
26 along with this program; if not, see <http://www.gnu.org/licenses/>.
27
28*/
29
30#ifndef __MBEST__
31#define __MBEST__
32
33#define MBEST_STAGES 4
34
35struct MBEST_LIST {
36 int index[MBEST_STAGES]; /* index of each stage that lead us to this error */
37 float error;
38};
39
40struct MBEST {
41 int entries; /* number of entries in mbest list */
42 struct MBEST_LIST *list;
43};
44
45struct MBEST *mbest_create(int entries);
46void mbest_destroy(struct MBEST *mbest);
47void mbest_insert(struct MBEST *mbest, int index[], float error);
48void mbest_search(const float *cb, float vec[], float w[], int k, int m, struct MBEST *mbest, int index[]);
49void mbest_search450(const float *cb, float vec[], float w[], int k,int shorterK, int m, struct MBEST *mbest, int index[]);
50
51// #define MBEST_PRINT_OUT
52#ifdef MBEST_PRINT_OUT
53 #define MBEST_PRINT(a,b) mbest_print((a),(b))
54#else
55 #define MBEST_PRINT(a,b)
56#endif
57
58
59#endif