Commit 027a2362a4 for aom
commit 027a2362a45e8238ece7306eeea5f3ded8c68540
Author: Julio Barba <juliobbv@gmail.com>
Date: Thu Dec 4 20:36:21 2025 -0500
Adaptive CDEF: code review feedback follow-up
Bug: aomedia:463698815
Change-Id: If9688052ba91fa6bb74f67545992f5ff7dd691e8
diff --git a/av1/encoder/pickcdef.c b/av1/encoder/pickcdef.c
index 2cc3aaf4a6..4d413a80d3 100644
--- a/av1/encoder/pickcdef.c
+++ b/av1/encoder/pickcdef.c
@@ -1002,12 +1002,13 @@ void av1_cdef_search(AV1_COMP *cpi) {
cdef_info->cdef_strengths[j] =
new_pri_luma_strength * CDEF_SEC_STRENGTHS + new_sec_luma_strength;
+ int new_pri_chroma_strength;
+ int new_sec_chroma_strength;
+
if (num_planes > 1) {
const int chroma_strength = cdef_info->cdef_uv_strengths[j];
- const int new_pri_chroma_strength =
- (chroma_strength / CDEF_SEC_STRENGTHS) >> 1;
- const int new_sec_chroma_strength =
- (chroma_strength % CDEF_SEC_STRENGTHS) >> 1;
+ new_pri_chroma_strength = (chroma_strength / CDEF_SEC_STRENGTHS) >> 1;
+ new_sec_chroma_strength = (chroma_strength % CDEF_SEC_STRENGTHS) >> 1;
cdef_info->cdef_uv_strengths[j] =
new_pri_chroma_strength * CDEF_SEC_STRENGTHS +
@@ -1029,11 +1030,8 @@ void av1_cdef_search(AV1_COMP *cpi) {
cdef_info->cdef_strengths[j] = 0;
}
if (num_planes > 1) {
- const int chroma_strength = cdef_info->cdef_uv_strengths[j];
- const int pri_chroma_strength = chroma_strength / CDEF_SEC_STRENGTHS;
- const int sec_chroma_strength = chroma_strength % CDEF_SEC_STRENGTHS;
const bool is_low_chroma_strength =
- pri_chroma_strength <= 4 && sec_chroma_strength <= 1;
+ new_pri_chroma_strength <= 4 && new_sec_chroma_strength <= 1;
if (is_low_luma_strength || is_low_chroma_strength) {
// Disable CDEF on chroma if we've disabled it on luma
diff --git a/av1/encoder/speed_features.h b/av1/encoder/speed_features.h
index 139a93fe30..3bcffb4d91 100644
--- a/av1/encoder/speed_features.h
+++ b/av1/encoder/speed_features.h
@@ -1566,7 +1566,7 @@ typedef struct LOOP_FILTER_SPEED_FEATURES {
// Decoder side speed feature for adaptive CDEF with strength reduction.
// Zero out values with low CDEF strengths (luma and/or chroma). This is
// done as CDEF is a relatively-expensive filter to compute during decode.
- // This speed feature is only enable in all intra mode.
+ // This speed feature is only enabled in all intra mode.
bool zero_low_cdef_strengths;
// Decoder side speed feature to add penalty for use of dual-sgr filters.