From f8b1da2f7bddebc9c7026bd5d106dec118ce70a9 Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Sat, 4 Nov 2006 00:42:18 +0000 Subject: H300, X5: Faster lcd_yuv_blit() using EMAC. Speedup of the function itself at 124MHz: 10.5% on X5, 16.5% on H300. mpegplayer speedup 3..4% git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11429 a1c6a512-1295-4272-9138-f99709370657 --- firmware/drivers/lcd-h300.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'firmware/drivers/lcd-h300.c') diff --git a/firmware/drivers/lcd-h300.c b/firmware/drivers/lcd-h300.c index b7865fa7c5..3e5642e35d 100644 --- a/firmware/drivers/lcd-h300.c +++ b/firmware/drivers/lcd-h300.c @@ -304,10 +304,11 @@ void lcd_blit(const fb_data* data, int x, int by, int width, /* Line write helper function for lcd_yuv_blit. Write two lines of yuv420. * y should have two lines of Y back to back. * bu and rv should contain the Cb and Cr data for the two lines of Y. - * Stores bu, guv and rv in repective buffers for use in second line. + * Needs EMAC set to saturated, signed integer mode. */ extern void lcd_write_yuv420_lines(const unsigned char *y, - unsigned char *bu, unsigned char *guv, unsigned char *rv, int width); + const unsigned char *bu, + const unsigned char *rv, int width); /* Performance function to blit a YUV bitmap directly to the LCD * src_x, src_y, width and height should be even @@ -317,10 +318,9 @@ void lcd_yuv_blit(unsigned char * const src[3], int src_x, int src_y, int stride, int x, int y, int width, int height) { - /* IRAM Y, Cb/bu, guv and Cb/rv buffers. */ + /* IRAM Y, Cb and Cb buffers. */ unsigned char y_ibuf[LCD_WIDTH*2]; unsigned char bu_ibuf[LCD_WIDTH/2]; - unsigned char guv_ibuf[LCD_WIDTH/2]; unsigned char rv_ibuf[LCD_WIDTH/2]; const unsigned char *ysrc, *usrc, *vsrc; const unsigned char *ysrc_max; @@ -342,13 +342,14 @@ void lcd_yuv_blit(unsigned char * const src[3], vsrc = src[2] + (src_y * stride >> 2) + (src_x >> 1); ysrc_max = ysrc + height * stride; + coldfire_set_macsr(EMAC_SATURATE); do { memcpy(y_ibuf, ysrc, width); memcpy(y_ibuf + width, ysrc + stride, width); memcpy(bu_ibuf, usrc, width >> 1); memcpy(rv_ibuf, vsrc, width >> 1); - lcd_write_yuv420_lines(y_ibuf, bu_ibuf, guv_ibuf, rv_ibuf, width); + lcd_write_yuv420_lines(y_ibuf, bu_ibuf, rv_ibuf, width); ysrc += 2 * stride; usrc += stride >> 1; vsrc += stride >> 1; @@ -381,6 +382,7 @@ void lcd_update(void) } } + /* Update a fraction of the display. */ void lcd_update_rect(int, int, int, int) ICODE_ATTR; void lcd_update_rect(int x, int y, int width, int height) -- cgit v1.2.3