Commit 971390c9 authored by Frank Bossen's avatar Frank Bossen

Merge branch 'CPR_PARA_SEQ_FIX' into 'master'

Cpr para seq fix

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