[x265] [PATCH 1 of 4] cu, search: remove redundant m_rdGoOnSbacCoder pointer

2014-07-10 Thread Steve Borho
# HG changeset patch
# User Steve Borho st...@borho.org
# Date 1405031594 18000
#  Thu Jul 10 17:33:14 2014 -0500
# Node ID d6c423c66e4d5a06dc4dccbd9eade7a21f9c8adf
# Parent  57a4c1c2274ec6b40f4a138523c6b67ffa853e09
cu, search: remove redundant m_rdGoOnSbacCoder pointer

m_rdGoOnSbacCoder was always either pointing to the same SBac as m_sbacCoder
(for calls to compressCU()) or it was supposed to be unused (for calls to
encodeCU)

diff -r 57a4c1c2274e -r d6c423c66e4d source/Lib/TLibEncoder/TEncCu.cpp
--- a/source/Lib/TLibEncoder/TEncCu.cpp Thu Jul 10 14:13:30 2014 -0500
+++ b/source/Lib/TLibEncoder/TEncCu.cpp Thu Jul 10 17:33:14 2014 -0500
@@ -75,7 +75,6 @@
 m_rdCost  = NULL;
 m_sbacCoder   = NULL;
 m_rdSbacCoders= NULL;
-m_rdGoOnSbacCoder = NULL;
 m_bBitCounting= false;
 }
 
@@ -1348,7 +1347,7 @@
 // Encode Coefficients
 bool bEncodeDQP = m_bEncodeDQP;
 m_sbacCoder-codeCoeff(outTempCU, 0, depth, outTempCU-getCUSize(0), 
bEncodeDQP);
-m_rdGoOnSbacCoder-store(m_rdSbacCoders[depth][CI_TEMP_BEST]);
+m_sbacCoder-store(m_rdSbacCoders[depth][CI_TEMP_BEST]);
 outTempCU-m_totalBits = m_sbacCoder-getNumberOfWrittenBits();
 outTempCU-m_coeffBits = outTempCU-m_totalBits - outTempCU-m_mvBits;
 
@@ -1397,7 +1396,7 @@
 // Encode Coefficients
 bool bCodeDQP = m_bEncodeDQP;
 m_sbacCoder-codeCoeff(outTempCU, 0, depth, outTempCU-getCUSize(0), 
bCodeDQP);
-m_rdGoOnSbacCoder-store(m_rdSbacCoders[depth][CI_TEMP_BEST]);
+m_sbacCoder-store(m_rdSbacCoders[depth][CI_TEMP_BEST]);
 outTempCU-m_totalBits = m_sbacCoder-getNumberOfWrittenBits();
 outTempCU-m_coeffBits = outTempCU-m_totalBits - outTempCU-m_mvBits;
 
diff -r 57a4c1c2274e -r d6c423c66e4d source/Lib/TLibEncoder/TEncCu.h
--- a/source/Lib/TLibEncoder/TEncCu.h   Thu Jul 10 14:13:30 2014 -0500
+++ b/source/Lib/TLibEncoder/TEncCu.h   Thu Jul 10 17:33:14 2014 -0500
@@ -124,7 +124,6 @@
 
 // RD SBac pointers
 SBac   (*m_rdSbacCoders)[CI_NUM];
-SBac*m_rdGoOnSbacCoder;
 
 uint8_t  m_totalDepth;
 
diff -r 57a4c1c2274e -r d6c423c66e4d source/Lib/TLibEncoder/TEncSearch.cpp
--- a/source/Lib/TLibEncoder/TEncSearch.cpp Thu Jul 10 14:13:30 2014 -0500
+++ b/source/Lib/TLibEncoder/TEncSearch.cpp Thu Jul 10 17:33:14 2014 -0500
@@ -68,7 +68,6 @@
 m_trQuant = NULL;
 m_sbacCoder = NULL;
 m_rdSbacCoders = NULL;
-m_rdGoOnSbacCoder = NULL;
 m_numLayers = 0;
 }
 
@@ -636,7 +635,7 @@
 if (checkTransformSkip || checkTQbypass)
 {
 //- store original entropy coding status -
-
m_rdGoOnSbacCoder-store(m_rdSbacCoders[fullDepth][CI_QT_TRAFO_ROOT]);
+m_sbacCoder-store(m_rdSbacCoders[fullDepth][CI_QT_TRAFO_ROOT]);
 
 uint32_t  singleDistYTmp = 0;
 uint32_t  singlePsyEnergyYTmp = 0;
@@ -694,10 +693,10 @@
 bestTQbypass = singleTQbypass;
 bestModeId   = modeId;
 if (bestModeId == firstCheckId)
-
m_rdGoOnSbacCoder-store(m_rdSbacCoders[fullDepth][CI_TEMP_BEST]);
+
m_sbacCoder-store(m_rdSbacCoders[fullDepth][CI_TEMP_BEST]);
 }
 if (modeId == firstCheckId)
