Don't perform YUV->RGB conversion before row output for unscaled loads of greyscale JPEG, as store_row_jpeg already does this.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21174 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Andrew Mahone 2009-06-03 06:35:10 +00:00
parent 840ab7c724
commit 2bedde17b6

View file

@ -2144,19 +2144,22 @@ int read_jpeg_fd(int fd,
{ {
part = store_row_jpeg(p_jpeg); part = store_row_jpeg(p_jpeg);
#ifdef HAVE_LCD_COLOR #ifdef HAVE_LCD_COLOR
struct uint8_rgb *qp = part->buf; if (p_jpeg->blocks > 1)
struct uint8_rgb *end = qp + bm->width;
uint8_t y, u, v;
unsigned r, g, b;
for (; qp < end; qp++)
{ {
y = qp->blue; struct uint8_rgb *qp = part->buf;
u = qp->green; struct uint8_rgb *end = qp + bm->width;
v = qp->red; uint8_t y, u, v;
yuv_to_rgb(y, u, v, &r, &g, &b); unsigned r, g, b;
qp->red = r; for (; qp < end; qp++)
qp->blue = b; {
qp->green = g; y = qp->blue;
u = qp->green;
v = qp->red;
yuv_to_rgb(y, u, v, &r, &g, &b);
qp->red = r;
qp->blue = b;
qp->green = g;
}
} }
#endif #endif
output_row_8(row, part->buf, &ctx); output_row_8(row, part->buf, &ctx);