| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Standalone benchmarking application based on FFmpeg. This tool is used to | 5 // Standalone benchmarking application based on FFmpeg. This tool is used to |
| 6 // measure decoding performance between different FFmpeg compile and run-time | 6 // measure decoding performance between different FFmpeg compile and run-time |
| 7 // options. We also use this tool to measure performance regressions when | 7 // options. We also use this tool to measure performance regressions when |
| 8 // testing newer builds of FFmpeg from trunk. | 8 // testing newer builds of FFmpeg from trunk. |
| 9 // | 9 // |
| 10 // This tool requires FFMPeg DLL's built with --enable-protocol=file. | 10 // This tool requires FFMPeg DLL's built with --enable-protocol=file. |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 base::TimeDelta total = base::TimeTicks::HighResNow() - start; | 248 base::TimeDelta total = base::TimeTicks::HighResNow() - start; |
| 249 | 249 |
| 250 // Calculate the sum of times. Note that some of these may be zero. | 250 // Calculate the sum of times. Note that some of these may be zero. |
| 251 double sum = 0; | 251 double sum = 0; |
| 252 for (size_t i = 0; i < decode_times.size(); ++i) { | 252 for (size_t i = 0; i < decode_times.size(); ++i) { |
| 253 sum += decode_times[i]; | 253 sum += decode_times[i]; |
| 254 } | 254 } |
| 255 | 255 |
| 256 // Print our results. | 256 // Print our results. |
| 257 std::cout.setf(std::ios::fixed); | 257 std::cout.setf(std::ios::fixed); |
| 258 std::cout.precision(3); | 258 std::cout.precision(2); |
| 259 std::cout << std::endl; | 259 std::cout << std::endl; |
| 260 std::cout << " Frames:" << std::setw(10) << frames | 260 std::cout << " Frames:" << std::setw(10) << frames |
| 261 << std::endl; | 261 << std::endl; |
| 262 std::cout << " Total:" << std::setw(10) << total.InMillisecondsF() | 262 std::cout << " Total:" << std::setw(10) << total.InMillisecondsF() |
| 263 << " ms" << std::endl; | 263 << " ms" << std::endl; |
| 264 std::cout << " Summation:" << std::setw(10) << sum | 264 std::cout << " Summation:" << std::setw(10) << sum |
| 265 << " ms" << std::endl; | 265 << " ms" << std::endl; |
| 266 | 266 |
| 267 if (frames > 0u) { | 267 if (frames > 0u) { |
| 268 // Calculate the average time per frame. | 268 // Calculate the average time per frame. |
| (...skipping 11 matching lines...) Expand all Loading... |
| 280 // Calculate the standard deviation (jitter). | 280 // Calculate the standard deviation (jitter). |
| 281 double stddev = sqrt(squared_sum / frames); | 281 double stddev = sqrt(squared_sum / frames); |
| 282 | 282 |
| 283 std::cout << " Average:" << std::setw(10) << average | 283 std::cout << " Average:" << std::setw(10) << average |
| 284 << " ms" << std::endl; | 284 << " ms" << std::endl; |
| 285 std::cout << " StdDev:" << std::setw(10) << stddev | 285 std::cout << " StdDev:" << std::setw(10) << stddev |
| 286 << " ms" << std::endl; | 286 << " ms" << std::endl; |
| 287 } | 287 } |
| 288 return 0; | 288 return 0; |
| 289 } | 289 } |
| OLD | NEW |