[x265] [PATCH] perf(tme): tune tme parameters for presets 6-9

Shashank Pathipati shashank.pathipati at multicorewareinc.com
Mon Mar 9 08:43:46 UTC 2026


>From e355a1ef155922e5ba864bf7a6d7f793f34201a2 Mon Sep 17 00:00:00 2001
From: Shashank Pathipati <shashank.pathipati at multicorewareinc.com>
Date: Fri, 6 Mar 2026 20:02:34 +0530
Subject: [PATCH] perf(tme): tune tme parameters for presets 6-9

---
 source/common/threadpool.cpp | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/source/common/threadpool.cpp b/source/common/threadpool.cpp
index 1c4f4ed15..43b1a7312 100644
--- a/source/common/threadpool.cpp
+++ b/source/common/threadpool.cpp
@@ -831,7 +831,9 @@ int ThreadPool::configureTmeThreadCount(x265_param* param, int cpuCount)

     enum TmeRule
     {
-        TME_RULE_FAST_MEDIUM_SLOW = 0,
+        TME_RULE_SLOWER_VERYSLOW = 0,
+        TME_RULE_SLOW,
+        TME_RULE_FAST_MEDIUM,
         TME_RULE_FASTER,
         TME_RULE_VERYFAST,
         TME_RULE_SUPERFAST,
@@ -849,7 +851,9 @@ int ThreadPool::configureTmeThreadCount(x265_param* param, int cpuCount)

     static const TmeRuleConfig s_tmeRuleConfig[TME_RULE_COUNT] =
     {
-        { { 1, 1, 1 }, { 10, 10, 10 }, { 90, 80, 70 }, false }, // fast / medium and slower presets
+        { { 1, 1, 1 }, { 3, 3, 3 }, { 90, 85, 70 }, false }, // slower / veryslow preset and similar options
+        { { 1, 1, 1 }, { 5, 5, 3 }, { 90, 85, 75 }, false }, // slow preset and similar options
+        { { 1, 1, 1 }, { 10, 10, 10 }, { 90, 80, 70 }, false }, // fast / medium preset and similar options
         { { 1, 1, 1 }, { 10, 15, 10 }, { 90, 80, 70 }, false }, // faster preset and similar options
         { { 1, 1, 1 }, { 10, 15, 20 }, { 90, 80, 70 }, false }, // veryfast preset and similar options
         { { 2, 4, 4 }, { 10, 15, 20 }, { 90, 80, 60 }, false }, // superfast preset and similar options
@@ -861,6 +865,8 @@ int ThreadPool::configureTmeThreadCount(x265_param* param, int cpuCount)

     const bool ruleMatches[TME_RULE_COUNT] =
     {
+        param->maxNumReferences >= 5 || param->subpelRefine >= 4 || (param->bEnableRectInter && param->bEnableAMP),
+        param->maxNumReferences >= 4 || param->subpelRefine >= 3 || (param->bEnableRectInter ^ param->bEnableAMP),
         param->maxNumReferences >= 3 && param->subpelRefine >= 2,
         param->maxNumReferences >= 2 && param->subpelRefine >= 2,
         param->subpelRefine >= 1 && param->bframes > 3,
--
2.52.0.windows.1



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20260309/f9846c16/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-perf-tme-tune-tme-parameters-for-presets-6-9.patch
Type: application/octet-stream
Size: 2344 bytes
Desc: 0001-perf-tme-tune-tme-parameters-for-presets-6-9.patch
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20260309/f9846c16/attachment.obj>


More information about the x265-devel mailing list