Commit 8849512c authored by Taoran Lu's avatar Taoran Lu
Browse files

fix interaction with IBC

parent 68cf1ee8
......@@ -214,7 +214,7 @@ void DecCu::xIntraRecBlk( TransformUnit& tu, const ComponentID compID )
}
#if JVET_M0427_INLOOP_RESHAPER
const Slice &slice = *cs.slice;
bool flag = slice.getReshapeInfo().getUseSliceReshaper() && (slice.isIntra() || (!slice.isIntra() && m_pcReshape->getCTUFlag() ) || (slice.getSliceType() == P_SLICE && slice.getSPS()->getSpsNext().getIBCMode()));
bool flag = slice.getReshapeInfo().getUseSliceReshaper() && (slice.isIntra() || (!slice.isIntra() && m_pcReshape->getCTUFlag()));
if (flag && slice.getReshapeInfo().getSliceReshapeChromaAdj() && (compID != COMPONENT_Y))
{
......@@ -274,7 +274,7 @@ void DecCu::xIntraRecBlk( TransformUnit& tu, const ComponentID compID )
CompArea tmpArea(COMPONENT_Y, area.chromaFormat, Position(0, 0), area.size());
PelBuf tmpPred;
#endif
if (slice.getReshapeInfo().getUseSliceReshaper() && (m_pcReshape->getCTUFlag() || slice.isIntra() || (slice.getSliceType() == P_SLICE && slice.getSPS()->getSpsNext().getIBCMode())) && compID == COMPONENT_Y)
if (slice.getReshapeInfo().getUseSliceReshaper() && (m_pcReshape->getCTUFlag() || slice.isIntra()) && compID == COMPONENT_Y)
{
#if REUSE_CU_RESULTS
{
......@@ -293,7 +293,7 @@ void DecCu::xIntraRecBlk( TransformUnit& tu, const ComponentID compID )
pReco.copyFrom( piPred );
#endif
#if JVET_M0427_INLOOP_RESHAPER
if (slice.getReshapeInfo().getUseSliceReshaper() && (m_pcReshape->getCTUFlag() || slice.isIntra() || (slice.getSliceType() == P_SLICE && slice.getSPS()->getSpsNext().getIBCMode())) && compID == COMPONENT_Y)
if (slice.getReshapeInfo().getUseSliceReshaper() && (m_pcReshape->getCTUFlag() || slice.isIntra()) && compID == COMPONENT_Y)
{
#if REUSE_CU_RESULTS
{
......
......@@ -1277,7 +1277,7 @@ bool DecLib::xDecodeSlice(InputNALUnit &nalu, int &iSkipFrame, int iPOCLastDispl
{
m_cReshaper.setReshapeFlag(false);
}
if ((pcSlice->getSliceType() == I_SLICE|| (pcSlice->getSliceType() == P_SLICE && pcSlice->getSPS()->getSpsNext().getIBCMode()) ) && m_cReshaper.getSliceReshaperInfo().getUseSliceReshaper())
if ((pcSlice->getSliceType() == I_SLICE) && m_cReshaper.getSliceReshaperInfo().getUseSliceReshaper())
{
m_cReshaper.setCTUFlag(false);
m_cReshaper.setRecReshaped(true);
......
......@@ -2205,18 +2205,18 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic,
if (m_pcCfg->getReshapeSignalType() == RESHAPE_SIGNAL_PQ)
{
m_pcReshaper->preAnalyzerHDR(pcPic, pcSlice->getSliceType(), m_pcCfg->getReshapeCW(), m_pcCfg->getDualITree(), m_pcCfg->getIBCMode());
m_pcReshaper->preAnalyzerHDR(pcPic, pcSlice->getSliceType(), m_pcCfg->getReshapeCW(), m_pcCfg->getDualITree());
}
else if (m_pcCfg->getReshapeSignalType() == RESHAPE_SIGNAL_SDR)
{
m_pcReshaper->preAnalyzerSDR(pcPic, pcSlice->getSliceType(), m_pcCfg->getReshapeCW(), m_pcCfg->getDualITree(), m_pcCfg->getIBCMode());
m_pcReshaper->preAnalyzerSDR(pcPic, pcSlice->getSliceType(), m_pcCfg->getReshapeCW(), m_pcCfg->getDualITree());
}
else
{
THROW("Reshaper for signal other than PQ and SDR currently not defined!");
}
if (pcSlice->getSliceType() == I_SLICE || (pcSlice->getSliceType()==P_SLICE && m_pcCfg->getIBCMode()))
if (pcSlice->getSliceType() == I_SLICE )
{
if (m_pcCfg->getReshapeSignalType() == RESHAPE_SIGNAL_PQ)
{
......
......@@ -107,7 +107,7 @@ void EncReshape::destroy()
\param pcPic describe pointer of current coding picture
\param sliceType describe the slice type
*/
void EncReshape::preAnalyzerHDR(Picture *pcPic, const SliceType sliceType, const ReshapeCW& reshapeCW, bool isDualT, bool isIBC)
void EncReshape::preAnalyzerHDR(Picture *pcPic, const SliceType sliceType, const ReshapeCW& reshapeCW, bool isDualT)
{
if (m_lumaBD >= 10)
{
......@@ -119,11 +119,11 @@ void EncReshape::preAnalyzerHDR(Picture *pcPic, const SliceType sliceType, const
}
else
{
if (sliceType == I_SLICE || (sliceType==P_SLICE && isIBC) ) { m_sliceReshapeInfo.sliceReshaperModelPresentFlag = true; }
if (sliceType == I_SLICE ) { m_sliceReshapeInfo.sliceReshaperModelPresentFlag = true; }
else { m_sliceReshapeInfo.sliceReshaperModelPresentFlag = false; }
}
if ((sliceType == I_SLICE || (sliceType == P_SLICE && isIBC)) && isDualT) { m_sliceReshapeInfo.enableChromaAdj = 0; }
else { m_sliceReshapeInfo.enableChromaAdj = 1; }
if (sliceType == I_SLICE && isDualT) { m_sliceReshapeInfo.enableChromaAdj = 0; }
else { m_sliceReshapeInfo.enableChromaAdj = 1; }
}
else
{
......@@ -138,14 +138,14 @@ void EncReshape::preAnalyzerHDR(Picture *pcPic, const SliceType sliceType, const
\param sliceType describe the slice type
\param reshapeCW describe some input info
*/
void EncReshape::preAnalyzerSDR(Picture *pcPic, const SliceType sliceType, const ReshapeCW& reshapeCW, bool isDualT, bool isIBC)
void EncReshape::preAnalyzerSDR(Picture *pcPic, const SliceType sliceType, const ReshapeCW& reshapeCW, bool isDualT)
{
m_sliceReshapeInfo.sliceReshaperModelPresentFlag = true;
m_sliceReshapeInfo.sliceReshaperEnableFlag = true;
int modIP = pcPic->getPOC() - pcPic->getPOC() / reshapeCW.rspFpsToIp * reshapeCW.rspFpsToIp;
if (sliceType == I_SLICE || (reshapeCW.rspIntraPeriod == -1 && modIP == 0) || (sliceType== P_SLICE && isIBC))
if (sliceType == I_SLICE || (reshapeCW.rspIntraPeriod == -1 && modIP == 0))
{
if (m_sliceReshapeInfo.sliceReshaperModelPresentFlag == true)
{
......@@ -460,7 +460,7 @@ void EncReshape::preAnalyzerSDR(Picture *pcPic, const SliceType sliceType, const
}
m_chromaAdj = m_sliceReshapeInfo.enableChromaAdj;
if ((sliceType == I_SLICE || (sliceType == P_SLICE && isIBC)) && isDualT)
if (sliceType == I_SLICE && isDualT)
{
m_sliceReshapeInfo.enableChromaAdj = 0;
}
......@@ -1123,7 +1123,7 @@ void EncReshape::constructReshaperSDR()
int16_t *tempFwdLUT = new int16_t[m_reshapeLUTSize + 1]();
int i, j;
int cwScaleBins1, cwScaleBins2;
int maxAllowedCW = totCW;
int maxAllowedCW = totCW-1;
cwScaleBins1 = m_reshapeCW.binCW[0];
cwScaleBins2 = m_reshapeCW.binCW[1];
......@@ -1252,7 +1252,7 @@ void EncReshape::constructReshaperSDR()
int sumBins = 0;
for (i = 0; i < PIC_CODE_CW_BINS; i++) { sumBins += m_binCW[i]; }
CHECK(sumBins > m_reshapeLUTSize, "SDR CW assignment is wrong!!");
CHECK(sumBins >= m_reshapeLUTSize, "SDR CW assignment is wrong!!");
memset(tempFwdLUT, 0, (m_reshapeLUTSize + 1) * sizeof(int16_t));
tempFwdLUT[0] = 0;
......
......@@ -106,8 +106,8 @@ public:
bool getSrcReshaped() { return m_srcReshaped; }
void setSrcReshaped(bool b) { m_srcReshaped = b; }
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);
void preAnalyzerSDR(Picture *pcPic, const SliceType sliceType, const ReshapeCW& reshapeCW, bool isDualT);
void preAnalyzerHDR(Picture *pcPic, const SliceType sliceType, const ReshapeCW& reshapeCW, bool isDualT);
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,7 @@ void IntraSearch::xIntraCodingTUBlock(TransformUnit &tu, const ComponentID &comp
#if JVET_M0427_INLOOP_RESHAPER
const Slice &slice = *cs.slice;
bool flag = slice.getReshapeInfo().getUseSliceReshaper() && (slice.isIntra() || (!slice.isIntra() && m_pcReshape->getCTUFlag()) || (slice.getSliceType() == P_SLICE && slice.getSPS()->getSpsNext().getIBCMode()));
bool flag = slice.getReshapeInfo().getUseSliceReshaper() && (slice.isIntra() || (!slice.isIntra() && m_pcReshape->getCTUFlag()));
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