Coverage Report

Created: 2024-09-06 07:53

/src/libvpx/vp9/encoder/vp9_cost.h
Line
Count
Source (jump to first uncovered line)
1
/*
2
 *  Copyright (c) 2014 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_ENCODER_VP9_COST_H_
12
#define VPX_VP9_ENCODER_VP9_COST_H_
13
14
#include "vpx_dsp/prob.h"
15
#include "vpx/vpx_integer.h"
16
17
#ifdef __cplusplus
18
extern "C" {
19
#endif
20
21
extern const uint16_t vp9_prob_cost[256];
22
23
// The factor to scale from cost in bits to cost in vp9_prob_cost units.
24
233M
#define VP9_PROB_COST_SHIFT 9
25
26
3.74G
#define vp9_cost_zero(prob) (vp9_prob_cost[prob])
27
28
1.25G
#define vp9_cost_one(prob) vp9_cost_zero(256 - (prob))
29
30
1.21G
#define vp9_cost_bit(prob, bit) vp9_cost_zero((bit) ? 256 - (prob) : (prob))
31
32
1.22G
static INLINE uint64_t cost_branch256(const unsigned int ct[2], vpx_prob p) {
33
1.22G
  return (uint64_t)ct[0] * vp9_cost_zero(p) + (uint64_t)ct[1] * vp9_cost_one(p);
34
1.22G
}
Unexecuted instantiation: vp9_cx_iface.c:cost_branch256
Unexecuted instantiation: vp9_firstpass.c:cost_branch256
Unexecuted instantiation: vp9_mcomp.c:cost_branch256
Unexecuted instantiation: vp9_encoder.c:cost_branch256
Unexecuted instantiation: vp9_picklpf.c:cost_branch256
Unexecuted instantiation: vp9_quantize.c:cost_branch256
Unexecuted instantiation: vp9_ratectrl.c:cost_branch256
Unexecuted instantiation: vp9_rd.c:cost_branch256
Unexecuted instantiation: vp9_segmentation.c:cost_branch256
Unexecuted instantiation: vp9_speed_features.c:cost_branch256
Unexecuted instantiation: vp9_svc_layercontext.c:cost_branch256
Unexecuted instantiation: vp9_tokenize.c:cost_branch256
Unexecuted instantiation: vp9_aq_variance.c:cost_branch256
Unexecuted instantiation: vp9_aq_360.c:cost_branch256
Unexecuted instantiation: vp9_aq_cyclicrefresh.c:cost_branch256
Unexecuted instantiation: vp9_aq_complexity.c:cost_branch256
Unexecuted instantiation: vp9_alt_ref_aq.c:cost_branch256
Unexecuted instantiation: vp9_skin_detection.c:cost_branch256
Unexecuted instantiation: vp9_noise_estimate.c:cost_branch256
Unexecuted instantiation: vp9_ext_ratectrl.c:cost_branch256
Unexecuted instantiation: vp9_temporal_filter.c:cost_branch256
Unexecuted instantiation: vp9_tpl_model.c:cost_branch256
Unexecuted instantiation: vp9_mbgraph.c:cost_branch256
Unexecuted instantiation: vp9_bitstream.c:cost_branch256
Unexecuted instantiation: vp9_context_tree.c:cost_branch256
Unexecuted instantiation: vp9_cost.c:cost_branch256
Unexecuted instantiation: vp9_encodeframe.c:cost_branch256
Unexecuted instantiation: vp9_encodemb.c:cost_branch256
vp9_encodemv.c:cost_branch256
Line
Count
Source
32
4.69M
static INLINE uint64_t cost_branch256(const unsigned int ct[2], vpx_prob p) {
33
4.69M
  return (uint64_t)ct[0] * vp9_cost_zero(p) + (uint64_t)ct[1] * vp9_cost_one(p);
34
4.69M
}
Unexecuted instantiation: vp9_ethread.c:cost_branch256
Unexecuted instantiation: vp9_frame_scale.c:cost_branch256
Unexecuted instantiation: vp9_lookahead.c:cost_branch256
Unexecuted instantiation: vp9_multi_thread.c:cost_branch256
Unexecuted instantiation: vp9_rdopt.c:cost_branch256
Unexecuted instantiation: vp9_pickmode.c:cost_branch256
vp9_subexp.c:cost_branch256
Line
Count
Source
32
1.22G
static INLINE uint64_t cost_branch256(const unsigned int ct[2], vpx_prob p) {
33
1.22G
  return (uint64_t)ct[0] * vp9_cost_zero(p) + (uint64_t)ct[1] * vp9_cost_one(p);
34
1.22G
}
Unexecuted instantiation: temporal_filter_sse4.c:cost_branch256
Unexecuted instantiation: highbd_temporal_filter_sse4.c:cost_branch256
35
36
static INLINE int treed_cost(vpx_tree tree, const vpx_prob *probs, int bits,
37
0
                             int len) {
38
0
  int cost = 0;
39
0
  vpx_tree_index i = 0;
40
0
41
0
  do {
42
0
    const int bit = (bits >> --len) & 1;
43
0
    cost += vp9_cost_bit(probs[i >> 1], bit);
44
0
    i = tree[i + bit];
45
0
  } while (len);
46
0
47
0
  return cost;
48
0
}
Unexecuted instantiation: vp9_cx_iface.c:treed_cost
Unexecuted instantiation: vp9_firstpass.c:treed_cost
Unexecuted instantiation: vp9_mcomp.c:treed_cost
Unexecuted instantiation: vp9_encoder.c:treed_cost
Unexecuted instantiation: vp9_picklpf.c:treed_cost
Unexecuted instantiation: vp9_quantize.c:treed_cost
Unexecuted instantiation: vp9_ratectrl.c:treed_cost
Unexecuted instantiation: vp9_rd.c:treed_cost
Unexecuted instantiation: vp9_segmentation.c:treed_cost
Unexecuted instantiation: vp9_speed_features.c:treed_cost
Unexecuted instantiation: vp9_svc_layercontext.c:treed_cost
Unexecuted instantiation: vp9_tokenize.c:treed_cost
Unexecuted instantiation: vp9_aq_variance.c:treed_cost
Unexecuted instantiation: vp9_aq_360.c:treed_cost
Unexecuted instantiation: vp9_aq_cyclicrefresh.c:treed_cost
Unexecuted instantiation: vp9_aq_complexity.c:treed_cost
Unexecuted instantiation: vp9_alt_ref_aq.c:treed_cost
Unexecuted instantiation: vp9_skin_detection.c:treed_cost
Unexecuted instantiation: vp9_noise_estimate.c:treed_cost
Unexecuted instantiation: vp9_ext_ratectrl.c:treed_cost
Unexecuted instantiation: vp9_temporal_filter.c:treed_cost
Unexecuted instantiation: vp9_tpl_model.c:treed_cost
Unexecuted instantiation: vp9_mbgraph.c:treed_cost
Unexecuted instantiation: vp9_bitstream.c:treed_cost
Unexecuted instantiation: vp9_context_tree.c:treed_cost
Unexecuted instantiation: vp9_cost.c:treed_cost
Unexecuted instantiation: vp9_encodeframe.c:treed_cost
Unexecuted instantiation: vp9_encodemb.c:treed_cost
Unexecuted instantiation: vp9_encodemv.c:treed_cost
Unexecuted instantiation: vp9_ethread.c:treed_cost
Unexecuted instantiation: vp9_frame_scale.c:treed_cost
Unexecuted instantiation: vp9_lookahead.c:treed_cost
Unexecuted instantiation: vp9_multi_thread.c:treed_cost
Unexecuted instantiation: vp9_rdopt.c:treed_cost
Unexecuted instantiation: vp9_pickmode.c:treed_cost
Unexecuted instantiation: vp9_subexp.c:treed_cost
Unexecuted instantiation: temporal_filter_sse4.c:treed_cost
Unexecuted instantiation: highbd_temporal_filter_sse4.c:treed_cost
49
50
void vp9_cost_tokens(int *costs, const vpx_prob *probs, vpx_tree tree);
51
void vp9_cost_tokens_skip(int *costs, const vpx_prob *probs, vpx_tree tree);
52
53
#ifdef __cplusplus
54
}  // extern "C"
55
#endif
56
57
#endif  // VPX_VP9_ENCODER_VP9_COST_H_