Commit 704580a0 authored by Fabrice Le Léannec's avatar Fabrice Le Léannec

JVET-N0286: simplified GBi index coding

parent 8ac77cab
......@@ -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_N0334_MVCLIPPING 1 // prevention of MV stroage overflow and alignment with spec of MV/CPMV modular for AMVP mode
#define JVET_N0481_BCW_CONSTRUCTED_AFFINE 1
......
......@@ -963,7 +963,11 @@ void CABACReader::cu_gbi_flag(CodingUnit& cu)
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)
{
......
......@@ -767,12 +767,20 @@ void CABACWriter::cu_gbi_flag(const CodingUnit& cu)
{
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));
#endif
ctxIdGBi += step;
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