FS#10177 - core jpeg decoder
Opened by Andrew Mahone (Unhelpful) - Thursday, 30 April 2009, 02:14 GMT
Last edited by Andrew Mahone (Unhelpful) - Saturday, 02 May 2009, 01:38 GMT
Core JPEG decoder for all targets with >1bit LCD. This is a port of the plugin jpeg decoder to work in core, along with some other changes. Data is read from disk as needed, IDCT have been split into separate horizontal and vertical passes, allowing different IDCT scaling on each axis, and 16-wide IDCT output is added, allowing for upscaling by 2x during decode (or upscaling chroma channels during IDCT when decoding at 1x). Output is fed to the scaler, and read_jpeg_file and read_jpeg_fd functions are added with call signatures identical to the similar functions for BMP files. Callers for these functions must pass a buffer in the struct bmp that is large enough for decoded image data, the struct jpeg used by the decoder, decode buffers (variable based on scaling and output width) and scaler buffers (variable based on output width). read_jpeg_file is exported in the plugin API, and a test_core_jpeg plugin is provided which will act as a viewer to decode and display one image (use the select button to exit). I have tested on images with 1x2-, 2x1-, 2x2-, and non-subsampled chroma, as well as Y-only images and ones with varying sizes above or below display size and various reset marker intervals.
The test_core_jpeg plugin will need to be enabled by editing apps/plugins/SOURCES. There seems to be some extra blockiness at the borders of 16-wide IDCT blocks - this should be tracked down before commit, these IDCT routines are possibly not ported correctly from the jpeg-7-pre sources.
The compiled object file for the loader is ~22KiB on an ARM color target (Gigabeat S).
View Dependency Graph
Saturday, 02 May 2009, 01:38 GMT
Reason for closing: Accepted
Additional comments about closing: Committed as r20836