[x265] cli: add --ipratio and --pbratio

2014-06-26 Thread Satoshi Nakagawa
# HG changeset patch
# User Satoshi Nakagawa nakagawa...@oki.com
# Date 1403706071 -32400
#  Wed Jun 25 23:21:11 2014 +0900
# Node ID 3ca045895945f0afc6b4d1b1868feb00382796a3
# Parent  09450ac6dc7d0f495582bf327488612755df1719
cli: add --ipratio and --pbratio

diff -r 09450ac6dc7d -r 3ca045895945 source/common/param.cpp
--- a/source/common/param.cpp   Tue Jun 24 15:41:55 2014 +0900
+++ b/source/common/param.cpp   Wed Jun 25 23:21:11 2014 +0900
@@ -633,6 +633,8 @@
 OPT(aud) p-bEnableAccessUnitDelimiters = atobool(value);
 OPT(b-pyramid) p-bBPyramid = atobool(value);
 OPT(hrd) p-bEmitHRDSEI = atobool(value);
+OPT2(ipratio, ip-factor) p-rc.ipFactor = atof(value);
+OPT2(pbratio, pb-factor) p-rc.pbFactor = atof(value);
 OPT(aq-mode) p-rc.aqMode = atoi(value);
 OPT(aq-strength) p-rc.aqStrength = atof(value);
 OPT(vbv-maxrate) p-rc.vbvMaxBitrate = atoi(value);
diff -r 09450ac6dc7d -r 3ca045895945 source/x265.cpp
--- a/source/x265.cpp   Tue Jun 24 15:41:55 2014 +0900
+++ b/source/x265.cpp   Wed Jun 25 23:21:11 2014 +0900
@@ -142,6 +142,8 @@
 { qp, required_argument, NULL, 'q' },
 { aq-mode,required_argument, NULL, 0 },
 { aq-strength,required_argument, NULL, 0 },
+{ ipratio,required_argument, NULL, 0 },
+{ pbratio,required_argument, NULL, 0 },
 { cbqpoffs,   required_argument, NULL, 0 },
 { crqpoffs,   required_argument, NULL, 0 },
 { rd, required_argument, NULL, 0 },
@@ -394,6 +396,8 @@
 H0(   --aq-mode integer   Mode for Adaptive Quantization - 
0:none 1:uniform AQ 2:auto variance. Default %d\n, param-rc.aqMode);
 H0(   --aq-strength float Reduces blocking and blurring in flat 
and textured areas.(0 to 3.0). Default %f\n, param-rc.aqStrength);
 H0(   --[no-]cutree Enable cutree for Adaptive 
Quantization. Default %s\n, OPT(param-rc.cuTree));
+H0(   --ipratio float QP factor between I and P. Default 
%f\n, param-rc.ipFactor);
+H0(   --pbratio float QP factor between P and B. Default 
%f\n, param-rc.pbFactor);
 H0(   --cbqpoffs integer  Chroma Cb QP Offset. Default %d\n, 
param-cbQpOffset);
 H0(   --crqpoffs integer  Chroma Cr QP Offset. Default %d\n, 
param-crQpOffset);
 H0(   --[no-]hrdEnable HRD parameters signalling. 
Default %s\n, OPT(param-bEmitHRDSEI));
___
x265-devel mailing list
x265-devel@videolan.org
https://mailman.videolan.org/listinfo/x265-devel


Re: [x265] [PATCH 2 of 3] rc: accumulate mv bits, coeff bits per frame

2014-06-26 Thread Deepthi Nandakumar
Pls fix extra newlines and whitespace nits.


