Skip to content

Commit

Permalink
PAMC modified source code
Browse files Browse the repository at this point in the history
  • Loading branch information
YounggjuuChoi committed Jun 22, 2022
1 parent caf8b02 commit 62c2f02
Show file tree
Hide file tree
Showing 27 changed files with 1,527 additions and 256 deletions.
2 changes: 1 addition & 1 deletion source/App/EncoderApp/EncAppCfg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,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]")
("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]" )
( "AffineType", m_AffineType, 2, "Enable affine type prediction (0:off, 1:on) [default: on] / [modify] 0:4param, 1:6param, 2:8param" )
#endif
#endif
("DisableMotCompression", m_DisableMotionCompression, false, "Disable motion data compression for all modes")
Expand Down
2 changes: 1 addition & 1 deletion source/App/EncoderApp/EncAppCfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ class EncAppCfg
#if JVET_K_AFFINE
bool m_Affine;
#if JVET_K0337_AFFINE_6PARA
bool m_AffineType;
int m_AffineType;
#endif
#endif
#if JVET_K0346 || JVET_K_AFFINE
Expand Down
33 changes: 28 additions & 5 deletions source/Lib/CommonLib/AffineGradientSearch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,25 +129,37 @@ void AffineGradientSearch::xVerticalSobelFilter( Pel *const pPred, const int pre
}
}

