Commit 71276ebd authored by Jeeva Raj A's avatar Jeeva Raj A Committed by Jeeva Raj A

review comments incorporated

parent 0d9ccf21
...@@ -877,7 +877,7 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] ) ...@@ -877,7 +877,7 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
("AffineAmvrEncOpt", m_AffineAmvrEncOpt, false, "Enable encoder optimization of affine AMVR") ("AffineAmvrEncOpt", m_AffineAmvrEncOpt, false, "Enable encoder optimization of affine AMVR")
#endif #endif
#if JVET_M0147_DMVR #if JVET_M0147_DMVR
("DMVR", m_DMVR, ("DMVR", m_DMVR, false, "Decoder-side Motion Vector Refinement")
#endif #endif
( "IBC", m_IBCMode, 0u, "IBCMode (0x1:enabled, 0x0:disabled) [default: disabled]") ( "IBC", m_IBCMode, 0u, "IBCMode (0x1:enabled, 0x0:disabled) [default: disabled]")
( "IBCLocalSearchRangeX", m_IBCLocalSearchRangeX, 128u, "Search range of IBC local search in x direction") ( "IBCLocalSearchRangeX", m_IBCLocalSearchRangeX, 128u, "Search range of IBC local search in x direction")
......
...@@ -327,15 +327,15 @@ void copyBufferCore(Pel *src, int srcStride, Pel *dst, int dstStride, int width, ...@@ -327,15 +327,15 @@ void copyBufferCore(Pel *src, int srcStride, Pel *dst, int dstStride, int width,
} }
} }
void paddingCore(Pel *ptr, int iStride, int iWidth, int iHeight, int padSize) void paddingCore(Pel *ptr, int stride, int width, int height, int padSize)
{ {
/*left and right padding*/ /*left and right padding*/
Pel *ptrTemp1 = ptr; Pel *ptrTemp1 = ptr;
Pel *ptrTemp2 = ptr + (iWidth - 1); Pel *ptrTemp2 = ptr + (width - 1);
int offset = 0; int offset = 0;
for (int i = 0; i < iHeight; i++) for (int i = 0; i < height; i++)
{ {
offset = iStride * i; offset = stride * i;
for (int j = 1; j <= padSize; j++) for (int j = 1; j <= padSize; j++)
{ {
*(ptrTemp1 - j + offset) = *(ptrTemp1 + offset); *(ptrTemp1 - j + offset) = *(ptrTemp1 + offset);
...@@ -343,13 +343,13 @@ void paddingCore(Pel *ptr, int iStride, int iWidth, int iHeight, int padSize) ...@@ -343,13 +343,13 @@ void paddingCore(Pel *ptr, int iStride, int iWidth, int iHeight, int padSize)
} }
} }
/*Top and Bottom padding*/ /*Top and Bottom padding*/
int numBytes = (iWidth + padSize + padSize) * sizeof(Pel); int numBytes = (width + padSize + padSize) * sizeof(Pel);
ptrTemp1 = (ptr - padSize); ptrTemp1 = (ptr - padSize);
ptrTemp2 = (ptr + (iStride * (iHeight - 1)) - padSize); ptrTemp2 = (ptr + (stride * (height - 1)) - padSize);
for (int i = 1; i <= padSize; i++) for (int i = 1; i <= padSize; i++)
{ {
memcpy(ptrTemp1 - (i * iStride), (ptrTemp1), numBytes); memcpy(ptrTemp1 - (i * stride), (ptrTemp1), numBytes);
memcpy(ptrTemp2 + (i * iStride), (ptrTemp2), numBytes); memcpy(ptrTemp2 + (i * stride), (ptrTemp2), numBytes);
} }
} }
#endif #endif
......
...@@ -96,7 +96,7 @@ extern PelBufferOps g_pelBufOP; ...@@ -96,7 +96,7 @@ extern PelBufferOps g_pelBufOP;
#if JVET_M0147_DMVR #if JVET_M0147_DMVR
void paddingCore(Pel *ptr, int iStride, int iWidth, int iHeight, int padSize); void paddingCore(Pel *ptr, int stride, int width, int height, int padSize);
void copyBufferCore(Pel *src, int srcStride, Pel *Dst, int dstStride, int width, int height); void copyBufferCore(Pel *src, int srcStride, Pel *Dst, int dstStride, int width, int height);
#endif #endif
......
...@@ -117,7 +117,7 @@ static const double AFFINE_ME_LIST_MVP_TH = 1.0; ...@@ -117,7 +117,7 @@ static const double AFFINE_ME_LIST_MVP_TH = 1.0;
// ==================================================================================================================== // ====================================================================================================================
// Common constants // Common constants
// ==================================================================================================================== // ====================================================================================================================
static const uint64_t MAX_UINT64 = 0xFFFFFFFFFFFFFFFFU;
static const uint32_t MAX_UINT = 0xFFFFFFFFU; ///< max. value of unsigned 32-bit integer static const uint32_t MAX_UINT = 0xFFFFFFFFU; ///< max. value of unsigned 32-bit integer
static const int MAX_INT = 2147483647; ///< max. value of signed 32-bit integer static const int MAX_INT = 2147483647; ///< max. value of signed 32-bit integer
static const uint8_t MAX_UCHAR = 255; static const uint8_t MAX_UCHAR = 255;
......
This diff is collapsed.
...@@ -119,7 +119,7 @@ protected: ...@@ -119,7 +119,7 @@ protected:
SAD_COUNT SAD_COUNT
}; };
Mv m_pSearchOffset[5] = { Mv(0, 1), Mv(0, -1), Mv(1, 0), Mv(-1, 0), Mv(0, 0) }; Mv m_pSearchOffset[5] = { Mv(0, 1), Mv(0, -1), Mv(1, 0), Mv(-1, 0), Mv(0, 0) };
uint64_t m_SADsArray[((DMVR_NUM_ITERATION << 1) + 1) * ((DMVR_NUM_ITERATION << 1) + 1)]; uint64_t m_SADsArray[((2 * DMVR_NUM_ITERATION) + 1) * ((2 * DMVR_NUM_ITERATION) + 1)];
#endif #endif
Pel* m_gradX0; Pel* m_gradX0;
...@@ -210,13 +210,13 @@ public: ...@@ -210,13 +210,13 @@ public:
#endif #endif
#if JVET_M0147_DMVR #if JVET_M0147_DMVR
void xPrefetchPad(PredictionUnit& pu, PelUnitBuf &pcPad, RefPicList refId); void xPrefetchPad(PredictionUnit& pu, PelUnitBuf &pcPad, RefPicList refId);
void xFinalPaddedMCForDMVR(PredictionUnit& pu, PelUnitBuf &pcYuvSrc0, PelUnitBuf &pcYuvSrc1, PelUnitBuf &pcPad0, PelUnitBuf &pcPad1, const bool bBIOApplied void xFinalPaddedMCForDMVR(PredictionUnit& pu, PelUnitBuf &pcYuvSrc0, PelUnitBuf &pcYuvSrc1, PelUnitBuf &pcPad0, PelUnitBuf &pcPad1, const bool bioApplied
, const Mv startMV[NUM_REF_PIC_LIST_01] , const Mv startMV[NUM_REF_PIC_LIST_01]
); );
void xBIPMVRefine(int bd, Pel *pRefL0, Pel *pRefL1, uint64_t& minCost, int16_t *delta_mv, uint64_t *pSADsArray, int width, int height); void xBIPMVRefine(int bd, Pel *pRefL0, Pel *pRefL1, uint64_t& minCost, int16_t *deltaMV, uint64_t *pSADsArray, int width, int height);
uint64_t xDMVRCost(int iBitDepth, Pel* pRef, uint32_t uiRefStride, const Pel* pOrg, uint32_t uiOrgStride, int iWidth, int iHeight); uint64_t xDMVRCost(int bitDepth, Pel* pRef, uint32_t refStride, const Pel* pOrg, uint32_t orgStride, int width, int height);
void xinitMC(PredictionUnit& pu, const ClpRngs &clpRngs); void xinitMC(PredictionUnit& pu, const ClpRngs &clpRngs);
void xProcessDMVR(PredictionUnit& pu, PelUnitBuf &pcYuvDst, const ClpRngs &clpRngs, const bool bBIOApplied ); void xProcessDMVR(PredictionUnit& pu, PelUnitBuf &pcYuvDst, const ClpRngs &clpRngs, const bool bioApplied );
#endif #endif
#if JVET_J0090_MEMORY_BANDWITH_MEASURE #if JVET_J0090_MEMORY_BANDWITH_MEASURE
......
...@@ -66,27 +66,27 @@ class InterpolationFilter ...@@ -66,27 +66,27 @@ class InterpolationFilter
public: public:
template<bool isFirst, bool isLast> template<bool isFirst, bool isLast>
#if JVET_M0147_DMVR #if JVET_M0147_DMVR
static void filterCopy( const ClpRng& clpRng, const Pel *src, int srcStride, Pel *dst, int dstStride, int width, int height, bool biMC10BitOut); static void filterCopy( const ClpRng& clpRng, const Pel *src, int srcStride, Pel *dst, int dstStride, int width, int height, bool biMCForDMVR);
#else #else
static void filterCopy( const ClpRng& clpRng, const Pel *src, int srcStride, Pel *dst, int dstStride, int width, int height ); static void filterCopy( const ClpRng& clpRng, const Pel *src, int srcStride, Pel *dst, int dstStride, int width, int height );
#endif #endif
template<int N, bool isVertical, bool isFirst, bool isLast> template<int N, bool isVertical, bool isFirst, bool isLast>
#if JVET_M0147_DMVR #if JVET_M0147_DMVR
static void filter(const ClpRng& clpRng, Pel const *src, int srcStride, Pel *dst, int dstStride, int width, int height, TFilterCoeff const *coeff, bool biMC10BitOut); static void filter(const ClpRng& clpRng, Pel const *src, int srcStride, Pel *dst, int dstStride, int width, int height, TFilterCoeff const *coeff, bool biMCForDMVR);
#else #else
static void filter(const ClpRng& clpRng, Pel const *src, int srcStride, Pel *dst, int dstStride, int width, int height, TFilterCoeff const *coeff); static void filter(const ClpRng& clpRng, Pel const *src, int srcStride, Pel *dst, int dstStride, int width, int height, TFilterCoeff const *coeff);
#endif #endif
template<int N> template<int N>
#if JVET_M0147_DMVR #if JVET_M0147_DMVR
void filterHor(const ClpRng& clpRng, Pel const* src, int srcStride, Pel *dst, int dstStride, int width, int height, bool isLast, TFilterCoeff const *coeff, bool biMC10BitOut); void filterHor(const ClpRng& clpRng, Pel const* src, int srcStride, Pel *dst, int dstStride, int width, int height, bool isLast, TFilterCoeff const *coeff, bool biMCForDMVR);
#else #else
void filterHor(const ClpRng& clpRng, Pel const* src, int srcStride, Pel *dst, int dstStride, int width, int height, bool isLast, TFilterCoeff const *coeff); void filterHor(const ClpRng& clpRng, Pel const* src, int srcStride, Pel *dst, int dstStride, int width, int height, bool isLast, TFilterCoeff const *coeff);
#endif #endif
template<int N> template<int N>
#if JVET_M0147_DMVR #if JVET_M0147_DMVR
void filterVer(const ClpRng& clpRng, Pel const* src, int srcStride, Pel *dst, int dstStride, int width, int height, bool isFirst, bool isLast, TFilterCoeff const *coeff, bool biMC10BitOut); void filterVer(const ClpRng& clpRng, Pel const* src, int srcStride, Pel *dst, int dstStride, int width, int height, bool isFirst, bool isLast, TFilterCoeff const *coeff, bool biMCForDMVR);
#else #else
void filterVer(const ClpRng& clpRng, Pel const* src, int srcStride, Pel *dst, int dstStride, int width, int height, bool isFirst, bool isLast, TFilterCoeff const *coeff); void filterVer(const ClpRng& clpRng, Pel const* src, int srcStride, Pel *dst, int dstStride, int width, int height, bool isFirst, bool isLast, TFilterCoeff const *coeff);
#endif #endif
...@@ -99,17 +99,17 @@ public: ...@@ -99,17 +99,17 @@ public:
InterpolationFilter(); InterpolationFilter();
~InterpolationFilter() {} ~InterpolationFilter() {}
#if JVET_M0147_DMVR #if JVET_M0147_DMVR
void( *m_filterHor[3][2][2] )( const ClpRng& clpRng, Pel const *src, int srcStride, Pel *dst, int dstStride, int width, int height, TFilterCoeff const *coeff, bool biMC10BitOut); void( *m_filterHor[3][2][2] )( const ClpRng& clpRng, Pel const *src, int srcStride, Pel *dst, int dstStride, int width, int height, TFilterCoeff const *coeff, bool biMCForDMVR);
#else #else
void( *m_filterHor[3][2][2] )( const ClpRng& clpRng, Pel const *src, int srcStride, Pel *dst, int dstStride, int width, int height, TFilterCoeff const *coeff ); void( *m_filterHor[3][2][2] )( const ClpRng& clpRng, Pel const *src, int srcStride, Pel *dst, int dstStride, int width, int height, TFilterCoeff const *coeff );
#endif #endif
#if JVET_M0147_DMVR #if JVET_M0147_DMVR
void( *m_filterVer[3][2][2] )( const ClpRng& clpRng, Pel const *src, int srcStride, Pel *dst, int dstStride, int width, int height, TFilterCoeff const *coeff, bool biMC10BitOut); void( *m_filterVer[3][2][2] )( const ClpRng& clpRng, Pel const *src, int srcStride, Pel *dst, int dstStride, int width, int height, TFilterCoeff const *coeff, bool biMCForDMVR);
#else #else
void( *m_filterVer[3][2][2] )( const ClpRng& clpRng, Pel const *src, int srcStride, Pel *dst, int dstStride, int width, int height, TFilterCoeff const *coeff ); void( *m_filterVer[3][2][2] )( const ClpRng& clpRng, Pel const *src, int srcStride, Pel *dst, int dstStride, int width, int height, TFilterCoeff const *coeff );
#endif #endif
#if JVET_M0147_DMVR #if JVET_M0147_DMVR
void( *m_filterCopy[2][2] ) ( const ClpRng& clpRng, Pel const *src, int srcStride, Pel *dst, int dstStride, int width, int height, bool biMC10BitOut); void( *m_filterCopy[2][2] ) ( const ClpRng& clpRng, Pel const *src, int srcStride, Pel *dst, int dstStride, int width, int height, bool biMCForDMVR);
#else #else
void( *m_filterCopy[2][2] ) ( const ClpRng& clpRng, Pel const *src, int srcStride, Pel *dst, int dstStride, int width, int height ); void( *m_filterCopy[2][2] ) ( const ClpRng& clpRng, Pel const *src, int srcStride, Pel *dst, int dstStride, int width, int height );
#endif #endif
...@@ -121,12 +121,12 @@ public: ...@@ -121,12 +121,12 @@ public:
void _initInterpolationFilterX86(); void _initInterpolationFilterX86();
#endif #endif
#if JVET_M0147_DMVR #if JVET_M0147_DMVR
void filterHor(const ComponentID compID, Pel const* src, int srcStride, Pel *dst, int dstStride, int width, int height, int frac, bool isLast, const ChromaFormat fmt, const ClpRng& clpRng, int nFilterIdx = 0, bool biMC10BitOut = false); void filterHor(const ComponentID compID, Pel const* src, int srcStride, Pel *dst, int dstStride, int width, int height, int frac, bool isLast, const ChromaFormat fmt, const ClpRng& clpRng, int nFilterIdx = 0, bool biMCForDMVR = false);
#else #else
void filterHor(const ComponentID compID, Pel const* src, int srcStride, Pel *dst, int dstStride, int width, int height, int frac, bool isLast, const ChromaFormat fmt, const ClpRng& clpRng, int nFilterIdx = 0); void filterHor(const ComponentID compID, Pel const* src, int srcStride, Pel *dst, int dstStride, int width, int height, int frac, bool isLast, const ChromaFormat fmt, const ClpRng& clpRng, int nFilterIdx = 0);
#endif #endif
#if JVET_M0147_DMVR #if JVET_M0147_DMVR
void filterVer(const ComponentID compID, Pel const* src, int srcStride, Pel *dst, int dstStride, int width, int height, int frac, bool isFirst, bool isLast, const ChromaFormat fmt, const ClpRng& clpRng, int nFilterIdx = 0, bool biMC10BitOut = false); void filterVer(const ComponentID compID, Pel const* src, int srcStride, Pel *dst, int dstStride, int width, int height, int frac, bool isFirst, bool isLast, const ChromaFormat fmt, const ClpRng& clpRng, int nFilterIdx = 0, bool biMCForDMVR = false);
#else #else
void filterVer(const ComponentID compID, Pel const* src, int srcStride, Pel *dst, int dstStride, int width, int height, int frac, bool isFirst, bool isLast, const ChromaFormat fmt, const ClpRng& clpRng, int nFilterIdx = 0); void filterVer(const ComponentID compID, Pel const* src, int srcStride, Pel *dst, int dstStride, int width, int height, int frac, bool isFirst, bool isLast, const ChromaFormat fmt, const ClpRng& clpRng, int nFilterIdx = 0);
#endif #endif
......
...@@ -1810,9 +1810,6 @@ SPSNext::SPSNext( SPS& sps ) ...@@ -1810,9 +1810,6 @@ SPSNext::SPSNext( SPS& sps )
, m_MTTEnabled ( false ) , m_MTTEnabled ( false )
, m_MHIntra ( false ) , m_MHIntra ( false )
, m_Triangle ( false ) , m_Triangle ( false )
#if JVET_M0147_DMVR
, m_DMVR ( false )
#endif
#if ENABLE_WPP_PARALLELISM #if ENABLE_WPP_PARALLELISM
, m_NextDQP ( false ) , m_NextDQP ( false )
#endif #endif
...@@ -1855,6 +1852,9 @@ SPS::SPS() ...@@ -1855,6 +1852,9 @@ SPS::SPS()
#if JVET_M0246_AFFINE_AMVR #if JVET_M0246_AFFINE_AMVR
, m_affineAmvrEnabledFlag ( false ) , m_affineAmvrEnabledFlag ( false )
#endif #endif
#if JVET_M0147_DMVR
, m_DMVR ( false )
#endif
#if HEVC_VPS #if HEVC_VPS
, m_VPSId ( 0) , m_VPSId ( 0)
#endif #endif
......
...@@ -855,9 +855,6 @@ private: ...@@ -855,9 +855,6 @@ private:
bool m_MTTEnabled; // bool m_MTTEnabled; //
bool m_MHIntra; bool m_MHIntra;
bool m_Triangle; bool m_Triangle;
#if JVET_M0147_DMVR
bool m_DMVR;
#endif
#if ENABLE_WPP_PARALLELISM #if ENABLE_WPP_PARALLELISM
bool m_NextDQP; bool m_NextDQP;
#endif #endif
...@@ -899,10 +896,6 @@ public: ...@@ -899,10 +896,6 @@ public:
bool getUseAffine () const { return m_Affine; } bool getUseAffine () const { return m_Affine; }
void setUseAffineType ( bool b ) { m_AffineType = b; } void setUseAffineType ( bool b ) { m_AffineType = b; }
bool getUseAffineType () const { return m_AffineType; } bool getUseAffineType () const { return m_AffineType; }
#if JVET_M0147_DMVR
void setUseDMVR(bool b) { m_DMVR = b; }
bool getUseDMVR() const { return m_DMVR; }
#endif
void setDisableMotCompress ( bool b ) { m_DisableMotionCompression = b; } void setDisableMotCompress ( bool b ) { m_DisableMotionCompression = b; }
bool getDisableMotCompress () const { return m_DisableMotionCompression; } bool getDisableMotCompress () const { return m_DisableMotionCompression; }
bool getMTTEnabled () const { return m_MTTEnabled; } bool getMTTEnabled () const { return m_MTTEnabled; }
...@@ -996,6 +989,9 @@ private: ...@@ -996,6 +989,9 @@ private:
#if JVET_M0246_AFFINE_AMVR #if JVET_M0246_AFFINE_AMVR
bool m_affineAmvrEnabledFlag; bool m_affineAmvrEnabledFlag;
#endif #endif
#if JVET_M0147_DMVR
bool m_DMVR;
#endif
#if HEVC_VPS #if HEVC_VPS
int m_VPSId; int m_VPSId;
#endif #endif
...@@ -1255,7 +1251,10 @@ public: ...@@ -1255,7 +1251,10 @@ public:
bool getDisFracMmvdEnabledFlag() const { return m_disFracMmvdEnabledFlag; } bool getDisFracMmvdEnabledFlag() const { return m_disFracMmvdEnabledFlag; }
void setDisFracMmvdEnabledFlag( bool b ) { m_disFracMmvdEnabledFlag = b; } void setDisFracMmvdEnabledFlag( bool b ) { m_disFracMmvdEnabledFlag = b; }
#endif #endif
#if JVET_M0147_DMVR
bool getUseDMVR()const { return m_DMVR; }
void setUseDMVR(bool b) { m_DMVR = b; }
#endif
uint32_t getMaxTLayers() const { return m_uiMaxTLayers; } uint32_t getMaxTLayers() const { return m_uiMaxTLayers; }
void setMaxTLayers( uint32_t uiMaxTLayers ) { CHECK( uiMaxTLayers > MAX_TLAYER, "Invalid number T-layers" ); m_uiMaxTLayers = uiMaxTLayers; } void setMaxTLayers( uint32_t uiMaxTLayers ) { CHECK( uiMaxTLayers > MAX_TLAYER, "Invalid number T-layers" ); m_uiMaxTLayers = uiMaxTLayers; }
......
...@@ -1461,7 +1461,7 @@ void PU::getInterMergeCandidates( const PredictionUnit &pu, MergeCtx& mrgCtx, ...@@ -1461,7 +1461,7 @@ void PU::getInterMergeCandidates( const PredictionUnit &pu, MergeCtx& mrgCtx,
#if JVET_M0147_DMVR #if JVET_M0147_DMVR
bool PU::checkDMVRCondition(const PredictionUnit& pu) bool PU::checkDMVRCondition(const PredictionUnit& pu)
{ {
if (pu.cs->sps->getSpsNext().getUseDMVR()) if (pu.cs->sps->getUseDMVR())
{ {
return pu.mergeFlag return pu.mergeFlag
&& pu.mergeType == MRG_TYPE_DEFAULT_N && pu.mergeType == MRG_TYPE_DEFAULT_N
...@@ -3878,12 +3878,12 @@ bool PU::isBiPredFromDifferentDirEqDistPoc(const PredictionUnit& pu) ...@@ -3878,12 +3878,12 @@ bool PU::isBiPredFromDifferentDirEqDistPoc(const PredictionUnit& pu)
{ {
if (pu.refIdx[0] >= 0 && pu.refIdx[1] >= 0) if (pu.refIdx[0] >= 0 && pu.refIdx[1] >= 0)
{ {
const int iPOC0 = pu.cu->slice->getRefPOC(REF_PIC_LIST_0, pu.refIdx[0]); const int poc0 = pu.cu->slice->getRefPOC(REF_PIC_LIST_0, pu.refIdx[0]);
const int iPOC1 = pu.cu->slice->getRefPOC(REF_PIC_LIST_1, pu.refIdx[1]); const int poc1 = pu.cu->slice->getRefPOC(REF_PIC_LIST_1, pu.refIdx[1]);
const int iPOC = pu.cu->slice->getPOC(); const int poc = pu.cu->slice->getPOC();
if ((iPOC - iPOC0)*(iPOC - iPOC1) < 0) if ((poc - poc0)*(poc - poc1) < 0)
{ {
if (abs(iPOC - iPOC0) == abs(iPOC - iPOC1)) if (abs(poc - poc0) == abs(poc - poc1))
{ {
return true; return true;
} }
......
...@@ -194,7 +194,7 @@ static void fullPelCopyAVX2( const ClpRng& clpRng, const void*_src, int srcStrid ...@@ -194,7 +194,7 @@ static void fullPelCopyAVX2( const ClpRng& clpRng, const void*_src, int srcStrid
template<X86_VEXT vext, bool isFirst, bool isLast> template<X86_VEXT vext, bool isFirst, bool isLast>
#if JVET_M0147_DMVR #if JVET_M0147_DMVR
static void simdFilterCopy( const ClpRng& clpRng, const Pel* src, int srcStride, int16_t* dst, int dstStride, int width, int height, bool biMC10BitOut) static void simdFilterCopy( const ClpRng& clpRng, const Pel* src, int srcStride, int16_t* dst, int dstStride, int width, int height, bool biMCForDMVR)
#else #else
static void simdFilterCopy( const ClpRng& clpRng, const Pel* src, int srcStride, int16_t* dst, int dstStride, int width, int height ) static void simdFilterCopy( const ClpRng& clpRng, const Pel* src, int srcStride, int16_t* dst, int dstStride, int width, int height )
#endif #endif
...@@ -216,7 +216,7 @@ static void simdFilterCopy( const ClpRng& clpRng, const Pel* src, int srcStride, ...@@ -216,7 +216,7 @@ static void simdFilterCopy( const ClpRng& clpRng, const Pel* src, int srcStride,
#endif #endif
{ //Scalar { //Scalar
#if JVET_M0147_DMVR #if JVET_M0147_DMVR
InterpolationFilter::filterCopy<isFirst, isLast>( clpRng, src, srcStride, dst, dstStride, width, height, biMC10BitOut); InterpolationFilter::filterCopy<isFirst, isLast>( clpRng, src, srcStride, dst, dstStride, width, height, biMCForDMVR);
#else #else
InterpolationFilter::filterCopy<isFirst, isLast>( clpRng, src, srcStride, dst, dstStride, width, height ); InterpolationFilter::filterCopy<isFirst, isLast>( clpRng, src, srcStride, dst, dstStride, width, height );
#endif #endif
...@@ -1031,17 +1031,6 @@ static inline __m128i simdInterpolateLuma10Bit2P4(int16_t const *src, int srcStr ...@@ -1031,17 +1031,6 @@ static inline __m128i simdInterpolateLuma10Bit2P4(int16_t const *src, int srcStr
sumLo = _mm_srai_epi16(_mm_add_epi16(sumLo, mmOffset), shift); sumLo = _mm_srai_epi16(_mm_add_epi16(sumLo, mmOffset), shift);
return sumLo; return sumLo;
} }
// intermediate are not expected to cross 16 bit
#if USE_AVX2
static inline __m256i simdClip3_256(__m256i mmMin, __m256i mmMax, __m256i mmPix)
{
__m256i mmMask = _mm256_cmpgt_epi16(mmPix, mmMin);
mmPix = _mm256_or_si256(_mm256_and_si256(mmMask, mmPix), _mm256_andnot_si256(mmMask, mmMin));
mmMask = _mm256_cmpgt_epi16(mmMax, mmPix);
mmPix = _mm256_or_si256(_mm256_and_si256(mmMask, mmPix), _mm256_andnot_si256(mmMask, mmMax));
return(mmPix);
}
#endif
template<X86_VEXT vext, bool isLast> template<X86_VEXT vext, bool isLast>
static void simdInterpolateN2_10BIT_M4(const int16_t* src, int srcStride, int16_t *dst, int dstStride, int cStride, int width, int height, int shift, int offset, const ClpRng& clpRng, int16_t const *c) static void simdInterpolateN2_10BIT_M4(const int16_t* src, int srcStride, int16_t *dst, int dstStride, int cStride, int width, int height, int shift, int offset, const ClpRng& clpRng, int16_t const *c)
...@@ -1049,16 +1038,14 @@ static void simdInterpolateN2_10BIT_M4(const int16_t* src, int srcStride, int16_ ...@@ -1049,16 +1038,14 @@ static void simdInterpolateN2_10BIT_M4(const int16_t* src, int srcStride, int16_
int row, col; int row, col;
__m128i mmOffset = _mm_set1_epi16(offset); __m128i mmOffset = _mm_set1_epi16(offset);
__m128i mmCoeff[2]; __m128i mmCoeff[2];
__m128i mmMin = _mm_set1_epi16(clpRng.min);
__m128i mmMax = _mm_set1_epi16(clpRng.max);
for (int n = 0; n < 2; n++) for (int n = 0; n < 2; n++)
mmCoeff[n] = _mm_set1_epi16(c[n]); mmCoeff[n] = _mm_set1_epi16(c[n]);
CHECK(isLast, "Not Supported");
#if USE_AVX2 #if USE_AVX2
__m256i mm256Offset = _mm256_set1_epi16(offset); __m256i mm256Offset = _mm256_set1_epi16(offset);
__m256i mm256Coeff[2]; __m256i mm256Coeff[2];
__m256i mm256Min = _mm256_set1_epi16(clpRng.min);
__m256i mm256Max = _mm256_set1_epi16(clpRng.max);
for (int n = 0; n < 2; n++) for (int n = 0; n < 2; n++)
mm256Coeff[n] = _mm256_set1_epi16(c[n]); mm256Coeff[n] = _mm256_set1_epi16(c[n]);
#endif #endif
...@@ -1070,10 +1057,6 @@ static void simdInterpolateN2_10BIT_M4(const int16_t* src, int srcStride, int16_ ...@@ -1070,10 +1057,6 @@ static void simdInterpolateN2_10BIT_M4(const int16_t* src, int srcStride, int16_
for (; col < ((width >> 4) << 4); col += 16) for (; col < ((width >> 4) << 4); col += 16)
{ {
__m256i mmFiltered = simdInterpolateLuma10Bit2P16(src + col, cStride, mm256Coeff, mm256Offset, shift); __m256i mmFiltered = simdInterpolateLuma10Bit2P16(src + col, cStride, mm256Coeff, mm256Offset, shift);
if (isLast)
{
mmFiltered = simdClip3_256(mm256Min, mm256Max, mmFiltered);
}
_mm256_storeu_si256((__m256i *)(dst + col), mmFiltered); _mm256_storeu_si256((__m256i *)(dst + col), mmFiltered);
} }
#endif #endif
...@@ -1081,19 +1064,11 @@ static void simdInterpolateN2_10BIT_M4(const int16_t* src, int srcStride, int16_ ...@@ -1081,19 +1064,11 @@ static void simdInterpolateN2_10BIT_M4(const int16_t* src, int srcStride, int16_
for (; col < ((width >> 3) << 3); col += 8) for (; col < ((width >> 3) << 3); col += 8)
{ {
__m128i mmFiltered = simdInterpolateLuma10Bit2P8(src + col, cStride, mmCoeff, mmOffset, shift); __m128i mmFiltered = simdInterpolateLuma10Bit2P8(src + col, cStride, mmCoeff, mmOffset, shift);
if (isLast)
{
mmFiltered = simdClip3(mmMin, mmMax, mmFiltered);
}
_mm_storeu_si128((__m128i *)(dst + col), mmFiltered); _mm_storeu_si128((__m128i *)(dst + col), mmFiltered);
} }
// last 4 samples // last 4 samples
__m128i mmFiltered = simdInterpolateLuma10Bit2P4(src + col, cStride, mmCoeff, mmOffset, shift); __m128i mmFiltered = simdInterpolateLuma10Bit2P4(src + col, cStride, mmCoeff, mmOffset, shift);
if (isLast)
{
mmFiltered = simdClip3(mmMin, mmMax, mmFiltered);
}
_mm_storel_epi64((__m128i *)(dst + col), mmFiltered); _mm_storel_epi64((__m128i *)(dst + col), mmFiltered);
src += srcStride; src += srcStride;
dst += dstStride; dst += dstStride;
...@@ -1103,7 +1078,7 @@ static void simdInterpolateN2_10BIT_M4(const int16_t* src, int srcStride, int16_ ...@@ -1103,7 +1078,7 @@ static void simdInterpolateN2_10BIT_M4(const int16_t* src, int srcStride, int16_
template<X86_VEXT vext, int N, bool isVertical, bool isFirst, bool isLast> template<X86_VEXT vext, int N, bool isVertical, bool isFirst, bool isLast>
#if JVET_M0147_DMVR #if JVET_M0147_DMVR
static void simdFilter( const ClpRng& clpRng, Pel const *src, int srcStride, Pel *dst, int dstStride, int width, int height, TFilterCoeff const *coeff, bool biMC10BitOut) static void simdFilter( const ClpRng& clpRng, Pel const *src, int srcStride, Pel *dst, int dstStride, int width, int height, TFilterCoeff const *coeff, bool biMCForDMVR)
#else #else
static void simdFilter( const ClpRng& clpRng, Pel const *src, int srcStride, Pel *dst, int dstStride, int width, int height, TFilterCoeff const *coeff ) static void simdFilter( const ClpRng& clpRng, Pel const *src, int srcStride, Pel *dst, int dstStride, int width, int height, TFilterCoeff const *coeff )
#endif #endif
...@@ -1153,7 +1128,7 @@ static void simdFilter( const ClpRng& clpRng, Pel const *src, int srcStride, Pel ...@@ -1153,7 +1128,7 @@ static void simdFilter( const ClpRng& clpRng, Pel const *src, int srcStride, Pel
} }
#if JVET_M0147_DMVR #if JVET_M0147_DMVR
if (biMC10BitOut) if (biMCForDMVR)
{ {
shift = IF_FILTER_PREC_BILINEAR - (IF_INTERNAL_PREC_BILINEAR - clpRng.bd); shift = IF_FILTER_PREC_BILINEAR - (IF_INTERNAL_PREC_BILINEAR - clpRng.bd);
offset = 1 << (shift - 1); offset = 1 << (shift - 1);
...@@ -1208,7 +1183,7 @@ static void simdFilter( const ClpRng& clpRng, Pel const *src, int srcStride, Pel ...@@ -1208,7 +1183,7 @@ static void simdFilter( const ClpRng& clpRng, Pel const *src, int srcStride, Pel
return; return;
} }
#if JVET_M0147_DMVR #if JVET_M0147_DMVR
else if (biMC10BitOut) else if (biMCForDMVR)
{ {
if (N == 2 && !(width & 0x03)) if (N == 2 && !(width & 0x03))
{ {
......
...@@ -829,9 +829,6 @@ void HLSyntaxReader::parseSPSNext( SPSNext& spsNext, const bool usePCM ) ...@@ -829,9 +829,6 @@ void HLSyntaxReader::parseSPSNext( SPSNext& spsNext, const bool usePCM )
READ_FLAG( symbol, "mtt_enabled_flag" ); spsNext.setMTTMode ( symbol ); READ_FLAG( symbol, "mtt_enabled_flag" ); spsNext.setMTTMode ( symbol );
READ_FLAG( symbol, "mhintra_flag" ); spsNext.setUseMHIntra ( symbol != 0 ); READ_FLAG( symbol, "mhintra_flag" ); spsNext.setUseMHIntra ( symbol != 0 );
READ_FLAG( symbol, "triangle_flag" ); spsNext.setUseTriangle ( symbol != 0 ); READ_FLAG( symbol, "triangle_flag" ); spsNext.setUseTriangle ( symbol != 0 );
#if JVET_M0147_DMVR
READ_FLAG(symbol, "dmvr_enable_flag"); spsNext.setUseDMVR (symbol != 0);
#endif
#if ENABLE_WPP_PARALLELISM #if ENABLE_WPP_PARALLELISM
READ_FLAG( symbol, "next_dqp_enabled_flag" ); spsNext.setUseNextDQP ( symbol != 0 ); READ_FLAG( symbol, "next_dqp_enabled_flag" ); spsNext.setUseNextDQP ( symbol != 0 );
#else #else
...@@ -1104,6 +1101,9 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS) ...@@ -1104,6 +1101,9 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
#if JVET_M0246_AFFINE_AMVR #if JVET_M0246_AFFINE_AMVR
READ_FLAG( uiCode, "sps_affine_amvr_enabled_flag" ); pcSPS->setAffineAmvrEnabledFlag ( uiCode != 0 ); READ_FLAG( uiCode, "sps_affine_amvr_enabled_flag" ); pcSPS->setAffineAmvrEnabledFlag ( uiCode != 0 );
#endif #endif
#if JVET_M0147_DMVR
READ_FLAG(uiCode, "dmvr_enable_flag"); pcSPS->setUseDMVR(uiCode != 0);
#endif
#if HEVC_USE_SCALING_LISTS #if HEVC_USE_SCALING_LISTS
READ_FLAG( uiCode, "scaling_list_enabled_flag" ); pcSPS->setScalingListFlag ( uiCode ); READ_FLAG( uiCode, "scaling_list_enabled_flag" ); pcSPS->setScalingListFlag ( uiCode );
if(pcSPS->getScalingListFlag()) if(pcSPS->getScalingListFlag())
......
...@@ -932,7 +932,7 @@ void EncLib::xInitSPS(SPS &sps) ...@@ -932,7 +932,7 @@ void EncLib::xInitSPS(SPS &sps)
sps.setAffineAmvrEnabledFlag ( m_AffineAmvr ); sps.setAffineAmvrEnabledFlag ( m_AffineAmvr );
#endif #endif
#if JVET_M0147_DMVR #if JVET_M0147_DMVR
sps.getSpsNext().setUseDMVR ( m_DMVR ); sps.setUseDMVR ( m_DMVR );
#endif #endif
sps.getSpsNext().setIBCMode ( m_IBCMode ); sps.getSpsNext().setIBCMode ( m_IBCMode );
......
...@@ -570,9 +570,6 @@ void HLSWriter::codeSPSNext( const SPSNext& spsNext, const bool usePCM ) ...@@ -570,9 +570,6 @@ void HLSWriter::codeSPSNext( const SPSNext& spsNext, const bool usePCM )
WRITE_FLAG( spsNext.getMTTEnabled() ? 1 : 0, "mtt_enabled_flag" ); WRITE_FLAG( spsNext.getMTTEnabled() ? 1 : 0, "mtt_enabled_flag" );
WRITE_FLAG( spsNext.getUseMHIntra() ? 1 : 0, "mhintra_flag" ); WRITE_FLAG( spsNext.getUseMHIntra() ? 1 : 0, "mhintra_flag" );
WRITE_FLAG( spsNext.getUseTriangle() ? 1: 0, "triangle_flag" ); WRITE_FLAG( spsNext.getUseTriangle() ? 1: 0, "triangle_flag" );
#if JVET_M0147_DMVR
WRITE_FLAG(spsNext.getUseDMVR() ? 1 : 0, "dmvr_enable_flag");
#endif
#if ENABLE_WPP_PARALLELISM #if ENABLE_WPP_PARALLELISM
WRITE_FLAG( spsNext.getUseNextDQP(), "next_dqp_enabled_flag" ); WRITE_FLAG( spsNext.getUseNextDQP(), "next_dqp_enabled_flag" );
#else #else
...@@ -774,6 +771,9 @@ void HLSWriter::codeSPS( const SPS* pcSPS ) ...@@ -774,6 +771,9 @@ void HLSWriter::codeSPS( const SPS* pcSPS )
#if JVET_M0246_AFFINE_AMVR #if JVET_M0246_AFFINE_AMVR
WRITE_FLAG( pcSPS->getAffineAmvrEnabledFlag() ? 1 : 0, "sps_affine_amvr_enabled_flag" ); WRITE_FLAG( pcSPS->getAffineAmvrEnabledFlag() ? 1 : 0, "sps_affine_amvr_enabled_flag" );
#endif #endif
#if JVET_M0147_DMVR
WRITE_FLAG( pcSPS->getUseDMVR() ? 1 : 0, "dmvr_enable_flag" );
#endif
#if HEVC_USE_SCALING_LISTS #if HEVC_USE_SCALING_LISTS
WRITE_FLAG( pcSPS->getScalingListFlag() ? 1 : 0, "scaling_list_enabled_flag" ); WRITE_FLAG( pcSPS->getScalingListFlag() ? 1 : 0, "scaling_list_enabled_flag" );
if(pcSPS->getScalingListFlag()) if(pcSPS->getScalingListFlag())
......
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