Commit b6f230b0 authored by Karsten Suehring's avatar Karsten Suehring

remove macro JVET_L0231_WRAPAROUND

parent b23288fb
......@@ -272,10 +272,8 @@ void EncApp::xInitLibCfg()
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
......
......@@ -873,10 +873,8 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
( "CPRFastMethod", m_CPRFastMethod, 6u, "Fast methods for CPR")
#endif
#if JVET_L0231_WRAPAROUND
("WrapAround", m_wrapAround, false, "Enable horizontal wrap-around motion compensation for inter prediction (0:off, 1:on) [default: off]")
("WrapAroundOffset", m_wrapAroundOffset, 0u, "Offset in luma samples used for computing the horizontal wrap-around position")
#endif
// ADD_NEW_TOOL : (encoder app) add parsing parameters here
......@@ -1976,14 +1974,12 @@ bool EncAppCfg::xCheckParameter()
}
#if JVET_L0231_WRAPAROUND
if( m_wrapAround )
{
xConfirmPara( m_wrapAroundOffset == 0, "Wrap-around offset must be greater than 0" );
xConfirmPara( m_wrapAroundOffset > m_iSourceWidth, "Wrap-around offset must not be greater than the source picture width" );
xConfirmPara( m_wrapAroundOffset % SPS::getWinUnitX(m_chromaFormatIDC) != 0, "Wrap-around offset must be an integer multiple of the specified chroma subsampling" );
}
#endif
#if ENABLE_SPLIT_PARALLELISM
xConfirmPara( m_numSplitThreads < 1, "Number of used threads cannot be smaller than 1" );
......@@ -3162,13 +3158,11 @@ void EncAppCfg::xPrintParameter()
#if JVET_L0293_CPR
msg(VERBOSE, "CPR:%d ", m_CPRMode);
#endif
#if JVET_L0231_WRAPAROUND
msg( VERBOSE, "WrapAround:%d ", m_wrapAround);
if( m_wrapAround )
{
msg( VERBOSE, "WrapAroundOffset:%d ", m_wrapAroundOffset );
}
#endif
// ADD_NEW_TOOL (add some output indicating the usage of tools)
msg( VERBOSE, "\nFAST TOOL CFG: " );
......
......@@ -254,10 +254,8 @@ protected:
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
......
......@@ -461,9 +461,7 @@ void InterPrediction::xPredInterUni(const PredictionUnit& pu, const RefPicList&
}
if ( !pu.cu->affine )
clipMv(mv[0], pu.cu->lumaPos(),
#if JVET_L0231_WRAPAROUND
pu.cu->lumaSize(),
#endif
sps);
......@@ -739,9 +737,7 @@ void InterPrediction::xPredAffineBlk( const ComponentID& compID, const Predictio
{
Mv mvTemp = _mv[0];
clipMv( mvTemp, pu.cu->lumaPos(),
#if JVET_L0231_WRAPAROUND
pu.cu->lumaSize(),
#endif
*pu.cs->sps );
xPredInterBlk( compID, pu, refPic, mvTemp, dstPic, bi, clpRng
#if JVET_L0256_BIO
......@@ -832,7 +828,6 @@ void InterPrediction::xPredAffineBlk( const ComponentID& compID, const Predictio
roundAffineMv(iMvScaleTmpHor, iMvScaleTmpVer, shift);
// clip and scale
#if JVET_L0231_WRAPAROUND
if (sps.getUseWrapAround())
{
m_storedMv[h / AFFINE_MIN_BLOCK_SIZE * MVBUFFER_SIZE + w / AFFINE_MIN_BLOCK_SIZE].set(iMvScaleTmpHor, iMvScaleTmpVer);
......@@ -843,14 +838,11 @@ void InterPrediction::xPredAffineBlk( const ComponentID& compID, const Predictio
}
else
{
#endif
iMvScaleTmpHor = std::min<int>(iHorMax, std::max<int>(iHorMin, iMvScaleTmpHor));
iMvScaleTmpVer = std::min<int>(iVerMax, std::max<int>(iVerMin, iMvScaleTmpVer));
m_storedMv[h / AFFINE_MIN_BLOCK_SIZE * MVBUFFER_SIZE + w / AFFINE_MIN_BLOCK_SIZE].set(iMvScaleTmpHor, iMvScaleTmpVer);
#if JVET_L0231_WRAPAROUND
}
#endif
}
else
{
......@@ -860,12 +852,10 @@ void InterPrediction::xPredAffineBlk( const ComponentID& compID, const Predictio
m_storedMv[((h << iScaleY) / AFFINE_MIN_BLOCK_SIZE + 1)* MVBUFFER_SIZE + ((w << iScaleX) / AFFINE_MIN_BLOCK_SIZE + 1)] +
Mv(2, 2));
curMv.set(curMv.getHor() >> 2, curMv.getVer() >> 2);
#if JVET_L0231_WRAPAROUND
if (sps.getUseWrapAround())
{
clipMv(curMv, Position(pu.Y().x + (w << iScaleX), pu.Y().y + (h << iScaleY)), Size(blockWidth << iScaleX, blockHeight << iScaleY), sps);
}
#endif
iMvScaleTmpHor = curMv.hor;
iMvScaleTmpVer = curMv.ver;
}
......@@ -875,7 +865,6 @@ void InterPrediction::xPredAffineBlk( const ComponentID& compID, const Predictio
roundAffineMv( iMvScaleTmpHor, iMvScaleTmpVer, shift );
// clip and scale
#if JVET_L0231_WRAPAROUND
if (sps.getUseWrapAround())
{
Mv tmpMv(iMvScaleTmpHor, iMvScaleTmpVer);
......@@ -885,12 +874,9 @@ void InterPrediction::xPredAffineBlk( const ComponentID& compID, const Predictio
}
else
{
#endif
iMvScaleTmpHor = std::min<int>( iHorMax, std::max<int>( iHorMin, iMvScaleTmpHor ) );
iMvScaleTmpVer = std::min<int>( iVerMax, std::max<int>( iVerMin, iMvScaleTmpVer ) );
#if JVET_L0231_WRAPAROUND
}
#endif
#endif
// get the MV in high precision
int xFrac, yFrac, xInt, yInt;
......
......@@ -50,9 +50,7 @@ void roundAffineMv( int& mvx, int& mvy, int nShift )
}
void clipMv( Mv& rcMv, const Position& pos,
#if JVET_L0231_WRAPAROUND
const struct Size& size,
#endif
const SPS& sps )
{
int iMvShift = MV_FRACTIONAL_BITS_INTERNAL;
......@@ -63,7 +61,6 @@ void clipMv( Mv& rcMv, const Position& pos,
int iVerMax = ( sps.getPicHeightInLumaSamples() + iOffset - ( int ) pos.y - 1 ) << iMvShift;
int iVerMin = ( -( int ) sps.getMaxCUHeight() - iOffset - ( int ) pos.y + 1 ) << iMvShift;
#if JVET_L0231_WRAPAROUND
if( sps.getUseWrapAround() )
{
int iHorMax = ( sps.getPicWidthInLumaSamples() + sps.getMaxCUWidth() - size.width + iOffset - ( int ) pos.x - 1 ) << iMvShift;
......@@ -72,7 +69,6 @@ void clipMv( Mv& rcMv, const Position& pos,
rcMv.setVer( std::min( iVerMax, std::max( iVerMin, rcMv.getVer() ) ) );
return;
}
#endif
rcMv.setHor( std::min( iHorMax, std::max( iHorMin, rcMv.getHor() ) ) );
rcMv.setVer( std::min( iVerMax, std::max( iVerMin, rcMv.getVer() ) ) );
......
......@@ -217,9 +217,7 @@ namespace std
};
#endif
void clipMv ( Mv& rcMv, const struct Position& pos,
#if JVET_L0231_WRAPAROUND
const struct Size& size,
#endif
const class SPS& sps );
void roundAffineMv( int& mvx, int& mvy, int nShift );
......
......@@ -1004,7 +1004,6 @@ void Picture::extendPicBorder()
Pel* pi = piTxt;
// do left and right margins
#if JVET_L0231_WRAPAROUND
if (cs->sps->getUseWrapAround())
{
int xoffset = cs->sps->getWrapAroundOffset() >> getComponentScaleX( compID, cs->area.chromaFormat );
......@@ -1020,7 +1019,6 @@ void Picture::extendPicBorder()
}
else
{
#endif
for (int y = 0; y < p.height; y++)
{
for (int x = 0; x < xmargin; x++ )
......@@ -1030,9 +1028,7 @@ void Picture::extendPicBorder()
}
pi += p.stride;
}
#if JVET_L0231_WRAPAROUND
}
#endif
// pi is now the (0,height) (bottom left of image within bigger picture
pi -= (p.stride + xmargin);
......
......@@ -1905,10 +1905,8 @@ SPS::SPS()
, m_vuiParametersPresentFlag (false)
, m_vuiParameters ()
, m_spsNextExtension (*this)
#if JVET_L0231_WRAPAROUND
, m_useWrapAround (false)
, m_wrapAroundOffset ( 0)
#endif
{
for(int ch=0; ch<MAX_NUM_CHANNEL_TYPE; ch++)
{
......
......@@ -1104,10 +1104,8 @@ private:
bool m_useALF;
#if JVET_L0231_WRAPAROUND
bool m_useWrapAround;
unsigned m_wrapAroundOffset;
#endif
public:
......@@ -1318,12 +1316,10 @@ public:
bool getUseALF() const { return m_useALF; }
void setUseALF( bool b ) { m_useALF = b; }
#if JVET_L0231_WRAPAROUND
void setUseWrapAround(bool b) { m_useWrapAround = b; }
bool getUseWrapAround() const { return m_useWrapAround; }
void setWrapAroundOffset(unsigned offset) { m_wrapAroundOffset = offset; }
unsigned getWrapAroundOffset() const { return m_wrapAroundOffset; }
#endif
};
......
......@@ -50,7 +50,6 @@
#include <assert.h>
#include <cassert>
#define JVET_L0231_WRAPAROUND 1 // Wrap-around MC
#define TRAINED_CABAC_INIT_TABLES 1 // Trained values for VTM3
#define JVET_L0410_TC_TAB 1 // Change TC table for QP 51-63
......
......@@ -1172,13 +1172,11 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
READ_FLAG( uiCode, "pcm_loop_filter_disable_flag" ); pcSPS->setPCMFilterDisableFlag ( uiCode ? true : false );
}
#if JVET_L0231_WRAPAROUND
READ_FLAG(uiCode, "ref_wraparound_enabled_flag"); pcSPS->setUseWrapAround( uiCode ? true : false );
if (pcSPS->getUseWrapAround())
{
READ_UVLC(uiCode, "ref_wraparound_offset"); pcSPS->setWrapAroundOffset( uiCode );
}
#endif
READ_UVLC( uiCode, "num_short_term_ref_pic_sets" );
CHECK(uiCode > 64, "Invalid code");
......
......@@ -255,10 +255,8 @@ protected:
unsigned m_CPRFastMethod;
#endif
#if JVET_L0231_WRAPAROUND
bool m_wrapAround;
unsigned m_wrapAroundOffset;
#endif
// ADD_NEW_TOOL : (encoder lib) add tool enabling flags and associated parameters here
......@@ -786,12 +784,10 @@ public:
unsigned getCPRFastMethod () const { return m_CPRFastMethod; }
#endif
#if JVET_L0231_WRAPAROUND
void setUseWrapAround ( bool b ) { m_wrapAround = b; }
bool getUseWrapAround () const { return m_wrapAround; }
void setWrapAroundOffset ( unsigned u ) { m_wrapAroundOffset = u; }
unsigned getWrapAroundOffset () const { return m_wrapAroundOffset; }
#endif
// ADD_NEW_TOOL : (encoder lib) add access functions here
......
......@@ -910,10 +910,8 @@ void EncLib::xInitSPS(SPS &sps)
sps.getSpsNext().setCPRMode ( m_CPRMode );
#endif
#if JVET_L0231_WRAPAROUND
sps.setUseWrapAround ( m_wrapAround );
sps.setWrapAroundOffset ( m_wrapAroundOffset );
#endif
// ADD_NEW_TOOL : (encoder lib) set tool enabling flags and associated parameters here
int minCUSize = sps.getMaxCUWidth() >> sps.getLog2DiffMaxMinCodingBlockSize();
......
......@@ -1280,14 +1280,10 @@ void InterSearch::xSetIntraSearchRange(PredictionUnit& pu, int iRoiWidth, int iR
rcMvSrchRngLT <<= 2;
rcMvSrchRngRB <<= 2;
clipMv(rcMvSrchRngLT, pu.cu->lumaPos(),
#if JVET_L0231_WRAPAROUND
pu.cu->lumaSize(),
#endif
sps);
clipMv(rcMvSrchRngRB, pu.cu->lumaPos(),
#if JVET_L0231_WRAPAROUND
pu.cu->lumaSize(),
#endif
sps);
rcMvSrchRngLT >>= 2;
rcMvSrchRngRB >>= 2;
......@@ -2316,9 +2312,7 @@ Distortion InterSearch::xGetTemplateCost( const PredictionUnit& pu,
const Picture* picRef = pu.cu->slice->getRefPic( eRefPicList, iRefIdx );
cMvCand.changePrecision(MV_PRECISION_QUARTER, MV_PRECISION_INTERNAL);
clipMv( cMvCand, pu.cu->lumaPos(),
#if JVET_L0231_WRAPAROUND
pu.cu->lumaSize(),
#endif
*pu.cs->sps );
......@@ -2537,23 +2531,17 @@ void InterSearch::xSetSearchRange ( const PredictionUnit& pu,
Mv cFPMvPred = cMvPred;
cFPMvPred.changePrecision(MV_PRECISION_QUARTER, MV_PRECISION_INTERNAL);
clipMv( cFPMvPred, pu.cu->lumaPos(),
#if JVET_L0231_WRAPAROUND
pu.cu->lumaSize(),
#endif
*pu.cs->sps );
Mv mvTL(cFPMvPred.getHor() - (iSrchRng << iMvShift), cFPMvPred.getVer() - (iSrchRng << iMvShift));
Mv mvBR(cFPMvPred.getHor() + (iSrchRng << iMvShift), cFPMvPred.getVer() + (iSrchRng << iMvShift));
clipMv( mvTL, pu.cu->lumaPos(),
#if JVET_L0231_WRAPAROUND
pu.cu->lumaSize(),
#endif
*pu.cs->sps );
clipMv( mvBR, pu.cu->lumaPos(),
#if JVET_L0231_WRAPAROUND
pu.cu->lumaSize(),
#endif
*pu.cs->sps );
mvTL.divideByPowerOf2( iMvShift );
......@@ -2699,9 +2687,7 @@ void InterSearch::xTZSearch( const PredictionUnit& pu,
int iSearchRange = m_iSearchRange;
rcMv.changePrecision(MV_PRECISION_QUARTER, MV_PRECISION_INTERNAL);
clipMv( rcMv, pu.cu->lumaPos(),
#if JVET_L0231_WRAPAROUND
pu.cu->lumaSize(),
#endif
*pu.cs->sps );
rcMv.changePrecision(MV_PRECISION_INTERNAL, MV_PRECISION_QUARTER);
rcMv.divideByPowerOf2(2);
......@@ -2737,9 +2723,7 @@ void InterSearch::xTZSearch( const PredictionUnit& pu,
Mv integerMv2Nx2NPred = *pIntegerMv2Nx2NPred;
integerMv2Nx2NPred.changePrecision(MV_PRECISION_INT, MV_PRECISION_INTERNAL);
clipMv( integerMv2Nx2NPred, pu.cu->lumaPos(),
#if JVET_L0231_WRAPAROUND
pu.cu->lumaSize(),
#endif
*pu.cs->sps );
integerMv2Nx2NPred.changePrecision(MV_PRECISION_INTERNAL, MV_PRECISION_QUARTER);
integerMv2Nx2NPred.divideByPowerOf2(2);
......@@ -2969,9 +2953,7 @@ void InterSearch::xTZSearchSelective( const PredictionUnit& pu,
int iDist = 0;
rcMv.changePrecision(MV_PRECISION_QUARTER, MV_PRECISION_INTERNAL);
clipMv( rcMv, pu.cu->lumaPos(),
#if JVET_L0231_WRAPAROUND
pu.cu->lumaSize(),
#endif
*pu.cs->sps );
rcMv.changePrecision(MV_PRECISION_INTERNAL, MV_PRECISION_QUARTER);
rcMv.divideByPowerOf2(2);
......@@ -3001,9 +2983,7 @@ void InterSearch::xTZSearchSelective( const PredictionUnit& pu,
Mv integerMv2Nx2NPred = *pIntegerMv2Nx2NPred;
integerMv2Nx2NPred.changePrecision(MV_PRECISION_INT, MV_PRECISION_INTERNAL);
clipMv( integerMv2Nx2NPred, pu.cu->lumaPos(),
#if JVET_L0231_WRAPAROUND
pu.cu->lumaSize(),
#endif
*pu.cs->sps );
integerMv2Nx2NPred.changePrecision(MV_PRECISION_INTERNAL, MV_PRECISION_QUARTER);
integerMv2Nx2NPred.divideByPowerOf2(2);
......@@ -3147,9 +3127,7 @@ void InterSearch::xPatternSearchIntRefine(PredictionUnit& pu, IntTZSearchStruct&
Mv cTempMV = cTestMv[iMVPIdx];
cTempMV.changePrecision(MV_PRECISION_QUARTER, MV_PRECISION_INTERNAL);
clipMv(cTempMV, pu.cu->lumaPos(),
#if JVET_L0231_WRAPAROUND
pu.cu->lumaSize(),
#endif
sps);
cTempMV.changePrecision(MV_PRECISION_INTERNAL, MV_PRECISION_QUARTER);
m_cDistParam.cur.buf = cStruct.piRefY + cStruct.iRefStride * (cTempMV.getVer() >> 2) + (cTempMV.getHor() >> 2);
......@@ -3413,9 +3391,7 @@ void InterSearch::xPredAffineInterSearch( PredictionUnit& pu,
roundAffineMv(vx, vy, shift);
mvTmp[0] = Mv(vx, vy);
clipMv(mvTmp[0], pu.cu->lumaPos(),
#if JVET_L0231_WRAPAROUND
pu.cu->lumaSize(),
#endif
*pu.cs->sps);
mvTmp[0].roundToPrecision(MV_PRECISION_INTERNAL, MV_PRECISION_QUARTER);
vx = mvScaleHor + dMvHorX * (pu.Y().x + pu.Y().width - mvInfo->x) + dMvVerX * (pu.Y().y - mvInfo->y);
......@@ -3423,9 +3399,7 @@ void InterSearch::xPredAffineInterSearch( PredictionUnit& pu,
roundAffineMv(vx, vy, shift);
mvTmp[1] = Mv(vx, vy);
clipMv(mvTmp[1], pu.cu->lumaPos(),
#if JVET_L0231_WRAPAROUND
pu.cu->lumaSize(),
#endif
*pu.cs->sps);
mvTmp[1].roundToPrecision(MV_PRECISION_INTERNAL, MV_PRECISION_QUARTER);
mvTmp[0].changePrecision(MV_PRECISION_INTERNAL, MV_PRECISION_QUARTER);
......@@ -4154,21 +4128,15 @@ void InterSearch::xAffineMotionEstimation( PredictionUnit& pu,
// do motion compensation with origin mv
clipMv( acMvTemp[0], pu.cu->lumaPos(),
#if JVET_L0231_WRAPAROUND
pu.cu->lumaSize(),
#endif
*pu.cs->sps );
clipMv( acMvTemp[1], pu.cu->lumaPos(),
#if JVET_L0231_WRAPAROUND
pu.cu->lumaSize(),
#endif
*pu.cs->sps );
if ( pu.cu->affineType == AFFINEMODEL_6PARAM )
{
clipMv( acMvTemp[2], pu.cu->lumaPos(),
#if JVET_L0231_WRAPAROUND
pu.cu->lumaSize(),
#endif
*pu.cs->sps );
}
xPredAffineBlk( COMPONENT_Y, pu, refPic, acMvTemp, predBuf, false, pu.cs->slice->clpRng( COMPONENT_Y ) );
......@@ -4325,9 +4293,7 @@ void InterSearch::xAffineMotionEstimation( PredictionUnit& pu,
acMvTemp[i].ver = Clip3( -32768, 32767, acMvTemp[i].ver );
acMvTemp[i].roundToPrecision(MV_PRECISION_INTERNAL, MV_PRECISION_QUARTER);
clipMv(acMvTemp[i], pu.cu->lumaPos(),
#if JVET_L0231_WRAPAROUND
pu.cu->lumaSize(),
#endif
*pu.cs->sps);
}
xPredAffineBlk( COMPONENT_Y, pu, refPic, acMvTemp, predBuf, false, pu.cu->slice->clpRng( COMPONENT_Y ) );
......
......@@ -798,13 +798,11 @@ void HLSWriter::codeSPS( const SPS* pcSPS )
WRITE_FLAG( pcSPS->getPCMFilterDisableFlag()?1 : 0, "pcm_loop_filter_disable_flag");
}
#if JVET_L0231_WRAPAROUND
WRITE_FLAG( pcSPS->getUseWrapAround() ? 1 : 0, "ref_wraparound_enabled_flag" );
if( pcSPS->getUseWrapAround() )
{
WRITE_UVLC( pcSPS->getWrapAroundOffset(), "ref_wraparound_offset" );
}
#endif
CHECK( pcSPS->getMaxTLayers() == 0, "Maximum number of T-layers is '0'" );
......
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