Skip to content
Snippets Groups Projects
Commit 0f426088 authored by Kai Zhang's avatar Kai Zhang
Browse files

Commit L0265 (Affine 4x4 chroma subblock)

parent bb866fa9
No related branches found
No related tags found
1 merge request!30JVET-L0265: Affine 4x4 chroma subblock
...@@ -501,6 +501,16 @@ void InterPrediction::xPredAffineBlk( const ComponentID& compID, const Predictio ...@@ -501,6 +501,16 @@ void InterPrediction::xPredAffineBlk( const ComponentID& compID, const Predictio
blockWidth >>= iScaleX; blockWidth >>= iScaleX;
blockHeight >>= iScaleY; blockHeight >>= iScaleY;
#if JVET_L0265_AFF_MINIMUM4X4
blockWidth = std::max(blockWidth, AFFINE_MIN_BLOCK_SIZE);
blockHeight = std::max(blockHeight, AFFINE_MIN_BLOCK_SIZE);
CHECK(blockWidth > (width >> iScaleX ), "Sub Block width > Block width");
CHECK(blockHeight > (height >> iScaleX), "Sub Block height > Block height");
static Mv storedMv[32][32];//128/4
#endif
const int cxWidth = width >> iScaleX; const int cxWidth = width >> iScaleX;
const int cxHeight = height >> iScaleY; const int cxHeight = height >> iScaleY;
const int iHalfBW = blockWidth >> 1; const int iHalfBW = blockWidth >> 1;
...@@ -541,6 +551,35 @@ void InterPrediction::xPredAffineBlk( const ComponentID& compID, const Predictio ...@@ -541,6 +551,35 @@ void InterPrediction::xPredAffineBlk( const ComponentID& compID, const Predictio
{ {
for ( int w = 0; w < cxWidth; w += blockWidth ) for ( int w = 0; w < cxWidth; w += blockWidth )
{ {
#if JVET_L0265_AFF_MINIMUM4X4
int iMvScaleTmpHor, iMvScaleTmpVer;
if(compID == COMPONENT_Y)
{
iMvScaleTmpHor = iMvScaleHor + iDMvHorX * (iHalfBW + w) + iDMvVerX * (iHalfBH + h);
iMvScaleTmpVer = iMvScaleVer + iDMvHorY * (iHalfBW + w) + iDMvVerY * (iHalfBH + h);
roundAffineMv(iMvScaleTmpHor, iMvScaleTmpVer, shift);
// clip and scale
iMvScaleTmpHor = std::min<int>(iHorMax, std::max<int>(iHorMin, iMvScaleTmpHor));
iMvScaleTmpVer = std::min<int>(iVerMax, std::max<int>(iVerMin, iMvScaleTmpVer));
storedMv[h / AFFINE_MIN_BLOCK_SIZE][w / AFFINE_MIN_BLOCK_SIZE].set(iMvScaleTmpHor, iMvScaleTmpVer);
}
else
{
Mv curMv = (storedMv[(h << iScaleY) / AFFINE_MIN_BLOCK_SIZE][(w << iScaleX) / AFFINE_MIN_BLOCK_SIZE] +
storedMv[(h << iScaleY) / AFFINE_MIN_BLOCK_SIZE + 1][(w << iScaleX) / AFFINE_MIN_BLOCK_SIZE] +
storedMv[(h << iScaleY) / AFFINE_MIN_BLOCK_SIZE][(w << iScaleX) / AFFINE_MIN_BLOCK_SIZE + 1] +
storedMv[(h << iScaleY) / AFFINE_MIN_BLOCK_SIZE + 1][(w << iScaleX) / AFFINE_MIN_BLOCK_SIZE + 1] +
Mv(2, 2));
curMv.set(curMv.getHor() >> 2, curMv.getVer() >> 2);
iMvScaleTmpHor = curMv.hor;
iMvScaleTmpVer = curMv.ver;
}
#else
int iMvScaleTmpHor = iMvScaleHor + iDMvHorX * (iHalfBW + w) + iDMvVerX * (iHalfBH + h); int iMvScaleTmpHor = iMvScaleHor + iDMvHorX * (iHalfBW + w) + iDMvVerX * (iHalfBH + h);
int iMvScaleTmpVer = iMvScaleVer + iDMvHorY * (iHalfBW + w) + iDMvVerY * (iHalfBH + h); int iMvScaleTmpVer = iMvScaleVer + iDMvHorY * (iHalfBW + w) + iDMvVerY * (iHalfBH + h);
roundAffineMv( iMvScaleTmpHor, iMvScaleTmpVer, shift ); roundAffineMv( iMvScaleTmpHor, iMvScaleTmpVer, shift );
...@@ -548,7 +587,7 @@ void InterPrediction::xPredAffineBlk( const ComponentID& compID, const Predictio ...@@ -548,7 +587,7 @@ void InterPrediction::xPredAffineBlk( const ComponentID& compID, const Predictio
// clip and scale // clip and scale
iMvScaleTmpHor = std::min<int>( iHorMax, std::max<int>( iHorMin, iMvScaleTmpHor ) ); iMvScaleTmpHor = std::min<int>( iHorMax, std::max<int>( iHorMin, iMvScaleTmpHor ) );
iMvScaleTmpVer = std::min<int>( iVerMax, std::max<int>( iVerMin, iMvScaleTmpVer ) ); iMvScaleTmpVer = std::min<int>( iVerMax, std::max<int>( iVerMin, iMvScaleTmpVer ) );
#endif
// get the MV in high precision // get the MV in high precision
int xFrac, yFrac, xInt, yInt; int xFrac, yFrac, xInt, yInt;
......
...@@ -50,8 +50,11 @@ ...@@ -50,8 +50,11 @@
#include <assert.h> #include <assert.h>
#include <cassert> #include <cassert>
#define JVET_L0104_NO_4x4BI_INTER_CU 1 // Prohibit 4x4 bi-prediction for inter CU #define JVET_L0104_NO_4x4BI_INTER_CU 1 // Prohibit 4x4 bi-prediction for inter CU
#define JVET_L0265_AFF_MINIMUM4X4 1 //Affine 4x4 chroma subblock
#define JVET_L0553_FIX_INITQP 1 #define JVET_L0553_FIX_INITQP 1
#define JVET_L0147_ALF_SUBSAMPLED_LAPLACIAN 1 // Subsampled Laplacian calculation #define JVET_L0147_ALF_SUBSAMPLED_LAPLACIAN 1 // Subsampled Laplacian calculation
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment