diff options
| author | Michael Sevakis <jethead71@rockbox.org> | 2007-04-24 03:38:19 +0000 |
|---|---|---|
| committer | Michael Sevakis <jethead71@rockbox.org> | 2007-04-24 03:38:19 +0000 |
| commit | 72e6dd5e0c5bb9fc0b2de176adb98dce43c273be (patch) | |
| tree | 5ae6adc43b5ae717d02d6102e7b11c20015846bc /apps/plugins | |
| parent | 0d032d1fa1a6b1aa45515bc96a66918f4a7b45f1 (diff) | |
| download | rockbox-72e6dd5e0c5bb9fc0b2de176adb98dce43c273be.zip rockbox-72e6dd5e0c5bb9fc0b2de176adb98dce43c273be.tar.gz rockbox-72e6dd5e0c5bb9fc0b2de176adb98dce43c273be.tar.bz2 rockbox-72e6dd5e0c5bb9fc0b2de176adb98dce43c273be.tar.xz | |
Do the clamping a little better.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13254 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins')
| -rw-r--r-- | apps/plugins/mpegplayer/video_out_rockbox.c | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/apps/plugins/mpegplayer/video_out_rockbox.c b/apps/plugins/mpegplayer/video_out_rockbox.c index b55ca8c..b57f77b 100644 --- a/apps/plugins/mpegplayer/video_out_rockbox.c +++ b/apps/plugins/mpegplayer/video_out_rockbox.c @@ -31,9 +31,6 @@ extern struct plugin_api* rb; #include "mpeg2.h" #include "video_out.h" -#define CSUB_X 2 -#define CSUB_Y 2 - static int image_width; static int image_height; static int image_chroma_x; @@ -119,11 +116,11 @@ static void yuv_bitmap_part(unsigned char * const src[3], g = y + guv; b = y + bu; - if ((unsigned)(r | g | b) > 63*256) + if ((unsigned)(r | g | b) > 64*256-1) { - r = clamp(r, 0, 63*256); - g = clamp(g, 0, 63*256); - b = clamp(b, 0, 63*256); + r = clamp(r, 0, 64*256-1); + g = clamp(g, 0, 64*256-1); + b = clamp(b, 0, 64*256-1); } *dst = LCD_RGBPACK_LCD(r >> 9, g >> 8, b >> 9); @@ -139,11 +136,11 @@ static void yuv_bitmap_part(unsigned char * const src[3], g = y + guv; b = y + bu; - if ((unsigned)(r | g | b) > 63*256) + if ((unsigned)(r | g | b) > 64*256-1) { - r = clamp(r, 0, 63*256); - g = clamp(g, 0, 63*256); - b = clamp(b, 0, 63*256); + r = clamp(r, 0, 64*256-1); + g = clamp(g, 0, 64*256-1); + b = clamp(b, 0, 64*256-1); } *dst = LCD_RGBPACK_LCD(r >> 9, g >> 8, b >> 9); @@ -184,11 +181,11 @@ static void yuv_bitmap_part(unsigned char * const src[3], g = y + guv; b = y + bu; - if ((unsigned)(r | g | b) > 63*256) + if ((unsigned)(r | g | b) > 64*256-1) { - r = clamp(r, 0, 63*256); - g = clamp(g, 0, 63*256); - b = clamp(b, 0, 63*256); + r = clamp(r, 0, 64*256-1); + g = clamp(g, 0, 64*256-1); + b = clamp(b, 0, 64*256-1); } *dst = LCD_RGBPACK_LCD(r >> 9, g >> 8, b >> 9); @@ -204,11 +201,11 @@ static void yuv_bitmap_part(unsigned char * const src[3], g = y + guv; b = y + bu; - if ((unsigned)(r | g | b) > 63*256) + if ((unsigned)(r | g | b) > 64*256-1) { - r = clamp(r, 0, 63*256); - g = clamp(g, 0, 63*256); - b = clamp(b, 0, 63*256); + r = clamp(r, 0, 64*256-1); + g = clamp(g, 0, 64*256-1); + b = clamp(b, 0, 64*256-1); } *dst = LCD_RGBPACK_LCD(r >> 9, g >> 8, b >> 9); |