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 ...@@ -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. 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} & \Option{ImplicitResidualDPCM} &
\Default{false} & \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. 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() ...@@ -133,6 +133,9 @@ void EncApp::xInitLibCfg()
m_cEncLib.setNoTriangleConstraintFlag ( !m_Triangle ); m_cEncLib.setNoTriangleConstraintFlag ( !m_Triangle );
m_cEncLib.setNoLadfConstraintFlag ( !m_LadfEnabed ); m_cEncLib.setNoLadfConstraintFlag ( !m_LadfEnabed );
m_cEncLib.setNoTransformSkipConstraintFlag ( !m_useTransformSkip ); m_cEncLib.setNoTransformSkipConstraintFlag ( !m_useTransformSkip );
#if JVET_O1136_TS_BDPCM_SIGNALLING
m_cEncLib.setNoBDPCMConstraintFlag ( !m_useBDPCM );
#endif
m_cEncLib.setNoQpDeltaConstraintFlag ( m_bNoQpDeltaConstraintFlag ); m_cEncLib.setNoQpDeltaConstraintFlag ( m_bNoQpDeltaConstraintFlag );
m_cEncLib.setNoDepQuantConstraintFlag ( !m_depQuantEnabledFlag); m_cEncLib.setNoDepQuantConstraintFlag ( !m_depQuantEnabledFlag);
m_cEncLib.setNoSignDataHidingConstraintFlag ( !m_signDataHidingEnabledFlag ); m_cEncLib.setNoSignDataHidingConstraintFlag ( !m_signDataHidingEnabledFlag );
...@@ -341,6 +344,9 @@ void EncApp::xInitLibCfg() ...@@ -341,6 +344,9 @@ void EncApp::xInitLibCfg()
m_cEncLib.setLog2SaoOffsetScale ( CHANNEL_TYPE_CHROMA, m_log2SaoOffsetScale[CHANNEL_TYPE_CHROMA] ); m_cEncLib.setLog2SaoOffsetScale ( CHANNEL_TYPE_CHROMA, m_log2SaoOffsetScale[CHANNEL_TYPE_CHROMA] );
m_cEncLib.setUseTransformSkip ( m_useTransformSkip ); m_cEncLib.setUseTransformSkip ( m_useTransformSkip );
m_cEncLib.setUseTransformSkipFast ( m_useTransformSkipFast ); m_cEncLib.setUseTransformSkipFast ( m_useTransformSkipFast );
#if JVET_O1136_TS_BDPCM_SIGNALLING
m_cEncLib.setUseBDPCM ( m_useBDPCM );
#endif
m_cEncLib.setTransformSkipRotationEnabledFlag ( m_transformSkipRotationEnabledFlag ); m_cEncLib.setTransformSkipRotationEnabledFlag ( m_transformSkipRotationEnabledFlag );
m_cEncLib.setTransformSkipContextEnabledFlag ( m_transformSkipContextEnabledFlag ); m_cEncLib.setTransformSkipContextEnabledFlag ( m_transformSkipContextEnabledFlag );
m_cEncLib.setPersistentRiceAdaptationEnabledFlag ( m_persistentRiceAdaptationEnabledFlag ); m_cEncLib.setPersistentRiceAdaptationEnabledFlag ( m_persistentRiceAdaptationEnabledFlag );
......
...@@ -134,6 +134,9 @@ EncAppCfg::EncAppCfg() ...@@ -134,6 +134,9 @@ EncAppCfg::EncAppCfg()
, m_bNoTriangleConstraintFlag(false) , m_bNoTriangleConstraintFlag(false)
, m_bNoLadfConstraintFlag(false) , m_bNoLadfConstraintFlag(false)
, m_noTransformSkipConstraintFlag(false) , m_noTransformSkipConstraintFlag(false)
#if JVET_O1136_TS_BDPCM_SIGNALLING
, m_noBDPCMConstraintFlag(false)
#endif
, m_bNoQpDeltaConstraintFlag(false) , m_bNoQpDeltaConstraintFlag(false)
, m_bNoDepQuantConstraintFlag(false) , m_bNoDepQuantConstraintFlag(false)
, m_bNoSignDataHidingConstraintFlag(false) , m_bNoSignDataHidingConstraintFlag(false)
...@@ -1050,6 +1053,9 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] ) ...@@ -1050,6 +1053,9 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
("TransformSkip", m_useTransformSkip, false, "Intra transform skipping") ("TransformSkip", m_useTransformSkip, false, "Intra transform skipping")
("TransformSkipFast", m_useTransformSkipFast, false, "Fast encoder search for transform skipping, winner takes it all mode.") ("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)") ("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") ("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)") ("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)") ("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() ...@@ -3251,6 +3257,9 @@ void EncAppCfg::xPrintParameter()
msg( VERBOSE, "TransformSkip:%d ", m_useTransformSkip ); msg( VERBOSE, "TransformSkip:%d ", m_useTransformSkip );
msg( VERBOSE, "TransformSkipFast:%d ", m_useTransformSkipFast ); msg( VERBOSE, "TransformSkipFast:%d ", m_useTransformSkipFast );
msg( VERBOSE, "TransformSkipLog2MaxSize:%d ", m_log2MaxTransformSkipBlockSize); 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)); msg( VERBOSE, "Slice: M=%d ", int(m_sliceMode));
if (m_sliceMode!=NO_SLICES) if (m_sliceMode!=NO_SLICES)
{ {
......
...@@ -143,6 +143,9 @@ protected: ...@@ -143,6 +143,9 @@ protected:
bool m_bNoTriangleConstraintFlag; bool m_bNoTriangleConstraintFlag;
bool m_bNoLadfConstraintFlag; bool m_bNoLadfConstraintFlag;
bool m_noTransformSkipConstraintFlag; bool m_noTransformSkipConstraintFlag;
#if JVET_O1136_TS_BDPCM_SIGNALLING
bool m_noBDPCMConstraintFlag;
#endif
bool m_bNoQpDeltaConstraintFlag; bool m_bNoQpDeltaConstraintFlag;
bool m_bNoDepQuantConstraintFlag; bool m_bNoDepQuantConstraintFlag;
bool m_bNoSignDataHidingConstraintFlag; bool m_bNoSignDataHidingConstraintFlag;
...@@ -180,6 +183,9 @@ protected: ...@@ -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 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_useTransformSkip; ///< flag for enabling intra transform skipping
bool m_useTransformSkipFast; ///< flag for enabling fast 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) 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_transformSkipRotationEnabledFlag; ///< control flag for transform-skip/transquant-bypass residual rotation
bool m_transformSkipContextEnabledFlag; ///< control flag for transform-skip/transquant-bypass single significance map context 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; ...@@ -370,7 +370,9 @@ static const int DMVR_SUBCU_WIDTH_LOG2 = 4;
static const int DMVR_SUBCU_HEIGHT_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 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; 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 static const int BDPCM_MAX_CU_SIZE = 32; ///< maximum CU size for RDPCM mode
#endif
//QTBT high level parameters //QTBT high level parameters
//for I slice luma CTB configuration para. //for I slice luma CTB configuration para.
......
...@@ -1404,6 +1404,10 @@ SPS::SPS() ...@@ -1404,6 +1404,10 @@ SPS::SPS()
, m_pcmEnabledFlag (false) , m_pcmEnabledFlag (false)
, m_pcmLog2MaxSize ( 5) , m_pcmLog2MaxSize ( 5)
, m_uiPCMLog2MinSize ( 7) , m_uiPCMLog2MinSize ( 7)
#if JVET_O1136_TS_BDPCM_SIGNALLING
, m_transformSkipEnabledFlag (false)
, m_BDPCMEnabledFlag (false)
#endif
, m_bPCMFilterDisableFlag (false) , m_bPCMFilterDisableFlag (false)
, m_sbtmvpEnabledFlag (false) , m_sbtmvpEnabledFlag (false)
, m_bdofEnabledFlag (false) , m_bdofEnabledFlag (false)
...@@ -1519,7 +1523,9 @@ PPS::PPS() ...@@ -1519,7 +1523,9 @@ PPS::PPS()
, m_numRefIdxL1DefaultActive (1) , m_numRefIdxL1DefaultActive (1)
, m_rpl1IdxPresentFlag (false) , m_rpl1IdxPresentFlag (false)
, m_TransquantBypassEnabledFlag (false) , m_TransquantBypassEnabledFlag (false)
#if !JVET_O1136_TS_BDPCM_SIGNALLING
, m_useTransformSkip (false) , m_useTransformSkip (false)
#endif
, m_entropyCodingSyncEnabledFlag (false) , m_entropyCodingSyncEnabledFlag (false)
, m_loopFilterAcrossBricksEnabledFlag (true) , m_loopFilterAcrossBricksEnabledFlag (true)
, m_uniformTileSpacingFlag (false) , m_uniformTileSpacingFlag (false)
......
...@@ -202,6 +202,9 @@ class ConstraintInfo ...@@ -202,6 +202,9 @@ class ConstraintInfo
bool m_noTriangleConstraintFlag; bool m_noTriangleConstraintFlag;
bool m_noLadfConstraintFlag; bool m_noLadfConstraintFlag;
bool m_noTransformSkipConstraintFlag; bool m_noTransformSkipConstraintFlag;
#if JVET_O1136_TS_BDPCM_SIGNALLING
bool m_noBDPCMConstraintFlag;
#endif
bool m_noQpDeltaConstraintFlag; bool m_noQpDeltaConstraintFlag;
bool m_noDepQuantConstraintFlag; bool m_noDepQuantConstraintFlag;
bool m_noSignDataHidingConstraintFlag; bool m_noSignDataHidingConstraintFlag;
...@@ -237,6 +240,9 @@ public: ...@@ -237,6 +240,9 @@ public:
, m_noTriangleConstraintFlag (false) , m_noTriangleConstraintFlag (false)
, m_noLadfConstraintFlag (false) , m_noLadfConstraintFlag (false)
, m_noTransformSkipConstraintFlag(false) , m_noTransformSkipConstraintFlag(false)
#if JVET_O1136_TS_BDPCM_SIGNALLING
, m_noBDPCMConstraintFlag (false)
#endif
, m_noQpDeltaConstraintFlag (false) , m_noQpDeltaConstraintFlag (false)
, m_noDepQuantConstraintFlag (false) , m_noDepQuantConstraintFlag (false)
, m_noSignDataHidingConstraintFlag(false) , m_noSignDataHidingConstraintFlag(false)
...@@ -313,6 +319,10 @@ public: ...@@ -313,6 +319,10 @@ public:
void setNoLadfConstraintFlag(bool bVal) { m_noLadfConstraintFlag = bVal; } void setNoLadfConstraintFlag(bool bVal) { m_noLadfConstraintFlag = bVal; }
bool getNoTransformSkipConstraintFlag() const { return m_noTransformSkipConstraintFlag; } bool getNoTransformSkipConstraintFlag() const { return m_noTransformSkipConstraintFlag; }
void setNoTransformSkipConstraintFlag(bool bVal) { m_noTransformSkipConstraintFlag = bVal; } 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; } bool getNoQpDeltaConstraintFlag() const { return m_noQpDeltaConstraintFlag; }
void setNoQpDeltaConstraintFlag(bool bVal) { m_noQpDeltaConstraintFlag = bVal; } void setNoQpDeltaConstraintFlag(bool bVal) { m_noQpDeltaConstraintFlag = bVal; }
bool getNoDepQuantConstraintFlag() const { return m_noDepQuantConstraintFlag; } bool getNoDepQuantConstraintFlag() const { return m_noDepQuantConstraintFlag; }
...@@ -709,6 +719,11 @@ private: ...@@ -709,6 +719,11 @@ private:
uint32_t m_pcmLog2MaxSize; uint32_t m_pcmLog2MaxSize;
uint32_t m_uiPCMLog2MinSize; uint32_t m_uiPCMLog2MinSize;
#if JVET_O1136_TS_BDPCM_SIGNALLING
bool m_transformSkipEnabledFlag;
bool m_BDPCMEnabledFlag;
#endif
// Parameter // Parameter
BitDepths m_bitDepths; BitDepths m_bitDepths;
int m_qpBDOffset[MAX_NUM_CHANNEL_TYPE]; int m_qpBDOffset[MAX_NUM_CHANNEL_TYPE];
...@@ -865,6 +880,12 @@ public: ...@@ -865,6 +880,12 @@ public:
uint32_t getPCMLog2MaxSize() const { return m_pcmLog2MaxSize; } uint32_t getPCMLog2MaxSize() const { return m_pcmLog2MaxSize; }
void setPCMLog2MinSize( uint32_t u ) { m_uiPCMLog2MinSize = u; } void setPCMLog2MinSize( uint32_t u ) { m_uiPCMLog2MinSize = u; }
uint32_t getPCMLog2MinSize() const { return m_uiPCMLog2MinSize; } 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; } void setBitsForPOC( uint32_t u ) { m_uiBitsForPOC = u; }
uint32_t getBitsForPOC() const { return m_uiBitsForPOC; } uint32_t getBitsForPOC() const { return m_uiBitsForPOC; }
void setNumReorderPics(int i, uint32_t tlayer) { m_numReorderPics[tlayer] = i; } void setNumReorderPics(int i, uint32_t tlayer) { m_numReorderPics[tlayer] = i; }
...@@ -1122,7 +1143,9 @@ private: ...@@ -1122,7 +1143,9 @@ private:
bool m_useWeightedBiPred; //!< Use of Weighting Bi-Prediction (B_SLICE) bool m_useWeightedBiPred; //!< Use of Weighting Bi-Prediction (B_SLICE)
bool m_OutputFlagPresentFlag; //!< Indicates the presence of output_flag in slice header bool m_OutputFlagPresentFlag; //!< Indicates the presence of output_flag in slice header
bool m_TransquantBypassEnabledFlag; //!< Indicates presence of cu_transquant_bypass_flag in CUs. bool m_TransquantBypassEnabledFlag; //!< Indicates presence of cu_transquant_bypass_flag in CUs.
#if !JVET_O1136_TS_BDPCM_SIGNALLING
bool m_useTransformSkip; bool m_useTransformSkip;
#endif
bool m_entropyCodingSyncEnabledFlag; //!< Indicates the presence of wavefronts bool m_entropyCodingSyncEnabledFlag; //!< Indicates the presence of wavefronts
bool m_loopFilterAcrossBricksEnabledFlag; bool m_loopFilterAcrossBricksEnabledFlag;
...@@ -1242,8 +1265,10 @@ public: ...@@ -1242,8 +1265,10 @@ public:
void setTransquantBypassEnabledFlag( bool b ) { m_TransquantBypassEnabledFlag = b; } void setTransquantBypassEnabledFlag( bool b ) { m_TransquantBypassEnabledFlag = b; }
bool getTransquantBypassEnabledFlag() const { return m_TransquantBypassEnabledFlag; } bool getTransquantBypassEnabledFlag() const { return m_TransquantBypassEnabledFlag; }
#if !JVET_O1136_TS_BDPCM_SIGNALLING
bool getUseTransformSkip() const { return m_useTransformSkip; } bool getUseTransformSkip() const { return m_useTransformSkip; }
void setUseTransformSkip( bool b ) { m_useTransformSkip = b; } void setUseTransformSkip( bool b ) { m_useTransformSkip = b; }
#endif
void setLoopFilterAcrossBricksEnabledFlag(bool b) { m_loopFilterAcrossBricksEnabledFlag = b; } void setLoopFilterAcrossBricksEnabledFlag(bool b) { m_loopFilterAcrossBricksEnabledFlag = b; }
bool getLoopFilterAcrossBricksEnabledFlag() const { return m_loopFilterAcrossBricksEnabledFlag; } bool getLoopFilterAcrossBricksEnabledFlag() const { return m_loopFilterAcrossBricksEnabledFlag; }
......
...@@ -50,6 +50,8 @@ ...@@ -50,6 +50,8 @@
#include <assert.h> #include <assert.h>
#include <cassert> #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_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 #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 ) ...@@ -4524,9 +4524,17 @@ uint8_t CU::deriveGbiIdx( uint8_t gbiLO, uint8_t gbiL1 )
bool CU::bdpcmAllowed( const CodingUnit& cu, const ComponentID compID ) 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; bool bdpcmAllowed = compID == COMPONENT_Y;
bdpcmAllowed &= CU::isIntra( cu ); 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 ); bdpcmAllowed &= ( cu.lwidth() <= 32 && cu.lheight() <= 32 );
#endif
return bdpcmAllowed; return bdpcmAllowed;
} }
...@@ -4560,11 +4568,20 @@ bool TU::isTSAllowed(const TransformUnit &tu, const ComponentID compID) ...@@ -4560,11 +4568,20 @@ bool TU::isTSAllowed(const TransformUnit &tu, const ComponentID compID)
bool tsAllowed = compID == COMPONENT_Y; bool tsAllowed = compID == COMPONENT_Y;
const int maxSize = tu.cs->pps->getPpsRangeExtension().getLog2MaxTransformSkipBlockSize(); 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(); tsAllowed &= tu.cs->pps->getUseTransformSkip();
#endif
tsAllowed &= !tu.cu->transQuantBypass; tsAllowed &= !tu.cu->transQuantBypass;
tsAllowed &= ( !tu.cu->ispMode || !isLuma(compID) ); 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 ); tsAllowed &= !( tu.cu->bdpcmMode && tu.lwidth() <= BDPCM_MAX_CU_SIZE && tu.lheight() <= BDPCM_MAX_CU_SIZE );
SizeType transformSkipMaxSize = 1 << maxSize; SizeType transformSkipMaxSize = 1 << maxSize;
#endif
tsAllowed &= tu.lwidth() <= transformSkipMaxSize && tu.lheight() <= transformSkipMaxSize; tsAllowed &= tu.lwidth() <= transformSkipMaxSize && tu.lheight() <= transformSkipMaxSize;
tsAllowed &= !tu.cu->sbtInfo; tsAllowed &= !tu.cu->sbtInfo;
...@@ -4580,7 +4597,12 @@ bool TU::isMTSAllowed(const TransformUnit &tu, const ComponentID compID) ...@@ -4580,7 +4597,12 @@ bool TU::isMTSAllowed(const TransformUnit &tu, const ComponentID compID)
mtsAllowed &= ( tu.lwidth() <= maxSize && tu.lheight() <= maxSize ); mtsAllowed &= ( tu.lwidth() <= maxSize && tu.lheight() <= maxSize );
mtsAllowed &= !tu.cu->ispMode; mtsAllowed &= !tu.cu->ispMode;
mtsAllowed &= !tu.cu->sbtInfo; 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 ); mtsAllowed &= !( tu.cu->bdpcmMode && tu.lwidth() <= BDPCM_MAX_CU_SIZE && tu.lheight() <= BDPCM_MAX_CU_SIZE );
#endif
return mtsAllowed; return mtsAllowed;
} }
......
...@@ -1017,6 +1017,9 @@ void CABACReader::bdpcm_mode( CodingUnit& cu, const ComponentID compID ) ...@@ -1017,6 +1017,9 @@ void CABACReader::bdpcm_mode( CodingUnit& cu, const ComponentID compID )
{ {
cu.bdpcmMode = 0; cu.bdpcmMode = 0;
#if JVET_O1136_TS_BDPCM_SIGNALLING
if( !cu.cs->sps->getBDPCMEnabledFlag() ) return;
#endif
if( !CU::bdpcmAllowed( cu, compID ) ) return; if( !CU::bdpcmAllowed( cu, compID ) ) return;
RExt__DECODER_DEBUG_BIT_STATISTICS_CREATE_SET_SIZE2( STATS__CABAC_BITS__BDPCM_MODE, cu.block(compID).lumaSize(), compID ); 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 ...@@ -377,8 +377,10 @@ void HLSyntaxReader::parsePPS( PPS* pcPPS, ParameterSetManager *parameterSetMana
READ_SVLC(iCode, "init_qp_minus26" ); pcPPS->setPicInitQPMinus26(iCode); READ_SVLC(iCode, "init_qp_minus26" ); pcPPS->setPicInitQPMinus26(iCode);
READ_FLAG( uiCode, "constrained_intra_pred_flag" ); pcPPS->setConstrainedIntraPred( uiCode ? true : false ); 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" ); READ_FLAG( uiCode, "transform_skip_enabled_flag" );
pcPPS->setUseTransformSkip ( uiCode ? true : false ); pcPPS->setUseTransformSkip ( uiCode ? true : false );
#endif
READ_FLAG( uiCode, "cu_qp_delta_enabled_flag" ); pcPPS->setUseDQP( uiCode ? true : false ); READ_FLAG( uiCode, "cu_qp_delta_enabled_flag" ); pcPPS->setUseDQP( uiCode ? true : false );
if( pcPPS->getUseDQP() ) if( pcPPS->getUseDQP() )
...@@ -686,7 +688,11 @@ void HLSyntaxReader::parsePPS( PPS* pcPPS, ParameterSetManager *parameterSetMana ...@@ -686,7 +688,11 @@ void HLSyntaxReader::parsePPS( PPS* pcPPS, ParameterSetManager *parameterSetMana
PPSRExt &ppsRangeExtension = pcPPS->getPpsRangeExtension(); PPSRExt &ppsRangeExtension = pcPPS->getPpsRangeExtension();
CHECK(bSkipTrailingExtensionBits, "Invalid state"); CHECK(bSkipTrailingExtensionBits, "Invalid state");
#if JVET_O1136_TS_BDPCM_SIGNALLING
if (parameterSetManager->getSPS(pcPPS->getSPSId())->getTransformSkipEnabledFlag())
#else
if (pcPPS->getUseTransformSkip()) if (pcPPS->getUseTransformSkip())
#endif
{ {
READ_UVLC( uiCode, "log2_max_transform_skip_block_size_minus2"); READ_UVLC( uiCode, "log2_max_transform_skip_block_size_minus2");
ppsRangeExtension.setLog2MaxTransformSkipBlockSize(uiCode+2); ppsRangeExtension.setLog2MaxTransformSkipBlockSize(uiCode+2);
...@@ -1198,6 +1204,14 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS) ...@@ -1198,6 +1204,14 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
READ_FLAG( uiCode, "pcm_loop_filter_disable_flag" ); pcSPS->setPCMFilterDisableFlag ( uiCode ? true : false ); 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() ) if( pcSPS->getCTUSize() + 2*(1 << pcSPS->getLog2MinCodingBlockSize()) <= pcSPS->getPicWidthInLumaSamples() )
{ {
READ_FLAG(uiCode, "sps_ref_wraparound_enabled_flag"); pcSPS->setWrapAroundEnabledFlag( uiCode ? true : false ); READ_FLAG(uiCode, "sps_ref_wraparound_enabled_flag"); pcSPS->setWrapAroundEnabledFlag( uiCode ? true : false );
...@@ -2266,6 +2280,9 @@ void HLSyntaxReader::parseConstraintInfo(ConstraintInfo *cinfo) ...@@ -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_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_ladf_constraint_flag"); cinfo->setNoLadfConstraintFlag(symbol > 0 ? true : false);
READ_FLAG(symbol, "no_transform_skip_constraint_flag"); cinfo->setNoTransformSkipConstraintFlag(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_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_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); 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 ) ...@@ -776,6 +776,9 @@ void CABACWriter::pred_mode( const CodingUnit& cu )
} }
void CABACWriter::bdpcm_mode( const CodingUnit& cu, const ComponentID compID ) 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; if( !CU::bdpcmAllowed( cu, compID ) ) return;
m_BinEncoder.encodeBin( cu.bdpcmMode > 0 ? 1 : 0, Ctx::BDPCMMode( 0 ) ); m_BinEncoder.encodeBin( cu.bdpcmMode > 0 ? 1 : 0, Ctx::BDPCMMode( 0 ) );
......
...@@ -202,6 +202,9 @@ protected: ...@@ -202,6 +202,9 @@ protected:
bool m_bNoTriangleConstraintFlag; bool m_bNoTriangleConstraintFlag;
bool m_bNoLadfConstraintFlag; bool m_bNoLadfConstraintFlag;
bool m_noTransformSkipConstraintFlag; bool m_noTransformSkipConstraintFlag;
#if JVET_O1136_TS_BDPCM_SIGNALLING
bool m_noBDPCMConstraintFlag;
#endif
bool m_bNoQpDeltaConstraintFlag; bool m_bNoQpDeltaConstraintFlag;
bool m_bNoDepQuantConstraintFlag; bool m_bNoDepQuantConstraintFlag;
bool m_bNoSignDataHidingConstraintFlag; bool m_bNoSignDataHidingConstraintFlag;
...@@ -414,6 +417,9 @@ protected: ...@@ -414,6 +417,9 @@ protected:
uint32_t m_log2SaoOffsetScale[MAX_NUM_CHANNEL_TYPE]; uint32_t m_log2SaoOffsetScale[MAX_NUM_CHANNEL_TYPE];
bool m_useTransformSkip; bool m_useTransformSkip;
bool m_useTransformSkipFast; bool m_useTransformSkipFast;
#if JVET_O1136_TS_BDPCM_SIGNALLING
bool m_useBDPCM;
#endif
uint32_t m_log2MaxTransformSkipBlockSize; uint32_t m_log2MaxTransformSkipBlockSize;
bool m_transformSkipRotationEnabledFlag; bool m_transformSkipRotationEnabledFlag;
bool m_transformSkipContextEnabledFlag; bool m_transformSkipContextEnabledFlag;
...@@ -694,6 +700,10 @@ public: ...@@ -694,6 +700,10 @@ public:
void setNoLadfConstraintFlag(bool bVal) { m_bNoLadfConstraintFlag = bVal; } void setNoLadfConstraintFlag(bool bVal) { m_bNoLadfConstraintFlag = bVal; }
bool getNoTransformSkipConstraintFlag() const { return m_noTransformSkipConstraintFlag; } bool getNoTransformSkipConstraintFlag() const { return m_noTransformSkipConstraintFlag; }
void setNoTransformSkipConstraintFlag(bool bVal) { m_noTransformSkipConstraintFlag = bVal; } 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; } bool getNoQpDeltaConstraintFlag() const { return m_bNoQpDeltaConstraintFlag; }
void setNoQpDeltaConstraintFlag(bool bVal) { m_bNoQpDeltaConstraintFlag = bVal; } void setNoQpDeltaConstraintFlag(bool bVal) { m_bNoQpDeltaConstraintFlag = bVal; }
bool getNoDepQuantConstraintFlag() const { return m_bNoDepQuantConstraintFlag; } bool getNoDepQuantConstraintFlag() const { return m_bNoDepQuantConstraintFlag; }
...@@ -1140,6 +1150,10 @@ public: ...@@ -1140,6 +1150,10 @@ public:
void setTransformSkipRotationEnabledFlag (const bool value) { m_transformSkipRotationEnabledFlag = value; } void setTransformSkipRotationEnabledFlag (const bool value) { m_transformSkipRotationEnabledFlag = value; }
bool getTransformSkipContextEnabledFlag () const { return m_transformSkipContextEnabledFlag; } bool getTransformSkipContextEnabledFlag () const { return m_transformSkipContextEnabledFlag; }
void setTransformSkipContextEnabledFlag (const bool value) { m_transformSkipContextEnabledFlag = value; } 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; } bool getPersistentRiceAdaptationEnabledFlag () const { return m_persistentRiceAdaptationEnabledFlag; }
void setPersistentRiceAdaptationEnabledFlag (const bool value) { m_persistentRiceAdaptationEnabledFlag = value; } void setPersistentRiceAdaptationEnabledFlag (const bool value) { m_persistentRiceAdaptationEnabledFlag = value; }
bool getCabacBypassAlignmentEnabledFlag () const { return m_cabacBypassAlignmentEnabledFlag; } bool getCabacBypassAlignmentEnabledFlag () const { return m_cabacBypassAlignmentEnabledFlag; }
......
...@@ -235,11 +235,19 @@ int EncGOP::xWriteSPS (AccessUnit &accessUnit, const SPS *sps) ...@@ -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) int EncGOP::xWritePPS (AccessUnit &accessUnit, const PPS *pps)
#endif
{ {
OutputNALUnit nalu(NAL_UNIT_PPS); OutputNALUnit nalu(NAL_UNIT_PPS);
m_HLSWriter->setBitstream( &nalu.m_Bitstream ); m_HLSWriter->setBitstream( &nalu.m_Bitstream );
#if JVET_O1136_TS_BDPCM_SIGNALLING
m_HLSWriter->codePPS( pps, sps );
#else
m_HLSWriter->codePPS( pps ); m_HLSWriter->codePPS( pps );
#endif
accessUnit.push_back(new NALUnitEBSP(nalu)); accessUnit.push_back(new NALUnitEBSP(nalu));
return (int)(accessUnit.back()->m_nalUnitData.str().size()) * 8; return (int)(accessUnit.back()->m_nalUnitData.str().size()) * 8;
} }
...@@ -273,7 +281,11 @@ int EncGOP::xWriteParameterSets (AccessUnit &accessUnit, Slice *slice, const boo ...@@ -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 (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()); actualTotalBits += xWritePPS(accessUnit, slice->getPPS());
#endif
} }