2 * Copyright (c) 2015 The WebM project authors. All Rights Reserved.
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.
13 #include "./vpx_config.h"
14 #include "./vpx_dsp_rtcd.h"
16 #include "vpx/vpx_integer.h"
17 #include "vpx_ports/mem.h"
19 void vpx_subtract_block_c(int rows, int cols, int16_t *diff,
20 ptrdiff_t diff_stride, const uint8_t *src,
21 ptrdiff_t src_stride, const uint8_t *pred,
22 ptrdiff_t pred_stride) {
25 for (r = 0; r < rows; r++) {
26 for (c = 0; c < cols; c++) diff[c] = src[c] - pred[c];
34 #if CONFIG_VP9_HIGHBITDEPTH
35 void vpx_highbd_subtract_block_c(int rows, int cols, int16_t *diff,
36 ptrdiff_t diff_stride, const uint8_t *src8,
37 ptrdiff_t src_stride, const uint8_t *pred8,
38 ptrdiff_t pred_stride, int bd) {
40 uint16_t *src = CONVERT_TO_SHORTPTR(src8);
41 uint16_t *pred = CONVERT_TO_SHORTPTR(pred8);
44 for (r = 0; r < rows; r++) {
45 for (c = 0; c < cols; c++) {
46 diff[c] = src[c] - pred[c];
54 #endif // CONFIG_VP9_HIGHBITDEPTH