Commit 84a6aa20 authored by Karsten Suehring's avatar Karsten Suehring

remove macro JVET_L0256_BIO

parent 095aed43
...@@ -225,9 +225,7 @@ void EncApp::xInitLibCfg() ...@@ -225,9 +225,7 @@ void EncApp::xInitLibCfg()
#endif #endif
m_cEncLib.setAffine ( m_Affine ); m_cEncLib.setAffine ( m_Affine );
m_cEncLib.setAffineType ( m_AffineType ); m_cEncLib.setAffineType ( m_AffineType );
#if JVET_L0256_BIO
m_cEncLib.setBIO (m_BIO); m_cEncLib.setBIO (m_BIO);
#endif
m_cEncLib.setDisableMotionCompression ( m_DisableMotionCompression ); m_cEncLib.setDisableMotionCompression ( m_DisableMotionCompression );
m_cEncLib.setMTTMode ( m_MTT ); m_cEncLib.setMTTMode ( m_MTT );
m_cEncLib.setUseLMChroma ( m_LMChroma ); m_cEncLib.setUseLMChroma ( m_LMChroma );
......
...@@ -820,9 +820,7 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] ) ...@@ -820,9 +820,7 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
#endif #endif
("Affine", m_Affine, false, "Enable affine prediction (0:off, 1:on) [default: off]") ("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]" ) ("AffineType", m_AffineType, true, "Enable affine type prediction (0:off, 1:on) [default: on]" )
#if JVET_L0256_BIO
("BIO", m_BIO, false, "Enable bi-directional optical flow") ("BIO", m_BIO, false, "Enable bi-directional optical flow")
#endif
("DisableMotCompression", m_DisableMotionCompression, false, "Disable motion data compression for all modes") ("DisableMotCompression", m_DisableMotionCompression, false, "Disable motion data compression for all modes")
("IMV", m_ImvMode, 2, "Adaptive MV precision Mode (IMV)\n" ("IMV", m_ImvMode, 2, "Adaptive MV precision Mode (IMV)\n"
"\t0: disabled IMV\n" "\t0: disabled IMV\n"
...@@ -1929,9 +1927,7 @@ bool EncAppCfg::xCheckParameter() ...@@ -1929,9 +1927,7 @@ bool EncAppCfg::xCheckParameter()
xConfirmPara( m_LMChroma, "LMChroma only allowed with NEXT profile" ); xConfirmPara( m_LMChroma, "LMChroma only allowed with NEXT profile" );
xConfirmPara( m_LargeCTU, "Large CTU is only allowed with NEXT profile" ); xConfirmPara( m_LargeCTU, "Large CTU is only allowed with NEXT profile" );
xConfirmPara( m_SubPuMvpMode != 0, "Sub-PU motion vector prediction is only allowed with NEXT profile" ); xConfirmPara( m_SubPuMvpMode != 0, "Sub-PU motion vector prediction is only allowed with NEXT profile" );
#if JVET_L0256_BIO
xConfirmPara( m_BIO, "BIO only allowed with NEXT profile" ); xConfirmPara( m_BIO, "BIO only allowed with NEXT profile" );
#endif
xConfirmPara( m_DisableMotionCompression, "Disable motion data compression only allowed with NEXT profile" ); xConfirmPara( m_DisableMotionCompression, "Disable motion data compression only allowed with NEXT profile" );
xConfirmPara( m_MTT, "Multi type tree is only allowed with NEXT profile" ); xConfirmPara( m_MTT, "Multi type tree is only allowed with NEXT profile" );
xConfirmPara( m_ImvMode, "IMV is only allowed with NEXT profile" ); xConfirmPara( m_ImvMode, "IMV is only allowed with NEXT profile" );
...@@ -3124,9 +3120,7 @@ void EncAppCfg::xPrintParameter() ...@@ -3124,9 +3120,7 @@ void EncAppCfg::xPrintParameter()
msg( VERBOSE, "DualITree:%d ", m_dualTree ); msg( VERBOSE, "DualITree:%d ", m_dualTree );
msg( VERBOSE, "LargeCTU:%d ", m_LargeCTU ); msg( VERBOSE, "LargeCTU:%d ", m_LargeCTU );
msg( VERBOSE, "IMV:%d ", m_ImvMode ); msg( VERBOSE, "IMV:%d ", m_ImvMode );
#if JVET_L0256_BIO
msg( VERBOSE, "BIO:%d ", m_BIO ); msg( VERBOSE, "BIO:%d ", m_BIO );
#endif
msg( VERBOSE, "DisMDC:%d ", m_DisableMotionCompression ); msg( VERBOSE, "DisMDC:%d ", m_DisableMotionCompression );
msg( VERBOSE, "MTT:%d ", m_MTT ); msg( VERBOSE, "MTT:%d ", m_MTT );
#if ENABLE_WPP_PARALLELISM #if ENABLE_WPP_PARALLELISM
......
...@@ -212,9 +212,7 @@ protected: ...@@ -212,9 +212,7 @@ protected:
#endif #endif
bool m_Affine; bool m_Affine;
bool m_AffineType; bool m_AffineType;
#if JVET_L0256_BIO
bool m_BIO; bool m_BIO;
#endif
bool m_DisableMotionCompression; bool m_DisableMotionCompression;
unsigned m_MTT; unsigned m_MTT;
#if ENABLE_WPP_PARALLELISM #if ENABLE_WPP_PARALLELISM
......
...@@ -62,7 +62,6 @@ void addAvgCore( const T* src1, int src1Stride, const T* src2, int src2Stride, T ...@@ -62,7 +62,6 @@ void addAvgCore( const T* src1, int src1Stride, const T* src2, int src2Stride, T
#undef ADD_AVG_CORE_INC #undef ADD_AVG_CORE_INC
} }
#if JVET_L0256_BIO
void addBIOAvgCore(const Pel* src0, int src0Stride, const Pel* src1, int src1Stride, Pel *dst, int dstStride, const Pel *gradX0, const Pel *gradX1, const Pel *gradY0, const Pel*gradY1, int gradStride, int width, int height, int tmpx, int tmpy, int shift, int offset, const ClpRng& clpRng) void addBIOAvgCore(const Pel* src0, int src0Stride, const Pel* src1, int src1Stride, Pel *dst, int dstStride, const Pel *gradX0, const Pel *gradX1, const Pel *gradY0, const Pel*gradY1, int gradStride, int width, int height, int tmpx, int tmpy, int shift, int offset, const ClpRng& clpRng)
{ {
int b = 0; int b = 0;
...@@ -192,7 +191,6 @@ void calcBlkGradientCore(int sx, int sy, int *arraysGx2, int *arraysGxGy ...@@ -192,7 +191,6 @@ void calcBlkGradientCore(int sx, int sy, int *arraysGx2, int *arraysGxGy
GydI += width; GydI += width;
} }
} }
#endif
#if ENABLE_SIMD_OPT_GBI && JVET_L0646_GBI #if ENABLE_SIMD_OPT_GBI && JVET_L0646_GBI
void removeWeightHighFreq(int16_t* dst, int dstStride, const int16_t* src, int srcStride, int width, int height, int shift, int gbiWeight) void removeWeightHighFreq(int16_t* dst, int dstStride, const int16_t* src, int srcStride, int width, int height, int shift, int gbiWeight)
......
...@@ -306,10 +306,8 @@ static const int MAX_NUM_GT2_BINS_4x4SUBBLOCK = 4; ///< max ...@@ -306,10 +306,8 @@ static const int MAX_NUM_GT2_BINS_4x4SUBBLOCK = 4; ///< max
static const int MAX_NUM_REG_BINS_2x2SUBBLOCK = 8; ///< max number of context-coded bins (incl. gt2 bins) per 2x2 subblock (chroma) static const int MAX_NUM_REG_BINS_2x2SUBBLOCK = 8; ///< max number of context-coded bins (incl. gt2 bins) per 2x2 subblock (chroma)
static const int MAX_NUM_GT2_BINS_2x2SUBBLOCK = 2; ///< max number of gt2 bins per 2x2 subblock (chroma) static const int MAX_NUM_GT2_BINS_2x2SUBBLOCK = 2; ///< max number of gt2 bins per 2x2 subblock (chroma)
#if JVET_L0256_BIO
static const int BIO_EXTEND_SIZE = 1; static const int BIO_EXTEND_SIZE = 1;
static const int BIO_TEMP_BUFFER_SIZE = (MAX_CU_SIZE + 2 * BIO_EXTEND_SIZE) * (MAX_CU_SIZE + 2 * BIO_EXTEND_SIZE); static const int BIO_TEMP_BUFFER_SIZE = (MAX_CU_SIZE + 2 * BIO_EXTEND_SIZE) * (MAX_CU_SIZE + 2 * BIO_EXTEND_SIZE);
#endif
#if JVET_L0646_GBI #if JVET_L0646_GBI
static const int GBI_NUM = 5; ///< the number of weight options static const int GBI_NUM = 5; ///< the number of weight options
...@@ -387,9 +385,7 @@ static const int NTAPS_CHROMA = 4; ///< Numb ...@@ -387,9 +385,7 @@ static const int NTAPS_CHROMA = 4; ///< Numb
static const int MAX_LADF_INTERVALS = 5; /// max number of luma adaptive deblocking filter qp offset intervals static const int MAX_LADF_INTERVALS = 5; /// max number of luma adaptive deblocking filter qp offset intervals
#endif #endif
#if JVET_L0256_BIO
static const int NTAPS_BILINEAR = 2; ///< Number of taps for bilinear filter static const int NTAPS_BILINEAR = 2; ///< Number of taps for bilinear filter
#endif
#if JVET_L0198_L0468_L0104_ATMVP_8x8SUB_BLOCK #if JVET_L0198_L0468_L0104_ATMVP_8x8SUB_BLOCK
static const int ATMVP_SUB_BLOCK_SIZE = 3; ///< sub-block size for ATMVP static const int ATMVP_SUB_BLOCK_SIZE = 3; ///< sub-block size for ATMVP
......
...@@ -56,13 +56,11 @@ InterPrediction::InterPrediction() ...@@ -56,13 +56,11 @@ InterPrediction::InterPrediction()
, m_maxCompIDToPred ( MAX_NUM_COMPONENT ) , m_maxCompIDToPred ( MAX_NUM_COMPONENT )
, m_pcRdCost ( nullptr ) , m_pcRdCost ( nullptr )
, m_storedMv ( nullptr ) , m_storedMv ( nullptr )
#if JVET_L0256_BIO
, m_gradX0(nullptr) , m_gradX0(nullptr)
, m_gradY0(nullptr) , m_gradY0(nullptr)
, m_gradX1(nullptr) , m_gradX1(nullptr)
, m_gradY1(nullptr) , m_gradY1(nullptr)
, m_subPuMC(false) , m_subPuMC(false)
#endif
{ {
for( uint32_t ch = 0; ch < MAX_NUM_COMPONENT; ch++ ) for( uint32_t ch = 0; ch < MAX_NUM_COMPONENT; ch++ )
{ {
...@@ -126,12 +124,10 @@ void InterPrediction::destroy() ...@@ -126,12 +124,10 @@ void InterPrediction::destroy()
m_storedMv = nullptr; m_storedMv = nullptr;
} }
#if JVET_L0256_BIO
xFree(m_gradX0); m_gradX0 = nullptr; xFree(m_gradX0); m_gradX0 = nullptr;
xFree(m_gradY0); m_gradY0 = nullptr; xFree(m_gradY0); m_gradY0 = nullptr;
xFree(m_gradX1); m_gradX1 = nullptr; xFree(m_gradX1); m_gradX1 = nullptr;
xFree(m_gradY1); m_gradY1 = nullptr; xFree(m_gradY1); m_gradY1 = nullptr;
#endif
} }
void InterPrediction::init( RdCost* pcRdCost, ChromaFormat chromaFormatIDC ) void InterPrediction::init( RdCost* pcRdCost, ChromaFormat chromaFormatIDC )
...@@ -150,13 +146,8 @@ void InterPrediction::init( RdCost* pcRdCost, ChromaFormat chromaFormatIDC ) ...@@ -150,13 +146,8 @@ void InterPrediction::init( RdCost* pcRdCost, ChromaFormat chromaFormatIDC )
{ {
for( uint32_t c = 0; c < MAX_NUM_COMPONENT; c++ ) for( uint32_t c = 0; c < MAX_NUM_COMPONENT; c++ )
{ {
#if JVET_L0256_BIO
int extWidth = MAX_CU_SIZE + (2 * BIO_EXTEND_SIZE + 2) + 16; int extWidth = MAX_CU_SIZE + (2 * BIO_EXTEND_SIZE + 2) + 16;
int extHeight = MAX_CU_SIZE + (2 * BIO_EXTEND_SIZE + 2) + 1; int extHeight = MAX_CU_SIZE + (2 * BIO_EXTEND_SIZE + 2) + 1;
#else
int extWidth = MAX_CU_SIZE + 16;
int extHeight = MAX_CU_SIZE + 1;
#endif
for( uint32_t i = 0; i < LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS_SIGNAL; i++ ) for( uint32_t i = 0; i < LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS_SIGNAL; i++ )
{ {
m_filteredBlockTmp[i][c] = ( Pel* ) xMalloc( Pel, ( extWidth + 4 ) * ( extHeight + 7 + 4 ) ); m_filteredBlockTmp[i][c] = ( Pel* ) xMalloc( Pel, ( extWidth + 4 ) * ( extHeight + 7 + 4 ) );
...@@ -178,12 +169,10 @@ void InterPrediction::init( RdCost* pcRdCost, ChromaFormat chromaFormatIDC ) ...@@ -178,12 +169,10 @@ void InterPrediction::init( RdCost* pcRdCost, ChromaFormat chromaFormatIDC )
m_iRefListIdx = -1; m_iRefListIdx = -1;
#if JVET_L0256_BIO
m_gradX0 = (Pel*)xMalloc(Pel, BIO_TEMP_BUFFER_SIZE); m_gradX0 = (Pel*)xMalloc(Pel, BIO_TEMP_BUFFER_SIZE);
m_gradY0 = (Pel*)xMalloc(Pel, BIO_TEMP_BUFFER_SIZE); m_gradY0 = (Pel*)xMalloc(Pel, BIO_TEMP_BUFFER_SIZE);
m_gradX1 = (Pel*)xMalloc(Pel, BIO_TEMP_BUFFER_SIZE); m_gradX1 = (Pel*)xMalloc(Pel, BIO_TEMP_BUFFER_SIZE);
m_gradY1 = (Pel*)xMalloc(Pel, BIO_TEMP_BUFFER_SIZE); m_gradY1 = (Pel*)xMalloc(Pel, BIO_TEMP_BUFFER_SIZE);
#endif
} }
#if !JVET_J0090_MEMORY_BANDWITH_MEASURE #if !JVET_J0090_MEMORY_BANDWITH_MEASURE
...@@ -327,9 +316,7 @@ void InterPrediction::xSubPuMC( PredictionUnit& pu, PelUnitBuf& predBuf, const R ...@@ -327,9 +316,7 @@ void InterPrediction::xSubPuMC( PredictionUnit& pu, PelUnitBuf& predBuf, const R
int fstStep = (!verMC ? puHeight : puWidth); int fstStep = (!verMC ? puHeight : puWidth);
int secStep = (!verMC ? puWidth : puHeight); int secStep = (!verMC ? puWidth : puHeight);
#if JVET_L0256_BIO
m_subPuMC = true; m_subPuMC = true;
#endif
for (int fstDim = fstStart; fstDim < fstEnd; fstDim += fstStep) for (int fstDim = fstStart; fstDim < fstEnd; fstDim += fstStep)
{ {
...@@ -366,9 +353,7 @@ void InterPrediction::xSubPuMC( PredictionUnit& pu, PelUnitBuf& predBuf, const R ...@@ -366,9 +353,7 @@ void InterPrediction::xSubPuMC( PredictionUnit& pu, PelUnitBuf& predBuf, const R
secDim = later - secStep; secDim = later - secStep;
} }
} }
#if JVET_L0256_BIO
m_subPuMC = false; m_subPuMC = false;
#endif
#if JVET_L0369_SUBBLOCK_MERGE #if JVET_L0369_SUBBLOCK_MERGE
pu.cu->affine = isAffine; pu.cu->affine = isAffine;
...@@ -395,14 +380,10 @@ void InterPrediction::xChromaMC(PredictionUnit &pu, PelUnitBuf& pcYuvPred) ...@@ -395,14 +380,10 @@ void InterPrediction::xChromaMC(PredictionUnit &pu, PelUnitBuf& pcYuvPred)
PelUnitBuf subPredBuf = pcYuvPred.subBuf(UnitAreaRelative(pu, subPu)); PelUnitBuf subPredBuf = pcYuvPred.subBuf(UnitAreaRelative(pu, subPu));
xPredInterBlk(COMPONENT_Cb, subPu, refPic, curMi.mv[0], subPredBuf, false, pu.cu->slice->clpRng(COMPONENT_Cb) xPredInterBlk(COMPONENT_Cb, subPu, refPic, curMi.mv[0], subPredBuf, false, pu.cu->slice->clpRng(COMPONENT_Cb)
#if JVET_L0256_BIO
, false , false
#endif
, true); , true);
xPredInterBlk(COMPONENT_Cr, subPu, refPic, curMi.mv[0], subPredBuf, false, pu.cu->slice->clpRng(COMPONENT_Cr) xPredInterBlk(COMPONENT_Cr, subPu, refPic, curMi.mv[0], subPredBuf, false, pu.cu->slice->clpRng(COMPONENT_Cr)
#if JVET_L0256_BIO
, false , false
#endif
, true); , true);
} }
} }
...@@ -411,9 +392,7 @@ void InterPrediction::xChromaMC(PredictionUnit &pu, PelUnitBuf& pcYuvPred) ...@@ -411,9 +392,7 @@ void InterPrediction::xChromaMC(PredictionUnit &pu, PelUnitBuf& pcYuvPred)
void InterPrediction::xPredInterUni(const PredictionUnit& pu, const RefPicList& eRefPicList, PelUnitBuf& pcYuvPred, const bool& bi void InterPrediction::xPredInterUni(const PredictionUnit& pu, const RefPicList& eRefPicList, PelUnitBuf& pcYuvPred, const bool& bi
#if JVET_L0256_BIO
, const bool& bioApplied , const bool& bioApplied
#endif
#if JVET_L0293_CPR #if JVET_L0293_CPR
, const bool luma, const bool chroma , const bool luma, const bool chroma
#endif #endif
...@@ -466,17 +445,13 @@ void InterPrediction::xPredInterUni(const PredictionUnit& pu, const RefPicList& ...@@ -466,17 +445,13 @@ void InterPrediction::xPredInterUni(const PredictionUnit& pu, const RefPicList&
#endif #endif
if ( pu.cu->affine ) if ( pu.cu->affine )
{ {
#if JVET_L0256_BIO
CHECK( bioApplied, "BIO is not allowed with affine" ); CHECK( bioApplied, "BIO is not allowed with affine" );
#endif
xPredAffineBlk( compID, pu, pu.cu->slice->getRefPic( eRefPicList, iRefIdx ), mv, pcYuvPred, bi, pu.cu->slice->clpRng( compID ) ); xPredAffineBlk( compID, pu, pu.cu->slice->getRefPic( eRefPicList, iRefIdx ), mv, pcYuvPred, bi, pu.cu->slice->clpRng( compID ) );
} }
else else
{ {
xPredInterBlk( compID, pu, pu.cu->slice->getRefPic( eRefPicList, iRefIdx ), mv[0], pcYuvPred, bi, pu.cu->slice->clpRng( compID ) xPredInterBlk( compID, pu, pu.cu->slice->getRefPic( eRefPicList, iRefIdx ), mv[0], pcYuvPred, bi, pu.cu->slice->clpRng( compID )
#if JVET_L0256_BIO
, bioApplied , bioApplied
#endif
#if JVET_L0293_CPR #if JVET_L0293_CPR
, isCPR , isCPR
#endif #endif
...@@ -491,7 +466,6 @@ void InterPrediction::xPredInterBi(PredictionUnit& pu, PelUnitBuf &pcYuvPred) ...@@ -491,7 +466,6 @@ void InterPrediction::xPredInterBi(PredictionUnit& pu, PelUnitBuf &pcYuvPred)
const PPS &pps = *pu.cs->pps; const PPS &pps = *pu.cs->pps;
const Slice &slice = *pu.cs->slice; const Slice &slice = *pu.cs->slice;
#if JVET_L0256_BIO
bool bioApplied = false; bool bioApplied = false;
if (pu.cs->sps->getSpsNext().getUseBIO()) if (pu.cs->sps->getSpsNext().getUseBIO())
{ {
...@@ -520,7 +494,6 @@ void InterPrediction::xPredInterBi(PredictionUnit& pu, PelUnitBuf &pcYuvPred) ...@@ -520,7 +494,6 @@ void InterPrediction::xPredInterBi(PredictionUnit& pu, PelUnitBuf &pcYuvPred)
} }
#endif #endif
} }
#endif
for (uint32_t refList = 0; refList < NUM_REF_PIC_LIST_01; refList++) for (uint32_t refList = 0; refList < NUM_REF_PIC_LIST_01; refList++)
{ {
...@@ -541,9 +514,7 @@ void InterPrediction::xPredInterBi(PredictionUnit& pu, PelUnitBuf &pcYuvPred) ...@@ -541,9 +514,7 @@ void InterPrediction::xPredInterBi(PredictionUnit& pu, PelUnitBuf &pcYuvPred)
if (pu.refIdx[0] >= 0 && pu.refIdx[1] >= 0) if (pu.refIdx[0] >= 0 && pu.refIdx[1] >= 0)
{ {
xPredInterUni ( pu, eRefPicList, pcMbBuf, true xPredInterUni ( pu, eRefPicList, pcMbBuf, true
#if JVET_L0256_BIO
, bioApplied , bioApplied
#endif
#if JVET_L0293_CPR #if JVET_L0293_CPR
, true, true , true, true
#endif #endif
...@@ -554,9 +525,7 @@ void InterPrediction::xPredInterBi(PredictionUnit& pu, PelUnitBuf &pcYuvPred) ...@@ -554,9 +525,7 @@ void InterPrediction::xPredInterBi(PredictionUnit& pu, PelUnitBuf &pcYuvPred)
if( ( (pps.getUseWP() && slice.getSliceType() == P_SLICE) || (pps.getWPBiPred() && slice.getSliceType() == B_SLICE) ) ) if( ( (pps.getUseWP() && slice.getSliceType() == P_SLICE) || (pps.getWPBiPred() && slice.getSliceType() == B_SLICE) ) )
{ {
xPredInterUni ( pu, eRefPicList, pcMbBuf, true xPredInterUni ( pu, eRefPicList, pcMbBuf, true
#if JVET_L0256_BIO
, bioApplied , bioApplied
#endif
#if JVET_L0293_CPR #if JVET_L0293_CPR
, true, true , true, true
#endif #endif
...@@ -565,9 +534,7 @@ void InterPrediction::xPredInterBi(PredictionUnit& pu, PelUnitBuf &pcYuvPred) ...@@ -565,9 +534,7 @@ void InterPrediction::xPredInterBi(PredictionUnit& pu, PelUnitBuf &pcYuvPred)
else else
{ {
xPredInterUni( pu, eRefPicList, pcMbBuf, pu.cu->triangle xPredInterUni( pu, eRefPicList, pcMbBuf, pu.cu->triangle
#if JVET_L0256_BIO
, bioApplied , bioApplied
#endif
#if JVET_L0293_CPR #if JVET_L0293_CPR
, true, true , true, true
#endif #endif
...@@ -593,18 +560,12 @@ void InterPrediction::xPredInterBi(PredictionUnit& pu, PelUnitBuf &pcYuvPred) ...@@ -593,18 +560,12 @@ void InterPrediction::xPredInterBi(PredictionUnit& pu, PelUnitBuf &pcYuvPred)
} }
else else
{ {
#if JVET_L0256_BIO
xWeightedAverage( pu, srcPred0, srcPred1, pcYuvPred, slice.getSPS()->getBitDepths(), slice.clpRngs(), bioApplied ); xWeightedAverage( pu, srcPred0, srcPred1, pcYuvPred, slice.getSPS()->getBitDepths(), slice.clpRngs(), bioApplied );
#else
xWeightedAverage( pu, srcPred0, srcPred1, pcYuvPred, slice.getSPS()->getBitDepths(), slice.clpRngs() );
#endif
} }
} }
void InterPrediction::xPredInterBlk ( const ComponentID& compID, const PredictionUnit& pu, const Picture* refPic, const Mv& _mv, PelUnitBuf& dstPic, const bool& bi, const ClpRng& clpRng void InterPrediction::xPredInterBlk ( const ComponentID& compID, const PredictionUnit& pu, const Picture* refPic, const Mv& _mv, PelUnitBuf& dstPic, const bool& bi, const ClpRng& clpRng
#if JVET_L0256_BIO
, const bool& bioApplied , const bool& bioApplied
#endif
#if JVET_L0293_CPR #if JVET_L0293_CPR
, bool isCPR , bool isCPR
#endif #endif
...@@ -637,7 +598,6 @@ void InterPrediction::xPredInterBlk ( const ComponentID& compID, const Predictio ...@@ -637,7 +598,6 @@ void InterPrediction::xPredInterBlk ( const ComponentID& compID, const Predictio
refBuf = refPic->getRecoBuf( CompArea( compID, chFmt, offset, pu.blocks[compID].size() ) ); refBuf = refPic->getRecoBuf( CompArea( compID, chFmt, offset, pu.blocks[compID].size() ) );
} }
#if JVET_L0256_BIO
// backup data // backup data
int backupWidth = width; int backupWidth = width;
int backupHeight = height; int backupHeight = height;
...@@ -653,46 +613,26 @@ void InterPrediction::xPredInterBlk ( const ComponentID& compID, const Predictio ...@@ -653,46 +613,26 @@ void InterPrediction::xPredInterBlk ( const ComponentID& compID, const Predictio
dstBuf.stride = width; dstBuf.stride = width;
dstBuf.buf = m_filteredBlockTmp[2 + m_iRefListIdx][compID] + 2 * dstBuf.stride + 2; dstBuf.buf = m_filteredBlockTmp[2 + m_iRefListIdx][compID] + 2 * dstBuf.stride + 2;
} }
#endif
if( yFrac == 0 ) if( yFrac == 0 )
{ {
#if JVET_L0256_BIO
m_if.filterHor(compID, (Pel*)refBuf.buf, refBuf.stride, dstBuf.buf, dstBuf.stride, backupWidth, backupHeight, xFrac, rndRes, chFmt, clpRng); m_if.filterHor(compID, (Pel*)refBuf.buf, refBuf.stride, dstBuf.buf, dstBuf.stride, backupWidth, backupHeight, xFrac, rndRes, chFmt, clpRng);
#else
m_if.filterHor(compID, (Pel*) refBuf.buf, refBuf.stride, dstBuf.buf, dstBuf.stride, width, height, xFrac, rndRes, chFmt, clpRng);
#endif
} }
else if( xFrac == 0 ) else if( xFrac == 0 )
{ {
#if JVET_L0256_BIO
m_if.filterVer(compID, (Pel*)refBuf.buf, refBuf.stride, dstBuf.buf, dstBuf.stride, backupWidth, backupHeight, yFrac, true, rndRes, chFmt, clpRng); m_if.filterVer(compID, (Pel*)refBuf.buf, refBuf.stride, dstBuf.buf, dstBuf.stride, backupWidth, backupHeight, yFrac, true, rndRes, chFmt, clpRng);
#else
m_if.filterVer(compID, (Pel*) refBuf.buf, refBuf.stride, dstBuf.buf, dstBuf.stride, width, height, yFrac, true, rndRes, chFmt, clpRng);
#endif
} }
else else
{ {
PelBuf tmpBuf = PelBuf(m_filteredBlockTmp[0][compID], pu.blocks[compID]); PelBuf tmpBuf = PelBuf(m_filteredBlockTmp[0][compID], pu.blocks[compID]);
#if JVET_L0256_BIO
tmpBuf.stride = dstBuf.stride; tmpBuf.stride = dstBuf.stride;
#endif
int vFilterSize = isLuma(compID) ? NTAPS_LUMA : NTAPS_CHROMA; int vFilterSize = isLuma(compID) ? NTAPS_LUMA : NTAPS_CHROMA;
#if JVET_L0256_BIO
m_if.filterHor(compID, (Pel*)refBuf.buf - ((vFilterSize >> 1) - 1) * refBuf.stride, refBuf.stride, tmpBuf.buf, tmpBuf.stride, backupWidth, backupHeight + vFilterSize - 1, xFrac, false, chFmt, clpRng); m_if.filterHor(compID, (Pel*)refBuf.buf - ((vFilterSize >> 1) - 1) * refBuf.stride, refBuf.stride, tmpBuf.buf, tmpBuf.stride, backupWidth, backupHeight + vFilterSize - 1, xFrac, false, chFmt, clpRng);
#else
m_if.filterHor(compID, (Pel*) refBuf.buf - ((vFilterSize >> 1) - 1) * refBuf.stride, refBuf.stride, tmpBuf.buf, tmpBuf.stride, width, height + vFilterSize - 1, xFrac, false, chFmt, clpRng);
#endif
JVET_J0090_SET_CACHE_ENABLE( false ); JVET_J0090_SET_CACHE_ENABLE( false );
#if JVET_L0256_BIO
m_if.filterVer(compID, (Pel*)tmpBuf.buf + ((vFilterSize >> 1) - 1) * tmpBuf.stride, tmpBuf.stride, dstBuf.buf, dstBuf.stride, backupWidth, backupHeight, yFrac, false, rndRes, chFmt, clpRng); m_if.filterVer(compID, (Pel*)tmpBuf.buf + ((vFilterSize >> 1) - 1) * tmpBuf.stride, tmpBuf.stride, dstBuf.buf, dstBuf.stride, backupWidth, backupHeight, yFrac, false, rndRes, chFmt, clpRng);
#else
m_if.filterVer(compID, (Pel*) tmpBuf.buf + ((vFilterSize >> 1) - 1) * tmpBuf.stride, tmpBuf.stride, dstBuf.buf, dstBuf.stride, width, height, yFrac, false, rndRes, chFmt, clpRng);
#endif
} }
JVET_J0090_SET_CACHE_ENABLE( true ); JVET_J0090_SET_CACHE_ENABLE( true );
#if JVET_L0256_BIO
if (bioApplied && compID == COMPONENT_Y) if (bioApplied && compID == COMPONENT_Y)
{ {
refBuf.buf = refBuf.buf - refBuf.stride - 1; refBuf.buf = refBuf.buf - refBuf.stride - 1;
...@@ -705,7 +645,6 @@ void InterPrediction::xPredInterBlk ( const ComponentID& compID, const Predictio ...@@ -705,7 +645,6 @@ void InterPrediction::xPredInterBlk ( const ComponentID& compID, const Predictio
dstBuf.buf = backupDstBufPtr; dstBuf.buf = backupDstBufPtr;
dstBuf.stride = backupDstBufStride; dstBuf.stride = backupDstBufStride;
} }
#endif
} }
void InterPrediction::xPredAffineBlk( const ComponentID& compID, const PredictionUnit& pu, const Picture* refPic, const Mv* _mv, PelUnitBuf& dstPic, const bool& bi, const ClpRng& clpRng ) void InterPrediction::xPredAffineBlk( const ComponentID& compID, const PredictionUnit& pu, const Picture* refPic, const Mv* _mv, PelUnitBuf& dstPic, const bool& bi, const ClpRng& clpRng )
...@@ -719,9 +658,7 @@ void InterPrediction::xPredAffineBlk( const ComponentID& compID, const Predictio ...@@ -719,9 +658,7 @@ void InterPrediction::xPredAffineBlk( const ComponentID& compID, const Predictio
pu.cu->lumaSize(), pu.cu->lumaSize(),
*pu.cs->sps ); *pu.cs->sps );
xPredInterBlk( compID, pu, refPic, mvTemp, dstPic, bi, clpRng xPredInterBlk( compID, pu, refPic, mvTemp, dstPic, bi, clpRng
#if JVET_L0256_BIO
, false , false
#endif
#if JVET_L0293_CPR #if JVET_L0293_CPR
, false , false
#endif #endif
...@@ -898,7 +835,6 @@ int getMSB( unsigned x ) ...@@ -898,7 +835,6 @@ int getMSB( unsigned x )
return msb; return msb;
} }
#if JVET_L0256_BIO
void InterPrediction::applyBiOptFlow(const PredictionUnit &pu, const CPelUnitBuf &yuvSrc0, const CPelUnitBuf &yuvSrc1, const int &refIdx0, const int &refIdx1, PelUnitBuf &yuvDst, const BitDepths &clipBitDepths) void InterPrediction::applyBiOptFlow(const PredictionUnit &pu, const CPelUnitBuf &yuvSrc0, const CPelUnitBuf &yuvSrc1, const int &refIdx0, const int &refIdx1, PelUnitBuf &yuvDst, const BitDepths &clipBitDepths)
{ {
const int height = yuvDst.Y().height; const int height = yuvDst.Y().height;
...@@ -1258,13 +1194,8 @@ void InterPrediction::xCalcBlkGradient(int sx, int sy, int *arraysGx2, int ...@@ -1258,13 +1194,8 @@ void InterPrediction::xCalcBlkGradient(int sx, int sy, int *arraysGx2, int
} }
#endif #endif
} }
#endif
#if JVET_L0256_BIO
void InterPrediction::xWeightedAverage(const PredictionUnit& pu, const CPelUnitBuf& pcYuvSrc0, const CPelUnitBuf& pcYuvSrc1, PelUnitBuf& pcYuvDst, const BitDepths& clipBitDepths, const ClpRngs& clpRngs, const bool& bioApplied ) void InterPrediction::xWeightedAverage(const PredictionUnit& pu, const CPelUnitBuf& pcYuvSrc0, const CPelUnitBuf& pcYuvSrc1, PelUnitBuf& pcYuvDst, const BitDepths& clipBitDepths, const ClpRngs& clpRngs, const bool& bioApplied )
#else
void InterPrediction::xWeightedAverage( const PredictionUnit& pu, const CPelUnitBuf& pcYuvSrc0, const CPelUnitBuf& pcYuvSrc1, PelUnitBuf& pcYuvDst, const BitDepths& clipBitDepths, const ClpRngs& clpRngs )
#endif
{ {
const int iRefIdx0 = pu.refIdx[0]; const int iRefIdx0 = pu.refIdx[0];
const int iRefIdx1 = pu.refIdx[1]; const int iRefIdx1 = pu.refIdx[1];
...@@ -1274,14 +1205,11 @@ void InterPrediction::xWeightedAverage( const PredictionUnit& pu, const CPelUnit ...@@ -1274,14 +1205,11 @@ void InterPrediction::xWeightedAverage( const PredictionUnit& pu, const CPelUnit
#if JVET_L0646_GBI #if JVET_L0646_GBI
if( pu.cu->GBiIdx != GBI_DEFAULT ) if( pu.cu->GBiIdx != GBI_DEFAULT )
{ {
#if JVET_L0256_BIO
CHECK(bioApplied, "GBi is disallowed with BIO"); CHECK(bioApplied, "GBi is disallowed with BIO");
#endif
pcYuvDst.addWeightedAvg(pcYuvSrc0, pcYuvSrc1, clpRngs, pu.cu->GBiIdx); pcYuvDst.addWeightedAvg(pcYuvSrc0, pcYuvSrc1, clpRngs, pu.cu->GBiIdx);
return; return;
} }
#endif #endif
#if JVET_L0256_BIO
if (bioApplied) if (bioApplied)
{ {
const int src0Stride = pu.lwidth() + 2 * BIO_EXTEND_SIZE + 2; const int src0Stride = pu.lwidth() + 2 * BIO_EXTEND_SIZE + 2;
...@@ -1300,9 +1228,6 @@ void InterPrediction::xWeightedAverage( const PredictionUnit& pu, const CPelUnit ...@@ -1300,9 +1228,6 @@ void InterPrediction::xWeightedAverage( const PredictionUnit& pu, const CPelUnit
} }
} }
pcYuvDst.addAvg(pcYuvSrc0, pcYuvSrc1, clpRngs, bioApplied); pcYuvDst.addAvg(pcYuvSrc0, pcYuvSrc1, clpRngs, bioApplied);
#else
pcYuvDst.addAvg( pcYuvSrc0, pcYuvSrc1, clpRngs );
#endif
} }
else if( iRefIdx0 >= 0 && iRefIdx1 < 0 ) else if( iRefIdx0 >= 0 && iRefIdx1 < 0 )
{ {
...@@ -1342,9 +1267,7 @@ void InterPrediction::motionCompensation( PredictionUnit &pu, PelUnitBuf &predBu ...@@ -1342,9 +1267,7 @@ void InterPrediction::motionCompensation( PredictionUnit &pu, PelUnitBuf &predBu
else // (luma && !chroma) else // (luma && !chroma)
{ {
xPredInterUni(pu, eRefPicList, predBuf, false xPredInterUni(pu, eRefPicList, predBuf, false
#if JVET_L0256_BIO
, false , false
#endif