public int[][] dct(int f[][]) {
        double tempX[][] = new double[N][N];
        double tempY[][] = new double[N][N];
        int F[][] = new int[N][N];

        for (int i = 0; i < N; i++) {
            for (int j = 0; j < N; j++) {
                tempX[i][j] = (double)f[i][j];
            }
        }

        dct_direct(tempX, tempY);
        for (int i = 0; i < N; i++) {
            for (int j = 0; j < N; j++) {
                F[i][j] = (int)(Math.floor(tempY[i][j] + 0.5));
            }
        }
        return F;
    }