/src/aom/av1/common/pred_common.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* |
2 | | * Copyright (c) 2016, Alliance for Open Media. All rights reserved |
3 | | * |
4 | | * This source code is subject to the terms of the BSD 2 Clause License and |
5 | | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License |
6 | | * was not distributed with this source code in the LICENSE file, you can |
7 | | * obtain it at www.aomedia.org/license/software. If the Alliance for Open |
8 | | * Media Patent License 1.0 was not distributed with this source code in the |
9 | | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. |
10 | | */ |
11 | | |
12 | | #ifndef AOM_AV1_COMMON_PRED_COMMON_H_ |
13 | | #define AOM_AV1_COMMON_PRED_COMMON_H_ |
14 | | |
15 | | #include <stdint.h> |
16 | | |
17 | | #include "av1/common/av1_common_int.h" |
18 | | #include "av1/common/blockd.h" |
19 | | #include "av1/common/mvref_common.h" |
20 | | #include "aom_dsp/aom_dsp_common.h" |
21 | | |
22 | | #ifdef __cplusplus |
23 | | extern "C" { |
24 | | #endif |
25 | | |
26 | | static INLINE uint8_t get_segment_id( |
27 | | const CommonModeInfoParams *const mi_params, const uint8_t *segment_ids, |
28 | 7.35M | BLOCK_SIZE bsize, int mi_row, int mi_col) { |
29 | 7.35M | const int mi_offset = mi_row * mi_params->mi_cols + mi_col; |
30 | 7.35M | const int bw = mi_size_wide[bsize]; |
31 | 7.35M | const int bh = mi_size_high[bsize]; |
32 | 7.35M | const int xmis = AOMMIN(mi_params->mi_cols - mi_col, bw); |
33 | 7.35M | const int ymis = AOMMIN(mi_params->mi_rows - mi_row, bh); |
34 | 7.35M | const int seg_stride = mi_params->mi_cols; |
35 | 7.35M | uint8_t segment_id = MAX_SEGMENTS; |
36 | | |
37 | 14.7M | for (int y = 0; y < ymis; ++y) { |
38 | 14.7M | for (int x = 0; x < xmis; ++x) { |
39 | 7.35M | segment_id = |
40 | 7.35M | AOMMIN(segment_id, segment_ids[mi_offset + y * seg_stride + x]); |
41 | 7.35M | } |
42 | 7.35M | } |
43 | | |
44 | 7.35M | assert(segment_id < MAX_SEGMENTS); |
45 | 0 | return segment_id; |
46 | 7.35M | } Unexecuted instantiation: decodeframe.c:get_segment_id decodemv.c:get_segment_id Line | Count | Source | 28 | 7.35M | BLOCK_SIZE bsize, int mi_row, int mi_col) { | 29 | 7.35M | const int mi_offset = mi_row * mi_params->mi_cols + mi_col; | 30 | 7.35M | const int bw = mi_size_wide[bsize]; | 31 | 7.35M | const int bh = mi_size_high[bsize]; | 32 | 7.35M | const int xmis = AOMMIN(mi_params->mi_cols - mi_col, bw); | 33 | 7.35M | const int ymis = AOMMIN(mi_params->mi_rows - mi_row, bh); | 34 | 7.35M | const int seg_stride = mi_params->mi_cols; | 35 | 7.35M | uint8_t segment_id = MAX_SEGMENTS; | 36 | | | 37 | 14.7M | for (int y = 0; y < ymis; ++y) { | 38 | 14.7M | for (int x = 0; x < xmis; ++x) { | 39 | 7.35M | segment_id = | 40 | 7.35M | AOMMIN(segment_id, segment_ids[mi_offset + y * seg_stride + x]); | 41 | 7.35M | } | 42 | 7.35M | } | 43 | | | 44 | 7.35M | assert(segment_id < MAX_SEGMENTS); | 45 | 0 | return segment_id; | 46 | 7.35M | } |
Unexecuted instantiation: pred_common.c:get_segment_id |
47 | | |
48 | | static INLINE uint8_t av1_get_spatial_seg_pred(const AV1_COMMON *const cm, |
49 | | const MACROBLOCKD *const xd, |
50 | | int *cdf_index, |
51 | 2.54M | int skip_over4x4) { |
52 | 2.54M | const int step_size = skip_over4x4 ? 2 : 1; |
53 | 2.54M | uint8_t prev_ul = UINT8_MAX; // top left segment_id |
54 | 2.54M | uint8_t prev_l = UINT8_MAX; // left segment_id |
55 | 2.54M | uint8_t prev_u = UINT8_MAX; // top segment_id |
56 | 2.54M | const int mi_row = xd->mi_row; |
57 | 2.54M | const int mi_col = xd->mi_col; |
58 | 2.54M | const CommonModeInfoParams *const mi_params = &cm->mi_params; |
59 | 2.54M | const uint8_t *seg_map = cm->cur_frame->seg_map; |
60 | 2.54M | if ((xd->up_available) && (xd->left_available)) { |
61 | 2.40M | prev_ul = get_segment_id(mi_params, seg_map, BLOCK_4X4, mi_row - step_size, |
62 | 2.40M | mi_col - step_size); |
63 | 2.40M | } |
64 | 2.54M | if (xd->up_available) { |
65 | 2.46M | prev_u = get_segment_id(mi_params, seg_map, BLOCK_4X4, mi_row - step_size, |
66 | 2.46M | mi_col - 0); |
67 | 2.46M | } |
68 | 2.54M | if (xd->left_available) { |
69 | 2.47M | prev_l = get_segment_id(mi_params, seg_map, BLOCK_4X4, mi_row - 0, |
70 | 2.47M | mi_col - step_size); |
71 | 2.47M | } |
72 | 2.54M | assert(IMPLIES(prev_ul != UINT8_MAX, |
73 | 2.54M | prev_u != UINT8_MAX && prev_l != UINT8_MAX)); |
74 | | |
75 | | // Pick CDF index based on number of matching/out-of-bounds segment IDs. |
76 | 2.54M | if (prev_ul == UINT8_MAX) /* Edge cases */ |
77 | 140k | *cdf_index = 0; |
78 | 2.40M | else if ((prev_ul == prev_u) && (prev_ul == prev_l)) |
79 | 1.04M | *cdf_index = 2; |
80 | 1.36M | else if ((prev_ul == prev_u) || (prev_ul == prev_l) || (prev_u == prev_l)) |
81 | 1.07M | *cdf_index = 1; |
82 | 293k | else |
83 | 293k | *cdf_index = 0; |
84 | | |
85 | | // If 2 or more are identical returns that as predictor, otherwise prev_l. |
86 | 2.54M | if (prev_u == UINT8_MAX) // edge case |
87 | 78.6k | return prev_l == UINT8_MAX ? 0 : prev_l; |
88 | 2.46M | if (prev_l == UINT8_MAX) // edge case |
89 | 61.5k | return prev_u; |
90 | 2.40M | return (prev_ul == prev_u) ? prev_u : prev_l; |
91 | 2.46M | } Unexecuted instantiation: decodeframe.c:av1_get_spatial_seg_pred decodemv.c:av1_get_spatial_seg_pred Line | Count | Source | 51 | 2.54M | int skip_over4x4) { | 52 | 2.54M | const int step_size = skip_over4x4 ? 2 : 1; | 53 | 2.54M | uint8_t prev_ul = UINT8_MAX; // top left segment_id | 54 | 2.54M | uint8_t prev_l = UINT8_MAX; // left segment_id | 55 | 2.54M | uint8_t prev_u = UINT8_MAX; // top segment_id | 56 | 2.54M | const int mi_row = xd->mi_row; | 57 | 2.54M | const int mi_col = xd->mi_col; | 58 | 2.54M | const CommonModeInfoParams *const mi_params = &cm->mi_params; | 59 | 2.54M | const uint8_t *seg_map = cm->cur_frame->seg_map; | 60 | 2.54M | if ((xd->up_available) && (xd->left_available)) { | 61 | 2.40M | prev_ul = get_segment_id(mi_params, seg_map, BLOCK_4X4, mi_row - step_size, | 62 | 2.40M | mi_col - step_size); | 63 | 2.40M | } | 64 | 2.54M | if (xd->up_available) { | 65 | 2.46M | prev_u = get_segment_id(mi_params, seg_map, BLOCK_4X4, mi_row - step_size, | 66 | 2.46M | mi_col - 0); | 67 | 2.46M | } | 68 | 2.54M | if (xd->left_available) { | 69 | 2.47M | prev_l = get_segment_id(mi_params, seg_map, BLOCK_4X4, mi_row - 0, | 70 | 2.47M | mi_col - step_size); | 71 | 2.47M | } | 72 | 2.54M | assert(IMPLIES(prev_ul != UINT8_MAX, | 73 | 2.54M | prev_u != UINT8_MAX && prev_l != UINT8_MAX)); | 74 | | | 75 | | // Pick CDF index based on number of matching/out-of-bounds segment IDs. | 76 | 2.54M | if (prev_ul == UINT8_MAX) /* Edge cases */ | 77 | 140k | *cdf_index = 0; | 78 | 2.40M | else if ((prev_ul == prev_u) && (prev_ul == prev_l)) | 79 | 1.04M | *cdf_index = 2; | 80 | 1.36M | else if ((prev_ul == prev_u) || (prev_ul == prev_l) || (prev_u == prev_l)) | 81 | 1.07M | *cdf_index = 1; | 82 | 293k | else | 83 | 293k | *cdf_index = 0; | 84 | | | 85 | | // If 2 or more are identical returns that as predictor, otherwise prev_l. | 86 | 2.54M | if (prev_u == UINT8_MAX) // edge case | 87 | 78.6k | return prev_l == UINT8_MAX ? 0 : prev_l; | 88 | 2.46M | if (prev_l == UINT8_MAX) // edge case | 89 | 61.5k | return prev_u; | 90 | 2.40M | return (prev_ul == prev_u) ? prev_u : prev_l; | 91 | 2.46M | } |
Unexecuted instantiation: pred_common.c:av1_get_spatial_seg_pred |
92 | | |
93 | 74.8k | static INLINE uint8_t av1_get_pred_context_seg_id(const MACROBLOCKD *xd) { |
94 | 74.8k | const MB_MODE_INFO *const above_mi = xd->above_mbmi; |
95 | 74.8k | const MB_MODE_INFO *const left_mi = xd->left_mbmi; |
96 | 74.8k | const int above_sip = (above_mi != NULL) ? above_mi->seg_id_predicted : 0; |
97 | 74.8k | const int left_sip = (left_mi != NULL) ? left_mi->seg_id_predicted : 0; |
98 | | |
99 | 74.8k | return above_sip + left_sip; |
100 | 74.8k | } Unexecuted instantiation: decodeframe.c:av1_get_pred_context_seg_id decodemv.c:av1_get_pred_context_seg_id Line | Count | Source | 93 | 74.8k | static INLINE uint8_t av1_get_pred_context_seg_id(const MACROBLOCKD *xd) { | 94 | 74.8k | const MB_MODE_INFO *const above_mi = xd->above_mbmi; | 95 | 74.8k | const MB_MODE_INFO *const left_mi = xd->left_mbmi; | 96 | 74.8k | const int above_sip = (above_mi != NULL) ? above_mi->seg_id_predicted : 0; | 97 | 74.8k | const int left_sip = (left_mi != NULL) ? left_mi->seg_id_predicted : 0; | 98 | | | 99 | 74.8k | return above_sip + left_sip; | 100 | 74.8k | } |
Unexecuted instantiation: pred_common.c:av1_get_pred_context_seg_id |
101 | | |
102 | | static INLINE int get_comp_index_context(const AV1_COMMON *cm, |
103 | 338k | const MACROBLOCKD *xd) { |
104 | 338k | MB_MODE_INFO *mbmi = xd->mi[0]; |
105 | 338k | const RefCntBuffer *const bck_buf = get_ref_frame_buf(cm, mbmi->ref_frame[0]); |
106 | 338k | const RefCntBuffer *const fwd_buf = get_ref_frame_buf(cm, mbmi->ref_frame[1]); |
107 | 338k | int bck_frame_index = 0, fwd_frame_index = 0; |
108 | 338k | int cur_frame_index = cm->cur_frame->order_hint; |
109 | | |
110 | 338k | if (bck_buf != NULL) bck_frame_index = bck_buf->order_hint; |
111 | 338k | if (fwd_buf != NULL) fwd_frame_index = fwd_buf->order_hint; |
112 | | |
113 | 338k | int fwd = abs(get_relative_dist(&cm->seq_params->order_hint_info, |
114 | 338k | fwd_frame_index, cur_frame_index)); |
115 | 338k | int bck = abs(get_relative_dist(&cm->seq_params->order_hint_info, |
116 | 338k | cur_frame_index, bck_frame_index)); |
117 | | |
118 | 338k | const MB_MODE_INFO *const above_mi = xd->above_mbmi; |
119 | 338k | const MB_MODE_INFO *const left_mi = xd->left_mbmi; |
120 | | |
121 | 338k | int above_ctx = 0, left_ctx = 0; |
122 | 338k | const int offset = (fwd == bck); |
123 | | |
124 | 338k | if (above_mi != NULL) { |
125 | 322k | if (has_second_ref(above_mi)) |
126 | 220k | above_ctx = above_mi->compound_idx; |
127 | 101k | else if (above_mi->ref_frame[0] == ALTREF_FRAME) |
128 | 13.3k | above_ctx = 1; |
129 | 322k | } |
130 | | |
131 | 338k | if (left_mi != NULL) { |
132 | 332k | if (has_second_ref(left_mi)) |
133 | 233k | left_ctx = left_mi->compound_idx; |
134 | 98.4k | else if (left_mi->ref_frame[0] == ALTREF_FRAME) |
135 | 12.2k | left_ctx = 1; |
136 | 332k | } |
137 | | |
138 | 338k | return above_ctx + left_ctx + 3 * offset; |
139 | 338k | } Unexecuted instantiation: decodeframe.c:get_comp_index_context decodemv.c:get_comp_index_context Line | Count | Source | 103 | 338k | const MACROBLOCKD *xd) { | 104 | 338k | MB_MODE_INFO *mbmi = xd->mi[0]; | 105 | 338k | const RefCntBuffer *const bck_buf = get_ref_frame_buf(cm, mbmi->ref_frame[0]); | 106 | 338k | const RefCntBuffer *const fwd_buf = get_ref_frame_buf(cm, mbmi->ref_frame[1]); | 107 | 338k | int bck_frame_index = 0, fwd_frame_index = 0; | 108 | 338k | int cur_frame_index = cm->cur_frame->order_hint; | 109 | | | 110 | 338k | if (bck_buf != NULL) bck_frame_index = bck_buf->order_hint; | 111 | 338k | if (fwd_buf != NULL) fwd_frame_index = fwd_buf->order_hint; | 112 | | | 113 | 338k | int fwd = abs(get_relative_dist(&cm->seq_params->order_hint_info, | 114 | 338k | fwd_frame_index, cur_frame_index)); | 115 | 338k | int bck = abs(get_relative_dist(&cm->seq_params->order_hint_info, | 116 | 338k | cur_frame_index, bck_frame_index)); | 117 | | | 118 | 338k | const MB_MODE_INFO *const above_mi = xd->above_mbmi; | 119 | 338k | const MB_MODE_INFO *const left_mi = xd->left_mbmi; | 120 | | | 121 | 338k | int above_ctx = 0, left_ctx = 0; | 122 | 338k | const int offset = (fwd == bck); | 123 | | | 124 | 338k | if (above_mi != NULL) { | 125 | 322k | if (has_second_ref(above_mi)) | 126 | 220k | above_ctx = above_mi->compound_idx; | 127 | 101k | else if (above_mi->ref_frame[0] == ALTREF_FRAME) | 128 | 13.3k | above_ctx = 1; | 129 | 322k | } | 130 | | | 131 | 338k | if (left_mi != NULL) { | 132 | 332k | if (has_second_ref(left_mi)) | 133 | 233k | left_ctx = left_mi->compound_idx; | 134 | 98.4k | else if (left_mi->ref_frame[0] == ALTREF_FRAME) | 135 | 12.2k | left_ctx = 1; | 136 | 332k | } | 137 | | | 138 | 338k | return above_ctx + left_ctx + 3 * offset; | 139 | 338k | } |
Unexecuted instantiation: pred_common.c:get_comp_index_context |
140 | | |
141 | 565k | static INLINE int get_comp_group_idx_context(const MACROBLOCKD *xd) { |
142 | 565k | const MB_MODE_INFO *const above_mi = xd->above_mbmi; |
143 | 565k | const MB_MODE_INFO *const left_mi = xd->left_mbmi; |
144 | 565k | int above_ctx = 0, left_ctx = 0; |
145 | | |
146 | 565k | if (above_mi) { |
147 | 531k | if (has_second_ref(above_mi)) |
148 | 362k | above_ctx = above_mi->comp_group_idx; |
149 | 168k | else if (above_mi->ref_frame[0] == ALTREF_FRAME) |
150 | 19.0k | above_ctx = 3; |
151 | 531k | } |
152 | 565k | if (left_mi) { |
153 | 554k | if (has_second_ref(left_mi)) |
154 | 389k | left_ctx = left_mi->comp_group_idx; |
155 | 165k | else if (left_mi->ref_frame[0] == ALTREF_FRAME) |
156 | 19.2k | left_ctx = 3; |
157 | 554k | } |
158 | | |
159 | 565k | return AOMMIN(5, above_ctx + left_ctx); |
160 | 565k | } Unexecuted instantiation: decodeframe.c:get_comp_group_idx_context decodemv.c:get_comp_group_idx_context Line | Count | Source | 141 | 565k | static INLINE int get_comp_group_idx_context(const MACROBLOCKD *xd) { | 142 | 565k | const MB_MODE_INFO *const above_mi = xd->above_mbmi; | 143 | 565k | const MB_MODE_INFO *const left_mi = xd->left_mbmi; | 144 | 565k | int above_ctx = 0, left_ctx = 0; | 145 | | | 146 | 565k | if (above_mi) { | 147 | 531k | if (has_second_ref(above_mi)) | 148 | 362k | above_ctx = above_mi->comp_group_idx; | 149 | 168k | else if (above_mi->ref_frame[0] == ALTREF_FRAME) | 150 | 19.0k | above_ctx = 3; | 151 | 531k | } | 152 | 565k | if (left_mi) { | 153 | 554k | if (has_second_ref(left_mi)) | 154 | 389k | left_ctx = left_mi->comp_group_idx; | 155 | 165k | else if (left_mi->ref_frame[0] == ALTREF_FRAME) | 156 | 19.2k | left_ctx = 3; | 157 | 554k | } | 158 | | | 159 | 565k | return AOMMIN(5, above_ctx + left_ctx); | 160 | 565k | } |
Unexecuted instantiation: pred_common.c:get_comp_group_idx_context |
161 | | |
162 | | static INLINE aom_cdf_prob *av1_get_pred_cdf_seg_id( |
163 | 0 | struct segmentation_probs *segp, const MACROBLOCKD *xd) { |
164 | 0 | return segp->pred_cdf[av1_get_pred_context_seg_id(xd)]; |
165 | 0 | } Unexecuted instantiation: decodeframe.c:av1_get_pred_cdf_seg_id Unexecuted instantiation: decodemv.c:av1_get_pred_cdf_seg_id Unexecuted instantiation: pred_common.c:av1_get_pred_cdf_seg_id |
166 | | |
167 | 396k | static INLINE int av1_get_skip_mode_context(const MACROBLOCKD *xd) { |
168 | 396k | const MB_MODE_INFO *const above_mi = xd->above_mbmi; |
169 | 396k | const MB_MODE_INFO *const left_mi = xd->left_mbmi; |
170 | 396k | const int above_skip_mode = above_mi ? above_mi->skip_mode : 0; |
171 | 396k | const int left_skip_mode = left_mi ? left_mi->skip_mode : 0; |
172 | 396k | return above_skip_mode + left_skip_mode; |
173 | 396k | } Unexecuted instantiation: decodeframe.c:av1_get_skip_mode_context decodemv.c:av1_get_skip_mode_context Line | Count | Source | 167 | 396k | static INLINE int av1_get_skip_mode_context(const MACROBLOCKD *xd) { | 168 | 396k | const MB_MODE_INFO *const above_mi = xd->above_mbmi; | 169 | 396k | const MB_MODE_INFO *const left_mi = xd->left_mbmi; | 170 | 396k | const int above_skip_mode = above_mi ? above_mi->skip_mode : 0; | 171 | 396k | const int left_skip_mode = left_mi ? left_mi->skip_mode : 0; | 172 | 396k | return above_skip_mode + left_skip_mode; | 173 | 396k | } |
Unexecuted instantiation: pred_common.c:av1_get_skip_mode_context |
174 | | |
175 | 12.7M | static INLINE int av1_get_skip_txfm_context(const MACROBLOCKD *xd) { |
176 | 12.7M | const MB_MODE_INFO *const above_mi = xd->above_mbmi; |
177 | 12.7M | const MB_MODE_INFO *const left_mi = xd->left_mbmi; |
178 | 12.7M | const int above_skip_txfm = above_mi ? above_mi->skip_txfm : 0; |
179 | 12.7M | const int left_skip_txfm = left_mi ? left_mi->skip_txfm : 0; |
180 | 12.7M | return above_skip_txfm + left_skip_txfm; |
181 | 12.7M | } Unexecuted instantiation: decodeframe.c:av1_get_skip_txfm_context decodemv.c:av1_get_skip_txfm_context Line | Count | Source | 175 | 12.7M | static INLINE int av1_get_skip_txfm_context(const MACROBLOCKD *xd) { | 176 | 12.7M | const MB_MODE_INFO *const above_mi = xd->above_mbmi; | 177 | 12.7M | const MB_MODE_INFO *const left_mi = xd->left_mbmi; | 178 | 12.7M | const int above_skip_txfm = above_mi ? above_mi->skip_txfm : 0; | 179 | 12.7M | const int left_skip_txfm = left_mi ? left_mi->skip_txfm : 0; | 180 | 12.7M | return above_skip_txfm + left_skip_txfm; | 181 | 12.7M | } |
Unexecuted instantiation: pred_common.c:av1_get_skip_txfm_context |
182 | | |
183 | | int av1_get_pred_context_switchable_interp(const MACROBLOCKD *xd, int dir); |
184 | | |
185 | | // Get a list of palette base colors that are used in the above and left blocks, |
186 | | // referred to as "color cache". The return value is the number of colors in the |
187 | | // cache (<= 2 * PALETTE_MAX_SIZE). The color values are stored in "cache" |
188 | | // in ascending order. |
189 | | int av1_get_palette_cache(const MACROBLOCKD *const xd, int plane, |
190 | | uint16_t *cache); |
191 | | |
192 | 2.22M | static INLINE int av1_get_palette_bsize_ctx(BLOCK_SIZE bsize) { |
193 | 2.22M | assert(bsize < BLOCK_SIZES_ALL); |
194 | 0 | return num_pels_log2_lookup[bsize] - num_pels_log2_lookup[BLOCK_8X8]; |
195 | 2.22M | } Unexecuted instantiation: decodeframe.c:av1_get_palette_bsize_ctx decodemv.c:av1_get_palette_bsize_ctx Line | Count | Source | 192 | 2.22M | static INLINE int av1_get_palette_bsize_ctx(BLOCK_SIZE bsize) { | 193 | 2.22M | assert(bsize < BLOCK_SIZES_ALL); | 194 | 0 | return num_pels_log2_lookup[bsize] - num_pels_log2_lookup[BLOCK_8X8]; | 195 | 2.22M | } |
Unexecuted instantiation: pred_common.c:av1_get_palette_bsize_ctx |
196 | | |
197 | 724k | static INLINE int av1_get_palette_mode_ctx(const MACROBLOCKD *xd) { |
198 | 724k | const MB_MODE_INFO *const above_mi = xd->above_mbmi; |
199 | 724k | const MB_MODE_INFO *const left_mi = xd->left_mbmi; |
200 | 724k | int ctx = 0; |
201 | 724k | if (above_mi) ctx += (above_mi->palette_mode_info.palette_size[0] > 0); |
202 | 724k | if (left_mi) ctx += (left_mi->palette_mode_info.palette_size[0] > 0); |
203 | 724k | return ctx; |
204 | 724k | } Unexecuted instantiation: decodeframe.c:av1_get_palette_mode_ctx decodemv.c:av1_get_palette_mode_ctx Line | Count | Source | 197 | 724k | static INLINE int av1_get_palette_mode_ctx(const MACROBLOCKD *xd) { | 198 | 724k | const MB_MODE_INFO *const above_mi = xd->above_mbmi; | 199 | 724k | const MB_MODE_INFO *const left_mi = xd->left_mbmi; | 200 | 724k | int ctx = 0; | 201 | 724k | if (above_mi) ctx += (above_mi->palette_mode_info.palette_size[0] > 0); | 202 | 724k | if (left_mi) ctx += (left_mi->palette_mode_info.palette_size[0] > 0); | 203 | 724k | return ctx; | 204 | 724k | } |
Unexecuted instantiation: pred_common.c:av1_get_palette_mode_ctx |
205 | | |
206 | | int av1_get_intra_inter_context(const MACROBLOCKD *xd); |
207 | | |
208 | | int av1_get_reference_mode_context(const MACROBLOCKD *xd); |
209 | | |
210 | 0 | static INLINE aom_cdf_prob *av1_get_reference_mode_cdf(const MACROBLOCKD *xd) { |
211 | 0 | return xd->tile_ctx->comp_inter_cdf[av1_get_reference_mode_context(xd)]; |
212 | 0 | } Unexecuted instantiation: decodeframe.c:av1_get_reference_mode_cdf Unexecuted instantiation: decodemv.c:av1_get_reference_mode_cdf Unexecuted instantiation: pred_common.c:av1_get_reference_mode_cdf |
213 | | |
214 | 0 | static INLINE aom_cdf_prob *av1_get_skip_txfm_cdf(const MACROBLOCKD *xd) { |
215 | 0 | return xd->tile_ctx->skip_txfm_cdfs[av1_get_skip_txfm_context(xd)]; |
216 | 0 | } Unexecuted instantiation: decodeframe.c:av1_get_skip_txfm_cdf Unexecuted instantiation: decodemv.c:av1_get_skip_txfm_cdf Unexecuted instantiation: pred_common.c:av1_get_skip_txfm_cdf |
217 | | |
218 | | int av1_get_comp_reference_type_context(const MACROBLOCKD *xd); |
219 | | |
220 | | // == Uni-directional contexts == |
221 | | |
222 | | int av1_get_pred_context_uni_comp_ref_p(const MACROBLOCKD *xd); |
223 | | |
224 | | int av1_get_pred_context_uni_comp_ref_p1(const MACROBLOCKD *xd); |
225 | | |
226 | | int av1_get_pred_context_uni_comp_ref_p2(const MACROBLOCKD *xd); |
227 | | |
228 | | static INLINE aom_cdf_prob *av1_get_comp_reference_type_cdf( |
229 | 0 | const MACROBLOCKD *xd) { |
230 | 0 | const int pred_context = av1_get_comp_reference_type_context(xd); |
231 | 0 | return xd->tile_ctx->comp_ref_type_cdf[pred_context]; |
232 | 0 | } Unexecuted instantiation: decodeframe.c:av1_get_comp_reference_type_cdf Unexecuted instantiation: decodemv.c:av1_get_comp_reference_type_cdf Unexecuted instantiation: pred_common.c:av1_get_comp_reference_type_cdf |
233 | | |
234 | | static INLINE aom_cdf_prob *av1_get_pred_cdf_uni_comp_ref_p( |
235 | 87.1k | const MACROBLOCKD *xd) { |
236 | 87.1k | const int pred_context = av1_get_pred_context_uni_comp_ref_p(xd); |
237 | 87.1k | return xd->tile_ctx->uni_comp_ref_cdf[pred_context][0]; |
238 | 87.1k | } Unexecuted instantiation: decodeframe.c:av1_get_pred_cdf_uni_comp_ref_p decodemv.c:av1_get_pred_cdf_uni_comp_ref_p Line | Count | Source | 235 | 87.1k | const MACROBLOCKD *xd) { | 236 | 87.1k | const int pred_context = av1_get_pred_context_uni_comp_ref_p(xd); | 237 | 87.1k | return xd->tile_ctx->uni_comp_ref_cdf[pred_context][0]; | 238 | 87.1k | } |
Unexecuted instantiation: pred_common.c:av1_get_pred_cdf_uni_comp_ref_p |
239 | | |
240 | | static INLINE aom_cdf_prob *av1_get_pred_cdf_uni_comp_ref_p1( |
241 | 60.5k | const MACROBLOCKD *xd) { |
242 | 60.5k | const int pred_context = av1_get_pred_context_uni_comp_ref_p1(xd); |
243 | 60.5k | return xd->tile_ctx->uni_comp_ref_cdf[pred_context][1]; |
244 | 60.5k | } Unexecuted instantiation: decodeframe.c:av1_get_pred_cdf_uni_comp_ref_p1 decodemv.c:av1_get_pred_cdf_uni_comp_ref_p1 Line | Count | Source | 241 | 60.5k | const MACROBLOCKD *xd) { | 242 | 60.5k | const int pred_context = av1_get_pred_context_uni_comp_ref_p1(xd); | 243 | 60.5k | return xd->tile_ctx->uni_comp_ref_cdf[pred_context][1]; | 244 | 60.5k | } |
Unexecuted instantiation: pred_common.c:av1_get_pred_cdf_uni_comp_ref_p1 |
245 | | |
246 | | static INLINE aom_cdf_prob *av1_get_pred_cdf_uni_comp_ref_p2( |
247 | 37.0k | const MACROBLOCKD *xd) { |
248 | 37.0k | const int pred_context = av1_get_pred_context_uni_comp_ref_p2(xd); |
249 | 37.0k | return xd->tile_ctx->uni_comp_ref_cdf[pred_context][2]; |
250 | 37.0k | } Unexecuted instantiation: decodeframe.c:av1_get_pred_cdf_uni_comp_ref_p2 decodemv.c:av1_get_pred_cdf_uni_comp_ref_p2 Line | Count | Source | 247 | 37.0k | const MACROBLOCKD *xd) { | 248 | 37.0k | const int pred_context = av1_get_pred_context_uni_comp_ref_p2(xd); | 249 | 37.0k | return xd->tile_ctx->uni_comp_ref_cdf[pred_context][2]; | 250 | 37.0k | } |
Unexecuted instantiation: pred_common.c:av1_get_pred_cdf_uni_comp_ref_p2 |
251 | | |
252 | | // == Bi-directional contexts == |
253 | | |
254 | | int av1_get_pred_context_comp_ref_p(const MACROBLOCKD *xd); |
255 | | |
256 | | int av1_get_pred_context_comp_ref_p1(const MACROBLOCKD *xd); |
257 | | |
258 | | int av1_get_pred_context_comp_ref_p2(const MACROBLOCKD *xd); |
259 | | |
260 | | int av1_get_pred_context_comp_bwdref_p(const MACROBLOCKD *xd); |
261 | | |
262 | | int av1_get_pred_context_comp_bwdref_p1(const MACROBLOCKD *xd); |
263 | | |
264 | 487k | static INLINE aom_cdf_prob *av1_get_pred_cdf_comp_ref_p(const MACROBLOCKD *xd) { |
265 | 487k | const int pred_context = av1_get_pred_context_comp_ref_p(xd); |
266 | 487k | return xd->tile_ctx->comp_ref_cdf[pred_context][0]; |
267 | 487k | } Unexecuted instantiation: decodeframe.c:av1_get_pred_cdf_comp_ref_p decodemv.c:av1_get_pred_cdf_comp_ref_p Line | Count | Source | 264 | 487k | static INLINE aom_cdf_prob *av1_get_pred_cdf_comp_ref_p(const MACROBLOCKD *xd) { | 265 | 487k | const int pred_context = av1_get_pred_context_comp_ref_p(xd); | 266 | 487k | return xd->tile_ctx->comp_ref_cdf[pred_context][0]; | 267 | 487k | } |
Unexecuted instantiation: pred_common.c:av1_get_pred_cdf_comp_ref_p |
268 | | |
269 | | static INLINE aom_cdf_prob *av1_get_pred_cdf_comp_ref_p1( |
270 | 378k | const MACROBLOCKD *xd) { |
271 | 378k | const int pred_context = av1_get_pred_context_comp_ref_p1(xd); |
272 | 378k | return xd->tile_ctx->comp_ref_cdf[pred_context][1]; |
273 | 378k | } Unexecuted instantiation: decodeframe.c:av1_get_pred_cdf_comp_ref_p1 decodemv.c:av1_get_pred_cdf_comp_ref_p1 Line | Count | Source | 270 | 378k | const MACROBLOCKD *xd) { | 271 | 378k | const int pred_context = av1_get_pred_context_comp_ref_p1(xd); | 272 | 378k | return xd->tile_ctx->comp_ref_cdf[pred_context][1]; | 273 | 378k | } |
Unexecuted instantiation: pred_common.c:av1_get_pred_cdf_comp_ref_p1 |
274 | | |
275 | | static INLINE aom_cdf_prob *av1_get_pred_cdf_comp_ref_p2( |
276 | 109k | const MACROBLOCKD *xd) { |
277 | 109k | const int pred_context = av1_get_pred_context_comp_ref_p2(xd); |
278 | 109k | return xd->tile_ctx->comp_ref_cdf[pred_context][2]; |
279 | 109k | } Unexecuted instantiation: decodeframe.c:av1_get_pred_cdf_comp_ref_p2 decodemv.c:av1_get_pred_cdf_comp_ref_p2 Line | Count | Source | 276 | 109k | const MACROBLOCKD *xd) { | 277 | 109k | const int pred_context = av1_get_pred_context_comp_ref_p2(xd); | 278 | 109k | return xd->tile_ctx->comp_ref_cdf[pred_context][2]; | 279 | 109k | } |
Unexecuted instantiation: pred_common.c:av1_get_pred_cdf_comp_ref_p2 |
280 | | |
281 | | static INLINE aom_cdf_prob *av1_get_pred_cdf_comp_bwdref_p( |
282 | 487k | const MACROBLOCKD *xd) { |
283 | 487k | const int pred_context = av1_get_pred_context_comp_bwdref_p(xd); |
284 | 487k | return xd->tile_ctx->comp_bwdref_cdf[pred_context][0]; |
285 | 487k | } Unexecuted instantiation: decodeframe.c:av1_get_pred_cdf_comp_bwdref_p decodemv.c:av1_get_pred_cdf_comp_bwdref_p Line | Count | Source | 282 | 487k | const MACROBLOCKD *xd) { | 283 | 487k | const int pred_context = av1_get_pred_context_comp_bwdref_p(xd); | 284 | 487k | return xd->tile_ctx->comp_bwdref_cdf[pred_context][0]; | 285 | 487k | } |
Unexecuted instantiation: pred_common.c:av1_get_pred_cdf_comp_bwdref_p |
286 | | |
287 | | static INLINE aom_cdf_prob *av1_get_pred_cdf_comp_bwdref_p1( |
288 | 241k | const MACROBLOCKD *xd) { |
289 | 241k | const int pred_context = av1_get_pred_context_comp_bwdref_p1(xd); |
290 | 241k | return xd->tile_ctx->comp_bwdref_cdf[pred_context][1]; |
291 | 241k | } Unexecuted instantiation: decodeframe.c:av1_get_pred_cdf_comp_bwdref_p1 decodemv.c:av1_get_pred_cdf_comp_bwdref_p1 Line | Count | Source | 288 | 241k | const MACROBLOCKD *xd) { | 289 | 241k | const int pred_context = av1_get_pred_context_comp_bwdref_p1(xd); | 290 | 241k | return xd->tile_ctx->comp_bwdref_cdf[pred_context][1]; | 291 | 241k | } |
Unexecuted instantiation: pred_common.c:av1_get_pred_cdf_comp_bwdref_p1 |
292 | | |
293 | | // == Single contexts == |
294 | | |
295 | | int av1_get_pred_context_single_ref_p1(const MACROBLOCKD *xd); |
296 | | |
297 | | int av1_get_pred_context_single_ref_p2(const MACROBLOCKD *xd); |
298 | | |
299 | | int av1_get_pred_context_single_ref_p3(const MACROBLOCKD *xd); |
300 | | |
301 | | int av1_get_pred_context_single_ref_p4(const MACROBLOCKD *xd); |
302 | | |
303 | | int av1_get_pred_context_single_ref_p5(const MACROBLOCKD *xd); |
304 | | |
305 | | int av1_get_pred_context_single_ref_p6(const MACROBLOCKD *xd); |
306 | | |
307 | | static INLINE aom_cdf_prob *av1_get_pred_cdf_single_ref_p1( |
308 | 4.10M | const MACROBLOCKD *xd) { |
309 | 4.10M | return xd->tile_ctx |
310 | 4.10M | ->single_ref_cdf[av1_get_pred_context_single_ref_p1(xd)][0]; |
311 | 4.10M | } Unexecuted instantiation: decodeframe.c:av1_get_pred_cdf_single_ref_p1 decodemv.c:av1_get_pred_cdf_single_ref_p1 Line | Count | Source | 308 | 4.10M | const MACROBLOCKD *xd) { | 309 | 4.10M | return xd->tile_ctx | 310 | 4.10M | ->single_ref_cdf[av1_get_pred_context_single_ref_p1(xd)][0]; | 311 | 4.10M | } |
Unexecuted instantiation: pred_common.c:av1_get_pred_cdf_single_ref_p1 |
312 | | static INLINE aom_cdf_prob *av1_get_pred_cdf_single_ref_p2( |
313 | 564k | const MACROBLOCKD *xd) { |
314 | 564k | return xd->tile_ctx |
315 | 564k | ->single_ref_cdf[av1_get_pred_context_single_ref_p2(xd)][1]; |
316 | 564k | } Unexecuted instantiation: decodeframe.c:av1_get_pred_cdf_single_ref_p2 decodemv.c:av1_get_pred_cdf_single_ref_p2 Line | Count | Source | 313 | 564k | const MACROBLOCKD *xd) { | 314 | 564k | return xd->tile_ctx | 315 | 564k | ->single_ref_cdf[av1_get_pred_context_single_ref_p2(xd)][1]; | 316 | 564k | } |
Unexecuted instantiation: pred_common.c:av1_get_pred_cdf_single_ref_p2 |
317 | | static INLINE aom_cdf_prob *av1_get_pred_cdf_single_ref_p3( |
318 | 3.54M | const MACROBLOCKD *xd) { |
319 | 3.54M | return xd->tile_ctx |
320 | 3.54M | ->single_ref_cdf[av1_get_pred_context_single_ref_p3(xd)][2]; |
321 | 3.54M | } Unexecuted instantiation: decodeframe.c:av1_get_pred_cdf_single_ref_p3 decodemv.c:av1_get_pred_cdf_single_ref_p3 Line | Count | Source | 318 | 3.54M | const MACROBLOCKD *xd) { | 319 | 3.54M | return xd->tile_ctx | 320 | 3.54M | ->single_ref_cdf[av1_get_pred_context_single_ref_p3(xd)][2]; | 321 | 3.54M | } |
Unexecuted instantiation: pred_common.c:av1_get_pred_cdf_single_ref_p3 |
322 | | static INLINE aom_cdf_prob *av1_get_pred_cdf_single_ref_p4( |
323 | 3.18M | const MACROBLOCKD *xd) { |
324 | 3.18M | return xd->tile_ctx |
325 | 3.18M | ->single_ref_cdf[av1_get_pred_context_single_ref_p4(xd)][3]; |
326 | 3.18M | } Unexecuted instantiation: decodeframe.c:av1_get_pred_cdf_single_ref_p4 decodemv.c:av1_get_pred_cdf_single_ref_p4 Line | Count | Source | 323 | 3.18M | const MACROBLOCKD *xd) { | 324 | 3.18M | return xd->tile_ctx | 325 | 3.18M | ->single_ref_cdf[av1_get_pred_context_single_ref_p4(xd)][3]; | 326 | 3.18M | } |
Unexecuted instantiation: pred_common.c:av1_get_pred_cdf_single_ref_p4 |
327 | | static INLINE aom_cdf_prob *av1_get_pred_cdf_single_ref_p5( |
328 | 351k | const MACROBLOCKD *xd) { |
329 | 351k | return xd->tile_ctx |
330 | 351k | ->single_ref_cdf[av1_get_pred_context_single_ref_p5(xd)][4]; |
331 | 351k | } Unexecuted instantiation: decodeframe.c:av1_get_pred_cdf_single_ref_p5 decodemv.c:av1_get_pred_cdf_single_ref_p5 Line | Count | Source | 328 | 351k | const MACROBLOCKD *xd) { | 329 | 351k | return xd->tile_ctx | 330 | 351k | ->single_ref_cdf[av1_get_pred_context_single_ref_p5(xd)][4]; | 331 | 351k | } |
Unexecuted instantiation: pred_common.c:av1_get_pred_cdf_single_ref_p5 |
332 | | static INLINE aom_cdf_prob *av1_get_pred_cdf_single_ref_p6( |
333 | 281k | const MACROBLOCKD *xd) { |
334 | 281k | return xd->tile_ctx |
335 | 281k | ->single_ref_cdf[av1_get_pred_context_single_ref_p6(xd)][5]; |
336 | 281k | } Unexecuted instantiation: decodeframe.c:av1_get_pred_cdf_single_ref_p6 decodemv.c:av1_get_pred_cdf_single_ref_p6 Line | Count | Source | 333 | 281k | const MACROBLOCKD *xd) { | 334 | 281k | return xd->tile_ctx | 335 | 281k | ->single_ref_cdf[av1_get_pred_context_single_ref_p6(xd)][5]; | 336 | 281k | } |
Unexecuted instantiation: pred_common.c:av1_get_pred_cdf_single_ref_p6 |
337 | | |
338 | | // Returns a context number for the given MB prediction signal |
339 | | // The mode info data structure has a one element border above and to the |
340 | | // left of the entries corresponding to real blocks. |
341 | | // The prediction flags in these dummy entries are initialized to 0. |
342 | 1.60M | static INLINE int get_tx_size_context(const MACROBLOCKD *xd) { |
343 | 1.60M | const MB_MODE_INFO *mbmi = xd->mi[0]; |
344 | 1.60M | const MB_MODE_INFO *const above_mbmi = xd->above_mbmi; |
345 | 1.60M | const MB_MODE_INFO *const left_mbmi = xd->left_mbmi; |
346 | 1.60M | const TX_SIZE max_tx_size = max_txsize_rect_lookup[mbmi->bsize]; |
347 | 1.60M | const int max_tx_wide = tx_size_wide[max_tx_size]; |
348 | 1.60M | const int max_tx_high = tx_size_high[max_tx_size]; |
349 | 1.60M | const int has_above = xd->up_available; |
350 | 1.60M | const int has_left = xd->left_available; |
351 | | |
352 | 1.60M | int above = xd->above_txfm_context[0] >= max_tx_wide; |
353 | 1.60M | int left = xd->left_txfm_context[0] >= max_tx_high; |
354 | | |
355 | 1.60M | if (has_above) |
356 | 1.49M | if (is_inter_block(above_mbmi)) |
357 | 132k | above = block_size_wide[above_mbmi->bsize] >= max_tx_wide; |
358 | | |
359 | 1.60M | if (has_left) |
360 | 1.49M | if (is_inter_block(left_mbmi)) |
361 | 130k | left = block_size_high[left_mbmi->bsize] >= max_tx_high; |
362 | | |
363 | 1.60M | if (has_above && has_left) |
364 | 1.40M | return (above + left); |
365 | 204k | else if (has_above) |
366 | 88.9k | return above; |
367 | 115k | else if (has_left) |
368 | 95.7k | return left; |
369 | 19.9k | else |
370 | 19.9k | return 0; |
371 | 1.60M | } decodeframe.c:get_tx_size_context Line | Count | Source | 342 | 1.60M | static INLINE int get_tx_size_context(const MACROBLOCKD *xd) { | 343 | 1.60M | const MB_MODE_INFO *mbmi = xd->mi[0]; | 344 | 1.60M | const MB_MODE_INFO *const above_mbmi = xd->above_mbmi; | 345 | 1.60M | const MB_MODE_INFO *const left_mbmi = xd->left_mbmi; | 346 | 1.60M | const TX_SIZE max_tx_size = max_txsize_rect_lookup[mbmi->bsize]; | 347 | 1.60M | const int max_tx_wide = tx_size_wide[max_tx_size]; | 348 | 1.60M | const int max_tx_high = tx_size_high[max_tx_size]; | 349 | 1.60M | const int has_above = xd->up_available; | 350 | 1.60M | const int has_left = xd->left_available; | 351 | | | 352 | 1.60M | int above = xd->above_txfm_context[0] >= max_tx_wide; | 353 | 1.60M | int left = xd->left_txfm_context[0] >= max_tx_high; | 354 | | | 355 | 1.60M | if (has_above) | 356 | 1.49M | if (is_inter_block(above_mbmi)) | 357 | 132k | above = block_size_wide[above_mbmi->bsize] >= max_tx_wide; | 358 | | | 359 | 1.60M | if (has_left) | 360 | 1.49M | if (is_inter_block(left_mbmi)) | 361 | 130k | left = block_size_high[left_mbmi->bsize] >= max_tx_high; | 362 | | | 363 | 1.60M | if (has_above && has_left) | 364 | 1.40M | return (above + left); | 365 | 204k | else if (has_above) | 366 | 88.9k | return above; | 367 | 115k | else if (has_left) | 368 | 95.7k | return left; | 369 | 19.9k | else | 370 | 19.9k | return 0; | 371 | 1.60M | } |
Unexecuted instantiation: decodemv.c:get_tx_size_context Unexecuted instantiation: pred_common.c:get_tx_size_context |
372 | | |
373 | | #ifdef __cplusplus |
374 | | } // extern "C" |
375 | | #endif |
376 | | |
377 | | #endif // AOM_AV1_COMMON_PRED_COMMON_H_ |