diff --git a/source/Lib/CommonLib/dtrace_blockstatistics.cpp b/source/Lib/CommonLib/dtrace_blockstatistics.cpp index ce453a0424152ff3de8796b497efc27159a36186..2a740dd1c0424d8751bb61bf464a8d68bf2c75f6 100644 --- a/source/Lib/CommonLib/dtrace_blockstatistics.cpp +++ b/source/Lib/CommonLib/dtrace_blockstatistics.cpp @@ -437,6 +437,13 @@ void writeAllData(const CodingStructure& cs, const UnitArea& ctuArea) DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, cu, GetBlockStatisticName(BlockStatistic::SkipFlag), cu.skip); } +#if JVET_N0413_RDPCM + DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, cu, GetBlockStatisticName(BlockStatistic::BDPCM), cu.bdpcmMode); +#endif + DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, cu, GetBlockStatisticName(BlockStatistic::TileIdx), cu.tileIdx); +#if JVET_N0193_LFNST + DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, cu, GetBlockStatisticName(BlockStatistic::LFNSTIdx), cu.lfnstIdx); +#endif DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, cu, GetBlockStatisticName(BlockStatistic::MMVDSkipFlag), cu.mmvdSkip); } else if( chType == CHANNEL_TYPE_CHROMA ) @@ -467,6 +474,9 @@ void writeAllData(const CodingStructure& cs, const UnitArea& ctuArea) { DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, pu, GetBlockStatisticName(BlockStatistic::MergeFlag), pu.mergeFlag); } +#if JVET_N0324_REGULAR_MRG_FLAG + DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, pu, GetBlockStatisticName(BlockStatistic::RegularMergeFlag), pu.regularMergeFlag); +#endif if( pu.mergeFlag ) { DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, pu, GetBlockStatisticName(BlockStatistic::MergeIdx), pu.mergeIdx); @@ -657,18 +667,23 @@ void writeAllData(const CodingStructure& cs, const UnitArea& ctuArea) } + DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, cu, GetBlockStatisticName(BlockStatistic::SMVDFlag), cu.smvdMode); DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, cu, GetBlockStatisticName(BlockStatistic::IMVMode), cu.imv); DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, cu, GetBlockStatisticName(BlockStatistic::RootCbf), cu.rootCbf); DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, cu, GetBlockStatisticName(BlockStatistic::GBIIndex), cu.GBiIdx); - DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, cu, GetBlockStatisticName(BlockStatistic::IBCFlag), cu.predMode == MODE_IBC); + DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, cu, GetBlockStatisticName(BlockStatistic::SbtIdx), cu.getSbtIdx()); + DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, cu, GetBlockStatisticName(BlockStatistic::SbtPos), cu.getSbtPos()); } break; case MODE_INTRA: { - if(chType == CHANNEL_TYPE_LUMA) { DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, cu, GetBlockStatisticName(BlockStatistic::IPCM), cu.ipcm); +#if JVET_N0217_MATRIX_INTRAPRED + DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, cu, GetBlockStatisticName(BlockStatistic::MIPFlag), cu.mipFlag); +#endif + DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, cu, GetBlockStatisticName(BlockStatistic::ISPMode), cu.ispMode); } else if(chType == CHANNEL_TYPE_CHROMA) { @@ -714,6 +729,42 @@ void writeAllData(const CodingStructure& cs, const UnitArea& ctuArea) DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, tu, GetBlockStatisticName(BlockStatistic::Cbf_Y), tu.cbf[COMPONENT_Y]); DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, tu, GetBlockStatisticName(BlockStatistic::MTSIdx), tu.mtsIdx); } +#if JVET_N0054_JOINT_CHROMA + if ( tu.Cb().valid() ) + { + DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, tu, GetBlockStatisticName(BlockStatistic::JointCbCr), tu.jointCbCr); + } +#endif + + if( !CU::isIntra(cu) && CU::isRDPCMEnabled(cu) && ( tu.mtsIdx==MTS_SKIP || cu.transQuantBypass ) ) + { + if (tu.Y().valid()) + { + DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, tu, GetBlockStatisticName(BlockStatistic::RDPCM_Y), tu.rdpcm[COMPONENT_Y]); + } + if (tu.Cb().valid()) + { + DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, tu, GetBlockStatisticName(BlockStatistic::RDPCM_Cb), tu.rdpcm[COMPONENT_Cb]); + } + if (tu.Cr().valid()) + { + DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, tu, GetBlockStatisticName(BlockStatistic::RDPCM_Cr), tu.rdpcm[COMPONENT_Cr]); + } + } + + bool lumaOnly = ( cu.chromaFormat == CHROMA_400 || !tu.blocks[COMPONENT_Cb].valid() ); + if( !lumaOnly ) + { + if( TU::hasCrossCompPredInfo( tu, COMPONENT_Cb ) ) + { + DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, tu, GetBlockStatisticName(BlockStatistic::CompAlphaCb), tu.compAlpha[COMPONENT_Cb] ); + } + if( TU::hasCrossCompPredInfo( tu, COMPONENT_Cr ) ) + { + DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, tu, GetBlockStatisticName(BlockStatistic::CompAlphaCr), tu.compAlpha[COMPONENT_Cr] ); + } + } + if (!(cu.chromaFormat == CHROMA_400 || (CS::isDualITree(*cu.cs) && cu.chType == CHANNEL_TYPE_LUMA))) { DTRACE_BLOCK_SCALAR_CHROMA(g_trace_ctx, D_BLOCK_STATISTICS_ALL, tu, GetBlockStatisticName(BlockStatistic::Cbf_Cb), tu.cbf[COMPONENT_Cb]); diff --git a/source/Lib/CommonLib/dtrace_blockstatistics.h b/source/Lib/CommonLib/dtrace_blockstatistics.h index 56b5adec63f37049fcc7bf518083f0b0c2e40fbf..d31c6c3f5b38413689d8caf1107d60fbcf8fdcf9 100644 --- a/source/Lib/CommonLib/dtrace_blockstatistics.h +++ b/source/Lib/CommonLib/dtrace_blockstatistics.h @@ -65,21 +65,46 @@ enum class BlockStatistic { SplitSeries, TransQuantBypassFlag, MTSIdx, +#if JVET_N0413_RDPCM + BDPCM, +#endif + TileIdx, +#if JVET_N0193_LFNST + LFNSTIdx, +#endif +#if JVET_N0054_JOINT_CHROMA + JointCbCr, +#endif + CompAlphaCb, + CompAlphaCr, + RDPCM_Y, + RDPCM_Cb, + RDPCM_Cr, // intra IPCM, Luma_IntraMode, Chroma_IntraMode, MultiRefIdx, +#if JVET_N0217_MATRIX_INTRAPRED + MIPFlag, +#endif + ISPMode, + // inter SkipFlag, RootCbf, + SbtIdx, + SbtPos, Cbf_Y, Cbf_Cb, Cbf_Cr, IMVMode, InterDir, MergeFlag, +#if JVET_N0324_REGULAR_MRG_FLAG + RegularMergeFlag, +#endif MergeIdx, MergeType, MVPIdxL0, @@ -100,12 +125,12 @@ enum class BlockStatistic { MMVDMergeFlag, MMVDMergeIdx, MHIntraFlag, + SMVDFlag, TriangleFlag, TrianglePartitioning, TriangleMVL0, //<< currently only uni-prediction enabled TriangleMVL1, //<< currently only uni-prediction enabled GBIIndex, - IBCFlag, // for dual tree // general Depth_Chroma, @@ -138,8 +163,11 @@ static const std::map<BlockStatistic, std::tuple<std::string, BlockStatisticType { // Statistics enum Statistics name string Statistic Type Type specific information: // Value range, vector scale - { BlockStatistic::PredMode, std::tuple<std::string, BlockStatisticType, std::string>{"PredMode", BlockStatisticType::Flag, ""}}, + { BlockStatistic::PredMode, std::tuple<std::string, BlockStatisticType, std::string>{"PredMode", BlockStatisticType::Integer, "[0, " + std::to_string(NUMBER_OF_PREDICTION_MODES) + "]"}}, { BlockStatistic::MergeFlag, std::tuple<std::string, BlockStatisticType, std::string>{"MergeFlag", BlockStatisticType::Flag, ""}}, +#if JVET_N0324_REGULAR_MRG_FLAG + { BlockStatistic::RegularMergeFlag, std::tuple<std::string, BlockStatisticType, std::string>{"RegularMergeFlag", BlockStatisticType::Flag, ""}}, +#endif { BlockStatistic::MVL0, std::tuple<std::string, BlockStatisticType, std::string>{"MVL0", BlockStatisticType::Vector, "Scale: 4"}}, { BlockStatistic::MVL1, std::tuple<std::string, BlockStatisticType, std::string>{"MVL1", BlockStatisticType::Vector, "Scale: 4"}}, { BlockStatistic::IPCM, std::tuple<std::string, BlockStatisticType, std::string>{"IPCM", BlockStatisticType::Flag, ""}}, @@ -147,6 +175,26 @@ static const std::map<BlockStatistic, std::tuple<std::string, BlockStatisticType { BlockStatistic::Chroma_IntraMode, std::tuple<std::string, BlockStatisticType, std::string>{"Chroma_IntraMode", BlockStatisticType::Integer, "[0, " + std::to_string(NUM_INTRA_MODE) + "]"}}, { BlockStatistic::SkipFlag, std::tuple<std::string, BlockStatisticType, std::string>{"SkipFlag", BlockStatisticType::Flag, ""}}, { BlockStatistic::MTSIdx, std::tuple<std::string, BlockStatisticType, std::string>{"TransformSkipFlag_Y", BlockStatisticType::Integer, ""}}, +#if JVET_N0413_RDPCM + { BlockStatistic::BDPCM, std::tuple<std::string, BlockStatisticType, std::string>{"BDPCM", BlockStatisticType::Flag, ""}}, // called bdpcmMode, but used like a flag in the software? related to intra, but signalled always? +#endif + { BlockStatistic::TileIdx, std::tuple<std::string, BlockStatisticType, std::string>{"TileIdx", BlockStatisticType::Integer, ""}}, +#if JVET_N0193_LFNST + { BlockStatistic::LFNSTIdx, std::tuple<std::string, BlockStatisticType, std::string>{"LFNSTIdx", BlockStatisticType::Integer, "[0, 3]"}}, +#endif +#if JVET_N0054_JOINT_CHROMA + { BlockStatistic::JointCbCr, std::tuple<std::string, BlockStatisticType, std::string>{"JointCbCr", BlockStatisticType::Flag, ""}}, +#endif + { BlockStatistic::CompAlphaCb, std::tuple<std::string, BlockStatisticType, std::string>{"CompAlphaCb", BlockStatisticType::Integer, ""}}, + { BlockStatistic::CompAlphaCr, std::tuple<std::string, BlockStatisticType, std::string>{"CompAlphaCr", BlockStatisticType::Integer, ""}}, + { BlockStatistic::RDPCM_Y, std::tuple<std::string, BlockStatisticType, std::string>{"RDPCM_Y", BlockStatisticType::Integer, "[0, " + std::to_string(NUMBER_OF_RDPCM_MODES) + "]"}}, + { BlockStatistic::RDPCM_Cb, std::tuple<std::string, BlockStatisticType, std::string>{"RDPCM_Cb", BlockStatisticType::Integer, "[0, " + std::to_string(NUMBER_OF_RDPCM_MODES) + "]"}}, + { BlockStatistic::RDPCM_Cr, std::tuple<std::string, BlockStatisticType, std::string>{"RDPCM_Cr", BlockStatisticType::Integer, "[0, " + std::to_string(NUMBER_OF_RDPCM_MODES) + "]"}}, + +#if JVET_N0217_MATRIX_INTRAPRED + { BlockStatistic::MIPFlag, std::tuple<std::string, BlockStatisticType, std::string>{"MIPFlag", BlockStatisticType::Flag, ""}}, +#endif + { BlockStatistic::ISPMode, std::tuple<std::string, BlockStatisticType, std::string>{"ISPMode", BlockStatisticType::Integer, "[0, " + std::to_string(NUM_INTRA_SUBPARTITIONS_MODES) + "]"}}, { BlockStatistic::Depth, std::tuple<std::string, BlockStatisticType, std::string>{"Depth", BlockStatisticType::Integer, "[0, 7]"}}, { BlockStatistic::QT_Depth, std::tuple<std::string, BlockStatisticType, std::string>{"QT_Depth", BlockStatisticType::Integer, "[0, 7]"}}, { BlockStatistic::BT_Depth, std::tuple<std::string, BlockStatisticType, std::string>{"BT_Depth", BlockStatisticType::Integer, "[0, 7]"}}, @@ -155,6 +203,8 @@ static const std::map<BlockStatistic, std::tuple<std::string, BlockStatisticType { BlockStatistic::QP, std::tuple<std::string, BlockStatisticType, std::string>{"QP", BlockStatisticType::Integer, "[0, 51]"}}, { BlockStatistic::SplitSeries, std::tuple<std::string, BlockStatisticType, std::string>{"SplitSeries", BlockStatisticType::Integer, "[0, " + std::to_string(std::numeric_limits<SplitSeries>::max()) + "]"}}, { BlockStatistic::RootCbf, std::tuple<std::string, BlockStatisticType, std::string>{"RootCbf", BlockStatisticType::Flag, ""}}, + { BlockStatistic::SbtIdx, std::tuple<std::string, BlockStatisticType, std::string>{"SbtIdx", BlockStatisticType::Integer, "[0, " + std::to_string(NUMBER_SBT_IDX) + "]"}}, + { BlockStatistic::SbtPos, std::tuple<std::string, BlockStatisticType, std::string>{"SbtPos", BlockStatisticType::Integer, "[0, " + std::to_string(NUMBER_SBT_POS) + "]"}}, { BlockStatistic::Cbf_Y, std::tuple<std::string, BlockStatisticType, std::string>{"Cbf_Y", BlockStatisticType::Flag, ""}}, { BlockStatistic::Cbf_Cb, std::tuple<std::string, BlockStatisticType, std::string>{"Cbf_Cb", BlockStatisticType::Flag, ""}}, { BlockStatistic::Cbf_Cr, std::tuple<std::string, BlockStatisticType, std::string>{"Cbf_Cr", BlockStatisticType::Flag, ""}}, @@ -180,12 +230,12 @@ static const std::map<BlockStatistic, std::tuple<std::string, BlockStatisticType { BlockStatistic::MMVDMergeFlag, std::tuple<std::string, BlockStatisticType, std::string>{"MMVDMergeFlag", BlockStatisticType::Flag, ""}}, { BlockStatistic::MMVDMergeIdx, std::tuple<std::string, BlockStatisticType, std::string>{"MMVDMergeIdx", BlockStatisticType::Integer, "[0, 1]"}}, { BlockStatistic::MHIntraFlag, std::tuple<std::string, BlockStatisticType, std::string>{"MHIntraFlag", BlockStatisticType::Flag, ""}}, + { BlockStatistic::SMVDFlag, std::tuple<std::string, BlockStatisticType, std::string>{"SMVDFlag", BlockStatisticType::Flag, ""}}, { BlockStatistic::TriangleFlag, std::tuple<std::string, BlockStatisticType, std::string>{"TriangleFlag", BlockStatisticType::Flag, ""}}, { BlockStatistic::TrianglePartitioning, std::tuple<std::string, BlockStatisticType, std::string>{"TrianglePartitioning", BlockStatisticType::Line, ""}}, { BlockStatistic::TriangleMVL0, std::tuple<std::string, BlockStatisticType, std::string>{"TriangleMVL0", BlockStatisticType::VectorPolygon, "Scale: 4"}}, { BlockStatistic::TriangleMVL1, std::tuple<std::string, BlockStatisticType, std::string>{"TriangleMVL1", BlockStatisticType::VectorPolygon, "Scale: 4"}}, { BlockStatistic::GBIIndex, std::tuple<std::string, BlockStatisticType, std::string>{"GBIIndex", BlockStatisticType::Integer, "[0, 4]"}}, - { BlockStatistic::IBCFlag, std::tuple<std::string, BlockStatisticType, std::string>{"IBCFlag", BlockStatisticType::Flag, ""}}, // for dual tree { BlockStatistic::Depth_Chroma, std::tuple<std::string, BlockStatisticType, std::string>{"Depth_Chroma", BlockStatisticType::Integer, "[0, 10]"}}, // todo: actual limits? { BlockStatistic::QT_Depth_Chroma, std::tuple<std::string, BlockStatisticType, std::string>{"QT_Depth_Chroma", BlockStatisticType::Integer, "[0, 10]"}}, // todo: actual limits?