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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 orig_frame_(), | 96 orig_frame_(), |
97 width_(352), | 97 width_(352), |
98 height_(288), | 98 height_(288), |
99 size_y_(width_ * height_), | 99 size_y_(width_ * height_), |
100 size_uv_(((width_ + 1) / 2) * ((height_ + 1) / 2)), | 100 size_uv_(((width_ + 1) / 2) * ((height_ + 1) / 2)), |
101 frame_length_(CalcBufferSize(kI420, 352, 288)) { | 101 frame_length_(CalcBufferSize(kI420, 352, 288)) { |
102 orig_buffer_.reset(new uint8_t[frame_length_]); | 102 orig_buffer_.reset(new uint8_t[frame_length_]); |
103 } | 103 } |
104 | 104 |
105 void TestLibYuv::SetUp() { | 105 void TestLibYuv::SetUp() { |
106 const std::string input_file_name = webrtc::test::ProjectRootPath() + | 106 const std::string input_file_name = webrtc::test::ResourcePath("foreman_cif", |
107 "resources/foreman_cif.yuv"; | 107 "yuv"); |
108 source_file_ = fopen(input_file_name.c_str(), "rb"); | 108 source_file_ = fopen(input_file_name.c_str(), "rb"); |
109 ASSERT_TRUE(source_file_ != NULL) << "Cannot read file: "<< | 109 ASSERT_TRUE(source_file_ != NULL) << "Cannot read file: "<< |
110 input_file_name << "\n"; | 110 input_file_name << "\n"; |
111 | 111 |
112 EXPECT_EQ(frame_length_, | 112 EXPECT_EQ(frame_length_, |
113 fread(orig_buffer_.get(), 1, frame_length_, source_file_)); | 113 fread(orig_buffer_.get(), 1, frame_length_, source_file_)); |
114 EXPECT_EQ(0, orig_frame_.CreateFrame(orig_buffer_.get(), | 114 EXPECT_EQ(0, orig_frame_.CreateFrame(orig_buffer_.get(), |
115 orig_buffer_.get() + size_y_, | 115 orig_buffer_.get() + size_y_, |
116 orig_buffer_.get() + | 116 orig_buffer_.get() + |
117 size_y_ + size_uv_, | 117 size_y_ + size_uv_, |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 Calc16ByteAlignedStride(width, &stride_y, &stride_uv); | 340 Calc16ByteAlignedStride(width, &stride_y, &stride_uv); |
341 EXPECT_EQ(128, stride_y); | 341 EXPECT_EQ(128, stride_y); |
342 EXPECT_EQ(64, stride_uv); | 342 EXPECT_EQ(64, stride_uv); |
343 width = 127; | 343 width = 127; |
344 Calc16ByteAlignedStride(width, &stride_y, &stride_uv); | 344 Calc16ByteAlignedStride(width, &stride_y, &stride_uv); |
345 EXPECT_EQ(128, stride_y); | 345 EXPECT_EQ(128, stride_y); |
346 EXPECT_EQ(64, stride_uv); | 346 EXPECT_EQ(64, stride_uv); |
347 } | 347 } |
348 | 348 |
349 } // namespace webrtc | 349 } // namespace webrtc |
OLD | NEW |