Remove "best" deadline parameter from aomenc.
This option increases runtime by 20% and is only marginally
better than good cpu-used=0:
PSNR | PSNR Cb | PSNR Cr | PSNR HVS | SSIM | MS SSIM | CIEDE 2000
-0.3382 | -0.3911 | -0.4875 | -0.2982 | -0.2992 | -0.3164 | -0.3686
It is also not well integrated with speed_features.c, which is
the main reason for the removal.
Change-Id: If88c50367f63b860ad57f650869b978ec7734aad
diff --git a/av1/encoder/encoder.h b/av1/encoder/encoder.h
index 1c11e08..f21263a 100644
--- a/av1/encoder/encoder.h
+++ b/av1/encoder/encoder.h
@@ -101,11 +101,6 @@
// time it takes to encode the output. Speed setting controls how fast.
GOOD,
- // The encoder places priority on the quality of the output over encoding
- // speed. The output is compressed at the highest possible quality. This
- // option takes the longest amount of time to encode. Speed setting ignored.
- BEST,
-
// Realtime/Live Encoding. This mode is optimized for realtime encoding (for
// example, capturing a television signal or feed from a live camera). Speed
// setting controls how fast.
diff --git a/av1/encoder/rd.c b/av1/encoder/rd.c
index d6561fc..fff0176 100644
--- a/av1/encoder/rd.c
+++ b/av1/encoder/rd.c
@@ -890,8 +890,7 @@
SPEED_FEATURES *const sf = &cpi->sf;
// Set baseline threshold values.
- for (i = 0; i < MAX_MODES; ++i)
- rd->thresh_mult[i] = cpi->oxcf.mode == BEST ? -500 : 0;
+ for (i = 0; i < MAX_MODES; ++i) rd->thresh_mult[i] = cpi->oxcf.mode == 0;
if (sf->adaptive_rd_thresh) {
rd->thresh_mult[THR_NEARESTMV] = 300;
@@ -1160,20 +1159,34 @@
}
void av1_set_rd_speed_thresholds_sub8x8(AV1_COMP *cpi) {
- static const int thresh_mult[2][MAX_REFS] = {
+ static const int thresh_mult[MAX_REFS] = {
#if CONFIG_EXT_REFS
- { 2500, 2500, 2500, 2500, 2500, 2500, 4500, 4500, 4500, 4500, 4500, 4500,
- 4500, 4500, 2500 },
- { 2000, 2000, 2000, 2000, 2000, 2000, 4000, 4000, 4000, 4000, 4000, 4000,
- 4000, 4000, 2000 }
+ 2500,
+ 2500,
+ 2500,
+ 2500,
+ 2500,
+ 2500,
+ 4500,
+ 4500,
+ 4500,
+ 4500,
+ 4500,
+ 4500,
+ 4500,
+ 4500,
+ 2500
#else
- { 2500, 2500, 2500, 4500, 4500, 2500 },
- { 2000, 2000, 2000, 4000, 4000, 2000 }
+ 2500,
+ 2500,
+ 2500,
+ 4500,
+ 4500,
+ 2500
#endif // CONFIG_EXT_REFS
};
RD_OPT *const rd = &cpi->rd;
- const int idx = cpi->oxcf.mode == BEST;
- memcpy(rd->thresh_mult_sub8x8, thresh_mult[idx], sizeof(thresh_mult[idx]));
+ memcpy(rd->thresh_mult_sub8x8, thresh_mult, sizeof(thresh_mult));
}
void av1_update_rd_thresh_fact(const AV1_COMMON *const cm,
diff --git a/av1/encoder/rdopt.c b/av1/encoder/rdopt.c
index 9157e5c..f938deb 100644
--- a/av1/encoder/rdopt.c
+++ b/av1/encoder/rdopt.c
@@ -6090,20 +6090,18 @@
* and new motion search. */
if (new_best_rd < label_mv_thresh) break;
- if (cpi->oxcf.mode != BEST) {
#if CONFIG_EXT_INTER
- bsi->mvp.as_int = bsi->ref_mv[0]->as_int;
+ bsi->mvp.as_int = bsi->ref_mv[0]->as_int;
#else
// use previous block's result as next block's MV predictor.
#if !CONFIG_REF_MV
- if (index > 0) {
- bsi->mvp.as_int = mi->bmi[index - 1].as_mv[0].as_int;
- if (index == 2)
- bsi->mvp.as_int = mi->bmi[index - 2].as_mv[0].as_int;
- }
+ if (index > 0) {
+ bsi->mvp.as_int = mi->bmi[index - 1].as_mv[0].as_int;
+ if (index == 2)
+ bsi->mvp.as_int = mi->bmi[index - 2].as_mv[0].as_int;
+ }
#endif // !CONFIG_REF_MV
#endif // CONFIG_EXT_INTER
- }
max_mv = (index == 0) ? (int)x->max_mv_context[mbmi->ref_frame[0]]
: AOMMAX(abs(bsi->mvp.as_mv.row),
abs(bsi->mvp.as_mv.col)) >>
diff --git a/av1/encoder/speed_features.c b/av1/encoder/speed_features.c
index a44a733..92de8cf 100644
--- a/av1/encoder/speed_features.c
+++ b/av1/encoder/speed_features.c
@@ -17,11 +17,6 @@
#include "aom_dsp/aom_dsp_common.h"
-// Mesh search patters for various speed settings
-static MESH_PATTERN best_quality_mesh_pattern[MAX_MESH_STEP] = {
- { 64, 4 }, { 28, 2 }, { 15, 1 }, { 7, 1 }
-};
-
#define MAX_MESH_SPEED 5 // Max speed setting for mesh motion method
static MESH_PATTERN
good_quality_mesh_patterns[MAX_MESH_SPEED + 1][MAX_MESH_STEP] = {
@@ -587,31 +582,19 @@
cpi->diamond_search_sad = av1_diamond_search_sad;
sf->allow_exhaustive_searches = 1;
- if (oxcf->mode == BEST) {
- if (cpi->twopass.fr_content_type == FC_GRAPHICS_ANIMATION)
- sf->exhaustive_searches_thresh = (1 << 20);
- else
- sf->exhaustive_searches_thresh = (1 << 21);
- sf->max_exaustive_pct = 100;
- for (i = 0; i < MAX_MESH_STEP; ++i) {
- sf->mesh_patterns[i].range = best_quality_mesh_pattern[i].range;
- sf->mesh_patterns[i].interval = best_quality_mesh_pattern[i].interval;
- }
- } else {
- int speed = (oxcf->speed > MAX_MESH_SPEED) ? MAX_MESH_SPEED : oxcf->speed;
- if (cpi->twopass.fr_content_type == FC_GRAPHICS_ANIMATION)
- sf->exhaustive_searches_thresh = (1 << 22);
- else
- sf->exhaustive_searches_thresh = (1 << 23);
- sf->max_exaustive_pct = good_quality_max_mesh_pct[speed];
- if (speed > 0)
- sf->exhaustive_searches_thresh = sf->exhaustive_searches_thresh << 1;
+ int speed = (oxcf->speed > MAX_MESH_SPEED) ? MAX_MESH_SPEED : oxcf->speed;
+ if (cpi->twopass.fr_content_type == FC_GRAPHICS_ANIMATION)
+ sf->exhaustive_searches_thresh = (1 << 22);
+ else
+ sf->exhaustive_searches_thresh = (1 << 23);
+ sf->max_exaustive_pct = good_quality_max_mesh_pct[speed];
+ if (speed > 0)
+ sf->exhaustive_searches_thresh = sf->exhaustive_searches_thresh << 1;
- for (i = 0; i < MAX_MESH_STEP; ++i) {
- sf->mesh_patterns[i].range = good_quality_mesh_patterns[speed][i].range;
- sf->mesh_patterns[i].interval =
- good_quality_mesh_patterns[speed][i].interval;
- }
+ for (i = 0; i < MAX_MESH_STEP; ++i) {
+ sf->mesh_patterns[i].range = good_quality_mesh_patterns[speed][i].range;
+ sf->mesh_patterns[i].interval =
+ good_quality_mesh_patterns[speed][i].interval;
}
#if !CONFIG_XIPHRC