From 002f0d09c91585713772b3249ebac6a27a8937b3 Mon Sep 17 00:00:00 2001 From: Marco Date: Thu, 17 Dec 2015 09:49:31 -0800 Subject: [PATCH] VP9: Set speed setting to 8 for ARM. At speed 8, vp9 on ARM is currently ~2x times slower than vp8 on ARM (speed -12). Update some parameters in videoprocessor_integrationtest.cc to make tests pass on android (which uses the new speed setting). TBR=stefan@webrtc.org BUG= Review URL: https://codereview.webrtc.org/1526973004 . Cr-Commit-Position: refs/heads/master@{#11072} --- .../codecs/test/videoprocessor_integrationtest.cc | 8 ++++---- webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc | 4 ++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest.cc b/webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest.cc index c1fd78e61e..70fe98737d 100644 --- a/webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest.cc +++ b/webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest.cc @@ -657,7 +657,7 @@ TEST_F(VideoProcessorIntegrationTest, ProcessNoLossChangeBitRateVP9) { false, true, false); // Metrics for expected quality. QualityMetrics quality_metrics; - SetQualityMetrics(&quality_metrics, 35.9, 30.0, 0.90, 0.85); + SetQualityMetrics(&quality_metrics, 35.7, 30.0, 0.90, 0.85); // Metrics for rate control. RateControlMetrics rc_metrics[3]; SetRateControlMetrics(rc_metrics, 0, 0, 30, 20, 20, 30, 0, 1); @@ -695,7 +695,7 @@ TEST_F(VideoProcessorIntegrationTest, SetQualityMetrics(&quality_metrics, 31.5, 18.0, 0.80, 0.44); // Metrics for rate control. RateControlMetrics rc_metrics[3]; - SetRateControlMetrics(rc_metrics, 0, 35, 50, 70, 15, 45, 0, 1); + SetRateControlMetrics(rc_metrics, 0, 35, 50, 75, 15, 45, 0, 1); SetRateControlMetrics(rc_metrics, 1, 10, 0, 40, 10, 30, 0, 0); SetRateControlMetrics(rc_metrics, 2, 5, 0, 30, 5, 20, 0, 0); ProcessFramesAndVerify(quality_metrics, @@ -743,10 +743,10 @@ TEST_F(VideoProcessorIntegrationTest, ProcessNoLossSpatialResizeFrameDropVP9) { 1, false, false, true, true); // Metrics for expected quality. QualityMetrics quality_metrics; - SetQualityMetrics(&quality_metrics, 25.0, 13.0, 0.70, 0.40); + SetQualityMetrics(&quality_metrics, 25.0, 13.0, 0.70, 0.37); // Metrics for rate control. RateControlMetrics rc_metrics[1]; - SetRateControlMetrics(rc_metrics, 0, 190, 70, 135, 15, 80, 1, 1); + SetRateControlMetrics(rc_metrics, 0, 225, 70, 160, 15, 80, 1, 1); ProcessFramesAndVerify(quality_metrics, rate_profile, process_settings, diff --git a/webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc b/webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc index 7833ded641..21096bd82e 100644 --- a/webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc +++ b/webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc @@ -36,12 +36,16 @@ namespace webrtc { // Only positive speeds, range for real-time coding currently is: 5 - 8. // Lower means slower/better quality, higher means fastest/lower quality. int GetCpuSpeed(int width, int height) { +#if defined(WEBRTC_ARCH_ARM) || defined(WEBRTC_ARCH_ARM64) + return 8; +#else // For smaller resolutions, use lower speed setting (get some coding gain at // the cost of increased encoding complexity). if (width * height <= 352 * 288) return 5; else return 7; +#endif } VP9Encoder* VP9Encoder::Create() {