summaryrefslogtreecommitdiff
path: root/apps/plugins/mpegplayer
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2008-01-04 23:42:38 +0000
committerJens Arnold <amiconn@rockbox.org>2008-01-04 23:42:38 +0000
commitfeb5b15e9bf9292e3d4d82ea1e01ab3557fb1240 (patch)
treed854c9a6fbbb3263537071fb02df349fdfa62361 /apps/plugins/mpegplayer
parentd3586837fa9221a7ef104550b4c0aadc1a6ea77c (diff)
downloadrockbox-feb5b15e9bf9292e3d4d82ea1e01ab3557fb1240.tar.gz
rockbox-feb5b15e9bf9292e3d4d82ea1e01ab3557fb1240.zip
All-new greyscale library, replacing the old one. Features: (1) Drawing/updating is faster than the old grayscale lib at full depth. (2) Always 129 shades instead of 2..33 shades. (3) No graininess caused by frequent updates (mpegplayer, doom, ...). (4) Needs less memory than the old grayscale lib at full depth. * The tradeoff is slightly higher CPU load in the ISR (frames are calculated 'live') and an extra function in the core. * Ported all plugins which used the graylib to use the new one. * Some slight optimisations for archos and H1x0 LCD update.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15998 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/mpegplayer')
-rw-r--r--apps/plugins/mpegplayer/mpegplayer.c2
-rw-r--r--apps/plugins/mpegplayer/mpegplayer.h12
-rw-r--r--apps/plugins/mpegplayer/stream_mgr.c29
-rw-r--r--apps/plugins/mpegplayer/video_out_rockbox.c2
4 files changed, 21 insertions, 24 deletions
diff --git a/apps/plugins/mpegplayer/mpegplayer.c b/apps/plugins/mpegplayer/mpegplayer.c
index 8ea4ee3abd..48bb73065c 100644
--- a/apps/plugins/mpegplayer/mpegplayer.c
+++ b/apps/plugins/mpegplayer/mpegplayer.c
@@ -868,7 +868,7 @@ static void wvs_refresh(int hint)
868 868
869 vo_unlock(); 869 vo_unlock();
870#else 870#else
871 gray_deferred_lcd_update(); 871 grey_deferred_lcd_update();
872#endif 872#endif
873} 873}
874 874
diff --git a/apps/plugins/mpegplayer/mpegplayer.h b/apps/plugins/mpegplayer/mpegplayer.h
index ae1234d39d..4ebf321fce 100644
--- a/apps/plugins/mpegplayer/mpegplayer.h
+++ b/apps/plugins/mpegplayer/mpegplayer.h
@@ -85,12 +85,12 @@ enum mpeg_malloc_reason_t
85#define GRAY_VIDEO_FLUSH_ICACHE() 85#define GRAY_VIDEO_FLUSH_ICACHE()
86#define GRAY_VIDEO_INVALIDATE_ICACHE() 86#define GRAY_VIDEO_INVALIDATE_ICACHE()
87#else 87#else
88#include "gray.h" 88#include "grey.h"
89#define DRAW_BLACK GRAY_BLACK 89#define DRAW_BLACK GREY_BLACK
90#define DRAW_DARKGRAY GRAY_DARKGRAY 90#define DRAW_DARKGRAY GREY_DARKGRAY
91#define DRAW_LIGHTGRAY GRAY_LIGHTGRAY 91#define DRAW_LIGHTGRAY GREY_LIGHTGRAY
92#define DRAW_WHITE GRAY_WHITE 92#define DRAW_WHITE GREY_WHITE
93#define lcd_(fn) gray_##fn 93#define lcd_(fn) grey_##fn
94 94
95#define GRAY_FLUSH_ICACHE() \ 95#define GRAY_FLUSH_ICACHE() \
96 IF_COP(flush_icache()) 96 IF_COP(flush_icache())
diff --git a/apps/plugins/mpegplayer/stream_mgr.c b/apps/plugins/mpegplayer/stream_mgr.c
index 8d2e42f62b..c473db3ce3 100644
--- a/apps/plugins/mpegplayer/stream_mgr.c
+++ b/apps/plugins/mpegplayer/stream_mgr.c
@@ -20,7 +20,7 @@
20 ****************************************************************************/ 20 ****************************************************************************/
21#include "plugin.h" 21#include "plugin.h"
22#include "mpegplayer.h" 22#include "mpegplayer.h"
23#include "gray.h" 23#include "grey.h"
24#include "mpeg_settings.h" 24#include "mpeg_settings.h"
25 25
26static struct event_queue stream_mgr_queue NOCACHEBSS_ATTR; 26static struct event_queue stream_mgr_queue NOCACHEBSS_ATTR;
@@ -712,7 +712,7 @@ bool stream_show_vo(bool show)
712 GRAY_VIDEO_INVALIDATE_ICACHE(); 712 GRAY_VIDEO_INVALIDATE_ICACHE();
713 GRAY_INVALIDATE_ICACHE(); 713 GRAY_INVALIDATE_ICACHE();
714 714
715 gray_show(show); 715 grey_show(show);
716 716
717 GRAY_FLUSH_ICACHE(); 717 GRAY_FLUSH_ICACHE();
718#endif 718#endif
@@ -801,11 +801,10 @@ bool stream_set_gray_rect(const struct vo_rect *rc)
801 801
802 vo_lock(); 802 vo_lock();
803 803
804 gray_init(rb, stream_mgr.graymem, stream_mgr.graysize, 804 grey_init(rb, stream_mgr.graymem, stream_mgr.graysize, false,
805 false, rc_gray.r - rc_gray.l, rc_gray.b - rc_gray.t, 805 rc_gray.r - rc_gray.l, rc_gray.b - rc_gray.t, NULL);
806 32, 2<<8, NULL);
807 806
808 gray_set_position(rc_gray.l, rc_gray.t); 807 grey_set_position(rc_gray.l, rc_gray.t);
809 808
810 vo_unlock(); 809 vo_unlock();
811 810
@@ -818,7 +817,7 @@ bool stream_set_gray_rect(const struct vo_rect *rc)
818 817
819 if (vis) 818 if (vis)
820 { 819 {
821 gray_show(true); 820 grey_show(true);
822 parser_send_video_msg(VIDEO_DISPLAY_SHOW, true); 821 parser_send_video_msg(VIDEO_DISPLAY_SHOW, true);
823 } 822 }
824 } 823 }
@@ -836,7 +835,7 @@ void stream_gray_show(bool show)
836 GRAY_VIDEO_INVALIDATE_ICACHE(); 835 GRAY_VIDEO_INVALIDATE_ICACHE();
837 GRAY_INVALIDATE_ICACHE(); 836 GRAY_INVALIDATE_ICACHE();
838 837
839 gray_show(show); 838 grey_show(show);
840 839
841 GRAY_FLUSH_ICACHE(); 840 GRAY_FLUSH_ICACHE();
842 841
@@ -1095,16 +1094,14 @@ int stream_init(void)
1095 1094
1096 /* Initialize non-allocator blocks first */ 1095 /* Initialize non-allocator blocks first */
1097#ifndef HAVE_LCD_COLOR 1096#ifndef HAVE_LCD_COLOR
1098 int grayscales; 1097 bool success;
1099 1098
1100 /* This can run on another processor - align data */ 1099 /* This can run on another processor - align data */
1101 memsize = CACHEALIGN_BUFFER(&mem, memsize); 1100 memsize = CACHEALIGN_BUFFER(&mem, memsize);
1102 stream_mgr.graymem = mem; 1101 stream_mgr.graymem = mem;
1103 1102
1104 /* initialize the grayscale buffer: 32 bitplanes for 33 shades of gray. */ 1103 success = grey_init(rb, mem, memsize, false, LCD_WIDTH,
1105 grayscales = gray_init(rb, mem, memsize, false, 1104 LCD_HEIGHT, &stream_mgr.graysize);
1106 LCD_WIDTH, LCD_HEIGHT,
1107 32, 2<<8, &stream_mgr.graysize) + 1;
1108 1105
1109 /* This can run on another processor - align size */ 1106 /* This can run on another processor - align size */
1110 stream_mgr.graysize = CACHEALIGN_UP(stream_mgr.graysize); 1107 stream_mgr.graysize = CACHEALIGN_UP(stream_mgr.graysize);
@@ -1112,9 +1109,9 @@ int stream_init(void)
1112 mem += stream_mgr.graysize; 1109 mem += stream_mgr.graysize;
1113 memsize -= stream_mgr.graysize; 1110 memsize -= stream_mgr.graysize;
1114 1111
1115 if (grayscales < 33 || (ssize_t)memsize <= 0) 1112 if (!success || (ssize_t)memsize <= 0)
1116 { 1113 {
1117 rb->splash(HZ, "graylib init failed!"); 1114 rb->splash(HZ, "greylib init failed!");
1118 stream_mgr.graymem = NULL; 1115 stream_mgr.graymem = NULL;
1119 return STREAM_ERROR; 1116 return STREAM_ERROR;
1120 } 1117 }
@@ -1188,6 +1185,6 @@ void stream_exit(void)
1188 1185
1189#ifndef HAVE_LCD_COLOR 1186#ifndef HAVE_LCD_COLOR
1190 if (stream_mgr.graymem != NULL) 1187 if (stream_mgr.graymem != NULL)
1191 gray_release(); 1188 grey_release();
1192#endif 1189#endif
1193} 1190}
diff --git a/apps/plugins/mpegplayer/video_out_rockbox.c b/apps/plugins/mpegplayer/video_out_rockbox.c
index 39d0e82c3b..12431bef4a 100644
--- a/apps/plugins/mpegplayer/video_out_rockbox.c
+++ b/apps/plugins/mpegplayer/video_out_rockbox.c
@@ -107,7 +107,7 @@ static inline void yuv_blit(uint8_t * const * buf, int src_x, int src_y,
107#ifdef HAVE_LCD_COLOR 107#ifdef HAVE_LCD_COLOR
108 rb->lcd_yuv_blit(buf, src_x, src_y, stride, x, y , width, height); 108 rb->lcd_yuv_blit(buf, src_x, src_y, stride, x, y , width, height);
109#else 109#else
110 gray_ub_gray_bitmap_part(buf[0], src_x, src_y, stride, x, y, width, height); 110 grey_ub_gray_bitmap_part(buf[0], src_x, src_y, stride, x, y, width, height);
111#endif 111#endif
112 112
113 video_unlock(); 113 video_unlock();