summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm/imx233/creative-zenxfi2/lcd-zenxfi2.c
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2013-06-20 13:49:59 +0200
committerAmaury Pouly <amaury.pouly@gmail.com>2013-06-20 13:49:59 +0200
commita2352004304427ac352ac0381b45ba8f6abd04b5 (patch)
treec684e6270420909e12c09f78da8bfc9c610edf2e /firmware/target/arm/imx233/creative-zenxfi2/lcd-zenxfi2.c
parent7f552f80b862d70590891bfc7c4da52ef22c0c9f (diff)
downloadrockbox-a2352004304427ac352ac0381b45ba8f6abd04b5.tar.gz
rockbox-a2352004304427ac352ac0381b45ba8f6abd04b5.tar.bz2
rockbox-a2352004304427ac352ac0381b45ba8f6abd04b5.zip
zenxfi2: remove lcd yuv blitting code (duplicate from generic)
Change-Id: I2be7d5f9cbc2086673c731e7b76b7d7d6f728f26
Diffstat (limited to 'firmware/target/arm/imx233/creative-zenxfi2/lcd-zenxfi2.c')
-rw-r--r--firmware/target/arm/imx233/creative-zenxfi2/lcd-zenxfi2.c193
1 files changed, 0 insertions, 193 deletions
diff --git a/firmware/target/arm/imx233/creative-zenxfi2/lcd-zenxfi2.c b/firmware/target/arm/imx233/creative-zenxfi2/lcd-zenxfi2.c
index 0131a39233..6917ea3f53 100644
--- a/firmware/target/arm/imx233/creative-zenxfi2/lcd-zenxfi2.c
+++ b/firmware/target/arm/imx233/creative-zenxfi2/lcd-zenxfi2.c
@@ -32,7 +32,6 @@
#ifdef HAVE_LCD_ENABLE
static bool lcd_on;
#endif
-static unsigned lcd_yuv_options = 0;
static void setup_lcdif(void)
{
@@ -274,195 +273,3 @@ void lcd_update_rect(int x, int y, int w, int h)
}
imx233_lcdif_dma_send((void *)FRAME_PHYS_ADDR, w, h);
}
-
-void lcd_yuv_set_options(unsigned options)
-{
- lcd_yuv_options = options;
-}
-
-#define YFAC (74)
-#define RVFAC (101)
-#define GUFAC (-24)
-#define GVFAC (-51)
-#define BUFAC (128)
-
-static inline int clamp(int val, int min, int max)
-{
- if (val < min)
- val = min;
- else if (val > max)
- val = max;
- return val;
-}
-
-void lcd_blit_yuv(unsigned char * const src[3],
- int src_x, int src_y, int stride,
- int x, int y, int width, int height)
-{
- const unsigned char *ysrc, *usrc, *vsrc;
- int linecounter;
- fb_data *dst, *row_end;
- long z;
-
- /* width and height must be >= 2 and an even number */
- width &= ~1;
- linecounter = height >> 1;
-
- #if LCD_WIDTH >= LCD_HEIGHT
- dst = FBADDR(x,y);
- row_end = dst + width;
- #else
- dst = FBADDR(LCD_WIDTH - y - 1,x);
- row_end = dst + LCD_WIDTH * width;
- #endif
-
- z = stride * src_y;
- ysrc = src[0] + z + src_x;
- usrc = src[1] + (z >> 2) + (src_x >> 1);
- vsrc = src[2] + (usrc - src[1]);
-
- /* stride => amount to jump from end of last row to start of next */
- stride -= width;
-
- /* upsampling, YUV->RGB conversion and reduction to RGB565 in one go */
-
- do
- {
- do
- {
- int y, cb, cr, rv, guv, bu, r, g, b;
-
- y = YFAC*(*ysrc++ - 16);
- cb = *usrc++ - 128;
- cr = *vsrc++ - 128;
-
- rv = RVFAC*cr;
- guv = GUFAC*cb + GVFAC*cr;
- bu = BUFAC*cb;
-
- r = y + rv;
- g = y + guv;
- b = y + bu;
-
- if ((unsigned)(r | g | b) > 64*256-1)
- {
- r = clamp(r, 0, 64*256-1);
- g = clamp(g, 0, 64*256-1);
- b = clamp(b, 0, 64*256-1);
- }
-
- *dst = LCD_RGBPACK_LCD(r >> 9, g >> 8, b >> 9);
-
- #if LCD_WIDTH >= LCD_HEIGHT
- dst++;
- #else
- dst += LCD_WIDTH;
- #endif
-
- y = YFAC*(*ysrc++ - 16);
- r = y + rv;
- g = y + guv;
- b = y + bu;
-
- if ((unsigned)(r | g | b) > 64*256-1)
- {
- r = clamp(r, 0, 64*256-1);
- g = clamp(g, 0, 64*256-1);
- b = clamp(b, 0, 64*256-1);
- }
-
- *dst = LCD_RGBPACK_LCD(r >> 9, g >> 8, b >> 9);
-
- #if LCD_WIDTH >= LCD_HEIGHT
- dst++;
- #else
- dst += LCD_WIDTH;
- #endif
- }
- while (dst < row_end);
-
- ysrc += stride;
- usrc -= width >> 1;
- vsrc -= width >> 1;
-
- #if LCD_WIDTH >= LCD_HEIGHT
- row_end += LCD_WIDTH;
- dst += LCD_WIDTH - width;
- #else
- row_end -= 1;
- dst -= LCD_WIDTH*width + 1;
- #endif
-
- do
- {
- int y, cb, cr, rv, guv, bu, r, g, b;
-
- y = YFAC*(*ysrc++ - 16);
- cb = *usrc++ - 128;
- cr = *vsrc++ - 128;
-
- rv = RVFAC*cr;
- guv = GUFAC*cb + GVFAC*cr;
- bu = BUFAC*cb;
-
- r = y + rv;
- g = y + guv;
- b = y + bu;
-
- if ((unsigned)(r | g | b) > 64*256-1)
- {
- r = clamp(r, 0, 64*256-1);
- g = clamp(g, 0, 64*256-1);
- b = clamp(b, 0, 64*256-1);
- }
-
- *dst = LCD_RGBPACK_LCD(r >> 9, g >> 8, b >> 9);
-
- #if LCD_WIDTH >= LCD_HEIGHT
- dst++;
- #else
- dst += LCD_WIDTH;
- #endif
-
- y = YFAC*(*ysrc++ - 16);
- r = y + rv;
- g = y + guv;
- b = y + bu;
-
- if ((unsigned)(r | g | b) > 64*256-1)
- {
- r = clamp(r, 0, 64*256-1);
- g = clamp(g, 0, 64*256-1);
- b = clamp(b, 0, 64*256-1);
- }
-
- *dst = LCD_RGBPACK_LCD(r >> 9, g >> 8, b >> 9);
-
- #if LCD_WIDTH >= LCD_HEIGHT
- dst++;
- #else
- dst += LCD_WIDTH;
- #endif
- }
- while (dst < row_end);
-
- ysrc += stride;
- usrc += stride >> 1;
- vsrc += stride >> 1;
-
- #if LCD_WIDTH >= LCD_HEIGHT
- row_end += LCD_WIDTH;
- dst += LCD_WIDTH - width;
- #else
- row_end -= 1;
- dst -= LCD_WIDTH*width + 1;
- #endif
- }
- while (--linecounter > 0);
-
- #if LCD_WIDTH >= LCD_HEIGHT
- lcd_update_rect(x, y, width, height);
- #else
- lcd_update_rect(LCD_WIDTH - y - height, x, height, width);
- #endif
-}