[x265-commits] [x265] ratecontrol: rename reInit to init. This method is called...

Deepthi Nandakumar deepthi at multicorewareinc.com
Fri Apr 11 21:53:21 CEST 2014


details:   http://hg.videolan.org/x265/rev/83ccf2f1453f
branches:  
changeset: 6687:83ccf2f1453f
user:      Deepthi Nandakumar <deepthi at multicorewareinc.com>
date:      Thu Apr 10 11:17:46 2014 +0530
description:
ratecontrol: rename reInit to init. This method is called in the constructor and
when ABR history is reset.
Subject: [x265] ratecontrol: prevent one layer of non-zero I-slice qp clipping [CHANGES OUTPUT].

details:   http://hg.videolan.org/x265/rev/1c0f1a4ce209
branches:  
changeset: 6688:1c0f1a4ce209
user:      Deepthi Nandakumar <deepthi at multicorewareinc.com>
date:      Thu Apr 10 12:56:53 2014 +0530
description:
ratecontrol: prevent one layer of non-zero I-slice qp clipping [CHANGES OUTPUT].

This seems to have been an error importing RC code from x264. It could be responsible
for error reports on I-slices (after POC 0) having much higher QP/low visual quality.
Needs review.
Subject: [x265] vbv: log frame-average QPs for VBV; even when AQ is disabled.

details:   http://hg.videolan.org/x265/rev/55981f89b398
branches:  
changeset: 6689:55981f89b398
user:      Aarthi Thirumalai
date:      Tue Apr 08 20:28:06 2014 +0530
description:
vbv: log frame-average QPs for VBV; even when AQ is disabled.
Subject: [x265] asm: HADDD optimization for XOP

details:   http://hg.videolan.org/x265/rev/78ab76f203a9
branches:  
changeset: 6690:78ab76f203a9
user:      Murugan Vairavel <murugan at multicorewareinc.com>
date:      Thu Apr 10 13:53:44 2014 +0530
description:
asm: HADDD optimization for XOP
Subject: [x265] asm-primitives: Enable missing XOP primitives in HIGH_BIT_DEPTH

details:   http://hg.videolan.org/x265/rev/bd5e59fc917d
branches:  
changeset: 6691:bd5e59fc917d
user:      Murugan Vairavel <murugan at multicorewareinc.com>
date:      Thu Apr 10 13:55:30 2014 +0530
description:
asm-primitives: Enable missing XOP primitives in HIGH_BIT_DEPTH
Subject: [x265] TComTrQuant: comparing >=0 of unsigned variable is always true

details:   http://hg.videolan.org/x265/rev/85f977830d9d
branches:  
changeset: 6692:85f977830d9d
user:      Steve Borho <steve at borho.org>
date:      Fri Apr 11 14:34:10 2014 -0500
description:
TComTrQuant: comparing >=0 of unsigned variable is always true
Subject: [x265] TComTrQuant: nits

details:   http://hg.videolan.org/x265/rev/a5aa9e730323
branches:  
changeset: 6693:a5aa9e730323
user:      Steve Borho <steve at borho.org>
date:      Fri Apr 11 14:35:01 2014 -0500
description:
TComTrQuant: nits
Subject: [x265] cip: add is*AvailableCIP()

details:   http://hg.videolan.org/x265/rev/13fa6d4d4fe4
branches:  
changeset: 6694:13fa6d4d4fe4
user:      Satoshi Nakagawa <nakagawa424 at oki.com>
date:      Wed Apr 09 18:01:41 2014 +0900
description:
cip: add is*AvailableCIP()

simplify no CIP case.
Subject: [x265] cmake: allow icpc to use vectorization if it likes

details:   http://hg.videolan.org/x265/rev/850ebca2f7c8
branches:  
changeset: 6695:850ebca2f7c8
user:      Steve Borho <steve at borho.org>
date:      Fri Apr 11 14:52:11 2014 -0500
description:
cmake: allow icpc to use vectorization if it likes

