This is a full example of processing RGB data into luma-chroma data, DCTing it, quantizing it, and converting it back to luma-chroma then RGB. Thanks http://unix4lyfe.org/dct/ for the DCT implementation. test.c is licensed under the ISC license. dct.c is copyrighted, but "Feel free to do whatever you like with this code."