6 #include <schroedinger/schro.h>
7 #include <schroedinger/schrowavelet.h>
8 #include <schroedinger/schrooil.h>
10 #define OIL_ENABLE_UNSTABLE_API
11 #include <liboil/liboil.h>
12 #include <liboil/liboilprofile.h>
19 int16_t tmp
[2048+100];
22 int oil_profile_get_min (OilProfile
*prof
)
26 min
= prof
->hist_time
[0];
28 if (prof
->hist_count
[i
] > 0) {
29 if (prof
->hist_time
[i
] < min
) {
30 min
= prof
->hist_time
[i
];
38 wavelet_speed (int filter
, int width
, int height
)
42 double ave_fwd
, ave_rev
;
46 fd
.format
= SCHRO_FRAME_FORMAT_S16_444
;
52 oil_profile_init (&prof1
);
53 oil_profile_init (&prof2
);
56 oil_profile_start (&prof1
);
57 schro_wavelet_transform_2d (&fd
, filter
, tmp
);
58 oil_profile_stop (&prof1
);
60 oil_profile_start (&prof2
);
61 schro_wavelet_inverse_transform_2d (&fd
, filter
, tmp
);
62 oil_profile_stop (&prof2
);
65 //oil_profile_get_ave_std (&prof1, &ave_fwd, &std);
66 //printf("fwd %g (%g)\n", ave, std);
68 //oil_profile_get_ave_std (&prof2, &ave_rev, &std);
69 //printf("rev %g (%g)\n", ave, std);
71 ave_fwd
= oil_profile_get_min (&prof1
);
72 ave_rev
= oil_profile_get_min (&prof2
);
73 printf("%d %d %g %g %g %g\n", width
, height
, ave_fwd
, ave_rev
,
74 ave_fwd
/(width
*height
), ave_rev
/(width
*height
));
79 main (int argc
, char *argv
[])
85 data
= malloc(2048*512*2);
89 printf("wavelet %d\n", i
);
90 wavelet_speed (i
, 256, 256);
93 for(i
=16;i
<=2048;i
+=16){
94 wavelet_speed (1, i
, 256);