Commit 55ea0f92 authored by Frank Bossen's avatar Frank Bossen

Remove JVET_K0337_AFFINE_6PARA macro

parent 397374f1
......@@ -226,9 +226,7 @@ void EncApp::xInitLibCfg()
m_cEncLib.setSubPuMvpLog2Size ( m_SubPuMvpLog2Size );
#endif
m_cEncLib.setAffine ( m_Affine );
#if JVET_K0337_AFFINE_6PARA
m_cEncLib.setAffineType ( m_AffineType );
#endif
#if !REMOVE_MV_ADAPT_PREC
m_cEncLib.setHighPrecisionMv (m_highPrecisionMv);
#endif
......
......@@ -821,9 +821,7 @@ 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
("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
("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"
......@@ -3150,12 +3148,10 @@ void EncAppCfg::xPrintParameter()
{
msg( VERBOSE, "\nNEXT TOOL CFG: " );
msg( VERBOSE, "Affine:%d ", m_Affine );
#if JVET_K0337_AFFINE_6PARA
if ( m_Affine )
{
msg( VERBOSE, "AffineType:%d ", m_AffineType );
}
#endif
#if JVET_K0346
msg(VERBOSE, "SubPuMvp:%d+%d ", m_SubPuMvpMode & 1, (m_SubPuMvpMode & 2) == 2);
if (m_SubPuMvpMode != 0)
......
......@@ -209,9 +209,7 @@ protected:
unsigned m_SubPuMvpLog2Size;
#endif
bool m_Affine;
#if JVET_K0337_AFFINE_6PARA
bool m_AffineType;
#endif
#if !REMOVE_MV_ADAPT_PREC
bool m_highPrecisionMv;
#endif
......
......@@ -96,9 +96,7 @@ enum CodingStatisticsType
STATS__TOOL_TOTAL_FRAME,// This is a special case and is not included in the report.
STATS__CABAC_BITS__AFFINE_FLAG,
STATS__TOOL_AFF,
#if JVET_K0337_AFFINE_6PARA
STATS__CABAC_BITS__AFFINE_TYPE,
#endif
STATS__CABAC_BITS__PAR_FLAG,
STATS__CABAC_BITS__ALF,
#if JVET_K0357_AMVR
......@@ -145,9 +143,7 @@ static inline const char* getName(CodingStatisticsType name)
"CABAC_BITS__MVD",
"CABAC_BITS__MVD_EP",
"CABAC_BITS__AFFINE_FLAG",
#if JVET_K0337_AFFINE_6PARA
"CABAC_BITS__AFFINE_TYPE",
#endif
"CABAC_BITS__TRANSFORM_SUBDIV_FLAG",
"CABAC_BITS__QT_ROOT_CBF",
"CABAC_BITS__DELTA_QP_EP",
......
......@@ -109,14 +109,12 @@ inline int64_t abs (int64_t x) { return _abs64(x); };
#define NULL 0
#endif
#if JVET_K0337_AFFINE_6PARA
typedef enum
{
AFFINEMODEL_4PARAM,
AFFINEMODEL_6PARAM,
AFFINE_MODEL_NUM
} EAffineModel;
#endif
// ====================================================================================================================
// Common constants
......
......@@ -360,14 +360,12 @@ const CtxSet ContextSetCfg::AffineFlag = ContextSetCfg::addCtxSet
{ CNU, CNU, CNU,},
});
#if JVET_K0337_AFFINE_6PARA
const CtxSet ContextSetCfg::AffineType = ContextSetCfg::addCtxSet
({
{ 92, },
{ 77, },
{ CNU, },
});
#endif
const CtxSet ContextSetCfg::Mvd = ContextSetCfg::addCtxSet
......
......@@ -167,9 +167,7 @@ public:
static const CtxSet InterDir;
static const CtxSet RefPic;
static const CtxSet AffineFlag;
#if JVET_K0337_AFFINE_6PARA
static const CtxSet AffineType;
#endif
static const CtxSet Mvd;
static const CtxSet TransSubdivFlag;
static const CtxSet QtRootCbf;
......
......@@ -180,12 +180,8 @@ bool checkIdenticalMotion( const PredictionUnit &pu, bool checkAffine )
{
CHECK( !checkAffine, "In this case, checkAffine should be on." );
const CMotionBuf &mb = pu.getMotionBuf();
#if JVET_K0337_AFFINE_6PARA
if ( (pu.cu->affineType == AFFINEMODEL_4PARAM && (mb.at( 0, 0 ).mv[0] == mb.at( 0, 0 ).mv[1]) && (mb.at( mb.width - 1, 0 ).mv[0] == mb.at( mb.width - 1, 0 ).mv[1]))
|| (pu.cu->affineType == AFFINEMODEL_6PARAM && (mb.at( 0, 0 ).mv[0] == mb.at( 0, 0 ).mv[1]) && (mb.at( mb.width - 1, 0 ).mv[0] == mb.at( mb.width - 1, 0 ).mv[1]) && (mb.at( 0, mb.height - 1 ).mv[0] == mb.at( 0, mb.height - 1 ).mv[1])) )
#else
if ( (mb.at( 0, 0 ).mv[0] == mb.at( 0, 0 ).mv[1]) && (mb.at( mb.width - 1, 0 ).mv[0] == mb.at( mb.width - 1, 0 ).mv[1]) )
#endif
{
return true;
}
......@@ -224,12 +220,8 @@ bool InterPrediction::xCheckIdenticalMotion( const PredictionUnit &pu )
else
{
const CMotionBuf &mb = pu.getMotionBuf();
#if JVET_K0337_AFFINE_6PARA
if ( (pu.cu->affineType == AFFINEMODEL_4PARAM && (mb.at( 0, 0 ).mv[0] == mb.at( 0, 0 ).mv[1]) && (mb.at( mb.width - 1, 0 ).mv[0] == mb.at( mb.width - 1, 0 ).mv[1]))
|| (pu.cu->affineType == AFFINEMODEL_6PARAM && (mb.at( 0, 0 ).mv[0] == mb.at( 0, 0 ).mv[1]) && (mb.at( mb.width - 1, 0 ).mv[0] == mb.at( mb.width - 1, 0 ).mv[1]) && (mb.at( 0, mb.height - 1 ).mv[0] == mb.at( 0, mb.height - 1 ).mv[1])) )
#else
if ( (mb.at( 0, 0 ).mv[0] == mb.at( 0, 0 ).mv[1]) && (mb.at( mb.width - 1, 0 ).mv[0] == mb.at( mb.width - 1, 0 ).mv[1]) )
#endif
{
return true;
}
......@@ -511,13 +503,9 @@ void InterPrediction::xPredInterBlk ( const ComponentID& compID, const Predictio
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
if ( (pu.cu->affineType == AFFINEMODEL_6PARAM && _mv[0] == _mv[1] && _mv[0] == _mv[2])
|| (pu.cu->affineType == AFFINEMODEL_4PARAM && _mv[0] == _mv[1])
)
#else
if( _mv[0] == _mv[1] )
#endif
{
Mv mvTemp = _mv[0];
clipMv( mvTemp, pu.cu->lumaPos(), *pu.cs->sps );
......@@ -557,7 +545,6 @@ void InterPrediction::xPredAffineBlk( const ComponentID& compID, const Predictio
int iDMvHorX, iDMvHorY, iDMvVerX, iDMvVerY;
iDMvHorX = (mvRT - mvLT).getHor() << (iBit - g_aucLog2[cxWidth]);
iDMvHorY = (mvRT - mvLT).getVer() << (iBit - g_aucLog2[cxWidth]);
#if JVET_K0337_AFFINE_6PARA
if ( pu.cu->affineType == AFFINEMODEL_6PARAM )
{
iDMvVerX = (mvLB - mvLT).getHor() << (iBit - g_aucLog2[cxHeight]);
......@@ -568,10 +555,6 @@ void InterPrediction::xPredAffineBlk( const ComponentID& compID, const Predictio
iDMvVerX = -iDMvHorY;
iDMvVerY = iDMvHorX;
}
#else
iDMvVerX = -iDMvHorY;
iDMvVerY = iDMvHorX;
#endif
int iMvScaleHor = mvLT.getHor() << iBit;
int iMvScaleVer = mvLT.getVer() << iBit;
......
......@@ -1660,9 +1660,7 @@ SPSNext::SPSNext( SPS& sps )
, m_IntraEMT ( false )
, m_InterEMT ( false )
, m_Affine ( false )
#if JVET_K0337_AFFINE_6PARA
, m_AffineType ( false )
#endif
, m_MTTEnabled ( false )
#if ENABLE_WPP_PARALLELISM
, m_NextDQP ( false )
......
......@@ -813,9 +813,7 @@ private:
bool m_IntraEMT; // 18
bool m_InterEMT; // 19
bool m_Affine;
#if JVET_K0337_AFFINE_6PARA
bool m_AffineType;
#endif
bool m_MTTEnabled; //
#if ENABLE_WPP_PARALLELISM
bool m_NextDQP;
......@@ -873,10 +871,8 @@ public:
#endif
void setUseAffine ( bool b ) { m_Affine = b; }
bool getUseAffine () const { return m_Affine; }
#if JVET_K0337_AFFINE_6PARA
void setUseAffineType ( bool b ) { m_AffineType = b; }
bool getUseAffineType () const { return m_AffineType; }
#endif
#if !REMOVE_MV_ADAPT_PREC
void setUseHighPrecMv(bool b) { m_highPrecMv = b; }
bool getUseHighPrecMv() const { return m_highPrecMv; }
......
......@@ -85,7 +85,6 @@
#define JVET_K0251_QP_EXT 1 // Extending the QP parameter value range for coarse quantization
#define JVET_K0337_AFFINE_6PARA 1 // CE4.1.3 CU level 4-para/6-para switching
#define JVET_K0185_AFFINE_6PARA_ENC 1 // CE4.1.5 Affine 6-para encoder
#define JVET_K0357_AMVR 1 // Adaptive motion vector resolution separated from JEM_TOOLS macro
......
......@@ -254,9 +254,7 @@ CodingUnit& CodingUnit::operator=( const CodingUnit& other )
splitSeries = other.splitSeries;
skip = other.skip;
affine = other.affine;
#if JVET_K0337_AFFINE_6PARA
affineType = other.affineType;
#endif
transQuantBypass = other.transQuantBypass;
ipcm = other.ipcm;
qp = other.qp;
......@@ -284,9 +282,7 @@ void CodingUnit::initData()
splitSeries = 0;
skip = false;
affine = false;
#if JVET_K0337_AFFINE_6PARA
affineType = 0;
#endif
transQuantBypass = false;
ipcm = false;
qp = 0;
......
......@@ -296,9 +296,7 @@ struct CodingUnit : public UnitArea
SplitSeries splitSeries;
bool skip;
bool affine;
#if JVET_K0337_AFFINE_6PARA
int affineType;
#endif
bool transQuantBypass;
bool ipcm;
#if JVET_K0357_AMVR
......
......@@ -1376,10 +1376,8 @@ void PU::xInheritedAffineMv( const PredictionUnit &pu, const PredictionUnit* puN
int neiW = puNeighbour->Y().width;
int curW = pu.Y().width;
#if JVET_K0337_AFFINE_6PARA
int neiH = puNeighbour->Y().height;
int curH = pu.Y().height;
#endif
Mv mvLT, mvRT, mvLB;
const Position posLT = puNeighbour->Y().topLeft();
......@@ -1394,14 +1392,12 @@ void PU::xInheritedAffineMv( const PredictionUnit &pu, const PredictionUnit* puN
iDMvHorX = (mvRT - mvLT).getHor() << (shift - g_aucLog2[neiW]);
iDMvHorY = (mvRT - mvLT).getVer() << (shift - g_aucLog2[neiW]);
#if JVET_K0337_AFFINE_6PARA
if ( puNeighbour->cu->affineType == AFFINEMODEL_6PARAM )
{
iDMvVerX = (mvLB - mvLT).getHor() << (shift - g_aucLog2[neiH]);
iDMvVerY = (mvLB - mvLT).getVer() << (shift - g_aucLog2[neiH]);
}
else
#endif
{
iDMvVerX = -iDMvHorY;
iDMvVerY = iDMvHorX;
......@@ -1434,7 +1430,6 @@ void PU::xInheritedAffineMv( const PredictionUnit &pu, const PredictionUnit* puN
#endif
// v2
#if JVET_K0337_AFFINE_6PARA
if ( pu.cu->affineType == AFFINEMODEL_6PARAM )
{
horTmp = iMvScaleHor + iDMvHorX * (posCurX - posNeiX) + iDMvVerX * (posCurY + curH - posNeiY);
......@@ -1447,7 +1442,6 @@ void PU::xInheritedAffineMv( const PredictionUnit &pu, const PredictionUnit* puN
rcMv[2] = Mv(horTmp, verTmp, true);
#endif
}
#endif
}
......@@ -1491,7 +1485,6 @@ void PU::fillAffineMvpCand(PredictionUnit &pu, const RefPicList &eRefPicList, co
outputAffineMv[0].roundMV2SignalPrecision();
outputAffineMv[1].roundMV2SignalPrecision();
#if JVET_K0337_AFFINE_6PARA
if ( pu.cu->affineType == AFFINEMODEL_6PARAM )
{
outputAffineMv[2].roundMV2SignalPrecision();
......@@ -1501,9 +1494,6 @@ void PU::fillAffineMvpCand(PredictionUnit &pu, const RefPicList &eRefPicList, co
|| (pu.cu->affineType == AFFINEMODEL_4PARAM && (outputAffineMv[0] != affiAMVPInfo.mvCandLT[0] || outputAffineMv[1] != affiAMVPInfo.mvCandRT[0]))
|| (pu.cu->affineType == AFFINEMODEL_6PARAM && (outputAffineMv[0] != affiAMVPInfo.mvCandLT[0] || outputAffineMv[1] != affiAMVPInfo.mvCandRT[0] || outputAffineMv[2] != affiAMVPInfo.mvCandLB[0]))
)
#else
if ( affiAMVPInfo.numCand == 0 || outputAffineMv[0] != affiAMVPInfo.mvCandLT[0] || outputAffineMv[1] != affiAMVPInfo.mvCandRT[0] )
#endif
{
affiAMVPInfo.mvCandLT[affiAMVPInfo.numCand] = outputAffineMv[0];
affiAMVPInfo.mvCandRT[affiAMVPInfo.numCand] = outputAffineMv[1];
......@@ -1591,7 +1581,6 @@ void PU::fillAffineMvpCand(PredictionUnit &pu, const RefPicList &eRefPicList, co
if ( cornerMVPattern == 7 || cornerMVPattern == 3 || cornerMVPattern == 5 )
{
#if JVET_K0337_AFFINE_6PARA
if ( cornerMVPattern == 3 && pu.cu->affineType == AFFINEMODEL_6PARAM ) // V0 V1 are available, derived V2 for 6-para
{
int shift = MAX_CU_DEPTH;
......@@ -1601,7 +1590,6 @@ void PU::fillAffineMvpCand(PredictionUnit &pu, const RefPicList &eRefPicList, co
outputAffineMv[2].set( vx2, vy2 );
outputAffineMv[2].roundMV2SignalPrecision();
}
#endif
if ( cornerMVPattern == 5 ) // V0 V2 are available, derived V1
{
......@@ -1613,14 +1601,10 @@ void PU::fillAffineMvpCand(PredictionUnit &pu, const RefPicList &eRefPicList, co
outputAffineMv[1].roundMV2SignalPrecision();
}
#if JVET_K0337_AFFINE_6PARA
if ( affiAMVPInfo.numCand == 0
|| (pu.cu->affineType == AFFINEMODEL_4PARAM && (outputAffineMv[0] != affiAMVPInfo.mvCandLT[0] || outputAffineMv[1] != affiAMVPInfo.mvCandRT[0]))
|| (pu.cu->affineType == AFFINEMODEL_6PARAM && (outputAffineMv[0] != affiAMVPInfo.mvCandLT[0] || outputAffineMv[1] != affiAMVPInfo.mvCandRT[0] || outputAffineMv[2] != affiAMVPInfo.mvCandLB[0]))
)
#else
if ( affiAMVPInfo.numCand == 0 || outputAffineMv[0] != affiAMVPInfo.mvCandLT[0] || outputAffineMv[1] != affiAMVPInfo.mvCandRT[0] )
#endif
{
affiAMVPInfo.mvCandLT[affiAMVPInfo.numCand] = outputAffineMv[0];
affiAMVPInfo.mvCandRT[affiAMVPInfo.numCand] = outputAffineMv[1];
......@@ -1927,9 +1911,7 @@ void PU::getAffineMergeCand( const PredictionUnit &pu, MvField (*mvFieldNeighbou
// get Inter Dir
interDirNeighbours = puFirstNeighbour->getMotionInfo().interDir;
#if JVET_K0337_AFFINE_6PARA // inherit affine type
pu.cu->affineType = puFirstNeighbour->cu->affineType;
#endif
// derive Mv from neighbor affine block
Mv cMv[3];
......@@ -1996,7 +1978,6 @@ void PU::setAllAffineMv( PredictionUnit& pu, Mv affLT, Mv affRT, Mv affLB, RefPi
int deltaMvHorX, deltaMvHorY, deltaMvVerX, deltaMvVerY;
deltaMvHorX = (affRT - affLT).getHor() << (shift - g_aucLog2[width]);
deltaMvHorY = (affRT - affLT).getVer() << (shift - g_aucLog2[width]);
#if JVET_K0337_AFFINE_6PARA
int height = pu.Y().height;
if ( pu.cu->affineType == AFFINEMODEL_6PARAM )
{
......@@ -2008,10 +1989,6 @@ void PU::setAllAffineMv( PredictionUnit& pu, Mv affLT, Mv affRT, Mv affLB, RefPi
deltaMvVerX = -deltaMvHorY;
deltaMvVerY = deltaMvHorX;
}
#else
deltaMvVerX = -deltaMvHorY;
deltaMvVerY = deltaMvHorX;
#endif
int mvScaleHor = affLT.getHor() << shift;
int mvScaleVer = affLT.getVer() << shift;
......@@ -2050,12 +2027,10 @@ void PU::setAllAffineMv( PredictionUnit& pu, Mv affLT, Mv affRT, Mv affLB, RefPi
mb.at( 0, 0 ).mv[eRefList] = affLT;
mb.at( mb.width - 1, 0 ).mv[eRefList] = affRT;
#if JVET_K0337_AFFINE_6PARA
if ( pu.cu->affineType == AFFINEMODEL_6PARAM )
{
mb.at( 0, mb.height - 1 ).mv[eRefList] = affLB;
}
#endif
}
#if JVET_K0346
......
......@@ -359,9 +359,7 @@ void writeAllData(const CodingStructure& cs, const UnitArea& ctuArea)
DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, pu, GetBlockStatisticName(BlockStatistic::MergeType), pu.mergeType);
}
DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, pu, GetBlockStatisticName(BlockStatistic::AffineFlag), pu.cu->affine);
#if JVET_K0337_AFFINE_6PARA
DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, pu, GetBlockStatisticName(BlockStatistic::AffineType), pu.cu->affineType);
#endif
DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_ALL, pu, GetBlockStatisticName(BlockStatistic::InterDir), pu.interDir);
if (pu.interDir != 2 /* PRED_L1 */)
......
......@@ -96,9 +96,7 @@ enum class BlockStatistic {
AffineFlag,
AffineMVL0,
AffineMVL1,
#if JVET_K0337_AFFINE_6PARA
AffineType,
#endif
// for dual tree
// general
......@@ -169,9 +167,7 @@ static const std::map<BlockStatistic, std::tuple<std::string, BlockStatisticType
{ 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"}},
#if JVET_K0337_AFFINE_6PARA
{ BlockStatistic::AffineType, std::tuple<std::string, BlockStatisticType, std::string>{"AffineType", BlockStatisticType::Flag, ""} },
#endif
{ BlockStatistic::EMTFlag, std::tuple<std::string, BlockStatisticType, std::string>{"EMTFlag", BlockStatisticType::Flag, ""}},
// for dual tree
......
......@@ -1136,12 +1136,10 @@ void CABACReader::prediction_unit( PredictionUnit& pu, MergeCtx& mrgCtx )
{
mvd_coding( pu.mvdAffi[REF_PIC_LIST_0][0] );
mvd_coding( pu.mvdAffi[REF_PIC_LIST_0][1] );
#if JVET_K0337_AFFINE_6PARA
if ( pu.cu->affineType == AFFINEMODEL_6PARAM )
{
mvd_coding( pu.mvdAffi[REF_PIC_LIST_0][2] );
}
#endif
}
else
{
......@@ -1164,12 +1162,10 @@ void CABACReader::prediction_unit( PredictionUnit& pu, MergeCtx& mrgCtx )
{
mvd_coding( pu.mvdAffi[REF_PIC_LIST_1][0] );
mvd_coding( pu.mvdAffi[REF_PIC_LIST_1][1] );
#if JVET_K0337_AFFINE_6PARA
if ( pu.cu->affineType == AFFINEMODEL_6PARAM )
{
mvd_coding( pu.mvdAffi[REF_PIC_LIST_1][2] );
}
#endif
}
else
{
......@@ -1214,7 +1210,6 @@ void CABACReader::affine_flag( CodingUnit& cu )
DTRACE( g_trace_ctx, D_SYNTAX, "affine_flag() affine=%d ctx=%d pos=(%d,%d)\n", cu.affine ? 1 : 0, ctxId, cu.Y().x, cu.Y().y );
#if JVET_K0337_AFFINE_6PARA
if ( cu.affine && !cu.firstPU->mergeFlag && cu.cs->sps->getSpsNext().getUseAffineType() )
{
ctxId = 0;
......@@ -1225,7 +1220,6 @@ void CABACReader::affine_flag( CodingUnit& cu )
{
cu.affineType = AFFINEMODEL_4PARAM;
}
#endif
}
void CABACReader::merge_flag( PredictionUnit& pu )
......
......@@ -519,7 +519,6 @@ void DecCu::xDeriveCUMV( CodingUnit &cu )
#endif
Mv mvLB;
#if JVET_K0337_AFFINE_6PARA
if ( cu.affineType == AFFINEMODEL_6PARAM )
{
mvLB = affineAMVPInfo.mvCandLB[mvp_idx] + pu.mvdAffi[eRefList][2];
......@@ -531,7 +530,6 @@ void DecCu::xDeriveCUMV( CodingUnit &cu )
CHECK(!mvLB.highPrec, "unexpected lp mv");
#endif
}
#endif
PU::setAllAffineMv( pu, mvLT, mvRT, mvLB, eRefList );
}
}
......
......@@ -804,12 +804,10 @@ void HLSyntaxReader::parseSPSNext( SPSNext& spsNext, const bool usePCM )
READ_FLAG( symbol, "emt_intra_enabled_flag" ); spsNext.setUseIntraEMT ( symbol != 0 );
READ_FLAG( symbol, "emt_inter_enabled_flag" ); spsNext.setUseInterEMT ( symbol != 0 );
READ_FLAG( symbol, "affine_flag" ); spsNext.setUseAffine ( symbol != 0 );
#if JVET_K0337_AFFINE_6PARA
if ( spsNext.getUseAffine() )
{
READ_FLAG( symbol, "affine_type_flag" ); spsNext.setUseAffineType ( symbol != 0 );
}
#endif
for( int k = 0; k < SPSNext::NumReservedFlags; k++ )
{
READ_FLAG( symbol, "reserved_flag" ); if( symbol != 0 ) EXIT("Incompatible version: SPSNext reserved flag not equal to zero (bitstream was probably created with newer software version)" );
......
......@@ -1121,7 +1121,6 @@ void CABACWriter::prediction_unit( const PredictionUnit& pu )
mvd_coding(pu.mvdAffi[REF_PIC_LIST_0][0]);
mvd_coding(pu.mvdAffi[REF_PIC_LIST_0][1]);
#endif
#if JVET_K0337_AFFINE_6PARA
if ( pu.cu->affineType == AFFINEMODEL_6PARAM )
{
#if JVET_K0357_AMVR
......@@ -1130,7 +1129,6 @@ void CABACWriter::prediction_unit( const PredictionUnit& pu )
mvd_coding(pu.mvdAffi[REF_PIC_LIST_0][2]);
#endif
}
#endif
}
else
{
......@@ -1156,7 +1154,6 @@ void CABACWriter::prediction_unit( const PredictionUnit& pu )
mvd_coding(pu.mvdAffi[REF_PIC_LIST_1][0]);
mvd_coding(pu.mvdAffi[REF_PIC_LIST_1][1]);
#endif
#if JVET_K0337_AFFINE_6PARA
if ( pu.cu->affineType == AFFINEMODEL_6PARAM )
{
#if JVET_K0357_AMVR
......@@ -1165,7 +1162,6 @@ void CABACWriter::prediction_unit( const PredictionUnit& pu )
mvd_coding(pu.mvdAffi[REF_PIC_LIST_1][2]);
#endif
}
#endif
}
else
{
......@@ -1206,7 +1202,6 @@ void CABACWriter::affine_flag( const CodingUnit& cu )
DTRACE( g_trace_ctx, D_SYNTAX, "affine_flag() affine=%d ctx=%d pos=(%d,%d)\n", cu.affine ? 1 : 0, ctxId, cu.Y().x, cu.Y().y );
#if JVET_K0337_AFFINE_6PARA
if ( cu.affine && !cu.firstPU->mergeFlag && cu.cs->sps->getSpsNext().getUseAffineType() )
{
unsigned ctxId = 0;
......@@ -1215,7 +1210,6 @@ void CABACWriter::affine_flag( const CodingUnit& cu )
DTRACE( g_trace_ctx, D_COMMON, " (%d) affine_type() affine_type=%d\n", DTRACE_GET_COUNTER( g_trace_ctx, D_COMMON ), cu.affineType ? 1 : 0 );
DTRACE( g_trace_ctx, D_SYNTAX, "affine_type() affine_type=%d ctx=%d pos=(%d,%d)\n", cu.affineType ? 1 : 0, ctxId, cu.Y().x, cu.Y().y );
}
#endif
}
void CABACWriter::merge_flag( const PredictionUnit& pu )
......
......@@ -195,9 +195,7 @@ protected:
unsigned m_SubPuMvpLog2Size;
#endif
bool m_Affine;
#if JVET_K0337_AFFINE_6PARA
bool m_AffineType;
#endif
#if !REMOVE_MV_ADAPT_PREC
bool m_highPrecMv;
#endif
......@@ -624,10 +622,8 @@ public:
void setAffine ( bool b ) { m_Affine = b; }
bool getAffine () const { return m_Affine; }
#if JVET_K0337_AFFINE_6PARA
void setAffineType( bool b ) { m_AffineType = b; }
bool getAffineType() const { return m_AffineType; }
#endif
#if !REMOVE_MV_ADAPT_PREC
void setHighPrecisionMv ( bool b ) { m_highPrecMv = b; }
bool getHighPrecisionMv () { return m_highPrecMv; }
......
......@@ -875,9 +875,7 @@ void EncLib::xInitSPS(SPS &sps)
sps.getSpsNext().setUseHighPrecMv ( m_highPrecMv );
#endif
sps.getSpsNext().setUseAffine ( m_Affine );
#if JVET_K0337_AFFINE_6PARA
sps.getSpsNext().setUseAffineType ( m_AffineType );
#endif
sps.getSpsNext().setDisableMotCompress ( m_DisableMotionCompression );
sps.getSpsNext().setMTTMode ( m_MTTMode );
sps.getSpsNext().setUseLMChroma ( m_LMChroma ? true : false );
......
......@@ -544,12 +544,10 @@ void HLSWriter::codeSPSNext( const SPSNext& spsNext, const bool usePCM )
WRITE_FLAG( spsNext.getUseIntraEMT() ? 1 : 0, "emt_intra_enabled_flag" );
WRITE_FLAG( spsNext.getUseInterEMT() ? 1 : 0, "emt_inter_enabled_flag" );
WRITE_FLAG( spsNext.getUseAffine() ? 1 : 0, "affine_flag" );
#if JVET_K0337_AFFINE_6PARA
if ( spsNext.getUseAffine() )
{
WRITE_FLAG( spsNext.getUseAffineType() ? 1 : 0, "affine_type_flag" );
}
#endif
for( int k = 0; k < SPSNext::NumReservedFlags; k++ )
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment