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

Unified Diff: remoting/host/differ_block.cc

Issue 2690003: Copy the (early prototype of) remoting in Chrome into the public tree.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/host/differ_block.h ('k') | remoting/host/differ_block_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/differ_block.cc
===================================================================
--- remoting/host/differ_block.cc (revision 0)
+++ remoting/host/differ_block.cc (revision 0)
@@ -0,0 +1,28 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "differ_block.h"
+
+#include <stdlib.h>
+
+namespace remoting {
+
+// TODO(fbarchard): Use common header for block size.
+int kBlockWidth = 32;
+int kBlockHeight = 32;
+int kBytesPerPixel = 3;
+
+int BlockDifference(const uint8* image1, const uint8* image2, int stride) {
+ int diff = 0;
+ for (int y = 0; y < kBlockHeight; ++y) {
+ for (int x = 0; x < kBlockWidth * kBytesPerPixel; ++x) {
+ diff += abs(image1[x] - image2[x]);
+ }
+ image1 += stride;
+ image2 += stride;
+ }
+ return diff;
+}
+
+} // namespace remoting
Property changes on: remoting/host/differ_block.cc
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « remoting/host/differ_block.h ('k') | remoting/host/differ_block_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698