[x265] sao: minimize skipped lines [CHANGES OUTPUT]

Satoshi Nakagawa nakagawa424 at oki.com
Sun Jan 4 03:18:30 CET 2015


# HG changeset patch
# User Satoshi Nakagawa <nakagawa424 at oki.com>
# Date 1420337650 -32400
#      Sun Jan 04 11:14:10 2015 +0900
# Node ID 78cf196b3982a327cd38a5f89fcc43fdb94fe5a5
# Parent  f255e8d06423231cb8c58ab5d3b10de7fb27b424
sao: minimize skipped lines [CHANGES OUTPUT]

diff -r f255e8d06423 -r 78cf196b3982 source/encoder/sao.cpp
--- a/source/encoder/sao.cpp	Fri Jan 02 18:22:38 2015 +0530
+++ b/source/encoder/sao.cpp	Sun Jan 04 11:14:10 2015 +0900
@@ -605,8 +605,8 @@
     int32_t* stats;
     int32_t* count;
 
-    int skipB = plane ? 2 : 4;
-    int skipR = plane ? 3 : 5;
+    int skipR, skipB;
+    int skipD = plane ? 1 : 3;
 
     int8_t _upBuff1[MAX_CU_SIZE + 2], *upBuff1 = _upBuff1 + 1;
     int8_t _upBufft[MAX_CU_SIZE + 2], *upBufft = _upBufft + 1;
@@ -615,11 +615,9 @@
     {
         const int boShift = X265_DEPTH - SAO_BO_BITS;
 
-        if (m_param->bSaoNonDeblocked)
-        {
-            skipB = plane ? 1 : 3;
-            skipR = plane ? 2 : 4;
-        }
+        skipR = skipD;
+        skipB = skipD;
+
         stats = m_offsetOrg[plane][SAO_BO];
         count = m_count[plane][SAO_BO];
 
@@ -646,11 +644,9 @@
     {
         // SAO_EO_0: // dir: -
         {
-            if (m_param->bSaoNonDeblocked)
-            {
-                skipB = plane ? 1 : 3;
-                skipR = plane ? 3 : 5;
-            }
+            skipR = skipD + 1;
+            skipB = skipD;
+
             stats = m_offsetOrg[plane][SAO_EO_0];
             count = m_count[plane][SAO_EO_0];
 
@@ -679,11 +675,9 @@
 
         // SAO_EO_1: // dir: |
         {
-            if (m_param->bSaoNonDeblocked)
-            {
-                skipB = plane ? 2 : 4;
-                skipR = plane ? 2 : 4;
-            }
+            skipR = skipD;
+            skipB = skipD + 1;
+
             stats = m_offsetOrg[plane][SAO_EO_1];
             count = m_count[plane][SAO_EO_1];
 
@@ -726,11 +720,9 @@
 
         // SAO_EO_2: // dir: 135
         {
-            if (m_param->bSaoNonDeblocked)
-            {
-                skipB = plane ? 2 : 4;
-                skipR = plane ? 3 : 5;
-            }
+            skipR = skipD + 1;
+            skipB = skipD + 1;
+
             stats = m_offsetOrg[plane][SAO_EO_2];
             count = m_count[plane][SAO_EO_2];
 
@@ -772,11 +764,9 @@
 
         // SAO_EO_3: // dir: 45
         {
-            if (m_param->bSaoNonDeblocked)
-            {
-                skipB = plane ? 2 : 4;
-                skipR = plane ? 3 : 5;
-            }
+            skipR = skipD + 1;
+            skipB = skipD + 1;
+
             stats = m_offsetOrg[plane][SAO_EO_3];
             count = m_count[plane][SAO_EO_3];
 
@@ -846,7 +836,8 @@
     int32_t* stats;
     int32_t* count;
 
-    int skipB, skipR;
+    int skipR, skipB;
+    int skipD = 3;
 
     int32_t _upBuff1[MAX_CU_SIZE + 2], *upBuff1 = _upBuff1 + 1;
     int32_t _upBufft[MAX_CU_SIZE + 2], *upBufft = _upBufft + 1;
@@ -861,6 +852,7 @@
         if (plane == 1)
         {
             stride = frame->m_reconPic->m_strideC;
+            skipD = 1;
             picWidth  >>= m_hChromaShift;
             picHeight >>= m_vChromaShift;
             ctuWidth  >>= m_hChromaShift;
@@ -873,8 +865,8 @@
 
         // SAO_BO:
 
-        skipB = plane ? 1 : 3;
-        skipR = plane ? 2 : 4;
+        skipR = skipD;
+        skipB = skipD;
 
         stats = m_offsetOrgPreDblk[addr][plane][SAO_BO];
         count = m_countPreDblk[addr][plane][SAO_BO];
@@ -902,8 +894,8 @@
 
         // SAO_EO_0: // dir: -
         {
-            skipB = plane ? 1 : 3;
-            skipR = plane ? 3 : 5;
+            skipR = skipD + 1;
+            skipB = skipD;
 
             stats = m_offsetOrgPreDblk[addr][plane][SAO_EO_0];
             count = m_countPreDblk[addr][plane][SAO_EO_0];
@@ -938,8 +930,8 @@
 
         // SAO_EO_1: // dir: |
         {
-            skipB = plane ? 2 : 4;
-            skipR = plane ? 2 : 4;
+            skipR = skipD;
+            skipB = skipD + 1;
 
             stats = m_offsetOrgPreDblk[addr][plane][SAO_EO_1];
             count = m_countPreDblk[addr][plane][SAO_EO_1];
@@ -983,8 +975,8 @@
 
         // SAO_EO_2: // dir: 135
         {
-            skipB = plane ? 2 : 4;
-            skipR = plane ? 3 : 5;
+            skipR = skipD + 1;
+            skipB = skipD + 1;
 
             stats = m_offsetOrgPreDblk[addr][plane][SAO_EO_2];
             count = m_countPreDblk[addr][plane][SAO_EO_2];
@@ -1035,8 +1027,8 @@
 
         // SAO_EO_3: // dir: 45
         {
-            skipB = plane ? 2 : 4;
-            skipR = plane ? 3 : 5;
+            skipR = skipD + 1;
+            skipB = skipD + 1;
 
             stats = m_offsetOrgPreDblk[addr][plane][SAO_EO_3];
             count = m_countPreDblk[addr][plane][SAO_EO_3];


More information about the x265-devel mailing list