diff options
author | Andrew Mahone <andrew.mahone@gmail.com> | 2009-06-03 06:35:10 +0000 |
---|---|---|
committer | Andrew Mahone <andrew.mahone@gmail.com> | 2009-06-03 06:35:10 +0000 |
commit | 2bedde17b6d841ee8910a71cf5343ec8c8fed98b (patch) | |
tree | 58538f3ebdcfd885572c5db00c4019fe1d5343c8 /apps | |
parent | 840ab7c72421b2d8dbb1587fe486498599b05a31 (diff) |
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
Diffstat (limited to 'apps')
-rw-r--r-- | apps/recorder/jpeg_load.c | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/apps/recorder/jpeg_load.c b/apps/recorder/jpeg_load.c index 07b79f0b85..027ddaf5a8 100644 --- a/apps/recorder/jpeg_load.c +++ b/apps/recorder/jpeg_load.c @@ -2144,19 +2144,22 @@ int read_jpeg_fd(int fd, { part = store_row_jpeg(p_jpeg); #ifdef HAVE_LCD_COLOR - struct uint8_rgb *qp = part->buf; - struct uint8_rgb *end = qp + bm->width; - uint8_t y, u, v; - unsigned r, g, b; - for (; qp < end; qp++) + if (p_jpeg->blocks > 1) { - 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; + struct uint8_rgb *qp = part->buf; + struct uint8_rgb *end = qp + bm->width; + uint8_t y, u, v; + unsigned r, g, b; + for (; qp < end; qp++) + { + 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 output_row_8(row, part->buf, &ctx); |