1
0
Fork 0
forked from len0rd/rockbox

Use TIME_BEFORE in bench_* plugins, and use 10s test duration.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20983 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Andrew Mahone 2009-05-18 20:21:03 +00:00
parent c8d6a02c5a
commit e631d1fb28
3 changed files with 7 additions and 4 deletions

View file

@ -1,6 +1,7 @@
alpine_cdc,apps alpine_cdc,apps
autostart,apps autostart,apps
battery_bench,apps battery_bench,apps
bench_scaler,apps
blackjack,games blackjack,games
bounce,demos bounce,demos
brickmania,games brickmania,games

View file

@ -119,17 +119,18 @@ enum plugin_status plugin_start(const void* parameter)
&format_null); &format_null);
if (ret == 1) if (ret == 1)
{ {
long t1, t2; long t1, t2, t_end;
int count = 0; int count = 0;
t2 = *(rb->current_tick); t2 = *(rb->current_tick);
while (t2 != (t1 = *(rb->current_tick))); while (t2 != (t1 = *(rb->current_tick)));
t_end = t1 + 10 * HZ;
do { do {
decode_jpeg_mem(jpeg_buf, filesize, &bm, plugin_buf_len, decode_jpeg_mem(jpeg_buf, filesize, &bm, plugin_buf_len,
FORMAT_NATIVE|FORMAT_RESIZE|FORMAT_KEEP_ASPECT, FORMAT_NATIVE|FORMAT_RESIZE|FORMAT_KEEP_ASPECT,
&format_null); &format_null);
count++; count++;
t2 = *(rb->current_tick); t2 = *(rb->current_tick);
} while (t2 - t1 < HZ || count < 10); } while (TIME_BEFORE(t2, t_end) || count < 10);
t2 -= t1; t2 -= t1;
t2 *= 10; t2 *= 10;
t2 += count >> 1; t2 += count >> 1;

View file

@ -109,17 +109,18 @@ enum plugin_status plugin_start(const void* parameter)
if (in == out) if (in == out)
continue; continue;
lcd_printf("timing %dx%d->%dx>%d scale", in, in, out, out); lcd_printf("timing %dx%d->%dx>%d scale", in, in, out, out);
long t1, t2; long t1, t2, t_end;
int count = 0; int count = 0;
t2 = *(rb->current_tick); t2 = *(rb->current_tick);
in_dim.width = in_dim.height = in; in_dim.width = in_dim.height = in;
bm.width = bm.height = rset.rowstop = out; bm.width = bm.height = rset.rowstop = out;
while (t2 != (t1 = *(rb->current_tick))); while (t2 != (t1 = *(rb->current_tick)));
t_end = t1 + 10 * HZ;
do { do {
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); 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);
count++; count++;
t2 = *(rb->current_tick); t2 = *(rb->current_tick);
} while (t2 - t1 < HZ || count < 10); } while (TIME_BEFORE(t2, t_end) || count < 10);
t2 -= t1; t2 -= t1;
t2 *= 10; t2 *= 10;
t2 += count >> 1; t2 += count >> 1;