[x265] [PATCH 1 of 3] rd level: change the indexing for sa8d threshold array

sumalatha at multicorewareinc.com sumalatha at multicorewareinc.com
Thu Dec 12 07:38:30 CET 2013


# HG changeset patch
# User Sumalatha Polureddy
# Date 1386829825 -19800
# Node ID 6d0bfe850f70962b4af354a88f7403ea29537ec8
# Parent  a87f12ebb55bc565fb3fa428471c5343c0125198
rd level: change the indexing for sa8d threshold array

The index in threshold array won't be same as depth when the max cu size is less than 64.

diff -r a87f12ebb55b -r 6d0bfe850f70 source/encoder/compress.cpp
--- a/source/encoder/compress.cpp	Wed Dec 11 15:37:02 2013 -0600
+++ b/source/encoder/compress.cpp	Thu Dec 12 12:00:25 2013 +0530
@@ -519,7 +519,8 @@
                     else
                     {
                         uint32_t threshold[4] = { 20000, 6000, 1600, 500 };
-                        bdoIntra = (outBestCU->m_totalDistortion > threshold[depth]);
+                        int index = 4 - g_convertToBit[outBestCU->getWidth(0)];
+                        bdoIntra = (outBestCU->m_totalDistortion > threshold[index]);
                     }
                     if (bdoIntra)
                     {
@@ -616,7 +617,8 @@
                     else if (m_cfg->param.rdLevel <= 1)
                     {
                         uint32_t threshold[4] = { 20000, 6000, 1600, 500 };
-                        if (m_mergeCU[depth]->m_totalDistortion < threshold[depth])
+                        int index = 4 - g_convertToBit[outBestCU->getWidth(0)];
+                        if (m_mergeCU[depth]->m_totalDistortion < threshold[index])
                         {
                             m_mergeCU[depth]->setSkipFlagSubParts(true, 0, depth);
                             m_search->generateCoeffRecon(m_mergeCU[depth], m_origYuv[depth], bestMergePred, m_tmpResiYuv[depth], m_bestRecoYuv[depth], true);


More information about the x265-devel mailing list