function [ X ] = DCTslow(A)
    [S1 S2] = size(A);
    X = zeros([S1 S2]);
    for (m1 = 1:S1)
        for (m2 = 1:S2)
            for (n1 = 1:S1)
                for (n2 = 1:S2)
                    X(m1, m2) = X(m1, m2) + A(n1, n2) * cos((n1 - .5)*m1 * pi / S1) * cos((n2 - .5)*m2 * pi / S2);
                end
            end
        end
    end            
end

