/src/libvpx/vp9/common/vp9_pred_common.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* |
2 | | * Copyright (c) 2012 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_PRED_COMMON_H_ |
12 | | #define VPX_VP9_COMMON_VP9_PRED_COMMON_H_ |
13 | | |
14 | | #include "vp9/common/vp9_blockd.h" |
15 | | #include "vp9/common/vp9_onyxc_int.h" |
16 | | #include "vpx_dsp/vpx_dsp_common.h" |
17 | | |
18 | | #ifdef __cplusplus |
19 | | extern "C" { |
20 | | #endif |
21 | | |
22 | | static INLINE int get_segment_id(const VP9_COMMON *cm, |
23 | | const uint8_t *segment_ids, BLOCK_SIZE bsize, |
24 | 0 | int mi_row, int mi_col) { |
25 | 0 | const int mi_offset = mi_row * cm->mi_cols + mi_col; |
26 | 0 | const int bw = num_8x8_blocks_wide_lookup[bsize]; |
27 | 0 | const int bh = num_8x8_blocks_high_lookup[bsize]; |
28 | 0 | const int xmis = VPXMIN(cm->mi_cols - mi_col, bw); |
29 | 0 | const int ymis = VPXMIN(cm->mi_rows - mi_row, bh); |
30 | 0 | int x, y, segment_id = MAX_SEGMENTS; |
31 | |
|
32 | 0 | for (y = 0; y < ymis; ++y) |
33 | 0 | for (x = 0; x < xmis; ++x) |
34 | 0 | segment_id = |
35 | 0 | VPXMIN(segment_id, segment_ids[mi_offset + y * cm->mi_cols + x]); |
36 | |
|
37 | 0 | assert(segment_id >= 0 && segment_id < MAX_SEGMENTS); |
38 | 0 | return segment_id; |
39 | 0 | } Unexecuted instantiation: vp9_rd.c:get_segment_id Unexecuted instantiation: vp9_segmentation.c:get_segment_id Unexecuted instantiation: vp9_tokenize.c:get_segment_id Unexecuted instantiation: vp9_bitstream.c:get_segment_id Unexecuted instantiation: vp9_encodeframe.c:get_segment_id Unexecuted instantiation: vp9_rdopt.c:get_segment_id Unexecuted instantiation: vp9_pickmode.c:get_segment_id Unexecuted instantiation: vp9_pred_common.c:get_segment_id |
40 | | |
41 | 0 | static INLINE int vp9_get_pred_context_seg_id(const MACROBLOCKD *xd) { |
42 | 0 | const MODE_INFO *const above_mi = xd->above_mi; |
43 | 0 | const MODE_INFO *const left_mi = xd->left_mi; |
44 | 0 | const int above_sip = (above_mi != NULL) ? above_mi->seg_id_predicted : 0; |
45 | 0 | const int left_sip = (left_mi != NULL) ? left_mi->seg_id_predicted : 0; |
46 | |
|
47 | 0 | return above_sip + left_sip; |
48 | 0 | } Unexecuted instantiation: vp9_rd.c:vp9_get_pred_context_seg_id Unexecuted instantiation: vp9_segmentation.c:vp9_get_pred_context_seg_id Unexecuted instantiation: vp9_tokenize.c:vp9_get_pred_context_seg_id Unexecuted instantiation: vp9_bitstream.c:vp9_get_pred_context_seg_id Unexecuted instantiation: vp9_encodeframe.c:vp9_get_pred_context_seg_id Unexecuted instantiation: vp9_rdopt.c:vp9_get_pred_context_seg_id Unexecuted instantiation: vp9_pickmode.c:vp9_get_pred_context_seg_id Unexecuted instantiation: vp9_pred_common.c:vp9_get_pred_context_seg_id |
49 | | |
50 | | static INLINE vpx_prob vp9_get_pred_prob_seg_id(const struct segmentation *seg, |
51 | 0 | const MACROBLOCKD *xd) { |
52 | 0 | return seg->pred_probs[vp9_get_pred_context_seg_id(xd)]; |
53 | 0 | } Unexecuted instantiation: vp9_rd.c:vp9_get_pred_prob_seg_id Unexecuted instantiation: vp9_segmentation.c:vp9_get_pred_prob_seg_id Unexecuted instantiation: vp9_tokenize.c:vp9_get_pred_prob_seg_id Unexecuted instantiation: vp9_bitstream.c:vp9_get_pred_prob_seg_id Unexecuted instantiation: vp9_encodeframe.c:vp9_get_pred_prob_seg_id Unexecuted instantiation: vp9_rdopt.c:vp9_get_pred_prob_seg_id Unexecuted instantiation: vp9_pickmode.c:vp9_get_pred_prob_seg_id Unexecuted instantiation: vp9_pred_common.c:vp9_get_pred_prob_seg_id |
54 | | |
55 | 60.3M | static INLINE int vp9_get_skip_context(const MACROBLOCKD *xd) { |
56 | 60.3M | const MODE_INFO *const above_mi = xd->above_mi; |
57 | 60.3M | const MODE_INFO *const left_mi = xd->left_mi; |
58 | 60.3M | const int above_skip = (above_mi != NULL) ? above_mi->skip : 0; |
59 | 60.3M | const int left_skip = (left_mi != NULL) ? left_mi->skip : 0; |
60 | 60.3M | return above_skip + left_skip; |
61 | 60.3M | } Unexecuted instantiation: vp9_rd.c:vp9_get_skip_context Unexecuted instantiation: vp9_segmentation.c:vp9_get_skip_context vp9_tokenize.c:vp9_get_skip_context Line | Count | Source | 55 | 7.54M | static INLINE int vp9_get_skip_context(const MACROBLOCKD *xd) { | 56 | 7.54M | const MODE_INFO *const above_mi = xd->above_mi; | 57 | 7.54M | const MODE_INFO *const left_mi = xd->left_mi; | 58 | 7.54M | const int above_skip = (above_mi != NULL) ? above_mi->skip : 0; | 59 | 7.54M | const int left_skip = (left_mi != NULL) ? left_mi->skip : 0; | 60 | 7.54M | return above_skip + left_skip; | 61 | 7.54M | } |
vp9_bitstream.c:vp9_get_skip_context Line | Count | Source | 55 | 1.89M | static INLINE int vp9_get_skip_context(const MACROBLOCKD *xd) { | 56 | 1.89M | const MODE_INFO *const above_mi = xd->above_mi; | 57 | 1.89M | const MODE_INFO *const left_mi = xd->left_mi; | 58 | 1.89M | const int above_skip = (above_mi != NULL) ? above_mi->skip : 0; | 59 | 1.89M | const int left_skip = (left_mi != NULL) ? left_mi->skip : 0; | 60 | 1.89M | return above_skip + left_skip; | 61 | 1.89M | } |
Unexecuted instantiation: vp9_encodeframe.c:vp9_get_skip_context vp9_rdopt.c:vp9_get_skip_context Line | Count | Source | 55 | 50.8M | static INLINE int vp9_get_skip_context(const MACROBLOCKD *xd) { | 56 | 50.8M | const MODE_INFO *const above_mi = xd->above_mi; | 57 | 50.8M | const MODE_INFO *const left_mi = xd->left_mi; | 58 | 50.8M | const int above_skip = (above_mi != NULL) ? above_mi->skip : 0; | 59 | 50.8M | const int left_skip = (left_mi != NULL) ? left_mi->skip : 0; | 60 | 50.8M | return above_skip + left_skip; | 61 | 50.8M | } |
Unexecuted instantiation: vp9_pickmode.c:vp9_get_skip_context Unexecuted instantiation: vp9_pred_common.c:vp9_get_skip_context |
62 | | |
63 | | static INLINE vpx_prob vp9_get_skip_prob(const VP9_COMMON *cm, |
64 | 52.7M | const MACROBLOCKD *xd) { |
65 | 52.7M | return cm->fc->skip_probs[vp9_get_skip_context(xd)]; |
66 | 52.7M | } Unexecuted instantiation: vp9_rd.c:vp9_get_skip_prob Unexecuted instantiation: vp9_segmentation.c:vp9_get_skip_prob Unexecuted instantiation: vp9_tokenize.c:vp9_get_skip_prob vp9_bitstream.c:vp9_get_skip_prob Line | Count | Source | 64 | 1.89M | const MACROBLOCKD *xd) { | 65 | 1.89M | return cm->fc->skip_probs[vp9_get_skip_context(xd)]; | 66 | 1.89M | } |
Unexecuted instantiation: vp9_encodeframe.c:vp9_get_skip_prob vp9_rdopt.c:vp9_get_skip_prob Line | Count | Source | 64 | 50.8M | const MACROBLOCKD *xd) { | 65 | 50.8M | return cm->fc->skip_probs[vp9_get_skip_context(xd)]; | 66 | 50.8M | } |
Unexecuted instantiation: vp9_pickmode.c:vp9_get_skip_prob Unexecuted instantiation: vp9_pred_common.c:vp9_get_skip_prob |
67 | | |
68 | | // Returns a context number for the given MB prediction signal |
69 | 45.3M | static INLINE int get_pred_context_switchable_interp(const MACROBLOCKD *xd) { |
70 | | // Note: |
71 | | // The mode info data structure has a one element border above and to the |
72 | | // left of the entries corresponding to real macroblocks. |
73 | | // The prediction flags in these dummy entries are initialized to 0. |
74 | 45.3M | const MODE_INFO *const left_mi = xd->left_mi; |
75 | 45.3M | const int left_type = left_mi ? left_mi->interp_filter : SWITCHABLE_FILTERS; |
76 | 45.3M | const MODE_INFO *const above_mi = xd->above_mi; |
77 | 45.3M | const int above_type = |
78 | 45.3M | above_mi ? above_mi->interp_filter : SWITCHABLE_FILTERS; |
79 | | |
80 | 45.3M | if (left_type == above_type) |
81 | 30.8M | return left_type; |
82 | 14.5M | else if (left_type == SWITCHABLE_FILTERS) |
83 | 6.51M | return above_type; |
84 | 8.01M | else if (above_type == SWITCHABLE_FILTERS) |
85 | 6.40M | return left_type; |
86 | 1.60M | else |
87 | 1.60M | return SWITCHABLE_FILTERS; |
88 | 45.3M | } vp9_rd.c:get_pred_context_switchable_interp Line | Count | Source | 69 | 44.7M | static INLINE int get_pred_context_switchable_interp(const MACROBLOCKD *xd) { | 70 | | // Note: | 71 | | // The mode info data structure has a one element border above and to the | 72 | | // left of the entries corresponding to real macroblocks. | 73 | | // The prediction flags in these dummy entries are initialized to 0. | 74 | 44.7M | const MODE_INFO *const left_mi = xd->left_mi; | 75 | 44.7M | const int left_type = left_mi ? left_mi->interp_filter : SWITCHABLE_FILTERS; | 76 | 44.7M | const MODE_INFO *const above_mi = xd->above_mi; | 77 | 44.7M | const int above_type = | 78 | 44.7M | above_mi ? above_mi->interp_filter : SWITCHABLE_FILTERS; | 79 | | | 80 | 44.7M | if (left_type == above_type) | 81 | 30.4M | return left_type; | 82 | 14.2M | else if (left_type == SWITCHABLE_FILTERS) | 83 | 6.43M | return above_type; | 84 | 7.80M | else if (above_type == SWITCHABLE_FILTERS) | 85 | 6.29M | return left_type; | 86 | 1.51M | else | 87 | 1.51M | return SWITCHABLE_FILTERS; | 88 | 44.7M | } |
Unexecuted instantiation: vp9_segmentation.c:get_pred_context_switchable_interp Unexecuted instantiation: vp9_tokenize.c:get_pred_context_switchable_interp vp9_bitstream.c:get_pred_context_switchable_interp Line | Count | Source | 69 | 267k | static INLINE int get_pred_context_switchable_interp(const MACROBLOCKD *xd) { | 70 | | // Note: | 71 | | // The mode info data structure has a one element border above and to the | 72 | | // left of the entries corresponding to real macroblocks. | 73 | | // The prediction flags in these dummy entries are initialized to 0. | 74 | 267k | const MODE_INFO *const left_mi = xd->left_mi; | 75 | 267k | const int left_type = left_mi ? left_mi->interp_filter : SWITCHABLE_FILTERS; | 76 | 267k | const MODE_INFO *const above_mi = xd->above_mi; | 77 | 267k | const int above_type = | 78 | 267k | above_mi ? above_mi->interp_filter : SWITCHABLE_FILTERS; | 79 | | | 80 | 267k | if (left_type == above_type) | 81 | 137k | return left_type; | 82 | 129k | else if (left_type == SWITCHABLE_FILTERS) | 83 | 32.9k | return above_type; | 84 | 96.8k | else if (above_type == SWITCHABLE_FILTERS) | 85 | 51.3k | return left_type; | 86 | 45.4k | else | 87 | 45.4k | return SWITCHABLE_FILTERS; | 88 | 267k | } |
vp9_encodeframe.c:get_pred_context_switchable_interp Line | Count | Source | 69 | 328k | static INLINE int get_pred_context_switchable_interp(const MACROBLOCKD *xd) { | 70 | | // Note: | 71 | | // The mode info data structure has a one element border above and to the | 72 | | // left of the entries corresponding to real macroblocks. | 73 | | // The prediction flags in these dummy entries are initialized to 0. | 74 | 328k | const MODE_INFO *const left_mi = xd->left_mi; | 75 | 328k | const int left_type = left_mi ? left_mi->interp_filter : SWITCHABLE_FILTERS; | 76 | 328k | const MODE_INFO *const above_mi = xd->above_mi; | 77 | 328k | const int above_type = | 78 | 328k | above_mi ? above_mi->interp_filter : SWITCHABLE_FILTERS; | 79 | | | 80 | 328k | if (left_type == above_type) | 81 | 176k | return left_type; | 82 | 151k | else if (left_type == SWITCHABLE_FILTERS) | 83 | 40.6k | return above_type; | 84 | 110k | else if (above_type == SWITCHABLE_FILTERS) | 85 | 64.9k | return left_type; | 86 | 45.4k | else | 87 | 45.4k | return SWITCHABLE_FILTERS; | 88 | 328k | } |
Unexecuted instantiation: vp9_rdopt.c:get_pred_context_switchable_interp Unexecuted instantiation: vp9_pickmode.c:get_pred_context_switchable_interp Unexecuted instantiation: vp9_pred_common.c:get_pred_context_switchable_interp |
89 | | |
90 | | // The mode info data structure has a one element border above and to the |
91 | | // left of the entries corresponding to real macroblocks. |
92 | | // The prediction flags in these dummy entries are initialized to 0. |
93 | | // 0 - inter/inter, inter/--, --/inter, --/-- |
94 | | // 1 - intra/inter, inter/intra |
95 | | // 2 - intra/--, --/intra |
96 | | // 3 - intra/intra |
97 | 8.78M | static INLINE int get_intra_inter_context(const MACROBLOCKD *xd) { |
98 | 8.78M | const MODE_INFO *const above_mi = xd->above_mi; |
99 | 8.78M | const MODE_INFO *const left_mi = xd->left_mi; |
100 | 8.78M | const int has_above = !!above_mi; |
101 | 8.78M | const int has_left = !!left_mi; |
102 | | |
103 | 8.78M | if (has_above && has_left) { // both edges available |
104 | 6.17M | const int above_intra = !is_inter_block(above_mi); |
105 | 6.17M | const int left_intra = !is_inter_block(left_mi); |
106 | 6.17M | return left_intra && above_intra ? 3 : left_intra || above_intra; |
107 | 6.17M | } else if (has_above || has_left) { // one edge available |
108 | 2.29M | return 2 * !is_inter_block(has_above ? above_mi : left_mi); |
109 | 2.29M | } |
110 | 319k | return 0; |
111 | 8.78M | } Unexecuted instantiation: vp9_rd.c:get_intra_inter_context Unexecuted instantiation: vp9_segmentation.c:get_intra_inter_context Unexecuted instantiation: vp9_tokenize.c:get_intra_inter_context vp9_bitstream.c:get_intra_inter_context Line | Count | Source | 97 | 1.39M | static INLINE int get_intra_inter_context(const MACROBLOCKD *xd) { | 98 | 1.39M | const MODE_INFO *const above_mi = xd->above_mi; | 99 | 1.39M | const MODE_INFO *const left_mi = xd->left_mi; | 100 | 1.39M | const int has_above = !!above_mi; | 101 | 1.39M | const int has_left = !!left_mi; | 102 | | | 103 | 1.39M | if (has_above && has_left) { // both edges available | 104 | 1.03M | const int above_intra = !is_inter_block(above_mi); | 105 | 1.03M | const int left_intra = !is_inter_block(left_mi); | 106 | 1.03M | return left_intra && above_intra ? 3 : left_intra || above_intra; | 107 | 1.03M | } else if (has_above || has_left) { // one edge available | 108 | 327k | return 2 * !is_inter_block(has_above ? above_mi : left_mi); | 109 | 327k | } | 110 | 35.1k | return 0; | 111 | 1.39M | } |
vp9_encodeframe.c:get_intra_inter_context Line | Count | Source | 97 | 1.39M | static INLINE int get_intra_inter_context(const MACROBLOCKD *xd) { | 98 | 1.39M | const MODE_INFO *const above_mi = xd->above_mi; | 99 | 1.39M | const MODE_INFO *const left_mi = xd->left_mi; | 100 | 1.39M | const int has_above = !!above_mi; | 101 | 1.39M | const int has_left = !!left_mi; | 102 | | | 103 | 1.39M | if (has_above && has_left) { // both edges available | 104 | 1.03M | const int above_intra = !is_inter_block(above_mi); | 105 | 1.03M | const int left_intra = !is_inter_block(left_mi); | 106 | 1.03M | return left_intra && above_intra ? 3 : left_intra || above_intra; | 107 | 1.03M | } else if (has_above || has_left) { // one edge available | 108 | 327k | return 2 * !is_inter_block(has_above ? above_mi : left_mi); | 109 | 327k | } | 110 | 35.1k | return 0; | 111 | 1.39M | } |
vp9_rdopt.c:get_intra_inter_context Line | Count | Source | 97 | 5.99M | static INLINE int get_intra_inter_context(const MACROBLOCKD *xd) { | 98 | 5.99M | const MODE_INFO *const above_mi = xd->above_mi; | 99 | 5.99M | const MODE_INFO *const left_mi = xd->left_mi; | 100 | 5.99M | const int has_above = !!above_mi; | 101 | 5.99M | const int has_left = !!left_mi; | 102 | | | 103 | 5.99M | if (has_above && has_left) { // both edges available | 104 | 4.10M | const int above_intra = !is_inter_block(above_mi); | 105 | 4.10M | const int left_intra = !is_inter_block(left_mi); | 106 | 4.10M | return left_intra && above_intra ? 3 : left_intra || above_intra; | 107 | 4.10M | } else if (has_above || has_left) { // one edge available | 108 | 1.63M | return 2 * !is_inter_block(has_above ? above_mi : left_mi); | 109 | 1.63M | } | 110 | 249k | return 0; | 111 | 5.99M | } |
Unexecuted instantiation: vp9_pickmode.c:get_intra_inter_context Unexecuted instantiation: vp9_pred_common.c:get_intra_inter_context |
112 | | |
113 | | static INLINE vpx_prob vp9_get_intra_inter_prob(const VP9_COMMON *cm, |
114 | 7.39M | const MACROBLOCKD *xd) { |
115 | 7.39M | return cm->fc->intra_inter_prob[get_intra_inter_context(xd)]; |
116 | 7.39M | } Unexecuted instantiation: vp9_rd.c:vp9_get_intra_inter_prob Unexecuted instantiation: vp9_segmentation.c:vp9_get_intra_inter_prob Unexecuted instantiation: vp9_tokenize.c:vp9_get_intra_inter_prob vp9_bitstream.c:vp9_get_intra_inter_prob Line | Count | Source | 114 | 1.39M | const MACROBLOCKD *xd) { | 115 | 1.39M | return cm->fc->intra_inter_prob[get_intra_inter_context(xd)]; | 116 | 1.39M | } |
Unexecuted instantiation: vp9_encodeframe.c:vp9_get_intra_inter_prob vp9_rdopt.c:vp9_get_intra_inter_prob Line | Count | Source | 114 | 5.99M | const MACROBLOCKD *xd) { | 115 | 5.99M | return cm->fc->intra_inter_prob[get_intra_inter_context(xd)]; | 116 | 5.99M | } |
Unexecuted instantiation: vp9_pickmode.c:vp9_get_intra_inter_prob Unexecuted instantiation: vp9_pred_common.c:vp9_get_intra_inter_prob |
117 | | |
118 | | int vp9_get_reference_mode_context(const VP9_COMMON *cm, const MACROBLOCKD *xd); |
119 | | |
120 | | static INLINE vpx_prob vp9_get_reference_mode_prob(const VP9_COMMON *cm, |
121 | 0 | const MACROBLOCKD *xd) { |
122 | 0 | return cm->fc->comp_inter_prob[vp9_get_reference_mode_context(cm, xd)]; |
123 | 0 | } Unexecuted instantiation: vp9_rd.c:vp9_get_reference_mode_prob Unexecuted instantiation: vp9_segmentation.c:vp9_get_reference_mode_prob Unexecuted instantiation: vp9_tokenize.c:vp9_get_reference_mode_prob Unexecuted instantiation: vp9_bitstream.c:vp9_get_reference_mode_prob Unexecuted instantiation: vp9_encodeframe.c:vp9_get_reference_mode_prob Unexecuted instantiation: vp9_rdopt.c:vp9_get_reference_mode_prob Unexecuted instantiation: vp9_pickmode.c:vp9_get_reference_mode_prob Unexecuted instantiation: vp9_pred_common.c:vp9_get_reference_mode_prob |
124 | | |
125 | | int vp9_get_pred_context_comp_ref_p(const VP9_COMMON *cm, |
126 | | const MACROBLOCKD *xd); |
127 | | |
128 | | static INLINE vpx_prob vp9_get_pred_prob_comp_ref_p(const VP9_COMMON *cm, |
129 | 0 | const MACROBLOCKD *xd) { |
130 | 0 | const int pred_context = vp9_get_pred_context_comp_ref_p(cm, xd); |
131 | 0 | return cm->fc->comp_ref_prob[pred_context]; |
132 | 0 | } Unexecuted instantiation: vp9_rd.c:vp9_get_pred_prob_comp_ref_p Unexecuted instantiation: vp9_segmentation.c:vp9_get_pred_prob_comp_ref_p Unexecuted instantiation: vp9_tokenize.c:vp9_get_pred_prob_comp_ref_p Unexecuted instantiation: vp9_bitstream.c:vp9_get_pred_prob_comp_ref_p Unexecuted instantiation: vp9_encodeframe.c:vp9_get_pred_prob_comp_ref_p Unexecuted instantiation: vp9_rdopt.c:vp9_get_pred_prob_comp_ref_p Unexecuted instantiation: vp9_pickmode.c:vp9_get_pred_prob_comp_ref_p Unexecuted instantiation: vp9_pred_common.c:vp9_get_pred_prob_comp_ref_p |
133 | | |
134 | | int vp9_get_pred_context_single_ref_p1(const MACROBLOCKD *xd); |
135 | | |
136 | | static INLINE vpx_prob vp9_get_pred_prob_single_ref_p1(const VP9_COMMON *cm, |
137 | 6.57M | const MACROBLOCKD *xd) { |
138 | 6.57M | return cm->fc->single_ref_prob[vp9_get_pred_context_single_ref_p1(xd)][0]; |
139 | 6.57M | } Unexecuted instantiation: vp9_rd.c:vp9_get_pred_prob_single_ref_p1 Unexecuted instantiation: vp9_segmentation.c:vp9_get_pred_prob_single_ref_p1 Unexecuted instantiation: vp9_tokenize.c:vp9_get_pred_prob_single_ref_p1 vp9_bitstream.c:vp9_get_pred_prob_single_ref_p1 Line | Count | Source | 137 | 582k | const MACROBLOCKD *xd) { | 138 | 582k | return cm->fc->single_ref_prob[vp9_get_pred_context_single_ref_p1(xd)][0]; | 139 | 582k | } |
Unexecuted instantiation: vp9_encodeframe.c:vp9_get_pred_prob_single_ref_p1 vp9_rdopt.c:vp9_get_pred_prob_single_ref_p1 Line | Count | Source | 137 | 5.99M | const MACROBLOCKD *xd) { | 138 | 5.99M | return cm->fc->single_ref_prob[vp9_get_pred_context_single_ref_p1(xd)][0]; | 139 | 5.99M | } |
Unexecuted instantiation: vp9_pickmode.c:vp9_get_pred_prob_single_ref_p1 Unexecuted instantiation: vp9_pred_common.c:vp9_get_pred_prob_single_ref_p1 |
140 | | |
141 | | int vp9_get_pred_context_single_ref_p2(const MACROBLOCKD *xd); |
142 | | |
143 | | static INLINE vpx_prob vp9_get_pred_prob_single_ref_p2(const VP9_COMMON *cm, |
144 | 6.20M | const MACROBLOCKD *xd) { |
145 | 6.20M | return cm->fc->single_ref_prob[vp9_get_pred_context_single_ref_p2(xd)][1]; |
146 | 6.20M | } Unexecuted instantiation: vp9_rd.c:vp9_get_pred_prob_single_ref_p2 Unexecuted instantiation: vp9_segmentation.c:vp9_get_pred_prob_single_ref_p2 Unexecuted instantiation: vp9_tokenize.c:vp9_get_pred_prob_single_ref_p2 vp9_bitstream.c:vp9_get_pred_prob_single_ref_p2 Line | Count | Source | 144 | 212k | const MACROBLOCKD *xd) { | 145 | 212k | return cm->fc->single_ref_prob[vp9_get_pred_context_single_ref_p2(xd)][1]; | 146 | 212k | } |
Unexecuted instantiation: vp9_encodeframe.c:vp9_get_pred_prob_single_ref_p2 vp9_rdopt.c:vp9_get_pred_prob_single_ref_p2 Line | Count | Source | 144 | 5.99M | const MACROBLOCKD *xd) { | 145 | 5.99M | return cm->fc->single_ref_prob[vp9_get_pred_context_single_ref_p2(xd)][1]; | 146 | 5.99M | } |
Unexecuted instantiation: vp9_pickmode.c:vp9_get_pred_prob_single_ref_p2 Unexecuted instantiation: vp9_pred_common.c:vp9_get_pred_prob_single_ref_p2 |
147 | | |
148 | | int vp9_compound_reference_allowed(const VP9_COMMON *cm); |
149 | | |
150 | | void vp9_setup_compound_reference_mode(VP9_COMMON *cm); |
151 | | |
152 | | // Returns a context number for the given MB prediction signal |
153 | | // The mode info data structure has a one element border above and to the |
154 | | // left of the entries corresponding to real blocks. |
155 | | // The prediction flags in these dummy entries are initialized to 0. |
156 | 24.5M | static INLINE int get_tx_size_context(const MACROBLOCKD *xd) { |
157 | 24.5M | const int max_tx_size = max_txsize_lookup[xd->mi[0]->sb_type]; |
158 | 24.5M | const MODE_INFO *const above_mi = xd->above_mi; |
159 | 24.5M | const MODE_INFO *const left_mi = xd->left_mi; |
160 | 24.5M | const int has_above = !!above_mi; |
161 | 24.5M | const int has_left = !!left_mi; |
162 | 24.5M | int above_ctx = |
163 | 24.5M | (has_above && !above_mi->skip) ? (int)above_mi->tx_size : max_tx_size; |
164 | 24.5M | int left_ctx = |
165 | 24.5M | (has_left && !left_mi->skip) ? (int)left_mi->tx_size : max_tx_size; |
166 | 24.5M | if (!has_left) left_ctx = above_ctx; |
167 | | |
168 | 24.5M | if (!has_above) above_ctx = left_ctx; |
169 | | |
170 | 24.5M | return (above_ctx + left_ctx) > max_tx_size; |
171 | 24.5M | } Unexecuted instantiation: vp9_rd.c:get_tx_size_context Unexecuted instantiation: vp9_segmentation.c:get_tx_size_context Unexecuted instantiation: vp9_tokenize.c:get_tx_size_context vp9_bitstream.c:get_tx_size_context Line | Count | Source | 156 | 378k | static INLINE int get_tx_size_context(const MACROBLOCKD *xd) { | 157 | 378k | const int max_tx_size = max_txsize_lookup[xd->mi[0]->sb_type]; | 158 | 378k | const MODE_INFO *const above_mi = xd->above_mi; | 159 | 378k | const MODE_INFO *const left_mi = xd->left_mi; | 160 | 378k | const int has_above = !!above_mi; | 161 | 378k | const int has_left = !!left_mi; | 162 | 378k | int above_ctx = | 163 | 378k | (has_above && !above_mi->skip) ? (int)above_mi->tx_size : max_tx_size; | 164 | 378k | int left_ctx = | 165 | 378k | (has_left && !left_mi->skip) ? (int)left_mi->tx_size : max_tx_size; | 166 | 378k | if (!has_left) left_ctx = above_ctx; | 167 | | | 168 | 378k | if (!has_above) above_ctx = left_ctx; | 169 | | | 170 | 378k | return (above_ctx + left_ctx) > max_tx_size; | 171 | 378k | } |
vp9_encodeframe.c:get_tx_size_context Line | Count | Source | 156 | 437k | static INLINE int get_tx_size_context(const MACROBLOCKD *xd) { | 157 | 437k | const int max_tx_size = max_txsize_lookup[xd->mi[0]->sb_type]; | 158 | 437k | const MODE_INFO *const above_mi = xd->above_mi; | 159 | 437k | const MODE_INFO *const left_mi = xd->left_mi; | 160 | 437k | const int has_above = !!above_mi; | 161 | 437k | const int has_left = !!left_mi; | 162 | 437k | int above_ctx = | 163 | 437k | (has_above && !above_mi->skip) ? (int)above_mi->tx_size : max_tx_size; | 164 | 437k | int left_ctx = | 165 | 437k | (has_left && !left_mi->skip) ? (int)left_mi->tx_size : max_tx_size; | 166 | 437k | if (!has_left) left_ctx = above_ctx; | 167 | | | 168 | 437k | if (!has_above) above_ctx = left_ctx; | 169 | | | 170 | 437k | return (above_ctx + left_ctx) > max_tx_size; | 171 | 437k | } |
vp9_rdopt.c:get_tx_size_context Line | Count | Source | 156 | 23.7M | static INLINE int get_tx_size_context(const MACROBLOCKD *xd) { | 157 | 23.7M | const int max_tx_size = max_txsize_lookup[xd->mi[0]->sb_type]; | 158 | 23.7M | const MODE_INFO *const above_mi = xd->above_mi; | 159 | 23.7M | const MODE_INFO *const left_mi = xd->left_mi; | 160 | 23.7M | const int has_above = !!above_mi; | 161 | 23.7M | const int has_left = !!left_mi; | 162 | 23.7M | int above_ctx = | 163 | 23.7M | (has_above && !above_mi->skip) ? (int)above_mi->tx_size : max_tx_size; | 164 | 23.7M | int left_ctx = | 165 | 23.7M | (has_left && !left_mi->skip) ? (int)left_mi->tx_size : max_tx_size; | 166 | 23.7M | if (!has_left) left_ctx = above_ctx; | 167 | | | 168 | 23.7M | if (!has_above) above_ctx = left_ctx; | 169 | | | 170 | 23.7M | return (above_ctx + left_ctx) > max_tx_size; | 171 | 23.7M | } |
Unexecuted instantiation: vp9_pickmode.c:get_tx_size_context Unexecuted instantiation: vp9_pred_common.c:get_tx_size_context |
172 | | |
173 | | static INLINE const vpx_prob *get_tx_probs(TX_SIZE max_tx_size, int ctx, |
174 | 632k | const struct tx_probs *tx_probs) { |
175 | 632k | switch (max_tx_size) { |
176 | 406k | case TX_8X8: return tx_probs->p8x8[ctx]; |
177 | 122k | case TX_16X16: return tx_probs->p16x16[ctx]; |
178 | 103k | case TX_32X32: return tx_probs->p32x32[ctx]; |
179 | 0 | default: assert(0 && "Invalid max_tx_size."); return NULL; |
180 | 632k | } |
181 | 632k | } Line | Count | Source | 174 | 253k | const struct tx_probs *tx_probs) { | 175 | 253k | switch (max_tx_size) { | 176 | 84.5k | case TX_8X8: return tx_probs->p8x8[ctx]; | 177 | 84.5k | case TX_16X16: return tx_probs->p16x16[ctx]; | 178 | 84.5k | case TX_32X32: return tx_probs->p32x32[ctx]; | 179 | 0 | default: assert(0 && "Invalid max_tx_size."); return NULL; | 180 | 253k | } | 181 | 253k | } |
Unexecuted instantiation: vp9_segmentation.c:get_tx_probs Unexecuted instantiation: vp9_tokenize.c:get_tx_probs vp9_bitstream.c:get_tx_probs Line | Count | Source | 174 | 378k | const struct tx_probs *tx_probs) { | 175 | 378k | switch (max_tx_size) { | 176 | 322k | case TX_8X8: return tx_probs->p8x8[ctx]; | 177 | 37.8k | case TX_16X16: return tx_probs->p16x16[ctx]; | 178 | 18.5k | case TX_32X32: return tx_probs->p32x32[ctx]; | 179 | 0 | default: assert(0 && "Invalid max_tx_size."); return NULL; | 180 | 378k | } | 181 | 378k | } |
Unexecuted instantiation: vp9_encodeframe.c:get_tx_probs Unexecuted instantiation: vp9_rdopt.c:get_tx_probs Unexecuted instantiation: vp9_pickmode.c:get_tx_probs Unexecuted instantiation: vp9_pred_common.c:get_tx_probs |
182 | | |
183 | | static INLINE unsigned int *get_tx_counts(TX_SIZE max_tx_size, int ctx, |
184 | 437k | struct tx_counts *tx_counts) { |
185 | 437k | switch (max_tx_size) { |
186 | 366k | case TX_8X8: return tx_counts->p8x8[ctx]; |
187 | 42.9k | case TX_16X16: return tx_counts->p16x16[ctx]; |
188 | 28.2k | case TX_32X32: return tx_counts->p32x32[ctx]; |
189 | 0 | default: assert(0 && "Invalid max_tx_size."); return NULL; |
190 | 437k | } |
191 | 437k | } Unexecuted instantiation: vp9_rd.c:get_tx_counts Unexecuted instantiation: vp9_segmentation.c:get_tx_counts Unexecuted instantiation: vp9_tokenize.c:get_tx_counts Unexecuted instantiation: vp9_bitstream.c:get_tx_counts vp9_encodeframe.c:get_tx_counts Line | Count | Source | 184 | 437k | struct tx_counts *tx_counts) { | 185 | 437k | switch (max_tx_size) { | 186 | 366k | case TX_8X8: return tx_counts->p8x8[ctx]; | 187 | 42.9k | case TX_16X16: return tx_counts->p16x16[ctx]; | 188 | 28.2k | case TX_32X32: return tx_counts->p32x32[ctx]; | 189 | 0 | default: assert(0 && "Invalid max_tx_size."); return NULL; | 190 | 437k | } | 191 | 437k | } |
Unexecuted instantiation: vp9_rdopt.c:get_tx_counts Unexecuted instantiation: vp9_pickmode.c:get_tx_counts Unexecuted instantiation: vp9_pred_common.c:get_tx_counts |
192 | | |
193 | | #ifdef __cplusplus |
194 | | } // extern "C" |
195 | | #endif |
196 | | |
197 | | #endif // VPX_VP9_COMMON_VP9_PRED_COMMON_H_ |