Commit 33accf97 authored by Karsten Suehring's avatar Karsten Suehring

remove SPS parameters for TU size signalling

keep max TU in #define for possibility of keeping the parameter

TU max/min size are constants in the VVC draft. Reflecting this in the software.
parent 48a2a95b
......@@ -9,11 +9,6 @@ Profile : next
MaxCUWidth : 64 # Maximum coding unit width in pixel
MaxCUHeight : 64 # Maximum coding unit height in pixel
MaxPartitionDepth : 4 # Maximum coding unit depth
# obsoleted by TULog2MaxSize
#QuadtreeTULog2MinSize : 2 # Log2 of minimum transform size for
# # quadtree-based TU coding (2...6)
QuadtreeTUMaxDepthInter : 3
QuadtreeTUMaxDepthIntra : 3
#======== Coding Structure =============
IntraPeriod : 1 # Period of I-Frame ( -1 = only first)
......@@ -89,7 +84,6 @@ TemporalSubsampleRatio : 8
# General
CTUSize : 128
LCTUFast : 1
QuadtreeTULog2MaxSize : 6
DualITree : 1 # separate partitioning of luma and chroma channels for I-slices
MinQTLumaISlice : 8
......
......@@ -9,11 +9,6 @@ Profile : next
MaxCUWidth : 64 # Maximum coding unit width in pixel
MaxCUHeight : 64 # Maximum coding unit height in pixel
MaxPartitionDepth : 4 # Maximum coding unit depth
# obsoleted by TULog2MaxSize
#QuadtreeTULog2MinSize : 2 # Log2 of minimum transform size for
# # quadtree-based TU coding (2...6)
QuadtreeTUMaxDepthInter : 3
QuadtreeTUMaxDepthIntra : 3
#======== Coding Structure =============
IntraPeriod : -1 # Period of I-Frame ( -1 = only first)
......@@ -105,7 +100,6 @@ CrQpOffset : 1
# General
CTUSize : 128
LCTUFast : 1
QuadtreeTULog2MaxSize : 6
DualITree : 1 # separate partitioning of luma and chroma channels for I-slices
MinQTLumaISlice : 8
......
......@@ -9,11 +9,6 @@ Profile : next
MaxCUWidth : 64 # Maximum coding unit width in pixel
MaxCUHeight : 64 # Maximum coding unit height in pixel
MaxPartitionDepth : 4 # Maximum coding unit depth
# obsoleted by TULog2MaxSize
#QuadtreeTULog2MinSize : 2 # Log2 of minimum transform size for
# # quadtree-based TU coding (2...6)
QuadtreeTUMaxDepthInter : 3
QuadtreeTUMaxDepthIntra : 3
#======== Coding Structure =============
IntraPeriod : -1 # Period of I-Frame ( -1 = only first)
......@@ -105,7 +100,6 @@ CrQpOffset : 1
# General
CTUSize : 128
LCTUFast : 1
QuadtreeTULog2MaxSize : 6
DualITree : 1 # separate partitioning of luma and chroma channels for I-slices
MinQTLumaISlice : 8
......
......@@ -9,11 +9,6 @@ Profile : next
MaxCUWidth : 64 # Maximum coding unit width in pixel
MaxCUHeight : 64 # Maximum coding unit height in pixel
MaxPartitionDepth : 4 # Maximum coding unit depth
# obsoleted by TULog2MaxSize
#QuadtreeTULog2MinSize : 2 # Log2 of minimum transform size for
# # quadtree-based TU coding (2...6)
QuadtreeTUMaxDepthInter : 3
QuadtreeTUMaxDepthIntra : 3
#======== Coding Structure =============
IntraPeriod : 32 # Period of I-Frame ( -1 = only first)
......@@ -119,7 +114,6 @@ CrQpOffset : 1
# General
CTUSize : 128
LCTUFast : 1
QuadtreeTULog2MaxSize : 6
DualITree : 1 # separate partitioning of luma and chroma channels for I-slices
MinQTLumaISlice : 8
......
......@@ -293,10 +293,9 @@ void EncApp::xInitLibCfg()
m_cEncLib.setMaxCUHeight ( m_uiCTUSize );
m_cEncLib.setMaxCodingDepth ( m_uiMaxCodingDepth );
m_cEncLib.setLog2DiffMaxMinCodingBlockSize ( m_uiLog2DiffMaxMinCodingBlockSize );
m_cEncLib.setQuadtreeTULog2MaxSize ( m_quadtreeTULog2MaxSize );
m_cEncLib.setQuadtreeTULog2MinSize ( m_quadtreeTULog2MinSize );
m_cEncLib.setQuadtreeTUMaxDepthInter ( m_uiQuadtreeTUMaxDepthInter );
m_cEncLib.setQuadtreeTUMaxDepthIntra ( m_uiQuadtreeTUMaxDepthIntra );
#if MAX_TB_SIZE_SIGNALLING
m_cEncLib.setLog2MaxTbSize ( m_log2MaxTbSize );
#endif
#if JVET_M0428_ENC_DB_OPT
m_cEncLib.setUseEncDbOpt(m_encDbOpt);
#endif
......
......@@ -913,14 +913,9 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
("MaxCUSize,s", m_uiMaxCUHeight, 64u, "Maximum CU size")
("MaxPartitionDepth,h", m_uiMaxCUDepth, 4u, "CU depth")
("QuadtreeTULog2MaxSize", m_quadtreeTULog2MaxSize, -1, "Maximum TU size in logarithm base 2")
("QuadtreeTULog2MinSize", m_quadtreeTULog2MinSize, 2, "Minimum TU size in logarithm base 2")
("QuadtreeTUMaxDepthIntra", m_uiQuadtreeTUMaxDepthIntra, 1u, "Depth of TU tree for intra CUs")
("QuadtreeTUMaxDepthInter", m_uiQuadtreeTUMaxDepthInter, 2u, "Depth of TU tree for inter CUs")
("TULog2MaxSize", m_tuLog2MaxSize, -1, "Maximum TU size in logarithm base 2 (for use with NEXT-Profile)")
#if MAX_TB_SIZE_SIGNALLING
("Log2MaxTbSize", m_log2MaxTbSize, 6, "Maximum transform block size in logarithm base 2 (Default: 6)")
#endif
// Coding structure paramters
("IntraPeriod,-ip", m_iIntraPeriod, -1, "Intra period in frames, (-1: only first frame)")
......@@ -1898,7 +1893,11 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
#else
if (((int)m_fQP < 38) && m_bUsePerceptQPA && !m_bUseAdaptiveQP && (m_iSourceWidth <= 2048) && (m_iSourceHeight <= 1280)
#endif
&& ((1 << (std::max (m_quadtreeTULog2MaxSize, m_tuLog2MaxSize) + 1)) == m_uiCTUSize) && (m_iSourceWidth > 512 || m_iSourceHeight > 320))
#if MAX_TB_SIZE_SIGNALLING
&& ((1 << (m_log2MaxTbSize + 1)) == m_uiCTUSize) && (m_iSourceWidth > 512 || m_iSourceHeight > 320))
#else
&& ((1 << (MAX_TB_LOG2_SIZEY + 1)) == m_uiCTUSize) && (m_iSourceWidth > 512 || m_iSourceHeight > 320))
#endif
{
m_iMaxCuDQPDepth = 1;
}
......@@ -1914,8 +1913,9 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
msg( WARNING, "*************************************************************************\n" );
m_uiCTUSize = m_uiMaxCUWidth;
if( ( 1u << m_quadtreeTULog2MaxSize ) > m_uiCTUSize ) m_quadtreeTULog2MaxSize--;
if( ( 1u << m_tuLog2MaxSize ) > m_uiCTUSize ) m_tuLog2MaxSize--;
#if MAX_TB_SIZE_SIGNALLING
if( ( 1u << m_log2MaxTbSize ) > m_uiCTUSize ) m_log2MaxTbSize--;
#endif
}
#endif
#endif // ENABLE_QPA
......@@ -2229,12 +2229,6 @@ bool EncAppCfg::xCheckParameter()
}
#endif
xConfirmPara( m_quadtreeTULog2MaxSize * m_tuLog2MaxSize >= 0, "Setting of TULog2MaxSize and QuadtreeTULog2MaxSize is mutually exclusive - use only one of the parameters" );
if( m_quadtreeTULog2MaxSize < 0 ) m_quadtreeTULog2MaxSize = m_tuLog2MaxSize;
xConfirmPara( m_quadtreeTULog2MaxSize < 0, "Maximal TU size is invalid" );
if( m_SubPuMvpMode == 3 && m_maxNumMergeCand < 7 )
{
msg( WARNING, "****************************************************************************\n" );
......@@ -2327,26 +2321,9 @@ bool EncAppCfg::xCheckParameter()
xConfirmPara( (m_iSourceWidth % (m_uiMaxCUWidth >> (m_uiMaxCUDepth-1)))!=0, "Resulting coded frame width must be a multiple of the minimum CU size");
xConfirmPara( (m_iSourceHeight % (m_uiMaxCUHeight >> (m_uiMaxCUDepth-1)))!=0, "Resulting coded frame height must be a multiple of the minimum CU size");
xConfirmPara( m_quadtreeTULog2MinSize < 2, "QuadtreeTULog2MinSize must be 2 or greater." );
if( m_profile == Profile::NEXT )
{
xConfirmPara( m_quadtreeTULog2MaxSize > 7, "QuadtreeTULog2MaxSize must be 7 or smaller." );
}
else
{
xConfirmPara( m_quadtreeTULog2MaxSize > 5, "QuadtreeTULog2MaxSize must be 5 or smaller." );
}
xConfirmPara( m_quadtreeTULog2MaxSize < m_quadtreeTULog2MinSize, "QuadtreeTULog2MaxSize must be greater than or equal to m_uiQuadtreeTULog2MinSize.");
xConfirmPara( (1<<m_quadtreeTULog2MaxSize) > m_uiMaxCUWidth, "QuadtreeTULog2MaxSize must be log2(maxCUSize) or smaller.");
xConfirmPara( ( 1 << m_quadtreeTULog2MinSize ) >= ( m_uiMaxCUWidth >> (m_uiMaxCUDepth-1)), "QuadtreeTULog2MinSize must not be greater than or equal to minimum CU size" );
xConfirmPara( ( 1 << m_quadtreeTULog2MinSize ) >= ( m_uiMaxCUHeight >> (m_uiMaxCUDepth-1)), "QuadtreeTULog2MinSize must not be greater than or equal to minimum CU size" );
xConfirmPara( m_uiQuadtreeTUMaxDepthInter < 1, "QuadtreeTUMaxDepthInter must be greater than or equal to 1" );
xConfirmPara( m_uiMaxCUWidth < ( 1 << (m_quadtreeTULog2MinSize + m_uiQuadtreeTUMaxDepthInter - 1) ), "QuadtreeTUMaxDepthInter must be less than or equal to the difference between log2(maxCUSize) and QuadtreeTULog2MinSize plus 1" );
xConfirmPara( m_uiQuadtreeTUMaxDepthIntra < 1, "QuadtreeTUMaxDepthIntra must be greater than or equal to 1" );
xConfirmPara( m_uiMaxCUWidth < ( 1 << (m_quadtreeTULog2MinSize + m_uiQuadtreeTUMaxDepthIntra - 1) ), "QuadtreeTUMaxDepthInter must be less than or equal to the difference between log2(maxCUSize) and QuadtreeTULog2MinSize plus 1" );
#if MAX_TB_SIZE_SIGNALLING
xConfirmPara( m_log2MaxTbSize > 6, "Log2MaxTbSize must be 6 or smaller." );
#endif
xConfirmPara( m_maxNumMergeCand < 1, "MaxNumMergeCand must be 1 or greater.");
xConfirmPara( m_maxNumMergeCand > MRG_MAX_NUM_CANDS, "MaxNumMergeCand must be no more than MRG_MAX_NUM_CANDS." );
......@@ -3060,9 +3037,9 @@ void EncAppCfg::xPrintParameter()
msg( DETAILS, "Profile : %s\n", profileToString(m_profile) );
}
msg( DETAILS, "CU size / depth / total-depth : %d / %d / %d\n", m_uiMaxCUWidth, m_uiMaxCUDepth, m_uiMaxCodingDepth );
msg( DETAILS, "RQT trans. size (min / max) : %d / %d\n", 1 << m_quadtreeTULog2MinSize, 1 << m_quadtreeTULog2MaxSize );
msg( DETAILS, "Max RQT depth inter : %d\n", m_uiQuadtreeTUMaxDepthInter);
msg( DETAILS, "Max RQT depth intra : %d\n", m_uiQuadtreeTUMaxDepthIntra);
#if MAX_TB_SIZE_SIGNALLING
msg( DETAILS, "Max TB size : %d \n", 1 << m_log2MaxTbSize );
#endif
msg( DETAILS, "Min PCM size : %d\n", 1 << m_uiPCMLog2MinSize);
msg( DETAILS, "Motion search range : %d\n", m_iSearchRange );
msg( DETAILS, "Intra period : %d\n", m_iIntraPeriod );
......
......@@ -300,14 +300,9 @@ protected:
int m_numWppExtraLines;
bool m_ensureWppBitEqual;
// transfom unit (TU) definition
int m_quadtreeTULog2MaxSize;
int m_quadtreeTULog2MinSize;
int m_tuLog2MaxSize;
uint32_t m_uiQuadtreeTUMaxDepthInter;
uint32_t m_uiQuadtreeTUMaxDepthIntra;
#if MAX_TB_SIZE_SIGNALLING
int m_log2MaxTbSize;
#endif
// coding tools (bit-depth)
int m_inputBitDepth [MAX_NUM_CHANNEL_TYPE]; ///< bit-depth of input file
int m_outputBitDepth [MAX_NUM_CHANNEL_TYPE]; ///< bit-depth of output file
......
......@@ -153,6 +153,12 @@ static const int MAX_TLAYER = 7; ///< Expl
static const int ADAPT_SR_SCALE = 1; ///< division factor for adaptive search range
static const int MIN_TB_LOG2_SIZEY = 2;
static const int MAX_TB_LOG2_SIZEY = 6;
static const int MIN_TB_SIZEY = 1 << MIN_TB_LOG2_SIZEY;
static const int MAX_TB_SIZEY = 1 << MAX_TB_LOG2_SIZEY;
static const int MAX_NUM_PICS_IN_SOP = 1024;
static const int MAX_NESTING_NUM_OPS = 1024;
......
......@@ -369,8 +369,11 @@ void LoopFilter::xDeblockCU( CodingUnit& cu, const DeblockEdgeDir edgeDir )
unsigned int orthogonalLength = 1;
unsigned int orthogonalIncrement = 1;
#if FIX_DB_MAX_TRANSFORM_SIZE
int maxTsize = 64;
maxTsize = 1 << cu.slice->getSPS()->getQuadtreeTULog2MaxSize();
#if MAX_TB_SIZE_SIGNALLING
const int maxTsize = cu.slice->getSPS()->getMaxTbSize();
#else
const int maxTsize = MAX_TB_SIZEY;
#endif
#endif
#if JVET_M0471_LONG_DEBLOCKING_FILTERS
#if FIX_DB_MAX_TRANSFORM_SIZE
......
......@@ -1951,10 +1951,6 @@ SPS::SPS()
, m_uiMaxCUHeight ( 32)
, m_uiMaxCodingDepth ( 3)
, m_bLongTermRefsPresent (false)
, m_uiQuadtreeTULog2MaxSize ( 0)
, m_uiQuadtreeTULog2MinSize ( 0)
, m_uiQuadtreeTUMaxDepthInter ( 0)
, m_uiQuadtreeTUMaxDepthIntra ( 0)
// Tool list
, m_pcmEnabledFlag (false)
, m_pcmLog2MaxSize ( 5)
......@@ -1967,7 +1963,9 @@ SPS::SPS()
#endif
, m_uiBitsForPOC ( 8)
, m_numLongTermRefPicSPS ( 0)
, m_uiMaxTrSize ( 32)
#if MAX_TB_SIZE_SIGNALLING
, m_log2MaxTbSize ( 6)
#endif
, m_saoEnabledFlag (false)
, m_bTemporalIdNestingFlag (false)
#if HEVC_USE_SCALING_LISTS
......
......@@ -902,10 +902,6 @@ private:
int m_numReorderPics[MAX_TLAYER];
// Tool list
uint32_t m_uiQuadtreeTULog2MaxSize;
uint32_t m_uiQuadtreeTULog2MinSize;
uint32_t m_uiQuadtreeTUMaxDepthInter;
uint32_t m_uiQuadtreeTUMaxDepthIntra;
bool m_pcmEnabledFlag;
uint32_t m_pcmLog2MaxSize;
uint32_t m_uiPCMLog2MinSize;
......@@ -925,8 +921,9 @@ private:
uint32_t m_numLongTermRefPicSPS;
uint32_t m_ltRefPicPocLsbSps[MAX_NUM_LONG_TERM_REF_PICS];
bool m_usedByCurrPicLtSPSFlag[MAX_NUM_LONG_TERM_REF_PICS];
// Max physical transform size
uint32_t m_uiMaxTrSize;
#if MAX_TB_SIZE_SIGNALLING
uint32_t m_log2MaxTbSize;
#endif
bool m_saoEnabledFlag;
......@@ -1138,14 +1135,6 @@ public:
uint32_t getPCMLog2MinSize() const { return m_uiPCMLog2MinSize; }
void setBitsForPOC( uint32_t u ) { m_uiBitsForPOC = u; }
uint32_t getBitsForPOC() const { return m_uiBitsForPOC; }
void setQuadtreeTULog2MaxSize( uint32_t u ) { m_uiQuadtreeTULog2MaxSize = u; }
uint32_t getQuadtreeTULog2MaxSize() const { return m_uiQuadtreeTULog2MaxSize; }
void setQuadtreeTULog2MinSize( uint32_t u ) { m_uiQuadtreeTULog2MinSize = u; }
uint32_t getQuadtreeTULog2MinSize() const { return m_uiQuadtreeTULog2MinSize; }
void setQuadtreeTUMaxDepthInter( uint32_t u ) { m_uiQuadtreeTUMaxDepthInter = u; }
void setQuadtreeTUMaxDepthIntra( uint32_t u ) { m_uiQuadtreeTUMaxDepthIntra = u; }
uint32_t getQuadtreeTUMaxDepthInter() const { return m_uiQuadtreeTUMaxDepthInter; }
uint32_t getQuadtreeTUMaxDepthIntra() const { return m_uiQuadtreeTUMaxDepthIntra; }
void setNumReorderPics(int i, uint32_t tlayer) { m_numReorderPics[tlayer] = i; }
int getNumReorderPics(uint32_t tlayer) const { return m_numReorderPics[tlayer]; }
void createRPSList( int numRPS );
......@@ -1155,10 +1144,11 @@ public:
void setLongTermRefsPresent(bool b) { m_bLongTermRefsPresent=b; }
bool getSPSTemporalMVPEnabledFlag() const { return m_SPSTemporalMVPEnabledFlag; }
void setSPSTemporalMVPEnabledFlag(bool b) { m_SPSTemporalMVPEnabledFlag=b; }
// physical transform
void setMaxTrSize( uint32_t u ) { m_uiMaxTrSize = u; }
uint32_t getMaxTrSize() const { return m_uiMaxTrSize; }
#if MAX_TB_SIZE_SIGNALLING
void setLog2MaxTbSize( uint32_t u ) { m_log2MaxTbSize = u; }
uint32_t getLog2MaxTbSize() const { return m_log2MaxTbSize; }
uint32_t getMaxTbSize() const { return 1 << m_log2MaxTbSize; }
#endif
// Bit-depth
int getBitDepth(ChannelType type) const { return m_bitDepths.recon[type]; }
void setBitDepth(ChannelType type, int u ) { m_bitDepths.recon[type] = u; }
......
......@@ -182,8 +182,11 @@ void TrQuant::invTransformNxN( TransformUnit &tu, const ComponentID &compID, Pel
const uint32_t uiWidth = area.width;
const uint32_t uiHeight = area.height;
CHECK( uiWidth > tu.cs->sps->getMaxTrSize() || uiHeight > tu.cs->sps->getMaxTrSize(), "Maximal allowed transformation size exceeded!" );
#if MAX_TB_SIZE_SIGNALLING
CHECK( uiWidth > tu.cs->sps->getMaxTbSize() || uiHeight > tu.cs->sps->getMaxTbSize(), "Maximal allowed transformation size exceeded!" );
#else
CHECK( uiWidth > MAX_TB_SIZEY || uiHeight > MAX_TB_SIZEY, "Maximal allowed transformation size exceeded!" );
#endif
if (tu.cu->transQuantBypass)
{
// where should this logic go?
......@@ -633,14 +636,17 @@ void TrQuant::transformNxN(TransformUnit &tu, const ComponentID &compID, const Q
#endif
{
CodingStructure &cs = *tu.cs;
const SPS &sps = *cs.sps;
const CompArea &rect = tu.blocks[compID];
const uint32_t width = rect.width;
const uint32_t height = rect.height;
const CPelBuf resiBuf = cs.getResiBuf(rect);
CHECK( sps.getMaxTrSize() < width, "Unsupported transformation size" );
#if MAX_TB_SIZE_SIGNALLING
CHECK( cs.sps->getMaxTbSize() < width, "Unsupported transformation size" );
#else
CHECK( MAX_TB_SIZEY < width, "Unsupported transformation size" );
#endif
int pos = 0;
std::vector<TrCost> trCosts;
......@@ -723,7 +729,6 @@ void TrQuant::transformNxN(TransformUnit &tu, const ComponentID &compID, const Q
#endif
{
CodingStructure &cs = *tu.cs;
const SPS &sps = *cs.sps;
const CompArea &rect = tu.blocks[compID];
const uint32_t uiWidth = rect.width;
const uint32_t uiHeight = rect.height;
......@@ -773,7 +778,12 @@ void TrQuant::transformNxN(TransformUnit &tu, const ComponentID &compID, const Q
}
else
{
CHECK( sps.getMaxTrSize() < uiWidth, "Unsupported transformation size" );
#if MAX_TB_SIZE_SIGNALLING
CHECK( cs.sps->getMaxTbSize() < uiWidth, "Unsupported transformation size" );
#else
CHECK( MAX_TB_SIZEY < uiWidth, "Unsupported transformation size" );
#endif
#if JVET_M0464_UNI_MTS
CoeffBuf tempCoeff( loadTr ? m_mtsCoeffs[tu.mtsIdx] : m_plTempCoeff, rect );
......
......@@ -153,6 +153,8 @@
#define FIX_PCM 1 // Fix PCM bugs in VTM3
#endif
#define MAX_TB_SIZE_SIGNALLING 0
#if JVET_M0464_UNI_MTS
typedef std::pair<int, bool> TrMode;
typedef std::pair<int, int> TrCost;
......
......@@ -395,7 +395,11 @@ bool QTBTPartitioner::canSplit( const PartSplit split, const CodingStructure &cs
{
#if JVET_M0421_SPLIT_SIG
const CompArea area = currArea().Y();
const unsigned maxTrSize = cs.sps->getMaxTrSize();
#if MAX_TB_SIZE_SIGNALLING
const unsigned maxTrSize = cs.sps->getMaxTbSize();
#else
const unsigned maxTrSize = MAX_TB_SIZEY;
#endif
bool canNo, canQt, canBh, canTh, canBv, canTv;
......@@ -411,7 +415,11 @@ bool QTBTPartitioner::canSplit( const PartSplit split, const CodingStructure &cs
const unsigned minBtSize = cs.pcv->getMinBtSize( *cs.slice, chType );
const unsigned maxTtSize = cs.pcv->getMaxTtSize( *cs.slice, chType );
const unsigned minTtSize = cs.pcv->getMinTtSize( *cs.slice, chType );
const unsigned maxTrSize = cs.sps->getMaxTrSize();
#if MAX_TB_SIZE_SIGNALLING
const unsigned maxTrSize = cs.sps->getMaxTbSize();
#else
const unsigned maxTrSize = MAX_TB_SIZEY;
#endif
const PartSplit lastSplit = m_partStack.back().split;
const PartSplit parlSplit = lastSplit == CU_TRIH_SPLIT ? CU_HORZ_SPLIT : CU_VERT_SPLIT;
......@@ -1107,7 +1115,11 @@ Partitioning PartitionerImpl::getMaxTuTiling( const UnitArea &cuArea, const Codi
static_assert( MAX_LOG2_DIFF_CU_TR_SIZE <= g_maxRtGridSize, "Z-scan tables are only provided for MAX_LOG2_DIFF_CU_TR_SIZE for up to 3 (8x8 tiling)!" );
const CompArea area = cuArea.Y().valid() ? cuArea.Y() : cuArea.Cb();
const int maxTrSize = cs.sps->getMaxTrSize() >> ( isLuma( area.compID ) ? 0 : 1 );
#if MAX_TB_SIZE_SIGNALLING
const int maxTrSize = cs.sps->getMaxTbSize() >> ( isLuma( area.compID ) ? 0 : 1 );
#else
const int maxTrSize = MAX_TB_SIZEY >> ( isLuma( area.compID ) ? 0 : 1 );
#endif
const int numTilesH = std::max<int>( 1, area.width / maxTrSize );
const int numTilesV = std::max<int>( 1, area.height / maxTrSize );
const int numTiles = numTilesH * numTilesV;
......
......@@ -392,7 +392,11 @@ ISPType CU::canUseISPSplit( const CodingUnit &cu, const ComponentID compID )
{
const int width = cu.blocks[compID].width;
const int height = cu.blocks[compID].height;
const int maxTrSize = cu.cs->sps->getMaxTrSize();
#if MAX_TB_SIZE_SIGNALLING
const int maxTrSize = cu.cs->sps->getMaxTbSize();
#else
const int maxTrSize = MAX_TB_SIZEY;
#endif
return CU::canUseISPSplit( width, height, maxTrSize );
}
......
......@@ -840,7 +840,11 @@ void DecLib::xActivateParameterSets()
m_cCuDecoder.initDecCuReshaper(&m_cReshaper, sps->getChromaFormatIdc());
}
#endif
m_cTrQuant.init( nullptr, sps->getMaxTrSize(), false, false, false, false, false );
#if MAX_TB_SIZE_SIGNALLING
m_cTrQuant.init( nullptr, sps->getMaxTbSize(), false, false, false, false, false );
#else
m_cTrQuant.init( nullptr, MAX_TB_SIZEY, false, false, false, false, false );
#endif
// RdCost
m_cRdCost.setCostMode ( COST_STANDARD_LOSSY ); // not used in decoder side RdCost stuff -> set to default
......
......@@ -1000,11 +1000,10 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
CHECK(log2MinCUSize + pcSPS->getLog2DiffMaxMinCodingBlockSize() < 5, "Invalid code");
}
// KJS: does not exist anymore -> remove!
READ_UVLC( uiCode, "log2_min_luma_transform_block_size_minus2" ); pcSPS->setQuadtreeTULog2MinSize( uiCode + 2 );
READ_UVLC( uiCode, "log2_diff_max_min_luma_transform_block_size" ); pcSPS->setQuadtreeTULog2MaxSize( uiCode + pcSPS->getQuadtreeTULog2MinSize() );
pcSPS->setMaxTrSize( 1<<(uiCode + pcSPS->getQuadtreeTULog2MinSize()) );
#if MAX_TB_SIZE_SIGNALLING
// KJS: Not in syntax
READ_UVLC( uiCode, "log2_max_luma_transform_block_size_minus2" ); pcSPS->setLog2MaxTbSize( uiCode + 2 );
#endif
READ_FLAG( uiCode, "sps_sao_enabled_flag" ); pcSPS->setSAOEnabledFlag ( uiCode ? true : false );
READ_FLAG( uiCode, "sps_alf_enabled_flag" ); pcSPS->setALFEnabledFlag ( uiCode ? true : false );
......
......@@ -299,11 +299,9 @@ protected:
bool m_e0023FastEnc;
bool m_contentBasedFastQtbt;
//======= Transform =============
uint32_t m_uiQuadtreeTULog2MaxSize;
uint32_t m_uiQuadtreeTULog2MinSize;
uint32_t m_uiQuadtreeTUMaxDepthInter;
uint32_t m_uiQuadtreeTUMaxDepthIntra;
#if MAX_TB_SIZE_SIGNALLING
uint32_t m_log2MaxTbSize;
#endif
//====== Loop/Deblock Filter ========
bool m_bLoopFilterDisable;
......@@ -899,11 +897,9 @@ public:
void setUseContentBasedFastQtbt ( bool b ) { m_contentBasedFastQtbt = b; }
bool getUseContentBasedFastQtbt () const { return m_contentBasedFastQtbt; }
//======== Transform =============
void setQuadtreeTULog2MaxSize ( uint32_t u ) { m_uiQuadtreeTULog2MaxSize = u; }
void setQuadtreeTULog2MinSize ( uint32_t u ) { m_uiQuadtreeTULog2MinSize = u; }
void setQuadtreeTUMaxDepthInter ( uint32_t u ) { m_uiQuadtreeTUMaxDepthInter = u; }
void setQuadtreeTUMaxDepthIntra ( uint32_t u ) { m_uiQuadtreeTUMaxDepthIntra = u; }
#if MAX_TB_SIZE_SIGNALLING
void setLog2MaxTbSize ( uint32_t u ) { m_log2MaxTbSize = u; }
#endif
//====== Loop/Deblock Filter ========
void setLoopFilterDisable ( bool b ) { m_bLoopFilterDisable = b; }
......@@ -1012,12 +1008,6 @@ public:
bool getAccessUnitDelimiter() const { return m_AccessUnitDelimiter; }
void setAccessUnitDelimiter(bool val){ m_AccessUnitDelimiter = val; }
//======== Transform =============
uint32_t getQuadtreeTULog2MaxSize () const { return m_uiQuadtreeTULog2MaxSize; }
uint32_t getQuadtreeTULog2MinSize () const { return m_uiQuadtreeTULog2MinSize; }
uint32_t getQuadtreeTUMaxDepthInter () const { return m_uiQuadtreeTUMaxDepthInter; }
uint32_t getQuadtreeTUMaxDepthIntra () const { return m_uiQuadtreeTUMaxDepthIntra; }
//==== Loop/Deblock Filter ========
bool getLoopFilterDisable () { return m_bLoopFilterDisable; }
bool getLoopFilterOffsetInPPS () { return m_loopFilterOffsetInPPS; }
......
......@@ -2184,7 +2184,11 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic,
if (pcSlice->getPPS()->getUseDQP() && pcSlice->getPPS()->getMaxCuDQPDepth() > 0)
{
const PreCalcValues &pcv = *pcPic->cs->pcv;
const unsigned mtsLog2 = (unsigned)g_aucLog2[std::min (pcPic->cs->sps->getMaxTrSize(), pcv.maxCUWidth)];
#if MAX_TB_SIZE_SIGNALLING
const unsigned mtsLog2 = (unsigned)g_aucLog2[std::min (pcPic->cs->sps->getMaxTbSize(), pcv.maxCUWidth)];
#else
const unsigned mtsLog2 = (unsigned)g_aucLog2[std::min<uint32_t> (MAX_TB_SIZEY, pcv.maxCUWidth)];
#endif
pcPic->m_subCtuQP.resize ((pcv.maxCUWidth >> mtsLog2) * (pcv.maxCUHeight >> mtsLog2));
}
#endif
......@@ -4049,8 +4053,12 @@ void EncGOP::applyDeblockingFilterMetric( Picture* pcPic, uint32_t uiNumSlices )
Pel* tempRec = Rec;
const Slice* pcSlice = pcPic->slices[0];
uint32_t log2maxTB = pcSlice->getSPS()->getQuadtreeTULog2MaxSize();
uint32_t maxTBsize = (1<<log2maxTB);
#if MAX_TB_SIZE_SIGNALLING
const uint32_t log2maxTB = pcSlice->getSPS()->getLog2MaxTbSize();
#else
const uint32_t log2maxTB = MAX_TB_LOG2_SIZEY;
#endif
const uint32_t maxTBsize = (1<<log2maxTB);
const uint32_t minBlockArtSize = 8;
const uint32_t noCol = (picWidth>>log2maxTB);
const uint32_t noRows = (picHeight>>log2maxTB);
......
......@@ -284,7 +284,12 @@ void EncLib::init( bool isFieldCoding, AUWriterIf* auWriterIf )
// initialize transform & quantization class
m_cTrQuant[jId].init( jId == 0 ? nullptr : m_cTrQuant[0].getQuant(),
1 << m_uiQuadtreeTULog2MaxSize,
#if MAX_TB_SIZE_SIGNALLING
1 << m_log2MaxTbSize,
#else
MAX_TB_SIZEY,
#endif
m_useRDOQ,
m_useRDOQTS,
#if T0196_SELECTIVE_RDOQ
......@@ -316,7 +321,11 @@ void EncLib::init( bool isFieldCoding, AUWriterIf* auWriterIf )
// initialize transform & quantization class
m_cTrQuant.init( nullptr,
1 << m_uiQuadtreeTULog2MaxSize,
#if MAX_TB_SIZE_SIGNALLING
1 << m_log2MaxTbSize,
#else
MAX_TB_SIZEY,
#endif
m_useRDOQ,
m_useRDOQTS,
#if T0196_SELECTIVE_RDOQ
......@@ -982,14 +991,11 @@ void EncLib::xInitSPS(SPS &sps)
sps.setPCMEnabledFlag ( m_usePCM );
sps.setPCMLog2MaxSize( m_pcmLog2MaxSize );
sps.setQuadtreeTULog2MaxSize( m_uiQuadtreeTULog2MaxSize );
sps.setQuadtreeTULog2MinSize( m_uiQuadtreeTULog2MinSize );
sps.setQuadtreeTUMaxDepthInter( m_uiQuadtreeTUMaxDepthInter );
sps.setQuadtreeTUMaxDepthIntra( m_uiQuadtreeTUMaxDepthIntra );
sps.setSPSTemporalMVPEnabledFlag((getTMVPModeId() == 2 || getTMVPModeId() == 1));
sps.setMaxTrSize ( 1 << m_uiQuadtreeTULog2MaxSize );
#if MAX_TB_SIZE_SIGNALLING
sps.setLog2MaxTbSize ( m_log2MaxTbSize );
#endif
for (uint32_t channelType = 0; channelType < MAX_NUM_CHANNEL_TYPE; channelType++)
{
......
......@@ -1167,7 +1167,11 @@ void EncModeCtrlMTnoRQT::initCULevel( Partitioner &partitioner, const CodingStru
if ((partitioner.currArea().lwidth() < pcv.maxCUWidth) && (partitioner.currArea().lheight() < pcv.maxCUHeight) && cs.picture)
{
const Position &pos = getMaxLumaDQPDepthPos (cs, partitioner);
const unsigned mtsLog2 = (unsigned)g_aucLog2[std::min (cs.sps->getMaxTrSize(), pcv.maxCUWidth)];
#if MAX_TB_SIZE_SIGNALLING
const unsigned mtsLog2 = (unsigned)g_aucLog2[std::min (cs.sps->getMaxTbSize(), pcv.maxCUWidth)];
#else
const unsigned mtsLog2 = (unsigned)g_aucLog2[std::min<uint32_t> (MAX_TB_SIZEY, pcv.maxCUWidth)];
#endif
const unsigned stride = pcv.maxCUWidth >> mtsLog2;
baseQP = cs.picture->m_subCtuQP[((pos.x & pcv.maxCUWidthMask) >> mtsLog2) + stride * ((pos.y & pcv.maxCUHeightMask) >> mtsLog2)];
......
......@@ -1099,7 +1099,11 @@ static int applyQPAdaptationSubCtu (CodingStructure &cs, const UnitArea ctuArea,
#if SHARP_LUMA_DELTA_QP
const int lumaCtuDQP = useSharpLumaDQP ? lumaDQPOffset ((uint32_t)pcPic->m_uEnerHpCtu[ctuAddr], bitDepth) : 0;
#endif
const unsigned mts = std::min (cs.sps->getMaxTrSize(), pcv.maxCUWidth);
#if MAX_TB_SIZE_SIGNALLING
const unsigned mts = std::min (cs.sps->getMaxTbSize(), pcv.maxCUWidth);
#else
const unsigned mts = std::min<uint32_t> (MAX_TB_SIZEY, pcv.maxCUWidth);
#endif
const unsigned mtsLog2 = (unsigned)g_aucLog2[mts];
const unsigned stride = pcv.maxCUWidth >> mtsLog2;
unsigned numAct = 0; // number of block activities
......
......@@ -339,7 +339,11 @@ void IntraSearch::estIntraPredLumaQT( CodingUnit &cu, Partitioner &partitioner )
int ispOptions[NUM_INTRA_SUBPARTITIONS_MODES] = { 0 };
if( nOptionsForISP > 1 )
{
auto splitsThatCanBeUsedForISP = CU::canUseISPSplit( width, height, cu.cs->sps->getMaxTrSize() );
#if MAX_TB_SIZE_SIGNALLING
auto splitsThatCanBeUsedForISP = CU::canUseISPSplit( width, height, cu.cs->sps->getMaxTbSize() );
#else
auto splitsThatCanBeUsedForISP = CU::canUseISPSplit( width, height, MAX_TB_SIZEY );
#endif
if( splitsThatCanBeUsedForISP == CAN_USE_VER_AND_HORL_SPLITS )
{
const CodingUnit* cuLeft = cu.ispMode != NOT_INTRA_SUBPARTITIONS ? cs.getCU( cs.area.blocks[partitioner.chType].pos().offset( -1, 0 ), partitioner.chType ) : nullptr;
......
......@@ -680,10 +680,10 @@ void HLSWriter::codeSPS( const SPS* pcSPS )
}
}
// KJS: does not exist anymore -> remove?
WRITE_UVLC( pcSPS->getQuadtreeTULog2MinSize() - 2, "log2_min_luma_transform_block_size_minus2" );
WRITE_UVLC( pcSPS->getQuadtreeTULog2MaxSize() - pcSPS->getQuadtreeTULog2MinSize(), "log2_diff_max_min_luma_transform_block_size" );
#if MAX_TB_SIZE_SIGNALLING
// KJS: Not in syntax
WRITE_UVLC( pcSPS->getLog2MaxTbSize() - 2, "log2_max_luma_transform_block_size_minus2" );
#endif
WRITE_FLAG( pcSPS->getSAOEnabledFlag(), "sps_sao_enabled_flag");
WRITE_FLAG( pcSPS->getALFEnabledFlag(), "sps_alf_enabled_flag" );
......
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