[x265] [PATCH] Fix Mac OS build warnings

vignesh at multicorewareinc.com vignesh at multicorewareinc.com
Wed Jan 10 07:42:53 CET 2018


# HG changeset patch
# User Vignesh Vijayakumar
# Date 1515049621 -19800
#      Thu Jan 04 12:37:01 2018 +0530
# Node ID 711d8c6cbb3cf3d164bb65d56626093b9023f8bf
# Parent  69cfe46e8a3b44281278d560c2e99f18eff2a950
Fix Mac OS build warnings
1. due to SEA motion search
2. due to condition check for CTUInfo

diff -r 69cfe46e8a3b -r 711d8c6cbb3c source/common/framedata.cpp
--- a/source/common/framedata.cpp	Tue Jan 02 16:41:36 2018 +0530
+++ b/source/common/framedata.cpp	Thu Jan 04 12:37:01 2018 +0530
@@ -78,15 +78,12 @@
     X265_FREE(m_cuStat);
     X265_FREE(m_rowStat);
 
-    if (m_meBuffer)
+    for (int i = 0; i < INTEGRAL_PLANE_NUM; i++)
     {
-        for (int i = 0; i < INTEGRAL_PLANE_NUM; i++)
+        if (m_meBuffer[i] != NULL)
         {
-            if (m_meBuffer[i] != NULL)
-            {
-                X265_FREE(m_meBuffer[i]);
-                m_meBuffer[i] = NULL;
-            }
+            X265_FREE(m_meBuffer[i]);
+            m_meBuffer[i] = NULL;
         }
     }
 }
diff -r 69cfe46e8a3b -r 711d8c6cbb3c source/encoder/analysis.cpp
--- a/source/encoder/analysis.cpp	Tue Jan 02 16:41:36 2018 +0530
+++ b/source/encoder/analysis.cpp	Thu Jan 04 12:37:01 2018 +0530
@@ -159,36 +159,33 @@
     if (m_param->bCTUInfo && (*m_frame->m_ctuInfo + ctu.m_cuAddr))
     {
         x265_ctu_info_t* ctuTemp = *m_frame->m_ctuInfo + ctu.m_cuAddr;
-        if (ctuTemp->ctuPartitions)
+        int32_t depthIdx = 0;
+        uint32_t maxNum8x8Partitions = 64;
+        uint8_t* depthInfoPtr = m_frame->m_addOnDepth[ctu.m_cuAddr];
+        uint8_t* contentInfoPtr = m_frame->m_addOnCtuInfo[ctu.m_cuAddr];
+        int* prevCtuInfoChangePtr = m_frame->m_addOnPrevChange[ctu.m_cuAddr];
+        do
         {
-            int32_t depthIdx = 0;
-            uint32_t maxNum8x8Partitions = 64;
-            uint8_t* depthInfoPtr = m_frame->m_addOnDepth[ctu.m_cuAddr];
-            uint8_t* contentInfoPtr = m_frame->m_addOnCtuInfo[ctu.m_cuAddr];
-            int* prevCtuInfoChangePtr = m_frame->m_addOnPrevChange[ctu.m_cuAddr];
-            do
-            {
-                uint8_t depth = (uint8_t)ctuTemp->ctuPartitions[depthIdx];
-                uint8_t content = (uint8_t)(*((int32_t *)ctuTemp->ctuInfo + depthIdx));
-                int prevCtuInfoChange = m_frame->m_prevCtuInfoChange[ctu.m_cuAddr * maxNum8x8Partitions + depthIdx];
-                memset(depthInfoPtr, depth, sizeof(uint8_t) * numPartition >> 2 * depth);
-                memset(contentInfoPtr, content, sizeof(uint8_t) * numPartition >> 2 * depth);
-                memset(prevCtuInfoChangePtr, 0, sizeof(int) * numPartition >> 2 * depth);
-                for (uint32_t l = 0; l < numPartition >> 2 * depth; l++)
-                    prevCtuInfoChangePtr[l] = prevCtuInfoChange;
-                depthInfoPtr += ctu.m_numPartitions >> 2 * depth;
-                contentInfoPtr += ctu.m_numPartitions >> 2 * depth;
-                prevCtuInfoChangePtr += ctu.m_numPartitions >> 2 * depth;
-                depthIdx++;
-            } while (ctuTemp->ctuPartitions[depthIdx] != 0);
-
-            m_additionalCtuInfo = m_frame->m_addOnCtuInfo[ctu.m_cuAddr];
-            m_prevCtuInfoChange = m_frame->m_addOnPrevChange[ctu.m_cuAddr];
-            memcpy(ctu.m_cuDepth, m_frame->m_addOnDepth[ctu.m_cuAddr], sizeof(uint8_t) * numPartition);
-            //Calculate log2CUSize from depth
-            for (uint32_t i = 0; i < cuGeom.numPartitions; i++)
-                ctu.m_log2CUSize[i] = (uint8_t)m_param->maxLog2CUSize - ctu.m_cuDepth[i];
-        }
+            uint8_t depth = (uint8_t)ctuTemp->ctuPartitions[depthIdx];
+            uint8_t content = (uint8_t)(*((int32_t *)ctuTemp->ctuInfo + depthIdx));
+            int prevCtuInfoChange = m_frame->m_prevCtuInfoChange[ctu.m_cuAddr * maxNum8x8Partitions + depthIdx];
+            memset(depthInfoPtr, depth, sizeof(uint8_t) * numPartition >> 2 * depth);
+            memset(contentInfoPtr, content, sizeof(uint8_t) * numPartition >> 2 * depth);
+            memset(prevCtuInfoChangePtr, 0, sizeof(int) * numPartition >> 2 * depth);
+            for (uint32_t l = 0; l < numPartition >> 2 * depth; l++)
+                prevCtuInfoChangePtr[l] = prevCtuInfoChange;
+            depthInfoPtr += ctu.m_numPartitions >> 2 * depth;
+            contentInfoPtr += ctu.m_numPartitions >> 2 * depth;
+            prevCtuInfoChangePtr += ctu.m_numPartitions >> 2 * depth;
+            depthIdx++;
+        } while (ctuTemp->ctuPartitions[depthIdx] != 0);
+
+        m_additionalCtuInfo = m_frame->m_addOnCtuInfo[ctu.m_cuAddr];
+        m_prevCtuInfoChange = m_frame->m_addOnPrevChange[ctu.m_cuAddr];
+        memcpy(ctu.m_cuDepth, m_frame->m_addOnDepth[ctu.m_cuAddr], sizeof(uint8_t) * numPartition);
+        //Calculate log2CUSize from depth
+        for (uint32_t i = 0; i < cuGeom.numPartitions; i++)
+            ctu.m_log2CUSize[i] = (uint8_t)m_param->maxLog2CUSize - ctu.m_cuDepth[i];
     }
 
     if (m_param->analysisMultiPassRefine && m_param->rc.bStatRead)
