public static void main(String[] args) {

        // Test for Block
        /*
        Pixel values
        49  61  69  61  78 89 100 112
        68  60  51  42  62 69 80  89
        90  81  58  49  69 72 68  69
        100 91  79  72  69 68 59  58
        111 100 101 91  82 71 59  49
        131 119 120 102 90 90 81  59
        148 140 129 99  92 78 59  39
        151 140 142 119 98 90 72  39

        Forward DCT

        672 101 13 21 -13 0 6 9
        -104 -144 35 -5 9 -17 -3 0
         31 -21 -1 -7 -9 0 0 4
         22 -21 -9 -13 -2 3 2 2
         9 -2 -17 -11 0 5 1 -2
         4 6 1 0 -2 -7 0 -1
         21 -12 -3 2 -4 3 0 -1
         -5 8 -3 2 1 -6 0 2
        */

        double[][] _input = { {49, 61, 69, 61, 78, 89, 100, 112}
                            , {68, 60, 51, 42, 62, 69, 80, 89}
                            , {90, 81, 58, 49, 69, 72, 68, 69}
                            , {100, 91, 79, 72, 69, 68, 59, 58}
                            , {111, 100, 101, 91, 82, 71, 59, 49}
                            , {131, 119, 120, 102, 90, 90, 81, 59}
                            , {148, 140, 129, 99, 92, 78, 59, 39}
                            , {151, 140, 142, 119, 98, 90, 72, 39} };
        //,()

        double[][] _output = { {672, 101, 13, 21, -13, 0, 6, 9}
                            , {-104, -144, 35, -5, 9, -17, -3, 0}
                            , {31, -21, -1, -7, -9, 0, 0, 4}
                            , {22, -21, -9, -13, -2, 3, 2, 2}
                            , {9, -2, -17, -11, 0, 5, 1, -2}
                            , {4, 6, 1, 0, -2, -7, 0, -1}
                            , {21, -12, -3, 2, -4, 3, 0, -1}
                            , {-5, 8, -3, 2, 1, -6, 0, 2} };

        Block _blockTest = new Block(_input);
        double[][] _dctResult = _blockTest.FDCT();
        for(int i=0;i<8;i++) {
            //System.out.println("");
            //System.out.print(_result[i][j] + " ");
            for (int j = 0; j < 8; j++)
                if ((_dctResult[i][j] - _output[i][j]) > 1) {
                    System.err.println("==> [Failed!] DCT Test Failed!");
                    System.err.flush();
                    return;
                }
        }
        //System.err.println("==> [Passed!] Test Passed");



        /*---------------------- Test For IDCT  -----------------------*/
//        double[][] _idctResult =  _blockTest.IDCT(_output);
//        for(int i=0;i<8;i++) {
//            System.out.println("");
//            for (int j = 0; j < 8; j++) {
//                System.out.print(_idctResult[i][j] + " ");
//            }
//        }


        /*-------------Test for ZigZag--------------------*/
        double[][] tem = _blockTest.ZigZag( 8, 14-1);
        for(int i=0;i<8;i++){
            System.out.println();
            for(int j=0;j<8;j++){
                System.out.print(tem[i][j] + " ");
            }
        }
    }