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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 int stride_uv; | 142 int stride_uv; |
143 int stride_y; | 143 int stride_y; |
144 Calc16ByteAlignedStride(codec_inst_.width, &stride_y, &stride_uv); | 144 Calc16ByteAlignedStride(codec_inst_.width, &stride_y, &stride_uv); |
145 EXPECT_EQ(stride_y, 176); | 145 EXPECT_EQ(stride_y, 176); |
146 EXPECT_EQ(stride_uv, 96); | 146 EXPECT_EQ(stride_uv, 96); |
147 | 147 |
148 rtc::scoped_refptr<I420Buffer> stride_buffer( | 148 rtc::scoped_refptr<I420Buffer> stride_buffer( |
149 I420Buffer::Create(kWidth, kHeight, stride_y, stride_uv, stride_uv)); | 149 I420Buffer::Create(kWidth, kHeight, stride_y, stride_uv, stride_uv)); |
150 | 150 |
151 // No scaling in our case, just a copy, to add stride to the image. | 151 // No scaling in our case, just a copy, to add stride to the image. |
152 stride_buffer->ScaleFrom(compact_buffer); | 152 stride_buffer->ScaleFrom(*compact_buffer); |
153 | 153 |
154 input_frame_.reset( | 154 input_frame_.reset( |
155 new VideoFrame(stride_buffer, kVideoRotation_0, 0)); | 155 new VideoFrame(stride_buffer, kVideoRotation_0, 0)); |
156 input_frame_->set_timestamp(kTestTimestamp); | 156 input_frame_->set_timestamp(kTestTimestamp); |
157 } | 157 } |
158 | 158 |
159 void SetUpEncodeDecode() { | 159 void SetUpEncodeDecode() { |
160 codec_inst_.startBitrate = 300; | 160 codec_inst_.startBitrate = 300; |
161 codec_inst_.maxBitrate = 4000; | 161 codec_inst_.maxBitrate = 4000; |
162 codec_inst_.qpMax = 56; | 162 codec_inst_.qpMax = 56; |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 EXPECT_EQ(WEBRTC_VIDEO_CODEC_ERROR, | 269 EXPECT_EQ(WEBRTC_VIDEO_CODEC_ERROR, |
270 decoder_->Decode(encoded_frame_, false, NULL)); | 270 decoder_->Decode(encoded_frame_, false, NULL)); |
271 // Now setting a key frame. | 271 // Now setting a key frame. |
272 encoded_frame_._frameType = kVideoFrameKey; | 272 encoded_frame_._frameType = kVideoFrameKey; |
273 EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, | 273 EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, |
274 decoder_->Decode(encoded_frame_, false, NULL)); | 274 decoder_->Decode(encoded_frame_, false, NULL)); |
275 EXPECT_GT(I420PSNR(input_frame_.get(), &decoded_frame_), 36); | 275 EXPECT_GT(I420PSNR(input_frame_.get(), &decoded_frame_), 36); |
276 } | 276 } |
277 | 277 |
278 } // namespace webrtc | 278 } // namespace webrtc |
OLD | NEW |