Commit b27d62a7 authored by Frank Bossen's avatar Frank Bossen

Remove JVET_K_AFFINE macro

parent 5cb8fd0e
......@@ -225,13 +225,11 @@ void EncApp::xInitLibCfg()
#endif
m_cEncLib.setSubPuMvpLog2Size ( m_SubPuMvpLog2Size );
#endif
#if JVET_K_AFFINE
m_cEncLib.setAffine ( m_Affine );
#if JVET_K0337_AFFINE_6PARA
m_cEncLib.setAffineType ( m_AffineType );
#endif
#endif
#if (JVET_K0346 || JVET_K_AFFINE) && !REMOVE_MV_ADAPT_PREC
#if !REMOVE_MV_ADAPT_PREC
m_cEncLib.setHighPrecisionMv (m_highPrecisionMv);
#endif
m_cEncLib.setDisableMotionCompression ( m_DisableMotionCompression );
......
......@@ -817,14 +817,12 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
("HighPrecMv", m_highPrecisionMv, false, "High precision motion vectors for temporal merging (0:off, 1:on) [default: off]")
#endif
#endif
#if JVET_K_AFFINE
#if !REMOVE_MV_ADAPT_PREC
("HighPrecMv", m_highPrecisionMv, false, "High precision motion vectors for temporal merging (0:off, 1:on) [default: off]")
#endif
("Affine", m_Affine, false, "Enable affine prediction (0:off, 1:on) [default: off]")
#if JVET_K0337_AFFINE_6PARA
( "AffineType", m_AffineType, true, "Enable affine type prediction (0:off, 1:on) [default: on]" )
#endif
#endif
("DisableMotCompression", m_DisableMotionCompression, false, "Disable motion data compression for all modes")
#if JVET_K0357_AMVR
......@@ -1924,12 +1922,9 @@ bool EncAppCfg::xCheckParameter()
#if JVET_K0346
xConfirmPara( m_SubPuMvpMode != 0, "Sub-PU motion vector prediction is only allowed with NEXT profile" );
#endif
#if JVET_K_AFFINE && !REMOVE_MV_ADAPT_PREC
#if !REMOVE_MV_ADAPT_PREC
xConfirmPara( m_highPrecisionMv, "High precision MV for temporal merging can only be used with NEXT profile" );
xConfirmPara( m_Affine, "Affine is only allowed with NEXT profile" );
#endif
#if JVET_K0346 && !JVET_K_AFFINE && !REMOVE_MV_ADAPT_PREC
xConfirmPara(m_highPrecisionMv, "High precision MV for temporal merging can only be used with NEXT profile");
#endif
xConfirmPara( m_DisableMotionCompression, "Disable motion data compression only allowed with NEXT profile" );
xConfirmPara( m_MTT, "Multi type tree is only allowed with NEXT profile" );
......@@ -1976,10 +1971,8 @@ bool EncAppCfg::xCheckParameter()
xConfirmPara( m_useSaveLoadSplitDecision && !m_QTBT, "Encoder split decision saving can only be applied with QTBT" );
#endif
#if JVET_K_AFFINE
#if !REMOVE_MV_ADAPT_PREC
xConfirmPara(m_Affine && !m_highPrecisionMv, "Affine is not yet implemented for HighPrecMv off.");
#endif
#endif
}
......@@ -3156,7 +3149,6 @@ void EncAppCfg::xPrintParameter()
if( m_profile == Profile::NEXT )
{
msg( VERBOSE, "\nNEXT TOOL CFG: " );
#if JVET_K_AFFINE
msg( VERBOSE, "Affine:%d ", m_Affine );
#if JVET_K0337_AFFINE_6PARA
if ( m_Affine )
......@@ -3164,7 +3156,6 @@ void EncAppCfg::xPrintParameter()
msg( VERBOSE, "AffineType:%d ", m_AffineType );
}
#endif
#endif
#if JVET_K0346
msg(VERBOSE, "SubPuMvp:%d+%d ", m_SubPuMvpMode & 1, (m_SubPuMvpMode & 2) == 2);
if (m_SubPuMvpMode != 0)
......@@ -3179,10 +3170,8 @@ void EncAppCfg::xPrintParameter()
msg( VERBOSE, "IMV:%d ", m_ImvMode );
if( !m_QTBT ) msg( VERBOSE, "IMVMaxCand:%d ", m_ImvMaxCand );
#endif
#if JVET_K0346 || JVET_K_AFFINE
#if !REMOVE_MV_ADAPT_PREC
msg(VERBOSE, "HighPrecMv:%d ", m_highPrecisionMv);
#endif
#endif
msg( VERBOSE, "DisMDC:%d ", m_DisableMotionCompression );
msg( VERBOSE, "MTT:%d ", m_MTT );
......
......@@ -208,13 +208,11 @@ protected:
int m_SubPuMvpMode;
unsigned m_SubPuMvpLog2Size;
#endif
#if JVET_K_AFFINE
bool m_Affine;
#if JVET_K0337_AFFINE_6PARA
bool m_AffineType;
#endif
#endif
#if (JVET_K0346 || JVET_K_AFFINE) && !REMOVE_MV_ADAPT_PREC
#if !REMOVE_MV_ADAPT_PREC
bool m_highPrecisionMv;
#endif
bool m_DisableMotionCompression;
......
......@@ -94,12 +94,10 @@ enum CodingStatisticsType
STATS__CABAC_BITS__OTHER,
STATS__CABAC_BITS__INVALID,
STATS__TOOL_TOTAL_FRAME,// This is a special case and is not included in the report.
#if JVET_K_AFFINE
STATS__CABAC_BITS__AFFINE_FLAG,
STATS__TOOL_AFF,
#if JVET_K0337_AFFINE_6PARA
STATS__CABAC_BITS__AFFINE_TYPE,
#endif
#endif
STATS__CABAC_BITS__PAR_FLAG,
STATS__CABAC_BITS__ALF,
......@@ -146,11 +144,9 @@ static inline const char* getName(CodingStatisticsType name)
"CABAC_BITS__REF_FRM_IDX",
"CABAC_BITS__MVD",
"CABAC_BITS__MVD_EP",
#if JVET_K_AFFINE
"CABAC_BITS__AFFINE_FLAG",
#if JVET_K0337_AFFINE_6PARA
"CABAC_BITS__AFFINE_TYPE",
#endif
#endif
"CABAC_BITS__TRANSFORM_SUBDIV_FLAG",
"CABAC_BITS__QT_ROOT_CBF",
......
......@@ -239,9 +239,7 @@ static const int CABAC_INIT_PRESENT_FLAG = 1;
static const int LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS = 4;
static const int CHROMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS = 8;
#if JVET_K0346 || JVET_K_AFFINE
static const int VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE = 2; ///< additional precision bit for MV storage
#endif
static const int MAX_NUM_LONG_TERM_REF_PICS = 33;
static const int NUM_LONG_TERM_REF_PIC_SPS = 0;
......@@ -300,13 +298,11 @@ static const int CONTEXT_STATE_BITS = 6;
static const int LAST_SIGNIFICANT_GROUPS = 14;
static const int MAX_GR_ORDER_RESIDUAL = 10;
#if JVET_K_AFFINE
static const int AFFINE_MAX_NUM_V0 = 3; ///< max number of motion candidates in top-left corner
static const int AFFINE_MAX_NUM_V1 = 2; ///< max number of motion candidates in top-right corner
static const int AFFINE_MAX_NUM_V2 = 2; ///< max number of motion candidates in left-bottom corner
static const int AFFINE_MAX_NUM_COMB = 12; ///< max number of combined motion candidates
static const int AFFINE_MIN_BLOCK_SIZE = 4; ///< Minimum affine MC block size
#endif
#if W0038_DB_OPT
......
......@@ -254,7 +254,6 @@ unsigned DeriveCtx::CtxInterDir( const PredictionUnit& pu )
return pu.cu->qtDepth;
}
#if JVET_K_AFFINE
unsigned DeriveCtx::CtxAffineFlag( const CodingUnit& cu )
{
const CodingStructure *cs = cu.cs;
......@@ -268,7 +267,6 @@ unsigned DeriveCtx::CtxAffineFlag( const CodingUnit& cu )
return ctxId;
}
#endif
unsigned DeriveCtx::CtxSkipFlag( const CodingUnit& cu )
{
const CodingStructure *cs = cu.cs;
......
......@@ -292,9 +292,7 @@ unsigned CtxSkipFlag ( const CodingUnit& cu );
#if JVET_K0357_AMVR
unsigned CtxIMVFlag ( const CodingUnit& cu );
#endif
#if JVET_K_AFFINE
unsigned CtxAffineFlag( const CodingUnit& cu );
#endif
}
#endif // __CONTEXTMODELLING__
......@@ -353,7 +353,6 @@ const CtxSet ContextSetCfg::RefPic = ContextSetCfg::addCtxSet
{ CNU, CNU,},
});
#if JVET_K_AFFINE
const CtxSet ContextSetCfg::AffineFlag = ContextSetCfg::addCtxSet
({
{ 197, 185, 201,},
......@@ -369,7 +368,6 @@ const CtxSet ContextSetCfg::AffineType = ContextSetCfg::addCtxSet
{ CNU, },
});
#endif
#endif
const CtxSet ContextSetCfg::Mvd = ContextSetCfg::addCtxSet
......
......@@ -166,11 +166,9 @@ public:
static const CtxSet DeltaQP;
static const CtxSet InterDir;
static const CtxSet RefPic;
#if JVET_K_AFFINE
static const CtxSet AffineFlag;
#if JVET_K0337_AFFINE_6PARA
static const CtxSet AffineType;
#endif
#endif
static const CtxSet Mvd;
static const CtxSet TransSubdivFlag;
......
......@@ -156,11 +156,7 @@ void InterPrediction::init( RdCost* pcRdCost, ChromaFormat chromaFormatIDC )
#endif
}
#if JVET_K_AFFINE
bool checkIdenticalMotion( const PredictionUnit &pu, bool checkAffine )
#else
bool checkIdenticalMotion( const PredictionUnit &pu )
#endif
{
const Slice &slice = *pu.cs->slice;
......@@ -173,16 +169,13 @@ bool checkIdenticalMotion( const PredictionUnit &pu )
if( RefPOCL0 == RefPOCL1 )
{
#if JVET_K_AFFINE
if( !pu.cu->affine )
#endif
{
if( pu.mv[0] == pu.mv[1] )
{
return true;
}
}
#if JVET_K_AFFINE
else
{
CHECK( !checkAffine, "In this case, checkAffine should be on." );
......@@ -201,7 +194,6 @@ bool checkIdenticalMotion( const PredictionUnit &pu )
return true;
}
}
#endif
}
}
}
......@@ -226,16 +218,13 @@ bool InterPrediction::xCheckIdenticalMotion( const PredictionUnit &pu )
if( RefPOCL0 == RefPOCL1 )
{
#if JVET_K_AFFINE
if( !pu.cu->affine )
#endif
{
if( pu.mv[0] == pu.mv[1] )
{
return true;
}
}
#if JVET_K_AFFINE
else
{
const CMotionBuf &mb = pu.getMotionBuf();
......@@ -253,7 +242,6 @@ bool InterPrediction::xCheckIdenticalMotion( const PredictionUnit &pu )
return true;
}
}
#endif
}
}
}
......@@ -373,7 +361,6 @@ void InterPrediction::xPredInterUni(const PredictionUnit& pu, const RefPicList&
int iRefIdx = pu.refIdx[eRefPicList];
Mv mv[3];
#if JVET_K_AFFINE
if( pu.cu->affine )
{
CHECK( iRefIdx < 0, "iRefIdx incorrect." );
......@@ -388,11 +375,10 @@ void InterPrediction::xPredInterUni(const PredictionUnit& pu, const RefPicList&
#endif
}
else
#endif
{
mv[0] = pu.mv[eRefPicList];
}
#if JVET_K_AFFINE && JVET_K_AFFINE_BUG_FIXES
#if JVET_K_AFFINE_BUG_FIXES
if ( !pu.cu->affine )
#endif
clipMv(mv[0], pu.cu->lumaPos(), sps);
......@@ -401,13 +387,11 @@ void InterPrediction::xPredInterUni(const PredictionUnit& pu, const RefPicList&
for( uint32_t comp = COMPONENT_Y; comp < pcYuvPred.bufs.size() && comp <= m_maxCompIDToPred; comp++ )
{
const ComponentID compID = ComponentID( comp );
#if JVET_K_AFFINE
if ( pu.cu->affine )
{
xPredAffineBlk( compID, pu, pu.cu->slice->getRefPic( eRefPicList, iRefIdx ), mv, pcYuvPred, bi, pu.cu->slice->clpRng( compID ) );
}
else
#endif
{
xPredInterBlk( compID, pu, pu.cu->slice->getRefPic( eRefPicList, iRefIdx ), mv[0], pcYuvPred, bi, pu.cu->slice->clpRng( compID )
);
......@@ -481,7 +465,6 @@ void InterPrediction::xPredInterBlk ( const ComponentID& compID, const Predictio
)
{
JVET_J0090_SET_REF_PICTURE( refPic, compID );
#if JVET_K0346 || JVET_K_AFFINE
const ChromaFormat chFmt = pu.chromaFormat;
const bool rndRes = !bi;
......@@ -509,16 +492,6 @@ void InterPrediction::xPredInterBlk ( const ComponentID& compID, const Predictio
CHECKD(!pu.cs->sps->getSpsNext().getUseHighPrecMv() && ((xFrac & 3) != 0), "Invalid fraction");
CHECKD(!pu.cs->sps->getSpsNext().getUseHighPrecMv() && ((yFrac & 3) != 0), "Invalid fraction");
#endif
#else
const ChromaFormat chFmt = pu.chromaFormat;
const bool rndRes = !bi;
int shiftHor = 2 + ::getComponentScaleX( compID, chFmt );
int shiftVer = 2 + ::getComponentScaleY( compID, chFmt );
int xFrac = _mv.hor & ( ( 1 << shiftHor ) - 1 );
int yFrac = _mv.ver & ( ( 1 << shiftVer ) - 1 );
#endif
PelBuf &dstBuf = dstPic.bufs[compID];
unsigned width = dstBuf.width;
......@@ -550,7 +523,6 @@ void InterPrediction::xPredInterBlk ( const ComponentID& compID, const Predictio
}
}
#if JVET_K_AFFINE
void InterPrediction::xPredAffineBlk( const ComponentID& compID, const PredictionUnit& pu, const Picture* refPic, const Mv* _mv, PelUnitBuf& dstPic, const bool& bi, const ClpRng& clpRng )
{
#if JVET_K0337_AFFINE_6PARA
......@@ -726,7 +698,6 @@ void InterPrediction::xPredAffineBlk( const ComponentID& compID, const Predictio
}
}
}
#endif
int getMSB( unsigned x )
{
......
......@@ -89,9 +89,7 @@ protected:
);
void xWeightedAverage ( const PredictionUnit& pu, const CPelUnitBuf& pcYuvSrc0, const CPelUnitBuf& pcYuvSrc1, PelUnitBuf& pcYuvDst, const BitDepths& clipBitDepths, const ClpRngs& clpRngs );
#if JVET_K_AFFINE
void xPredAffineBlk( const ComponentID& compID, const PredictionUnit& pu, const Picture* refPic, const Mv* _mv, PelUnitBuf& dstPic, const bool& bi, const ClpRng& clpRng );
#endif
static bool xCheckIdenticalMotion( const PredictionUnit& pu );
......
......@@ -55,13 +55,8 @@ CacheModel* InterpolationFilter::m_cacheModel;
// Tables
// ====================================================================================================================
#if JVET_K0346 || JVET_K_AFFINE
const TFilterCoeff InterpolationFilter::m_lumaFilter[LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE][NTAPS_LUMA] =
#else
const TFilterCoeff InterpolationFilter::m_lumaFilter[LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS][NTAPS_LUMA] =
#endif
{
#if JVET_K0346 || JVET_K_AFFINE
{ 0, 0, 0, 64, 0, 0, 0, 0 },
{ 0, 1, -3, 63, 4, -2, 1, 0 },
{ -1, 2, -5, 62, 8, -3, 1, 0 },
......@@ -78,21 +73,10 @@ const TFilterCoeff InterpolationFilter::m_lumaFilter[LUMA_INTERPOLATION_FILTER_S
{ 0, 1, -4, 13, 60, -8, 3, -1 },
{ 0, 1, -3, 8, 62, -5, 2, -1 },
{ 0, 1, -2, 4, 63, -3, 1, 0 }
#else
{ 0, 0, 0, 64, 0, 0, 0, 0 },
{ -1, 4, -10, 58, 17, -5, 1, 0 },
{ -1, 4, -11, 40, 40, -11, 4, -1 },
{ 0, 1, -5, 17, 58, -10, 4, -1 }
#endif
};
#if JVET_K0346 || JVET_K_AFFINE
const TFilterCoeff InterpolationFilter::m_chromaFilter[CHROMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE][NTAPS_CHROMA] =
#else
const TFilterCoeff InterpolationFilter::m_chromaFilter[CHROMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS][NTAPS_CHROMA] =
#endif
{
#if JVET_K0346 || JVET_K_AFFINE
{ 0, 64, 0, 0 },
{ -1, 63, 2, 0 },
{ -2, 62, 4, 0 },
......@@ -125,16 +109,6 @@ const TFilterCoeff InterpolationFilter::m_chromaFilter[CHROMA_INTERPOLATION_FILT
{ -1, 7, 60, -2 },
{ 0, 4, 62, -2 },
{ 0, 2, 63, -1 },
#else
{ 0, 64, 0, 0 },
{ -2, 58, 10, -2 },
{ -4, 54, 16, -2 },
{ -6, 46, 28, -4 },
{ -4, 36, 36, -4 },
{ -4, 28, 46, -6 },
{ -2, 16, 54, -4 },
{ -2, 10, 58, -2 }
#endif
};
// ====================================================================================================================
......@@ -477,11 +451,7 @@ void InterpolationFilter::filterHor( const ComponentID compID, Pel const *src, i
}
else if( isLuma( compID ) )
{
#if JVET_K0346 || JVET_K_AFFINE
CHECK( frac < 0 || frac >= ( LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE ), "Invalid fraction" );
#else
CHECK( frac < 0 || frac >= ( LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS ), "Invalid fraction" );
#endif
{
filterHor<NTAPS_LUMA>( clpRng, src, srcStride, dst, dstStride, width, height, isLast, m_lumaFilter[frac] );
}
......@@ -489,11 +459,7 @@ void InterpolationFilter::filterHor( const ComponentID compID, Pel const *src, i
else
{
const uint32_t csx = getComponentScaleX( compID, fmt );
#if JVET_K0346 || JVET_K_AFFINE
CHECK( frac < 0 || csx >= 2 || ( frac << ( 1 - csx ) ) >= ( CHROMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE ), "Invalid fraction" );
#else
CHECK( frac < 0 || csx >= 2 || ( frac << ( 1 - csx ) ) >= ( CHROMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS ), "Invalid fraction" );
#endif
filterHor<NTAPS_CHROMA>( clpRng, src, srcStride, dst, dstStride, width, height, isLast, m_chromaFilter[frac << ( 1 - csx )] );
}
}
......@@ -523,11 +489,7 @@ void InterpolationFilter::filterVer( const ComponentID compID, Pel const *src, i
}
else if( isLuma( compID ) )
{
#if JVET_K0346 || JVET_K_AFFINE
CHECK( frac < 0 || frac >= ( LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE ), "Invalid fraction" );
#else
CHECK( frac < 0 || frac >= ( LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS ), "Invalid fraction" );
#endif
{
filterVer<NTAPS_LUMA>( clpRng, src, srcStride, dst, dstStride, width, height, isFirst, isLast, m_lumaFilter[frac] );
}
......@@ -535,11 +497,7 @@ void InterpolationFilter::filterVer( const ComponentID compID, Pel const *src, i
else
{
const uint32_t csy = getComponentScaleY( compID, fmt );
#if JVET_K0346 || JVET_K_AFFINE
CHECK( frac < 0 || csy >= 2 || ( frac << ( 1 - csy ) ) >= ( CHROMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE ), "Invalid fraction" );
#else
CHECK( frac < 0 || csy >= 2 || ( frac << ( 1 - csy ) ) >= ( CHROMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS ), "Invalid fraction" );
#endif
filterVer<NTAPS_CHROMA>( clpRng, src, srcStride, dst, dstStride, width, height, isFirst, isLast, m_chromaFilter[frac << ( 1 - csy )] );
}
}
......
......@@ -54,13 +54,8 @@
*/
class InterpolationFilter
{
#if JVET_K0346 || JVET_K_AFFINE
static const TFilterCoeff m_lumaFilter[LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE][NTAPS_LUMA]; ///< Luma filter taps
static const TFilterCoeff m_chromaFilter[CHROMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE][NTAPS_CHROMA]; ///< Chroma filter taps
#else
static const TFilterCoeff m_lumaFilter [LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS][NTAPS_LUMA ]; ///< Luma filter taps
static const TFilterCoeff m_chromaFilter[CHROMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS][NTAPS_CHROMA]; ///< Chroma filter taps
#endif
public:
template<bool isFirst, bool isLast>
static void filterCopy( const ClpRng& clpRng, const Pel *src, int srcStride, Pel *dst, int dstStride, int width, int height );
......
......@@ -265,7 +265,6 @@ void LoopFilter::xDeblockCU( CodingUnit& cu, const DeblockEdgeDir edgeDir )
}
#if JVET_K_AFFINE
if ( cu.affine )
{
const int widthInBaseUnits = cu.Y().width >> pcv.minCUWidthLog2;
......@@ -281,7 +280,6 @@ void LoopFilter::xDeblockCU( CodingUnit& cu, const DeblockEdgeDir edgeDir )
xSetEdgefilterMultiple( cu, EDGE_HOR, affiBlockH, m_stLFCUParam.internalEdge, 1 );
}
}
#endif
const unsigned uiPelsInPart = pcv.minCUWidth;
for( int y = 0; y < area.height; y += uiPelsInPart )
......@@ -445,7 +443,6 @@ unsigned LoopFilter::xGetBoundaryStrengthSingle ( const CodingUnit& cu, const De
if( 0 <= miQ.refIdx[1] ) { mvQ1 = miQ.mv[1]; }
int nThreshold = 4;
#if JVET_K0346 || JVET_K_AFFINE
#if !REMOVE_MV_ADAPT_PREC
if (cu.cs->sps->getSpsNext().getUseHighPrecMv())
{
......@@ -457,7 +454,6 @@ unsigned LoopFilter::xGetBoundaryStrengthSingle ( const CodingUnit& cu, const De
nThreshold = 4 << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE;
#if !REMOVE_MV_ADAPT_PREC
}
#endif
#endif
unsigned uiBs = 0;
......@@ -512,7 +508,6 @@ unsigned LoopFilter::xGetBoundaryStrengthSingle ( const CodingUnit& cu, const De
Mv mvQ0 = miQ.mv[0];
int nThreshold = 4;
#if JVET_K0346 || JVET_K_AFFINE
#if !REMOVE_MV_ADAPT_PREC
if (cu.cs->sps->getSpsNext().getUseHighPrecMv())
{
......@@ -522,7 +517,6 @@ unsigned LoopFilter::xGetBoundaryStrengthSingle ( const CodingUnit& cu, const De
nThreshold = 4 << VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE;
#if !REMOVE_MV_ADAPT_PREC
}
#endif
#endif
return ( ( abs( mvQ0.getHor() - mvP0.getHor() ) >= nThreshold ) || ( abs( mvQ0.getVer() - mvP0.getVer() ) >= nThreshold ) ) ? 1 : 0;
}
......
......@@ -56,7 +56,6 @@ struct AMVPInfo
unsigned numCand; ///< number of motion vector predictor candidates
};
#if JVET_K_AFFINE
struct AffineAMVPInfo
{
Mv mvCandLT[ AMVP_MAX_NUM_CANDS_MEM ]; ///< array of affine motion vector predictor candidates for left-top corner
......@@ -64,7 +63,6 @@ struct AffineAMVPInfo
Mv mvCandLB[ AMVP_MAX_NUM_CANDS_MEM ]; ///< array of affine motion vector predictor candidates for left-bottom corner
unsigned numCand; ///< number of motion vector predictor candidates
};
#endif
// ====================================================================================================================
// Class definition
......
......@@ -65,7 +65,7 @@ void roundAffineMv( int& mvx, int& mvy, int nShift )
void clipMv( Mv& rcMv, const Position& pos, const SPS& sps )
{
#if ( JVET_K0346 || JVET_K_AFFINE) && !REMOVE_MV_ADAPT_PREC
#if !REMOVE_MV_ADAPT_PREC
int iMvShift = 2 + (rcMv.highPrec ? VCEG_AZ07_MV_ADD_PRECISION_BIT_FOR_STORE : 0);
#else
int iMvShift = 2;
......
......@@ -53,7 +53,7 @@ class Mv
public:
int hor; ///< horizontal component of motion vector
int ver; ///< vertical component of motion vector
#if ( JVET_K0346 || JVET_K_AFFINE) && !REMOVE_MV_ADAPT_PREC
#if !REMOVE_MV_ADAPT_PREC
bool highPrec;///< true if the vector is high precision
#endif
......@@ -61,7 +61,7 @@ public:
// constructors
// ------------------------------------------------------------------------------------------------------------------
#if ( JVET_K0346 || JVET_K_AFFINE) && !REMOVE_MV_ADAPT_PREC
#if !REMOVE_MV_ADAPT_PREC
Mv( ) : hor( 0 ), ver( 0 ), highPrec( false ) {}
Mv( int iHor, int iVer, bool _highPrec = false ) : hor( iHor ), ver( iVer ), highPrec( _highPrec ) {}
#else
......@@ -93,7 +93,7 @@ public:
const Mv& operator += (const Mv& _rcMv)
{
#if ( JVET_K0346 || JVET_K_AFFINE) && !REMOVE_MV_ADAPT_PREC
#if !REMOVE_MV_ADAPT_PREC
if( highPrec == _rcMv.highPrec )
{
hor += _rcMv.hor;
......@@ -104,7 +104,7 @@ public:
{
Mv rcMv = _rcMv;
#if ( JVET_K0346 || JVET_K_AFFINE) && !REMOVE_MV_ADAPT_PREC
#if !REMOVE_MV_ADAPT_PREC
if( highPrec && !rcMv.highPrec ) rcMv.setHighPrec();
if( !highPrec && rcMv.highPrec ) setHighPrec();
#endif
......@@ -116,7 +116,7 @@ public:
const Mv& operator-= (const Mv& _rcMv)
{
#if ( JVET_K0346 || JVET_K_AFFINE) && !REMOVE_MV_ADAPT_PREC
#if !REMOVE_MV_ADAPT_PREC
if( highPrec == _rcMv.highPrec )
{
hor -= _rcMv.hor;
......@@ -127,7 +127,7 @@ public:
{
Mv rcMv = _rcMv;
#if ( JVET_K0346 || JVET_K_AFFINE) && !REMOVE_MV_ADAPT_PREC
#if !REMOVE_MV_ADAPT_PREC
if( highPrec && !rcMv.highPrec ) rcMv.setHighPrec();
if( !highPrec && rcMv.highPrec ) setHighPrec();
#endif
......@@ -166,7 +166,7 @@ public:
const Mv operator - ( const Mv& rcMv ) const
{
#if ( JVET_K0346 || JVET_K_AFFINE) && !REMOVE_MV_ADAPT_PREC
#if !REMOVE_MV_ADAPT_PREC
if( rcMv.highPrec == highPrec )
{
return Mv( hor - rcMv.hor, ver - rcMv.ver, highPrec );
......@@ -185,7 +185,7 @@ public:
const Mv operator + ( const Mv& rcMv ) const
{
#if ( JVET_K0346 || JVET_K_AFFINE) && !REMOVE_MV_ADAPT_PREC
#if !REMOVE_MV_ADAPT_PREC
if( rcMv.highPrec == highPrec )
{
return Mv( hor + rcMv.hor, ver + rcMv.ver, highPrec );
......@@ -204,7 +204,7 @@ public:
bool operator== ( const Mv& rcMv ) const
{
#if ( JVET_K0346 || JVET_K_AFFINE) && !REMOVE_MV_ADAPT_PREC
#if !REMOVE_MV_ADAPT_PREC
if( rcMv.highPrec == highPrec )
{
return ( hor == rcMv.hor && ver == rcMv.ver );
......@@ -231,14 +231,13 @@ public:
{
const int mvx = Clip3( -32768, 32767, (iScale * getHor() + 127 + (iScale * getHor() < 0)) >> 8 );
const int mvy = Clip3( -32768, 32767, (iScale * getVer() + 127 + (iScale * getVer() < 0)) >> 8 );
#if ( JVET_K0346 || JVET_K_AFFINE) && !REMOVE_MV_ADAPT_PREC
#if !REMOVE_MV_ADAPT_PREC
return Mv( mvx, mvy, highPrec );
#else
return Mv( mvx, mvy );
#endif
}
#if JVET_K0346 || JVET_K_AFFINE
void roundMV2SignalPrecision()
{
#if REMOVE_MV_ADAPT_PREC
......@@ -273,7 +272,6 @@ public:
highPrec = true;
}
#endif
#endif
};// END CLASS DEFINITION MV
#if JVET_K0357_AMVR