1
2 #ifdef HAVE_CONFIG_H
3 #include "config.h"
4 #endif
5
6 #include <schroedinger/schro.h>
7 #include <schroedinger/schrowavelet.h>
8
9 #include <orc/orc.h>
10 #include <orc-test/orcprofile.h>
11
12 #include <stdio.h>
13 #include <string.h>
14 #include <stdlib.h>
15
16
17 int16_t tmp[2048+100];
18
orc_profile_get_min(OrcProfile * prof)19 int orc_profile_get_min (OrcProfile *prof)
20 {
21 int i;
22 int min;
23 min = prof->hist_time[0];
24 for(i=0;i<10;i++){
25 if (prof->hist_count[i] > 0) {
26 if (prof->hist_time[i] < min) {
27 min = prof->hist_time[i];
28 }
29 }
30 }
31 return min;
32 }
33
34 void
upsample_speed(int filter,int width,int height)35 upsample_speed (int filter, int width, int height)
36 {
37 OrcProfile prof1;
38 double ave;
39 int i;
40 SchroFrame *frame1;
41 SchroFrame *frame2;
42 SchroUpsampledFrame *upframe;
43 SchroMemoryDomain *mem;
44
45 mem = schro_memory_domain_new_local ();
46 frame1 = schro_frame_new_and_alloc (mem, SCHRO_FRAME_FORMAT_U8_444, width, height);
47 frame2 = schro_frame_new_and_alloc (mem, SCHRO_FRAME_FORMAT_U8_444, width, height);
48
49 orc_profile_init (&prof1);
50
51 upframe = schro_upsampled_frame_new (schro_frame_ref(frame1));
52 schro_upsampled_frame_upsample (upframe);
53 schro_upsampled_frame_free (upframe);
54 for(i=0;i<10;i++) {
55 upframe = schro_upsampled_frame_new (schro_frame_ref(frame1));
56 orc_profile_start (&prof1);
57 schro_upsampled_frame_upsample (upframe);
58 orc_profile_stop (&prof1);
59 schro_upsampled_frame_free (upframe);
60 }
61
62 ave = orc_profile_get_min (&prof1);
63 printf("%d %d %g %g\n", width, height, ave, ave/(width*height));
64
65 schro_frame_unref (frame1);
66 schro_frame_unref (frame2);
67
68 schro_memory_domain_free (mem);
69 }
70
71
72 int
main(int argc,char * argv[])73 main (int argc, char *argv[])
74 {
75 int i;
76
77 orc_init();
78
79 for(i=16;i<=2048;i+=16){
80 upsample_speed (1, i, (i*9)/16);
81 }
82
83 return 0;
84 }
85
86