Coverage Report

Created: 2026-05-23 07:06

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libvpx/vp9/common/vp9_scan.h
Line
Count
Source
1
/*
2
 *  Copyright (c) 2013 The WebM project authors. All Rights Reserved.
3
 *
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.
9
 */
10
11
#ifndef VPX_VP9_COMMON_VP9_SCAN_H_
12
#define VPX_VP9_COMMON_VP9_SCAN_H_
13
14
#include "vpx/vpx_integer.h"
15
#include "vpx_ports/mem.h"
16
17
#include "vp9/common/vp9_enums.h"
18
#include "vp9/common/vp9_blockd.h"
19
20
#ifdef __cplusplus
21
extern "C" {
22
#endif
23
24
11.2G
#define MAX_NEIGHBORS 2
25
2.34G
#define MAX_SCAN_VALUE 1024
26
27
typedef struct ScanOrder {
28
  const int16_t *scan;
29
  const int16_t *iscan;
30
  const int16_t *neighbors;
31
} ScanOrder;
32
33
extern const ScanOrder vp9_default_scan_orders[TX_SIZES];
34
extern const ScanOrder vp9_scan_orders[TX_SIZES][TX_TYPES];
35
36
// The return value is at most the maximum value in token_cache.
37
// If N is the maximum value in token_cache, the function returns
38
// (1 + val1 + val2) >> 1, where val1 and val2 are at most N.
39
// The result of this expression is also at most N.
40
static INLINE int get_coef_context(const int16_t *neighbors,
41
5.63G
                                   const uint8_t *token_cache, int c) {
42
5.63G
  return (1 + token_cache[neighbors[MAX_NEIGHBORS * c + 0]] +
43
5.63G
          token_cache[neighbors[MAX_NEIGHBORS * c + 1]]) >>
44
5.63G
         1;
45
5.63G
}
Unexecuted instantiation: vp9_decodeframe.c:get_coef_context
vp9_detokenize.c:get_coef_context
Line
Count
Source
41
191M
                                   const uint8_t *token_cache, int c) {
42
191M
  return (1 + token_cache[neighbors[MAX_NEIGHBORS * c + 0]] +
43
191M
          token_cache[neighbors[MAX_NEIGHBORS * c + 1]]) >>
44
191M
         1;
45
191M
}
Unexecuted instantiation: vp9_decoder.c:get_coef_context
Unexecuted instantiation: vp9_scan.c:get_coef_context
Unexecuted instantiation: vp9_quantize.c:get_coef_context
vp9_tokenize.c:get_coef_context
Line
Count
Source
41
135M
                                   const uint8_t *token_cache, int c) {
42
135M
  return (1 + token_cache[neighbors[MAX_NEIGHBORS * c + 0]] +
43
135M
          token_cache[neighbors[MAX_NEIGHBORS * c + 1]]) >>
44
135M
         1;
45
135M
}
Unexecuted instantiation: vp9_tpl_model.c:get_coef_context
Unexecuted instantiation: vp9_quantize_sse2.c:get_coef_context
Unexecuted instantiation: vp9_quantize_ssse3.c:get_coef_context
Unexecuted instantiation: vp9_quantize_avx2.c:get_coef_context
Unexecuted instantiation: quantize.c:get_coef_context
Unexecuted instantiation: quantize_sse2.c:get_coef_context
Unexecuted instantiation: quantize_ssse3.c:get_coef_context
Unexecuted instantiation: quantize_avx.c:get_coef_context
Unexecuted instantiation: quantize_avx2.c:get_coef_context
Unexecuted instantiation: highbd_quantize_intrin_sse2.c:get_coef_context
Unexecuted instantiation: highbd_quantize_intrin_avx2.c:get_coef_context
vp9_encodemb.c:get_coef_context
Line
Count
Source
41
1.19G
                                   const uint8_t *token_cache, int c) {
42
1.19G
  return (1 + token_cache[neighbors[MAX_NEIGHBORS * c + 0]] +
43
1.19G
          token_cache[neighbors[MAX_NEIGHBORS * c + 1]]) >>
44
1.19G
         1;
45
1.19G
}
vp9_rdopt.c:get_coef_context
Line
Count
Source
41
4.11G
                                   const uint8_t *token_cache, int c) {
42
4.11G
  return (1 + token_cache[neighbors[MAX_NEIGHBORS * c + 0]] +
43
4.11G
          token_cache[neighbors[MAX_NEIGHBORS * c + 1]]) >>
44
4.11G
         1;
45
4.11G
}
Unexecuted instantiation: vp9_pickmode.c:get_coef_context
46
47
static INLINE const ScanOrder *get_scan(const MACROBLOCKD *xd, TX_SIZE tx_size,
48
290M
                                        PLANE_TYPE type, int block_idx) {
49
290M
  const MODE_INFO *const mi = xd->mi[0];
50
51
290M
  if (is_inter_block(mi) || type != PLANE_TYPE_Y || xd->lossless) {
52
229M
    return &vp9_default_scan_orders[tx_size];
53
229M
  } else {
54
60.7M
    const PREDICTION_MODE mode = get_y_mode(mi, block_idx);
55
60.7M
    return &vp9_scan_orders[tx_size][intra_mode_to_tx_type_lookup[mode]];
56
60.7M
  }
57
290M
}
Unexecuted instantiation: vp9_decodeframe.c:get_scan
Unexecuted instantiation: vp9_detokenize.c:get_scan
Unexecuted instantiation: vp9_decoder.c:get_scan
Unexecuted instantiation: vp9_scan.c:get_scan
Unexecuted instantiation: vp9_quantize.c:get_scan
vp9_tokenize.c:get_scan
Line
Count
Source
48
10.5M
                                        PLANE_TYPE type, int block_idx) {
49
10.5M
  const MODE_INFO *const mi = xd->mi[0];
50
51
10.5M
  if (is_inter_block(mi) || type != PLANE_TYPE_Y || xd->lossless) {
52
6.71M
    return &vp9_default_scan_orders[tx_size];
53
6.71M
  } else {
54
3.83M
    const PREDICTION_MODE mode = get_y_mode(mi, block_idx);
55
3.83M
    return &vp9_scan_orders[tx_size][intra_mode_to_tx_type_lookup[mode]];
56
3.83M
  }
57
10.5M
}
Unexecuted instantiation: vp9_tpl_model.c:get_scan
Unexecuted instantiation: vp9_quantize_sse2.c:get_scan
Unexecuted instantiation: vp9_quantize_ssse3.c:get_scan
Unexecuted instantiation: vp9_quantize_avx2.c:get_scan
Unexecuted instantiation: quantize.c:get_scan
Unexecuted instantiation: quantize_sse2.c:get_scan
Unexecuted instantiation: quantize_ssse3.c:get_scan
Unexecuted instantiation: quantize_avx.c:get_scan
Unexecuted instantiation: quantize_avx2.c:get_scan
Unexecuted instantiation: highbd_quantize_intrin_sse2.c:get_scan
Unexecuted instantiation: highbd_quantize_intrin_avx2.c:get_scan
vp9_encodemb.c:get_scan
Line
Count
Source
48
31.2M
                                        PLANE_TYPE type, int block_idx) {
49
31.2M
  const MODE_INFO *const mi = xd->mi[0];
50
51
31.2M
  if (is_inter_block(mi) || type != PLANE_TYPE_Y || xd->lossless) {
52
25.3M
    return &vp9_default_scan_orders[tx_size];
53
25.3M
  } else {
54
5.88M
    const PREDICTION_MODE mode = get_y_mode(mi, block_idx);
55
5.88M
    return &vp9_scan_orders[tx_size][intra_mode_to_tx_type_lookup[mode]];
56
5.88M
  }
57
31.2M
}
vp9_rdopt.c:get_scan
Line
Count
Source
48
248M
                                        PLANE_TYPE type, int block_idx) {
49
248M
  const MODE_INFO *const mi = xd->mi[0];
50
51
248M
  if (is_inter_block(mi) || type != PLANE_TYPE_Y || xd->lossless) {
52
197M
    return &vp9_default_scan_orders[tx_size];
53
197M
  } else {
54
51.0M
    const PREDICTION_MODE mode = get_y_mode(mi, block_idx);
55
51.0M
    return &vp9_scan_orders[tx_size][intra_mode_to_tx_type_lookup[mode]];
56
51.0M
  }
57
248M
}
Unexecuted instantiation: vp9_pickmode.c:get_scan
58
59
#ifdef __cplusplus
60
}  // extern "C"
61
#endif
62
63
#endif  // VPX_VP9_COMMON_VP9_SCAN_H_