michael@0: /* michael@0: * Copyright (c) 2010 The WebM project authors. All Rights Reserved. michael@0: * michael@0: * Use of this source code is governed by a BSD-style license michael@0: * that can be found in the LICENSE file in the root of the source michael@0: * tree. An additional intellectual property rights grant can be found michael@0: * in the file PATENTS. All contributing project authors may michael@0: * be found in the AUTHORS file in the root of the source tree. michael@0: */ michael@0: michael@0: #ifndef VP9_COMMON_VP9_SADMXN_H_ michael@0: #define VP9_COMMON_VP9_SADMXN_H_ michael@0: michael@0: #include "./vpx_config.h" michael@0: #include "vpx/vpx_integer.h" michael@0: michael@0: static INLINE unsigned int sad_mx_n_c(const uint8_t *src_ptr, michael@0: int src_stride, michael@0: const uint8_t *ref_ptr, michael@0: int ref_stride, michael@0: int m, michael@0: int n) { michael@0: int r, c; michael@0: unsigned int sad = 0; michael@0: michael@0: for (r = 0; r < n; r++) { michael@0: for (c = 0; c < m; c++) { michael@0: sad += abs(src_ptr[c] - ref_ptr[c]); michael@0: } michael@0: michael@0: src_ptr += src_stride; michael@0: ref_ptr += ref_stride; michael@0: } michael@0: michael@0: return sad; michael@0: } michael@0: michael@0: #endif // VP9_COMMON_VP9_SADMXN_H_