| 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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 Calc16ByteAlignedStride(codec_inst_.width, &stride_y, &stride_uv); | 159 Calc16ByteAlignedStride(codec_inst_.width, &stride_y, &stride_uv); |
| 160 EXPECT_EQ(stride_y, 176); | 160 EXPECT_EQ(stride_y, 176); |
| 161 EXPECT_EQ(stride_uv, 96); | 161 EXPECT_EQ(stride_uv, 96); |
| 162 | 162 |
| 163 rtc::scoped_refptr<I420Buffer> stride_buffer( | 163 rtc::scoped_refptr<I420Buffer> stride_buffer( |
| 164 I420Buffer::Create(kWidth, kHeight, stride_y, stride_uv, stride_uv)); | 164 I420Buffer::Create(kWidth, kHeight, stride_y, stride_uv, stride_uv)); |
| 165 | 165 |
| 166 // No scaling in our case, just a copy, to add stride to the image. | 166 // No scaling in our case, just a copy, to add stride to the image. |
| 167 stride_buffer->ScaleFrom(*compact_buffer); | 167 stride_buffer->ScaleFrom(*compact_buffer); |
| 168 | 168 |
| 169 input_frame_.reset( | 169 input_frame_.reset(new VideoFrame(stride_buffer, kVideoRotation_0, |
| 170 new VideoFrame(stride_buffer, kVideoRotation_0, 0)); | 170 kVideoContent_Default, 0)); |
| 171 input_frame_->set_timestamp(kTestTimestamp); | 171 input_frame_->set_timestamp(kTestTimestamp); |
| 172 } | 172 } |
| 173 | 173 |
| 174 void SetUpEncodeDecode() { | 174 void SetUpEncodeDecode() { |
| 175 codec_inst_.startBitrate = 300; | 175 codec_inst_.startBitrate = 300; |
| 176 codec_inst_.maxBitrate = 4000; | 176 codec_inst_.maxBitrate = 4000; |
| 177 codec_inst_.qpMax = 56; | 177 codec_inst_.qpMax = 56; |
| 178 codec_inst_.VP8()->denoisingOn = true; | 178 codec_inst_.VP8()->denoisingOn = true; |
| 179 codec_inst_.VP8()->tl_factory = &tl_factory_; | 179 codec_inst_.VP8()->tl_factory = &tl_factory_; |
| 180 codec_inst_.VP8()->numberOfTemporalLayers = 1; | 180 codec_inst_.VP8()->numberOfTemporalLayers = 1; |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 decoder_->Decode(encoded_frame_, false, NULL)); | 309 decoder_->Decode(encoded_frame_, false, NULL)); |
| 310 // Now setting a key frame. | 310 // Now setting a key frame. |
| 311 encoded_frame_._frameType = kVideoFrameKey; | 311 encoded_frame_._frameType = kVideoFrameKey; |
| 312 EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, | 312 EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, |
| 313 decoder_->Decode(encoded_frame_, false, NULL)); | 313 decoder_->Decode(encoded_frame_, false, NULL)); |
| 314 ASSERT_TRUE(decoded_frame_); | 314 ASSERT_TRUE(decoded_frame_); |
| 315 EXPECT_GT(I420PSNR(input_frame_.get(), &*decoded_frame_), 36); | 315 EXPECT_GT(I420PSNR(input_frame_.get(), &*decoded_frame_), 36); |
| 316 } | 316 } |
| 317 | 317 |
| 318 } // namespace webrtc | 318 } // namespace webrtc |
| OLD | NEW |