[x265] Subject: [PATCH] TME: Move setSourcePU earlier to fix segfault
Somu Vineela
somu at multicorewareinc.com
Wed May 6 07:46:00 UTC 2026
>From 8d3a533f69798b1f037fd63634099d2c6ef5d449 Mon Sep 17 00:00:00 2001
From: somuvineela <somu at multicorewareinc.com>
Date: Tue, 5 May 2026 17:38:10 +0530
Subject: [PATCH] TME: Move setSourcePU() earlier to fix segfault
---
source/encoder/search.cpp | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/source/encoder/search.cpp b/source/encoder/search.cpp
index cb5c276da..057c1bbec 100644
--- a/source/encoder/search.cpp
+++ b/source/encoder/search.cpp
@@ -277,6 +277,10 @@ void Search::puMotionEstimation(const Slice* slice, const CUGeom& cuGeom, CUData
const MV* amvp = zeroMV;
int mvpIdx = 0;
+ PicYuv* recon = slice->m_mref[list][ref].reconPic;
+ int offset = recon->getLumaAddr(cu.m_cuAddr, pu.cuAbsPartIdx + pu.puAbsPartIdx) - recon->getLumaAddr(0);
+ m_me.setSourcePU(fencPic->m_picOrg[0], fencPic->m_stride, offset, pu.width, pu.height, m_param->searchMethod, m_param->subpelRefine);
+
bool bLowresMVP = false;
if (!isMVP)
{
@@ -345,16 +349,12 @@ void Search::puMotionEstimation(const Slice* slice, const CUGeom& cuGeom, CUData
}
}
- PicYuv* recon = slice->m_mref[list][ref].reconPic;
- int offset = recon->getLumaAddr(cu.m_cuAddr, pu.cuAbsPartIdx + pu.puAbsPartIdx) - recon->getLumaAddr(0);
-
if (m_param->searchMethod == X265_SEA)
{
for (int planes = 0; planes < INTEGRAL_PLANE_NUM; planes++)
m_me.integral[planes] = slice->m_refFrameList[list][ref]->m_encData->m_meIntegral[planes] + offset;
}
- m_me.setSourcePU(fencPic->m_picOrg[0], fencPic->m_stride, offset, pu.width, pu.height, m_param->searchMethod, m_param->subpelRefine);
setSearchRange(cu, mvp, searchRange, mvmin, mvmax);
if (isMVP)
--
2.43.0.windows.1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20260506/2cae33a1/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tme_move_setsourcepu_eariler.diff
Type: application/octet-stream
Size: 2004 bytes
Desc: tme_move_setsourcepu_eariler.diff
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20260506/2cae33a1/attachment.obj>
More information about the x265-devel
mailing list