Commit ff977ac4 authored by Karsten Suehring's avatar Karsten Suehring Committed by Xiang Li

Structure cleanup

parent ae9412fc
......@@ -92,7 +92,6 @@ CTUSize : 128
LCTUFast : 1
QuadtreeTULog2MaxSize : 6
QTBT : 1 # QTBT
DualITree : 1 # separate partitioning of luma and chroma channels for I-slices
MinQTLumaISlice : 8
MinQTChromaISlice : 4
......
......@@ -108,7 +108,6 @@ CTUSize : 128
LCTUFast : 1
QuadtreeTULog2MaxSize : 6
QTBT : 1 # QTBT
DualITree : 1 # separate partitioning of luma and chroma channels for I-slices
MinQTLumaISlice : 8
MinQTChromaISlice : 4
......
......@@ -108,7 +108,6 @@ CTUSize : 128
LCTUFast : 1
QuadtreeTULog2MaxSize : 6
QTBT : 1 # QTBT
DualITree : 1 # separate partitioning of luma and chroma channels for I-slices
MinQTLumaISlice : 8
MinQTChromaISlice : 4
......
......@@ -122,7 +122,6 @@ CTUSize : 128
LCTUFast : 1
QuadtreeTULog2MaxSize : 6
QTBT : 1 # QTBT
DualITree : 1 # separate partitioning of luma and chroma channels for I-slices
MinQTLumaISlice : 8
MinQTChromaISlice : 4
......
......@@ -211,7 +211,6 @@ void EncApp::xInitLibCfg()
m_cEncLib.setUseSelectiveRDOQ ( m_useSelectiveRDOQ );
#endif
m_cEncLib.setRDpenalty ( m_rdPenalty );
m_cEncLib.setQTBT ( m_QTBT );
m_cEncLib.setCTUSize ( m_uiCTUSize );
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
m_cEncLib.setUseSplitConsOverride ( m_SplitConsOverrideEnabledFlag );
......@@ -278,8 +277,8 @@ void EncApp::xInitLibCfg()
// ADD_NEW_TOOL : (encoder app) add setting of tool enabling flags and associated parameters here
m_cEncLib.setMaxCUWidth ( m_QTBT ? m_uiCTUSize : m_uiMaxCUWidth );
m_cEncLib.setMaxCUHeight ( m_QTBT ? m_uiCTUSize : m_uiMaxCUWidth );
m_cEncLib.setMaxCUWidth ( m_uiCTUSize );
m_cEncLib.setMaxCUHeight ( m_uiCTUSize );
m_cEncLib.setMaxCodingDepth ( m_uiMaxCodingDepth );
m_cEncLib.setLog2DiffMaxMinCodingBlockSize ( m_uiLog2DiffMaxMinCodingBlockSize );
m_cEncLib.setQuadtreeTULog2MaxSize ( m_quadtreeTULog2MaxSize );
......@@ -535,7 +534,6 @@ void EncApp::xInitLibCfg()
m_cEncLib.setSummaryVerboseness ( m_summaryVerboseness );
m_cEncLib.setIMV ( m_ImvMode );
m_cEncLib.setIMV4PelFast ( m_Imv4PelFast );
m_cEncLib.setIMVMaxCand ( m_ImvMaxCand );
m_cEncLib.setDecodeBitstream ( 0, m_decodeBitstreams[0] );
m_cEncLib.setDecodeBitstream ( 1, m_decodeBitstreams[1] );
m_cEncLib.setSwitchPOC ( m_switchPOC );
......
......@@ -799,7 +799,6 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
("InterlacedSource", m_interlacedSourceFlag, false, "Indicate that source is interlaced")
("NonPackedSource", m_nonPackedConstraintFlag, false, "Indicate that source does not contain frame packing")
("FrameOnly", m_frameOnlyConstraintFlag, false, "Indicate that the bitstream contains only frames")
("QTBT", m_QTBT, false, "Enable QTBT (0:off, 1:on) [default: off]")
("MTT", m_MTT, 0u, "Multi type tree type (0: off, 1:QTBT + triple split) [default: 0]")
("CTUSize", m_uiCTUSize, 128u, "CTUSize (specifies the CTU size if QTBT is on) [default: 128]")
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
......@@ -836,7 +835,6 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
"\t1: IMV default (Full-Pel)\n"
"\t2: IMV Full-Pel and 4-PEL\n")
("IMV4PelFast", m_Imv4PelFast, 1, "Fast 4-Pel Adaptive MV precision Mode 0:disabled, 1:enabled) [default: 1]")
("IMVMaxCand", m_ImvMaxCand, 4, "max IMV cand (QTBF off only)")
#if ENABLE_WPP_PARALLELISM
("AltDQPCoding", m_AltDQPCoding, false, "Improved predictive delta-QP coding (0:off, 1:on) [default: off]")
#endif
......@@ -1870,21 +1868,18 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
if( ( 1u << m_tuLog2MaxSize ) > m_uiCTUSize ) m_tuLog2MaxSize--;
}
if( m_QTBT )
const int minCuSize = 1 << MIN_CU_LOG2;
m_uiMaxCodingDepth = 0;
while( ( m_uiCTUSize >> m_uiMaxCodingDepth ) > minCuSize )
{
int minCuSize = 1 << MIN_CU_LOG2;
m_uiMaxCodingDepth = 0;
while( ( m_uiCTUSize >> m_uiMaxCodingDepth ) > minCuSize )
{
m_uiMaxCodingDepth++;
}
m_uiLog2DiffMaxMinCodingBlockSize = m_uiMaxCodingDepth;
m_uiMaxCUWidth = m_uiMaxCUHeight = m_uiCTUSize;
m_uiMaxCUDepth = m_uiMaxCodingDepth;
m_uiMaxCodingDepth++;
}
m_uiLog2DiffMaxMinCodingBlockSize = m_uiMaxCodingDepth;
m_uiMaxCUWidth = m_uiMaxCUHeight = m_uiCTUSize;
m_uiMaxCUDepth = m_uiMaxCodingDepth;
#if !JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
m_uiLog2DiffMaxMinCodingBlockSize = m_uiMaxCUDepth - 1;
m_uiLog2DiffMaxMinCodingBlockSize = m_uiMaxCUDepth - 1;
#endif
}
// check validity of input parameters
if( xCheckParameter() )
......@@ -1893,22 +1888,6 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
return false;
}
if( !m_QTBT )
{
// compute actual CU depth with respect to config depth and max transform size
uint32_t uiAddCUDepth = 0;
while( ( m_uiMaxCUWidth >> m_uiMaxCUDepth ) > ( 1 << ( m_quadtreeTULog2MinSize + uiAddCUDepth ) ) )
{
uiAddCUDepth++;
}
m_uiMaxCodingDepth = m_uiMaxCUDepth + uiAddCUDepth; // if minimum TU larger than 4x4, allow for additional part indices for 4:2:2 SubTUs.
m_uiLog2DiffMaxMinCodingBlockSize = m_uiMaxCUDepth - 1;
m_uiCTUSize = m_uiMaxCUWidth;
}
// print-out parameters
xPrintParameter();
......@@ -1954,7 +1933,6 @@ bool EncAppCfg::xCheckParameter()
#if ENABLE_WPP_PARALLELISM
xConfirmPara( m_numWppThreads > 1, "WPP-style parallelization only supported with NEXT profile" );
#endif
xConfirmPara( m_QTBT, "QTBT only allowed with NEXT profile" );
xConfirmPara( m_LMChroma, "LMChroma only allowed with NEXT profile" );
xConfirmPara( m_LargeCTU, "Large CTU is only allowed with NEXT profile" );
xConfirmPara( m_SubPuMvpMode != 0, "Sub-PU motion vector prediction is only allowed with NEXT profile" );
......@@ -2000,7 +1978,6 @@ bool EncAppCfg::xCheckParameter()
xConfirmPara( m_signDataHidingEnabledFlag, "SignHideFlag must be equal to 0 if dependent quantization is enabled" );
#endif
}
xConfirmPara( !m_QTBT && m_MTT, "Multi type tree is an extension of QTBT, thus QTBT has to be enabled for MTT" );
#if !REMOVE_MV_ADAPT_PREC
xConfirmPara(m_Affine && !m_highPrecisionMv, "Affine is not yet implemented for HighPrecMv off.");
......@@ -2049,13 +2026,8 @@ bool EncAppCfg::xCheckParameter()
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
xConfirmPara( m_useAMaxBT && !m_SplitConsOverrideEnabledFlag, "AMaxBt can only be used with PartitionConstriantsOverride enabled" );
#endif
xConfirmPara( m_useAMaxBT && !m_QTBT, "AMaxBT can only be used with QTBT!" );
xConfirmPara(m_bitstreamFileName.empty(), "A bitstream file name must be specified (BitstreamFile)");
const uint32_t maxBitDepth=(m_chromaFormatIDC==CHROMA_400) ? m_internalBitDepth[CHANNEL_TYPE_LUMA] : std::max(m_internalBitDepth[CHANNEL_TYPE_LUMA], m_internalBitDepth[CHANNEL_TYPE_CHROMA]);
xConfirmPara(m_bitDepthConstraint<maxBitDepth, "The internalBitDepth must not be greater than the bitDepthConstraint value");
......@@ -2251,10 +2223,6 @@ bool EncAppCfg::xCheckParameter()
#if SHARP_LUMA_DELTA_QP
xConfirmPara( m_lumaLevelToDeltaQPMapping.mode && m_uiDeltaQpRD > 0, "Luma-level-based Delta QP cannot be used together with slice level multiple-QP optimization\n" );
#endif
if( !m_QTBT )
{
xConfirmPara( m_iMaxCuDQPDepth > m_uiMaxCUDepth - 1, "Absolute depth for a minimum CuDQP exceeds maximum coding unit depth" );
}
xConfirmPara( m_cbQpOffset < -12, "Min. Chroma Cb QP Offset is -12" );
xConfirmPara( m_cbQpOffset > 12, "Max. Chroma Cb QP Offset is 12" );
......@@ -2297,7 +2265,7 @@ bool EncAppCfg::xCheckParameter()
{
xConfirmPara( m_uiMaxCUHeight > 64, "CTU bigger than 64 only allowed with large CTU." );
xConfirmPara( m_uiMaxCUWidth > 64, "CTU bigger than 64 only allowed with large CTU." );
if( m_QTBT ) xConfirmPara( m_uiCTUSize > 64, "CTU bigger than 64 only allowed with large CTU." );
xConfirmPara( m_uiCTUSize > 64, "CTU bigger than 64 only allowed with large CTU." );
}
if( m_profile == Profile::NEXT )
......@@ -3101,7 +3069,6 @@ void EncAppCfg::xPrintParameter()
msg( VERBOSE, "FDM:%d ", m_useFastDecisionForMerge );
msg( VERBOSE, "CFM:%d ", m_bUseCbfFastMode );
msg( VERBOSE, "ESD:%d ", m_useEarlySkipDetection );
msg( VERBOSE, "RQT:%d ", !m_QTBT );
msg( VERBOSE, "TransformSkip:%d ", m_useTransformSkip );
msg( VERBOSE, "TransformSkipFast:%d ", m_useTransformSkipFast );
msg( VERBOSE, "TransformSkipLog2MaxSize:%d ", m_log2MaxTransformSkipBlockSize);
......@@ -3164,12 +3131,10 @@ void EncAppCfg::xPrintParameter()
msg(VERBOSE, "SubPuMvpLog2Size:%d ", m_SubPuMvpLog2Size);
}
#endif
msg( VERBOSE, "QTBT:%d ", m_QTBT );
if( m_QTBT ) msg( VERBOSE, "DualITree:%d ", m_dualTree );
msg( VERBOSE, "DualITree:%d ", m_dualTree );
msg( VERBOSE, "LargeCTU:%d ", m_LargeCTU );
msg( VERBOSE, "IMV:%d ", m_ImvMode );
if( !m_QTBT ) msg( VERBOSE, "IMVMaxCand:%d ", m_ImvMaxCand );
#if !REMOVE_MV_ADAPT_PREC
#if !REMOVE_MV_ADAPT_PREC
msg(VERBOSE, "HighPrecMv:%d ", m_highPrecisionMv);
#endif
#if JVET_L0256_BIO
......@@ -3211,9 +3176,9 @@ void EncAppCfg::xPrintParameter()
msg( VERBOSE, "PBIntraFast:%d ", m_usePbIntraFast );
if( m_ImvMode == 2 ) msg( VERBOSE, "IMV4PelFast:%d ", m_Imv4PelFast );
if( m_EMT ) msg( VERBOSE, "EMTFast: %1d(intra) %1d(inter) ", ( m_FastEMT & m_EMT & 1 ), ( m_FastEMT >> 1 ) & ( m_EMT >> 1 ) & 1 );
if( m_QTBT ) msg( VERBOSE, "AMaxBT:%d ", m_useAMaxBT );
if( m_QTBT ) msg( VERBOSE, "E0023FastEnc:%d ", m_e0023FastEnc );
if( m_QTBT ) msg( VERBOSE, "ContentBasedFastQtbt:%d ", m_contentBasedFastQtbt );
msg( VERBOSE, "AMaxBT:%d ", m_useAMaxBT );
msg( VERBOSE, "E0023FastEnc:%d ", m_e0023FastEnc );
msg( VERBOSE, "ContentBasedFastQtbt:%d ", m_contentBasedFastQtbt );
msg( VERBOSE, "NumSplitThreads:%d ", m_numSplitThreads );
if( m_numSplitThreads > 1 )
......
......@@ -196,7 +196,6 @@ protected:
int m_maxTempLayer; ///< Max temporal layer
// coding unit (CU) definition
bool m_QTBT;
unsigned m_uiCTUSize;
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
bool m_SplitConsOverrideEnabledFlag;
......@@ -525,7 +524,6 @@ protected:
int m_log2MaxMvLengthVertical; ///< Indicate the maximum absolute value of a decoded vertical MV component in quarter-pel luma units
int m_ImvMode; ///< imv mode
int m_Imv4PelFast; ///< imv 4-Pel fast mode
int m_ImvMaxCand; ///< imv max num cand for test (QTBT off only)
std::string m_colourRemapSEIFileRoot;
std::string m_summaryOutFilename; ///< filename to use for producing summary output file.
......
......@@ -361,10 +361,7 @@ PredictionUnit& CodingStructure::addPU( const UnitArea &unit, const ChannelType
#if ENABLE_SPLIT_PARALLELISM || ENABLE_WPP_PARALLELISM
CHECK( pu->cacheId != pu->cu->cacheId, "Inconsintent cacheId between the PU and assigned CU" );
if( pcv->noRQT )
{
CHECK( pu->cu->firstPU != nullptr, "Without an RQT the firstPU should be null" );
}
CHECK( pu->cu->firstPU != nullptr, "Without an RQT the firstPU should be null" );
#endif
PredictionUnit *prevPU = m_numPUs > 0 ? pus.back() : nullptr;
......@@ -1340,4 +1337,4 @@ CprLumaCoverage CodingStructure::getCprLumaCoverage(const CompArea& chromaArea)
return coverage;
}
#endif
\ No newline at end of file
#endif
......@@ -223,8 +223,6 @@ static const int DM_CHROMA_IDX = NUM_INTRA_MODE; ///< chro
static const uint8_t INTER_MODE_IDX = 255; ///< index for inter modes
static const uint32_t EMT_INTRA_MAX_CU = 32; ///< Max Intra CU size applying EMT, supported values: 8, 16, 32, 64, 128
static const uint32_t EMT_INTER_MAX_CU = 32; ///< Max Inter CU size applying EMT, supported values: 8, 16, 32, 64, 128
static const uint32_t EMT_INTRA_MAX_CU_WITH_QTBT = 32; ///< Max Intra CU size applying EMT, supported values: 8, 16, 32, 64, 128
static const uint32_t EMT_INTER_MAX_CU_WITH_QTBT = 32; ///< Max Inter CU size applying EMT, supported values: 8, 16, 32, 64, 128
#if JVET_L0165_6MPM
......
......@@ -110,35 +110,19 @@ CoeffCodingContext::CoeffCodingContext(const TransformUnit& tu, ComponentID comp
#endif
if (m_chType == CHANNEL_TYPE_CHROMA)
{
if( tu.cs->pcv->rectCUs )
{
#if HEVC_USE_MDCS
const_cast<int&>(m_lastShiftX) = Clip3( 0, 2, int( ( m_scanType == SCAN_VER ? m_height : m_width ) >> 3) );
const_cast<int&>(m_lastShiftY) = Clip3( 0, 2, int( ( m_scanType == SCAN_VER ? m_width : m_height ) >> 3) );
const_cast<int&>(m_lastShiftX) = Clip3( 0, 2, int( ( m_scanType == SCAN_VER ? m_height : m_width ) >> 3) );
const_cast<int&>(m_lastShiftY) = Clip3( 0, 2, int( ( m_scanType == SCAN_VER ? m_width : m_height ) >> 3) );
#else
const_cast<int&>(m_lastShiftX) = Clip3( 0, 2, int( m_width >> 3) );
const_cast<int&>(m_lastShiftY) = Clip3( 0, 2, int( m_height >> 3) );
const_cast<int&>(m_lastShiftX) = Clip3( 0, 2, int( m_width >> 3) );
const_cast<int&>(m_lastShiftY) = Clip3( 0, 2, int( m_height >> 3) );
#endif
}
else
{
const_cast<int&>(m_lastShiftX) = log2sizeX - 2;
const_cast<int&>(m_lastShiftY) = log2sizeY - 2;
}
}
else
{
if( tu.cs->pcv->rectCUs )
{
static const int prefix_ctx[8] = { 0, 0, 0, 3, 6, 10, 15, 21 };
const_cast<int&>(m_lastOffsetX) = prefix_ctx[ log2sizeX ];
const_cast<int&>(m_lastOffsetY) = prefix_ctx[ log2sizeY ];;
}
else
{
const_cast<int&>(m_lastOffsetX) = 3 * (log2sizeX - 2) + ((log2sizeX - 1) >> 2);
const_cast<int&>(m_lastOffsetY) = 3 * (log2sizeY - 2) + ((log2sizeY - 1) >> 2);
}
static const int prefix_ctx[8] = { 0, 0, 0, 3, 6, 10, 15, 21 };
const_cast<int&>(m_lastOffsetX) = prefix_ctx[ log2sizeX ];
const_cast<int&>(m_lastOffsetY) = prefix_ctx[ log2sizeY ];;
const_cast<int&>(m_lastShiftX) = (log2sizeX + 1) >> 2;
const_cast<int&>(m_lastShiftY) = (log2sizeY + 1) >> 2;
}
......@@ -240,11 +224,7 @@ unsigned DeriveCtx::CtxInterDir( const PredictionUnit& pu )
{
if( pu.cs->sps->getSpsNext().getUseLargeCTU() )
{
if( pu.cs->pcv->rectCUs )
{
return Clip3( 0, 3, 7 - ( ( g_aucLog2[pu.lumaSize().width] + g_aucLog2[pu.lumaSize().height] + 1 ) >> 1 ) ); // VG-ASYMM DONE
}
return Clip3( 0, 3, 6 - g_aucLog2[pu.cu->lumaSize().width] );
return Clip3( 0, 3, 7 - ( ( g_aucLog2[pu.lumaSize().width] + g_aucLog2[pu.lumaSize().height] + 1 ) >> 1 ) ); // VG-ASYMM DONE
}
return pu.cu->qtDepth;
}
......@@ -610,4 +590,4 @@ void MergeCtx::setMmvdMergeCandiInfo(PredictionUnit& pu, int candIdx)
pu.cu->GBiIdx = (interDirNeighbours[fPosBaseIdx] == 3) ? GBiIdx[fPosBaseIdx] : GBI_DEFAULT;
#endif
}
#endif
\ No newline at end of file
#endif
......@@ -491,8 +491,8 @@ namespace DQIntern
const bool useYCtx = ( xy != 0 );
#endif
const CtxSet& ctxSetLast = ( useYCtx ? Ctx::LastY : Ctx::LastX )[ chType ];
const unsigned lastShift = ( compID == COMPONENT_Y ? (log2Size+1)>>2 : ( tu.cs->pcv->rectCUs ? Clip3<unsigned>(0,2,size>>3) : log2Size-2 ) );
const unsigned lastOffset = ( compID == COMPONENT_Y ? ( tu.cs->pcv->rectCUs ? prefixCtx[log2Size] : 3*(log2Size-2)+((log2Size-1)>>2) ) : 0 );
const unsigned lastShift = ( compID == COMPONENT_Y ? (log2Size+1)>>2 : Clip3<unsigned>(0,2,size>>3) );
const unsigned lastOffset = ( compID == COMPONENT_Y ? ( prefixCtx[log2Size] ) : 0 );
uint32_t sumFBits = 0;
unsigned maxCtxId = g_uiGroupIdx[ size - 1 ];
for( unsigned ctxId = 0; ctxId < maxCtxId; ctxId++ )
......@@ -892,8 +892,8 @@ namespace DQIntern
const bool useYCtx = ( xy != 0 );
#endif
const CtxSet& ctxSetLast = ( useYCtx ? Ctx::LastY : Ctx::LastX )[ m_chType ];
const unsigned lastShift = ( m_compID == COMPONENT_Y ? (log2Size+1)>>2 : ( tu.cs->pcv->rectCUs ? Clip3<unsigned>(0,2,size>>3) : log2Size-2 ) );
const unsigned lastOffset = ( m_compID == COMPONENT_Y ? ( tu.cs->pcv->rectCUs ? prefixCtx[log2Size] : 3*(log2Size-2)+((log2Size-1)>>2) ) : 0 );
const unsigned lastShift = ( m_compID == COMPONENT_Y ? (log2Size+1)>>2 : Clip3<unsigned>(0,2,size>>3) );
const unsigned lastOffset = ( m_compID == COMPONENT_Y ? prefixCtx[log2Size] : 0 );
uint32_t sumFBits = 0;
unsigned maxCtxId = g_uiGroupIdx[ size - 1 ];
for( unsigned ctxId = 0; ctxId < maxCtxId; ctxId++ )
......
......@@ -363,7 +363,6 @@ void IntraPrediction::predIntraAng( const ComponentID compId, PelBuf &piPred, co
CHECK( g_aucLog2[iWidth] < 2 && pu.cs->pcv->noChroma2x2, "Size not allowed" );
CHECK( g_aucLog2[iWidth] > 7, "Size not allowed" );
CHECK( iWidth != iHeight && !pu.cs->pcv->rectCUs, "Rectangular block are only allowed with QTBT" );
#if JVET_L0283_MULTI_REF_LINE
const int multiRefIdx = (compID == COMPONENT_Y) ? pu.multiRefIdx : 0;
......@@ -1852,24 +1851,16 @@ void IntraPrediction::xGetLumaRecPixels(const PredictionUnit &pu, CompArea chrom
int iRecStride = Src.stride;
int iRecStride2 = iRecStride << 1;
CodingStructure& cs = *pu.cs;
const CodingUnit& lumaCU = isChroma( pu.chType ) ? *pu.cs->picture->cs->getCU( lumaArea.pos(), CH_L ) : *pu.cu;
const CodingUnit& cu = *pu.cu;
const CompArea& area = isChroma( pu.chType ) ? chromaArea : lumaArea;
const SPS &sps = *cs.sps;
const uint32_t uiTuWidth = area.width;
const uint32_t uiTuHeight = area.height;
int iBaseUnitSize = ( 1 << MIN_CU_LOG2 );
if( !cs.pcv->rectCUs )
{
iBaseUnitSize = sps.getMaxCUWidth() >> sps.getMaxCodingDepth();
}
const int iUnitWidth = iBaseUnitSize >> getComponentScaleX( area.compID, area.chromaFormat );
const int iUnitHeight = iBaseUnitSize >> getComponentScaleX( area.compID, area.chromaFormat );
const int iTUWidthInUnits = uiTuWidth / iUnitWidth;
......@@ -1907,15 +1898,8 @@ void IntraPrediction::xGetLumaRecPixels(const PredictionUnit &pu, CompArea chrom
( bNeighborFlags + iLeftUnits - 1 ) );
#endif
if( lumaCU.cs->pcv->rectCUs )
{
bLeftAvaillable = availlableUnit == iTUHeightInUnits;
}
else
{
bLeftAvaillable = availlableUnit == iTUWidthInUnits;
}
bLeftAvaillable = availlableUnit == iTUHeightInUnits;
availlableUnit = isAboveAvailable( isChroma( pu.chType ) ? cu : lumaCU, toChannelType( area.compID ), area.pos(), iAboveUnits, iUnitWidth,
#if JVET_L0338_MDLM
( bNeighborFlags + iLeftUnits + leftBelowUnits + 1 ) );
......@@ -1923,14 +1907,8 @@ void IntraPrediction::xGetLumaRecPixels(const PredictionUnit &pu, CompArea chrom
( bNeighborFlags + iLeftUnits + 1 ) );
#endif
if( lumaCU.cs->pcv->rectCUs )
{
bAboveAvaillable = availlableUnit == iTUWidthInUnits;
}
else
{
bAboveAvaillable = availlableUnit == iTUHeightInUnits;
}
bAboveAvaillable = availlableUnit == iTUWidthInUnits;
#if JVET_L0338_MDLM
if (bLeftAvaillable) // if left is not available, then the below left is not available
{
......@@ -2477,7 +2455,7 @@ void IntraPrediction::xGetLMParameters(const PredictionUnit &pu, const Component
#endif
int minDim = bLeftAvaillable && bAboveAvaillable ? 1 << g_aucPrevLog2[std::min( uiCHeight, uiCWidth )] : 1 << g_aucPrevLog2[bLeftAvaillable ? uiCHeight : uiCWidth];
int minStep = 1;
int numSteps = cs.pcv->rectCUs ? minDim / minStep : minDim;
int numSteps = minDim / minStep;
if( bAboveAvaillable )
{
......
......@@ -316,10 +316,6 @@ void LoopFilter::xDeblockCU( CodingUnit& cu, const DeblockEdgeDir edgeDir )
for( int x = 0; x < area.width; x += uiPelsInPart )
{
unsigned uiBSCheck = 1;
if( !cu.cs->pcv->noRQT && uiPelsInPart == 4 )
{
uiBSCheck = ( ( edgeDir == EDGE_VER ) && ( x % 8 == 0 ) ) || ( ( edgeDir == EDGE_HOR ) && ( y % 8 == 0 ) );
}
const Position localPos { area.x + x, area.y + y };
const unsigned rasterIdx = getRasterIdx( localPos, pcv );
......@@ -330,9 +326,6 @@ void LoopFilter::xDeblockCU( CodingUnit& cu, const DeblockEdgeDir edgeDir )
}
}
const unsigned shiftFactor = edgeDir == EDGE_VER ? ::getComponentScaleX( COMPONENT_Cb, pcv.chrFormat ) : ::getComponentScaleY( COMPONENT_Cb, pcv.chrFormat );
const bool bAlwaysDoChroma = pcv.chrFormat == CHROMA_444 || pcv.noRQT;
if (edgeDir == EDGE_HOR)
{
if (!((cu.block(COMPONENT_Y).y % 8) == 0))
......@@ -382,7 +375,7 @@ void LoopFilter::xDeblockCU( CodingUnit& cu, const DeblockEdgeDir edgeDir )
{
xEdgeFilterLuma(cu, edgeDir, edge);
}
if (cu.blocks[COMPONENT_Cb].valid() && pcv.chrFormat != CHROMA_400 && (bAlwaysDoChroma || (uiPelsInPart > DEBLOCK_SMALLEST_BLOCK) || (edge % ((DEBLOCK_SMALLEST_BLOCK << shiftFactor) / uiPelsInPart)) == 0))
if (cu.blocks[COMPONENT_Cb].valid() && pcv.chrFormat != CHROMA_400)
{
xEdgeFilterChroma(cu, edgeDir, edge);
}
......@@ -618,7 +611,7 @@ void LoopFilter::xEdgeFilterLuma(const CodingUnit& cu, const DeblockEdgeDir edge
const ClpRng& clpRng( cu.cs->slice->clpRng(COMPONENT_Y) );
int iQP = 0;
unsigned uiNumParts = ( pcv.rectCUs ? ( ( edgeDir == EDGE_VER ) ? lumaArea.height / pcv.minCUHeight : lumaArea.width / pcv.minCUWidth ) : pcv.partsInCtuWidth >> cu.qtDepth );
unsigned uiNumParts = ( ( ( edgeDir == EDGE_VER ) ? lumaArea.height / pcv.minCUHeight : lumaArea.width / pcv.minCUWidth ) );
int pelsInPart = pcv.minCUWidth;
unsigned uiBsAbsIdx = 0, uiBs = 0;
int iOffset, iSrcStep;
......@@ -792,7 +785,7 @@ void LoopFilter::xEdgeFilterChroma(const CodingUnit& cu, const DeblockEdgeDir ed
return;
}
unsigned uiNumParts = ( pcv.rectCUs ? ( ( edgeDir == EDGE_VER ) ? lumaSize.height / pcv.minCUHeight : lumaSize.width / pcv.minCUWidth ) : pcv.partsInCtuWidth >> cu.qtDepth );
unsigned uiNumParts = ( edgeDir == EDGE_VER ) ? lumaSize.height / pcv.minCUHeight : lumaSize.width / pcv.minCUWidth ;
int uiNumPelsLuma = pcv.minCUWidth;
unsigned uiBsAbsIdx;
unsigned ucBs;
......
......@@ -192,7 +192,6 @@ void RdCost::copyState( const RdCost& other )
m_mvPredictor = other.m_mvPredictor;
m_motionLambda = other.m_motionLambda;
m_iCostScale = other.m_iCostScale;
m_useQtbt = other.m_useQtbt;
memcpy( m_dLambdaMotionSAD, other.m_dLambdaMotionSAD, sizeof( m_dLambdaMotionSAD ) );
}
#endif
......@@ -201,7 +200,6 @@ void RdCost::setDistParam( DistParam &rcDP, const CPelBuf &org, const Pel* piRef
{
rcDP.bitDepth = bitDepth;
rcDP.compID = compID;
rcDP.isQtbt = m_useQtbt;
// set Original & Curr Pointer / Stride
rcDP.org = org;
......@@ -281,7 +279,6 @@ void RdCost::setDistParam( DistParam &rcDP, const CPelBuf &org, const Pel* piRef
void RdCost::setDistParam( DistParam &rcDP, const CPelBuf &org, const CPelBuf &cur, int bitDepth, ComponentID compID, bool useHadamard )
{
rcDP.isQtbt = m_useQtbt;
rcDP.org = org;
rcDP.cur = cur;
rcDP.step = 1;
......@@ -330,7 +327,6 @@ void RdCost::setDistParam( DistParam &rcDP, const Pel* pOrg, const Pel* piRefY,
{
rcDP.bitDepth = bitDepth;
rcDP.compID = compID;
rcDP.isQtbt = m_useQtbt;
rcDP.org.buf = pOrg;
rcDP.org.stride = iOrgStride;
......@@ -381,7 +377,6 @@ Distortion RdCost::getDistPart( const CPelBuf &org, const CPelBuf &cur, int bitD
{
DistParam cDtParam;
cDtParam.isQtbt = m_useQtbt;
cDtParam.org = org;
cDtParam.cur = cur;
cDtParam.step = 1;
......@@ -2770,7 +2765,7 @@ Distortion RdCost::xGetHADs( const DistParam &rcDtParam )
Distortion uiSum = 0;
if( rcDtParam.isQtbt && iCols > iRows && ( iRows & 7 ) == 0 && ( iCols & 15 ) == 0 )
if( iCols > iRows && ( iRows & 7 ) == 0 && ( iCols & 15 ) == 0 )
{
for( y = 0; y < iRows; y += 8 )
{
......@@ -2782,7 +2777,7 @@ Distortion RdCost::xGetHADs( const DistParam &rcDtParam )
piCur += iStrideCur * 8;
}
}
else if( rcDtParam.isQtbt && iCols < iRows && ( iCols & 7 ) == 0 && ( iRows & 15 ) == 0 )
else if( iCols < iRows && ( iCols & 7 ) == 0 && ( iRows & 15 ) == 0 )
{
for( y = 0; y < iRows; y += 16 )
{
......@@ -2794,7 +2789,7 @@ Distortion RdCost::xGetHADs( const DistParam &rcDtParam )
piCur += iStrideCur * 16;
}
}
else if( rcDtParam.isQtbt && iCols > iRows && ( iRows & 3 ) == 0 && ( iCols & 7 ) == 0 )
else if( iCols > iRows && ( iRows & 3 ) == 0 && ( iCols & 7 ) == 0 )
{
for( y = 0; y < iRows; y += 4 )
{
......@@ -2806,7 +2801,7 @@ Distortion RdCost::xGetHADs( const DistParam &rcDtParam )
piCur += iStrideCur * 4;
}
}
else if( rcDtParam.isQtbt && iCols < iRows && ( iCols & 3 ) == 0 && ( iRows & 7 ) == 0 )
else if( iCols < iRows && ( iCols & 3 ) == 0 && ( iRows & 7 ) == 0 )
{
for( y = 0; y < iRows; y += 8 )
{
......
......@@ -79,7 +79,6 @@ public:
bool useMR;
bool applyWeight; // whether weighted prediction is used or not
bool isBiPred;
bool isQtbt;
const WPScalingParam *wpCur; // weighted prediction scaling parameters for current ref
ComponentID compID;
......@@ -121,7 +120,6 @@ private:
double m_motionLambda;
int m_iCostScale;
bool m_useQtbt;
#if JVET_L0293_CPR
double m_dCost; // for cpr
#endif
......@@ -148,8 +146,6 @@ public:
void setCostMode(CostMode m) { m_costMode = m; }
void setUseQtbt(bool b) { m_useQtbt = b; }
// Distortion Functions
void init();
#ifdef TARGET_SIMD_X86
......
......@@ -1776,7 +1776,6 @@ SPSNext::SPSNext( SPS& sps )
: m_SPS ( sps )
, m_NextEnabled ( false )
// disable all tool enabling flags by default
, m_QTBT ( false )
, m_LargeCTU ( false )
, m_SubPuMvp ( false )
, m_IMV ( false )
......
......@@ -800,7 +800,6 @@ private:
bool m_NextEnabled;
//===== tool enabling flags (4 bytes - NOTE: last flag must be used for new extensions) =====
bool m_QTBT; // 1
bool m_LargeCTU; // 5
bool m_SubPuMvp;
bool m_IMV; // 9
......@@ -880,8 +879,6 @@ public:
void setNextToolsEnabled ( bool next ) { m_NextEnabled = next; }
//===== tool enabling flags and extension bit =====
void setUseQTBT ( bool QTBT ) { m_QTBT = QTBT; }
bool getUseQTBT () const { return m_QTBT; }
void setUseLargeCTU ( bool b ) { m_LargeCTU = b; }
bool getUseLargeCTU () const { return m_LargeCTU; }
bool getUseSubPuMvp() const { return m_SubPuMvp; }
......@@ -2155,7 +2152,7 @@ class PreCalcValues
public:
PreCalcValues( const SPS& sps, const PPS& pps, bool _isEncoder )
: chrFormat ( sps.getChromaFormatIdc() )
, multiBlock422 ( chrFormat == CHROMA_422 && !sps.getSpsNext().getUseQTBT() )
, multiBlock422 ( false )
, noMotComp ( sps.getSpsNext().getDisableMotCompress() )
, maxCUWidth ( sps.getMaxCUWidth() )
, maxCUHeight ( sps.getMaxCUHeight() )
......@@ -2176,12 +2173,9 @@ public:
, lumaWidth ( sps.getPicWidthInLumaSamples() )
, lumaHeight ( sps.getPicHeightInLumaSamples() )
, fastDeltaQPCuMaxSize( Clip3(sps.getMaxCUHeight() >> (sps.getLog2DiffMaxMinCodingBlockSize()), sps.getMaxCUHeight(), 32u) )
, noRQT ( sps.getSpsNext().getUseQTBT() )
, rectCUs ( sps.getSpsNext().getUseQTBT() )
, only2Nx2N ( sps.getSpsNext().getUseQTBT() )
, noChroma2x2 ( !sps.getSpsNext().getUseQTBT() )
, noChroma2x2 ( false )
, isEncoder ( _isEncoder )
, ISingleTree ( !sps.getSpsNext().getUseQTBT() || !sps.getSpsNext().getUseDualITree() )
, ISingleTree ( !sps.getSpsNext().getUseDualITree() )
, maxBtDepth { sps.getSpsNext().getMaxBTDepthI(), sps.getSpsNext().getMaxBTDepth(), sps.getSpsNext().getMaxBTDepthIChroma() }
, minBtSize { MIN_BT_SIZE, MIN_BT_SIZE_INTER, MIN_BT_SIZE_C }
, maxBtSize { sps.getSpsNext().getMaxBTSizeI(), sps.getSpsNext().getMaxBTSize(), sps.getSpsNext().getMaxBTSizeIChroma() }
......@@ -2217,9 +2211,6 @@ public:
const unsigned lumaWidth;
const unsigned lumaHeight;
const unsigned fastDeltaQPCuMaxSize;
const bool noRQT;
const bool rectCUs;
const bool only2Nx2N;
const bool noChroma2x2;
const bool isEncoder;
const bool ISingleTree;
......
......@@ -132,8 +132,7 @@ void xTrMxN_EMT( const int bitDepth, const Pel *residual, size_t stride, TCoeff
#else
void xTrMxN_EMT( const int bitDepth, const Pel *residual, size_t stride, TCoeff *coeff, int iWidth, int iHeight, const int maxLog2TrDynamicRange,
#endif
const uint8_t ucMode, const uint8_t ucTrIdx
, const bool useQTBT )
const uint8_t ucMode, const uint8_t ucTrIdx)
{
const int TRANSFORM_MATRIX_SHIFT = g_transformMatrixShift[TRANSFORM_FORWARD];
const int shift_1st = ((g_aucLog2[iWidth ]) + bitDepth + TRANSFORM_MATRIX_SHIFT) - maxLog2TrDynamicRange + COM16_C806_TRANS_PREC;
......@@ -143,17 +142,8 @@ void xTrMxN_EMT( const int bitDepth, const Pel *residual, size_t stride, TCoeff
const int iZeroOutThresh = JVET_C0024_ZERO_OUT_TH;
int iSkipWidth = 0, iSkipHeight = 0;
if( useQTBT )
{
iSkipWidth = (iWidth > iZeroOutThresh ? iWidth - iZeroOutThresh : 0);
iSkipHeight = (iHeight > iZeroOutThresh ? iHeight - iZeroOutThresh : 0);
}
else
if( ( ( ucMode == INTER_MODE_IDX || iWidth > iZeroOutThresh ) && ucTrIdx != DCT2_EMT && iWidth >= iZeroOutThresh ) || ( ucTrIdx == DCT2_EMT && iWidth > iZeroOutThresh ) )
{
iSkipWidth = iWidth >> 1;
iSkipHeight = iHeight >> 1;
}
iSkipWidth = (iWidth > iZeroOutThresh ? iWidth - iZeroOutThresh : 0);
iSkipHeight = (iHeight > iZeroOutThresh ? iHeight - iZeroOutThresh : 0);
CHECK( shift_1st < 0, "Negative shift" );
CHECK( shift_2nd < 0, "Negative shift" );
......@@ -270,14 +260,12 @@ void TrQuant::init( const Quant* otherQuant,
const bool useSelectiveRDOQ,
#endif
const bool bEnc,
const bool useTransformSkipFast,
const bool rectTUs
const bool useTransformSkipFast
)
{
m_uiMaxTrSize = uiMaxTrSize;
m_bEnc = bEnc;
m_useTransformSkipFast = useTransformSkipFast;
m_rectTUs = rectTUs;
delete m_quant;
m_quant = nullptr;
......@@ -427,7 +415,6 @@ void TrQuant::xT( const TransformUnit &tu, const ComponentID &compID, const CPel
#else
xTrMxN_EMT(channelBitDepth, resi.buf, resi.stride, dstCoeff.buf, iWidth, iHeight, maxLog2TrDynamicRange, ucMode, ucTrIdx
#endif
, m_rectTUs
);
}
......
......@@ -75,8 +75,7 @@ public:
const bool useSelectiveRDOQ = false,
#endif
const bool bEnc = false,
const bool useTransformSkipFast = false,