-
m_rdGoOnSbacCoder-load(m_rdSbacCoders[fullDepth][CI_QT_TRAFO_ROOT]);
+
m_sbacCoder-load(m_rdSbacCoders[fullDepth][CI_QT_TRAFO_ROOT]);
 }
 
 cu-setTransformSkipSubParts(checkTransformSkip ? bestModeId : 0, 
TEXT_LUMA, absPartIdx, fullDepth);
@@ -708,7 +707,7 @@
 {
 xLoadIntraResultQT(cu, absPartIdx, log2TrSize, reconQt, 
reconQtStride);
 cu-setCbfSubParts(singleCbfY  trDepth, TEXT_LUMA, 
absPartIdx, fullDepth);
-
m_rdGoOnSbacCoder-load(m_rdSbacCoders[fullDepth][CI_TEMP_BEST]);
+m_sbacCoder-load(m_rdSbacCoders[fullDepth][CI_TEMP_BEST]);
 }
 else
 {
@@ -719,7 +718,7 @@
 }
 else
 {
-
m_rdGoOnSbacCoder-store(m_rdSbacCoders[fullDepth][CI_QT_TRAFO_ROOT]);
+m_sbacCoder-store(m_rdSbacCoders[fullDepth][CI_QT_TRAFO_ROOT]);
 
 //- code luma block with given intra prediction mode and store 
Cbf-
 cu-setTransformSkipSubParts(0, TEXT_LUMA, absPartIdx, fullDepth);
@@ -748,11 +747,11 @@
 //- store full entropy coding status, load original entropy coding 
status -
 if (bCheckFull)
 {
-
m_rdGoOnSbacCoder-store(m_rdSbacCoders[fullDepth][CI_QT_TRAFO_TEST]);
-
m_rdGoOnSbacCoder-load(m_rdSbacCoders[fullDepth][CI_QT_TRAFO_ROOT]);
+m_sbacCoder-store(m_rdSbacCoders[fullDepth][CI_QT_TRAFO_TEST]);
+m_sbacCoder-load(m_rdSbacCoders[fullDepth][CI_QT_TRAFO_ROOT]);
 }
 else
-
m_rdGoOnSbacCoder-store(m_rdSbacCoders[fullDepth][CI_QT_TRAFO_ROOT]);
+

Re: [x265] [PATCH 1 of 4] cu, search: remove redundant m_rdGoOnSbacCoder pointer

2014-07-10 Thread Deepthi Nandakumar
This series is awesome...


On Fri, Jul 11, 2014 at 6:00 AM, Steve Borho st...@borho.org wrote:

 # HG changeset patch
 # User Steve Borho st...@borho.org
 # Date 1405031594 18000
 #  Thu Jul 10 17:33:14 2014 -0500
 # Node ID d6c423c66e4d5a06dc4dccbd9eade7a21f9c8adf
 # Parent  57a4c1c2274ec6b40f4a138523c6b67ffa853e09
 cu, search: remove redundant m_rdGoOnSbacCoder pointer

 m_rdGoOnSbacCoder was always either pointing to the same SBac as
 m_sbacCoder
 (for calls to compressCU()) or it was supposed to be unused (for calls to
 encodeCU)

 diff -r 57a4c1c2274e -r d6c423c66e4d source/Lib/TLibEncoder/TEncCu.cpp
 --- a/source/Lib/TLibEncoder/TEncCu.cpp Thu Jul 10 14:13:30 2014 -0500
 +++ b/source/Lib/TLibEncoder/TEncCu.cpp Thu Jul 10 17:33:14 2014 -0500
 @@ -75,7 +75,6 @@
  m_rdCost  = NULL;
  m_sbacCoder   = NULL;
  m_rdSbacCoders= NULL;
 -m_rdGoOnSbacCoder = NULL;
  m_bBitCounting= false;
  }

 @@ -1348,7 +1347,7 @@
  // Encode Coefficients
  bool bEncodeDQP = m_bEncodeDQP;
  m_sbacCoder-codeCoeff(outTempCU, 0, depth, outTempCU-getCUSize(0),
 bEncodeDQP);
 -m_rdGoOnSbacCoder-store(m_rdSbacCoders[depth][CI_TEMP_BEST]);
 +m_sbacCoder-store(m_rdSbacCoders[depth][CI_TEMP_BEST]);
  outTempCU-m_totalBits = m_sbacCoder-getNumberOfWrittenBits();
  outTempCU-m_coeffBits = outTempCU-m_totalBits - outTempCU-m_mvBits;

 @@ -1397,7 +1396,7 @@
  // Encode Coefficients
  bool bCodeDQP = m_bEncodeDQP;
  m_sbacCoder-codeCoeff(outTempCU, 0, depth, outTempCU-getCUSize(0),
 bCodeDQP);
 -m_rdGoOnSbacCoder-store(m_rdSbacCoders[depth][CI_TEMP_BEST]);
 +m_sbacCoder-store(m_rdSbacCoders[depth][CI_TEMP_BEST]);
  outTempCU-m_totalBits = m_sbacCoder-getNumberOfWrittenBits();
  outTempCU-m_coeffBits = outTempCU-m_totalBits - outTempCU-m_mvBits;

 diff -r 57a4c1c2274e -r d6c423c66e4d source/Lib/TLibEncoder/TEncCu.h
 --- a/source/Lib/TLibEncoder/TEncCu.h   Thu Jul 10 14:13:30 2014 -0500
 +++ b/source/Lib/TLibEncoder/TEncCu.h   Thu Jul 10 17:33:14 2014 -0500
 @@ -124,7 +124,6 @@

  // RD SBac pointers
  SBac   (*m_rdSbacCoders)[CI_NUM];
 -SBac*m_rdGoOnSbacCoder;

  uint8_t  m_totalDepth;

 diff -r 57a4c1c2274e -r d6c423c66e4d source/Lib/TLibEncoder/TEncSearch.cpp
 --- a/source/Lib/TLibEncoder/TEncSearch.cpp Thu Jul 10 14:13:30 2014
 -0500
 +++ b/source/Lib/TLibEncoder/TEncSearch.cpp Thu Jul 10 17:33:14 2014
 -0500
 @@ -68,7 +68,6 @@
  m_trQuant = NULL;
  m_sbacCoder = NULL;
  m_rdSbacCoders = NULL;
 -m_rdGoOnSbacCoder = NULL;
  m_numLayers = 0;
  }

 @@ -636,7 +635,7 @@
  if (checkTransformSkip || checkTQbypass)
  {
  //- store original entropy coding status -
 -
  m_rdGoOnSbacCoder-store(m_rdSbacCoders[fullDepth][CI_QT_TRAFO_ROOT]);
 +
  m_sbacCoder-store(m_rdSbacCoders[fullDepth][CI_QT_TRAFO_ROOT]);

  uint32_t  singleDistYTmp = 0;
  uint32_t  singlePsyEnergyYTmp = 0;
 @@ -694,10 +693,10 @@
  bestTQbypass = singleTQbypass;
  bestModeId   = modeId;
  if (bestModeId == firstCheckId)
 -
  m_rdGoOnSbacCoder-store(m_rdSbacCoders[fullDepth][CI_TEMP_BEST]);
 +
  m_sbacCoder-store(m_rdSbacCoders[fullDepth][CI_TEMP_BEST]);
  }
  if (modeId == firstCheckId)
 -
  m_rdGoOnSbacCoder-load(m_rdSbacCoders[fullDepth][CI_QT_TRAFO_ROOT]);
 +
  m_sbacCoder-load(m_rdSbacCoders[fullDepth][CI_QT_TRAFO_ROOT]);
  }

  cu-setTransformSkipSubParts(checkTransformSkip ? bestModeId
 : 0, TEXT_LUMA, absPartIdx, fullDepth);
 @@ -708,7 +707,7 @@
  {
  xLoadIntraResultQT(cu, absPartIdx, log2TrSize, reconQt,
 reconQtStride);
  cu-setCbfSubParts(singleCbfY  trDepth, TEXT_LUMA,
 absPartIdx, fullDepth);
 -
  m_rdGoOnSbacCoder-load(m_rdSbacCoders[fullDepth][CI_TEMP_BEST]);
 +
  m_sbacCoder-load(m_rdSbacCoders[fullDepth][CI_TEMP_BEST]);
  }
  else
  {
 @@ -719,7 +718,7 @@
  }
  else
  {
 -
  m_rdGoOnSbacCoder-store(m_rdSbacCoders[fullDepth][CI_QT_TRAFO_ROOT]);
 +
  m_sbacCoder-store(m_rdSbacCoders[fullDepth][CI_QT_TRAFO_ROOT]);

  //- code luma block with given intra prediction mode and
 store Cbf-
  cu-setTransformSkipSubParts(0, TEXT_LUMA, absPartIdx,
 fullDepth);
 @@ -748,11 +747,11 @@
  //- store full entropy coding status, load original entropy
 coding status -
  if (bCheckFull)
  {
 -
  m_rdGoOnSbacCoder-store(m_rdSbacCoders[fullDepth][CI_QT_TRAFO_TEST]);
 -
  m_rdGoOnSbacCoder-load(m_rdSbacCoders[fullDepth][CI_QT_TRAFO_ROOT]);
 +
  m_sbacCoder-store(m_rdSbacCoders[fullDepth][CI_QT_TRAFO_TEST]);
 +
  m_sbacCoder-load(m_rdSbacCoders[fullDepth][CI_QT_TRAFO_ROOT]);
  }
  else
 -
  m_rdGoOnSbacCoder-store(m_rdSbacCoders[fullDepth][CI_QT_TRAFO_ROOT]);
 +