diffstat:

 source/CMakeLists.txt                 |    2 +-
 source/Lib/TLibCommon/TComDataCU.cpp  |   12 -
 source/Lib/TLibCommon/TComPattern.cpp |  263 +++++++++++++++++++++------------
 source/Lib/TLibCommon/TComPattern.h   |    6 +
 source/Lib/TLibCommon/TComTrQuant.cpp |    8 +-
 source/common/x86/asm-primitives.cpp  |    4 +
 source/common/x86/x86util.asm         |    5 +
 source/encoder/ratecontrol.cpp        |   51 +++---
 source/encoder/ratecontrol.h          |    2 +-
 9 files changed, 213 insertions(+), 140 deletions(-)

diffs (truncated from 634 to 300 lines):

diff -r 51c627e235bc -r 850ebca2f7c8 source/CMakeLists.txt
--- a/source/CMakeLists.txt	Wed Apr 09 21:37:38 2014 -0500
+++ b/source/CMakeLists.txt	Fri Apr 11 14:52:11 2014 -0500
@@ -101,7 +101,7 @@ endif(MSVC)
 if(INTEL_CXX AND UNIX)
     # treat icpc roughly like gcc
     set(GCC 1)
-    add_definitions(-Wall -Wextra -Wshadow -no-vec)
+    add_definitions(-Wall -Wextra -Wshadow)
 elseif(CLANG)
     # treat clang roughly like gcc
     set(GCC 1)
diff -r 51c627e235bc -r 850ebca2f7c8 source/Lib/TLibCommon/TComDataCU.cpp
--- a/source/Lib/TLibCommon/TComDataCU.cpp	Wed Apr 09 21:37:38 2014 -0500
+++ b/source/Lib/TLibCommon/TComDataCU.cpp	Fri Apr 11 14:52:11 2014 -0500
@@ -884,7 +884,6 @@ TComDataCU* TComDataCU::getPUAboveRight(
 
     if ((m_pic->getCU(m_cuAddr)->getCUPelX() + g_rasterToPelX[absPartIdxRT] + m_pic->getUnitSize()) >= m_slice->getSPS()->getPicWidthInLumaSamples())
     {
-        arPartUnitIdx = MAX_UINT;
         return NULL;
     }
 
@@ -905,7 +904,6 @@ TComDataCU* TComDataCU::getPUAboveRight(
                     return this;
                 }
             }
-            arPartUnitIdx = MAX_UINT;
             return NULL;
         }
         arPartUnitIdx = g_rasterToZscan[absPartIdxRT + m_pic->getNumPartInCU() - numPartInCUSize + 1];
@@ -918,7 +916,6 @@ TComDataCU* TComDataCU::getPUAboveRight(
 
     if (!RasterAddress::isZeroRow(absPartIdxRT, numPartInCUSize))
     {
-        arPartUnitIdx = MAX_UINT;
         return NULL;
     }
 
@@ -939,7 +936,6 @@ TComDataCU* TComDataCU::getPUBelowLeft(u
 
     if ((m_pic->getCU(m_cuAddr)->getCUPelY() + g_rasterToPelY[absPartIdxLB] + m_pic->getUnitSize()) >= m_slice->getSPS()->getPicHeightInLumaSamples())
     {
-        blPartUnitIdx = MAX_UINT;
         return NULL;
     }
 
@@ -960,7 +956,6 @@ TComDataCU* TComDataCU::getPUBelowLeft(u
                     return this;
                 }
             }
-            blPartUnitIdx = MAX_UINT;
             return NULL;
         }
         blPartUnitIdx = g_rasterToZscan[absPartIdxLB + numPartInCUSize * 2 - 1];
@@ -971,7 +966,6 @@ TComDataCU* TComDataCU::getPUBelowLeft(u
         return m_cuLeft;
     }
 
-    blPartUnitIdx = MAX_UINT;
     return NULL;
 }
 
@@ -984,7 +978,6 @@ TComDataCU* TComDataCU::getPUBelowLeftAd
     if ((m_pic->getCU(m_cuAddr)->getCUPelY() + g_rasterToPelY[absPartIdxLB] + (partUnitOffset << m_pic->getPicSym()->getLog2UnitSize())) >=
         m_slice->getSPS()->getPicHeightInLumaSamples())
     {
-        blPartUnitIdx = MAX_UINT;
         return NULL;
     }
 
