fbarchard@google.com | 3f46745 | 2012-10-20 01:23:27 +0000 | [diff] [blame^] | 1 | /*
|
| 2 | * Copyright 2012 The LibYuv Project Authors. All rights reserved.
|
| 3 | *
|
| 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
|
| 6 | * tree. An additional intellectual property rights grant can be found
|
| 7 | * in the file PATENTS. All contributing project authors may
|
| 8 | * be found in the AUTHORS file in the root of the source tree.
|
| 9 | */
|
| 10 |
|
| 11 | #include "libyuv/basic_types.h"
|
| 12 |
|
| 13 | #ifdef __cplusplus
|
| 14 | namespace libyuv {
|
| 15 | extern "C" {
|
| 16 | #endif
|
| 17 |
|
| 18 | uint32 SumSquareError_C(const uint8* src_a, const uint8* src_b, int count) {
|
| 19 | uint32 sse = 0u;
|
| 20 | for (int i = 0; i < count; ++i) {
|
| 21 | int diff = src_a[i] - src_b[i];
|
| 22 | sse += static_cast<uint32>(diff * diff);
|
| 23 | }
|
| 24 | return sse;
|
| 25 | }
|
| 26 |
|
| 27 | #ifdef __cplusplus
|
| 28 | } // extern "C"
|
| 29 | } // namespace libyuv
|
| 30 | #endif
|
| 31 |
|