| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 | 10 |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 // Using ConvertToI420 to add stride to the image. | 144 // Using ConvertToI420 to add stride to the image. |
| 145 EXPECT_EQ(0, ConvertToI420(kI420, source_buffer_.get(), 0, 0, | 145 EXPECT_EQ(0, ConvertToI420(kI420, source_buffer_.get(), 0, 0, |
| 146 codec_inst_.width, codec_inst_.height, 0, | 146 codec_inst_.width, codec_inst_.height, 0, |
| 147 kVideoRotation_0, &input_frame_)); | 147 kVideoRotation_0, &input_frame_)); |
| 148 } | 148 } |
| 149 | 149 |
| 150 void SetUpEncodeDecode() { | 150 void SetUpEncodeDecode() { |
| 151 codec_inst_.startBitrate = 300; | 151 codec_inst_.startBitrate = 300; |
| 152 codec_inst_.maxBitrate = 4000; | 152 codec_inst_.maxBitrate = 4000; |
| 153 codec_inst_.qpMax = 56; | 153 codec_inst_.qpMax = 56; |
| 154 codec_inst_.codecSpecific.VP8.denoisingOn = true; | 154 codec_inst_.VP8()->denoisingOn = true; |
| 155 | 155 |
| 156 EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, | 156 EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, |
| 157 encoder_->InitEncode(&codec_inst_, 1, 1440)); | 157 encoder_->InitEncode(&codec_inst_, 1, 1440)); |
| 158 EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, decoder_->InitDecode(&codec_inst_, 1)); | 158 EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, decoder_->InitDecode(&codec_inst_, 1)); |
| 159 } | 159 } |
| 160 | 160 |
| 161 size_t WaitForEncodedFrame() const { | 161 size_t WaitForEncodedFrame() const { |
| 162 int64_t startTime = rtc::TimeMillis(); | 162 int64_t startTime = rtc::TimeMillis(); |
| 163 while (rtc::TimeMillis() - startTime < kMaxWaitEncTimeMs) { | 163 while (rtc::TimeMillis() - startTime < kMaxWaitEncTimeMs) { |
| 164 if (encode_complete_callback_->EncodeComplete()) { | 164 if (encode_complete_callback_->EncodeComplete()) { |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 TEST_F(TestVp8Impl, EncoderParameterTest) { | 198 TEST_F(TestVp8Impl, EncoderParameterTest) { |
| 199 strncpy(codec_inst_.plName, "VP8", 31); | 199 strncpy(codec_inst_.plName, "VP8", 31); |
| 200 codec_inst_.plType = 126; | 200 codec_inst_.plType = 126; |
| 201 codec_inst_.maxBitrate = 0; | 201 codec_inst_.maxBitrate = 0; |
| 202 codec_inst_.minBitrate = 0; | 202 codec_inst_.minBitrate = 0; |
| 203 codec_inst_.width = 1440; | 203 codec_inst_.width = 1440; |
| 204 codec_inst_.height = 1080; | 204 codec_inst_.height = 1080; |
| 205 codec_inst_.maxFramerate = 30; | 205 codec_inst_.maxFramerate = 30; |
| 206 codec_inst_.startBitrate = 300; | 206 codec_inst_.startBitrate = 300; |
| 207 codec_inst_.qpMax = 56; | 207 codec_inst_.qpMax = 56; |
| 208 codec_inst_.codecSpecific.VP8.complexity = kComplexityNormal; | 208 codec_inst_.VP8()->complexity = kComplexityNormal; |
| 209 codec_inst_.codecSpecific.VP8.numberOfTemporalLayers = 1; | 209 codec_inst_.VP8()->numberOfTemporalLayers = 1; |
| 210 // Calls before InitEncode(). | 210 // Calls before InitEncode(). |
| 211 EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, encoder_->Release()); | 211 EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, encoder_->Release()); |
| 212 int bit_rate = 300; | 212 int bit_rate = 300; |
| 213 EXPECT_EQ(WEBRTC_VIDEO_CODEC_UNINITIALIZED, | 213 EXPECT_EQ(WEBRTC_VIDEO_CODEC_UNINITIALIZED, |
| 214 encoder_->SetRates(bit_rate, codec_inst_.maxFramerate)); | 214 encoder_->SetRates(bit_rate, codec_inst_.maxFramerate)); |
| 215 | 215 |
| 216 EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, encoder_->InitEncode(&codec_inst_, 1, 1440)); | 216 EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, encoder_->InitEncode(&codec_inst_, 1, 1440)); |
| 217 | 217 |
| 218 // Decoder parameter tests. | 218 // Decoder parameter tests. |
| 219 // Calls before InitDecode(). | 219 // Calls before InitDecode(). |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 EXPECT_EQ(WEBRTC_VIDEO_CODEC_ERROR, | 261 EXPECT_EQ(WEBRTC_VIDEO_CODEC_ERROR, |
| 262 decoder_->Decode(encoded_frame_, false, NULL)); | 262 decoder_->Decode(encoded_frame_, false, NULL)); |
| 263 // Now setting a key frame. | 263 // Now setting a key frame. |
| 264 encoded_frame_._frameType = kVideoFrameKey; | 264 encoded_frame_._frameType = kVideoFrameKey; |
| 265 EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, | 265 EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, |
| 266 decoder_->Decode(encoded_frame_, false, NULL)); | 266 decoder_->Decode(encoded_frame_, false, NULL)); |
| 267 EXPECT_GT(I420PSNR(&input_frame_, &decoded_frame_), 36); | 267 EXPECT_GT(I420PSNR(&input_frame_, &decoded_frame_), 36); |
| 268 } | 268 } |
| 269 | 269 |
| 270 } // namespace webrtc | 270 } // namespace webrtc |
| OLD | NEW |