@@ -1005,7 +998,6 @@ TComDataCU* TComDataCU::getPUBelowLeftAd
                     return this;
                 }
             }
-            blPartUnitIdx = MAX_UINT;
             return NULL;
         }
         blPartUnitIdx = g_rasterToZscan[absPartIdxLB + (1 + partUnitOffset) * numPartInCUSize - 1];
@@ -1016,7 +1008,6 @@ TComDataCU* TComDataCU::getPUBelowLeftAd
         return m_cuLeft;
     }
 
-    blPartUnitIdx = MAX_UINT;
     return NULL;
 }
 
@@ -1029,7 +1020,6 @@ TComDataCU* TComDataCU::getPUAboveRightA
     if ((m_pic->getCU(m_cuAddr)->getCUPelX() + g_rasterToPelX[absPartIdxRT] + (partUnitOffset << m_pic->getPicSym()->getLog2UnitSize())) >=
         m_slice->getSPS()->getPicWidthInLumaSamples())
     {
-        arPartUnitIdx = MAX_UINT;
         return NULL;
     }
 
@@ -1050,7 +1040,6 @@ TComDataCU* TComDataCU::getPUAboveRightA
                     return this;
                 }
             }
-            arPartUnitIdx = MAX_UINT;
             return NULL;
         }
         arPartUnitIdx = g_rasterToZscan[absPartIdxRT + m_pic->getNumPartInCU() - numPartInCUSize + partUnitOffset];
@@ -1063,7 +1052,6 @@ TComDataCU* TComDataCU::getPUAboveRightA
 
     if (!RasterAddress::isZeroRow(absPartIdxRT, numPartInCUSize))
     {
-        arPartUnitIdx = MAX_UINT;
         return NULL;
     }
 
