Commit 4e03071a authored by Alexey Filippov's avatar Alexey Filippov
Browse files

JVET-K0122:

Sampes of a larger side are used to get DC value for non-square blocks
Square blocks processing is HEVC-compliant
parent ab75f17a
......@@ -208,17 +208,35 @@ Pel IntraPrediction::xGetPredValDc( const CPelBuf &pSrc, const Size &dstSize )
Pel pDcVal;
const int width = dstSize.width;
const int height = dstSize.height;
#if JVET_K0122
const int iState = (width == height) ? 0 : ((width > height) ? 1 : -1);
const SizeType iDenom = (width == height) ? (width << 1) : ((width > height) ? width : height);
const Int iDivShift = g_aucLog2[iDenom];
const Int iDivOffset = (iDenom >> 1);
if (iState >= 0) //width is a larger side or a block is square
{
#endif
for( iInd = 0; iInd < width; iInd++ )
{
iSum += pSrc.at( 1 + iInd, 0 );
}
#if JVET_K0122
}
if (iState <= 0) //height is a larger side or a block is square
{
#endif
for( iInd = 0; iInd < height; iInd++ )
{
iSum += pSrc.at( 0, 1 + iInd );
}
#if JVET_K0122
}
pDcVal = (iSum + iDivOffset) >> iDivShift;
#else
pDcVal = ( iSum + ( ( width + height ) >> 1 ) ) / ( width + height );
#endif
return pDcVal;
}
......
......@@ -59,6 +59,9 @@
#define JVET_K0072 1
#define JVET_K0122 1 // CE3-related: Alternative techniques for DC mode without division
// Test 2: Samples are taken only along with a longer side
#define JVET_K0220_ENC_CTRL 1 // remove HM_NO_ADDITIONAL_SPEEDUPS when adopting
#if JVET_K0220_ENC_CTRL
#define REUSE_CU_RESULTS 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