OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 #include <algorithm> // max | 10 #include <algorithm> // max |
(...skipping 2128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2139 const uint8_t kNumSpatialLayers = 1; | 2139 const uint8_t kNumSpatialLayers = 1; |
2140 TestVp9NonFlexMode(kNumTemporalLayers, kNumSpatialLayers); | 2140 TestVp9NonFlexMode(kNumTemporalLayers, kNumSpatialLayers); |
2141 } | 2141 } |
2142 | 2142 |
2143 TEST_F(VideoSendStreamTest, Vp9NonFlexMode_1Tl2SLayers) { | 2143 TEST_F(VideoSendStreamTest, Vp9NonFlexMode_1Tl2SLayers) { |
2144 const uint8_t kNumTemporalLayers = 1; | 2144 const uint8_t kNumTemporalLayers = 1; |
2145 const uint8_t kNumSpatialLayers = 2; | 2145 const uint8_t kNumSpatialLayers = 2; |
2146 TestVp9NonFlexMode(kNumTemporalLayers, kNumSpatialLayers); | 2146 TestVp9NonFlexMode(kNumTemporalLayers, kNumSpatialLayers); |
2147 } | 2147 } |
2148 | 2148 |
2149 #if !defined(MEMORY_SANITIZER) | |
2150 // Fails under MemorySanitizer: | |
2151 // See https://code.google.com/p/webrtc/issues/detail?id=5402. | |
2152 TEST_F(VideoSendStreamTest, Vp9NonFlexMode_2Tl2SLayers) { | 2149 TEST_F(VideoSendStreamTest, Vp9NonFlexMode_2Tl2SLayers) { |
2153 const uint8_t kNumTemporalLayers = 2; | 2150 const uint8_t kNumTemporalLayers = 2; |
2154 const uint8_t kNumSpatialLayers = 2; | 2151 const uint8_t kNumSpatialLayers = 2; |
2155 TestVp9NonFlexMode(kNumTemporalLayers, kNumSpatialLayers); | 2152 TestVp9NonFlexMode(kNumTemporalLayers, kNumSpatialLayers); |
2156 } | 2153 } |
2157 | 2154 |
2158 TEST_F(VideoSendStreamTest, Vp9NonFlexMode_3Tl2SLayers) { | 2155 TEST_F(VideoSendStreamTest, Vp9NonFlexMode_3Tl2SLayers) { |
2159 const uint8_t kNumTemporalLayers = 3; | 2156 const uint8_t kNumTemporalLayers = 3; |
2160 const uint8_t kNumSpatialLayers = 2; | 2157 const uint8_t kNumSpatialLayers = 2; |
2161 TestVp9NonFlexMode(kNumTemporalLayers, kNumSpatialLayers); | 2158 TestVp9NonFlexMode(kNumTemporalLayers, kNumSpatialLayers); |
2162 } | 2159 } |
2163 #endif | |
2164 | 2160 |
2165 void VideoSendStreamTest::TestVp9NonFlexMode(uint8_t num_temporal_layers, | 2161 void VideoSendStreamTest::TestVp9NonFlexMode(uint8_t num_temporal_layers, |
2166 uint8_t num_spatial_layers) { | 2162 uint8_t num_spatial_layers) { |
2167 static const size_t kNumFramesToSend = 100; | 2163 static const size_t kNumFramesToSend = 100; |
2168 // Set to < kNumFramesToSend and coprime to length of temporal layer | 2164 // Set to < kNumFramesToSend and coprime to length of temporal layer |
2169 // structures to verify temporal id reset on key frame. | 2165 // structures to verify temporal id reset on key frame. |
2170 static const int kKeyFrameInterval = 31; | 2166 static const int kKeyFrameInterval = 31; |
2171 class NonFlexibleMode : public Vp9HeaderObserver { | 2167 class NonFlexibleMode : public Vp9HeaderObserver { |
2172 public: | 2168 public: |
2173 NonFlexibleMode(uint8_t num_temporal_layers, uint8_t num_spatial_layers) | 2169 NonFlexibleMode(uint8_t num_temporal_layers, uint8_t num_spatial_layers) |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2235 observation_complete_.Set(); | 2231 observation_complete_.Set(); |
2236 } | 2232 } |
2237 } | 2233 } |
2238 } test; | 2234 } test; |
2239 | 2235 |
2240 RunBaseTest(&test); | 2236 RunBaseTest(&test); |
2241 } | 2237 } |
2242 #endif | 2238 #endif |
2243 | 2239 |
2244 } // namespace webrtc | 2240 } // namespace webrtc |
OLD | NEW |