File aom3.10-AV1E_SET_AUTO_TILES.patch of Package nodejs-electron
From 0b4b5b0ae81dca83d3d602e905732e2c82bd340d Mon Sep 17 00:00:00 2001
From: Sergey Silkin <ssilkin@webrtc.org>
Date: Fri, 30 Aug 2024 13:37:32 +0200
Subject: [PATCH] Use AV1E_SET_AUTO_TILES
Delegate control over number of times to encoder using AV1E_SET_AUTO_TILES that was added in https://aomedia-review.googlesource.com/c/aom/+/191102.
Bug: webrtc:351644568
Change-Id: I87ed11734e907c7f6c6508ac7389c84ececf5b21
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/361140
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Reviewed-by: Marco Paniconi <marpan@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42903}
---
.../codecs/av1/libaom_av1_encoder.cc | 16 +---------------
1 file changed, 1 insertion(+), 15 deletions(-)
diff --git a/modules/video_coding/codecs/av1/libaom_av1_encoder.cc b/modules/video_coding/codecs/av1/libaom_av1_encoder.cc
index db9238477d..c06792207e 100644
--- a/third_party/webrtc/modules/video_coding/codecs/av1/libaom_av1_encoder.cc
+++ b/third_party/webrtc/modules/video_coding/codecs/av1/libaom_av1_encoder.cc
@@ -307,21 +307,7 @@ int LibaomAv1Encoder::InitEncode(const VideoCodec* codec_settings,
SET_ENCODER_PARAM_OR_RETURN_ERROR(AV1E_SET_ENABLE_PALETTE, 0);
}
- if (cfg_.g_threads == 8) {
- // Values passed to AV1E_SET_TILE_ROWS and AV1E_SET_TILE_COLUMNS are log2()
- // based.
- // Use 4 tile columns x 2 tile rows for 8 threads.
- SET_ENCODER_PARAM_OR_RETURN_ERROR(AV1E_SET_TILE_ROWS, 1);
- SET_ENCODER_PARAM_OR_RETURN_ERROR(AV1E_SET_TILE_COLUMNS, 2);
- } else if (cfg_.g_threads == 4) {
- // Use 2 tile columns x 2 tile rows for 4 threads.
- SET_ENCODER_PARAM_OR_RETURN_ERROR(AV1E_SET_TILE_ROWS, 1);
- SET_ENCODER_PARAM_OR_RETURN_ERROR(AV1E_SET_TILE_COLUMNS, 1);
- } else {
- SET_ENCODER_PARAM_OR_RETURN_ERROR(AV1E_SET_TILE_COLUMNS,
- static_cast<int>(log2(cfg_.g_threads)));
- }
-
+ SET_ENCODER_PARAM_OR_RETURN_ERROR(AV1E_SET_AUTO_TILES, 1);
SET_ENCODER_PARAM_OR_RETURN_ERROR(AV1E_SET_ROW_MT, 1);
SET_ENCODER_PARAM_OR_RETURN_ERROR(AV1E_SET_ENABLE_OBMC, 0);
SET_ENCODER_PARAM_OR_RETURN_ERROR(AV1E_SET_NOISE_SENSITIVITY, 0);