Commit f110c4df authored by Frank Bossen's avatar Frank Bossen

Remove JVET_K0357_AMVR macro

parent 2b201181
......@@ -502,11 +502,9 @@ void EncApp::xInitLibCfg()
m_cEncLib.setSummaryOutFilename ( m_summaryOutFilename );
m_cEncLib.setSummaryPicFilenameBase ( m_summaryPicFilenameBase );
m_cEncLib.setSummaryVerboseness ( m_summaryVerboseness );
#if JVET_K0357_AMVR
m_cEncLib.setIMV ( m_ImvMode );
m_cEncLib.setIMV4PelFast ( m_Imv4PelFast );
m_cEncLib.setIMVMaxCand ( m_ImvMaxCand );
#endif
m_cEncLib.setDecodeBitstream ( 0, m_decodeBitstreams[0] );
m_cEncLib.setDecodeBitstream ( 1, m_decodeBitstreams[1] );
m_cEncLib.setSwitchPOC ( m_switchPOC );
......
......@@ -823,14 +823,12 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
("Affine", m_Affine, false, "Enable affine prediction (0:off, 1:on) [default: off]")
( "AffineType", m_AffineType, true, "Enable affine type prediction (0:off, 1:on) [default: on]" )
("DisableMotCompression", m_DisableMotionCompression, false, "Disable motion data compression for all modes")
#if JVET_K0357_AMVR
("IMV", m_ImvMode, 2, "Adaptive MV precision Mode (IMV)\n"
"\t0: disabled IMV\n"
"\t1: IMV default (Full-Pel)\n"
"\t2: IMV Full-Pel and 4-PEL\n")
("IMV4PelFast", m_Imv4PelFast, 1, "Fast 4-Pel Adaptive MV precision Mode 0:disabled, 1:enabled) [default: 1]")
("IMVMaxCand", m_ImvMaxCand, 4, "max IMV cand (QTBF off only)")
#endif
#if ENABLE_WPP_PARALLELISM
("AltDQPCoding", m_AltDQPCoding, false, "Improved predictive delta-QP coding (0:off, 1:on) [default: off]")
#endif
......@@ -1926,9 +1924,7 @@ bool EncAppCfg::xCheckParameter()
#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" );
#if JVET_K0357_AMVR
xConfirmPara( m_ImvMode, "IMV is only allowed with NEXT profile" );
#endif
xConfirmPara( m_useFastLCTU, "Fast large CTU can only be applied when encoding with NEXT profile" );
#if !JVET_K0220_ENC_CTRL
xConfirmPara( m_useSaveLoadEncInfo, "Encoder decision saving can only be applied when encoding with NEXT profile" );
......@@ -2912,9 +2908,7 @@ bool EncAppCfg::xCheckParameter()
#if U0033_ALTERNATIVE_TRANSFER_CHARACTERISTICS_SEI
xConfirmPara(m_preferredTransferCharacteristics > 255, "transfer_characteristics_idc should not be greater than 255.");
#endif
#if JVET_K0357_AMVR
xConfirmPara( unsigned(m_ImvMode) > 2, "ImvMode exceeds range (0 to 2)" );
#endif
xConfirmPara( m_decodeBitstreams[0] == m_bitstreamFileName, "Debug bitstream and the output bitstream cannot be equal.\n" );
xConfirmPara( m_decodeBitstreams[1] == m_bitstreamFileName, "Decode2 bitstream and the output bitstream cannot be equal.\n" );
xConfirmPara(unsigned(m_LMChroma) > 1, "LMMode exceeds range (0 to 1)");
......@@ -3162,10 +3156,8 @@ void EncAppCfg::xPrintParameter()
msg( VERBOSE, "QTBT:%d ", m_QTBT );
if( m_QTBT ) msg( VERBOSE, "DualITree:%d ", m_dualTree );
msg( VERBOSE, "LargeCTU:%d ", m_LargeCTU );
#if JVET_K0357_AMVR
msg( VERBOSE, "IMV:%d ", m_ImvMode );
if( !m_QTBT ) msg( VERBOSE, "IMVMaxCand:%d ", m_ImvMaxCand );
#endif
#if !REMOVE_MV_ADAPT_PREC
msg(VERBOSE, "HighPrecMv:%d ", m_highPrecisionMv);
#endif
......@@ -3196,9 +3188,7 @@ void EncAppCfg::xPrintParameter()
#endif
msg( VERBOSE, "FastMrg:%d ", m_useFastMrg );
msg( VERBOSE, "PBIntraFast:%d ", m_usePbIntraFast );
#if JVET_K0357_AMVR
if( m_ImvMode == 2 ) msg( VERBOSE, "IMV4PelFast:%d ", m_Imv4PelFast );
#endif
if( m_EMT ) msg( VERBOSE, "EMTFast: %1d(intra) %1d(inter) ", ( m_FastEMT & m_EMT & 1 ), ( m_FastEMT >> 1 ) & ( m_EMT >> 1 ) & 1 );
if( m_QTBT ) msg( VERBOSE, "AMaxBT:%d ", m_useAMaxBT );
if( m_QTBT ) msg( VERBOSE, "E0023FastEnc:%d ", m_e0023FastEnc );
......
......@@ -491,11 +491,9 @@ protected:
int m_maxBitsPerMinCuDenom; ///< Indicates an upper bound for the number of bits of coding_unit() data
int m_log2MaxMvLengthHorizontal; ///< Indicate the maximum absolute value of a decoded horizontal MV component in quarter-pel luma units
int m_log2MaxMvLengthVertical; ///< Indicate the maximum absolute value of a decoded vertical MV component in quarter-pel luma units
#if JVET_K0357_AMVR
int m_ImvMode; ///< imv mode
int m_Imv4PelFast; ///< imv 4-Pel fast mode
int m_ImvMaxCand; ///< imv max num cand for test (QTBT off only)
#endif
std::string m_colourRemapSEIFileRoot;
std::string m_summaryOutFilename; ///< filename to use for producing summary output file.
......
......@@ -99,9 +99,7 @@ enum CodingStatisticsType
STATS__CABAC_BITS__AFFINE_TYPE,
STATS__CABAC_BITS__PAR_FLAG,
STATS__CABAC_BITS__ALF,
#if JVET_K0357_AMVR
STATS__CABAC_BITS__IMV_FLAG,
#endif
STATS__CABAC_BITS__EMT_CU_FLAG,
STATS__CABAC_BITS__EMT_TU_INDEX,
STATS__TOOL_EMT,
......@@ -171,9 +169,7 @@ static inline const char* getName(CodingStatisticsType name)
"CABAC_EP_BIT_ALIGNMENT",
"CABAC_BITS__ALIGNED_SIGN_BIT",
"CABAC_BITS__ALIGNED_ESCAPE_BITS",
#if JVET_K0357_AMVR
"CABAC_BITS__IMV_FLAG",
#endif
"CABAC_BITS__EMT_CU_FLAG",
"CABAC_BITS__EMT_TU_INDX",
"CABAC_BITS__OTHER",
......
......@@ -284,7 +284,6 @@ unsigned DeriveCtx::CtxSkipFlag( const CodingUnit& cu )
}
#if JVET_K0357_AMVR
unsigned DeriveCtx::CtxIMVFlag( const CodingUnit& cu )
{
const CodingStructure *cs = cu.cs;
......@@ -300,7 +299,6 @@ unsigned DeriveCtx::CtxIMVFlag( const CodingUnit& cu )
return ctxId;
}
#endif
unsigned DeriveCtx::CtxBTsplit(const CodingStructure& cs, Partitioner& partitioner)
{
......
......@@ -289,9 +289,7 @@ unsigned CtxQtCbf ( const ComponentID compID, const bool prevCbCbf );
#endif
unsigned CtxInterDir ( const PredictionUnit& pu );
unsigned CtxSkipFlag ( const CodingUnit& cu );
#if JVET_K0357_AMVR
unsigned CtxIMVFlag ( const CodingUnit& cu );
#endif
unsigned CtxAffineFlag( const CodingUnit& cu );
}
......
......@@ -641,14 +641,12 @@ const CtxSet ContextSetCfg::ChromaQpAdjIdc = ContextSetCfg::addCtxSet
{ 154,},
});
#if JVET_K0357_AMVR
const CtxSet ContextSetCfg::ImvFlag = ContextSetCfg::addCtxSet
({
{ 197, 185, 201, 185,},
{ 197, 185, 201, 185,},
{ CNU, CNU, CNU, CNU,},
});
#endif
const CtxSet ContextSetCfg::ctbAlfFlag =
{
......
......@@ -190,9 +190,7 @@ public:
static const CtxSet CrossCompPred;
static const CtxSet ChromaQpAdjFlag;
static const CtxSet ChromaQpAdjIdc;
#if JVET_K0357_AMVR
static const CtxSet ImvFlag;
#endif
static const CtxSet ctbAlfFlag;
static const unsigned NumberOfContexts;
......
......@@ -40,7 +40,6 @@
#include "Common.h"
#include "Slice.h"
#if JVET_K0357_AMVR
void roundMV( Mv & rMV, unsigned imvShift )
{
CHECK( imvShift == 0, "roundMV called for imvShift=0" );
......@@ -52,7 +51,6 @@ void roundMV( Mv & rMV, unsigned imvShift )
rMV.setHor( ( ( rMV.getHor() + offset ) >> imvShift ) << imvShift );
rMV.setVer( ( ( rMV.getVer() + offset ) >> imvShift ) << imvShift );
}
#endif
void roundAffineMv( int& mvx, int& mvy, int nShift )
{
......
......@@ -273,9 +273,7 @@ public:
}
#endif
};// END CLASS DEFINITION MV
#if JVET_K0357_AMVR
void roundMV( Mv& rcMv, unsigned imvShift );
#endif
void clipMv ( Mv& rcMv, const struct Position& pos, const class SPS& sps );
void roundAffineMv( int& mvx, int& mvy, int nShift );
......
......@@ -190,13 +190,8 @@ public:
return uiLength2 + ( g_aucPrevLog2[uiTemp2] << 1 );
}
#if JVET_K0357_AMVR
Distortion getCostOfVectorWithPredictor( const int x, const int y, const unsigned imvShift ) { return Distortion( m_motionLambda * getBitsOfVectorWithPredictor(x, y, imvShift )); }
uint32_t getBitsOfVectorWithPredictor( const int x, const int y, const unsigned imvShift ) { return xGetExpGolombNumberOfBits(((x << m_iCostScale) - m_mvPredictor.getHor())>>imvShift) + xGetExpGolombNumberOfBits(((y << m_iCostScale) - m_mvPredictor.getVer())>>imvShift); }
#else
Distortion getCostOfVectorWithPredictor( const int x, const int y ) { return Distortion( m_motionLambda * getBitsOfVectorWithPredictor(x, y )); }
uint32_t getBitsOfVectorWithPredictor( const int x, const int y ) { return xGetExpGolombNumberOfBits(((x << m_iCostScale) - m_mvPredictor.getHor())) + xGetExpGolombNumberOfBits(((y << m_iCostScale) - m_mvPredictor.getVer())); }
#endif
#if WCG_EXT
void saveUnadjustedLambda ();
void initLumaLevelToWeightTable ();
......
......@@ -1649,9 +1649,7 @@ SPSNext::SPSNext( SPS& sps )
#if JVET_K0346
, m_SubPuMvp ( false )
#endif
#if JVET_K0357_AMVR
, m_IMV ( false )
#endif
#if !REMOVE_MV_ADAPT_PREC
, m_highPrecMv ( false )
#endif
......@@ -1675,9 +1673,7 @@ SPSNext::SPSNext( SPS& sps )
, m_subPuLog2Size ( 0 )
, m_subPuMrgMode ( 0 )
#endif
#if JVET_K0357_AMVR
, m_ImvMode ( IMV_OFF )
#endif
, m_MTTMode ( 0 )
#if JVET_K0157
, m_compositeRefEnabled ( false )
......
......@@ -802,9 +802,7 @@ private:
#if JVET_K0346
bool m_SubPuMvp;
#endif
#if JVET_K0357_AMVR
bool m_IMV; // 9
#endif
#if !REMOVE_MV_ADAPT_PREC
bool m_highPrecMv;
#endif
......@@ -835,10 +833,8 @@ private:
unsigned m_subPuLog2Size;
int m_subPuMrgMode;
#endif
#if JVET_K0357_AMVR
//imv
ImvMode m_ImvMode;
#endif
// multi type tree (QTBT + triple split)
unsigned m_MTTMode;
......@@ -865,10 +861,8 @@ public:
void setSubPuMvpMode(int n) { m_subPuMrgMode = n; m_SubPuMvp = n != 0; }
bool getUseATMVP() const { return (m_subPuMrgMode & 1) == 1; }
#endif
#if JVET_K0357_AMVR
void setUseIMV ( bool b ) { m_IMV = b; }
bool getUseIMV () const { return m_IMV; }
#endif
void setUseAffine ( bool b ) { m_Affine = b; }
bool getUseAffine () const { return m_Affine; }
void setUseAffineType ( bool b ) { m_AffineType = b; }
......@@ -919,10 +913,8 @@ public:
void setSubPuMvpLog2Size ( unsigned log2Size ) { m_subPuLog2Size = log2Size; }
unsigned getSubPuMvpLog2Size () const { return m_subPuLog2Size; }
#endif
#if JVET_K0357_AMVR
void setImvMode(ImvMode m) { m_ImvMode = m; m_IMV = m != 0; }
ImvMode getImvMode () const { return m_ImvMode; }
#endif
......
......@@ -86,7 +86,6 @@
#define JVET_K0357_AMVR 1 // Adaptive motion vector resolution separated from JEM_TOOLS macro
#define REMOVE_MV_ADAPT_PREC 1 // remove the high precision flag in the MV class
......
......@@ -264,10 +264,8 @@ CodingUnit& CodingUnit::operator=( const CodingUnit& other )
#if HEVC_TILES_WPP
tileIdx = other.tileIdx;
#endif
#if JVET_K0357_AMVR
imv = other.imv;
imvNumCand = other.imvNumCand;
#endif
return *this;
}
......@@ -292,10 +290,8 @@ void CodingUnit::initData()
#if HEVC_TILES_WPP
tileIdx = 0;
#endif
#if JVET_K0357_AMVR
imv = 0;
imvNumCand = 0;
#endif
}
......
......@@ -299,9 +299,7 @@ struct CodingUnit : public UnitArea
int affineType;
bool transQuantBypass;
bool ipcm;
#if JVET_K0357_AMVR
uint8_t imv;
#endif
bool rootCbf;
#if HEVC_TILES_WPP
uint32_t tileIdx;
......
......@@ -1203,7 +1203,6 @@ void PU::fillMvpCand(PredictionUnit &pu, const RefPicList &eRefPicList, const in
}
}
#if JVET_K0357_AMVR
if( pu.cu->imv != 0)
{
unsigned imvShift = pu.cu->imv << 1;
......@@ -1215,7 +1214,6 @@ void PU::fillMvpCand(PredictionUnit &pu, const RefPicList &eRefPicList, const in
roundMV( pInfo->mvCand[i], imvShift );
}
}
#endif
if( pInfo->numCand == 2 )
{
......@@ -1305,7 +1303,6 @@ void PU::fillMvpCand(PredictionUnit &pu, const RefPicList &eRefPicList, const in
#if !REMOVE_MV_ADAPT_PREC
}
#endif
#if JVET_K0357_AMVR
if (pu.cu->imv != 0)
{
unsigned imvShift = pu.cu->imv << 1;
......@@ -1314,7 +1311,6 @@ void PU::fillMvpCand(PredictionUnit &pu, const RefPicList &eRefPicList, const in
roundMV(pInfo->mvCand[i], imvShift);
}
}
#endif
#if !REMOVE_MV_ADAPT_PREC
if (pu.cs->sps->getSpsNext().getUseHighPrecMv())
{
......@@ -2541,7 +2537,6 @@ void PU::spanMotionInfo( PredictionUnit &pu, const MergeCtx &mrgCtx )
}
}
#if JVET_K0357_AMVR
void PU::applyImv( PredictionUnit& pu, MergeCtx &mrgCtx, InterPrediction *interPred )
{
if( !pu.mergeFlag )
......@@ -2601,7 +2596,6 @@ void PU::applyImv( PredictionUnit& pu, MergeCtx &mrgCtx, InterPrediction *interP
PU::spanMotionInfo( pu, mrgCtx );
}
#endif
bool PU::isBiPredFromDifferentDir( const PredictionUnit& pu )
{
......@@ -2634,7 +2628,6 @@ void PU::restrictBiPredMergeCands( const PredictionUnit &pu, MergeCtx& mergeCtx
}
}
#if JVET_K0357_AMVR
void CU::resetMVDandMV2Int( CodingUnit& cu, InterPrediction *interPred )
{
for( auto &pu : CU::traversePUs( cu ) )
......@@ -2745,7 +2738,6 @@ int CU::getMaxNeighboriMVCandNum( const CodingStructure& cs, const Position& pos
return maxImvNumCand;
}
#endif
......
......@@ -90,11 +90,9 @@ namespace CU
cPUTraverser traversePUs (const CodingUnit& cu);
cTUTraverser traverseTUs (const CodingUnit& cu);
#if JVET_K0357_AMVR
bool hasSubCUNonZeroMVd (const CodingUnit& cu);
int getMaxNeighboriMVCandNum (const CodingStructure& cs, const Position& pos);
void resetMVDandMV2Int ( CodingUnit& cu, InterPrediction *interPred );
#endif
}
......@@ -116,9 +114,7 @@ namespace PU
void xInheritedAffineMv ( const PredictionUnit &pu, const PredictionUnit* puNeighbour, RefPicList eRefPicList, Mv rcMv[3] );
bool isBipredRestriction (const PredictionUnit &pu);
void spanMotionInfo ( PredictionUnit &pu, const MergeCtx &mrgCtx = MergeCtx() );
#if JVET_K0357_AMVR
void applyImv ( PredictionUnit &pu, MergeCtx &mrgCtx, InterPrediction *interPred = NULL );
#endif
void getAffineMergeCand (const PredictionUnit &pu, MvField (*mvFieldNeighbours)[3], unsigned char &interDirNeighbours, int &numValidMergeCand );
bool isAffineMrgFlagCoded (const PredictionUnit &pu );
void getAffineMergeCand (const PredictionUnit &pu, MvField (*mvFieldNeighbours)[3], unsigned char &interDirNeighbours, int &numValidMergeCand );
......
......@@ -455,9 +455,7 @@ void writeAllData(const CodingStructure& cs, const UnitArea& ctuArea)
}
}
}
#if JVET_K0357_AMVR
DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, cu, GetBlockStatisticName(BlockStatistic::IMVMode), cu.imv);
#endif
DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, cu, GetBlockStatisticName(BlockStatistic::RootCbf), cu.rootCbf);
}
......@@ -746,12 +744,10 @@ void writeAllCodedData(const CodingStructure & cs, const UnitArea & ctuArea)
DTRACE_BLOCK_AFFINETF(g_trace_ctx, D_BLOCK_STATISTICS_CODED, pu, GetBlockStatisticName(BlockStatistic::AffineMVL1), mv[0].hor, mv[0].ver, mv[1].hor, mv[1].ver, mv[2].hor, mv[2].ver);
}
}
#if JVET_K0357_AMVR
if (cu.cs->sps->getSpsNext().getUseIMV() && CU::hasSubCUNonZeroMVd(cu))
{
DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_CODED, cu, GetBlockStatisticName(BlockStatistic::IMVMode), cu.imv);
}
#endif
break;
}
......
......@@ -78,9 +78,7 @@ enum class BlockStatistic {
Cbf_Y,
Cbf_Cb,
Cbf_Cr,
#if JVET_K0357_AMVR
IMVMode,
#endif
InterDir,
MergeFlag,
MergeIdx,
......@@ -161,9 +159,7 @@ static const std::map<BlockStatistic, std::tuple<std::string, BlockStatisticType
{ BlockStatistic::MVPIdxL1, std::tuple<std::string, BlockStatisticType, std::string>{"MVPIdxL1", BlockStatisticType::Integer, "[0, 1]"}},
{ BlockStatistic::MVDL1, std::tuple<std::string, BlockStatisticType, std::string>{"MVDL1", BlockStatisticType::Vector, "Scale: 4"}},
{ BlockStatistic::RefIdxL1, std::tuple<std::string, BlockStatisticType, std::string>{"RefIdxL1", BlockStatisticType::Integer, "[0, 4]"}},
#if JVET_K0357_AMVR
{ BlockStatistic::IMVMode, std::tuple<std::string, BlockStatisticType, std::string>{"IMVMode", BlockStatisticType::Integer, "[0, 2]"}},
#endif
{ BlockStatistic::AffineFlag, std::tuple<std::string, BlockStatisticType, std::string>{"AffineFlag", BlockStatisticType::Flag, ""}},
{ BlockStatistic::AffineMVL0, std::tuple<std::string, BlockStatisticType, std::string>{"AffineMVL0", BlockStatisticType::AffineTFVectors, "Scale: 4"}},
{ BlockStatistic::AffineMVL1, std::tuple<std::string, BlockStatisticType, std::string>{"AffineMVL1", BlockStatisticType::AffineTFVectors, "Scale: 4"}},
......
......@@ -96,9 +96,7 @@ inline void dtraceModeCost(CodingStructure &cs, double lambda)
if (isIntra && intraModeC == DM_CHROMA_IDX)
intraModeC = 68;
int imvVal = 0;
#if JVET_K0357_AMVR
imvVal = cs.cus[0]->imv;
#endif
DTRACE( g_trace_ctx, D_MODE_COST, "ModeCost: %6lld %3d @(%4d,%4d) [%2dx%2d] %d (qp%d,pm%d,ptSize%d,skip%d,mrg%d,fruc%d,obmc%d,ic%d,imv%d,affn%d,%d,%d) tempCS = %lld (%d,%d)\n",
DTRACE_GET_COUNTER( g_trace_ctx, D_MODE_COST ),
cs.slice->getPOC(),
......
......@@ -779,7 +779,6 @@ void CABACReader::cu_skip_flag( CodingUnit& cu )
}
}
#if JVET_K0357_AMVR
void CABACReader::imv_mode( CodingUnit& cu, MergeCtx& mrgCtx )
{
RExt__DECODER_DEBUG_BIT_STATISTICS_CREATE_SET( STATS__CABAC_BITS__OTHER );
......@@ -812,7 +811,6 @@ void CABACReader::imv_mode( CodingUnit& cu, MergeCtx& mrgCtx )
cu.imv = value;
DTRACE( g_trace_ctx, D_SYNTAX, "imv_mode() IMVFlag=%d\n", cu.imv );
}
#endif
void CABACReader::pred_mode( CodingUnit& cu )
{
......@@ -856,9 +854,7 @@ void CABACReader::cu_pred_data( CodingUnit &cu )
prediction_unit( pu, mrgCtx );
}
#if JVET_K0357_AMVR
imv_mode ( cu, mrgCtx );
#endif
}
......
......@@ -98,9 +98,7 @@ public:
void merge_data ( PredictionUnit& pu );
void affine_flag ( CodingUnit& cu );
void merge_idx ( PredictionUnit& pu );
#if JVET_K0357_AMVR
void imv_mode ( CodingUnit& cu, MergeCtx& mrgCtx );
#endif
void inter_pred_idc ( PredictionUnit& pu );
void ref_idx ( PredictionUnit& pu, RefPicList eRefList );
void mvp_flag ( PredictionUnit& pu, RefPicList eRefList );
......
......@@ -476,7 +476,6 @@ void DecCu::xDeriveCUMV( CodingUnit &cu )
}
else
{
#if JVET_K0357_AMVR
#if REUSE_CU_RESULTS
if (cu.imv && !cu.cs->pcv->isEncoder)
#else
......@@ -486,7 +485,6 @@ void DecCu::xDeriveCUMV( CodingUnit &cu )
PU::applyImv(pu, mrgCtx, m_pcInterPred);
}
else
#endif
{
if( pu.cu->affine )
{
......
......@@ -793,9 +793,7 @@ void HLSyntaxReader::parseSPSNext( SPSNext& spsNext, const bool usePCM )
#if JVET_K0346
READ_FLAG( symbol, "subpu_tmvp_flag" ); spsNext.setSubPuMvpMode (symbol);
#endif
#if JVET_K0357_AMVR
READ_FLAG( symbol, "imv_enable_flag" ); spsNext.setUseIMV ( symbol != 0 );
#endif
#if !REMOVE_MV_ADAPT_PREC
READ_FLAG( symbol, "high_precision_motion_vectors" ); spsNext.setUseHighPrecMv(symbol != 0);
#endif
......@@ -859,12 +857,10 @@ void HLSyntaxReader::parseSPSNext( SPSNext& spsNext, const bool usePCM )
#endif
#if JVET_K0357_AMVR
if( spsNext.getUseIMV() )
{
READ_UVLC( symbol, "imv_mode_minus1" ); spsNext.setImvMode( ImvMode( symbol + 1 ) );
}
#endif
if( spsNext.getMTTEnabled() )
{
READ_UVLC( symbol, "mtt_mode_minus1" ); spsNext.setMTTMode( symbol + 1 );
......
......@@ -747,9 +747,7 @@ void CABACWriter::cu_pred_data( const CodingUnit& cu )
prediction_unit( pu );
}
#if JVET_K0357_AMVR
imv_mode ( cu );
#endif
}
......@@ -1114,29 +1112,16 @@ void CABACWriter::prediction_unit( const PredictionUnit& pu )
ref_idx ( pu, REF_PIC_LIST_0 );
if ( pu.cu->affine )
{
#if JVET_K0357_AMVR
mvd_coding(pu.mvdAffi[REF_PIC_LIST_0][0], 0);
mvd_coding(pu.mvdAffi[REF_PIC_LIST_0][1], 0);
#else
mvd_coding(pu.mvdAffi[REF_PIC_LIST_0][0]);
mvd_coding(pu.mvdAffi[REF_PIC_LIST_0][1]);
#endif
if ( pu.cu->affineType == AFFINEMODEL_6PARAM )
{
#if JVET_K0357_AMVR
mvd_coding(pu.mvdAffi[REF_PIC_LIST_0][2], 0);
#else
mvd_coding(pu.mvdAffi[REF_PIC_LIST_0][2]);
#endif
}
}
else
{
#if JVET_K0357_AMVR
mvd_coding( pu.mvd[REF_PIC_LIST_0], pu.cu->imv );
#else
mvd_coding( pu.mvd[REF_PIC_LIST_0] );
#endif
}
mvp_flag ( pu, REF_PIC_LIST_0 );
}
......@@ -1147,29 +1132,16 @@ void CABACWriter::prediction_unit( const PredictionUnit& pu )
{
if ( pu.cu->affine )
{
#if JVET_K0357_AMVR
mvd_coding(pu.mvdAffi[REF_PIC_LIST_1][0], 0);
mvd_coding(pu.mvdAffi[REF_PIC_LIST_1][1], 0);
#else
mvd_coding(pu.mvdAffi[REF_PIC_LIST_1][0]);
mvd_coding(pu.mvdAffi[REF_PIC_LIST_1][1]);
#endif
if ( pu.cu->affineType == AFFINEMODEL_6PARAM )
{
#if JVET_K0357_AMVR
mvd_coding(pu.mvdAffi[REF_PIC_LIST_1][2], 0);
#else
mvd_coding(pu.mvdAffi[REF_PIC_LIST_1][2]);
#endif
}
}
else
{
#if JVET_K0357_AMVR
mvd_coding( pu.mvd[REF_PIC_LIST_1], pu.cu->imv );
#else
mvd_coding( pu.mvd[REF_PIC_LIST_1] );
#endif
}
}
mvp_flag ( pu, REF_PIC_LIST_1 );
......@@ -1219,7 +1191,6 @@ void CABACWriter::merge_flag( const PredictionUnit& pu )
DTRACE( g_trace_ctx, D_SYNTAX, "merge_flag() merge=%d pos=(%d,%d) size=%dx%d\n", pu.mergeFlag ? 1 : 0, pu.lumaPos().x, pu.lumaPos().y, pu.lumaSize().width, pu.lumaSize().height );
}
#if JVET_K0357_AMVR
void CABACWriter::imv_mode( const CodingUnit& cu )
{
const SPSNext& spsNext = cu.cs->sps->getSpsNext();
......@@ -1247,7 +1218,6 @@ void CABACWriter::imv_mode( const CodingUnit& cu )
DTRACE( g_trace_ctx, D_SYNTAX, "imv_mode() IMVFlag=%d\n", cu.imv );
}
#endif
void CABACWriter::merge_idx( const PredictionUnit& pu )
{
......@@ -1591,15 +1561,10 @@ void CABACWriter::cbf_comp( const CodingStructure& cs, bool cbf, const CompArea&
// void mvd_coding( pu, refList )
//================================================================================
#if JVET_K0357_AMVR
void CABACWriter::mvd_coding( const Mv &rMvd, uint8_t imv )
#else
void CABACWriter::mvd_coding( const Mv &rMvd )
#endif
{
int horMvd = rMvd.getHor();
int verMvd = rMvd.getVer();
#if JVET_K0357_AMVR
if( imv )
{
CHECK( (horMvd % 4) != 0 && (verMvd % 4) != 0, "IMV: MVD is not a multiple of 4" );
......@@ -1612,7 +1577,6 @@ void CABACWriter::mvd_coding( const Mv &rMvd )
verMvd >>= 2;
}
}
#endif
unsigned horAbs = unsigned( horMvd < 0 ? -horMvd : horMvd );
unsigned verAbs = unsigned( verMvd < 0 ? -verMvd : verMvd );
......
......@@ -119,9 +119,7 @@ public:
void merge_flag ( const PredictionUnit& pu );
void affine_flag ( const CodingUnit& cu );
void merge_idx ( const PredictionUnit& pu );
#if JVET_K0357_AMVR
void imv_mode ( const CodingUnit& cu );
#endif