[x265] [PATCH 3 of 3] MotionReference objects with distinct weights handled as linked list

deepthidevaki at multicorewareinc.com deepthidevaki at multicorewareinc.com
Tue Jul 30 13:39:51 CEST 2013


# HG changeset patch
# User Deepthi Devaki
# Date 1375184226 -19800
# Node ID e3ab4a7575dcb2f8f6129b70dc679b3a3dc6fe7a
# Parent  25b74f97e87324d065c10a25d2c5ee85b1db4792
MotionReference objects with distinct weights handled as linked list

diff -r 25b74f97e873 -r e3ab4a7575dc source/Lib/TLibCommon/TComPicYuv.cpp
--- a/source/Lib/TLibCommon/TComPicYuv.cpp	Tue Jul 30 16:55:53 2013 +0530
+++ b/source/Lib/TLibCommon/TComPicYuv.cpp	Tue Jul 30 17:07:06 2013 +0530
@@ -229,21 +229,40 @@
     ::memcpy(destPicYuv->getBufV(), m_picBufV, sizeof(Pel) * ((m_picWidth >> 1) + (m_chromaMarginX << 1)) * ((m_picHeight >> 1) + (m_chromaMarginY << 1)));
 }
 
-Void TComPicYuv::extendPicBorder(x265::ThreadPool *pool)
+x265::MotionReference * TComPicYuv::getMotionReference(int weight)
 {
-    if (m_bIsBorderExtended)
+    MotionReference *temp;
+    for(temp = m_refList; temp!=NULL; temp = temp->m_next)
+    {
+        if(temp->m_weight == weight)
+        {
+            return(temp);
+        }
+    }
+    return NULL;
+}
+
+Void TComPicYuv::extendPicBorder(x265::ThreadPool *pool, wpScalingParam *w)
+{
+    int weight = (w==NULL)? 0: w->inputWeight;          // Assuming weight ==0 to represent the unweighted frames
+    if (getMotionReference(weight)!=NULL)
+    {
         return;
+    }
 
-    /* HPEL generation requires luma integer plane to already be extended */
-    xExtendPicCompBorder(getLumaAddr(), getStride(), getWidth(), getHeight(), m_lumaMarginX, m_lumaMarginY);
+    if(!m_bIsBorderExtended)
+    {
+        /* HPEL generation requires luma integer plane to already be extended */
+        xExtendPicCompBorder(getLumaAddr(), getStride(), getWidth(), getHeight(), m_lumaMarginX, m_lumaMarginY);
 
-    xExtendPicCompBorder(getCbAddr(), getCStride(), getWidth() >> 1, getHeight() >> 1, m_chromaMarginX, m_chromaMarginY);
-    xExtendPicCompBorder(getCrAddr(), getCStride(), getWidth() >> 1, getHeight() >> 1, m_chromaMarginX, m_chromaMarginY);
+        xExtendPicCompBorder(getCbAddr(), getCStride(), getWidth() >> 1, getHeight() >> 1, m_chromaMarginX, m_chromaMarginY);
+        xExtendPicCompBorder(getCrAddr(), getCStride(), getWidth() >> 1, getHeight() >> 1, m_chromaMarginX, m_chromaMarginY);
+    }
 
-    if (m_refList == NULL)
-        m_refList = new x265::MotionReference(this, pool);
-    m_refList->generateReferencePlanes();
-
+    MotionReference *temp = new x265::MotionReference(this, pool, w);
+    temp->generateReferencePlanes();
+    temp->m_next = m_refList;
+    m_refList = temp;
     m_bIsBorderExtended = true;
 }
 
diff -r 25b74f97e873 -r e3ab4a7575dc source/Lib/TLibCommon/TComPicYuv.h
--- a/source/Lib/TLibCommon/TComPicYuv.h	Tue Jul 30 16:55:53 2013 +0530
+++ b/source/Lib/TLibCommon/TComPicYuv.h	Tue Jul 30 17:07:06 2013 +0530
@@ -153,7 +153,7 @@
     Pel*  getCrAddr()     { return m_picOrgV; }
 
     /* Actual weight handling TBD: this is just a placeholder.  Always pass 0 */
-    x265::MotionReference *getMotionReference(Int weightIdx) { return &m_refList[weightIdx]; }
+    x265::MotionReference *getMotionReference(Int weightIdx); 
 
     //  Access starting position of original picture for specific coding unit (CU) or partition unit (PU)
     Pel*  getLumaAddr(Int cuAddr) { return m_picOrgY + m_cuOffsetY[cuAddr]; }
@@ -169,9 +169,9 @@
     Pel*  getCrAddr(Int cuAddr, Int absZOrderIdx) { return m_picOrgV + m_cuOffsetC[cuAddr] + m_buOffsetC[g_zscanToRaster[absZOrderIdx]]; }
 
     /* Access functions for m_filteredBlock */
-    Pel* getLumaFilterBlock(int ver, int hor) { return (Pel*)m_refList->m_lumaPlane[hor][ver]; }
+    Pel* getLumaFilterBlock(int ver, int hor, int weight=0) { return (Pel*)getMotionReference(weight)->m_lumaPlane[hor][ver]; }
 
-    Pel* getLumaFilterBlock(int ver, int hor, Int cuAddr, Int absZOrderIdx) { return (Pel*)m_refList->m_lumaPlane[hor][ver] + m_cuOffsetY[cuAddr] + m_buOffsetY[g_zscanToRaster[absZOrderIdx]]; }
+    Pel* getLumaFilterBlock(int ver, int hor, Int cuAddr, Int absZOrderIdx, int weight=0) { return (Pel*)getMotionReference(weight)->m_lumaPlane[hor][ver] + m_cuOffsetY[cuAddr] + m_buOffsetY[g_zscanToRaster[absZOrderIdx]]; }
 
     // ------------------------------------------------------------------------------------------------
     //  Miscellaneous
@@ -185,7 +185,7 @@
     Void  copyFromPicture(const x265_picture_t&);
 
     //  Extend function of picture buffer
-    Void  extendPicBorder(x265::ThreadPool *pool);
+    Void  extendPicBorder(x265::ThreadPool *pool, wpScalingParam *w=NULL);
 
     //  Dump picture
     Void  dump(Char* pFileName, Bool bAdd = false);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: x265-3.patch
Type: text/x-patch
Size: 4582 bytes
Desc: not available
URL: <http://mailman.videolan.org/private/x265-devel/attachments/20130730/fd37072d/attachment.bin>


More information about the x265-devel mailing list