/src/aom/av1/encoder/rdopt_utils.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* |
2 | | * Copyright (c) 2019, 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_ENCODER_RDOPT_UTILS_H_ |
13 | | #define AOM_AV1_ENCODER_RDOPT_UTILS_H_ |
14 | | |
15 | | #include "aom/aom_integer.h" |
16 | | #include "av1/encoder/block.h" |
17 | | #include "av1/common/cfl.h" |
18 | | #include "av1/common/pred_common.h" |
19 | | #include "av1/encoder/rdopt_data_defs.h" |
20 | | |
21 | | #ifdef __cplusplus |
22 | | extern "C" { |
23 | | #endif |
24 | | |
25 | 0 | #define MAX_REF_MV_SEARCH 3 |
26 | | #define MAX_TX_RD_GATE_LEVEL 5 |
27 | 0 | #define INTER_INTRA_RD_THRESH_SCALE 9 |
28 | 0 | #define INTER_INTRA_RD_THRESH_SHIFT 4 |
29 | | |
30 | | typedef struct { |
31 | | PREDICTION_MODE mode; |
32 | | MV_REFERENCE_FRAME ref_frame[2]; |
33 | | } MODE_DEFINITION; |
34 | | |
35 | | // This array defines the mapping from the enums in THR_MODES to the actual |
36 | | // prediction modes and refrence frames |
37 | | static const MODE_DEFINITION av1_mode_defs[MAX_MODES] = { |
38 | | { NEARESTMV, { LAST_FRAME, NONE_FRAME } }, |
39 | | { NEARESTMV, { LAST2_FRAME, NONE_FRAME } }, |
40 | | { NEARESTMV, { LAST3_FRAME, NONE_FRAME } }, |
41 | | { NEARESTMV, { BWDREF_FRAME, NONE_FRAME } }, |
42 | | { NEARESTMV, { ALTREF2_FRAME, NONE_FRAME } }, |
43 | | { NEARESTMV, { ALTREF_FRAME, NONE_FRAME } }, |
44 | | { NEARESTMV, { GOLDEN_FRAME, NONE_FRAME } }, |
45 | | |
46 | | { NEWMV, { LAST_FRAME, NONE_FRAME } }, |
47 | | { NEWMV, { LAST2_FRAME, NONE_FRAME } }, |
48 | | { NEWMV, { LAST3_FRAME, NONE_FRAME } }, |
49 | | { NEWMV, { BWDREF_FRAME, NONE_FRAME } }, |
50 | | { NEWMV, { ALTREF2_FRAME, NONE_FRAME } }, |
51 | | { NEWMV, { ALTREF_FRAME, NONE_FRAME } }, |
52 | | { NEWMV, { GOLDEN_FRAME, NONE_FRAME } }, |
53 | | |
54 | | { NEARMV, { LAST_FRAME, NONE_FRAME } }, |
55 | | { NEARMV, { LAST2_FRAME, NONE_FRAME } }, |
56 | | { NEARMV, { LAST3_FRAME, NONE_FRAME } }, |
57 | | { NEARMV, { BWDREF_FRAME, NONE_FRAME } }, |
58 | | { NEARMV, { ALTREF2_FRAME, NONE_FRAME } }, |
59 | | { NEARMV, { ALTREF_FRAME, NONE_FRAME } }, |
60 | | { NEARMV, { GOLDEN_FRAME, NONE_FRAME } }, |
61 | | |
62 | | { GLOBALMV, { LAST_FRAME, NONE_FRAME } }, |
63 | | { GLOBALMV, { LAST2_FRAME, NONE_FRAME } }, |
64 | | { GLOBALMV, { LAST3_FRAME, NONE_FRAME } }, |
65 | | { GLOBALMV, { BWDREF_FRAME, NONE_FRAME } }, |
66 | | { GLOBALMV, { ALTREF2_FRAME, NONE_FRAME } }, |
67 | | { GLOBALMV, { ALTREF_FRAME, NONE_FRAME } }, |
68 | | { GLOBALMV, { GOLDEN_FRAME, NONE_FRAME } }, |
69 | | |
70 | | // TODO(zoeliu): May need to reconsider the order on the modes to check |
71 | | |
72 | | { NEAREST_NEARESTMV, { LAST_FRAME, ALTREF_FRAME } }, |
73 | | { NEAREST_NEARESTMV, { LAST2_FRAME, ALTREF_FRAME } }, |
74 | | { NEAREST_NEARESTMV, { LAST3_FRAME, ALTREF_FRAME } }, |
75 | | { NEAREST_NEARESTMV, { GOLDEN_FRAME, ALTREF_FRAME } }, |
76 | | { NEAREST_NEARESTMV, { LAST_FRAME, BWDREF_FRAME } }, |
77 | | { NEAREST_NEARESTMV, { LAST2_FRAME, BWDREF_FRAME } }, |
78 | | { NEAREST_NEARESTMV, { LAST3_FRAME, BWDREF_FRAME } }, |
79 | | { NEAREST_NEARESTMV, { GOLDEN_FRAME, BWDREF_FRAME } }, |
80 | | { NEAREST_NEARESTMV, { LAST_FRAME, ALTREF2_FRAME } }, |
81 | | { NEAREST_NEARESTMV, { LAST2_FRAME, ALTREF2_FRAME } }, |
82 | | { NEAREST_NEARESTMV, { LAST3_FRAME, ALTREF2_FRAME } }, |
83 | | { NEAREST_NEARESTMV, { GOLDEN_FRAME, ALTREF2_FRAME } }, |
84 | | |
85 | | { NEAREST_NEARESTMV, { LAST_FRAME, LAST2_FRAME } }, |
86 | | { NEAREST_NEARESTMV, { LAST_FRAME, LAST3_FRAME } }, |
87 | | { NEAREST_NEARESTMV, { LAST_FRAME, GOLDEN_FRAME } }, |
88 | | { NEAREST_NEARESTMV, { BWDREF_FRAME, ALTREF_FRAME } }, |
89 | | |
90 | | { NEAR_NEARMV, { LAST_FRAME, BWDREF_FRAME } }, |
91 | | { NEW_NEWMV, { LAST_FRAME, BWDREF_FRAME } }, |
92 | | { NEW_NEARESTMV, { LAST_FRAME, BWDREF_FRAME } }, |
93 | | { NEAREST_NEWMV, { LAST_FRAME, BWDREF_FRAME } }, |
94 | | { NEW_NEARMV, { LAST_FRAME, BWDREF_FRAME } }, |
95 | | { NEAR_NEWMV, { LAST_FRAME, BWDREF_FRAME } }, |
96 | | { GLOBAL_GLOBALMV, { LAST_FRAME, BWDREF_FRAME } }, |
97 | | |
98 | | { NEAR_NEARMV, { LAST_FRAME, ALTREF_FRAME } }, |
99 | | { NEW_NEWMV, { LAST_FRAME, ALTREF_FRAME } }, |
100 | | { NEW_NEARESTMV, { LAST_FRAME, ALTREF_FRAME } }, |
101 | | { NEAREST_NEWMV, { LAST_FRAME, ALTREF_FRAME } }, |
102 | | { NEW_NEARMV, { LAST_FRAME, ALTREF_FRAME } }, |
103 | | { NEAR_NEWMV, { LAST_FRAME, ALTREF_FRAME } }, |
104 | | { GLOBAL_GLOBALMV, { LAST_FRAME, ALTREF_FRAME } }, |
105 | | |
106 | | { NEAR_NEARMV, { LAST2_FRAME, ALTREF_FRAME } }, |
107 | | { NEW_NEWMV, { LAST2_FRAME, ALTREF_FRAME } }, |
108 | | { NEW_NEARESTMV, { LAST2_FRAME, ALTREF_FRAME } }, |
109 | | { NEAREST_NEWMV, { LAST2_FRAME, ALTREF_FRAME } }, |
110 | | { NEW_NEARMV, { LAST2_FRAME, ALTREF_FRAME } }, |
111 | | { NEAR_NEWMV, { LAST2_FRAME, ALTREF_FRAME } }, |
112 | | { GLOBAL_GLOBALMV, { LAST2_FRAME, ALTREF_FRAME } }, |
113 | | |
114 | | { NEAR_NEARMV, { LAST3_FRAME, ALTREF_FRAME } }, |
115 | | { NEW_NEWMV, { LAST3_FRAME, ALTREF_FRAME } }, |
116 | | { NEW_NEARESTMV, { LAST3_FRAME, ALTREF_FRAME } }, |
117 | | { NEAREST_NEWMV, { LAST3_FRAME, ALTREF_FRAME } }, |
118 | | { NEW_NEARMV, { LAST3_FRAME, ALTREF_FRAME } }, |
119 | | { NEAR_NEWMV, { LAST3_FRAME, ALTREF_FRAME } }, |
120 | | { GLOBAL_GLOBALMV, { LAST3_FRAME, ALTREF_FRAME } }, |
121 | | |
122 | | { NEAR_NEARMV, { GOLDEN_FRAME, ALTREF_FRAME } }, |
123 | | { NEW_NEWMV, { GOLDEN_FRAME, ALTREF_FRAME } }, |
124 | | { NEW_NEARESTMV, { GOLDEN_FRAME, ALTREF_FRAME } }, |
125 | | { NEAREST_NEWMV, { GOLDEN_FRAME, ALTREF_FRAME } }, |
126 | | { NEW_NEARMV, { GOLDEN_FRAME, ALTREF_FRAME } }, |
127 | | { NEAR_NEWMV, { GOLDEN_FRAME, ALTREF_FRAME } }, |
128 | | { GLOBAL_GLOBALMV, { GOLDEN_FRAME, ALTREF_FRAME } }, |
129 | | |
130 | | { NEAR_NEARMV, { LAST2_FRAME, BWDREF_FRAME } }, |
131 | | { NEW_NEWMV, { LAST2_FRAME, BWDREF_FRAME } }, |
132 | | { NEW_NEARESTMV, { LAST2_FRAME, BWDREF_FRAME } }, |
133 | | { NEAREST_NEWMV, { LAST2_FRAME, BWDREF_FRAME } }, |
134 | | { NEW_NEARMV, { LAST2_FRAME, BWDREF_FRAME } }, |
135 | | { NEAR_NEWMV, { LAST2_FRAME, BWDREF_FRAME } }, |
136 | | { GLOBAL_GLOBALMV, { LAST2_FRAME, BWDREF_FRAME } }, |
137 | | |
138 | | { NEAR_NEARMV, { LAST3_FRAME, BWDREF_FRAME } }, |
139 | | { NEW_NEWMV, { LAST3_FRAME, BWDREF_FRAME } }, |
140 | | { NEW_NEARESTMV, { LAST3_FRAME, BWDREF_FRAME } }, |
141 | | { NEAREST_NEWMV, { LAST3_FRAME, BWDREF_FRAME } }, |
142 | | { NEW_NEARMV, { LAST3_FRAME, BWDREF_FRAME } }, |
143 | | { NEAR_NEWMV, { LAST3_FRAME, BWDREF_FRAME } }, |
144 | | { GLOBAL_GLOBALMV, { LAST3_FRAME, BWDREF_FRAME } }, |
145 | | |
146 | | { NEAR_NEARMV, { GOLDEN_FRAME, BWDREF_FRAME } }, |
147 | | { NEW_NEWMV, { GOLDEN_FRAME, BWDREF_FRAME } }, |
148 | | { NEW_NEARESTMV, { GOLDEN_FRAME, BWDREF_FRAME } }, |
149 | | { NEAREST_NEWMV, { GOLDEN_FRAME, BWDREF_FRAME } }, |
150 | | { NEW_NEARMV, { GOLDEN_FRAME, BWDREF_FRAME } }, |
151 | | { NEAR_NEWMV, { GOLDEN_FRAME, BWDREF_FRAME } }, |
152 | | { GLOBAL_GLOBALMV, { GOLDEN_FRAME, BWDREF_FRAME } }, |
153 | | |
154 | | { NEAR_NEARMV, { LAST_FRAME, ALTREF2_FRAME } }, |
155 | | { NEW_NEWMV, { LAST_FRAME, ALTREF2_FRAME } }, |
156 | | { NEW_NEARESTMV, { LAST_FRAME, ALTREF2_FRAME } }, |
157 | | { NEAREST_NEWMV, { LAST_FRAME, ALTREF2_FRAME } }, |
158 | | { NEW_NEARMV, { LAST_FRAME, ALTREF2_FRAME } }, |
159 | | { NEAR_NEWMV, { LAST_FRAME, ALTREF2_FRAME } }, |
160 | | { GLOBAL_GLOBALMV, { LAST_FRAME, ALTREF2_FRAME } }, |
161 | | |
162 | | { NEAR_NEARMV, { LAST2_FRAME, ALTREF2_FRAME } }, |
163 | | { NEW_NEWMV, { LAST2_FRAME, ALTREF2_FRAME } }, |
164 | | { NEW_NEARESTMV, { LAST2_FRAME, ALTREF2_FRAME } }, |
165 | | { NEAREST_NEWMV, { LAST2_FRAME, ALTREF2_FRAME } }, |
166 | | { NEW_NEARMV, { LAST2_FRAME, ALTREF2_FRAME } }, |
167 | | { NEAR_NEWMV, { LAST2_FRAME, ALTREF2_FRAME } }, |
168 | | { GLOBAL_GLOBALMV, { LAST2_FRAME, ALTREF2_FRAME } }, |
169 | | |
170 | | { NEAR_NEARMV, { LAST3_FRAME, ALTREF2_FRAME } }, |
171 | | { NEW_NEWMV, { LAST3_FRAME, ALTREF2_FRAME } }, |
172 | | { NEW_NEARESTMV, { LAST3_FRAME, ALTREF2_FRAME } }, |
173 | | { NEAREST_NEWMV, { LAST3_FRAME, ALTREF2_FRAME } }, |
174 | | { NEW_NEARMV, { LAST3_FRAME, ALTREF2_FRAME } }, |
175 | | { NEAR_NEWMV, { LAST3_FRAME, ALTREF2_FRAME } }, |
176 | | { GLOBAL_GLOBALMV, { LAST3_FRAME, ALTREF2_FRAME } }, |
177 | | |
178 | | { NEAR_NEARMV, { GOLDEN_FRAME, ALTREF2_FRAME } }, |
179 | | { NEW_NEWMV, { GOLDEN_FRAME, ALTREF2_FRAME } }, |
180 | | { NEW_NEARESTMV, { GOLDEN_FRAME, ALTREF2_FRAME } }, |
181 | | { NEAREST_NEWMV, { GOLDEN_FRAME, ALTREF2_FRAME } }, |
182 | | { NEW_NEARMV, { GOLDEN_FRAME, ALTREF2_FRAME } }, |
183 | | { NEAR_NEWMV, { GOLDEN_FRAME, ALTREF2_FRAME } }, |
184 | | { GLOBAL_GLOBALMV, { GOLDEN_FRAME, ALTREF2_FRAME } }, |
185 | | |
186 | | { NEAR_NEARMV, { LAST_FRAME, LAST2_FRAME } }, |
187 | | { NEW_NEWMV, { LAST_FRAME, LAST2_FRAME } }, |
188 | | { NEW_NEARESTMV, { LAST_FRAME, LAST2_FRAME } }, |
189 | | { NEAREST_NEWMV, { LAST_FRAME, LAST2_FRAME } }, |
190 | | { NEW_NEARMV, { LAST_FRAME, LAST2_FRAME } }, |
191 | | { NEAR_NEWMV, { LAST_FRAME, LAST2_FRAME } }, |
192 | | { GLOBAL_GLOBALMV, { LAST_FRAME, LAST2_FRAME } }, |
193 | | |
194 | | { NEAR_NEARMV, { LAST_FRAME, LAST3_FRAME } }, |
195 | | { NEW_NEWMV, { LAST_FRAME, LAST3_FRAME } }, |
196 | | { NEW_NEARESTMV, { LAST_FRAME, LAST3_FRAME } }, |
197 | | { NEAREST_NEWMV, { LAST_FRAME, LAST3_FRAME } }, |
198 | | { NEW_NEARMV, { LAST_FRAME, LAST3_FRAME } }, |
199 | | { NEAR_NEWMV, { LAST_FRAME, LAST3_FRAME } }, |
200 | | { GLOBAL_GLOBALMV, { LAST_FRAME, LAST3_FRAME } }, |
201 | | |
202 | | { NEAR_NEARMV, { LAST_FRAME, GOLDEN_FRAME } }, |
203 | | { NEW_NEWMV, { LAST_FRAME, GOLDEN_FRAME } }, |
204 | | { NEW_NEARESTMV, { LAST_FRAME, GOLDEN_FRAME } }, |
205 | | { NEAREST_NEWMV, { LAST_FRAME, GOLDEN_FRAME } }, |
206 | | { NEW_NEARMV, { LAST_FRAME, GOLDEN_FRAME } }, |
207 | | { NEAR_NEWMV, { LAST_FRAME, GOLDEN_FRAME } }, |
208 | | { GLOBAL_GLOBALMV, { LAST_FRAME, GOLDEN_FRAME } }, |
209 | | |
210 | | { NEAR_NEARMV, { BWDREF_FRAME, ALTREF_FRAME } }, |
211 | | { NEW_NEWMV, { BWDREF_FRAME, ALTREF_FRAME } }, |
212 | | { NEW_NEARESTMV, { BWDREF_FRAME, ALTREF_FRAME } }, |
213 | | { NEAREST_NEWMV, { BWDREF_FRAME, ALTREF_FRAME } }, |
214 | | { NEW_NEARMV, { BWDREF_FRAME, ALTREF_FRAME } }, |
215 | | { NEAR_NEWMV, { BWDREF_FRAME, ALTREF_FRAME } }, |
216 | | { GLOBAL_GLOBALMV, { BWDREF_FRAME, ALTREF_FRAME } }, |
217 | | |
218 | | // intra modes |
219 | | { DC_PRED, { INTRA_FRAME, NONE_FRAME } }, |
220 | | { PAETH_PRED, { INTRA_FRAME, NONE_FRAME } }, |
221 | | { SMOOTH_PRED, { INTRA_FRAME, NONE_FRAME } }, |
222 | | { SMOOTH_V_PRED, { INTRA_FRAME, NONE_FRAME } }, |
223 | | { SMOOTH_H_PRED, { INTRA_FRAME, NONE_FRAME } }, |
224 | | { H_PRED, { INTRA_FRAME, NONE_FRAME } }, |
225 | | { V_PRED, { INTRA_FRAME, NONE_FRAME } }, |
226 | | { D135_PRED, { INTRA_FRAME, NONE_FRAME } }, |
227 | | { D203_PRED, { INTRA_FRAME, NONE_FRAME } }, |
228 | | { D157_PRED, { INTRA_FRAME, NONE_FRAME } }, |
229 | | { D67_PRED, { INTRA_FRAME, NONE_FRAME } }, |
230 | | { D113_PRED, { INTRA_FRAME, NONE_FRAME } }, |
231 | | { D45_PRED, { INTRA_FRAME, NONE_FRAME } }, |
232 | | }; |
233 | | |
234 | | // Number of winner modes allowed for different values of the speed feature |
235 | | // multi_winner_mode_type. |
236 | | static const int winner_mode_count_allowed[MULTI_WINNER_MODE_LEVELS] = { |
237 | | 1, // MULTI_WINNER_MODE_OFF |
238 | | 2, // MULTI_WINNER_MODE_FAST |
239 | | 3 // MULTI_WINNER_MODE_DEFAULT |
240 | | }; |
241 | | |
242 | | static inline void restore_dst_buf(MACROBLOCKD *xd, const BUFFER_SET dst, |
243 | 0 | const int num_planes) { |
244 | 0 | for (int i = 0; i < num_planes; i++) { |
245 | 0 | xd->plane[i].dst.buf = dst.plane[i]; |
246 | 0 | xd->plane[i].dst.stride = dst.stride[i]; |
247 | 0 | } |
248 | 0 | } Unexecuted instantiation: av1_cx_iface.c:restore_dst_buf Unexecuted instantiation: allintra_vis.c:restore_dst_buf Unexecuted instantiation: encodeframe.c:restore_dst_buf Unexecuted instantiation: encodeframe_utils.c:restore_dst_buf Unexecuted instantiation: encodemb.c:restore_dst_buf Unexecuted instantiation: encoder.c:restore_dst_buf Unexecuted instantiation: encoder_utils.c:restore_dst_buf Unexecuted instantiation: encodetxb.c:restore_dst_buf Unexecuted instantiation: ethread.c:restore_dst_buf Unexecuted instantiation: firstpass.c:restore_dst_buf Unexecuted instantiation: global_motion_facade.c:restore_dst_buf Unexecuted instantiation: mcomp.c:restore_dst_buf Unexecuted instantiation: palette.c:restore_dst_buf Unexecuted instantiation: partition_search.c:restore_dst_buf Unexecuted instantiation: partition_strategy.c:restore_dst_buf Unexecuted instantiation: rd.c:restore_dst_buf Unexecuted instantiation: rdopt.c:restore_dst_buf Unexecuted instantiation: nonrd_pickmode.c:restore_dst_buf Unexecuted instantiation: nonrd_opt.c:restore_dst_buf Unexecuted instantiation: speed_features.c:restore_dst_buf Unexecuted instantiation: superres_scale.c:restore_dst_buf Unexecuted instantiation: svc_layercontext.c:restore_dst_buf Unexecuted instantiation: temporal_filter.c:restore_dst_buf Unexecuted instantiation: tokenize.c:restore_dst_buf Unexecuted instantiation: tpl_model.c:restore_dst_buf Unexecuted instantiation: tx_search.c:restore_dst_buf Unexecuted instantiation: intra_mode_search.c:restore_dst_buf Unexecuted instantiation: var_based_part.c:restore_dst_buf Unexecuted instantiation: compound_type.c:restore_dst_buf Unexecuted instantiation: encode_strategy.c:restore_dst_buf Unexecuted instantiation: interp_search.c:restore_dst_buf Unexecuted instantiation: motion_search_facade.c:restore_dst_buf |
249 | | |
250 | | static inline void swap_dst_buf(MACROBLOCKD *xd, const BUFFER_SET *dst_bufs[2], |
251 | 0 | int num_planes) { |
252 | 0 | const BUFFER_SET *buf0 = dst_bufs[0]; |
253 | 0 | dst_bufs[0] = dst_bufs[1]; |
254 | 0 | dst_bufs[1] = buf0; |
255 | 0 | restore_dst_buf(xd, *dst_bufs[0], num_planes); |
256 | 0 | } Unexecuted instantiation: av1_cx_iface.c:swap_dst_buf Unexecuted instantiation: allintra_vis.c:swap_dst_buf Unexecuted instantiation: encodeframe.c:swap_dst_buf Unexecuted instantiation: encodeframe_utils.c:swap_dst_buf Unexecuted instantiation: encodemb.c:swap_dst_buf Unexecuted instantiation: encoder.c:swap_dst_buf Unexecuted instantiation: encoder_utils.c:swap_dst_buf Unexecuted instantiation: encodetxb.c:swap_dst_buf Unexecuted instantiation: ethread.c:swap_dst_buf Unexecuted instantiation: firstpass.c:swap_dst_buf Unexecuted instantiation: global_motion_facade.c:swap_dst_buf Unexecuted instantiation: mcomp.c:swap_dst_buf Unexecuted instantiation: palette.c:swap_dst_buf Unexecuted instantiation: partition_search.c:swap_dst_buf Unexecuted instantiation: partition_strategy.c:swap_dst_buf Unexecuted instantiation: rd.c:swap_dst_buf Unexecuted instantiation: rdopt.c:swap_dst_buf Unexecuted instantiation: nonrd_pickmode.c:swap_dst_buf Unexecuted instantiation: nonrd_opt.c:swap_dst_buf Unexecuted instantiation: speed_features.c:swap_dst_buf Unexecuted instantiation: superres_scale.c:swap_dst_buf Unexecuted instantiation: svc_layercontext.c:swap_dst_buf Unexecuted instantiation: temporal_filter.c:swap_dst_buf Unexecuted instantiation: tokenize.c:swap_dst_buf Unexecuted instantiation: tpl_model.c:swap_dst_buf Unexecuted instantiation: tx_search.c:swap_dst_buf Unexecuted instantiation: intra_mode_search.c:swap_dst_buf Unexecuted instantiation: var_based_part.c:swap_dst_buf Unexecuted instantiation: compound_type.c:swap_dst_buf Unexecuted instantiation: encode_strategy.c:swap_dst_buf Unexecuted instantiation: interp_search.c:swap_dst_buf Unexecuted instantiation: motion_search_facade.c:swap_dst_buf |
257 | | |
258 | | /* clang-format on */ |
259 | | // Calculate rd threshold based on ref best rd and relevant scaling factors |
260 | | static inline int64_t get_rd_thresh_from_best_rd(int64_t ref_best_rd, |
261 | | int mul_factor, |
262 | 0 | int div_factor) { |
263 | 0 | int64_t rd_thresh = ref_best_rd; |
264 | 0 | if (div_factor != 0) { |
265 | 0 | rd_thresh = ref_best_rd < (div_factor * (INT64_MAX / mul_factor)) |
266 | 0 | ? ((ref_best_rd / div_factor) * mul_factor) |
267 | 0 | : INT64_MAX; |
268 | 0 | } |
269 | 0 | return rd_thresh; |
270 | 0 | } Unexecuted instantiation: av1_cx_iface.c:get_rd_thresh_from_best_rd Unexecuted instantiation: allintra_vis.c:get_rd_thresh_from_best_rd Unexecuted instantiation: encodeframe.c:get_rd_thresh_from_best_rd Unexecuted instantiation: encodeframe_utils.c:get_rd_thresh_from_best_rd Unexecuted instantiation: encodemb.c:get_rd_thresh_from_best_rd Unexecuted instantiation: encoder.c:get_rd_thresh_from_best_rd Unexecuted instantiation: encoder_utils.c:get_rd_thresh_from_best_rd Unexecuted instantiation: encodetxb.c:get_rd_thresh_from_best_rd Unexecuted instantiation: ethread.c:get_rd_thresh_from_best_rd Unexecuted instantiation: firstpass.c:get_rd_thresh_from_best_rd Unexecuted instantiation: global_motion_facade.c:get_rd_thresh_from_best_rd Unexecuted instantiation: mcomp.c:get_rd_thresh_from_best_rd Unexecuted instantiation: palette.c:get_rd_thresh_from_best_rd Unexecuted instantiation: partition_search.c:get_rd_thresh_from_best_rd Unexecuted instantiation: partition_strategy.c:get_rd_thresh_from_best_rd Unexecuted instantiation: rd.c:get_rd_thresh_from_best_rd Unexecuted instantiation: rdopt.c:get_rd_thresh_from_best_rd Unexecuted instantiation: nonrd_pickmode.c:get_rd_thresh_from_best_rd Unexecuted instantiation: nonrd_opt.c:get_rd_thresh_from_best_rd Unexecuted instantiation: speed_features.c:get_rd_thresh_from_best_rd Unexecuted instantiation: superres_scale.c:get_rd_thresh_from_best_rd Unexecuted instantiation: svc_layercontext.c:get_rd_thresh_from_best_rd Unexecuted instantiation: temporal_filter.c:get_rd_thresh_from_best_rd Unexecuted instantiation: tokenize.c:get_rd_thresh_from_best_rd Unexecuted instantiation: tpl_model.c:get_rd_thresh_from_best_rd Unexecuted instantiation: tx_search.c:get_rd_thresh_from_best_rd Unexecuted instantiation: intra_mode_search.c:get_rd_thresh_from_best_rd Unexecuted instantiation: var_based_part.c:get_rd_thresh_from_best_rd Unexecuted instantiation: compound_type.c:get_rd_thresh_from_best_rd Unexecuted instantiation: encode_strategy.c:get_rd_thresh_from_best_rd Unexecuted instantiation: interp_search.c:get_rd_thresh_from_best_rd Unexecuted instantiation: motion_search_facade.c:get_rd_thresh_from_best_rd |
271 | | |
272 | | static inline THR_MODES get_prediction_mode_idx( |
273 | | PREDICTION_MODE this_mode, MV_REFERENCE_FRAME ref_frame, |
274 | 0 | MV_REFERENCE_FRAME second_ref_frame) { |
275 | 0 | if (this_mode < INTRA_MODE_END) { |
276 | 0 | assert(ref_frame == INTRA_FRAME); |
277 | 0 | assert(second_ref_frame == NONE_FRAME); |
278 | 0 | return intra_to_mode_idx[this_mode - INTRA_MODE_START]; |
279 | 0 | } |
280 | 0 | if (this_mode >= SINGLE_INTER_MODE_START && |
281 | 0 | this_mode < SINGLE_INTER_MODE_END) { |
282 | 0 | assert((ref_frame > INTRA_FRAME) && (ref_frame <= ALTREF_FRAME)); |
283 | 0 | return single_inter_to_mode_idx[this_mode - SINGLE_INTER_MODE_START] |
284 | 0 | [ref_frame]; |
285 | 0 | } |
286 | 0 | if (this_mode >= COMP_INTER_MODE_START && this_mode < COMP_INTER_MODE_END && |
287 | 0 | second_ref_frame != NONE_FRAME) { |
288 | 0 | assert((ref_frame > INTRA_FRAME) && (ref_frame <= ALTREF_FRAME)); |
289 | 0 | assert((second_ref_frame > INTRA_FRAME) && |
290 | 0 | (second_ref_frame <= ALTREF_FRAME)); |
291 | 0 | return comp_inter_to_mode_idx[this_mode - COMP_INTER_MODE_START][ref_frame] |
292 | 0 | [second_ref_frame]; |
293 | 0 | } |
294 | 0 | assert(0); |
295 | 0 | return THR_INVALID; |
296 | 0 | } Unexecuted instantiation: av1_cx_iface.c:get_prediction_mode_idx Unexecuted instantiation: allintra_vis.c:get_prediction_mode_idx Unexecuted instantiation: encodeframe.c:get_prediction_mode_idx Unexecuted instantiation: encodeframe_utils.c:get_prediction_mode_idx Unexecuted instantiation: encodemb.c:get_prediction_mode_idx Unexecuted instantiation: encoder.c:get_prediction_mode_idx Unexecuted instantiation: encoder_utils.c:get_prediction_mode_idx Unexecuted instantiation: encodetxb.c:get_prediction_mode_idx Unexecuted instantiation: ethread.c:get_prediction_mode_idx Unexecuted instantiation: firstpass.c:get_prediction_mode_idx Unexecuted instantiation: global_motion_facade.c:get_prediction_mode_idx Unexecuted instantiation: mcomp.c:get_prediction_mode_idx Unexecuted instantiation: palette.c:get_prediction_mode_idx Unexecuted instantiation: partition_search.c:get_prediction_mode_idx Unexecuted instantiation: partition_strategy.c:get_prediction_mode_idx Unexecuted instantiation: rd.c:get_prediction_mode_idx Unexecuted instantiation: rdopt.c:get_prediction_mode_idx Unexecuted instantiation: nonrd_pickmode.c:get_prediction_mode_idx Unexecuted instantiation: nonrd_opt.c:get_prediction_mode_idx Unexecuted instantiation: speed_features.c:get_prediction_mode_idx Unexecuted instantiation: superres_scale.c:get_prediction_mode_idx Unexecuted instantiation: svc_layercontext.c:get_prediction_mode_idx Unexecuted instantiation: temporal_filter.c:get_prediction_mode_idx Unexecuted instantiation: tokenize.c:get_prediction_mode_idx Unexecuted instantiation: tpl_model.c:get_prediction_mode_idx Unexecuted instantiation: tx_search.c:get_prediction_mode_idx Unexecuted instantiation: intra_mode_search.c:get_prediction_mode_idx Unexecuted instantiation: var_based_part.c:get_prediction_mode_idx Unexecuted instantiation: compound_type.c:get_prediction_mode_idx Unexecuted instantiation: encode_strategy.c:get_prediction_mode_idx Unexecuted instantiation: interp_search.c:get_prediction_mode_idx Unexecuted instantiation: motion_search_facade.c:get_prediction_mode_idx |
297 | | |
298 | 0 | static inline int inter_mode_data_block_idx(BLOCK_SIZE bsize) { |
299 | 0 | if (bsize == BLOCK_4X4 || bsize == BLOCK_4X8 || bsize == BLOCK_8X4 || |
300 | 0 | bsize == BLOCK_4X16 || bsize == BLOCK_16X4) { |
301 | 0 | return -1; |
302 | 0 | } |
303 | 0 | return 1; |
304 | 0 | } Unexecuted instantiation: av1_cx_iface.c:inter_mode_data_block_idx Unexecuted instantiation: allintra_vis.c:inter_mode_data_block_idx Unexecuted instantiation: encodeframe.c:inter_mode_data_block_idx Unexecuted instantiation: encodeframe_utils.c:inter_mode_data_block_idx Unexecuted instantiation: encodemb.c:inter_mode_data_block_idx Unexecuted instantiation: encoder.c:inter_mode_data_block_idx Unexecuted instantiation: encoder_utils.c:inter_mode_data_block_idx Unexecuted instantiation: encodetxb.c:inter_mode_data_block_idx Unexecuted instantiation: ethread.c:inter_mode_data_block_idx Unexecuted instantiation: firstpass.c:inter_mode_data_block_idx Unexecuted instantiation: global_motion_facade.c:inter_mode_data_block_idx Unexecuted instantiation: mcomp.c:inter_mode_data_block_idx Unexecuted instantiation: palette.c:inter_mode_data_block_idx Unexecuted instantiation: partition_search.c:inter_mode_data_block_idx Unexecuted instantiation: partition_strategy.c:inter_mode_data_block_idx Unexecuted instantiation: rd.c:inter_mode_data_block_idx Unexecuted instantiation: rdopt.c:inter_mode_data_block_idx Unexecuted instantiation: nonrd_pickmode.c:inter_mode_data_block_idx Unexecuted instantiation: nonrd_opt.c:inter_mode_data_block_idx Unexecuted instantiation: speed_features.c:inter_mode_data_block_idx Unexecuted instantiation: superres_scale.c:inter_mode_data_block_idx Unexecuted instantiation: svc_layercontext.c:inter_mode_data_block_idx Unexecuted instantiation: temporal_filter.c:inter_mode_data_block_idx Unexecuted instantiation: tokenize.c:inter_mode_data_block_idx Unexecuted instantiation: tpl_model.c:inter_mode_data_block_idx Unexecuted instantiation: tx_search.c:inter_mode_data_block_idx Unexecuted instantiation: intra_mode_search.c:inter_mode_data_block_idx Unexecuted instantiation: var_based_part.c:inter_mode_data_block_idx Unexecuted instantiation: compound_type.c:inter_mode_data_block_idx Unexecuted instantiation: encode_strategy.c:inter_mode_data_block_idx Unexecuted instantiation: interp_search.c:inter_mode_data_block_idx Unexecuted instantiation: motion_search_facade.c:inter_mode_data_block_idx |
305 | | |
306 | | // Get transform block visible dimensions cropped to the MI units. |
307 | | static inline void get_txb_dimensions(const MACROBLOCKD *xd, int plane, |
308 | | BLOCK_SIZE plane_bsize, int blk_row, |
309 | | int blk_col, BLOCK_SIZE tx_bsize, |
310 | | int *width, int *height, |
311 | 0 | int *visible_width, int *visible_height) { |
312 | 0 | assert(tx_bsize <= plane_bsize); |
313 | 0 | const int txb_height = block_size_high[tx_bsize]; |
314 | 0 | const int txb_width = block_size_wide[tx_bsize]; |
315 | 0 | const struct macroblockd_plane *const pd = &xd->plane[plane]; |
316 | | |
317 | | // TODO(aconverse@google.com): Investigate using crop_width/height here rather |
318 | | // than the MI size |
319 | 0 | if (xd->mb_to_bottom_edge >= 0) { |
320 | 0 | *visible_height = txb_height; |
321 | 0 | } else { |
322 | 0 | const int block_height = block_size_high[plane_bsize]; |
323 | 0 | const int block_rows = |
324 | 0 | (xd->mb_to_bottom_edge >> (3 + pd->subsampling_y)) + block_height; |
325 | 0 | *visible_height = |
326 | 0 | clamp(block_rows - (blk_row << MI_SIZE_LOG2), 0, txb_height); |
327 | 0 | } |
328 | 0 | if (height) *height = txb_height; |
329 | |
|
330 | 0 | if (xd->mb_to_right_edge >= 0) { |
331 | 0 | *visible_width = txb_width; |
332 | 0 | } else { |
333 | 0 | const int block_width = block_size_wide[plane_bsize]; |
334 | 0 | const int block_cols = |
335 | 0 | (xd->mb_to_right_edge >> (3 + pd->subsampling_x)) + block_width; |
336 | 0 | *visible_width = |
337 | 0 | clamp(block_cols - (blk_col << MI_SIZE_LOG2), 0, txb_width); |
338 | 0 | } |
339 | 0 | if (width) *width = txb_width; |
340 | 0 | } Unexecuted instantiation: av1_cx_iface.c:get_txb_dimensions Unexecuted instantiation: allintra_vis.c:get_txb_dimensions Unexecuted instantiation: encodeframe.c:get_txb_dimensions Unexecuted instantiation: encodeframe_utils.c:get_txb_dimensions Unexecuted instantiation: encodemb.c:get_txb_dimensions Unexecuted instantiation: encoder.c:get_txb_dimensions Unexecuted instantiation: encoder_utils.c:get_txb_dimensions Unexecuted instantiation: encodetxb.c:get_txb_dimensions Unexecuted instantiation: ethread.c:get_txb_dimensions Unexecuted instantiation: firstpass.c:get_txb_dimensions Unexecuted instantiation: global_motion_facade.c:get_txb_dimensions Unexecuted instantiation: mcomp.c:get_txb_dimensions Unexecuted instantiation: palette.c:get_txb_dimensions Unexecuted instantiation: partition_search.c:get_txb_dimensions Unexecuted instantiation: partition_strategy.c:get_txb_dimensions Unexecuted instantiation: rd.c:get_txb_dimensions Unexecuted instantiation: rdopt.c:get_txb_dimensions Unexecuted instantiation: nonrd_pickmode.c:get_txb_dimensions Unexecuted instantiation: nonrd_opt.c:get_txb_dimensions Unexecuted instantiation: speed_features.c:get_txb_dimensions Unexecuted instantiation: superres_scale.c:get_txb_dimensions Unexecuted instantiation: svc_layercontext.c:get_txb_dimensions Unexecuted instantiation: temporal_filter.c:get_txb_dimensions Unexecuted instantiation: tokenize.c:get_txb_dimensions Unexecuted instantiation: tpl_model.c:get_txb_dimensions Unexecuted instantiation: tx_search.c:get_txb_dimensions Unexecuted instantiation: intra_mode_search.c:get_txb_dimensions Unexecuted instantiation: var_based_part.c:get_txb_dimensions Unexecuted instantiation: compound_type.c:get_txb_dimensions Unexecuted instantiation: encode_strategy.c:get_txb_dimensions Unexecuted instantiation: interp_search.c:get_txb_dimensions Unexecuted instantiation: motion_search_facade.c:get_txb_dimensions |
341 | | |
342 | 0 | static inline int bsize_to_num_blk(BLOCK_SIZE bsize) { |
343 | 0 | int num_blk = 1 << (num_pels_log2_lookup[bsize] - 2 * MI_SIZE_LOG2); |
344 | 0 | return num_blk; |
345 | 0 | } Unexecuted instantiation: av1_cx_iface.c:bsize_to_num_blk Unexecuted instantiation: allintra_vis.c:bsize_to_num_blk Unexecuted instantiation: encodeframe.c:bsize_to_num_blk Unexecuted instantiation: encodeframe_utils.c:bsize_to_num_blk Unexecuted instantiation: encodemb.c:bsize_to_num_blk Unexecuted instantiation: encoder.c:bsize_to_num_blk Unexecuted instantiation: encoder_utils.c:bsize_to_num_blk Unexecuted instantiation: encodetxb.c:bsize_to_num_blk Unexecuted instantiation: ethread.c:bsize_to_num_blk Unexecuted instantiation: firstpass.c:bsize_to_num_blk Unexecuted instantiation: global_motion_facade.c:bsize_to_num_blk Unexecuted instantiation: mcomp.c:bsize_to_num_blk Unexecuted instantiation: palette.c:bsize_to_num_blk Unexecuted instantiation: partition_search.c:bsize_to_num_blk Unexecuted instantiation: partition_strategy.c:bsize_to_num_blk Unexecuted instantiation: rd.c:bsize_to_num_blk Unexecuted instantiation: rdopt.c:bsize_to_num_blk Unexecuted instantiation: nonrd_pickmode.c:bsize_to_num_blk Unexecuted instantiation: nonrd_opt.c:bsize_to_num_blk Unexecuted instantiation: speed_features.c:bsize_to_num_blk Unexecuted instantiation: superres_scale.c:bsize_to_num_blk Unexecuted instantiation: svc_layercontext.c:bsize_to_num_blk Unexecuted instantiation: temporal_filter.c:bsize_to_num_blk Unexecuted instantiation: tokenize.c:bsize_to_num_blk Unexecuted instantiation: tpl_model.c:bsize_to_num_blk Unexecuted instantiation: tx_search.c:bsize_to_num_blk Unexecuted instantiation: intra_mode_search.c:bsize_to_num_blk Unexecuted instantiation: var_based_part.c:bsize_to_num_blk Unexecuted instantiation: compound_type.c:bsize_to_num_blk Unexecuted instantiation: encode_strategy.c:bsize_to_num_blk Unexecuted instantiation: interp_search.c:bsize_to_num_blk Unexecuted instantiation: motion_search_facade.c:bsize_to_num_blk |
346 | | |
347 | | static inline int check_txfm_eval(MACROBLOCK *const x, BLOCK_SIZE bsize, |
348 | | int64_t best_skip_rd, int64_t skip_rd, |
349 | 0 | int level, int is_luma_only) { |
350 | 0 | int eval_txfm = 1; |
351 | | // Derive aggressiveness factor for gating the transform search |
352 | | // Lower value indicates more aggressiveness. Be more conservative (high |
353 | | // value) for (i) low quantizers (ii) regions where prediction is poor |
354 | 0 | const int scale[MAX_TX_RD_GATE_LEVEL + 1] = { INT_MAX, 4, 3, 2, 2, 1 }; |
355 | 0 | const int qslope = 2 * (!is_luma_only); |
356 | 0 | const int level_to_qindex_map[MAX_TX_RD_GATE_LEVEL + 1] = { 0, 0, 0, |
357 | 0 | 80, 100, 140 }; |
358 | 0 | int aggr_factor = 4; |
359 | 0 | assert(level <= MAX_TX_RD_GATE_LEVEL); |
360 | 0 | const int pred_qindex_thresh = level_to_qindex_map[level]; |
361 | 0 | if (!is_luma_only && level <= 2) { |
362 | 0 | aggr_factor = 4 * AOMMAX(1, ROUND_POWER_OF_TWO((MAXQ - x->qindex) * qslope, |
363 | 0 | QINDEX_BITS)); |
364 | 0 | } |
365 | 0 | if ((best_skip_rd > |
366 | 0 | (x->source_variance << (num_pels_log2_lookup[bsize] + RDDIV_BITS))) && |
367 | 0 | (x->qindex >= pred_qindex_thresh)) |
368 | 0 | aggr_factor *= scale[level]; |
369 | | // For level setting 1, be more conservative for non-luma-only case even when |
370 | | // prediction is good. |
371 | 0 | else if ((level <= 1) && !is_luma_only) |
372 | 0 | aggr_factor = (aggr_factor >> 2) * 6; |
373 | | |
374 | | // Be more conservative for luma only cases (called from compound type rd) |
375 | | // since best_skip_rd is computed after and skip_rd is computed (with 8-bit |
376 | | // prediction signals blended for WEDGE/DIFFWTD rather than 16-bit) before |
377 | | // interpolation filter search |
378 | 0 | const int luma_mul[MAX_TX_RD_GATE_LEVEL + 1] = { |
379 | 0 | INT_MAX, 32, 29, 17, 17, 17 |
380 | 0 | }; |
381 | 0 | int mul_factor = is_luma_only ? luma_mul[level] : 16; |
382 | 0 | int64_t rd_thresh = |
383 | 0 | (best_skip_rd == INT64_MAX) |
384 | 0 | ? best_skip_rd |
385 | 0 | : (int64_t)(best_skip_rd * aggr_factor * mul_factor >> 6); |
386 | 0 | if (skip_rd > rd_thresh) eval_txfm = 0; |
387 | 0 | return eval_txfm; |
388 | 0 | } Unexecuted instantiation: av1_cx_iface.c:check_txfm_eval Unexecuted instantiation: allintra_vis.c:check_txfm_eval Unexecuted instantiation: encodeframe.c:check_txfm_eval Unexecuted instantiation: encodeframe_utils.c:check_txfm_eval Unexecuted instantiation: encodemb.c:check_txfm_eval Unexecuted instantiation: encoder.c:check_txfm_eval Unexecuted instantiation: encoder_utils.c:check_txfm_eval Unexecuted instantiation: encodetxb.c:check_txfm_eval Unexecuted instantiation: ethread.c:check_txfm_eval Unexecuted instantiation: firstpass.c:check_txfm_eval Unexecuted instantiation: global_motion_facade.c:check_txfm_eval Unexecuted instantiation: mcomp.c:check_txfm_eval Unexecuted instantiation: palette.c:check_txfm_eval Unexecuted instantiation: partition_search.c:check_txfm_eval Unexecuted instantiation: partition_strategy.c:check_txfm_eval Unexecuted instantiation: rd.c:check_txfm_eval Unexecuted instantiation: rdopt.c:check_txfm_eval Unexecuted instantiation: nonrd_pickmode.c:check_txfm_eval Unexecuted instantiation: nonrd_opt.c:check_txfm_eval Unexecuted instantiation: speed_features.c:check_txfm_eval Unexecuted instantiation: superres_scale.c:check_txfm_eval Unexecuted instantiation: svc_layercontext.c:check_txfm_eval Unexecuted instantiation: temporal_filter.c:check_txfm_eval Unexecuted instantiation: tokenize.c:check_txfm_eval Unexecuted instantiation: tpl_model.c:check_txfm_eval Unexecuted instantiation: tx_search.c:check_txfm_eval Unexecuted instantiation: intra_mode_search.c:check_txfm_eval Unexecuted instantiation: var_based_part.c:check_txfm_eval Unexecuted instantiation: compound_type.c:check_txfm_eval Unexecuted instantiation: encode_strategy.c:check_txfm_eval Unexecuted instantiation: interp_search.c:check_txfm_eval Unexecuted instantiation: motion_search_facade.c:check_txfm_eval |
389 | | |
390 | | static TX_MODE select_tx_mode( |
391 | 0 | const AV1_COMMON *cm, const TX_SIZE_SEARCH_METHOD tx_size_search_method) { |
392 | 0 | if (cm->features.coded_lossless) return ONLY_4X4; |
393 | 0 | if (tx_size_search_method == USE_LARGESTALL) { |
394 | 0 | return TX_MODE_LARGEST; |
395 | 0 | } else { |
396 | 0 | assert(tx_size_search_method == USE_FULL_RD || |
397 | 0 | tx_size_search_method == USE_FAST_RD); |
398 | 0 | return TX_MODE_SELECT; |
399 | 0 | } |
400 | 0 | } Unexecuted instantiation: av1_cx_iface.c:select_tx_mode Unexecuted instantiation: allintra_vis.c:select_tx_mode Unexecuted instantiation: encodeframe.c:select_tx_mode Unexecuted instantiation: encodeframe_utils.c:select_tx_mode Unexecuted instantiation: encodemb.c:select_tx_mode Unexecuted instantiation: encoder.c:select_tx_mode Unexecuted instantiation: encoder_utils.c:select_tx_mode Unexecuted instantiation: encodetxb.c:select_tx_mode Unexecuted instantiation: ethread.c:select_tx_mode Unexecuted instantiation: firstpass.c:select_tx_mode Unexecuted instantiation: global_motion_facade.c:select_tx_mode Unexecuted instantiation: mcomp.c:select_tx_mode Unexecuted instantiation: palette.c:select_tx_mode Unexecuted instantiation: partition_search.c:select_tx_mode Unexecuted instantiation: partition_strategy.c:select_tx_mode Unexecuted instantiation: rd.c:select_tx_mode Unexecuted instantiation: rdopt.c:select_tx_mode Unexecuted instantiation: nonrd_pickmode.c:select_tx_mode Unexecuted instantiation: nonrd_opt.c:select_tx_mode Unexecuted instantiation: speed_features.c:select_tx_mode Unexecuted instantiation: superres_scale.c:select_tx_mode Unexecuted instantiation: svc_layercontext.c:select_tx_mode Unexecuted instantiation: temporal_filter.c:select_tx_mode Unexecuted instantiation: tokenize.c:select_tx_mode Unexecuted instantiation: tpl_model.c:select_tx_mode Unexecuted instantiation: tx_search.c:select_tx_mode Unexecuted instantiation: intra_mode_search.c:select_tx_mode Unexecuted instantiation: var_based_part.c:select_tx_mode Unexecuted instantiation: compound_type.c:select_tx_mode Unexecuted instantiation: encode_strategy.c:select_tx_mode Unexecuted instantiation: interp_search.c:select_tx_mode Unexecuted instantiation: motion_search_facade.c:select_tx_mode |
401 | | |
402 | | // Checks the conditions to disable winner mode processing |
403 | | static inline int bypass_winner_mode_processing(const MACROBLOCK *const x, |
404 | | const SPEED_FEATURES *sf, |
405 | | int use_txfm_skip, |
406 | | int actual_txfm_skip, |
407 | 0 | PREDICTION_MODE best_mode) { |
408 | 0 | const int prune_winner_mode_eval_level = |
409 | 0 | sf->winner_mode_sf.prune_winner_mode_eval_level; |
410 | | |
411 | | // Disable winner mode processing for blocks with low source variance. |
412 | | // The aggressiveness of this pruning logic reduces as qindex increases. |
413 | | // The threshold decreases linearly from 64 as qindex varies from 0 to 255. |
414 | 0 | if (prune_winner_mode_eval_level == 1) { |
415 | 0 | const unsigned int src_var_thresh = 64 - 48 * x->qindex / (MAXQ + 1); |
416 | 0 | if (x->source_variance < src_var_thresh) return 1; |
417 | 0 | } else if (prune_winner_mode_eval_level == 2) { |
418 | | // Skip winner mode processing of blocks for which transform turns out to be |
419 | | // skip due to nature of eob alone except NEWMV mode. |
420 | 0 | if (!have_newmv_in_inter_mode(best_mode) && actual_txfm_skip) return 1; |
421 | 0 | } else if (prune_winner_mode_eval_level == 3) { |
422 | | // Skip winner mode processing of blocks for which transform turns out to be |
423 | | // skip except NEWMV mode and considered based on the quantizer. |
424 | | // At high quantizers: Take conservative approach by considering transform |
425 | | // skip based on eob alone. |
426 | | // At low quantizers: Consider transform skip based on eob nature or RD cost |
427 | | // evaluation. |
428 | 0 | const int is_txfm_skip = |
429 | 0 | x->qindex > 127 ? actual_txfm_skip : actual_txfm_skip || use_txfm_skip; |
430 | |
|
431 | 0 | if (!have_newmv_in_inter_mode(best_mode) && is_txfm_skip) return 1; |
432 | 0 | } else if (prune_winner_mode_eval_level >= 4) { |
433 | | // Do not skip winner mode evaluation at low quantizers if normal mode's |
434 | | // transform search was too aggressive. |
435 | 0 | if (sf->rd_sf.perform_coeff_opt >= 5 && x->qindex <= 70) return 0; |
436 | | |
437 | 0 | if (use_txfm_skip || actual_txfm_skip) return 1; |
438 | 0 | } |
439 | | |
440 | 0 | return 0; |
441 | 0 | } Unexecuted instantiation: av1_cx_iface.c:bypass_winner_mode_processing Unexecuted instantiation: allintra_vis.c:bypass_winner_mode_processing Unexecuted instantiation: encodeframe.c:bypass_winner_mode_processing Unexecuted instantiation: encodeframe_utils.c:bypass_winner_mode_processing Unexecuted instantiation: encodemb.c:bypass_winner_mode_processing Unexecuted instantiation: encoder.c:bypass_winner_mode_processing Unexecuted instantiation: encoder_utils.c:bypass_winner_mode_processing Unexecuted instantiation: encodetxb.c:bypass_winner_mode_processing Unexecuted instantiation: ethread.c:bypass_winner_mode_processing Unexecuted instantiation: firstpass.c:bypass_winner_mode_processing Unexecuted instantiation: global_motion_facade.c:bypass_winner_mode_processing Unexecuted instantiation: mcomp.c:bypass_winner_mode_processing Unexecuted instantiation: palette.c:bypass_winner_mode_processing Unexecuted instantiation: partition_search.c:bypass_winner_mode_processing Unexecuted instantiation: partition_strategy.c:bypass_winner_mode_processing Unexecuted instantiation: rd.c:bypass_winner_mode_processing Unexecuted instantiation: rdopt.c:bypass_winner_mode_processing Unexecuted instantiation: nonrd_pickmode.c:bypass_winner_mode_processing Unexecuted instantiation: nonrd_opt.c:bypass_winner_mode_processing Unexecuted instantiation: speed_features.c:bypass_winner_mode_processing Unexecuted instantiation: superres_scale.c:bypass_winner_mode_processing Unexecuted instantiation: svc_layercontext.c:bypass_winner_mode_processing Unexecuted instantiation: temporal_filter.c:bypass_winner_mode_processing Unexecuted instantiation: tokenize.c:bypass_winner_mode_processing Unexecuted instantiation: tpl_model.c:bypass_winner_mode_processing Unexecuted instantiation: tx_search.c:bypass_winner_mode_processing Unexecuted instantiation: intra_mode_search.c:bypass_winner_mode_processing Unexecuted instantiation: var_based_part.c:bypass_winner_mode_processing Unexecuted instantiation: compound_type.c:bypass_winner_mode_processing Unexecuted instantiation: encode_strategy.c:bypass_winner_mode_processing Unexecuted instantiation: interp_search.c:bypass_winner_mode_processing Unexecuted instantiation: motion_search_facade.c:bypass_winner_mode_processing |
442 | | |
443 | | // Checks the conditions to enable winner mode processing |
444 | | static inline int is_winner_mode_processing_enabled(const struct AV1_COMP *cpi, |
445 | | const MACROBLOCK *const x, |
446 | | MB_MODE_INFO *const mbmi, |
447 | 0 | int actual_txfm_skip) { |
448 | 0 | const SPEED_FEATURES *sf = &cpi->sf; |
449 | 0 | const PREDICTION_MODE best_mode = mbmi->mode; |
450 | |
|
451 | 0 | if (bypass_winner_mode_processing(x, sf, mbmi->skip_txfm, actual_txfm_skip, |
452 | 0 | best_mode)) |
453 | 0 | return 0; |
454 | | |
455 | | // TODO(any): Move block independent condition checks to frame level |
456 | 0 | if (is_inter_block(mbmi)) { |
457 | 0 | if (is_inter_mode(best_mode) && |
458 | 0 | (sf->tx_sf.tx_type_search.fast_inter_tx_type_prob_thresh != INT_MAX) && |
459 | 0 | !cpi->oxcf.txfm_cfg.use_inter_dct_only) |
460 | 0 | return 1; |
461 | 0 | } else { |
462 | 0 | if (sf->tx_sf.tx_type_search.fast_intra_tx_type_search && |
463 | 0 | !cpi->oxcf.txfm_cfg.use_intra_default_tx_only && |
464 | 0 | !cpi->oxcf.txfm_cfg.use_intra_dct_only) |
465 | 0 | return 1; |
466 | 0 | } |
467 | | |
468 | | // Check speed feature related to winner mode processing |
469 | 0 | if (sf->winner_mode_sf.enable_winner_mode_for_coeff_opt && |
470 | 0 | cpi->optimize_seg_arr[mbmi->segment_id] != NO_TRELLIS_OPT && |
471 | 0 | cpi->optimize_seg_arr[mbmi->segment_id] != FINAL_PASS_TRELLIS_OPT) |
472 | 0 | return 1; |
473 | 0 | if (sf->winner_mode_sf.enable_winner_mode_for_tx_size_srch) return 1; |
474 | | |
475 | 0 | return 0; |
476 | 0 | } Unexecuted instantiation: av1_cx_iface.c:is_winner_mode_processing_enabled Unexecuted instantiation: allintra_vis.c:is_winner_mode_processing_enabled Unexecuted instantiation: encodeframe.c:is_winner_mode_processing_enabled Unexecuted instantiation: encodeframe_utils.c:is_winner_mode_processing_enabled Unexecuted instantiation: encodemb.c:is_winner_mode_processing_enabled Unexecuted instantiation: encoder.c:is_winner_mode_processing_enabled Unexecuted instantiation: encoder_utils.c:is_winner_mode_processing_enabled Unexecuted instantiation: encodetxb.c:is_winner_mode_processing_enabled Unexecuted instantiation: ethread.c:is_winner_mode_processing_enabled Unexecuted instantiation: firstpass.c:is_winner_mode_processing_enabled Unexecuted instantiation: global_motion_facade.c:is_winner_mode_processing_enabled Unexecuted instantiation: mcomp.c:is_winner_mode_processing_enabled Unexecuted instantiation: palette.c:is_winner_mode_processing_enabled Unexecuted instantiation: partition_search.c:is_winner_mode_processing_enabled Unexecuted instantiation: partition_strategy.c:is_winner_mode_processing_enabled Unexecuted instantiation: rd.c:is_winner_mode_processing_enabled Unexecuted instantiation: rdopt.c:is_winner_mode_processing_enabled Unexecuted instantiation: nonrd_pickmode.c:is_winner_mode_processing_enabled Unexecuted instantiation: nonrd_opt.c:is_winner_mode_processing_enabled Unexecuted instantiation: speed_features.c:is_winner_mode_processing_enabled Unexecuted instantiation: superres_scale.c:is_winner_mode_processing_enabled Unexecuted instantiation: svc_layercontext.c:is_winner_mode_processing_enabled Unexecuted instantiation: temporal_filter.c:is_winner_mode_processing_enabled Unexecuted instantiation: tokenize.c:is_winner_mode_processing_enabled Unexecuted instantiation: tpl_model.c:is_winner_mode_processing_enabled Unexecuted instantiation: tx_search.c:is_winner_mode_processing_enabled Unexecuted instantiation: intra_mode_search.c:is_winner_mode_processing_enabled Unexecuted instantiation: var_based_part.c:is_winner_mode_processing_enabled Unexecuted instantiation: compound_type.c:is_winner_mode_processing_enabled Unexecuted instantiation: encode_strategy.c:is_winner_mode_processing_enabled Unexecuted instantiation: interp_search.c:is_winner_mode_processing_enabled Unexecuted instantiation: motion_search_facade.c:is_winner_mode_processing_enabled |
477 | | |
478 | | static inline void set_tx_size_search_method( |
479 | | const AV1_COMMON *cm, const WinnerModeParams *winner_mode_params, |
480 | | TxfmSearchParams *txfm_params, int enable_winner_mode_for_tx_size_srch, |
481 | 0 | int is_winner_mode) { |
482 | | // Populate transform size search method/transform mode appropriately |
483 | 0 | txfm_params->tx_size_search_method = |
484 | 0 | winner_mode_params->tx_size_search_methods[DEFAULT_EVAL]; |
485 | 0 | if (enable_winner_mode_for_tx_size_srch) { |
486 | 0 | if (is_winner_mode) |
487 | 0 | txfm_params->tx_size_search_method = |
488 | 0 | winner_mode_params->tx_size_search_methods[WINNER_MODE_EVAL]; |
489 | 0 | else |
490 | 0 | txfm_params->tx_size_search_method = |
491 | 0 | winner_mode_params->tx_size_search_methods[MODE_EVAL]; |
492 | 0 | } |
493 | 0 | txfm_params->tx_mode_search_type = |
494 | 0 | select_tx_mode(cm, txfm_params->tx_size_search_method); |
495 | 0 | } Unexecuted instantiation: av1_cx_iface.c:set_tx_size_search_method Unexecuted instantiation: allintra_vis.c:set_tx_size_search_method Unexecuted instantiation: encodeframe.c:set_tx_size_search_method Unexecuted instantiation: encodeframe_utils.c:set_tx_size_search_method Unexecuted instantiation: encodemb.c:set_tx_size_search_method Unexecuted instantiation: encoder.c:set_tx_size_search_method Unexecuted instantiation: encoder_utils.c:set_tx_size_search_method Unexecuted instantiation: encodetxb.c:set_tx_size_search_method Unexecuted instantiation: ethread.c:set_tx_size_search_method Unexecuted instantiation: firstpass.c:set_tx_size_search_method Unexecuted instantiation: global_motion_facade.c:set_tx_size_search_method Unexecuted instantiation: mcomp.c:set_tx_size_search_method Unexecuted instantiation: palette.c:set_tx_size_search_method Unexecuted instantiation: partition_search.c:set_tx_size_search_method Unexecuted instantiation: partition_strategy.c:set_tx_size_search_method Unexecuted instantiation: rd.c:set_tx_size_search_method Unexecuted instantiation: rdopt.c:set_tx_size_search_method Unexecuted instantiation: nonrd_pickmode.c:set_tx_size_search_method Unexecuted instantiation: nonrd_opt.c:set_tx_size_search_method Unexecuted instantiation: speed_features.c:set_tx_size_search_method Unexecuted instantiation: superres_scale.c:set_tx_size_search_method Unexecuted instantiation: svc_layercontext.c:set_tx_size_search_method Unexecuted instantiation: temporal_filter.c:set_tx_size_search_method Unexecuted instantiation: tokenize.c:set_tx_size_search_method Unexecuted instantiation: tpl_model.c:set_tx_size_search_method Unexecuted instantiation: tx_search.c:set_tx_size_search_method Unexecuted instantiation: intra_mode_search.c:set_tx_size_search_method Unexecuted instantiation: var_based_part.c:set_tx_size_search_method Unexecuted instantiation: compound_type.c:set_tx_size_search_method Unexecuted instantiation: encode_strategy.c:set_tx_size_search_method Unexecuted instantiation: interp_search.c:set_tx_size_search_method Unexecuted instantiation: motion_search_facade.c:set_tx_size_search_method |
496 | | |
497 | | static inline void set_tx_type_prune(const SPEED_FEATURES *sf, |
498 | | TxfmSearchParams *txfm_params, |
499 | | int winner_mode_tx_type_pruning, |
500 | 0 | int is_winner_mode) { |
501 | | // Populate prune transform mode appropriately |
502 | 0 | txfm_params->prune_2d_txfm_mode = sf->tx_sf.tx_type_search.prune_2d_txfm_mode; |
503 | 0 | if (!winner_mode_tx_type_pruning) return; |
504 | | |
505 | 0 | const int prune_mode[4][2] = { { TX_TYPE_PRUNE_3, TX_TYPE_PRUNE_0 }, |
506 | 0 | { TX_TYPE_PRUNE_4, TX_TYPE_PRUNE_0 }, |
507 | 0 | { TX_TYPE_PRUNE_5, TX_TYPE_PRUNE_2 }, |
508 | 0 | { TX_TYPE_PRUNE_5, TX_TYPE_PRUNE_3 } }; |
509 | 0 | txfm_params->prune_2d_txfm_mode = |
510 | 0 | prune_mode[winner_mode_tx_type_pruning - 1][is_winner_mode]; |
511 | 0 | } Unexecuted instantiation: av1_cx_iface.c:set_tx_type_prune Unexecuted instantiation: allintra_vis.c:set_tx_type_prune Unexecuted instantiation: encodeframe.c:set_tx_type_prune Unexecuted instantiation: encodeframe_utils.c:set_tx_type_prune Unexecuted instantiation: encodemb.c:set_tx_type_prune Unexecuted instantiation: encoder.c:set_tx_type_prune Unexecuted instantiation: encoder_utils.c:set_tx_type_prune Unexecuted instantiation: encodetxb.c:set_tx_type_prune Unexecuted instantiation: ethread.c:set_tx_type_prune Unexecuted instantiation: firstpass.c:set_tx_type_prune Unexecuted instantiation: global_motion_facade.c:set_tx_type_prune Unexecuted instantiation: mcomp.c:set_tx_type_prune Unexecuted instantiation: palette.c:set_tx_type_prune Unexecuted instantiation: partition_search.c:set_tx_type_prune Unexecuted instantiation: partition_strategy.c:set_tx_type_prune Unexecuted instantiation: rd.c:set_tx_type_prune Unexecuted instantiation: rdopt.c:set_tx_type_prune Unexecuted instantiation: nonrd_pickmode.c:set_tx_type_prune Unexecuted instantiation: nonrd_opt.c:set_tx_type_prune Unexecuted instantiation: speed_features.c:set_tx_type_prune Unexecuted instantiation: superres_scale.c:set_tx_type_prune Unexecuted instantiation: svc_layercontext.c:set_tx_type_prune Unexecuted instantiation: temporal_filter.c:set_tx_type_prune Unexecuted instantiation: tokenize.c:set_tx_type_prune Unexecuted instantiation: tpl_model.c:set_tx_type_prune Unexecuted instantiation: tx_search.c:set_tx_type_prune Unexecuted instantiation: intra_mode_search.c:set_tx_type_prune Unexecuted instantiation: var_based_part.c:set_tx_type_prune Unexecuted instantiation: compound_type.c:set_tx_type_prune Unexecuted instantiation: encode_strategy.c:set_tx_type_prune Unexecuted instantiation: interp_search.c:set_tx_type_prune Unexecuted instantiation: motion_search_facade.c:set_tx_type_prune |
512 | | |
513 | | static inline void set_tx_domain_dist_params( |
514 | | const WinnerModeParams *winner_mode_params, TxfmSearchParams *txfm_params, |
515 | 0 | int enable_winner_mode_for_tx_domain_dist, int is_winner_mode) { |
516 | 0 | if (txfm_params->use_qm_dist_metric) { |
517 | | // QM-weighted PSNR is computed in transform space, so we need to forcibly |
518 | | // enable the use of tx domain distortion. |
519 | 0 | txfm_params->use_transform_domain_distortion = 1; |
520 | 0 | txfm_params->tx_domain_dist_threshold = 0; |
521 | 0 | return; |
522 | 0 | } |
523 | | |
524 | 0 | if (!enable_winner_mode_for_tx_domain_dist) { |
525 | 0 | txfm_params->use_transform_domain_distortion = |
526 | 0 | winner_mode_params->use_transform_domain_distortion[DEFAULT_EVAL]; |
527 | 0 | txfm_params->tx_domain_dist_threshold = |
528 | 0 | winner_mode_params->tx_domain_dist_threshold[DEFAULT_EVAL]; |
529 | 0 | return; |
530 | 0 | } |
531 | | |
532 | 0 | if (is_winner_mode) { |
533 | 0 | txfm_params->use_transform_domain_distortion = |
534 | 0 | winner_mode_params->use_transform_domain_distortion[WINNER_MODE_EVAL]; |
535 | 0 | txfm_params->tx_domain_dist_threshold = |
536 | 0 | winner_mode_params->tx_domain_dist_threshold[WINNER_MODE_EVAL]; |
537 | 0 | } else { |
538 | 0 | txfm_params->use_transform_domain_distortion = |
539 | 0 | winner_mode_params->use_transform_domain_distortion[MODE_EVAL]; |
540 | 0 | txfm_params->tx_domain_dist_threshold = |
541 | 0 | winner_mode_params->tx_domain_dist_threshold[MODE_EVAL]; |
542 | 0 | } |
543 | 0 | } Unexecuted instantiation: av1_cx_iface.c:set_tx_domain_dist_params Unexecuted instantiation: allintra_vis.c:set_tx_domain_dist_params Unexecuted instantiation: encodeframe.c:set_tx_domain_dist_params Unexecuted instantiation: encodeframe_utils.c:set_tx_domain_dist_params Unexecuted instantiation: encodemb.c:set_tx_domain_dist_params Unexecuted instantiation: encoder.c:set_tx_domain_dist_params Unexecuted instantiation: encoder_utils.c:set_tx_domain_dist_params Unexecuted instantiation: encodetxb.c:set_tx_domain_dist_params Unexecuted instantiation: ethread.c:set_tx_domain_dist_params Unexecuted instantiation: firstpass.c:set_tx_domain_dist_params Unexecuted instantiation: global_motion_facade.c:set_tx_domain_dist_params Unexecuted instantiation: mcomp.c:set_tx_domain_dist_params Unexecuted instantiation: palette.c:set_tx_domain_dist_params Unexecuted instantiation: partition_search.c:set_tx_domain_dist_params Unexecuted instantiation: partition_strategy.c:set_tx_domain_dist_params Unexecuted instantiation: rd.c:set_tx_domain_dist_params Unexecuted instantiation: rdopt.c:set_tx_domain_dist_params Unexecuted instantiation: nonrd_pickmode.c:set_tx_domain_dist_params Unexecuted instantiation: nonrd_opt.c:set_tx_domain_dist_params Unexecuted instantiation: speed_features.c:set_tx_domain_dist_params Unexecuted instantiation: superres_scale.c:set_tx_domain_dist_params Unexecuted instantiation: svc_layercontext.c:set_tx_domain_dist_params Unexecuted instantiation: temporal_filter.c:set_tx_domain_dist_params Unexecuted instantiation: tokenize.c:set_tx_domain_dist_params Unexecuted instantiation: tpl_model.c:set_tx_domain_dist_params Unexecuted instantiation: tx_search.c:set_tx_domain_dist_params Unexecuted instantiation: intra_mode_search.c:set_tx_domain_dist_params Unexecuted instantiation: var_based_part.c:set_tx_domain_dist_params Unexecuted instantiation: compound_type.c:set_tx_domain_dist_params Unexecuted instantiation: encode_strategy.c:set_tx_domain_dist_params Unexecuted instantiation: interp_search.c:set_tx_domain_dist_params Unexecuted instantiation: motion_search_facade.c:set_tx_domain_dist_params |
544 | | |
545 | | // This function sets mode parameters for different mode evaluation stages |
546 | | static inline void set_mode_eval_params(const struct AV1_COMP *cpi, |
547 | | MACROBLOCK *x, |
548 | 0 | MODE_EVAL_TYPE mode_eval_type) { |
549 | 0 | const AV1_COMMON *cm = &cpi->common; |
550 | 0 | const SPEED_FEATURES *sf = &cpi->sf; |
551 | 0 | const WinnerModeParams *winner_mode_params = &cpi->winner_mode_params; |
552 | 0 | TxfmSearchParams *txfm_params = &x->txfm_search_params; |
553 | |
|
554 | 0 | txfm_params->use_qm_dist_metric = |
555 | 0 | cpi->oxcf.tune_cfg.dist_metric == AOM_DIST_METRIC_QM_PSNR; |
556 | |
|
557 | 0 | switch (mode_eval_type) { |
558 | 0 | case DEFAULT_EVAL: |
559 | 0 | txfm_params->default_inter_tx_type_prob_thresh = INT_MAX; |
560 | 0 | txfm_params->use_default_intra_tx_type = 0; |
561 | 0 | txfm_params->skip_txfm_level = |
562 | 0 | winner_mode_params->skip_txfm_level[DEFAULT_EVAL]; |
563 | 0 | txfm_params->predict_dc_level = |
564 | 0 | winner_mode_params->predict_dc_level[DEFAULT_EVAL]; |
565 | | // Set default transform domain distortion type |
566 | 0 | set_tx_domain_dist_params(winner_mode_params, txfm_params, 0, 0); |
567 | | |
568 | | // Get default threshold for R-D optimization of coefficients |
569 | 0 | get_rd_opt_coeff_thresh(winner_mode_params->coeff_opt_thresholds, |
570 | 0 | txfm_params, 0, 0); |
571 | | |
572 | | // Set default transform size search method |
573 | 0 | set_tx_size_search_method(cm, winner_mode_params, txfm_params, 0, 0); |
574 | | // Set default transform type prune |
575 | 0 | set_tx_type_prune(sf, txfm_params, 0, 0); |
576 | 0 | break; |
577 | 0 | case MODE_EVAL: |
578 | 0 | txfm_params->use_default_intra_tx_type = |
579 | 0 | (cpi->sf.tx_sf.tx_type_search.fast_intra_tx_type_search || |
580 | 0 | cpi->oxcf.txfm_cfg.use_intra_default_tx_only); |
581 | 0 | txfm_params->default_inter_tx_type_prob_thresh = |
582 | 0 | cpi->sf.tx_sf.tx_type_search.fast_inter_tx_type_prob_thresh; |
583 | 0 | txfm_params->skip_txfm_level = |
584 | 0 | winner_mode_params->skip_txfm_level[MODE_EVAL]; |
585 | 0 | txfm_params->predict_dc_level = |
586 | 0 | winner_mode_params->predict_dc_level[MODE_EVAL]; |
587 | | // Set transform domain distortion type for mode evaluation |
588 | 0 | set_tx_domain_dist_params( |
589 | 0 | winner_mode_params, txfm_params, |
590 | 0 | sf->winner_mode_sf.enable_winner_mode_for_use_tx_domain_dist, 0); |
591 | | |
592 | | // Get threshold for R-D optimization of coefficients during mode |
593 | | // evaluation |
594 | 0 | get_rd_opt_coeff_thresh( |
595 | 0 | winner_mode_params->coeff_opt_thresholds, txfm_params, |
596 | 0 | sf->winner_mode_sf.enable_winner_mode_for_coeff_opt, 0); |
597 | | |
598 | | // Set the transform size search method for mode evaluation |
599 | 0 | set_tx_size_search_method( |
600 | 0 | cm, winner_mode_params, txfm_params, |
601 | 0 | sf->winner_mode_sf.enable_winner_mode_for_tx_size_srch, 0); |
602 | | // Set transform type prune for mode evaluation |
603 | 0 | set_tx_type_prune(sf, txfm_params, |
604 | 0 | sf->tx_sf.tx_type_search.winner_mode_tx_type_pruning, |
605 | 0 | 0); |
606 | 0 | break; |
607 | 0 | case WINNER_MODE_EVAL: |
608 | 0 | txfm_params->default_inter_tx_type_prob_thresh = INT_MAX; |
609 | 0 | txfm_params->use_default_intra_tx_type = 0; |
610 | 0 | txfm_params->skip_txfm_level = |
611 | 0 | winner_mode_params->skip_txfm_level[WINNER_MODE_EVAL]; |
612 | 0 | txfm_params->predict_dc_level = |
613 | 0 | winner_mode_params->predict_dc_level[WINNER_MODE_EVAL]; |
614 | | |
615 | | // Set transform domain distortion type for winner mode evaluation |
616 | 0 | set_tx_domain_dist_params( |
617 | 0 | winner_mode_params, txfm_params, |
618 | 0 | sf->winner_mode_sf.enable_winner_mode_for_use_tx_domain_dist, 1); |
619 | | |
620 | | // Get threshold for R-D optimization of coefficients for winner mode |
621 | | // evaluation |
622 | 0 | get_rd_opt_coeff_thresh( |
623 | 0 | winner_mode_params->coeff_opt_thresholds, txfm_params, |
624 | 0 | sf->winner_mode_sf.enable_winner_mode_for_coeff_opt, 1); |
625 | | |
626 | | // Set the transform size search method for winner mode evaluation |
627 | 0 | set_tx_size_search_method( |
628 | 0 | cm, winner_mode_params, txfm_params, |
629 | 0 | sf->winner_mode_sf.enable_winner_mode_for_tx_size_srch, 1); |
630 | | // Set default transform type prune mode for winner mode evaluation |
631 | 0 | set_tx_type_prune(sf, txfm_params, |
632 | 0 | sf->tx_sf.tx_type_search.winner_mode_tx_type_pruning, |
633 | 0 | 1); |
634 | 0 | break; |
635 | 0 | default: assert(0); |
636 | 0 | } |
637 | | |
638 | | // Rd record collected at a specific mode evaluation stage can not be used |
639 | | // across other evaluation stages as the transform parameters are different. |
640 | | // Hence, reset mb rd record whenever mode evaluation stage type changes. |
641 | 0 | if (txfm_params->mode_eval_type != mode_eval_type) |
642 | 0 | reset_mb_rd_record(x->txfm_search_info.mb_rd_record); |
643 | |
|
644 | 0 | txfm_params->mode_eval_type = mode_eval_type; |
645 | 0 | } Unexecuted instantiation: av1_cx_iface.c:set_mode_eval_params Unexecuted instantiation: allintra_vis.c:set_mode_eval_params Unexecuted instantiation: encodeframe.c:set_mode_eval_params Unexecuted instantiation: encodeframe_utils.c:set_mode_eval_params Unexecuted instantiation: encodemb.c:set_mode_eval_params Unexecuted instantiation: encoder.c:set_mode_eval_params Unexecuted instantiation: encoder_utils.c:set_mode_eval_params Unexecuted instantiation: encodetxb.c:set_mode_eval_params Unexecuted instantiation: ethread.c:set_mode_eval_params Unexecuted instantiation: firstpass.c:set_mode_eval_params Unexecuted instantiation: global_motion_facade.c:set_mode_eval_params Unexecuted instantiation: mcomp.c:set_mode_eval_params Unexecuted instantiation: palette.c:set_mode_eval_params Unexecuted instantiation: partition_search.c:set_mode_eval_params Unexecuted instantiation: partition_strategy.c:set_mode_eval_params Unexecuted instantiation: rd.c:set_mode_eval_params Unexecuted instantiation: rdopt.c:set_mode_eval_params Unexecuted instantiation: nonrd_pickmode.c:set_mode_eval_params Unexecuted instantiation: nonrd_opt.c:set_mode_eval_params Unexecuted instantiation: speed_features.c:set_mode_eval_params Unexecuted instantiation: superres_scale.c:set_mode_eval_params Unexecuted instantiation: svc_layercontext.c:set_mode_eval_params Unexecuted instantiation: temporal_filter.c:set_mode_eval_params Unexecuted instantiation: tokenize.c:set_mode_eval_params Unexecuted instantiation: tpl_model.c:set_mode_eval_params Unexecuted instantiation: tx_search.c:set_mode_eval_params Unexecuted instantiation: intra_mode_search.c:set_mode_eval_params Unexecuted instantiation: var_based_part.c:set_mode_eval_params Unexecuted instantiation: compound_type.c:set_mode_eval_params Unexecuted instantiation: encode_strategy.c:set_mode_eval_params Unexecuted instantiation: interp_search.c:set_mode_eval_params Unexecuted instantiation: motion_search_facade.c:set_mode_eval_params |
646 | | |
647 | | // Similar to store_cfl_required(), but for use during the RDO process, |
648 | | // where we haven't yet determined whether this block uses CfL. |
649 | | static inline CFL_ALLOWED_TYPE store_cfl_required_rdo(const AV1_COMMON *cm, |
650 | 0 | const MACROBLOCK *x) { |
651 | 0 | const MACROBLOCKD *xd = &x->e_mbd; |
652 | |
|
653 | 0 | if (cm->seq_params->monochrome || !xd->is_chroma_ref) return CFL_DISALLOWED; |
654 | | |
655 | 0 | if (!xd->is_chroma_ref) { |
656 | | // For non-chroma-reference blocks, we should always store the luma pixels, |
657 | | // in case the corresponding chroma-reference block uses CfL. |
658 | | // Note that this can only happen for block sizes which are <8 on |
659 | | // their shortest side, as otherwise they would be chroma reference |
660 | | // blocks. |
661 | 0 | return CFL_ALLOWED; |
662 | 0 | } |
663 | | |
664 | | // For chroma reference blocks, we should store data in the encoder iff we're |
665 | | // allowed to try out CfL. |
666 | 0 | return is_cfl_allowed(xd); |
667 | 0 | } Unexecuted instantiation: av1_cx_iface.c:store_cfl_required_rdo Unexecuted instantiation: allintra_vis.c:store_cfl_required_rdo Unexecuted instantiation: encodeframe.c:store_cfl_required_rdo Unexecuted instantiation: encodeframe_utils.c:store_cfl_required_rdo Unexecuted instantiation: encodemb.c:store_cfl_required_rdo Unexecuted instantiation: encoder.c:store_cfl_required_rdo Unexecuted instantiation: encoder_utils.c:store_cfl_required_rdo Unexecuted instantiation: encodetxb.c:store_cfl_required_rdo Unexecuted instantiation: ethread.c:store_cfl_required_rdo Unexecuted instantiation: firstpass.c:store_cfl_required_rdo Unexecuted instantiation: global_motion_facade.c:store_cfl_required_rdo Unexecuted instantiation: mcomp.c:store_cfl_required_rdo Unexecuted instantiation: palette.c:store_cfl_required_rdo Unexecuted instantiation: partition_search.c:store_cfl_required_rdo Unexecuted instantiation: partition_strategy.c:store_cfl_required_rdo Unexecuted instantiation: rd.c:store_cfl_required_rdo Unexecuted instantiation: rdopt.c:store_cfl_required_rdo Unexecuted instantiation: nonrd_pickmode.c:store_cfl_required_rdo Unexecuted instantiation: nonrd_opt.c:store_cfl_required_rdo Unexecuted instantiation: speed_features.c:store_cfl_required_rdo Unexecuted instantiation: superres_scale.c:store_cfl_required_rdo Unexecuted instantiation: svc_layercontext.c:store_cfl_required_rdo Unexecuted instantiation: temporal_filter.c:store_cfl_required_rdo Unexecuted instantiation: tokenize.c:store_cfl_required_rdo Unexecuted instantiation: tpl_model.c:store_cfl_required_rdo Unexecuted instantiation: tx_search.c:store_cfl_required_rdo Unexecuted instantiation: intra_mode_search.c:store_cfl_required_rdo Unexecuted instantiation: var_based_part.c:store_cfl_required_rdo Unexecuted instantiation: compound_type.c:store_cfl_required_rdo Unexecuted instantiation: encode_strategy.c:store_cfl_required_rdo Unexecuted instantiation: interp_search.c:store_cfl_required_rdo Unexecuted instantiation: motion_search_facade.c:store_cfl_required_rdo |
668 | | |
669 | 0 | static inline void init_sbuv_mode(MB_MODE_INFO *const mbmi) { |
670 | 0 | mbmi->uv_mode = UV_DC_PRED; |
671 | 0 | mbmi->palette_mode_info.palette_size[1] = 0; |
672 | 0 | } Unexecuted instantiation: av1_cx_iface.c:init_sbuv_mode Unexecuted instantiation: allintra_vis.c:init_sbuv_mode Unexecuted instantiation: encodeframe.c:init_sbuv_mode Unexecuted instantiation: encodeframe_utils.c:init_sbuv_mode Unexecuted instantiation: encodemb.c:init_sbuv_mode Unexecuted instantiation: encoder.c:init_sbuv_mode Unexecuted instantiation: encoder_utils.c:init_sbuv_mode Unexecuted instantiation: encodetxb.c:init_sbuv_mode Unexecuted instantiation: ethread.c:init_sbuv_mode Unexecuted instantiation: firstpass.c:init_sbuv_mode Unexecuted instantiation: global_motion_facade.c:init_sbuv_mode Unexecuted instantiation: mcomp.c:init_sbuv_mode Unexecuted instantiation: palette.c:init_sbuv_mode Unexecuted instantiation: partition_search.c:init_sbuv_mode Unexecuted instantiation: partition_strategy.c:init_sbuv_mode Unexecuted instantiation: rd.c:init_sbuv_mode Unexecuted instantiation: rdopt.c:init_sbuv_mode Unexecuted instantiation: nonrd_pickmode.c:init_sbuv_mode Unexecuted instantiation: nonrd_opt.c:init_sbuv_mode Unexecuted instantiation: speed_features.c:init_sbuv_mode Unexecuted instantiation: superres_scale.c:init_sbuv_mode Unexecuted instantiation: svc_layercontext.c:init_sbuv_mode Unexecuted instantiation: temporal_filter.c:init_sbuv_mode Unexecuted instantiation: tokenize.c:init_sbuv_mode Unexecuted instantiation: tpl_model.c:init_sbuv_mode Unexecuted instantiation: tx_search.c:init_sbuv_mode Unexecuted instantiation: intra_mode_search.c:init_sbuv_mode Unexecuted instantiation: var_based_part.c:init_sbuv_mode Unexecuted instantiation: compound_type.c:init_sbuv_mode Unexecuted instantiation: encode_strategy.c:init_sbuv_mode Unexecuted instantiation: interp_search.c:init_sbuv_mode Unexecuted instantiation: motion_search_facade.c:init_sbuv_mode |
673 | | |
674 | | // Store best mode stats for winner mode processing |
675 | | static inline void store_winner_mode_stats( |
676 | | const AV1_COMMON *const cm, MACROBLOCK *x, const MB_MODE_INFO *mbmi, |
677 | | RD_STATS *rd_cost, RD_STATS *rd_cost_y, RD_STATS *rd_cost_uv, |
678 | | THR_MODES mode_index, uint8_t *color_map, BLOCK_SIZE bsize, int64_t this_rd, |
679 | 0 | int multi_winner_mode_type, int txfm_search_done) { |
680 | 0 | WinnerModeStats *winner_mode_stats = x->winner_mode_stats; |
681 | 0 | int mode_idx = 0; |
682 | 0 | int is_palette_mode = mbmi->palette_mode_info.palette_size[PLANE_TYPE_Y] > 0; |
683 | | // Mode stat is not required when multiwinner mode processing is disabled |
684 | 0 | if (multi_winner_mode_type == MULTI_WINNER_MODE_OFF) return; |
685 | | // Ignore mode with maximum rd |
686 | 0 | if (this_rd == INT64_MAX) return; |
687 | | // TODO(any): Winner mode processing is currently not applicable for palette |
688 | | // mode in Inter frames. Clean-up the following code, once support is added |
689 | 0 | if (!frame_is_intra_only(cm) && is_palette_mode) return; |
690 | | |
691 | 0 | int max_winner_mode_count = winner_mode_count_allowed[multi_winner_mode_type]; |
692 | 0 | assert(x->winner_mode_count >= 0 && |
693 | 0 | x->winner_mode_count <= max_winner_mode_count); |
694 | |
|
695 | 0 | if (x->winner_mode_count) { |
696 | | // Find the mode which has higher rd cost than this_rd |
697 | 0 | for (mode_idx = 0; mode_idx < x->winner_mode_count; mode_idx++) |
698 | 0 | if (winner_mode_stats[mode_idx].rd > this_rd) break; |
699 | |
|
700 | 0 | if (mode_idx == max_winner_mode_count) { |
701 | | // No mode has higher rd cost than this_rd |
702 | 0 | return; |
703 | 0 | } else if (mode_idx < max_winner_mode_count - 1) { |
704 | | // Create a slot for current mode and move others to the next slot |
705 | 0 | memmove( |
706 | 0 | &winner_mode_stats[mode_idx + 1], &winner_mode_stats[mode_idx], |
707 | 0 | (max_winner_mode_count - mode_idx - 1) * sizeof(*winner_mode_stats)); |
708 | 0 | } |
709 | 0 | } |
710 | | // Add a mode stat for winner mode processing |
711 | 0 | winner_mode_stats[mode_idx].mbmi = *mbmi; |
712 | 0 | winner_mode_stats[mode_idx].rd = this_rd; |
713 | 0 | winner_mode_stats[mode_idx].mode_index = mode_index; |
714 | | |
715 | | // Update rd stats required for inter frame |
716 | 0 | if (!frame_is_intra_only(cm) && rd_cost && rd_cost_y && rd_cost_uv) { |
717 | 0 | const MACROBLOCKD *xd = &x->e_mbd; |
718 | 0 | const int skip_ctx = av1_get_skip_txfm_context(xd); |
719 | 0 | const int is_intra_mode = av1_mode_defs[mode_index].mode < INTRA_MODE_END; |
720 | 0 | const int skip_txfm = mbmi->skip_txfm && !is_intra_mode; |
721 | |
|
722 | 0 | winner_mode_stats[mode_idx].rd_cost = *rd_cost; |
723 | 0 | if (txfm_search_done) { |
724 | 0 | winner_mode_stats[mode_idx].rate_y = |
725 | 0 | rd_cost_y->rate + |
726 | 0 | x->mode_costs |
727 | 0 | .skip_txfm_cost[skip_ctx][rd_cost->skip_txfm || skip_txfm]; |
728 | 0 | winner_mode_stats[mode_idx].rate_uv = rd_cost_uv->rate; |
729 | 0 | } |
730 | 0 | } |
731 | |
|
732 | 0 | if (color_map) { |
733 | | // Store color_index_map for palette mode |
734 | 0 | const MACROBLOCKD *const xd = &x->e_mbd; |
735 | 0 | int block_width, block_height; |
736 | 0 | av1_get_block_dimensions(bsize, AOM_PLANE_Y, xd, &block_width, |
737 | 0 | &block_height, NULL, NULL); |
738 | 0 | memcpy(winner_mode_stats[mode_idx].color_index_map, color_map, |
739 | 0 | block_width * block_height * sizeof(color_map[0])); |
740 | 0 | } |
741 | |
|
742 | 0 | x->winner_mode_count = |
743 | 0 | AOMMIN(x->winner_mode_count + 1, max_winner_mode_count); |
744 | 0 | } Unexecuted instantiation: av1_cx_iface.c:store_winner_mode_stats Unexecuted instantiation: allintra_vis.c:store_winner_mode_stats Unexecuted instantiation: encodeframe.c:store_winner_mode_stats Unexecuted instantiation: encodeframe_utils.c:store_winner_mode_stats Unexecuted instantiation: encodemb.c:store_winner_mode_stats Unexecuted instantiation: encoder.c:store_winner_mode_stats Unexecuted instantiation: encoder_utils.c:store_winner_mode_stats Unexecuted instantiation: encodetxb.c:store_winner_mode_stats Unexecuted instantiation: ethread.c:store_winner_mode_stats Unexecuted instantiation: firstpass.c:store_winner_mode_stats Unexecuted instantiation: global_motion_facade.c:store_winner_mode_stats Unexecuted instantiation: mcomp.c:store_winner_mode_stats Unexecuted instantiation: palette.c:store_winner_mode_stats Unexecuted instantiation: partition_search.c:store_winner_mode_stats Unexecuted instantiation: partition_strategy.c:store_winner_mode_stats Unexecuted instantiation: rd.c:store_winner_mode_stats Unexecuted instantiation: rdopt.c:store_winner_mode_stats Unexecuted instantiation: nonrd_pickmode.c:store_winner_mode_stats Unexecuted instantiation: nonrd_opt.c:store_winner_mode_stats Unexecuted instantiation: speed_features.c:store_winner_mode_stats Unexecuted instantiation: superres_scale.c:store_winner_mode_stats Unexecuted instantiation: svc_layercontext.c:store_winner_mode_stats Unexecuted instantiation: temporal_filter.c:store_winner_mode_stats Unexecuted instantiation: tokenize.c:store_winner_mode_stats Unexecuted instantiation: tpl_model.c:store_winner_mode_stats Unexecuted instantiation: tx_search.c:store_winner_mode_stats Unexecuted instantiation: intra_mode_search.c:store_winner_mode_stats Unexecuted instantiation: var_based_part.c:store_winner_mode_stats Unexecuted instantiation: compound_type.c:store_winner_mode_stats Unexecuted instantiation: encode_strategy.c:store_winner_mode_stats Unexecuted instantiation: interp_search.c:store_winner_mode_stats Unexecuted instantiation: motion_search_facade.c:store_winner_mode_stats |
745 | | |
746 | | unsigned int av1_get_perpixel_variance(const AV1_COMP *cpi, |
747 | | const MACROBLOCKD *xd, |
748 | | const struct buf_2d *ref, |
749 | | BLOCK_SIZE bsize, int plane, |
750 | | int use_hbd); |
751 | | |
752 | | unsigned int av1_get_perpixel_variance_facade(const struct AV1_COMP *cpi, |
753 | | const MACROBLOCKD *xd, |
754 | | const struct buf_2d *ref, |
755 | | BLOCK_SIZE bsize, int plane); |
756 | | |
757 | 0 | static inline int is_mode_intra(PREDICTION_MODE mode) { |
758 | 0 | return mode < INTRA_MODE_END; |
759 | 0 | } Unexecuted instantiation: av1_cx_iface.c:is_mode_intra Unexecuted instantiation: allintra_vis.c:is_mode_intra Unexecuted instantiation: encodeframe.c:is_mode_intra Unexecuted instantiation: encodeframe_utils.c:is_mode_intra Unexecuted instantiation: encodemb.c:is_mode_intra Unexecuted instantiation: encoder.c:is_mode_intra Unexecuted instantiation: encoder_utils.c:is_mode_intra Unexecuted instantiation: encodetxb.c:is_mode_intra Unexecuted instantiation: ethread.c:is_mode_intra Unexecuted instantiation: firstpass.c:is_mode_intra Unexecuted instantiation: global_motion_facade.c:is_mode_intra Unexecuted instantiation: mcomp.c:is_mode_intra Unexecuted instantiation: palette.c:is_mode_intra Unexecuted instantiation: partition_search.c:is_mode_intra Unexecuted instantiation: partition_strategy.c:is_mode_intra Unexecuted instantiation: rd.c:is_mode_intra Unexecuted instantiation: rdopt.c:is_mode_intra Unexecuted instantiation: nonrd_pickmode.c:is_mode_intra Unexecuted instantiation: nonrd_opt.c:is_mode_intra Unexecuted instantiation: speed_features.c:is_mode_intra Unexecuted instantiation: superres_scale.c:is_mode_intra Unexecuted instantiation: svc_layercontext.c:is_mode_intra Unexecuted instantiation: temporal_filter.c:is_mode_intra Unexecuted instantiation: tokenize.c:is_mode_intra Unexecuted instantiation: tpl_model.c:is_mode_intra Unexecuted instantiation: tx_search.c:is_mode_intra Unexecuted instantiation: intra_mode_search.c:is_mode_intra Unexecuted instantiation: var_based_part.c:is_mode_intra Unexecuted instantiation: compound_type.c:is_mode_intra Unexecuted instantiation: encode_strategy.c:is_mode_intra Unexecuted instantiation: interp_search.c:is_mode_intra Unexecuted instantiation: motion_search_facade.c:is_mode_intra |
760 | | |
761 | | // This function will copy usable ref_mv_stack[ref_frame][4] and |
762 | | // weight[ref_frame][4] information from ref_mv_stack[ref_frame][8] and |
763 | | // weight[ref_frame][8]. |
764 | | static inline void av1_copy_usable_ref_mv_stack_and_weight( |
765 | | const MACROBLOCKD *xd, MB_MODE_INFO_EXT *const mbmi_ext, |
766 | 0 | MV_REFERENCE_FRAME ref_frame) { |
767 | 0 | memcpy(mbmi_ext->weight[ref_frame], xd->weight[ref_frame], |
768 | 0 | USABLE_REF_MV_STACK_SIZE * sizeof(xd->weight[0][0])); |
769 | 0 | memcpy(mbmi_ext->ref_mv_stack[ref_frame], xd->ref_mv_stack[ref_frame], |
770 | 0 | USABLE_REF_MV_STACK_SIZE * sizeof(xd->ref_mv_stack[0][0])); |
771 | 0 | } Unexecuted instantiation: av1_cx_iface.c:av1_copy_usable_ref_mv_stack_and_weight Unexecuted instantiation: allintra_vis.c:av1_copy_usable_ref_mv_stack_and_weight Unexecuted instantiation: encodeframe.c:av1_copy_usable_ref_mv_stack_and_weight Unexecuted instantiation: encodeframe_utils.c:av1_copy_usable_ref_mv_stack_and_weight Unexecuted instantiation: encodemb.c:av1_copy_usable_ref_mv_stack_and_weight Unexecuted instantiation: encoder.c:av1_copy_usable_ref_mv_stack_and_weight Unexecuted instantiation: encoder_utils.c:av1_copy_usable_ref_mv_stack_and_weight Unexecuted instantiation: encodetxb.c:av1_copy_usable_ref_mv_stack_and_weight Unexecuted instantiation: ethread.c:av1_copy_usable_ref_mv_stack_and_weight Unexecuted instantiation: firstpass.c:av1_copy_usable_ref_mv_stack_and_weight Unexecuted instantiation: global_motion_facade.c:av1_copy_usable_ref_mv_stack_and_weight Unexecuted instantiation: mcomp.c:av1_copy_usable_ref_mv_stack_and_weight Unexecuted instantiation: palette.c:av1_copy_usable_ref_mv_stack_and_weight Unexecuted instantiation: partition_search.c:av1_copy_usable_ref_mv_stack_and_weight Unexecuted instantiation: partition_strategy.c:av1_copy_usable_ref_mv_stack_and_weight Unexecuted instantiation: rd.c:av1_copy_usable_ref_mv_stack_and_weight Unexecuted instantiation: rdopt.c:av1_copy_usable_ref_mv_stack_and_weight Unexecuted instantiation: nonrd_pickmode.c:av1_copy_usable_ref_mv_stack_and_weight Unexecuted instantiation: nonrd_opt.c:av1_copy_usable_ref_mv_stack_and_weight Unexecuted instantiation: speed_features.c:av1_copy_usable_ref_mv_stack_and_weight Unexecuted instantiation: superres_scale.c:av1_copy_usable_ref_mv_stack_and_weight Unexecuted instantiation: svc_layercontext.c:av1_copy_usable_ref_mv_stack_and_weight Unexecuted instantiation: temporal_filter.c:av1_copy_usable_ref_mv_stack_and_weight Unexecuted instantiation: tokenize.c:av1_copy_usable_ref_mv_stack_and_weight Unexecuted instantiation: tpl_model.c:av1_copy_usable_ref_mv_stack_and_weight Unexecuted instantiation: tx_search.c:av1_copy_usable_ref_mv_stack_and_weight Unexecuted instantiation: intra_mode_search.c:av1_copy_usable_ref_mv_stack_and_weight Unexecuted instantiation: var_based_part.c:av1_copy_usable_ref_mv_stack_and_weight Unexecuted instantiation: compound_type.c:av1_copy_usable_ref_mv_stack_and_weight Unexecuted instantiation: encode_strategy.c:av1_copy_usable_ref_mv_stack_and_weight Unexecuted instantiation: interp_search.c:av1_copy_usable_ref_mv_stack_and_weight Unexecuted instantiation: motion_search_facade.c:av1_copy_usable_ref_mv_stack_and_weight |
772 | | |
773 | | // Get transform rd gate level for the given transform search case. |
774 | | static inline int get_txfm_rd_gate_level( |
775 | | const int is_masked_compound_enabled, |
776 | | const int txfm_rd_gate_level[TX_SEARCH_CASES], BLOCK_SIZE bsize, |
777 | 0 | TX_SEARCH_CASE tx_search_case, int eval_motion_mode) { |
778 | 0 | assert(tx_search_case < TX_SEARCH_CASES); |
779 | 0 | if (tx_search_case == TX_SEARCH_MOTION_MODE && !eval_motion_mode && |
780 | 0 | num_pels_log2_lookup[bsize] > 8) |
781 | 0 | return txfm_rd_gate_level[TX_SEARCH_MOTION_MODE]; |
782 | | // Enable aggressive gating of transform search only when masked compound type |
783 | | // is enabled. |
784 | 0 | else if (tx_search_case == TX_SEARCH_COMP_TYPE_MODE && |
785 | 0 | is_masked_compound_enabled) |
786 | 0 | return txfm_rd_gate_level[TX_SEARCH_COMP_TYPE_MODE]; |
787 | | |
788 | 0 | return txfm_rd_gate_level[TX_SEARCH_DEFAULT]; |
789 | 0 | } Unexecuted instantiation: av1_cx_iface.c:get_txfm_rd_gate_level Unexecuted instantiation: allintra_vis.c:get_txfm_rd_gate_level Unexecuted instantiation: encodeframe.c:get_txfm_rd_gate_level Unexecuted instantiation: encodeframe_utils.c:get_txfm_rd_gate_level Unexecuted instantiation: encodemb.c:get_txfm_rd_gate_level Unexecuted instantiation: encoder.c:get_txfm_rd_gate_level Unexecuted instantiation: encoder_utils.c:get_txfm_rd_gate_level Unexecuted instantiation: encodetxb.c:get_txfm_rd_gate_level Unexecuted instantiation: ethread.c:get_txfm_rd_gate_level Unexecuted instantiation: firstpass.c:get_txfm_rd_gate_level Unexecuted instantiation: global_motion_facade.c:get_txfm_rd_gate_level Unexecuted instantiation: mcomp.c:get_txfm_rd_gate_level Unexecuted instantiation: palette.c:get_txfm_rd_gate_level Unexecuted instantiation: partition_search.c:get_txfm_rd_gate_level Unexecuted instantiation: partition_strategy.c:get_txfm_rd_gate_level Unexecuted instantiation: rd.c:get_txfm_rd_gate_level Unexecuted instantiation: rdopt.c:get_txfm_rd_gate_level Unexecuted instantiation: nonrd_pickmode.c:get_txfm_rd_gate_level Unexecuted instantiation: nonrd_opt.c:get_txfm_rd_gate_level Unexecuted instantiation: speed_features.c:get_txfm_rd_gate_level Unexecuted instantiation: superres_scale.c:get_txfm_rd_gate_level Unexecuted instantiation: svc_layercontext.c:get_txfm_rd_gate_level Unexecuted instantiation: temporal_filter.c:get_txfm_rd_gate_level Unexecuted instantiation: tokenize.c:get_txfm_rd_gate_level Unexecuted instantiation: tpl_model.c:get_txfm_rd_gate_level Unexecuted instantiation: tx_search.c:get_txfm_rd_gate_level Unexecuted instantiation: intra_mode_search.c:get_txfm_rd_gate_level Unexecuted instantiation: var_based_part.c:get_txfm_rd_gate_level Unexecuted instantiation: compound_type.c:get_txfm_rd_gate_level Unexecuted instantiation: encode_strategy.c:get_txfm_rd_gate_level Unexecuted instantiation: interp_search.c:get_txfm_rd_gate_level Unexecuted instantiation: motion_search_facade.c:get_txfm_rd_gate_level |
790 | | |
791 | | #ifdef __cplusplus |
792 | | } // extern "C" |
793 | | #endif |
794 | | |
795 | | #endif // AOM_AV1_ENCODER_RDOPT_UTILS_H_ |