[x265-commits] [x265] TEncSearch: simplify square block dim logic

Steve Borho steve at borho.org
Tue Jun 17 19:51:23 CEST 2014


details:   http://hg.videolan.org/x265/rev/0c3d33212ebd
branches:  
changeset: 7088:0c3d33212ebd
user:      Steve Borho <steve at borho.org>
date:      Tue Jun 17 12:47:57 2014 -0500
description:
TEncSearch: simplify square block dim logic

this works around a bizarre MSVC warning on those lines.
 '<<' : result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)

I have no idea why it was implicitly making the result 64bits.

diffstat:

 source/Lib/TLibEncoder/TEncSearch.cpp |  12 ++++--------
 1 files changed, 4 insertions(+), 8 deletions(-)

diffs (47 lines):

diff -r 7c6654c332c5 -r 0c3d33212ebd source/Lib/TLibEncoder/TEncSearch.cpp
--- a/source/Lib/TLibEncoder/TEncSearch.cpp	Mon Jun 16 17:23:04 2014 +0900
+++ b/source/Lib/TLibEncoder/TEncSearch.cpp	Tue Jun 17 12:47:57 2014 -0500
@@ -666,9 +666,8 @@ void TEncSearch::xRecurIntraCodingQT(TCo
                 xIntraCodingLumaBlk(cu, absPartIdx, log2TrSize, fencYuv, predYuv, resiYuv, singleCbfYTmp, singleDistYTmp);
                 if (m_rdCost->psyRdEnabled())
                 {
-                    int size = g_convertToBit[1 << log2TrSize];
                     uint32_t zorder = cu->getZorderIdxInCU() + absPartIdx;
-                    singlePsyEnergyYTmp = m_rdCost->psyCost(size, fencYuv->getLumaAddr(absPartIdx), fencYuv->getStride(),
+                    singlePsyEnergyYTmp = m_rdCost->psyCost(log2TrSize - 2, fencYuv->getLumaAddr(absPartIdx), fencYuv->getStride(),
                         cu->getPic()->getPicYuvRec()->getLumaAddr(cu->getAddr(), zorder), cu->getPic()->getPicYuvRec()->getStride());
                 }
                 cu->setCbfSubParts(singleCbfYTmp << trDepth, TEXT_LUMA, absPartIdx, fullDepth);
@@ -730,9 +729,8 @@ void TEncSearch::xRecurIntraCodingQT(TCo
             xIntraCodingLumaBlk(cu, absPartIdx, log2TrSize, fencYuv, predYuv, resiYuv, singleCbfY, singleDistY);
             if (m_rdCost->psyRdEnabled())
             {
-                int size = g_convertToBit[1 << log2TrSize];
                 uint32_t zorder = cu->getZorderIdxInCU() + absPartIdx;
-                singlePsyEnergyY = m_rdCost->psyCost(size, fencYuv->getLumaAddr(absPartIdx), fencYuv->getStride(),
+                singlePsyEnergyY = m_rdCost->psyCost(log2TrSize - 2, fencYuv->getLumaAddr(absPartIdx), fencYuv->getStride(),
                     cu->getPic()->getPicYuvRec()->getLumaAddr(cu->getAddr(), zorder), cu->getPic()->getPicYuvRec()->getStride());
             }
             cu->setCbfSubParts(singleCbfY << trDepth, TEXT_LUMA, absPartIdx, fullDepth);
@@ -1225,9 +1223,8 @@ void TEncSearch::xRecurIntraChromaCoding
                             uint32_t bitsTmp = xGetIntraBitsQTChroma(cu, trDepth, absPartIdxC, chromaId, splitIntoSubTUs);
                             if (m_rdCost->psyRdEnabled())
                             {
-                                int size = g_convertToBit[1 << log2TrSizeC];
                                 uint32_t zorder = cu->getZorderIdxInCU() + absPartIdxC;
-                                singlePsyEnergyTmp = m_rdCost->psyCost(size, fencYuv->getChromaAddr(chromaId, absPartIdxC), fencYuv->getCStride(),
+                                singlePsyEnergyTmp = m_rdCost->psyCost(log2TrSizeC - 2, fencYuv->getChromaAddr(chromaId, absPartIdxC), fencYuv->getCStride(),
                                     cu->getPic()->getPicYuvRec()->getChromaAddr(chromaId, cu->getAddr(), zorder), cu->getPic()->getPicYuvRec()->getCStride());
                                 singleCostTmp = m_rdCost->calcPsyRdCost(singleDistCTmp, bitsTmp, singlePsyEnergyTmp);
                             }
@@ -1277,9 +1274,8 @@ void TEncSearch::xRecurIntraChromaCoding
                     xIntraCodingChromaBlk(cu, absPartIdxC, log2TrSize, fencYuv, predYuv, resiYuv, singleCbfC, outDist, chromaId, log2TrSizeC);
                     if (m_rdCost->psyRdEnabled())
                     {
-                        int size = g_convertToBit[1 << log2TrSizeC];
                         uint32_t zorder = cu->getZorderIdxInCU() + absPartIdxC;
-                        singlePsyEnergyTmp = m_rdCost->psyCost(size, fencYuv->getChromaAddr(chromaId, absPartIdxC), fencYuv->getCStride(),
+                        singlePsyEnergyTmp = m_rdCost->psyCost(log2TrSizeC - 2, fencYuv->getChromaAddr(chromaId, absPartIdxC), fencYuv->getCStride(),
                             cu->getPic()->getPicYuvRec()->getChromaAddr(chromaId, cu->getAddr(), zorder), cu->getPic()->getPicYuvRec()->getCStride());
                     }
                     cu->setCbfPartRange(singleCbfC << trDepth, (TextType)chromaId, absPartIdxC, tuIterator.m_absPartIdxStep);


More information about the x265-commits mailing list