On Wed, Jun 25, 2014 at 10:54 PM, aar...@multicorewareinc.com wrote:

 # HG changeset patch
 # User Aarthi Thirumalaiaar...@multicorewareinc.com
 # Date 1403716735 -19800
 #  Wed Jun 25 22:48:55 2014 +0530
 # Node ID 0995efabd44470c1192994e1aceeb40ae606467f
 # Parent  e71e34d02de228eab43edf1910a71a44417d
 rc: accumulate mv bits, coeff bits per frame.

 diff -r e71e34d02d77 -r 0995efabd444 source/Lib/TLibEncoder/TEncCu.cpp
 --- a/source/Lib/TLibEncoder/TEncCu.cpp Wed Jun 25 22:46:45 2014 +0530
 +++ b/source/Lib/TLibEncoder/TEncCu.cpp Wed Jun 25 22:48:55 2014 +0530
 @@ -555,6 +555,7 @@
  m_entropyCoder-resetBits();
  m_entropyCoder-encodeSplitFlag(outBestCU, 0, depth);
  outBestCU-m_totalBits +=
 m_entropyCoder-getNumberOfWrittenBits(); // split bits
 +
  if (m_rdCost-psyRdEnabled())
  {
  outBestCU-m_totalPsyCost =
 m_rdCost-calcPsyRdCost(outBestCU-m_totalDistortion,
 outBestCU-m_totalBits,
 @@ -616,7 +617,7 @@
  m_entropyCoder-encodeSplitFlag(outTempCU, 0, depth);
  outTempCU-m_totalBits +=
 m_entropyCoder-getNumberOfWrittenBits(); // split bits
  }
 -
 +
  if (m_rdCost-psyRdEnabled())
  {
  outTempCU-m_totalPsyCost =
 m_rdCost-calcPsyRdCost(outTempCU-m_totalDistortion,
 outTempCU-m_totalBits,
 @@ -907,6 +908,7 @@
  m_entropyCoder-resetBits();
  m_entropyCoder-encodeSplitFlag(outBestCU, 0, depth);
  outBestCU-m_totalBits +=
 m_entropyCoder-getNumberOfWrittenBits(); // split bits
 +
  if (m_rdCost-psyRdEnabled())
  {
  outBestCU-m_totalPsyCost =
 m_rdCost-calcPsyRdCost(outBestCU-m_totalDistortion,
 outBestCU-m_totalBits,
 @@ -1168,6 +1170,7 @@
  return;
  }

 +
  if (slice-getPPS()-getTransquantBypassEnableFlag())
  {
  m_entropyCoder-encodeCUTransquantBypassFlag(cu, absPartIdx);
 @@ -1390,12 +1393,14 @@
  m_entropyCoder-encodePartSize(outTempCU, 0, depth);
  m_entropyCoder-encodePredInfo(outTempCU, 0);
  m_entropyCoder-encodeIPCMInfo(outTempCU, 0);
 +outTempCU-m_mvBits = m_entropyCoder-getNumberOfWrittenBits();

  // Encode Coefficients
  bool bCodeDQP = getdQPFlag();
  m_entropyCoder-encodeCoeff(outTempCU, 0, depth,
 outTempCU-getCUSize(0), bCodeDQP);
  m_rdGoOnSbacCoder-store(m_rdSbacCoders[depth][CI_TEMP_BEST]);
  outTempCU-m_totalBits = m_entropyCoder-getNumberOfWrittenBits();
 +outTempCU-m_coeffBits = outTempCU-m_totalBits - outTempCU-m_mvBits;

  if (m_rdCost-psyRdEnabled())
  {
 @@ -1437,12 +1442,13 @@
  m_entropyCoder-encodePartSize(outTempCU, 0, depth);
  m_entropyCoder-encodePredInfo(outTempCU, 0);
  m_entropyCoder-encodeIPCMInfo(outTempCU, 0);
 -
 +outTempCU-m_mvBits = m_entropyCoder-getNumberOfWrittenBits();
  // Encode Coefficients
  bool bCodeDQP = getdQPFlag();
  m_entropyCoder-encodeCoeff(outTempCU, 0, depth,
 outTempCU-getCUSize(0), bCodeDQP);
  m_rdGoOnSbacCoder-store(m_rdSbacCoders[depth][CI_TEMP_BEST]);
  outTempCU-m_totalBits = m_entropyCoder-getNumberOfWrittenBits();
 +outTempCU-m_coeffBits = outTempCU-m_totalBits - outTempCU-m_mvBits;

  if (m_rdCost-psyRdEnabled())
  {
 @@ -1492,12 +1498,14 @@
  m_entropyCoder-encodeSkipFlag(outTempCU, 0);
  m_entropyCoder-encodePredMode(outTempCU, 0);
  m_entropyCoder-encodePartSize(outTempCU, 0, depth);
 +outTempCU-m_mvBits = m_entropyCoder-getNumberOfWrittenBits();
  m_entropyCoder-encodeIPCMInfo(outTempCU, 0);

  m_rdGoOnSbacCoder-store(m_rdSbacCoders[depth][CI_TEMP_BEST]);

  outTempCU-m_totalBits = m_entropyCoder-getNumberOfWrittenBits();
  outTempCU-m_totalRDCost =
 m_rdCost-calcRdCost(outTempCU-m_totalDistortion, outTempCU-m_totalBits);
 +outTempCU-m_coeffBits = outTempCU-m_totalBits - outTempCU-m_mvBits;

  xCheckDQP(outTempCU);
  xCheckBestMode(outBestCU, outTempCU, depth);
 diff -r e71e34d02d77 -r 0995efabd444 source/Lib/TLibEncoder/TEncSearch.cpp
 --- a/source/Lib/TLibEncoder/TEncSearch.cpp Wed Jun 25 22:46:45 2014
 +0530
 +++ b/source/Lib/TLibEncoder/TEncSearch.cpp Wed Jun 25 22:48:55 2014
 +0530
 @@ -4211,6 +4211,7 @@
  }
  m_entropyCoder-encodeSkipFlag(cu, 0);
  m_entropyCoder-encodeMergeIndex(cu, 0);
 +cu-m_mvBits = m_entropyCoder-getNumberOfWrittenBits();
  return m_entropyCoder-getNumberOfWrittenBits();
  }
  else
 @@ -4225,8 +4226,11 @@
  m_entropyCoder-encodePartSize(cu, 0, cu-getDepth(0));
  m_entropyCoder-encodePredInfo(cu, 0);
  bool bDummy = false;
 +cu-m_mvBits = m_entropyCoder-getNumberOfWrittenBits();
  m_entropyCoder-encodeCoeff(cu, 0, cu-getDepth(0),
 cu-getCUSize(0), bDummy);
 -return m_entropyCoder-getNumberOfWrittenBits();
 +int totalBits = m_entropyCoder-getNumberOfWrittenBits();
 +cu-m_coeffBits = totalBits - 

[x265] v1.1+202: Variable shadowing warning (MSYS GCC)

2014-06-26 Thread Mario *LigH* Rohkrämer

Compiling with MSYS/MinGW GCC 4.8.2 reports a warning:

+
h:/MSYS/home/Entwicklung/x265/source/Lib/TLibCommon/TComDataCU.cpp: In  
member function 'void x265::TComDataCU::copyToPic(uint8_t)':
h:/MSYS/home/Entwicklung/x265/source/Lib/TLibCommon/TComDataCU.cpp:781:18:  
warning: declaration of 'tmp' shadows a previous local [-Wshadow]

 uint32_t tmp  = (g_maxCUSize * g_maxCUSize)  (depth  1);
  ^
h:/MSYS/home/Entwicklung/x265/source/Lib/TLibCommon/TComDataCU.cpp:770:14:  
warning: shadowed declaration is here [-Wshadow]

 uint32_t tmp  = (g_maxCUSize * g_maxCUSize)  (depth  1);
  ^
h:/MSYS/home/Entwicklung/x265/source/Lib/TLibCommon/TComDataCU.cpp:782:18:  
warning: declaration of 'tmp2' shadows a previous local [-Wshadow]

 uint32_t tmp2 = m_absIdxInLCU  m_pic-getLog2UnitSize() * 2;
  ^
h:/MSYS/home/Entwicklung/x265/source/Lib/TLibCommon/TComDataCU.cpp:771:14:  
warning: shadowed declaration is here [-Wshadow]

 uint32_t tmp2 = m_absIdxInLCU  m_pic-getLog2UnitSize() * 2;
  ^
+

--

Fun and success!
Mario *LigH* Rohkrämer
mailto:cont...@ligh.de

___
x265-devel mailing list
x265-devel@videolan.org
https://mailman.videolan.org/listinfo/x265-devel


Re: [x265] [PATCH 1 of 3] Chroma QP Offset: increase chroma QP when psy-rd is enabled

2014-06-26 Thread Derek Buitenhuis
On 6/26/2014 6:35 AM, BugMaster wrote:
 That is separate --psy (--no-psy) option in x264 and not --psy-rd

Yeah, that was my point. :)

- Derek
___
x265-devel mailing list
x265-devel@videolan.org
https://mailman.videolan.org/listinfo/x265-devel


Re: [x265] cli: add --ipratio and --pbratio

2014-06-26 Thread Derek Buitenhuis
On 6/26/2014 8:22 AM, Satoshi Nakagawa wrote:
 # HG changeset patch
 # User Satoshi Nakagawa nakagawa...@oki.com
 # Date 1403706071 -32400
 #  Wed Jun 25 23:21:11 2014 +0900
 # Node ID 3ca045895945f0afc6b4d1b1868feb00382796a3
 # Parent  09450ac6dc7d0f495582bf327488612755df1719
 cli: add --ipratio and --pbratio

OK patch-wise.

I'm not entirely sure of the value of exposing such options myself,
since usually it's a case of please don't touch these options anyway,
but it's already an API option anyway, so, OK.

Cheers,
- Derek
___
x265-devel mailing list
x265-devel@videolan.org
https://mailman.videolan.org/listinfo/x265-devel


Re: [x265] [PATCH 1 of 3] Chroma QP Offset: increase chroma QP when psy-rd is enabled

2014-06-26 Thread Deepthi Nandakumar
Ok, we dont have a separate psy option.yet
On Jun 26, 2014 6:00 PM, Derek Buitenhuis derek.buitenh...@gmail.com
wrote:

 On 6/26/2014 6:35 AM, BugMaster wrote:
  That is separate --psy (--no-psy) option in x264 and not --psy-rd

 Yeah, that was my point. :)

 - Derek
 ___
 x265-devel mailing list
 x265-devel@videolan.org
 https://mailman.videolan.org/listinfo/x265-devel

___
x265-devel mailing list
x265-devel@videolan.org
https://mailman.videolan.org/listinfo/x265-devel


Re: [x265] [PATCH 2 of 3] rc: accumulate mv bits, coeff bits per frame

2014-06-26 Thread Aarthi Priya Thirumalai
# HG changeset patch
# User Aarthi Thirumalaiaar...@multicorewareinc.com
# Date 1403808050 -19800
#  Fri Jun 27 00:10:50 2014 +0530
# Node ID 11ddf73017d44933090a8943f4fc5098b231b56d
# Parent  1b669c33ff3a8d8f6c9bd1e18979c009baed2433
rc: accumulate mv bits, coeff bits per frame

diff -r 1b669c33ff3a -r 11ddf73017d4 source/Lib/TLibEncoder/TEncCu.cpp
--- a/source/Lib/TLibEncoder/TEncCu.cpp Wed Jun 25 22:46:45 2014 +0530
+++ b/source/Lib/TLibEncoder/TEncCu.cpp Fri Jun 27 00:10:50 2014 +0530
@@ -1365,12 +1365,14 @@
 m_entropyCoder-encodePredMode(outTempCU, 0);
 m_entropyCoder-encodePartSize(outTempCU, 0, depth);
 m_entropyCoder-encodePredInfo(outTempCU, 0);
+outTempCU-m_mvBits = m_entropyCoder-getNumberOfWrittenBits();

 // Encode Coefficients
 bool bCodeDQP = getdQPFlag();
 m_entropyCoder-encodeCoeff(outTempCU, 0, depth,
outTempCU-getCUSize(0), bCodeDQP);
 m_rdGoOnSbacCoder-store(m_rdSbacCoders[depth][CI_TEMP_BEST]);
 outTempCU-m_totalBits = m_entropyCoder-getNumberOfWrittenBits();
+outTempCU-m_coeffBits = outTempCU-m_totalBits - outTempCU-m_mvBits;

 if (m_rdCost-psyRdEnabled())
 {
@@ -1411,12 +1413,14 @@
 m_entropyCoder-encodePredMode(outTempCU, 0);
 m_entropyCoder-encodePartSize(outTempCU, 0, depth);
 m_entropyCoder-encodePredInfo(outTempCU, 0);
+outTempCU-m_mvBits = m_entropyCoder-getNumberOfWrittenBits();

 // Encode Coefficients
 bool bCodeDQP = getdQPFlag();
 m_entropyCoder-encodeCoeff(outTempCU, 0, depth,
outTempCU-getCUSize(0), bCodeDQP);
 m_rdGoOnSbacCoder-store(m_rdSbacCoders[depth][CI_TEMP_BEST]);
 outTempCU-m_totalBits = m_entropyCoder-getNumberOfWrittenBits();
+outTempCU-m_coeffBits = outTempCU-m_totalBits - outTempCU-m_mvBits;

 if (m_rdCost-psyRdEnabled())
 {
diff -r 1b669c33ff3a -r 11ddf73017d4 source/Lib/TLibEncoder/TEncSearch.cpp
--- a/source/Lib/TLibEncoder/TEncSearch.cpp Wed Jun 25 22:46:45 2014 +0530
+++ b/source/Lib/TLibEncoder/TEncSearch.cpp Fri Jun 27 00:10:50 2014 +0530
@@ -4059,6 +4059,7 @@
 }
 m_entropyCoder-encodeSkipFlag(cu, 0);
 m_entropyCoder-encodeMergeIndex(cu, 0);
+cu-m_mvBits = m_entropyCoder-getNumberOfWrittenBits();
 return m_entropyCoder-getNumberOfWrittenBits();
 }
 else
@@ -4073,8 +4074,11 @@
 m_entropyCoder-encodePartSize(cu, 0, cu-getDepth(0));
 m_entropyCoder-encodePredInfo(cu, 0);
 bool bDummy = false;
+cu-m_mvBits = m_entropyCoder-getNumberOfWrittenBits();
 m_entropyCoder-encodeCoeff(cu, 0, cu-getDepth(0),
cu-getCUSize(0), bDummy);
-return m_entropyCoder-getNumberOfWrittenBits();
+int totalBits = m_entropyCoder-getNumberOfWrittenBits();
+cu-m_coeffBits = totalBits - cu-m_mvBits;
+return totalBits;
 }
 }

diff -r 1b669c33ff3a -r 11ddf73017d4 source/encoder/compress.cpp
--- a/source/encoder/compress.cpp Wed Jun 25 22:46:45 2014 +0530
+++ b/source/encoder/compress.cpp Fri Jun 27 00:10:50 2014 +0530
@@ -63,6 +63,7 @@
 m_entropyCoder-encodePredMode(cu, 0);
 m_entropyCoder-encodePartSize(cu, 0, depth);
 m_entropyCoder-encodePredInfo(cu, 0);
+cu-m_mvBits += m_entropyCoder-getNumberOfWrittenBits();

 // Encode Coefficients
 bool bCodeDQP = getdQPFlag();
@@ -71,6 +72,7 @@
 m_rdGoOnSbacCoder-store(m_rdSbacCoders[depth][CI_TEMP_BEST]);

 cu-m_totalBits = m_entropyCoder-getNumberOfWrittenBits();
+cu-m_coeffBits = cu-m_totalBits - cu-m_mvBits;
 if (m_rdCost-psyRdEnabled())
 {
 int part = g_convertToBit[cu-getCUSize(0)];
diff -r 1b669c33ff3a -r 11ddf73017d4 source/encoder/frameencoder.cpp
--- a/source/encoder/frameencoder.cpp Wed Jun 25 22:46:45 2014 +0530
+++ b/source/encoder/frameencoder.cpp Fri Jun 27 00:10:50 2014 +0530
@@ -694,6 +694,11 @@
 // Store probabilities of second LCU in line into buffer
 if (col == 1  m_param-bEnableWavefront)
 getBufferSBac(lin)-loadContexts(getSbacCoder(subStrm));
+
+// Collect Frame Stats for 2 pass
+m_frame-m_stats.mvBits += cu-m_mvBits;
+m_frame-m_stats.coeffBits += cu-m_coeffBits;
+m_frame-m_stats.miscBits += cu-m_totalBits - (cu-m_mvBits +
cu-m_coeffBits);
 }

 if (slice-getPPS()-getCabacInitPresentFlag())


On Thu, Jun 26, 2014 at 4:25 PM, Deepthi Nandakumar 
deep...@multicorewareinc.com wrote:

 Pls fix extra newlines and whitespace nits.


 On Wed, Jun 25, 2014 at 10:54 PM, aar...@multicorewareinc.com wrote:

 # HG changeset patch
 # User Aarthi Thirumalaiaar...@multicorewareinc.com
 # Date 1403716735 -19800
 #  Wed Jun 25 22:48:55 2014 +0530
 # Node ID 0995efabd44470c1192994e1aceeb40ae606467f
 # Parent  e71e34d02de228eab43edf1910a71a44417d
 rc: accumulate mv bits, coeff bits per frame.

 diff -r e71e34d02d77 -r 0995efabd444 source/Lib/TLibEncoder/TEncCu.cpp
 --- a/source/Lib/TLibEncoder/TEncCu.cpp Wed Jun 25 22:46:45 2014 +0530
 +++ b/source/Lib/TLibEncoder/TEncCu.cpp Wed Jun 25 22:48:55 

[x265] [PATCH 2 of 2] reduce condition jmp in codeCoeffNxN

2014-06-26 Thread Min Chen
# HG changeset patch
# User Min Chen chenm...@163.com
# Date 1403828348 25200
# Node ID 5e91fb51047f650f07579611d720b45c66b30595
# Parent  5bb8cc1ce689c5fc353809662a1af557e4a9e087
reduce condition jmp in codeCoeffNxN

diff -r 5bb8cc1ce689 -r 5e91fb51047f source/Lib/TLibEncoder/TEncSbac.cpp
--- a/source/Lib/TLibEncoder/TEncSbac.cpp   Thu Jun 26 17:18:50 2014 -0700
+++ b/source/Lib/TLibEncoder/TEncSbac.cpp   Thu Jun 26 17:19:08 2014 -0700
@@ -2028,8 +2028,10 @@
 
 X265_CHECK(trSize = m_slice-getSPS()-getMaxTrSize(), transform size 
out of range\n);
 
+const uint32_t log2TrSize = g_convertToBit[trSize] + 2;
+
 // compute number of significant coefficients
-uint32_t numSig = primitives.count_nonzero(coeff, trSize * trSize);
+uint32_t numSig = primitives.count_nonzero(coeff, (1  (log2TrSize  
1)));
 
 #if CHECKED_BUILD || _DEBUG
 X265_CHECK(numSig  0, cbf check fail\n);
@@ -2050,7 +2052,6 @@
 }
 
 ttype = ttype == TEXT_LUMA ? TEXT_LUMA : TEXT_CHROMA;
