summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Koleszar <jkoleszar@google.com>2010-10-21 17:28:34 -0400
committerJohn Koleszar <jkoleszar@google.com>2010-10-25 22:22:40 -0400
commit5d12e04d16f6127c66b54a1a62b9192b9d880f54 (patch)
tree84448abd22c94f0378adda15acb0e0fe43cf1c3b
parentdea6193d093df79a191350fedf52577d2e269804 (diff)
downloadlibvpx-5d12e04d16f6127c66b54a1a62b9192b9d880f54.tar.gz
vpxdec: use the same output for --progress and --summary
Update the timing information in-place for the --progress option. Change-Id: I8efea57050db72963c0bc5c994425e7e692d1502
-rw-r--r--vpxdec.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/vpxdec.c b/vpxdec.c
index 0de072e8b..2d96b28b6 100644
--- a/vpxdec.c
+++ b/vpxdec.c
@@ -577,6 +577,15 @@ fail:
return 0;
}
+
+void show_progress(int frame_in, int frame_out, unsigned long dx_time)
+{
+ fprintf(stderr, "%d decoded frames/%d showed frames in %lu us (%.2f fps)\r",
+ frame_in, frame_out, dx_time,
+ (float)frame_out * 1000000.0 / (float)dx_time);
+}
+
+
int main(int argc, const char **argv_)
{
vpx_codec_ctx_t decoder;
@@ -812,12 +821,12 @@ int main(int argc, const char **argv_)
++frame_in;
- if (progress)
- fprintf(stderr, "decoded frame %d.\n", frame_in);
-
if ((img = vpx_codec_get_frame(&decoder, &iter)))
++frame_out;
+ if (progress)
+ show_progress(frame_in, frame_out, dx_time);
+
if (!noblit)
{
if (img)
@@ -869,10 +878,10 @@ int main(int argc, const char **argv_)
break;
}
- if (summary)
+ if (summary || progress)
{
- fprintf(stderr, "%d decoded frames/%d showed frames in %lu us (%.2f fps)\n",
- frame_in, frame_out, dx_time, (float)frame_out * 1000000.0 / (float)dx_time);
+ show_progress(frame_in, frame_out, dx_time);
+ fprintf(stderr, "\n");
}
fail: