OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // This tool can be used to measure performace of video frame scaling | 5 // This tool can be used to measure performace of video frame scaling |
6 // code. It times performance of the scaler with and without filtering. | 6 // code. It times performance of the scaler with and without filtering. |
7 // It also measures performance of the Skia scaler for comparison. | 7 // It also measures performance of the Skia scaler for comparison. |
8 | 8 |
9 #include <iostream> | 9 #include <iostream> |
10 #include <vector> | 10 #include <vector> |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 filter); | 153 filter); |
154 } | 154 } |
155 TimeTicks end = TimeTicks::HighResNow(); | 155 TimeTicks end = TimeTicks::HighResNow(); |
156 return static_cast<double>((end - start).InMilliseconds()) / num_frames; | 156 return static_cast<double>((end - start).InMilliseconds()) / num_frames; |
157 } | 157 } |
158 | 158 |
159 int main(int argc, const char** argv) { | 159 int main(int argc, const char** argv) { |
160 CommandLine::Init(argc, argv); | 160 CommandLine::Init(argc, argv); |
161 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); | 161 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); |
162 | 162 |
163 if (!cmd_line->args().empty()) { | 163 if (!cmd_line->GetArgs().empty()) { |
164 std::cerr << "Usage: " << argv[0] << " [OPTIONS]\n" | 164 std::cerr << "Usage: " << argv[0] << " [OPTIONS]\n" |
165 << " --frames=N " | 165 << " --frames=N " |
166 << "Number of frames\n" | 166 << "Number of frames\n" |
167 << " --buffers=N " | 167 << " --buffers=N " |
168 << "Number of buffers\n" | 168 << "Number of buffers\n" |
169 << " --src-w=N " | 169 << " --src-w=N " |
170 << "Width of the source image\n" | 170 << "Width of the source image\n" |
171 << " --src-h=N " | 171 << " --src-h=N " |
172 << "Height of the source image\n" | 172 << "Height of the source image\n" |
173 << " --dest-w=N " | 173 << " --dest-w=N " |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 << BenchmarkFilter(media::FILTER_BILINEAR_V) | 231 << BenchmarkFilter(media::FILTER_BILINEAR_V) |
232 << "ms/frame" << std::endl; | 232 << "ms/frame" << std::endl; |
233 std::cout << "Bilinear Horizontal: " | 233 std::cout << "Bilinear Horizontal: " |
234 << BenchmarkFilter(media::FILTER_BILINEAR_H) | 234 << BenchmarkFilter(media::FILTER_BILINEAR_H) |
235 << "ms/frame" << std::endl; | 235 << "ms/frame" << std::endl; |
236 std::cout << "Bilinear: " << BenchmarkFilter(media::FILTER_BILINEAR) | 236 std::cout << "Bilinear: " << BenchmarkFilter(media::FILTER_BILINEAR) |
237 << "ms/frame" << std::endl; | 237 << "ms/frame" << std::endl; |
238 | 238 |
239 return 0; | 239 return 0; |
240 } | 240 } |
OLD | NEW |