diff options
author | John Koleszar <jkoleszar@google.com> | 2013-02-27 11:14:23 -0800 |
---|---|---|
committer | John Koleszar <jkoleszar@google.com> | 2013-02-27 12:29:25 -0800 |
commit | ebf8b9fc6d4dce95afd41b43ca356b6a0c1ee6d4 (patch) | |
tree | 9f946d0e51b7453a18accc5a5203315b9ac523de /vpxenc.c | |
parent | 350ba5f30e194ee4542b7f92c7979bd2f93e405e (diff) | |
download | libvpx-ebf8b9fc6d4dce95afd41b43ca356b6a0c1ee6d4.tar libvpx-ebf8b9fc6d4dce95afd41b43ca356b6a0c1ee6d4.tar.gz libvpx-ebf8b9fc6d4dce95afd41b43ca356b6a0c1ee6d4.tar.bz2 libvpx-ebf8b9fc6d4dce95afd41b43ca356b6a0c1ee6d4.zip |
Fix rollover and pass 1 time estimate
Fixes a rollover of the cx_time variable for encodes that take
over ~4200 seconds. Also enable the time estimate in first pass.
Change-Id: Ib5a98ee71bccd79a804d709cec7260651d0b7141
Diffstat (limited to 'vpxenc.c')
-rw-r--r-- | vpxenc.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -2450,7 +2450,7 @@ int main(int argc, const char **argv_) { struct global_config global; struct stream_state *streams = NULL; char **argv, **argi; - unsigned long cx_time = 0; + uint64_t cx_time = 0; int stream_cnt = 0; int res = 0; @@ -2587,7 +2587,7 @@ int main(int argc, const char **argv_) { else fprintf(stderr, "frame %4d ", frames_in); - fprintf(stderr, "%7lu %s %.2f %s ", + fprintf(stderr, "%7"PRId64" %s %.2f %s ", cx_time > 9999999 ? cx_time / 1000 : cx_time, cx_time > 9999999 ? "ms" : "us", fps >= 1.0 ? fps : 1000.0 / fps, @@ -2605,7 +2605,7 @@ int main(int argc, const char **argv_) { frame_avail ? &raw : NULL, frames_in)); vpx_usec_timer_mark(&timer); - cx_time += (unsigned long)vpx_usec_timer_elapsed(&timer); + cx_time += vpx_usec_timer_elapsed(&timer); FOREACH_STREAM(update_quantizer_histogram(stream)); @@ -2614,7 +2614,7 @@ int main(int argc, const char **argv_) { if (!got_data && input.length && !streams->frames_out) { lagged_count = global.limit ? frames_in : ftello(input.file); - } else if (got_data && input.length) { + } else if (input.length) { int64_t remaining; int64_t rate; |