Coverage Report

Created: 2025-12-03 07:28

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/aom/aom_dsp/blend_a64_vmask.c
Line
Count
Source
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 <assert.h>
13
14
#include "aom/aom_integer.h"
15
#include "aom_ports/mem.h"
16
#include "aom_dsp/aom_dsp_common.h"
17
#include "aom_dsp/blend.h"
18
19
#include "config/aom_dsp_rtcd.h"
20
21
void aom_blend_a64_vmask_c(uint8_t *dst, uint32_t dst_stride,
22
                           const uint8_t *src0, uint32_t src0_stride,
23
                           const uint8_t *src1, uint32_t src1_stride,
24
1.29k
                           const uint8_t *mask, int w, int h) {
25
1.29k
  int i, j;
26
27
1.29k
  assert(IMPLIES(src0 == dst, src0_stride == dst_stride));
28
1.29k
  assert(IMPLIES(src1 == dst, src1_stride == dst_stride));
29
30
1.29k
  assert(h >= 1);
31
1.29k
  assert(w >= 1);
32
1.29k
  assert(IS_POWER_OF_TWO(h));
33
1.29k
  assert(IS_POWER_OF_TWO(w));
34
35
7.43k
  for (i = 0; i < h; ++i) {
36
6.14k
    const int m = mask[i];
37
53.0k
    for (j = 0; j < w; ++j) {
38
46.9k
      dst[i * dst_stride + j] = AOM_BLEND_A64(m, src0[i * src0_stride + j],
39
46.9k
                                              src1[i * src1_stride + j]);
40
46.9k
    }
41
6.14k
  }
42
1.29k
}
43
44
#if CONFIG_AV1_HIGHBITDEPTH
45
void aom_highbd_blend_a64_vmask_c(uint8_t *dst_8, uint32_t dst_stride,
46
                                  const uint8_t *src0_8, uint32_t src0_stride,
47
                                  const uint8_t *src1_8, uint32_t src1_stride,
48
6.36k
                                  const uint8_t *mask, int w, int h, int bd) {
49
6.36k
  int i, j;
50
6.36k
  uint16_t *dst = CONVERT_TO_SHORTPTR(dst_8);
51
6.36k
  const uint16_t *src0 = CONVERT_TO_SHORTPTR(src0_8);
52
6.36k
  const uint16_t *src1 = CONVERT_TO_SHORTPTR(src1_8);
53
6.36k
  (void)bd;
54
55
6.36k
  assert(IMPLIES(src0 == dst, src0_stride == dst_stride));
56
6.36k
  assert(IMPLIES(src1 == dst, src1_stride == dst_stride));
57
58
6.36k
  assert(h >= 1);
59
6.36k
  assert(w >= 1);
60
6.36k
  assert(IS_POWER_OF_TWO(h));
61
6.36k
  assert(IS_POWER_OF_TWO(w));
62
63
6.36k
  assert(bd == 8 || bd == 10 || bd == 12);
64
65
34.4k
  for (i = 0; i < h; ++i) {
66
28.1k
    const int m = mask[i];
67
258k
    for (j = 0; j < w; ++j) {
68
230k
      dst[i * dst_stride + j] = AOM_BLEND_A64(m, src0[i * src0_stride + j],
69
230k
                                              src1[i * src1_stride + j]);
70
230k
    }
71
28.1k
  }
72
6.36k
}
73
#endif