[x265] [PATCH] aq : bug fix . extend border of TComPic::m_origPicYuv to a multiple of 16

Aarthi Thirumalai aarthi at multicorewareinc.com
Wed Nov 6 11:33:42 CET 2013


# HG changeset patch
# User Aarthi Thirumalai
# Date 1383734012 -19800
#      Wed Nov 06 16:03:32 2013 +0530
# Node ID 6b725179b61564df5b4eb497f783b193dcbda1e9
# Parent  21e08cf159c552ff98334c98070b9cd442aaff27
aq : bug fix . extend border of TComPic::m_origPicYuv to a multiple of 16

diff -r 21e08cf159c5 -r 6b725179b615 source/Lib/TLibCommon/TComPicYuv.cpp
--- a/source/Lib/TLibCommon/TComPicYuv.cpp	Wed Nov 06 15:43:19 2013 +0530
+++ b/source/Lib/TLibCommon/TComPicYuv.cpp	Wed Nov 06 16:03:32 2013 +0530
@@ -431,10 +431,12 @@
         uint8_t *v = (uint8_t*)pic.planes[2];
 
         /* width and height - without padsize */
-        int width = (m_picWidth * (pic.bitDepth > 8 ? 2 : 1)) - padx;
-        int height = m_picHeight - pady;
-
-        // copy pixels by row into encoder's buffer
+         int width = (m_picWidth * (pic.bitDepth > 8 ? 2 : 1)) - padx;
+         int height = m_picHeight - pady;
+         uint8_t rem = m_picWidth % 16;
+         padx += rem ? 16 - rem : 0;
+         rem = m_picHeight % 16;
+         pady += rem ? 16 - rem : 0;
         for (int r = 0; r < height; r++)
         {
             memcpy(Y, y, width);
diff -r 21e08cf159c5 -r 6b725179b615 source/common/lowres.cpp
--- a/source/common/lowres.cpp	Wed Nov 06 15:43:19 2013 +0530
+++ b/source/common/lowres.cpp	Wed Nov 06 16:03:32 2013 +0530
@@ -150,31 +150,6 @@
         intraMbs[i] = 0;
     }
 
-    int y, extWidth = (orig->getWidth() + X265_LOWRES_CU_SIZE - 1);
-    int srcStride = orig->getStride();
-    int srcHeight = orig->getHeight();
-    int srcWidth  = orig->getWidth();
-    Pel *src;
-    src = orig->getLumaAddr();
-
-    /* extending right margin */
-    if (2 * width > srcWidth)
-    {
-        for (y = 0; y < srcHeight; y++)
-        {
-            ::memset(src + srcWidth, src[srcWidth - 1], sizeof(Pel) * (X265_LOWRES_CU_SIZE - 1));
-            src += srcStride;
-        }
-    }
-
-    /* extending bottom margin */
-    src = orig->getLumaAddr() + (srcHeight - 1) * srcStride;
-
-    for (y = 1; y <= 2 * lines - srcHeight; y++)
-    {
-        ::memcpy(src + y * srcStride, src, sizeof(Pel) * (extWidth));
-    }
-
     /* downscale and generate 4 HPEL planes for lookahead */
     primitives.frame_init_lowres_core(orig->getLumaAddr(),
                                       lowresPlane[0], lowresPlane[1], lowresPlane[2], lowresPlane[3],


More information about the x265-devel mailing list