rtc: Alllow source_sad selectively for speed >= 10
Enable source_sad speed feature for speed >= 10,
but only selectively based on the current frame
avg_source_sad (running average) and the current QP.
The source_sad is used to condition the increase
in partition thresholds and usage of modeled_nonrd_cost.
Enabling it locally gets ~4% bdrate gain on desktop_ex2,
and ~2% on several other clips, and some clips have no change.
avg bdrate gain ~0.5% on rtc set, with --cdf-update-mode=2.
Speed slowdown measured on vga clips is ~2%.
Change-Id: I5aae2fa60f14182934da66b3d4bc7c761709f6bd
diff --git a/av1/encoder/speed_features.c b/av1/encoder/speed_features.c
index dc6c2ae..7fc4b3f 100644
--- a/av1/encoder/speed_features.c
+++ b/av1/encoder/speed_features.c
@@ -2056,6 +2056,12 @@
? 0
: cm->quant_params.base_qindex > qindex_thresh;
}
+ if (speed >= 10) {
+ sf->rt_sf.source_metrics_sb_nonrd =
+ (cm->quant_params.base_qindex > 150 && cpi->rc.avg_source_sad > 20000)
+ ? 1
+ : 0;
+ }
return;
}