Commit 35090d5c authored by Xiaoyu Xiu's avatar Xiaoyu Xiu

Fix the prefix problem of some variables names; change the macro from...

Fix the prefix problem of some variables names; change the macro from ACT_LMCS_FIX to JVET_S0234_ACT_CRS_FIX.
parent d658766a
Pipeline #5207 passed with stage
in 10 minutes and 7 seconds
......@@ -83,8 +83,8 @@ void RdCost::setLambda( double dLambda, const BitDepths &bitDepths )
m_dLambdaMotionSAD = sqrt(m_dLambda);
}
#if ACT_LMCS_FIX
void RdCost::lambdaAdjustColorTrans(bool forward, ComponentID componentID, bool bCS, int* pcResScaleInv)
#if JVET_S0234_ACT_CRS_FIX
void RdCost::lambdaAdjustColorTrans(bool forward, ComponentID componentID, bool applyChromaScale, int* resScaleInv)
#else
void RdCost::lambdaAdjustColorTrans(bool forward, ComponentID componentID)
#endif
......@@ -119,11 +119,11 @@ void RdCost::lambdaAdjustColorTrans(bool forward, ComponentID componentID)
m_dLambda = m_lambdaStore[m_pairCheck][componentID];
m_DistScale = m_DistScaleStore[m_pairCheck][componentID];
#if ACT_LMCS_FIX
if (bCS)
#if JVET_S0234_ACT_CRS_FIX
if (applyChromaScale)
{
CHECK(m_pairCheck == 0 || componentID == COMPONENT_Y, "wrong lambda adjustment for CS");
double cResScale = (double)(1 << CSCALE_FP_PREC) / (double)(*pcResScaleInv);
double cResScale = (double)(1 << CSCALE_FP_PREC) / (double)(*resScaleInv);
m_dLambda = m_dLambda / (cResScale*cResScale);
m_DistScale = double(1 << SCALE_BITS) / m_dLambda;
}
......
......@@ -326,8 +326,8 @@ public:
inline std::vector<double>& getLumaLevelWeightTable () { return m_lumaLevelToWeightPLUT; }
#endif
#if ACT_LMCS_FIX
void lambdaAdjustColorTrans(bool forward, ComponentID compID, bool bCS = false, int* pcResScaleInv = NULL);
#if JVET_S0234_ACT_CRS_FIX
void lambdaAdjustColorTrans(bool forward, ComponentID compID, bool applyChromaScale = false, int* resScaleInv = NULL);
#else
void lambdaAdjustColorTrans(bool forward, ComponentID compID);
#endif
......
......@@ -54,7 +54,7 @@
//########### place macros to be removed in next cycle below this line ###############
#define ACT_LMCS_FIX 1 // JVET-S0234: perform chroma residual scaling in RGB domain when ACT is on
#define JVET_S0234_ACT_CRS_FIX 1 // JVET-S0234: perform chroma residual scaling in RGB domain when ACT is on
//########### place macros to be be kept below this line ###############
#define JVET_R0351_HIGH_BIT_DEPTH_SUPPORT 1 // JVET-R0351: high bit depth coding support (syntax changes, no mathematical differences for CTCs)
......
......@@ -347,7 +347,7 @@ void DecCu::xIntraRecACTBlk(TransformUnit& tu)
CHECK(pu.intraDir[CHANNEL_TYPE_CHROMA] != DM_CHROMA_IDX, "chroma should use DM mode for adaptive color transform");
bool flag = slice.getLmcsEnabledFlag() && (slice.isIntra() || (!slice.isIntra() && m_pcReshape->getCTUFlag()));
#if ACT_LMCS_FIX
#if JVET_S0234_ACT_CRS_FIX
if (flag && slice.getPicHeader()->getLmcsChromaResidualScaleFlag())
#else
if (flag && slice.getPicHeader()->getLmcsChromaResidualScaleFlag() && (tu.cbf[COMPONENT_Cb] || tu.cbf[COMPONENT_Cr]))
......@@ -411,7 +411,7 @@ void DecCu::xIntraRecACTBlk(TransformUnit& tu)
}
}
#if !ACT_LMCS_FIX
#if !JVET_S0234_ACT_CRS_FIX
flag = flag && (tu.blocks[compID].width*tu.blocks[compID].height > 4);
if (flag && (TU::getCbf(tu, compID) || tu.jointCbCr) && isChroma(compID) && slice.getPicHeader()->getLmcsChromaResidualScaleFlag())
{
......@@ -441,7 +441,7 @@ void DecCu::xIntraRecACTBlk(TransformUnit& tu)
tmpPred.copyFrom(piPred);
}
#if ACT_LMCS_FIX
#if JVET_S0234_ACT_CRS_FIX
if (flag && isChroma(compID) && (tu.blocks[compID].width*tu.blocks[compID].height > 4) && slice.getPicHeader()->getLmcsChromaResidualScaleFlag())
{
piResi.scaleSignal(tu.getChromaAdj(), 0, tu.cu->cs->slice->clpRng(compID));
......@@ -706,7 +706,7 @@ void DecCu::xReconInter(CodingUnit &cu)
if (cu.rootCbf)
{
#if !ACT_LMCS_FIX
#if !JVET_S0234_ACT_CRS_FIX
if (cu.colorTransform)
{
cs.getResiBuf(cu).colorSpaceConvert(cs.getResiBuf(cu), false, cu.cs->slice->clpRng(COMPONENT_Y));
......@@ -802,7 +802,7 @@ void DecCu::xDecodeInterTU( TransformUnit & currTU, const ComponentID compID )
//===== reconstruction =====
const Slice &slice = *cs.slice;
#if ACT_LMCS_FIX
#if JVET_S0234_ACT_CRS_FIX
if (!currTU.cu->colorTransform && slice.getPicHeader()->getLmcsEnabledFlag() && isChroma(compID) && (TU::getCbf(currTU, compID) || currTU.jointCbCr)
#else
if (slice.getLmcsEnabledFlag() && isChroma(compID) && (TU::getCbf(currTU, compID) || currTU.jointCbCr)
......@@ -822,7 +822,7 @@ void DecCu::xDecodeInterTexture(CodingUnit &cu)
const uint32_t uiNumVaildComp = getNumberValidComponents(cu.chromaFormat);
#if ACT_LMCS_FIX
#if JVET_S0234_ACT_CRS_FIX
if (cu.colorTransform)
{
CodingStructure &cs = *cu.cs;
......@@ -869,7 +869,7 @@ void DecCu::xDecodeInterTexture(CodingUnit &cu)
xDecodeInterTU( currTU, compID );
}
}
#if ACT_LMCS_FIX
#if JVET_S0234_ACT_CRS_FIX
}
#endif
}
......
......@@ -6496,7 +6496,7 @@ void InterSearch::xEstimateInterResidualQT(CodingStructure &cs, Partitioner &par
tu.setChromaAdj(adj);
}
#if ACT_LMCS_FIX
#if JVET_S0234_ACT_CRS_FIX
PelUnitBuf colorTransResidual = m_colorTransResiBuf[1].getBuf(relativeUnitArea);
if (colorTransFlag)
{
......@@ -6588,7 +6588,7 @@ void InterSearch::xEstimateInterResidualQT(CodingStructure &cs, Partitioner &par
if (colorTransFlag && (m_pcEncCfg->getCostMode() != COST_LOSSLESS_CODING || !slice.isLossless()))
{
m_pcTrQuant->lambdaAdjustColorTrans(true);
#if ACT_LMCS_FIX
#if JVET_S0234_ACT_CRS_FIX
if (isChroma(compID) && slice.getPicHeader()->getLmcsEnabledFlag() && slice.getPicHeader()->getLmcsChromaResidualScaleFlag() && tu.blocks[compID].width*tu.blocks[compID].height > 4)
{
int cResScaleInv = tu.getChromaAdj();
......@@ -6604,7 +6604,7 @@ void InterSearch::xEstimateInterResidualQT(CodingStructure &cs, Partitioner &par
{
const bool isFirstMode = transformMode == 0;
// copy the original residual into the residual buffer
#if ACT_LMCS_FIX
#if JVET_S0234_ACT_CRS_FIX
if (colorTransFlag)
{
csFull->getResiBuf(compArea).copyFrom(colorTransResidual.bufs[compID]);
......@@ -6653,7 +6653,7 @@ void InterSearch::xEstimateInterResidualQT(CodingStructure &cs, Partitioner &par
Distortion nonCoeffDist = 0;
double nonCoeffCost = 0;
#if ACT_LMCS_FIX
#if JVET_S0234_ACT_CRS_FIX
if (!colorTransFlag && slice.getPicHeader()->getLmcsEnabledFlag() && isChroma(compID) && slice.getPicHeader()->getLmcsChromaResidualScaleFlag() && tu.blocks[compID].width*tu.blocks[compID].height > 4)
#else
if (slice.getLmcsEnabledFlag() && isChroma(compID) && slice.getPicHeader()->getLmcsChromaResidualScaleFlag() && tu.blocks[compID].width * tu.blocks[compID].height > 4)
......@@ -6682,7 +6682,7 @@ void InterSearch::xEstimateInterResidualQT(CodingStructure &cs, Partitioner &par
if (isFirstMode || (currAbsSum == 0))
{
const CPelBuf zeroBuf(m_pTempPel, compArea);
#if ACT_LMCS_FIX
#if JVET_S0234_ACT_CRS_FIX
const CPelBuf orgResi = colorTransFlag ? colorTransResidual.bufs[compID] : csFull->getOrgResiBuf(compArea);
#else
const CPelBuf orgResi = csFull->getOrgResiBuf( compArea );
......@@ -6758,14 +6758,14 @@ void InterSearch::xEstimateInterResidualQT(CodingStructure &cs, Partitioner &par
currCompFracBits = m_CABACEstimator->getEstFracBits();
PelBuf resiBuf = csFull->getResiBuf(compArea);
#if ACT_LMCS_FIX
#if JVET_S0234_ACT_CRS_FIX
CPelBuf orgResiBuf = colorTransFlag ? colorTransResidual.bufs[compID] : csFull->getOrgResiBuf(compArea);
#else
CPelBuf orgResiBuf = csFull->getOrgResiBuf(compArea);
#endif
m_pcTrQuant->invTransformNxN(tu, compID, resiBuf, cQP);
#if ACT_LMCS_FIX
#if JVET_S0234_ACT_CRS_FIX
if (!colorTransFlag && slice.getPicHeader()->getLmcsEnabledFlag() && isChroma(compID) && slice.getPicHeader()->getLmcsChromaResidualScaleFlag() && tu.blocks[compID].width*tu.blocks[compID].height > 4)
#else
if (slice.getLmcsEnabledFlag() && isChroma(compID) && slice.getPicHeader()->getLmcsChromaResidualScaleFlag() && tu.blocks[compID].width * tu.blocks[compID].height > 4)
......@@ -6841,7 +6841,7 @@ void InterSearch::xEstimateInterResidualQT(CodingStructure &cs, Partitioner &par
PelUnitBuf orgResidual = orgResi->subBuf(relativeUnitArea);
PelUnitBuf invColorTransResidual = m_colorTransResiBuf[2].getBuf(relativeUnitArea);
csFull->getResiBuf(currArea).colorSpaceConvert(invColorTransResidual, false, slice.clpRng(COMPONENT_Y));
#if ACT_LMCS_FIX
#if JVET_S0234_ACT_CRS_FIX
if (slice.getPicHeader()->getLmcsEnabledFlag() && slice.getPicHeader()->getLmcsChromaResidualScaleFlag() && tu.blocks[COMPONENT_Cb].width*tu.blocks[COMPONENT_Cb].height > 4)
{
invColorTransResidual.bufs[1].scaleSignal(tu.getChromaAdj(), 0, tu.cu->cs->slice->clpRng(COMPONENT_Cb));
......@@ -6884,7 +6884,7 @@ void InterSearch::xEstimateInterResidualQT(CodingStructure &cs, Partitioner &par
{
orgResiCb[0].create(cbArea);
orgResiCr[0].create(crArea);
#if ACT_LMCS_FIX
#if JVET_S0234_ACT_CRS_FIX
if (colorTransFlag)
{
orgResiCb[0].copyFrom(colorTransResidual.bufs[1]);
......@@ -6895,7 +6895,7 @@ void InterSearch::xEstimateInterResidualQT(CodingStructure &cs, Partitioner &par
#endif
orgResiCb[0].copyFrom(cs.getOrgResiBuf(cbArea));
orgResiCr[0].copyFrom(cs.getOrgResiBuf(crArea));
#if ACT_LMCS_FIX
#if JVET_S0234_ACT_CRS_FIX
}
if (!colorTransFlag && reshape)
#else
......@@ -7040,7 +7040,7 @@ void InterSearch::xEstimateInterResidualQT(CodingStructure &cs, Partitioner &par
currCompFracBits = m_CABACEstimator->getEstFracBits();
m_pcTrQuant->invTransformICT(tu, cbResi, crResi);
#if ACT_LMCS_FIX
#if JVET_S0234_ACT_CRS_FIX
if (!colorTransFlag && reshape)
#else
if (reshape)
......@@ -7055,7 +7055,7 @@ void InterSearch::xEstimateInterResidualQT(CodingStructure &cs, Partitioner &par
PelUnitBuf orgResidual = orgResi->subBuf(relativeUnitArea);
PelUnitBuf invColorTransResidual = m_colorTransResiBuf[2].getBuf(relativeUnitArea);
csFull->getResiBuf(currArea).colorSpaceConvert(invColorTransResidual, false, slice.clpRng(COMPONENT_Y));
#if ACT_LMCS_FIX
#if JVET_S0234_ACT_CRS_FIX
if (reshape)
{
invColorTransResidual.bufs[1].scaleSignal(tu.getChromaAdj(), 0, tu.cu->cs->slice->clpRng(COMPONENT_Cb));
......@@ -7158,7 +7158,7 @@ void InterSearch::xEstimateInterResidualQT(CodingStructure &cs, Partitioner &par
{
CHECK( m_CABACEstimator->getEstFracBits() > 0, "no residual TU's bits shall be 0" );
}
#if ACT_LMCS_FIX
#if JVET_S0234_ACT_CRS_FIX
if (colorTransFlag)
{
PelUnitBuf resiBuf = csFull->getResiBuf(currArea);
......@@ -7412,18 +7412,18 @@ void InterSearch::encodeResAndCalcRdInterCU(CodingStructure &cs, Partitioner &pa
pu = *ppu;
}
#if ACT_LMCS_FIX
#if JVET_S0234_ACT_CRS_FIX
PelUnitBuf orgResidual;
#else
PelUnitBuf orgResidual, colorTransResidual;
#endif
const UnitArea localUnitArea(cs.area.chromaFormat, Area(0, 0, cu.Y().width, cu.Y().height));
orgResidual = m_colorTransResiBuf[0].getBuf(localUnitArea);
#if !ACT_LMCS_FIX
#if !JVET_S0234_ACT_CRS_FIX
colorTransResidual = m_colorTransResiBuf[1].getBuf(localUnitArea);
#endif
orgResidual.copyFrom(cs.getResiBuf());
#if !ACT_LMCS_FIX
#if !JVET_S0234_ACT_CRS_FIX
if (colorTransAllowed)
{
cs.getResiBuf().colorSpaceConvert(colorTransResidual, true, cu.cs->slice->clpRng(COMPONENT_Y));
......@@ -7500,7 +7500,7 @@ void InterSearch::encodeResAndCalcRdInterCU(CodingStructure &cs, Partitioner &pa
if (colorTransFlag)
{
#if ACT_LMCS_FIX
#if JVET_S0234_ACT_CRS_FIX
cs.getOrgResiBuf().bufs[0].copyFrom(orgResidual.bufs[0]);
cs.getOrgResiBuf().bufs[1].copyFrom(orgResidual.bufs[1]);
cs.getOrgResiBuf().bufs[2].copyFrom(orgResidual.bufs[2]);
......@@ -7581,7 +7581,7 @@ void InterSearch::encodeResAndCalcRdInterCU(CodingStructure &cs, Partitioner &pa
if (cs.cost < bestCost)
{
bestIter = iter;
#if !ACT_LMCS_FIX
#if !JVET_S0234_ACT_CRS_FIX
if (cu.rootCbf && cu.colorTransform)
{
cs.getResiBuf(curUnitArea).colorSpaceConvert(cs.getResiBuf(curUnitArea), false, cu.cs->slice->clpRng(COMPONENT_Y));
......
......@@ -3458,7 +3458,7 @@ void IntraSearch::xIntraCodingACTTUBlock(TransformUnit &tu, const ComponentID &c
}
}
#if !ACT_LMCS_FIX
#if !JVET_S0234_ACT_CRS_FIX
if (flag && uiAbsSum > 0 && isChroma(compID) && slice.getPicHeader()->getLmcsChromaResidualScaleFlag())
{
piResi.scaleSignal(tu.getChromaAdj(), 0, slice.clpRng(compID));
......@@ -4158,7 +4158,7 @@ bool IntraSearch::xRecurIntraCodingACTQT(CodingStructure &cs, Partitioner &parti
PelUnitBuf predBuf = csFull->getPredBuf(tu);
PelUnitBuf resiBuf = csFull->getResiBuf(tu);
PelUnitBuf orgResiBuf = csFull->getOrgResiBuf(tu);
#if ACT_LMCS_FIX
#if JVET_S0234_ACT_CRS_FIX
bool doReshaping = (slice.getPicHeader()->getLmcsEnabledFlag() && slice.getPicHeader()->getLmcsChromaResidualScaleFlag() && (slice.isIntra() || m_pcReshape->getCTUFlag()) && (tu.blocks[COMPONENT_Cb].width * tu.blocks[COMPONENT_Cb].height > 4));
if (doReshaping)
{
......@@ -4199,7 +4199,7 @@ bool IntraSearch::xRecurIntraCodingACTQT(CodingStructure &cs, Partitioner &parti
piResi.rspSignal(m_pcReshape->getFwdLUT());
piResi.subtract(tmpPred);
}
#if ACT_LMCS_FIX
#if JVET_S0234_ACT_CRS_FIX
else if (doReshaping && (compID != COMPONENT_Y))
{
piResi.subtract(piPred);
......@@ -4502,7 +4502,7 @@ bool IntraSearch::xRecurIntraCodingACTQT(CodingStructure &cs, Partitioner &parti
tu.jointCbCr = 0;
#if !ACT_LMCS_FIX
#if !JVET_S0234_ACT_CRS_FIX
bool doReshaping = (slice.getLmcsEnabledFlag() && slice.getPicHeader()->getLmcsChromaResidualScaleFlag() && (slice.isIntra() || m_pcReshape->getCTUFlag()) && (cbArea.width * cbArea.height > 4));
if (doReshaping)
{
......@@ -4518,7 +4518,7 @@ bool IntraSearch::xRecurIntraCodingACTQT(CodingStructure &cs, Partitioner &parti
orgResiCr[0].create(crArea);
orgResiCb[0].copyFrom(csFull->getOrgResiBuf(cbArea));
orgResiCr[0].copyFrom(csFull->getOrgResiBuf(crArea));
#if !ACT_LMCS_FIX
#if !JVET_S0234_ACT_CRS_FIX
if (doReshaping)
{
int cResScaleInv = tu.getChromaAdj();
......@@ -4563,7 +4563,7 @@ bool IntraSearch::xRecurIntraCodingACTQT(CodingStructure &cs, Partitioner &parti
}
}
if (m_pcEncCfg->getCostMode() != COST_LOSSLESS_CODING || !slice.isLossless())
#if ACT_LMCS_FIX
#if JVET_S0234_ACT_CRS_FIX
{
if (doReshaping)
{
......@@ -4654,7 +4654,7 @@ bool IntraSearch::xRecurIntraCodingACTQT(CodingStructure &cs, Partitioner &parti
PelBuf piPred = csFull->getPredBuf(area);
PelBuf piResi = invColorTransResidual.bufs[compID];
#if ACT_LMCS_FIX
#if JVET_S0234_ACT_CRS_FIX
if (doReshaping && (compID != COMPONENT_Y))
{
piResi.scaleSignal(tu.getChromaAdj(), 0, slice.clpRng(compID));
......@@ -4768,7 +4768,7 @@ bool IntraSearch::xRecurIntraCodingACTQT(CodingStructure &cs, Partitioner &parti
PelBuf piPred = csFull->getPredBuf(area);
PelBuf piResi = invColorTransResidual.bufs[compID];
#if ACT_LMCS_FIX
#if JVET_S0234_ACT_CRS_FIX
if (doReshaping && (compID != COMPONENT_Y))
{
piResi.scaleSignal(tu.getChromaAdj(), 0, slice.clpRng(compID));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment