[x265] [PATCH 4 of 5] TComDataCU: introduce new variable m_psyEnergy

deepthi at multicorewareinc.com deepthi at multicorewareinc.com
Tue May 27 18:38:18 CEST 2014


# HG changeset patch
# User Deepthi Nandakumar <deepthi at multicorewareinc.com>
# Date 1401187057 -19800
#      Tue May 27 16:07:37 2014 +0530
# Node ID 2ab3e192144abb9b236cb75551ec755676959e97
# Parent  df08fbb4fe09e403f37af6169477401cc3f7afca
TComDataCU: introduce new variable m_psyEnergy

diff -r df08fbb4fe09 -r 2ab3e192144a source/Lib/TLibCommon/TComDataCU.cpp
--- a/source/Lib/TLibCommon/TComDataCU.cpp	Tue May 27 15:17:34 2014 +0530
+++ b/source/Lib/TLibCommon/TComDataCU.cpp	Tue May 27 16:07:37 2014 +0530
@@ -214,6 +214,7 @@
     m_cuPelX           = (cuAddr % pic->getFrameWidthInCU()) * g_maxCUSize;
     m_cuPelY           = (cuAddr / pic->getFrameWidthInCU()) * g_maxCUSize;
     m_absIdxInLCU      = 0;
+    m_psyEnergy        = 0;
     m_totalPsyCost     = MAX_INT64;
     m_totalRDCost      = MAX_INT64;
     m_sa8dCost         = MAX_INT64;
