The jd_prepare function analyzes the JPEG data and create a decompression object for subsequnet decompression process.
JRESULT jd_prepare ( JDEC* jdec, /* Pointer to blank decompression object */ size_t (*infunc)(JDEC*, uint8_t*, size_t), /* Pointer to input function */ void* work, /* Pointer to the work area */ size_t sz_work, /* Size of the work area */ void* device /* Session identifier for the session */ );
The jd_prepare function is the first stage of a JPEG decompression session. It analyzes the JPEG image and create parameter tables for decompression. After the function succeeded, the session gets ready to decompress the JPEG image by the jd_decomp fnction. The application program can refer the dimensions of the JPEG image stored in the decompression object. These information will be used to configure the output device and parameters for subsequent decompression stage.