media/libvpx/vp9/common/vp9_sadmxn.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/media/libvpx/vp9/common/vp9_sadmxn.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,38 @@
     1.4 +/*
     1.5 + *  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
     1.6 + *
     1.7 + *  Use of this source code is governed by a BSD-style license
     1.8 + *  that can be found in the LICENSE file in the root of the source
     1.9 + *  tree. An additional intellectual property rights grant can be found
    1.10 + *  in the file PATENTS.  All contributing project authors may
    1.11 + *  be found in the AUTHORS file in the root of the source tree.
    1.12 + */
    1.13 +
    1.14 +#ifndef VP9_COMMON_VP9_SADMXN_H_
    1.15 +#define VP9_COMMON_VP9_SADMXN_H_
    1.16 +
    1.17 +#include "./vpx_config.h"
    1.18 +#include "vpx/vpx_integer.h"
    1.19 +
    1.20 +static INLINE unsigned int sad_mx_n_c(const uint8_t *src_ptr,
    1.21 +                                      int src_stride,
    1.22 +                                      const uint8_t *ref_ptr,
    1.23 +                                      int ref_stride,
    1.24 +                                      int m,
    1.25 +                                      int n) {
    1.26 +  int r, c;
    1.27 +  unsigned int sad = 0;
    1.28 +
    1.29 +  for (r = 0; r < n; r++) {
    1.30 +    for (c = 0; c < m; c++) {
    1.31 +      sad += abs(src_ptr[c] - ref_ptr[c]);
    1.32 +    }
    1.33 +
    1.34 +    src_ptr += src_stride;
    1.35 +    ref_ptr += ref_stride;
    1.36 +  }
    1.37 +
    1.38 +  return sad;
    1.39 +}
    1.40 +
    1.41 +#endif  // VP9_COMMON_VP9_SADMXN_H_

mercurial