Commit 22661cd3 authored by Frank Bossen's avatar Frank Bossen

JVET-O0364 Part 5: simplify PDPC process for angular modes

parent 76e3aee8
......@@ -514,7 +514,22 @@ void IntraPrediction::initPredIntraParams(const PredictionUnit & pu, const CompA
m_ipaParam.invAngle = invAngTable[absAngMode];
m_ipaParam.intraPredAngle = signAng * absAng;
#if JVET_O0364_PDPC_ANGULAR
if (intraPredAngleMode < 0)
{
m_ipaParam.applyPDPC = false;
}
else if (intraPredAngleMode > 0)
{
const int sideSize = m_ipaParam.isModeVer ? puSize.height : puSize.width;
const int maxScale = 2;
m_ipaParam.angularScale = std::min(maxScale, g_aucLog2[sideSize] - (floorLog2(3 * m_ipaParam.invAngle - 2) - 7));
m_ipaParam.applyPDPC &= m_ipaParam.angularScale >= 0;
}
#else
m_ipaParam.applyPDPC &= m_ipaParam.intraPredAngle == 0 || m_ipaParam.intraPredAngle >= 12; // intra prediction modes: HOR, VER, x, where x>=VDIA-8 or x<=2+8
#endif
}
// high level conditions and DC intra prediction
......@@ -721,6 +736,22 @@ void IntraPrediction::xPredIntraAng( const CPelBuf &pSrc, PelBuf &pDst, const Ch
pDsty[x] = refMain[x + deltaInt + 1];
}
}
#if JVET_O0364_PDPC_ANGULAR
if (m_ipaParam.applyPDPC)
{
const int scale = m_ipaParam.angularScale;
int invAngleSum = 128;
for (int x = 0; x < std::min(3 << scale, width); x++)
{
invAngleSum += invAngle;
int wL = 32 >> (2 * x >> scale);
Pel left = refSide[y + (invAngleSum >> 8) + 1];
pDsty[x] = pDsty[x] + ((wL * (left - pDsty[x]) + 32) >> 6);
}
}
#else
const int scale = ((g_aucLog2[width] - 2 + g_aucLog2[height] - 2 + 2) >> 2);
CHECK(scale < 0 || scale > 31, "PDPC: scale < 0 || scale > 31");
if (m_ipaParam.applyPDPC)
......@@ -765,6 +796,7 @@ void IntraPrediction::xPredIntraAng( const CPelBuf &pSrc, PelBuf &pDst, const Ch
}
}
}
#endif
}
}
......
......@@ -86,6 +86,9 @@ private:
int intraPredAngle;
int invAngle;
bool interpolationFlag;
#if JVET_O0364_PDPC_ANGULAR
int angularScale;
#endif
IntraPredParam() :
refFilterFlag ( false ),
......
......@@ -77,6 +77,7 @@
#define JVET_O0280_SIMD_TRIANGLE_WEIGHTING 1 // JVET-O0280: SIMD implementation for weighted sample prediction process of triangle prediction mode
#define JVET_O0364_PDPC_DC 1 // JVET-O0364 Part 4: align PDPC process for DC with the one for Planar
#define JVET_O0364_PDPC_ANGULAR 1 // JVET-O0364 Part 5: simplify PDPC process for angular modes
#define FIX_DB_MAX_TRANSFORM_SIZE 1
......
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