...
 
Commits (26)
This diff is collapsed.
...@@ -121,7 +121,11 @@ protected: ...@@ -121,7 +121,11 @@ protected:
, const bool& bioApplied , const bool& bioApplied
, const bool luma, const bool chroma , const bool luma, const bool chroma
); );
#if JVET_O0108_DIS_DMVR_BDOF_CIIP
void xPredInterBi ( PredictionUnit& pu, PelUnitBuf &pcYuvPred, PelUnitBuf* yuvPredTmp = NULL );
#else
void xPredInterBi ( PredictionUnit& pu, PelUnitBuf &pcYuvPred ); void xPredInterBi ( PredictionUnit& pu, PelUnitBuf &pcYuvPred );
#endif
void xPredInterBlk ( const ComponentID& compID, const PredictionUnit& pu, const Picture* refPic, const Mv& _mv, PelUnitBuf& dstPic, const bool& bi, const ClpRng& clpRng void xPredInterBlk ( const ComponentID& compID, const PredictionUnit& pu, const Picture* refPic, const Mv& _mv, PelUnitBuf& dstPic, const bool& bi, const ClpRng& clpRng
, const bool& bioApplied , const bool& bioApplied
, bool isIBC , bool isIBC
...@@ -136,7 +140,11 @@ protected: ...@@ -136,7 +140,11 @@ protected:
void xBioGradFilter (Pel* pSrc, int srcStride, int width, int height, int gradStride, Pel* gradX, Pel* gradY, int bitDepth); void xBioGradFilter (Pel* pSrc, int srcStride, int width, int height, int gradStride, Pel* gradX, Pel* gradY, int bitDepth);
void xCalcBIOPar (const Pel* srcY0Temp, const Pel* srcY1Temp, const Pel* gradX0, const Pel* gradX1, const Pel* gradY0, const Pel* gradY1, int* dotProductTemp1, int* dotProductTemp2, int* dotProductTemp3, int* dotProductTemp5, int* dotProductTemp6, const int src0Stride, const int src1Stride, const int gradStride, const int widthG, const int heightG, int bitDepth); void xCalcBIOPar (const Pel* srcY0Temp, const Pel* srcY1Temp, const Pel* gradX0, const Pel* gradX1, const Pel* gradY0, const Pel* gradY1, int* dotProductTemp1, int* dotProductTemp2, int* dotProductTemp3, int* dotProductTemp5, int* dotProductTemp6, const int src0Stride, const int src1Stride, const int gradStride, const int widthG, const int heightG, int bitDepth);
void xCalcBlkGradient (int sx, int sy, int *arraysGx2, int *arraysGxGy, int *arraysGxdI, int *arraysGy2, int *arraysGydI, int &sGx2, int &sGy2, int &sGxGy, int &sGxdI, int &sGydI, int width, int height, int unitSize); void xCalcBlkGradient (int sx, int sy, int *arraysGx2, int *arraysGxGy, int *arraysGxdI, int *arraysGy2, int *arraysGydI, int &sGx2, int &sGy2, int &sGxGy, int &sGxdI, int &sGydI, int width, int height, int unitSize);
void xWeightedAverage ( const PredictionUnit& pu, const CPelUnitBuf& pcYuvSrc0, const CPelUnitBuf& pcYuvSrc1, PelUnitBuf& pcYuvDst, const BitDepths& clipBitDepths, const ClpRngs& clpRngs, const bool& bioApplied ); #if JVET_O0108_DIS_DMVR_BDOF_CIIP
void xWeightedAverage ( const PredictionUnit& pu, const CPelUnitBuf& pcYuvSrc0, const CPelUnitBuf& pcYuvSrc1, PelUnitBuf& pcYuvDst, const BitDepths& clipBitDepths, const ClpRngs& clpRngs, const bool& bioApplied, PelUnitBuf* yuvDstTmp = NULL );
#else
void xWeightedAverage ( const PredictionUnit& pu, const CPelUnitBuf& pcYuvSrc0, const CPelUnitBuf& pcYuvSrc1, PelUnitBuf& pcYuvDst, const BitDepths& clipBitDepths, const ClpRngs& clpRngs, const bool& bioApplied );
#endif
void xPredAffineBlk( const ComponentID& compID, const PredictionUnit& pu, const Picture* refPic, const Mv* _mv, PelUnitBuf& dstPic, const bool& bi, const ClpRng& clpRng ); void xPredAffineBlk( const ComponentID& compID, const PredictionUnit& pu, const Picture* refPic, const Mv* _mv, PelUnitBuf& dstPic, const bool& bi, const ClpRng& clpRng );
void xWeightedTriangleBlk ( const PredictionUnit &pu, const uint32_t width, const uint32_t height, const ComponentID compIdx, const bool splitDir, PelUnitBuf& predDst, PelUnitBuf& predSrc0, PelUnitBuf& predSrc1 ); void xWeightedTriangleBlk ( const PredictionUnit &pu, const uint32_t width, const uint32_t height, const ComponentID compIdx, const bool splitDir, PelUnitBuf& predDst, PelUnitBuf& predSrc0, PelUnitBuf& predSrc1 );
...@@ -144,7 +152,11 @@ protected: ...@@ -144,7 +152,11 @@ protected:
static bool xCheckIdenticalMotion( const PredictionUnit& pu ); static bool xCheckIdenticalMotion( const PredictionUnit& pu );
void xSubPuMC(PredictionUnit& pu, PelUnitBuf& predBuf, const RefPicList &eRefPicList = REF_PIC_LIST_X); void xSubPuMC(PredictionUnit& pu, PelUnitBuf& predBuf, const RefPicList &eRefPicList = REF_PIC_LIST_X);
#if JVET_O0108_DIS_DMVR_BDOF_CIIP
void xSubPuBio(PredictionUnit& pu, PelUnitBuf& predBuf, const RefPicList &eRefPicList = REF_PIC_LIST_X, PelUnitBuf* yuvDstTmp = NULL);
#else
void xSubPuBio(PredictionUnit& pu, PelUnitBuf& predBuf, const RefPicList &eRefPicList = REF_PIC_LIST_X); void xSubPuBio(PredictionUnit& pu, PelUnitBuf& predBuf, const RefPicList &eRefPicList = REF_PIC_LIST_X);
#endif
void destroy(); void destroy();
...@@ -162,6 +174,9 @@ public: ...@@ -162,6 +174,9 @@ public:
// inter // inter
void motionCompensation (PredictionUnit &pu, PelUnitBuf& predBuf, const RefPicList &eRefPicList = REF_PIC_LIST_X void motionCompensation (PredictionUnit &pu, PelUnitBuf& predBuf, const RefPicList &eRefPicList = REF_PIC_LIST_X
, const bool luma = true, const bool chroma = true , const bool luma = true, const bool chroma = true
#if JVET_O0108_DIS_DMVR_BDOF_CIIP
, PelUnitBuf* predBufWOBIO = NULL
#endif
); );
void motionCompensation (PredictionUnit &pu, const RefPicList &eRefPicList = REF_PIC_LIST_X void motionCompensation (PredictionUnit &pu, const RefPicList &eRefPicList = REF_PIC_LIST_X
, const bool luma = true, const bool chroma = true , const bool luma = true, const bool chroma = true
......
...@@ -177,6 +177,8 @@ void LoopFilter::loopFilterPic( CodingStructure& cs ...@@ -177,6 +177,8 @@ void LoopFilter::loopFilterPic( CodingStructure& cs
m_ctuYLumaSamples = y << pcv.maxCUHeightLog2; m_ctuYLumaSamples = y << pcv.maxCUHeightLog2;
const UnitArea ctuArea( pcv.chrFormat, Area( x << pcv.maxCUWidthLog2, y << pcv.maxCUHeightLog2, pcv.maxCUWidth, pcv.maxCUWidth ) ); const UnitArea ctuArea( pcv.chrFormat, Area( x << pcv.maxCUWidthLog2, y << pcv.maxCUHeightLog2, pcv.maxCUWidth, pcv.maxCUWidth ) );
CodingUnit* firstCU = cs.getCU( ctuArea.lumaPos(), CH_L);
cs.slice = firstCU->slice;
// CU-based deblocking // CU-based deblocking
for( auto &currCU : cs.traverseCUs( CS::getArea( cs, ctuArea, CH_L ), CH_L ) ) for( auto &currCU : cs.traverseCUs( CS::getArea( cs, ctuArea, CH_L ), CH_L ) )
...@@ -214,6 +216,8 @@ void LoopFilter::loopFilterPic( CodingStructure& cs ...@@ -214,6 +216,8 @@ void LoopFilter::loopFilterPic( CodingStructure& cs
m_ctuYLumaSamples = y << pcv.maxCUHeightLog2; m_ctuYLumaSamples = y << pcv.maxCUHeightLog2;
const UnitArea ctuArea( pcv.chrFormat, Area( x << pcv.maxCUWidthLog2, y << pcv.maxCUHeightLog2, pcv.maxCUWidth, pcv.maxCUWidth ) ); const UnitArea ctuArea( pcv.chrFormat, Area( x << pcv.maxCUWidthLog2, y << pcv.maxCUHeightLog2, pcv.maxCUWidth, pcv.maxCUWidth ) );
CodingUnit* firstCU = cs.getCU( ctuArea.lumaPos(), CH_L);
cs.slice = firstCU->slice;
// CU-based deblocking // CU-based deblocking
for( auto &currCU : cs.traverseCUs( CS::getArea( cs, ctuArea, CH_L ), CH_L ) ) for( auto &currCU : cs.traverseCUs( CS::getArea( cs, ctuArea, CH_L ), CH_L ) )
...@@ -1140,7 +1144,8 @@ void LoopFilter::xEdgeFilterChroma(const CodingUnit& cu, const DeblockEdgeDir ed ...@@ -1140,7 +1144,8 @@ void LoopFilter::xEdgeFilterChroma(const CodingUnit& cu, const DeblockEdgeDir ed
if (bS[0] > 0 || bS[1] > 0) if (bS[0] > 0 || bS[1] > 0)
{ {
const CodingUnit& cuQ = cu; const CodingUnit& cuQ = cu;
const CodingUnit& cuP = *cu.cs->getCU( recalcPosition( cu.chromaFormat, CHANNEL_TYPE_LUMA, cu.chType, pos.offset( xoffset - uiNumPelsLuma, yoffset - uiNumPelsLuma ) ), cu.chType ); CodingUnit& cuP1 = *cu.cs->getCU( recalcPosition( cu.chromaFormat, CHANNEL_TYPE_LUMA, cu.chType, pos.offset( xoffset - uiNumPelsLuma, yoffset - uiNumPelsLuma ) ), cu.chType );
CodingUnit& cuP = *cu.cs->getCU( recalcPosition( cu.chromaFormat, CHANNEL_TYPE_LUMA, ((!cuP1.cs->pcv->ISingleTree && cuP1.slice->isIntra()) ? CHANNEL_TYPE_CHROMA : cu.chType), pos.offset( xoffset - uiNumPelsLuma, yoffset - uiNumPelsLuma ) ), ((!cuP1.cs->pcv->ISingleTree && cuP1.slice->isIntra()) ? CHANNEL_TYPE_CHROMA : cu.chType));
if (edgeDir == EDGE_VER) if (edgeDir == EDGE_VER)
{ {
......
...@@ -430,6 +430,10 @@ void initROM() ...@@ -430,6 +430,10 @@ void initROM()
} }
} }
#endif #endif
#if JVET_O0592_ENC_ME_IMP
::memset(g_isReusedUniMVsFilled, 0, sizeof(g_isReusedUniMVsFilled));
#endif
} }
void destroyROM() void destroyROM()
...@@ -753,5 +757,9 @@ uint8_t g_triangleMvStorage[TRIANGLE_DIR_NUM][MAX_CU_DEPTH - MIN_CU_LOG2 + 1][MA ...@@ -753,5 +757,9 @@ uint8_t g_triangleMvStorage[TRIANGLE_DIR_NUM][MAX_CU_DEPTH - MIN_CU_LOG2 + 1][MA
#if JVET_O0280_SIMD_TRIANGLE_WEIGHTING #if JVET_O0280_SIMD_TRIANGLE_WEIGHTING
int16_t *g_triangleWeights[2][TRIANGLE_DIR_NUM][MAX_CU_DEPTH - MIN_CU_LOG2 + 2][MAX_CU_DEPTH - MIN_CU_LOG2 + 2]; int16_t *g_triangleWeights[2][TRIANGLE_DIR_NUM][MAX_CU_DEPTH - MIN_CU_LOG2 + 2][MAX_CU_DEPTH - MIN_CU_LOG2 + 2];
#endif #endif
#if JVET_O0592_ENC_ME_IMP
Mv g_reusedUniMVs[32][32][8][8][2][33];
bool g_isReusedUniMVsFilled[32][32][8][8];
#endif
//! \} //! \}
...@@ -226,5 +226,11 @@ extern int16_t *g_triangleWeights[2][TRIANGLE_DIR_NUM][MAX_CU_DEPTH - MIN_CU_LOG ...@@ -226,5 +226,11 @@ extern int16_t *g_triangleWeights[2][TRIANGLE_DIR_NUM][MAX_CU_DEPTH - MIN_CU_LOG
extern bool g_mctsDecCheckEnabled; extern bool g_mctsDecCheckEnabled;
#if JVET_O0592_ENC_ME_IMP
class Mv;
extern Mv g_reusedUniMVs[32][32][8][8][2][33];
extern bool g_isReusedUniMVsFilled[32][32][8][8];
#endif
#endif //__TCOMROM__ #endif //__TCOMROM__
...@@ -687,13 +687,17 @@ void SampleAdaptiveOffset::xPCMLFDisableProcess(CodingStructure& cs) ...@@ -687,13 +687,17 @@ void SampleAdaptiveOffset::xPCMLFDisableProcess(CodingStructure& cs)
void SampleAdaptiveOffset::xPCMCURestoration(CodingStructure& cs, const UnitArea &ctuArea) void SampleAdaptiveOffset::xPCMCURestoration(CodingStructure& cs, const UnitArea &ctuArea)
{ {
const SPS& sps = *cs.sps; const SPS& sps = *cs.sps;
uint32_t numComponents = CS::isDualITree(cs) ? 1 : m_numberOfComponents; uint32_t numComponents;
bool anyDualTree = false;
for( auto &cu : cs.traverseCUs( ctuArea, CH_L ) ) for( auto &cu : cs.traverseCUs( ctuArea, CH_L ) )
{ {
// restore PCM samples // restore PCM samples
if( ( cu.ipcm && sps.getPCMFilterDisableFlag() ) || CU::isLosslessCoded( cu ) ) if( ( cu.ipcm && sps.getPCMFilterDisableFlag() ) || CU::isLosslessCoded( cu ) )
{ {
cs.slice = cu.slice;
anyDualTree |= CS::isDualITree(cs);
numComponents = CS::isDualITree(cs) ? 1 : m_numberOfComponents;
for( uint32_t comp = 0; comp < numComponents; comp++ ) for( uint32_t comp = 0; comp < numComponents; comp++ )
{ {
xPCMSampleRestoration( cu, ComponentID( comp ) ); xPCMSampleRestoration( cu, ComponentID( comp ) );
...@@ -701,10 +705,15 @@ void SampleAdaptiveOffset::xPCMCURestoration(CodingStructure& cs, const UnitArea ...@@ -701,10 +705,15 @@ void SampleAdaptiveOffset::xPCMCURestoration(CodingStructure& cs, const UnitArea
} }
} }
numComponents = m_numberOfComponents; numComponents = m_numberOfComponents;
if (CS::isDualITree(cs) && numComponents) if (anyDualTree && numComponents)
{ {
for (auto &cu : cs.traverseCUs(ctuArea, CH_C)) for (auto &cu : cs.traverseCUs(ctuArea, CH_C))
{ {
if (cu.slice->isIntra() == false)
{
continue;
}
// restore PCM samples // restore PCM samples
if ((cu.ipcm && sps.getPCMFilterDisableFlag()) || CU::isLosslessCoded(cu)) if ((cu.ipcm && sps.getPCMFilterDisableFlag()) || CU::isLosslessCoded(cu))
{ {
......
...@@ -83,6 +83,9 @@ Slice::Slice() ...@@ -83,6 +83,9 @@ Slice::Slice()
, m_maxNumAffineMergeCand ( 0 ) , m_maxNumAffineMergeCand ( 0 )
, m_maxNumTriangleCand ( 0 ) , m_maxNumTriangleCand ( 0 )
, m_disFracMMVD ( false ) , m_disFracMMVD ( false )
#if JVET_O1140_SLICE_DISABLE_BDOF_DMVR_FLAG
, m_disBdofDmvrFlag ( false )
#endif
, m_uiTLayer ( 0 ) , m_uiTLayer ( 0 )
, m_bTLayerSwitchingFlag ( false ) , m_bTLayerSwitchingFlag ( false )
, m_sliceMode ( NO_SLICES ) , m_sliceMode ( NO_SLICES )
...@@ -193,6 +196,9 @@ void Slice::initSlice() ...@@ -193,6 +196,9 @@ void Slice::initSlice()
m_bFinalized=false; m_bFinalized=false;
m_disFracMMVD = false; m_disFracMMVD = false;
#if JVET_O1140_SLICE_DISABLE_BDOF_DMVR_FLAG
m_disBdofDmvrFlag = false;
#endif
m_substreamSizes.clear(); m_substreamSizes.clear();
m_cabacInitFlag = false; m_cabacInitFlag = false;
#if JVET_O0105_ICT #if JVET_O0105_ICT
...@@ -695,6 +701,9 @@ void Slice::copySliceInfo(Slice *pSrc, bool cpyAlmostAll) ...@@ -695,6 +701,9 @@ void Slice::copySliceInfo(Slice *pSrc, bool cpyAlmostAll)
m_maxNumAffineMergeCand = pSrc->m_maxNumAffineMergeCand; m_maxNumAffineMergeCand = pSrc->m_maxNumAffineMergeCand;
m_maxNumTriangleCand = pSrc->m_maxNumTriangleCand; m_maxNumTriangleCand = pSrc->m_maxNumTriangleCand;
m_disFracMMVD = pSrc->m_disFracMMVD; m_disFracMMVD = pSrc->m_disFracMMVD;
#if JVET_O1140_SLICE_DISABLE_BDOF_DMVR_FLAG
m_disBdofDmvrFlag = pSrc->m_disBdofDmvrFlag;
#endif
if( cpyAlmostAll ) m_encCABACTableIdx = pSrc->m_encCABACTableIdx; if( cpyAlmostAll ) m_encCABACTableIdx = pSrc->m_encCABACTableIdx;
m_splitConsOverrideFlag = pSrc->m_splitConsOverrideFlag; m_splitConsOverrideFlag = pSrc->m_splitConsOverrideFlag;
m_uiMinQTSize = pSrc->m_uiMinQTSize; m_uiMinQTSize = pSrc->m_uiMinQTSize;
...@@ -1401,6 +1410,9 @@ SPS::SPS() ...@@ -1401,6 +1410,9 @@ SPS::SPS()
, m_sbtmvpEnabledFlag (false) , m_sbtmvpEnabledFlag (false)
, m_bdofEnabledFlag (false) , m_bdofEnabledFlag (false)
, m_fpelMmvdEnabledFlag ( false ) , m_fpelMmvdEnabledFlag ( false )
#if JVET_O1140_SLICE_DISABLE_BDOF_DMVR_FLAG
, m_BdofDmvrSlicePresentFlag ( false )
#endif
, m_uiBitsForPOC ( 8) , m_uiBitsForPOC ( 8)
, m_numLongTermRefPicSPS ( 0) , m_numLongTermRefPicSPS ( 0)
#if MAX_TB_SIZE_SIGNALLING #if MAX_TB_SIZE_SIGNALLING
...@@ -1458,14 +1470,14 @@ SPS::~SPS() ...@@ -1458,14 +1470,14 @@ SPS::~SPS()
void SPS::createRPLList0(int numRPL) void SPS::createRPLList0(int numRPL)
{ {
m_RPLList0.destroy(); m_RPLList0.destroy();
m_RPLList0.create(numRPL); m_RPLList0.create(numRPL + 1);
m_numRPL0 = numRPL; m_numRPL0 = numRPL;
m_rpl1IdxPresentFlag = (m_numRPL0 != m_numRPL1) ? true : false; m_rpl1IdxPresentFlag = (m_numRPL0 != m_numRPL1) ? true : false;
} }
void SPS::createRPLList1(int numRPL) void SPS::createRPLList1(int numRPL)
{ {
m_RPLList1.destroy(); m_RPLList1.destroy();
m_RPLList1.create(numRPL); m_RPLList1.create(numRPL + 1);
m_numRPL1 = numRPL; m_numRPL1 = numRPL;
m_rpl1IdxPresentFlag = (m_numRPL0 != m_numRPL1) ? true : false; m_rpl1IdxPresentFlag = (m_numRPL0 != m_numRPL1) ? true : false;
......
...@@ -713,6 +713,9 @@ private: ...@@ -713,6 +713,9 @@ private:
bool m_sbtmvpEnabledFlag; bool m_sbtmvpEnabledFlag;
bool m_bdofEnabledFlag; bool m_bdofEnabledFlag;
bool m_fpelMmvdEnabledFlag; bool m_fpelMmvdEnabledFlag;
#if JVET_O1140_SLICE_DISABLE_BDOF_DMVR_FLAG
bool m_BdofDmvrSlicePresentFlag;
#endif
uint32_t m_uiBitsForPOC; uint32_t m_uiBitsForPOC;
uint32_t m_numLongTermRefPicSPS; uint32_t m_numLongTermRefPicSPS;
uint32_t m_ltRefPicPocLsbSps[MAX_NUM_LONG_TERM_REF_PICS]; uint32_t m_ltRefPicPocLsbSps[MAX_NUM_LONG_TERM_REF_PICS];
...@@ -911,6 +914,10 @@ public: ...@@ -911,6 +914,10 @@ public:
void setUseDMVR(bool b) { m_DMVR = b; } void setUseDMVR(bool b) { m_DMVR = b; }
bool getUseMMVD()const { return m_MMVD; } bool getUseMMVD()const { return m_MMVD; }
void setUseMMVD(bool b) { m_MMVD = b; } void setUseMMVD(bool b) { m_MMVD = b; }
#if JVET_O1140_SLICE_DISABLE_BDOF_DMVR_FLAG
bool getBdofDmvrSlicePresentFlag()const { return m_BdofDmvrSlicePresentFlag; }
void setBdofDmvrSlicePresentFlag(bool b) { m_BdofDmvrSlicePresentFlag = b; }
#endif
uint32_t getMaxTLayers() const { return m_uiMaxTLayers; } uint32_t getMaxTLayers() const { return m_uiMaxTLayers; }
void setMaxTLayers( uint32_t uiMaxTLayers ) { CHECK( uiMaxTLayers > MAX_TLAYER, "Invalid number T-layers" ); m_uiMaxTLayers = uiMaxTLayers; } void setMaxTLayers( uint32_t uiMaxTLayers ) { CHECK( uiMaxTLayers > MAX_TLAYER, "Invalid number T-layers" ); m_uiMaxTLayers = uiMaxTLayers; }
...@@ -1438,6 +1445,9 @@ private: ...@@ -1438,6 +1445,9 @@ private:
uint32_t m_maxNumAffineMergeCand; uint32_t m_maxNumAffineMergeCand;
uint32_t m_maxNumTriangleCand; uint32_t m_maxNumTriangleCand;
bool m_disFracMMVD; bool m_disFracMMVD;
#if JVET_O1140_SLICE_DISABLE_BDOF_DMVR_FLAG
bool m_disBdofDmvrFlag;
#endif
double m_lambdas[MAX_NUM_COMPONENT]; double m_lambdas[MAX_NUM_COMPONENT];
bool m_abEqualRef [NUM_REF_PIC_LIST_01][MAX_NUM_REF][MAX_NUM_REF]; bool m_abEqualRef [NUM_REF_PIC_LIST_01][MAX_NUM_REF][MAX_NUM_REF];
...@@ -1685,6 +1695,10 @@ public: ...@@ -1685,6 +1695,10 @@ public:
uint32_t getMaxNumTriangleCand() const { return m_maxNumTriangleCand;} uint32_t getMaxNumTriangleCand() const { return m_maxNumTriangleCand;}
void setDisFracMMVD( bool val ) { m_disFracMMVD = val; } void setDisFracMMVD( bool val ) { m_disFracMMVD = val; }
bool getDisFracMMVD() const { return m_disFracMMVD; } bool getDisFracMMVD() const { return m_disFracMMVD; }
#if JVET_O1140_SLICE_DISABLE_BDOF_DMVR_FLAG
void setDisBdofDmvrFlag(bool val) { m_disBdofDmvrFlag = val; }
bool getDisBdofDmvrFlag() const { return m_disBdofDmvrFlag; }
#endif
void setNoOutputPriorPicsFlag( bool val ) { m_noOutputPriorPicsFlag = val; } void setNoOutputPriorPicsFlag( bool val ) { m_noOutputPriorPicsFlag = val; }
bool getNoOutputPriorPicsFlag() const { return m_noOutputPriorPicsFlag; } bool getNoOutputPriorPicsFlag() const { return m_noOutputPriorPicsFlag; }
......
...@@ -50,6 +50,12 @@ ...@@ -50,6 +50,12 @@
#include <assert.h> #include <assert.h>
#include <cassert> #include <cassert>
#define JVET_O0315_RDPCM_INTRAMODE_ALIGN 1 // JVET-O0200/O0205/O0296/O0342/O0463/O0542: Intra prediction mode alignment for BDPCM
#define JVET_O0284_CONDITION_SMVD_MVDL1ZEROFLAG 1 // JVET-O0284: condition sym_mvd_flag on mvd_l1_zero_flag
#define JVET_O0438_SPS_AFFINE_AMVR_FLAG 1 // JVET-O0438: affine AMVR control flag conditioned on affine control flag in SPS
#define JVET_O0052_TU_LEVEL_CTX_CODED_BIN_CONSTRAINT 1 // JVET-O0052 Method-1: TU-level context coded bin constraint #define JVET_O0052_TU_LEVEL_CTX_CODED_BIN_CONSTRAINT 1 // JVET-O0052 Method-1: TU-level context coded bin constraint
#define JVET_O0105_ICT 1 // JVET-O0105: inter-chroma transform (ICT) as extension of joint chroma coding (JCC) #define JVET_O0105_ICT 1 // JVET-O0105: inter-chroma transform (ICT) as extension of joint chroma coding (JCC)
...@@ -110,6 +116,13 @@ ...@@ -110,6 +116,13 @@
#define JVET_O0126_BPWA_INDEX_CODING_FIX 1 // JVET-O0126 align BPWA index coding with specification #define JVET_O0126_BPWA_INDEX_CODING_FIX 1 // JVET-O0126 align BPWA index coding with specification
#define JVET_O0592_ENC_ME_IMP 1 // JVET-O0592 encoder ME improvement
#define JVET_O0108_DIS_DMVR_BDOF_CIIP 1 // JVET_O0108 CE9-2.2: disable DMVR and BDOF for CIIP
#define JVET_O1140_SLICE_DISABLE_BDOF_DMVR_FLAG 1 // JVET-O1140 slice level disable flag for BDOF and DMVR
#define FIX_DB_MAX_TRANSFORM_SIZE 1 #define FIX_DB_MAX_TRANSFORM_SIZE 1
#define MRG_SHARELIST_SHARSIZE 32 #define MRG_SHARELIST_SHARSIZE 32
......
...@@ -1597,16 +1597,23 @@ void PU::getInterMergeCandidates( const PredictionUnit &pu, MergeCtx& mrgCtx, ...@@ -1597,16 +1597,23 @@ void PU::getInterMergeCandidates( const PredictionUnit &pu, MergeCtx& mrgCtx,
} }
bool PU::checkDMVRCondition(const PredictionUnit& pu) bool PU::checkDMVRCondition(const PredictionUnit& pu)
{ {
WPScalingParam *wp0; WPScalingParam *wp0;
WPScalingParam *wp1; WPScalingParam *wp1;
int refIdx0 = pu.refIdx[REF_PIC_LIST_0]; int refIdx0 = pu.refIdx[REF_PIC_LIST_0];
int refIdx1 = pu.refIdx[REF_PIC_LIST_1]; int refIdx1 = pu.refIdx[REF_PIC_LIST_1];
pu.cs->slice->getWpScaling(REF_PIC_LIST_0, refIdx0, wp0); pu.cu->slice->getWpScaling(REF_PIC_LIST_0, refIdx0, wp0);
pu.cs->slice->getWpScaling(REF_PIC_LIST_1, refIdx1, wp1); pu.cu->slice->getWpScaling(REF_PIC_LIST_1, refIdx1, wp1);
#if JVET_O1140_SLICE_DISABLE_BDOF_DMVR_FLAG
if (pu.cs->sps->getUseDMVR() && (!pu.cs->slice->getDisBdofDmvrFlag()))
#else
if (pu.cs->sps->getUseDMVR()) if (pu.cs->sps->getUseDMVR())
#endif
{ {
return pu.mergeFlag return pu.mergeFlag
&& pu.mergeType == MRG_TYPE_DEFAULT_N && pu.mergeType == MRG_TYPE_DEFAULT_N
#if JVET_O0108_DIS_DMVR_BDOF_CIIP
&& !pu.mhIntraFlag
#endif
&& !pu.cu->affine && !pu.cu->affine
&& !pu.mmvdMergeFlag && !pu.mmvdMergeFlag
&& !pu.cu->mmvdSkip && !pu.cu->mmvdSkip
......
...@@ -1180,10 +1180,14 @@ void CABACReader::intra_luma_pred_modes( CodingUnit &cu ) ...@@ -1180,10 +1180,14 @@ void CABACReader::intra_luma_pred_modes( CodingUnit &cu )
if( cu.bdpcmMode ) if( cu.bdpcmMode )
{ {
#if JVET_O0315_RDPCM_INTRAMODE_ALIGN
cu.firstPU->intraDir[0] = cu.bdpcmMode == 2? VER_IDX : HOR_IDX;
#else
PredictionUnit *pu = cu.firstPU; PredictionUnit *pu = cu.firstPU;
unsigned mpm_pred[NUM_MOST_PROBABLE_MODES]; unsigned mpm_pred[NUM_MOST_PROBABLE_MODES];
PU::getIntraMPMs(*pu, mpm_pred); PU::getIntraMPMs(*pu, mpm_pred);
cu.firstPU->intraDir[0] = mpm_pred[0]; cu.firstPU->intraDir[0] = mpm_pred[0];
#endif
return; return;
} }
......
...@@ -1207,6 +1207,9 @@ bool DecLib::xDecodeSlice(InputNALUnit &nalu, int &iSkipFrame, int iPOCLastDispl ...@@ -1207,6 +1207,9 @@ bool DecLib::xDecodeSlice(InputNALUnit &nalu, int &iSkipFrame, int iPOCLastDispl
} }
if (pcSlice->getSPS()->getUseSMVD() && pcSlice->getCheckLDC() == false if (pcSlice->getSPS()->getUseSMVD() && pcSlice->getCheckLDC() == false
#if JVET_O0284_CONDITION_SMVD_MVDL1ZEROFLAG
&& pcSlice->getMvdL1ZeroFlag() == false
#endif
) )
{ {
int currPOC = pcSlice->getPOC(); int currPOC = pcSlice->getPOC();
......
...@@ -184,7 +184,7 @@ void DecSlice::decompressSlice( Slice* slice, InputBitstream* bitstream, int deb ...@@ -184,7 +184,7 @@ void DecSlice::decompressSlice( Slice* slice, InputBitstream* bitstream, int deb
resetGbiCodingOrder(true, cs); resetGbiCodingOrder(true, cs);
} }
if ((cs.slice->getSliceType() != I_SLICE || cs.sps->getIBCFlag()) && ctuXPosInCtus == 0) if ((cs.slice->getSliceType() != I_SLICE || cs.sps->getIBCFlag()) && ctuXPosInCtus == tileXPosInCtus)
{ {
cs.motionLut.lut.resize(0); cs.motionLut.lut.resize(0);
cs.motionLut.lutIbc.resize(0); cs.motionLut.lutIbc.resize(0);
......
...@@ -1087,7 +1087,7 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS) ...@@ -1087,7 +1087,7 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
//Read candidate for List0 //Read candidate for List0
READ_UVLC(uiCode, "num_ref_pic_lists_in_sps[0]"); READ_UVLC(uiCode, "num_ref_pic_lists_in_sps[0]");
uint32_t numberOfRPL = uiCode; uint32_t numberOfRPL = uiCode;
pcSPS->createRPLList0(numberOfRPL + 1); pcSPS->createRPLList0(numberOfRPL);
RPLList* rplList = pcSPS->getRPLList0(); RPLList* rplList = pcSPS->getRPLList0();
ReferencePictureList* rpl; ReferencePictureList* rpl;
for (uint32_t ii = 0; ii < numberOfRPL; ii++) for (uint32_t ii = 0; ii < numberOfRPL; ii++)
...@@ -1101,7 +1101,7 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS) ...@@ -1101,7 +1101,7 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
{ {
READ_UVLC(uiCode, "num_ref_pic_lists_in_sps[1]"); READ_UVLC(uiCode, "num_ref_pic_lists_in_sps[1]");
numberOfRPL = uiCode; numberOfRPL = uiCode;
pcSPS->createRPLList1(numberOfRPL + 1); pcSPS->createRPLList1(numberOfRPL);
rplList = pcSPS->getRPLList1(); rplList = pcSPS->getRPLList1();
for (uint32_t ii = 0; ii < numberOfRPL; ii++) for (uint32_t ii = 0; ii < numberOfRPL; ii++)
{ {
...@@ -1216,9 +1216,9 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS) ...@@ -1216,9 +1216,9 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
READ_FLAG( uiCode, "sps_amvr_enabled_flag" ); pcSPS->setAMVREnabledFlag ( uiCode != 0 ); READ_FLAG( uiCode, "sps_amvr_enabled_flag" ); pcSPS->setAMVREnabledFlag ( uiCode != 0 );
READ_FLAG( uiCode, "sps_bdof_enabled_flag" ); pcSPS->setBDOFEnabledFlag ( uiCode != 0 ); READ_FLAG( uiCode, "sps_bdof_enabled_flag" ); pcSPS->setBDOFEnabledFlag ( uiCode != 0 );
#if !JVET_O0438_SPS_AFFINE_AMVR_FLAG
READ_FLAG( uiCode, "sps_affine_amvr_enabled_flag" ); pcSPS->setAffineAmvrEnabledFlag ( uiCode != 0 ); READ_FLAG( uiCode, "sps_affine_amvr_enabled_flag" ); pcSPS->setAffineAmvrEnabledFlag ( uiCode != 0 );
#endif
READ_FLAG(uiCode, "sps_dmvr_enable_flag"); pcSPS->setUseDMVR(uiCode != 0); READ_FLAG(uiCode, "sps_dmvr_enable_flag"); pcSPS->setUseDMVR(uiCode != 0);
READ_FLAG(uiCode, "sps_mmvd_enable_flag"); pcSPS->setUseMMVD(uiCode != 0); READ_FLAG(uiCode, "sps_mmvd_enable_flag"); pcSPS->setUseMMVD(uiCode != 0);
// KJS: sps_cclm_enabled_flag // KJS: sps_cclm_enabled_flag
...@@ -1241,6 +1241,9 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS) ...@@ -1241,6 +1241,9 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
if ( pcSPS->getUseAffine() ) if ( pcSPS->getUseAffine() )
{ {
READ_FLAG( uiCode, "affine_type_flag" ); pcSPS->setUseAffineType ( uiCode != 0 ); READ_FLAG( uiCode, "affine_type_flag" ); pcSPS->setUseAffineType ( uiCode != 0 );
#if JVET_O0438_SPS_AFFINE_AMVR_FLAG
READ_FLAG( uiCode, "sps_affine_amvr_enabled_flag" ); pcSPS->setAffineAmvrEnabledFlag ( uiCode != 0 );
#endif
} }
READ_FLAG( uiCode, "gbi_flag" ); pcSPS->setUseGBi ( uiCode != 0 ); READ_FLAG( uiCode, "gbi_flag" ); pcSPS->setUseGBi ( uiCode != 0 );
READ_FLAG(uiCode, "ibc_flag"); pcSPS->setIBCFlag(uiCode); READ_FLAG(uiCode, "ibc_flag"); pcSPS->setIBCFlag(uiCode);
...@@ -1251,7 +1254,12 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS) ...@@ -1251,7 +1254,12 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
{ {
READ_FLAG( uiCode, "sps_fpel_mmvd_enabled_flag" ); pcSPS->setFpelMmvdEnabledFlag ( uiCode != 0 ); READ_FLAG( uiCode, "sps_fpel_mmvd_enabled_flag" ); pcSPS->setFpelMmvdEnabledFlag ( uiCode != 0 );
} }
#if JVET_O1140_SLICE_DISABLE_BDOF_DMVR_FLAG
if (pcSPS->getBDOFEnabledFlag() || pcSPS->getUseDMVR())
{
READ_FLAG(uiCode, "sps_bdof_dmvr_slice_level_present_flag"); pcSPS->setBdofDmvrSlicePresentFlag(uiCode != 0);
}
#endif
READ_FLAG( uiCode, "triangle_flag" ); pcSPS->setUseTriangle ( uiCode != 0 ); READ_FLAG( uiCode, "triangle_flag" ); pcSPS->setUseTriangle ( uiCode != 0 );
READ_FLAG( uiCode, "sps_mip_flag"); pcSPS->setUseMIP ( uiCode != 0 ); READ_FLAG( uiCode, "sps_mip_flag"); pcSPS->setUseMIP ( uiCode != 0 );
...@@ -1982,6 +1990,13 @@ void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, ParameterSetManager *para ...@@ -1982,6 +1990,13 @@ void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, ParameterSetManager *para
READ_FLAG( uiCode, "tile_group_fracmmvd_disabled_flag" ); READ_FLAG( uiCode, "tile_group_fracmmvd_disabled_flag" );
pcSlice->setDisFracMMVD( uiCode ? true : false ); pcSlice->setDisFracMMVD( uiCode ? true : false );
} }
#if JVET_O1140_SLICE_DISABLE_BDOF_DMVR_FLAG
if (sps->getBdofDmvrSlicePresentFlag())
{
READ_FLAG(uiCode, "tile_group_bdof_dmvr_disabled_flag");
pcSlice->setDisBdofDmvrFlag(uiCode ? true : false);
}
#endif
if (sps->getUseTriangle() && pcSlice->getMaxNumMergeCand() >= 2) if (sps->getUseTriangle() && pcSlice->getMaxNumMergeCand() >= 2)
{ {
READ_UVLC(uiCode, "max_num_merge_cand_minus_max_num_triangle_cand"); READ_UVLC(uiCode, "max_num_merge_cand_minus_max_num_triangle_cand");
......
...@@ -969,10 +969,14 @@ void CABACWriter::intra_luma_pred_modes( const CodingUnit& cu ) ...@@ -969,10 +969,14 @@ void CABACWriter::intra_luma_pred_modes( const CodingUnit& cu )
if( cu.bdpcmMode ) if( cu.bdpcmMode )
{ {
#if JVET_O0315_RDPCM_INTRAMODE_ALIGN
cu.firstPU->intraDir[0] = cu.bdpcmMode == 2? VER_IDX : HOR_IDX;
#else
PredictionUnit *pu = cu.firstPU; PredictionUnit *pu = cu.firstPU;
unsigned mpm_pred[NUM_MOST_PROBABLE_MODES]; unsigned mpm_pred[NUM_MOST_PROBABLE_MODES];
PU::getIntraMPMs( *pu, mpm_pred ); PU::getIntraMPMs( *pu, mpm_pred );
cu.firstPU->intraDir[0] = mpm_pred[0]; cu.firstPU->intraDir[0] = mpm_pred[0];
#endif
return; return;
} }
......
...@@ -130,6 +130,9 @@ void EncCu::create( EncCfg* encCfg ) ...@@ -130,6 +130,9 @@ void EncCu::create( EncCfg* encCfg )
for (unsigned ui = 0; ui < MRG_MAX_NUM_CANDS; ui++) for (unsigned ui = 0; ui < MRG_MAX_NUM_CANDS; ui++)
{ {
m_acRealMergeBuffer[ui].create(chromaFormat, Area(0, 0, uiMaxWidth, uiMaxHeight)); m_acRealMergeBuffer[ui].create(chromaFormat, Area(0, 0, uiMaxWidth, uiMaxHeight));
#if JVET_O0108_DIS_DMVR_BDOF_CIIP
m_acMergeTmpBuffer[ui].create(chromaFormat, Area(0, 0, uiMaxWidth, uiMaxHeight));
#endif
} }
const unsigned maxNumTriangleCand = encCfg->getMaxNumTriangleCand(); const unsigned maxNumTriangleCand = encCfg->getMaxNumTriangleCand();
for (unsigned i = 0; i < maxNumTriangleCand; i++) for (unsigned i = 0; i < maxNumTriangleCand; i++)
...@@ -218,6 +221,9 @@ void EncCu::destroy() ...@@ -218,6 +221,9 @@ void EncCu::destroy()
for (unsigned ui = 0; ui < MRG_MAX_NUM_CANDS; ui++) for (unsigned ui = 0; ui < MRG_MAX_NUM_CANDS; ui++)
{ {
m_acRealMergeBuffer[ui].destroy(); m_acRealMergeBuffer[ui].destroy();
#if JVET_O0108_DIS_DMVR_BDOF_CIIP
m_acMergeTmpBuffer[ui].destroy();
#endif
} }
for( unsigned ui = 0; ui < TRIANGLE_MAX_NUM_CANDS; ui++ ) for( unsigned ui = 0; ui < TRIANGLE_MAX_NUM_CANDS; ui++ )
{ {
...@@ -266,6 +272,9 @@ void EncCu::init( EncLib* pcEncLib, const SPS& sps PARL_PARAM( const int tId ) ) ...@@ -266,6 +272,9 @@ void EncCu::init( EncLib* pcEncLib, const SPS& sps PARL_PARAM( const int tId ) )
m_modeCtrl->init( m_pcEncCfg, m_pcRateCtrl, m_pcRdCost ); m_modeCtrl->init( m_pcEncCfg, m_pcRateCtrl, m_pcRdCost );
m_pcInterSearch->setModeCtrl( m_modeCtrl ); m_pcInterSearch->setModeCtrl( m_modeCtrl );
#if JVET_O0592_ENC_ME_IMP
m_modeCtrl->setInterSearch(m_pcInterSearch);
#endif
m_pcIntraSearch->setModeCtrl( m_modeCtrl ); m_pcIntraSearch->setModeCtrl( m_modeCtrl );
if ( ( m_pcEncCfg->getIBCHashSearch() && m_pcEncCfg->getIBCMode() ) || m_pcEncCfg->getAllowDisFracMMVD() ) if ( ( m_pcEncCfg->getIBCHashSearch() && m_pcEncCfg->getIBCMode() ) || m_pcEncCfg->getAllowDisFracMMVD() )
...@@ -1188,6 +1197,14 @@ void EncCu::xCheckModeSplit(CodingStructure *&tempCS, CodingStructure *&bestCS, ...@@ -1188,6 +1197,14 @@ void EncCu::xCheckModeSplit(CodingStructure *&tempCS, CodingStructure *&bestCS,
AffineMVInfo tmpMVInfo; AffineMVInfo tmpMVInfo;
bool isAffMVInfoSaved; bool isAffMVInfoSaved;
m_pcInterSearch->savePrevAffMVInfo(0, tmpMVInfo, isAffMVInfoSaved); m_pcInterSearch->savePrevAffMVInfo(0, tmpMVInfo, isAffMVInfoSaved);
#if JVET_O0592_ENC_ME_IMP
BlkUniMvInfo tmpUniMvInfo;
bool isUniMvInfoSaved = false;
if (!tempCS->slice->isIntra())
{
m_pcInterSearch->savePrevUniMvInfo(tempCS->area.Y(), tmpUniMvInfo, isUniMvInfoSaved);
}
#endif
do do
{ {
...@@ -1319,6 +1336,12 @@ void EncCu::xCheckModeSplit(CodingStructure *&tempCS, CodingStructure *&bestCS, ...@@ -1319,6 +1336,12 @@ void EncCu::xCheckModeSplit(CodingStructure *&tempCS, CodingStructure *&bestCS,
if (isAffMVInfoSaved) if (isAffMVInfoSaved)
m_pcInterSearch->addAffMVInfo(tmpMVInfo); m_pcInterSearch->addAffMVInfo(tmpMVInfo);
#if JVET_O0592_ENC_ME_IMP
if (!tempCS->slice->isIntra() && isUniMvInfoSaved)
{
m_pcInterSearch->addUniMvInfo(tmpUniMvInfo);
}
#endif
tempCS->motionLut = oldMotionLut; tempCS->motionLut = oldMotionLut;
...@@ -1864,6 +1887,9 @@ void EncCu::xCheckRDCostMerge2Nx2N( CodingStructure *&tempCS, CodingStructure *& ...@@ -1864,6 +1887,9 @@ void EncCu::xCheckRDCostMerge2Nx2N( CodingStructure *&tempCS, CodingStructure *&
bool bestIsSkip = false; bool bestIsSkip = false;
bool bestIsMMVDSkip = true; bool bestIsMMVDSkip = true;
PelUnitBuf acMergeBuffer[MRG_MAX_NUM_CANDS]; PelUnitBuf acMergeBuffer[MRG_MAX_NUM_CANDS];
#if JVET_O0108_DIS_DMVR_BDOF_CIIP
PelUnitBuf acMergeTmpBuffer[MRG_MAX_NUM_CANDS];
#endif
PelUnitBuf acMergeRealBuffer[MMVD_MRG_MAX_RD_BUF_NUM]; PelUnitBuf acMergeRealBuffer[MMVD_MRG_MAX_RD_BUF_NUM];
PelUnitBuf * acMergeTempBuffer[MMVD_MRG_MAX_RD_NUM]; PelUnitBuf * acMergeTempBuffer[MMVD_MRG_MAX_RD_NUM];
PelUnitBuf * singleMergeTempBuffer; PelUnitBuf * singleMergeTempBuffer;
...@@ -1985,7 +2011,12 @@ void EncCu::xCheckRDCostMerge2Nx2N( CodingStructure *&tempCS, CodingStructure *& ...@@ -1985,7 +2011,12 @@ void EncCu::xCheckRDCostMerge2Nx2N( CodingStructure *&tempCS, CodingStructure *&
PU::spanMotionInfo( pu, mergeCtx ); PU::spanMotionInfo( pu, mergeCtx );
pu.mvRefine = true; pu.mvRefine = true;
distParam.cur = singleMergeTempBuffer->Y(); distParam.cur = singleMergeTempBuffer->Y();
#if JVET_O0108_DIS_DMVR_BDOF_CIIP
acMergeTmpBuffer[uiMergeCand] = m_acMergeTmpBuffer[uiMergeCand].getBuf(localUnitArea);
m_pcInterSearch->motionCompensation(pu, *singleMergeTempBuffer, REF_PIC_LIST_X, true, true, &(acMergeTmpBuffer[uiMergeCand]));
#else
m_pcInterSearch->motionCompensation(pu, *singleMergeTempBuffer); m_pcInterSearch->motionCompensation(pu, *singleMergeTempBuffer);
#endif
acMergeBuffer[uiMergeCand] = m_acRealMergeBuffer[uiMergeCand].getBuf(localUnitArea); acMergeBuffer[uiMergeCand] = m_acRealMergeBuffer[uiMergeCand].getBuf(localUnitArea);
acMergeBuffer[uiMergeCand].copyFrom(*singleMergeTempBuffer); acMergeBuffer[uiMergeCand].copyFrom(*singleMergeTempBuffer);
pu.mvRefine = false; pu.mvRefine = false;
...@@ -2049,7 +2080,11 @@ void EncCu::xCheckRDCostMerge2Nx2N( CodingStructure *&tempCS, CodingStructure *& ...@@ -2049,7 +2080,11 @@ void EncCu::xCheckRDCostMerge2Nx2N( CodingStructure *&tempCS, CodingStructure *&
for (uint32_t mergeCnt = 0; mergeCnt < std::min(std::min(NUM_MRG_SATD_CAND, (const int)mergeCtx.numValidMergeCand), 4); mergeCnt++) for (uint32_t mergeCnt = 0; mergeCnt < std::min(std::min(NUM_MRG_SATD_CAND, (const int)mergeCtx.numValidMergeCand), 4); mergeCnt++)
{ {
uint32_t mergeCand = MHIntraMergeCand[mergeCnt]; uint32_t mergeCand = MHIntraMergeCand[mergeCnt];
#if JVET_O0108_DIS_DMVR_BDOF_CIIP
acMergeTmpBuffer[mergeCand] = m_acMergeTmpBuffer[mergeCand].getBuf(localUnitArea);
#else
acMergeBuffer[mergeCand] = m_acRealMergeBuffer[mergeCand].getBuf(localUnitArea); acMergeBuffer[mergeCand] = m_acRealMergeBuffer[mergeCand].getBuf(localUnitArea);
#endif
// estimate merge bits // estimate merge bits
mergeCtx.setMergeInfo(pu, mergeCand); mergeCtx.setMergeInfo(pu, mergeCand);
...@@ -2064,7 +2099,11 @@ void EncCu::xCheckRDCostMerge2Nx2N( CodingStructure *&tempCS, CodingStructure *& ...@@ -2064,7 +2099,11 @@ void EncCu::xCheckRDCostMerge2Nx2N( CodingStructure *&tempCS, CodingStructure *&
m_pcIntraSearch->predIntraAng(COMPONENT_Y, pu.cs->getPredBuf(pu).Y(), pu); m_pcIntraSearch->predIntraAng(COMPONENT_Y, pu.cs->getPredBuf(pu).Y(), pu);
m_pcIntraSearch->switchBuffer(pu, COMPONENT_Y, pu.cs->getPredBuf(pu).Y(), m_pcIntraSearch->getPredictorPtr2(COMPONENT_Y, intraCnt)); m_pcIntraSearch->switchBuffer(pu, COMPONENT_Y, pu.cs->getPredBuf(pu).Y(), m_pcIntraSearch->getPredictorPtr2(COMPONENT_Y, intraCnt));
} }
#if JVET_O0108_DIS_DMVR_BDOF_CIIP
pu.cs->getPredBuf(pu).copyFrom(acMergeTmpBuffer[mergeCand]);
#else
pu.cs->getPredBuf(pu).copyFrom(acMergeBuffer[mergeCand]); pu.cs->getPredBuf(pu).copyFrom(acMergeBuffer[mergeCand]);
#endif
if (pu.cs->slice->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag()) if (pu.cs->slice->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag())
{ {
pu.cs->getPredBuf(pu).Y().rspSignal(m_pcReshape->getFwdLUT()); pu.cs->getPredBuf(pu).Y().rspSignal(m_pcReshape->getFwdLUT());
...@@ -2287,17 +2326,29 @@ void EncCu::xCheckRDCostMerge2Nx2N( CodingStructure *&tempCS, CodingStructure *& ...@@ -2287,17 +2326,29 @@ void EncCu::xCheckRDCostMerge2Nx2N( CodingStructure *&tempCS, CodingStructure *&
{ {
uint32_t bufIdx = 0; uint32_t bufIdx = 0;
PelBuf tmpBuf = tempCS->getPredBuf(pu).Y(); PelBuf tmpBuf = tempCS->getPredBuf(pu).Y();
#if JVET_O0108_DIS_DMVR_BDOF_CIIP
tmpBuf.copyFrom(acMergeTmpBuffer[uiMergeCand].Y());
#else
tmpBuf.copyFrom(acMergeBuffer[uiMergeCand].Y()); tmpBuf.copyFrom(acMergeBuffer[uiMergeCand].Y());
#endif
if (pu.cs->slice->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag()) if (pu.cs->slice->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag())
{ {
tmpBuf.rspSignal(m_pcReshape->getFwdLUT()); tmpBuf.rspSignal(m_pcReshape->getFwdLUT());
} }
m_pcIntraSearch->geneWeightedPred(COMPONENT_Y, tmpBuf, pu, m_pcIntraSearch->getPredictorPtr2(COMPONENT_Y, bufIdx)); m_pcIntraSearch->geneWeightedPred(COMPONENT_Y, tmpBuf, pu, m_pcIntraSearch->getPredictorPtr2(COMPONENT_Y, bufIdx));
tmpBuf = tempCS->getPredBuf(pu).Cb(); tmpBuf = tempCS->getPredBuf(pu).Cb();
#if JVET_O0108_DIS_DMVR_BDOF_CIIP
tmpBuf.copyFrom(acMergeTmpBuffer[uiMergeCand].Cb());
#else
tmpBuf.copyFrom(acMergeBuffer[uiMergeCand].Cb()); tmpBuf.copyFrom(acMergeBuffer[uiMergeCand].Cb());
#endif
m_pcIntraSearch->geneWeightedPred(COMPONENT_Cb, tmpBuf, pu, m_pcIntraSearch->getPredictorPtr2(COMPONENT_Cb, bufIdx)); m_pcIntraSearch->geneWeightedPred(COMPONENT_Cb, tmpBuf, pu, m_pcIntraSearch->getPredictorPtr2(COMPONENT_Cb, bufIdx));
tmpBuf = tempCS->getPredBuf(pu).Cr(); tmpBuf = tempCS->getPredBuf(pu).Cr();
#if JVET_O0108_DIS_DMVR_BDOF_CIIP
tmpBuf.copyFrom(acMergeTmpBuffer[uiMergeCand].Cr());
#else
tmpBuf.copyFrom(acMergeBuffer[uiMergeCand].Cr()); tmpBuf.copyFrom(acMergeBuffer[uiMergeCand].Cr());
#endif
m_pcIntraSearch->geneWeightedPred(COMPONENT_Cr, tmpBuf, pu, m_pcIntraSearch->getPredictorPtr2(COMPONENT_Cr, bufIdx)); m_pcIntraSearch->geneWeightedPred(COMPONENT_Cr, tmpBuf, pu, m_pcIntraSearch->getPredictorPtr2(COMPONENT_Cr, bufIdx));
} }
else else
......
...@@ -123,6 +123,9 @@ private: ...@@ -123,6 +123,9 @@ private:
PelStorage m_acMergeBuffer[MMVD_MRG_MAX_RD_BUF_NUM]; PelStorage m_acMergeBuffer[MMVD_MRG_MAX_RD_BUF_NUM];
PelStorage m_acRealMergeBuffer[MRG_MAX_NUM_CANDS]; PelStorage m_acRealMergeBuffer[MRG_MAX_NUM_CANDS];
#if JVET_O0108_DIS_DMVR_BDOF_CIIP
PelStorage m_acMergeTmpBuffer[MRG_MAX_NUM_CANDS];
#endif
PelStorage m_acTriangleWeightedBuffer[TRIANGLE_MAX_NUM_CANDS]; // to store weighted prediction pixles PelStorage m_acTriangleWeightedBuffer[TRIANGLE_MAX_NUM_CANDS]; // to store weighted prediction pixles
double m_mergeBestSATDCost; double m_mergeBestSATDCost;
MotionInfo m_SubPuMiBuf [( MAX_CU_SIZE * MAX_CU_SIZE ) >> ( MIN_CU_LOG2 << 1 )]; MotionInfo m_SubPuMiBuf [( MAX_CU_SIZE * MAX_CU_SIZE ) >> ( MIN_CU_LOG2 << 1 )];
......
...@@ -1804,6 +1804,9 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic, ...@@ -1804,6 +1804,9 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic,
} }
if ( pcSlice->getSPS()->getUseSMVD() && pcSlice->getCheckLDC() == false if ( pcSlice->getSPS()->getUseSMVD() && pcSlice->getCheckLDC() == false
#if JVET_O0284_CONDITION_SMVD_MVDL1ZEROFLAG
&& pcSlice->getMvdL1ZeroFlag() == false
#endif
) )
{ {
int currPOC = pcSlice->getPOC(); int currPOC = pcSlice->getPOC();
......
...@@ -931,6 +931,9 @@ void EncLib::xInitSPS(SPS &sps) ...@@ -931,6 +931,9 @@ void EncLib::xInitSPS(SPS &sps)
sps.setUseTriangle ( m_Triangle ); sps.setUseTriangle ( m_Triangle );
sps.setUseMMVD ( m_MMVD ); sps.setUseMMVD ( m_MMVD );
sps.setFpelMmvdEnabledFlag (( m_MMVD ) ? m_allowDisFracMMVD : false); sps.setFpelMmvdEnabledFlag (( m_MMVD ) ? m_allowDisFracMMVD : false);
#if JVET_O1140_SLICE_DISABLE_BDOF_DMVR_FLAG
sps.setBdofDmvrSlicePresentFlag(m_DMVR || m_BIO);
#endif
sps.setAffineAmvrEnabledFlag ( m_AffineAmvr ); sps.setAffineAmvrEnabledFlag ( m_AffineAmvr );
sps.setUseDMVR ( m_DMVR ); sps.setUseDMVR ( m_DMVR );
...@@ -1291,8 +1294,8 @@ void EncLib::xInitRPL(SPS &sps, bool isFieldCoding) ...@@ -1291,8 +1294,8 @@ void EncLib::xInitRPL(SPS &sps, bool isFieldCoding)
ReferencePictureList* rpl; ReferencePictureList* rpl;
int numRPLCandidates = getRPLCandidateSize(0); int numRPLCandidates = getRPLCandidateSize(0);
sps.createRPLList0(numRPLCandidates + 1); sps.createRPLList0(numRPLCandidates);
sps.createRPLList1(numRPLCandidates + 1); sps.createRPLList1(numRPLCandidates);
RPLList* rplList = 0; RPLList* rplList = 0;
for (int i = 0; i < 2; i++) for (int i = 0; i < 2; i++)
...@@ -1317,7 +1320,7 @@ void EncLib::xInitRPL(SPS &sps, bool isFieldCoding) ...@@ -1317,7 +1320,7 @@ void EncLib::xInitRPL(SPS &sps, bool isFieldCoding)
//Check RPLL0 first //Check RPLL0 first
const RPLList* rplList0 = sps.getRPLList0(); const RPLList* rplList0 = sps.getRPLList0();
const RPLList* rplList1 = sps.getRPLList1(); const RPLList* rplList1 = sps.getRPLList1();
uint32_t numberOfRPL = sps.getNumRPL0() - 1; uint32_t numberOfRPL = sps.getNumRPL0();
bool isAllEntriesinRPLHasSameSignFlag = true; bool isAllEntriesinRPLHasSameSignFlag = true;
bool isFirstEntry = true; bool isFirstEntry = true;
...@@ -1339,7 +1342,7 @@ void EncLib::xInitRPL(SPS &sps, bool isFieldCoding) ...@@ -1339,7 +1342,7 @@ void EncLib::xInitRPL(SPS &sps, bool isFieldCoding)
} }
} }
//Check RPLL1. Skip it if it is already found out that this flag is not true for RPL0 or if RPL1 is the same as RPL0 //Check RPLL1. Skip it if it is already found out that this flag is not true for RPL0 or if RPL1 is the same as RPL0
numberOfRPL = sps.getNumRPL1() - 1; numberOfRPL = sps.getNumRPL1();
isFirstEntry = true; isFirstEntry = true;
lastSign = true; lastSign = true;
for (uint32_t ii = 0; isAllEntriesinRPLHasSameSignFlag && !sps.getRPL1CopyFromRPL0Flag() && ii < numberOfRPL; ii++) for (uint32_t ii = 0; isAllEntriesinRPLHasSameSignFlag && !sps.getRPL1CopyFromRPL0Flag() && ii < numberOfRPL; ii++)
......
...@@ -1795,6 +1795,18 @@ bool EncModeCtrlMTnoRQT::tryMode( const EncTestMode& encTestmode, const CodingSt ...@@ -1795,6 +1795,18 @@ bool EncModeCtrlMTnoRQT::tryMode( const EncTestMode& encTestmode, const CodingSt
{ {
CHECK( encTestmode.type != ETM_POST_DONT_SPLIT, "Unknown mode" ); CHECK( encTestmode.type != ETM_POST_DONT_SPLIT, "Unknown mode" );
#if JVET_O0592_ENC_ME_IMP
if ((cuECtx.get<double>(BEST_NO_IMV_COST) == (MAX_DOUBLE * .5) || cuECtx.get<bool>(IS_REUSING_CU)) && !slice.isIntra())
{
unsigned idx1, idx2, idx3, idx4;
getAreaIdx(partitioner.currArea().Y(), *slice.getPPS()->pcv, idx1, idx2, idx3, idx4);
if (g_isReusedUniMVsFilled[idx1][idx2][idx3][idx4])
{
m_pcInterSearch->insertUniMvCands(partitioner.currArea().Y(), g_reusedUniMVs[idx1][idx2][idx3][idx4]);
}
}
#endif
if( !bestCS || ( bestCS && isModeSplit( bestMode ) ) ) if( !bestCS || ( bestCS && isModeSplit( bestMode ) ) )
{ {
return false; return false;
......
...@@ -43,6 +43,9 @@ ...@@ -43,6 +43,9 @@
#include "CommonLib/CommonDef.h" #include "CommonLib/CommonDef.h"
#include "CommonLib/CodingStructure.h" #include "CommonLib/CodingStructure.h"
#if JVET_O0592_ENC_ME_IMP
#include "InterSearch.h"
#endif
#include <typeinfo> #include <typeinfo>
#include <vector> #include <vector>
...@@ -258,6 +261,9 @@ protected: ...@@ -258,6 +261,9 @@ protected:
#if ENABLE_SPLIT_PARALLELISM #if ENABLE_SPLIT_PARALLELISM
int m_runNextInParallel; int m_runNextInParallel;
#endif #endif
#if JVET_O0592_ENC_ME_IMP
InterSearch* m_pcInterSearch;
#endif
public: public:
...@@ -315,6 +321,9 @@ public: ...@@ -315,6 +321,9 @@ public:
void setBestCostWithoutSplitFlags ( double cost ) { m_ComprCUCtxList.back().bestCostWithoutSplitFlags = cost; } void setBestCostWithoutSplitFlags ( double cost ) { m_ComprCUCtxList.back().bestCostWithoutSplitFlags = cost; }
double getMtsFirstPassNoIspCost () const { return m_ComprCUCtxList.back().bestCostMtsFirstPassNoIsp; } double getMtsFirstPassNoIspCost () const { return m_ComprCUCtxList.back().bestCostMtsFirstPassNoIsp; }
void setMtsFirstPassNoIspCost ( double cost ) { m_ComprCUCtxList.back().bestCostMtsFirstPassNoIsp = cost; } void setMtsFirstPassNoIspCost ( double cost ) { m_ComprCUCtxList.back().bestCostMtsFirstPassNoIsp = cost; }
#if JVET_O0592_ENC_ME_IMP
void setInterSearch (InterSearch* pcInterSearch) { m_pcInterSearch = pcInterSearch; }
#endif
protected: protected:
void xExtractFeatures ( const EncTestMode encTestmode, CodingStructure& cs ); void xExtractFeatures ( const EncTestMode encTestmode, CodingStructure& cs );
......
...@@ -1415,6 +1415,9 @@ void EncSlice::compressSlice( Picture* pcPic, const bool bCompressEntireSlice, c ...@@ -1415,6 +1415,9 @@ void EncSlice::compressSlice( Picture* pcPic, const bool bCompressEntireSlice, c
writeBlockStatisticsHeader(sps); writeBlockStatisticsHeader(sps);
#endif #endif
m_pcInterSearch->resetAffineMVList(); m_pcInterSearch->resetAffineMVList();
#if JVET_O0592_ENC_ME_IMP
m_pcInterSearch->resetUniMvList();
#endif
encodeCtus( pcPic, bCompressEntireSlice, bFastDeltaQP, startCtuTsAddr, boundingCtuTsAddr, m_pcLib ); encodeCtus( pcPic, bCompressEntireSlice, bFastDeltaQP, startCtuTsAddr, boundingCtuTsAddr, m_pcLib );
...@@ -1578,7 +1581,7 @@ void EncSlice::encodeCtus( Picture* pcPic, const bool bCompressEntireSlice, cons ...@@ -1578,7 +1581,7 @@ void EncSlice::encodeCtus( Picture* pcPic, const bool bCompressEntireSlice, cons
DTRACE_UPDATE( g_trace_ctx, std::make_pair( "ctu", ctuRsAddr ) ); DTRACE_UPDATE( g_trace_ctx, std::make_pair( "ctu", ctuRsAddr ) );
if( pCfg->getSwitchPOC() != pcPic->poc || -1 == pCfg->getDebugCTU() ) if( pCfg->getSwitchPOC() != pcPic->poc || -1 == pCfg->getDebugCTU() )
if ((cs.slice->getSliceType() != I_SLICE || cs.sps->getIBCFlag()) && ctuXPosInCtus == 0) if ((cs.slice->getSliceType() != I_SLICE || cs.sps->getIBCFlag()) && ctuXPosInCtus == tileXPosInCtus)
{ {
cs.motionLut.lut.resize(0); cs.motionLut.lut.resize(0);
cs.motionLut.lutIbc.resize(0); cs.motionLut.lutIbc.resize(0);
......
This diff is collapsed.
...@@ -78,6 +78,14 @@ struct AffineMVInfo ...@@ -78,6 +78,14 @@ struct AffineMVInfo
int x, y, w, h; int x, y, w, h;
}; };
#if JVET_O0592_ENC_ME_IMP
struct BlkUniMvInfo
{
Mv uniMvs[2][33];
int x, y, w, h;
};
#endif
typedef struct typedef struct
{ {
Mv acMvAffine4Para[2][3]; Mv acMvAffine4Para[2][3];
...@@ -116,6 +124,12 @@ private: ...@@ -116,6 +124,12 @@ private:
int m_affMVListIdx; int m_affMVListIdx;
int m_affMVListSize; int m_affMVListSize;
int m_affMVListMaxSize; int m_affMVListMaxSize;
#if JVET_O0592_ENC_ME_IMP
BlkUniMvInfo* m_uniMvList;
int m_uniMvListIdx;
int m_uniMvListSize;
int m_uniMvListMaxSize;
#endif
Distortion m_hevcCost; Distortion m_hevcCost;
EncAffineMotion m_affineMotion; EncAffineMotion m_affineMotion;
PatentBvCand m_defaultCachedBvs; PatentBvCand m_defaultCachedBvs;
...@@ -232,6 +246,80 @@ public: ...@@ -232,6 +246,80 @@ public:
m_affMVListSize = std::min(m_affMVListSize + 1, m_affMVListMaxSize); m_affMVListSize = std::min(m_affMVListSize + 1, m_affMVListMaxSize);
} }
} }
#if JVET_O0592_ENC_ME_IMP
void resetUniMvList() { m_uniMvListIdx = 0; m_uniMvListSize = 0; }
void insertUniMvCands(CompArea blkArea, Mv cMvTemp[2][33])
{
BlkUniMvInfo* curMvInfo = m_uniMvList + m_uniMvListIdx;
int j = 0;
for (; j < m_uniMvListSize; j++)
{
BlkUniMvInfo* prevMvInfo = m_uniMvList + ((m_uniMvListIdx - 1 - j + m_uniMvListMaxSize) % (m_uniMvListMaxSize));
if ((blkArea.x == prevMvInfo->x) && (blkArea.y == prevMvInfo->y) && (blkArea.width == prevMvInfo->w) && (blkArea.height == prevMvInfo->h))
{
break;
}
}
if (j < m_uniMvListSize)
{
curMvInfo = m_uniMvList + ((m_uniMvListIdx - 1 - j + m_uniMvListMaxSize) % (m_uniMvListMaxSize));
}
::memcpy(curMvInfo->uniMvs, cMvTemp, 2 * 33 * sizeof(Mv));
if (j == m_uniMvListSize) // new element
{
curMvInfo->x = blkArea.x;
curMvInfo->y = blkArea.y;
curMvInfo->w = blkArea.width;
curMvInfo->h = blkArea.height;
m_uniMvListSize = std::min(m_uniMvListSize + 1, m_uniMvListMaxSize);
m_uniMvListIdx = (m_uniMvListIdx + 1) % (m_uniMvListMaxSize);
}
}
void savePrevUniMvInfo(CompArea blkArea, BlkUniMvInfo &tmpUniMvInfo, bool& isUniMvInfoSaved)
{
int j = 0;
BlkUniMvInfo* curUniMvInfo = nullptr;
for (; j < m_uniMvListSize; j++)
{
curUniMvInfo = m_uniMvList + ((m_uniMvListIdx - 1 - j + m_uniMvListMaxSize) % (m_uniMvListMaxSize));
if ((blkArea.x == curUniMvInfo->x) && (blkArea.y == curUniMvInfo->y) && (blkArea.width == curUniMvInfo->w) && (blkArea.height == curUniMvInfo->h))
{
break;
}
}
if (j < m_uniMvListSize)
{
isUniMvInfoSaved = true;
tmpUniMvInfo = *curUniMvInfo;
}
}
void addUniMvInfo(BlkUniMvInfo &tmpUniMVInfo)
{
int j = 0;
BlkUniMvInfo* prevUniMvInfo = nullptr;
for (; j < m_uniMvListSize; j++)
{
prevUniMvInfo = m_uniMvList + ((m_uniMvListIdx - 1 - j + m_uniMvListMaxSize) % (m_uniMvListMaxSize));
if ((tmpUniMVInfo.x == prevUniMvInfo->x) && (tmpUniMVInfo.y == prevUniMvInfo->y) && (tmpUniMVInfo.w == prevUniMvInfo->w) && (tmpUniMVInfo.h == prevUniMvInfo->h))
{
break;
}
}
if (j < m_uniMvListSize)
{
*prevUniMvInfo = tmpUniMVInfo;
}
else
{
m_uniMvList[m_uniMvListIdx] = tmpUniMVInfo;
m_uniMvListIdx = (m_uniMvListIdx + 1) % m_uniMvListMaxSize;
m_uniMvListSize = std::min(m_uniMvListSize + 1, m_uniMvListMaxSize);
}
}
#endif
void resetSavedAffineMotion(); void resetSavedAffineMotion();
void storeAffineMotion( Mv acAffineMv[2][3], int16_t affineRefIdx[2], EAffineModel affineType, int gbiIdx ); void storeAffineMotion( Mv acAffineMv[2][3], int16_t affineRefIdx[2], EAffineModel affineType, int gbiIdx );
protected: protected:
...@@ -364,6 +452,10 @@ protected: ...@@ -364,6 +452,10 @@ protected:
); );
void xTZSearch ( const PredictionUnit& pu, void xTZSearch ( const PredictionUnit& pu,
#if JVET_O0592_ENC_ME_IMP
RefPicList eRefPicList,
int iRefIdxPred,
#endif
IntTZSearchStruct& cStruct, IntTZSearchStruct& cStruct,
Mv& rcMv, Mv& rcMv,
Distortion& ruiSAD, Distortion& ruiSAD,
...@@ -373,6 +465,10 @@ protected: ...@@ -373,6 +465,10 @@ protected:
); );
void xTZSearchSelective ( const PredictionUnit& pu, void xTZSearchSelective ( const PredictionUnit& pu,
#if JVET_O0592_ENC_ME_IMP
RefPicList eRefPicList,
int iRefIdxPred,
#endif
IntTZSearchStruct& cStruct, IntTZSearchStruct& cStruct,
Mv& rcMv, Mv& rcMv,
Distortion& ruiSAD, Distortion& ruiSAD,
...@@ -387,6 +483,10 @@ protected: ...@@ -387,6 +483,10 @@ protected:
); );
void xPatternSearchFast ( const PredictionUnit& pu, void xPatternSearchFast ( const PredictionUnit& pu,
#if JVET_O0592_ENC_ME_IMP
RefPicList eRefPicList,
int iRefIdxPred,
#endif
IntTZSearchStruct& cStruct, IntTZSearchStruct& cStruct,
Mv& rcMv, Mv& rcMv,
Distortion& ruiSAD, Distortion& ruiSAD,
......
...@@ -962,9 +962,13 @@ bool IntraSearch::estIntraPredLumaQT( CodingUnit &cu, Partitioner &partitioner, ...@@ -962,9 +962,13 @@ bool IntraSearch::estIntraPredLumaQT( CodingUnit &cu, Partitioner &partitioner,
{ {
cu.bdpcmMode = -mode; cu.bdpcmMode = -mode;
#if JVET_O0315_RDPCM_INTRAMODE_ALIGN
uiOrgMode = ModeInfo(false, 0, NOT_INTRA_SUBPARTITIONS, cu.bdpcmMode == 2 ? VER_IDX : HOR_IDX);
#else
unsigned mpm_pred[NUM_MOST_PROBABLE_MODES]; unsigned mpm_pred[NUM_MOST_PROBABLE_MODES];
PU::getIntraMPMs(pu, mpm_pred); PU::getIntraMPMs(pu, mpm_pred);
uiOrgMode = ModeInfo(false, 0, NOT_INTRA_SUBPARTITIONS, mpm_pred[0]); uiOrgMode = ModeInfo(false, 0, NOT_INTRA_SUBPARTITIONS, mpm_pred[0]);
#endif
cu.mipFlag = uiOrgMode.mipFlg; cu.mipFlag = uiOrgMode.mipFlg;
cu.ispMode = uiOrgMode.ispMod; cu.ispMode = uiOrgMode.ispMod;
pu.multiRefIdx = uiOrgMode.mRefId; pu.multiRefIdx = uiOrgMode.mRefId;
...@@ -2781,11 +2785,15 @@ ChromaCbfs IntraSearch::xRecurIntraChromaCodingQT( CodingStructure &cs, Partitio ...@@ -2781,11 +2785,15 @@ ChromaCbfs IntraSearch::xRecurIntraChromaCodingQT( CodingStructure &cs, Partitio
if( doReshaping ) if( doReshaping )
{ {
const Area area = currTU.Y().valid() ? currTU.Y() : Area(recalcPosition(currTU.chromaFormat, currTU.chType, CHANNEL_TYPE_LUMA, currTU.blocks[currTU.chType].pos()), recalcSize(currTU.chromaFormat, currTU.chType, CHANNEL_TYPE_LUMA, currTU.blocks[currTU.chType].size())); const Area area = currTU.Y().valid() ? currTU.Y() : Area(recalcPosition(currTU.chromaFormat, currTU.chType, CHANNEL_TYPE_LUMA, currTU.blocks[currTU.chType].pos()), recalcSize(currTU.chromaFormat, currTU.chType, CHANNEL_TYPE_LUMA, currTU.blocks[currTU.chType].size()));
const CompArea &areaY = CompArea(COMPONENT_Y, currTU.chromaFormat, area ); const CompArea &areaY = CompArea(COMPONENT_Y, currTU.chromaFormat, area);
#if JVET_O1109_UNFIY_CRS
int adj = m_pcReshape->calculateChromaAdjVpduNei(currTU, areaY);
#else
PelBuf piPredY; PelBuf piPredY;
piPredY = cs.picture->getPredBuf(areaY); piPredY = cs.picture->getPredBuf(areaY);
const Pel avgLuma = piPredY.computeAvg(); const Pel avgLuma = piPredY.computeAvg();
int adj = m_pcReshape->calculateChromaAdj(avgLuma); int adj = m_pcReshape->calculateChromaAdj(avgLuma);
#endif
currTU.setChromaAdj(adj); currTU.setChromaAdj(adj);
} }
......
...@@ -722,10 +722,9 @@ void HLSWriter::codeSPS( const SPS* pcSPS ) ...@@ -722,10 +722,9 @@ void HLSWriter::codeSPS( const SPS* pcSPS )
const RPLList* rplList0 = pcSPS->getRPLList0(); const RPLList* rplList0 = pcSPS->getRPLList0();
const RPLList* rplList1 = pcSPS->getRPLList1(); const RPLList* rplList1 = pcSPS->getRPLList1();
uint32_t numberOfRPL = pcSPS->getNumRPL0() - 1;
//Write candidate for List0 //Write candidate for List0
numberOfRPL = pcSPS->getNumRPL0() - 1; uint32_t numberOfRPL = pcSPS->getNumRPL0();
WRITE_UVLC(numberOfRPL, "num_ref_pic_lists_in_sps[0]"); WRITE_UVLC(numberOfRPL, "num_ref_pic_lists_in_sps[0]");
for (int ii = 0; ii < numberOfRPL; ii++) for (int ii = 0; ii < numberOfRPL; ii++)
{ {
...@@ -736,7 +735,7 @@ void HLSWriter::codeSPS( const SPS* pcSPS ) ...@@ -736,7 +735,7 @@ void HLSWriter::codeSPS( const SPS* pcSPS )
//Write candidate for List1 //Write candidate for List1
if (!pcSPS->getRPL1CopyFromRPL0Flag()) if (!pcSPS->getRPL1CopyFromRPL0Flag())
{ {
numberOfRPL = pcSPS->getNumRPL1() - 1; numberOfRPL = pcSPS->getNumRPL1();
WRITE_UVLC(numberOfRPL, "num_ref_pic_lists_in_sps[1]"); WRITE_UVLC(numberOfRPL, "num_ref_pic_lists_in_sps[1]");
for (int ii = 0; ii < numberOfRPL; ii++) for (int ii = 0; ii < numberOfRPL; ii++)
{ {
...@@ -809,9 +808,9 @@ void HLSWriter::codeSPS( const SPS* pcSPS ) ...@@ -809,9 +808,9 @@ void HLSWriter::codeSPS( const SPS* pcSPS )
WRITE_FLAG( pcSPS->getAMVREnabledFlag() ? 1 : 0, "sps_amvr_enabled_flag" ); WRITE_FLAG( pcSPS->getAMVREnabledFlag() ? 1 : 0, "sps_amvr_enabled_flag" );
WRITE_FLAG( pcSPS->getBDOFEnabledFlag() ? 1 : 0, "sps_bdof_enabled_flag" ); WRITE_FLAG( pcSPS->getBDOFEnabledFlag() ? 1 : 0, "sps_bdof_enabled_flag" );
#if !JVET_O0438_SPS_AFFINE_AMVR_FLAG
WRITE_FLAG( pcSPS->getAffineAmvrEnabledFlag() ? 1 : 0, "sps_affine_amvr_enabled_flag" ); WRITE_FLAG( pcSPS->getAffineAmvrEnabledFlag() ? 1 : 0, "sps_affine_amvr_enabled_flag" );
#endif
WRITE_FLAG( pcSPS->getUseDMVR() ? 1 : 0, "sps_dmvr_enable_flag" ); WRITE_FLAG( pcSPS->getUseDMVR() ? 1 : 0, "sps_dmvr_enable_flag" );
WRITE_FLAG(pcSPS->getUseMMVD() ? 1 : 0, "sps_mmvd_enable_flag"); WRITE_FLAG(pcSPS->getUseMMVD() ? 1 : 0, "sps_mmvd_enable_flag");
// KJS: sps_cclm_enabled_flag // KJS: sps_cclm_enabled_flag
...@@ -834,6 +833,9 @@ void HLSWriter::codeSPS( const SPS* pcSPS ) ...@@ -834,6 +833,9 @@ void HLSWriter::codeSPS( const SPS* pcSPS )
if ( pcSPS->getUseAffine() ) if ( pcSPS->getUseAffine() )
{ {
WRITE_FLAG( pcSPS->getUseAffineType() ? 1 : 0, "affine_type_flag" ); WRITE_FLAG( pcSPS->getUseAffineType() ? 1 : 0, "affine_type_flag" );
#if JVET_O0438_SPS_AFFINE_AMVR_FLAG
WRITE_FLAG( pcSPS->getAffineAmvrEnabledFlag() ? 1 : 0, "sps_affine_amvr_enabled_flag" );
#endif
} }
WRITE_FLAG( pcSPS->getUseGBi() ? 1 : 0, "gbi_flag" ); WRITE_FLAG( pcSPS->getUseGBi() ? 1 : 0, "gbi_flag" );
WRITE_FLAG(pcSPS->getIBCFlag() ? 1 : 0, "ibc_flag"); WRITE_FLAG(pcSPS->getIBCFlag() ? 1 : 0, "ibc_flag");
...@@ -845,7 +847,12 @@ void HLSWriter::codeSPS( const SPS* pcSPS ) ...@@ -845,7 +847,12 @@ void HLSWriter::codeSPS( const SPS* pcSPS )
{ {
WRITE_FLAG( pcSPS->getFpelMmvdEnabledFlag() ? 1 : 0, "sps_fpel_mmvd_enabled_flag" ); WRITE_FLAG( pcSPS->getFpelMmvdEnabledFlag() ? 1 : 0, "sps_fpel_mmvd_enabled_flag" );
} }
#if JVET_O1140_SLICE_DISABLE_BDOF_DMVR_FLAG
if(pcSPS->getBDOFEnabledFlag() || pcSPS->getUseDMVR())
{
WRITE_FLAG(pcSPS->getBdofDmvrSlicePresentFlag() ? 1 : 0, "sps_bdof_dmvr_slice_level_present_flag");
}
#endif
WRITE_FLAG( pcSPS->getUseTriangle() ? 1: 0, "triangle_flag" ); WRITE_FLAG( pcSPS->getUseTriangle() ? 1: 0, "triangle_flag" );
WRITE_FLAG( pcSPS->getUseMIP() ? 1: 0, "sps_mip_flag" ); WRITE_FLAG( pcSPS->getUseMIP() ? 1: 0, "sps_mip_flag" );
...@@ -1365,6 +1372,12 @@ void HLSWriter::codeSliceHeader ( Slice* pcSlice ) ...@@ -1365,6 +1372,12 @@ void HLSWriter::codeSliceHeader ( Slice* pcSlice )
{ {
WRITE_FLAG( pcSlice->getDisFracMMVD(), "tile_group_fracmmvd_disabled_flag" ); WRITE_FLAG( pcSlice->getDisFracMMVD(), "tile_group_fracmmvd_disabled_flag" );
} }
#if JVET_O1140_SLICE_DISABLE_BDOF_DMVR_FLAG
if (pcSlice->getSPS()->getBdofDmvrSlicePresentFlag())
{
WRITE_FLAG(pcSlice->getDisBdofDmvrFlag(), "tile_group_bdof_dmvr_disabled_flag");
}
#endif
if (pcSlice->getSPS()->getUseTriangle() && pcSlice->getMaxNumMergeCand() >= 2) if (pcSlice->getSPS()->getUseTriangle() && pcSlice->getMaxNumMergeCand() >= 2)
{ {
CHECK(pcSlice->getMaxNumMergeCand() < pcSlice->getMaxNumTriangleCand(), "Incorrrect max number of triangle candidates!"); CHECK(pcSlice->getMaxNumMergeCand() < pcSlice->getMaxNumTriangleCand(), "Incorrrect max number of triangle candidates!");
......