public double[][] FDCT()
    {
        double[][] uvResult = new double[8][8];
        double _cu, _cv, _sum = 0;

        for(int u=0; u<N; u++)
        {
            _cu = (u==0) ? Math.sqrt(1.0/this.N) : Math.sqrt(2.0/this.N);
            for(int v=0; v<N; v++)
            {
                _cv= (v==0) ? Math.sqrt(1.0/this.N) : Math.sqrt(2.0/this.N);
                _sum = 0;
                for(int x=0;x<N;x++) {
                    for (int y = 0; y < N; y++) {
                        _sum += this.block[x][y] * Math.cos((2 * x + 1) * u * Math.PI / (2 * N))
                                * Math.cos((2 * y + 1) * v * Math.PI / (2 * N));
                    } // for y
                } // for x
                uvResult[u][v] = _cu * _cv * _sum;
            } // for v
        } // for u

    this.block = uvResult;
    return uvResult;
    }