Commit 9814a786 authored by Yu-Chi Su's avatar Yu-Chi Su

JVET_L0646 GBI Merge Commit

parents 00818548 144c1986
......@@ -290,9 +290,15 @@ const CtxSet ContextSetCfg::MergeFlag = ContextSetCfg::addCtxSet
const CtxSet ContextSetCfg::MergeIdx = ContextSetCfg::addCtxSet
({
#if JVET_L0194_ONE_CTX_FOR_MRG_IDX
{ 137,},
{ 122,},
{ CNU,},
#else
{ 137, CNU, CNU, CNU, CNU,},
{ 122, CNU, CNU, CNU, CNU,},
{ CNU, CNU, CNU, CNU, CNU,},
#endif
});
const CtxSet ContextSetCfg::PartSize = ContextSetCfg::addCtxSet
......@@ -661,9 +667,15 @@ const CtxSet ContextSetCfg::ctbAlfFlag =
{
ContextSetCfg::addCtxSet
( {
#if JVET_L0392_ALF_INIT_STATE
{ 100, 153, 200, 100, 153, 200, 100, 153, 200 },
{ 100, 153, 200, 100, 153, 200, 100, 153, 200 },
{ 100, 153, 200, 100, 153, 200, 100, 153, 200 },
#else
{ 100, 100, 100, 100, 100, 100, 100, 100, 100 },
{ 153, 153, 153, 153, 153, 153, 153, 153, 153 },
{ 200, 200, 200, 200, 200, 200, 200, 200, 200 },
#endif
} )
};
......
......@@ -50,12 +50,21 @@
#include <assert.h>
#include <cassert>
#define JVET_L0392_ALF_INIT_STATE 1
#define JVET_L0664_ALF_REMOVE_LUMA_5x5 1
#define JVET_L0083_ALF_FRAC_BIT 1 // Reduce number of ALF fractional bit to 7
#define JVET_L0082_ALF_COEF_BITS 1 // ALF filter coefficient bitwidth constraints
#define JVET_L0194_ONE_CTX_FOR_MRG_IDX 1 // one context for full-block Merge index
#define JVET_L0646_GBI 1 // Generalized bi-prediction (GBi)
#define REUSE_CU_RESULTS 1
......
......@@ -1282,10 +1282,13 @@ void CABACReader::merge_idx( PredictionUnit& pu )
{
if( m_BinDecoder.decodeBin( Ctx::MergeIdx() ) )
{
#if !JVET_L0194_ONE_CTX_FOR_MRG_IDX
bool useExtCtx = pu.cs->sps->getSpsNext().getUseSubPuMvp();
#endif
pu.mergeIdx++;
for( ; pu.mergeIdx < numCandminus1; pu.mergeIdx++ )
{
#if !JVET_L0194_ONE_CTX_FOR_MRG_IDX
if( useExtCtx )
{
if( !m_BinDecoder.decodeBin( Ctx::MergeIdx( std::min<int>( pu.mergeIdx, NUM_MERGE_IDX_EXT_CTX - 1 ) ) ) )
......@@ -1295,11 +1298,14 @@ void CABACReader::merge_idx( PredictionUnit& pu )
}
else
{
#endif
if( !m_BinDecoder.decodeBinEP() )
{
break;
}
#if !JVET_L0194_ONE_CTX_FOR_MRG_IDX
}
#endif
}
}
}
......
......@@ -1243,18 +1243,24 @@ void CABACWriter::merge_idx( const PredictionUnit& pu )
}
else
{
#if !JVET_L0194_ONE_CTX_FOR_MRG_IDX
bool useExtCtx = pu.cs->sps->getSpsNext().getUseSubPuMvp();
#endif
m_BinEncoder.encodeBin( 1, Ctx::MergeIdx() );
for( unsigned idx = 1; idx < numCandminus1; idx++ )
{
#if !JVET_L0194_ONE_CTX_FOR_MRG_IDX
if( useExtCtx )
{
m_BinEncoder.encodeBin( pu.mergeIdx == idx ? 0 : 1, Ctx::MergeIdx( std::min<int>( idx, NUM_MERGE_IDX_EXT_CTX - 1 ) ) );
}
else
{
#endif
m_BinEncoder.encodeBinEP( pu.mergeIdx == idx ? 0 : 1 );
#if !JVET_L0194_ONE_CTX_FOR_MRG_IDX
}
#endif
if( pu.mergeIdx == idx )
{
break;
......
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