-const uint32_t log2TrSize = g_convertToBit[trSize] + 2;
 
 //select scans
 TUEntropyCodingParameters codingParameters;
@@ -2059,27 +2060,27 @@
 //- encode significance map -
 
 // Find position of last coefficient
-int scanPosLast = -1;
-int posLast;
+int scanPosLast = 0;
+uint32_t posLast;
 uint64_t sigCoeffGroupFlag64 = 0;
-const uint32_t maskPosXY = (1  (log2TrSize - MLS_CG_LOG2_SIZE)) - 1;
+const uint32_t maskPosXY = ((uint32_t)~0  (31 - log2TrSize + 
MLS_CG_LOG2_SIZE))  1;
+assert(((1  (log2TrSize - MLS_CG_LOG2_SIZE)) - 1) == (((uint32_t)~0  
(31 - log2TrSize + MLS_CG_LOG2_SIZE))  1));
 do
 {
-posLast = codingParameters.scan[++scanPosLast];
-if (coeff[posLast] != 0)
-{
-// get L1 sig map
-// NOTE: the new algorithm is complicated, so I keep reference 
code here
-//uint32_t posy   = posLast  log2TrSize;
-//uint32_t posx   = posLast - (posy  log2TrSize);
-//uint32_t blkIdx0 = ((posy  MLS_CG_LOG2_SIZE)  
codingParameters.log2TrSizeCG) + (posx  MLS_CG_LOG2_SIZE);
-uint32_t blkIdx = ((posLast  (2 * MLS_CG_LOG2_SIZE))  
~maskPosXY) + ((posLast  MLS_CG_LOG2_SIZE)  maskPosXY);
-sigCoeffGroupFlag64 |= ((uint64_t)1  blkIdx);
+posLast = codingParameters.scan[scanPosLast++];
 
-numSig--;
-}
+const uint32_t isNZCoeff = (coeff[posLast] != 0);
+// get L1 sig map
+// NOTE: the new algorithm is complicated, so I keep reference code 
here
+//uint32_t posy   = posLast  log2TrSize;
+//uint32_t posx   = posLast - (posy  log2TrSize);
+//uint32_t blkIdx0 = ((posy  MLS_CG_LOG2_SIZE)  
codingParameters.log2TrSizeCG) + (posx  MLS_CG_LOG2_SIZE);
+const uint32_t blkIdx = ((posLast  (2 * MLS_CG_LOG2_SIZE))  
~maskPosXY) + ((posLast  MLS_CG_LOG2_SIZE)  maskPosXY);
+sigCoeffGroupFlag64 |= ((uint64_t)isNZCoeff  blkIdx);
+numSig -= isNZCoeff;
 }
 while (numSig  0);
