[x265] [PATCH] tcompicyuv: improvement for Extend the right if width is not multiple of min CU size

Gopu Govindaswamy gopu at multicorewareinc.com
Thu Nov 7 10:01:22 CET 2013


# HG changeset patch
# User Gopu Govindaswamy <gopu at multicorewareinc.com>
# Date 1383814865 -19800
# Node ID f30069d6c965d6c30784393576746625d8abd698
# Parent  ed1b1a7b0b38c347fb0b8e6303f1fddab5a7260b
tcompicyuv: improvement for Extend the right if width is not multiple of min CU size

diff -r ed1b1a7b0b38 -r f30069d6c965 source/Lib/TLibCommon/TComPicYuv.cpp
--- a/source/Lib/TLibCommon/TComPicYuv.cpp	Thu Nov 07 13:05:53 2013 +0530
+++ b/source/Lib/TLibCommon/TComPicYuv.cpp	Thu Nov 07 14:31:05 2013 +0530
@@ -354,6 +354,10 @@
                 Y[c] = (Pel)y[c];
             }
 
+            for (int x = 0; x < padx; x++)
+            {
+                Y[width + x] = Y[width - 1];
+            }
             Y += getStride();
             y += pic.stride[0];
         }
@@ -366,43 +370,17 @@
                 V[c] = (Pel)v[c];
             }
 
+            for (int x = 0; x < padx >> m_hChromaShift; x++)
+            {
+                U[(width >> m_hChromaShift) + x] = U[(width >> m_hChromaShift) - 1];
+                V[(width >> m_hChromaShift) + x] = V[(width >> m_hChromaShift) - 1];
+            }
             U += getCStride();
             V += getCStride();
             u += pic.stride[1];
             v += pic.stride[2];
         }
 
-        /* Extend the right if width is not multiple of minimum CU size */
-
-        if (padx)
-        {
-            Y = getLumaAddr();
-            U = getCbAddr();
-            V = getCrAddr();
-
-            for (int r = 0; r < height; r++)
-            {
-                for (int x = 0; x < padx; x++)
-                {
-                    Y[width + x] = Y[width - 1];
-                }
-
-                Y += getStride();
-            }
-
-            for (int r = 0; r < height >> m_vChromaShift; r++)
-            {
-                for (int x = 0; x < padx >> m_hChromaShift; x++)
-                {
-                    U[(width >> m_hChromaShift) + x] = U[(width >> m_hChromaShift) - 1];
-                    V[(width >> m_hChromaShift) + x] = V[(width >> m_hChromaShift) - 1];
-                }
-
-                U += getCStride();
-                V += getCStride();
-            }
-        }
-
         /* extend the bottom if height is not multiple of the minimum CU size */
         if (pady)
         {
@@ -441,6 +419,10 @@
                 Y[c] = (Pel)y[c];
             }
 
+            for (int x = 0; x < padx; x++)
+            {
+                Y[width + x] = Y[width - 1];
+            }
             Y += getStride();
             y += pic.stride[0];
         }
@@ -453,43 +435,18 @@
                 V[c] = (Pel)v[c];
             }
 
+            for (int x = 0; x < padx >> m_hChromaShift; x++)
+            {
+                U[(width >> m_hChromaShift) + x] = U[(width >> m_hChromaShift) - 1];
+                V[(width >> m_hChromaShift) + x] = V[(width >> m_hChromaShift) - 1];
+            }
+
             U += getCStride();
             V += getCStride();
             u += pic.stride[1];
             v += pic.stride[2];
         }
 
-        /* Extend the right if width is not multiple of minimum CU size */
-
-        if (padx)
-        {
-            Y = getLumaAddr();
-            U = getCbAddr();
-            V = getCrAddr();
-
-            for (int r = 0; r < height; r++)
-            {
-                for (int x = 0; x < padx; x++)
-                {
-                    Y[width + x] = Y[width - 1];
-                }
-
-                Y += getStride();
-            }
-
-            for (int r = 0; r < height >> m_vChromaShift; r++)
-            {
-                for (int x = 0; x < padx >> m_hChromaShift; x++)
-                {
-                    U[(width >> m_hChromaShift) + x] = U[(width >> m_hChromaShift) - 1];
-                    V[(width >> m_hChromaShift) + x] = V[(width >> m_hChromaShift) - 1];
-                }
-
-                U += getCStride();
-                V += getCStride();
-            }
-        }
-
         /* extend the bottom if height is not multiple of the minimum CU size */
         if (pady)
         {


More information about the x265-devel mailing list