Use 64x64 SB size more aggressively
This patch makes the encoder use 64x64 superblock size more
aggressively:
Before: speed >= 2, low resolution
Now: speed >= 1, low and mid resolution(up to 480P)
This imporves both encoding quality and speed.
Quality gains(%):
speed 1 seed 2 speed 3 speed 4
lowres -0.17 - - -
midres -0.01 -0.01 -0.19 -0.23
Speed gains(%):
speed 1 seed 2 speed 3 speed 4
lowres 2.5 - - -
midres 1.5 1.2 2.4 2.5
STATS_CHANGED
Change-Id: I1cbf3aa1cf05ae8d4cb2eda07fb23e1c18c0a1b4
diff --git a/av1/encoder/encoder.c b/av1/encoder/encoder.c
index d2b9ab2..e33b36b 100644
--- a/av1/encoder/encoder.c
+++ b/av1/encoder/encoder.c
@@ -330,15 +330,13 @@
#endif
// When superres / resize is on, 'cm->width / height' can change between
- // calls, so we don't apply this heuristic there. Also, this heuristic gives
- // compression gain for speed >= 2 only.
- // Things break if superblock size changes per-frame which is why this
- // heuristic is set based on configured speed rather than actual
- // speed-features (which may change per-frame in future)
+ // calls, so we don't apply this heuristic there.
+ // Things break if superblock size changes between the first pass and second
+ // pass encoding, which is why this heuristic is not configured as a
+ // speed-feature.
if (cpi->oxcf.superres_mode == SUPERRES_NONE &&
- cpi->oxcf.resize_mode == RESIZE_NONE && cpi->oxcf.speed >= 2) {
- return (cm->width >= 480 && cm->height >= 360) ? BLOCK_128X128
- : BLOCK_64X64;
+ cpi->oxcf.resize_mode == RESIZE_NONE && cpi->oxcf.speed >= 1) {
+ return AOMMIN(cm->width, cm->height) > 480 ? BLOCK_128X128 : BLOCK_64X64;
}
return BLOCK_128X128;