Commit 9623538e authored by Christian Helmrich's avatar Christian Helmrich

merge, address software coordinator's comments

parents e5c1ab7f d528eb7d
...@@ -843,7 +843,7 @@ void AdaptiveLoopFilter::deriveClassificationBlk(AlfClassifier** classifier, int ...@@ -843,7 +843,7 @@ void AdaptiveLoopFilter::deriveClassificationBlk(AlfClassifier** classifier, int
d0 = sumD0; d0 = sumD0;
dirTempD = 2; dirTempD = 2;
} }
if( d1*hv0 > hv1*d0 ) if( (uint32_t)d1 * (uint32_t)hv0 > (uint32_t)hv1 * (uint32_t)d0 )
{ {
hvd1 = d1; hvd1 = d1;
hvd0 = d0; hvd0 = d0;
......
...@@ -92,10 +92,12 @@ public: ...@@ -92,10 +92,12 @@ public:
void resetPCMBlkClassInfo(CodingStructure & cs, AlfClassifier** classifier, const CPelBuf& srcLuma, const Area& blk); void resetPCMBlkClassInfo(CodingStructure & cs, AlfClassifier** classifier, const CPelBuf& srcLuma, const Area& blk);
template<AlfFilterType filtType> template<AlfFilterType filtType>
static void filterBlk(AlfClassifier** classifier, const PelUnitBuf &recDst, const CPelUnitBuf& recSrc, const Area& blkDst, const Area& blk, const ComponentID compId, short* filterSet, short* fClipSet, const ClpRng& clpRng, CodingStructure& cs, int vbCTUHeight, int vbPos); static void filterBlk(AlfClassifier** classifier, const PelUnitBuf &recDst, const CPelUnitBuf& recSrc, const Area& blkDst, const Area& blk, const ComponentID compId, short* filterSet, short* fClipSet, const ClpRng& clpRng, CodingStructure& cs, int vbCTUHeight, int vbPos);
#if !JVET_O0216_ALF_COEFF_EG3 || !JVET_O0064_SIMP_ALF_CLIP_CODING
inline static int getMaxGolombIdx( AlfFilterType filterType ) inline static int getMaxGolombIdx( AlfFilterType filterType )
{ {
return filterType == ALF_FILTER_5 ? 2 : 3; return filterType == ALF_FILTER_5 ? 2 : 3;
} }
#endif
void(*m_deriveClassificationBlk)(AlfClassifier** classifier, int** laplacian[NUM_DIRECTIONS], const CPelBuf& srcLuma, const Area& blkDst, const Area& blk, const int shift, int vbCTUHeight, int vbPos); void(*m_deriveClassificationBlk)(AlfClassifier** classifier, int** laplacian[NUM_DIRECTIONS], const CPelBuf& srcLuma, const Area& blkDst, const Area& blk, const int shift, int vbCTUHeight, int vbPos);
......
...@@ -111,7 +111,7 @@ struct AreaBuf : public Size ...@@ -111,7 +111,7 @@ struct AreaBuf : public Size
void copyClip ( const AreaBuf<const T> &src, const ClpRng& clpRng); void copyClip ( const AreaBuf<const T> &src, const ClpRng& clpRng);
void subtract ( const AreaBuf<const T> &other ); void subtract ( const AreaBuf<const T> &other );
#if !JVET_O0105_ICT_HHI #if !JVET_O0105_ICT
void copyAndNegate ( const AreaBuf<const T> &other ); void copyAndNegate ( const AreaBuf<const T> &other );
void subtractAndHalve ( const AreaBuf<const T> &other ); void subtractAndHalve ( const AreaBuf<const T> &other );
#endif #endif
...@@ -359,7 +359,7 @@ void AreaBuf<T>::subtract( const AreaBuf<const T> &other ) ...@@ -359,7 +359,7 @@ void AreaBuf<T>::subtract( const AreaBuf<const T> &other )
#undef SUBS_INC #undef SUBS_INC
} }
#if !JVET_O0105_ICT_HHI #if !JVET_O0105_ICT
template<typename T> template<typename T>
void AreaBuf<T>::copyAndNegate( const AreaBuf<const T> &other ) void AreaBuf<T>::copyAndNegate( const AreaBuf<const T> &other )
{ {
...@@ -928,11 +928,11 @@ private: ...@@ -928,11 +928,11 @@ private:
Pel *m_origin[MAX_NUM_COMPONENT]; Pel *m_origin[MAX_NUM_COMPONENT];
}; };
#if JVET_O0105_ICT_HHI #if JVET_O0105_ICT
struct CompStorage : public PelBuf struct CompStorage : public PelBuf
{ {
CompStorage () { m_memory = nullptr; } CompStorage () { m_memory = nullptr; }
~CompStorage() { delete [] m_memory; } ~CompStorage() { if (valid()) delete [] m_memory; }
void create( const Size& size ) void create( const Size& size )
{ {
...@@ -942,7 +942,7 @@ struct CompStorage : public PelBuf ...@@ -942,7 +942,7 @@ struct CompStorage : public PelBuf
} }
void destroy() void destroy()
{ {
delete [] m_memory; if (valid()) delete [] m_memory;
m_memory = nullptr; m_memory = nullptr;
} }
bool valid() { return m_memory != nullptr; } bool valid() { return m_memory != nullptr; }
......
...@@ -445,6 +445,9 @@ static constexpr int MV_MIN = -(1 << (MV_BITS - 1)); ...@@ -445,6 +445,9 @@ static constexpr int MV_MIN = -(1 << (MV_BITS - 1));
static const int PIC_ANALYZE_CW_BINS = 32; static const int PIC_ANALYZE_CW_BINS = 32;
static const int PIC_CODE_CW_BINS = 16; static const int PIC_CODE_CW_BINS = 16;
#if JVET_O0272_LMCS_SIMP_INVERSE_MAPPING
static const int LMCS_SEG_SIZE = (PIC_CODE_CW_BINS << 1);
#endif
static const int FP_PREC = 11; static const int FP_PREC = 11;
static const int CSCALE_FP_PREC = 11; static const int CSCALE_FP_PREC = 11;
#if JVET_O1109_UNFIY_CRS #if JVET_O1109_UNFIY_CRS
......
...@@ -784,7 +784,7 @@ const CtxSet ContextSetCfg::IBCFlag = ContextSetCfg::addCtxSet ...@@ -784,7 +784,7 @@ const CtxSet ContextSetCfg::IBCFlag = ContextSetCfg::addCtxSet
const CtxSet ContextSetCfg::JointCbCrFlag = ContextSetCfg::addCtxSet const CtxSet ContextSetCfg::JointCbCrFlag = ContextSetCfg::addCtxSet
({ ({
#if JVET_O0105_ICT_HHI #if JVET_O0105_ICT
{ 156, 156, 156, }, { 156, 156, 156, },
{ 156, 156, 156, }, { 156, 156, 156, },
{ 184, 184, 184, }, { 184, 184, 184, },
......
...@@ -750,15 +750,13 @@ namespace DQIntern ...@@ -750,15 +750,13 @@ namespace DQIntern
{ {
if (enableScalingLists) if (enableScalingLists)
invQScale = piDequantCoef[rasterPos];//scalingfactor*levelScale invQScale = piDequantCoef[rasterPos];//scalingfactor*levelScale
if (shift < 0) if (shift < 0 && (enableScalingLists || scanIdx == lastScanIdx))
{ {
invQScale <<= -shift; invQScale <<= -shift;
shift = 0;
//add = (1 << shift) >> 1;
} }
Intermediate_Int qIdx = ( level << 1 ) + ( level > 0 ? -(state>>1) : (state>>1) ); Intermediate_Int qIdx = ( level << 1 ) + ( level > 0 ? -(state>>1) : (state>>1) );
Intermediate_Int nomTCoeff = ( qIdx * invQScale + add ) >> shift; int64_t nomTCoeff = ((int64_t)qIdx * (int64_t)invQScale + add) >> ((shift < 0) ? 0 : shift);
tCoeff[ rasterPos ] = (TCoeff)Clip3<Intermediate_Int>( minTCoeff, maxTCoeff, nomTCoeff ); tCoeff[rasterPos] = (TCoeff)Clip3<int64_t>(minTCoeff, maxTCoeff, nomTCoeff);
} }
state = ( 32040 >> ((state<<2)+((level&1)<<1)) ) & 3; // the 16-bit value "32040" represent the state transition table state = ( 32040 >> ((state<<2)+((level&1)<<1)) ) & 3; // the 16-bit value "32040" represent the state transition table
} }
...@@ -1615,7 +1613,7 @@ void DepQuant::quant( TransformUnit &tu, const ComponentID &compID, const CCoeff ...@@ -1615,7 +1613,7 @@ void DepQuant::quant( TransformUnit &tu, const ComponentID &compID, const CCoeff
CHECK(scalingListType >= SCALING_LIST_NUM, "Invalid scaling list"); CHECK(scalingListType >= SCALING_LIST_NUM, "Invalid scaling list");
const uint32_t log2TrWidth = g_aucLog2[width]; const uint32_t log2TrWidth = g_aucLog2[width];
const uint32_t log2TrHeight = g_aucLog2[height]; const uint32_t log2TrHeight = g_aucLog2[height];
const bool enableScalingLists = getUseScalingList(width, height, tu.mtsIdx == MTS_SKIP); const bool enableScalingLists = getUseScalingList(width, height, (tu.mtsIdx == MTS_SKIP && isLuma(compID)));
static_cast<DQIntern::DepQuant*>(p)->quant( tu, pSrc, compID, cQP, Quant::m_dLambda, ctx, uiAbsSum, enableScalingLists, Quant::getQuantCoeff(scalingListType, qpRem, log2TrWidth, log2TrHeight) ); static_cast<DQIntern::DepQuant*>(p)->quant( tu, pSrc, compID, cQP, Quant::m_dLambda, ctx, uiAbsSum, enableScalingLists, Quant::getQuantCoeff(scalingListType, qpRem, log2TrWidth, log2TrHeight) );
} }
else else
...@@ -1639,7 +1637,7 @@ void DepQuant::dequant( const TransformUnit &tu, CoeffBuf &dstCoeff, const Compo ...@@ -1639,7 +1637,7 @@ void DepQuant::dequant( const TransformUnit &tu, CoeffBuf &dstCoeff, const Compo
const uint32_t log2TrWidth = g_aucLog2[width]; const uint32_t log2TrWidth = g_aucLog2[width];
const uint32_t log2TrHeight = g_aucLog2[height]; const uint32_t log2TrHeight = g_aucLog2[height];
const bool enableScalingLists = getUseScalingList(width, height, (tu.mtsIdx == MTS_SKIP)); const bool enableScalingLists = getUseScalingList(width, height, (tu.mtsIdx == MTS_SKIP && isLuma(compID)));
static_cast<DQIntern::DepQuant*>(p)->dequant( tu, dstCoeff, compID, cQP, enableScalingLists, Quant::getDequantCoeff(scalingListType, qpRem, log2TrWidth, log2TrHeight) ); static_cast<DQIntern::DepQuant*>(p)->dequant( tu, dstCoeff, compID, cQP, enableScalingLists, Quant::getDequantCoeff(scalingListType, qpRem, log2TrWidth, log2TrHeight) );
} }
else else
......
...@@ -578,11 +578,7 @@ void InterPrediction::xPredInterBi(PredictionUnit& pu, PelUnitBuf &pcYuvPred) ...@@ -578,11 +578,7 @@ void InterPrediction::xPredInterBi(PredictionUnit& pu, PelUnitBuf &pcYuvPred)
} }
else else
{ {
#if JVET_O0055_INT_DMVR_DIS_BDOF
xWeightedAverage( pu, srcPred0, srcPred1, pcYuvPred, slice.getSPS()->getBitDepths(), slice.clpRngs(), (bioApplied ? 1 : 0));
#else
xWeightedAverage( pu, srcPred0, srcPred1, pcYuvPred, slice.getSPS()->getBitDepths(), slice.clpRngs(), bioApplied ); xWeightedAverage( pu, srcPred0, srcPred1, pcYuvPred, slice.getSPS()->getBitDepths(), slice.clpRngs(), bioApplied );
#endif
} }
} }
} }
...@@ -1121,11 +1117,7 @@ void InterPrediction::xCalcBlkGradient(int sx, int sy, int *arraysGx2, int ...@@ -1121,11 +1117,7 @@ void InterPrediction::xCalcBlkGradient(int sx, int sy, int *arraysGx2, int
g_pelBufOP.calcBlkGradient(sx, sy, arraysGx2, arraysGxGy, arraysGxdI, arraysGy2, arraysGydI, sGx2, sGy2, sGxGy, sGxdI, sGydI, width, height, unitSize); g_pelBufOP.calcBlkGradient(sx, sy, arraysGx2, arraysGxGy, arraysGxdI, arraysGy2, arraysGydI, sGx2, sGy2, sGxGy, sGxdI, sGydI, width, height, unitSize);
} }
#if JVET_O0055_INT_DMVR_DIS_BDOF
void InterPrediction::xWeightedAverage(const PredictionUnit& pu, const CPelUnitBuf& pcYuvSrc0, const CPelUnitBuf& pcYuvSrc1, PelUnitBuf& pcYuvDst, const BitDepths& clipBitDepths, const ClpRngs& clpRngs, const int& bioApplied )
#else
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 )
#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];
...@@ -1138,11 +1130,7 @@ void InterPrediction::xWeightedAverage(const PredictionUnit& pu, const CPelUnitB ...@@ -1138,11 +1130,7 @@ void InterPrediction::xWeightedAverage(const PredictionUnit& pu, const CPelUnitB
pcYuvDst.addWeightedAvg(pcYuvSrc0, pcYuvSrc1, clpRngs, pu.cu->GBiIdx); pcYuvDst.addWeightedAvg(pcYuvSrc0, pcYuvSrc1, clpRngs, pu.cu->GBiIdx);
return; return;
} }
#if JVET_O0055_INT_DMVR_DIS_BDOF
if (bioApplied > 0)
#else
if (bioApplied) if (bioApplied)
#endif
{ {
const int src0Stride = pu.lwidth() + 2 * BIO_EXTEND_SIZE + 2; const int src0Stride = pu.lwidth() + 2 * BIO_EXTEND_SIZE + 2;
const int src1Stride = pu.lwidth() + 2 * BIO_EXTEND_SIZE + 2; const int src1Stride = pu.lwidth() + 2 * BIO_EXTEND_SIZE + 2;
...@@ -1849,7 +1837,7 @@ void InterPrediction::xProcessDMVR(PredictionUnit& pu, PelUnitBuf &pcYuvDst, con ...@@ -1849,7 +1837,7 @@ void InterPrediction::xProcessDMVR(PredictionUnit& pu, PelUnitBuf &pcYuvDst, con
#if JVET_O0055_INT_DMVR_DIS_BDOF #if JVET_O0055_INT_DMVR_DIS_BDOF
int bioEnabledThres = 8 * (dy >> 1) * dx; int bioEnabledThres = 8 * (dy >> 1) * dx;
int bioAppliedType[64]; bool bioAppliedType[MAX_NUM_SUBCU_DMVR];
#endif #endif
{ {
int num = 0; int num = 0;
...@@ -1909,7 +1897,7 @@ void InterPrediction::xProcessDMVR(PredictionUnit& pu, PelUnitBuf &pcYuvDst, con ...@@ -1909,7 +1897,7 @@ void InterPrediction::xProcessDMVR(PredictionUnit& pu, PelUnitBuf &pcYuvDst, con
} }
#if JVET_O0055_INT_DMVR_DIS_BDOF #if JVET_O0055_INT_DMVR_DIS_BDOF
bioAppliedType[num] = (minCost < bioEnabledThres) ? 0 : (bioApplied ? 2 : 0); bioAppliedType[num] = (minCost < bioEnabledThres) ? false : bioApplied;
#endif #endif
totalDeltaMV[0] = (totalDeltaMV[0] << mvShift); totalDeltaMV[0] = (totalDeltaMV[0] << mvShift);
totalDeltaMV[1] = (totalDeltaMV[1] << mvShift); totalDeltaMV[1] = (totalDeltaMV[1] << mvShift);
...@@ -1956,7 +1944,7 @@ void InterPrediction::xProcessDMVR(PredictionUnit& pu, PelUnitBuf &pcYuvDst, con ...@@ -1956,7 +1944,7 @@ void InterPrediction::xProcessDMVR(PredictionUnit& pu, PelUnitBuf &pcYuvDst, con
m_cYuvRefBuffSubCuDMVRL0 = m_cYuvRefBuffDMVRL0.subBuf(UnitAreaRelative(pu, subPu)); m_cYuvRefBuffSubCuDMVRL0 = m_cYuvRefBuffDMVRL0.subBuf(UnitAreaRelative(pu, subPu));
m_cYuvRefBuffSubCuDMVRL1 = m_cYuvRefBuffDMVRL1.subBuf(UnitAreaRelative(pu, subPu)); m_cYuvRefBuffSubCuDMVRL1 = m_cYuvRefBuffDMVRL1.subBuf(UnitAreaRelative(pu, subPu));
#if JVET_O0055_INT_DMVR_DIS_BDOF #if JVET_O0055_INT_DMVR_DIS_BDOF
xFinalPaddedMCForDMVR(subPu, srcPred0, srcPred1, m_cYuvRefBuffSubCuDMVRL0, m_cYuvRefBuffSubCuDMVRL1, (bioAppliedType[num] > 0 ? true : false), mergeMv); xFinalPaddedMCForDMVR(subPu, srcPred0, srcPred1, m_cYuvRefBuffSubCuDMVRL0, m_cYuvRefBuffSubCuDMVRL1, bioAppliedType[num], mergeMv);
#else #else
xFinalPaddedMCForDMVR(subPu, srcPred0, srcPred1, m_cYuvRefBuffSubCuDMVRL0, m_cYuvRefBuffSubCuDMVRL1, bioApplied, mergeMv); xFinalPaddedMCForDMVR(subPu, srcPred0, srcPred1, m_cYuvRefBuffSubCuDMVRL0, m_cYuvRefBuffSubCuDMVRL1, bioApplied, mergeMv);
#endif #endif
......
...@@ -136,11 +136,7 @@ protected: ...@@ -136,11 +136,7 @@ protected:
void xBioGradFilter (Pel* pSrc, int srcStride, int width, int height, int gradStride, Pel* gradX, Pel* gradY, int bitDepth); void xBioGradFilter (Pel* pSrc, int srcStride, int width, int height, int gradStride, Pel* gradX, Pel* gradY, int bitDepth);
void xCalcBIOPar (const Pel* srcY0Temp, const Pel* srcY1Temp, const Pel* gradX0, const Pel* gradX1, const Pel* gradY0, const Pel* gradY1, int* dotProductTemp1, int* dotProductTemp2, int* dotProductTemp3, int* dotProductTemp5, int* dotProductTemp6, const int src0Stride, const int src1Stride, const int gradStride, const int widthG, const int heightG, int bitDepth); void xCalcBIOPar (const Pel* srcY0Temp, const Pel* srcY1Temp, const Pel* gradX0, const Pel* gradX1, const Pel* gradY0, const Pel* gradY1, int* dotProductTemp1, int* dotProductTemp2, int* dotProductTemp3, int* dotProductTemp5, int* dotProductTemp6, const int src0Stride, const int src1Stride, const int gradStride, const int widthG, const int heightG, int bitDepth);
void xCalcBlkGradient (int sx, int sy, int *arraysGx2, int *arraysGxGy, int *arraysGxdI, int *arraysGy2, int *arraysGydI, int &sGx2, int &sGy2, int &sGxGy, int &sGxdI, int &sGydI, int width, int height, int unitSize); void xCalcBlkGradient (int sx, int sy, int *arraysGx2, int *arraysGxGy, int *arraysGxdI, int *arraysGy2, int *arraysGydI, int &sGx2, int &sGy2, int &sGxGy, int &sGxdI, int &sGydI, int width, int height, int unitSize);
#if JVET_O0055_INT_DMVR_DIS_BDOF void xWeightedAverage ( const PredictionUnit& pu, const CPelUnitBuf& pcYuvSrc0, const CPelUnitBuf& pcYuvSrc1, PelUnitBuf& pcYuvDst, const BitDepths& clipBitDepths, const ClpRngs& clpRngs, const bool& bioApplied );
void xWeightedAverage ( const PredictionUnit& pu, const CPelUnitBuf& pcYuvSrc0, const CPelUnitBuf& pcYuvSrc1, PelUnitBuf& pcYuvDst, const BitDepths& clipBitDepths, const ClpRngs& clpRngs, const int& bioApplied );
#else
void xWeightedAverage ( const PredictionUnit& pu, const CPelUnitBuf& pcYuvSrc0, const CPelUnitBuf& pcYuvSrc1, PelUnitBuf& pcYuvDst, const BitDepths& clipBitDepths, const ClpRngs& clpRngs, const bool& bioApplied );
#endif
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 );
void xWeightedTriangleBlk ( const PredictionUnit &pu, const uint32_t width, const uint32_t height, const ComponentID compIdx, const bool splitDir, PelUnitBuf& predDst, PelUnitBuf& predSrc0, PelUnitBuf& predSrc1 ); void xWeightedTriangleBlk ( const PredictionUnit &pu, const uint32_t width, const uint32_t height, const ComponentID compIdx, const bool splitDir, PelUnitBuf& predDst, PelUnitBuf& predSrc0, PelUnitBuf& predSrc1 );
......
...@@ -58,9 +58,15 @@ ...@@ -58,9 +58,15 @@
const uint8_t IntraPrediction::m_aucIntraFilter[MAX_NUM_CHANNEL_TYPE][MAX_INTRA_FILTER_DEPTHS] = const uint8_t IntraPrediction::m_aucIntraFilter[MAX_NUM_CHANNEL_TYPE][MAX_INTRA_FILTER_DEPTHS] =
{ {
{ // Luma { // Luma
#if JVET_O0277_INTRA_SMALL_BLOCK_DCTIF
24, // 1xn
24, // 2xn
24, // 4xn
#else
20, // 1xn 20, // 1xn
20, // 2xn 20, // 2xn
20, // 4xn 20, // 4xn
#endif
14, // 8xn 14, // 8xn
2, // 16xn 2, // 16xn
0, // 32xn 0, // 32xn
...@@ -556,14 +562,19 @@ void IntraPrediction::initPredIntraParams(const PredictionUnit & pu, const CompA ...@@ -556,14 +562,19 @@ void IntraPrediction::initPredIntraParams(const PredictionUnit & pu, const CompA
else if (!useISP)// HOR, VER and angular modes (MDIS) else if (!useISP)// HOR, VER and angular modes (MDIS)
{ {
bool filterFlag = false; bool filterFlag = false;
#if !JVET_O0277_INTRA_SMALL_BLOCK_DCTIF
if (predMode != dirMode ) // wide-anlge mode if (predMode != dirMode ) // wide-anlge mode
{ {
filterFlag = true; filterFlag = true;
} }
else else
#endif
{ {
#if JVET_O0277_INTRA_SMALL_BLOCK_DCTIF
const int diff = std::min<int>( abs( predMode - HOR_IDX ), abs( predMode - VER_IDX ) );
#else
const int diff = std::min<int>( abs( dirMode - HOR_IDX ), abs( dirMode - VER_IDX ) ); const int diff = std::min<int>( abs( dirMode - HOR_IDX ), abs( dirMode - VER_IDX ) );
#endif
const int log2Size = ((g_aucLog2[puSize.width] + g_aucLog2[puSize.height]) >> 1); const int log2Size = ((g_aucLog2[puSize.width] + g_aucLog2[puSize.height]) >> 1);
CHECK( log2Size >= MAX_INTRA_FILTER_DEPTHS, "Size not supported" ); CHECK( log2Size >= MAX_INTRA_FILTER_DEPTHS, "Size not supported" );
filterFlag = (diff > m_aucIntraFilter[chType][log2Size]); filterFlag = (diff > m_aucIntraFilter[chType][log2Size]);
...@@ -573,7 +584,12 @@ void IntraPrediction::initPredIntraParams(const PredictionUnit & pu, const CompA ...@@ -573,7 +584,12 @@ void IntraPrediction::initPredIntraParams(const PredictionUnit & pu, const CompA
if (filterFlag) if (filterFlag)
{ {
const bool isRefFilter = isIntegerSlope(absAng); const bool isRefFilter = isIntegerSlope(absAng);
#if JVET_O0277_INTRA_SMALL_BLOCK_DCTIF
CHECK( puSize.width * puSize.height <= 32, "DCT-IF interpolation filter is always used for 4x4, 4x8, and 8x4 luma CB" );
m_ipaParam.refFilterFlag = isRefFilter;
#else
m_ipaParam.refFilterFlag = isRefFilter && puSize.width * puSize.height > 32; m_ipaParam.refFilterFlag = isRefFilter && puSize.width * puSize.height > 32;
#endif
m_ipaParam.interpolationFlag = !isRefFilter; m_ipaParam.interpolationFlag = !isRefFilter;
} }
} }
......
...@@ -667,7 +667,7 @@ unsigned LoopFilter::xGetBoundaryStrengthSingle ( const CodingUnit& cu, const De ...@@ -667,7 +667,7 @@ unsigned LoopFilter::xGetBoundaryStrengthSingle ( const CodingUnit& cu, const De
tmpBs += BsSet(1, COMPONENT_Y); tmpBs += BsSet(1, COMPONENT_Y);
} }
// U // U
#if JVET_O0105_ICT_HHI #if JVET_O0105_ICT
if (m_aapucBS[edgeDir][rasterIdx] && (TU::getCbf(tuQ, COMPONENT_Cb) || TU::getCbf(tuP, COMPONENT_Cb) || tuQ.jointCbCr || tuP.jointCbCr)) if (m_aapucBS[edgeDir][rasterIdx] && (TU::getCbf(tuQ, COMPONENT_Cb) || TU::getCbf(tuP, COMPONENT_Cb) || tuQ.jointCbCr || tuP.jointCbCr))
#else #else
if (m_aapucBS[edgeDir][rasterIdx] && (TU::getCbf(tuQ, COMPONENT_Cb) || TU::getCbf(tuP, COMPONENT_Cb))) if (m_aapucBS[edgeDir][rasterIdx] && (TU::getCbf(tuQ, COMPONENT_Cb) || TU::getCbf(tuP, COMPONENT_Cb)))
...@@ -676,7 +676,7 @@ unsigned LoopFilter::xGetBoundaryStrengthSingle ( const CodingUnit& cu, const De ...@@ -676,7 +676,7 @@ unsigned LoopFilter::xGetBoundaryStrengthSingle ( const CodingUnit& cu, const De
tmpBs += BsSet(1, COMPONENT_Cb); tmpBs += BsSet(1, COMPONENT_Cb);
} }
// V // V
#if JVET_O0105_ICT_HHI #if JVET_O0105_ICT
if (m_aapucBS[edgeDir][rasterIdx] && (TU::getCbf(tuQ, COMPONENT_Cr) || TU::getCbf(tuP, COMPONENT_Cr) || tuQ.jointCbCr || tuP.jointCbCr)) if (m_aapucBS[edgeDir][rasterIdx] && (TU::getCbf(tuQ, COMPONENT_Cr) || TU::getCbf(tuP, COMPONENT_Cr) || tuQ.jointCbCr || tuP.jointCbCr))
#else #else
if (m_aapucBS[edgeDir][rasterIdx] && (TU::getCbf(tuQ, COMPONENT_Cr) || TU::getCbf(tuP, COMPONENT_Cr))) if (m_aapucBS[edgeDir][rasterIdx] && (TU::getCbf(tuQ, COMPONENT_Cr) || TU::getCbf(tuP, COMPONENT_Cr)))
...@@ -1214,18 +1214,33 @@ void LoopFilter::xEdgeFilterChroma(const CodingUnit& cu, const DeblockEdgeDir ed ...@@ -1214,18 +1214,33 @@ void LoopFilter::xEdgeFilterChroma(const CodingUnit& cu, const DeblockEdgeDir ed
const int dp0 = xCalcDP(piTmpSrcChroma + iSrcStep*(iIdx*uiLoopLength + 0), iOffset); const int dp0 = xCalcDP(piTmpSrcChroma + iSrcStep*(iIdx*uiLoopLength + 0), iOffset);
const int dq0 = xCalcDQ(piTmpSrcChroma + iSrcStep*(iIdx*uiLoopLength + 0), iOffset); const int dq0 = xCalcDQ(piTmpSrcChroma + iSrcStep*(iIdx*uiLoopLength + 0), iOffset);
#if JVET_O0637_CHROMA_GRADIENT_LINE_SELECTION
const int subSamplingShift = ( edgeDir == EDGE_VER ) ? m_shiftVer : m_shiftHor;
const int dp3 = ( subSamplingShift == 1 ) ? xCalcDP(piTmpSrcChroma + iSrcStep*(iIdx*uiLoopLength + 1), iOffset) : xCalcDP(piTmpSrcChroma + iSrcStep*(iIdx*uiLoopLength + 3), iOffset);
const int dq3 = ( subSamplingShift == 1 ) ? xCalcDQ(piTmpSrcChroma + iSrcStep*(iIdx*uiLoopLength + 1), iOffset) : xCalcDQ(piTmpSrcChroma + iSrcStep*(iIdx*uiLoopLength + 3), iOffset);
#else
const int dp1 = xCalcDP(piTmpSrcChroma + iSrcStep*(iIdx*uiLoopLength + 1), iOffset); const int dp1 = xCalcDP(piTmpSrcChroma + iSrcStep*(iIdx*uiLoopLength + 1), iOffset);
const int dq1 = xCalcDQ(piTmpSrcChroma + iSrcStep*(iIdx*uiLoopLength + 1), iOffset); const int dq1 = xCalcDQ(piTmpSrcChroma + iSrcStep*(iIdx*uiLoopLength + 1), iOffset);
#endif
const int d0 = dp0 + dq0; const int d0 = dp0 + dq0;
#if JVET_O0637_CHROMA_GRADIENT_LINE_SELECTION
const int d3 = dp3 + dq3;
const int d = d0 + d3;
#else
const int d1 = dp1 + dq1; const int d1 = dp1 + dq1;
const int d = d0 + d1; const int d = d0 + d1;
#endif
if (d < beta) if (d < beta)
{ {
useLongFilter = true; useLongFilter = true;
const bool sw = xUseStrongFiltering(piTmpSrcChroma + iSrcStep*(iIdx*uiLoopLength + 0), iOffset, 2 * d0, beta, iTc) const bool sw = xUseStrongFiltering(piTmpSrcChroma + iSrcStep*(iIdx*uiLoopLength + 0), iOffset, 2 * d0, beta, iTc)
#if JVET_O0637_CHROMA_GRADIENT_LINE_SELECTION
&& xUseStrongFiltering(piTmpSrcChroma + iSrcStep*(iIdx*uiLoopLength + ( ( subSamplingShift == 1 ) ? 1 : 3 ) ), iOffset, 2 * d3, beta, iTc);
#else
&& xUseStrongFiltering(piTmpSrcChroma + iSrcStep*(iIdx*uiLoopLength + 1), iOffset, 2 * d1, beta, iTc); && xUseStrongFiltering(piTmpSrcChroma + iSrcStep*(iIdx*uiLoopLength + 1), iOffset, 2 * d1, beta, iTc);
#endif
for (unsigned step = 0; step < uiLoopLength; step++) for (unsigned step = 0; step < uiLoopLength; step++)
{ {
......
...@@ -221,7 +221,9 @@ struct LutMotionCand ...@@ -221,7 +221,9 @@ struct LutMotionCand
{ {
static_vector<MotionInfo, MAX_NUM_HMVP_CANDS> lut; static_vector<MotionInfo, MAX_NUM_HMVP_CANDS> lut;
static_vector<MotionInfo, MAX_NUM_HMVP_CANDS> lutIbc; static_vector<MotionInfo, MAX_NUM_HMVP_CANDS> lutIbc;
#if !JVET_O0078_SINGLE_HMVPLUT
static_vector<MotionInfo, MAX_NUM_HMVP_CANDS> lutShareIbc; static_vector<MotionInfo, MAX_NUM_HMVP_CANDS> lutShareIbc;
#endif
}; };
struct PatentBvCand struct PatentBvCand
{ {
......
...@@ -103,9 +103,8 @@ QpParam::QpParam(const TransformUnit& tu, const ComponentID &compIDX, const int ...@@ -103,9 +103,8 @@ QpParam::QpParam(const TransformUnit& tu, const ComponentID &compIDX, const int
if (isChroma(compID)) if (isChroma(compID))
{ {
#if JVET_O0105_ICT_HHI #if JVET_O0105_ICT
const int absIct = abs( TU::getICTMode(tu) ); const bool useJQP = ( abs(TU::getICTMode(tu)) == 2 );
const bool useJQP = ( absIct == 2 || absIct == 4 );
chromaQpOffset += tu.cs->pps->getQpOffset ( useJQP ? JOINT_CbCr : compID ); chromaQpOffset += tu.cs->pps->getQpOffset ( useJQP ? JOINT_CbCr : compID );
chromaQpOffset += tu.cs->slice->getSliceChromaQpDelta( useJQP ? JOINT_CbCr : compID ); chromaQpOffset += tu.cs->slice->getSliceChromaQpDelta( useJQP ? JOINT_CbCr : compID );
...@@ -407,7 +406,7 @@ void Quant::dequant(const TransformUnit &tu, ...@@ -407,7 +406,7 @@ void Quant::dequant(const TransformUnit &tu,
const uint32_t uiLog2TrWidth = g_aucLog2[uiWidth]; const uint32_t uiLog2TrWidth = g_aucLog2[uiWidth];
const uint32_t uiLog2TrHeight = g_aucLog2[uiHeight]; const uint32_t uiLog2TrHeight = g_aucLog2[uiHeight];
int *piDequantCoef = getDequantCoeff(scalingListType, QP_rem, uiLog2TrWidth - 1, uiLog2TrHeight - 1); int *piDequantCoef = getDequantCoeff(scalingListType, QP_rem, uiLog2TrWidth, uiLog2TrHeight);
if(rightShift > 0) if(rightShift > 0)
{ {
...@@ -921,7 +920,7 @@ void Quant::quant(TransformUnit &tu, const ComponentID &compID, const CCoeffBuf ...@@ -921,7 +920,7 @@ void Quant::quant(TransformUnit &tu, const ComponentID &compID, const CCoeffBuf
const CCoeffBuf &piCoef = pSrc; const CCoeffBuf &piCoef = pSrc;
CoeffBuf piQCoef = tu.getCoeffs(compID); CoeffBuf piQCoef = tu.getCoeffs(compID);
const bool useTransformSkip = tu.mtsIdx==MTS_SKIP; const bool useTransformSkip = tu.mtsIdx==MTS_SKIP && isLuma(compID);
const int maxLog2TrDynamicRange = sps.getMaxLog2TrDynamicRange(toChannelType(compID)); const int maxLog2TrDynamicRange = sps.getMaxLog2TrDynamicRange(toChannelType(compID));
{ {
...@@ -935,7 +934,7 @@ void Quant::quant(TransformUnit &tu, const ComponentID &compID, const CCoeffBuf ...@@ -935,7 +934,7 @@ void Quant::quant(TransformUnit &tu, const ComponentID &compID, const CCoeffBuf
CHECK(scalingListType >= SCALING_LIST_NUM, "Invalid scaling list"); CHECK(scalingListType >= SCALING_LIST_NUM, "Invalid scaling list");
const uint32_t uiLog2TrWidth = g_aucLog2[uiWidth]; const uint32_t uiLog2TrWidth = g_aucLog2[uiWidth];
const uint32_t uiLog2TrHeight = g_aucLog2[uiHeight]; const uint32_t uiLog2TrHeight = g_aucLog2[uiHeight];
int *piQuantCoeff = getQuantCoeff(scalingListType, cQP.rem, uiLog2TrWidth-1, uiLog2TrHeight-1); int *piQuantCoeff = getQuantCoeff(scalingListType, cQP.rem, uiLog2TrWidth, uiLog2TrHeight);
const bool enableScalingLists = getUseScalingList(uiWidth, uiHeight, useTransformSkip); const bool enableScalingLists = getUseScalingList(uiWidth, uiHeight, useTransformSkip);
...@@ -998,7 +997,7 @@ bool Quant::xNeedRDOQ(TransformUnit &tu, const ComponentID &compID, const CCoeff ...@@ -998,7 +997,7 @@ bool Quant::xNeedRDOQ(TransformUnit &tu, const ComponentID &compID, const CCoeff
const CCoeffBuf piCoef = pSrc; const CCoeffBuf piCoef = pSrc;
const bool useTransformSkip = tu.mtsIdx==MTS_SKIP; const bool useTransformSkip = tu.mtsIdx == MTS_SKIP && isLuma(compID);
const int maxLog2TrDynamicRange = sps.getMaxLog2TrDynamicRange(toChannelType(compID)); const int maxLog2TrDynamicRange = sps.getMaxLog2TrDynamicRange(toChannelType(compID));
int scalingListType = getScalingListType(tu.cu->predMode, compID); int scalingListType = getScalingListType(tu.cu->predMode, compID);
...@@ -1006,7 +1005,7 @@ bool Quant::xNeedRDOQ(TransformUnit &tu, const ComponentID &compID, const CCoeff ...@@ -1006,7 +1005,7 @@ bool Quant::xNeedRDOQ(TransformUnit &tu, const ComponentID &compID, const CCoeff
const uint32_t uiLog2TrWidth = g_aucLog2[uiWidth]; const uint32_t uiLog2TrWidth = g_aucLog2[uiWidth];
const uint32_t uiLog2TrHeight = g_aucLog2[uiHeight]; const uint32_t uiLog2TrHeight = g_aucLog2[uiHeight];
int *piQuantCoeff = getQuantCoeff(scalingListType, cQP.rem, uiLog2TrWidth-1, uiLog2TrHeight-1); int *piQuantCoeff = getQuantCoeff(scalingListType, cQP.rem, uiLog2TrWidth, uiLog2TrHeight);
const bool enableScalingLists = getUseScalingList(uiWidth, uiHeight, (useTransformSkip != 0)); const bool enableScalingLists = getUseScalingList(uiWidth, uiHeight, (useTransformSkip != 0));
...@@ -1064,7 +1063,7 @@ void Quant::transformSkipQuantOneSample(TransformUnit &tu, const ComponentID &co ...@@ -1064,7 +1063,7 @@ void Quant::transformSkipQuantOneSample(TransformUnit &tu, const ComponentID &co
const uint32_t uiLog2TrWidth = g_aucLog2[uiWidth]; const uint32_t uiLog2TrWidth = g_aucLog2[uiWidth];
const uint32_t uiLog2TrHeight = g_aucLog2[uiHeight]; const uint32_t uiLog2TrHeight = g_aucLog2[uiHeight];
const int *const piQuantCoeff = getQuantCoeff(scalingListType, cQP.rem, uiLog2TrWidth-1, uiLog2TrHeight-1); const int *const piQuantCoeff = getQuantCoeff(scalingListType, cQP.rem, uiLog2TrWidth, uiLog2TrHeight);
/* for 422 chroma blocks, the effective scaling applied during transformation is not a power of 2, hence it cannot be /* for 422 chroma blocks, the effective scaling applied during transformation is not a power of 2, hence it cannot be
* implemented as a bit-shift (the quantised result will be sqrt(2) * larger than required). Alternatively, adjust the * implemented as a bit-shift (the quantised result will be sqrt(2) * larger than required). Alternatively, adjust the
...@@ -1138,7 +1137,7 @@ void Quant::invTrSkipDeQuantOneSample(TransformUnit &tu, const ComponentID &comp ...@@ -1138,7 +1137,7 @@ void Quant::invTrSkipDeQuantOneSample(TransformUnit &tu, const ComponentID &comp
const uint32_t uiLog2TrWidth = g_aucLog2[uiWidth]; const uint32_t uiLog2TrWidth = g_aucLog2[uiWidth];
const uint32_t uiLog2TrHeight = g_aucLog2[uiHeight]; const uint32_t uiLog2TrHeight = g_aucLog2[uiHeight];
int *piDequantCoef = getDequantCoeff(scalingListType,QP_rem,uiLog2TrWidth-1, uiLog2TrHeight-1); int *piDequantCoef = getDequantCoeff(scalingListType, QP_rem, uiLog2TrWidth, uiLog2TrHeight);
if (rightShift > 0) if (rightShift > 0)
{ {
......
...@@ -511,7 +511,7 @@ void QuantRDOQ::quant(TransformUnit &tu, const ComponentID &compID, const CCoeff ...@@ -511,7 +511,7 @@ void QuantRDOQ::quant(TransformUnit &tu, const ComponentID &compID, const CCoeff
const CCoeffBuf &piCoef = pSrc; const CCoeffBuf &piCoef = pSrc;
CoeffBuf piQCoef = tu.getCoeffs(compID); CoeffBuf piQCoef = tu.getCoeffs(compID