Commit 5529412a authored by Yung-Hsuan Chao (Jessie)'s avatar Yung-Hsuan Chao (Jessie)
Browse files

initial commit of JVET_O0119_BASE_PALETTE_444: palette in HEVC and palette...

initial commit of JVET_O0119_BASE_PALETTE_444: palette in HEVC and palette mode coding in JVET-N0258
parent b8a28645
......@@ -290,6 +290,9 @@ void EncApp::xInitLibCfg()
m_cEncLib.setMMVD ( m_MMVD );
m_cEncLib.setMmvdDisNum (m_MmvdDisNum);
m_cEncLib.setRDPCM ( m_RdpcmMode );
#if JVET_O0119_BASE_PALETTE_444
m_cEncLib.setPLTMode ( m_PLTMode);
#endif
m_cEncLib.setIBCMode ( m_IBCMode );
m_cEncLib.setIBCLocalSearchRangeX ( m_IBCLocalSearchRangeX );
m_cEncLib.setIBCLocalSearchRangeY ( m_IBCLocalSearchRangeY );
......
......@@ -901,6 +901,9 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
("DMVR", m_DMVR, false, "Decoder-side Motion Vector Refinement")
("MmvdDisNum", m_MmvdDisNum, 8, "Number of MMVD Distance Entries")
( "RDPCM", m_RdpcmMode, false, "RDPCM")
#if JVET_O0119_BASE_PALETTE_444
("PLT", m_PLTMode, 0u, "PLTMode (0x1:enabled, 0x0:disabled) [default: disabled]")
#endif
( "IBC", m_IBCMode, 0u, "IBCMode (0x1:enabled, 0x0:disabled) [default: disabled]")
( "IBCLocalSearchRangeX", m_IBCLocalSearchRangeX, 128u, "Search range of IBC local search in x direction")
( "IBCLocalSearchRangeY", m_IBCLocalSearchRangeY, 128u, "Search range of IBC local search in y direction")
......@@ -2181,6 +2184,9 @@ bool EncAppCfg::xCheckParameter()
#endif
xConfirmPara( m_LMChroma, "LMChroma only allowed with NEXT profile" );
xConfirmPara( m_ImvMode, "IMV is only allowed with NEXT profile" );
#if JVET_O0119_BASE_PALETTE_444
xConfirmPara( m_PLTMode, "PLT Mode only allowed with NEXT profile");
#endif
xConfirmPara(m_IBCMode, "IBC Mode only allowed with NEXT profile");
xConfirmPara( m_HashME, "Hash motion estimation only allowed with NEXT profile" );
xConfirmPara( m_useFastLCTU, "Fast large CTU can only be applied when encoding with NEXT profile" );
......@@ -3367,6 +3373,10 @@ void EncAppCfg::xPrintParameter()
msg(VERBOSE, "MmvdDisNum:%d ", m_MmvdDisNum);
msg(VERBOSE, "RDPCM:%d ", m_RdpcmMode );
}
#if JVET_O0119_BASE_PALETTE_444
m_PLTMode = ( m_chromaFormatIDC == CHROMA_444) ? m_PLTMode : 0u;
msg(VERBOSE, "PLT:%d ", m_PLTMode);
#endif
msg(VERBOSE, "IBC:%d ", m_IBCMode);
msg( VERBOSE, "HashME:%d ", m_HashME );
msg( VERBOSE, "WrapAround:%d ", m_wrapAround);
......
......@@ -283,6 +283,9 @@ protected:
bool m_MMVD;
int m_MmvdDisNum;
bool m_RdpcmMode;
#if JVET_O0119_BASE_PALETTE_444
unsigned m_PLTMode;
#endif
unsigned m_IBCMode;
unsigned m_IBCLocalSearchRangeX;
unsigned m_IBCLocalSearchRangeY;
......
......@@ -164,6 +164,13 @@ typedef AreaBuf<const TCoeff> CCoeffBuf;
typedef AreaBuf< MotionInfo> MotionBuf;
typedef AreaBuf<const MotionInfo> CMotionBuf;
#if JVET_O0119_BASE_PALETTE_444
typedef AreaBuf< TCoeff> PLTescapeBuf;
typedef AreaBuf<const TCoeff> CPLTescapeBuf;
typedef AreaBuf< bool> PLTtypeBuf;
typedef AreaBuf<const bool> CPLTtypeBuf;
#endif
#define SIZE_AWARE_PER_EL_OP( OP, INC ) \
if( ( width & 7 ) == 0 ) \
......
......@@ -72,6 +72,10 @@ CodingStructure::CodingStructure(CUCache& cuCache, PUCache& puCache, TUCache& tu
{
m_coeffs[ i ] = nullptr;
m_pcmbuf[ i ] = nullptr;
#if JVET_O0119_BASE_PALETTE_444
m_runType[i] = nullptr;
m_runLength[i] = nullptr;
#endif
m_offsets[ i ] = 0;
}
......@@ -501,6 +505,10 @@ TransformUnit& CodingStructure::addTU( const UnitArea &unit, const ChannelType c
TCoeff *coeffs[5] = { nullptr, nullptr, nullptr, nullptr, nullptr };
Pel *pcmbuf[5] = { nullptr, nullptr, nullptr, nullptr, nullptr };
#if JVET_O0119_BASE_PALETTE_444
bool *runType[5] = { nullptr, nullptr, nullptr, nullptr, nullptr };
Pel *runLength[5] = { nullptr, nullptr, nullptr, nullptr, nullptr };
#endif
uint32_t numCh = ::getNumberValidComponents( area.chromaFormat );
......@@ -537,12 +545,20 @@ TransformUnit& CodingStructure::addTU( const UnitArea &unit, const ChannelType c
coeffs[i] = m_coeffs[i] + m_offsets[i];
pcmbuf[i] = m_pcmbuf[i] + m_offsets[i];
#if JVET_O0119_BASE_PALETTE_444
runType[i] = m_runType[i] + m_offsets[i];
runLength[i] = m_runLength[i] + m_offsets[i];
#endif
unsigned areaSize = tu->blocks[i].area();
m_offsets[i] += areaSize;
}
#if JVET_O0119_BASE_PALETTE_444
tu->init( coeffs, pcmbuf, runLength, runType);
#else
tu->init( coeffs, pcmbuf );
#endif
return *tu;
}
......@@ -705,6 +721,64 @@ void CodingStructure::addMiToLut(static_vector<MotionInfo, MAX_NUM_HMVP_CANDS> &
lut.push_back(mi);
}
#if JVET_O0119_BASE_PALETTE_444
void CodingStructure::resetPrevPLT(PLTBuf& prevPLT)
{
for (int comp = 0; comp < MAX_NUM_COMPONENT; comp++)
{
prevPLT.curPLTSize[comp] = 0;
memset(prevPLT.curPLT[comp], 0, MAXPLTPREDSIZE * sizeof(Pel));
}
}
void CodingStructure::reorderPrevPLT(PLTBuf& prevPLT, uint32_t curPLTSize[MAX_NUM_COMPONENT], Pel curPLT[MAX_NUM_COMPONENT][MAXPLTSIZE], bool reuseflag[MAX_NUM_COMPONENT][MAXPLTPREDSIZE], uint32_t compBegin, uint32_t NumComp, bool jointPLT)
{
Pel stuffedPLT[MAX_NUM_COMPONENT][MAXPLTPREDSIZE];
uint32_t tempCurPLTsize[MAX_NUM_COMPONENT];
uint32_t stuffPLTsize[MAX_NUM_COMPONENT];
for (int i = compBegin; i < (compBegin + NumComp); i++)
{
ComponentID comID = jointPLT ? (ComponentID)compBegin : ((i > 0) ? COMPONENT_Cb : COMPONENT_Y);
tempCurPLTsize[comID] = curPLTSize[comID];
stuffPLTsize[i] = 0;
memcpy(stuffedPLT[i], curPLT[i], curPLTSize[comID] * sizeof(Pel));
}
for (int ch = compBegin; ch < (compBegin + NumComp); ch++)
{
ComponentID comID = jointPLT ? (ComponentID)compBegin : ((ch > 0) ? COMPONENT_Cb : COMPONENT_Y);
if (ch > 1) break;
for (int i = 0; i < prevPLT.curPLTSize[comID]; i++)
{
if (tempCurPLTsize[comID] + stuffPLTsize[ch] >= MAXPLTPREDSIZE)
break;
if (!reuseflag[comID][i])
{
if (ch == COMPONENT_Y)
{
stuffedPLT[0][tempCurPLTsize[comID] + stuffPLTsize[ch]] = prevPLT.curPLT[0][i];
}
else
{
stuffedPLT[1][tempCurPLTsize[comID] + stuffPLTsize[ch]] = prevPLT.curPLT[1][i];
stuffedPLT[2][tempCurPLTsize[comID] + stuffPLTsize[ch]] = prevPLT.curPLT[2][i];
}
stuffPLTsize[ch]++;
}
}
}
for (int i = compBegin; i < (compBegin + NumComp); i++)
{
ComponentID comID = jointPLT ? (ComponentID)compBegin : ((i > 0) ? COMPONENT_Cb : COMPONENT_Y);
prevPLT.curPLTSize[comID] = curPLTSize[comID] + stuffPLTsize[comID];
memcpy(prevPLT.curPLT[i], stuffedPLT[i], prevPLT.curPLTSize[comID] * sizeof(Pel));
}
}
#endif
void CodingStructure::rebindPicBufs()
{
CHECK( parent, "rebindPicBufs can only be used for the top level CodingStructure" );
......@@ -732,6 +806,10 @@ void CodingStructure::createCoeffs()
m_coeffs[i] = _area > 0 ? ( TCoeff* ) xMalloc( TCoeff, _area ) : nullptr;
m_pcmbuf[i] = _area > 0 ? ( Pel* ) xMalloc( Pel, _area ) : nullptr;
#if JVET_O0119_BASE_PALETTE_444
m_runType[i] = _area > 0 ? (bool*)xMalloc( bool, _area) : nullptr;
m_runLength[i] = _area > 0 ? (Pel*) xMalloc( Pel, _area) : nullptr;
#endif
}
}
......@@ -741,6 +819,10 @@ void CodingStructure::destroyCoeffs()
{
if( m_coeffs[i] ) { xFree( m_coeffs[i] ); m_coeffs[i] = nullptr; }
if( m_pcmbuf[i] ) { xFree( m_pcmbuf[i] ); m_pcmbuf[i] = nullptr; }
#if JVET_O0119_BASE_PALETTE_444
if (m_runType[i]) { xFree(m_runType[i]); m_runType[i] = nullptr; }
if (m_runLength[i]) { xFree(m_runLength[i]); m_runLength[i] = nullptr; }
#endif
}
}
......@@ -784,6 +866,10 @@ void CodingStructure::initSubStructure( CodingStructure& subStruct, const Channe
subStruct.motionLut = motionLut;
#if JVET_O0119_BASE_PALETTE_444
subStruct.prevPLT = prevPLT;
#endif
subStruct.initStructData( currQP[_chType], isLossless );
if( isTuEnc )
......@@ -845,6 +931,10 @@ void CodingStructure::useSubStructure( const CodingStructure& subStruct, const C
motionLut = subStruct.motionLut;
}
#if JVET_O0119_BASE_PALETTE_444
prevPLT = subStruct.prevPLT;
#endif
#if ENABLE_WPP_PARALLELISM
if( nullptr == parent )
......@@ -1027,6 +1117,9 @@ void CodingStructure::copyStructure( const CodingStructure& other, const Channel
motionLut = other.motionLut;
}
#if JVET_O0119_BASE_PALETTE_444
prevPLT = other.prevPLT;
#endif
if( copyTUs )
{
......
......@@ -197,6 +197,11 @@ public:
void addMiToLut(static_vector<MotionInfo, MAX_NUM_HMVP_CANDS>& lut, const MotionInfo &mi);
#if JVET_O0119_BASE_PALETTE_444
PLTBuf prevPLT;
void resetPrevPLT(PLTBuf& prevPLT);
void reorderPrevPLT(PLTBuf& prevPLT, uint32_t curPLTSize[MAX_NUM_COMPONENT], Pel curPLT[MAX_NUM_COMPONENT][MAXPLTSIZE], bool reuseflag[MAX_NUM_COMPONENT][MAXPLTPREDSIZE], uint32_t compBegin, uint32_t NumComp, bool jointPLT);
#endif
private:
// needed for TU encoding
......@@ -224,7 +229,10 @@ private:
TCoeff *m_coeffs [ MAX_NUM_COMPONENT ];
Pel *m_pcmbuf [ MAX_NUM_COMPONENT ];
#if JVET_O0119_BASE_PALETTE_444
bool *m_runType [MAX_NUM_COMPONENT];
Pel *m_runLength[MAX_NUM_COMPONENT];
#endif
int m_offsets[ MAX_NUM_COMPONENT ];
MotionInfo *m_motionBuf;
......
......@@ -469,6 +469,14 @@ static const int CSCALE_FP_PREC = 11;
static const int NEIG_NUM_LOG = 6;
static const int NEIG_NUM = 1 << NEIG_NUM_LOG;
#endif
#if JVET_O0119_BASE_PALETTE_444
static const int MAXPLTPREDSIZE = 63;
static const int MAXPLTSIZE = 31;
static const int PLT_RUN_MSB_IDX_CABAC_BYPASS_THRE = 4;
static const int PLT_RUN_MSB_IDX_CTX_T1 = 1;
static const int PLT_RUN_MSB_IDX_CTX_T2 = 3;
static const int PLT_FAST_RATIO = 100;
#endif
#if RExt__DECODER_DEBUG_TOOL_MAX_FRAME_STATS
static const int EPBIN_WEIGHT_FACTOR = 4;
#endif
......
......@@ -679,6 +679,48 @@ const CtxSet ContextSetCfg::LFNSTIdx = ContextSetCfg::addCtxSet
{ 8, 8, },
} );
#if JVET_O0119_BASE_PALETTE_444
const CtxSet ContextSetCfg::PLTFlag = ContextSetCfg::addCtxSet
({
{ 146 },
{ 146 },
{ 147 },
{ 1 }
});
const CtxSet ContextSetCfg::RotationFlag = ContextSetCfg::addCtxSet
({
{ 153 },
{ 138 },
{ 168 },
{ 5 }
});
const CtxSet ContextSetCfg::RunTypeFlag = ContextSetCfg::addCtxSet
({
{ 167 },
{ 167 },
{ 167 },
{ 8 }
});
const CtxSet ContextSetCfg::IdxRunModel = ContextSetCfg::addCtxSet
({
{ 157, 169, 138, 170, 155 },
{ 186, 169, 166, 186, 185 },
{ 155, 168, 167, 155, 154 },
{ 5, 6, 5, 9, 10 }
});
const CtxSet ContextSetCfg::CopyRunModel = ContextSetCfg::addCtxSet
({
{ 187, 172, 156 },
{ 187, 187, 185 },
{ 201, 171, 155 },
{ 0, 5, 5 }
});
#endif
const CtxSet ContextSetCfg::RdpcmFlag = ContextSetCfg::addCtxSet
({
{ CNU, CNU, },
......@@ -905,6 +947,9 @@ const unsigned ContextSetCfg::NumberOfContexts = (unsigned)ContextSetCfg::sm_Ini
// combined sets
#if JVET_O0119_BASE_PALETTE_444
const CtxSet ContextSetCfg::Palette = { ContextSetCfg::RotationFlag, ContextSetCfg::RunTypeFlag, ContextSetCfg::IdxRunModel, ContextSetCfg::CopyRunModel };
#endif
const CtxSet ContextSetCfg::Sao = { ContextSetCfg::SaoMergeFlag, ContextSetCfg::SaoTypeIdx };
const CtxSet ContextSetCfg::Alf = { ContextSetCfg::ctbAlfFlag, ContextSetCfg::AlfUseLatestFilt, ContextSetCfg::AlfUseTemporalFilt };
......
......@@ -248,6 +248,13 @@ public:
static const CtxSet MTSIndex;
static const CtxSet TransquantBypassFlag;
static const CtxSet LFNSTIdx;
#if JVET_O0119_BASE_PALETTE_444
static const CtxSet PLTFlag;
static const CtxSet RotationFlag;
static const CtxSet RunTypeFlag;
static const CtxSet IdxRunModel;
static const CtxSet CopyRunModel;
#endif
static const CtxSet RdpcmFlag;
static const CtxSet RdpcmDir;
static const CtxSet SbtFlag;
......@@ -274,6 +281,9 @@ public:
// NOTE: The contained CtxSet's should directly follow each other in the initalization list;
// otherwise, you will copy more elements than you want !!!
static const CtxSet Sao;
#if JVET_O0119_BASE_PALETTE_444
static const CtxSet Palette;
#endif
public:
static const std::vector<uint8_t>& getInitTable( unsigned initId );
......
......@@ -175,6 +175,10 @@ void IntraPrediction::destroy()
m_piTemp = nullptr;
delete[] m_pMdlmTemp;
m_pMdlmTemp = nullptr;
#if JVET_O0119_BASE_PALETTE_444
if (m_runTypeRD) { xFree(m_runTypeRD); m_runTypeRD = NULL; }
if (m_runLengthRD) { xFree(m_runLengthRD); m_runLengthRD = NULL; }
#endif
}
void IntraPrediction::init(ChromaFormat chromaFormatIDC, const unsigned bitDepthY)
......@@ -226,6 +230,10 @@ void IntraPrediction::init(ChromaFormat chromaFormatIDC, const unsigned bitDepth
{
m_pMdlmTemp = new Pel[(2 * MAX_CU_SIZE + 1)*(2 * MAX_CU_SIZE + 1)];//MDLM will use top-above and left-below samples.
}
#if JVET_O0119_BASE_PALETTE_444
m_runTypeRD = (bool*)xMalloc(bool, MAX_CU_SIZE*MAX_CU_SIZE);
m_runLengthRD = (Pel*)xMalloc(Pel, MAX_CU_SIZE*MAX_CU_SIZE);
#endif
}
// ====================================================================================================================
......@@ -1928,4 +1936,150 @@ void IntraPrediction::predIntraMip( const ComponentID compId, PelBuf &piPred, co
m_matrixIntraPred.predBlock( pu.Y(), pu.intraDir[CHANNEL_TYPE_LUMA], piPred, bitDepth );
}
#if JVET_O0119_BASE_PALETTE_444
bool IntraPrediction::calCopyRun(CodingStructure &cs, Partitioner& partitioner, uint32_t uiStartPos, uint32_t uiTotal, uint32_t &uiRun, ComponentID compBegin)
{
CodingUnit &cu = *cs.getCU(partitioner.chType);
TransformUnit &tu = *cs.getTU(partitioner.chType);
PelBuf curPLTIdx = tu.getcurPLTIdx(compBegin);
PLTtypeBuf runType = tu.getrunType(compBegin);
uint32_t uiIdx = uiStartPos;
uint32_t uiX;
uint32_t uiY;
bool valid = false;
uiRun = 0;
while (uiIdx < uiTotal)
{
uiX = m_puiScanOrder[uiIdx].x;
uiY = m_puiScanOrder[uiIdx].y;
runType.at(uiX, uiY) = PLT_RUN_COPY;
if (uiY == 0 && !cu.useRotation[compBegin])
{
return false;
}
if (uiX == 0 && cu.useRotation[compBegin])
{
return false;
}
if (!cu.useRotation[compBegin] && curPLTIdx.at(uiX, uiY) == curPLTIdx.at(uiX, uiY - 1))
{
uiRun++;
valid = true;
}
else if (cu.useRotation[compBegin] && curPLTIdx.at(uiX, uiY) == curPLTIdx.at(uiX - 1, uiY))
{
uiRun++;
valid = true;
}
else
{
break;
}
uiIdx++;
}
return valid;
}
bool IntraPrediction::calIndexRun(CodingStructure &cs, Partitioner& partitioner, uint32_t uiStartPos, uint32_t uiTotal, uint32_t &uiRun, ComponentID compBegin)
{
TransformUnit &tu = *cs.getTU(partitioner.chType);
PelBuf curPLTIdx = tu.getcurPLTIdx(compBegin);
PLTtypeBuf runType = tu.getrunType(compBegin);
uiRun = 1;
uint32_t uiIdx = uiStartPos;
while (uiIdx < uiTotal)
{
uint32_t uiX = m_puiScanOrder[uiIdx].x;
uint32_t uiY = m_puiScanOrder[uiIdx].y;
runType.at(uiX, uiY) = PLT_RUN_INDEX;
uint32_t uiXprev = uiIdx == 0 ? 0 : m_puiScanOrder[uiIdx - 1].x;
uint32_t uiYprev = uiIdx == 0 ? 0 : m_puiScanOrder[uiIdx - 1].y;
if (uiIdx > uiStartPos && curPLTIdx.at(uiX, uiY) == curPLTIdx.at(uiXprev, uiYprev))
{
uiRun++;
}
else if (uiIdx > uiStartPos)
{
break;
}
uiIdx++;
}
return true;
}
void IntraPrediction::reorderPLT(CodingStructure& cs, Partitioner& partitioner, ComponentID compBegin, uint32_t NumComp)
{
CodingUnit &cu = *cs.getCU(partitioner.chType);
uint32_t reusePLTSizetmp = 0;
uint32_t PLTSizetmp = 0;
Pel curPLTtmp[MAX_NUM_COMPONENT][MAXPLTSIZE];
bool curPLTpred[MAXPLTPREDSIZE];
for (int idx = 0; idx < MAXPLTPREDSIZE; idx++)
{
curPLTpred[idx] = false;
cu.reuseflag[compBegin][idx] = false;
}
for (int idx = 0; idx < MAXPLTSIZE; idx++)
{
curPLTpred[idx] = false;
}
for (int predidx = 0; predidx < cs.prevPLT.curPLTSize[compBegin]; predidx++)
{
bool match = false;
int curidx = 0;
for (curidx = 0; curidx < cu.curPLTSize[compBegin]; curidx++)
{
bool matchTmp = true;
for (int comp = compBegin; comp < (compBegin + NumComp); comp++)
{
matchTmp = matchTmp && (cu.curPLT[comp][curidx] == cs.prevPLT.curPLT[comp][predidx]);
}
if (matchTmp)
{
match = true;
break;
}
}
if (match)
{
cu.reuseflag[compBegin][predidx] = true;
curPLTpred[curidx] = true;
for (int comp = compBegin; comp < (compBegin + NumComp); comp++)
{
curPLTtmp[comp][reusePLTSizetmp] = cs.prevPLT.curPLT[comp][predidx];
}
reusePLTSizetmp++;
PLTSizetmp++;
}
}
cu.reusePLTSize[compBegin] = reusePLTSizetmp;
for (int curidx = 0; curidx < cu.curPLTSize[compBegin]; curidx++)
{
if (!curPLTpred[curidx])
{
for (int comp = compBegin; comp < (compBegin + NumComp); comp++)
{
curPLTtmp[comp][PLTSizetmp] = cu.curPLT[comp][curidx];
}
PLTSizetmp++;
}
}
assert(PLTSizetmp == cu.curPLTSize[compBegin]);
for (int curidx = 0; curidx < cu.curPLTSize[compBegin]; curidx++)
{
for (int comp = compBegin; comp < (compBegin + NumComp); comp++)
{
cu.curPLT[comp][curidx] = curPLTtmp[comp][curidx];
}
}
}
#endif
//! \}
......@@ -108,12 +108,23 @@ private:
Pel* m_pMdlmTemp; // for MDLM mode
MatrixIntraPrediction m_matrixIntraPred;
protected:
protected:
ChromaFormat m_currChromaFormat;
int m_topRefLength;
int m_leftRefLength;
#if JVET_O0119_BASE_PALETTE_444
ScanElement* m_puiScanOrder;
bool m_bBestScanRotationMode;
Ctx m_storeCtx_Run;
Ctx m_storeCtx_RunIndex;
Ctx m_storeCtx_RunCopy;
Ctx m_orgCtxRD;
bool *m_runTypeRD;
Pel *m_runLengthRD;
#endif
// prediction
void xPredIntraPlanar ( const CPelBuf &pSrc, PelBuf &pDst );
void xPredIntraDc ( const CPelBuf &pSrc, PelBuf &pDst, const ChannelType channelType, const bool enableBoundaryFilter = true );
......@@ -163,6 +174,11 @@ public:
Pel* getPredictorPtr2 (const ComponentID compID, uint32_t idx) { return m_yuvExt2[compID][idx]; }
void switchBuffer (const PredictionUnit &pu, ComponentID compID, PelBuf srcBuff, Pel *dst);
void geneIntrainterPred (const CodingUnit &cu);
#if JVET_O0119_BASE_PALETTE_444
void reorderPLT(CodingStructure& cs, Partitioner& partitioner, ComponentID compBegin, uint32_t NumComp);
bool calCopyRun(CodingStructure &cs, Partitioner& partitioner, uint32_t uiStartPos, uint32_t uiTotal, uint32_t &uiRun, ComponentID compBegin);
bool calIndexRun(CodingStructure &cs, Partitioner& partitioner, uint32_t uiStartPos, uint32_t uiTotal, uint32_t &uiRun, ComponentID compBegin);
#endif
};
//! \}
......
......@@ -821,6 +821,9 @@ void LoopFilter::xEdgeFilterLuma( const CodingUnit& cu, const DeblockEdgeDir edg
const SPS &sps = *(cu.cs->sps);
const Slice &slice = *(cu.slice);
const bool ppsTransquantBypassEnabledFlag = pps.getTransquantBypassEnabledFlag();
#if JVET_O0119_BASE_PALETTE_444
const bool spsPaletteEnabledFlag = sps.getPLTMode();
#endif
const int bitDepthLuma = sps.getBitDepth(CHANNEL_TYPE_LUMA);
const ClpRng& clpRng( cu.cs->slice->clpRng(COMPONENT_Y) );
......@@ -984,6 +987,14 @@ void LoopFilter::xEdgeFilterLuma( const CodingUnit& cu, const DeblockEdgeDir edg
bPartPNoFilter = bPartPNoFilter || cuP.transQuantBypass;
bPartQNoFilter = bPartQNoFilter || cuQ.transQuantBypass;
}
#if JVET_O0119_BASE_PALETTE_444
if (spsPaletteEnabledFlag)
{
// check if each of PUs is palette coded
bPartPNoFilter = bPartPNoFilter || CU::isPLT(cuP);
bPartQNoFilter = bPartQNoFilter || CU::isPLT(cuQ);
}
#endif
if (dL < iBeta)
{
......@@ -1029,6 +1040,14 @@ void LoopFilter::xEdgeFilterLuma( const CodingUnit& cu, const DeblockEdgeDir edg
bPartPNoFilter = bPartPNoFilter || cuP.transQuantBypass;
bPartQNoFilter = bPartQNoFilter || cuQ.transQuantBypass;
}
#if JVET_O0119_BASE_PALETTE_444
if ( spsPaletteEnabledFlag)
{
// check if each of PUs is palette coded
bPartPNoFilter = bPartPNoFilter || CU::isPLT(