diff -r 51c627e235bc -r 850ebca2f7c8 source/Lib/TLibCommon/TComPattern.cpp
--- a/source/Lib/TLibCommon/TComPattern.cpp	Wed Apr 09 21:37:38 2014 -0500
+++ b/source/Lib/TLibCommon/TComPattern.cpp	Fri Apr 11 14:52:11 2014 -0500
@@ -75,12 +75,24 @@ void TComPattern::initAdiPattern(TComDat
     numUnitsInCU  = cuWidth / unitSize;
     totalUnits    = (numUnitsInCU << 2) + 1;
 
-    bNeighborFlags[numUnitsInCU * 2] = isAboveLeftAvailable(cu, partIdxLT);
-    numIntraNeighbor  += (int)(bNeighborFlags[numUnitsInCU * 2]);
-    numIntraNeighbor  += isAboveAvailable(cu, partIdxLT, partIdxRT, bNeighborFlags + (numUnitsInCU * 2) + 1);
-    numIntraNeighbor  += isAboveRightAvailable(cu, partIdxLT, partIdxRT, bNeighborFlags + (numUnitsInCU * 3) + 1);
-    numIntraNeighbor  += isLeftAvailable(cu, partIdxLT, partIdxLB, bNeighborFlags + (numUnitsInCU * 2) - 1);
-    numIntraNeighbor  += isBelowLeftAvailable(cu, partIdxLT, partIdxLB, bNeighborFlags + numUnitsInCU   - 1);
+    if (!cu->getSlice()->getPPS()->getConstrainedIntraPred())
+    {
+        bNeighborFlags[numUnitsInCU * 2] = isAboveLeftAvailable(cu, partIdxLT);
+        numIntraNeighbor += (int)(bNeighborFlags[numUnitsInCU * 2]);
+        numIntraNeighbor += isAboveAvailable(cu, partIdxLT, partIdxRT, bNeighborFlags + (numUnitsInCU * 2) + 1);
+        numIntraNeighbor += isAboveRightAvailable(cu, partIdxLT, partIdxRT, bNeighborFlags + (numUnitsInCU * 3) + 1);
+        numIntraNeighbor += isLeftAvailable(cu, partIdxLT, partIdxLB, bNeighborFlags + (numUnitsInCU * 2) - 1);
+        numIntraNeighbor += isBelowLeftAvailable(cu, partIdxLT, partIdxLB, bNeighborFlags + numUnitsInCU   - 1);
+    }
+    else
+    {
+        bNeighborFlags[numUnitsInCU * 2] = isAboveLeftAvailableCIP(cu, partIdxLT);
+        numIntraNeighbor += (int)(bNeighborFlags[numUnitsInCU * 2]);
+        numIntraNeighbor += isAboveAvailableCIP(cu, partIdxLT, partIdxRT, bNeighborFlags + (numUnitsInCU * 2) + 1);
+        numIntraNeighbor += isAboveRightAvailableCIP(cu, partIdxLT, partIdxRT, bNeighborFlags + (numUnitsInCU * 3) + 1);
+        numIntraNeighbor += isLeftAvailableCIP(cu, partIdxLT, partIdxLB, bNeighborFlags + (numUnitsInCU * 2) - 1);
+        numIntraNeighbor += isBelowLeftAvailableCIP(cu, partIdxLT, partIdxLB, bNeighborFlags + numUnitsInCU   - 1);
+    }
 
     width = cuWidth2 + 1;
     height = cuHeight2 + 1;
@@ -229,12 +241,24 @@ void TComPattern::initAdiPatternChroma(T
     numUnitsInCU  = (cuWidth / unitSize) >> cu->getHorzChromaShift();           // for chroma
     totalUnits    = (numUnitsInCU << 2) + 1;
 
-    bNeighborFlags[numUnitsInCU * 2] = isAboveLeftAvailable(cu, partIdxLT);
-    numIntraNeighbor += (int)(bNeighborFlags[numUnitsInCU * 2]);
-    numIntraNeighbor += isAboveAvailable(cu, partIdxLT, partIdxRT, bNeighborFlags + (numUnitsInCU * 2) + 1);
-    numIntraNeighbor += isAboveRightAvailable(cu, partIdxLT, partIdxRT, bNeighborFlags + (numUnitsInCU * 3) + 1);
-    numIntraNeighbor += isLeftAvailable(cu, partIdxLT, partIdxLB, bNeighborFlags + (numUnitsInCU * 2) - 1);
-    numIntraNeighbor += isBelowLeftAvailable(cu, partIdxLT, partIdxLB, bNeighborFlags + numUnitsInCU   - 1);
+    if (!cu->getSlice()->getPPS()->getConstrainedIntraPred())
+    {
+        bNeighborFlags[numUnitsInCU * 2] = isAboveLeftAvailable(cu, partIdxLT);
+        numIntraNeighbor += (int)(bNeighborFlags[numUnitsInCU * 2]);
+        numIntraNeighbor += isAboveAvailable(cu, partIdxLT, partIdxRT, bNeighborFlags + (numUnitsInCU * 2) + 1);
+        numIntraNeighbor += isAboveRightAvailable(cu, partIdxLT, partIdxRT, bNeighborFlags + (numUnitsInCU * 3) + 1);
+        numIntraNeighbor += isLeftAvailable(cu, partIdxLT, partIdxLB, bNeighborFlags + (numUnitsInCU * 2) - 1);
+        numIntraNeighbor += isBelowLeftAvailable(cu, partIdxLT, partIdxLB, bNeighborFlags + numUnitsInCU   - 1);
+    }
+    else
+    {
+        bNeighborFlags[numUnitsInCU * 2] = isAboveLeftAvailableCIP(cu, partIdxLT);
+        numIntraNeighbor += (int)(bNeighborFlags[numUnitsInCU * 2]);
+        numIntraNeighbor += isAboveAvailableCIP(cu, partIdxLT, partIdxRT, bNeighborFlags + (numUnitsInCU * 2) + 1);
+        numIntraNeighbor += isAboveRightAvailableCIP(cu, partIdxLT, partIdxRT, bNeighborFlags + (numUnitsInCU * 3) + 1);
+        numIntraNeighbor += isLeftAvailableCIP(cu, partIdxLT, partIdxLB, bNeighborFlags + (numUnitsInCU * 2) - 1);
+        numIntraNeighbor += isBelowLeftAvailableCIP(cu, partIdxLT, partIdxLB, bNeighborFlags + numUnitsInCU   - 1);
+    }
 
     cuWidth = cuWidth >> cu->getHorzChromaShift(); // for chroma
     cuHeight = cuHeight >> cu->getVertChromaShift(); // for chroma
@@ -415,19 +439,10 @@ void TComPattern::fillReferenceSamples(p
 
 bool TComPattern::isAboveLeftAvailable(TComDataCU* cu, uint32_t partIdxLT)
 {
-    bool bAboveLeftFlag;
     uint32_t partAboveLeft;
     TComDataCU* pcCUAboveLeft = cu->getPUAboveLeft(partAboveLeft, partIdxLT);
 
-    if (cu->getSlice()->getPPS()->getConstrainedIntraPred())
-    {
-        bAboveLeftFlag = (pcCUAboveLeft && pcCUAboveLeft->getPredictionMode(partAboveLeft) == MODE_INTRA);
-    }
-    else
-    {
-        bAboveLeftFlag = (pcCUAboveLeft ? true : false);
-    }
-    return bAboveLeftFlag;
+    return (pcCUAboveLeft ? true : false);
 }
 
 int TComPattern::isAboveAvailable(TComDataCU* cu, uint32_t partIdxLT, uint32_t partIdxRT, bool *bValidFlags)
@@ -442,29 +457,14 @@ int TComPattern::isAboveAvailable(TComDa
     {
         uint32_t uiPartAbove;
         TComDataCU* pcCUAbove = cu->getPUAbove(uiPartAbove, g_rasterToZscan[rasterPart]);
-        if (cu->getSlice()->getPPS()->getConstrainedIntraPred())
+        if (pcCUAbove)
         {
-            if (pcCUAbove && pcCUAbove->getPredictionMode(uiPartAbove) == MODE_INTRA)
-            {
-                numIntra++;
-                *validFlagPtr = true;
-            }
-            else
-            {
-                *validFlagPtr = false;
-            }
+            numIntra++;
+            *validFlagPtr = true;
         }
         else
         {
-            if (pcCUAbove)
-            {
-                numIntra++;
-                *validFlagPtr = true;
-            }
-            else
-            {
-                *validFlagPtr = false;
-            }
+            *validFlagPtr = false;
         }
         validFlagPtr++;
     }
@@ -484,29 +484,14 @@ int TComPattern::isLeftAvailable(TComDat
     {
         uint32_t partLeft;
         TComDataCU* pcCULeft = cu->getPULeft(partLeft, g_rasterToZscan[rasterPart]);
-        if (cu->getSlice()->getPPS()->getConstrainedIntraPred())
+        if (pcCULeft)
         {
-            if (pcCULeft && pcCULeft->getPredictionMode(partLeft) == MODE_INTRA)
-            {
-                numIntra++;
-                *validFlagPtr = true;
-            }
-            else
-            {
-                *validFlagPtr = false;
-            }
+            numIntra++;
+            *validFlagPtr = true;
         }
         else
         {
-            if (pcCULeft)
-            {
-                numIntra++;
-                *validFlagPtr = true;
-            }
-            else
-            {
-                *validFlagPtr = false;
-            }
+            *validFlagPtr = false;
         }
         validFlagPtr--; // opposite direction
     }
@@ -524,29 +509,14 @@ int TComPattern::isAboveRightAvailable(T
     {
         uint32_t uiPartAboveRight;
         TComDataCU* pcCUAboveRight = cu->getPUAboveRightAdi(uiPartAboveRight, partIdxRT, offset);
-        if (cu->getSlice()->getPPS()->getConstrainedIntraPred())
+        if (pcCUAboveRight)
         {
-            if (pcCUAboveRight && pcCUAboveRight->getPredictionMode(uiPartAboveRight) == MODE_INTRA)
-            {
-                numIntra++;
-                *validFlagPtr = true;
-            }
-            else
-            {
-                *validFlagPtr = false;
-            }
+            numIntra++;
+            *validFlagPtr = true;
         }
         else
         {
-            if (pcCUAboveRight)
-            {
-                numIntra++;
-                *validFlagPtr = true;
-            }
-            else
-            {
-                *validFlagPtr = false;
-            }
+            *validFlagPtr = false;
         }
         validFlagPtr++;
     }
@@ -564,29 +534,126 @@ int TComPattern::isBelowLeftAvailable(TC


More information about the x265-commits mailing list