Commit 225719d9 authored by Yu Han's avatar Yu Han Committed by Xiang Li
Browse files

JVET-O1136: Unified syntax for JVET-O0165/O0200/O0783 on TS and BDPCM signalling

parent f3b12f43
No preview for this file type
......@@ -2402,6 +2402,11 @@ Specifies the shift to apply to the SAO parameters. If negative, an estimate wil
Specifies the maximum TU size for which transform-skip can be used; the minimum value is 2. Version 1 and some Version 2 (RExt) profiles require this to be 2.
\\
\Option{BDPCM} &
\Default{false} &
When true, specifies the use of the BDPCM tool (for intra). Version 1 and some Version 2 (RExt) profiles require this to be false.
\\
\Option{ImplicitResidualDPCM} &
\Default{false} &
When true, specifies the use of the implicitly signalled residual RDPCM tool (for intra). Version 1 and some Version 2 (RExt) profiles require this to be false.
......
......@@ -133,6 +133,9 @@ void EncApp::xInitLibCfg()
m_cEncLib.setNoTriangleConstraintFlag ( !m_Triangle );
m_cEncLib.setNoLadfConstraintFlag ( !m_LadfEnabed );
m_cEncLib.setNoTransformSkipConstraintFlag ( !m_useTransformSkip );
#if JVET_O1136_TS_BDPCM_SIGNALLING
m_cEncLib.setNoBDPCMConstraintFlag ( !m_useBDPCM );
#endif
m_cEncLib.setNoQpDeltaConstraintFlag ( m_bNoQpDeltaConstraintFlag );
m_cEncLib.setNoDepQuantConstraintFlag ( !m_depQuantEnabledFlag);
m_cEncLib.setNoSignDataHidingConstraintFlag ( !m_signDataHidingEnabledFlag );
......@@ -341,6 +344,9 @@ void EncApp::xInitLibCfg()
m_cEncLib.setLog2SaoOffsetScale ( CHANNEL_TYPE_CHROMA, m_log2SaoOffsetScale[CHANNEL_TYPE_CHROMA] );
m_cEncLib.setUseTransformSkip ( m_useTransformSkip );
m_cEncLib.setUseTransformSkipFast ( m_useTransformSkipFast );
#if JVET_O1136_TS_BDPCM_SIGNALLING
m_cEncLib.setUseBDPCM ( m_useBDPCM );
#endif
m_cEncLib.setTransformSkipRotationEnabledFlag ( m_transformSkipRotationEnabledFlag );
m_cEncLib.setTransformSkipContextEnabledFlag ( m_transformSkipContextEnabledFlag );
m_cEncLib.setPersistentRiceAdaptationEnabledFlag ( m_persistentRiceAdaptationEnabledFlag );
......
......@@ -134,6 +134,9 @@ EncAppCfg::EncAppCfg()
, m_bNoTriangleConstraintFlag(false)
, m_bNoLadfConstraintFlag(false)
, m_noTransformSkipConstraintFlag(false)
#if JVET_O1136_TS_BDPCM_SIGNALLING
, m_noBDPCMConstraintFlag(false)
#endif
, m_bNoQpDeltaConstraintFlag(false)
, m_bNoDepQuantConstraintFlag(false)
, m_bNoSignDataHidingConstraintFlag(false)
......@@ -1050,6 +1053,9 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
("TransformSkip", m_useTransformSkip, false, "Intra transform skipping")
("TransformSkipFast", m_useTransformSkipFast, false, "Fast encoder search for transform skipping, winner takes it all mode.")
("TransformSkipLog2MaxSize", m_log2MaxTransformSkipBlockSize, 5U, "Specify transform-skip maximum size. Minimum 2, Maximum 5. (not valid in V1 profiles)")
#if JVET_O1136_TS_BDPCM_SIGNALLING
("BDPCM", m_useBDPCM, false, "BDPCM")
#endif
("ISPFast", m_useFastISP, false, "Fast encoder search for ISP")
("ImplicitResidualDPCM", m_rdpcmEnabledFlag[RDPCM_SIGNAL_IMPLICIT], false, "Enable implicitly signalled residual DPCM for intra (also known as sample-adaptive intra predict) (not valid in V1 profiles)")
("ExplicitResidualDPCM", m_rdpcmEnabledFlag[RDPCM_SIGNAL_EXPLICIT], false, "Enable explicitly signalled residual DPCM for inter (not valid in V1 profiles)")
......@@ -3251,6 +3257,9 @@ void EncAppCfg::xPrintParameter()
msg( VERBOSE, "TransformSkip:%d ", m_useTransformSkip );
msg( VERBOSE, "TransformSkipFast:%d ", m_useTransformSkipFast );
msg( VERBOSE, "TransformSkipLog2MaxSize:%d ", m_log2MaxTransformSkipBlockSize);
#if JVET_O1136_TS_BDPCM_SIGNALLING
msg( VERBOSE, "BDPCM:%d ", m_useBDPCM );
#endif
msg( VERBOSE, "Slice: M=%d ", int(m_sliceMode));
if (m_sliceMode!=NO_SLICES)
{
......
......@@ -143,6 +143,9 @@ protected:
bool m_bNoTriangleConstraintFlag;
bool m_bNoLadfConstraintFlag;
bool m_noTransformSkipConstraintFlag;
#if JVET_O1136_TS_BDPCM_SIGNALLING
bool m_noBDPCMConstraintFlag;
#endif
bool m_bNoQpDeltaConstraintFlag;
bool m_bNoDepQuantConstraintFlag;
bool m_bNoSignDataHidingConstraintFlag;
......@@ -180,6 +183,9 @@ protected:
uint32_t m_log2SaoOffsetScale[MAX_NUM_CHANNEL_TYPE]; ///< number of bits for the upward bit shift operation on the decoded SAO offsets
bool m_useTransformSkip; ///< flag for enabling intra transform skipping
bool m_useTransformSkipFast; ///< flag for enabling fast intra transform skipping
#if JVET_O1136_TS_BDPCM_SIGNALLING
bool m_useBDPCM;
#endif
uint32_t m_log2MaxTransformSkipBlockSize; ///< transform-skip maximum size (minimum of 2)
bool m_transformSkipRotationEnabledFlag; ///< control flag for transform-skip/transquant-bypass residual rotation
bool m_transformSkipContextEnabledFlag; ///< control flag for transform-skip/transquant-bypass single significance map context
......
......@@ -370,7 +370,9 @@ static const int DMVR_SUBCU_WIDTH_LOG2 = 4;
static const int DMVR_SUBCU_HEIGHT_LOG2 = 4;
static const int MAX_NUM_SUBCU_DMVR = ((MAX_CU_SIZE * MAX_CU_SIZE) >> (DMVR_SUBCU_WIDTH_LOG2 + DMVR_SUBCU_HEIGHT_LOG2));
static const int DMVR_NUM_ITERATION = 2;
#if !JVET_O1136_TS_BDPCM_SIGNALLING
static const int BDPCM_MAX_CU_SIZE = 32; ///< maximum CU size for RDPCM mode
#endif
//QTBT high level parameters
//for I slice luma CTB configuration para.
......
......@@ -1404,6 +1404,10 @@ SPS::SPS()
, m_pcmEnabledFlag (false)
, m_pcmLog2MaxSize ( 5)
, m_uiPCMLog2MinSize ( 7)
#if JVET_O1136_TS_BDPCM_SIGNALLING
, m_transformSkipEnabledFlag (false)
, m_BDPCMEnabledFlag (false)
#endif
, m_bPCMFilterDisableFlag (false)
, m_sbtmvpEnabledFlag (false)
, m_bdofEnabledFlag (false)
......@@ -1519,7 +1523,9 @@ PPS::PPS()
, m_numRefIdxL1DefaultActive (1)
, m_rpl1IdxPresentFlag (false)
, m_TransquantBypassEnabledFlag (false)
#if !JVET_O1136_TS_BDPCM_SIGNALLING
, m_useTransformSkip (false)
#endif
, m_entropyCodingSyncEnabledFlag (false)
, m_loopFilterAcrossBricksEnabledFlag (true)
, m_uniformTileSpacingFlag (false)
......
......@@ -202,6 +202,9 @@ class ConstraintInfo
bool m_noTriangleConstraintFlag;
bool m_noLadfConstraintFlag;
bool m_noTransformSkipConstraintFlag;
#if JVET_O1136_TS_BDPCM_SIGNALLING
bool m_noBDPCMConstraintFlag;
#endif
bool m_noQpDeltaConstraintFlag;
bool m_noDepQuantConstraintFlag;
bool m_noSignDataHidingConstraintFlag;
......@@ -237,6 +240,9 @@ public:
, m_noTriangleConstraintFlag (false)
, m_noLadfConstraintFlag (false)
, m_noTransformSkipConstraintFlag(false)
#if JVET_O1136_TS_BDPCM_SIGNALLING
, m_noBDPCMConstraintFlag (false)
#endif
, m_noQpDeltaConstraintFlag (false)
, m_noDepQuantConstraintFlag (false)
, m_noSignDataHidingConstraintFlag(false)
......@@ -313,6 +319,10 @@ public:
void setNoLadfConstraintFlag(bool bVal) { m_noLadfConstraintFlag = bVal; }
bool getNoTransformSkipConstraintFlag() const { return m_noTransformSkipConstraintFlag; }
void setNoTransformSkipConstraintFlag(bool bVal) { m_noTransformSkipConstraintFlag = bVal; }
#if JVET_O1136_TS_BDPCM_SIGNALLING
bool getNoBDPCMConstraintFlag() const { return m_noBDPCMConstraintFlag; }
void setNoBDPCMConstraintFlag(bool bVal) { m_noBDPCMConstraintFlag = bVal; }
#endif
bool getNoQpDeltaConstraintFlag() const { return m_noQpDeltaConstraintFlag; }
void setNoQpDeltaConstraintFlag(bool bVal) { m_noQpDeltaConstraintFlag = bVal; }
bool getNoDepQuantConstraintFlag() const { return m_noDepQuantConstraintFlag; }
......@@ -709,6 +719,11 @@ private:
uint32_t m_pcmLog2MaxSize;
uint32_t m_uiPCMLog2MinSize;
#if JVET_O1136_TS_BDPCM_SIGNALLING
bool m_transformSkipEnabledFlag;
bool m_BDPCMEnabledFlag;
#endif
// Parameter
BitDepths m_bitDepths;
int m_qpBDOffset[MAX_NUM_CHANNEL_TYPE];
......@@ -865,6 +880,12 @@ public:
uint32_t getPCMLog2MaxSize() const { return m_pcmLog2MaxSize; }
void setPCMLog2MinSize( uint32_t u ) { m_uiPCMLog2MinSize = u; }
uint32_t getPCMLog2MinSize() const { return m_uiPCMLog2MinSize; }
#if JVET_O1136_TS_BDPCM_SIGNALLING
bool getTransformSkipEnabledFlag() const { return m_transformSkipEnabledFlag; }
void setTransformSkipEnabledFlag( bool b ) { m_transformSkipEnabledFlag = b; }
bool getBDPCMEnabledFlag() const { return m_BDPCMEnabledFlag; }
void setBDPCMEnabledFlag( bool b ) { m_BDPCMEnabledFlag = b; }
#endif
void setBitsForPOC( uint32_t u ) { m_uiBitsForPOC = u; }
uint32_t getBitsForPOC() const { return m_uiBitsForPOC; }
void setNumReorderPics(int i, uint32_t tlayer) { m_numReorderPics[tlayer] = i; }
......@@ -1122,7 +1143,9 @@ private:
bool m_useWeightedBiPred; //!< Use of Weighting Bi-Prediction (B_SLICE)
bool m_OutputFlagPresentFlag; //!< Indicates the presence of output_flag in slice header
bool m_TransquantBypassEnabledFlag; //!< Indicates presence of cu_transquant_bypass_flag in CUs.
#if !JVET_O1136_TS_BDPCM_SIGNALLING
bool m_useTransformSkip;
#endif
bool m_entropyCodingSyncEnabledFlag; //!< Indicates the presence of wavefronts
bool m_loopFilterAcrossBricksEnabledFlag;
......@@ -1242,8 +1265,10 @@ public:
void setTransquantBypassEnabledFlag( bool b ) { m_TransquantBypassEnabledFlag = b; }
bool getTransquantBypassEnabledFlag() const { return m_TransquantBypassEnabledFlag; }
#if !JVET_O1136_TS_BDPCM_SIGNALLING
bool getUseTransformSkip() const { return m_useTransformSkip; }
void setUseTransformSkip( bool b ) { m_useTransformSkip = b; }
#endif
void setLoopFilterAcrossBricksEnabledFlag(bool b) { m_loopFilterAcrossBricksEnabledFlag = b; }
bool getLoopFilterAcrossBricksEnabledFlag() const { return m_loopFilterAcrossBricksEnabledFlag; }
......
......@@ -50,6 +50,8 @@
#include <assert.h>
#include <cassert>
#define JVET_O1136_TS_BDPCM_SIGNALLING 1 // JVET-O1136: Unified syntax for JVET-O0165/O0200/O0783 on TS and BDPCM signalling
#define JVET_O0219_LFNST_TRANSFORM_SET_FOR_LMCMODE 1
#define JVET_O0426_MRL_REF_SAMPLES_DC_MODE 1 // JVET-O0426: align MRL reference samples used for DC intra mode prediction
......
......@@ -4524,9 +4524,17 @@ uint8_t CU::deriveGbiIdx( uint8_t gbiLO, uint8_t gbiL1 )
bool CU::bdpcmAllowed( const CodingUnit& cu, const ComponentID compID )
{
#if JVET_O1136_TS_BDPCM_SIGNALLING
SizeType transformSkipMaxSize = 1 << cu.cs->pps->getPpsRangeExtension().getLog2MaxTransformSkipBlockSize();
#endif
bool bdpcmAllowed = compID == COMPONENT_Y;
bdpcmAllowed &= CU::isIntra( cu );
#if JVET_O1136_TS_BDPCM_SIGNALLING
bdpcmAllowed &= ( cu.lwidth() <= transformSkipMaxSize && cu.lheight() <= transformSkipMaxSize );
#else
bdpcmAllowed &= ( cu.lwidth() <= 32 && cu.lheight() <= 32 );
#endif
return bdpcmAllowed;
}
......@@ -4560,11 +4568,20 @@ bool TU::isTSAllowed(const TransformUnit &tu, const ComponentID compID)
bool tsAllowed = compID == COMPONENT_Y;
const int maxSize = tu.cs->pps->getPpsRangeExtension().getLog2MaxTransformSkipBlockSize();
#if JVET_O1136_TS_BDPCM_SIGNALLING
tsAllowed &= tu.cs->sps->getTransformSkipEnabledFlag();
#else
tsAllowed &= tu.cs->pps->getUseTransformSkip();
#endif
tsAllowed &= !tu.cu->transQuantBypass;
tsAllowed &= ( !tu.cu->ispMode || !isLuma(compID) );
#if JVET_O1136_TS_BDPCM_SIGNALLING
SizeType transformSkipMaxSize = 1 << maxSize;
tsAllowed &= !(tu.cu->bdpcmMode && tu.lwidth() <= transformSkipMaxSize && tu.lheight() <= transformSkipMaxSize);
#else
tsAllowed &= !( tu.cu->bdpcmMode && tu.lwidth() <= BDPCM_MAX_CU_SIZE && tu.lheight() <= BDPCM_MAX_CU_SIZE );
SizeType transformSkipMaxSize = 1 << maxSize;
#endif
tsAllowed &= tu.lwidth() <= transformSkipMaxSize && tu.lheight() <= transformSkipMaxSize;
tsAllowed &= !tu.cu->sbtInfo;
......@@ -4580,7 +4597,12 @@ bool TU::isMTSAllowed(const TransformUnit &tu, const ComponentID compID)
mtsAllowed &= ( tu.lwidth() <= maxSize && tu.lheight() <= maxSize );
mtsAllowed &= !tu.cu->ispMode;
mtsAllowed &= !tu.cu->sbtInfo;
#if JVET_O1136_TS_BDPCM_SIGNALLING
SizeType transformSkipMaxSize = 1 << tu.cs->pps->getPpsRangeExtension().getLog2MaxTransformSkipBlockSize();
mtsAllowed &= !( tu.cu->bdpcmMode && tu.lwidth() <= transformSkipMaxSize && tu.lheight() <= transformSkipMaxSize);
#else
mtsAllowed &= !( tu.cu->bdpcmMode && tu.lwidth() <= BDPCM_MAX_CU_SIZE && tu.lheight() <= BDPCM_MAX_CU_SIZE );
#endif
return mtsAllowed;
}
......
......@@ -1017,6 +1017,9 @@ void CABACReader::bdpcm_mode( CodingUnit& cu, const ComponentID compID )
{
cu.bdpcmMode = 0;
#if JVET_O1136_TS_BDPCM_SIGNALLING
if( !cu.cs->sps->getBDPCMEnabledFlag() ) return;
#endif
if( !CU::bdpcmAllowed( cu, compID ) ) return;
RExt__DECODER_DEBUG_BIT_STATISTICS_CREATE_SET_SIZE2( STATS__CABAC_BITS__BDPCM_MODE, cu.block(compID).lumaSize(), compID );
......
......@@ -377,8 +377,10 @@ void HLSyntaxReader::parsePPS( PPS* pcPPS, ParameterSetManager *parameterSetMana
READ_SVLC(iCode, "init_qp_minus26" ); pcPPS->setPicInitQPMinus26(iCode);
READ_FLAG( uiCode, "constrained_intra_pred_flag" ); pcPPS->setConstrainedIntraPred( uiCode ? true : false );
#if !JVET_O1136_TS_BDPCM_SIGNALLING
READ_FLAG( uiCode, "transform_skip_enabled_flag" );
pcPPS->setUseTransformSkip ( uiCode ? true : false );
#endif
READ_FLAG( uiCode, "cu_qp_delta_enabled_flag" ); pcPPS->setUseDQP( uiCode ? true : false );
if( pcPPS->getUseDQP() )
......@@ -686,7 +688,11 @@ void HLSyntaxReader::parsePPS( PPS* pcPPS, ParameterSetManager *parameterSetMana
PPSRExt &ppsRangeExtension = pcPPS->getPpsRangeExtension();
CHECK(bSkipTrailingExtensionBits, "Invalid state");
#if JVET_O1136_TS_BDPCM_SIGNALLING
if (parameterSetManager->getSPS(pcPPS->getSPSId())->getTransformSkipEnabledFlag())
#else
if (pcPPS->getUseTransformSkip())
#endif
{
READ_UVLC( uiCode, "log2_max_transform_skip_block_size_minus2");
ppsRangeExtension.setLog2MaxTransformSkipBlockSize(uiCode+2);
......@@ -1198,6 +1204,14 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
READ_FLAG( uiCode, "pcm_loop_filter_disable_flag" ); pcSPS->setPCMFilterDisableFlag ( uiCode ? true : false );
}
#if JVET_O1136_TS_BDPCM_SIGNALLING
READ_FLAG(uiCode, "sps_transform_skip_enabled_flag"); pcSPS->setTransformSkipEnabledFlag(uiCode ? true : false);
if (pcSPS->getTransformSkipEnabledFlag())
{
READ_FLAG(uiCode, "sps_bdpcm_enabled_flag"); pcSPS->setBDPCMEnabledFlag(uiCode ? true : false);
}
#endif
if( pcSPS->getCTUSize() + 2*(1 << pcSPS->getLog2MinCodingBlockSize()) <= pcSPS->getPicWidthInLumaSamples() )
{
READ_FLAG(uiCode, "sps_ref_wraparound_enabled_flag"); pcSPS->setWrapAroundEnabledFlag( uiCode ? true : false );
......@@ -2266,6 +2280,9 @@ void HLSyntaxReader::parseConstraintInfo(ConstraintInfo *cinfo)
READ_FLAG(symbol, "no_triangle_constraint_flag"); cinfo->setNoTriangleConstraintFlag(symbol > 0 ? true : false);
READ_FLAG(symbol, "no_ladf_constraint_flag"); cinfo->setNoLadfConstraintFlag(symbol > 0 ? true : false);
READ_FLAG(symbol, "no_transform_skip_constraint_flag"); cinfo->setNoTransformSkipConstraintFlag(symbol > 0 ? true : false);
#if JVET_O1136_TS_BDPCM_SIGNALLING
READ_FLAG(symbol, "no_bdpcm_constraint_flag"); cinfo->setNoBDPCMConstraintFlag(symbol > 0 ? true : false);
#endif
READ_FLAG(symbol, "no_qp_delta_constraint_flag"); cinfo->setNoQpDeltaConstraintFlag(symbol > 0 ? true : false);
READ_FLAG(symbol, "no_dep_quant_constraint_flag"); cinfo->setNoDepQuantConstraintFlag(symbol > 0 ? true : false);
READ_FLAG(symbol, "no_sign_data_hiding_constraint_flag"); cinfo->setNoSignDataHidingConstraintFlag(symbol > 0 ? true : false);
......
......@@ -776,6 +776,9 @@ void CABACWriter::pred_mode( const CodingUnit& cu )
}
void CABACWriter::bdpcm_mode( const CodingUnit& cu, const ComponentID compID )
{
#if JVET_O1136_TS_BDPCM_SIGNALLING
if( !cu.cs->sps->getBDPCMEnabledFlag() ) return;
#endif
if( !CU::bdpcmAllowed( cu, compID ) ) return;
m_BinEncoder.encodeBin( cu.bdpcmMode > 0 ? 1 : 0, Ctx::BDPCMMode( 0 ) );
......
......@@ -202,6 +202,9 @@ protected:
bool m_bNoTriangleConstraintFlag;
bool m_bNoLadfConstraintFlag;
bool m_noTransformSkipConstraintFlag;
#if JVET_O1136_TS_BDPCM_SIGNALLING
bool m_noBDPCMConstraintFlag;
#endif
bool m_bNoQpDeltaConstraintFlag;
bool m_bNoDepQuantConstraintFlag;
bool m_bNoSignDataHidingConstraintFlag;
......@@ -414,6 +417,9 @@ protected:
uint32_t m_log2SaoOffsetScale[MAX_NUM_CHANNEL_TYPE];
bool m_useTransformSkip;
bool m_useTransformSkipFast;
#if JVET_O1136_TS_BDPCM_SIGNALLING
bool m_useBDPCM;
#endif
uint32_t m_log2MaxTransformSkipBlockSize;
bool m_transformSkipRotationEnabledFlag;
bool m_transformSkipContextEnabledFlag;
......@@ -694,6 +700,10 @@ public:
void setNoLadfConstraintFlag(bool bVal) { m_bNoLadfConstraintFlag = bVal; }
bool getNoTransformSkipConstraintFlag() const { return m_noTransformSkipConstraintFlag; }
void setNoTransformSkipConstraintFlag(bool bVal) { m_noTransformSkipConstraintFlag = bVal; }
#if JVET_O1136_TS_BDPCM_SIGNALLING
bool getNoBDPCMConstraintFlag() const { return m_noBDPCMConstraintFlag; }
void setNoBDPCMConstraintFlag(bool bVal) { m_noBDPCMConstraintFlag = bVal; }
#endif
bool getNoQpDeltaConstraintFlag() const { return m_bNoQpDeltaConstraintFlag; }
void setNoQpDeltaConstraintFlag(bool bVal) { m_bNoQpDeltaConstraintFlag = bVal; }
bool getNoDepQuantConstraintFlag() const { return m_bNoDepQuantConstraintFlag; }
......@@ -1140,6 +1150,10 @@ public:
void setTransformSkipRotationEnabledFlag (const bool value) { m_transformSkipRotationEnabledFlag = value; }
bool getTransformSkipContextEnabledFlag () const { return m_transformSkipContextEnabledFlag; }
void setTransformSkipContextEnabledFlag (const bool value) { m_transformSkipContextEnabledFlag = value; }
#if JVET_O1136_TS_BDPCM_SIGNALLING
bool getUseBDPCM () { return m_useBDPCM; }
void setUseBDPCM ( bool b ) { m_useBDPCM = b; }
#endif
bool getPersistentRiceAdaptationEnabledFlag () const { return m_persistentRiceAdaptationEnabledFlag; }
void setPersistentRiceAdaptationEnabledFlag (const bool value) { m_persistentRiceAdaptationEnabledFlag = value; }
bool getCabacBypassAlignmentEnabledFlag () const { return m_cabacBypassAlignmentEnabledFlag; }
......
......@@ -235,11 +235,19 @@ int EncGOP::xWriteSPS (AccessUnit &accessUnit, const SPS *sps)
}
#if JVET_O1136_TS_BDPCM_SIGNALLING
int EncGOP::xWritePPS (AccessUnit &accessUnit, const PPS *pps, const SPS *sps)
#else
int EncGOP::xWritePPS (AccessUnit &accessUnit, const PPS *pps)
#endif
{
OutputNALUnit nalu(NAL_UNIT_PPS);
m_HLSWriter->setBitstream( &nalu.m_Bitstream );
#if JVET_O1136_TS_BDPCM_SIGNALLING
m_HLSWriter->codePPS( pps, sps );
#else
m_HLSWriter->codePPS( pps );
#endif
accessUnit.push_back(new NALUnitEBSP(nalu));
return (int)(accessUnit.back()->m_nalUnitData.str().size()) * 8;
}
......@@ -273,7 +281,11 @@ int EncGOP::xWriteParameterSets (AccessUnit &accessUnit, Slice *slice, const boo
}
if (m_pcEncLib->PPSNeedsWriting(slice->getPPS()->getPPSId())) // Note this assumes that all changes to the PPS are made at the EncLib level prior to picture creation (EncLib::xGetNewPicBuffer).
{
#if JVET_O1136_TS_BDPCM_SIGNALLING
actualTotalBits += xWritePPS(accessUnit, slice->getPPS(), slice->getSPS());
#else
actualTotalBits += xWritePPS(accessUnit, slice->getPPS());
#endif
}
return actualTotalBits;
......
......@@ -274,7 +274,11 @@ protected:
int xWriteVPS (AccessUnit &accessUnit, const VPS *vps);
int xWriteDPS (AccessUnit &accessUnit, const DPS *dps);
int xWriteSPS (AccessUnit &accessUnit, const SPS *sps);
#if JVET_O1136_TS_BDPCM_SIGNALLING
int xWritePPS (AccessUnit &accessUnit, const PPS *pps, const SPS *sps);
#else
int xWritePPS (AccessUnit &accessUnit, const PPS *pps);
#endif
int xWriteAPS(AccessUnit &accessUnit, APS *aps);
int xWriteParameterSets (AccessUnit &accessUnit, Slice *slice, const bool bSeqFirst);
......
......@@ -867,6 +867,9 @@ void EncLib::xInitSPS(SPS &sps)
cinfo->setNoTriangleConstraintFlag(m_bNoTriangleConstraintFlag);
cinfo->setNoLadfConstraintFlag(m_bNoLadfConstraintFlag);
cinfo->setNoTransformSkipConstraintFlag(m_noTransformSkipConstraintFlag);
#if JVET_O1136_TS_BDPCM_SIGNALLING
cinfo->setNoBDPCMConstraintFlag(m_noBDPCMConstraintFlag);
#endif
cinfo->setNoQpDeltaConstraintFlag(m_bNoQpDeltaConstraintFlag);
cinfo->setNoDepQuantConstraintFlag(m_bNoDepQuantConstraintFlag);
cinfo->setNoSignDataHidingConstraintFlag(m_bNoSignDataHidingConstraintFlag);
......@@ -958,6 +961,11 @@ void EncLib::xInitSPS(SPS &sps)
sps.setPCMEnabledFlag ( m_usePCM );
sps.setPCMLog2MaxSize( m_pcmLog2MaxSize );
#if JVET_O1136_TS_BDPCM_SIGNALLING
sps.setTransformSkipEnabledFlag(m_useTransformSkip);
sps.setBDPCMEnabledFlag(m_useBDPCM);
#endif
sps.setSPSTemporalMVPEnabledFlag((getTMVPModeId() == 2 || getTMVPModeId() == 1));
#if MAX_TB_SIZE_SIGNALLING
......@@ -1264,7 +1272,9 @@ void EncLib::xInitPPS(PPS &pps, const SPS &sps)
pps.setNumRefIdxL0DefaultActive(bestPos);
pps.setNumRefIdxL1DefaultActive(bestPos);
pps.setTransquantBypassEnabledFlag(getTransquantBypassEnabledFlag());
#if !JVET_O1136_TS_BDPCM_SIGNALLING
pps.setUseTransformSkip( m_useTransformSkip );
#endif
pps.getPpsRangeExtension().setLog2MaxTransformSkipBlockSize( m_log2MaxTransformSkipBlockSize );
......
......@@ -371,7 +371,11 @@ bool IntraSearch::estIntraPredLumaQT( CodingUnit &cu, Partitioner &partitioner,
m_intraModeTestedNormalIntra.clear();
}
#if JVET_O1136_TS_BDPCM_SIGNALLING
const bool testBDPCM = sps.getBDPCMEnabledFlag() && CU::bdpcmAllowed( cu, ComponentID( partitioner.chType ) ) && cu.mtsFlag == 0 && cu.lfnstIdx == 0;
#else
const bool testBDPCM = m_pcEncCfg->getRDPCM() && CU::bdpcmAllowed( cu, ComponentID( partitioner.chType ) ) && cu.mtsFlag == 0 && cu.lfnstIdx == 0;
#endif
static_vector<ModeInfo, FAST_UDI_MAX_RDMODE_NUM> uiHadModeList;
static_vector<double, FAST_UDI_MAX_RDMODE_NUM> CandCostList;
static_vector<double, FAST_UDI_MAX_RDMODE_NUM> CandHadList;
......@@ -1322,7 +1326,11 @@ void IntraSearch::estIntraPredChromaQT( CodingUnit &cu, Partitioner &partitioner
continue;
}
#if JVET_O1136_TS_BDPCM_SIGNALLING
if (cs.sps->getTransformSkipEnabledFlag())
#else
if (cs.pps->getUseTransformSkip())
#endif
{
m_CABACEstimator->getCtx() = ctxStart;
}
......@@ -2231,7 +2239,11 @@ bool IntraSearch::xRecurIntraCodingLumaQT( CodingStructure &cs, Partitioner &par
double dSingleCost = MAX_DOUBLE;
Distortion uiSingleDistLuma = 0;
uint64_t singleFracBits = 0;
#if JVET_O1136_TS_BDPCM_SIGNALLING
bool checkTransformSkip = sps.getTransformSkipEnabledFlag();
#else
bool checkTransformSkip = pps.getUseTransformSkip();
#endif
int bestModeId[ MAX_NUM_COMPONENT ] = { 0, 0, 0 };
uint8_t nNumTransformCands = cu.mtsFlag ? 4 : 1;
uint8_t numTransformIndexCands = nNumTransformCands;
......
......@@ -192,7 +192,11 @@ void HLSWriter::xCodeRefPicList(const ReferencePictureList* rpl, bool isLongTerm
}
}
#if JVET_O1136_TS_BDPCM_SIGNALLING
void HLSWriter::codePPS( const PPS* pcPPS, const SPS* pcSPS )
#else
void HLSWriter::codePPS( const PPS* pcPPS )
#endif
{
#if ENABLE_TRACING
xTracePPSHeader ();
......@@ -209,7 +213,9 @@ void HLSWriter::codePPS( const PPS* pcPPS )
WRITE_SVLC( pcPPS->getPicInitQPMinus26(), "init_qp_minus26");
WRITE_FLAG( pcPPS->getConstrainedIntraPred() ? 1 : 0, "constrained_intra_pred_flag" );
#if !JVET_O1136_TS_BDPCM_SIGNALLING
WRITE_FLAG( pcPPS->getUseTransformSkip() ? 1 : 0, "transform_skip_enabled_flag" );
#endif
WRITE_FLAG( pcPPS->getUseDQP() ? 1 : 0, "cu_qp_delta_enabled_flag" );
if ( pcPPS->getUseDQP() )
{
......@@ -373,7 +379,11 @@ void HLSWriter::codePPS( const PPS* pcPPS )
bool pps_extension_present_flag=false;
bool pps_extension_flags[NUM_PPS_EXTENSION_FLAGS]={false};
#if JVET_O1136_TS_BDPCM_SIGNALLING
pps_extension_flags[PPS_EXT__REXT] = pcPPS->getPpsRangeExtension().settingsDifferFromDefaults(pcSPS->getTransformSkipEnabledFlag());
#else
pps_extension_flags[PPS_EXT__REXT] = pcPPS->getPpsRangeExtension().settingsDifferFromDefaults(pcPPS->getUseTransformSkip());
#endif
// Other PPS extension flags checked here.
......@@ -411,7 +421,11 @@ void HLSWriter::codePPS( const PPS* pcPPS )
case PPS_EXT__REXT:
{
const PPSRExt &ppsRangeExtension = pcPPS->getPpsRangeExtension();
#if JVET_O1136_TS_BDPCM_SIGNALLING
if (pcSPS->getTransformSkipEnabledFlag())
#else
if (pcPPS->getUseTransformSkip())
#endif
{
WRITE_UVLC( ppsRangeExtension.getLog2MaxTransformSkipBlockSize()-2, "log2_max_transform_skip_block_size_minus2");
}
......@@ -792,6 +806,14 @@ void HLSWriter::codeSPS( const SPS* pcSPS )
WRITE_FLAG( pcSPS->getPCMFilterDisableFlag()?1 : 0, "pcm_loop_filter_disable_flag");
}
#if JVET_O1136_TS_BDPCM_SIGNALLING
WRITE_FLAG(pcSPS->getTransformSkipEnabledFlag() ? 1 : 0, "sps_transform_skip_enabled_flag");
if (pcSPS->getTransformSkipEnabledFlag())
{
WRITE_FLAG(pcSPS->getBDPCMEnabledFlag() ? 1 : 0, "sps_bdpcm_enabled_flag");
}
#endif
if( pcSPS->getCTUSize() + 2*(1 << pcSPS->getLog2MinCodingBlockSize()) <= pcSPS->getPicWidthInLumaSamples() )
{
WRITE_FLAG( pcSPS->getWrapAroundEnabledFlag() ? 1 : 0, "sps_ref_wraparound_enabled_flag" );
......@@ -1495,6 +1517,9 @@ void HLSWriter::codeConstraintInfo ( const ConstraintInfo* cinfo )
WRITE_FLAG(cinfo->getNoTriangleConstraintFlag() ? 1 : 0, "no_triangle_constraint_flag");
WRITE_FLAG(cinfo->getNoLadfConstraintFlag() ? 1 : 0, "no_ladf_constraint_flag");
WRITE_FLAG(cinfo->getNoTransformSkipConstraintFlag() ? 1 : 0, "no_transform_skip_constraint_flag");
#if JVET_O1136_TS_BDPCM_SIGNALLING
WRITE_FLAG(cinfo->getNoBDPCMConstraintFlag() ? 1 : 0, "no_bdpcm_constraint_flag");
#endif
WRITE_FLAG(cinfo->getNoQpDeltaConstraintFlag() ? 1 : 0, "no_qp_delta_constraint_flag");
WRITE_FLAG(cinfo->getNoDepQuantConstraintFlag() ? 1 : 0, "no_dep_quant_constraint_flag");
WRITE_FLAG(cinfo->getNoSignDataHidingConstraintFlag() ? 1 : 0, "no_sign_data_hiding_constraint_flag");
......
......@@ -120,7 +120,11 @@ public:
uint32_t getNumberOfWrittenBits () { return m_pcBitIf->getNumberOfWrittenBits(); }
void codeVUI ( const VUI *pcVUI, const SPS* pcSPS );
void codeSPS ( const SPS* pcSPS );
#if JVET_O1136_TS_BDPCM_SIGNALLING
void codePPS ( const PPS* pcPPS, const SPS* pcSPS );
#else
void codePPS ( const PPS* pcPPS );
#endif
void codeAPS ( APS* pcAPS );
void codeAlfAps ( APS* pcAPS );
void codeLmcsAps ( APS* pcAPS );
......
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