[x265] [PATCH] TcomPridiction : IP calculation for a Block and modified the src buffer

Gopu Govindaswamy gopu at multicorewareinc.com
Thu Aug 29 11:14:57 CEST 2013


# HG changeset patch
# User Gopu Govindaswamy <gopu at multicorewareinc.com>
# Date 1377767678 -19800
# Node ID 2eb14efb13876ae9b555110cabcf6e6e47dabdea
# Parent  77d92ca1d18332da920f399b5ccc3902a91d4198
TcomPridiction : IP calculation for a Block and modified the src buffer

diff -r 77d92ca1d183 -r 2eb14efb1387 source/Lib/TLibCommon/TComPrediction.cpp
--- a/source/Lib/TLibCommon/TComPrediction.cpp	Thu Aug 29 02:01:23 2013 -0500
+++ b/source/Lib/TLibCommon/TComPrediction.cpp	Thu Aug 29 14:44:38 2013 +0530
@@ -474,10 +474,34 @@
     Int yFrac = mv->y & 0x3;
     TComPicYuv* pic = cu->getSlice()->getPic()->getPicYuvOrg();
     Int blkOffset = pic->getLumaAddr(cu->getAddr(), cu->getZorderIdxInCU() + partAddr) - pic->getLumaAddr();
-    Pel* src = ref->lumaPlane[xFrac][yFrac] + blkOffset + refOffset;
+    Pel* src = ref->m_reconPic->getLumaAddr() + blkOffset + refOffset;
     Int srcStride = refStride;
 
-    x265::primitives.blockcpy_pp(width, height, dst, dstStride, src, srcStride);
+    if (yFrac == 0)
+    {
+        if (xFrac != 0)
+        {
+            x265::primitives.ipfilter_pp[FILTER_H_P_P_8]((pixel*)src, refStride, (pixel*)dst, dstStride, width, height, g_lumaFilter[xFrac]);
+        }
+        else
+        {
+            x265::primitives.blockcpy_pp(width, height, dst, dstStride, src, srcStride);
+        }
+    }
+    else if (xFrac == 0)
+    {
+        x265::primitives.ipfilter_pp[FILTER_H_P_P_8]((pixel*)src, refStride, (pixel*)dst, dstStride, width, height, g_lumaFilter[yFrac]);
+    }
+    else
+    {
+        Int tmpStride = width;
+        Int filterSize = NTAPS_LUMA;
+        Int halfFilterSize = (filterSize >> 1);
+        Short *tmp    = (Short*)malloc(width * (height + filterSize - 1) * sizeof(Short));
+        primitives.ipfilter_ps[FILTER_H_P_S_8]((pixel*)src - (halfFilterSize - 1) * refStride,  refStride, tmp, tmpStride, width, height + filterSize - 1, g_lumaFilter[xFrac]);
+        primitives.ipfilter_sp[FILTER_V_S_P_8](tmp + (halfFilterSize - 1) * tmpStride, tmpStride, (pixel*)dst, dstStride, width, height, g_lumaFilter[yFrac]);
+        free(tmp);
+    }
 }
 
 //Motion compensated block for biprediction
diff -r 77d92ca1d183 -r 2eb14efb1387 source/common/reference.h
--- a/source/common/reference.h	Thu Aug 29 02:01:23 2013 -0500
+++ b/source/common/reference.h	Thu Aug 29 14:44:38 2013 +0530
@@ -64,6 +64,7 @@
     void generateReferencePlanes();
 
     MotionReference *m_next;
+    TComPicYuv  *m_reconPic;
 
 protected:
 
@@ -71,7 +72,6 @@
     void generateReferencePlane(const int idx);
 
     intptr_t     m_startPad;
-    TComPicYuv  *m_reconPic;
     volatile int m_workerCount;
     volatile int m_finishedPlanes;
     Event        m_completionEvent;


More information about the x265-devel mailing list