DCT and mean difference of an image
You can investigate that if the size of the DCT block (which is the whole image in here) is $x\times y$, then 

c=d(1,1)/sqrt(x*y);


That is, the DC element of the DCT matrix (i.e. d(1,1)) is actually the mean of the image scaled by $\sqrt{xy}$.

So you are basically subtracting a scaled version of the DC component form all coefficients, which makes not much sense at the moment, except if you provide more context.