diff --git a/source/Lib/CommonLib/dtrace_blockstatistics.cpp b/source/Lib/CommonLib/dtrace_blockstatistics.cpp index 5971ab4046563e91164918e0f8c3608e9921a4fa..7419c1964784584517f5a21943e8f66f62caede3 100644 --- a/source/Lib/CommonLib/dtrace_blockstatistics.cpp +++ b/source/Lib/CommonLib/dtrace_blockstatistics.cpp @@ -437,10 +437,12 @@ 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_M0464_UNI_MTS if (!(!((cs.sps->getSpsNext().getUseIntraEMT() && CU::isIntra(cu)) || (cs.sps->getSpsNext().getUseInterEMT() && CU::isInter(cu))) || isChroma(cu.chType))) { DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, cu, GetBlockStatisticName(BlockStatistic::EMTFlag), cu.emtFlag); } +#endif DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, cu, GetBlockStatisticName(BlockStatistic::MMVDSkipFlag), cu.mmvdSkip); } else if( chType == CHANNEL_TYPE_CHROMA ) @@ -458,10 +460,12 @@ void writeAllData(const CodingStructure& cs, const UnitArea& ctuArea) DTRACE_BLOCK_SCALAR_CHROMA(g_trace_ctx, D_BLOCK_STATISTICS_ALL, cu, GetBlockStatisticName(BlockStatistic::TransQuantBypassFlag_Chroma), cu.transQuantBypass); } +#if !JVET_M0464_UNI_MTS if (!(!((cs.sps->getSpsNext().getUseIntraEMT() && CU::isIntra(cu)) || (cs.sps->getSpsNext().getUseInterEMT() && CU::isInter(cu))) || isChroma(cu.chType))) { DTRACE_BLOCK_SCALAR_CHROMA(g_trace_ctx, D_BLOCK_STATISTICS_ALL, cu, GetBlockStatisticName(BlockStatistic::EMTFlag_Chroma), cu.emtFlag); } +#endif } @@ -721,14 +725,20 @@ void writeAllData(const CodingStructure& cs, const UnitArea& ctuArea) if (tu.Y().valid()) { DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, tu, GetBlockStatisticName(BlockStatistic::Cbf_Y), tu.cbf[COMPONENT_Y]); +#if JVET_M0464_UNI_MTS + DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, tu, GetBlockStatisticName(BlockStatistic::MTSIdx), tu.mtsIdx); +#else DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, tu, GetBlockStatisticName(BlockStatistic::TransformSkipFlag_Y), tu.transformSkip[COMPONENT_Y]); +#endif } 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]); DTRACE_BLOCK_SCALAR_CHROMA(g_trace_ctx, D_BLOCK_STATISTICS_ALL, tu, GetBlockStatisticName(BlockStatistic::Cbf_Cr), tu.cbf[COMPONENT_Cr]); +#if !JVET_M0464_UNI_MTS DTRACE_BLOCK_SCALAR_CHROMA(g_trace_ctx, D_BLOCK_STATISTICS_ALL, tu, GetBlockStatisticName(BlockStatistic::TransformSkipFlag_Cb), tu.transformSkip[COMPONENT_Cb]); DTRACE_BLOCK_SCALAR_CHROMA(g_trace_ctx, D_BLOCK_STATISTICS_ALL, tu, GetBlockStatisticName(BlockStatistic::TransformSkipFlag_Cr), tu.transformSkip[COMPONENT_Cr]); +#endif } } } @@ -1006,15 +1016,20 @@ void writeAllCodedData(const CodingStructure & cs, const UnitArea & ctuArea) if (tu.Y().valid()) { DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_CODED, tu, GetBlockStatisticName(BlockStatistic::Cbf_Y), tu.cbf[COMPONENT_Y]); +#if JVET_M0464_UNI_MTS + DTRACE_BLOCK_SCALAR( g_trace_ctx, D_BLOCK_STATISTICS_CODED, tu, GetBlockStatisticName( BlockStatistic::MTSIdx ), tu.mtsIdx ); +#else if (!(!tu.cu->cs->pps->getUseTransformSkip() || tu.cu->transQuantBypass || !TU::hasTransformSkipFlag(*tu.cs, tu.blocks[COMPONENT_Y]) || (isLuma(COMPONENT_Y) && tu.cu->emtFlag))) { DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_CODED, tu, GetBlockStatisticName(BlockStatistic::TransformSkipFlag_Y), tu.transformSkip[COMPONENT_Y]); } +#endif } if (!(cu.chromaFormat == CHROMA_400 || (CS::isDualITree(*cu.cs) && cu.chType == CHANNEL_TYPE_LUMA))) { DTRACE_BLOCK_SCALAR_CHROMA(g_trace_ctx, D_BLOCK_STATISTICS_CODED, tu, GetBlockStatisticName(BlockStatistic::Cbf_Cb), tu.cbf[COMPONENT_Cb]); DTRACE_BLOCK_SCALAR_CHROMA(g_trace_ctx, D_BLOCK_STATISTICS_CODED, tu, GetBlockStatisticName(BlockStatistic::Cbf_Cr), tu.cbf[COMPONENT_Cr]); +#if !JVET_M0464_UNI_MTS if (!(!tu.cu->cs->pps->getUseTransformSkip() || tu.cu->transQuantBypass || !TU::hasTransformSkipFlag(*tu.cs, tu.blocks[COMPONENT_Cb]) || (isLuma(COMPONENT_Cb) && tu.cu->emtFlag))) { DTRACE_BLOCK_SCALAR_CHROMA(g_trace_ctx, D_BLOCK_STATISTICS_CODED, tu, GetBlockStatisticName(BlockStatistic::TransformSkipFlag_Cb), tu.transformSkip[COMPONENT_Cb]); @@ -1023,9 +1038,11 @@ void writeAllCodedData(const CodingStructure & cs, const UnitArea & ctuArea) { DTRACE_BLOCK_SCALAR_CHROMA(g_trace_ctx, D_BLOCK_STATISTICS_CODED, tu, GetBlockStatisticName(BlockStatistic::TransformSkipFlag_Cr), tu.transformSkip[COMPONENT_Cr]); } +#endif } } } +#if !JVET_M0464_UNI_MTS if (!(!((cs.sps->getSpsNext().getUseIntraEMT() && CU::isIntra(cu)) || (cs.sps->getSpsNext().getUseInterEMT() && CU::isInter(cu))) || isChroma(cu.chType))) { if( isLuma( ChannelType( chType ) ) ) @@ -1037,6 +1054,7 @@ void writeAllCodedData(const CodingStructure & cs, const UnitArea & ctuArea) DTRACE_BLOCK_SCALAR_CHROMA(g_trace_ctx, D_BLOCK_STATISTICS_CODED, cu, GetBlockStatisticName(BlockStatistic::EMTFlag_Chroma), cu.emtFlag); } } +#endif } } } diff --git a/source/Lib/CommonLib/dtrace_blockstatistics.h b/source/Lib/CommonLib/dtrace_blockstatistics.h index 34d457098ab571aa683c1cd49efbba568eee2515..a7c5c5fa5c7f9fb136678d1469df2d17830a8e5a 100644 --- a/source/Lib/CommonLib/dtrace_blockstatistics.h +++ b/source/Lib/CommonLib/dtrace_blockstatistics.h @@ -64,10 +64,14 @@ enum class BlockStatistic { QP, SplitSeries, TransQuantBypassFlag, +#if JVET_M0464_UNI_MTS + MTSIdx, +#else EMTFlag, TransformSkipFlag_Y, TransformSkipFlag_Cb, TransformSkipFlag_Cr, +#endif // intra IPCM, @@ -119,7 +123,9 @@ enum class BlockStatistic { QP_Chroma, SplitSeries_Chroma, TransQuantBypassFlag_Chroma, +#if !JVET_M0464_UNI_MTS EMTFlag_Chroma, // this is called flag, though the type is UChar ?! +#endif // intra IPCM_Chroma, @@ -150,9 +156,13 @@ static const std::map<BlockStatistic, std::tuple<std::string, BlockStatisticType { BlockStatistic::Luma_IntraMode, std::tuple<std::string, BlockStatisticType, std::string>{"Luma_IntraMode", BlockStatisticType::Integer, "[0, " + std::to_string(NUM_INTRA_MODE) + "]"}}, { 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, ""}}, +#if JVET_M0464_UNI_MTS + { BlockStatistic::MTSIdx, std::tuple<std::string, BlockStatisticType, std::string>{"TransformSkipFlag_Y", BlockStatisticType::Integer, ""}}, +#else { BlockStatistic::TransformSkipFlag_Y, std::tuple<std::string, BlockStatisticType, std::string>{"TransformSkipFlag_Y", BlockStatisticType::Flag, ""}}, { BlockStatistic::TransformSkipFlag_Cb, std::tuple<std::string, BlockStatisticType, std::string>{"TransformSkipFlag_Cb", BlockStatisticType::Flag, ""}}, { BlockStatistic::TransformSkipFlag_Cr, std::tuple<std::string, BlockStatisticType, std::string>{"TransformSkipFlag_Cr", BlockStatisticType::Flag, ""}}, +#endif { 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]"}}, @@ -179,7 +189,9 @@ static const std::map<BlockStatistic, std::tuple<std::string, BlockStatisticType { BlockStatistic::AffineMVL0, std::tuple<std::string, BlockStatisticType, std::string>{"AffineMVL0", BlockStatisticType::AffineTFVectors, "Scale: 4"}}, { BlockStatistic::AffineMVL1, std::tuple<std::string, BlockStatisticType, std::string>{"AffineMVL1", BlockStatisticType::AffineTFVectors, "Scale: 4"}}, { BlockStatistic::AffineType, std::tuple<std::string, BlockStatisticType, std::string>{"AffineType", BlockStatisticType::Flag, ""} }, +#if !JVET_M0464_UNI_MTS { BlockStatistic::EMTFlag, std::tuple<std::string, BlockStatisticType, std::string>{"EMTFlag", BlockStatisticType::Flag, ""}}, +#endif { BlockStatistic::MotionBufL0, std::tuple<std::string, BlockStatisticType, std::string>{"MotionBufL0", BlockStatisticType::Vector, "Scale: 16"}}, { BlockStatistic::MotionBufL1, std::tuple<std::string, BlockStatisticType, std::string>{"MotionBufL1", BlockStatisticType::Vector, "Scale: 16"}}, { BlockStatistic::MultiRefIdx, std::tuple<std::string, BlockStatisticType, std::string>{"MultiRefIdx", BlockStatisticType::Integer, "[0, 1]"}}, @@ -202,7 +214,9 @@ static const std::map<BlockStatistic, std::tuple<std::string, BlockStatisticType { BlockStatistic::QP_Chroma, std::tuple<std::string, BlockStatisticType, std::string>{"QP_Chroma", BlockStatisticType::Integer, "[0, 51]"}}, { BlockStatistic::SplitSeries_Chroma, std::tuple<std::string, BlockStatisticType, std::string>{"SplitSeries_Chroma", BlockStatisticType::Integer, "[0, " + std::to_string(std::numeric_limits<SplitSeries>::max()) + "]"}}, { BlockStatistic::TransQuantBypassFlag_Chroma, std::tuple<std::string, BlockStatisticType, std::string>{"TransQuantBypassFlag_Chroma", BlockStatisticType::Flag, ""}}, +#if !JVET_M0464_UNI_MTS { BlockStatistic::EMTFlag_Chroma, std::tuple<std::string, BlockStatisticType, std::string>{"EMTFlag_Chroma", BlockStatisticType::Integer, "[0, 10]"}}, // todo: actual limits? +#endif { BlockStatistic::IPCM_Chroma, std::tuple<std::string, BlockStatisticType, std::string>{"IPCM_Chroma", BlockStatisticType::Flag, ""}}, };