[x265] [PATCH] no-rdo: compute Luma only in MC for cost estimation for mode decision
sumalatha at multicorewareinc.com
sumalatha at multicorewareinc.com
Mon Oct 21 11:21:39 CEST 2013
# HG changeset patch
# User Sumalatha Polureddy
# Date 1382347292 -19800
# Node ID a93cc842f81a869930b4c7ac1de711473dc2e457
# Parent 8fc308449916b49cea8b0839690d91cebcfb528b
no-rdo: compute Luma only in MC for cost estimation for mode decision
luma alone is computed in MC since luma cost alone is used for mode decision.
After best mode is selected, before encoding, chroma MC is done
diff -r 8fc308449916 -r a93cc842f81a source/encoder/compress.cpp
--- a/source/encoder/compress.cpp Mon Oct 21 14:09:12 2013 +0530
+++ b/source/encoder/compress.cpp Mon Oct 21 14:51:32 2013 +0530
@@ -260,7 +260,8 @@
m_tmpRecoYuv[depth]->clear();
m_tmpResiYuv[depth]->clear();
- m_search->predInterSearch(outTempCU, outPredYuv, bUseMRG);
+ //do motion compensation only for Luma since luma cost alone is calculated
+ m_search->predInterSearch(outTempCU, outPredYuv, bUseMRG, true, false);
int part = PartitionFromSizes(outTempCU->getWidth(0), outTempCU->getHeight(0));
outTempCU->m_totalCost = primitives.sse_pp[part](m_origYuv[depth]->getLumaAddr(), m_origYuv[depth]->getStride(),
outPredYuv->getLumaAddr(), outPredYuv->getStride());
@@ -295,8 +296,8 @@
outTempCU->getCUMvField(REF_PIC_LIST_0)->setAllMvField(mvFieldNeighbours[0 + 2 * mergeCand], SIZE_2Nx2N, 0, 0); // interprets depth relative to rpcTempCU level
outTempCU->getCUMvField(REF_PIC_LIST_1)->setAllMvField(mvFieldNeighbours[1 + 2 * mergeCand], SIZE_2Nx2N, 0, 0); // interprets depth relative to rpcTempCU level
- // do MC
- m_search->motionCompensation(outTempCU, m_tmpPredYuv[depth]);
+ // do MC only for Luma part
+ m_search->motionCompensation(outTempCU, m_tmpPredYuv[depth], REF_PIC_LIST_X, -1, true, false);
int part = PartitionFromSizes(outTempCU->getWidth(0), outTempCU->getHeight(0));
outTempCU->m_totalCost = primitives.sse_pp[part](m_origYuv[depth]->getLumaAddr(), m_origYuv[depth]->getStride(),
@@ -318,6 +319,12 @@
outTempCU->initEstData(depth, orgQP);
}
+ //calculate the motion compensation for chroma for the best mode selected
+ int numPart = outBestCU->getNumPartInter();
+ for (int partIdx = 0; partIdx < numPart; partIdx++)
+ {
+ m_search->motionCompensation(outBestCU, bestPredYuv, REF_PIC_LIST_X, partIdx, false, true);
+ }
m_search->encodeResAndCalcRdInterCU(outBestCU, m_origYuv[depth], bestPredYuv, m_tmpResiYuv[depth], m_bestResiYuv[depth], yuvReconBest, false);
if (m_cfg->param.bEnableEarlySkip)
{
@@ -466,6 +473,12 @@
m_modePredYuv[2][depth] = m_bestPredYuv[depth];
m_bestPredYuv[depth] = tempYuv;
}
+ //calculate the motion compensation for chroma for the best mode selected
+ int numPart = outBestCU->getNumPartInter();
+ for (int partIdx = 0; partIdx < numPart; partIdx++)
+ {
+ m_search->motionCompensation(outBestCU, m_bestPredYuv[depth], REF_PIC_LIST_X, partIdx, false, true);
+ }
m_search->encodeResAndCalcRdInterCU(outBestCU, m_origYuv[depth], m_bestPredYuv[depth], m_tmpResiYuv[depth],
m_bestResiYuv[depth], m_bestRecoYuv[depth], false);
More information about the x265-devel
mailing list