FS#10162 - Problems with subsampled chroma in jpeg viewer plugin

Attached to Project: Rockbox
Opened by Andrew Mahone (Unhelpful) - Thursday, 23 April 2009, 04:30 GMT
Last edited by Andrew Mahone (Unhelpful) - Thursday, 23 April 2009, 06:09 GMT
Task Type Bugs
Category Plugins
Status Closed
Assigned To No-one
Operating System All players
Severity Low
Priority Normal
Reported Version Version 3.2
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


I noticed while working on jpeg loading+scaling for core that the plugin's code for handling chroma subsampling had some oddities - it used the first (luma) component's subsampling values to decide how the image was subsampled, but these values are stored separately per-component, and luma is almost never subsampled. I added code to fail on loading any really bizarre cases (subsampled luma, or the chroma channels having different subsampling), and to check the second component, rather than the first, for subsampling information. While the decoder is now initializing properly (to the best of my knowledge) for chroma-subsampled images, these images are still not displayed correctly. Patch with my (unsuccesful) fixes + some debug output attached, as well as some sample images. All four images should look roughly the same (subsampling is very obvious at this low resolution) but bees-40.jpg is the only one which displays correctly for me.
This task depends upon

Closed by  Andrew Mahone (Unhelpful)
Thursday, 23 April 2009, 06:09 GMT
Reason for closing:  Invalid
Additional comments about closing:  I was interpreting the command-line option for cjpeg (and the flags in the file, as well) backwards, this is not a real bug.