function process(file, m, n)
    QT = [16  11  10  16  24  40  51  61;
          12  12  14  19  26  58  60  55;
          14  13  16  24  40  57  69  56;
          14  17  22  29  51  87  80  62;
          18  22  37  56  68 109 103  77;
          24  35  55  64  81 104 113  92;
          49  64  78  87 103 121 120 101;
          72  92  95  98 112 100 103  99];
    fin=fopen(file,'r');
    X=fread(fin,m*n,'uint8=>uint8'); fclose(fin);
    Y=reshape(X,m,n);
    Y=Y';
    dc = 0;
    for i=1:8:m
        for j=1:8:n
            tmp = Y(i:i+7, j:j+7);
            tmp = dct2(tmp-128);
            tmp = round(tmp ./ QT);
            vec = zigzag(tmp);
            xx = 1;
            while(xx<=64)
                if(xx==1)
                    s = vec(xx) - dc;
                    num = strlength(dec2bin(abs(s), 1));
                    if(64*ceil((i-1)/8)+ceil((j-1)/8)==100 || 64*ceil((i-1)/8)+ceil((j-1)/8)==1999)
                        fprintf("(%d, %d)", num, s);
                    end
                else
                    cnt = 0;
                    while(xx<=64 && vec(xx)==0)
                        cnt = cnt+1;
                        xx = xx+1;
                    end
                    if(xx==65)
                        if(64*ceil((i-1)/8)+ceil((j-1)/8)==100 || 64*ceil((i-1)/8)+ceil((j-1)/8)==1999)  
                            fprintf(", EOB");
                        end
                    else
                        t = vec(xx);
                        num = strlength(dec2bin(abs(t), 1));
                        if(64*ceil((i-1)/8)+ceil((j-1)/8)==100 || 64*ceil((i-1)/8)+ceil((j-1)/8)==1999)  
                            fprintf(", (%d, %d, %d)", cnt, num, vec(xx));
                        end
                    end
                end
                xx = xx+1;
            end
            if(64*ceil((i-1)/8)+ceil((j-1)/8)==100 || 64*ceil((i-1)/8)+ceil((j-1)/8)==1999)  
                fprintf("\n");
            end
            dc = tmp(1, 1);
        end
    end
end