@@ -306,6 +307,7 @@
 */
 void TComDataCU::initEstData(uint32_t depth, int qp)
 {
+    m_psyEnergy        = 0;
     m_totalPsyCost     = MAX_INT64;
     m_totalRDCost      = MAX_INT64;
     m_sa8dCost         = MAX_INT64;
@@ -343,6 +345,7 @@
 
 void TComDataCU::initEstData(uint32_t depth)
 {
+    m_psyEnergy        = 0;
     m_totalPsyCost     = MAX_INT64;
     m_totalRDCost      = MAX_INT64;
     m_sa8dCost         = MAX_INT64;
@@ -392,6 +395,7 @@
     m_cuPelX           = cu->getCUPelX() + (g_maxCUSize >> depth) * (partUnitIdx &  1);
     m_cuPelY           = cu->getCUPelY() + (g_maxCUSize >> depth) * (partUnitIdx >> 1);
 
+    m_psyEnergy        = 0;
     m_totalPsyCost     = MAX_INT64;
     m_totalRDCost      = MAX_INT64;
     m_sa8dCost         = MAX_INT64;
@@ -457,6 +461,7 @@
     m_cuPelX           = cu->getCUPelX() + (g_maxCUSize >> depth) * (partUnitIdx &  1);
     m_cuPelY           = cu->getCUPelY() + (g_maxCUSize >> depth) * (partUnitIdx >> 1);
 
+    m_psyEnergy        = 0;
     m_totalPsyCost     = MAX_INT64;
     m_totalRDCost      = MAX_INT64;
     m_sa8dCost         = MAX_INT64;
@@ -521,6 +526,7 @@
     m_cuPelX           = cu->getCUPelX() + (g_maxCUSize >> depth) * (partUnitIdx & 1);
     m_cuPelY           = cu->getCUPelY() + (g_maxCUSize >> depth) * (partUnitIdx >> 1);
 
+    m_psyEnergy        = 0;
     m_totalPsyCost     = MAX_INT64;
     m_totalRDCost      = MAX_INT64;
     m_sa8dCost         = MAX_INT64;
@@ -557,6 +563,7 @@
         m_totalRDCost  += cu->m_totalRDCost;
     }
 
+    m_psyEnergy        += cu->m_psyEnergy;
     m_totalDistortion  += cu->m_totalDistortion;
     m_totalBits        += cu->m_totalBits;
 
@@ -616,6 +623,7 @@
 {
     TComDataCU* rpcCU = m_pic->getCU(m_cuAddr);
 
+    rpcCU->m_psyEnergy       = m_psyEnergy;
     rpcCU->m_totalPsyCost    = m_totalPsyCost;
     rpcCU->m_totalRDCost     = m_totalRDCost;
     rpcCU->m_totalDistortion = m_totalDistortion;
@@ -702,6 +710,7 @@
     uint32_t partStart = partIdx * qNumPart;
     uint32_t partOffset  = m_absIdxInLCU + partStart;
 
+    cu->m_psyEnergy       = m_psyEnergy;
     cu->m_totalPsyCost    = m_totalPsyCost;
     cu->m_totalRDCost     = m_totalRDCost;
     cu->m_totalDistortion = m_totalDistortion;
diff -r df08fbb4fe09 -r 2ab3e192144a source/Lib/TLibCommon/TComDataCU.h
--- a/source/Lib/TLibCommon/TComDataCU.h	Tue May 27 15:17:34 2014 +0530
+++ b/source/Lib/TLibCommon/TComDataCU.h	Tue May 27 16:07:37 2014 +0530
@@ -165,6 +165,7 @@
     TComDataCU();
     virtual ~TComDataCU();
 
+    uint32_t      m_psyEnergy;
     uint64_t      m_totalPsyCost;
     uint64_t      m_totalRDCost;       ///< sum of partition RD costs
     uint32_t      m_totalDistortion; ///< sum of partition distortion
diff -r df08fbb4fe09 -r 2ab3e192144a source/Lib/TLibEncoder/TEncCu.cpp
--- a/source/Lib/TLibEncoder/TEncCu.cpp	Tue May 27 15:17:34 2014 +0530
+++ b/source/Lib/TLibEncoder/TEncCu.cpp	Tue May 27 16:07:37 2014 +0530
@@ -1392,9 +1392,9 @@
     if (m_rdCost->psyRdEnabled())
     {
         int part = g_convertToBit[outTempCU->getCUSize(0)];
-        uint32_t psyRdCost = m_rdCost->psyCost(part, m_origYuv[depth]->getLumaAddr(), m_origYuv[depth]->getStride(),
+        outTempCU->m_psyEnergy = m_rdCost->psyCost(part, m_origYuv[depth]->getLumaAddr(), m_origYuv[depth]->getStride(),
                                                      m_tmpRecoYuv[depth]->getLumaAddr(), m_tmpRecoYuv[depth]->getStride());
-        outTempCU->m_totalRDCost = m_rdCost->calcPsyRdCost(outTempCU->m_totalDistortion, outTempCU->m_totalBits, psyRdCost);
+        outTempCU->m_totalRDCost = m_rdCost->calcPsyRdCost(outTempCU->m_totalDistortion, outTempCU->m_totalBits, outTempCU->m_psyEnergy);
     }
     else
     {
@@ -1439,9 +1439,9 @@
     if (m_rdCost->psyRdEnabled())
     {
         int part = g_convertToBit[outTempCU->getCUSize(0)];
-        uint32_t psyRdCost = m_rdCost->psyCost(part, m_origYuv[depth]->getLumaAddr(), m_origYuv[depth]->getStride(),
+        outTempCU->m_psyEnergy = m_rdCost->psyCost(part, m_origYuv[depth]->getLumaAddr(), m_origYuv[depth]->getStride(),
                                                      m_tmpRecoYuv[depth]->getLumaAddr(), m_tmpRecoYuv[depth]->getStride());
-        outTempCU->m_totalRDCost = m_rdCost->calcPsyRdCost(outTempCU->m_totalDistortion, outTempCU->m_totalBits, psyRdCost);
+        outTempCU->m_totalRDCost = m_rdCost->calcPsyRdCost(outTempCU->m_totalDistortion, outTempCU->m_totalBits, outTempCU->m_psyEnergy);
     }
     else
     {
diff -r df08fbb4fe09 -r 2ab3e192144a source/Lib/TLibEncoder/TEncSearch.cpp
--- a/source/Lib/TLibEncoder/TEncSearch.cpp	Tue May 27 15:17:34 2014 +0530
+++ b/source/Lib/TLibEncoder/TEncSearch.cpp	Tue May 27 16:07:37 2014 +0530
@@ -2695,9 +2695,9 @@
         if (m_rdCost->psyRdEnabled())
         {
             int size = g_convertToBit[cuSize];
-            uint32_t psyRdCost = m_rdCost->psyCost(size, fencYuv->getLumaAddr(), fencYuv->getStride(),
+            cu->m_psyEnergy = m_rdCost->psyCost(size, fencYuv->getLumaAddr(), fencYuv->getStride(),
                                                    outReconYuv->getLumaAddr(), outReconYuv->getStride());
-            cu->m_totalRDCost = m_rdCost->calcPsyRdCost(cu->m_totalDistortion, cu->m_totalBits, psyRdCost);
+            cu->m_totalRDCost = m_rdCost->calcPsyRdCost(cu->m_totalDistortion, cu->m_totalBits, cu->m_psyEnergy);
         }
         else
         {
@@ -2786,9 +2786,9 @@
     if (m_rdCost->psyRdEnabled())
     {
         int size = g_convertToBit[cuSize];
-        uint32_t psyRdCost = m_rdCost->psyCost(size, fencYuv->getLumaAddr(), fencYuv->getStride(),
+        cu->m_psyEnergy = m_rdCost->psyCost(size, fencYuv->getLumaAddr(), fencYuv->getStride(),
                                                outReconYuv->getLumaAddr(), outReconYuv->getStride());
-        bcost = m_rdCost->calcPsyRdCost(bdist, bestBits, psyRdCost);
+        bcost = m_rdCost->calcPsyRdCost(bdist, bestBits, cu->m_psyEnergy);
     }
     else
     {


More information about the x265-devel mailing list