[x265] [PATCH] Relaxing frame-thread constraint in mcstf

Anusuya Kumarasamy anusuya.kumarasamy at multicorewareinc.com
Fri Oct 3 03:24:32 UTC 2025


>From b7eb56503d80fc77610e1a88a3f69423e737267a Mon Sep 17 00:00:00 2001
From: AnusuyaKumarasamy <anusuya.kumarasamy at multicorewareinc.com>
Date: Sun, 28 Sep 2025 20:59:31 +0530
Subject: [PATCH] Relaxing frame-thread constraint in mcstf

---
 source/common/param.cpp    | 5 -----
 source/encoder/encoder.cpp | 2 +-
 2 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/source/common/param.cpp b/source/common/param.cpp
index c06862b9e..e22f51a76 100755
--- a/source/common/param.cpp
+++ b/source/common/param.cpp
@@ -1978,11 +1978,6 @@ int x265_check_params(x265_param* param)
         param->bSingleSeiNal = 0;
         x265_log(param, X265_LOG_WARNING, "None of the SEI messages are enabled. Disabling Single SEI NAL\n");
     }
-    if (param->bEnableTemporalFilter && (param->frameNumThreads != 1))
-    {
-        param->bEnableTemporalFilter = 0;
-        x265_log(param, X265_LOG_WARNING, "MCSTF can be enabled with frame thread = 1 only. Disabling MCSTF\n");
-    }
     CHECK(param->confWinRightOffset < 0, "Conformance Window Right Offset must be 0 or greater");
     CHECK(param->confWinBottomOffset < 0, "Conformance Window Bottom Offset must be 0 or greater");
     CHECK(param->decoderVbvMaxRate < 0, "Invalid Decoder Vbv Maxrate. Value can not be less than zero");
diff --git a/source/encoder/encoder.cpp b/source/encoder/encoder.cpp
index 44a09baf3..7b919d263 100644
--- a/source/encoder/encoder.cpp
+++ b/source/encoder/encoder.cpp
@@ -1831,7 +1831,7 @@ int Encoder::encode(const x265_picture* pic_in, x265_picture* pic_out)
             if (!m_pocLast)
             {
                 /*One shot allocation of frames in OriginalPictureBuffer*/
-                int numFramesinOPB = X265_MAX(m_param->bframes, (inFrame[0]->m_mcstf->m_range << 1)) + 1;
+                int numFramesinOPB = X265_MAX(m_param->bframes, m_param->frameNumThreads) + 2;
                 for (int i = 0; i < numFramesinOPB; i++)
                 {
                     Frame* dupFrame = new Frame;
--
2.45.2


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20251003/00708014/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Relaxing-frame-thread-constraint-in-mcstf.patch
Type: application/octet-stream
Size: 2010 bytes
Desc: 0001-Relaxing-frame-thread-constraint-in-mcstf.patch
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20251003/00708014/attachment.obj>


More information about the x265-devel mailing list