function Rick=dctUV(p,X)
[m,n]=size(X);n=m;
for i=2:n
    for j=1:n
        C(i,j)=sqrt(2/n)*cos((i-1)*(j-1/2)*pi/n);
    end
end
C(1,1:n)=ones(1,n)/sqrt(n);

Y=C*X*C';
Q=p*[17 18 24 47 99 99 99 99; 18 21 26 66 99 99 99 99; 24 26 56 99 99 99 99 99; 47 66 99 99 99 99 99 99; 99 99 99 99 99 99 99 99; 99 99 99 99 99 99 99 99; 99 99 99 99 99 99 99 99; 99 99 99 99 99 99 99 99]; 
Yq=round(Y./Q);

Ydq=Yq.*Q;
Xdq=C'*Ydq*C;
Rick=Xdq+128;
%Xf=uint8(Rick);
%imagesc(Xf);colormap(gray)