diff -r 69cfe46e8a3b -r 711d8c6cbb3c source/encoder/dpb.cpp
--- a/source/encoder/dpb.cpp	Tue Jan 02 16:41:36 2018 +0530
+++ b/source/encoder/dpb.cpp	Thu Jan 04 12:37:01 2018 +0530
@@ -93,15 +93,12 @@
             curFrame->m_encData->m_freeListNext = m_frameDataFreeList;
             m_frameDataFreeList = curFrame->m_encData;
 
-            if (curFrame->m_encData->m_meBuffer)
+            for (int i = 0; i < INTEGRAL_PLANE_NUM; i++)
             {
-                for (int i = 0; i < INTEGRAL_PLANE_NUM; i++)
+                if (curFrame->m_encData->m_meBuffer[i] != NULL)
                 {
-                    if (curFrame->m_encData->m_meBuffer[i] != NULL)
-                    {
-                        X265_FREE(curFrame->m_encData->m_meBuffer[i]);
-                        curFrame->m_encData->m_meBuffer[i] = NULL;
-                    }
+                    X265_FREE(curFrame->m_encData->m_meBuffer[i]);
+                    curFrame->m_encData->m_meBuffer[i] = NULL;
                 }
             }
 
diff -r 69cfe46e8a3b -r 711d8c6cbb3c source/encoder/framefilter.cpp
--- a/source/encoder/framefilter.cpp	Tue Jan 02 16:41:36 2018 +0530
+++ b/source/encoder/framefilter.cpp	Thu Jan 04 12:37:01 2018 +0530
@@ -795,7 +795,7 @@
 void FrameFilter::computeMEIntegral(int row)
 {
     int lastRow = row == (int)m_frame->m_encData->m_slice->m_sps->numCuInHeight - 1;
-    if (m_frame->m_encData->m_meIntegral && m_frame->m_lowres.sliceType != X265_TYPE_B)
+    if (m_frame->m_lowres.sliceType != X265_TYPE_B)
     {
         /* If WPP, other than first row, integral calculation for current row needs to wait till the
         * integral for the previous row is computed */


More information about the x265-devel mailing list