Commit 13c29e61 authored by Jonathan Taquet's avatar Jonathan Taquet Committed by Xiang Li

Merge tag 'VTM-4.2' into JVET-N0242

VTM version 4.2
parent d19f3cef
......@@ -1962,6 +1962,18 @@ luma TUs are also skipped.
\par
This option has no effect if TransformSkip is disabled.
\\
\Option{UseNonLinearAlfLuma} &
%\ShortOption{\None} &
\Default{true} &
Enables optimization of non-linear filters for ALF on Luma channel.
\\
\Option{UseNonLinearAlfChroma} &
%\ShortOption{\None} &
\Default{true} &
Enables optimization of non-linear filters for ALF on Chroma channels.
\\
\end{OptionTableNoShorthand}
%%
......
......@@ -314,6 +314,10 @@ void EncApp::xInitLibCfg()
m_cEncLib.setUseAMaxBT ( m_useAMaxBT );
m_cEncLib.setUseE0023FastEnc ( m_e0023FastEnc );
m_cEncLib.setUseContentBasedFastQtbt ( m_contentBasedFastQtbt );
#if JVET_N0242_NON_LINEAR_ALF
m_cEncLib.setUseNonLinearAlfLuma ( m_useNonLinearAlfLuma );
m_cEncLib.setUseNonLinearAlfChroma ( m_useNonLinearAlfChroma );
#endif
m_cEncLib.setCrossComponentPredictionEnabledFlag ( m_crossComponentPredictionEnabledFlag );
m_cEncLib.setUseReconBasedCrossCPredictionEstimate ( m_reconBasedCrossCPredictionEstimate );
m_cEncLib.setLog2SaoOffsetScale ( CHANNEL_TYPE_LUMA , m_log2SaoOffsetScale[CHANNEL_TYPE_LUMA] );
......
......@@ -899,6 +899,10 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
("AMaxBT", m_useAMaxBT, false, "Adaptive maximal BT-size")
("E0023FastEnc", m_e0023FastEnc, true, "Fast encoding setting for QTBT (proposal E0023)")
("ContentBasedFastQtbt", m_contentBasedFastQtbt, false, "Signal based QTBT speed-up")
#if JVET_N0242_NON_LINEAR_ALF
("UseNonLinearAlfLuma", m_useNonLinearAlfLuma, true, "Non-linear adaptive loop filters for Luma Channel")
("UseNonLinearAlfChroma", m_useNonLinearAlfChroma, true, "Non-linear adaptive loop filters for Chroma Channels")
#endif
// Unit definition parameters
("MaxCUWidth", m_uiMaxCUWidth, 64u)
("MaxCUHeight", m_uiMaxCUHeight, 64u)
......@@ -3194,6 +3198,10 @@ void EncAppCfg::xPrintParameter()
msg( VERBOSE, "AMaxBT:%d ", m_useAMaxBT );
msg( VERBOSE, "E0023FastEnc:%d ", m_e0023FastEnc );
msg( VERBOSE, "ContentBasedFastQtbt:%d ", m_contentBasedFastQtbt );
#if JVET_N0242_NON_LINEAR_ALF
msg( VERBOSE, "UseNonLinearALFLuma:%d ", m_useNonLinearAlfLuma );
msg( VERBOSE, "UseNonLinearALFChroma:%d ", m_useNonLinearAlfChroma );
#endif
msg( VERBOSE, "NumSplitThreads:%d ", m_numSplitThreads );
if( m_numSplitThreads > 1 )
......
......@@ -292,6 +292,10 @@ protected:
bool m_useFastMrg;
bool m_e0023FastEnc;
bool m_contentBasedFastQtbt;
#if JVET_N0242_NON_LINEAR_ALF
bool m_useNonLinearAlfLuma;
bool m_useNonLinearAlfChroma;
#endif
int m_numSplitThreads;
......
This diff is collapsed.
......@@ -42,6 +42,7 @@
#include "Unit.h"
#include "UnitTools.h"
struct AlfClassifier
{
AlfClassifier() {}
......@@ -66,6 +67,16 @@ enum Direction
class AdaptiveLoopFilter
{
public:
#if JVET_N0242_NON_LINEAR_ALF
static inline int clipALF(const int clip, const short ref, const short val0, const short val1)
{
return Clip3<int>(-clip, +clip, val0-ref) + Clip3<int>(-clip, +clip, val1-ref);
}
static constexpr int AlfNumClippingValues[MAX_NUM_CHANNEL_TYPE] = { 4, 4 };
static constexpr int MaxAlfNumClippingValues = 4;
#endif
static constexpr int m_NUM_BITS = 8;
static constexpr int m_CLASSIFICATION_BLK_SIZE = 32; //non-normative, local buffer size
static constexpr int m_ALF_UNUSED_CLASSIDX = 255;
......@@ -82,15 +93,24 @@ public:
void deriveClassification( AlfClassifier** classifier, const CPelBuf& srcLuma, const Area& blk );
void resetPCMBlkClassInfo(CodingStructure & cs, AlfClassifier** classifier, const CPelBuf& srcLuma, const Area& blk);
template<AlfFilterType filtType>
#if JVET_N0242_NON_LINEAR_ALF
static void filterBlk( AlfClassifier** classifier, const PelUnitBuf &recDst, const CPelUnitBuf& recSrc, const Area& blk, const ComponentID compId, short* filterSet, short* fClipSet, const ClpRng& clpRng, CodingStructure& cs );
#else
static void filterBlk( AlfClassifier** classifier, const PelUnitBuf &recDst, const CPelUnitBuf& recSrc, const Area& blk, const ComponentID compId, short* filterSet, const ClpRng& clpRng, CodingStructure& cs );
#endif
inline static int getMaxGolombIdx( AlfFilterType filterType )
{
return filterType == ALF_FILTER_5 ? 2 : 3;
}
void( *m_deriveClassificationBlk )( AlfClassifier** classifier, int** laplacian[NUM_DIRECTIONS], const CPelBuf& srcLuma, const Area& blk, const int shift );
#if JVET_N0242_NON_LINEAR_ALF
void( *m_filter5x5Blk )( AlfClassifier** classifier, const PelUnitBuf &recDst, const CPelUnitBuf& recSrc, const Area& blk, const ComponentID compId, short* filterSet, short* fClipSet, const ClpRng& clpRng, CodingStructure& cs );
void( *m_filter7x7Blk )( AlfClassifier** classifier, const PelUnitBuf &recDst, const CPelUnitBuf& recSrc, const Area& blk, const ComponentID compId, short* filterSet, short* fClipSet, const ClpRng& clpRng, CodingStructure& cs );
#else
void( *m_filter5x5Blk )( AlfClassifier** classifier, const PelUnitBuf &recDst, const CPelUnitBuf& recSrc, const Area& blk, const ComponentID compId, short* filterSet, const ClpRng& clpRng, CodingStructure& cs );
void( *m_filter7x7Blk )( AlfClassifier** classifier, const PelUnitBuf &recDst, const CPelUnitBuf& recSrc, const Area& blk, const ComponentID compId, short* filterSet, const ClpRng& clpRng, CodingStructure& cs );
#endif
#ifdef TARGET_SIMD_X86
void initAdaptiveLoopFilterX86();
......@@ -99,9 +119,16 @@ public:
#endif
protected:
#if JVET_N0242_NON_LINEAR_ALF
Pel m_alfClippingValues[MAX_NUM_CHANNEL_TYPE][MaxAlfNumClippingValues];
#endif
std::vector<AlfFilterShape> m_filterShapes[MAX_NUM_CHANNEL_TYPE];
AlfClassifier** m_classifier;
short m_coeffFinal[MAX_NUM_ALF_CLASSES * MAX_NUM_ALF_LUMA_COEFF];
#if JVET_N0242_NON_LINEAR_ALF
short m_clippFinal[MAX_NUM_ALF_CLASSES * MAX_NUM_ALF_LUMA_COEFF];
short m_chromaClippFinal[MAX_NUM_ALF_LUMA_COEFF];
#endif
int** m_laplacian[NUM_DIRECTIONS];
uint8_t* m_ctuEnableFlag[MAX_NUM_COMPONENT];
PelStorage m_tempBuf;
......
......@@ -50,6 +50,8 @@
#include <assert.h>
#include <cassert>
#define JVET_N0242_NON_LINEAR_ALF 1 // enable CE5-3.2, Non-linear ALF based on clipping function
#define JVET_N0449_MMVD_SIMP 1 // Configurable number of mmvd distance entries used
#define JVET_N0137_DUALTREE_CHROMA_SIZE 1
......@@ -1555,8 +1557,17 @@ struct AlfFilterShape
struct AlfSliceParam
{
bool enabledFlag[MAX_NUM_COMPONENT]; // alf_slice_enable_flag, alf_chroma_idc
#if JVET_N0242_NON_LINEAR_ALF
bool nonLinearFlag[MAX_NUM_CHANNEL_TYPE]; // alf_nonlinear_enable_flag[Luma/Chroma]
#endif
short lumaCoeff[MAX_NUM_ALF_CLASSES * MAX_NUM_ALF_LUMA_COEFF]; // alf_coeff_luma_delta[i][j]
#if JVET_N0242_NON_LINEAR_ALF
short lumaClipp[MAX_NUM_ALF_CLASSES * MAX_NUM_ALF_LUMA_COEFF]; // alf_clipp_luma_[i][j]
#endif
short chromaCoeff[MAX_NUM_ALF_CHROMA_COEFF]; // alf_coeff_chroma[i]
#if JVET_N0242_NON_LINEAR_ALF
short chromaClipp[MAX_NUM_ALF_CHROMA_COEFF]; // alf_clipp_chroma[i]
#endif
short filterCoeffDeltaIdx[MAX_NUM_ALF_CLASSES]; // filter_coeff_delta[i]
bool alfLumaCoeffFlag[MAX_NUM_ALF_CLASSES]; // alf_luma_coeff_flag[i]
int numLumaFilters; // number_of_filters_minus1 + 1
......@@ -1572,8 +1583,17 @@ struct AlfSliceParam
void reset()
{
std::memset( enabledFlag, false, sizeof( enabledFlag ) );
#if JVET_N0242_NON_LINEAR_ALF
std::memset( nonLinearFlag, false, sizeof( nonLinearFlag ) );
#endif
std::memset( lumaCoeff, 0, sizeof( lumaCoeff ) );
#if JVET_N0242_NON_LINEAR_ALF
std::memset( lumaClipp, 0, sizeof( lumaClipp ) );
#endif
std::memset( chromaCoeff, 0, sizeof( chromaCoeff ) );
#if JVET_N0242_NON_LINEAR_ALF
std::memset( chromaClipp, 0, sizeof( chromaClipp ) );
#endif
std::memset( filterCoeffDeltaIdx, 0, sizeof( filterCoeffDeltaIdx ) );
std::memset( alfLumaCoeffFlag, true, sizeof( alfLumaCoeffFlag ) );
numLumaFilters = 1;
......@@ -1584,8 +1604,17 @@ struct AlfSliceParam
const AlfSliceParam& operator = ( const AlfSliceParam& src )
{
std::memcpy( enabledFlag, src.enabledFlag, sizeof( enabledFlag ) );
#if JVET_N0242_NON_LINEAR_ALF
std::memcpy( nonLinearFlag, src.nonLinearFlag, sizeof( nonLinearFlag ) );
#endif
std::memcpy( lumaCoeff, src.lumaCoeff, sizeof( lumaCoeff ) );
#if JVET_N0242_NON_LINEAR_ALF
std::memcpy( lumaClipp, src.lumaClipp, sizeof( lumaClipp ) );
#endif
std::memcpy( chromaCoeff, src.chromaCoeff, sizeof( chromaCoeff ) );
#if JVET_N0242_NON_LINEAR_ALF
std::memcpy( chromaClipp, src.chromaClipp, sizeof( chromaClipp ) );
#endif
std::memcpy( filterCoeffDeltaIdx, src.filterCoeffDeltaIdx, sizeof( filterCoeffDeltaIdx ) );
std::memcpy( alfLumaCoeffFlag, src.alfLumaCoeffFlag, sizeof( alfLumaCoeffFlag ) );
numLumaFilters = src.numLumaFilters;
......
......@@ -625,6 +625,17 @@ void HLSyntaxReader::parseAPS(APS* aps)
param.enabledFlag[COMPONENT_Cb] = alfChromaIdc >> 1;
param.enabledFlag[COMPONENT_Cr] = alfChromaIdc & 1;
#if JVET_N0242_NON_LINEAR_ALF
READ_FLAG( code, "alf_luma_clip" );
param.nonLinearFlag[CHANNEL_TYPE_LUMA] = code ? true : false;
if( alfChromaIdc )
{
READ_FLAG( code, "alf_chroma_clip" );
param.nonLinearFlag[CHANNEL_TYPE_CHROMA] = code ? true : false;
}
#endif
xReadTruncBinCode(code, MAX_NUM_ALF_CLASSES); //number_of_filters_minus1
param.numLumaFilters = code + 1;
if (param.numLumaFilters > 1)
......@@ -2522,8 +2533,11 @@ bool HLSyntaxReader::xMoreRbspData()
return (cnt>0);
}
#if JVET_N0242_NON_LINEAR_ALF
int HLSyntaxReader::alfGolombDecode( const int k, const bool signed_val )
#else
int HLSyntaxReader::alfGolombDecode( const int k )
#endif
{
uint32_t uiSymbol;
int q = -1;
......@@ -2555,7 +2569,11 @@ int HLSyntaxReader::alfGolombDecode( const int k )
}
}
nr += q * m; // add the bits and the multiple of M
#if JVET_N0242_NON_LINEAR_ALF
if( signed_val && nr != 0 )
#else
if( nr != 0 )
#endif
{
#if RExt__DECODER_DEBUG_BIT_STATISTICS
xReadFlag( uiSymbol, "" );
......@@ -2604,6 +2622,9 @@ void HLSyntaxReader::alfFilter( AlfSliceParam& alfSliceParam, const bool isChrom
static int kMinTab[MAX_NUM_ALF_COEFF];
const int numFilters = isChroma ? 1 : alfSliceParam.numLumaFilters;
short* coeff = isChroma ? alfSliceParam.chromaCoeff : alfSliceParam.lumaCoeff;
#if JVET_N0242_NON_LINEAR_ALF
short* clipp = isChroma ? alfSliceParam.chromaClipp : alfSliceParam.lumaClipp;
#endif
for( int idx = 0; idx < maxGolombIdx; idx++ )
{
......@@ -2639,6 +2660,70 @@ void HLSyntaxReader::alfFilter( AlfSliceParam& alfSliceParam, const bool isChrom
coeff[ind * MAX_NUM_ALF_LUMA_COEFF + i] = alfGolombDecode( kMinTab[alfShape.golombIdx[i]] );
}
}
#if JVET_N0242_NON_LINEAR_ALF
// Clipping values coding
if ( alfSliceParam.nonLinearFlag[isChroma] )
{
READ_UVLC( code, "clip_min_golomb_order" );
kMin = code + 1;
for( int idx = 0; idx < maxGolombIdx; idx++ )
{
READ_FLAG( code, "clip_golomb_order_increase_flag" );
CHECK( code > 1, "Wrong golomb_order_increase_flag" );
kMinTab[idx] = kMin + code;
kMin = kMinTab[idx];
}
short recCoeff[MAX_NUM_ALF_CLASSES * MAX_NUM_ALF_LUMA_COEFF];
if( isChroma )
{
memcpy( recCoeff, coeff, sizeof(short) * MAX_NUM_ALF_CHROMA_COEFF );
}
else
{
memcpy( recCoeff, coeff, sizeof(short) * numFilters * MAX_NUM_ALF_LUMA_COEFF );
if( alfSliceParam.alfLumaCoeffDeltaPredictionFlag )
{
for( int i = 1; i < numFilters; i++ )
{
for( int j = 0; j < alfShape.numCoeff - 1; j++ )
{
recCoeff[i * MAX_NUM_ALF_LUMA_COEFF + j] += recCoeff[( i - 1 ) * MAX_NUM_ALF_LUMA_COEFF + j];
}
}
}
}
// Filter coefficients
for( int ind = 0; ind < numFilters; ++ind )
{
if( !isChroma && !alfSliceParam.alfLumaCoeffFlag[ind] && alfSliceParam.alfLumaCoeffDeltaFlag )
{
std::fill_n( clipp + ind * MAX_NUM_ALF_LUMA_COEFF, alfShape.numCoeff, 0 );
continue;
}
for( int i = 0; i < alfShape.numCoeff - 1; i++ )
{
if( recCoeff[ind * MAX_NUM_ALF_LUMA_COEFF + i] )
clipp[ind * MAX_NUM_ALF_LUMA_COEFF + i] = alfGolombDecode( kMinTab[alfShape.golombIdx[i]], false );
else
clipp[ind * MAX_NUM_ALF_LUMA_COEFF + i] = 0;
}
}
}
else
{
for( int ind = 0; ind < numFilters; ++ind )
{
std::fill_n( clipp + ind * MAX_NUM_ALF_LUMA_COEFF, alfShape.numCoeff, 0 );
}
}
#endif
}
int HLSyntaxReader::truncatedUnaryEqProb( const int maxSymbol )
......
......@@ -177,7 +177,11 @@ public:
private:
int truncatedUnaryEqProb( const int maxSymbol );
void xReadTruncBinCode( uint32_t& ruiSymbol, const int uiMaxSymbol );
#if JVET_N0242_NON_LINEAR_ALF
int alfGolombDecode( const int k, const bool signed_val=true );
#else
int alfGolombDecode( const int k );
#endif
protected:
bool xMoreRbspData();
......
......@@ -266,6 +266,10 @@ protected:
bool m_useAMaxBT;
bool m_e0023FastEnc;
bool m_contentBasedFastQtbt;
#if JVET_N0242_NON_LINEAR_ALF
bool m_useNonLinearAlfLuma;
bool m_useNonLinearAlfChroma;
#endif
#if MAX_TB_SIZE_SIGNALLING
uint32_t m_log2MaxTbSize;
......@@ -822,6 +826,12 @@ public:
bool getUseE0023FastEnc () const { return m_e0023FastEnc; }
void setUseContentBasedFastQtbt ( bool b ) { m_contentBasedFastQtbt = b; }
bool getUseContentBasedFastQtbt () const { return m_contentBasedFastQtbt; }
#if JVET_N0242_NON_LINEAR_ALF
void setUseNonLinearAlfLuma ( bool b ) { m_useNonLinearAlfLuma = b; }
bool getUseNonLinearAlfLuma () const { return m_useNonLinearAlfLuma; }
void setUseNonLinearAlfChroma ( bool b ) { m_useNonLinearAlfChroma = b; }
bool getUseNonLinearAlfChroma () const { return m_useNonLinearAlfChroma; }
#endif
#if MAX_TB_SIZE_SIGNALLING
void setLog2MaxTbSize ( uint32_t u ) { m_log2MaxTbSize = u; }
......
......@@ -135,7 +135,11 @@ void EncLib::create ()
}
if( m_alf )
{
#if JVET_N0242_NON_LINEAR_ALF
m_cEncALF.create( this, getSourceWidth(), getSourceHeight(), m_chromaFormatIDC, m_maxCUWidth, m_maxCUHeight, m_maxTotalCUDepth, m_bitDepth, m_inputBitDepth );
#else
m_cEncALF.create( getSourceWidth(), getSourceHeight(), m_chromaFormatIDC, m_maxCUWidth, m_maxCUHeight, m_maxTotalCUDepth, m_bitDepth, m_inputBitDepth );
#endif
}
#if ENABLE_SPLIT_PARALLELISM || ENABLE_WPP_PARALLELISM
......
......@@ -377,6 +377,14 @@ void HLSWriter::codeAPS( APS* pcAPS)
const int alfChromaIdc = param.enabledFlag[COMPONENT_Cb] * 2 + param.enabledFlag[COMPONENT_Cr];
truncatedUnaryEqProb(alfChromaIdc, 3); // alf_chroma_idc
#if JVET_N0242_NON_LINEAR_ALF
WRITE_FLAG( param.nonLinearFlag[CHANNEL_TYPE_LUMA], "alf_luma_clip" );
if( alfChromaIdc )
{
WRITE_FLAG( param.nonLinearFlag[CHANNEL_TYPE_CHROMA], "alf_chroma_clip" );
}
#endif
xWriteTruncBinCode(param.numLumaFilters - 1, MAX_NUM_ALF_CLASSES); //number_of_filters_minus1
if (param.numLumaFilters > 1)
{
......@@ -1793,8 +1801,11 @@ bool HLSWriter::xFindMatchingLTRP(Slice* pcSlice, uint32_t *ltrpsIndex, int ltrp
return false;
}
#if JVET_N0242_NON_LINEAR_ALF
void HLSWriter::alfGolombEncode( int coeff, int k, const bool signed_coeff )
#else
void HLSWriter::alfGolombEncode( int coeff, int k )
#endif
{
int symbol = abs( coeff );
......@@ -1814,7 +1825,11 @@ void HLSWriter::alfGolombEncode( int coeff, int k )
symbol >>= 1;
}
#if JVET_N0242_NON_LINEAR_ALF
if( signed_coeff && coeff != 0 )
#else
if( coeff != 0 )
#endif
{
int sign = ( coeff > 0 ) ? 1 : 0;
xWriteFlag( sign );
......@@ -1840,6 +1855,9 @@ void HLSWriter::alfFilter( const AlfSliceParam& alfSliceParam, const bool isChro
AlfFilterShape alfShape( isChroma ? 5 : 7 );
const int maxGolombIdx = AdaptiveLoopFilter::getMaxGolombIdx( alfShape.filterType );
const short* coeff = isChroma ? alfSliceParam.chromaCoeff : alfSliceParam.lumaCoeff;
#if JVET_N0242_NON_LINEAR_ALF
const short* clipp = isChroma ? alfSliceParam.chromaClipp : alfSliceParam.lumaClipp;
#endif
const int numFilters = isChroma ? 1 : alfSliceParam.numLumaFilters;
// vlc for all
......@@ -1897,6 +1915,82 @@ void HLSWriter::alfFilter( const AlfSliceParam& alfSliceParam, const bool isChro
alfGolombEncode( coeff[ind* MAX_NUM_ALF_LUMA_COEFF + i], kMinTab[alfShape.golombIdx[i]] ); // alf_coeff_chroma[i], alf_coeff_luma_delta[i][j]
}
}
#if JVET_N0242_NON_LINEAR_ALF
// Clipping values coding
if( alfSliceParam.nonLinearFlag[isChroma] )
{
memset( bitsCoeffScan, 0, sizeof( bitsCoeffScan ) );
short recCoeff[MAX_NUM_ALF_CLASSES * MAX_NUM_ALF_LUMA_COEFF];
if( isChroma )
{
memcpy( recCoeff, coeff, sizeof(short) * MAX_NUM_ALF_CHROMA_COEFF );
}
else
{
memcpy( recCoeff, coeff, sizeof(short) * numFilters * MAX_NUM_ALF_LUMA_COEFF );
if( alfSliceParam.alfLumaCoeffDeltaPredictionFlag )
{
for( int i = 1; i < numFilters; i++ )
{
for( int j = 0; j < alfShape.numCoeff - 1; j++ )
{
recCoeff[i * MAX_NUM_ALF_LUMA_COEFF + j] += recCoeff[( i - 1 ) * MAX_NUM_ALF_LUMA_COEFF + j];
}
}
}
}
// vlc for all
for( int ind = 0; ind < numFilters; ++ind )
{
if( isChroma || !alfSliceParam.alfLumaCoeffDeltaFlag || alfSliceParam.alfLumaCoeffFlag[ind] )
{
for( int i = 0; i < alfShape.numCoeff - 1; i++ )
{
if( !abs( recCoeff[ind * MAX_NUM_ALF_LUMA_COEFF + i] ) )
continue;
int coeffVal = abs( clipp[ind * MAX_NUM_ALF_LUMA_COEFF + i] );
for( int k = 1; k < 15; k++ )
{
bitsCoeffScan[alfShape.golombIdx[i]][k] += EncAdaptiveLoopFilter::lengthGolomb( coeffVal, k, false );
}
}
}
}
kMin = EncAdaptiveLoopFilter::getGolombKMin( alfShape, numFilters, kMinTab, bitsCoeffScan );
// Golomb parameters
WRITE_UVLC( kMin - 1, "clip_min_golomb_order" );
for( int idx = 0; idx < maxGolombIdx; idx++ )
{
bool golombOrderIncreaseFlag = ( kMinTab[idx] != kMin ) ? true : false;
CHECK( !( kMinTab[idx] <= kMin + 1 ), "ALF Golomb parameter not consistent" );
WRITE_FLAG( golombOrderIncreaseFlag, "clip_golomb_order_increase_flag" );
kMin = kMinTab[idx];
}
// Filter coefficients
for( int ind = 0; ind < numFilters; ++ind )
{
if( !isChroma && !alfSliceParam.alfLumaCoeffFlag[ind] && alfSliceParam.alfLumaCoeffDeltaFlag )
{
continue;
}
for( int i = 0; i < alfShape.numCoeff - 1; i++ )
{
if( !abs( recCoeff[ind * MAX_NUM_ALF_LUMA_COEFF + i] ) )
continue;
alfGolombEncode( clipp[ind* MAX_NUM_ALF_LUMA_COEFF + i], kMinTab[alfShape.golombIdx[i]], false ); // alf_coeff_chroma[i], alf_coeff_luma_delta[i][j]
}
}
}
#endif
}
void HLSWriter::xWriteTruncBinCode( uint32_t uiSymbol, const int uiMaxSymbol )
......
......@@ -149,7 +149,11 @@ public:
private:
void xWriteTruncBinCode( uint32_t uiSymbol, const int uiMaxSymbol );
#if JVET_N0242_NON_LINEAR_ALF
void alfGolombEncode( const int coeff, const int k, const bool signed_coeff=true );
#else
void alfGolombEncode( const int coeff, const int k );
#endif
void truncatedUnaryEqProb( int symbol, int maxSymbol );
void codeReshaper ( const SliceReshapeInfo& pSliceReshaperInfo, const SPS* pcSPS, const bool isIntra);
......
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