Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(42)

Unified Diff: remoting/codec/video_encoder_vpx_perftest.cc

Issue 349223007: Add manual tests to benchmark VP8 & VP9 encode performance. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove exclusions for enable_remoting_host==0 Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/codec/codec_test.cc ('k') | remoting/remoting_test.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/codec/video_encoder_vpx_perftest.cc
diff --git a/remoting/codec/video_encoder_vpx_perftest.cc b/remoting/codec/video_encoder_vpx_perftest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..3dc4ef16ebcc6d243dba090c5a4365428be7c00a
--- /dev/null
+++ b/remoting/codec/video_encoder_vpx_perftest.cc
@@ -0,0 +1,61 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "remoting/codec/video_encoder_vpx.h"
+
+#include <limits>
+#include <vector>
+
+#include "base/logging.h"
+#include "base/memory/scoped_ptr.h"
+#include "remoting/codec/codec_test.h"
+#include "testing/gtest/include/gtest/gtest.h"
+#include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h"
+
+using webrtc::DesktopSize;
+
+namespace remoting {
+
+// Measure the performance of the VP8 encoder.
+TEST(VideoEncoderVpxTest, MeasureVp8Fps) {
+ scoped_ptr<VideoEncoderVpx> encoder(VideoEncoderVpx::CreateForVP8());
+
+ const DesktopSize kFrameSizes[] = {
+ DesktopSize(1280, 1024), DesktopSize(1920, 1200)
+ };
+
+ for (size_t i = 0; i < arraysize(kFrameSizes); ++i) {
+ float fps =
+ MeasureVideoEncoderFpsWithSize(encoder.get(), kFrameSizes[i]);
+ LOG(ERROR) << kFrameSizes[i].width() << "x" << kFrameSizes[i].height()
+ << ": " << fps << "fps";
+ }
+}
+
+// Measure the performance of the VP9 encoder.
+TEST(VideoEncoderVpxTest, MeasureVp9Fps) {
+ const DesktopSize kFrameSizes[] = {
+ DesktopSize(1280, 1024), DesktopSize(1920, 1200)
+ };
+
+ for (int lossless_mode = 0; lossless_mode < 4; ++lossless_mode) {
+ bool lossless_color = lossless_mode & 1;
+ bool lossless_encode = lossless_mode & 2;
+
+ scoped_ptr<VideoEncoderVpx> encoder(VideoEncoderVpx::CreateForVP9());
+ encoder->SetLosslessColor(lossless_color);
+ encoder->SetLosslessEncode(lossless_encode);
+
+ for (size_t i = 0; i < arraysize(kFrameSizes); ++i) {
+ float fps =
+ MeasureVideoEncoderFpsWithSize(encoder.get(), kFrameSizes[i]);
+ LOG(ERROR) << kFrameSizes[i].width() << "x" << kFrameSizes[i].height()
+ << "(" << (lossless_encode ? "lossless" : "lossy ") << ")"
+ << "(" << (lossless_color ? "I444" : "I420") << ")"
+ << ": " << fps << "fps";
+ }
+ }
+}
+
+} // namespace remoting
« no previous file with comments | « remoting/codec/codec_test.cc ('k') | remoting/remoting_test.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698