Commit 4f4499a4 authored by Xin Zhao's avatar Xin Zhao

Integration of JVET-P0505: Modified non-linear ALF clipping value derivations

parent 41f89f69
Pipeline #2972 passed with stage
......@@ -649,17 +649,24 @@ void AdaptiveLoopFilter::create( const int picWidth, const int picHeight, const
static_assert( AlfNumClippingValues[CHANNEL_TYPE_LUMA] > 0, "AlfNumClippingValues[CHANNEL_TYPE_LUMA] must be at least one" );
for( int i = 0; i < AlfNumClippingValues[CHANNEL_TYPE_LUMA]; ++i )
{
# if JVET_P0505_ALF_CLIP_VALUE
m_alfClippingValues[CHANNEL_TYPE_LUMA][i] = (Pel)std::round( std::pow(2., double(m_inputBitDepth[CHANNEL_TYPE_LUMA] - 2.35*i)) );
#else
m_alfClippingValues[CHANNEL_TYPE_LUMA][i] =
(Pel) std::round(
std::pow(
2.,
double( m_inputBitDepth[CHANNEL_TYPE_LUMA] * ( AlfNumClippingValues[CHANNEL_TYPE_LUMA] - i ) ) / AlfNumClippingValues[CHANNEL_TYPE_LUMA]
) );
#endif
}
static_assert( AlfNumClippingValues[CHANNEL_TYPE_CHROMA] > 0, "AlfNumClippingValues[CHANNEL_TYPE_CHROMA] must be at least one" );
m_alfClippingValues[CHANNEL_TYPE_CHROMA][0] = 1 << m_inputBitDepth[CHANNEL_TYPE_CHROMA];
for( int i = 1; i < AlfNumClippingValues[CHANNEL_TYPE_CHROMA]; ++i )
{
# if JVET_P0505_ALF_CLIP_VALUE
m_alfClippingValues[CHANNEL_TYPE_CHROMA][i] = (Pel)std::round( std::pow(2., double(m_inputBitDepth[CHANNEL_TYPE_CHROMA] - 2.35*i)) );
#else
m_alfClippingValues[CHANNEL_TYPE_CHROMA][i] =
(Pel) std::round(
std::pow(
......@@ -667,6 +674,7 @@ void AdaptiveLoopFilter::create( const int picWidth, const int picHeight, const
m_inputBitDepth[CHANNEL_TYPE_CHROMA] - 8
+ 8. * ( AlfNumClippingValues[CHANNEL_TYPE_CHROMA] - i - 1 ) / ( AlfNumClippingValues[CHANNEL_TYPE_CHROMA] - 1 )
) );
#endif
}
if (m_created)
......
......@@ -56,6 +56,8 @@
#define JVET_P0436_CQP_OFFSET_SIGNALLING 1 // JVET_P0436: CU chroma QP offset signalling consistent with VPDU and bugfix
#define JVET_P0505_ALF_CLIP_VALUE 1 // JVET-P0505: Modified non-linear ALF clipping value derivations
#define JVET_P0154_PROF_SAMPLE_OFFSET_CLIPPING 1 // JVET-P0154/P0094/P0172/P0413/P0518/P0281: Clip the PROF sample offset to 14-bit
#define JVET_P1023_DMVR_BDOF_RP_CONDITION 1 // JVET_P1023: Reference picture conditions in DMVR and BDOF
......
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