Commit 3555dd7b39 for aom
commit 3555dd7b398d9dd0d8559ebbc3a3a1b7eed60fb5
Author: Julio Barba <juliobbv@gmail.com>
Date: Thu Feb 19 22:46:20 2026 -0500
Enable screen detection mode 2 in all intra mode
Change-Id: I235de24065ee575a9f68672137f67fd2a57beedf
diff --git a/aom/aomcx.h b/aom/aomcx.h
index 4b39f34e23..e5ce630c27 100644
--- a/aom/aomcx.h
+++ b/aom/aomcx.h
@@ -1596,9 +1596,10 @@ enum aome_enc_control_id {
/*!\brief Codec control to set the screen content detection mode,
* aom_screen_detection_mode parameter.
*
- * - 1: AOM_SCREEN_DETECTION_STANDARD = standard (default)
+ * - 1: AOM_SCREEN_DETECTION_STANDARD = standard (default in good quality and
+ realtime modes)
* - 2: AOM_SCREEN_DETECTION_ANTIALIASING_AWARE = anti-aliased text and
- * graphics aware
+ * graphics aware (default in all intra mode)
*/
AV1E_SET_SCREEN_CONTENT_DETECTION_MODE = 171,
@@ -1743,7 +1744,6 @@ typedef enum {
* * --enable-cdef=3
* * --enable-chroma-deltaq=1
* * --deltaq-mode=6
- * * --screen-detection-mode=2
* AOM_TUNE_IQ additionally sets the following options:
* * --enable-adaptive-sharpness=1
*/
diff --git a/av1/arg_defs.c b/av1/arg_defs.c
index 1086567136..ad28435460 100644
--- a/av1/arg_defs.c
+++ b/av1/arg_defs.c
@@ -714,9 +714,10 @@ const av1_codec_arg_definitions_t g_av1_codec_arg_defs = {
"Enable low complexity decode (0: false (default), 1: true). As of now, "
"this only supports good-quality encoding (speed 1 to 3) for vertical "
"videos between 608p and 720p."),
- .screen_detection_mode =
- ARG_DEF(NULL, "screen-detection-mode", 1,
- "Screen content detection mode (1: standard (default), "
- "2: anti-aliased text and graphics aware)"),
+ .screen_detection_mode = ARG_DEF(
+ NULL, "screen-detection-mode", 1,
+ "Screen content detection mode (1: standard (default in good quality and "
+ "realtime modes), 2: anti-aliased text and graphics aware (default in "
+ "all intra mode))"),
#endif // CONFIG_AV1_ENCODER
};
diff --git a/av1/av1_cx_iface.c b/av1/av1_cx_iface.c
index 5727aeadaf..69140cc449 100644
--- a/av1/av1_cx_iface.c
+++ b/av1/av1_cx_iface.c
@@ -1928,8 +1928,6 @@ static aom_codec_err_t handle_tuning(aom_codec_alg_priv_t *ctx,
extra_cfg->enable_chroma_deltaq = 1;
// Enable "Variance Boost" deltaq mode, optimized for images.
extra_cfg->deltaq_mode = DELTA_Q_VARIANCE_BOOST;
- // Enable "anti-aliased text and graphics aware" screen detection mode.
- extra_cfg->screen_detection_mode = AOM_SCREEN_DETECTION_ANTIALIASING_AWARE;
}
if (extra_cfg->tuning == AOM_TUNE_IQ) {
// Enable adaptive sharpness to adjust loop filter levels according to QP.
@@ -3017,14 +3015,20 @@ static aom_codec_err_t encoder_init(aom_codec_ctx_t *ctx) {
priv->extra_cfg = default_extra_cfg;
// Special handling:
- // By default, if omitted: --enable-cdef=1, --qm-min=5, and --qm-max=9
- // Here we set its default values to 0, 4, and 10 respectively when
- // --allintra is turned on.
- // However, if users set --enable-cdef, --qm-min, or --qm-max, either from
- // the command line or aom_codec_control(), the encoder still respects it.
+ // By default, if omitted: --enable-cdef=1, --screen-detection-mode=1,
+ // --qm-min=5, and --qm-max=9.
+ // Here we set its default values to --enable-cdef=0,
+ // --screen-detection-mode=2, --qm-min=4, and --qm-max=10 when --allintra
+ // is turned on.
+ // However, if users set --enable-cdef, --screen-detection-mode, --qm-min,
+ // or --qm-max, either from the command line or aom_codec_control(), the
+ // encoder still respects it.
if (priv->cfg.g_usage == AOM_USAGE_ALL_INTRA) {
// CDEF has been found to blur images, so it's disabled in all-intra mode
priv->extra_cfg.enable_cdef = 0;
+ // Enable "anti-aliased text and graphics aware" screen detection mode.
+ priv->extra_cfg.screen_detection_mode =
+ AOM_SCREEN_DETECTION_ANTIALIASING_AWARE;
// These QM min/max values have been found to be beneficial for images,
// when used with an alternative QM formula (see
// aom_get_qmlevel_allintra()).