remove the dependency to stop_watch.[ch] in imageio

Passing the 'verbose' flag to DecodeWebP() wasn't mandated,
and was creating a forced dependency between imageio/ and examples/

Change-Id: Ib3d3f381a7b699df369a97cfb44360580422df11
This commit is contained in:
Pascal Massimino
2016-12-12 22:01:36 +01:00
parent fbba5bc2c1
commit cb215aed5c
3 changed files with 20 additions and 34 deletions

View File

@ -366,10 +366,19 @@ int main(int argc, const char *argv[]) {
if (external_buffer == NULL) goto Exit;
}
if (incremental) {
status = DecodeWebPIncremental(data, data_size, verbose, &config);
} else {
status = DecodeWebP(data, data_size, verbose, &config);
{
Stopwatch stop_watch;
if (verbose) StopwatchReset(&stop_watch);
if (incremental) {
status = DecodeWebPIncremental(data, data_size, &config);
} else {
status = DecodeWebP(data, data_size, &config);
}
if (verbose) {
const double decode_time = StopwatchReadAndReset(&stop_watch);
fprintf(stderr, "Time to decode picture: %.3fs\n", decode_time);
}
}
ok = (status == VP8_STATUS_OK);