1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Rob Purchase 2008-07-15 17:54:58 +00:00
parent bda60d18d8
commit adb6a00c59
5 changed files with 47 additions and 92 deletions

View file

@ -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)

View file

@ -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)

View file

@ -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

View file

@ -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,11 +298,18 @@ 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
@ -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,11 +600,17 @@ 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

View file

@ -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,
extern 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];
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,