Skip to content
Snippets Groups Projects
Commit ba50405c authored by Xiaoyu Xiu's avatar Xiaoyu Xiu Committed by Xiang Li
Browse files

JVET-Q0517: Affine down-sampling filters for RPR

parent a9e562cb
No related branches found
No related tags found
No related merge requests found
...@@ -2378,6 +2378,51 @@ bool InterPrediction::xPredInterBlkRPR( const std::pair<int, int>& scalingRatio, ...@@ -2378,6 +2378,51 @@ bool InterPrediction::xPredInterBlkRPR( const std::pair<int, int>& scalingRatio,
yFilter = 3; yFilter = 3;
} }
} }
#if JVET_Q0517_RPR_AFFINE_DS
if (filterIndex == 2)
{
if (isLuma(compID))
{
if (scalingRatio.first > rprThreshold2)
{
xFilter = 6;
}
else if (scalingRatio.first > rprThreshold1)
{
xFilter = 5;
}
if (scalingRatio.second > rprThreshold2)
{
yFilter = 6;
}
else if (scalingRatio.second > rprThreshold1)
{
yFilter = 5;
}
}
else
{
if (scalingRatio.first > rprThreshold2)
{
xFilter = 4;
}
else if (scalingRatio.first > rprThreshold1)
{
xFilter = 3;
}
if (scalingRatio.second > rprThreshold2)
{
yFilter = 4;
}
else if (scalingRatio.second > rprThreshold1)
{
yFilter = 3;
}
}
}
#endif
const int posShift = SCALE_RATIO_BITS - 4; const int posShift = SCALE_RATIO_BITS - 4;
int stepX = ( scalingRatio.first + 8 ) >> 4; int stepX = ( scalingRatio.first + 8 ) >> 4;
......
...@@ -136,6 +136,50 @@ const TFilterCoeff InterpolationFilter::m_lumaFilterRPR2[LUMA_INTERPOLATION_FILT ...@@ -136,6 +136,50 @@ const TFilterCoeff InterpolationFilter::m_lumaFilterRPR2[LUMA_INTERPOLATION_FILT
{ -2, -4, 5, 21, 29, 19, 0, -4 } { -2, -4, 5, 21, 29, 19, 0, -4 }
}; };
#if JVET_Q0517_RPR_AFFINE_DS
// 1.5x
const TFilterCoeff InterpolationFilter::m_affineLumaFilterRPR1[LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS][NTAPS_LUMA] =
{
{ 0, -6, 17, 42, 17, -5, -1, 0 },
{ 0, -5, 15, 41, 19, -5, -1, 0 },
{ 0, -5, 13, 40, 21, -4, -1, 0 },
{ 0, -5, 11, 39, 24, -4, -1, 0 },
{ 0, -5, 9, 38, 26, -3, -1, 0 },
{ 0, -5, 7, 38, 28, -2, -2, 0 },
{ 0, -4, 5, 36, 30, -1, -2, 0 },
{ 0, -3, 3, 35, 32, 0, -3, 0 },
{ 0, -3, 2, 33, 33, 2, -3, 0 },
{ 0, -3, 0, 32, 35, 3, -3, 0 },
{ 0, -2, -1, 30, 36, 5, -4, 0 },
{ 0, -2, -2, 28, 38, 7, -5, 0 },
{ 0, -1, -3, 26, 38, 9, -5, 0 },
{ 0, -1, -4, 24, 39, 11, -5, 0 },
{ 0, -1, -4, 21, 40, 13, -5, 0 },
{ 0, -1, -5, 19, 41, 15, -5, 0 }
};
// 2x
const TFilterCoeff InterpolationFilter::m_affineLumaFilterRPR2[LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS][NTAPS_LUMA] =
{
{ 0, -2, 20, 28, 20, 2, -4, 0 },
{ 0, -4, 19, 29, 21, 5, -6, 0 },
{ 0, -5, 18, 29, 22, 6, -6, 0 },
{ 0, -5, 16, 29, 23, 7, -6, 0 },
{ 0, -5, 16, 28, 24, 7, -6, 0 },
{ 0, -5, 14, 28, 25, 8, -6, 0 },
{ 0, -6, 14, 27, 26, 9, -6, 0 },
{ 0, -4, 12, 28, 25, 10, -7, 0 },
{ 0, -6, 11, 27, 27, 11, -6, 0 },
{ 0, -7, 10, 25, 28, 12, -4, 0 },
{ 0, -6, 9, 26, 27, 14, -6, 0 },
{ 0, -6, 8, 25, 28, 14, -5, 0 },
{ 0, -6, 7, 24, 28, 16, -5, 0 },
{ 0, -6, 7, 23, 29, 16, -5, 0 },
{ 0, -6, 6, 22, 29, 18, -5, 0 },
{ 0, -6, 5, 21, 29, 19, -4, 0 }
};
#endif
const TFilterCoeff InterpolationFilter::m_lumaAltHpelIFilter[NTAPS_LUMA] = { 0, 3, 9, 20, 20, 9, 3, 0 }; const TFilterCoeff InterpolationFilter::m_lumaAltHpelIFilter[NTAPS_LUMA] = { 0, 3, 9, 20, 20, 9, 3, 0 };
const TFilterCoeff InterpolationFilter::m_chromaFilter[CHROMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS][NTAPS_CHROMA] = const TFilterCoeff InterpolationFilter::m_chromaFilter[CHROMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS][NTAPS_CHROMA] =
{ {
...@@ -717,6 +761,16 @@ void InterpolationFilter::filterHor(const ComponentID compID, Pel const *src, in ...@@ -717,6 +761,16 @@ void InterpolationFilter::filterHor(const ComponentID compID, Pel const *src, in
{ {
filterHor<NTAPS_LUMA>( clpRng, src, srcStride, dst, dstStride, width, height, isLast, m_lumaFilterRPR2[frac], biMCForDMVR ); filterHor<NTAPS_LUMA>( clpRng, src, srcStride, dst, dstStride, width, height, isLast, m_lumaFilterRPR2[frac], biMCForDMVR );
} }
#if JVET_Q0517_RPR_AFFINE_DS
else if (nFilterIdx == 5)
{
filterHor<NTAPS_LUMA>(clpRng, src, srcStride, dst, dstStride, width, height, isLast, m_affineLumaFilterRPR1[frac], biMCForDMVR);
}
else if (nFilterIdx == 6)
{
filterHor<NTAPS_LUMA>(clpRng, src, srcStride, dst, dstStride, width, height, isLast, m_affineLumaFilterRPR2[frac], biMCForDMVR);
}
#endif
else if( frac == 8 && useAltHpelIf ) else if( frac == 8 && useAltHpelIf )
{ {
filterHor<NTAPS_LUMA>( clpRng, src, srcStride, dst, dstStride, width, height, isLast, m_lumaAltHpelIFilter, biMCForDMVR ); filterHor<NTAPS_LUMA>( clpRng, src, srcStride, dst, dstStride, width, height, isLast, m_lumaAltHpelIFilter, biMCForDMVR );
...@@ -792,6 +846,16 @@ void InterpolationFilter::filterVer(const ComponentID compID, Pel const *src, in ...@@ -792,6 +846,16 @@ void InterpolationFilter::filterVer(const ComponentID compID, Pel const *src, in
{ {
filterVer<NTAPS_LUMA>( clpRng, src, srcStride, dst, dstStride, width, height, isFirst, isLast, m_lumaFilterRPR2[frac], biMCForDMVR ); filterVer<NTAPS_LUMA>( clpRng, src, srcStride, dst, dstStride, width, height, isFirst, isLast, m_lumaFilterRPR2[frac], biMCForDMVR );
} }
#if JVET_Q0517_RPR_AFFINE_DS
else if (nFilterIdx == 5)
{
filterVer<NTAPS_LUMA>(clpRng, src, srcStride, dst, dstStride, width, height, isFirst, isLast, m_affineLumaFilterRPR1[frac], biMCForDMVR);
}
else if (nFilterIdx == 6)
{
filterVer<NTAPS_LUMA>(clpRng, src, srcStride, dst, dstStride, width, height, isFirst, isLast, m_affineLumaFilterRPR2[frac], biMCForDMVR);
}
#endif
else if( frac == 8 && useAltHpelIf ) else if( frac == 8 && useAltHpelIf )
{ {
filterVer<NTAPS_LUMA>( clpRng, src, srcStride, dst, dstStride, width, height, isFirst, isLast, m_lumaAltHpelIFilter, biMCForDMVR ); filterVer<NTAPS_LUMA>( clpRng, src, srcStride, dst, dstStride, width, height, isFirst, isLast, m_lumaAltHpelIFilter, biMCForDMVR );
......
...@@ -63,6 +63,10 @@ public: ...@@ -63,6 +63,10 @@ public:
static const TFilterCoeff m_lumaFilterRPR2[LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS][NTAPS_LUMA]; ///< Luma filter taps 2x static const TFilterCoeff m_lumaFilterRPR2[LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS][NTAPS_LUMA]; ///< Luma filter taps 2x
static const TFilterCoeff m_chromaFilterRPR1[CHROMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS][NTAPS_CHROMA]; ///< Chroma filter taps 1.5x static const TFilterCoeff m_chromaFilterRPR1[CHROMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS][NTAPS_CHROMA]; ///< Chroma filter taps 1.5x
static const TFilterCoeff m_chromaFilterRPR2[CHROMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS][NTAPS_CHROMA]; ///< Chroma filter taps 2x static const TFilterCoeff m_chromaFilterRPR2[CHROMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS][NTAPS_CHROMA]; ///< Chroma filter taps 2x
#if JVET_Q0517_RPR_AFFINE_DS
static const TFilterCoeff m_affineLumaFilterRPR1[LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS][NTAPS_LUMA]; ///< Luma filter taps 1.5x
static const TFilterCoeff m_affineLumaFilterRPR2[LUMA_INTERPOLATION_FILTER_SUB_SAMPLE_POSITIONS][NTAPS_LUMA]; ///< Luma filter taps 2x
#endif
private: private:
static const TFilterCoeff m_lumaAltHpelIFilter[NTAPS_LUMA]; ///< Luma filter taps static const TFilterCoeff m_lumaAltHpelIFilter[NTAPS_LUMA]; ///< Luma 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
......
...@@ -50,17 +50,13 @@ ...@@ -50,17 +50,13 @@
#include <assert.h> #include <assert.h>
#include <cassert> #include <cassert>
#define JVET_Q0517_RPR_AFFINE_DS 1 // JVET-Q0517: affine down-sampling filters for RPR
#define JVET_O1143_SUBPIC_BOUNDARY 1 // treat subpicture boundary as piucture boundary #define JVET_O1143_SUBPIC_BOUNDARY 1 // treat subpicture boundary as piucture boundary
#if JVET_O1143_SUBPIC_BOUNDARY #if JVET_O1143_SUBPIC_BOUNDARY
#define SUBPIC_DECCHECK 0 #define SUBPIC_DECCHECK 0
#endif #endif
#define JVET_Q0495_NLALF_CLIP_CLEANUP 1 // JVET-Q0495: Cleanup of clipping table for NL-ALF #define JVET_Q0495_NLALF_CLIP_CLEANUP 1 // JVET-Q0495: Cleanup of clipping table for NL-ALF
#define JVET_Q0249_ALF_CHROMA_CLIPFLAG 1 // JVET-Q0249: Cleanup of chroma clipping flags for ALF #define JVET_Q0249_ALF_CHROMA_CLIPFLAG 1 // JVET-Q0249: Cleanup of chroma clipping flags for ALF
#define JVET_Q0150 1 // fix for ALF virtual horizontal CTU boundary processing #define JVET_Q0150 1 // fix for ALF virtual horizontal CTU boundary processing
......
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