| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "remoting/codec/video_decoder_vpx.h" | 5 #include "remoting/codec/video_decoder_vpx.h" |
| 6 | 6 |
| 7 #include "media/base/video_frame.h" | 7 #include "media/base/video_frame.h" |
| 8 #include "remoting/codec/codec_test.h" | 8 #include "remoting/codec/codec_test.h" |
| 9 #include "remoting/codec/video_encoder_vpx.h" | 9 #include "remoting/codec/video_encoder_vpx.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| 11 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" | 11 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" |
| 12 | 12 |
| 13 namespace remoting { | 13 namespace remoting { |
| 14 | 14 |
| 15 namespace { | 15 namespace { |
| 16 | 16 |
| 17 class VideoDecoderVpxTest : public testing::Test { | 17 class VideoDecoderVpxTest : public testing::Test { |
| 18 protected: | 18 protected: |
| 19 scoped_ptr<VideoEncoderVpx> encoder_; | 19 std::unique_ptr<VideoEncoderVpx> encoder_; |
| 20 scoped_ptr<VideoDecoderVpx> decoder_; | 20 std::unique_ptr<VideoDecoderVpx> decoder_; |
| 21 | 21 |
| 22 VideoDecoderVpxTest() : encoder_(VideoEncoderVpx::CreateForVP8()), | 22 VideoDecoderVpxTest() : encoder_(VideoEncoderVpx::CreateForVP8()), |
| 23 decoder_(VideoDecoderVpx::CreateForVP8()) { | 23 decoder_(VideoDecoderVpx::CreateForVP8()) { |
| 24 } | 24 } |
| 25 | 25 |
| 26 void TestGradient(int screen_width, int screen_height, | 26 void TestGradient(int screen_width, int screen_height, |
| 27 double max_error_limit, double mean_error_limit) { | 27 double max_error_limit, double mean_error_limit) { |
| 28 TestVideoEncoderDecoderGradient( | 28 TestVideoEncoderDecoderGradient( |
| 29 encoder_.get(), decoder_.get(), | 29 encoder_.get(), decoder_.get(), |
| 30 webrtc::DesktopSize(screen_width, screen_height), | 30 webrtc::DesktopSize(screen_width, screen_height), |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 } | 74 } |
| 75 | 75 |
| 76 // Check that encoding and decoding a particular frame doesn't change the | 76 // Check that encoding and decoding a particular frame doesn't change the |
| 77 // frame too much. The frame used is a gradient, which does not contain sharp | 77 // frame too much. The frame used is a gradient, which does not contain sharp |
| 78 // transitions, so encoding lossiness should not be too high. | 78 // transitions, so encoding lossiness should not be too high. |
| 79 TEST_F(VideoDecoderVp9Test, Gradient) { | 79 TEST_F(VideoDecoderVp9Test, Gradient) { |
| 80 TestGradient(320, 240, 0.04, 0.02); | 80 TestGradient(320, 240, 0.04, 0.02); |
| 81 } | 81 } |
| 82 | 82 |
| 83 } // namespace remoting | 83 } // namespace remoting |
| OLD | NEW |