diff options
| author | Rob Purchase <shotofadds@rockbox.org> | 2008-07-15 17:54:58 +0000 |
|---|---|---|
| committer | Rob Purchase <shotofadds@rockbox.org> | 2008-07-15 17:54:58 +0000 |
| commit | adb6a00c59371e202edba06d19f950f422b688ee (patch) | |
| tree | e852e9340d9d3a567467bc8ded6b55b64820b316 | |
| parent | bda60d18d8d2cc48eb39b37665809abb31116b55 (diff) | |
| download | rockbox-adb6a00c59371e202edba06d19f950f422b688ee.zip rockbox-adb6a00c59371e202edba06d19f950f422b688ee.tar.gz rockbox-adb6a00c59371e202edba06d19f950f422b688ee.tar.bz2 rockbox-adb6a00c59371e202edba06d19f950f422b688ee.tar.xz | |
Update lcd-as-memframe.S to only rotate YUV data for portrait LCDs (and remove the D2's temporary C implementation). Enable MpegPlayer dithering option for D2.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18055 a1c6a512-1295-4272-9138-f99709370657
| -rw-r--r-- | apps/plugin.c | 2 | ||||
| -rw-r--r-- | apps/plugin.h | 4 | ||||
| -rw-r--r-- | apps/plugins/mpegplayer/mpeg_settings.h | 2 | ||||
| -rw-r--r-- | firmware/target/arm/lcd-as-memframe.S | 46 | ||||
| -rw-r--r-- | firmware/target/arm/tcc780x/cowond2/lcd-cowond2.c | 87 |
5 files changed, 48 insertions, 93 deletions
diff --git a/apps/plugin.c b/apps/plugin.c index b864170..a220e8c 100644 --- a/apps/plugin.c +++ b/apps/plugin.c @@ -120,7 +120,7 @@ static const struct plugin_api rockbox_api = { lcd_bitmap_transparent, lcd_blit_yuv, #if defined(TOSHIBA_GIGABEAT_F) || defined(SANSA_E200) || defined(SANSA_C200) \ - || defined (IRIVER_H10) + || defined(IRIVER_H10) || defined(COWON_D2) lcd_yuv_set_options, #endif #elif (LCD_DEPTH < 4) && !defined(SIMULATOR) diff --git a/apps/plugin.h b/apps/plugin.h index dfe7463..3ffaafc 100644 --- a/apps/plugin.h +++ b/apps/plugin.h @@ -206,7 +206,7 @@ struct plugin_api { int src_x, int src_y, int stride, int x, int y, int width, int height); #if defined(TOSHIBA_GIGABEAT_F) || defined(SANSA_E200) || defined(SANSA_C200) \ - || defined (IRIVER_H10) + || defined(IRIVER_H10) || defined(COWON_D2) void (*lcd_yuv_set_options)(unsigned options); #endif #elif (LCD_DEPTH < 4) && !defined(SIMULATOR) @@ -395,7 +395,7 @@ struct plugin_api { size_t stack_size, unsigned flags, const char *name IF_PRIO(, int priority) - IF_COP(, unsigned int core)); + IF_COP(, unsigned int core)); void (*thread_exit)(void); void (*thread_wait)(struct thread_entry *thread); #if CONFIG_CODEC == SWCODEC diff --git a/apps/plugins/mpegplayer/mpeg_settings.h b/apps/plugins/mpegplayer/mpeg_settings.h index d00dc19..71c6db5 100644 --- a/apps/plugins/mpegplayer/mpeg_settings.h +++ b/apps/plugins/mpegplayer/mpeg_settings.h @@ -6,7 +6,7 @@ #define SETTINGS_FILENAME "mpegplayer.cfg" #if defined(TOSHIBA_GIGABEAT_F) || defined(SANSA_E200) || defined(SANSA_C200) \ - || defined (IRIVER_H10) + || defined(IRIVER_H10) || defined(COWON_D2) #define MPEG_OPTION_DITHERING_ENABLED 1 #endif diff --git a/firmware/target/arm/lcd-as-memframe.S b/firmware/target/arm/lcd-as-memframe.S index 1cd27bd..519a8a1 100644 --- a/firmware/target/arm/lcd-as-memframe.S +++ b/firmware/target/arm/lcd-as-memframe.S @@ -189,7 +189,10 @@ lcd_write_yuv420_lines: @ orr r1, r1, r7, lsl #5 @ r4 |= (g << 5) orr r1, r1, r11, lsl #11 @ r4 = b | (r << 11) -#if LCD_WIDTH < 256 + +#if LCD_WIDTH >= LCD_HEIGHT + strh r1, [r0] @ +#elif LCD_WIDTH < 256 strh r1, [r0], #LCD_WIDTH @ store pixel #else strh r1, [r0] @ @@ -222,7 +225,12 @@ lcd_write_yuv420_lines: @ orr r1, r1, r11, lsl #11 @ r1 = b | (r << 11) orr r1, r1, r7, lsl #5 @ r1 |= (g << 5) -#if LCD_WIDTH < 256 + +#if LCD_WIDTH >= LCD_HEIGHT + add r0, r0, #2*LCD_WIDTH @ + strh r1, [r0] @ store pixel + sub r0, r0, #2*LCD_WIDTH @ +#elif LCD_WIDTH < 256 strh r1, [r0, #-LCD_WIDTH-2] @ store pixel #else strh r1, [r0, #-2] @ @@ -256,7 +264,10 @@ lcd_write_yuv420_lines: @ orr r1, r1, r7, lsl #5 @ r1 = b | (g << 5) orr r1, r1, r11, lsl #11 @ r1 |= (r << 11) -#if LCD_WIDTH < 256 + +#if LCD_WIDTH >= LCD_HEIGHT + strh r1, [r0, #2] +#elif LCD_WIDTH < 256 strh r1, [r0, #LCD_WIDTH]! @ store pixel #else strh r1, [r0] @ @@ -287,12 +298,19 @@ lcd_write_yuv420_lines: @ orr r12, r1, r11, lsl #11 @ r12 = b | (r << 11) orr r12, r12, r7, lsl #5 @ r12 |= (g << 5) + +#if LCD_WIDTH >= LCD_HEIGHT + add r0, r0, #2*LCD_WIDTH + strh r12, [r0, #2] + sub r0, r0, #(2*LCD_WIDTH)-4 +#else strh r12, [r0, #-2] @ store pixel #if LCD_WIDTH < 256 add r0, r0, #2*LCD_WIDTH @ #else add r0, r0, #LCD_WIDTH @ #endif +#endif @ subs r2, r2, #2 @ subtract block from width bgt 10b @ loop line @ @@ -423,7 +441,9 @@ lcd_write_yuv420_lines_odither: orr r11, r11, r7, lsr #4 @ ((g & 0x7e00) >> 4) | orr r1, r11, r1, lsr #10 @ (b >> 10) @ -#if LCD_WIDTH < 256 +#if LCD_WIDTH >= LCD_HEIGHT + strh r1, [r0] @ +#elif LCD_WIDTH < 256 strh r1, [r0], #LCD_WIDTH @ store pixel #else strh r1, [r0] @ @@ -473,7 +493,11 @@ lcd_write_yuv420_lines_odither: orr r11, r11, r7, lsr #4 @ ((g & 0x7e00) >> 4) | orr r1, r11, r1, lsr #10 @ (b >> 10) @ -#if LCD_WIDTH < 256 +#if LCD_WIDTH >= LCD_HEIGHT + add r0, r0, #2*LCD_WIDTH @ + strh r1, [r0] @ store pixel + sub r0, r0, #2*LCD_WIDTH @ +#elif LCD_WIDTH < 256 strh r1, [r0, #-LCD_WIDTH-2] @ store pixel #else strh r1, [r0, #-2] @ store pixel @@ -526,12 +550,14 @@ lcd_write_yuv420_lines_odither: orr r11, r11, r7, lsr #4 @ ((g & 0x7e00) >> 4) | orr r1, r11, r1, lsr #10 @ (b >> 10) @ -#if LCD_WIDTH < 256 +#if LCD_WIDTH >= LCD_HEIGHT + strh r1, [r0, #2] +#elif LCD_WIDTH < 256 strh r1, [r0, #LCD_WIDTH]! @ store pixel #else strh r1, [r0] @ #endif - @ + sub r7, r12, #16 @ r7 = Y = (Y' - 16)*149 add r12, r7, r7, asl #2 @ add r12, r12, r12, asl #4 @ @@ -574,12 +600,18 @@ lcd_write_yuv420_lines_odither: orr r11, r11, r7, lsr #4 @ ((g & 0x7e00) >> 4) | orr r1, r11, r1, lsr #10 @ (b >> 10) @ +#if LCD_WIDTH >= LCD_HEIGHT + add r0, r0, #2*LCD_WIDTH + strh r1, [r0, #2] @ store pixel + sub r0, r0, #(2*LCD_WIDTH-4) +#else strh r1, [r0, #-2] @ store pixel #if LCD_WIDTH < 256 add r0, r0, #2*LCD_WIDTH @ #else add r0, r0, #LCD_WIDTH @ #endif +#endif @ subs r2, r2, #2 @ subtract block from width bgt 10b @ loop line @ diff --git a/firmware/target/arm/tcc780x/cowond2/lcd-cowond2.c b/firmware/target/arm/tcc780x/cowond2/lcd-cowond2.c index 48ae99d..70d823a 100644 --- a/firmware/target/arm/tcc780x/cowond2/lcd-cowond2.c +++ b/firmware/target/arm/tcc780x/cowond2/lcd-cowond2.c @@ -359,88 +359,11 @@ void lcd_yuv_set_options(unsigned options) } /* Line write helper function for lcd_yuv_blit. Write two lines of yuv420. */ -static void lcd_write_yuv420_lines(fb_data *dst, - unsigned char const * const src[3], - int width, - int stride) -{ - int i = 0; - int y; - int rv, guv, bu; - int cb, cr; - int r, g, b; - unsigned const char *y_p = src[0]; - - for (i = 0; i < width/2; i++) - { - y_p++; - - /* YCbCr -> RGB conversion */ - cb = src[1][i] - 128; - cr = src[2][i] - 128; - - rv = (cr*101 + 56) >> 9; - guv = (128 - cr*51 + cb*24) >> 8; - bu = (cb*128 + 256) >> 9; - - y = (*y_p - 16)*74; - r = (y >> 9) + rv; - g = (y >> 8) + guv; - b = (y >> 9) + bu; - if (r < 0) r = 0; - else if (r > 31) r = 31; - if (g < 0) g = 0; - else if (g > 63) g = 63; - if (b < 0) b = 0; - else if (b > 31) b = 31; - - dst[i*2] = (r << 11) | (g << 5) | b; - - /* YCbCr -> RGB conversion */ - y = (*(y_p+stride) - 16)*74; - r = (y >> 9) + rv; - g = (y >> 8) + guv; - b = (y >> 9) + bu; - if (r < 0) r = 0; - else if (r > 31) r = 31; - if (g < 0) g = 0; - else if (g > 63) g = 63; - if (b < 0) b = 0; - else if (b > 31) b = 31; - - dst[i*2+LCD_FBWIDTH] = (r << 11) | (g << 5) | b; - - y_p++; - - /* YCbCr -> RGB conversion */ - y = (*y_p - 16)*74; - r = (y >> 9) + rv; - g = (y >> 8) + guv; - b = (y >> 9) + bu; - if (r < 0) r = 0; - else if (r > 31) r = 31; - if (g < 0) g = 0; - else if (g > 63) g = 63; - if (b < 0) b = 0; - else if (b > 31) b = 31; - - dst[i*2+1] = (r << 11) | (g << 5) | b; - - /* YCbCr -> RGB conversion */ - y = (*(y_p+stride) - 16)*74; - r = (y >> 9) + rv; - g = (y >> 8) + guv; - b = (y >> 9) + bu; - if (r < 0) r = 0; - else if (r > 31) r = 31; - if (g < 0) g = 0; - else if (g > 63) g = 63; - if (b < 0) b = 0; - else if (b > 31) b = 31; - - dst[i*2+1+LCD_FBWIDTH] = (r << 11) | (g << 5) | b; - } -} +extern void lcd_write_yuv420_lines(fb_data *dst, + unsigned char const * const src[3], + int width, + int stride); + extern void lcd_write_yuv420_lines_odither(fb_data *dst, unsigned char const * const src[3], int width, |