mirror of
https://github.com/Rockbox/rockbox.git
synced 2026-10-10 08:03:04 -04:00
Both decoders treated every 3-component image as YCbCr, so RGB JPEGs (as written by cjpeg -rgb, and by some Adobe software) came out with wrong colours. Decide the colour space as libjpeg does: a JFIF marker means YCbCr; otherwise the transform flag of an Adobe APP14 marker decides (0 is RGB); otherwise component IDs 'R', 'G', 'B' mean RGB. Core loader: on colour targets R, G and B are stored in place in the row buffer and the YUV conversion is skipped. Greyscale builds now also decode G and B for RGB and combine them into luma per block, which needs every component to be one block per MCU; other RGB layouts are rejected there. Plugin: RGB needs one block per MCU for every component, otherwise it is rejected (colour targets fall back to jpegp). Colour builds convert the R, G and B planes to YCbCr in place after decoding, so display and greyscale view modes are unchanged; greyscale builds combine R, G and B into luma per block as the core does. Code size on the e200: core loader +351 bytes, plugin decoder +603 bytes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Change-Id: Ib24a0b7690ca4c00b3ac01b2f511309efeac5975 |
||
|---|---|---|
| .. | ||
| jpeg.c | ||
| jpeg.make | ||
| jpeg_decoder.c | ||
| jpeg_decoder.h | ||
| SOURCES | ||
| yuv2rgb.c | ||
| yuv2rgb.h | ||