AOMedia AV1 Codec
speed_features.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2016, Alliance for Open Media. All rights reserved
3 *
4 * This source code is subject to the terms of the BSD 2 Clause License and
5 * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
6 * was not distributed with this source code in the LICENSE file, you can
7 * obtain it at www.aomedia.org/license/software. If the Alliance for Open
8 * Media Patent License 1.0 was not distributed with this source code in the
9 * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
10 */
11
12#ifndef AOM_AV1_ENCODER_SPEED_FEATURES_H_
13#define AOM_AV1_ENCODER_SPEED_FEATURES_H_
14
15#include "av1/common/enums.h"
16#include "av1/encoder/enc_enums.h"
17#include "av1/encoder/mcomp.h"
18#include "av1/encoder/encodemb.h"
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
27#define MAX_MESH_STEP 4
28
29typedef struct MESH_PATTERN {
30 int range;
31 int interval;
32} MESH_PATTERN;
33
34enum {
35 GM_FULL_SEARCH,
36 GM_REDUCED_REF_SEARCH_SKIP_L2_L3,
37 GM_REDUCED_REF_SEARCH_SKIP_L2_L3_ARF2,
38
39 // Same as GM_REDUCED_REF_SEARCH_SKIP_L2_L3_ARF2 but with extra filtering
40 // to keep at most two ref frames
41 GM_SEARCH_CLOSEST_REFS_ONLY,
42
43 GM_DISABLE_SEARCH
44} UENUM1BYTE(GM_SEARCH_TYPE);
45
46enum {
47 DIST_WTD_COMP_ENABLED,
48 DIST_WTD_COMP_SKIP_MV_SEARCH,
49 DIST_WTD_COMP_DISABLED,
50} UENUM1BYTE(DIST_WTD_COMP_FLAG);
51
52enum {
53 INTRA_ALL = (1 << DC_PRED) | (1 << V_PRED) | (1 << H_PRED) | (1 << D45_PRED) |
54 (1 << D135_PRED) | (1 << D113_PRED) | (1 << D157_PRED) |
55 (1 << D203_PRED) | (1 << D67_PRED) | (1 << SMOOTH_PRED) |
56 (1 << SMOOTH_V_PRED) | (1 << SMOOTH_H_PRED) | (1 << PAETH_PRED),
57 UV_INTRA_ALL =
58 (1 << UV_DC_PRED) | (1 << UV_V_PRED) | (1 << UV_H_PRED) |
59 (1 << UV_D45_PRED) | (1 << UV_D135_PRED) | (1 << UV_D113_PRED) |
60 (1 << UV_D157_PRED) | (1 << UV_D203_PRED) | (1 << UV_D67_PRED) |
61 (1 << UV_SMOOTH_PRED) | (1 << UV_SMOOTH_V_PRED) |
62 (1 << UV_SMOOTH_H_PRED) | (1 << UV_PAETH_PRED) | (1 << UV_CFL_PRED),
63 UV_INTRA_DC = (1 << UV_DC_PRED),
64 UV_INTRA_DC_CFL = (1 << UV_DC_PRED) | (1 << UV_CFL_PRED),
65 UV_INTRA_DC_TM = (1 << UV_DC_PRED) | (1 << UV_PAETH_PRED),
66 UV_INTRA_DC_PAETH_CFL =
67 (1 << UV_DC_PRED) | (1 << UV_PAETH_PRED) | (1 << UV_CFL_PRED),
68 UV_INTRA_DC_H_V = (1 << UV_DC_PRED) | (1 << UV_V_PRED) | (1 << UV_H_PRED),
69 UV_INTRA_DC_H_V_CFL = (1 << UV_DC_PRED) | (1 << UV_V_PRED) |
70 (1 << UV_H_PRED) | (1 << UV_CFL_PRED),
71 UV_INTRA_DC_PAETH_H_V = (1 << UV_DC_PRED) | (1 << UV_PAETH_PRED) |
72 (1 << UV_V_PRED) | (1 << UV_H_PRED),
73 UV_INTRA_DC_PAETH_H_V_CFL = (1 << UV_DC_PRED) | (1 << UV_PAETH_PRED) |
74 (1 << UV_V_PRED) | (1 << UV_H_PRED) |
75 (1 << UV_CFL_PRED),
76 INTRA_DC = (1 << DC_PRED),
77 INTRA_DC_TM = (1 << DC_PRED) | (1 << PAETH_PRED),
78 INTRA_DC_H_V = (1 << DC_PRED) | (1 << V_PRED) | (1 << H_PRED),
79 INTRA_DC_H_V_SMOOTH =
80 (1 << DC_PRED) | (1 << V_PRED) | (1 << H_PRED) | (1 << SMOOTH_PRED),
81 INTRA_DC_PAETH_H_V =
82 (1 << DC_PRED) | (1 << PAETH_PRED) | (1 << V_PRED) | (1 << H_PRED)
83};
84
85enum {
86 INTER_ALL = (1 << NEARESTMV) | (1 << NEARMV) | (1 << GLOBALMV) |
87 (1 << NEWMV) | (1 << NEAREST_NEARESTMV) | (1 << NEAR_NEARMV) |
88 (1 << NEW_NEWMV) | (1 << NEAREST_NEWMV) | (1 << NEAR_NEWMV) |
89 (1 << NEW_NEARMV) | (1 << NEW_NEARESTMV) | (1 << GLOBAL_GLOBALMV),
90 INTER_NEAREST_NEAR_ZERO = (1 << NEARESTMV) | (1 << NEARMV) | (1 << GLOBALMV) |
91 (1 << NEAREST_NEARESTMV) | (1 << GLOBAL_GLOBALMV) |
92 (1 << NEAREST_NEWMV) | (1 << NEW_NEARESTMV) |
93 (1 << NEW_NEARMV) | (1 << NEAR_NEWMV) |
94 (1 << NEAR_NEARMV),
95};
96
97enum {
98 DISABLE_ALL_INTER_SPLIT = (1 << THR_COMP_GA) | (1 << THR_COMP_LA) |
99 (1 << THR_ALTR) | (1 << THR_GOLD) | (1 << THR_LAST),
100
101 DISABLE_ALL_SPLIT = (1 << THR_INTRA) | DISABLE_ALL_INTER_SPLIT,
102
103 DISABLE_COMPOUND_SPLIT = (1 << THR_COMP_GA) | (1 << THR_COMP_LA),
104
105 LAST_AND_INTRA_SPLIT_ONLY = (1 << THR_COMP_GA) | (1 << THR_COMP_LA) |
106 (1 << THR_ALTR) | (1 << THR_GOLD)
107};
108
109enum {
110 TXFM_CODING_SF = 1,
111 INTER_PRED_SF = 2,
112 INTRA_PRED_SF = 4,
113 PARTITION_SF = 8,
114 LOOP_FILTER_SF = 16,
115 RD_SKIP_SF = 32,
116 RESERVE_2_SF = 64,
117 RESERVE_3_SF = 128,
118} UENUM1BYTE(DEV_SPEED_FEATURES);
119
120/* This enumeration defines when the rate control recode loop will be
121 * enabled.
122 */
123enum {
124 /*
125 * No recodes allowed
126 */
127 DISALLOW_RECODE = 0,
128 /*
129 * Allow recode only for KF/ARF/GF frames
130 */
131 ALLOW_RECODE_KFARFGF = 1,
132 /*
133 * Allow recode for all frame types based on bitrate constraints.
134 */
135 ALLOW_RECODE = 2,
136} UENUM1BYTE(RECODE_LOOP_TYPE);
137
138enum {
139 SUBPEL_TREE = 0,
140 SUBPEL_TREE_PRUNED = 1, // Prunes 1/2-pel searches
141 SUBPEL_TREE_PRUNED_MORE = 2, // Prunes 1/2-pel searches more aggressively
142 SUBPEL_SEARCH_METHODS
143} UENUM1BYTE(SUBPEL_SEARCH_METHOD);
144
145enum {
146 // Try the full image with different values.
147 LPF_PICK_FROM_FULL_IMAGE,
148 // Try the full image filter search with non-dual filter only.
149 LPF_PICK_FROM_FULL_IMAGE_NON_DUAL,
150 // Try a small portion of the image with different values.
151 LPF_PICK_FROM_SUBIMAGE,
152 // Estimate the level based on quantizer and frame type
153 LPF_PICK_FROM_Q,
154 // Pick 0 to disable LPF if LPF was enabled last frame
155 LPF_PICK_MINIMAL_LPF
156} UENUM1BYTE(LPF_PICK_METHOD);
162typedef enum {
171 CDEF_PICK_METHODS
173
175enum {
176 // Terminate search early based on distortion so far compared to
177 // qp step, distortion in the neighborhood of the frame, etc.
178 FLAG_EARLY_TERMINATE = 1 << 0,
179
180 // Skips comp inter modes if the best so far is an intra mode.
181 FLAG_SKIP_COMP_BESTINTRA = 1 << 1,
182
183 // Skips oblique intra modes if the best so far is an inter mode.
184 FLAG_SKIP_INTRA_BESTINTER = 1 << 3,
185
186 // Skips oblique intra modes at angles 27, 63, 117, 153 if the best
187 // intra so far is not one of the neighboring directions.
188 FLAG_SKIP_INTRA_DIRMISMATCH = 1 << 4,
189
190 // Skips intra modes other than DC_PRED if the source variance is small
191 FLAG_SKIP_INTRA_LOWVAR = 1 << 5,
192} UENUM1BYTE(MODE_SEARCH_SKIP_LOGIC);
193
194enum {
195 // No tx type pruning
196 TX_TYPE_PRUNE_0 = 0,
197 // adaptively prunes the least perspective tx types out of all 16
198 // (tuned to provide negligible quality loss)
199 TX_TYPE_PRUNE_1 = 1,
200 // similar, but applies much more aggressive pruning to get better speed-up
201 TX_TYPE_PRUNE_2 = 2,
202 TX_TYPE_PRUNE_3 = 3,
203 // More aggressive pruning based on tx type score and allowed tx count
204 TX_TYPE_PRUNE_4 = 4,
205 TX_TYPE_PRUNE_5 = 5,
206} UENUM1BYTE(TX_TYPE_PRUNE_MODE);
207
208enum {
209 // No reaction to rate control on a detected slide/scene change.
210 NO_DETECTION = 0,
211
212 // Set to larger Q based only on the detected slide/scene change and
213 // current/past Q.
214 FAST_DETECTION_MAXQ = 1,
215} UENUM1BYTE(OVERSHOOT_DETECTION_CBR);
216
217enum {
218 // Turns off multi-winner mode. So we will do txfm search on either all modes
219 // if winner mode is off, or we will only on txfm search on a single winner
220 // mode.
221 MULTI_WINNER_MODE_OFF = 0,
222
223 // Limits the number of winner modes to at most 2
224 MULTI_WINNER_MODE_FAST = 1,
225
226 // Uses the default number of winner modes, which is 3 for intra mode, and 1
227 // for inter mode.
228 MULTI_WINNER_MODE_DEFAULT = 2,
229
230 // Maximum number of winner modes allowed.
231 MULTI_WINNER_MODE_LEVELS,
232} UENUM1BYTE(MULTI_WINNER_MODE_TYPE);
233
234enum {
235 PRUNE_NEARMV_OFF = 0, // Turn off nearmv pruning
236 PRUNE_NEARMV_LEVEL1 = 1, // Prune nearmv for qindex (0-85)
237 PRUNE_NEARMV_LEVEL2 = 2, // Prune nearmv for qindex (0-170)
238 PRUNE_NEARMV_LEVEL3 = 3, // Prune nearmv more aggressively for qindex (0-170)
239 PRUNE_NEARMV_MAX = PRUNE_NEARMV_LEVEL3,
240} UENUM1BYTE(PRUNE_NEARMV_LEVEL);
241
242enum {
243 // Default Transform search case - used in evaluation of compound type mode
244 // and best inter candidates
245 TX_SEARCH_DEFAULT = 0,
246 // Transform search in motion mode rd
247 TX_SEARCH_MOTION_MODE,
248 // All transform search cases
249 TX_SEARCH_CASES
250} UENUM1BYTE(TX_SEARCH_CASE);
251
252typedef struct {
253 TX_TYPE_PRUNE_MODE prune_2d_txfm_mode;
254 int fast_intra_tx_type_search;
255
256 // INT_MAX: Disable fast search.
257 // 1 - 1024: Probability threshold used for conditionally forcing tx type,
258 // during mode search.
259 // 0: Force tx type to be DCT_DCT unconditionally, during
260 // mode search.
261 int fast_inter_tx_type_prob_thresh;
262
263 // Prune less likely chosen transforms for each intra mode. The speed
264 // feature ranges from 0 to 2, for different speed / compression trade offs.
265 int use_reduced_intra_txset;
266
267 // Use a skip flag prediction model to detect blocks with skip = 1 early
268 // and avoid doing full TX type search for such blocks.
269 int use_skip_flag_prediction;
270
271 // Threshold used by the ML based method to predict TX block split decisions.
272 int ml_tx_split_thresh;
273
274 // skip remaining transform type search when we found the rdcost of skip is
275 // better than applying transform
276 int skip_tx_search;
277
278 // Prune tx type search using previous frame stats.
279 int prune_tx_type_using_stats;
280 // Prune tx type search using estimated RDcost
281 int prune_tx_type_est_rd;
282
283 // Flag used to control the winner mode processing for tx type pruning for
284 // inter blocks. It enables further tx type mode pruning based on ML model for
285 // mode evaluation and disables tx type mode pruning for winner mode
286 // processing.
287 int winner_mode_tx_type_pruning;
288} TX_TYPE_SEARCH;
289
290enum {
291 // Search partitions using RD criterion
292 SEARCH_PARTITION,
293
294 // Always use a fixed size partition
295 FIXED_PARTITION,
296
297 // Partition using source variance
298 VAR_BASED_PARTITION,
299
300#if CONFIG_RT_ML_PARTITIONING
301 // Partition using ML model
302 ML_BASED_PARTITION
303#endif
304} UENUM1BYTE(PARTITION_SEARCH_TYPE);
305
306enum {
307 NOT_IN_USE,
308 DIRECT_PRED,
309 RELAXED_PRED,
310 ADAPT_PRED
311} UENUM1BYTE(MAX_PART_PRED_MODE);
312
313enum {
314 LAST_MV_DATA,
315 CURRENT_Q,
316 QTR_ONLY,
317} UENUM1BYTE(MV_PREC_LOGIC);
318
319enum {
320 SUPERRES_AUTO_ALL, // Tries all possible superres ratios
321 SUPERRES_AUTO_DUAL, // Tries no superres and q-based superres ratios
322 SUPERRES_AUTO_SOLO, // Only apply the q-based superres ratio
323} UENUM1BYTE(SUPERRES_AUTO_SEARCH_TYPE);
341typedef enum {
348
353typedef enum {
354 NO_PRUNING = -1,
371
375typedef enum {
380
385typedef enum {
387 0,
389 1,
391 2,
393 3,
395 4,
398
405
409 RECODE_LOOP_TYPE recode_loop;
410
416
424
433
437 SUPERRES_AUTO_SEARCH_TYPE superres_auto_search_type;
438
443
448
454
461
469
481
486
491
497
499typedef struct TPL_SPEED_FEATURES {
500 // GOP length adaptive decision.
501 // If set to 0, tpl model decides whether a shorter gf interval is better.
502 // If set to 1, tpl stats of ARFs from base layer, (base+1) layer and
503 // (base+2) layer decide whether a shorter gf interval is better.
504 // If set to 2, tpl stats of ARFs from base layer, (base+1) layer and GF boost
505 // decide whether a shorter gf interval is better.
506 // If set to 3, gop length adaptive decision is disabled.
507 int gop_length_decision_method;
508 // Prune the intra modes search by tpl.
509 // If set to 0, we will search all intra modes from DC_PRED to PAETH_PRED.
510 // If set to 1, we only search DC_PRED, V_PRED, and H_PRED.
511 int prune_intra_modes;
512 // This parameter controls which step in the n-step process we start at.
513 int reduce_first_step_size;
514 // Skip motion estimation based on the precision of center MVs and the
515 // difference between center MVs.
516 // If set to 0, motion estimation is skipped for duplicate center MVs
517 // (default). If set to 1, motion estimation is skipped for duplicate
518 // full-pixel center MVs. If set to 2, motion estimation is skipped if the
519 // difference between center MVs is less than the threshold.
520 int skip_alike_starting_mv;
521
522 // When to stop subpel search.
523 SUBPEL_FORCE_STOP subpel_force_stop;
524
525 // Which search method to use.
526 SEARCH_METHODS search_method;
527
528 // Prune starting mvs in TPL based on sad scores.
529 int prune_starting_mv;
530
531 // Prune reference frames in TPL.
532 int prune_ref_frames_in_tpl;
533
534 // Support compound predictions.
535 int allow_compound_pred;
536
537 // Calculate rate and distortion based on Y plane only.
538 int use_y_only_rate_distortion;
539} TPL_SPEED_FEATURES;
540
541typedef struct GLOBAL_MOTION_SPEED_FEATURES {
542 GM_SEARCH_TYPE gm_search_type;
543
544 // During global motion estimation, prune remaining reference frames in a
545 // given direction(past/future), if the evaluated ref_frame in that direction
546 // yields gm_type as INVALID/TRANSLATION/IDENTITY
547 int prune_ref_frame_for_gm_search;
548
549 // When the current GM type is set to ZEROMV, prune ZEROMV if its performance
550 // is worse than NEWMV under SSE metric.
551 // 0 : no pruning
552 // 1 : conservative pruning
553 // 2 : aggressive pruning
555
556 // Disable global motion estimation based on stats of previous frames in the
557 // GF group
558 int disable_gm_search_based_on_stats;
559
560 // Number of refinement steps to apply after initial model generation
561 int num_refinement_steps;
562} GLOBAL_MOTION_SPEED_FEATURES;
563
564typedef struct PARTITION_SPEED_FEATURES {
565 PARTITION_SEARCH_TYPE partition_search_type;
566
567 // Used if partition_search_type = FIXED_PARTITION
568 BLOCK_SIZE fixed_partition_size;
569
570 // Prune extended partition types search
571 // Can take values 0 - 2, 0 referring to no pruning, and 1 - 2 increasing
572 // aggressiveness of pruning in order.
573 int prune_ext_partition_types_search_level;
574
575 // Prune part4 based on block size
576 int prune_part4_search;
577
578 // Use a ML model to prune rectangular, ab and 4-way horz
579 // and vert partitions
580 int ml_prune_partition;
581
582 // Use a ML model to adaptively terminate partition search after trying
583 // PARTITION_SPLIT. Can take values 0 - 2, 0 meaning not being enabled, and
584 // 1 - 2 increasing aggressiveness in order.
585 int ml_early_term_after_part_split_level;
586
587 // Skip rectangular partition test when partition type none gives better
588 // rd than partition type split. Can take values 0 - 2, 0 referring to no
589 // skipping, and 1 - 2 increasing aggressiveness of skipping in order.
590 int less_rectangular_check_level;
591
592 // Use square partition only beyond this block size.
593 BLOCK_SIZE use_square_partition_only_threshold;
594
595 // Sets max square partition levels for this superblock based on
596 // motion vector and prediction error distribution produced from 16x16
597 // simple motion search
598 MAX_PART_PRED_MODE auto_max_partition_based_on_simple_motion;
599
600 // Min and max square partition size we enable (block_size) as per auto
601 // min max, but also used by adjust partitioning, and pick_partitioning.
602 BLOCK_SIZE default_min_partition_size;
603 BLOCK_SIZE default_max_partition_size;
604
605 // Sets level of adjustment of variance-based partitioning during
606 // rd_use_partition 0 - no partition adjustment, 1 - try to merge partitions
607 // for small blocks and high QP, 2 - try to merge partitions, 3 - try to merge
608 // and split leaf partitions and 0 - 3 decreasing aggressiveness in order.
609 int adjust_var_based_rd_partitioning;
610
611 // Partition search early breakout thresholds.
612 int64_t partition_search_breakout_dist_thr;
613 int partition_search_breakout_rate_thr;
614
615 // Thresholds for ML based partition search breakout.
616 int ml_partition_search_breakout_thresh[PARTITION_BLOCK_SIZES];
617
618 // Aggressiveness levels for pruning split and rectangular partitions based on
619 // simple_motion_search. SIMPLE_AGG_LVL0 to SIMPLE_AGG_LVL3 correspond to
620 // simple motion search based pruning. QIDX_BASED_AGG_LVL1 corresponds to
621 // qindex based and simple motion search based pruning.
622 int simple_motion_search_prune_agg;
623
624 // Perform simple_motion_search on each possible subblock and use it to prune
625 // PARTITION_HORZ and PARTITION_VERT.
626 int simple_motion_search_prune_rect;
627
628 // Perform simple motion search before none_partition to decide if we
629 // want to remove all partitions other than PARTITION_SPLIT. If set to 0, this
630 // model is disabled. If set to 1, the model attempts to perform
631 // PARTITION_SPLIT only. If set to 2, the model also attempts to prune
632 // PARTITION_SPLIT.
633 int simple_motion_search_split;
634
635 // Use features from simple_motion_search to terminate prediction block
636 // partition after PARTITION_NONE
637 int simple_motion_search_early_term_none;
638
639 // Controls whether to reduce the number of motion search steps. If this is 0,
640 // then simple_motion_search has the same number of steps as
641 // single_motion_search (assuming no other speed features). Otherwise, reduce
642 // the number of steps by the value contained in this variable.
643 int simple_motion_search_reduce_search_steps;
644
645 // This variable controls the maximum block size where intra blocks can be
646 // used in inter frames.
647 // TODO(aconverse): Fold this into one of the other many mode skips
648 BLOCK_SIZE max_intra_bsize;
649
650 // Use CNN with luma pixels on source frame on each of the 64x64 subblock to
651 // perform partition pruning in intra frames.
652 // 0: No Pruning
653 // 1: Prune split and rectangular partitions only
654 // 2: Prune none, split and rectangular partitions
655 int intra_cnn_based_part_prune_level;
656
657 // Disable extended partition search for lower block sizes.
658 int ext_partition_eval_thresh;
659
660 // Disable rectangular partitions for larger block sizes.
661 int rect_partition_eval_thresh;
662
663 // prune extended partition search
664 // 0 : no pruning
665 // 1 : prune 1:4 partition search using winner info from split partitions
666 // 2 : prune 1:4 and AB partition search using split and HORZ/VERT info
667 int prune_ext_part_using_split_info;
668
669 // Prunt rectangular, AB and 4-way partition based on q index and block size
670 // 0 : no pruning
671 // 1 : prune sub_8x8 at very low quantizers
672 // 2 : prune all block size based on qindex
673 int prune_rectangular_split_based_on_qidx;
674
675 // Prune rectangular partitions based on 4x4 sub-block variance
676 // false : no pruning
677 // true : prune rectangular partitions based on 4x4 sub-block variance
678 // deviation
679 //
680 // For allintra encode, this speed feature reduces instruction count by 6.4%
681 // for speed=6 with coding performance change less than 0.24%. For AVIF image
682 // encode, this speed feature reduces encode time by 8.14% for speed 6 on a
683 // typical image dataset with coding performance change less than 0.16%. This
684 // speed feature is not applicable to speed >= 7.
685 bool prune_rect_part_using_4x4_var_deviation;
686
687 // Terminate partition search for child partition,
688 // when NONE and SPLIT partition rd_costs are INT64_MAX.
689 int early_term_after_none_split;
690
691 // Level used to adjust threshold for av1_ml_predict_breakout(). At lower
692 // levels, more conservative threshold is used, and value of 0 indicates
693 // av1_ml_predict_breakout() is disabled. Value of 3 corresponds to default
694 // case with no adjustment to lbd thresholds.
695 int ml_predict_breakout_level;
696
697 // Prune sub_8x8 (BLOCK_4X4, BLOCK_4X8 and BLOCK_8X4) partitions.
698 // 0 : no pruning
699 // 1 : pruning based on neighbour block information
700 // 2 : prune always
701 int prune_sub_8x8_partition_level;
702
703 // Prune rectangular split based on simple motion search split/no_split score.
704 // 0: disable pruning, 1: enable pruning
705 int simple_motion_search_rect_split;
706
707 // The current encoder adopts a DFS search for block partitions.
708 // Therefore the mode selection and associated rdcost is ready for smaller
709 // blocks before the mode selection for some partition types.
710 // AB partition could use previous rd information and skip mode search.
711 // An example is:
712 //
713 // current block
714 // +---+---+
715 // | |
716 // + +
717 // | |
718 // +-------+
719 //
720 // SPLIT partition has been searched first before trying HORZ_A
721 // +---+---+
722 // | R | R |
723 // +---+---+
724 // | R | R |
725 // +---+---+
726 //
727 // HORZ_A
728 // +---+---+
729 // | | |
730 // +---+---+
731 // | |
732 // +-------+
733 //
734 // With this speed feature, the top two sub blocks can directly use rdcost
735 // searched in split partition, and the mode info is also copied from
736 // saved info. Similarly, the bottom rectangular block can also use
737 // the available information from previous rectangular search.
738 int reuse_prev_rd_results_for_part_ab;
739
740 // Reuse the best prediction modes found in PARTITION_SPLIT and PARTITION_RECT
741 // when encoding PARTITION_AB.
742 int reuse_best_prediction_for_part_ab;
743
744 // The current partition search records the best rdcost so far and uses it
745 // in mode search and transform search to early skip when some criteria is
746 // met. For example, when the current rdcost is larger than the best rdcost,
747 // or the model rdcost is larger than the best rdcost times some thresholds.
748 // By default, this feature is turned on to speed up the encoder partition
749 // search.
750 // If disabling it, at speed 0, 30 frames, we could get
751 // about -0.25% quality gain (psnr, ssim, vmaf), with about 13% slowdown.
752 int use_best_rd_for_pruning;
753
754 // Skip evaluation of non-square partitions based on the corresponding NONE
755 // partition.
756 // 0: no pruning
757 // 1: prune extended partitions if NONE is skippable
758 // 2: on top of 1, prune rectangular partitions if NONE is inter, not a newmv
759 // mode and skippable
760 int skip_non_sq_part_based_on_none;
761
762 // Disables 8x8 and below partitions for low quantizers.
763 int disable_8x8_part_based_on_qidx;
764} PARTITION_SPEED_FEATURES;
765
766typedef struct MV_SPEED_FEATURES {
767 // Motion search method (Diamond, NSTEP, Hex, Big Diamond, Square, etc).
768 SEARCH_METHODS search_method;
769
770 // Enable the use of faster, less accurate mv search method
771 // 0: disable, 1: if bsize >= BLOCK_32X32, 2: based on bsize, SAD and qp
772 // TODO(chiyotsai@google.com): Take the clip's resolution and mv activity into
773 // account.
774 int use_bsize_dependent_search_method;
775
776 // If this is set to 1, we limit the motion search range to 2 times the
777 // largest motion vector found in the last frame.
778 int auto_mv_step_size;
779
780 // Subpel_search_method can only be subpel_tree which does a subpixel
781 // logarithmic search that keeps stepping at 1/2 pixel units until
782 // you stop getting a gain, and then goes on to 1/4 and repeats
783 // the same process. Along the way it skips many diagonals.
784 SUBPEL_SEARCH_METHOD subpel_search_method;
785
786 // Maximum number of steps in logarithmic subpel search before giving up.
787 int subpel_iters_per_step;
788
789 // When to stop subpel search.
790 SUBPEL_FORCE_STOP subpel_force_stop;
791
792 // When to stop subpel search in simple motion search.
793 SUBPEL_FORCE_STOP simple_motion_subpel_force_stop;
794
795 // If true, sub-pixel search uses the exact convolve function used for final
796 // encoding and decoding; otherwise, it uses bilinear interpolation.
797 SUBPEL_SEARCH_TYPE use_accurate_subpel_search;
798
799 // Threshold for allowing exhaustive motion search.
800 int exhaustive_searches_thresh;
801
802 // Pattern to be used for any exhaustive mesh searches (except intraBC ME).
803 MESH_PATTERN mesh_patterns[MAX_MESH_STEP];
804
805 // Pattern to be used for exhaustive mesh searches of intraBC ME.
806 MESH_PATTERN intrabc_mesh_patterns[MAX_MESH_STEP];
807
808 // Reduce single motion search range based on MV result of prior ref_mv_idx.
809 int reduce_search_range;
810
811 // Prune mesh search.
812 PRUNE_MESH_SEARCH_LEVEL prune_mesh_search;
813
814 // Use the rd cost around the best FULLPEL_MV to speed up subpel search
815 int use_fullpel_costlist;
816
817 // Set the full pixel search level of obmc
818 // 0: obmc_full_pixel_diamond
819 // 1: obmc_refining_search_sad (faster)
820 int obmc_full_pixel_search_level;
821
822 // Accurate full pixel motion search based on TPL stats.
823 int full_pixel_search_level;
824
825 // Whether to downsample the rows in sad calculation during motion search.
826 // This is only active when there are at least 16 rows. When this sf is
827 // active, if there is a large discrepancy in the SAD values for the final
828 // motion vector between skipping vs not skipping, motion search is redone
829 // with skip row features off.
830 // 0: Disabled (do not downsample rows)
831 // 1: Skip SAD calculation of odd rows if the SAD deviation of the even and
832 // odd rows for the starting MV is small. Redo motion search with sf off
833 // when SAD deviation is high for the final motion vector.
834 // 2: Skip SAD calculation of odd rows. SAD deviation is not tested for the
835 // start MV and tested only for the final MV.
836 int use_downsampled_sad;
837
838 // Enable/disable extensive joint motion search.
839 int disable_extensive_joint_motion_search;
840
841 // Enable second best mv check in joint mv search.
842 // 0: allow second MV (use rd cost as the metric)
843 // 1: use var as the metric
844 // 2: disable second MV
845 int disable_second_mv;
846
847 // Skips full pixel search based on start mv of prior ref_mv_idx.
848 // 0: Disabled
849 // 1: Skips the full pixel search upto 4 neighbor full-pel MV positions.
850 // 2: Skips the full pixel search upto 8 neighbor full-pel MV positions.
851 int skip_fullpel_search_using_startmv;
852
853 // Method to use for refining WARPED_CAUSAL motion vectors
854 // TODO(rachelbarker): Can this be unified with OBMC in some way?
855 WARP_SEARCH_METHOD warp_search_method;
856
857 // Maximum number of iterations in WARPED_CAUSAL refinement search
858 int warp_search_iters;
859} MV_SPEED_FEATURES;
860
861typedef struct INTER_MODE_SPEED_FEATURES {
862 // 2-pass inter mode model estimation where the preliminary pass skips
863 // transform search and uses a model to estimate rd, while the final pass
864 // computes the full transform search. Two types of models are supported:
865 // 0: not used
866 // 1: used with online dynamic rd model
867 // 2: used with static rd model
868 int inter_mode_rd_model_estimation;
869
870 // Bypass transform search based on skip rd at following stages
871 // i. Compound type mode search
872 // ii. Motion mode search (mode evaluation and winner motion mode stage)
873 // iii. Transform search for best inter candidates
874 int txfm_rd_gate_level[TX_SEARCH_CASES];
875
876 // Limit the inter mode tested in the RD loop
877 int reduce_inter_modes;
878
879 // This variable is used to cap the maximum number of times we skip testing a
880 // mode to be evaluated. A high value means we will be faster.
881 int adaptive_rd_thresh;
882
883 // Aggressively prune inter modes when best mode is skippable.
884 int prune_inter_modes_if_skippable;
885
886 // Drop less likely to be picked reference frames in the RD search.
887 // Has seven levels for now: 0, 1, 2, 3, 4, 5 and 6 where higher levels prune
888 // more aggressively than lower ones. (0 means no pruning).
889 int selective_ref_frame;
890
891 // Prune reference frames for rectangular partitions.
892 // 0 implies no pruning
893 // 1 implies prune for extended partition
894 // 2 implies prune horiz, vert and extended partition
895 int prune_ref_frame_for_rect_partitions;
896
897 // Prune inter modes w.r.t past reference frames
898 // 0 no pruning
899 // 1 prune inter modes w.r.t ALTREF2 and ALTREF reference frames
900 // 2 prune inter modes w.r.t BWDREF, ALTREF2 and ALTREF reference frames
901 int alt_ref_search_fp;
902
903 // Prune compound reference frames
904 // 0 no pruning
905 // 1 prune compound references which do not satisfy the two conditions:
906 // a) The references are at a nearest distance from the current frame in
907 // both past and future direction.
908 // b) The references have minimum pred_mv_sad in both past and future
909 // direction.
910 // 2 prune compound references except the one with nearest distance from the
911 // current frame in both past and future direction.
912 int prune_comp_ref_frames;
913
914 // Skip the current ref_mv in NEW_MV mode based on mv, rate cost, etc.
915 // This speed feature equaling 0 means no skipping.
916 // If the speed feature equals 1 or 2, skip the current ref_mv in NEW_MV mode
917 // if we have already encountered ref_mv in the drl such that:
918 // 1. The other drl has the same mv during the SIMPLE_TRANSLATION search
919 // process as the current mv.
920 // 2. The rate needed to encode the current mv is larger than that for the
921 // other ref_mv.
922 // The speed feature equaling 1 means using subpel mv in the comparison.
923 // The speed feature equaling 2 means using fullpel mv in the comparison.
924 // If the speed feature >= 3, skip the current ref_mv in NEW_MV mode based on
925 // known full_mv bestsme and drl cost.
926 int skip_newmv_in_drl;
927
928 // This speed feature checks duplicate ref MVs among NEARESTMV, NEARMV,
929 // GLOBALMV and skips NEARMV or GLOBALMV (in order) if a duplicate is found
930 // TODO(any): Instead of skipping repeated ref mv, use the recalculated
931 // rd-cost based on mode rate and skip the mode evaluation
932 int skip_repeated_ref_mv;
933
934 // Flag used to control the ref_best_rd based gating for chroma
935 int perform_best_rd_based_gating_for_chroma;
936
937 // Reuse the inter_intra_mode search result from NEARESTMV mode to other
938 // single ref modes
939 int reuse_inter_intra_mode;
940
941 // prune wedge and compound segment approximate rd evaluation based on
942 // compound average modeled rd
943 int prune_comp_type_by_model_rd;
944
945 // prune wedge and compound segment approximate rd evaluation based on
946 // compound average rd/ref_best_rd
947 int prune_comp_type_by_comp_avg;
948
949 // Skip some ref frames in compound motion search by single motion search
950 // result. Has three levels for now: 0 referring to no skipping, and 1 - 3
951 // increasing aggressiveness of skipping in order.
952 // Note: The search order might affect the result. It assumes that the single
953 // reference modes are searched before compound modes. It is better to search
954 // same single inter mode as a group.
955 int prune_comp_search_by_single_result;
956
957 // Instead of performing a full MV search, do a simple translation first
958 // and only perform a full MV search on the motion vectors that performed
959 // well.
960 int prune_mode_search_simple_translation;
961
962 // Only search compound modes with at least one "good" reference frame.
963 // A reference frame is good if, after looking at its performance among
964 // the single reference modes, it is one of the two best performers.
965 int prune_compound_using_single_ref;
966
967 // Skip extended compound mode (NEAREST_NEWMV, NEW_NEARESTMV, NEAR_NEWMV,
968 // NEW_NEARMV) using ref frames of above and left neighbor
969 // blocks.
970 // 0 : no pruning
971 // 1 : prune ext compound modes using neighbor blocks (less aggressiveness)
972 // 2 : prune ext compound modes using neighbor blocks (high aggressiveness)
973 // 3 : prune ext compound modes unconditionally (highest aggressiveness)
974 int prune_ext_comp_using_neighbors;
975
976 // Skip NEW_NEARMV and NEAR_NEWMV extended compound modes
977 int skip_ext_comp_nearmv_mode;
978
979 // Skip extended compound mode when ref frame corresponding to NEWMV does not
980 // have NEWMV as single mode winner.
981 // 0 : no pruning
982 // 1 : prune extended compound mode (less aggressiveness)
983 // 2 : prune extended compound mode (high aggressiveness)
984 int prune_comp_using_best_single_mode_ref;
985
986 // Skip NEARESTMV and NEARMV using weight computed in ref mv list population
987 //
988 // Pruning is enabled only when both the top and left neighbor blocks are
989 // available and when the current block already has a valid inter prediction.
990 int prune_nearest_near_mv_using_refmv_weight;
991
992 // Based on previous ref_mv_idx search result, prune the following search.
993 int prune_ref_mv_idx_search;
994
995 // Disable one sided compound modes.
996 int disable_onesided_comp;
997
998 // Prune obmc search using previous frame stats.
999 // INT_MAX : disable obmc search
1000 int prune_obmc_prob_thresh;
1001
1002 // Prune warped motion search using previous frame stats.
1003 int prune_warped_prob_thresh;
1004
1005 // Variance threshold to enable/disable Interintra wedge search
1006 unsigned int disable_interintra_wedge_var_thresh;
1007
1008 // Variance threshold to enable/disable Interinter wedge search
1009 unsigned int disable_interinter_wedge_var_thresh;
1010
1011 // De-couple wedge and mode search during interintra RDO.
1012 int fast_interintra_wedge_search;
1013
1014 // Whether fast wedge sign estimate is used
1015 int fast_wedge_sign_estimate;
1016
1017 // Enable/disable ME for interinter wedge search.
1018 int disable_interinter_wedge_newmv_search;
1019
1020 // Decide when and how to use joint_comp.
1021 DIST_WTD_COMP_FLAG use_dist_wtd_comp_flag;
1022
1023 // Clip the frequency of updating the mv cost.
1024 INTERNAL_COST_UPDATE_TYPE mv_cost_upd_level;
1025
1026 // Clip the frequency of updating the coeff cost.
1027 INTERNAL_COST_UPDATE_TYPE coeff_cost_upd_level;
1028
1029 // Clip the frequency of updating the mode cost.
1030 INTERNAL_COST_UPDATE_TYPE mode_cost_upd_level;
1031
1032 // Prune inter modes based on tpl stats
1033 // 0 : no pruning
1034 // 1 - 3 indicate increasing aggressiveness in order.
1035 int prune_inter_modes_based_on_tpl;
1036
1037 // Skip NEARMV and NEAR_NEARMV modes using ref frames of above and left
1038 // neighbor blocks and qindex.
1039 PRUNE_NEARMV_LEVEL prune_nearmv_using_neighbors;
1040
1041 // Model based breakout after interpolation filter search
1042 // 0: no breakout
1043 // 1: use model based rd breakout
1044 int model_based_post_interp_filter_breakout;
1045
1046 // Reuse compound type rd decision when exact match is found
1047 // 0: No reuse
1048 // 1: Reuse the compound type decision
1049 int reuse_compound_type_decision;
1050
1051 // Enable/disable masked compound.
1052 int disable_masked_comp;
1053
1054 // Enable/disable MV refinement for compound modes corresponds to compound
1055 // types COMPOUND_AVERAGE, COMPOUND_DISTWTD (currently, this compound type
1056 // is disabled for speeds >= 2 using the sf 'use_dist_wtd_comp_flag') and
1057 // COMPOUND_DIFFWTD based on the availability. Levels 0 to 3 indicate
1058 // increasing order of aggressiveness to disable MV refinement.
1059 // 0: MV Refinement is enabled and for NEW_NEWMV mode used two iterations of
1060 // refinement in av1_joint_motion_search().
1061 // 1: MV Refinement is disabled for COMPOUND_DIFFWTD and enabled for
1062 // COMPOUND_AVERAGE & COMPOUND_DISTWTD.
1063 // 2: MV Refinement is enabled for COMPOUND_AVERAGE & COMPOUND_DISTWTD for
1064 // NEW_NEWMV mode with one iteration of refinement in
1065 // av1_joint_motion_search() and MV Refinement is disabled for other compound
1066 // type modes.
1067 // 3: MV Refinement is disabled.
1068 int enable_fast_compound_mode_search;
1069
1070 // Reuse masked compound type search results
1071 int reuse_mask_search_results;
1072
1073 // Enable/disable fast search for wedge masks
1074 int enable_fast_wedge_mask_search;
1075
1076 // Early breakout from transform search of inter modes
1077 int inter_mode_txfm_breakout;
1078
1079 // Limit number of inter modes for txfm search if a newmv mode gets
1080 // evaluated among the top modes.
1081 // 0: no pruning
1082 // 1 to 3 indicate increasing order of aggressiveness
1083 int limit_inter_mode_cands;
1084
1085 // Cap the no. of txfm searches for a given prediction mode.
1086 // 0: no cap, 1: cap beyond first 4 searches, 2: cap beyond first 3 searches.
1087 int limit_txfm_eval_per_mode;
1088
1089 // Prune warped motion search based on block size.
1090 int extra_prune_warped;
1091
1092 // Do not search compound modes for ARF.
1093 // The intuition is that ARF is predicted by frames far away from it,
1094 // whose temporal correlations with the ARF are likely low.
1095 // It is therefore likely that compound modes do not work as well for ARF
1096 // as other inter frames.
1097 // Speed/quality impact:
1098 // Speed 1: 12% faster, 0.1% psnr loss.
1099 // Speed 2: 2% faster, 0.05% psnr loss.
1100 // No change for speed 3 and up, because |disable_onesided_comp| is true.
1101 int skip_arf_compound;
1102} INTER_MODE_SPEED_FEATURES;
1103
1104typedef struct INTERP_FILTER_SPEED_FEATURES {
1105 // Do limited interpolation filter search for dual filters, since best choice
1106 // usually includes EIGHTTAP_REGULAR.
1107 int use_fast_interpolation_filter_search;
1108
1109 // Disable dual filter
1110 int disable_dual_filter;
1111
1112 // Save results of av1_interpolation_filter_search for a block
1113 // Check mv and ref_frames before search, if they are very close with previous
1114 // saved results, filter search can be skipped.
1115 int use_interp_filter;
1116
1117 // skip sharp_filter evaluation based on regular and smooth filter rd for
1118 // dual_filter=0 case
1119 int skip_sharp_interp_filter_search;
1120
1121 // skip interpolation filter search for a block in chessboard pattern
1122 int cb_pred_filter_search;
1123
1124 // adaptive interp_filter search to allow skip of certain filter types.
1125 int adaptive_interp_filter_search;
1126} INTERP_FILTER_SPEED_FEATURES;
1127
1128typedef struct INTRA_MODE_SPEED_FEATURES {
1129 // These bit masks allow you to enable or disable intra modes for each
1130 // transform size separately.
1131 int intra_y_mode_mask[TX_SIZES];
1132 int intra_uv_mode_mask[TX_SIZES];
1133
1134 // flag to allow skipping intra mode for inter frame prediction
1135 int skip_intra_in_interframe;
1136
1137 // Prune intra mode candidates based on source block histogram of gradient.
1138 // Applies to luma plane only.
1139 // Feasible values are 0..4. The feature is disabled for 0. An increasing
1140 // value indicates more aggressive pruning threshold.
1141 int intra_pruning_with_hog;
1142
1143 // Prune intra mode candidates based on source block histogram of gradient.
1144 // Applies to chroma plane only.
1145 // Feasible values are 0..4. The feature is disabled for 0. An increasing
1146 // value indicates more aggressive pruning threshold.
1147 int chroma_intra_pruning_with_hog;
1148
1149 // Enable/disable smooth intra modes.
1150 int disable_smooth_intra;
1151
1152 // Prune UV_SMOOTH_PRED mode for chroma based on chroma source variance.
1153 // false : No pruning
1154 // true : Prune UV_SMOOTH_PRED mode based on chroma source variance
1155 //
1156 // For allintra encode, this speed feature reduces instruction count
1157 // by 1.90%, 2.21% and 1.97% for speed 6, 7 and 8 with coding performance
1158 // change less than 0.04%. For AVIF image encode, this speed feature reduces
1159 // encode time by 1.56%, 2.14% and 0.90% for speed 6, 7 and 8 on a typical
1160 // image dataset with coding performance change less than 0.05%.
1161 bool prune_smooth_intra_mode_for_chroma;
1162
1163 // Prune filter intra modes in intra frames.
1164 // 0 : No pruning
1165 // 1 : Evaluate applicable filter intra modes based on best intra mode so far
1166 // 2 : Do not evaluate filter intra modes
1167 int prune_filter_intra_level;
1168
1169 // prune palette search
1170 // 0: No pruning
1171 // 1: Perform coarse search to prune the palette colors. For winner colors,
1172 // neighbors are also evaluated using a finer search.
1173 // 2: Perform 2 way palette search from max colors to min colors (and min
1174 // colors to remaining colors) and terminate the search if current number of
1175 // palette colors is not the winner.
1176 int prune_palette_search_level;
1177
1178 // Terminate early in luma palette_size search. Speed feature values indicate
1179 // increasing level of pruning.
1180 // 0: No early termination
1181 // 1: Terminate early for higher luma palette_size, if header rd cost of lower
1182 // palette_size is more than 2 * best_rd. This level of pruning is more
1183 // conservative when compared to sf level 2 as the cases which will get pruned
1184 // with sf level 1 is a subset of the cases which will get pruned with sf
1185 // level 2.
1186 // 2: Terminate early for higher luma palette_size, if header rd cost of lower
1187 // palette_size is more than best_rd.
1188 // For allintra encode, this sf reduces instruction count by 2.49%, 1.07%,
1189 // 2.76%, 2.30%, 1.84%, 2.69%, 2.04%, 2.05% and 1.44% for speed 0, 1, 2, 3, 4,
1190 // 5, 6, 7 and 8 on screen content set with coding performance change less
1191 // than 0.01% for speed <= 2 and less than 0.03% for speed >= 3. For AVIF
1192 // image encode, this sf reduces instruction count by 1.94%, 1.13%, 1.29%,
1193 // 0.93%, 0.89%, 1.03%, 1.07%, 1.20% and 0.18% for speed 0, 1, 2, 3, 4, 5, 6,
1194 // 7 and 8 on a typical image dataset with coding performance change less than
1195 // 0.01%.
1196 int prune_luma_palette_size_search_level;
1197
1198 // Prune chroma intra modes based on luma intra mode winner.
1199 // 0: No pruning
1200 // 1: Prune chroma intra modes other than UV_DC_PRED, UV_SMOOTH_PRED,
1201 // UV_CFL_PRED and the mode that corresponds to luma intra mode winner.
1202 int prune_chroma_modes_using_luma_winner;
1203
1204 // Clip the frequency of updating the mv cost for intrabc.
1205 INTERNAL_COST_UPDATE_TYPE dv_cost_upd_level;
1206
1207 // We use DCT_DCT transform followed by computing SATD (Sum of Absolute
1208 // Transformed Differences) as an estimation of RD score to quickly find the
1209 // best possible Chroma from Luma (CFL) parameter. Then we do a full RD search
1210 // near the best possible parameter. The search range is set here.
1211 // The range of cfl_searh_range should be [1, 33], and the following are the
1212 // recommended values.
1213 // 1: Fastest mode.
1214 // 3: Default mode that provides good speedup without losing compression
1215 // performance at speed 0.
1216 // 33: Exhaustive rd search (33 == CFL_MAGS_SIZE). This mode should only
1217 // be used for debugging purpose.
1218 int cfl_search_range;
1219
1220 // TOP_INTRA_MODEL_COUNT is 4 that is the number of top model rd to store in
1221 // intra mode decision. Here, add a speed feature to reduce this number for
1222 // higher speeds.
1223 int top_intra_model_count_allowed;
1224
1225 // Adapt top_intra_model_count_allowed locally to prune luma intra modes using
1226 // neighbor block and quantizer information.
1227 int adapt_top_model_rd_count_using_neighbors;
1228
1229 // Prune the evaluation of odd delta angles of directional luma intra modes by
1230 // using the rdcosts of neighbouring delta angles.
1231 // For allintra encode, this speed feature reduces instruction count
1232 // by 4.461%, 3.699% and 3.536% for speed 6, 7 and 8 on a typical video
1233 // dataset with coding performance change less than 0.26%. For AVIF image
1234 // encode, this speed feature reduces encode time by 2.849%, 2.471%,
1235 // and 2.051% for speed 6, 7 and 8 on a typical image dataset with coding
1236 // performance change less than 0.27%.
1237 int prune_luma_odd_delta_angles_in_intra;
1238
1239 // Terminate early in chroma palette_size search.
1240 // 0: No early termination
1241 // 1: Terminate early for higher palette_size, if header rd cost of lower
1242 // palette_size is more than best_rd.
1243 // For allintra encode, this sf reduces instruction count by 0.45%,
1244 // 0.62%, 1.73%, 2.50%, 2.89%, 3.09% and 3.86% for speed 0 to 6 on screen
1245 // content set with coding performance change less than 0.01%.
1246 // For AVIF image encode, this sf reduces instruction count by 0.45%, 0.81%,
1247 // 0.85%, 1.05%, 1.45%, 1.66% and 1.95% for speed 0 to 6 on a typical image
1248 // dataset with no quality drop.
1249 int early_term_chroma_palette_size_search;
1250
1251 // Skips the evaluation of filter intra modes in inter frames if rd evaluation
1252 // of luma intra dc mode results in invalid rd stats.
1253 int skip_filter_intra_in_inter_frames;
1254} INTRA_MODE_SPEED_FEATURES;
1255
1256typedef struct TX_SPEED_FEATURES {
1257 // Init search depth for square and rectangular transform partitions.
1258 // Values:
1259 // 0 - search full tree, 1: search 1 level, 2: search the highest level only
1260 int inter_tx_size_search_init_depth_sqr;
1261 int inter_tx_size_search_init_depth_rect;
1262 int intra_tx_size_search_init_depth_sqr;
1263 int intra_tx_size_search_init_depth_rect;
1264
1265 // If any dimension of a coding block size above 64, always search the
1266 // largest transform only, since the largest transform block size is 64x64.
1267 int tx_size_search_lgr_block;
1268
1269 TX_TYPE_SEARCH tx_type_search;
1270
1271 // Skip split transform block partition when the collocated bigger block
1272 // is selected as all zero coefficients.
1273 int txb_split_cap;
1274
1275 // Shortcut the transform block partition and type search when the target
1276 // rdcost is relatively lower.
1277 // Values are 0 (not used) , or 1 - 2 with progressively increasing
1278 // aggressiveness
1279 int adaptive_txb_search_level;
1280
1281 // Prune level for tx_size_type search for inter based on rd model
1282 // 0: no pruning
1283 // 1-2: progressively increasing aggressiveness of pruning
1284 int model_based_prune_tx_search_level;
1285
1286 // Refine TX type after fast TX search.
1287 int refine_fast_tx_search_results;
1288
1289 // Prune transform split/no_split eval based on residual properties. A value
1290 // of 0 indicates no pruning, and the aggressiveness of pruning progressively
1291 // increases from levels 1 to 3.
1292 int prune_tx_size_level;
1293
1294 // Prune the evaluation of transform depths as decided by the NN model.
1295 // false: No pruning.
1296 // true : Avoid the evaluation of specific transform depths using NN model.
1297 //
1298 // For allintra encode, this speed feature reduces instruction count
1299 // by 4.76%, 8.92% and 11.28% for speed 6, 7 and 8 with coding performance
1300 // change less than 0.32%. For AVIF image encode, this speed feature reduces
1301 // encode time by 4.65%, 9.16% and 10.45% for speed 6, 7 and 8 on a typical
1302 // image dataset with coding performance change less than 0.19%.
1303 bool prune_intra_tx_depths_using_nn;
1304
1305 // Enable/disable early breakout during transform search of intra modes, by
1306 // using the minimum rd cost possible. By using this approach, the rd
1307 // evaluation of applicable transform blocks (in the current block) can be
1308 // avoided as
1309 // 1) best_rd evolves during the search in choose_tx_size_type_from_rd()
1310 // 2) appropriate ref_best_rd is passed in intra_block_yrd()
1311 //
1312 // For allintra encode, this speed feature reduces instruction count
1313 // by 1.11%, 1.08%, 1.02% and 0.93% for speed 3, 6, 7 and 8 with coding
1314 // performance change less than 0.02%. For AVIF image encode, this speed
1315 // feature reduces encode time by 0.93%, 1.46%, 1.07%, 0.84%, 0.99% and 0.73%
1316 // for speed 3, 4, 5, 6, 7 and 8 on a typical image dataset with coding
1317 // performance change less than 0.004%.
1318 bool use_rd_based_breakout_for_intra_tx_search;
1319} TX_SPEED_FEATURES;
1320
1321typedef struct RD_CALC_SPEED_FEATURES {
1322 // Fast approximation of av1_model_rd_from_var_lapndz
1323 int simple_model_rd_from_var;
1324
1325 // Perform faster distortion computation during the R-D evaluation by trying
1326 // to approximate the prediction error with transform coefficients (faster but
1327 // less accurate) rather than computing distortion in the pixel domain (slower
1328 // but more accurate). The following methods are used for distortion
1329 // computation:
1330 // Method 0: Always compute distortion in the pixel domain
1331 // Method 1: Based on block error, try using transform domain distortion for
1332 // tx_type search and compute distortion in pixel domain for final RD_STATS
1333 // Method 2: Based on block error, try to compute distortion in transform
1334 // domain
1335 // Methods 1 and 2 may fallback to computing distortion in the pixel domain in
1336 // case the block error is less than the threshold, which is controlled by the
1337 // speed feature tx_domain_dist_thres_level.
1338 //
1339 // The speed feature tx_domain_dist_level decides which of the above methods
1340 // needs to be used across different mode evaluation stages as described
1341 // below:
1342 // Eval type: Default Mode Winner
1343 // Level 0 : Method 0 Method 2 Method 0
1344 // Level 1 : Method 1 Method 2 Method 0
1345 // Level 2 : Method 2 Method 2 Method 0
1346 // Level 3 : Method 2 Method 2 Method 2
1347 int tx_domain_dist_level;
1348
1349 // Transform domain distortion threshold level
1350 int tx_domain_dist_thres_level;
1351
1352 // Trellis (dynamic programming) optimization of quantized values
1353 TRELLIS_OPT_TYPE optimize_coefficients;
1354
1355 // Use hash table to store macroblock RD search results
1356 // to avoid repeated search on the same residue signal.
1357 int use_mb_rd_hash;
1358
1359 // Flag used to control the extent of coeff R-D optimization
1360 int perform_coeff_opt;
1361} RD_CALC_SPEED_FEATURES;
1362
1363typedef struct WINNER_MODE_SPEED_FEATURES {
1364 // Flag used to control the winner mode processing for better R-D optimization
1365 // of quantized coeffs
1366 int enable_winner_mode_for_coeff_opt;
1367
1368 // Flag used to control the winner mode processing for transform size
1369 // search method
1370 int enable_winner_mode_for_tx_size_srch;
1371
1372 // Control transform size search level
1373 // Eval type: Default Mode Winner
1374 // Level 0 : FULL RD LARGEST ALL FULL RD
1375 // Level 1 : FAST RD LARGEST ALL FULL RD
1376 // Level 2 : LARGEST ALL LARGEST ALL FULL RD
1377 // Level 3 : LARGEST ALL LARGEST ALL LARGEST ALL
1378 int tx_size_search_level;
1379
1380 // Flag used to control the winner mode processing for use transform
1381 // domain distortion
1382 int enable_winner_mode_for_use_tx_domain_dist;
1383
1384 // Flag used to enable processing of multiple winner modes
1385 MULTI_WINNER_MODE_TYPE multi_winner_mode_type;
1386
1387 // Motion mode for winner candidates:
1388 // 0: speed feature OFF
1389 // 1 / 2 : Use configured number of winner candidates
1390 int motion_mode_for_winner_cand;
1391
1392 // Controls the prediction of transform skip block or DC only block.
1393 //
1394 // Different speed feature values (0 to 3) decide the aggressiveness of
1395 // prediction (refer to predict_dc_levels[][] in speed_features.c) to be used
1396 // during different mode evaluation stages.
1397 int dc_blk_pred_level;
1398
1399 // If on, disables interpolation filter search in handle_inter_mode loop, and
1400 // performs it during winner mode processing by \ref
1401 // tx_search_best_inter_candidates.
1402 int winner_mode_ifs;
1403
1404 // Controls the disabling of winner mode processing. Speed feature levels
1405 // are ordered in increasing aggressiveness of pruning. The method considered
1406 // for disabling, depends on the sf level value and it is described as below.
1407 // 0: Do not disable
1408 // 1: Disable for blocks with low source variance.
1409 // 2: Disable for blocks which turn out to be transform skip (skipped based on
1410 // eob) during MODE_EVAL stage except NEWMV mode.
1411 // 3: Disable for blocks which turn out to be transform skip during MODE_EVAL
1412 // stage except NEWMV mode. For high quantizers, prune conservatively based on
1413 // transform skip (skipped based on eob) except for NEWMV mode.
1414 // 4: Disable for blocks which turn out to be transform skip during MODE_EVAL
1415 // stage.
1416 int prune_winner_mode_eval_level;
1417} WINNER_MODE_SPEED_FEATURES;
1418
1419typedef struct LOOP_FILTER_SPEED_FEATURES {
1420 // This feature controls how the loop filter level is determined.
1421 LPF_PICK_METHOD lpf_pick;
1422
1423 // Skip some final iterations in the determination of the best loop filter
1424 // level.
1425 int use_coarse_filter_level_search;
1426
1427 // Control how the CDEF strength is determined.
1428 CDEF_PICK_METHOD cdef_pick_method;
1429
1430 // Decoder side speed feature to add penalty for use of dual-sgr filters.
1431 // Takes values 0 - 10, 0 indicating no penalty and each additional level
1432 // adding a penalty of 1%
1433 int dual_sgr_penalty_level;
1434
1435 // prune sgr ep using binary search like mechanism
1436 int enable_sgr_ep_pruning;
1437
1438 // Disable loop restoration for Chroma plane
1439 int disable_loop_restoration_chroma;
1440
1441 // Disable loop restoration for luma plane
1442 int disable_loop_restoration_luma;
1443
1444 // Prune RESTORE_WIENER evaluation based on source variance
1445 // 0 : no pruning
1446 // 1 : conservative pruning
1447 // 2 : aggressive pruning
1448 int prune_wiener_based_on_src_var;
1449
1450 // Prune self-guided loop restoration based on wiener search results
1451 // 0 : no pruning
1452 // 1 : pruning based on rdcost ratio of RESTORE_WIENER and RESTORE_NONE
1453 // 2 : pruning based on winner restoration type among RESTORE_WIENER and
1454 // RESTORE_NONE
1455 int prune_sgr_based_on_wiener;
1456
1457 // Reduce the wiener filter win size for luma
1458 int reduce_wiener_window_size;
1459
1460 // Flag to disable Wiener Loop restoration filter.
1461 bool disable_wiener_filter;
1462
1463 // Flag to disable Self-guided Loop restoration filter.
1464 bool disable_sgr_filter;
1465
1466 // Disable the refinement search around the wiener filter coefficients.
1467 bool disable_wiener_coeff_refine_search;
1468
1469 // Whether to downsample the rows in computation of wiener stats.
1470 int use_downsampled_wiener_stats;
1471} LOOP_FILTER_SPEED_FEATURES;
1472
1473typedef struct REAL_TIME_SPEED_FEATURES {
1474 // check intra prediction for non-RD mode.
1475 int check_intra_pred_nonrd;
1476
1477 // Skip checking intra prediction.
1478 // 0 - don't skip
1479 // 1 - skip if TX is skipped and best mode is not NEWMV
1480 // 2 - skip if TX is skipped
1481 // Skipping aggressiveness increases from level 1 to 2.
1482 int skip_intra_pred;
1483
1484 // Estimate motion before calculating variance in variance-based partition
1485 // 0 - Only use zero MV
1486 // 1 - perform coarse ME
1487 // 2 - perform coarse ME, and also use neighbours' MVs
1488 // 3 - use neighbours' MVs without performing coarse ME
1489 int estimate_motion_for_var_based_partition;
1490
1491 // For nonrd_use_partition: mode of extra check of leaf partition
1492 // 0 - don't check merge
1493 // 1 - always check merge
1494 // 2 - check merge and prune checking final split
1495 // 3 - check merge and prune checking final split based on bsize and qindex
1496 int nonrd_check_partition_merge_mode;
1497
1498 // For nonrd_use_partition: check of leaf partition extra split
1499 int nonrd_check_partition_split;
1500
1501 // Implements various heuristics to skip searching modes
1502 // The heuristics selected are based on flags
1503 // defined in the MODE_SEARCH_SKIP_HEURISTICS enum
1504 unsigned int mode_search_skip_flags;
1505
1506 // For nonrd: Reduces ref frame search.
1507 // 0 - low level of search prune in non last frames
1508 // 1 - pruned search in non last frames
1509 // 2 - more pruned search in non last frames
1510 int nonrd_prune_ref_frame_search;
1511
1512 // This flag controls the use of non-RD mode decision.
1513 int use_nonrd_pick_mode;
1514
1515 // Use ALTREF frame in non-RD mode decision.
1516 int use_nonrd_altref_frame;
1517
1518 // Use compound reference for non-RD mode.
1519 int use_comp_ref_nonrd;
1520
1521 // Reference frames for compound prediction for nonrd pickmode:
1522 // LAST_GOLDEN (0), LAST_LAST2 (1), or LAST_ALTREF (2).
1523 int ref_frame_comp_nonrd[3];
1524
1525 // use reduced ref set for real-time mode
1526 int use_real_time_ref_set;
1527
1528 // Skip a number of expensive mode evaluations for blocks with very low
1529 // temporal variance.
1530 int short_circuit_low_temp_var;
1531
1532 // Reuse inter prediction in fast non-rd mode.
1533 int reuse_inter_pred_nonrd;
1534
1535 // Number of best inter modes to search transform. INT_MAX - search all.
1536 int num_inter_modes_for_tx_search;
1537
1538 // Use interpolation filter search in non-RD mode decision.
1539 int use_nonrd_filter_search;
1540
1541 // Use simplified RD model for interpolation search and Intra
1542 int use_simple_rd_model;
1543
1544 // If set forces interpolation filter to EIGHTTAP_REGULAR
1545 int skip_interp_filter_search;
1546
1547 // For nonrd mode: use hybrid intra mode search for intra only frames based on
1548 // block properties.
1549 // 0 : use nonrd pick intra for all blocks
1550 // 1 : use rd for bsize < 16x16, nonrd otherwise
1551 // 2 : use rd for bsize < 16x16 and src var >= 101, nonrd otherwise
1552 int hybrid_intra_pickmode;
1553
1554 // Compute variance/sse on source difference, prior to encoding superblock.
1555 int source_metrics_sb_nonrd;
1556
1557 // Flag to indicate process for handling overshoot on slide/scene change,
1558 // for real-time CBR mode.
1559 OVERSHOOT_DETECTION_CBR overshoot_detection_cbr;
1560
1561 // Check for scene/content change detection on every frame before encoding.
1562 int check_scene_detection;
1563
1564 // For nonrd mode: Prefer larger partition blks in variance based partitioning
1565 // 0: disabled, 1-3: increasing aggressiveness
1566 int prefer_large_partition_blocks;
1567
1568 // uses results of temporal noise estimate
1569 int use_temporal_noise_estimate;
1570
1571 // Parameter indicating initial search window to be used in full-pixel search
1572 // for nonrd_pickmode. Range [0, MAX_MVSEARCH_STEPS - 1]. Lower value
1573 // indicates larger window. If set to 0, step_param is set based on internal
1574 // logic in set_mv_search_params().
1575 int fullpel_search_step_param;
1576
1577 // Bit mask to enable or disable intra modes for each prediction block size
1578 // separately, for nonrd_pickmode. Currently, the sf is not respected when
1579 // 'force_intra_check' is true in 'av1_estimate_intra_mode()' function. Also,
1580 // H and V pred modes allowed through this sf can be further pruned when
1581 //'prune_hv_pred_modes_using_src_sad' sf is true.
1582 int intra_y_mode_bsize_mask_nrd[BLOCK_SIZES];
1583
1584 // Prune H and V intra predition modes evalution in inter frame.
1585 // The sf does not have any impact.
1586 // i. when frame_source_sad is 1.1 times greater than avg_source_sad
1587 // ii. when cyclic_refresh_segment_id_boosted is enabled
1588 // iii. when SB level source sad is greater than kMedSad
1589 // iv. when color sensitivity is non zero for both the chroma channels
1590 bool prune_hv_pred_modes_using_src_sad;
1591
1592 // Skips mode checks more aggressively in nonRD mode
1593 int nonrd_aggressive_skip;
1594
1595 // Skip cdef on 64x64 blocks/
1596 // 0: disabled
1597 // 1: skip when NEWMV or INTRA is not picked or color sensitivity is off.
1598 // When color sensitivity is on for a superblock, all 64x64 blocks within
1599 // will not skip.
1600 // 2: more aggressive mode where skip is done for all frames where
1601 // rc->high_source_sad = 0 (non slide-changes), and color sensitivity off.
1602 int skip_cdef_sb;
1603
1604 // Forces larger partition blocks in variance based partitioning for intra
1605 // frames
1606 int force_large_partition_blocks_intra;
1607
1608 // Skip evaluation of no split in tx size selection for merge partition
1609 int skip_tx_no_split_var_based_partition;
1610
1611 // Intermediate termination of newMV mode evaluation based on so far best mode
1612 // sse
1613 int skip_newmv_mode_based_on_sse;
1614
1615 // Define gf length multiplier.
1616 // Level 0: use large multiplier, level 1: use medium multiplier.
1617 int gf_length_lvl;
1618
1619 // Prune inter modes with golden frame as reference for NEARMV and NEWMV modes
1620 int prune_inter_modes_with_golden_ref;
1621
1622 // Prune inter modes w.r.t golden or alt-ref frame based on sad
1623 int prune_inter_modes_wrt_gf_arf_based_on_sad;
1624
1625 // Prune inter mode search in rd path based on current block's temporal
1626 // variance wrt LAST reference.
1627 int prune_inter_modes_using_temp_var;
1628
1629 // Reduce MV precision to halfpel for higher int MV value & frame-level motion
1630 // 0: disabled
1631 // 1-2: Reduce precision to halfpel, fullpel based on conservative
1632 // thresholds, aggressiveness increases with increase in level
1633 // 3: Reduce precision to halfpel using more aggressive thresholds
1634 int reduce_mv_pel_precision_highmotion;
1635
1636 // Reduce MV precision for low complexity blocks
1637 // 0: disabled
1638 // 1: Reduce the mv resolution for zero mv if the variance is low
1639 // 2: Switch to halfpel, fullpel based on low block spatial-temporal
1640 // complexity.
1641 int reduce_mv_pel_precision_lowcomplex;
1642
1643 // Prune intra mode evaluation in inter frames based on mv range.
1644 BLOCK_SIZE prune_intra_mode_based_on_mv_range;
1645 // The number of times to left shift the splitting thresholds in variance
1646 // based partitioning. The minimum values should be 7 to avoid left shifting
1647 // by a negative number.
1648 int var_part_split_threshold_shift;
1649
1650 // Qindex based variance partition threshold index, which determines
1651 // the aggressiveness of partition pruning
1652 // 0: disabled for speeds 9,10
1653 // 1,2: (rd-path) lowers qindex thresholds conditionally (for low SAD sb)
1654 // 3,4: (non-rd path) uses pre-tuned qindex thresholds
1655 int var_part_based_on_qidx;
1656
1657 // Enable GF refresh based on Q value.
1658 int gf_refresh_based_on_qp;
1659
1660 // Temporal filtering
1661 // The value can be 1 or 2, which indicates the threshold to use.
1662 // Must be off for lossless mode.
1663 int use_rtc_tf;
1664
1665 // Prune the use of the identity transform in nonrd_pickmode,
1666 // used for screen content mode: only for smaller blocks
1667 // and higher spatial variance, and when skip_txfm is not
1668 // already set.
1669 int prune_idtx_nonrd;
1670
1671 // Prune the use of paletter mode in nonrd pickmode.
1672 int prune_palette_nonrd;
1673
1674 // Skip loopfilter, for static content after slide change
1675 // or key frame, once quality has ramped up.
1676 // 0: disabled
1677 // 1: skip only after quality is ramped up.
1678 // 2: aggrssive mode, where skip is done for all frames that
1679 // where rc->high_source_sad = 0 (no slide-changes).
1680 int skip_lf_screen;
1681
1682 // For nonrd: early exit out of variance partition that sets the
1683 // block size to superblock size, and sets mode to zeromv-last skip.
1684 // 0: disabled
1685 // 1: zeromv-skip is enabled at SB level only
1686 // 2: zeromv-skip is enabled at SB level and coding block level
1687 int part_early_exit_zeromv;
1688
1689 // Early terminate inter mode search based on sse in non-rd path.
1690 INTER_SEARCH_EARLY_TERM_IDX sse_early_term_inter_search;
1691
1692 // SAD based adaptive altref selection
1693 int sad_based_adp_altref_lag;
1694
1695 // Enable/disable partition direct merging.
1696 int partition_direct_merging;
1697
1698 // Level of aggressiveness for obtaining tx size based on qstep
1699 int tx_size_level_based_on_qstep;
1700
1701 // Avoid the partitioning of a 16x16 block in variance based partitioning
1702 // (VBP) by making use of minimum and maximum sub-block variances.
1703 // For allintra encode, this speed feature reduces instruction count by 5.39%
1704 // for speed 9 on a typical video dataset with coding performance gain
1705 // of 1.44%.
1706 // For AVIF image encode, this speed feature reduces encode time
1707 // by 8.44% for speed 9 on a typical image dataset with coding performance
1708 // gain of 0.78%.
1709 bool vbp_prune_16x16_split_using_min_max_sub_blk_var;
1710
1711 // A qindex threshold that determines whether to use qindex based CDEF filter
1712 // strength estimation for screen content types. The strength estimation model
1713 // used for screen contents prefers to allow cdef filtering for more frames.
1714 // This sf is used to limit the frames which go through cdef filtering and
1715 // following explains the setting of the same.
1716 // MAXQ (255): This disables the usage of this sf. Here, frame does not use a
1717 // screen content model thus reduces the number of frames that go through cdef
1718 // filtering.
1719 // MINQ (0): Frames always use screen content model thus increasing the number
1720 // of frames that go through cdef filtering.
1721 // This speed feature has a substantial gain on coding metrics, with moderate
1722 // increase encoding time. Select threshold based on speed vs quality
1723 // trade-off.
1724 int screen_content_cdef_filter_qindex_thresh;
1725
1726 // Prune compound mode if its variance is higher than the variance of single
1727 // modes.
1728 bool prune_compoundmode_with_singlecompound_var;
1729
1730 // Allow mode cost update at frame level every couple frames. This
1731 // overrides the command line setting --mode-cost-upd-freq=3 (never update
1732 // except on key frame and first delta).
1733 bool frame_level_mode_cost_update;
1734
1735 // Prune H_PRED during intra mode evaluation in the nonrd path based on best
1736 // mode so far.
1737 //
1738 // For allintra encode, this speed feature reduces instruction count by 1.10%
1739 // for speed 9 with coding performance change less than 0.04%.
1740 // For AVIF image encode, this speed feature reduces encode time by 1.03% for
1741 // speed 9 on a typical image dataset with coding performance change less than
1742 // 0.08%.
1743 bool prune_h_pred_using_best_mode_so_far;
1744
1745 // Enable pruning of intra mode evaluations in nonrd path based on source
1746 // variance and best mode so far. The pruning logic is enabled only if the
1747 // mode is not a winner mode of both the neighboring blocks (left/top).
1748 //
1749 // For allintra encode, this speed feature reduces instruction count by 3.96%
1750 // for speed 9 with coding performance change less than 0.38%.
1751 // For AVIF image encode, this speed feature reduces encode time by 3.46% for
1752 // speed 9 on a typical image dataset with coding performance change less than
1753 // -0.06%.
1754 bool enable_intra_mode_pruning_using_neighbors;
1755
1756 // Prune intra mode evaluations in nonrd path based on best sad so far.
1757 //
1758 // For allintra encode, this speed feature reduces instruction count by 3.05%
1759 // for speed 9 with coding performance change less than 0.24%.
1760 // For AVIF image encode, this speed feature reduces encode time by 1.87% for
1761 // speed 9 on a typical image dataset with coding performance change less than
1762 // 0.16%.
1763 bool prune_intra_mode_using_best_sad_so_far;
1764
1765 // If compound is enabled, and the current block size is \geq BLOCK_16X16,
1766 // limit the compound modes to GLOBAL_GLOBALMV. This does not apply to the
1767 // base layer of svc.
1768 bool check_only_zero_zeromv_on_large_blocks;
1769
1770 // Allow for disabling cdf update for non reference frames in svc mode.
1771 bool disable_cdf_update_non_reference_frame;
1772
1773 // Prune compound modes if the single modes variances do not perform well.
1774 bool prune_compoundmode_with_singlemode_var;
1775
1776 // Skip searching all compound mode if the variance of single_mode residue is
1777 // sufficiently low.
1778 bool skip_compound_based_on_var;
1779
1780 // Sets force_zeromv_skip based on the source sad available. Aggressiveness
1781 // increases with increase in the level set for speed feature.
1782 // 0: No setting
1783 // 1: If source sad is kZeroSad
1784 // 2: If source sad <= kVeryLowSad
1785 int set_zeromv_skip_based_on_source_sad;
1786
1787 // Downgrades the block-level subpel motion search to
1788 // av1_find_best_sub_pixel_tree_pruned_more for higher QP and when fullpel
1789 // search performed well, zeromv has low sad or low source_var
1790 bool use_adaptive_subpel_search;
1791
1792 // A flag used in RTC case to control frame_refs_short_signaling. Note that
1793 // the final decision is made in check_frame_refs_short_signaling(). The flag
1794 // can only be turned on when res < 360p and speed >= 9, in which case only
1795 // LAST and GOLDEN ref frames are used now.
1796 bool enable_ref_short_signaling;
1797
1798 // A flag that controls if we check or bypass GLOBALMV in rtc single ref frame
1799 // case.
1800 bool check_globalmv_on_single_ref;
1801} REAL_TIME_SPEED_FEATURES;
1802
1808typedef struct SPEED_FEATURES {
1813
1818
1822 TPL_SPEED_FEATURES tpl_sf;
1823
1827 GLOBAL_MOTION_SPEED_FEATURES gm_sf;
1828
1832 PARTITION_SPEED_FEATURES part_sf;
1833
1837 MV_SPEED_FEATURES mv_sf;
1838
1842 INTER_MODE_SPEED_FEATURES inter_sf;
1843
1847 INTERP_FILTER_SPEED_FEATURES interp_sf;
1848
1852 INTRA_MODE_SPEED_FEATURES intra_sf;
1853
1857 TX_SPEED_FEATURES tx_sf;
1858
1862 RD_CALC_SPEED_FEATURES rd_sf;
1863
1867 WINNER_MODE_SPEED_FEATURES winner_mode_sf;
1868
1872 LOOP_FILTER_SPEED_FEATURES lpf_sf;
1873
1877 REAL_TIME_SPEED_FEATURES rt_sf;
1881struct AV1_COMP;
1882
1896 int speed);
1897
1910 int speed);
1923
1924#ifdef __cplusplus
1925} // extern "C"
1926#endif
1927
1928#endif // AOM_AV1_ENCODER_SPEED_FEATURES_H_
static int prune_zero_mv_with_sse(const aom_variance_fn_ptr_t *fn_ptr, const MACROBLOCK *x, BLOCK_SIZE bsize, const HandleInterModeArgs *args, int prune_zero_mv_with_sse)
Prunes ZeroMV Search Using Best NEWMV's SSE.
Definition: rdopt.c:2499
void av1_set_speed_features_framesize_independent(struct AV1_COMP *cpi, int speed)
Frame size independent speed vs quality trade off flags.
void av1_set_speed_features_qindex_dependent(struct AV1_COMP *cpi, int speed)
Q index dependent speed vs quality trade off flags.
void av1_set_speed_features_framesize_dependent(struct AV1_COMP *cpi, int speed)
Frame size dependent speed vs quality trade off flags.
INTERNAL_COST_UPDATE_TYPE
This enum decides internally how often to update the entropy costs.
Definition: speed_features.h:341
@ INTERNAL_COST_UPD_OFF
Definition: speed_features.h:342
@ INTERNAL_COST_UPD_SBROW_SET
Definition: speed_features.h:344
@ INTERNAL_COST_UPD_SBROW
Definition: speed_features.h:345
@ INTERNAL_COST_UPD_SB
Definition: speed_features.h:346
@ INTERNAL_COST_UPD_TILE
Definition: speed_features.h:343
INTER_SEARCH_EARLY_TERM_IDX
This enumeration defines inter search early termination index in non-rd path based on sse value.
Definition: speed_features.h:385
@ EARLY_TERM_INDICES
Definition: speed_features.h:396
@ EARLY_TERM_IDX_1
Definition: speed_features.h:388
@ EARLY_TERM_IDX_4
Definition: speed_features.h:394
@ EARLY_TERM_IDX_2
Definition: speed_features.h:390
@ EARLY_TERM_DISABLED
Definition: speed_features.h:386
@ EARLY_TERM_IDX_3
Definition: speed_features.h:392
SIMPLE_MOTION_SEARCH_PRUNE_LEVEL
This enumeration defines a variety of simple motion search based partition prune levels.
Definition: speed_features.h:353
@ QIDX_BASED_AGG_LVL1
Definition: speed_features.h:359
@ SIMPLE_AGG_LVL3
Definition: speed_features.h:358
@ TOTAL_SIMPLE_AGG_LVLS
Definition: speed_features.h:362
@ SIMPLE_AGG_LVL1
Definition: speed_features.h:356
@ SIMPLE_AGG_LVL0
Definition: speed_features.h:355
@ TOTAL_AGG_LVLS
Definition: speed_features.h:368
@ SIMPLE_AGG_LVL2
Definition: speed_features.h:357
@ TOTAL_QINDEX_BASED_AGG_LVLS
Definition: speed_features.h:364
struct SPEED_FEATURES SPEED_FEATURES
Top level speed vs quality trade off data struture.
PRUNE_MESH_SEARCH_LEVEL
This enumeration defines a variety of mesh search prune levels.
Definition: speed_features.h:375
@ PRUNE_MESH_SEARCH_LVL_1
Definition: speed_features.h:377
@ PRUNE_MESH_SEARCH_LVL_2
Definition: speed_features.h:378
@ PRUNE_MESH_SEARCH_DISABLED
Definition: speed_features.h:376
struct HIGH_LEVEL_SPEED_FEATURES HIGH_LEVEL_SPEED_FEATURES
Sequence/frame level speed vs quality features.
struct FIRST_PASS_SPEED_FEATURES FIRST_PASS_SPEED_FEATURES
CDEF_PICK_METHOD
This enumeration defines a variety of CDEF pick methods.
Definition: speed_features.h:162
@ CDEF_FAST_SEARCH_LVL2
Definition: speed_features.h:165
@ CDEF_FAST_SEARCH_LVL5
Definition: speed_features.h:169
@ CDEF_FAST_SEARCH_LVL1
Definition: speed_features.h:164
@ CDEF_FULL_SEARCH
Definition: speed_features.h:163
@ CDEF_PICK_FROM_Q
Definition: speed_features.h:170
@ CDEF_FAST_SEARCH_LVL4
Definition: speed_features.h:168
@ CDEF_FAST_SEARCH_LVL3
Definition: speed_features.h:166
Top level encoder structure.
Definition: encoder.h:2815
int speed
Definition: encoder.h:3032
Definition: speed_features.h:473
int disable_recon
Skips reconstruction by using source buffers for prediction.
Definition: speed_features.h:490
int reduce_mv_step_param
Reduces the mv search window. By default, the initial search window is around MIN(MIN(dims),...
Definition: speed_features.h:480
int skip_zeromv_motion_search
Skips the motion search centered on 0,0 mv.
Definition: speed_features.h:495
int skip_motion_search_threshold
Skips the motion search when the zero mv has small sse.
Definition: speed_features.h:485
Sequence/frame level speed vs quality features.
Definition: speed_features.h:402
int adjust_num_frames_for_arf_filtering
Definition: speed_features.h:453
int second_alt_ref_filtering
Definition: speed_features.h:447
int frame_parameter_update
Definition: speed_features.h:404
int weight_calc_level_in_tf
Definition: speed_features.h:467
MV_PREC_LOGIC high_precision_mv_usage
Definition: speed_features.h:423
int disable_extra_sc_testing
Definition: speed_features.h:442
int recode_tolerance
Definition: speed_features.h:415
SUPERRES_AUTO_SEARCH_TYPE superres_auto_search_type
Definition: speed_features.h:437
int static_segmentation
Definition: speed_features.h:432
int accurate_bit_estimate
Definition: speed_features.h:460
RECODE_LOOP_TYPE recode_loop
Definition: speed_features.h:409
Top level speed vs quality trade off data struture.
Definition: speed_features.h:1808
MV_SPEED_FEATURES mv_sf
Definition: speed_features.h:1837
TPL_SPEED_FEATURES tpl_sf
Definition: speed_features.h:1822
LOOP_FILTER_SPEED_FEATURES lpf_sf
Definition: speed_features.h:1872
TX_SPEED_FEATURES tx_sf
Definition: speed_features.h:1857
INTER_MODE_SPEED_FEATURES inter_sf
Definition: speed_features.h:1842
RD_CALC_SPEED_FEATURES rd_sf
Definition: speed_features.h:1862
PARTITION_SPEED_FEATURES part_sf
Definition: speed_features.h:1832
GLOBAL_MOTION_SPEED_FEATURES gm_sf
Definition: speed_features.h:1827
INTERP_FILTER_SPEED_FEATURES interp_sf
Definition: speed_features.h:1847
FIRST_PASS_SPEED_FEATURES fp_sf
Definition: speed_features.h:1817
INTRA_MODE_SPEED_FEATURES intra_sf
Definition: speed_features.h:1852
WINNER_MODE_SPEED_FEATURES winner_mode_sf
Definition: speed_features.h:1867
REAL_TIME_SPEED_FEATURES rt_sf
Definition: speed_features.h:1877
HIGH_LEVEL_SPEED_FEATURES hl_sf
Definition: speed_features.h:1812