Index: firmware/target/arm/lcd-as-memframe.S =================================================================== --- firmware/target/arm/lcd-as-memframe.S (revision 17990) +++ firmware/target/arm/lcd-as-memframe.S (working copy) @@ -189,7 +189,10 @@ @ 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 @@ @ 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 @@ @ 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 @@ @ 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 @@ 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 @@ 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 @@ 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 @@ 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 @ Index: apps/plugins/mpegplayer/mpeg_settings.h =================================================================== --- apps/plugins/mpegplayer/mpeg_settings.h (revision 17990) +++ apps/plugins/mpegplayer/mpeg_settings.h (working copy) @@ -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 Index: apps/plugin.c =================================================================== --- apps/plugin.c (revision 17990) +++ apps/plugin.c (working copy) @@ -120,7 +120,7 @@ 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) Index: apps/plugin.h =================================================================== --- apps/plugin.h (revision 17990) +++ apps/plugin.h (working copy) @@ -206,7 +206,7 @@ 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 @@ 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 Index: firmware/target/arm/tcc780x/cowond2/lcd-cowond2.c =================================================================== --- firmware/target/arm/tcc780x/cowond2/lcd-cowond2.c (revision 18000) +++ firmware/target/arm/tcc780x/cowond2/lcd-cowond2.c (working copy) @@ -359,88 +359,11 @@ } /* 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]; +extern void lcd_write_yuv420_lines(fb_data *dst, + unsigned char const * const src[3], + int width, + int stride); - 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_odither(fb_data *dst, unsigned char const * const src[3], int width,