6 #include <schroedinger/schro.h>
7 #include <schroedinger/schrowavelet.h>
15 check_output (int type
, int split
)
23 src
= malloc (256 * 2);
24 dest
= malloc (256 * 2);
33 schro_lift_split (type
, dest
+ 10, src
+ 10, n
);
35 schro_lift_synth (type
, dest
+ 10, src
+ 10, n
);
40 printf("check_output failed type=%d, split=%d, n=%d, offset=%d\n",
41 type
, split
, n
, i
- 10);
54 check_endpoints (int type
, int split
)
63 src
= malloc (256 * 2);
64 dest
= malloc (256 * 2);
79 schro_lift_split (type
, dest
+ 10, src
+ 10, n
);
81 schro_lift_synth (type
, dest
+ 10, src
+ 10, n
);
86 printf("check_endpoints failed type=%d, split=%d, n=%d, x=%d\n",
101 check_constant (int type
)
109 src
= malloc (256 * 2);
110 dest
= malloc (256 * 2);
117 schro_lift_split (type
, dest
, src
, n
);
120 if (dest
[i
] != dest
[0]) {
121 printf("check_constant failed type=%d, n=%d, i=%d\n",
128 if (dest
[i
+1] != 0) {
129 printf("check_constant failed type=%d, n=%d, i=%d\n",
143 check_random (int type
)
152 src
= malloc (256 * 2);
153 tmp
= malloc (256 * 2);
154 dest
= malloc (256 * 2);
158 src
[i
] = rand()&0xff;
161 schro_lift_split (type
, tmp
, src
, n
);
162 schro_lift_synth (type
, dest
, tmp
, n
);
165 if (dest
[i
] != src
[i
]) {
166 printf("check_random failed type=%d, n=%d, i=%d\n", type
, n
, i
);
180 main (int argc
, char *argv
[])
184 check_output (SCHRO_WAVELET_DAUBECHIES_9_7
, 1);
185 check_output (SCHRO_WAVELET_DAUBECHIES_9_7
, 0);
187 check_output (SCHRO_WAVELET_DESLAURIERS_DUBUC_9_7
, 1);
188 check_output (SCHRO_WAVELET_DESLAURIERS_DUBUC_9_7
, 0);
190 check_output (SCHRO_WAVELET_LE_GALL_5_3
, 1);
191 check_output (SCHRO_WAVELET_LE_GALL_5_3
, 0);
193 check_output (SCHRO_WAVELET_DESLAURIERS_DUBUC_13_7
, 1);
194 check_output (SCHRO_WAVELET_DESLAURIERS_DUBUC_13_7
, 0);
196 check_endpoints (SCHRO_WAVELET_DAUBECHIES_9_7
, 1);
197 check_endpoints (SCHRO_WAVELET_DAUBECHIES_9_7
, 0);
199 check_endpoints (SCHRO_WAVELET_DESLAURIERS_DUBUC_9_7
, 1);
200 check_endpoints (SCHRO_WAVELET_DESLAURIERS_DUBUC_9_7
, 0);
202 check_endpoints (SCHRO_WAVELET_LE_GALL_5_3
, 1);
203 check_endpoints (SCHRO_WAVELET_LE_GALL_5_3
, 0);
205 check_endpoints (SCHRO_WAVELET_DESLAURIERS_DUBUC_13_7
, 1);
206 check_endpoints (SCHRO_WAVELET_DESLAURIERS_DUBUC_13_7
, 0);
209 check_constant (SCHRO_WAVELET_DAUBECHIES_9_7
);
210 check_constant (SCHRO_WAVELET_DESLAURIERS_DUBUC_9_7
);
211 check_constant (SCHRO_WAVELET_LE_GALL_5_3
);
212 check_constant (SCHRO_WAVELET_DESLAURIERS_DUBUC_13_7
);
215 check_random (SCHRO_WAVELET_DAUBECHIES_9_7
);
216 check_random (SCHRO_WAVELET_DESLAURIERS_DUBUC_9_7
);
217 check_random (SCHRO_WAVELET_LE_GALL_5_3
);
218 check_random (SCHRO_WAVELET_DESLAURIERS_DUBUC_13_7
);