Skip to content
Snippets Groups Projects
Commit 0c7ba478 authored by Xiang Li's avatar Xiang Li
Browse files

Merge branch 'master' into 'master'

N0196: Use six tap filter for affine motion compensation

See merge request !454
parents c7adbb92 434e0d20
No related merge requests found
...@@ -54,6 +54,28 @@ CacheModel* InterpolationFilter::m_cacheModel; ...@@ -54,6 +54,28 @@ CacheModel* InterpolationFilter::m_cacheModel;
// ==================================================================================================================== // ====================================================================================================================
// Tables // Tables
// ==================================================================================================================== // ====================================================================================================================
#if JVET_N0196_SIX_TAP_FILTERS
const TFilterCoeff InterpolationFilter::m_lumaFilter4x4[LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS][NTAPS_LUMA] =
{
{ 0, 0, 0, 64, 0, 0, 0, 0 },
{ 0, 1, -3, 63, 4, -2, 1, 0 },
{ 0, 1, -5, 62, 8, -3, 1, 0 },
{ 0, 2, -8, 60, 13, -4, 1, 0 },
{ 0, 3, -10, 58, 17, -5, 1, 0 }, //1/4
{ 0, 3, -11, 52, 26, -8, 2, 0 },
{ 0, 2, -9, 47, 31, -10, 3, 0 },
{ 0, 3, -11, 45, 34, -10, 3, 0 },
{ 0, 3, -11, 40, 40, -11, 3, 0 }, //1/2
{ 0, 3, -10, 34, 45, -11, 3, 0 },
{ 0, 3, -10, 31, 47, -9, 2, 0 },
{ 0, 2, -8, 26, 52, -11, 3, 0 },
{ 0, 1, -5, 17, 58, -10, 3, 0 }, //3/4
{ 0, 1, -4, 13, 60, -8, 2, 0 },
{ 0, 1, -3, 8, 62, -5, 1, 0 },
{ 0, 1, -2, 4, 63, -3, 1, 0 }
};
#endif
const TFilterCoeff InterpolationFilter::m_lumaFilter[LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS][NTAPS_LUMA] = const TFilterCoeff InterpolationFilter::m_lumaFilter[LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS][NTAPS_LUMA] =
{ {
{ 0, 0, 0, 64, 0, 0, 0, 0 }, { 0, 0, 0, 64, 0, 0, 0, 0 },
...@@ -573,7 +595,18 @@ void InterpolationFilter::filterHor( const ComponentID compID, Pel const *src, i ...@@ -573,7 +595,18 @@ void InterpolationFilter::filterHor( const ComponentID compID, Pel const *src, i
} }
else else
{ {
#if JVET_N0196_SIX_TAP_FILTERS
if ((width == 4 && height == 4) || (width == 4 && height == (4 + NTAPS_LUMA - 1)))
{
filterHor<NTAPS_LUMA>(clpRng, src, srcStride, dst, dstStride, width, height, isLast, m_lumaFilter4x4[frac], biMCForDMVR);
}
else
{
#endif
filterHor<NTAPS_LUMA>(clpRng, src, srcStride, dst, dstStride, width, height, isLast, m_lumaFilter[frac], biMCForDMVR); filterHor<NTAPS_LUMA>(clpRng, src, srcStride, dst, dstStride, width, height, isLast, m_lumaFilter[frac], biMCForDMVR);
#if JVET_N0196_SIX_TAP_FILTERS
}
#endif
} }
} }
else else
...@@ -616,7 +649,18 @@ void InterpolationFilter::filterVer( const ComponentID compID, Pel const *src, i ...@@ -616,7 +649,18 @@ void InterpolationFilter::filterVer( const ComponentID compID, Pel const *src, i
} }
else else
{ {
#if JVET_N0196_SIX_TAP_FILTERS
if (width == 4 && height == 4)
{
filterVer<NTAPS_LUMA>(clpRng, src, srcStride, dst, dstStride, width, height, isFirst, isLast, m_lumaFilter4x4[frac], biMCForDMVR);
}
else
{
#endif
filterVer<NTAPS_LUMA>(clpRng, src, srcStride, dst, dstStride, width, height, isFirst, isLast, m_lumaFilter[frac], biMCForDMVR); filterVer<NTAPS_LUMA>(clpRng, src, srcStride, dst, dstStride, width, height, isFirst, isLast, m_lumaFilter[frac], biMCForDMVR);
#if JVET_N0196_SIX_TAP_FILTERS
}
#endif
} }
} }
else else
......
...@@ -55,6 +55,9 @@ ...@@ -55,6 +55,9 @@
*/ */
class InterpolationFilter class InterpolationFilter
{ {
#if JVET_N0196_SIX_TAP_FILTERS
static const TFilterCoeff m_lumaFilter4x4[LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS][NTAPS_LUMA];
#endif
static const TFilterCoeff m_lumaFilter[LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS][NTAPS_LUMA]; ///< Luma filter taps static const TFilterCoeff m_lumaFilter[LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS][NTAPS_LUMA]; ///< Luma filter taps
static const TFilterCoeff m_chromaFilter[CHROMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS][NTAPS_CHROMA]; ///< Chroma filter taps static const TFilterCoeff m_chromaFilter[CHROMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS][NTAPS_CHROMA]; ///< Chroma filter taps
static const TFilterCoeff m_bilinearFilter[LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS][NTAPS_BILINEAR]; ///< bilinear filter taps static const TFilterCoeff m_bilinearFilter[LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS][NTAPS_BILINEAR]; ///< bilinear filter taps
......
...@@ -115,6 +115,9 @@ ...@@ -115,6 +115,9 @@
#define JVET_N0407_DMVR_CU_SIZE_RESTRICTION 1 // Disable 4xN/8x8 CUs for DMVR #define JVET_N0407_DMVR_CU_SIZE_RESTRICTION 1 // Disable 4xN/8x8 CUs for DMVR
#define JVET_N0196_SIX_TAP_FILTERS 1 // 6-tap filters for affine motion compensation
#define JCTVC_Y0038_PARAMS 1 #define JCTVC_Y0038_PARAMS 1
#define JVET_MMVD_OFF_MACRO 0 #define JVET_MMVD_OFF_MACRO 0
......
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