diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/plugins/CATEGORIES | 1 | ||||
-rw-r--r-- | apps/plugins/bench_mem_jpeg.c | 5 | ||||
-rw-r--r-- | apps/plugins/bench_scaler.c | 5 |
3 files changed, 7 insertions, 4 deletions
diff --git a/apps/plugins/CATEGORIES b/apps/plugins/CATEGORIES index bf49c8afca..c7cdd3fe53 100644 --- a/apps/plugins/CATEGORIES +++ b/apps/plugins/CATEGORIES | |||
@@ -1,6 +1,7 @@ | |||
1 | alpine_cdc,apps | 1 | alpine_cdc,apps |
2 | autostart,apps | 2 | autostart,apps |
3 | battery_bench,apps | 3 | battery_bench,apps |
4 | bench_scaler,apps | ||
4 | blackjack,games | 5 | blackjack,games |
5 | bounce,demos | 6 | bounce,demos |
6 | brickmania,games | 7 | brickmania,games |
diff --git a/apps/plugins/bench_mem_jpeg.c b/apps/plugins/bench_mem_jpeg.c index cd7dea356e..5169286fe3 100644 --- a/apps/plugins/bench_mem_jpeg.c +++ b/apps/plugins/bench_mem_jpeg.c | |||
@@ -119,17 +119,18 @@ enum plugin_status plugin_start(const void* parameter) | |||
119 | &format_null); | 119 | &format_null); |
120 | if (ret == 1) | 120 | if (ret == 1) |
121 | { | 121 | { |
122 | long t1, t2; | 122 | long t1, t2, t_end; |
123 | int count = 0; | 123 | int count = 0; |
124 | t2 = *(rb->current_tick); | 124 | t2 = *(rb->current_tick); |
125 | while (t2 != (t1 = *(rb->current_tick))); | 125 | while (t2 != (t1 = *(rb->current_tick))); |
126 | t_end = t1 + 10 * HZ; | ||
126 | do { | 127 | do { |
127 | decode_jpeg_mem(jpeg_buf, filesize, &bm, plugin_buf_len, | 128 | decode_jpeg_mem(jpeg_buf, filesize, &bm, plugin_buf_len, |
128 | FORMAT_NATIVE|FORMAT_RESIZE|FORMAT_KEEP_ASPECT, | 129 | FORMAT_NATIVE|FORMAT_RESIZE|FORMAT_KEEP_ASPECT, |
129 | &format_null); | 130 | &format_null); |
130 | count++; | 131 | count++; |
131 | t2 = *(rb->current_tick); | 132 | t2 = *(rb->current_tick); |
132 | } while (t2 - t1 < HZ || count < 10); | 133 | } while (TIME_BEFORE(t2, t_end) || count < 10); |
133 | t2 -= t1; | 134 | t2 -= t1; |
134 | t2 *= 10; | 135 | t2 *= 10; |
135 | t2 += count >> 1; | 136 | t2 += count >> 1; |
diff --git a/apps/plugins/bench_scaler.c b/apps/plugins/bench_scaler.c index 723e427aa7..c24807dad6 100644 --- a/apps/plugins/bench_scaler.c +++ b/apps/plugins/bench_scaler.c | |||
@@ -109,17 +109,18 @@ enum plugin_status plugin_start(const void* parameter) | |||
109 | if (in == out) | 109 | if (in == out) |
110 | continue; | 110 | continue; |
111 | lcd_printf("timing %dx%d->%dx>%d scale", in, in, out, out); | 111 | lcd_printf("timing %dx%d->%dx>%d scale", in, in, out, out); |
112 | long t1, t2; | 112 | long t1, t2, t_end; |
113 | int count = 0; | 113 | int count = 0; |
114 | t2 = *(rb->current_tick); | 114 | t2 = *(rb->current_tick); |
115 | in_dim.width = in_dim.height = in; | 115 | in_dim.width = in_dim.height = in; |
116 | bm.width = bm.height = rset.rowstop = out; | 116 | bm.width = bm.height = rset.rowstop = out; |
117 | while (t2 != (t1 = *(rb->current_tick))); | 117 | while (t2 != (t1 = *(rb->current_tick))); |
118 | t_end = t1 + 10 * HZ; | ||
118 | do { | 119 | do { |
119 | resize_on_load(&bm, false, &in_dim, &rset, (unsigned char *)plugin_buf, plugin_buf_len, &format_null, IF_PIX_FMT(0,) store_part_null, NULL); | 120 | resize_on_load(&bm, false, &in_dim, &rset, (unsigned char *)plugin_buf, plugin_buf_len, &format_null, IF_PIX_FMT(0,) store_part_null, NULL); |
120 | count++; | 121 | count++; |
121 | t2 = *(rb->current_tick); | 122 | t2 = *(rb->current_tick); |
122 | } while (t2 - t1 < HZ || count < 10); | 123 | } while (TIME_BEFORE(t2, t_end) || count < 10); |
123 | t2 -= t1; | 124 | t2 -= t1; |
124 | t2 *= 10; | 125 | t2 *= 10; |
125 | t2 += count >> 1; | 126 | t2 += count >> 1; |