diff options
author | fbarchard@chromium.org <fbarchard@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-03 23:34:24 +0000 |
---|---|---|
committer | fbarchard@chromium.org <fbarchard@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-03 23:34:24 +0000 |
commit | 0d97e298c87bb5d5b7b3cda7202a82389230c01f (patch) | |
tree | c8ccb8c694c62056575ca512dfeaca9702221069 /media/tools/media_bench | |
parent | 4cbfb7e8cfab54280de2d5e18b2d010c0e48dade (diff) | |
download | chromium_src-0d97e298c87bb5d5b7b3cda7202a82389230c01f.zip chromium_src-0d97e298c87bb5d5b7b3cda7202a82389230c01f.tar.gz chromium_src-0d97e298c87bb5d5b7b3cda7202a82389230c01f.tar.bz2 |
media bench report fps
also handles videos with 0 frames the same as videos with more than 0 frames, for consistency
and throwing in a comment in yuv conversion
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/3073019
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54842 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/tools/media_bench')
-rw-r--r-- | media/tools/media_bench/media_bench.cc | 41 |
1 files changed, 24 insertions, 17 deletions
diff --git a/media/tools/media_bench/media_bench.cc b/media/tools/media_bench/media_bench.cc index 5809470..86833b1 100644 --- a/media/tools/media_bench/media_bench.cc +++ b/media/tools/media_bench/media_bench.cc @@ -528,20 +528,12 @@ int main(int argc, const char** argv) { sum += decode_times[i]; } - // Print our results. - log_out->setf(std::ios::fixed); - log_out->precision(2); - *log_out << std::endl; - *log_out << " Frames:" << std::setw(11) << frames - << std::endl; - *log_out << " Total:" << std::setw(11) << total.InMillisecondsF() - << " ms" << std::endl; - *log_out << " Summation:" << std::setw(11) << sum - << " ms" << std::endl; - + double average = 0; + double stddev = 0; + double fps = 0; if (frames > 0) { // Calculate the average time per frame. - double average = sum / frames; + average = sum / frames; // Calculate the sum of the squared differences. // Standard deviation will only be accurate if no threads are used. @@ -553,13 +545,28 @@ int main(int argc, const char** argv) { } // Calculate the standard deviation (jitter). - double stddev = sqrt(squared_sum / frames); + stddev = sqrt(squared_sum / frames); - *log_out << " Average:" << std::setw(11) << average - << " ms" << std::endl; - *log_out << " StdDev:" << std::setw(11) << stddev - << " ms" << std::endl; + // Calculate frames per second. + fps = frames * 1000.0 / sum; } + + // Print our results. + log_out->setf(std::ios::fixed); + log_out->precision(2); + *log_out << std::endl; + *log_out << " Frames:" << std::setw(11) << frames + << std::endl; + *log_out << " Total:" << std::setw(11) << total.InMillisecondsF() + << " ms" << std::endl; + *log_out << " Summation:" << std::setw(11) << sum + << " ms" << std::endl; + *log_out << " Average:" << std::setw(11) << average + << " ms" << std::endl; + *log_out << " StdDev:" << std::setw(11) << stddev + << " ms" << std::endl; + *log_out << " FPS:" << std::setw(11) << fps + << std::endl; if (hash_djb2) { *log_out << " DJB2 Hash:" << std::setw(11) << hash_value << " " << in_path.value() << std::endl; |