Coverage Report

Created: 2026-09-14 08:00

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
7.76G
#define MAX_NEIGHBORS 2
25
1.77G
#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
3.88G
                                   const uint8_t *token_cache, int c) {
42
3.88G
  return (1 + token_cache[neighbors[MAX_NEIGHBORS * c + 0]] +
43
3.88G
          token_cache[neighbors[MAX_NEIGHBORS * c + 1]]) >>
44
3.88G
         1;
45
3.88G
}
Unexecuted instantiation: vp9_decodeframe.c:get_coef_context
vp9_detokenize.c:get_coef_context
Line
Count
Source
41
156M
                                   const uint8_t *token_cache, int c) {
42
156M
  return (1 + token_cache[neighbors[MAX_NEIGHBORS * c + 0]] +
43
156M
          token_cache[neighbors[MAX_NEIGHBORS * c + 1]]) >>
44
156M
         1;
45
156M
}
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
87.7M
                                   const uint8_t *token_cache, int c) {
42
87.7M
  return (1 + token_cache[neighbors[MAX_NEIGHBORS * c + 0]] +
43
87.7M
          token_cache[neighbors[MAX_NEIGHBORS * c + 1]]) >>
44
87.7M
         1;
45
87.7M
}
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
891M
                                   const uint8_t *token_cache, int c) {
42
891M
  return (1 + token_cache[neighbors[MAX_NEIGHBORS * c + 0]] +
43
891M
          token_cache[neighbors[MAX_NEIGHBORS * c + 1]]) >>
44
891M
         1;
45
891M
}
vp9_rdopt.c:get_coef_context
Line
Count
Source
41
2.74G
                                   const uint8_t *token_cache, int c) {
42
2.74G
  return (1 + token_cache[neighbors[MAX_NEIGHBORS * c + 0]] +
43
2.74G
          token_cache[neighbors[MAX_NEIGHBORS * c + 1]]) >>
44
2.74G
         1;
45
2.74G
}
Unexecuted instantiation: vp9_pickmode.c:get_coef_context
46
47
static INLINE const ScanOrder *get_scan(const MACROBLOCKD *xd, TX_SIZE tx_size,
48
190M
                                        PLANE_TYPE type, int block_idx) {
49
190M
  const MODE_INFO *const mi = xd->mi[0];
50
51
190M
  if (is_inter_block(mi) || type != PLANE_TYPE_Y || xd->lossless) {
52
148M
    return &vp9_default_scan_orders[tx_size];
53
148M
  } else {
54
41.9M
    const PREDICTION_MODE mode = get_y_mode(mi, block_idx);
55
41.9M
    return &vp9_scan_orders[tx_size][intra_mode_to_tx_type_lookup[mode]];
56
41.9M
  }
57
190M
}
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
7.00M
                                        PLANE_TYPE type, int block_idx) {
49
7.00M
  const MODE_INFO *const mi = xd->mi[0];
50
51
7.00M
  if (is_inter_block(mi) || type != PLANE_TYPE_Y || xd->lossless) {
52
4.37M
    return &vp9_default_scan_orders[tx_size];
53
4.37M
  } else {
54
2.62M
    const PREDICTION_MODE mode = get_y_mode(mi, block_idx);
55
2.62M
    return &vp9_scan_orders[tx_size][intra_mode_to_tx_type_lookup[mode]];
56
2.62M
  }
57
7.00M
}
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
23.3M
                                        PLANE_TYPE type, int block_idx) {
49
23.3M
  const MODE_INFO *const mi = xd->mi[0];
50
51
23.3M
  if (is_inter_block(mi) || type != PLANE_TYPE_Y || xd->lossless) {
52
18.7M
    return &vp9_default_scan_orders[tx_size];
53
18.7M
  } else {
54
4.62M
    const PREDICTION_MODE mode = get_y_mode(mi, block_idx);
55
4.62M
    return &vp9_scan_orders[tx_size][intra_mode_to_tx_type_lookup[mode]];
56
4.62M
  }
57
23.3M
}
vp9_rdopt.c:get_scan
Line
Count
Source
48
159M
                                        PLANE_TYPE type, int block_idx) {
49
159M
  const MODE_INFO *const mi = xd->mi[0];
50
51
159M
  if (is_inter_block(mi) || type != PLANE_TYPE_Y || xd->lossless) {
52
124M
    return &vp9_default_scan_orders[tx_size];
53
124M
  } else {
54
34.7M
    const PREDICTION_MODE mode = get_y_mode(mi, block_idx);
55
34.7M
    return &vp9_scan_orders[tx_size][intra_mode_to_tx_type_lookup[mode]];
56
34.7M
  }
57
159M
}
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_