Commit ff269850 authored by Karsten Suehring's avatar Karsten Suehring

remove ENABLE_BMS and related unused macros

parent ca9057c3
......@@ -220,11 +220,7 @@ void EncApp::xInitLibCfg()
m_cEncLib.setMaxBTDepth ( m_uiMaxBTDepth, m_uiMaxBTDepthI, m_uiMaxBTDepthIChroma );
m_cEncLib.setDualITree ( m_dualTree );
m_cEncLib.setLargeCTU ( m_LargeCTU );
#if ENABLE_BMS
m_cEncLib.setSubPuMvpMode ( m_SubPuMvpMode );
#else
m_cEncLib.setSubPuMvpMode ( m_SubPuMvpMode > 0 ? 3 : 0 );
#endif
#if !JVET_L0198_L0468_L0104_ATMVP_8x8SUB_BLOCK
m_cEncLib.setSubPuMvpLog2Size ( m_SubPuMvpLog2Size );
#endif
......
......@@ -815,11 +815,7 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
("MaxBTDepthISliceC", m_uiMaxBTDepthIChroma, 3u, "MaxBTDepthISliceC")
("DualITree", m_dualTree, false, "Use separate QTBT trees for intra slice luma and chroma channel types")
("LargeCTU", m_LargeCTU, false, "Enable large CTU (0:off, 1:on) [default: off]")
#if ENABLE_BMS
("SubPuMvp", m_SubPuMvpMode, 0, "Enable Sub-PU temporal motion vector prediction (0:off, 1:ATMVP, 2:STMVP, 3:ATMVP+STMVP) [default: off]")
#else
("SubPuMvp", m_SubPuMvpMode, 0, "Enable Sub-PU temporal motion vector prediction (0:off, 1:on) [default: off]")
#endif
#if !JVET_L0198_L0468_L0104_ATMVP_8x8SUB_BLOCK
("SubPuMvpLog2Size", m_SubPuMvpLog2Size, 2u, "Sub-PU TMVP size index: 2^n")
#endif
......@@ -1912,9 +1908,6 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
m_uiCTUSize = m_uiMaxCUWidth;
}
#if !ENABLE_BMS
m_SubPuMvpMode = m_SubPuMvpMode > 0 ? 3 : 0;
#endif
// print-out parameters
xPrintParameter();
......@@ -2226,17 +2219,6 @@ bool EncAppCfg::xCheckParameter()
xConfirmPara( m_quadtreeTULog2MaxSize < 0, "Maximal TU size is invalid" );
#if !ENABLE_BMS
if( m_profile == Profile::NEXT && m_quadtreeTULog2MaxSize < 6 )
{
msg( WARNING, "****************************************************************************\n" );
msg( WARNING, "** WARNING: Using NEXT-Profile but not enabling large transformation **\n" );
msg( WARNING, "** sizes. Use --TULog2MaxSize to set maximum transformation **\n" );
msg( WARNING, "** size to 128 (=7) or 64 (=6) **\n" );
msg( WARNING, "****************************************************************************\n" );
}
#endif
if( m_SubPuMvpMode == 3 && m_maxNumMergeCand < 7 )
{
msg( WARNING, "****************************************************************************\n" );
......
......@@ -287,10 +287,8 @@ static const int MAX_TR_SIZE = MAX_CU_SIZE;
#if JVET_L0081_VPDU_SPLIT_CONSTRAINTS
static const int MAX_TU_SIZE_FOR_PROFILE = 64;
#endif
#if ENABLE_BMS
static const int MAX_LOG2_DIFF_CU_TR_SIZE = 2;
static const int MAX_CU_TILING_PARTITIONS = 1 << ( MAX_LOG2_DIFF_CU_TR_SIZE << 1 );
#endif
static const int JVET_C0024_ZERO_OUT_TH = 32;
......
......@@ -220,17 +220,12 @@ unsigned DeriveCtx::CtxCUsplit( const CodingStructure& cs, Partitioner& partitio
return ctxId;
}
#if ENABLE_BMS
unsigned DeriveCtx::CtxQtCbf( const ComponentID compID, const unsigned trDepth, const bool prevCbCbf )
#else
unsigned DeriveCtx::CtxQtCbf( const ComponentID compID, const bool prevCbCbf )
#endif
{
if( compID == COMPONENT_Cr )
{
return ( prevCbCbf ? 1 : 0 );
}
#if ENABLE_BMS
if( isChroma( compID ) )
{
return trDepth;
......@@ -239,9 +234,6 @@ unsigned DeriveCtx::CtxQtCbf( const ComponentID compID, const bool prevCbCbf )
{
return ( trDepth == 0 ? 1 : 0 );
}
#else
return isChroma( compID ) ? 0 : 1;
#endif
}
unsigned DeriveCtx::CtxInterDir( const PredictionUnit& pu )
......
......@@ -344,11 +344,7 @@ namespace DeriveCtx
{
unsigned CtxCUsplit ( const CodingStructure& cs, Partitioner& partitioner );
unsigned CtxBTsplit ( const CodingStructure& cs, Partitioner& partitioner );
#if ENABLE_BMS
unsigned CtxQtCbf ( const ComponentID compID, const unsigned trDepth, const bool prevCbCbf );
#else
unsigned CtxQtCbf ( const ComponentID compID, const bool prevCbCbf );
#endif
unsigned CtxInterDir ( const PredictionUnit& pu );
unsigned CtxSkipFlag ( const CodingUnit& cu );
unsigned CtxIMVFlag ( const CodingUnit& cu );
......
......@@ -473,11 +473,7 @@ namespace DQIntern
}
else
{
#if ENABLE_BMS
BinFracBits bits = fracBitsAccess.getFracBitsArray( Ctx::QtCbf[compID]( DeriveCtx::CtxQtCbf( compID, tu.depth, tu.cbf[COMPONENT_Cb] ) ) );
#else
BinFracBits bits = fracBitsAccess.getFracBitsArray( Ctx::QtCbf[compID]( DeriveCtx::CtxQtCbf( compID, tu.cbf[COMPONENT_Cb] ) ) );
#endif
cbfDeltaBits = int32_t( bits.intBits[1] ) - int32_t( bits.intBits[0] );
}
......@@ -878,11 +874,7 @@ namespace DQIntern
}
else
{
#if ENABLE_BMS
BinFracBits bits = fracBitsAccess.getFracBitsArray( Ctx::QtCbf[m_compID]( DeriveCtx::CtxQtCbf( m_compID, tu.depth, tu.cbf[COMPONENT_Cb] ) ) );
#else
BinFracBits bits = fracBitsAccess.getFracBitsArray( Ctx::QtCbf[m_compID]( DeriveCtx::CtxQtCbf( m_compID, tu.cbf[COMPONENT_Cb] ) ) );
#endif
cbfDeltaBits = int32_t( bits.intBits[1] ) - int32_t( bits.intBits[0] );
}
......
......@@ -1018,11 +1018,7 @@ void QuantRDOQ::xRateDistOptQuant(TransformUnit &tu, const ComponentID &compID,
int iBestLastIdxP1 = 0;
#if ENABLE_BMS
if( !CU::isIntra( *tu.cu ) && isLuma( compID ) && tu.depth == 0 )
#else
if( !CU::isIntra( *tu.cu ) && isLuma( compID ) )
#endif
{
const BinFracBits fracBitsQtRootCbf = fracBits.getFracBitsArray( Ctx::QtRootCbf() );
d64BestCost = d64BlockUncodedCost + xGetICost( fracBitsQtRootCbf.intBits[ 0 ] );
......@@ -1030,11 +1026,7 @@ void QuantRDOQ::xRateDistOptQuant(TransformUnit &tu, const ComponentID &compID,
}
else
{
#if ENABLE_BMS
BinFracBits fracBitsQtCbf = fracBits.getFracBitsArray( Ctx::QtCbf[compID]( DeriveCtx::CtxQtCbf( rect.compID, tu.depth, tu.cbf[COMPONENT_Cb] ) ) );
#else
BinFracBits fracBitsQtCbf = fracBits.getFracBitsArray( Ctx::QtCbf[compID]( DeriveCtx::CtxQtCbf( rect.compID, tu.cbf[COMPONENT_Cb] ) ) );
#endif
d64BestCost = d64BlockUncodedCost + xGetICost( fracBitsQtCbf.intBits[0] );
d64BaseCost += xGetICost( fracBitsQtCbf.intBits[1] );
......
......@@ -303,10 +303,8 @@ void TrQuant::invTransformNxN( TransformUnit &tu, const ComponentID &compID, Pel
const uint32_t uiWidth = area.width;
const uint32_t uiHeight = area.height;
#if ENABLE_BMS
CHECK( uiWidth > tu.cs->sps->getMaxTrSize() || uiHeight > tu.cs->sps->getMaxTrSize(), "Maximal allowed transformation size exceeded!" );
#endif
if (tu.cu->transQuantBypass)
{
// where should this logic go?
......@@ -647,12 +645,8 @@ void TrQuant::transformNxN(TransformUnit &tu, const ComponentID &compID, const Q
}
}
#if ENABLE_BMS
// set coded block flag (CBF)
TU::setCbfAtDepth (tu, compID, tu.depth, uiAbsSum > 0);
#else
TU::setCbf( tu, compID, uiAbsSum > 0 );
#endif
}
void TrQuant::applyForwardRDPCM(TransformUnit &tu, const ComponentID &compID, const QpParam &cQP, TCoeff &uiAbsSum, const RDPCMMode &mode)
......
......@@ -214,17 +214,12 @@
#define KEEP_PRED_AND_RESI_SIGNALS 0
#define ENABLE_BMS 1
#if QTBT_AS_IN_JEM // macros which will cause changes in the decoder behavior ara marked with *** - keep them on to retain compatibility with JEM-toolcheck
#define HM_NO_ADDITIONAL_SPEEDUPS 0
#define HM_QTBT_AS_IN_JEM 1 // ***
#if HM_QTBT_AS_IN_JEM
#define HM_QTBT_AS_IN_JEM_CONTEXT 1 // ***
#define HM_QTBT_AS_IN_JEM_SYNTAX ( 1 && !( ENABLE_BMS ) ) // *** -- cannot be enabled if ENABLE_BMS is on
#define HM_QTBT_AS_IN_JEM_QUANT 1 // ***
#define HM_QTBT_REPRODUCE_FAST_LCTU_BUG 1
#define HM_QTBT_ONLY_QT_IMPLICIT 0 // ***
#endif
#define HM_CODED_CU_INFO 1 // like in JEM, when related CU is skipped, it stays like this even if a non skip mode wins...
#define HM_4TAPIF_AS_IN_JEM 1 // *** - PM: condition not well suited for 4-tap interpolation filters
......@@ -239,13 +234,6 @@
#endif//JEM_COMP
#if ENABLE_BMS
#if HM_QTBT_AS_IN_JEM_SYNTAX
#error HM_QTBT_AS_IN_JEM_SYNTAX cannot be enabled if ENABLE_BMS is enabled
#endif
#endif
// ====================================================================================================================
// Debugging
// ====================================================================================================================
......@@ -307,12 +295,6 @@
// End of SIMD optimizations
#define ENABLE_RQT_INTRA_SPEEDUP_MOD 0 ///< tests two best modes with full rqt
#if ENABLE_RQT_INTRA_SPEEDUP_MOD
#error
#endif
#define ME_ENABLE_ROUNDING_OF_MVS 1 ///< 0 (default) = disables rounding of motion vectors when right shifted, 1 = enables rounding
#define RDOQ_CHROMA_LAMBDA 1 ///< F386: weighting of chroma for RDOQ
......
......@@ -544,9 +544,7 @@ void TransformUnit::initData()
transformSkip[i] = false;
compAlpha[i] = 0;
}
#if ENABLE_BMS
depth = 0;
#endif
emtIdx = 0;
}
......@@ -581,9 +579,7 @@ TransformUnit& TransformUnit::operator=(const TransformUnit& other)
transformSkip[i] = other.transformSkip[i];
compAlpha[i] = other.compAlpha[i];
}
#if ENABLE_BMS
depth = other.depth;
#endif
emtIdx = other.emtIdx;
return *this;
}
......@@ -604,10 +600,8 @@ void TransformUnit::copyComponentFrom(const TransformUnit& other, const Componen
transformSkip[i] = other.transformSkip[i];
compAlpha[i] = other.compAlpha[i];
#if ENABLE_BMS
depth = other.depth;
#endif
if( isLuma( i ) )
{
emtIdx = other.emtIdx;
......
......@@ -428,9 +428,7 @@ struct TransformUnit : public UnitArea
CodingStructure *cs;
ChannelType chType;
#if ENABLE_BMS
uint8_t depth;
#endif
uint8_t emtIdx;
uint8_t cbf [ MAX_NUM_TBLOCKS ];
RDPCMMode rdpcm [ MAX_NUM_TBLOCKS ];
......
......@@ -116,9 +116,7 @@ void Partitioner::copyState( const Partitioner& other )
currQtDepth = other.currQtDepth;
currDepth = other.currDepth;
currMtDepth = other.currMtDepth;
#if ENABLE_BMS
currTrDepth = other.currTrDepth;
#endif
currImplicitBtDepth
= other.currImplicitBtDepth;
chType = other.chType;
......@@ -224,9 +222,7 @@ void QTBTPartitioner::initCtu( const UnitArea& ctuArea, const ChannelType _chTyp
m_currArea = ctuArea;
#endif
currDepth = 0;
#if ENABLE_BMS
currTrDepth = 0;
#endif
currBtDepth = 0;
currMtDepth = 0;
currQtDepth = 0;
......@@ -259,11 +255,9 @@ void QTBTPartitioner::splitCurrArea( const PartSplit split, const CodingStructur
CHECK( ( cs.sps->getSpsNext().getMTTMode() & 1 ) != 1, "Triple splits are not allowed" );
m_partStack.push_back( PartLevel( split, PartitionerImpl::getCUSubPartitions( currArea(), cs, split ) ) );
break;
#if ENABLE_BMS
case TU_MAX_TR_SPLIT:
m_partStack.push_back( PartLevel( split, PartitionerImpl::getMaxTuTiling( currArea(), cs ) ) );
break;
#endif
default:
THROW( "Unknown split mode" );
break;
......@@ -274,18 +268,14 @@ void QTBTPartitioner::splitCurrArea( const PartSplit split, const CodingStructur
m_currArea = m_partStack.back().parts.front();
#endif
#if ENABLE_BMS
if( split == TU_MAX_TR_SPLIT )
{
currTrDepth++;
}
#endif
#if ENABLE_BMS
else
{
currTrDepth = 0;
}
#endif
if( split == CU_HORZ_SPLIT || split == CU_VERT_SPLIT || split == CU_TRIH_SPLIT || split == CU_TRIV_SPLIT )
{
......@@ -322,9 +312,7 @@ 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 );
#if ENABLE_BMS
const unsigned maxTrSize = cs.sps->getMaxTrSize();
#endif
const PartSplit lastSplit = m_partStack.back().split;
const PartSplit parlSplit = lastSplit == CU_TRIH_SPLIT ? CU_HORZ_SPLIT : CU_VERT_SPLIT;
......@@ -340,11 +328,9 @@ bool QTBTPartitioner::canSplit( const PartSplit split, const CodingStructure &cs
THROW( "Checking if top level split is possible" );
return true;
break;
#if ENABLE_BMS
case TU_MAX_TR_SPLIT:
return area.width > maxTrSize || area.height > maxTrSize;
break;
#endif
case CU_QUAD_SPLIT:
{
// don't allow QT-splitting below a BT split
......@@ -457,13 +443,6 @@ PartSplit QTBTPartitioner::getImplicitSplit( const CodingStructure &cs )
PartSplit split = CU_DONT_SPLIT;
#if !ENABLE_BMS
if( currArea().lwidth() > cs.sps->getMaxTrSize() || currArea().lheight() > cs.sps->getMaxTrSize() )
{
split = CU_QUAD_SPLIT;
}
#endif
if( split == CU_DONT_SPLIT )
{
const bool isBlInPic = cs.picture->Y().contains( currArea().Y().bottomLeft() );
......@@ -531,19 +510,15 @@ void QTBTPartitioner::exitCurrSplit()
currBtDepth--;
}
}
#if ENABLE_BMS
else if( currSplit == TU_MAX_TR_SPLIT )
{
CHECK( currTrDepth == 0, "TR depth is '0', although a TU split was performed" );
currTrDepth--;
}
#endif
else
{
#if ENABLE_BMS
CHECK( currTrDepth > 0, "RQT found with QTBT partitioner" );
#endif
CHECK( currQtDepth == 0, "QT depth is '0', although a QT split was performed" );
currQtDepth--;
}
......@@ -804,7 +779,6 @@ Partitioning PartitionerImpl::getCUSubPartitions( const UnitArea &cuArea, const
}
}
#if ENABLE_BMS
static const int g_maxRtGridSize = 3;
static const int g_zScanToX[1 << ( g_maxRtGridSize << 1 )] =
......@@ -880,4 +854,3 @@ Partitioning PartitionerImpl::getMaxTuTiling( const UnitArea &cuArea, const Codi
return ret;
}
#endif
......@@ -42,12 +42,8 @@
#include "CommonDef.h"
#if ENABLE_BMS
static_assert( MAX_CU_TILING_PARTITIONS >= 4, "Minimum required number of partitions for the Partitioning type is 4!" );
typedef static_vector<UnitArea, MAX_CU_TILING_PARTITIONS> Partitioning;
#else
typedef static_vector<UnitArea, 4> Partitioning;
#endif
//////////////////////////////////////////////////////////////////////////
// PartManager class - manages the partitioning tree
......@@ -66,9 +62,7 @@ enum PartSplit
CU_VERT_SPLIT,
CU_TRIH_SPLIT,
CU_TRIV_SPLIT,
#if ENABLE_BMS
TU_MAX_TR_SPLIT,
#endif
NUM_PART_SPLIT,
CU_MT_SPLIT = 1000, ///< dummy element to indicate the MT (multi-type-tree) split
CU_BT_SPLIT = 1001, ///< dummy element to indicate the BT split
......@@ -107,9 +101,7 @@ protected:
public:
unsigned currDepth;
unsigned currQtDepth;
#if ENABLE_BMS
unsigned currTrDepth;
#endif
unsigned currBtDepth;
unsigned currMtDepth;
......@@ -177,9 +169,7 @@ namespace PartitionerFactory
namespace PartitionerImpl
{
Partitioning getCUSubPartitions( const UnitArea &cuArea, const CodingStructure &cs, const PartSplit splitType = CU_QUAD_SPLIT );
#if ENABLE_BMS
Partitioning getMaxTuTiling ( const UnitArea& curArea, const CodingStructure &cs );
#endif
};
#endif
......@@ -5403,14 +5403,9 @@ bool TU::isNonTransformedResidualRotated(const TransformUnit &tu, const Componen
bool TU::getCbf( const TransformUnit &tu, const ComponentID &compID )
{
#if ENABLE_BMS
return getCbfAtDepth( tu, compID, tu.depth );
#else
return tu.cbf[compID];
#endif
}
#if ENABLE_BMS
bool TU::getCbfAtDepth(const TransformUnit &tu, const ComponentID &compID, const unsigned &depth)
{
return ((tu.cbf[compID] >> depth) & 1) == 1;
......@@ -5423,12 +5418,6 @@ void TU::setCbfAtDepth(TransformUnit &tu, const ComponentID &compID, const unsig
// then set the CBF
tu.cbf[compID] |= ((cbf ? 1 : 0) << depth);
}
#else
void TU::setCbf( TransformUnit &tu, const ComponentID &compID, const bool &cbf )
{
tu.cbf[compID] = cbf;
}
#endif
bool TU::hasTransformSkipFlag(const CodingStructure& cs, const CompArea& area)
{
......
......@@ -207,12 +207,8 @@ namespace TU
#endif
bool isNonTransformedResidualRotated(const TransformUnit &tu, const ComponentID &compID);
bool getCbf (const TransformUnit &tu, const ComponentID &compID);
#if ENABLE_BMS
bool getCbfAtDepth (const TransformUnit &tu, const ComponentID &compID, const unsigned &depth);
void setCbfAtDepth ( TransformUnit &tu, const ComponentID &compID, const unsigned &depth, const bool &cbf);
#else
void setCbf ( TransformUnit &tu, const ComponentID &compID, const bool &cbf);
#endif
bool hasTransformSkipFlag (const CodingStructure& cs, const CompArea& area);
uint32_t getGolombRiceStatisticsIndex (const TransformUnit &tu, const ComponentID &compID);
#if HEVC_USE_MDCS
......
......@@ -599,16 +599,9 @@ PartSplit CABACReader::split_cu_mode_mt( CodingStructure& cs, Partitioner &parti
DecisionTree dt( g_mtSplitDTT );
#if HM_QTBT_AS_IN_JEM_SYNTAX
unsigned minBTSize = cs.slice->isIntra() ? ( partitioner.chType == 0 ? MIN_BT_SIZE : MIN_BT_SIZE_C ) : MIN_BT_SIZE_INTER;
dt.setAvail( DTT_SPLIT_BT_HORZ, height > minBTSize && ( partitioner.canSplit( CU_HORZ_SPLIT, cs ) || width == minBTSize ) );
dt.setAvail( DTT_SPLIT_BT_VERT, width > minBTSize && ( partitioner.canSplit( CU_VERT_SPLIT, cs ) || height == minBTSize ) );
#else
dt.setAvail( DTT_SPLIT_BT_HORZ, partitioner.canSplit( CU_HORZ_SPLIT, cs ) );
dt.setAvail( DTT_SPLIT_BT_VERT, partitioner.canSplit( CU_VERT_SPLIT, cs ) );
#endif
dt.setAvail( DTT_SPLIT_TT_HORZ, partitioner.canSplit( CU_TRIH_SPLIT, cs ) );
dt.setAvail( DTT_SPLIT_TT_VERT, partitioner.canSplit( CU_TRIV_SPLIT, cs ) );
dt.setAvail( DTT_SPLIT_NO_SPLIT, partitioner.canSplit( CU_DONT_SPLIT, cs ) );
......@@ -1154,9 +1147,7 @@ void CABACReader::cu_residual( CodingUnit& cu, Partitioner &partitioner, CUCtx&
if( !cu.rootCbf )
{
TransformUnit& tu = cu.cs->addTU(cu, partitioner.chType);
#if ENABLE_BMS
tu.depth = 0;
#endif
for( unsigned c = 0; c < tu.blocks.size(); c++ )
{
tu.cbf[c] = 0;
......@@ -1898,9 +1889,7 @@ void CABACReader::pcm_samples( TransformUnit& tu )
const SPS& sps = *tu.cu->cs->sps;
const ComponentID maxCompId = ( tu.chromaFormat == CHROMA_400 ? COMPONENT_Y : COMPONENT_Cr );
#if ENABLE_BMS
tu.depth = 0;
#endif
for( ComponentID compID = COMPONENT_Y; compID <= maxCompId; compID = ComponentID(compID+1) )
{
PelBuf samples = tu.getPcmbuf( compID );
......@@ -1932,31 +1921,7 @@ void CABACReader::transform_tree( CodingStructure &cs, Partitioner &partitioner,
{
const UnitArea& area = partitioner.currArea();
#if HM_QTBT_AS_IN_JEM_SYNTAX
if( cs.pcv->noRQT )
{
TransformUnit &tu = cs.addTU( CS::getArea( cs, area, partitioner.chType ), partitioner.chType );
#if ENABLE_BMS
tu.depth = 0;
#endif
unsigned numBlocks = ::getNumberValidTBlocks( *cs.pcv );
for( unsigned compID = COMPONENT_Y; compID < numBlocks; compID++ )
{
if( tu.blocks[compID].valid() )
{
tu.getCoeffs( ComponentID( compID ) ).fill( 0 );
tu.getPcmbuf( ComponentID( compID ) ).fill( 0 );
}
}
transform_unit_qtbt( tu, cuCtx, chromaCbfs );
return;
}
#endif
CodingUnit& cu = *cs.getCU( area.blocks[partitioner.chType], partitioner.chType );
#if ENABLE_BMS
const unsigned trDepth = partitioner.currTrDepth;
// split_transform_flag
......@@ -1965,7 +1930,6 @@ void CABACReader::transform_tree( CodingStructure &cs, Partitioner &partitioner,
{
split = partitioner.canSplit( TU_MAX_TR_SPLIT, cs );
}
#endif
// cbf_cb & cbf_cr
if( area.chromaFormat != CHROMA_400 && area.blocks[COMPONENT_Cb].valid() && ( !CS::isDualITree( cs ) || partitioner.chType == CHANNEL_TYPE_CHROMA ) )
......@@ -1974,19 +1938,11 @@ void CABACReader::transform_tree( CodingStructure &cs, Partitioner &partitioner,
{
if( chromaCbfs.Cb )
{
#if ENABLE_BMS
chromaCbfs.Cb &= cbf_comp( cs, area.blocks[COMPONENT_Cb], trDepth );
#else
chromaCbfs.Cb &= cbf_comp( cs, area.blocks[COMPONENT_Cb] );
#endif
}
if( chromaCbfs.Cr )
{
#if ENABLE_BMS
chromaCbfs.Cr &= cbf_comp( cs, area.blocks[COMPONENT_Cr], trDepth, chromaCbfs.Cb );
#else
chromaCbfs.Cr &= cbf_comp( cs, area.blocks[COMPONENT_Cr], chromaCbfs.Cb );
#endif
}
}
}
......@@ -1996,7 +1952,6 @@ void CABACReader::transform_tree( CodingStructure &cs, Partitioner &partitioner,
chromaCbfs = ChromaCbfs( false );
}
#if ENABLE_BMS
if( split )
{
{
......@@ -2004,7 +1959,6 @@ void CABACReader::transform_tree( CodingStructure &cs, Partitioner &partitioner,
if( trDepth == 0 ) emt_cu_flag( cu );
#endif
#if ENABLE_BMS
if( partitioner.canSplit( TU_MAX_TR_SPLIT, cs ) )
{
#if ENABLE_TRACING
......@@ -2015,7 +1969,6 @@ void CABACReader::transform_tree( CodingStructure &cs, Partitioner &partitioner,
partitioner.splitCurrArea( TU_MAX_TR_SPLIT, cs );
}
else
#endif
THROW( "Implicit TU split not available!" );
}
......@@ -2055,7 +2008,6 @@ void CABACReader::transform_tree( CodingStructure &cs, Partitioner &partitioner,
}
}
else
#endif
{
TransformUnit &tu = cs.addTU( CS::getArea( cs, area, partitioner.chType ), partitioner.chType );
unsigned numBlocks = ::getNumberValidTBlocks( *cs.pcv );
......@@ -2068,76 +2020,38 @@ void CABACReader::transform_tree( CodingStructure &cs, Partitioner &partitioner,
tu.getPcmbuf( ComponentID( compID ) ).fill( 0 );
}
}
#if ENABLE_BMS
tu.depth = trDepth;
#endif
#if ENABLE_BMS
DTRACE( g_trace_ctx, D_SYNTAX, "transform_unit() pos=(%d,%d) size=%dx%d depth=%d trDepth=%d\n", tu.blocks[tu.chType].x, tu.blocks[tu.chType].y, tu.blocks[tu.chType].width, tu.blocks[tu.chType].height, cu.depth, partitioner.currTrDepth );
#else
DTRACE( g_trace_ctx, D_SYNTAX, "transform_unit() pos=(%d,%d) size=%dx%d depth=%d\n", tu.blocks[tu.chType].x, tu.blocks[tu.chType].y, tu.blocks[tu.chType].width, tu.blocks[tu.chType].height, cu.depth );
#endif
if( !isChroma( partitioner.chType ) )
{
#if ENABLE_BMS
if( !CU::isIntra( cu ) && trDepth == 0 && !chromaCbfs.sigChroma( area.chromaFormat ) )
{
TU::setCbfAtDepth( tu, COMPONENT_Y, trDepth, 1 );
}
#else
if( !CU::isIntra( cu ) && !chromaCbfs.sigChroma( area.chromaFormat ) )
{
TU::setCbf( tu, COMPONENT_Y, true );
}
#endif
else
{
#if ENABLE_BMS
bool cbfY = cbf_comp( cs, tu.Y(), trDepth );
#else
bool cbfY = cbf_comp( cs, tu.Y() );
#endif
#if ENABLE_BMS
TU::setCbfAtDepth( tu, COMPONENT_Y, trDepth, ( cbfY ? 1 : 0 ) );
#else
TU::setCbf( tu, COMPONENT_Y, cbfY );
#endif
}
}
if( area.chromaFormat != CHROMA_400 )
{
#if ENABLE_BMS