Commit 8a220a6b authored by Frank Bossen's avatar Frank Bossen

Merge branch 'cleanup_v3' into 'master'

Cleanup macros of VTM3

See merge request !146
parents b23288fb 2b075c2a
Pipeline #495 passed with stage
......@@ -212,22 +212,15 @@ void EncApp::xInitLibCfg()
#endif
m_cEncLib.setRDpenalty ( m_rdPenalty );
m_cEncLib.setCTUSize ( m_uiCTUSize );
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
m_cEncLib.setUseSplitConsOverride ( m_SplitConsOverrideEnabledFlag );
#endif
m_cEncLib.setMinQTSizes ( m_uiMinQT );
m_cEncLib.setMaxBTDepth ( m_uiMaxBTDepth, m_uiMaxBTDepthI, m_uiMaxBTDepthIChroma );
m_cEncLib.setDualITree ( m_dualTree );
m_cEncLib.setLargeCTU ( m_LargeCTU );
m_cEncLib.setSubPuMvpMode ( m_SubPuMvpMode );
#if !JVET_L0198_L0468_L0104_ATMVP_8x8SUB_BLOCK
m_cEncLib.setSubPuMvpLog2Size ( m_SubPuMvpLog2Size );
#endif
m_cEncLib.setAffine ( m_Affine );
m_cEncLib.setAffineType ( m_AffineType );
#if JVET_L0256_BIO
m_cEncLib.setBIO (m_BIO);
#endif
m_cEncLib.setDisableMotionCompression ( m_DisableMotionCompression );
m_cEncLib.setMTTMode ( m_MTT );
m_cEncLib.setUseLMChroma ( m_LMChroma );
......@@ -239,10 +232,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 )
......@@ -255,14 +246,9 @@ void EncApp::xInitLibCfg()
}
}
#endif
#if JVET_L0100_MULTI_HYPOTHESIS_INTRA
m_cEncLib.setUseMHIntra ( m_MHIntra );
#endif
#if JVET_L0124_L0208_TRIANGLE
m_cEncLib.setUseTriangle ( m_Triangle );
#endif
#if JVET_L0293_CPR
m_cEncLib.setCPRMode ( m_CPRMode );
m_cEncLib.setCPRLocalSearchRangeX ( m_CPRLocalSearchRangeX );
m_cEncLib.setCPRLocalSearchRangeY ( m_CPRLocalSearchRangeY );
......@@ -270,12 +256,9 @@ void EncApp::xInitLibCfg()
m_cEncLib.setCPRHashSearchMaxCand ( m_CPRHashSearchMaxCand );
m_cEncLib.setCPRHashSearchRange4SmallBlk ( m_CPRHashSearchRange4SmallBlk );
m_cEncLib.setCPRFastMethod ( m_CPRFastMethod );
#endif
#if JVET_L0231_WRAPAROUND
m_cEncLib.setUseWrapAround ( m_wrapAround );
m_cEncLib.setWrapAroundOffset ( m_wrapAroundOffset );
#endif
// ADD_NEW_TOOL : (encoder app) add setting of tool enabling flags and associated parameters here
......@@ -330,9 +313,7 @@ void EncApp::xInitLibCfg()
m_cEncLib.setPCMLog2MaxSize ( m_pcmLog2MaxSize);
m_cEncLib.setMaxNumMergeCand ( m_maxNumMergeCand );
#if JVET_L0632_AFFINE_MERGE
m_cEncLib.setMaxNumAffineMergeCand ( m_maxNumAffineMergeCand );
#endif
//====== Weighted Prediction ========
m_cEncLib.setUseWP ( m_useWeightedPred );
......
This diff is collapsed.
......@@ -197,9 +197,7 @@ protected:
// coding unit (CU) definition
unsigned m_uiCTUSize;
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
bool m_SplitConsOverrideEnabledFlag;
#endif
unsigned m_uiMinQT[3]; // 0: I slice luma; 1: P/B slice; 2: I slice chroma
unsigned m_uiMaxBTDepth;
unsigned m_uiMaxBTDepthI;
......@@ -207,14 +205,9 @@ protected:
bool m_dualTree;
bool m_LargeCTU;
int m_SubPuMvpMode;
#if !JVET_L0198_L0468_L0104_ATMVP_8x8SUB_BLOCK
unsigned m_SubPuMvpLog2Size;
#endif
bool m_Affine;
bool m_AffineType;
#if JVET_L0256_BIO
bool m_BIO;
#endif
bool m_DisableMotionCompression;
unsigned m_MTT;
#if ENABLE_WPP_PARALLELISM
......@@ -225,10 +218,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;
......@@ -236,15 +227,10 @@ protected:
int m_LadfIntervalLowerBound[MAX_LADF_INTERVALS];
#endif
#if JVET_L0100_MULTI_HYPOTHESIS_INTRA
bool m_MHIntra;
#endif
#if JVET_L0124_L0208_TRIANGLE
bool m_Triangle;
#endif
#if JVET_L0293_CPR
unsigned m_CPRMode;
unsigned m_CPRLocalSearchRangeX;
unsigned m_CPRLocalSearchRangeY;
......@@ -252,12 +238,9 @@ protected:
unsigned m_CPRHashSearchMaxCand;
unsigned m_CPRHashSearchRange4SmallBlk;
unsigned m_CPRFastMethod;
#endif
#if JVET_L0231_WRAPAROUND
bool m_wrapAround;
unsigned m_wrapAroundOffset;
#endif
// ADD_NEW_TOOL : (encoder app) add tool enabling flags and associated parameters here
......@@ -453,9 +436,7 @@ protected:
uint32_t m_log2ParallelMergeLevel; ///< Parallel merge estimation region
uint32_t m_maxNumMergeCand; ///< Max number of merge candidates
#if JVET_L0632_AFFINE_MERGE
uint32_t m_maxNumAffineMergeCand; ///< Max number of affine merge candidates
#endif
int m_TMVPModeId;
bool m_depQuantEnabledFlag;
......
......@@ -104,22 +104,7 @@ void AdaptiveLoopFilter::ALFProcess( CodingStructure& cs, AlfSliceParam& alfSlic
{
Area blk( xPos, yPos, width, height );
deriveClassification( m_classifier, tmpYuv.get( COMPONENT_Y ), blk );
#if JVET_L0664_ALF_REMOVE_LUMA_5x5
m_filter7x7Blk(m_classifier, recYuv, tmpYuv, blk, COMPONENT_Y, m_coeffFinal, m_clpRngs.comp[COMPONENT_Y]);
#else
if( alfSliceParam.lumaFilterType == ALF_FILTER_5 )
{
m_filter5x5Blk( m_classifier, recYuv, tmpYuv, blk, COMPONENT_Y, m_coeffFinal, m_clpRngs.comp[COMPONENT_Y] );
}
else if( alfSliceParam.lumaFilterType == ALF_FILTER_7 )
{
m_filter7x7Blk( m_classifier, recYuv, tmpYuv, blk, COMPONENT_Y, m_coeffFinal, m_clpRngs.comp[COMPONENT_Y] );
}
else
{
CHECK( 0, "Wrong ALF filter type" );
}
#endif
}
for( int compIdx = 1; compIdx < MAX_NUM_COMPONENT; compIdx++ )
......@@ -143,11 +128,7 @@ void AdaptiveLoopFilter::ALFProcess( CodingStructure& cs, AlfSliceParam& alfSlic
void AdaptiveLoopFilter::reconstructCoeff( AlfSliceParam& alfSliceParam, ChannelType channel, const bool bRedo )
{
int factor = ( 1 << ( m_NUM_BITS - 1 ) );
#if JVET_L0664_ALF_REMOVE_LUMA_5x5
AlfFilterType filterType = isLuma( channel ) ? ALF_FILTER_7 : ALF_FILTER_5;
#else
AlfFilterType filterType = isLuma( channel ) ? alfSliceParam.lumaFilterType : ALF_FILTER_5;
#endif
int numClasses = isLuma( channel ) ? MAX_NUM_ALF_CLASSES : 1;
int numCoeff = filterType == ALF_FILTER_5 ? 7 : 13;
int numCoeffMinus1 = numCoeff - 1;
......@@ -211,9 +192,6 @@ void AdaptiveLoopFilter::create( const int picWidth, const int picHeight, const
m_numCTUsInWidth = ( m_picWidth / m_maxCUWidth ) + ( ( m_picWidth % m_maxCUWidth ) ? 1 : 0 );
m_numCTUsInHeight = ( m_picHeight / m_maxCUHeight ) + ( ( m_picHeight % m_maxCUHeight ) ? 1 : 0 );
m_numCTUsInPic = m_numCTUsInHeight * m_numCTUsInWidth;
#if !JVET_L0664_ALF_REMOVE_LUMA_5x5
m_filterShapes[CHANNEL_TYPE_LUMA].push_back( AlfFilterShape( 5 ) );
#endif
m_filterShapes[CHANNEL_TYPE_LUMA].push_back( AlfFilterShape( 7 ) );
m_filterShapes[CHANNEL_TYPE_CHROMA].push_back( AlfFilterShape( 5 ) );
......@@ -337,23 +315,12 @@ void AdaptiveLoopFilter::deriveClassificationBlk( AlfClassifier** classifier, in
const Pel* pYup2 = src3 + pixY;
const Pel y0 = pY[0] << 1;
#if !JVET_L0147_ALF_SUBSAMPLED_LAPLACIAN
const Pel y1 = pY[1] << 1;
const Pel yup0 = pYup[0] << 1;
#endif
const Pel yup1 = pYup[1] << 1;
#if JVET_L0147_ALF_SUBSAMPLED_LAPLACIAN
pYver[j] = abs( y0 - pYdown[0] - pYup[0] ) + abs( yup1 - pY[1] - pYup2[1] );
pYhor[j] = abs( y0 - pY[1] - pY[-1] ) + abs( yup1 - pYup[2] - pYup[0] );
pYdig0[j] = abs( y0 - pYdown[-1] - pYup[1] ) + abs( yup1 - pY[0] - pYup2[2] );
pYdig1[j] = abs( y0 - pYup[-1] - pYdown[1] ) + abs( yup1 - pYup2[0] - pY[2] );
#else
pYver[j] = abs( y0 - pYdown[0] - pYup[0] ) + abs( y1 - pYdown[1] - pYup[1] ) + abs( yup0 - pY[0] - pYup2[0] ) + abs( yup1 - pY[1] - pYup2[1] );
pYhor[j] = abs( y0 - pY[1] - pY[-1] ) + abs( y1 - pY[2] - pY[0] ) + abs( yup0 - pYup[1] - pYup[-1] ) + abs( yup1 - pYup[2] - pYup[0] );
pYdig0[j] = abs( y0 - pYdown[-1] - pYup[1] ) + abs( y1 - pYdown[0] - pYup[2] ) + abs( yup0 - pY[-1] - pYup2[1] ) + abs( yup1 - pY[0] - pYup2[2] );
pYdig1[j] = abs( y0 - pYup[-1] - pYdown[1] ) + abs( y1 - pYup[0] - pYdown[2] ) + abs( yup0 - pYup2[-1] - pY[1] ) + abs( yup1 - pYup2[0] - pY[2] );
#endif
if( j > 4 && ( j - 6 ) % 4 == 0 )
{
......@@ -403,11 +370,7 @@ void AdaptiveLoopFilter::deriveClassificationBlk( AlfClassifier** classifier, in
int sumD1 = pYdig1[j] + pYdig12[j] + pYdig14[j] + pYdig16[j];
int tempAct = sumV + sumH;
#if JVET_L0147_ALF_SUBSAMPLED_LAPLACIAN
int activity = (Pel)Clip3<int>( 0, maxActivity, ( tempAct * 64 ) >> shift );
#else
int activity = (Pel)Clip3<int>( 0, maxActivity, ( tempAct * 32 ) >> shift );
#endif
int classIdx = th[activity];
int hv1, hv0, d1, d0, hvd1, hvd0;
......@@ -509,11 +472,7 @@ void AdaptiveLoopFilter::filterBlk( AlfClassifier** classifier, const PelUnitBuf
short *coef = filterSet;
#if JVET_L0083_ALF_FRAC_BIT
const int shift = m_NUM_BITS - 1;
#else
const int shift = 9;
#endif
const int offset = 1 << ( shift - 1 );
......
......@@ -66,11 +66,7 @@ enum Direction
class AdaptiveLoopFilter
{
public:
#if JVET_L0083_ALF_FRAC_BIT
static constexpr int m_NUM_BITS = 8;
#else
static constexpr int m_NUM_BITS = 10;
#endif
static constexpr int m_CLASSIFICATION_BLK_SIZE = 32; //non-normative, local buffer size
AdaptiveLoopFilter();
......
......@@ -135,50 +135,28 @@ void AffineGradientSearch::xEqualCoeffComputer( Pel *pResidue, int residueStride
for ( int j = 0; j != height; j++ )
{
#if JVET_L0260_AFFINE_ME
int cy = ((j >> 2) << 2) + 2;
#endif
for ( int k = 0; k != width; k++ )
{
int iC[6];
int idx = j * derivateBufStride + k;
#if JVET_L0260_AFFINE_ME
int cx = ((k >> 2) << 2) + 2;
#endif
if ( !b6Param )
{
iC[0] = ppDerivate[0][idx];
#if JVET_L0260_AFFINE_ME
iC[1] = cx * ppDerivate[0][idx] + cy * ppDerivate[1][idx];
#else
iC[1] = k * ppDerivate[0][idx] + j * ppDerivate[1][idx];
#endif
iC[2] = ppDerivate[1][idx];
#if JVET_L0260_AFFINE_ME
iC[3] = cy * ppDerivate[0][idx] - cx * ppDerivate[1][idx];
#else
iC[3] = j * ppDerivate[0][idx] - k * ppDerivate[1][idx];
#endif
}
else
{
iC[0] = ppDerivate[0][idx];
#if JVET_L0260_AFFINE_ME
iC[1] = cx * ppDerivate[0][idx];
#else
iC[1] = k * ppDerivate[0][idx];
#endif
iC[2] = ppDerivate[1][idx];
#if JVET_L0260_AFFINE_ME
iC[3] = cx * ppDerivate[1][idx];
iC[4] = cy * ppDerivate[0][idx];
iC[5] = cy * ppDerivate[1][idx];
#else
iC[3] = k * ppDerivate[1][idx];
iC[4] = j * ppDerivate[0][idx];
iC[5] = j * ppDerivate[1][idx];
#endif
}
for ( int col = 0; col < affineParamNum; col++ )
{
......
......@@ -62,7 +62,6 @@ void addAvgCore( const T* src1, int src1Stride, const T* src2, int src2Stride, T
#undef ADD_AVG_CORE_INC
}
#if JVET_L0256_BIO
void addBIOAvgCore(const Pel* src0, int src0Stride, const Pel* src1, int src1Stride, Pel *dst, int dstStride, const Pel *gradX0, const Pel *gradX1, const Pel *gradY0, const Pel*gradY1, int gradStride, int width, int height, int tmpx, int tmpy, int shift, int offset, const ClpRng& clpRng)
{
int b = 0;
......@@ -192,9 +191,8 @@ void calcBlkGradientCore(int sx, int sy, int *arraysGx2, int *arraysGxGy
GydI += width;
}
}
#endif
#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;
......@@ -270,12 +268,10 @@ PelBufferOps::PelBufferOps()
linTf4 = linTfCore<Pel>;
linTf8 = linTfCore<Pel>;
#if ENABLE_SIMD_OPT_BIO
addBIOAvg4 = addBIOAvgCore;
bioGradFilter = gradFilterCore;
calcBIOPar = calcBIOParCore;
calcBlkGradient = calcBlkGradientCore;
#endif
#if ENABLE_SIMD_OPT_GBI
removeWeightHighFreq8 = removeWeightHighFreq;
......@@ -291,7 +287,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)
{
......@@ -321,7 +316,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)
......
......@@ -68,12 +68,10 @@ struct PelBufferOps
void ( *reco8 ) ( const Pel* src0, int src0Stride, const Pel* src1, int src1Stride, Pel *dst, int dstStride, int width, int height, const ClpRng& clpRng );
void ( *linTf4 ) ( const Pel* src0, int src0Stride, Pel *dst, int dstStride, int width, int height, int scale, int shift, int offset, const ClpRng& clpRng, bool bClip );
void ( *linTf8 ) ( const Pel* src0, int src0Stride, Pel *dst, int dstStride, int width, int height, int scale, int shift, int offset, const ClpRng& clpRng, bool bClip );
#if ENABLE_SIMD_OPT_BIO
void(*addBIOAvg4) (const Pel* src0, int src0Stride, const Pel* src1, int src1Stride, Pel *dst, int dstStride, const Pel *gradX0, const Pel *gradX1, const Pel *gradY0, const Pel*gradY1, int gradStride, int width, int height, int tmpx, int tmpy, int shift, int offset, const ClpRng& clpRng);
void(*bioGradFilter) (Pel* pSrc, int srcStride, int width, int height, int gradStride, Pel* gradX, Pel* gradY);
void(*calcBIOPar) (const Pel* srcY0Temp, const Pel* srcY1Temp, const Pel* gradX0, const Pel* gradX1, const Pel* gradY0, const Pel* gradY1, int* dotProductTemp1, int* dotProductTemp2, int* dotProductTemp3, int* dotProductTemp5, int* dotProductTemp6, const int src0Stride, const int src1Stride, const int gradStride, const int widthG, const int heightG);
void(*calcBlkGradient)(int sx, int sy, int *arraysGx2, int *arraysGxGy, int *arraysGxdI, int *arraysGy2, int *arraysGydI, int &sGx2, int &sGy2, int &sGxGy, int &sGxdI, int &sGydI, int width, int height, int unitSize);
#endif
#if ENABLE_SIMD_OPT_GBI
void ( *removeWeightHighFreq8) ( Pel* src0, int src0Stride, const Pel* src1, int src1Stride, int width, int height, int shift, int gbiWeight);
void ( *removeWeightHighFreq4) ( Pel* src0, int src0Stride, const Pel* src1, int src1Stride, int width, int height, int shift, int gbiWeight);
......@@ -114,10 +112,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 +396,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 +447,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 +457,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 +491,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 +657,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 +732,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 +745,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 +780,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,21 +98,13 @@ 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,
#if JVET_L0100_MULTI_HYPOTHESIS_INTRA
STATS__CABAC_BITS__MH_INTRA_FLAG,
#endif
#if JVET_L0124_L0208_TRIANGLE
STATS__CABAC_BITS__TRIANGLE_FLAG,
STATS__CABAC_BITS__TRIANGLE_INDEX,
#endif
#if JVET_L0283_MULTI_REF_LINE
STATS__CABAC_BITS__MULTI_REF_LINE,
#endif
STATS__TOOL_TOTAL_FRAME,// This is a special case and is not included in the report.
STATS__TOOL_AFF,
STATS__TOOL_EMT,
......@@ -185,21 +177,13 @@ 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",
#if JVET_L0100_MULTI_HYPOTHESIS_INTRA
"CABAC_BITS__MH_INTRA_FLAG",
#endif
#if JVET_L0124_L0208_TRIANGLE
"CABAC_BITS__TRIANGLE_FLAG",
"CABAC_BITS__TRIANGLE_INDEX",
#endif
#if JVET_L0283_MULTI_REF_LINE
"CABAC_BITS__MULTI_REF_LINE",
#endif
"TOOL_FRAME",
"TOOL_AFFINE",
"TOOL_EMT",
......
......@@ -746,11 +746,7 @@ void CodingStructure::useSubStructure( const CodingStructure& subStruct, const C
if( cpyResi ) picture->getResiBuf( clippedArea ).copyFrom( subResiBuf );
if( cpyReco ) picture->getRecoBuf( clippedArea ).copyFrom( subRecoBuf );
#if JVET_L0293_CPR
if (!subStruct.m_isTuEnc && (!slice->isIntra() && subStruct.chType != CHANNEL_TYPE_CHROMA))
#else
if( !subStruct.m_isTuEnc && !slice->isIntra() )
#endif
{
// copy motion buffer
MotionBuf ownMB = getMotionBuf ( clippedArea );
......@@ -1303,7 +1299,6 @@ const TransformUnit* CodingStructure::getTURestricted( const Position &pos, cons
}
}
#if JVET_L0293_CPR
CprLumaCoverage CodingStructure::getCprLumaCoverage(const CompArea& chromaArea) const
{
CHECK(chType != CHANNEL_TYPE_CHROMA, "Error");
......@@ -1337,4 +1332,3 @@ CprLumaCoverage CodingStructure::getCprLumaCoverage(const CompArea& chromaArea)
return coverage;
}
#endif
......@@ -58,7 +58,6 @@ enum PictureType
PIC_ORG_RESI,
NUM_PIC_TYPES
};
#if JVET_L0293_CPR
enum CprLumaCoverage
{
CPR_LUMA_COVERAGE_FULL = 0,
......@@ -66,7 +65,6 @@ enum CprLumaCoverage
CPR_LUMA_COVERAGE_NONE,
NUM_CPR_LUMA_COVERAGE,
};
#endif
extern XUCache g_globalUnitCache;
// ---------------------------------------------------------------------------
......@@ -85,9 +83,7 @@ public:
Slice *slice;
UnitScale unitScale[MAX_NUM_COMPONENT];
#if JVET_L0293_CPR
ChannelType chType;
#endif
int baseQP;
int prevQP[MAX_NUM_CHANNEL_TYPE];
......@@ -158,9 +154,7 @@ public:
cCUTraverser traverseCUs(const UnitArea& _unit, const ChannelType _chType) const;
cPUTraverser traversePUs(const UnitArea& _unit, const ChannelType _chType) const;
cTUTraverser traverseTUs(const UnitArea& _unit, const ChannelType _chType) const;
#if JVET_L0293_CPR
CprLumaCoverage getCprLumaCoverage(const CompArea& chromaArea) const;
#endif
// ---------------------------------------------------------------------------
// encoding search utilities
// ---------------------------------------------------------------------------
......
......@@ -114,7 +114,6 @@ struct UnitScale
Size scale( const Size &size ) const { return { size.width >> posx, size.height >> posy }; }
Area scale( const Area &_area ) const { return Area( scale( _area.pos() ), scale( _area.size() ) ); }
};
#if JVET_L0293_CPR
namespace std
{
template <>
......@@ -135,7 +134,6 @@ namespace std
}
};
}
#endif
inline size_t rsAddr(const Position &pos, const uint32_t stride, const UnitScale &unitScale )
{
return (size_t)(stride >> unitScale.posx) * (size_t)(pos.y >> unitScale.posy) + (size_t)(pos.x >> unitScale.posx);
......
......@@ -110,11 +110,9 @@ typedef enum
AFFINE_MODEL_NUM
} EAffineModel;
#if JVET_L0260_AFFINE_ME
static const int AFFINE_ME_LIST_SIZE = 4;
static const int AFFINE_ME_LIST_SIZE_LD = 3;
static const double AFFINE_ME_LIST_MVP_TH = 1.0;
#endif
// ====================================================================================================================
// Common constants
......@@ -141,9 +139,7 @@ static const int AMVP_MAX_NUM_CANDS = 2; ///< AMVP
static const int AMVP_MAX_NUM_CANDS_MEM = 3; ///< AMVP: advanced motion vector prediction - max number of candidates
static const int AMVP_DECIMATION_FACTOR = 2;
static const int MRG_MAX_NUM_CANDS = 7; ///< MERGE
#if JVET_L0632_AFFINE_MERGE
static const int AFFINE_MRG_MAX_NUM_CANDS = 5; ///< AFFINE MERGE
#endif
static const int MAX_TLAYER = 7; ///< Explicit temporal layer QP offset - max number of temporal layer
......@@ -190,18 +186,12 @@ static const int ADJ_DEQUANT_SHIFT = ( ADJ_QUANT_SHIFT + 1 );
static const int RVM_VCEGAM10_M = 4;
#if JVET_L0283_MULTI_REF_LINE
static const int MAX_REF_LINE_IDX = 3; //highest refLine offset in the list
static const int MRL_NUM_REF_LINES = 3; //number of candidates in the array
static const int MULTI_REF_LINE_IDX[4] = { 0, 1, 3, 0 };
#endif
static const int NUM_LUMA_MODE = 67; ///< Planar + DC + 65 directional mode (4*16 + 1)
#if JVET_L0338_MDLM
static const int NUM_LMC_MODE = 1 + 2; ///< LMC + MDLM_T + MDLM_L
#else
static const int NUM_LMC_MODE = 1; ///< LMC
#endif
static const int NUM_INTRA_MODE = (NUM_LUMA_MODE + NUM_LMC_MODE);
static const int NUM_DIR = (((NUM_LUMA_MODE - 3) >> 2) + 1);
......@@ -215,21 +205,15 @@ static const int NOMODE_IDX = MAX_UCHAR; ///< indi
static const int NUM_CHROMA_MODE = (5 + NUM_LMC_MODE); ///< total number of chroma modes
static const int LM_CHROMA_IDX = NUM_LUMA_MODE; ///< chroma mode index for derived from LM mode
#if JVET_L0338_MDLM
static const int MDLM_L_IDX = LM_CHROMA_IDX + 1; ///< MDLM_L
static const int MDLM_T_IDX = LM_CHROMA_IDX + 2; ///< MDLM_T
#endif
static const int DM_CHROMA_IDX = NUM_INTRA_MODE; ///< chroma mode index for derived from luma intra mode
static const uint8_t INTER_MODE_IDX = 255; ///< index for inter modes
static const uint32_t EMT_INTRA_MAX_CU_WITH_QTBT = 32; ///< Max Intra CU size applying EMT, supported values: 8, 16, 32, 64, 128
static const uint32_t EMT_INTER_MAX_CU_WITH_QTBT = 32; ///< Max Inter CU size applying EMT, supported values: 8, 16, 32, 64, 128
#if JVET_L0165_6MPM
static const int NUM_MOST_PROBABLE_MODES = 6;
#else
static const int NUM_MOST_PROBABLE_MODES = 3;
#endif
static const int LM_SYMBOL_NUM = (1 + NUM_LMC_MODE);
static const int FAST_UDI_MAX_RDMODE_NUM = NUM_LUMA_MODE; ///< maximum number of RD comparison in fast-UDI estimation loop
......@@ -279,9 +263,7 @@ static const int MAX_TU_SIZE = 128;
static const int MAX_LOG2_TU_SIZE_PLUS_ONE = 8; ///< log2(MAX_TU_SIZE) + 1
static const int MAX_NUM_PARTS_IN_CTU = ( ( MAX_CU_SIZE * MAX_CU_SIZE ) >> ( MIN_CU_LOG2 << 1 ) );
static const int MAX_TR_SIZE = MAX_CU_SIZE;
#if JVET_L0081_VPDU_SPLIT_CONSTRAINTS
static const int MAX_TU_SIZE_FOR_PROFILE = 64;
#endif
static const int MAX_LOG2_DIFF_CU_TR_SIZE = 2;
static const int MAX_CU_TILING_PARTITIONS = 1 << ( MAX_LOG2_DIFF_CU_TR_SIZE << 1 );
......@@ -310,36 +292,26 @@ static const int MAX_GR_ORDER_RESIDUAL = 10;
static const int AFFINE_MIN_BLOCK_SIZE = 4; ///< Minimum affine MC block size
#if JVET_L0054_MMVD
static const int MMVD_REFINE_STEP = 8; ///< max number of distance step
static const int MMVD_MAX_REFINE_NUM = (MMVD_REFINE_STEP * 4); ///< max number of candidate from a base candidate
static const int MMVD_BASE_MV_NUM = 2; ///< max number of base candidate
static const int MMVD_ADD_NUM = (MMVD_MAX_REFINE_NUM * MMVD_BASE_MV_NUM);///< total number of mmvd candidate
static const int MMVD_MRG_MAX_RD_NUM = MRG_MAX_NUM_CANDS;
static const int MMVD_MRG_MAX_RD_BUF_NUM = (MMVD_MRG_MAX_RD_NUM + 1);///< increase buffer size by 1
#endif
#if JVET_L0274
static const int MAX_NUM_REG_BINS_4x4SUBBLOCK = 32; ///< max number of context-coded bins (incl. gt2 bins) per 4x4 subblock
static const int MAX_NUM_GT2_BINS_4x4SUBBLOCK = 4; ///< max number of gt2 bins per 4x4 subblock
static const int MAX_NUM_REG_BINS_2x2SUBBLOCK = 8; ///< max number of context-coded bins (incl. gt2 bins) per 2x2 subblock (chroma)
static const int MAX_NUM_GT2_BINS_2x2SUBBLOCK = 2; ///< max number of gt2 bins per 2x2 subblock (chroma)
#endif
#if JVET_L0256_BIO
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);
#endif
#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 =