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 <memory> | 14 #include <memory> |
15 | 15 |
16 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "webrtc/base/gtest.h" |
17 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" | 17 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" |
18 #include "webrtc/test/testsupport/fileutils.h" | 18 #include "webrtc/test/testsupport/fileutils.h" |
19 #include "webrtc/video_frame.h" | 19 #include "webrtc/video_frame.h" |
20 | 20 |
21 namespace webrtc { | 21 namespace webrtc { |
22 | 22 |
23 namespace { | 23 namespace { |
24 void Calc16ByteAlignedStride(int width, int* stride_y, int* stride_uv) { | 24 void Calc16ByteAlignedStride(int width, int* stride_y, int* stride_uv) { |
25 *stride_y = 16 * ((width + 15) / 16); | 25 *stride_y = 16 * ((width + 15) / 16); |
26 *stride_uv = 16 * ((width + 31) / 32); | 26 *stride_uv = 16 * ((width + 31) / 32); |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 EXPECT_EQ(0, ConvertToI420(kI420, orig_buffer_.get(), 0, 0, width_, height_, | 248 EXPECT_EQ(0, ConvertToI420(kI420, orig_buffer_.get(), 0, 0, width_, height_, |
249 0, kVideoRotation_270, &rotated_res_i420_frame)); | 249 0, kVideoRotation_270, &rotated_res_i420_frame)); |
250 rotated_res_i420_frame.CreateEmptyFrame(width_, height_, | 250 rotated_res_i420_frame.CreateEmptyFrame(width_, height_, |
251 width_, (width_ + 1) / 2, | 251 width_, (width_ + 1) / 2, |
252 (width_ + 1) / 2); | 252 (width_ + 1) / 2); |
253 EXPECT_EQ(0, ConvertToI420(kI420, orig_buffer_.get(), 0, 0, width_, height_, | 253 EXPECT_EQ(0, ConvertToI420(kI420, orig_buffer_.get(), 0, 0, width_, height_, |
254 0, kVideoRotation_180, &rotated_res_i420_frame)); | 254 0, kVideoRotation_180, &rotated_res_i420_frame)); |
255 } | 255 } |
256 | 256 |
257 } // namespace webrtc | 257 } // namespace webrtc |
OLD | NEW |