+scanPosLast--;
 
 // Code position of last coefficient
 int posLastY = posLast  log2TrSize;

___
x265-devel mailing list
x265-devel@videolan.org
https://mailman.videolan.org/listinfo/x265-devel


[x265] [PATCH 1 of 2] improve count_nonzero by SSSE3

2014-06-26 Thread Min Chen
# HG changeset patch
# User Min Chen chenm...@163.com
# Date 1403828330 25200
# Node ID 5bb8cc1ce689c5fc353809662a1af557e4a9e087
# Parent  1b669c33ff3a8d8f6c9bd1e18979c009baed2433
improve count_nonzero by SSSE3

diff -r 1b669c33ff3a -r 5bb8cc1ce689 source/common/x86/asm-primitives.cpp
--- a/source/common/x86/asm-primitives.cpp  Wed Jun 25 22:46:45 2014 +0530
+++ b/source/common/x86/asm-primitives.cpp  Thu Jun 26 17:18:50 2014 -0700
@@ -1037,7 +1037,6 @@
 p.dct[DCT_4x4] = x265_dct4_sse2;
 p.idct[IDCT_4x4] = x265_idct4_sse2;
 p.idct[IDST_4x4] = x265_idst4_sse2;
-p.count_nonzero = x265_count_nonzero_sse2;
 
 LUMA_SS_FILTERS(_sse2);
 }
