[x265] [PATCH 1 of 2] derive TEncCu from TEncSearch
Steve Borho
steve at borho.org
Fri Jul 11 06:15:39 CEST 2014
# HG changeset patch
# User Steve Borho <steve at borho.org>
# Date 1405049544 18000
# Thu Jul 10 22:32:24 2014 -0500
# Node ID 3685d607012f345079e7ae2cf1949338a23683d0
# Parent e3e077965c39a56a24e09189652e1de3c5a0e3ea
derive TEncCu from TEncSearch
TEncSearch methods are only callable from TEncCu methods. and there is much
duplication in their data members. This removes a lot of redundancy and removes
a lot of pointer dereferences
diff -r e3e077965c39 -r 3685d607012f source/Lib/TLibEncoder/TEncCu.cpp
--- a/source/Lib/TLibEncoder/TEncCu.cpp Thu Jul 10 19:29:46 2014 -0500
+++ b/source/Lib/TLibEncoder/TEncCu.cpp Thu Jul 10 22:32:24 2014 -0500
@@ -66,17 +66,26 @@
m_bestMergeRecoYuv = NULL;
m_origYuv = NULL;
for (int i = 0; i < MAX_PRED_TYPES; i++)
- {
m_modePredYuv[i] = NULL;
- }
- m_search = NULL;
- m_trQuant = NULL;
- m_rdCost = NULL;
m_sbacCoder = NULL;
m_rdSbacCoders = NULL;
}
+bool TEncCu::init(Encoder* top, RDCost* rdCost, TComTrQuant* trQuant)
+{
+ m_trQuant = trQuant;
+ m_rdCost = rdCost;
+
+ m_CUTransquantBypass = top->m_CUTransquantBypassFlagValue;
+ m_param = top->m_param;
+ m_bEnableRDOQ = top->m_bEnableRDOQ;
+ m_bFrameParallel = top->m_totalFrameThreads > 1;
+ m_numLayers = top->m_quadtreeTULog2MaxSize - top->m_quadtreeTULog2MinSize + 1;
+
+ return initSearch();
+}
+
/**
\param totalDepth total number of allowable depth
\param maxWidth largest CU width
@@ -302,14 +311,6 @@
m_origYuv = NULL;
}
-/** \param pcEncTop pointer of encoder class
- */
-void TEncCu::init(Encoder* top)
-{
- m_param = top->m_param;
- m_CUTransquantBypass = top->m_CUTransquantBypassFlagValue;
-}
-
// ====================================================================================================================
// Public member functions
// ====================================================================================================================
@@ -1202,7 +1203,7 @@
{
for (uint32_t mergeCand = 0; mergeCand < maxNumMergeCand; ++mergeCand)
{
- if (m_search->m_bFrameParallel &&
+ if (m_bFrameParallel &&
(mvFieldNeighbours[mergeCand][0].mv.y >= (m_param->searchRange + 1) * 4 ||
mvFieldNeighbours[mergeCand][1].mv.y >= (m_param->searchRange + 1) * 4))
{
@@ -1223,16 +1224,16 @@
outTempCU->getCUMvField(REF_PIC_LIST_1)->setAllMvField(mvFieldNeighbours[mergeCand][1], SIZE_2Nx2N, 0, 0); // interprets depth relative to outTempCU level
// do MC
- m_search->motionCompensation(outTempCU, m_tmpPredYuv[depth], REF_PIC_LIST_X, 0);
+ motionCompensation(outTempCU, m_tmpPredYuv[depth], REF_PIC_LIST_X, 0);
// estimate residual and encode everything
- m_search->encodeResAndCalcRdInterCU(outTempCU,
- m_origYuv[depth],
- m_tmpPredYuv[depth],
- m_tmpResiYuv[depth],
- m_bestResiYuv[depth],
- m_tmpRecoYuv[depth],
- !!noResidual,
- true);
+ encodeResAndCalcRdInterCU(outTempCU,
+ m_origYuv[depth],
+ m_tmpPredYuv[depth],
+ m_tmpResiYuv[depth],
+ m_bestResiYuv[depth],
+ m_tmpRecoYuv[depth],
+ !!noResidual,
+ true);
/* Todo: Fix the satd cost estimates. Why is merge being chosen in high motion areas: estimated distortion is too low? */
if (!noResidual && !outTempCU->getQtRootCbf(0))
@@ -1302,9 +1303,9 @@
outTempCU->setPredModeSubParts(MODE_INTER, 0, depth);
outTempCU->setCUTransquantBypassSubParts(m_CUTransquantBypass, 0, depth);
- if (m_search->predInterSearch(outTempCU, m_tmpPredYuv[depth], bUseMRG, true))
+ if (predInterSearch(outTempCU, m_tmpPredYuv[depth], bUseMRG, true))
{
- m_search->encodeResAndCalcRdInterCU(outTempCU, m_origYuv[depth], m_tmpPredYuv[depth], m_tmpResiYuv[depth], m_bestResiYuv[depth], m_tmpRecoYuv[depth], false, true);
+ encodeResAndCalcRdInterCU(outTempCU, m_origYuv[depth], m_tmpPredYuv[depth], m_tmpResiYuv[depth], m_bestResiYuv[depth], m_tmpRecoYuv[depth], false, true);
xCheckDQP(outTempCU);
xCheckBestMode(outBestCU, outTempCU, depth);
}
@@ -1320,9 +1321,9 @@
outTempCU->setPredModeSubParts(MODE_INTRA, 0, depth);
outTempCU->setCUTransquantBypassSubParts(m_CUTransquantBypass, 0, depth);
- m_search->estIntraPredQT(outTempCU, m_origYuv[depth], m_tmpPredYuv[depth], m_tmpResiYuv[depth], m_tmpRecoYuv[depth]);
+ estIntraPredQT(outTempCU, m_origYuv[depth], m_tmpPredYuv[depth], m_tmpResiYuv[depth], m_tmpRecoYuv[depth]);
- m_search->estIntraPredChromaQT(outTempCU, m_origYuv[depth], m_tmpPredYuv[depth], m_tmpResiYuv[depth], m_tmpRecoYuv[depth]);
+ estIntraPredChromaQT(outTempCU, m_origYuv[depth], m_tmpPredYuv[depth], m_tmpResiYuv[depth], m_tmpRecoYuv[depth]);
m_sbacCoder->resetBits();
if (outTempCU->getSlice()->getPPS()->getTransquantBypassEnableFlag())
@@ -1371,9 +1372,9 @@
outTempCU->setPredModeSubParts(MODE_INTRA, 0, depth);
outTempCU->setCUTransquantBypassSubParts(m_CUTransquantBypass, 0, depth);
- m_search->estIntraPredQT(outTempCU, m_origYuv[depth], m_tmpPredYuv[depth], m_tmpResiYuv[depth], m_tmpRecoYuv[depth]);
+ estIntraPredQT(outTempCU, m_origYuv[depth], m_tmpPredYuv[depth], m_tmpResiYuv[depth], m_tmpRecoYuv[depth]);
- m_search->estIntraPredChromaQT(outTempCU, m_origYuv[depth], m_tmpPredYuv[depth], m_tmpResiYuv[depth], m_tmpRecoYuv[depth]);
+ estIntraPredChromaQT(outTempCU, m_origYuv[depth], m_tmpPredYuv[depth], m_tmpResiYuv[depth], m_tmpRecoYuv[depth]);
m_sbacCoder->resetBits();
if (outTempCU->getSlice()->getPPS()->getTransquantBypassEnableFlag())
diff -r e3e077965c39 -r 3685d607012f source/Lib/TLibEncoder/TEncCu.h
--- a/source/Lib/TLibEncoder/TEncCu.h Thu Jul 10 19:29:46 2014 -0500
+++ b/source/Lib/TLibEncoder/TEncCu.h Thu Jul 10 22:32:24 2014 -0500
@@ -87,7 +87,7 @@
// ====================================================================================================================
/// CU encoder class
-class TEncCu
+class TEncCu : public TEncSearch
{
public:
@@ -115,15 +115,6 @@
TComYuv** m_bestMergeRecoYuv;
TComYuv** m_origYuv; ///< Original Yuv at each depth
- x265_param* m_param;
- TEncSearch* m_search;
- TComTrQuant* m_trQuant;
- RDCost* m_rdCost;
- SBac* m_sbacCoder;
-
- // RD SBac pointers
- SBac (*m_rdSbacCoders)[CI_NUM];
-
uint8_t m_totalDepth;
bool m_bEncodeDQP;
@@ -134,7 +125,7 @@
TEncCu();
- void init(Encoder* top);
+ bool init(Encoder* top, RDCost* rdCost, TComTrQuant* trQuant);
bool create(uint8_t totalDepth, uint32_t maxWidth);
void destroy();
void compressCU(TComDataCU* cu);
diff -r e3e077965c39 -r 3685d607012f source/Lib/TLibEncoder/TEncSearch.cpp
--- a/source/Lib/TLibEncoder/TEncSearch.cpp Thu Jul 10 19:29:46 2014 -0500
+++ b/source/Lib/TLibEncoder/TEncSearch.cpp Thu Jul 10 22:32:24 2014 -0500
@@ -86,23 +86,16 @@
delete[] m_qtTempShortYuv;
}
-bool TEncSearch::init(Encoder* top, RDCost* rdCost, TComTrQuant* trQuant)
+bool TEncSearch::initSearch()
{
- m_param = top->m_param;
- m_trQuant = trQuant;
- m_rdCost = rdCost;
- m_bEnableRDOQ = top->m_bEnableRDOQ;
-
initTempBuff(m_param->internalCsp);
m_me.setSearchMethod(m_param->searchMethod);
m_me.setSubpelRefine(m_param->subpelRefine);
/* When frame parallelism is active, only 'refLagPixels' of reference frames will be guaranteed
* available for motion reference. See refLagRows in FrameEncoder::compressCTURows() */
- m_bFrameParallel = top->m_totalFrameThreads > 1;
m_refLagPixels = m_bFrameParallel ? m_param->searchRange : m_param->sourceHeight;
- m_numLayers = top->m_quadtreeTULog2MaxSize - top->m_quadtreeTULog2MinSize + 1;
m_qtTempCoeff[0] = new coeff_t*[m_numLayers * 3];
m_qtTempCoeff[1] = m_qtTempCoeff[0] + m_numLayers;
m_qtTempCoeff[2] = m_qtTempCoeff[0] + m_numLayers * 2;
diff -r e3e077965c39 -r 3685d607012f source/Lib/TLibEncoder/TEncSearch.h
--- a/source/Lib/TLibEncoder/TEncSearch.h Thu Jul 10 19:29:46 2014 -0500
+++ b/source/Lib/TLibEncoder/TEncSearch.h Thu Jul 10 22:32:24 2014 -0500
@@ -133,7 +133,7 @@
TEncSearch();
virtual ~TEncSearch();
- bool init(Encoder* top, RDCost* rdCost, TComTrQuant *trQuant);
+ bool initSearch();
uint32_t xModeBitsIntra(TComDataCU* cu, uint32_t mode, uint32_t partOffset, uint32_t depth);
uint32_t xModeBitsRemIntra(TComDataCU * cu, uint32_t partOffset, uint32_t depth, uint32_t preds[3], uint64_t & mpms);
diff -r e3e077965c39 -r 3685d607012f source/encoder/compress.cpp
--- a/source/encoder/compress.cpp Thu Jul 10 19:29:46 2014 -0500
+++ b/source/encoder/compress.cpp Thu Jul 10 22:32:24 2014 -0500
@@ -42,10 +42,10 @@
uint32_t initTrDepth = cu->getPartitionSize(0) == SIZE_2Nx2N ? 0 : 1;
// set context models
- m_sbacCoder->load(m_search->m_rdSbacCoders[depth][CI_CURR_BEST]);
+ m_sbacCoder->load(m_rdSbacCoders[depth][CI_CURR_BEST]);
- m_search->xRecurIntraCodingQT(cu, initTrDepth, 0, fencYuv, predYuv, outResiYuv, puDistY, false, puCost);
- m_search->xSetIntraResultQT(cu, initTrDepth, 0, outReconYuv);
+ xRecurIntraCodingQT(cu, initTrDepth, 0, fencYuv, predYuv, outResiYuv, puDistY, false, puCost);
+ xSetIntraResultQT(cu, initTrDepth, 0, outReconYuv);
//=== update PU data ====
cu->copyToPic(cu->getDepth(0), 0, initTrDepth);
@@ -53,7 +53,7 @@
//===== set distortion (rate and r-d costs are determined later) =====
cu->m_totalDistortion = puDistY;
- m_search->estIntraPredChromaQT(cu, fencYuv, predYuv, outResiYuv, outReconYuv);
+ estIntraPredChromaQT(cu, fencYuv, predYuv, outResiYuv, outReconYuv);
m_sbacCoder->resetBits();
if (cu->getSlice()->getPPS()->getTransquantBypassEnableFlag())
{
@@ -101,17 +101,15 @@
const uint32_t partOffset = 0;
// Reference sample smoothing
- TComPattern::initAdiPattern(cu, partOffset, initTrDepth, m_search->m_predBuf,
- m_search->m_refAbove, m_search->m_refLeft,
- m_search->m_refAboveFlt, m_search->m_refLeftFlt, ALL_IDX);
+ TComPattern::initAdiPattern(cu, partOffset, initTrDepth, m_predBuf, m_refAbove, m_refLeft, m_refAboveFlt, m_refLeftFlt, ALL_IDX);
pixel* fenc = m_origYuv[depth]->getLumaAddr();
uint32_t stride = m_modePredYuv[5][depth]->getStride();
- pixel *above = m_search->m_refAbove + tuSize - 1;
- pixel *aboveFiltered = m_search->m_refAboveFlt + tuSize - 1;
- pixel *left = m_search->m_refLeft + tuSize - 1;
- pixel *leftFiltered = m_search->m_refLeftFlt + tuSize - 1;
+ pixel *above = m_refAbove + tuSize - 1;
+ pixel *aboveFiltered = m_refAboveFlt + tuSize - 1;
+ pixel *left = m_refLeft + tuSize - 1;
+ pixel *leftFiltered = m_refLeftFlt + tuSize - 1;
int sad, bsad;
uint32_t bits, bbits, mode, bmode;
uint64_t cost, bcost;
@@ -158,13 +156,13 @@
cu->getIntraDirLumaPredictor(partOffset, preds);
uint64_t mpms;
- uint32_t rbits = m_search->xModeBitsRemIntra(cu, partOffset, depth, preds, mpms);
+ uint32_t rbits = xModeBitsRemIntra(cu, partOffset, depth, preds, mpms);
// DC
primitives.intra_pred[sizeIdx][DC_IDX](tmp, scaleStride, left, above, 0, (scaleTuSize <= 16));
bsad = costMultiplier * sa8d(fenc, scaleStride, tmp, scaleStride);
bmode = mode = DC_IDX;
- bbits = !(mpms & ((uint64_t)1 << mode)) ? rbits : m_search->xModeBitsIntra(cu, mode, partOffset, depth);
+ bbits = !(mpms & ((uint64_t)1 << mode)) ? rbits : xModeBitsIntra(cu, mode, partOffset, depth);
bcost = m_rdCost->calcRdSADCost(bsad, bbits);
pixel *abovePlanar = above;
@@ -180,7 +178,7 @@
primitives.intra_pred[sizeIdx][PLANAR_IDX](tmp, scaleStride, leftPlanar, abovePlanar, 0, 0);
sad = costMultiplier * sa8d(fenc, scaleStride, tmp, scaleStride);
mode = PLANAR_IDX;
- bits = !(mpms & ((uint64_t)1 << mode)) ? rbits : m_search->xModeBitsIntra(cu, mode, partOffset, depth);
+ bits = !(mpms & ((uint64_t)1 << mode)) ? rbits : xModeBitsIntra(cu, mode, partOffset, depth);
cost = m_rdCost->calcRdSADCost(sad, bits);
COPY4_IF_LT(bcost, cost, bmode, mode, bsad, sad, bbits, bits);
@@ -195,7 +193,7 @@
pixel *cmp = (modeHor ? buf_trans : fenc);
intptr_t srcStride = (modeHor ? scaleTuSize : scaleStride);
sad = costMultiplier * sa8d(cmp, srcStride, &tmp[(mode - 2) * (scaleTuSize * scaleTuSize)], scaleTuSize);
- bits = !(mpms & ((uint64_t)1 << mode)) ? rbits : m_search->xModeBitsIntra(cu, mode, partOffset, depth);
+ bits = !(mpms & ((uint64_t)1 << mode)) ? rbits : xModeBitsIntra(cu, mode, partOffset, depth);
cost = m_rdCost->calcRdSADCost(sad, bits);
COPY4_IF_LT(bcost, cost, bmode, mode, bsad, sad, bbits, bits);
}
@@ -219,7 +217,7 @@
// do motion compensation only for Luma since luma cost alone is calculated
outTempCU->m_totalBits = 0;
- if (m_search->predInterSearch(outTempCU, outPredYuv, bUseMRG, false))
+ if (predInterSearch(outTempCU, outPredYuv, bUseMRG, false))
{
int sizeIdx = g_convertToBit[outTempCU->getCUSize(0)];
uint32_t distortion = primitives.sa8d[sizeIdx](m_origYuv[depth]->getLumaAddr(), m_origYuv[depth]->getStride(),
@@ -258,7 +256,7 @@
for (uint32_t mergeCand = 0; mergeCand < maxNumMergeCand; ++mergeCand)
{
- if (!m_search->m_bFrameParallel ||
+ if (!m_bFrameParallel ||
(mvFieldNeighbours[mergeCand][0].mv.y < (m_param->searchRange + 1) * 4 &&
mvFieldNeighbours[mergeCand][1].mv.y < (m_param->searchRange + 1) * 4))
{
@@ -269,7 +267,7 @@
outTempCU->getCUMvField(REF_PIC_LIST_1)->setAllMvField(mvFieldNeighbours[mergeCand][1], SIZE_2Nx2N, 0, 0); // interprets depth relative to rpcTempCU level
// do MC only for Luma part
- m_search->motionCompensation(outTempCU, m_tmpPredYuv[depth], REF_PIC_LIST_X, 0, true, false);
+ motionCompensation(outTempCU, m_tmpPredYuv[depth], REF_PIC_LIST_X, 0, true, false);
uint32_t bitsCand = getTUBits(mergeCand, maxNumMergeCand);
outTempCU->m_totalBits = bitsCand;
outTempCU->m_totalDistortion = primitives.sa8d[sizeIdx](m_origYuv[depth]->getLumaAddr(), m_origYuv[depth]->getStride(),
@@ -308,24 +306,20 @@
//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);
- }
+ motionCompensation(outBestCU, bestPredYuv, REF_PIC_LIST_X, partIdx, false, true);
if (outTempCU->isLosslessCoded(0))
- {
outBestCU->m_totalRDCost = MAX_INT64;
- }
else
{
//No-residue mode
- m_search->encodeResAndCalcRdInterCU(outBestCU, m_origYuv[depth], bestPredYuv, m_tmpResiYuv[depth], m_bestResiYuv[depth], m_tmpRecoYuv[depth], true, true);
+ encodeResAndCalcRdInterCU(outBestCU, m_origYuv[depth], bestPredYuv, m_tmpResiYuv[depth], m_bestResiYuv[depth], m_tmpRecoYuv[depth], true, true);
std::swap(yuvReconBest, m_tmpRecoYuv[depth]);
}
//Encode with residue
- m_search->encodeResAndCalcRdInterCU(outTempCU, m_origYuv[depth], bestPredYuv, m_tmpResiYuv[depth], m_bestResiYuv[depth], m_tmpRecoYuv[depth], false, true);
+ encodeResAndCalcRdInterCU(outTempCU, m_origYuv[depth], bestPredYuv, m_tmpResiYuv[depth], m_bestResiYuv[depth], m_tmpRecoYuv[depth], false, true);
uint64_t tempCost = m_rdCost->psyRdEnabled() ? outTempCU->m_totalPsyCost : outTempCU->m_totalRDCost;
uint64_t bestCost = m_rdCost->psyRdEnabled() ? outBestCU->m_totalPsyCost : outBestCU->m_totalRDCost;
@@ -473,12 +467,10 @@
// 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);
- }
+ 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, true);
+ encodeResAndCalcRdInterCU(outBestCU, m_origYuv[depth], m_bestPredYuv[depth], m_tmpResiYuv[depth],
+ m_bestResiYuv[depth], m_bestRecoYuv[depth], false, true);
uint64_t bestMergeCost = m_rdCost->psyRdEnabled() ? m_bestMergeCU[depth]->m_totalPsyCost : m_bestMergeCU[depth]->m_totalRDCost;
uint64_t bestCost = m_rdCost->psyRdEnabled() ? outBestCU->m_totalPsyCost : outBestCU->m_totalRDCost;
if (bestMergeCost < bestCost)
@@ -537,17 +529,13 @@
{
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);
- }
+ 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, true);
+ encodeResAndCalcRdInterCU(outBestCU, m_origYuv[depth], m_bestPredYuv[depth], m_tmpResiYuv[depth],
+ m_bestResiYuv[depth], m_bestRecoYuv[depth], false, true);
}
else if (outBestCU->getPredictionMode(0) == MODE_INTRA)
- {
xEncodeIntraInInter(outBestCU, m_origYuv[depth], m_bestPredYuv[depth], m_tmpResiYuv[depth], m_bestRecoYuv[depth]);
- }
}
else if (m_param->rdLevel == 1)
{
@@ -561,17 +549,13 @@
{
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);
- }
+ motionCompensation(outBestCU, m_bestPredYuv[depth], REF_PIC_LIST_X, partIdx, false, true);
m_tmpResiYuv[depth]->subtract(m_origYuv[depth], m_bestPredYuv[depth], outBestCU->getCUSize(0));
- m_search->generateCoeffRecon(outBestCU, m_origYuv[depth], m_bestPredYuv[depth], m_tmpResiYuv[depth], m_bestRecoYuv[depth], false);
+ generateCoeffRecon(outBestCU, m_origYuv[depth], m_bestPredYuv[depth], m_tmpResiYuv[depth], m_bestRecoYuv[depth], false);
}
else
- {
- m_search->generateCoeffRecon(outBestCU, m_origYuv[depth], m_bestPredYuv[depth], m_tmpResiYuv[depth], m_bestRecoYuv[depth], false);
- }
+ generateCoeffRecon(outBestCU, m_origYuv[depth], m_bestPredYuv[depth], m_tmpResiYuv[depth], m_bestRecoYuv[depth], false);
}
else if (m_param->rdLevel == 0)
{
@@ -579,9 +563,7 @@
{
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);
- }
+ motionCompensation(outBestCU, m_bestPredYuv[depth], REF_PIC_LIST_X, partIdx, false, true);
}
}
}
@@ -900,7 +882,7 @@
primitives.chroma[m_param->internalCsp].sub_ps[part](dst, dststride, src1, src2, src1stride, src2stride);
// Residual encoding
- m_search->residualTransformQuantInter(cu, 0, m_tmpResiYuv[depth], cu->getDepth(0), true);
+ residualTransformQuantInter(cu, 0, m_tmpResiYuv[depth], cu->getDepth(0), true);
xCheckDQP(cu);
if (lcu->getMergeFlag(absPartIdx) && cu->getPartitionSize(0) == SIZE_2Nx2N && !cu->getQtRootCbf(0))
@@ -961,7 +943,7 @@
else
{
m_origYuv[0]->copyPartToYuv(m_origYuv[depth], absPartIdx);
- m_search->generateCoeffRecon(cu, m_origYuv[depth], m_modePredYuv[5][depth], m_tmpResiYuv[depth], m_tmpRecoYuv[depth], false);
+ generateCoeffRecon(cu, m_origYuv[depth], m_modePredYuv[5][depth], m_tmpResiYuv[depth], m_tmpRecoYuv[depth], false);
xCheckDQP(cu);
m_tmpRecoYuv[depth]->copyToPicYuv(pic->getPicYuvRec(), lcu->getAddr(), absPartIdx);
cu->copyCodedToPic(depth);
diff -r e3e077965c39 -r 3685d607012f source/encoder/cturow.cpp
--- a/source/encoder/cturow.cpp Thu Jul 10 19:29:46 2014 -0500
+++ b/source/encoder/cturow.cpp Thu Jul 10 22:32:24 2014 -0500
@@ -46,12 +46,7 @@
m_rdCost.setPsyRdScale(enc.m_param->psyRd);
- m_search.init(&enc, &m_rdCost, &m_trQuant);
-
- m_cuCoder.init(&enc);
- m_cuCoder.m_search = &m_search;
- m_cuCoder.m_trQuant = &m_trQuant;
- m_cuCoder.m_rdCost = &m_rdCost;
+ m_cuCoder.init(&enc, &m_rdCost, &m_trQuant);
m_cuCoder.create((uint8_t)g_maxCUDepth, g_maxCUSize);
}
@@ -67,14 +62,11 @@
m_rdSbacCoders[0][CI_CURR_BEST].loadContexts(*bufferSbac);
// setup thread local data structures to use this row's CABAC state
- tld.m_search.m_sbacCoder = &m_sbacCoder;
- tld.m_search.m_rdSbacCoders = m_rdSbacCoders;
tld.m_cuCoder.m_sbacCoder = &m_sbacCoder;
tld.m_cuCoder.m_rdSbacCoders = m_rdSbacCoders;
tld.m_cuCoder.compressCU(cu); // Does all the CU analysis
- tld.m_search.m_sbacCoder = &m_rdSbacCoders[0][CI_CURR_BEST];
tld.m_cuCoder.m_sbacCoder = &m_rdSbacCoders[0][CI_CURR_BEST];
m_rdSbacCoders[0][CI_CURR_BEST].resetBits();
diff -r e3e077965c39 -r 3685d607012f source/encoder/cturow.h
--- a/source/encoder/cturow.h Thu Jul 10 19:29:46 2014 -0500
+++ b/source/encoder/cturow.h Thu Jul 10 22:32:24 2014 -0500
@@ -29,7 +29,6 @@
#include "frame.h"
#include "TLibEncoder/TEncCu.h"
-#include "TLibEncoder/TEncSearch.h"
#include "rdcost.h"
#include "entropy.h"
@@ -41,7 +40,6 @@
struct ThreadLocalData
{
- TEncSearch m_search;
TEncCu m_cuCoder;
RDCost m_rdCost;
TComTrQuant m_trQuant;
diff -r e3e077965c39 -r 3685d607012f source/encoder/frameencoder.cpp
--- a/source/encoder/frameencoder.cpp Thu Jul 10 19:29:46 2014 -0500
+++ b/source/encoder/frameencoder.cpp Thu Jul 10 22:32:24 2014 -0500
@@ -311,7 +311,7 @@
chromaQPOffset = slice->getPPS()->getChromaCrQpOffset() + slice->getSliceQpDeltaCr();
int qpCr = Clip3(0, MAX_MAX_QP, qp + chromaQPOffset);
- tld.m_search.setQP(qp, qpCb, qpCr);
+ tld.m_cuCoder.setQP(qp, qpCb, qpCr);
}
void FrameEncoder::compressFrame()
@@ -659,7 +659,6 @@
}
// final coding (bitstream generation) for this CU
- m_tld.m_search.m_sbacCoder = &m_sbacCoder;
m_tld.m_cuCoder.m_sbacCoder = &m_sbacCoder;
m_tld.m_cuCoder.encodeCU(cu);
@@ -851,13 +850,12 @@
}
// setup thread-local data
+ TComPicYuv* fenc = m_frame->getPicYuvOrg();
tld.m_trQuant.m_nr = &m_nr;
- tld.m_search.m_mref = m_mref;
-
+ tld.m_cuCoder.m_mref = m_mref;
+ tld.m_cuCoder.m_me.setSourcePlane(fenc->getLumaAddr(), fenc->getStride());
+ tld.m_cuCoder.m_log = &tld.m_cuCoder.m_sliceTypeLog[m_frame->getSlice()->getSliceType()];
setLambda(m_frame->getSlice()->getSliceQp(), tld);
- TComPicYuv* fenc = m_frame->getPicYuvOrg();
- tld.m_search.m_me.setSourcePlane(fenc->getLumaAddr(), fenc->getStride());
- tld.m_cuCoder.m_log = &tld.m_cuCoder.m_sliceTypeLog[m_frame->getSlice()->getSliceType()];
int64_t startTime = x265_mdate();
assert(m_frame->getPicSym()->getFrameWidthInCU() == m_numCols);
More information about the x265-devel
mailing list