1
0
Fork 0
forked from len0rd/rockbox

imageviewer: Initial support for JPEG progressive images. Add decoder

Added jpeg decoder jpegp.c using RAINBOW lib. Currently enabled only for pictures not supported by old decoder (as old decoder more optimized for low mem targets)

Someone TODO:
 * Old decoder has optimized downscale logic which new decoder doesn't have (it gives big difference in required memory and time for decoding). This logic should be ported/adapted if possible.

 * Add smooth downscaling.

 * Grayscale support

Change-Id: Ie96bc62848b51cc6a3942f8e069ec6ab02dc1c56
This commit is contained in:
Roman Artiukhin 2024-10-09 19:39:15 +03:00 committed by Solomon Peachy
parent 64ad7354b6
commit b8238f7b20
19 changed files with 599 additions and 22 deletions

View file

@ -853,6 +853,8 @@ static int load_and_show(char* filename, struct image_info *info)
file_pt[curfile] = NULL;
return change_filename(direction);
}
reload_decoder:
if (image_type != status) /* type of image is changed, load decoder. */
{
struct loader_info loader_info = {
@ -881,6 +883,13 @@ static int load_and_show(char* filename, struct image_info *info)
else
status = imgdec->load_image(filename, info, buf, &remaining);
if (status == PLUGIN_JPEG_PROGRESSIVE)
{
rb->lcd_clear_display();
status = IMAGE_JPEG_PROGRESSIVE;
goto reload_decoder;
}
if (status == PLUGIN_OUTOFMEM)
{
#ifdef USE_PLUG_BUF