Commit 5f4f63e5 authored by LI JINGYA's avatar LI JINGYA

JVET-O0126 align BPWA index coding with specification

parent 8b8cfa37
......@@ -97,6 +97,8 @@
#define JVET_O0078_SINGLE_HMVPLUT 1 // JVET-O0078Single HMVP table for all CUs inside the shared merge list region for IBC
#define JVET_O0126_BPWA_INDEX_CODING_FIX 1 // JVET-O0126 align BPWA index coding with specification
#define FIX_DB_MAX_TRANSFORM_SIZE 1
#define MRG_SHARELIST_SHARSIZE 32
......
......@@ -1068,8 +1068,11 @@ void CABACReader::cu_gbi_flag(CodingUnit& cu)
uint32_t symbol = m_BinDecoder.decodeBin(Ctx::GBiIdx(0));
int32_t numGBi = (cu.slice->getCheckLDC()) ? 5 : 3;
#if JVET_O0126_BPWA_INDEX_CODING_FIX
if(symbol == 1)
#else
if(symbol == 0)
#endif
{
uint32_t prefixNumBits = numGBi - 2;
uint32_t step = 1;
......@@ -1079,8 +1082,11 @@ void CABACReader::cu_gbi_flag(CodingUnit& cu)
for(int ui = 0; ui < prefixNumBits; ++ui)
{
symbol = m_BinDecoder.decodeBinEP();
#if JVET_O0126_BPWA_INDEX_CODING_FIX
if (symbol == 0)
#else
if (symbol == 1)
#endif
{
break;
}
......
......@@ -823,9 +823,11 @@ void CABACWriter::cu_gbi_flag(const CodingUnit& cu)
const uint8_t gbiCodingIdx = (uint8_t)g_GbiCodingOrder[CU::getValidGbiIdx(cu)];
const int32_t numGBi = (cu.slice->getCheckLDC()) ? 5 : 3;
#if JVET_O0126_BPWA_INDEX_CODING_FIX
m_BinEncoder.encodeBin((gbiCodingIdx == 0 ? 0 : 1), Ctx::GBiIdx(0));
#else
m_BinEncoder.encodeBin((gbiCodingIdx == 0 ? 1 : 0), Ctx::GBiIdx(0));
#endif
if(numGBi > 2 && gbiCodingIdx != 0)
{
const uint32_t prefixNumBits = numGBi - 2;
......@@ -836,12 +838,20 @@ void CABACWriter::cu_gbi_flag(const CodingUnit& cu)
{
if (gbiCodingIdx == idx)
{
#if JVET_O0126_BPWA_INDEX_CODING_FIX
m_BinEncoder.encodeBinEP(0);
#else
m_BinEncoder.encodeBinEP(1);
#endif
break;
}
else
{
#if JVET_O0126_BPWA_INDEX_CODING_FIX
m_BinEncoder.encodeBinEP(1);
#else
m_BinEncoder.encodeBinEP(0);
#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