You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
tests/swscale: print speedup numbers in color
This commit is contained in:
@@ -239,10 +239,17 @@ static int run_test(enum AVPixelFormat src_fmt, enum AVPixelFormat dst_fmt,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (opts.bench && time_ref) {
|
if (opts.bench && time_ref) {
|
||||||
printf(" time=%"PRId64" us, ref=%"PRId64" us, speedup=%.3fx %s\n",
|
double ratio = (double) time_ref / time;
|
||||||
time / opts.iters, time_ref / opts.iters,
|
const char *color = ratio > 1.10 ? "\033[1;32m" : /* bold green */
|
||||||
(double) time_ref / time,
|
ratio > 1.02 ? "\033[32m" : /* green */
|
||||||
time <= time_ref ? "faster" : "\033[1;33mslower\033[0m");
|
ratio > 0.98 ? "" : /* default */
|
||||||
|
ratio > 0.95 ? "\033[33m" : /* yellow */
|
||||||
|
ratio > 0.90 ? "\033[31m" : /* red */
|
||||||
|
"\033[1;31m"; /* bold red */
|
||||||
|
|
||||||
|
printf(" time=%"PRId64" us, ref=%"PRId64" us, speedup=%.3fx %s%s\033[0m\n",
|
||||||
|
time / opts.iters, time_ref / opts.iters, ratio, color,
|
||||||
|
ratio >= 1.0 ? "faster" : "slower");
|
||||||
} else if (opts.bench) {
|
} else if (opts.bench) {
|
||||||
printf(" time=%"PRId64" us\n", time / opts.iters);
|
printf(" time=%"PRId64" us\n", time / opts.iters);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user