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 |
11 #include <math.h> | 11 #include <math.h> |
12 #include <string.h> | 12 #include <string.h> |
13 | 13 |
14 #include "webrtc/test/gtest.h" | |
15 #include "webrtc/base/bind.h" | 14 #include "webrtc/base/bind.h" |
16 #include "webrtc/test/fake_texture_frame.h" | 15 #include "webrtc/test/fake_texture_frame.h" |
17 #include "webrtc/test/frame_utils.h" | 16 #include "webrtc/test/frame_utils.h" |
| 17 #include "webrtc/test/gtest.h" |
18 #include "webrtc/video_frame.h" | 18 #include "webrtc/video_frame.h" |
19 | 19 |
20 namespace webrtc { | 20 namespace webrtc { |
21 | 21 |
22 namespace { | 22 namespace { |
23 | 23 |
24 rtc::scoped_refptr<I420Buffer> CreateGradient(int width, int height) { | 24 rtc::scoped_refptr<I420Buffer> CreateGradient(int width, int height) { |
25 rtc::scoped_refptr<I420Buffer> buffer( | 25 rtc::scoped_refptr<I420Buffer> buffer( |
26 I420Buffer::Create(width, height)); | 26 I420Buffer::Create(width, height)); |
27 // Initialize with gradient, Y = 128(x/w + y/h), U = 256 x/w, V = 256 y/h | 27 // Initialize with gradient, Y = 128(x/w + y/h), U = 256 x/w, V = 256 y/h |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 | 335 |
336 // Center crop to 640 x 360 (16/9 aspect), then scale down by 2. | 336 // Center crop to 640 x 360 (16/9 aspect), then scale down by 2. |
337 rtc::scoped_refptr<I420Buffer> scaled_buffer( | 337 rtc::scoped_refptr<I420Buffer> scaled_buffer( |
338 I420Buffer::Create(320, 180)); | 338 I420Buffer::Create(320, 180)); |
339 | 339 |
340 scaled_buffer->CropAndScaleFrom(buf); | 340 scaled_buffer->CropAndScaleFrom(buf); |
341 CheckCrop(scaled_buffer, 0.0, 0.125, 1.0, 0.75); | 341 CheckCrop(scaled_buffer, 0.0, 0.125, 1.0, 0.75); |
342 } | 342 } |
343 | 343 |
344 } // namespace webrtc | 344 } // namespace webrtc |
OLD | NEW |