
function [img] = quant_mat(imag, Q)
	T = dctmtx(8);
	Q = Q/255;
	qdct = @(block_struct) round( (T * block_struct.data * T')./Q).*Q;
	B = blockproc( imag,[8 8],qdct);
	invdct = @(block_struct) T' * block_struct.data * T;
	img = blockproc(B,[8 8],invdct);
end


