OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 29 matching lines...) Expand all Loading... |
40 const int half_width = (f1.width() + 1) / 2; | 40 const int half_width = (f1.width() + 1) / 2; |
41 const int half_height = (f1.height() + 1) / 2; | 41 const int half_height = (f1.height() + 1) / 2; |
42 return EqualPlane(f1.buffer(webrtc::kYPlane), f2.buffer(webrtc::kYPlane), | 42 return EqualPlane(f1.buffer(webrtc::kYPlane), f2.buffer(webrtc::kYPlane), |
43 f1.stride(webrtc::kYPlane), f1.width(), f1.height()) && | 43 f1.stride(webrtc::kYPlane), f1.width(), f1.height()) && |
44 EqualPlane(f1.buffer(webrtc::kUPlane), f2.buffer(webrtc::kUPlane), | 44 EqualPlane(f1.buffer(webrtc::kUPlane), f2.buffer(webrtc::kUPlane), |
45 f1.stride(webrtc::kUPlane), half_width, half_height) && | 45 f1.stride(webrtc::kUPlane), half_width, half_height) && |
46 EqualPlane(f1.buffer(webrtc::kVPlane), f2.buffer(webrtc::kVPlane), | 46 EqualPlane(f1.buffer(webrtc::kVPlane), f2.buffer(webrtc::kVPlane), |
47 f1.stride(webrtc::kVPlane), half_width, half_height); | 47 f1.stride(webrtc::kVPlane), half_width, half_height); |
48 } | 48 } |
49 | 49 |
| 50 bool FrameBufsEqual(const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& f1, |
| 51 const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& f2) { |
| 52 if (f1->width() != f2->width() || f1->height() != f2->height() || |
| 53 f1->stride(webrtc::kYPlane) != f2->stride(webrtc::kYPlane) || |
| 54 f1->stride(webrtc::kUPlane) != f2->stride(webrtc::kUPlane) || |
| 55 f1->stride(webrtc::kVPlane) != f2->stride(webrtc::kVPlane)) { |
| 56 return false; |
| 57 } |
| 58 const int half_width = (f1->width() + 1) / 2; |
| 59 const int half_height = (f1->height() + 1) / 2; |
| 60 return EqualPlane(f1->data(webrtc::kYPlane), f2->data(webrtc::kYPlane), |
| 61 f1->stride(webrtc::kYPlane), f1->width(), f1->height()) && |
| 62 EqualPlane(f1->data(webrtc::kUPlane), f2->data(webrtc::kUPlane), |
| 63 f1->stride(webrtc::kUPlane), half_width, half_height) && |
| 64 EqualPlane(f1->data(webrtc::kVPlane), f2->data(webrtc::kVPlane), |
| 65 f1->stride(webrtc::kVPlane), half_width, half_height); |
| 66 } |
| 67 |
50 } // namespace test | 68 } // namespace test |
51 } // namespace webrtc | 69 } // namespace webrtc |
OLD | NEW |