The algorithm to perform discrete cosine transform is
break image into 8*8 block of pixels
from left to right top to bottom subtract 128 from each block of pixels
apply dct to each block
..
the...