Commit 49301308 authored by Taoran Lu's avatar Taoran Lu
Browse files

add macro to brace interactions with JVET_M0483_IBC

parent 8849512c
......@@ -214,8 +214,11 @@ void DecCu::xIntraRecBlk( TransformUnit& tu, const ComponentID compID )
}
#if JVET_M0427_INLOOP_RESHAPER
const Slice &slice = *cs.slice;
#if JVET_M0483_IBC
bool flag = slice.getReshapeInfo().getUseSliceReshaper() && (slice.isIntra() || (!slice.isIntra() && m_pcReshape->getCTUFlag()));
#else
bool flag = slice.getReshapeInfo().getUseSliceReshaper() && (slice.isIntra() || (!slice.isIntra() && m_pcReshape->getCTUFlag()) || (slice.getSliceType() == P_SLICE && slice.getSPS()->getSpsNext().getIBCMode()));
#endif
if (flag && slice.getReshapeInfo().getSliceReshapeChromaAdj() && (compID != COMPONENT_Y))
{
const Area area = tu.Y().valid() ? tu.Y() : Area(recalcPosition(tu.chromaFormat, tu.chType, CHANNEL_TYPE_LUMA, tu.blocks[tu.chType].pos()), recalcSize(tu.chromaFormat, tu.chType, CHANNEL_TYPE_LUMA, tu.blocks[tu.chType].size()));
......@@ -274,7 +277,11 @@ void DecCu::xIntraRecBlk( TransformUnit& tu, const ComponentID compID )
CompArea tmpArea(COMPONENT_Y, area.chromaFormat, Position(0, 0), area.size());
PelBuf tmpPred;
#endif
#if JVET_M0483_IBC
if (slice.getReshapeInfo().getUseSliceReshaper() && (m_pcReshape->getCTUFlag() || slice.isIntra()) && compID == COMPONENT_Y)
#else
if (slice.getReshapeInfo().getUseSliceReshaper() && (m_pcReshape->getCTUFlag() || slice.isIntra() || (slice.getSliceType() == P_SLICE && slice.getSPS()->getSpsNext().getIBCMode())) && compID == COMPONENT_Y)
#endif
{
#if REUSE_CU_RESULTS
{
......@@ -293,7 +300,11 @@ void DecCu::xIntraRecBlk( TransformUnit& tu, const ComponentID compID )
pReco.copyFrom( piPred );
#endif
#if JVET_M0427_INLOOP_RESHAPER
#if JVET_M0483_IBC
if (slice.getReshapeInfo().getUseSliceReshaper() && (m_pcReshape->getCTUFlag() || slice.isIntra()) && compID == COMPONENT_Y)
#else
if (slice.getReshapeInfo().getUseSliceReshaper() && (m_pcReshape->getCTUFlag() || slice.isIntra() || (slice.getSliceType() == P_SLICE && slice.getSPS()->getSpsNext().getIBCMode())) && compID == COMPONENT_Y)
#endif
{
#if REUSE_CU_RESULTS
{
......
......@@ -1277,7 +1277,11 @@ bool DecLib::xDecodeSlice(InputNALUnit &nalu, int &iSkipFrame, int iPOCLastDispl
{
m_cReshaper.setReshapeFlag(false);
}
#if JVET_M0483_IBC
if ((pcSlice->getSliceType() == I_SLICE) && m_cReshaper.getSliceReshaperInfo().getUseSliceReshaper())
#else
if ((pcSlice->getSliceType() == I_SLICE || (pcSlice->getSliceType() == P_SLICE && pcSlice->getSPS()->getSpsNext().getIBCMode())) && m_cReshaper.getSliceReshaperInfo().getUseSliceReshaper())
#endif
{
m_cReshaper.setCTUFlag(false);
m_cReshaper.setRecReshaped(true);
......
......@@ -2205,18 +2205,29 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic,
if (m_pcCfg->getReshapeSignalType() == RESHAPE_SIGNAL_PQ)
{
#if JVET_M0483_IBC
m_pcReshaper->preAnalyzerHDR(pcPic, pcSlice->getSliceType(), m_pcCfg->getReshapeCW(), m_pcCfg->getDualITree());
#else
m_pcReshaper->preAnalyzerHDR(pcPic, pcSlice->getSliceType(), m_pcCfg->getReshapeCW(), m_pcCfg->getDualITree(), m_pcCfg->getIBCMode());
#endif
}
else if (m_pcCfg->getReshapeSignalType() == RESHAPE_SIGNAL_SDR)
{
#if JVET_M0483_IBC
m_pcReshaper->preAnalyzerSDR(pcPic, pcSlice->getSliceType(), m_pcCfg->getReshapeCW(), m_pcCfg->getDualITree());
#else
m_pcReshaper->preAnalyzerSDR(pcPic, pcSlice->getSliceType(), m_pcCfg->getReshapeCW(), m_pcCfg->getDualITree(), m_pcCfg->getIBCMode());
#endif
}
else
{
THROW("Reshaper for signal other than PQ and SDR currently not defined!");
}
#if JVET_M0483_IBC
if (pcSlice->getSliceType() == I_SLICE )
#else
if (pcSlice->getSliceType() == I_SLICE || (pcSlice->getSliceType() == P_SLICE && m_pcCfg->getIBCMode()))
#endif
{
if (m_pcCfg->getReshapeSignalType() == RESHAPE_SIGNAL_PQ)
{
......
......@@ -107,7 +107,11 @@ void EncReshape::destroy()
\param pcPic describe pointer of current coding picture
\param sliceType describe the slice type
*/
#if JVET_M0483_IBC
void EncReshape::preAnalyzerHDR(Picture *pcPic, const SliceType sliceType, const ReshapeCW& reshapeCW, bool isDualT)
#else
void EncReshape::preAnalyzerHDR(Picture *pcPic, const SliceType sliceType, const ReshapeCW& reshapeCW, bool isDualT, bool isIBC)
#endif
{
if (m_lumaBD >= 10)
{
......@@ -119,10 +123,18 @@ void EncReshape::preAnalyzerHDR(Picture *pcPic, const SliceType sliceType, const
}
else
{
#if JVET_M0483_IBC
if (sliceType == I_SLICE ) { m_sliceReshapeInfo.sliceReshaperModelPresentFlag = true; }
#else
if (sliceType == I_SLICE || (sliceType == P_SLICE && isIBC)) { m_sliceReshapeInfo.sliceReshaperModelPresentFlag = true; }
#endif
else { m_sliceReshapeInfo.sliceReshaperModelPresentFlag = false; }
}
#if JVET_M0483_IBC
if (sliceType == I_SLICE && isDualT) { m_sliceReshapeInfo.enableChromaAdj = 0; }
#else
if ((sliceType == I_SLICE || (sliceType == P_SLICE && isIBC)) && isDualT) { m_sliceReshapeInfo.enableChromaAdj = 0; }
#endif
else { m_sliceReshapeInfo.enableChromaAdj = 1; }
}
else
......@@ -138,14 +150,21 @@ void EncReshape::preAnalyzerHDR(Picture *pcPic, const SliceType sliceType, const
\param sliceType describe the slice type
\param reshapeCW describe some input info
*/
#if JVET_M0483_IBC
void EncReshape::preAnalyzerSDR(Picture *pcPic, const SliceType sliceType, const ReshapeCW& reshapeCW, bool isDualT)
#else
void EncReshape::preAnalyzerSDR(Picture *pcPic, const SliceType sliceType, const ReshapeCW& reshapeCW, bool isDualT, bool isIBC)
#endif
{
m_sliceReshapeInfo.sliceReshaperModelPresentFlag = true;
m_sliceReshapeInfo.sliceReshaperEnableFlag = true;
int modIP = pcPic->getPOC() - pcPic->getPOC() / reshapeCW.rspFpsToIp * reshapeCW.rspFpsToIp;
#if JVET_M0483_IBC
if (sliceType == I_SLICE || (reshapeCW.rspIntraPeriod == -1 && modIP == 0))
#else
if (sliceType == I_SLICE || (reshapeCW.rspIntraPeriod == -1 && modIP == 0) || (sliceType == P_SLICE && isIBC))
#endif
{
if (m_sliceReshapeInfo.sliceReshaperModelPresentFlag == true)
{
......@@ -460,7 +479,11 @@ void EncReshape::preAnalyzerSDR(Picture *pcPic, const SliceType sliceType, const
}
m_chromaAdj = m_sliceReshapeInfo.enableChromaAdj;
#if JVET_M0483_IBC
if (sliceType == I_SLICE && isDualT)
#else
if ((sliceType == I_SLICE || (sliceType == P_SLICE && isIBC)) && isDualT)
#endif
{
m_sliceReshapeInfo.enableChromaAdj = 0;
}
......
......@@ -105,9 +105,13 @@ public:
bool getSrcReshaped() { return m_srcReshaped; }
void setSrcReshaped(bool b) { m_srcReshaped = b; }
#if JVET_M0483_IBC
void preAnalyzerSDR(Picture *pcPic, const SliceType sliceType, const ReshapeCW& reshapeCW, bool isDualT);
void preAnalyzerHDR(Picture *pcPic, const SliceType sliceType, const ReshapeCW& reshapeCW, bool isDualT);
#else
void preAnalyzerSDR(Picture *pcPic, const SliceType sliceType, const ReshapeCW& reshapeCW, bool isDualT, bool isIBC);
void preAnalyzerHDR(Picture *pcPic, const SliceType sliceType, const ReshapeCW& reshapeCW, bool isDualT, bool isIBC);
#endif
void bubbleSortDsd(double *array, int * idx, int n);
void swap(int *xp, int *yp) { int temp = *xp; *xp = *yp; *yp = temp; }
void swap(double *xp, double *yp) { double temp = *xp; *xp = *yp; *yp = temp; }
......
......@@ -1807,7 +1807,11 @@ void IntraSearch::xIntraCodingTUBlock(TransformUnit &tu, const ComponentID &comp
#if JVET_M0427_INLOOP_RESHAPER
const Slice &slice = *cs.slice;
#if JVET_M0483_IBC
bool flag = slice.getReshapeInfo().getUseSliceReshaper() && (slice.isIntra() || (!slice.isIntra() && m_pcReshape->getCTUFlag()));
#else
bool flag = slice.getReshapeInfo().getUseSliceReshaper() && (slice.isIntra() || (!slice.isIntra() && m_pcReshape->getCTUFlag()) || (slice.getSliceType() == P_SLICE && slice.getSPS()->getSpsNext().getIBCMode()));
#endif
if (flag && slice.getReshapeInfo().getSliceReshapeChromaAdj() && isChroma(compID))
{
const Area area = tu.Y().valid() ? tu.Y() : Area(recalcPosition(tu.chromaFormat, tu.chType, CHANNEL_TYPE_LUMA, tu.blocks[tu.chType].pos()), recalcSize(tu.chromaFormat, tu.chType, CHANNEL_TYPE_LUMA, tu.blocks[tu.chType].size()));
......
Supports Markdown
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