Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(205)

Side by Side Diff: webrtc/test/frame_utils.cc

Issue 1822283002: New method I420Buffer::Copy. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Address compare nit. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/test/frame_utils.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « webrtc/test/frame_utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698