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 #include <iomanip> | 10 #include <iomanip> |
(...skipping 30 matching lines...) Expand all Loading... |
41 << "Benchmark either the audio or video stream\n" | 41 << "Benchmark either the audio or video stream\n" |
42 << " --video-threads=N " | 42 << " --video-threads=N " |
43 << "Decode video using N threads\n" | 43 << "Decode video using N threads\n" |
44 << " --fast2 " | 44 << " --fast2 " |
45 << "Enable fast2 flag\n" | 45 << "Enable fast2 flag\n" |
46 << " --skip=[1|2|3] " | 46 << " --skip=[1|2|3] " |
47 << "1=loop nonref, 2=loop, 3= frame nonref" << std::endl; | 47 << "1=loop nonref, 2=loop, 3= frame nonref" << std::endl; |
48 return 1; | 48 return 1; |
49 } | 49 } |
50 | 50 |
51 media::InitializeMediaLibrary(FilePath()); | 51 // Initialize our media library (try loading DLLs, etc.) before continuing. |
| 52 // We use an empty file path as the parameter to force searching of the |
| 53 // default locations for necessary DLLs and DSOs. |
| 54 if (media::InitializeMediaLibrary(FilePath()) == false) { |
| 55 std::cerr << "Unable to initialize the media library."; |
| 56 return 1; |
| 57 } |
52 | 58 |
53 // Retrieve command line options. | 59 // Retrieve command line options. |
54 std::string path(WideToUTF8(filenames[0])); | 60 std::string path(WideToUTF8(filenames[0])); |
55 CodecType target_codec = CODEC_TYPE_UNKNOWN; | 61 CodecType target_codec = CODEC_TYPE_UNKNOWN; |
56 int video_threads = 0; | 62 int video_threads = 0; |
57 | 63 |
58 // Determine whether to benchmark audio or video decoding. | 64 // Determine whether to benchmark audio or video decoding. |
59 std::wstring stream(cmd_line->GetSwitchValue(switches::kStream)); | 65 std::wstring stream(cmd_line->GetSwitchValue(switches::kStream)); |
60 if (!stream.empty()) { | 66 if (!stream.empty()) { |
61 if (stream.compare(L"audio") == 0) { | 67 if (stream.compare(L"audio") == 0) { |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 std::cout << " Total:" << std::setw(10) << total.InMillisecondsF() | 242 std::cout << " Total:" << std::setw(10) << total.InMillisecondsF() |
237 << " ms" << std::endl; | 243 << " ms" << std::endl; |
238 std::cout << " Summation:" << std::setw(10) << sum | 244 std::cout << " Summation:" << std::setw(10) << sum |
239 << " ms" << std::endl; | 245 << " ms" << std::endl; |
240 std::cout << " Average:" << std::setw(10) << average | 246 std::cout << " Average:" << std::setw(10) << average |
241 << " ms" << std::endl; | 247 << " ms" << std::endl; |
242 std::cout << " StdDev:" << std::setw(10) << stddev | 248 std::cout << " StdDev:" << std::setw(10) << stddev |
243 << " ms" << std::endl; | 249 << " ms" << std::endl; |
244 return 0; | 250 return 0; |
245 } | 251 } |
OLD | NEW |