@@ -1050,6 +1049,7 @@
 
 p.dct[DST_4x4] = x265_dst4_ssse3;
 p.idct[IDCT_8x8] = x265_idct8_ssse3;
+p.count_nonzero = x265_count_nonzero_ssse3;
 }
 if (cpuMask  X265_CPU_SSE4)
 {
@@ -1173,7 +1173,6 @@
 p.dct[DCT_4x4] = x265_dct4_sse2;
 p.idct[IDCT_4x4] = x265_idct4_sse2;
 p.idct[IDST_4x4] = x265_idst4_sse2;
-p.count_nonzero = x265_count_nonzero_sse2;
 p.planecopy_sp = x265_downShift_16_sse2;
 }
 if (cpuMask  X265_CPU_SSSE3)
@@ -1208,6 +1207,7 @@
 
 p.dct[DST_4x4] = x265_dst4_ssse3;
 p.idct[IDCT_8x8] = x265_idct8_ssse3;
+p.count_nonzero = x265_count_nonzero_ssse3;
 }
 if (cpuMask  X265_CPU_SSE4)
 {
diff -r 1b669c33ff3a -r 5bb8cc1ce689 source/common/x86/pixel-util.h
--- a/source/common/x86/pixel-util.hWed Jun 25 22:46:45 2014 +0530
+++ b/source/common/x86/pixel-util.hThu Jun 26 17:18:50 2014 -0700
@@ -46,7 +46,7 @@
 
 uint32_t x265_quant_sse4(int32_t *coef, int32_t *quantCoeff, int32_t *deltaU, 
int32_t *qCoef, int qBits, int add, int numCoeff, int32_t* lastPos);
 void x265_dequant_normal_sse4(const int32_t* quantCoef, int32_t* coef, int 
num, int scale, int shift);
-int x265_count_nonzero_sse2(const int32_t *quantCoeff, int numCoeff);
+int x265_count_nonzero_ssse3(const int32_t *quantCoeff, int numCoeff);
 
 void x265_weight_pp_sse4(pixel *src, pixel *dst, intptr_t srcStride, intptr_t 
dstStride, int width, int height, int w0, int round, int shift, int offset);
 void x265_weight_sp_sse4(int16_t *src, pixel *dst, intptr_t srcStride, 
intptr_t dstStride, int width, int height, int w0, int round, int shift, int 
offset);
diff -r 1b669c33ff3a -r 5bb8cc1ce689 source/common/x86/pixel-util8.asm
--- a/source/common/x86/pixel-util8.asm Wed Jun 25 22:46:45 2014 +0530
+++ b/source/common/x86/pixel-util8.asm Thu Jun 26 17:18:50 2014 -0700
@@ -1070,28 +1070,31 @@
 ;-
 ; int count_nonzero(const int32_t *quantCoeff, int numCoeff);
 ;-
-INIT_XMM sse2
-cglobal count_nonzero, 2,2,4
+INIT_XMM ssse3
+cglobal count_nonzero, 2,2,5
 pxorm0, m0
-shr r1d, 3
+shr r1d, 4
 movdm1, r1d
-pshuflw m1, m1, 0
-punpcklqdq  m1, m1
+pshufb  m1, m0
 
 .loop:
-movam2, [r0]
+movam2, [r0 +  0]
 movam3, [r0 + 16]
-add r0, 32
 packssdwm2, m3
-pcmpeqw m2, m0
-paddw   m1, m2
+movam3, [r0 + 32]
+movam4, [r0 + 48]
+add r0, 64
+packssdwm3, m4
+packsswbm2, m3
+pcmpeqb m2, m0
+paddb   m1, m2
 dec r1d
 jnz .loop
 
-packuswbm1, m1
 psadbw  m1, m0
-movdeax, m1
-
+pshufd  m0, m1, 2
+paddd   m0, m1
+movdeax, m0
 RET
 
 

___
x265-devel mailing list
x265-devel@videolan.org
https://mailman.videolan.org/listinfo/x265-devel


[x265] RDOQ enabled rdLevel changed

2014-06-26 Thread Satoshi Nakagawa

Is this change intended?

 # HG changeset patch
 # User Sumalatha Polureddysumala...@multicorewareinc.com
 # Date 1403689018 -19800
 #  Wed Jun 25 15:06:58 2014 +0530
 # Node ID e2ed009d296af39926d79f1a245974f158d6861a
 # Parent  5797d6a8197c96b68752705167ced6cb63194013
 psy-rd: implement psy-rd in rdlevel=4,3 and 2

 diff -r 5797d6a8197c -r e2ed009d296a source/encoder/encoder.cpp
 --- a/source/encoder/encoder.cpp  Wed Jun 25 18:21:34 2014 +0530
 +++ b/source/encoder/encoder.cpp  Wed Jun 25 15:06:58 2014 +0530
 @@ -1267,7 +1267,7 @@
  }
  
  // disable RDOQ if psy-rd is enabled; until we make it psy-aware
 -m_bEnableRDOQ = p-psyRd == 0.0  p-rdLevel = 4;
 +m_bEnableRDOQ = p-psyRd == 0.0  p-rdLevel = 1;
  
  if (p-bLossless)
  {
___
x265-devel mailing list
x265-devel@videolan.org
https://mailman.videolan.org/listinfo/x265-devel


Re: [x265] RDOQ enabled rdLevel changed

2014-06-26 Thread Deepthi Nandakumar
Yes, the rest of the patch added support for lower rd levels.


On Fri, Jun 27, 2014 at 6:17 AM, Satoshi Nakagawa nakagawa...@oki.com
wrote:


 Is this change intended?

  # HG changeset patch
  # User Sumalatha Polureddysumala...@multicorewareinc.com
  # Date 1403689018 -19800
  #  Wed Jun 25 15:06:58 2014 +0530
  # Node ID e2ed009d296af39926d79f1a245974f158d6861a
  # Parent  5797d6a8197c96b68752705167ced6cb63194013
  psy-rd: implement psy-rd in rdlevel=4,3 and 2

  diff -r 5797d6a8197c -r e2ed009d296a source/encoder/encoder.cpp
  --- a/source/encoder/encoder.cpp  Wed Jun 25 18:21:34 2014 +0530
  +++ b/source/encoder/encoder.cpp  Wed Jun 25 15:06:58 2014 +0530
  @@ -1267,7 +1267,7 @@
   }
 
   // disable RDOQ if psy-rd is enabled; until we make it psy-aware
  -m_bEnableRDOQ = p-psyRd == 0.0  p-rdLevel = 4;
  +m_bEnableRDOQ = p-psyRd == 0.0  p-rdLevel = 1;
 
   if (p-bLossless)
   {
 ___
 x265-devel mailing list
 x265-devel@videolan.org
 https://mailman.videolan.org/listinfo/x265-devel

___
x265-devel mailing list
x265-devel@videolan.org
https://mailman.videolan.org/listinfo/x265-devel