static void dctsub( int n, double* a, int nc, double* c ) {
int j, k, kk, ks, m;
double wkr, wki, xr;
m = n >> 1;
ks = nc / n;
kk = 0;
for ( j = 1; j < m; j++ ) {
k = n - j;
kk += ks;
wkr = c[kk] - c[nc - kk];
wki = c[kk] + c[nc - kk];
xr = wki * a[j] - wkr * a[k];
a[j] = wkr * a[j] + wki * a[k];
a[k] = xr;
}
a[m] *= c[0];
}