[x265] [PATCH] blockcpy_sp replaced with asm code

praveen at multicorewareinc.com praveen at multicorewareinc.com
Wed Nov 13 13:09:57 CET 2013


# HG changeset patch
# User Praveen Tiwari
# Date 1384344581 -19800
# Node ID 16daee5e879e6a3b269fb79301dba60f8809543c
# Parent  c0da70471ba63f052bd0e0cdf81af3d0ca9150a4
blockcpy_sp replaced with asm code

diff -r c0da70471ba6 -r 16daee5e879e source/Lib/TLibCommon/TComYuv.cpp
--- a/source/Lib/TLibCommon/TComYuv.cpp	Wed Nov 13 16:09:00 2013 +0530
+++ b/source/Lib/TLibCommon/TComYuv.cpp	Wed Nov 13 17:39:41 2013 +0530
@@ -255,10 +255,12 @@
 
 void TComYuv::copyPartToPartYuv(TShortYUV* dstPicYuv, uint32_t partIdx, uint32_t width, uint32_t height, bool bLuma, bool bChroma)
 {
+    int part = partitionFromSizes(width, height);
+
     if (bLuma)
-        copyPartToPartLuma(dstPicYuv, partIdx, width, height);
+        copyPartToPartLuma(dstPicYuv, partIdx, part);
     if (bChroma)
-        copyPartToPartChroma(dstPicYuv, partIdx, width >> m_hChromaShift, height >> m_vChromaShift);
+        copyPartToPartChroma(dstPicYuv, partIdx, part);
 }
 
 void TComYuv::copyPartToPartLuma(TComYuv* dstPicYuv, uint32_t partIdx, uint32_t part)
@@ -274,7 +276,7 @@
     primitives.luma_copy_pp[part](dst, dststride, src, srcstride);
 }
 
-void TComYuv::copyPartToPartLuma(TShortYUV* dstPicYuv, uint32_t partIdx, uint32_t width, uint32_t height)
+void TComYuv::copyPartToPartLuma(TShortYUV* dstPicYuv, uint32_t partIdx, uint32_t part)
 {
     Pel* src = getLumaAddr(partIdx);
     int16_t* dst = dstPicYuv->getLumaAddr(partIdx);
@@ -282,7 +284,6 @@
     uint32_t  srcstride = getStride();
     uint32_t  dststride = dstPicYuv->m_width;
 
-    int part = partitionFromSizes(width, height);
     primitives.luma_copy_ps[part](dst, dststride, src, srcstride);
 }
 
@@ -302,7 +303,7 @@
     primitives.chroma_copy_pp[part](dstV, dststride, srcV, srcstride);
 }
 
-void TComYuv::copyPartToPartChroma(TShortYUV* dstPicYuv, uint32_t partIdx, uint32_t width, uint32_t height)
+void TComYuv::copyPartToPartChroma(TShortYUV* dstPicYuv, uint32_t partIdx, uint32_t part)
 {
     Pel*   srcU = getCbAddr(partIdx);
     Pel*   srcV = getCrAddr(partIdx);
@@ -312,8 +313,8 @@
     uint32_t srcstride = getCStride();
     uint32_t dststride = dstPicYuv->m_cwidth;
 
-    primitives.blockcpy_sp(width, height, dstU, dststride, srcU, srcstride);
-    primitives.blockcpy_sp(width, height, dstV, dststride, srcV, srcstride);
+    primitives.chroma_copy_ps[part](dstU, dststride, srcU, srcstride);
+    primitives.chroma_copy_ps[part](dstV, dststride, srcV, srcstride);
 }
 
 void TComYuv::copyPartToPartChroma(TComYuv* dstPicYuv, uint32_t partIdx, uint32_t width, uint32_t height, uint32_t chromaId)
diff -r c0da70471ba6 -r 16daee5e879e source/Lib/TLibCommon/TComYuv.h
--- a/source/Lib/TLibCommon/TComYuv.h	Wed Nov 13 16:09:00 2013 +0530
+++ b/source/Lib/TLibCommon/TComYuv.h	Wed Nov 13 17:39:41 2013 +0530
@@ -137,9 +137,9 @@
     void    copyPartToPartYuv(TComYuv* dstPicYuv, uint32_t partIdx, uint32_t width, uint32_t height, bool bLuma = true, bool bChroma = true);
     void    copyPartToPartYuv(TShortYUV* dstPicYuv, uint32_t partIdx, uint32_t width, uint32_t height, bool bLuma = true, bool bChroma = true);
     void    copyPartToPartLuma(TComYuv* dstPicYuv, uint32_t partIdx, uint32_t part);
-    void    copyPartToPartLuma(TShortYUV* dstPicYuv, uint32_t partIdx, uint32_t width, uint32_t height);
+    void    copyPartToPartLuma(TShortYUV* dstPicYuv, uint32_t partIdx, uint32_t part);
     void    copyPartToPartChroma(TComYuv* dstPicYuv, uint32_t partIdx, uint32_t part);
-    void    copyPartToPartChroma(TShortYUV* dstPicYuv, uint32_t partIdx, uint32_t width, uint32_t height);
+    void    copyPartToPartChroma(TShortYUV* dstPicYuv, uint32_t partIdx, uint32_t part);
 
     void    copyPartToPartChroma(TComYuv* dstPicYuv, uint32_t partIdx, uint32_t width, uint32_t height, uint32_t chromaId);
     void    copyPartToPartChroma(TShortYUV* dstPicYuv, uint32_t partIdx, uint32_t width, uint32_t height, uint32_t chromaId);
diff -r c0da70471ba6 -r 16daee5e879e source/Lib/TLibEncoder/TEncSearch.cpp
--- a/source/Lib/TLibEncoder/TEncSearch.cpp	Wed Nov 13 16:09:00 2013 +0530
+++ b/source/Lib/TLibEncoder/TEncSearch.cpp	Wed Nov 13 17:39:41 2013 +0530
@@ -1121,13 +1121,14 @@
         ::memcpy(coeffDstV, coeffSrcV, sizeof(TCoeff) * numCoeffC);
     }
 
+    int part = partitionFromSizes(1 << trSizeLog2, 1 << trSizeLog2);
+
     //===== copy reconstruction =====
-    m_qtTempTransformSkipTComYuv.copyPartToPartLuma(&m_qtTempTComYuv[qtlayer], absPartIdx, 1 << trSizeLog2, 1 << trSizeLog2);
+    m_qtTempTransformSkipTComYuv.copyPartToPartLuma(&m_qtTempTComYuv[qtlayer], absPartIdx, part);
 
     if (!bLumaOnly && !bSkipChroma)
     {
-        uint32_t trSizeCLog2 = (bChromaSame ? trSizeLog2 : trSizeLog2 - 1);
-        m_qtTempTransformSkipTComYuv.copyPartToPartChroma(&m_qtTempTComYuv[qtlayer], absPartIdx, 1 << trSizeCLog2, 1 << trSizeCLog2);
+        m_qtTempTransformSkipTComYuv.copyPartToPartChroma(&m_qtTempTComYuv[qtlayer], absPartIdx, part);
     }
 
     uint32_t   zOrder           = cu->getZorderIdxInCU() + absPartIdx;


More information about the x265-devel mailing list