Coverage Report

Created: 2026-04-01 07:42

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
10.4G
#define MAX_NEIGHBORS 2
25
2.29G
#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.22G
                                   const uint8_t *token_cache, int c) {
42
5.22G
  return (1 + token_cache[neighbors[MAX_NEIGHBORS * c + 0]] +
43
5.22G
          token_cache[neighbors[MAX_NEIGHBORS * c + 1]]) >>
44
5.22G
         1;
45
5.22G
}
Unexecuted instantiation: vp9_decodeframe.c:get_coef_context
vp9_detokenize.c:get_coef_context
Line
Count
Source
41
153M
                                   const uint8_t *token_cache, int c) {
42
153M
  return (1 + token_cache[neighbors[MAX_NEIGHBORS * c + 0]] +
43
153M
          token_cache[neighbors[MAX_NEIGHBORS * c + 1]]) >>
44
153M
         1;
45
153M
}
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
121M
                                   const uint8_t *token_cache, int c) {
42
121M
  return (1 + token_cache[neighbors[MAX_NEIGHBORS * c + 0]] +
43
121M
          token_cache[neighbors[MAX_NEIGHBORS * c + 1]]) >>
44
121M
         1;
45
121M
}
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.14G
                                   const uint8_t *token_cache, int c) {
42
1.14G
  return (1 + token_cache[neighbors[MAX_NEIGHBORS * c + 0]] +
43
1.14G
          token_cache[neighbors[MAX_NEIGHBORS * c + 1]]) >>
44
1.14G
         1;
45
1.14G
}
vp9_rdopt.c:get_coef_context
Line
Count
Source
41
3.80G
                                   const uint8_t *token_cache, int c) {
42
3.80G
  return (1 + token_cache[neighbors[MAX_NEIGHBORS * c + 0]] +
43
3.80G
          token_cache[neighbors[MAX_NEIGHBORS * c + 1]]) >>
44
3.80G
         1;
45
3.80G
}
Unexecuted instantiation: vp9_pickmode.c:get_coef_context
46
47
static INLINE const ScanOrder *get_scan(const MACROBLOCKD *xd, TX_SIZE tx_size,
48
260M
                                        PLANE_TYPE type, int block_idx) {
49
260M
  const MODE_INFO *const mi = xd->mi[0];
50
51
260M
  if (is_inter_block(mi) || type != PLANE_TYPE_Y || xd->lossless) {
52
204M
    return &vp9_default_scan_orders[tx_size];
53
204M
  } else {
54
55.7M
    const PREDICTION_MODE mode = get_y_mode(mi, block_idx);
55
55.7M
    return &vp9_scan_orders[tx_size][intra_mode_to_tx_type_lookup[mode]];
56
55.7M
  }
57
260M
}
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
9.42M
                                        PLANE_TYPE type, int block_idx) {
49
9.42M
  const MODE_INFO *const mi = xd->mi[0];
50
51
9.42M
  if (is_inter_block(mi) || type != PLANE_TYPE_Y || xd->lossless) {
52
5.87M
    return &vp9_default_scan_orders[tx_size];
53
5.87M
  } else {
54
3.55M
    const PREDICTION_MODE mode = get_y_mode(mi, block_idx);
55
3.55M
    return &vp9_scan_orders[tx_size][intra_mode_to_tx_type_lookup[mode]];
56
3.55M
  }
57
9.42M
}
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
29.1M
                                        PLANE_TYPE type, int block_idx) {
49
29.1M
  const MODE_INFO *const mi = xd->mi[0];
50
51
29.1M
  if (is_inter_block(mi) || type != PLANE_TYPE_Y || xd->lossless) {
52
23.4M
    return &vp9_default_scan_orders[tx_size];
53
23.4M
  } else {
54
5.68M
    const PREDICTION_MODE mode = get_y_mode(mi, block_idx);
55
5.68M
    return &vp9_scan_orders[tx_size][intra_mode_to_tx_type_lookup[mode]];
56
5.68M
  }
57
29.1M
}
vp9_rdopt.c:get_scan
Line
Count
Source
48
222M
                                        PLANE_TYPE type, int block_idx) {
49
222M
  const MODE_INFO *const mi = xd->mi[0];
50
51
222M
  if (is_inter_block(mi) || type != PLANE_TYPE_Y || xd->lossless) {
52
175M
    return &vp9_default_scan_orders[tx_size];
53
175M
  } else {
54
46.5M
    const PREDICTION_MODE mode = get_y_mode(mi, block_idx);
55
46.5M
    return &vp9_scan_orders[tx_size][intra_mode_to_tx_type_lookup[mode]];
56
46.5M
  }
57
222M
}
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_