Commit 27c1d1f9 authored by Xiang Li's avatar Xiang Li

Merge branch 'fabrice.leleannec/VVCSoftware_VTM-JVET-N0286-simplified-GBiIdx'

parents baca1f1e 4a9d7582
Pipeline #1219 passed with stage
......@@ -379,11 +379,18 @@ const CtxSet ContextSetCfg::AffMergeIdx = ContextSetCfg::addCtxSet
const CtxSet ContextSetCfg::GBiIdx = ContextSetCfg::addCtxSet
({
#if JVET_N0286_SIMPLIFIED_GBI_IDX
{ 228, },
{ 242, },
{ CNU, },
{ 4, },
#else
// 4 ctx for 1st bin; 1 ctx for each of rest bins
{ 228, CNU, CNU, CNU, 125, 155, 175, },
{ 242, CNU, CNU, CNU, 154, 170, 237, },
{ CNU, CNU, CNU, CNU, CNU, CNU, CNU, },
{ 4, DWS, DWS, DWS, 4, 0, 0, },
#endif
});
const CtxSet ContextSetCfg::Mvd = ContextSetCfg::addCtxSet
......
......@@ -50,6 +50,8 @@
#include <assert.h>
#include <cassert>
#define JVET_N0286_SIMPLIFIED_GBI_IDX 1 // Simplified coding of the GBi index
#define JVET_N600_AMVR_TPM_CTX_REDUCTION 1
#define JVET_N0334_MVCLIPPING 1 // prevention of MV stroage overflow and alignment with spec of MV/CPMV modular for AMVP mode
......
......@@ -980,18 +980,26 @@ void CABACReader::cu_gbi_flag(CodingUnit& cu)
uint32_t prefixNumBits = numGBi - 2;
uint32_t step = 1;
#if !JVET_N0286_SIMPLIFIED_GBI_IDX
unsigned ctxIdGBi = 4;
#endif
idx = 1;
for(int ui = 0; ui < prefixNumBits; ++ui)
{
#if JVET_N0286_SIMPLIFIED_GBI_IDX
symbol = m_BinDecoder.decodeBinEP();
#else
symbol = m_BinDecoder.decodeBin(Ctx::GBiIdx(ctxIdGBi));
#endif
if (symbol == 1)
{
break;
}
#if !JVET_N0286_SIMPLIFIED_GBI_IDX
ctxIdGBi += step;
#endif
idx += step;
}
}
......
......@@ -761,19 +761,29 @@ void CABACWriter::cu_gbi_flag(const CodingUnit& cu)
const uint32_t prefixNumBits = numGBi - 2;
const uint32_t step = 1;
#if !JVET_N0286_SIMPLIFIED_GBI_IDX
int ctxIdGBi = 4;
#endif
uint8_t idx = 1;
for(int ui = 0; ui < prefixNumBits; ++ui)
{
if (gbiCodingIdx == idx)
{
#if JVET_N0286_SIMPLIFIED_GBI_IDX
m_BinEncoder.encodeBinEP(1);
#else
m_BinEncoder.encodeBin(1, Ctx::GBiIdx(ctxIdGBi));
#endif
break;
}
else
{
#if JVET_N0286_SIMPLIFIED_GBI_IDX
m_BinEncoder.encodeBinEP(0);
#else
m_BinEncoder.encodeBin(0, Ctx::GBiIdx(ctxIdGBi));
ctxIdGBi += step;
#endif
idx += step;
}
}
......
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