[x265] [PATCH] TComYuv::copyPartToYuv, now using asm blockcopy_pp

praveen at multicorewareinc.com praveen at multicorewareinc.com
Wed Nov 13 13:59:37 CET 2013


# HG changeset patch
# User Praveen Tiwari
# Date 1384347567 -19800
# Node ID 6de9a634a13ec674a73e657666d5a8d909e6e68f
# Parent  7317f6d3680792951d74969fb2567dbe833b340f
TComYuv::copyPartToYuv, now using asm blockcopy_pp

diff -r 7317f6d36807 -r 6de9a634a13e source/Lib/TLibCommon/TComYuv.cpp
--- a/source/Lib/TLibCommon/TComYuv.cpp	Wed Nov 13 18:05:29 2013 +0530
+++ b/source/Lib/TLibCommon/TComYuv.cpp	Wed Nov 13 18:29:27 2013 +0530
@@ -209,11 +209,16 @@
 
 void TComYuv::copyPartToYuv(TComYuv* dstPicYuv, uint32_t partIdx)
 {
-    copyPartToLuma(dstPicYuv, partIdx);
-    copyPartToChroma(dstPicYuv, partIdx);
+    uint32_t height = dstPicYuv->getHeight();
+    uint32_t width = dstPicYuv->getWidth();
+
+    int part = partitionFromSizes(width, height);
+
+    copyPartToLuma(dstPicYuv, partIdx, part);
+    copyPartToChroma(dstPicYuv, partIdx, part);
 }
 
-void TComYuv::copyPartToLuma(TComYuv* dstPicYuv, uint32_t partIdx)
+void TComYuv::copyPartToLuma(TComYuv* dstPicYuv, uint32_t partIdx, uint32_t part)
 {
     Pel* src = getLumaAddr(partIdx);
     Pel* dst = dstPicYuv->getLumaAddr(0);
@@ -221,14 +226,10 @@
     uint32_t srcstride = getStride();
     uint32_t dststride = dstPicYuv->getStride();
 
-    uint32_t height = dstPicYuv->getHeight();
-    uint32_t width = dstPicYuv->getWidth();
-
-    int part = partitionFromSizes(width, height);
     primitives.luma_copy_pp[part](dst, dststride, src, srcstride);
 }
 
-void TComYuv::copyPartToChroma(TComYuv* dstPicYuv, uint32_t partIdx)
+void TComYuv::copyPartToChroma(TComYuv* dstPicYuv, uint32_t partIdx, uint32_t part)
 {
     Pel* srcU = getCbAddr(partIdx);
     Pel* srcV = getCrAddr(partIdx);
@@ -238,11 +239,8 @@
     uint32_t srcstride = getCStride();
     uint32_t dststride = dstPicYuv->getCStride();
 
-    uint32_t uiCHeight = dstPicYuv->getCHeight();
-    uint32_t uiCWidth = dstPicYuv->getCWidth();
-
-    primitives.blockcpy_pp(uiCWidth, uiCHeight, dstU, dststride, srcU, srcstride);
-    primitives.blockcpy_pp(uiCWidth, uiCHeight, dstV, dststride, srcV, srcstride);
+    primitives.chroma_copy_pp[part](dstU, dststride, srcU, srcstride);
+    primitives.chroma_copy_pp[part](dstV, dststride, srcV, srcstride);
 }
 
 void TComYuv::copyPartToPartYuv(TComYuv* dstPicYuv, uint32_t partIdx, uint32_t width, uint32_t height, bool bLuma, bool bChroma)
diff -r 7317f6d36807 -r 6de9a634a13e source/Lib/TLibCommon/TComYuv.h
--- a/source/Lib/TLibCommon/TComYuv.h	Wed Nov 13 18:05:29 2013 +0530
+++ b/source/Lib/TLibCommon/TComYuv.h	Wed Nov 13 18:29:27 2013 +0530
@@ -130,8 +130,8 @@
 
     //  Copy the part of Big YUV buffer to other Small YUV buffer
     void    copyPartToYuv(TComYuv* dstPicYuv, uint32_t srcPartIdx);
-    void    copyPartToLuma(TComYuv* dstPicYuv, uint32_t srcPartIdx);
-    void    copyPartToChroma(TComYuv* dstPicYuv, uint32_t srcPartIdx);
+    void    copyPartToLuma(TComYuv* dstPicYuv, uint32_t srcPartIdx, uint32_t part);
+    void    copyPartToChroma(TComYuv* dstPicYuv, uint32_t srcPartIdx, uint32_t part);
 
     //  Copy YUV partition buffer to other YUV partition buffer
     void    copyPartToPartYuv(TComYuv* dstPicYuv, uint32_t partIdx, uint32_t width, uint32_t height, bool bLuma = true, bool bChroma = true);


More information about the x265-devel mailing list