[x265-commits] [x265] Remove invalid check

Aasaipriya Chandran aasaipriya at multicorewareinc.com
Fri Jul 27 01:03:03 CEST 2018


details:   http://hg.videolan.org/x265/rev/c5ae4495d43d
branches:  
changeset: 12403:c5ae4495d43d
user:      Aasaipriya Chandran <aasaipriya at multicorewareinc.com>
date:      Thu Jul 26 10:15:48 2018 +0530
description:
Remove invalid check
Fix error in Release builds
Subject: [x265] remove whitespace

details:   http://hg.videolan.org/x265/rev/613074c6714f
branches:  
changeset: 12404:613074c6714f
user:      Ashok Kumar Mishra <ashok at multicorewareinc.com>
date:      Thu Jul 26 13:38:14 2018 +0530
description:
remove whitespace

diffstat:

 source/common/lowres.cpp        |   8 +++---
 source/common/param.cpp         |  22 ++++++++--------
 source/common/quant.cpp         |   2 +-
 source/encoder/api.cpp          |   1 -
 source/encoder/frameencoder.cpp |  54 ++++++++++++++++++++--------------------
 source/x265.h                   |   8 +++---
 6 files changed, 47 insertions(+), 48 deletions(-)

diffs (263 lines):

diff -r 79c76e42cb28 -r 613074c6714f source/common/lowres.cpp
--- a/source/common/lowres.cpp	Wed Jul 25 14:40:47 2018 +0530
+++ b/source/common/lowres.cpp	Thu Jul 26 13:38:14 2018 +0530
@@ -61,8 +61,8 @@ bool Lowres::create(PicYuv *origPic, int
         if (qgSize == 8)
             CHECKED_MALLOC_ZERO(invQscaleFactor8x8, int, cuCount);
     }
-       if (origPic->m_param->bAQMotion)
-               CHECKED_MALLOC_ZERO(qpAqMotionOffset, double, cuCountFullRes);
+    if (origPic->m_param->bAQMotion)
+        CHECKED_MALLOC_ZERO(qpAqMotionOffset, double, cuCountFullRes);
     if (origPic->m_param->bDynamicRefine)
         CHECKED_MALLOC_ZERO(blockVariance, uint32_t, cuCountFullRes);
     CHECKED_MALLOC(propagateCost, uint16_t, cuCount);
@@ -131,8 +131,8 @@ void Lowres::destroy()
     X265_FREE(invQscaleFactor);
     X265_FREE(qpCuTreeOffset);
     X265_FREE(propagateCost);
-       X265_FREE(invQscaleFactor8x8);
-       X265_FREE(qpAqMotionOffset);
+    X265_FREE(invQscaleFactor8x8);
+    X265_FREE(qpAqMotionOffset);
     X265_FREE(blockVariance);
 }
 // (re) initialize lowres state
