Commit 5b93362a authored by Xiaozhong Xu's avatar Xiaozhong Xu Committed by Frank Bossen

Cpr para seq fix

parent 3571143b
...@@ -566,7 +566,7 @@ void CodingStructure::allocateVectorsAtPicLevel() ...@@ -566,7 +566,7 @@ void CodingStructure::allocateVectorsAtPicLevel()
{ {
const int twice = ( const int twice = (
#if JVET_K0076_CPR_DT #if JVET_K0076_CPR_DT
(!pcv->ISingleTree && (slice->isIntra() || (this->slice->getNumRefIdx(REF_PIC_LIST_0) == 1 && this->slice->getNumRefIdx(REF_PIC_LIST_1) == 0 && this->slice->getRefPOC(REF_PIC_LIST_0, 0) == this->slice->getPOC()))) (!pcv->ISingleTree && (slice->isIntra() || this->slice->getCprIsOnlyRefPic()))
#else #else
!pcv->ISingleTree && slice->isIntra() !pcv->ISingleTree && slice->isIntra()
#endif #endif
......
...@@ -136,6 +136,9 @@ Slice::Slice() ...@@ -136,6 +136,9 @@ Slice::Slice()
, m_iProcessingStartTime ( 0 ) , m_iProcessingStartTime ( 0 )
, m_dProcessingTime ( 0 ) , m_dProcessingTime ( 0 )
, m_uiMaxBTSize ( 0 ) , m_uiMaxBTSize ( 0 )
#if JVET_K0076_CPR
, m_bCprIsOnlyRefPic ( false )
#endif
{ {
for(uint32_t i=0; i<NUM_REF_PIC_LIST_01; i++) for(uint32_t i=0; i<NUM_REF_PIC_LIST_01; i++)
{ {
...@@ -2724,7 +2727,7 @@ void calculateParameterSetChangedFlag(bool &bChanged, const std::vector<uint8_t> ...@@ -2724,7 +2727,7 @@ void calculateParameterSetChangedFlag(bool &bChanged, const std::vector<uint8_t>
uint32_t PreCalcValues::getValIdx( const Slice &slice, const ChannelType chType ) const uint32_t PreCalcValues::getValIdx( const Slice &slice, const ChannelType chType ) const
{ {
#if JVET_K0076_CPR_DT #if JVET_K0076_CPR_DT
return (slice.isIntra() || (slice.getNumRefIdx(REF_PIC_LIST_0) == 1 && slice.getNumRefIdx(REF_PIC_LIST_1) == 0 && slice.getRefPOC(REF_PIC_LIST_0, 0) == slice.getPOC())) return (slice.isIntra() || slice.getCprIsOnlyRefPic())
? (ISingleTree ? 0 : (chType << 1)) : 1; ? (ISingleTree ? 0 : (chType << 1)) : 1;
#else #else
return slice.isIntra() ? ( ISingleTree ? 0 : ( chType << 1 ) ) : 1; return slice.isIntra() ? ( ISingleTree ? 0 : ( chType << 1 ) ) : 1;
...@@ -2744,7 +2747,7 @@ uint32_t PreCalcValues::getMinBtSize( const Slice &slice, const ChannelType chTy ...@@ -2744,7 +2747,7 @@ uint32_t PreCalcValues::getMinBtSize( const Slice &slice, const ChannelType chTy
uint32_t PreCalcValues::getMaxBtSize( const Slice &slice, const ChannelType chType ) const uint32_t PreCalcValues::getMaxBtSize( const Slice &slice, const ChannelType chType ) const
{ {
#if JVET_K0076_CPR_DT #if JVET_K0076_CPR_DT
return (( !slice.isIntra() && !(slice.getNumRefIdx(REF_PIC_LIST_0) == 1 && slice.getNumRefIdx(REF_PIC_LIST_1) == 0 && slice.getRefPOC(REF_PIC_LIST_0, 0) == slice.getPOC()) ) return ((!slice.isIntra() && !slice.getCprIsOnlyRefPic())
|| isLuma(chType) || ISingleTree) ? slice.getMaxBTSize() : MAX_BT_SIZE_C; || isLuma(chType) || ISingleTree) ? slice.getMaxBTSize() : MAX_BT_SIZE_C;
#else #else
return ( !slice.isIntra() || isLuma( chType ) || ISingleTree ) ? slice.getMaxBTSize() : MAX_BT_SIZE_C; return ( !slice.isIntra() || isLuma( chType ) || ISingleTree ) ? slice.getMaxBTSize() : MAX_BT_SIZE_C;
......
...@@ -1839,6 +1839,9 @@ private: ...@@ -1839,6 +1839,9 @@ private:
clock_t m_iProcessingStartTime; clock_t m_iProcessingStartTime;
double m_dProcessingTime; double m_dProcessingTime;
uint32_t m_uiMaxBTSize; uint32_t m_uiMaxBTSize;
#if JVET_K0076_CPR
bool m_bCprIsOnlyRefPic;
#endif
#if JVET_K0371_ALF #if JVET_K0371_ALF
AlfSliceParam m_alfSliceParam; AlfSliceParam m_alfSliceParam;
...@@ -1959,6 +1962,10 @@ public: ...@@ -1959,6 +1962,10 @@ public:
void setMaxBTSize(int i) { m_uiMaxBTSize = i; } void setMaxBTSize(int i) { m_uiMaxBTSize = i; }
uint32_t getMaxBTSize() const { return m_uiMaxBTSize; } uint32_t getMaxBTSize() const { return m_uiMaxBTSize; }
#if JVET_K0076_CPR
bool getCprIsOnlyRefPic() const { return m_bCprIsOnlyRefPic; }
void setCprIsOnlyRefPic(bool b) { m_bCprIsOnlyRefPic = b; }
#endif
#if JEM_TOOLS #if JEM_TOOLS
bool getUseLIC() const { return m_UseLIC; } bool getUseLIC() const { return m_UseLIC; }
......
...@@ -243,13 +243,7 @@ bool CS::isDualITree( const CodingStructure &cs ) ...@@ -243,13 +243,7 @@ bool CS::isDualITree( const CodingStructure &cs )
{ {
#if JVET_K0076_CPR_DT #if JVET_K0076_CPR_DT
// for I slice, or P slice with CPR is the only ref // for I slice, or P slice with CPR is the only ref
return (cs.slice->isIntra() || return (cs.slice->isIntra() || cs.slice->getCprIsOnlyRefPic()) && !cs.pcv->ISingleTree;
(
cs.slice->getNumRefIdx(REF_PIC_LIST_0) == 1 &&
cs.slice->getNumRefIdx(REF_PIC_LIST_1) == 0 &&
cs.slice->getRefPOC(REF_PIC_LIST_0, 0) == cs.slice->getPOC()
)
) && !cs.pcv->ISingleTree;
#else #else
return cs.slice->isIntra() && !cs.pcv->ISingleTree; return cs.slice->isIntra() && !cs.pcv->ISingleTree;
#endif #endif
......
...@@ -1167,7 +1167,7 @@ bool DecLib::xDecodeSlice(InputNALUnit &nalu, int &iSkipFrame, int iPOCLastDispl ...@@ -1167,7 +1167,7 @@ bool DecLib::xDecodeSlice(InputNALUnit &nalu, int &iSkipFrame, int iPOCLastDispl
pcSlice->checkCRA(pcSlice->getRPS(), m_pocCRA, m_associatedIRAPType, m_cListPic ); pcSlice->checkCRA(pcSlice->getRPS(), m_pocCRA, m_associatedIRAPType, m_cListPic );
// Set reference list // Set reference list
pcSlice->setRefPicList( m_cListPic, true, true ); pcSlice->setRefPicList( m_cListPic, true, true );
if (!pcSlice->isIntra()) if (!pcSlice->isIntra())
{ {
bool bLowDelay = true; bool bLowDelay = true;
...@@ -1197,6 +1197,12 @@ bool DecLib::xDecodeSlice(InputNALUnit &nalu, int &iSkipFrame, int iPOCLastDispl ...@@ -1197,6 +1197,12 @@ bool DecLib::xDecodeSlice(InputNALUnit &nalu, int &iSkipFrame, int iPOCLastDispl
//--------------- //---------------
pcSlice->setRefPOCList(); pcSlice->setRefPOCList();
#if JVET_K0076_CPR
if (pcSlice->getNumRefIdx(REF_PIC_LIST_0) == 1 &&
pcSlice->getNumRefIdx(REF_PIC_LIST_1) == 0 &&
pcSlice->getRefPOC(REF_PIC_LIST_0, 0) == pcSlice->getPOC())
pcSlice->setCprIsOnlyRefPic(true);
#endif
#if JEM_TOOLS #if JEM_TOOLS
if( pcSlice->getSPS()->getSpsNext().getUseBIO() ) if( pcSlice->getSPS()->getSpsNext().getUseBIO() )
......
...@@ -411,7 +411,7 @@ void EncCu::compressCtu( CodingStructure& cs, const UnitArea& area, const unsign ...@@ -411,7 +411,7 @@ void EncCu::compressCtu( CodingStructure& cs, const UnitArea& area, const unsign
if( !cs.pcv->ISingleTree && if( !cs.pcv->ISingleTree &&
#if JVET_K0076_CPR_DT #if JVET_K0076_CPR_DT
(cs.slice->isIntra() || (cs.slice->getNumRefIdx(REF_PIC_LIST_0) == 1 && cs.slice->getNumRefIdx(REF_PIC_LIST_1) == 0 && cs.slice->getRefPOC(REF_PIC_LIST_0, 0) == cs.slice->getPOC())) (cs.slice->isIntra() || cs.slice->getCprIsOnlyRefPic())
#else #else
cs.slice->isIntra() cs.slice->isIntra()
#endif #endif
......
...@@ -1684,6 +1684,7 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic, ...@@ -1684,6 +1684,7 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic,
if (pcSlice->getSliceType() == I_SLICE && pcSlice->getSPS()->getSpsNext().getIBCMode()) if (pcSlice->getSliceType() == I_SLICE && pcSlice->getSPS()->getSpsNext().getIBCMode())
{ {
pcSlice->setSliceType(P_SLICE); pcSlice->setSliceType(P_SLICE);
pcSlice->setCprIsOnlyRefPic(true);
} }
#endif #endif
// Set the nal unit type // Set the nal unit type
...@@ -1889,7 +1890,11 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic, ...@@ -1889,7 +1890,11 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic,
if( m_pcCfg->getUseAMaxBT() ) if( m_pcCfg->getUseAMaxBT() )
{ {
if( !pcSlice->isIntra() ) if( !pcSlice->isIntra()
#if JVET_K0076_CPR
&& !pcSlice->getCprIsOnlyRefPic()
#endif
)
{ {
int refLayer = pcSlice->getDepth(); int refLayer = pcSlice->getDepth();
if( refLayer > 9 ) refLayer = 9; // Max layer is 10 if( refLayer > 9 ) refLayer = 9; // Max layer is 10
...@@ -2524,10 +2529,7 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic, ...@@ -2524,10 +2529,7 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic,
{ {
if( !pcSlice->isIntra() if( !pcSlice->isIntra()
#if JVET_K0076_CPR #if JVET_K0076_CPR
&& && !pcSlice->getCprIsOnlyRefPic()
!(pcSlice->getNumRefIdx(REF_PIC_LIST_0) == 1 &&
pcSlice->getNumRefIdx(REF_PIC_LIST_1) == 0 &&
pcSlice->getRefPOC(REF_PIC_LIST_0, 0) == pcSlice->getPOC())
#endif #endif
) )
{ {
......
...@@ -1274,7 +1274,11 @@ void EncSlice::compressSlice( Picture* pcPic, const bool bCompressEntireSlice, c ...@@ -1274,7 +1274,11 @@ void EncSlice::compressSlice( Picture* pcPic, const bool bCompressEntireSlice, c
#if JVET_K0346 #if JVET_K0346
if (pcSlice->getSPS()->getSpsNext().getUseSubPuMvp()) if (pcSlice->getSPS()->getSpsNext().getUseSubPuMvp())
{ {
if (!pcSlice->isIntra()) if (!pcSlice->isIntra()
#if JVET_K0076_CPR
&& !pcSlice->getCprIsOnlyRefPic()
#endif
)
{ {
if (pcSlice->getPOC() > m_pcCuEncoder->getPrevPOC() && m_pcCuEncoder->getClearSubMergeStatic()) if (pcSlice->getPOC() > m_pcCuEncoder->getPrevPOC() && m_pcCuEncoder->getClearSubMergeStatic())
{ {
......
Markdown is supported
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