The jd_decomp function decompress the JPEG image and output it as pixel data.
JRESULT jd_decomp ( JDEC* jdec, /* Pointer to valid decompression object */ int(*outfunc)(JDEC*,void*,JRECT*), /* Pointer to output function */ uint8_t scale /* Scaling factor */ );
The jd_decomp function is the second stage of a JPEG decompression session. It decompresses the input JPEG stream and outputs it via user defined output function. After this function, the decompressor object is no longer valid.
The scaling factor can be specified on decompresson. It descales the size of the output image by 1/2, 1/4 or 1/8. For example, when decompress a JPEG image of 1024x768 in 1/4 scaling, the decmopressed image will be output in 256x192. The scaling ratio of 1/2 and 1/4 will slightly decrease the decompression speed compared to 1/1 due to averaging process. However scaling ratio of 1/8 will 2-3 times faster than 1/1, because IDCT and averaging process for each block can be skipped. This characteristic is sutable to create thumbnails.