[x265] [PATCH 2 of 2] sao: merge saoCuOrgE3 asm with encoder along with sign asm code integration

nabajit at multicorewareinc.com nabajit at multicorewareinc.com
Wed Jan 7 10:00:17 CET 2015


# HG changeset patch
# User Nabajit Deka
# Date 1420621053 -19800
#      Wed Jan 07 14:27:33 2015 +0530
# Node ID 09499a02ddb41b438e4e6de09ddb92b926c6c8e0
# Parent  9ec89f245be8ca4468362cb095172dbc92bd5140
sao: merge saoCuOrgE3 asm with encoder along with sign asm code integration

diff -r 9ec89f245be8 -r 09499a02ddb4 source/encoder/sao.cpp
--- a/source/encoder/sao.cpp	Wed Jan 07 14:18:11 2015 +0530
+++ b/source/encoder/sao.cpp	Wed Jan 07 14:27:33 2015 +0530
@@ -453,27 +453,62 @@
         if (!tpely)
             rec += stride;
 
-        for (x = startX - 1; x < endX; x++)
-            upBuff1[x] = signOf(rec[x] - tmpU[x + 1]);
+        if (ctuWidth & 15)
+        {
+            for (x = startX - 1; x < endX; x++)
+                upBuff1[x] = signOf(rec[x] - tmpU[x + 1]);
 
-        for (y = startY; y < endY; y++)
-        {
-            x = startX;
-            int8_t signDown = signOf(rec[x] - tmpL[y + 1]);
-            int edgeType = signDown + upBuff1[x] + 2;
-            upBuff1[x - 1] = -signDown;
-            rec[x] = m_clipTable[rec[x] + m_offsetEo[edgeType]];
-            for (x = startX + 1; x < endX; x++)
+            for (y = startY; y < endY; y++)
             {
-                signDown = signOf(rec[x] - rec[x + stride - 1]);
-                edgeType = signDown + upBuff1[x] + 2;
+                x = startX;
+                int8_t signDown = signOf(rec[x] - tmpL[y + 1]);
+                int edgeType = signDown + upBuff1[x] + 2;
                 upBuff1[x - 1] = -signDown;
                 rec[x] = m_clipTable[rec[x] + m_offsetEo[edgeType]];
+
+                for (x = startX + 1; x < endX; x++)
+                {
+                    signDown = signOf(rec[x] - rec[x + stride - 1]);
+                    edgeType = signDown + upBuff1[x] + 2;
+                    upBuff1[x - 1] = -signDown;
+                    rec[x] = m_clipTable[rec[x] + m_offsetEo[edgeType]];
+                }
+
+                upBuff1[endX - 1] = signOf(rec[endX - 1 + stride] - rec[endX]);
+
+                rec += stride;
             }
+        }
+        else
+        {
+            int8_t firstSign, lastSign;
 
-            upBuff1[endX - 1] = signOf(rec[endX - 1 + stride] - rec[endX]);
+            if (lpelx)
+                firstSign = signOf(rec[-1] - tmpU[0]);
+            if (rpelx == picWidth)
+                lastSign = upBuff1[ctuWidth - 1];
 
-            rec += stride;
+            primitives.sign(upBuff1, rec, &tmpU[1], ctuWidth);
+
+            if (lpelx)
+                upBuff1[-1] = firstSign;
+            if (rpelx == picWidth)
+                upBuff1[ctuWidth - 1] = lastSign;
+
+            for (y = startY; y < endY; y++)
+            {
+                x = startX;
+                int8_t signDown = signOf(rec[x] - tmpL[y + 1]);
+                int edgeType = signDown + upBuff1[x] + 2;
+                upBuff1[x - 1] = -signDown;
+                rec[x] = m_clipTable[rec[x] + m_offsetEo[edgeType]];
+
+                primitives.saoCuOrgE3(rec, upBuff1, m_offsetEo, stride - 1, startX, endX);
+
+                upBuff1[endX - 1] = signOf(rec[endX - 1 + stride] - rec[endX]);
+
+                rec += stride;
+            }
         }
 
         break;


More information about the x265-devel mailing list