diff -r 79c76e42cb28 -r 613074c6714f source/common/param.cpp
--- a/source/common/param.cpp	Wed Jul 25 14:40:47 2018 +0530
+++ b/source/common/param.cpp	Thu Jul 26 13:38:14 2018 +0530
@@ -134,8 +134,8 @@ void x265_param_default(x265_param* para
     param->bEmitInfoSEI = 1;
     param->bEmitHDRSEI = 0;
     param->bEmitIDRRecoverySEI = 0;
-    
-	/* CU definitions */
+
+    /* CU definitions */
     param->maxCUSize = 64;
     param->minCUSize = 8;
     param->tuQTMaxInterDepth = 1;
@@ -196,8 +196,8 @@ void x265_param_default(x265_param* para
     param->bEnableSAO = 1;
     param->bSaoNonDeblocked = 0;
     param->bLimitSAO = 0;
-    
-	/* Coding Quality */
+
+    /* Coding Quality */
     param->cbQpOffset = 0;
     param->crQpOffset = 0;
     param->rdPenalty = 0;
@@ -309,9 +309,9 @@ void x265_param_default(x265_param* para
     param->bMVType = 0;
     param->bSingleSeiNal = 0;
 
-	/* SEI messages */
-	param->preferredTransferCharacteristics = -1;
-	param->pictureStructure = -1;
+    /* SEI messages */
+    param->preferredTransferCharacteristics = -1;
+    param->pictureStructure = -1;
 }
 
 int x265_param_default_preset(x265_param* param, const char* preset, const char* tune)
@@ -1019,7 +1019,7 @@ int x265_param_parse(x265_param* p, cons
         OPT("refine-mv")p->mvRefine = atobool(value);
         OPT("force-flush")p->forceFlush = atoi(value);
         OPT("splitrd-skip") p->bEnableSplitRdSkip = atobool(value);
-		OPT("lowpass-dct") p->bLowPassDct = atobool(value);
+        OPT("lowpass-dct") p->bLowPassDct = atobool(value);
         OPT("vbv-end") p->vbvBufferEnd = atof(value);
         OPT("vbv-end-fr-adj") p->vbvEndFrameAdjust = atof(value);
         OPT("copy-pic") p->bCopyPicToFrame = atobool(value);
@@ -1037,7 +1037,7 @@ int x265_param_parse(x265_param* p, cons
             {
                 bError = true;
             }
-         }
+        }
         OPT("gop-lookahead") p->gopLookahead = atoi(value);
         OPT("analysis-save") p->analysisSave = strdup(value);
         OPT("analysis-load") p->analysisLoad = strdup(value);
@@ -1045,8 +1045,8 @@ int x265_param_parse(x265_param* p, cons
         OPT("max-ausize-factor") p->maxAUSizeFactor = atof(value);
         OPT("dynamic-refine") p->bDynamicRefine = atobool(value);
         OPT("single-sei") p->bSingleSeiNal = atobool(value);
-		OPT("atc-sei") p->preferredTransferCharacteristics = atoi(value);
-		OPT("pic-struct") p->pictureStructure = atoi(value);
+        OPT("atc-sei") p->preferredTransferCharacteristics = atoi(value);
+        OPT("pic-struct") p->pictureStructure = atoi(value);
         OPT("chunk-start") p->chunkStart = atoi(value);
         OPT("chunk-end") p->chunkEnd = atoi(value);
         OPT("nalu-file") p->naluFile = strdup(value);
diff -r 79c76e42cb28 -r 613074c6714f source/common/quant.cpp
--- a/source/common/quant.cpp	Wed Jul 25 14:40:47 2018 +0530
+++ b/source/common/quant.cpp	Thu Jul 26 13:38:14 2018 +0530
@@ -806,7 +806,7 @@ uint32_t Quant::rdoQuant(const CUData& c
             if (usePsyMask)
             {
                 bool enable512 = detect512();
-                
+
                 if (enable512)
                     primitives.cu[log2TrSize - 2].psyRdoQuant(m_resiDctCoeff, m_fencDctCoeff, costUncoded, &totalUncodedCost, &totalRdCost, &psyScale, blkPos);
                 else
diff -r 79c76e42cb28 -r 613074c6714f source/encoder/api.cpp
--- a/source/encoder/api.cpp	Wed Jul 25 14:40:47 2018 +0530
+++ b/source/encoder/api.cpp	Thu Jul 26 13:38:14 2018 +0530
@@ -405,7 +405,6 @@ int x265_set_analysis_data(x265_encoder 
 
 void x265_alloc_analysis_data(x265_param *param, x265_analysis_data* analysis)
 {
-    X265_CHECK(analysis->sliceType, "invalid slice type\n");
     x265_analysis_inter_data *interData = analysis->interData = NULL;
     x265_analysis_intra_data *intraData = analysis->intraData = NULL;
     x265_analysis_distortion_data *distortionData = analysis->distortionData = NULL;
diff -r 79c76e42cb28 -r 613074c6714f source/encoder/frameencoder.cpp
--- a/source/encoder/frameencoder.cpp	Wed Jul 25 14:40:47 2018 +0530
+++ b/source/encoder/frameencoder.cpp	Thu Jul 26 13:38:14 2018 +0530
@@ -674,14 +674,14 @@ void FrameEncoder::compressFrame()
                 sei->m_picStruct = (poc & 1) ? 1 /* top */ : 2 /* bottom */;
             else if (m_param->interlaceMode == 1)
                 sei->m_picStruct = (poc & 1) ? 2 /* bottom */ : 1 /* top */;
-			else
-				sei->m_picStruct = m_param->pictureStructure;
-			
-		    if (m_param->interlaceMode)
-				 sei->m_sourceScanType = 0;
-			else
-				 sei->m_sourceScanType = 1;
-			
+            else
+                sei->m_picStruct = m_param->pictureStructure;
+
+            if (m_param->interlaceMode)
+                sei->m_sourceScanType = 0;
+            else
+                sei->m_sourceScanType = 1;
+
             sei->m_duplicateFlag = false;
         }
 
@@ -702,17 +702,17 @@ void FrameEncoder::compressFrame()
         sei->alignAndSerialize(m_bs, false, m_param->bSingleSeiNal, NAL_UNIT_PREFIX_SEI, m_nalList);
     }
 
-	if (m_param->preferredTransferCharacteristics > -1 && slice->isIRAP())
-	{
-	    SEIAlternativeTC m_seiAlternativeTC;
-		m_seiAlternativeTC.m_preferredTransferCharacteristics = m_param->preferredTransferCharacteristics;
-		m_bs.resetBits();
-		int payloadSize = m_seiAlternativeTC.countPayloadSize(*slice->m_sps);
-		m_seiAlternativeTC.setSize(payloadSize);
-		m_seiAlternativeTC.write(m_bs, *slice->m_sps);
-		m_seiAlternativeTC.alignAndSerialize(m_bs, false, m_param->bSingleSeiNal, NAL_UNIT_PREFIX_SEI, m_nalList);
-	}
-	
+    if (m_param->preferredTransferCharacteristics > -1 && slice->isIRAP())
+    {
+        SEIAlternativeTC m_seiAlternativeTC;
+        m_seiAlternativeTC.m_preferredTransferCharacteristics = m_param->preferredTransferCharacteristics;
+        m_bs.resetBits();
+        int payloadSize = m_seiAlternativeTC.countPayloadSize(*slice->m_sps);
+        m_seiAlternativeTC.setSize(payloadSize);
+        m_seiAlternativeTC.write(m_bs, *slice->m_sps);
+        m_seiAlternativeTC.alignAndSerialize(m_bs, false, m_param->bSingleSeiNal, NAL_UNIT_PREFIX_SEI, m_nalList);
+    }
+
     bool isSei = false;
     /* Write user SEI */
     for (int i = 0; i < m_frame->m_userSEI.numPayloads; i++)
@@ -1420,7 +1420,7 @@ void FrameEncoder::processRowEncoder(int
             }
             curRow.avgQPComputed = 1;
         }
-    }    
+    }
 
     // Initialize restrict on MV range in slices
     tld.analysis.m_sliceMinY = -(int16_t)(rowInSlice * m_param->maxCUSize * 4) + 3 * 4;
@@ -1525,7 +1525,7 @@ void FrameEncoder::processRowEncoder(int
         {
             // NOTE: in VBV mode, we may reencode anytime, so we can't do Deblock stage-Horizon and SAO
             if (!bIsVbv)
-            {                
+            {
                 // Delay one row to avoid intra prediction conflict
                 if (m_pool && !bFirstRowInSlice)
                 {                    
@@ -1802,24 +1802,24 @@ void FrameEncoder::processRowEncoder(int
         else if ((uint32_t)m_rce.encodeOrder <= 2 * (m_param->fpsNum / m_param->fpsDenom))
             rowCount = X265_MIN((maxRows + 1) / 2, maxRows - 1);
         else
-			rowCount = X265_MIN(m_refLagRows / m_param->maxSlices, maxRows - 1);
+            rowCount = X265_MIN(m_refLagRows / m_param->maxSlices, maxRows - 1);
 
         if (rowInSlice == rowCount)
         {
             m_rowSliceTotalBits[sliceId] = 0;
             if (bIsVbv && !(m_param->rc.bEnableConstVbv && m_param->bEnableWavefront))
-            {          
+            {
                 for (uint32_t i = m_sliceBaseRow[sliceId]; i < rowCount + m_sliceBaseRow[sliceId]; i++)
                     m_rowSliceTotalBits[sliceId] += curEncData.m_rowStat[i].encodedBits;
             }
             else
             {
                 uint32_t startAddr = m_sliceBaseRow[sliceId] * numCols;
-				uint32_t finishAddr = startAddr + rowCount * numCols;
+                uint32_t finishAddr = startAddr + rowCount * numCols;
                 
-				for (uint32_t cuAddr = startAddr; cuAddr < finishAddr; cuAddr++)
+                for (uint32_t cuAddr = startAddr; cuAddr < finishAddr; cuAddr++)
                     m_rowSliceTotalBits[sliceId] += curEncData.m_cuStat[cuAddr].totalBits;
-            }            
+            }
 
             if (ATOMIC_INC(&m_sliceCnt) == (int)m_param->maxSlices)
             {
@@ -2132,7 +2132,7 @@ void FrameEncoder::vmafFrameLevelScore()
 Frame *FrameEncoder::getEncodedPicture(NALList& output)
 {
     if (m_frame)
-    {    
+    {
         /* block here until worker thread completes */
         m_done.wait();
 
diff -r 79c76e42cb28 -r 613074c6714f source/x265.h
--- a/source/x265.h	Wed Jul 25 14:40:47 2018 +0530
+++ b/source/x265.h	Thu Jul 26 13:38:14 2018 +0530
@@ -343,7 +343,7 @@ typedef enum
     REGION_REFRESH_INFO                  = 134,
     MASTERING_DISPLAY_INFO               = 137,
     CONTENT_LIGHT_LEVEL_INFO             = 144,
-	ALTERNATIVE_TRANSFER_CHARACTERISTICS = 147,
+    ALTERNATIVE_TRANSFER_CHARACTERISTICS = 147,
 } SEIPayloadType;
 
 typedef struct x265_sei_payload
@@ -652,7 +652,7 @@ typedef struct x265_zone
     
 /* data to calculate aggregate VMAF score */
 typedef struct x265_vmaf_data
-{   
+{
     int width;
     int height;
     size_t offset; 
@@ -1698,12 +1698,12 @@ typedef struct x265_param
 
 
     /* First frame of the chunk. Frames preceeding this in display order will
-	* be encoded, however, they will be discarded in the bitstream.
+    * be encoded, however, they will be discarded in the bitstream.
     * Default 0 (disabled). */
     int       chunkStart;
 
     /* Last frame of the chunk. Frames following this in display order will be
-	* used in taking lookahead decisions, but, they will not be encoded.
+    * used in taking lookahead decisions, but, they will not be encoded.
     * Default 0 (disabled). */
     int       chunkEnd;
     /* File containing base64 encoded SEI messages in POC order */


More information about the x265-commits mailing list