int[][]fold_index=null;// index of the source item in 2nx2n array input to mdct_2d.
// First index (0..n^2-1) index in the folded array (dct-iV input)
// Second index(0..3) - item to add (2 vertical, 2 - horizontal)
double[][][]fold_k=null;// First index - mode: 0 - CC 1: SC, 2: CS, 3: SS. Other indices matching fold_index items. Each is a product of 2 window coefficients and sign
// First index (0..n^2-1) index in the folded array (dct-iV input)
// Second index(0..3) - item to add (2 vertical, 2 - horizontal)
double[][][]fold_k=null;// First index - mode: 0 - CC 1: SC, 2: CS, 3: SS. Other indices matching fold_index items. Each is a product of 2 window coefficients and sign
int[]unfold_index=null;// index for each element of idct(2nx2n)
double[][]unfold_k=null;// First index - mode: 0 - CC 1: SC, 2: CS, 3: SS. Other indices matching unfold_index items. Each is a product of 2 window coefficients and sign
double[][]unfold_k=null;// First index - mode: 0 - CC 1: SC, 2: CS, 3: SS. Other indices matching unfold_index items. Each is a product of 2 window coefficients and sign
publicint[][]getFoldIndex(){
returnfold_index;
}
publicint[]getUnfoldIndex(){
returnunfold_index;
}
publicdouble[][][]getFoldK(){
returnfold_k;
}
publicDttRad2(intmaxN){// n - maximal
setup_arrays(maxN);// always setup arrays for fast calculations
}
...
...
@@ -78,21 +82,21 @@ public class DttRad2 {
for(inti=0;i<y.length;i++)y[i]*=scale;
returny;
}
publicdouble[]dst_iv(double[]x){
double[]xr=newdouble[x.length];
intj=x.length-1;
for(inti=0;i<x.length;i++)xr[i]=x[j--];
for(inti=0;i<x.length;i++)xr[i]=x[j--];
double[]y=_dctiv_recurs(xr);
doublescale=1.0/Math.sqrt(x.length);
for(inti=0;i<y.length;i++){
y[i]*=scale;
scale=-scale;
scale=-scale;
}
returny;
}
// For index in dct-iv input (0..n-1) get 2 variants of index in mdct input array (0..2*n-1)
// second index : 0 - index in X array 2*n long
// 1 - window index (0..n-1), [0] - minimal, [n-1] - max
...
...
@@ -111,7 +115,7 @@ public class DttRad2 {
ind[0][3]=1;
ind[0][4]=n1-x-1;
ind[0][5]=-1;// c - window derivative over shift is negative
ind[1][0]=n+n1+x;// C: -d, S: -d
ind[1][1]=n1-x-1;
ind[1][2]=-1;
...
...
@@ -127,7 +131,7 @@ public class DttRad2 {
ind[0][3]=1;
ind[0][4]=n-x-1;
ind[0][5]=1;// a - window derivative over shift is positive