26 #define M_PI_4 0.78539816339744830961566084581987572
32 #define M_1_SQRT2 0.70710678118654752440084436210484904
36 #define M_SQRT3 1.73205080756887729352744634150587237
40 #define M_COSPI_8 0.92387953251128675612818318939678829
44 #define M_COSPI3_8 0.38268343236508977172845998403039887
64 long N,
long stride,
num sigma)
66 double alpha = (2.0 *
M_PI_4 *
M_PI_4) * (sigma * sigma);
68 assert(dest && src && 0 < N && N <= 4 && stride != 0 && sigma > 0);
77 double F0 = 0.5 * (src[0] + src[stride]);
78 double F1 = 0.5 * (src[0] - src[stride]);
80 dest[0] = (
num)(F0 + F1);
81 dest[stride] = (
num)(F0 - F1);
86 double F0 = (src[0] + src[stride] + src[stride * 2]) / 3.0;
87 double F1 = ((0.5*
M_SQRT3) * (src[0] - src[stride * 2])) / 3.0;
88 double F2 = (0.5*(src[0] + src[stride * 2]) - src[stride]) / 3.0;
90 F2 *= exp(-4.0 * alpha);
92 dest[stride] = (
num)(F0 - 2.0 * F2);
93 dest[stride * 2] = (
num)(F0 -
M_SQRT3 * F1 + F2);
98 double F0 = (src[0] + src[stride]
99 + src[stride * 2] + src[stride * 3]) / 4.0;
100 double F1 = (
M_COSPI_8 * (src[0] - src[stride * 3])
101 +
M_COSPI3_8 * (src[stride] - src[stride * 2])) / 4.0;
102 double F2 = (
M_1_SQRT2 * (src[0] - src[stride]
103 + src[stride * 2] - src[stride * 3])) / 4.0;
104 double F3 = (
M_COSPI3_8 * (src[0] - src[stride * 3])
105 -
M_COSPI_8 * (src[stride] - src[stride * 2])) / 4.0;
107 F2 *= exp(-4.0 * alpha);
108 F3 *= exp(-9.0 * alpha);
109 dest[0] = (
num)(F0 + 2.0 *
111 dest[stride] = (
num)(F0 + 2.0 *
113 dest[stride * 2] = (
num)(F0 + 2.0 *
115 dest[stride * 3] = (
num)(F0 + 2.0 *