[x265] [PATCH] Fixed the Hash error with -no-rdo ON

sumalatha at multicorewareinc.com sumalatha at multicorewareinc.com
Thu Jun 27 12:44:36 CEST 2013


# HG changeset patch
# User sumalatha
# Date 1372329854 -19800
# Node ID 3b93256a844bbbe5584ec1ae7b95e618bf955d69
# Parent  5b42d1c900b42f0e95793825b1e242af29e83180
Fixed the Hash error with -no-rdo ON

diff -r 5b42d1c900b4 -r 3b93256a844b source/encoder/compress.cpp
--- a/source/encoder/compress.cpp	Wed Jun 26 17:35:15 2013 -0500
+++ b/source/encoder/compress.cpp	Thu Jun 27 16:14:14 2013 +0530
@@ -139,15 +139,18 @@
             pcYuv =  m_ppcPredYuvMode[3][uhDepth];
             m_ppcPredYuvMode[3][uhDepth]  = m_ppcPredYuvMode[4][uhDepth];
             m_ppcPredYuvMode[4][uhDepth] = pcYuv;
+            pcYuv = m_ppcRecoYuvBest[uhDepth];
+            m_ppcRecoYuvBest[uhDepth] = m_ppcRecoYuvTemp[uhDepth];
+            m_ppcRecoYuvTemp[uhDepth] = pcYuv;         
         }
 
         rpcTempCU->initEstData(uhDepth, orgQP);
     }
 
     me_merge.setSourcePU(0, rpcBestCU->getWidth(0), rpcBestCU->getHeight(0));
-    rpcBestCU->getTotalDistortion() = me_merge.bufSATD((pixel*)m_ppcPredYuvMode[3][uhDepth]->getLumaAddr(),
+   
+    rpcBestCU->getTotalCost() = me_merge.bufSATD((pixel*)m_ppcPredYuvMode[3][uhDepth]->getLumaAddr(),
                                                        m_ppcPredYuvMode[3][uhDepth]->getStride());
-    rpcBestCU->getTotalCost() = rpcBestCU->getTotalDistortion();
     x265_emms();
 }
 
@@ -284,8 +287,12 @@
         }
 
         /* Perform encode residual for the best mode chosen only*/
-
+        if(m_MergeBestCU[uiDepth] != rpcBestCU){
         m_pcPredSearch->encodeResAndCalcRdInterCU(rpcBestCU, m_ppcOrigYuv[uiDepth], m_ppcPredYuvBest[uiDepth], m_ppcResiYuvTemp[uiDepth], m_ppcResiYuvBest[uiDepth], m_ppcRecoYuvBest[uiDepth], false);
+        }
+        else{
+            rpcBestCU->getTotalCost() =  m_pcRdCost->calcRdCost(rpcBestCU->getTotalDistortion(), rpcBestCU->getTotalBits());
+        }
 
         /* Disable recursive analysis for whole CUs temporarily*/
         if (rpcBestCU->isSkipped(0))
@@ -317,6 +324,7 @@
         fprintf(fp1, "\n Width : %d ,Inter 2Nx2N_Merge : %d , 2Nx2N : %d , 2NxN : %d, Nx2N : %d ", rpcBestCU->getWidth(0), m_MergeBestCU[uiDepth]->getTotalCost(), m_InterCU_2Nx2N[uiDepth]->getTotalCost(), m_InterCU_2NxN[uiDepth]->getTotalCost(), m_InterCU_Nx2N[uiDepth]->getTotalCost());
     }
 #endif
+
 // further split
     if (bSubBranch && bTrySplitDQP && uiDepth < g_uiMaxCUDepth - g_uiAddCUDepth)
     {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: June_27_sumalatha_new.patch
Type: text/x-patch
Size: 2385 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20130627/29ceae84/attachment.bin>


More information about the x265-devel mailing list