void AffineGradientSearch::xEqualCoeffComputer( Pel *pResidue, int residueStride, int **ppDerivate, int derivateBufStride, int64_t( *pEqualCoeff )[7], int width, int height, bool b6Param )
void AffineGradientSearch::xEqualCoeffComputer( Pel *pResidue, int residueStride, int **ppDerivate, int derivateBufStride, int64_t( *pEqualCoeff )[9], int width, int height, int i468Param )
{
int affineParamNum = b6Param ? 6 : 4;
int affineParamNum = 0;
if (i468Param == 0)
{
affineParamNum = 4;
}
else if (i468Param == 1)
{
affineParamNum = 6;
}
else if (i468Param == 2)
{
affineParamNum = 8;
}

for ( int j = 0; j != height; j++ )
{
for ( int k = 0; k != width; k++ )
{
int iC[6];
int iC[8];

int idx = j * derivateBufStride + k;
if ( !b6Param )
if (i468Param == 0)
{
iC[0] = ppDerivate[0][idx];
iC[1] = k * ppDerivate[0][idx] + j * ppDerivate[1][idx];
iC[2] = ppDerivate[1][idx];
iC[3] = j * ppDerivate[0][idx] - k * ppDerivate[1][idx];
}
else
else if (i468Param == 1)
{
iC[0] = ppDerivate[0][idx];
iC[1] = k * ppDerivate[0][idx];
Expand All @@ -156,6 +168,17 @@ void AffineGradientSearch::xEqualCoeffComputer( Pel *pResidue, int residueStride
iC[4] = j * ppDerivate[0][idx];
iC[5] = j * ppDerivate[1][idx];
}
else
{
iC[0] = ppDerivate[0][idx];
iC[1] = k * ppDerivate[0][idx];
iC[2] = ppDerivate[1][idx];
iC[3] = k * ppDerivate[1][idx];
iC[4] = j * ppDerivate[0][idx];
iC[5] = j * ppDerivate[1][idx];
iC[6] = k * ppDerivate[0][idx] + j * ppDerivate[0][idx];
iC[7] = k * ppDerivate[1][idx] + j * ppDerivate[1][idx];
}
for ( int col = 0; col < affineParamNum; col++ )
{
for ( int row = 0; row < affineParamNum; row++ )
Expand Down
4 changes: 2 additions & 2 deletions source/Lib/CommonLib/AffineGradientSearch.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ class AffineGradientSearch

void( *m_VerticalSobelFilter ) (Pel *const pPred, const int predStride, int *const pDerivate, const int derivateBufStride, const int width, const int height);

void( *m_EqualCoeffComputer ) (Pel *pResidue, int residueStride, int **ppDerivate, int derivateBufStride, int64_t( *pEqualCoeff )[7], int width, int height, bool b6Param);
void( *m_EqualCoeffComputer ) (Pel *pResidue, int residueStride, int **ppDerivate, int derivateBufStride, int64_t( *pEqualCoeff )[9], int width, int height, int i468Param);

static void xHorizontalSobelFilter( Pel *const pPred, const int predStride, int *const pDerivate, const int derivateBufStride, const int width, const int height );

static void xVerticalSobelFilter( Pel *const pPred, const int predStride, int *const pDerivate, const int derivateBufStride, const int width, const int height );

static void xEqualCoeffComputer( Pel *pResidue, int residueStride, int **ppDerivate, int derivateBufStride, int64_t( *pEqualCoeff )[7], int width, int height, bool b6Param );
static void xEqualCoeffComputer( Pel *pResidue, int residueStride, int **ppDerivate, int derivateBufStride, int64_t( *pEqualCoeff )[9], int width, int height, int i468Param);

AffineGradientSearch();
~AffineGradientSearch() {}
Expand Down
2 changes: 2 additions & 0 deletions source/Lib/CommonLib/CommonDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ typedef enum
{
AFFINEMODEL_4PARAM,
AFFINEMODEL_6PARAM,
AFFINEMODEL_8PARAM, // [Perspective ME] Perspective Model 8Param
AFFINE_MODEL_NUM
} EAffineModel;
#endif
Expand Down Expand Up @@ -327,6 +328,7 @@ static const int MAX_GR_ORDER_RESIDUAL = 10;
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_V3 = 1; ///< max number of motion candidates in right-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
Expand Down
1 change: 1 addition & 0 deletions source/Lib/CommonLib/Contexts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,7 @@ const CtxSet ContextSetCfg::AffineType = ContextSetCfg::addCtxSet
({
{ 92, },
{ 77, },
{ 62, }, // [YJC][PerspectiveME] 같은 간격으로 하긴 했으나, 설정 방법을 잘 모르겠음.
{ CNU, },
});
#endif
Expand Down
87 changes: 80 additions & 7 deletions source/Lib/CommonLib/InterPrediction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,8 @@ bool checkIdenticalMotion( const PredictionUnit &pu )
#if JVET_K_AFFINE_BUG_FIXES
#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])) )
|| (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]))
|| (pu.cu->affineType == AFFINEMODEL_8PARAM && (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
Expand Down Expand Up @@ -243,7 +244,8 @@ bool InterPrediction::xCheckIdenticalMotion( const PredictionUnit &pu )
#if JVET_K_AFFINE_BUG_FIXES
#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])) )
|| (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]))
|| (pu.cu->affineType == AFFINEMODEL_8PARAM && (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
Expand Down Expand Up @@ -370,7 +372,7 @@ void InterPrediction::xPredInterUni(const PredictionUnit& pu, const RefPicList&
const SPS &sps = *pu.cs->sps;

int iRefIdx = pu.refIdx[eRefPicList];
Mv mv[3];
Mv mv[4];

#if JVET_K_AFFINE
if( pu.cu->affine )
Expand All @@ -381,6 +383,8 @@ void InterPrediction::xPredInterUni(const PredictionUnit& pu, const RefPicList&
mv[0] = mb.at( 0, 0 ).mv[eRefPicList];
mv[1] = mb.at( mb.width - 1, 0 ).mv[eRefPicList];
mv[2] = mb.at( 0, mb.height - 1 ).mv[eRefPicList];
mv[3] = mb.at( mb.width - 1, mb.height - 1 ).mv[eRefPicList];

#if !JVET_K_AFFINE_BUG_FIXES
clipMv(mv[1], pu.cu->lumaPos(), sps);
clipMv(mv[2], pu.cu->lumaPos(), sps);
Expand Down Expand Up @@ -553,6 +557,7 @@ void InterPrediction::xPredAffineBlk( const ComponentID& compID, const Predictio
{
#if JVET_K0337_AFFINE_6PARA
if ( (pu.cu->affineType == AFFINEMODEL_6PARAM && _mv[0] == _mv[1] && _mv[0] == _mv[2])
|| (pu.cu->affineType == AFFINEMODEL_8PARAM && _mv[0] == _mv[1] && _mv[0] == _mv[2] && _mv[0] == _mv[3])
|| (pu.cu->affineType == AFFINEMODEL_4PARAM && _mv[0] == _mv[1])
)
#else
Expand All @@ -577,10 +582,12 @@ void InterPrediction::xPredAffineBlk( const ComponentID& compID, const Predictio
Mv mvLT =_mv[0];
Mv mvRT =_mv[1];
Mv mvLB =_mv[2];
Mv mvRB =_mv[3];

mvLT.setHighPrec();
mvRT.setHighPrec();
mvLB.setHighPrec();
mvRB.setHighPrec();

// get affine sub-block width and height
const int width = pu.Y().width;
Expand Down Expand Up @@ -625,11 +632,18 @@ void InterPrediction::xPredAffineBlk( const ComponentID& compID, const Predictio
const int iHalfBH = blockHeight >> 1;

const int iBit = MAX_CU_DEPTH;
int iDMvHorX, iDMvHorY, iDMvVerX, iDMvVerY;
int iDMvHorX, iDMvHorY, iDMvVerX, iDMvVerY; //a, d, b, e
int iDMvHorBottom = 1; //g
int iDMvVerBottom = 1; //h

//int perspParamX = (int)pu.perspParam[0];
//int perspParamY = (int)pu.perspParam[1];

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 )
if ( pu.cu->affineType == AFFINEMODEL_6PARAM || pu.cu->affineType == AFFINEMODEL_8PARAM)
{
iDMvVerX = (mvLB - mvLT).getHor() << (iBit - g_aucLog2[cxHeight]);
iDMvVerY = (mvLB - mvLT).getVer() << (iBit - g_aucLog2[cxHeight]);
Expand All @@ -639,13 +653,57 @@ void InterPrediction::xPredAffineBlk( const ComponentID& compID, const Predictio
iDMvVerX = -iDMvHorY;
iDMvVerY = iDMvHorX;
}

if (pu.cu->affineType == AFFINEMODEL_8PARAM)
{
// Full MV Model
if ((((mvRB - mvLB).getVer() * (mvRB - mvRT).getHor()) - ((mvRB - mvLB).getHor() * (mvRB - mvRT).getVer())) != 0)
{
iDMvHorBottom = ((((mvRB - mvLB).getHor() * (2 * mvLT.getVer() - mvRT.getVer())) + ((mvRB - mvLB).getVer() * (mvRT.getHor() - 2 * mvLT.getHor())))
/ (((mvRB - mvLB).getVer() * (mvRB - mvRT).getHor()) - ((mvRB - mvLB).getHor() * (mvRB - mvRT).getVer())));
}
else
{
iDMvHorBottom = (0) << (iBit - g_aucLog2[cxWidth]);
}

if ((((mvRB - mvLT).getVer() * (mvRB - mvLB).getHor()) - ((mvRB - mvLT).getHor() * (mvRB - mvLB).getVer())) != 0)
{
iDMvVerBottom = ((((mvRB - mvLT).getHor() * (2 * mvLT.getVer() - mvRT.getVer())) + ((mvRB - mvLT).getVer() * (mvRT.getHor() - 2 * mvLT.getHor())))
/ (((mvRB - mvLT).getVer() * (mvRB - mvLB).getHor()) - ((mvRB - mvLT).getHor() * (mvRB - mvLB).getVer())));
}
else
{
iDMvVerBottom = (0) << (iBit - g_aucLog2[cxHeight]);
}


iDMvHorX = (mvRT.getHor() * (iDMvHorBottom + 1) - mvLT.getHor()) << (iBit - g_aucLog2[cxWidth]);

iDMvVerX = (mvLB.getHor() * (iDMvVerBottom + 1) - mvLT.getHor()) << (iBit - g_aucLog2[cxHeight]);

iDMvHorY = (mvRT.getVer() * (iDMvHorBottom + 1) - mvLT.getVer()) << (iBit - g_aucLog2[cxWidth]);

iDMvVerY = (mvLB.getVer() * (iDMvVerBottom + 1) - mvLT.getVer()) << (iBit - g_aucLog2[cxHeight]);


// MV+Param Model
/*
iDMvHorX = (perspParamX * mvRT.getHor() - mvLT.getHor()) << (iBit - g_aucLog2[cxWidth]);
iDMvVerX = (perspParamY * mvLB.getHor() - mvLT.getHor()) << (iBit - g_aucLog2[cxWidth]);
iDMvHorY = (perspParamX * mvRT.getVer() - mvLT.getVer()) << (iBit - g_aucLog2[cxHeight]);
iDMvVerY = (perspParamY * mvLB.getVer() - mvLT.getVer()) << (iBit - g_aucLog2[cxHeight]);
iDMvHorBottom = (perspParamX - 1) << (iBit - g_aucLog2[cxWidth]);
iDMvVerBottom = (perspParamY - 1) << (iBit - g_aucLog2[cxHeight]);
*/
}
#else
iDMvVerX = -iDMvHorY;
iDMvVerY = iDMvHorX;
#endif

int iMvScaleHor = mvLT.getHor() << iBit;
int iMvScaleVer = mvLT.getVer() << iBit;
int iMvScaleHor = mvLT.getHor() << iBit; //c
int iMvScaleVer = mvLT.getVer() << iBit; //f
const SPS &sps = *pu.cs->sps;
const int iMvShift = 4;
const int iOffset = 8;
Expand All @@ -666,6 +724,21 @@ void InterPrediction::xPredAffineBlk( const ComponentID& compID, const Predictio
{
int iMvScaleTmpHor = iMvScaleHor + iDMvHorX * (iHalfBW + w) + iDMvVerX * (iHalfBH + h);
int iMvScaleTmpVer = iMvScaleVer + iDMvHorY * (iHalfBW + w) + iDMvVerY * (iHalfBH + h);

if (pu.cu->affineType == AFFINEMODEL_8PARAM)
{
if ((iDMvHorBottom * (iHalfBW + w) + iDMvVerBottom * (iHalfBH + h) + 1) != 0)
{
iMvScaleTmpHor = (iMvScaleHor + iDMvHorX * (iHalfBW + w) + iDMvVerX * (iHalfBH + h)) / (iDMvHorBottom * (iHalfBW + w) + iDMvVerBottom * (iHalfBH + h) + 1);
iMvScaleTmpVer = (iMvScaleVer + iDMvHorY * (iHalfBW + w) + iDMvVerY * (iHalfBH + h)) / (iDMvHorBottom * (iHalfBW + w) + iDMvVerBottom * (iHalfBH + h) + 1);
}
else
{
iMvScaleTmpHor = (iMvScaleHor + iDMvHorX * (iHalfBW + w) + iDMvVerX * (iHalfBH + h));
iMvScaleTmpVer = (iMvScaleVer + iDMvHorY * (iHalfBW + w) + iDMvVerY * (iHalfBH + h));
}
}

#if JVET_K_AFFINE_BUG_FIXES
roundAffineMv( iMvScaleTmpHor, iMvScaleTmpVer, shift );
#else
Expand Down
2 changes: 1 addition & 1 deletion source/Lib/CommonLib/InterPrediction.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class InterPrediction : public WeightPrediction

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 );
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 );
Expand Down
1 change: 1 addition & 0 deletions source/Lib/CommonLib/MotionInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ struct AffineAMVPInfo
Mv mvCandLT[ AMVP_MAX_NUM_CANDS_MEM ]; ///< array of affine motion vector predictor candidates for left-top corner
Mv mvCandRT[ AMVP_MAX_NUM_CANDS_MEM ]; ///< array of affine motion vector predictor candidates for right-top corner
Mv mvCandLB[ AMVP_MAX_NUM_CANDS_MEM ]; ///< array of affine motion vector predictor candidates for left-bottom corner
Mv mvCandRB[ AMVP_MAX_NUM_CANDS_MEM ]; ///< array of affine motion vector predictor candidates for right-bottom corner
unsigned numCand; ///< number of motion vector predictor candidates
};
#endif
Expand Down
2 changes: 1 addition & 1 deletion source/Lib/CommonLib/Slice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1617,7 +1617,7 @@ SPSNext::SPSNext( SPS& sps )
#if JVET_K_AFFINE
, m_Affine ( false )
#if JVET_K0337_AFFINE_6PARA
, m_AffineType ( false )
, m_AffineType ( 0 )
#endif
#endif
, m_MTTEnabled ( false )
Expand Down
6 changes: 3 additions & 3 deletions source/Lib/CommonLib/Slice.h
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,7 @@ class SPSNext
#if JVET_K_AFFINE
bool m_Affine;
#if JVET_K0337_AFFINE_6PARA
bool m_AffineType;
int m_AffineType;
#endif
#endif
bool m_MTTEnabled; //
Expand Down Expand Up @@ -887,8 +887,8 @@ class SPSNext
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; }
void setUseAffineType ( int b ) { m_AffineType = b; }
int getUseAffineType () const { return m_AffineType; }
#endif
#endif
#if JVET_K0072
Expand Down
6 changes: 5 additions & 1 deletion source/Lib/CommonLib/TypeDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@
#if JVET_K0337_AFFINE_6PARA
#define JVET_K0185_AFFINE_6PARA_ENC 1 // CE4.1.5 Affine 6-para encoder
#endif
#define JVET_YJC_PERSP_8PARA 1 // [YJC] Perspective 8-para encoder
#if JVET_YJC_PERSP_8PARA
#define JVET_YJC_PERSP_8PARA_ENC 1 // [YJC] Perspective 8-para encoder
#endif
#endif

#define JVET_K0357_AMVR 1 // Adaptive motion vector resolution separated from JEM_TOOLS macro
Expand Down Expand Up @@ -604,7 +608,7 @@ enum MvpDir
MD_ABOVE, ///< MVP of above block
MD_ABOVE_RIGHT, ///< MVP of above right block
MD_BELOW_LEFT, ///< MVP of below left block
MD_ABOVE_LEFT ///< MVP of above left block
MD_ABOVE_LEFT, ///< MVP of above left block
};

enum StoredResidualType
Expand Down
10 changes: 7 additions & 3 deletions source/Lib/CommonLib/Unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -338,12 +338,16 @@ void PredictionUnit::initData()
mv[i] .setZero();
mvd[i] .setZero();
#if JVET_K_AFFINE
for( uint32_t j = 0; j < 3; j++ )
for( uint32_t j = 0; j < 4; j++ )
{
mvdAffi[i][j].setZero();
}
#endif
}
for (uint32_t i = 0; i < 2; i++)
{
perspParam[i] = 0.0;
}
}

PredictionUnit& PredictionUnit::operator=(const IntraPredictionData& predData)
Expand All @@ -370,7 +374,7 @@ PredictionUnit& PredictionUnit::operator=(const InterPredictionData& predData)
mvd[i] = predData.mvd[i];
refIdx[i] = predData.refIdx[i];
#if JVET_K_AFFINE
for( uint32_t j = 0; j < 3; j++ )
for( uint32_t j = 0; j < 4; j++ )
{
mvdAffi[i][j] = predData.mvdAffi[i][j];
}
Expand Down Expand Up @@ -399,7 +403,7 @@ PredictionUnit& PredictionUnit::operator=( const PredictionUnit& other )
mvd[i] = other.mvd[i];
refIdx[i] = other.refIdx[i];
#if JVET_K_AFFINE
for( uint32_t j = 0; j < 3; j++ )
for( uint32_t j = 0; j < 4; j++ )
{
mvdAffi[i][j] = other.mvdAffi[i][j];
}
Expand Down
4 changes: 3 additions & 1 deletion source/Lib/CommonLib/Unit.h
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,9 @@ struct InterPredictionData
int16_t refIdx [NUM_REF_PIC_LIST_01];
MergeType mergeType;
#if JVET_K_AFFINE
Mv mvdAffi [NUM_REF_PIC_LIST_01][3];
Mv mvdAffi [NUM_REF_PIC_LIST_01][4];

double perspParam[2];
#endif
};

Expand Down
Loading

0 comments on commit 62c2f02

Please sign in to comment.