Coverage Report

Created: 2022-08-24 06:17

/src/aom/aom_dsp/subtract.c
Line
Count
Source (jump to first uncovered line)
1
/*
2
 * Copyright (c) 2016, Alliance for Open Media. All rights reserved
3
 *
4
 * This source code is subject to the terms of the BSD 2 Clause License and
5
 * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
6
 * was not distributed with this source code in the LICENSE file, you can
7
 * obtain it at www.aomedia.org/license/software. If the Alliance for Open
8
 * Media Patent License 1.0 was not distributed with this source code in the
9
 * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
10
 */
11
12
#include <stdlib.h>
13
14
#include "config/aom_config.h"
15
#include "config/aom_dsp_rtcd.h"
16
17
#include "aom/aom_integer.h"
18
#include "aom_ports/mem.h"
19
20
void aom_subtract_block_c(int rows, int cols, int16_t *diff,
21
                          ptrdiff_t diff_stride, const uint8_t *src,
22
                          ptrdiff_t src_stride, const uint8_t *pred,
23
51.7M
                          ptrdiff_t pred_stride) {
24
51.7M
  int r, c;
25
26
389M
  for (r = 0; r < rows; r++) {
27
5.47G
    for (c = 0; c < cols; c++) diff[c] = src[c] - pred[c];
28
29
337M
    diff += diff_stride;
30
337M
    pred += pred_stride;
31
337M
    src += src_stride;
32
337M
  }
33
51.7M
}
34
35
#if CONFIG_AV1_HIGHBITDEPTH
36
void aom_highbd_subtract_block_c(int rows, int cols, int16_t *diff,
37
                                 ptrdiff_t diff_stride, const uint8_t *src8,
38
                                 ptrdiff_t src_stride, const uint8_t *pred8,
39
0
                                 ptrdiff_t pred_stride, int bd) {
40
0
  int r, c;
41
0
  uint16_t *src = CONVERT_TO_SHORTPTR(src8);
42
0
  uint16_t *pred = CONVERT_TO_SHORTPTR(pred8);
43
0
  (void)bd;
44
45
0
  for (r = 0; r < rows; r++) {
46
0
    for (c = 0; c < cols; c++) {
47
0
      diff[c] = src[c] - pred[c];
48
0
    }
49
50
0
    diff += diff_stride;
51
0
    pred += pred_stride;
52
0
    src += src_stride;
53
0
  }
54
0
}
55
#endif