Commit dcef4aae authored by Johannes Sauer's avatar Johannes Sauer

fixed CPR bv for chroma block in dual tree

parent 03a990f2
......@@ -495,8 +495,13 @@ void writeAllData(const CodingStructure& cs, const UnitArea& ctuArea)
{
if(cu.ibc)
{
DTRACE_BLOCK_VECTOR_CHROMA(g_trace_ctx, D_BLOCK_STATISTICS_ALL, pu, GetBlockStatisticName(BlockStatistic::IBC_BV_Chroma), pu.mv[0].hor, pu.mv[0].ver);
DTRACE_BLOCK_VECTOR_CHROMA(g_trace_ctx, D_BLOCK_STATISTICS_ALL, pu, GetBlockStatisticName(BlockStatistic::IBC_BVD_Chroma), pu.mvd[0].hor, pu.mvd[0].ver);
// separated tree, chroma
const CompArea lumaArea = CompArea(COMPONENT_Y, pu.chromaFormat, pu.Cb().lumaPos(), recalcSize(pu.chromaFormat, CHANNEL_TYPE_CHROMA, CHANNEL_TYPE_LUMA, pu.Cb().size()));
const MotionInfo &curMi = pu.cs->picture->cs->getMotionInfo(Position{ lumaArea.x, lumaArea.y });
Mv bv = curMi.mv[0];
bv.hor = bv.hor >> ::getChannelTypeScaleX( ChannelType( chType ), cu.chromaFormat );
bv.ver = bv.ver >> ::getChannelTypeScaleY( ChannelType( chType ), cu.chromaFormat );
DTRACE_BLOCK_VECTOR_CHROMA(g_trace_ctx, D_BLOCK_STATISTICS_ALL, pu, GetBlockStatisticName(BlockStatistic::IBC_BV_Chroma), bv.hor, bv.ver);
}
}
}
......@@ -668,7 +673,7 @@ void writeAllCodedData(const CodingStructure & cs, const UnitArea & ctuArea)
#endif
}
for (auto &pu : CU::traversePUs(cu))
for (const PredictionUnit &pu : CU::traversePUs(cu))
{
switch (pu.cu->predMode)
{
......@@ -865,8 +870,14 @@ void writeAllCodedData(const CodingStructure & cs, const UnitArea & ctuArea)
{
if(cu.ibc)
{
DTRACE_BLOCK_VECTOR_CHROMA(g_trace_ctx, D_BLOCK_STATISTICS_CODED, pu, GetBlockStatisticName(BlockStatistic::IBC_BV_Chroma), pu.mv[0].hor, pu.mv[0].ver);
DTRACE_BLOCK_VECTOR_CHROMA(g_trace_ctx, D_BLOCK_STATISTICS_CODED, pu, GetBlockStatisticName(BlockStatistic::IBC_BVD_Chroma), pu.mvd[0].hor, pu.mvd[0].ver);
// separated tree, chroma
const CompArea lumaArea = CompArea(COMPONENT_Y, pu.chromaFormat, pu.Cb().lumaPos(), recalcSize(pu.chromaFormat, CHANNEL_TYPE_CHROMA, CHANNEL_TYPE_LUMA, pu.Cb().size()));
const MotionInfo &curMi = pu.cs->picture->cs->getMotionInfo(Position{ lumaArea.x, lumaArea.y });
Mv bv = curMi.mv[0];
bv.setLowPrec();
bv.hor = bv.hor >> ::getChannelTypeScaleX( ChannelType( chType ), cu.chromaFormat );
bv.ver = bv.ver >> ::getChannelTypeScaleY( ChannelType( chType ), cu.chromaFormat );
DTRACE_BLOCK_VECTOR_CHROMA(g_trace_ctx, D_BLOCK_STATISTICS_CODED, pu, GetBlockStatisticName(BlockStatistic::IBC_BV_Chroma), bv.hor, bv.ver);
}
}
#endif
......
......@@ -82,8 +82,7 @@ enum class BlockStatistic {
IBCFlag_Chroma,
IBC_BV,
IBC_BV_Chroma,
IBC_BVD,
IBC_BVD_Chroma,
IBC_BVD,
#endif
// inter
......@@ -224,7 +223,6 @@ static const std::map<BlockStatistic, std::tuple<std::string, BlockStatisticType
{ BlockStatistic::IBC_BV, std::tuple<std::string, BlockStatisticType, std::string>{"IBC_BV", BlockStatisticType::Vector, "Scale: 4"}},
{ BlockStatistic::IBC_BV_Chroma, std::tuple<std::string, BlockStatisticType, std::string>{"IBC_BV_Chroma", BlockStatisticType::Vector, "Scale: 4"}},
{ BlockStatistic::IBC_BVD, std::tuple<std::string, BlockStatisticType, std::string>{"IBC_BD", BlockStatisticType::Vector, "Scale: 4"}},
{ BlockStatistic::IBC_BVD_Chroma, std::tuple<std::string, BlockStatisticType, std::string>{"IBC_BD_Chroma", BlockStatisticType::Vector, "Scale: 4"}},
#endif
#if JVET_K0248_GBI
{ BlockStatistic::GBiIdx, std::tuple<std::string, BlockStatisticType, std::string>{"GBiIdx", BlockStatisticType::Integer, "[0, " + std::to_string(GBI_NUM) + "]"}},
......
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