Commit b665f360 authored by Yi-Wen Chen's avatar Yi-Wen Chen Committed by Xiang Li

Fix of ticket #247

parent 6fa124a6
......@@ -866,9 +866,16 @@ void CABACReader::cu_skip_flag( CodingUnit& cu )
(skip && !cu.cs->slice->getSPS()->getIBCFlag()))
{
#if JVET_N0324_REGULAR_MRG_FLAG
unsigned regularMergeFlag = (m_BinDecoder.decodeBin(Ctx::RegularMergeFlag(0)));
DTRACE(g_trace_ctx, D_SYNTAX, "regular_merge_flag() ctx=%d regularMergeFlag=%d\n", 0, regularMergeFlag?1:0);
cu.firstPU->regularMergeFlag = regularMergeFlag;
if (!cu.cs->slice->getSPS()->getUseMMVD() && (cu.firstPU->lwidth() * cu.firstPU->lheight() == 32))
{
cu.firstPU->regularMergeFlag = true;
}
else
{
unsigned regularMergeFlag = (m_BinDecoder.decodeBin(Ctx::RegularMergeFlag(0)));
DTRACE(g_trace_ctx, D_SYNTAX, "regular_merge_flag() ctx=%d regularMergeFlag=%d\n", 0, regularMergeFlag?1:0);
cu.firstPU->regularMergeFlag = regularMergeFlag;
}
if (cu.firstPU->regularMergeFlag)
{
cu.mmvdSkip = false;
......@@ -1805,8 +1812,15 @@ void CABACReader::merge_flag( PredictionUnit& pu )
#if JVET_N0324_REGULAR_MRG_FLAG
if (pu.mergeFlag)
{
pu.regularMergeFlag = (m_BinDecoder.decodeBin(Ctx::RegularMergeFlag(1)));
DTRACE(g_trace_ctx, D_SYNTAX, "regular_merge_flag() ctx=%d pu.regularMergeFlag=%d\n", 1, pu.regularMergeFlag?1:0);
if (!pu.cs->sps->getUseMMVD() && (pu.lwidth() * pu.lheight() == 32))
{
pu.regularMergeFlag = true;
}
else
{
pu.regularMergeFlag = (m_BinDecoder.decodeBin(Ctx::RegularMergeFlag(1)));
DTRACE(g_trace_ctx, D_SYNTAX, "regular_merge_flag() ctx=%d pu.regularMergeFlag=%d\n", 1, pu.regularMergeFlag?1:0);
}
if (pu.regularMergeFlag)
{
pu.mmvdMergeFlag = false;
......
......@@ -687,8 +687,15 @@ void CABACWriter::cu_skip_flag( const CodingUnit& cu )
#if JVET_N0324_REGULAR_MRG_FLAG
if (CU::isInter(cu))
{
m_BinEncoder.encodeBin(cu.firstPU->regularMergeFlag, Ctx::RegularMergeFlag(0));
DTRACE(g_trace_ctx, D_SYNTAX, "regularMergeFlag() ctx=%d regularMergeFlag=%d\n", 0, cu.firstPU->regularMergeFlag?1:0);
if (!cu.cs->slice->getSPS()->getUseMMVD() && (cu.firstPU->lwidth() * cu.firstPU->lheight() == 32))
{
CHECK(!cu.firstPU->regularMergeFlag, "regular_merge_flag must be true!");
}
else
{
m_BinEncoder.encodeBin(cu.firstPU->regularMergeFlag, Ctx::RegularMergeFlag(0));
DTRACE(g_trace_ctx, D_SYNTAX, "regularMergeFlag() ctx=%d regularMergeFlag=%d\n", 0, cu.firstPU->regularMergeFlag?1:0);
}
#if JVET_N0127_MMVD_SPS_FLAG
if (cu.cs->slice->getSPS()->getUseMMVD())
{
......@@ -726,8 +733,15 @@ void CABACWriter::cu_skip_flag( const CodingUnit& cu )
#if JVET_N0324_REGULAR_MRG_FLAG
if (cu.skip && !cu.cs->slice->getSPS()->getIBCFlag())
{
m_BinEncoder.encodeBin(cu.firstPU->regularMergeFlag, Ctx::RegularMergeFlag(0));
DTRACE(g_trace_ctx, D_SYNTAX, "regularMergeFlag() ctx=%d regularMergeFlag=%d\n", 0, cu.firstPU->regularMergeFlag?1:0);
if (!cu.cs->slice->getSPS()->getUseMMVD() && (cu.firstPU->lwidth() * cu.firstPU->lheight() == 32))
{
CHECK(!cu.firstPU->regularMergeFlag, "regular_merge_flag must be true!");
}
else
{
m_BinEncoder.encodeBin(cu.firstPU->regularMergeFlag, Ctx::RegularMergeFlag(0));
DTRACE(g_trace_ctx, D_SYNTAX, "regularMergeFlag() ctx=%d regularMergeFlag=%d\n", 0, cu.firstPU->regularMergeFlag?1:0);
}
#if JVET_N0127_MMVD_SPS_FLAG
if (cu.cs->slice->getSPS()->getUseMMVD())
{
......@@ -1667,8 +1681,15 @@ void CABACWriter::merge_flag( const PredictionUnit& pu )
#if JVET_N0324_REGULAR_MRG_FLAG
if (pu.mergeFlag)
{
m_BinEncoder.encodeBin(pu.regularMergeFlag, Ctx::RegularMergeFlag(1));
DTRACE(g_trace_ctx, D_SYNTAX, "regularMergeFlag() ctx=%d regularMergeFlag=%d\n", 1, pu.regularMergeFlag?1:0);
if (!pu.cs->sps->getUseMMVD() && (pu.lwidth() * pu.lheight() == 32))
{
CHECK(!pu.regularMergeFlag, "regular_merge_flag must be true!");
}
else
{
m_BinEncoder.encodeBin(pu.regularMergeFlag, Ctx::RegularMergeFlag(1));
DTRACE(g_trace_ctx, D_SYNTAX, "regularMergeFlag() ctx=%d regularMergeFlag=%d\n", 1, pu.regularMergeFlag?1:0);
}
#if JVET_N0127_MMVD_SPS_FLAG
if (pu.cs->sps->getUseMMVD())
{
......
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