diff options
Diffstat (limited to 'firmware/target/arm/tcc780x/cowond2/lcd-cowond2.c')
-rw-r--r-- | firmware/target/arm/tcc780x/cowond2/lcd-cowond2.c | 87 |
1 files changed, 5 insertions, 82 deletions
diff --git a/firmware/target/arm/tcc780x/cowond2/lcd-cowond2.c b/firmware/target/arm/tcc780x/cowond2/lcd-cowond2.c index 48ae99ddcd..70d823a25b 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, |