-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_mod_rmf.c
51 lines (39 loc) · 1.01 KB
/
test_mod_rmf.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include <stdio.h>
#include <stdlib.h>
#include "matrix.h"
#include "mod_rmf.h"
#include "module.h"
#define NB_FEATURES 9*9*4
//#define MATRIX_DEBUG(...)
//#define MATRIX_DEBUG(...) fprintf(stderr, __VA_ARGS__)
int main(int argc, char **argv)
{
module_t *module;
int i,j;
param_t param;
float *tab;
int dct[8][8] = {
{ 45, 8, 6, 4, 2, 0, 0, 0 },
{ 4, 4, 2, 1, 0, 0, 0, 0 },
{ 3, 3, 1, 1, 0, 0, 0, 0 },
{ 2, 2, 0, 0, 0, 0, 0, 0 },
{ 1, 1, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0 }};
// printf("do_extraction()...\n");
rmf_hello_module();
param.nb_dct = 1;
rmf_init();
module = rmf_get_module();
tab = (float *) malloc(sizeof(float) * module->features);
rmf_reset(¶m);
rmf_compute((int *) dct);
rmf_get_features((float *) tab);
for(i=0;i<module->features;i++) {
printf("%f ",tab[i]);
}
// do_extraction((int *)dct, 8,8, &tab, NB_FEATURES);
// printf("done\n");
return 0;
}