Coverage Report

Created: 2026-07-25 07:06

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/aom/av1/encoder/rdopt_utils.h
Line
Count
Source
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
0
317
0
  // TODO(aconverse@google.com): Investigate using crop_width/height here rather
318
0
  // 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
0
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
/*!
343
 * \brief Computes the effective dimensions of a block.
344
 *
345
 * \param[in]    x             Pointer to structure holding the data for the
346
                               current encoding macroblock
347
 * \param[in]    plane         The index of the current plane
348
 * \param[in]    plane_bsize   Block size for the current plane
349
 * \param[in]    blk_col       Column offset of the transform block, in MI units
350
 * \param[in]    blk_row       Row offset of the transform block, in MI units
351
 * \param[in]    cols          Transform block width, in pixels
352
 * \param[in]    rows          Transform block height, in pixels
353
 * \param[in]    clip_dims     If false, returns the original block dimensions
354
 *                             If true, clips the block dimensions so they lie
355
 *                             within the valid frame extent
356
 * \param[out]   visible_cols  Pointer to the effective block width, in pixels
357
 * \param[out]   visible_rows  Pointer to the effective block height, in pixels
358
 *
359
 * \return 1 if the block dimensions were clipped; otherwise 0.
360
 */
361
static inline int get_visible_dimensions(const MACROBLOCK *x, int plane,
362
                                         BLOCK_SIZE plane_bsize, int blk_col,
363
                                         int blk_row, int cols, int rows,
364
                                         bool clip_dims, int *visible_cols,
365
0
                                         int *visible_rows) {
366
0
  if ((x->pix_to_bottom_edge >= 0 && x->pix_to_right_edge >= 0) || !clip_dims) {
367
0
    if (visible_cols != NULL && visible_rows != NULL) {
368
0
      *visible_rows = rows;
369
0
      *visible_cols = cols;
370
0
    }
371
0
    return 0;
372
0
  }
373
0
  const MACROBLOCKD *const xd = &x->e_mbd;
374
0
  const struct macroblockd_plane *const pd = &xd->plane[plane];
375
0
  int valid_cols, valid_rows;
376
377
0
  if (x->pix_to_bottom_edge >= 0) {
378
0
    valid_rows = rows;
379
0
  } else {
380
0
    const int block_height = block_size_high[plane_bsize];
381
0
    const int block_rows =
382
0
        -ROUND_POWER_OF_TWO(-x->pix_to_bottom_edge, pd->subsampling_y) +
383
0
        block_height;
384
0
    valid_rows = clamp(block_rows - (blk_row << MI_SIZE_LOG2), 0, rows);
385
0
  }
386
387
0
  if (x->pix_to_right_edge >= 0) {
388
0
    valid_cols = cols;
389
0
  } else {
390
0
    const int block_width = block_size_wide[plane_bsize];
391
0
    const int block_cols =
392
0
        -ROUND_POWER_OF_TWO(-x->pix_to_right_edge, pd->subsampling_x) +
393
0
        block_width;
394
0
    valid_cols = clamp(block_cols - (blk_col << MI_SIZE_LOG2), 0, cols);
395
0
  }
396
0
  if (visible_cols != NULL && visible_rows != NULL) {
397
0
    *visible_cols = valid_cols;
398
0
    *visible_rows = valid_rows;
399
0
  }
400
0
  return (valid_cols < cols || valid_rows < rows);
401
0
}
Unexecuted instantiation: av1_cx_iface.c:get_visible_dimensions
Unexecuted instantiation: allintra_vis.c:get_visible_dimensions
Unexecuted instantiation: encodeframe.c:get_visible_dimensions
Unexecuted instantiation: encodeframe_utils.c:get_visible_dimensions
Unexecuted instantiation: encodemb.c:get_visible_dimensions
Unexecuted instantiation: encoder.c:get_visible_dimensions
Unexecuted instantiation: encoder_utils.c:get_visible_dimensions
Unexecuted instantiation: encodetxb.c:get_visible_dimensions
Unexecuted instantiation: ethread.c:get_visible_dimensions
Unexecuted instantiation: firstpass.c:get_visible_dimensions
Unexecuted instantiation: global_motion_facade.c:get_visible_dimensions
Unexecuted instantiation: mcomp.c:get_visible_dimensions
Unexecuted instantiation: palette.c:get_visible_dimensions
Unexecuted instantiation: partition_search.c:get_visible_dimensions
Unexecuted instantiation: partition_strategy.c:get_visible_dimensions
Unexecuted instantiation: rd.c:get_visible_dimensions
Unexecuted instantiation: rdopt.c:get_visible_dimensions
Unexecuted instantiation: nonrd_pickmode.c:get_visible_dimensions
Unexecuted instantiation: nonrd_opt.c:get_visible_dimensions
Unexecuted instantiation: speed_features.c:get_visible_dimensions
Unexecuted instantiation: superres_scale.c:get_visible_dimensions
Unexecuted instantiation: svc_layercontext.c:get_visible_dimensions
Unexecuted instantiation: temporal_filter.c:get_visible_dimensions
Unexecuted instantiation: tokenize.c:get_visible_dimensions
Unexecuted instantiation: tpl_model.c:get_visible_dimensions
Unexecuted instantiation: tx_search.c:get_visible_dimensions
Unexecuted instantiation: intra_mode_search.c:get_visible_dimensions
Unexecuted instantiation: var_based_part.c:get_visible_dimensions
Unexecuted instantiation: compound_type.c:get_visible_dimensions
Unexecuted instantiation: encode_strategy.c:get_visible_dimensions
Unexecuted instantiation: interp_search.c:get_visible_dimensions
Unexecuted instantiation: motion_search_facade.c:get_visible_dimensions
402
403
0
static inline int bsize_to_num_blk(BLOCK_SIZE bsize) {
404
0
  int num_blk = 1 << (num_pels_log2_lookup[bsize] - 2 * MI_SIZE_LOG2);
405
0
  return num_blk;
406
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
407
408
static inline int check_txfm_eval(MACROBLOCK *const x, BLOCK_SIZE bsize,
409
                                  int64_t best_skip_rd, int64_t skip_rd,
410
0
                                  int level, int is_luma_only) {
411
0
  int eval_txfm = 1;
412
  // Derive aggressiveness factor for gating the transform search
413
  // Lower value indicates more aggressiveness. Be more conservative (high
414
  // value) for (i) low quantizers (ii) regions where prediction is poor
415
0
  const int scale[MAX_TX_RD_GATE_LEVEL + 1] = { INT_MAX, 4, 3, 2, 2, 1 };
416
0
  const int qslope = 2 * (!is_luma_only);
417
0
  const int level_to_qindex_map[MAX_TX_RD_GATE_LEVEL + 1] = { 0,  0,   0,
418
0
                                                              80, 100, 140 };
419
0
  int aggr_factor = 4;
420
0
  assert(level <= MAX_TX_RD_GATE_LEVEL);
421
0
  const int pred_qindex_thresh = level_to_qindex_map[level];
422
0
  if (!is_luma_only && level <= 2) {
423
0
    aggr_factor = 4 * AOMMAX(1, ROUND_POWER_OF_TWO((MAXQ - x->qindex) * qslope,
424
0
                                                   QINDEX_BITS));
425
0
  }
426
0
  if ((best_skip_rd >
427
0
       (x->source_variance << (num_pels_log2_lookup[bsize] + RDDIV_BITS))) &&
428
0
      (x->qindex >= pred_qindex_thresh))
429
0
    aggr_factor *= scale[level];
430
  // For level setting 1, be more conservative for non-luma-only case even when
431
  // prediction is good.
432
0
  else if ((level <= 1) && !is_luma_only)
433
0
    aggr_factor = (aggr_factor >> 2) * 6;
434
435
  // Be more conservative for luma only cases (called from compound type rd)
436
  // since best_skip_rd is computed after and skip_rd is computed (with 8-bit
437
  // prediction signals blended for WEDGE/DIFFWTD rather than 16-bit) before
438
  // interpolation filter search
439
0
  const int luma_mul[MAX_TX_RD_GATE_LEVEL + 1] = {
440
0
    INT_MAX, 32, 29, 17, 17, 17
441
0
  };
442
0
  int mul_factor = is_luma_only ? luma_mul[level] : 16;
443
0
  int64_t rd_thresh =
444
0
      (best_skip_rd == INT64_MAX)
445
0
          ? best_skip_rd
446
0
          : (int64_t)(best_skip_rd * aggr_factor * mul_factor >> 6);
447
0
  if (skip_rd > rd_thresh) eval_txfm = 0;
448
0
  return eval_txfm;
449
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
450
451
static TX_MODE select_tx_mode(
452
0
    const AV1_COMMON *cm, const TX_SIZE_SEARCH_METHOD tx_size_search_method) {
453
0
  if (cm->features.coded_lossless) return ONLY_4X4;
454
0
  if (tx_size_search_method == USE_LARGESTALL) {
455
0
    return TX_MODE_LARGEST;
456
0
  } else {
457
0
    assert(tx_size_search_method == USE_FULL_RD ||
458
0
           tx_size_search_method == USE_FAST_RD);
459
0
    return TX_MODE_SELECT;
460
0
  }
461
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
462
463
// Checks the conditions to disable winner mode processing
464
static inline int bypass_winner_mode_processing(const MACROBLOCK *const x,
465
                                                const SPEED_FEATURES *sf,
466
                                                int use_txfm_skip,
467
                                                int actual_txfm_skip,
468
0
                                                PREDICTION_MODE best_mode) {
469
0
  const int prune_winner_mode_eval_level =
470
0
      sf->winner_mode_sf.prune_winner_mode_eval_level;
471
472
  // Disable winner mode processing for blocks with low source variance.
473
  // The aggressiveness of this pruning logic reduces as qindex increases.
474
  // The threshold decreases linearly from 64 as qindex varies from 0 to 255.
475
0
  if (prune_winner_mode_eval_level == 1) {
476
0
    const unsigned int src_var_thresh = 64 - 48 * x->qindex / (MAXQ + 1);
477
0
    if (x->source_variance < src_var_thresh) return 1;
478
0
  } else if (prune_winner_mode_eval_level == 2) {
479
    // Skip winner mode processing of blocks for which transform turns out to be
480
    // skip due to nature of eob alone except NEWMV mode.
481
0
    if (!have_newmv_in_inter_mode(best_mode) && actual_txfm_skip) return 1;
482
0
  } else if (prune_winner_mode_eval_level == 3) {
483
    // Skip winner mode processing of blocks for which transform turns out to be
484
    // skip except NEWMV mode and considered based on the quantizer.
485
    // At high quantizers: Take conservative approach by considering transform
486
    // skip based on eob alone.
487
    // At low quantizers: Consider transform skip based on eob nature or RD cost
488
    // evaluation.
489
0
    const int is_txfm_skip =
490
0
        x->qindex > 127 ? actual_txfm_skip : actual_txfm_skip || use_txfm_skip;
491
492
0
    if (!have_newmv_in_inter_mode(best_mode) && is_txfm_skip) return 1;
493
0
  } else if (prune_winner_mode_eval_level >= 4) {
494
    // Do not skip winner mode evaluation at low quantizers if normal mode's
495
    // transform search was too aggressive.
496
0
    if (sf->rd_sf.perform_coeff_opt >= 5 && x->qindex <= 70) return 0;
497
498
0
    if (use_txfm_skip || actual_txfm_skip) return 1;
499
0
  }
500
501
0
  return 0;
502
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
503
504
// Checks the conditions to enable winner mode processing
505
static inline int is_winner_mode_processing_enabled(const struct AV1_COMP *cpi,
506
                                                    const MACROBLOCK *const x,
507
                                                    MB_MODE_INFO *const mbmi,
508
0
                                                    int actual_txfm_skip) {
509
0
  const SPEED_FEATURES *sf = &cpi->sf;
510
0
  const PREDICTION_MODE best_mode = mbmi->mode;
511
512
0
  if (bypass_winner_mode_processing(x, sf, mbmi->skip_txfm, actual_txfm_skip,
513
0
                                    best_mode))
514
0
    return 0;
515
516
  // TODO(any): Move block independent condition checks to frame level
517
0
  if (is_inter_block(mbmi)) {
518
0
    if (is_inter_mode(best_mode) &&
519
0
        (sf->tx_sf.tx_type_search.fast_inter_tx_type_prob_thresh != INT_MAX) &&
520
0
        !cpi->oxcf.txfm_cfg.use_inter_dct_only)
521
0
      return 1;
522
0
  } else {
523
0
    if (sf->tx_sf.tx_type_search.fast_intra_tx_type_search &&
524
0
        !cpi->oxcf.txfm_cfg.use_intra_default_tx_only &&
525
0
        !cpi->oxcf.txfm_cfg.use_intra_dct_only)
526
0
      return 1;
527
0
  }
528
529
  // Check speed feature related to winner mode processing
530
0
  if (sf->winner_mode_sf.enable_winner_mode_for_coeff_opt &&
531
0
      cpi->optimize_seg_arr[mbmi->segment_id] != NO_TRELLIS_OPT &&
532
0
      cpi->optimize_seg_arr[mbmi->segment_id] != FINAL_PASS_TRELLIS_OPT)
533
0
    return 1;
534
0
  if (sf->winner_mode_sf.enable_winner_mode_for_tx_size_srch) return 1;
535
536
0
  return 0;
537
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
538
539
static inline void set_tx_size_search_method(
540
    const AV1_COMMON *cm, const WinnerModeParams *winner_mode_params,
541
    TxfmSearchParams *txfm_params, int enable_winner_mode_for_tx_size_srch,
542
0
    int is_winner_mode) {
543
  // Populate transform size search method/transform mode appropriately
544
0
  txfm_params->tx_size_search_method =
545
0
      winner_mode_params->tx_size_search_methods[DEFAULT_EVAL];
546
0
  if (enable_winner_mode_for_tx_size_srch) {
547
0
    if (is_winner_mode)
548
0
      txfm_params->tx_size_search_method =
549
0
          winner_mode_params->tx_size_search_methods[WINNER_MODE_EVAL];
550
0
    else
551
0
      txfm_params->tx_size_search_method =
552
0
          winner_mode_params->tx_size_search_methods[MODE_EVAL];
553
0
  }
554
0
  txfm_params->tx_mode_search_type =
555
0
      select_tx_mode(cm, txfm_params->tx_size_search_method);
556
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
557
558
static inline void set_tx_type_prune(const SPEED_FEATURES *sf,
559
                                     TxfmSearchParams *txfm_params,
560
                                     int winner_mode_tx_type_pruning,
561
0
                                     int is_winner_mode) {
562
  // Populate prune transform mode appropriately
563
0
  txfm_params->prune_2d_txfm_mode = sf->tx_sf.tx_type_search.prune_2d_txfm_mode;
564
0
  if (!winner_mode_tx_type_pruning) return;
565
566
0
  const int prune_mode[4][2] = { { TX_TYPE_PRUNE_3, TX_TYPE_PRUNE_0 },
567
0
                                 { TX_TYPE_PRUNE_4, TX_TYPE_PRUNE_0 },
568
0
                                 { TX_TYPE_PRUNE_5, TX_TYPE_PRUNE_2 },
569
0
                                 { TX_TYPE_PRUNE_5, TX_TYPE_PRUNE_3 } };
570
0
  txfm_params->prune_2d_txfm_mode =
571
0
      prune_mode[winner_mode_tx_type_pruning - 1][is_winner_mode];
572
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
573
574
static inline void set_tx_domain_dist_params(
575
    const WinnerModeParams *winner_mode_params, TxfmSearchParams *txfm_params,
576
0
    int enable_winner_mode_for_tx_domain_dist, int is_winner_mode) {
577
0
  if (txfm_params->use_qm_dist_metric) {
578
    // QM-weighted PSNR is computed in transform space, so we need to forcibly
579
    // enable the use of tx domain distortion.
580
0
    txfm_params->use_transform_domain_distortion = 1;
581
0
    txfm_params->tx_domain_dist_threshold = 0;
582
0
    return;
583
0
  }
584
585
0
  if (!enable_winner_mode_for_tx_domain_dist) {
586
0
    txfm_params->use_transform_domain_distortion =
587
0
        winner_mode_params->use_transform_domain_distortion[DEFAULT_EVAL];
588
0
    txfm_params->tx_domain_dist_threshold =
589
0
        winner_mode_params->tx_domain_dist_threshold[DEFAULT_EVAL];
590
0
    return;
591
0
  }
592
593
0
  if (is_winner_mode) {
594
0
    txfm_params->use_transform_domain_distortion =
595
0
        winner_mode_params->use_transform_domain_distortion[WINNER_MODE_EVAL];
596
0
    txfm_params->tx_domain_dist_threshold =
597
0
        winner_mode_params->tx_domain_dist_threshold[WINNER_MODE_EVAL];
598
0
  } else {
599
0
    txfm_params->use_transform_domain_distortion =
600
0
        winner_mode_params->use_transform_domain_distortion[MODE_EVAL];
601
0
    txfm_params->tx_domain_dist_threshold =
602
0
        winner_mode_params->tx_domain_dist_threshold[MODE_EVAL];
603
0
  }
604
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
605
606
// This function sets mode parameters for different mode evaluation stages
607
static inline void set_mode_eval_params(const struct AV1_COMP *cpi,
608
                                        MACROBLOCK *x,
609
0
                                        MODE_EVAL_TYPE mode_eval_type) {
610
0
  const AV1_COMMON *cm = &cpi->common;
611
0
  const SPEED_FEATURES *sf = &cpi->sf;
612
0
  const WinnerModeParams *winner_mode_params = &cpi->winner_mode_params;
613
0
  TxfmSearchParams *txfm_params = &x->txfm_search_params;
614
615
0
  txfm_params->use_qm_dist_metric =
616
0
      cpi->oxcf.tune_cfg.dist_metric == AOM_DIST_METRIC_QM_PSNR;
617
618
0
  switch (mode_eval_type) {
619
0
    case DEFAULT_EVAL:
620
0
      txfm_params->default_inter_tx_type_prob_thresh = INT_MAX;
621
0
      txfm_params->use_default_intra_tx_type = 0;
622
0
      txfm_params->use_derived_intra_tx_type_set = 0;
623
0
      txfm_params->skip_txfm_level =
624
0
          winner_mode_params->skip_txfm_level[DEFAULT_EVAL];
625
0
      txfm_params->predict_dc_level =
626
0
          winner_mode_params->predict_dc_level[DEFAULT_EVAL];
627
      // Set default transform domain distortion type
628
0
      set_tx_domain_dist_params(winner_mode_params, txfm_params, 0, 0);
629
630
      // Get default threshold for R-D optimization of coefficients
631
0
      get_rd_opt_coeff_thresh(winner_mode_params->coeff_opt_thresholds,
632
0
                              txfm_params, 0, 0);
633
634
      // Set default transform size search method
635
0
      set_tx_size_search_method(cm, winner_mode_params, txfm_params, 0, 0);
636
      // Set default transform type prune
637
0
      set_tx_type_prune(sf, txfm_params, 0, 0);
638
0
      break;
639
0
    case MODE_EVAL:
640
0
      txfm_params->use_default_intra_tx_type =
641
0
          (cpi->sf.tx_sf.tx_type_search.fast_intra_tx_type_search == 2 ||
642
0
           cpi->oxcf.txfm_cfg.use_intra_default_tx_only);
643
0
      txfm_params->use_derived_intra_tx_type_set =
644
0
          cpi->sf.tx_sf.tx_type_search.fast_intra_tx_type_search == 1;
645
0
      txfm_params->default_inter_tx_type_prob_thresh =
646
0
          cpi->sf.tx_sf.tx_type_search.fast_inter_tx_type_prob_thresh;
647
0
      txfm_params->skip_txfm_level =
648
0
          winner_mode_params->skip_txfm_level[MODE_EVAL];
649
0
      txfm_params->predict_dc_level =
650
0
          winner_mode_params->predict_dc_level[MODE_EVAL];
651
      // Set transform domain distortion type for mode evaluation
652
0
      set_tx_domain_dist_params(
653
0
          winner_mode_params, txfm_params,
654
0
          sf->winner_mode_sf.enable_winner_mode_for_use_tx_domain_dist, 0);
655
656
      // Get threshold for R-D optimization of coefficients during mode
657
      // evaluation
658
0
      get_rd_opt_coeff_thresh(
659
0
          winner_mode_params->coeff_opt_thresholds, txfm_params,
660
0
          sf->winner_mode_sf.enable_winner_mode_for_coeff_opt, 0);
661
662
      // Set the transform size search method for mode evaluation
663
0
      set_tx_size_search_method(
664
0
          cm, winner_mode_params, txfm_params,
665
0
          sf->winner_mode_sf.enable_winner_mode_for_tx_size_srch, 0);
666
      // Set transform type prune for mode evaluation
667
0
      set_tx_type_prune(sf, txfm_params,
668
0
                        sf->tx_sf.tx_type_search.winner_mode_tx_type_pruning,
669
0
                        0);
670
0
      break;
671
0
    case WINNER_MODE_EVAL:
672
0
      txfm_params->default_inter_tx_type_prob_thresh = INT_MAX;
673
0
      txfm_params->use_default_intra_tx_type = 0;
674
0
      txfm_params->use_derived_intra_tx_type_set = 0;
675
0
      txfm_params->skip_txfm_level =
676
0
          winner_mode_params->skip_txfm_level[WINNER_MODE_EVAL];
677
0
      txfm_params->predict_dc_level =
678
0
          winner_mode_params->predict_dc_level[WINNER_MODE_EVAL];
679
680
      // Set transform domain distortion type for winner mode evaluation
681
0
      set_tx_domain_dist_params(
682
0
          winner_mode_params, txfm_params,
683
0
          sf->winner_mode_sf.enable_winner_mode_for_use_tx_domain_dist, 1);
684
685
      // Get threshold for R-D optimization of coefficients for winner mode
686
      // evaluation
687
0
      get_rd_opt_coeff_thresh(
688
0
          winner_mode_params->coeff_opt_thresholds, txfm_params,
689
0
          sf->winner_mode_sf.enable_winner_mode_for_coeff_opt, 1);
690
691
      // Set the transform size search method for winner mode evaluation
692
0
      set_tx_size_search_method(
693
0
          cm, winner_mode_params, txfm_params,
694
0
          sf->winner_mode_sf.enable_winner_mode_for_tx_size_srch, 1);
695
      // Set default transform type prune mode for winner mode evaluation
696
0
      set_tx_type_prune(sf, txfm_params,
697
0
                        sf->tx_sf.tx_type_search.winner_mode_tx_type_pruning,
698
0
                        1);
699
0
      break;
700
0
    default: assert(0);
701
0
  }
702
703
  // Rd record collected at a specific mode evaluation stage can not be used
704
  // across other evaluation stages as the transform parameters are different.
705
  // Hence, reset mb rd record whenever mode evaluation stage type changes.
706
0
  if (txfm_params->mode_eval_type != mode_eval_type)
707
0
    reset_mb_rd_record(x->txfm_search_info.mb_rd_record);
708
709
0
  txfm_params->mode_eval_type = mode_eval_type;
710
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
711
712
// Calculate global motion weight and transformation types for RD bias.
713
// Returns the weight to apply to scaled RD cost for global motion blocks.
714
static inline float get_global_mv_mode_bias(const AV1_COMP *cpi,
715
0
                                            const MB_MODE_INFO *mbmi) {
716
0
  if (cpi->sf.inter_sf.bias_gm_mode_rd_scale_pct <= 0.0f) return 0.0f;
717
0
  if (cpi->common.features.cur_frame_force_integer_mv) return 0.0f;
718
719
0
  assert(mbmi->mode == GLOBALMV || mbmi->mode == GLOBAL_GLOBALMV);
720
721
0
  TransformationType ref_trans_type =
722
0
      cpi->common.global_motion[mbmi->ref_frame[0]].wmtype;
723
0
  if (is_global_mv_block(mbmi, ref_trans_type)) {
724
0
    return cpi->sf.inter_sf.bias_gm_mode_rd_scale_pct / 100.0f;
725
0
  }
726
727
0
  if (has_second_ref(mbmi)) {
728
0
    ref_trans_type = cpi->common.global_motion[mbmi->ref_frame[1]].wmtype;
729
0
    if (is_global_mv_block(mbmi, ref_trans_type)) {
730
0
      return cpi->sf.inter_sf.bias_gm_mode_rd_scale_pct / 100.0f;
731
0
    }
732
0
  }
733
734
0
  return 0.0f;
735
0
}
Unexecuted instantiation: av1_cx_iface.c:get_global_mv_mode_bias
Unexecuted instantiation: allintra_vis.c:get_global_mv_mode_bias
Unexecuted instantiation: encodeframe.c:get_global_mv_mode_bias
Unexecuted instantiation: encodeframe_utils.c:get_global_mv_mode_bias
Unexecuted instantiation: encodemb.c:get_global_mv_mode_bias
Unexecuted instantiation: encoder.c:get_global_mv_mode_bias
Unexecuted instantiation: encoder_utils.c:get_global_mv_mode_bias
Unexecuted instantiation: encodetxb.c:get_global_mv_mode_bias
Unexecuted instantiation: ethread.c:get_global_mv_mode_bias
Unexecuted instantiation: firstpass.c:get_global_mv_mode_bias
Unexecuted instantiation: global_motion_facade.c:get_global_mv_mode_bias
Unexecuted instantiation: mcomp.c:get_global_mv_mode_bias
Unexecuted instantiation: palette.c:get_global_mv_mode_bias
Unexecuted instantiation: partition_search.c:get_global_mv_mode_bias
Unexecuted instantiation: partition_strategy.c:get_global_mv_mode_bias
Unexecuted instantiation: rd.c:get_global_mv_mode_bias
Unexecuted instantiation: rdopt.c:get_global_mv_mode_bias
Unexecuted instantiation: nonrd_pickmode.c:get_global_mv_mode_bias
Unexecuted instantiation: nonrd_opt.c:get_global_mv_mode_bias
Unexecuted instantiation: speed_features.c:get_global_mv_mode_bias
Unexecuted instantiation: superres_scale.c:get_global_mv_mode_bias
Unexecuted instantiation: svc_layercontext.c:get_global_mv_mode_bias
Unexecuted instantiation: temporal_filter.c:get_global_mv_mode_bias
Unexecuted instantiation: tokenize.c:get_global_mv_mode_bias
Unexecuted instantiation: tpl_model.c:get_global_mv_mode_bias
Unexecuted instantiation: tx_search.c:get_global_mv_mode_bias
Unexecuted instantiation: intra_mode_search.c:get_global_mv_mode_bias
Unexecuted instantiation: var_based_part.c:get_global_mv_mode_bias
Unexecuted instantiation: compound_type.c:get_global_mv_mode_bias
Unexecuted instantiation: encode_strategy.c:get_global_mv_mode_bias
Unexecuted instantiation: interp_search.c:get_global_mv_mode_bias
Unexecuted instantiation: motion_search_facade.c:get_global_mv_mode_bias
736
737
static inline int increase_motion_mode_rate(const AV1_COMP *cpi,
738
                                            const MB_MODE_INFO *this_mbmi,
739
0
                                            int rate) {
740
0
  const INTER_MODE_SPEED_FEATURES *const inter_sf = &cpi->sf.inter_sf;
741
0
  double rd_bias_scale = 0.0;
742
0
  if (this_mbmi->motion_mode == WARPED_CAUSAL) {
743
0
    rd_bias_scale = inter_sf->bias_warp_mode_rd_scale_pct / 100.0;
744
0
  } else if (this_mbmi->motion_mode == OBMC_CAUSAL) {
745
0
    rd_bias_scale = inter_sf->bias_obmc_mode_rd_scale_pct / 100.0;
746
0
  } else if (this_mbmi->mode == GLOBALMV ||
747
0
             this_mbmi->mode == GLOBAL_GLOBALMV) {
748
0
    rd_bias_scale = get_global_mv_mode_bias(cpi, this_mbmi);
749
0
  }
750
0
  if (rd_bias_scale <= 0.0) return rate;
751
752
0
  int scaled_rate = rate;
753
0
  scaled_rate += (int)(rd_bias_scale * rate + 0.5);
754
0
  return scaled_rate;
755
0
}
Unexecuted instantiation: av1_cx_iface.c:increase_motion_mode_rate
Unexecuted instantiation: allintra_vis.c:increase_motion_mode_rate
Unexecuted instantiation: encodeframe.c:increase_motion_mode_rate
Unexecuted instantiation: encodeframe_utils.c:increase_motion_mode_rate
Unexecuted instantiation: encodemb.c:increase_motion_mode_rate
Unexecuted instantiation: encoder.c:increase_motion_mode_rate
Unexecuted instantiation: encoder_utils.c:increase_motion_mode_rate
Unexecuted instantiation: encodetxb.c:increase_motion_mode_rate
Unexecuted instantiation: ethread.c:increase_motion_mode_rate
Unexecuted instantiation: firstpass.c:increase_motion_mode_rate
Unexecuted instantiation: global_motion_facade.c:increase_motion_mode_rate
Unexecuted instantiation: mcomp.c:increase_motion_mode_rate
Unexecuted instantiation: palette.c:increase_motion_mode_rate
Unexecuted instantiation: partition_search.c:increase_motion_mode_rate
Unexecuted instantiation: partition_strategy.c:increase_motion_mode_rate
Unexecuted instantiation: rd.c:increase_motion_mode_rate
Unexecuted instantiation: rdopt.c:increase_motion_mode_rate
Unexecuted instantiation: nonrd_pickmode.c:increase_motion_mode_rate
Unexecuted instantiation: nonrd_opt.c:increase_motion_mode_rate
Unexecuted instantiation: speed_features.c:increase_motion_mode_rate
Unexecuted instantiation: superres_scale.c:increase_motion_mode_rate
Unexecuted instantiation: svc_layercontext.c:increase_motion_mode_rate
Unexecuted instantiation: temporal_filter.c:increase_motion_mode_rate
Unexecuted instantiation: tokenize.c:increase_motion_mode_rate
Unexecuted instantiation: tpl_model.c:increase_motion_mode_rate
Unexecuted instantiation: tx_search.c:increase_motion_mode_rate
Unexecuted instantiation: intra_mode_search.c:increase_motion_mode_rate
Unexecuted instantiation: var_based_part.c:increase_motion_mode_rate
Unexecuted instantiation: compound_type.c:increase_motion_mode_rate
Unexecuted instantiation: encode_strategy.c:increase_motion_mode_rate
Unexecuted instantiation: interp_search.c:increase_motion_mode_rate
Unexecuted instantiation: motion_search_facade.c:increase_motion_mode_rate
756
757
// Similar to store_cfl_required(), but for use during the RDO process,
758
// where we haven't yet determined whether this block uses CfL.
759
static inline CFL_ALLOWED_TYPE store_cfl_required_rdo(const AV1_COMMON *cm,
760
0
                                                      const MACROBLOCK *x) {
761
0
  const MACROBLOCKD *xd = &x->e_mbd;
762
763
0
  if (cm->seq_params->monochrome || !xd->is_chroma_ref) return CFL_DISALLOWED;
764
765
0
  if (!xd->is_chroma_ref) {
766
    // For non-chroma-reference blocks, we should always store the luma pixels,
767
    // in case the corresponding chroma-reference block uses CfL.
768
    // Note that this can only happen for block sizes which are <8 on
769
    // their shortest side, as otherwise they would be chroma reference
770
    // blocks.
771
0
    return CFL_ALLOWED;
772
0
  }
773
774
  // For chroma reference blocks, we should store data in the encoder iff we're
775
  // allowed to try out CfL.
776
0
  return is_cfl_allowed(xd);
777
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
778
779
0
static inline void init_sbuv_mode(MB_MODE_INFO *const mbmi) {
780
0
  mbmi->uv_mode = UV_DC_PRED;
781
0
  mbmi->palette_mode_info.palette_size[1] = 0;
782
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
783
784
// Store best mode stats for winner mode processing
785
static inline void store_winner_mode_stats(
786
    const AV1_COMP *cpi, MACROBLOCK *x, const MB_MODE_INFO *mbmi,
787
    RD_STATS *rd_cost, RD_STATS *rd_cost_y, RD_STATS *rd_cost_uv,
788
    THR_MODES mode_index, uint8_t *color_map, BLOCK_SIZE bsize, int64_t this_rd,
789
0
    int multi_winner_mode_type, int txfm_search_done) {
790
0
  const AV1_COMMON *const cm = &cpi->common;
791
0
  WinnerModeStats *winner_mode_stats = x->winner_mode_stats;
792
0
  int mode_idx = 0;
793
0
  int is_palette_mode = mbmi->palette_mode_info.palette_size[PLANE_TYPE_Y] > 0;
794
  // Mode stat is not required when multiwinner mode processing is disabled
795
0
  if (multi_winner_mode_type == MULTI_WINNER_MODE_OFF) return;
796
  // Ignore mode with maximum rd
797
0
  if (this_rd == INT64_MAX) return;
798
  // TODO(any): Winner mode processing is currently not applicable for palette
799
  // mode in Inter frames. Clean-up the following code, once support is added
800
0
  if (!frame_is_intra_only(cm) && is_palette_mode) return;
801
802
0
  int max_winner_mode_count = winner_mode_count_allowed[multi_winner_mode_type];
803
0
  assert(x->winner_mode_count >= 0 &&
804
0
         x->winner_mode_count <= max_winner_mode_count);
805
806
0
  if (x->winner_mode_count) {
807
    // Find the mode which has higher rd cost than this_rd
808
0
    for (mode_idx = 0; mode_idx < x->winner_mode_count; mode_idx++)
809
0
      if (winner_mode_stats[mode_idx].rd > this_rd) break;
810
811
0
    if (mode_idx == max_winner_mode_count) {
812
      // No mode has higher rd cost than this_rd
813
0
      return;
814
0
    } else if (mode_idx < max_winner_mode_count - 1) {
815
      // Create a slot for current mode and move others to the next slot
816
0
      memmove(
817
0
          &winner_mode_stats[mode_idx + 1], &winner_mode_stats[mode_idx],
818
0
          (max_winner_mode_count - mode_idx - 1) * sizeof(*winner_mode_stats));
819
0
    }
820
0
  }
821
  // Add a mode stat for winner mode processing
822
0
  winner_mode_stats[mode_idx].mbmi = *mbmi;
823
0
  winner_mode_stats[mode_idx].rd = this_rd;
824
0
  winner_mode_stats[mode_idx].mode_index = mode_index;
825
826
  // Update rd stats required for inter frame
827
0
  if (!frame_is_intra_only(cm) && rd_cost && rd_cost_y && rd_cost_uv) {
828
0
    const MACROBLOCKD *xd = &x->e_mbd;
829
0
    const int skip_ctx = av1_get_skip_txfm_context(xd);
830
0
    const int is_intra_mode = av1_mode_defs[mode_index].mode < INTRA_MODE_END;
831
0
    const int skip_txfm = mbmi->skip_txfm && !is_intra_mode;
832
833
0
    winner_mode_stats[mode_idx].rd_cost = *rd_cost;
834
0
    if (txfm_search_done) {
835
0
      const int skip_rate =
836
0
          x->mode_costs
837
0
              .skip_txfm_cost[skip_ctx][rd_cost->skip_txfm || skip_txfm];
838
0
      const int scaled_skip_rate =
839
0
          increase_motion_mode_rate(cpi, mbmi, skip_rate);
840
0
      winner_mode_stats[mode_idx].rate_y = rd_cost_y->rate + scaled_skip_rate;
841
0
      winner_mode_stats[mode_idx].rate_uv = rd_cost_uv->rate;
842
0
    }
843
0
  }
844
845
0
  if (color_map) {
846
    // Store color_index_map for palette mode
847
0
    const MACROBLOCKD *const xd = &x->e_mbd;
848
0
    int block_width, block_height;
849
0
    av1_get_block_dimensions(bsize, AOM_PLANE_Y, xd, &block_width,
850
0
                             &block_height, NULL, NULL);
851
0
    memcpy(winner_mode_stats[mode_idx].color_index_map, color_map,
852
0
           block_width * block_height * sizeof(color_map[0]));
853
0
  }
854
855
0
  x->winner_mode_count =
856
0
      AOMMIN(x->winner_mode_count + 1, max_winner_mode_count);
857
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
858
859
unsigned int av1_get_perpixel_variance(const AV1_COMP *cpi,
860
                                       const MACROBLOCKD *xd,
861
                                       const struct buf_2d *ref,
862
                                       BLOCK_SIZE bsize, int plane,
863
                                       int use_hbd);
864
865
unsigned int av1_get_perpixel_variance_facade(const struct AV1_COMP *cpi,
866
                                              const MACROBLOCKD *xd,
867
                                              const struct buf_2d *ref,
868
                                              BLOCK_SIZE bsize, int plane);
869
870
0
static inline int is_mode_intra(PREDICTION_MODE mode) {
871
0
  return mode < INTRA_MODE_END;
872
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
873
874
// This function will copy usable ref_mv_stack[ref_frame][4] and
875
// weight[ref_frame][4] information from ref_mv_stack[ref_frame][8] and
876
// weight[ref_frame][8].
877
static inline void av1_copy_usable_ref_mv_stack_and_weight(
878
    const MACROBLOCKD *xd, MB_MODE_INFO_EXT *const mbmi_ext,
879
0
    MV_REFERENCE_FRAME ref_frame) {
880
0
  memcpy(mbmi_ext->weight[ref_frame], xd->weight[ref_frame],
881
0
         USABLE_REF_MV_STACK_SIZE * sizeof(xd->weight[0][0]));
882
0
  memcpy(mbmi_ext->ref_mv_stack[ref_frame], xd->ref_mv_stack[ref_frame],
883
0
         USABLE_REF_MV_STACK_SIZE * sizeof(xd->ref_mv_stack[0][0]));
884
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
885
886
// Get transform rd gate level for the given transform search case.
887
static inline int get_txfm_rd_gate_level(
888
    const int is_masked_compound_enabled,
889
    const int txfm_rd_gate_level[TX_SEARCH_CASES], BLOCK_SIZE bsize,
890
0
    TX_SEARCH_CASE tx_search_case, int eval_motion_mode) {
891
0
  assert(tx_search_case < TX_SEARCH_CASES);
892
0
  if (tx_search_case == TX_SEARCH_MOTION_MODE && !eval_motion_mode &&
893
0
      num_pels_log2_lookup[bsize] > 8)
894
0
    return txfm_rd_gate_level[TX_SEARCH_MOTION_MODE];
895
  // Enable aggressive gating of transform search only when masked compound type
896
  // is enabled.
897
0
  else if (tx_search_case == TX_SEARCH_COMP_TYPE_MODE &&
898
0
           is_masked_compound_enabled)
899
0
    return txfm_rd_gate_level[TX_SEARCH_COMP_TYPE_MODE];
900
901
0
  return txfm_rd_gate_level[TX_SEARCH_DEFAULT];
902
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
903
904
#ifdef __cplusplus
905
}  // extern "C"
906
#endif
907
908
#endif  // AOM_AV1_ENCODER_RDOPT_UTILS_H_