[x265] [PATCH] framedata: rely on thread pool getNumaNodeCount() and m_numaNode to work
Steve Borho
steve at borho.org
Tue Aug 4 05:40:22 CEST 2015
# HG changeset patch
# User Steve Borho <steve at borho.org>
# Date 1438659560 18000
# Mon Aug 03 22:39:20 2015 -0500
# Node ID a1b90e16cf25cb08f63866357566d0164f404cc9
# Parent 642e40276ab81696f5a6b342d8d71345f4e58339
framedata: rely on thread pool getNumaNodeCount() and m_numaNode to work
diff -r 642e40276ab8 -r a1b90e16cf25 source/common/framedata.cpp
--- a/source/common/framedata.cpp Mon Aug 03 22:22:04 2015 -0500
+++ b/source/common/framedata.cpp Mon Aug 03 22:39:20 2015 -0500
@@ -46,11 +46,7 @@
m_param = ¶m;
m_slice = new Slice;
m_picCTU = new CUData[sps.numCUsInFrame];
-#if (defined(_WIN32_WINNT) && _WIN32_WINNT >= _WIN32_WINNT_WIN7) || HAVE_LIBNUMA
m_nodes = new PerNodeRecon[ThreadPool::getNumaNodeCount()];
-#else
- m_nodes = new PerNodeRecon[1];
-#endif
m_cuMemPool.create(0, param.internalCsp, sps.numCUsInFrame);
for (uint32_t ctuAddr = 0; ctuAddr < sps.numCUsInFrame; ctuAddr++)
@@ -69,12 +65,8 @@
{
memset(m_cuStat, 0, sps.numCUsInFrame * sizeof(*m_cuStat));
memset(m_rowStat, 0, sps.numCuInHeight * sizeof(*m_rowStat));
-#if (defined(_WIN32_WINNT) && _WIN32_WINNT >= _WIN32_WINNT_WIN7) || HAVE_LIBNUMA
for (int i = 0; i < ThreadPool::getNumaNodeCount(); i++)
m_nodes[i].rows = 0;
-#else
- m_nodes->rows = 0;
-#endif
}
bool FrameData::allocRecon(const SPS& sps, int node)
diff -r 642e40276ab8 -r a1b90e16cf25 source/common/framedata.h
--- a/source/common/framedata.h Mon Aug 03 22:22:04 2015 -0500
+++ b/source/common/framedata.h Mon Aug 03 22:39:20 2015 -0500
@@ -167,16 +167,12 @@
inline CUData* getPicCTU(uint32_t ctuAddr) { return &m_picCTU[ctuAddr]; }
-#if (defined(_WIN32_WINNT) && _WIN32_WINNT >= _WIN32_WINNT_WIN7) || HAVE_LIBNUMA
/* this function should only be called by worker threads which are encoding this particular
* frame. workers which are using this frame as a motion reference should use their slice's
* m_refReconPicList[][] array instead. Its pointers will always reference a buffer which
* was allocated on their local socket */
/* TODO: X265_CHECK that current node == m_ownerNode */
inline PicYuv* getOutputRecon() { return m_nodes[m_ownerNode].reconPic; }
-#else
- inline PicYuv* getOutputRecon() { return m_nodes->reconPic; }
-#endif
};
}
diff -r 642e40276ab8 -r a1b90e16cf25 source/encoder/frameencoder.cpp
--- a/source/encoder/frameencoder.cpp Mon Aug 03 22:22:04 2015 -0500
+++ b/source/encoder/frameencoder.cpp Mon Aug 03 22:39:20 2015 -0500
@@ -329,13 +329,8 @@
if (m_frame->m_lowres.bKeyframe && m_param->bRepeatHeaders)
m_top->getStreamHeaders(m_nalList, m_entropyCoder, m_bs);
-#if (defined(_WIN32_WINNT) && _WIN32_WINNT >= _WIN32_WINNT_WIN7) || HAVE_LIBNUMA
+ /* Claim this frame as being encoded by this NUMA node */
int numaNode = m_pool ? m_pool->m_numaNode : 0;
-#else
- int numaNode = 0;
-#endif
-
- /* Claim this frame as being encoded by this NUMA node */
m_frame->m_encData->allocRecon(m_top->m_sps, numaNode); /* TODO: bail if failure */
m_frame->m_encData->m_ownerNode = numaNode;
More information about the x265-devel
mailing list