Commit 51d9db8e authored by Taoran Lu's avatar Taoran Lu
Browse files

remove variable prefix and rebase

parent 7cde3746
......@@ -50,6 +50,8 @@
#include <assert.h>
#include <cassert>
#define JVET_M0427_INLOOP_RESHAPER 1
#define JVET_M0470 1 // Fixed GR/TU+EG-k transition point, use limited prefix length for escape codes
#define JVET_M0257 1 // Scan only non zero-out regions of large TUs
......
......@@ -211,9 +211,9 @@ void DecCu::xIntraRecBlk( TransformUnit& tu, const ComponentID compID )
}
#if JVET_M0427_INLOOP_RESHAPER
const Slice &slice = *cs.slice;
bool bFlag = 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() ) || (slice.getSliceType() == P_SLICE && slice.getSPS()->getSpsNext().getIBCMode()));
if (bFlag && slice.getReshapeInfo().getSliceReshapeChromaAdj() && (compID != COMPONENT_Y))
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()));
const CompArea &areaY = CompArea(COMPONENT_Y, tu.chromaFormat, area);
......@@ -240,8 +240,8 @@ void DecCu::xIntraRecBlk( TransformUnit& tu, const ComponentID compID )
//===== reconstruction =====
#if JVET_M0427_INLOOP_RESHAPER
bFlag = bFlag && (tu.blocks[compID].width*tu.blocks[compID].height > 4);
if (bFlag && TU::getCbf(tu, compID) && isChroma(compID) && slice.getReshapeInfo().getSliceReshapeChromaAdj())
flag = flag && (tu.blocks[compID].width*tu.blocks[compID].height > 4);
if (flag && TU::getCbf(tu, compID) && isChroma(compID) && slice.getReshapeInfo().getSliceReshapeChromaAdj())
{
piResi.scaleSignal(tu.getChromaAdj(), 0, tu.cu->cs->slice->clpRng(compID));
}
......@@ -600,10 +600,10 @@ void DecCu::xDecodeInterTexture(CodingUnit &cu)
if (slice.getReshapeInfo().getUseSliceReshaper() && m_pcReshape->getCTUFlag() && slice.getReshapeInfo().getSliceReshapeChromaAdj() && (compID == COMPONENT_Y))
{
const CompArea &areaY = currTU.blocks[COMPONENT_Y];
PelBuf piPredY = cs.getPredBuf(areaY);
PelBuf predY = cs.getPredBuf(areaY);
CompArea tmpArea(COMPONENT_Y, areaY.chromaFormat, Position(0, 0), areaY.size());
PelBuf tmpPred = m_tmpStorageLCU->getBuf(tmpArea);
tmpPred.copyFrom(piPredY);
tmpPred.copyFrom(predY);
if (!cu.firstPU->mhIntraFlag && !cu.ibc)
tmpPred.rspSignal(m_pcReshape->getFwdLUT());
const Pel avgLuma = tmpPred.computeAvg();
......
......@@ -1007,13 +1007,13 @@ void EncReshape::initLUTfromdQPModel()
int pwlFwdBinLen = m_reshapeLUTSize / PIC_CODE_CW_BINS;
int p1 = m_dQPModel.scaleFracPrec;
int p2 = m_dQPModel.offsetFracPrec;
int total_shift = p1 + p2;
int totalShift = p1 + p2;
int scaleFP = (1 - 2 * m_dQPModel.scaleSign) * m_dQPModel.scaleAbs;
int offsetFP = (1 - 2 * m_dQPModel.offsetSign) * m_dQPModel.offsetAbs;
int maxQP = (1 - 2 * m_dQPModel.maxQPSign) * m_dQPModel.maxQPAbs;
int minQP = (1 - 2 * m_dQPModel.minQPSign) * m_dQPModel.minQPAbs;
int maxFP = maxQP * (1 << total_shift);
int minFP = minQP * (1 << total_shift);
int maxFP = maxQP * (1 << totalShift);
int minFP = minQP * (1 << totalShift);
int temp, signval, absval;
int dQPDiv6FP;
int32_t * slopeLUT = new int32_t[m_reshapeLUTSize]();
......@@ -1026,7 +1026,7 @@ void EncReshape::initLUTfromdQPModel()
temp = temp > maxFP ? maxFP : temp < minFP ? minFP : temp;
signval = temp >= 0 ? 1 : -1;
absval = signval * temp;
dQPDiv6FP = signval * (((absval + 3) / 6 + (1 << (total_shift - 17))) >> (total_shift - 16));
dQPDiv6FP = signval * (((absval + 3) / 6 + (1 << (totalShift - 17))) >> (totalShift - 16));
slopeLUT[i] = calcEXP2(dQPDiv6FP);
}
......
......@@ -1483,7 +1483,15 @@ void EncSlice::encodeCtus( Picture* pcPic, const bool bCompressEntireSlice, cons
if ( pcSlice->getSPS()->getDisFracMmvdEnabledFlag() ||
( pcSlice->getSPS()->getSpsNext().getIBCMode() && m_pcCuEncoder->getEncCfg()->getIBCHashSearch() ) )
{
#if JVET_M0427_INLOOP_RESHAPER
if (pcSlice->getSPS()->getUseReshaper() && m_pcLib->getReshaper()->getCTUFlag() && pcSlice->getSPS()->getSpsNext().getIBCMode())
cs.picture->getOrigBuf(COMPONENT_Y).rspSignal(m_pcLib->getReshaper()->getFwdLUT());
#endif
m_pcCuEncoder->getIbcHashMap().rebuildPicHashMap( cs.picture->getOrigBuf() );
#if JVET_M0427_INLOOP_RESHAPER
if (pcSlice->getSPS()->getUseReshaper() && m_pcLib->getReshaper()->getCTUFlag() && pcSlice->getSPS()->getSpsNext().getIBCMode())
cs.picture->getOrigBuf().copyFrom(cs.picture->getTrueOrigBuf());
#endif
}
checkDisFracMmvd( pcPic, startCtuTsAddr, boundingCtuTsAddr );
#endif
......
......@@ -1317,8 +1317,8 @@ void IntraSearch::xIntraCodingTUBlock(TransformUnit &tu, const ComponentID &comp
#if JVET_M0427_INLOOP_RESHAPER
const Slice &slice = *cs.slice;
bool bFlag = slice.getReshapeInfo().getUseSliceReshaper() && (slice.isIntra() || (!slice.isIntra() && m_pcReshape->getCTUFlag()) || (slice.getSliceType() == P_SLICE && slice.getSPS()->getSpsNext().getIBCMode()));
if (bFlag && slice.getReshapeInfo().getSliceReshapeChromaAdj() && isChroma(compID))
bool flag = slice.getReshapeInfo().getUseSliceReshaper() && (slice.isIntra() || (!slice.isIntra() && m_pcReshape->getCTUFlag()) || (slice.getSliceType() == P_SLICE && slice.getSPS()->getSpsNext().getIBCMode()));
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()));
const CompArea &areaY = CompArea(COMPONENT_Y, tu.chromaFormat, area );
......@@ -1370,8 +1370,8 @@ void IntraSearch::xIntraCodingTUBlock(TransformUnit &tu, const ComponentID &comp
#endif
#if JVET_M0427_INLOOP_RESHAPER
bFlag = bFlag && (tu.blocks[compID].width*tu.blocks[compID].height > 4);
if (bFlag && isChroma(compID) && slice.getReshapeInfo().getSliceReshapeChromaAdj() )
flag =flag && (tu.blocks[compID].width*tu.blocks[compID].height > 4);
if (flag && isChroma(compID) && slice.getReshapeInfo().getSliceReshapeChromaAdj() )
{
int cResScaleInv = tu.getChromaAdj();
double cResScale = round((double)(1 << CSCALE_FP_PREC) / (double)cResScaleInv);
......@@ -1407,7 +1407,7 @@ void IntraSearch::xIntraCodingTUBlock(TransformUnit &tu, const ComponentID &comp
//===== reconstruction =====
#if JVET_M0427_INLOOP_RESHAPER
if (bFlag && uiAbsSum > 0 && isChroma(compID) && slice.getReshapeInfo().getSliceReshapeChromaAdj() )
if (flag && uiAbsSum > 0 && isChroma(compID) && slice.getReshapeInfo().getSliceReshapeChromaAdj() )
{
piResi.scaleSignal(tu.getChromaAdj(), 0, tu.cu->cs->slice->clpRng(compID));
}
......
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