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

more fix

parent 65f5a45f
......@@ -662,6 +662,12 @@ void SampleAdaptiveOffset::xPCMSampleRestoration(CodingUnit& cu, const Component
PelBuf dstBuf = cu.cs->getRecoBuf( currTU.block(compID) );
dstBuf.copyFrom( pcmBuf );
#if JVET_M0427_INLOOP_RESHAPER
if (cu.slice->getReshapeInfo().getUseSliceReshaper() && isLuma(compID))
{
dstBuf.rspSignal(m_pcReshape->getInvLUT());
}
#endif
}
return;
......@@ -680,6 +686,12 @@ void SampleAdaptiveOffset::xPCMSampleRestoration(CodingUnit& cu, const Component
dstBuf.at(x,y) = (pcmBuf.at(x,y) << uiPcmLeftShiftBit);
}
}
#if JVET_M0427_INLOOP_RESHAPER
if (cu.slice->getReshapeInfo().getUseSliceReshaper() && isLuma(compID))
{
dstBuf.rspSignal(m_pcReshape->getInvLUT());
}
#endif
}
void SampleAdaptiveOffset::deriveLoopFilterBoundaryAvailibility(CodingStructure& cs, const Position &pos,
......
......@@ -40,7 +40,9 @@
#include "CommonDef.h"
#include "Unit.h"
#if JVET_M0427_INLOOP_RESHAPER
#include "Reshape.h"
#endif
//! \ingroup CommonLib
//! \{
......@@ -70,7 +72,9 @@ public:
void create( int picWidth, int picHeight, ChromaFormat format, uint32_t maxCUWidth, uint32_t maxCUHeight, uint32_t maxCUDepth, uint32_t lumaBitShift, uint32_t chromaBitShift );
void destroy();
static int getMaxOffsetQVal(const int channelBitDepth) { return (1<<(std::min<int>(channelBitDepth,MAX_SAO_TRUNCATED_BITDEPTH)-5))-1; } //Table 9-32, inclusive
#if JVET_M0427_INLOOP_RESHAPER
void setReshaper(Reshape * p) { m_pcReshape = p; }
#endif
protected:
void deriveLoopFilterBoundaryAvailibility(CodingStructure& cs, const Position &pos,
bool& isLeftAvail,
......@@ -93,7 +97,9 @@ protected:
void xPCMCURestoration(CodingStructure& cs, const UnitArea &ctuArea);
void xPCMSampleRestoration(CodingUnit& cu, const ComponentID compID);
void xReconstructBlkSAOParams(CodingStructure& cs, SAOBlkParam* saoBlkParams);
#if JVET_M0427_INLOOP_RESHAPER
Reshape* m_pcReshape;
#endif
protected:
uint32_t m_offsetStepLog2[MAX_NUM_COMPONENT]; //offset step
PelStorage m_tempBuf;
......
......@@ -564,6 +564,7 @@ void DecLib::executeLoopFilters()
CHECK((m_cReshaper.getRecReshaped() == false), "Rec picture is not reshaped!");
m_pcPic->getRecoBuf(COMPONENT_Y).rspSignal(m_cReshaper.getInvLUT());
m_cReshaper.setRecReshaped(false);
m_cSAO.setReshaper(&m_cReshaper);
}
#endif
// deblocking filter
......
......@@ -1893,6 +1893,17 @@ void EncCu::xFillPCMBuffer( CodingUnit &cu )
const CPelBuf source = tu.cs->getOrgBuf( compArea );
PelBuf destination = tu.getPcmbuf( compID );
#if JVET_M0427_INLOOP_RESHAPER
if (tu.cs->slice->getReshapeInfo().getUseSliceReshaper() && m_pcReshape->getCTUFlag() && compID == COMPONENT_Y)
{
CompArea tmpArea(COMPONENT_Y, compArea.chromaFormat, Position(0, 0), compArea.size());
PelBuf tempOrgBuf = m_tmpStorageLCU->getBuf(tmpArea);
tempOrgBuf.copyFrom(source);
tempOrgBuf.rspSignal(m_pcReshape->getFwdLUT());
destination.copyFrom(tempOrgBuf);
}
else
#endif
destination.copyFrom( source );
}
}
......
......@@ -1338,13 +1338,25 @@ void IntraSearch::xEncPCM(CodingStructure &cs, Partitioner& partitioner, const C
CPelBuf orgBuf = cs.getOrgBuf ( area );
CHECK(pcmShiftRight < 0, "Negative shift");
#if JVET_M0427_INLOOP_RESHAPER
CompArea tmpArea(COMPONENT_Y, area.chromaFormat, Position(0, 0), area.size());
PelBuf tempOrgBuf = m_tmpStorageLCU.getBuf(tmpArea);
tempOrgBuf.copyFrom(orgBuf);
if (cs.slice->getReshapeInfo().getUseSliceReshaper() && m_pcReshape->getCTUFlag() && compID == COMPONENT_Y)
{
tempOrgBuf.rspSignal(m_pcReshape->getFwdLUT());
}
#endif
for (uint32_t uiY = 0; uiY < pcmBuf.height; uiY++)
{
for (uint32_t uiX = 0; uiX < pcmBuf.width; uiX++)
{
// Encode
#if JVET_M0427_INLOOP_RESHAPER
pcmBuf.at(uiX, uiY) = tempOrgBuf.at(uiX, uiY) >> pcmShiftRight;
#else
pcmBuf.at(uiX, uiY) = orgBuf.at(uiX, uiY) >> pcmShiftRight;
#endif
// Reconstruction
recBuf.at(uiX, uiY) = pcmBuf.at(uiX, uiY) << pcmShiftRight;
}
......
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