Commit 52586e96 authored by Karsten Suehring's avatar Karsten Suehring

remove macro JVET_L0646_GBI

parent 84a6aa20
......@@ -237,10 +237,8 @@ void EncApp::xInitLibCfg()
m_cEncLib.setInterEMT ( ( m_EMT >> 1 ) & 1 );
m_cEncLib.setFastInterEMT ( ( m_FastEMT >> 1 ) & ( m_EMT >> 1 ) & 1 );
m_cEncLib.setUseCompositeRef ( m_compositeRefEnabled );
#if JVET_L0646_GBI
m_cEncLib.setUseGBi ( m_GBi );
m_cEncLib.setUseGBiFast ( m_GBiFast );
#endif
#if LUMA_ADAPTIVE_DEBLOCKING_FILTER_QP_OFFSET
m_cEncLib.setUseLadf ( m_LadfEnabed );
if ( m_LadfEnabed )
......
......@@ -844,10 +844,8 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
"\t2: Enable fast methods only for Inter EMT\n"
"\t3: Enable fast methods for both Intra & Inter EMT\n")
("CompositeLTReference", m_compositeRefEnabled, false, "Enable Composite Long Term Reference Frame")
#if JVET_L0646_GBI
("GBi", m_GBi, false, "Enable Generalized Bi-prediction(GBi)")
("GBiFast", m_GBiFast, false, "Fast methods for Generalized Bi-prediction(GBi)\n")
#endif
#if LUMA_ADAPTIVE_DEBLOCKING_FILTER_QP_OFFSET
("LADF", m_LadfEnabed, false, "Luma adaptive deblocking filter QP Offset(L0414)")
("LadfNumIntervals", m_LadfNumIntervals, 3, "LADF number of intervals (2-5, inclusive)")
......@@ -1938,10 +1936,8 @@ bool EncAppCfg::xCheckParameter()
xConfirmPara( m_EMT, "EMT only allowed with NEXT profile" );
xConfirmPara( m_FastEMT, "EMT only allowed with NEXT profile" );
xConfirmPara( m_compositeRefEnabled, "Composite Reference Frame is only allowed with NEXT profile" );
#if JVET_L0646_GBI
xConfirmPara( m_GBi, "GBi is only allowed with NEXT profile" );
xConfirmPara( m_GBiFast, "GBiFast is only allowed with NEXT profile" );
#endif
xConfirmPara( m_Triangle, "Triangle is only allowed with NEXT profile" );
// ADD_NEW_TOOL : (parameter check) add a check for next tools here
}
......@@ -3129,10 +3125,8 @@ void EncAppCfg::xPrintParameter()
msg( VERBOSE, "LMChroma:%d ", m_LMChroma );
msg( VERBOSE, "EMT: %1d(intra) %1d(inter) ", m_EMT & 1, ( m_EMT >> 1 ) & 1 );
msg(VERBOSE, "CompositeLTReference:%d ", m_compositeRefEnabled);
#if JVET_L0646_GBI
msg( VERBOSE, "GBi:%d ", m_GBi );
msg( VERBOSE, "GBiFast:%d ", m_GBiFast );
#endif
#if LUMA_ADAPTIVE_DEBLOCKING_FILTER_QP_OFFSET
msg( VERBOSE, "LADF:%d ", m_LadfEnabed );
#endif
......
......@@ -223,10 +223,8 @@ protected:
int m_FastEMT; ///< XZ: Fast Methods of Enhanced Multiple Transform
bool m_compositeRefEnabled;
#if JVET_L0646_GBI
bool m_GBi;
bool m_GBiFast;
#endif
#if LUMA_ADAPTIVE_DEBLOCKING_FILTER_QP_OFFSET
bool m_LadfEnabed;
int m_LadfNumIntervals;
......
......@@ -192,7 +192,7 @@ void calcBlkGradientCore(int sx, int sy, int *arraysGx2, int *arraysGxGy
}
}
#if ENABLE_SIMD_OPT_GBI && JVET_L0646_GBI
#if ENABLE_SIMD_OPT_GBI
void removeWeightHighFreq(int16_t* dst, int dstStride, const int16_t* src, int srcStride, int width, int height, int shift, int gbiWeight)
{
int normalizer = ((1 << 16) + (gbiWeight > 0 ? (gbiWeight >> 1) : -(gbiWeight >> 1))) / gbiWeight;
......@@ -289,7 +289,6 @@ PelBufferOps g_pelBufOP = PelBufferOps();
#endif
#endif
#if JVET_L0646_GBI
template<>
void AreaBuf<Pel>::addWeightedAvg(const AreaBuf<const Pel> &other1, const AreaBuf<const Pel> &other2, const ClpRng& clpRng, const int8_t gbiIdx)
{
......@@ -319,7 +318,6 @@ void AreaBuf<Pel>::addWeightedAvg(const AreaBuf<const Pel> &other1, const AreaBu
#undef ADD_AVG_OP
#undef ADD_AVG_INC
}
#endif
template<>
void AreaBuf<Pel>::addAvg( const AreaBuf<const Pel> &other1, const AreaBuf<const Pel> &other2, const ClpRng& clpRng)
......
......@@ -114,10 +114,8 @@ struct AreaBuf : public Size
void subtract ( const AreaBuf<const T> &other );
void extendSingleBorderPel();
void extendBorderPel ( unsigned margin );
#if JVET_L0646_GBI
void addWeightedAvg ( const AreaBuf<const T> &other1, const AreaBuf<const T> &other2, const ClpRng& clpRng, const int8_t gbiIdx);
void removeWeightHighFreq ( const AreaBuf<T>& other, const bool bClip, const ClpRng& clpRng, const int8_t iGbiWeight);
#endif
void addAvg ( const AreaBuf<const T> &other1, const AreaBuf<const T> &other2, const ClpRng& clpRng );
void removeHighFreq ( const AreaBuf<T>& other, const bool bClip, const ClpRng& clpRng);
void updateHistogram ( std::vector<int32_t>& hist ) const;
......@@ -400,7 +398,6 @@ void AreaBuf<T>::toLast( const ClpRng& clpRng )
template<>
void AreaBuf<Pel>::toLast( const ClpRng& clpRng );
#if JVET_L0646_GBI
template<typename T>
void AreaBuf<T>::removeWeightHighFreq(const AreaBuf<T>& other, const bool bClip, const ClpRng& clpRng, const int8_t gbiWeight)
{
......@@ -452,7 +449,6 @@ void AreaBuf<T>::removeWeightHighFreq(const AreaBuf<T>& other, const bool bClip,
}
#endif
}
#endif
template<typename T>
void AreaBuf<T>::removeHighFreq( const AreaBuf<T>& other, const bool bClip, const ClpRng& clpRng )
......@@ -463,7 +459,7 @@ void AreaBuf<T>::removeHighFreq( const AreaBuf<T>& other, const bool bClip, cons
T* dst = buf;
const int dstStride = stride;
#if ENABLE_SIMD_OPT_GBI && JVET_L0646_GBI
#if ENABLE_SIMD_OPT_GBI
if (!bClip)
{
if(!(width & 7))
......@@ -497,7 +493,7 @@ void AreaBuf<T>::removeHighFreq( const AreaBuf<T>& other, const bool bClip, cons
#undef REM_HF_OP
#undef REM_HF_OP_CLIP
#if ENABLE_SIMD_OPT_GBI && JVET_L0646_GBI
#if ENABLE_SIMD_OPT_GBI
}
#endif
}
......@@ -663,16 +659,12 @@ struct UnitBuf
void reconstruct ( const UnitBuf<const T> &pred, const UnitBuf<const T> &resi, const ClpRngs& clpRngs );
void copyClip ( const UnitBuf<const T> &src, const ClpRngs& clpRngs );
void subtract ( const UnitBuf<const T> &other );
#if JVET_L0646_GBI
void addWeightedAvg ( const UnitBuf<const T> &other1, const UnitBuf<const T> &other2, const ClpRngs& clpRngs, const uint8_t gbiIdx = GBI_DEFAULT, const bool chromaOnly = false, const bool lumaOnly = false);
#endif
void addAvg ( const UnitBuf<const T> &other1, const UnitBuf<const T> &other2, const ClpRngs& clpRngs, const bool chromaOnly = false, const bool lumaOnly = false);
void extendSingleBorderPel();
void extendBorderPel ( unsigned margin );
void removeHighFreq ( const UnitBuf<T>& other, const bool bClip, const ClpRngs& clpRngs
#if JVET_L0646_GBI
, const int8_t gbiWeight = g_GbiWeights[GBI_DEFAULT]
#endif
);
UnitBuf< T> subBuf (const UnitArea& subArea);
......@@ -742,7 +734,6 @@ void UnitBuf<T>::reconstruct(const UnitBuf<const T> &pred, const UnitBuf<const T
}
}
#if JVET_L0646_GBI
template<typename T>
void UnitBuf<T>::addWeightedAvg(const UnitBuf<const T> &other1, const UnitBuf<const T> &other2, const ClpRngs& clpRngs, const uint8_t gbiIdx /* = GBI_DEFAULT */, const bool chromaOnly /* = false */, const bool lumaOnly /* = false */)
{
......@@ -756,7 +747,6 @@ void UnitBuf<T>::addWeightedAvg(const UnitBuf<const T> &other1, const UnitBuf<co
bufs[i].addWeightedAvg(other1.bufs[i], other2.bufs[i], clpRngs.comp[i], gbiIdx);
}
}
#endif
template<typename T>
void UnitBuf<T>::addAvg(const UnitBuf<const T> &other1, const UnitBuf<const T> &other2, const ClpRngs& clpRngs, const bool chromaOnly /* = false */, const bool lumaOnly /* = false */)
......@@ -792,24 +782,15 @@ void UnitBuf<T>::extendBorderPel( unsigned margin )
template<typename T>
void UnitBuf<T>::removeHighFreq( const UnitBuf<T>& other, const bool bClip, const ClpRngs& clpRngs
#if JVET_L0646_GBI
, const int8_t gbiWeight
#endif
)
{
#if JVET_L0646_GBI
if(gbiWeight != g_GbiWeights[GBI_DEFAULT])
{
bufs[0].removeWeightHighFreq(other.bufs[0], bClip, clpRngs.comp[0], gbiWeight);
return;
}
bufs[0].removeHighFreq(other.bufs[0], bClip, clpRngs.comp[0]);
#else
for (unsigned i = 0; i <bufs.size(); i++)
{
bufs[i].removeHighFreq(other.bufs[i], bClip, clpRngs.comp[i]);
}
#endif
}
......
......@@ -98,9 +98,7 @@ enum CodingStatisticsType
STATS__CABAC_BITS__OTHER,
STATS__CABAC_BITS__INVALID,
STATS__CABAC_BITS__IMV_FLAG,
#if JVET_L0646_GBI
STATS__CABAC_BITS__GBI_IDX,
#endif
STATS__CABAC_BITS__EMT_CU_FLAG,
STATS__CABAC_BITS__EMT_TU_INDEX,
STATS__CABAC_BITS__MH_INTRA_FLAG,
......@@ -179,9 +177,7 @@ static inline const char* getName(CodingStatisticsType name)
"CABAC_BITS__OTHER",
"CABAC_BITS__INVALID",
"CABAC_BITS__IMV_FLAG",
#if JVET_L0646_GBI
"CABAC_BITS__GBI_IDX",
#endif
"CABAC_BITS__EMT_CU_FLAG",
"CABAC_BITS__EMT_TU_INDX",
"CABAC_BITS__MH_INTRA_FLAG",
......
......@@ -309,11 +309,9 @@ static const int MAX_NUM_GT2_BINS_2x2SUBBLOCK = 2; ///< max
static const int BIO_EXTEND_SIZE = 1;
static const int BIO_TEMP_BUFFER_SIZE = (MAX_CU_SIZE + 2 * BIO_EXTEND_SIZE) * (MAX_CU_SIZE + 2 * BIO_EXTEND_SIZE);
#if JVET_L0646_GBI
static const int GBI_NUM = 5; ///< the number of weight options
static const int GBI_DEFAULT = ((uint8_t)(GBI_NUM >> 1)); ///< Default weighting index representing for w=0.5
static const int GBI_SIZE_CONSTRAINT = 256; ///< disabling GBi if cu size is smaller than 256
#endif
static const int MAX_NUM_HMVP_CANDS = 6; ///< maximum number of HMVP candidates to be stored and used in merge list
static const int MAX_NUM_HMVP_AVMPCANDS = 4; ///< maximum number of HMVP candidates to be used in AMVP list
......
......@@ -348,9 +348,7 @@ void MergeCtx::setMergeInfo( PredictionUnit& pu, int candIdx )
pu.bv.changePrecision(MV_PRECISION_INTERNAL, MV_PRECISION_INT); // used for only integer resolution
}
#endif
#if JVET_L0646_GBI
pu.cu->GBiIdx = ( interDirNeighbours[candIdx] == 3 ) ? GBiIdx[candIdx] : GBI_DEFAULT;
#endif
}
void MergeCtx::setMmvdMergeCandiInfo(PredictionUnit& pu, int candIdx)
......@@ -492,7 +490,5 @@ void MergeCtx::setMmvdMergeCandiInfo(PredictionUnit& pu, int candIdx)
pu.mvpNum[REF_PIC_LIST_0] = NOT_VALID;
pu.mvpNum[REF_PIC_LIST_1] = NOT_VALID;
#if JVET_L0646_GBI
pu.cu->GBiIdx = (interDirNeighbours[fPosBaseIdx] == 3) ? GBiIdx[fPosBaseIdx] : GBI_DEFAULT;
#endif
}
......@@ -261,9 +261,7 @@ public:
~MergeCtx() {}
public:
MvField mvFieldNeighbours [ MRG_MAX_NUM_CANDS << 1 ]; // double length for mv of both lists
#if JVET_L0646_GBI
uint8_t GBiIdx [ MRG_MAX_NUM_CANDS ];
#endif
unsigned char interDirNeighbours[ MRG_MAX_NUM_CANDS ];
MergeType mrgTypeNeighbours [ MRG_MAX_NUM_CANDS ];
int numValidMergeCand;
......@@ -286,9 +284,7 @@ public:
MvField mvFieldNeighbours[AFFINE_MRG_MAX_NUM_CANDS << 1][3]; // double length for mv of both lists
unsigned char interDirNeighbours[AFFINE_MRG_MAX_NUM_CANDS];
EAffineModel affineType[AFFINE_MRG_MAX_NUM_CANDS];
#if JVET_L0646_GBI
uint8_t GBiIdx[AFFINE_MRG_MAX_NUM_CANDS];
#endif
int numValidMergeCand;
int maxNumMergeCand;
......
......@@ -505,7 +505,6 @@ const CtxSet ContextSetCfg::AffMergeIdx = ContextSetCfg::addCtxSet
} );
#endif
#if JVET_L0646_GBI
const CtxSet ContextSetCfg::GBiIdx = ContextSetCfg::addCtxSet
({
// 4 ctx for 1st bin; 1 ctx for each of rest bins
......@@ -519,7 +518,6 @@ const CtxSet ContextSetCfg::GBiIdx = ContextSetCfg::addCtxSet
{ CNU, CNU, CNU, CNU, CNU, CNU, CNU, },
#endif
});
#endif
const CtxSet ContextSetCfg::Mvd = ContextSetCfg::addCtxSet
({
......
......@@ -198,9 +198,7 @@ public:
static const CtxSet ChromaQpAdjFlag;
static const CtxSet ChromaQpAdjIdc;
static const CtxSet ImvFlag;
#if JVET_L0646_GBI
static const CtxSet GBiIdx;
#endif
static const CtxSet ctbAlfFlag;
static const CtxSet MHIntraFlag;
static const CtxSet MHIntraPredMode;
......
......@@ -487,12 +487,10 @@ void InterPrediction::xPredInterBi(PredictionUnit& pu, PelUnitBuf &pcYuvPred)
}
}
#if JVET_L0646_GBI
if (pu.cu->cs->sps->getSpsNext().getUseGBi() && bioApplied && pu.cu->GBiIdx != GBI_DEFAULT)
{
bioApplied = false;
}
#endif
}
for (uint32_t refList = 0; refList < NUM_REF_PIC_LIST_01; refList++)
......@@ -1202,14 +1200,12 @@ void InterPrediction::xWeightedAverage(const PredictionUnit& pu, const CPelUnitB
if( iRefIdx0 >= 0 && iRefIdx1 >= 0 )
{
#if JVET_L0646_GBI
if( pu.cu->GBiIdx != GBI_DEFAULT )
{
CHECK(bioApplied, "GBi is disallowed with BIO");
pcYuvDst.addWeightedAvg(pcYuvSrc0, pcYuvSrc1, clpRngs, pu.cu->GBiIdx);
return;
}
#endif
if (bioApplied)
{
const int src0Stride = pu.lwidth() + 2 * BIO_EXTEND_SIZE + 2;
......
......@@ -143,7 +143,6 @@ struct MotionInfo
}
};
#if JVET_L0646_GBI
class GBiMotionParam
{
bool m_readOnly[2][33]; // 2 RefLists, 33 RefFrams
......@@ -210,7 +209,6 @@ public:
ruiDist = m_distAffine[bP4][uiRefList][uiRefIdx];
}
};
#endif
struct LutMotionCand
{
MotionInfo* motionCand;
......
......@@ -244,7 +244,6 @@ int g_aiLMDivTableHigh[] = {
134, 134, 134, 133, 133, 133, 132, 132, 132, 132, 131, 131, 131, 131, 130, 130, 130, 130,
129, 129, 129, 129, 128, 128, 128, 128,
};
#if JVET_L0646_GBI
const int8_t g_GbiLog2WeightBase = 3;
const int8_t g_GbiWeightBase = (1 << g_GbiLog2WeightBase);
const int8_t g_GbiWeights[GBI_NUM] = { -2, 3, 4, 5, 10 };
......@@ -308,7 +307,6 @@ uint32_t deriveWeightIdxBits(uint8_t gbiIdx) // Note: align this with TEncSbac::
}
return numBits;
}
#endif
// initialize ROM variables
void initROM()
......
......@@ -215,7 +215,6 @@ extern int g_aiLMDivTableHigh[];
extern const int g_aiNonLMPosThrs[];
#if JVET_L0646_GBI
extern const int8_t g_GbiLog2WeightBase;
extern const int8_t g_GbiWeightBase;
extern const int8_t g_GbiWeights[GBI_NUM];
......@@ -227,7 +226,6 @@ class CodingStructure;
int8_t getGbiWeight(uint8_t gbiIdx, uint8_t uhRefFrmList);
void resetGbiCodingOrder(bool bRunDecoding, const CodingStructure &cs);
uint32_t deriveWeightIdxBits(uint8_t gbiIdx);
#endif
constexpr uint8_t g_tbMax[257] = { 0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
......
......@@ -808,9 +808,7 @@ private:
bool m_InterEMT; // 19
bool m_Affine;
bool m_AffineType;
#if JVET_L0646_GBI
bool m_GBi; //
#endif
bool m_MTTEnabled; //
bool m_MHIntra;
bool m_Triangle;
......@@ -896,10 +894,8 @@ public:
bool getUseIntraEMT () const { return m_IntraEMT; }
void setUseInterEMT ( bool b ) { m_InterEMT = b; }
bool getUseInterEMT () const { return m_InterEMT; }
#if JVET_L0646_GBI
void setUseGBi ( bool b ) { m_GBi = b; }
bool getUseGBi () const { return m_GBi; }
#endif
#if LUMA_ADAPTIVE_DEBLOCKING_FILTER_QP_OFFSET
void setLadfEnabled ( bool b ) { m_LadfEnabled = b; }
bool getLadfEnabled () const { return m_LadfEnabled; }
......
......@@ -80,7 +80,6 @@
#define JVET_L0646_GBI 1 // Generalized bi-prediction (GBi)
#define JVET_L0628_4TAP_INTRA 1 // 4-tap intra-interpolation filtering with switching between Gaussian and DCT-IF filters for luma component
......@@ -261,7 +260,7 @@
#define ENABLE_SIMD_OPT_DIST ( 1 && ENABLE_SIMD_OPT ) ///< SIMD optimization for the distortion calculations(SAD,SSE,HADAMARD), no impact on RD performance
#define ENABLE_SIMD_OPT_AFFINE_ME ( 1 && ENABLE_SIMD_OPT ) ///< SIMD optimization for affine ME, no impact on RD performance
#define ENABLE_SIMD_OPT_ALF ( 1 && ENABLE_SIMD_OPT ) ///< SIMD optimization for ALF
#if ENABLE_SIMD_OPT_BUFFER && JVET_L0646_GBI
#if ENABLE_SIMD_OPT_BUFFER
#define ENABLE_SIMD_OPT_GBI 1 ///< SIMD optimization for GBi
#endif
#define ENABLE_SIMD_OPT_BIO ( JVET_L0256_BIO && ENABLE_SIMD_OPT ) ///< SIMD optimization for BIO
......
......@@ -267,11 +267,9 @@ CodingUnit& CodingUnit::operator=( const CodingUnit& other )
#endif
imv = other.imv;
imvNumCand = other.imvNumCand;
#if JVET_L0646_GBI
GBiIdx = other.GBiIdx;
for (int i = 0; i<2; i++)
refIdxBi[i] = other.refIdxBi[i];
#endif
#if JVET_L0293_CPR
cpr = other.cpr;
#endif
......@@ -302,11 +300,9 @@ void CodingUnit::initData()
#endif
imv = 0;
imvNumCand = 0;
#if JVET_L0646_GBI
GBiIdx = GBI_DEFAULT;
for (int i = 0; i < 2; i++)
refIdxBi[i] = -1;
#endif
#if JVET_L0293_CPR
cpr = false;
#endif
......
......@@ -306,10 +306,8 @@ struct CodingUnit : public UnitArea
uint32_t tileIdx;
#endif
uint8_t emtFlag;
#if JVET_L0646_GBI
uint8_t GBiIdx;
int refIdxBi[2];
#endif
// needed for fast imv mode decisions
int8_t imvNumCand;
#if JVET_L0293_CPR
......
......@@ -800,9 +800,7 @@ void PU::getInterMergeCandidates( const PredictionUnit &pu, MergeCtx& mrgCtx,
#if !JVET_L0090_PAIR_AVG
isCandInter[ui] = false;
#endif
#if JVET_L0646_GBI
mrgCtx.GBiIdx[ui] = GBI_DEFAULT;
#endif
mrgCtx.interDirNeighbours[ui] = 0;
mrgCtx.mrgTypeNeighbours [ui] = MRG_TYPE_DEFAULT_N;
mrgCtx.mvFieldNeighbours[(ui << 1) ].refIdx = NOT_VALID;
......@@ -843,9 +841,7 @@ void PU::getInterMergeCandidates( const PredictionUnit &pu, MergeCtx& mrgCtx,
// get Inter Dir
mrgCtx.interDirNeighbours[cnt] = miLeft.interDir;
#if JVET_L0646_GBI
mrgCtx.GBiIdx[cnt] = (mrgCtx.interDirNeighbours[cnt] == 3) ? puLeft->cu->GBiIdx : GBI_DEFAULT;
#endif
// get Mv from Left
#if JVET_L0293_CPR
if (puLeft->cu->cpr)
......@@ -904,9 +900,7 @@ void PU::getInterMergeCandidates( const PredictionUnit &pu, MergeCtx& mrgCtx,
// get Inter Dir
mrgCtx.interDirNeighbours[cnt] = miAbove.interDir;
// get Mv from Above
#if JVET_L0646_GBI
mrgCtx.GBiIdx[cnt] = (mrgCtx.interDirNeighbours[cnt] == 3) ? puAbove->cu->GBiIdx : GBI_DEFAULT;
#endif
#if JVET_L0293_CPR
if (puAbove->cu->cpr)
{
......@@ -968,9 +962,7 @@ void PU::getInterMergeCandidates( const PredictionUnit &pu, MergeCtx& mrgCtx,
// get Inter Dir
mrgCtx.interDirNeighbours[cnt] = miAboveRight.interDir;
// get Mv from Above-right
#if JVET_L0646_GBI
mrgCtx.GBiIdx[cnt] = (mrgCtx.interDirNeighbours[cnt] == 3) ? puAboveRight->cu->GBiIdx : GBI_DEFAULT;
#endif
#if JVET_L0293_CPR
if (puAboveRight->cu->cpr)
{
......@@ -1031,9 +1023,7 @@ void PU::getInterMergeCandidates( const PredictionUnit &pu, MergeCtx& mrgCtx,
// get Inter Dir
mrgCtx.interDirNeighbours[cnt] = miBelowLeft.interDir;
#if JVET_L0646_GBI
mrgCtx.GBiIdx[cnt] = (mrgCtx.interDirNeighbours[cnt] == 3) ? puLeftBottom->cu->GBiIdx : GBI_DEFAULT;
#endif
// get Mv from Bottom-Left
#if JVET_L0293_CPR
if (puLeftBottom->cu->cpr)
......@@ -1160,9 +1150,7 @@ void PU::getInterMergeCandidates( const PredictionUnit &pu, MergeCtx& mrgCtx,
// get Inter Dir
mrgCtx.interDirNeighbours[cnt] = miAboveLeft.interDir;
#if JVET_L0646_GBI
mrgCtx.GBiIdx[cnt] = (mrgCtx.interDirNeighbours[cnt] == 3) ? puAboveLeft->cu->GBiIdx : GBI_DEFAULT;
#endif
// get Mv from Above-Left
#if JVET_L0293_CPR
if (puAboveLeft->cu->cpr)
......@@ -1319,9 +1307,7 @@ void PU::getInterMergeCandidates( const PredictionUnit &pu, MergeCtx& mrgCtx,
#if !JVET_L0090_PAIR_AVG
isCandInter [uiArrayAddr] = true;
#endif
#if JVET_L0646_GBI
mrgCtx.GBiIdx[uiArrayAddr] = GBI_DEFAULT;
#endif
#if JVET_L0293_CPR
if (mrgCandIdxCPR == cnt && canFastExit)
#else
......@@ -1489,9 +1475,7 @@ void PU::getInterMergeCandidates( const PredictionUnit &pu, MergeCtx& mrgCtx,
{
isCandInter[uiArrayAddr] = true;
mrgCtx.interDirNeighbours[uiArrayAddr] = 3;
#if JVET_L0646_GBI
mrgCtx.GBiIdx[uiArrayAddr] = ((mrgCtx.interDirNeighbours[uiArrayAddr] == 3)) ? CU::deriveGbiIdx(mrgCtx.GBiIdx[i], mrgCtx.GBiIdx[j]) : GBI_DEFAULT;
#endif
// get Mv from cand[i] and cand[j]
mrgCtx.mvFieldNeighbours[ uiArrayAddr << 1 ].setMvField(mrgCtx.mvFieldNeighbours[ i << 1 ].mv, mrgCtx.mvFieldNeighbours[ i << 1 ].refIdx);
......@@ -1529,9 +1513,7 @@ void PU::getInterMergeCandidates( const PredictionUnit &pu, MergeCtx& mrgCtx,
isCandInter [uiArrayAddr ] = true;
#endif
mrgCtx.interDirNeighbours [uiArrayAddr ] = 1;
#if JVET_L0646_GBI
mrgCtx.GBiIdx [uiArrayAddr ] = GBI_DEFAULT;
#endif
mrgCtx.mvFieldNeighbours [uiArrayAddr << 1].setMvField(Mv(0, 0), r);
if (slice.isInterB())
......@@ -3049,9 +3031,7 @@ void PU::getAffineMergeCand( const PredictionUnit &pu, AffineMergeCtx& affMrgCtx
#if JVET_L0369_SUBBLOCK_MERGE
affMrgCtx.mergeType[i] = MRG_TYPE_DEFAULT_N;
#endif
#if JVET_L0646_GBI
affMrgCtx.GBiIdx[i] = GBI_DEFAULT;
#endif
}
affMrgCtx.numValidMergeCand = 0;
......@@ -3267,9 +3247,7 @@ void PU::getAffineMergeCand( const PredictionUnit &pu, AffineMergeCtx& affMrgCtx
}
affMrgCtx.interDirNeighbours[affMrgCtx.numValidMergeCand] = puNeigh->interDir;
affMrgCtx.affineType[affMrgCtx.numValidMergeCand] = (EAffineModel)(puNeigh->cu->affineType);
#if JVET_L0646_GBI
affMrgCtx.GBiIdx[affMrgCtx.numValidMergeCand] = puNeigh->cu->GBiIdx;
#endif
if ( affMrgCtx.numValidMergeCand == mrgCandIdx )
{
......@@ -3516,11 +3494,7 @@ bool PU::isAffineMrgFlagCoded( const PredictionUnit &pu )
}
return getFirstAvailableAffineNeighbour( pu ) != nullptr;
}
#if JVET_L0646_GBI
void PU::getAffineMergeCand( const PredictionUnit &pu, MvField(*mvFieldNeighbours)[3], unsigned char &interDirNeighbours, unsigned char &gbiIdx, int &numValidMergeCand )
#else
void PU::getAffineMergeCand( const PredictionUnit &pu, MvField (*mvFieldNeighbours)[3], unsigned char &interDirNeighbours, int &numValidMergeCand )
#endif
{
for ( int mvNum = 0; mvNum < 3; mvNum++ )
{
......@@ -3532,9 +3506,7 @@ void PU::getAffineMergeCand( const PredictionUnit &pu, MvField (*mvFieldNeighbou
if( puFirstNeighbour == nullptr )
{
numValidMergeCand = -1;
#if JVET_L0646_GBI
gbiIdx = GBI_DEFAULT;
#endif
return;
}
else
......@@ -3569,9 +3541,7 @@ void PU::getAffineMergeCand( const PredictionUnit &pu, MvField (*mvFieldNeighbou
}
}
}
#if JVET_L0646_GBI
gbiIdx = puFirstNeighbour->cu->GBiIdx;
#endif
}
#endif
......@@ -3925,9 +3895,7 @@ bool PU::getInterMergeSubPuMvpCand(const PredictionUnit &pu, MergeCtx& mrgCtx, b
mrgCtx.mvFieldNeighbours[(count << 1) + currRefListId].setMvField(cColMv, 0);
mrgCtx.interDirNeighbours[count] |= (1 << currRefListId);
LICFlag = tempLICFlag;
#if JVET_L0646_GBI
mrgCtx.GBiIdx[count] = GBI_DEFAULT;
#endif
found = true;
}
else
......@@ -4188,9 +4156,7 @@ void PU::restrictBiPredMergeCands( const PredictionUnit &pu, MergeCtx& mergeCtx
{
mergeCtx.interDirNeighbours[ mergeCand ] = 1;
mergeCtx.mvFieldNeighbours[( mergeCand << 1 ) + 1].setMvField( Mv( 0, 0 ), -1 );
#if JVET_L0646_GBI
mergeCtx.GBiIdx[mergeCand] = GBI_DEFAULT;
#endif
}
}
}
......@@ -4819,7 +4785,6 @@ int CU::getMaxNeighboriMVCandNum( const CodingStructure& cs, const Position& pos
return maxImvNumCand;
}
#if JVET_L0646_GBI
bool CU::isGBiIdxCoded( const CodingUnit &cu )
{
if( cu.cs->sps->getSpsNext().getUseGBi() == false )
......@@ -4920,7 +4885,6 @@ uint8_t CU::deriveGbiIdx( uint8_t gbiLO, uint8_t gbiL1 )
}
}
}
#endif
// TU tools
......
......@@ -85,12 +85,10 @@ namespace CU
bool hasNonTsCodedBlock (const CodingUnit& cu);
uint32_t getNumNonZeroCoeffNonTs (const CodingUnit& cu);
#if JVET_L0646_GBI
bool isGBiIdxCoded (const CodingUnit& cu);
uint8_t getValidGbiIdx (const CodingUnit& cu);
void setGbiIdx (CodingUnit& cu, uint8_t uh);
uint8_t deriveGbiIdx (uint8_t gbiLO, uint8_t gbiL1);
#endif
PUTraverser traversePUs ( CodingUnit& cu);
TUTraverser traverseTUs ( CodingUnit& cu);
......@@ -147,11 +145,7 @@ namespace PU
void getAffineControlPointCand( const PredictionUnit &pu, MotionInfo mi[4], bool isAvailable[4], int verIdx[4], int modelIdx, int verNum, AffineMergeCtx& affMrgCtx );
void getAffineMergeCand( const PredictionUnit &pu, AffineMergeCtx& affMrgCtx, const int mrgCandIdx = -1 );
#else
#if JVET_L0646_GBI
void getAffineMergeCand (const PredictionUnit &pu, MvField(*mvFieldNeighbours)[3], unsigned char &interDirNeighbours, unsigned char &gbiIdx, int &numValidMergeCand);
#else
void getAffineMergeCand (const PredictionUnit &pu, MvField (*mvFieldNeighbours)[3], unsigned char &interDirNeighbours, int &numValidMergeCand );
#endif
bool isAffineMrgFlagCoded (const PredictionUnit &pu );
#endif
void setAllAffineMvField ( PredictionUnit &pu, MvField *mvField, RefPicList eRefList );
......
......@@ -667,9 +667,7 @@ void writeAllData(const CodingStructure& cs, const UnitArea& ctuArea)
}
DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, cu, GetBlockStatisticName(BlockStatistic::IMVMode), cu.imv);
DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, cu, GetBlockStatisticName(BlockStatistic::RootCbf), cu.rootCbf);
#if JVET_L0646_GBI
DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, cu, GetBlockStatisticName(BlockStatistic::GBIIndex), cu.GBiIdx);
#endif
#if JVET_L0293_CPR
DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, cu, GetBlockStatisticName(BlockStatistic::CPRFlag), cu.cpr);
#endif
......@@ -994,12 +992,10 @@ void writeAllCodedData(const CodingStructure & cs, const UnitArea & ctuArea)
{
DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_CODED, cu, GetBlockStatisticName(BlockStatistic::IMVMode), cu.imv);
}
#if JVET_L0646_GBI
if (CU::isGBiIdxCoded(cu))
{
DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, cu, GetBlockStatisticName(BlockStatistic::GBIIndex), cu.GBiIdx);
}
#endif
break;
}
default:
......
......@@ -107,9 +107,7 @@ enum class BlockStatistic {
TrianglePartitioning,
TriangleMVL0, //<< currently only uni-prediction enabled
TriangleMVL1, //<< currently only uni-prediction enabled
#if JVET_L0646_GBI
GBIIndex,
#endif
#if JVET_L0293_CPR
CPRFlag,
#endif
......@@ -195,9 +193,7 @@ static const std::map<BlockStatistic, std::tuple<std::string, BlockStatisticType
{ BlockStatistic::TrianglePartitioning, std::tuple<std::string, BlockStatisticType, std::string>{"TrianglePartitioning", BlockStatisticType::Line, ""}},
{ BlockStatistic::TriangleMVL0, std::tuple<std::string, BlockStatisticType, std::string>{"TriangleMVL0", BlockStatisticType::VectorPolygon, "Scale: 4"}},
{ BlockStatistic::TriangleMVL1, std::tuple<std::string, BlockStatisticType, std::string>{"TriangleMVL1", BlockStatisticType::VectorPolygon, "Scale: 4"}},
#if JVET_L0646_GBI
{ BlockStatistic::GBIIndex, std::tuple<std::string, BlockStatisticType, std::string>{"GBIIndex", BlockStatisticType::Integer, "[0, 4]"}},
#endif
#if JVET_L0293_CPR
{ BlockStatistic::CPRFlag, std::tuple<std::string, BlockStatisticType, std::string>{"CPRFlag", BlockStatisticType::Flag, ""}},
#endif
......
......@@ -861,13 +861,10 @@ void CABACReader::cu_pred_data( CodingUnit &cu )
imv_mode ( cu, mrgCtx );
#if JVET_L0646_GBI
cu_gbi_flag( cu );
#endif
}
#if JVET_L0646_GBI
void CABACReader::cu_gbi_flag(CodingUnit& cu)
{
if(!CU::isGBiIdxCoded(cu))
......@@ -916,7 +913,6 @@ void CABACReader::cu_gbi_flag(CodingUnit& cu)
DTRACE(g_trace_ctx, D_SYNTAX, "cu_gbi_flag() gbi_idx=%d\n", cu.GBiIdx ? 1 : 0);
}
#endif
void CABACReader::xReadTruncBinCode(uint32_t& symbol, uint32_t maxSymbol)
{
......@@ -1285,9 +1281,7 @@ void CABACReader::prediction_unit( PredictionUnit& pu, MergeCtx& mrgCtx )
pu.mv [REF_PIC_LIST_1] = Mv(0, 0);
pu.refIdx[REF_PIC_LIST_1] = -1;
pu.interDir = 1;
#if JVET_L0646_GBI
pu.cu->GBiIdx = GBI_DEFAULT;
#endif
}
PU::spanMotionInfo( pu, mrgCtx );
......
......@@ -80,9 +80,7 @@ public:
void pred_mode ( CodingUnit