Commit 5fb7bcc5 authored by Karsten Suehring's avatar Karsten Suehring Committed by Xiang Li

Macro removal M-Meeting

parent 17706be6
......@@ -112,9 +112,7 @@ bool DecAppCfg::parseCfg( int argc, char* argv[] )
"\t2: enable tool statistic\n"
"\t3: enable bit and tool statistic\n")
#endif
#if JVET_M0445_MCTS_DEC_CHECK
("MCTSCheck", m_mctsCheck, false, "If enabled, the decoder checks for violations of mc_exact_sample_value_match_flag in Temporal MCTS ")
#endif
;
po::setDefaults(opts);
......@@ -151,9 +149,7 @@ bool DecAppCfg::parseCfg( int argc, char* argv[] )
}
#endif
#if JVET_M0445_MCTS_DEC_CHECK
g_mctsDecCheckEnabled = m_mctsCheck;
#endif
// Chroma output bit-depth
if( m_outputBitDepth[CHANNEL_TYPE_LUMA] != 0 && m_outputBitDepth[CHANNEL_TYPE_CHROMA] == 0 )
{
......@@ -236,9 +232,7 @@ DecAppCfg::DecAppCfg()
, m_bClipOutputVideoToRec709Range(false)
, m_packedYUVMode(false)
, m_statMode(0)
#if JVET_M0445_MCTS_DEC_CHECK
, m_mctsCheck(false)
#endif
{
for (uint32_t channelTypeIndex = 0; channelTypeIndex < MAX_NUM_CHANNEL_TYPE; channelTypeIndex++)
{
......
......@@ -73,9 +73,7 @@ protected:
bool m_packedYUVMode; ///< If true, output 10-bit and 12-bit YUV data as 5-byte and 3-byte (respectively) packed YUV data
std::string m_cacheCfgFile; ///< Config file of cache model
int m_statMode; ///< Config statistic mode (0 - bit stat, 1 - tool stat, 3 - both)
#if JVET_M0445_MCTS_DEC_CHECK
bool m_mctsCheck;
#endif
public:
DecAppCfg();
......
......@@ -121,40 +121,20 @@ void EncApp::xInitLibCfg()
m_cEncLib.setNoSaoConstraintFlag ( !m_bUseSAO );
m_cEncLib.setNoAlfConstraintFlag ( !m_alf );
m_cEncLib.setNoPcmConstraintFlag ( !m_usePCM );
#if JVET_M0451_INTEROPERABILITY_POINT_SYNTAX
m_cEncLib.setNoRefWraparoundConstraintFlag ( m_bNoRefWraparoundConstraintFlag );
#endif
m_cEncLib.setNoTemporalMvpConstraintFlag ( m_TMVPModeId ? false : true );
m_cEncLib.setNoSbtmvpConstraintFlag ( m_SubPuMvpMode ? false : true );
m_cEncLib.setNoAmvrConstraintFlag ( m_bNoAmvrConstraintFlag );
#if JVET_M0451_INTEROPERABILITY_POINT_SYNTAX
m_cEncLib.setNoBdofConstraintFlag ( !m_BIO );
#endif
m_cEncLib.setNoCclmConstraintFlag ( m_LMChroma ? false : true );
#if JVET_M0464_UNI_MTS
#if JVET_M0303_IMPLICIT_MTS
m_cEncLib.setNoMtsConstraintFlag ( (m_MTS || m_MTSImplicit) ? false : true );
#else
m_cEncLib.setNoMtsConstraintFlag ( m_MTS ? false : true );
#endif
#else
#if JVET_M0303_IMPLICIT_MTS
m_cEncLib.setNoMtsConstraintFlag ( (m_EMT || m_MTSImplicit) ? false : true );
#else
m_cEncLib.setNoMtsConstraintFlag ( m_EMT ? false : true );
#endif
#endif
m_cEncLib.setNoAffineMotionConstraintFlag ( !m_Affine );
#if JVET_M0451_INTEROPERABILITY_POINT_SYNTAX
m_cEncLib.setNoGbiConstraintFlag ( !m_GBi );
m_cEncLib.setNoMhIntraConstraintFlag ( !m_MHIntra );
m_cEncLib.setNoTriangleConstraintFlag ( !m_Triangle );
#endif
m_cEncLib.setNoLadfConstraintFlag ( !m_LadfEnabed );
#if JVET_M0451_INTEROPERABILITY_POINT_SYNTAX
m_cEncLib.setNoCurrPicRefConstraintFlag ( !m_IBCMode );
m_cEncLib.setNoQpDeltaConstraintFlag ( m_bNoQpDeltaConstraintFlag );
#endif
m_cEncLib.setNoDepQuantConstraintFlag ( !m_depQuantEnabledFlag);
m_cEncLib.setNoSignDataHidingConstraintFlag ( !m_signDataHidingEnabledFlag );
......@@ -216,13 +196,8 @@ void EncApp::xInitLibCfg()
//====== Quality control ========
m_cEncLib.setMaxDeltaQP ( m_iMaxDeltaQP );
#if JVET_M0113_M0188_QG_SIZE
m_cEncLib.setCuQpDeltaSubdiv ( m_cuQpDeltaSubdiv );
m_cEncLib.setCuChromaQpOffsetSubdiv ( m_cuChromaQpOffsetSubdiv );
#else
m_cEncLib.setMaxCuDQPDepth ( m_iMaxCuDQPDepth );
m_cEncLib.setDiffCuChromaQpOffsetDepth ( m_diffCuChromaQpOffsetDepth );
#endif
m_cEncLib.setChromaCbQpOffset ( m_cbQpOffset );
m_cEncLib.setChromaCrQpOffset ( m_crQpOffset );
m_cEncLib.setChromaCbQpOffsetDualTree ( m_cbQpOffsetDualTree );
......@@ -274,26 +249,13 @@ void EncApp::xInitLibCfg()
m_cEncLib.setAffineType ( m_AffineType );
m_cEncLib.setBIO (m_BIO);
m_cEncLib.setUseLMChroma ( m_LMChroma );
#if JVET_M0142_CCLM_COLLOCATED_CHROMA
m_cEncLib.setCclmCollocatedChromaFlag ( m_cclmCollocatedChromaFlag );
#endif
#if JVET_M0464_UNI_MTS
m_cEncLib.setIntraMTS ( m_MTS & 1 );
m_cEncLib.setIntraMTSMaxCand ( m_MTSIntraMaxCand );
m_cEncLib.setInterMTS ( ( m_MTS >> 1 ) & 1 );
m_cEncLib.setInterMTSMaxCand ( m_MTSInterMaxCand );
#else
m_cEncLib.setIntraEMT ( m_EMT & 1 );
m_cEncLib.setFastIntraEMT ( m_FastEMT & m_EMT & 1 );
m_cEncLib.setInterEMT ( ( m_EMT >> 1 ) & 1 );
m_cEncLib.setFastInterEMT ( ( m_FastEMT >> 1 ) & ( m_EMT >> 1 ) & 1 );
#endif
#if JVET_M0303_IMPLICIT_MTS
m_cEncLib.setImplicitMTS ( m_MTSImplicit );
#endif
#if JVET_M0140_SBT
m_cEncLib.setUseSBT ( m_SBT );
#endif
m_cEncLib.setUseCompositeRef ( m_compositeRefEnabled );
m_cEncLib.setUseGBi ( m_GBi );
m_cEncLib.setUseGBiFast ( m_GBiFast );
......@@ -311,22 +273,12 @@ void EncApp::xInitLibCfg()
#endif
m_cEncLib.setUseMHIntra ( m_MHIntra );
m_cEncLib.setUseTriangle ( m_Triangle );
#if JVET_M0253_HASH_ME
m_cEncLib.setUseHashME ( m_HashME );
#endif
#if JVET_M0255_FRACMMVD_SWITCH
m_cEncLib.setAllowDisFracMMVD ( m_allowDisFracMMVD );
#endif
#if JVET_M0246_AFFINE_AMVR
m_cEncLib.setUseAffineAmvr ( m_AffineAmvr );
#endif
#if JVET_M0247_AFFINE_AMVR_ENCOPT
m_cEncLib.setUseAffineAmvrEncOpt ( m_AffineAmvrEncOpt );
#endif
#if JVET_M0147_DMVR
m_cEncLib.setDMVR ( m_DMVR );
#endif
m_cEncLib.setIBCMode ( m_IBCMode );
m_cEncLib.setIBCLocalSearchRangeX ( m_IBCLocalSearchRangeX );
m_cEncLib.setIBCLocalSearchRangeY ( m_IBCLocalSearchRangeY );
......@@ -347,9 +299,7 @@ void EncApp::xInitLibCfg()
#if MAX_TB_SIZE_SIGNALLING
m_cEncLib.setLog2MaxTbSize ( m_log2MaxTbSize );
#endif
#if JVET_M0428_ENC_DB_OPT
m_cEncLib.setUseEncDbOpt(m_encDbOpt);
#endif
m_cEncLib.setUseFastLCTU ( m_useFastLCTU );
m_cEncLib.setFastInterSearchMode ( m_fastInterSearchMode );
m_cEncLib.setUseEarlyCU ( m_bUseEarlyCU );
......@@ -382,9 +332,7 @@ void EncApp::xInitLibCfg()
m_cEncLib.setUseBLambdaForNonKeyLowDelayPictures ( m_bUseBLambdaForNonKeyLowDelayPictures );
m_cEncLib.setPCMLog2MinSize ( m_uiPCMLog2MinSize);
m_cEncLib.setUsePCM ( m_usePCM );
#if JVET_M0102_INTRA_SUBPARTITIONS
m_cEncLib.setUseFastISP ( m_useFastISP );
#endif
// set internal bit-depth and constants
for (uint32_t channelType = 0; channelType < MAX_NUM_CHANNEL_TYPE; channelType++)
......@@ -485,9 +433,7 @@ void EncApp::xInitLibCfg()
m_cEncLib.setSOPDescriptionSEIEnabled ( m_SOPDescriptionSEIEnabled );
m_cEncLib.setScalableNestingSEIEnabled ( m_scalableNestingSEIEnabled );
m_cEncLib.setTMCTSSEIEnabled ( m_tmctsSEIEnabled );
#if JVET_M0445_MCTS
m_cEncLib.setMCTSEncConstraint ( m_MCTSEncConstraint);
#endif
m_cEncLib.setTimeCodeSEIEnabled ( m_timeCodeSEIEnabled );
m_cEncLib.setNumberOfTimeSets ( m_timeCodeSEINumTs );
for(int i = 0; i < m_timeCodeSEINumTs; i++)
......@@ -611,9 +557,7 @@ void EncApp::xInitLibCfg()
m_cEncLib.setForceDecodeBitstream1 ( m_forceDecodeBitstream1 );
m_cEncLib.setStopAfterFFtoPOC ( m_stopAfterFFtoPOC );
m_cEncLib.setBs2ModPOCAndType ( m_bs2ModPOCAndType );
#if JVET_M0055_DEBUG_CTU
m_cEncLib.setDebugCTU ( m_debugCTU );
#endif
#if ENABLE_SPLIT_PARALLELISM
m_cEncLib.setNumSplitThreads ( m_numSplitThreads );
m_cEncLib.setForceSingleSplitThread ( m_forceSplitSequential );
......@@ -625,12 +569,10 @@ void EncApp::xInitLibCfg()
#endif
m_cEncLib.setUseALF ( m_alf );
#if JVET_M0427_INLOOP_RESHAPER
m_cEncLib.setReshaper ( m_lumaReshapeEnable );
m_cEncLib.setReshapeSignalType ( m_reshapeSignalType );
m_cEncLib.setReshapeIntraCMD ( m_intraCMD );
m_cEncLib.setReshapeCW ( m_reshapeCW );
#endif
}
void EncApp::xCreateLib( std::list<PelUnitBuf*>& recBufList
......@@ -919,9 +861,7 @@ void EncApp::rateStatsAccum(const AccessUnit& au, const std::vector<uint32_t>& a
#endif
case NAL_UNIT_SPS:
case NAL_UNIT_PPS:
#if JVET_M0132_APS
case NAL_UNIT_APS:
#endif
m_essentialBytes += *it_stats;
break;
default:
......@@ -938,11 +878,7 @@ void EncApp::printRateSummary()
msg( DETAILS,"Bytes written to file: %u (%.3f kbps)\n", m_totalBytes, 0.008 * m_totalBytes / time );
if (m_summaryVerboseness > 0)
{
#if JVET_M0132_APS
msg(DETAILS, "Bytes for SPS/PPS/APS/Slice (Incl. Annex B): %u (%.3f kbps)\n", m_essentialBytes, 0.008 * m_essentialBytes / time);
#else
msg( DETAILS,"Bytes for SPS/PPS/Slice (Incl. Annex B): %u (%.3f kbps)\n", m_essentialBytes, 0.008 * m_essentialBytes / time );
#endif
}
}
......
This diff is collapsed.
......@@ -125,28 +125,20 @@ protected:
bool m_bNoSaoConstraintFlag;
bool m_bNoAlfConstraintFlag;
bool m_bNoPcmConstraintFlag;
#if JVET_M0451_INTEROPERABILITY_POINT_SYNTAX
bool m_bNoRefWraparoundConstraintFlag;
#endif
bool m_bNoTemporalMvpConstraintFlag;
bool m_bNoSbtmvpConstraintFlag;
bool m_bNoAmvrConstraintFlag;
#if JVET_M0451_INTEROPERABILITY_POINT_SYNTAX
bool m_bNoBdofConstraintFlag;
#endif
bool m_bNoCclmConstraintFlag;
bool m_bNoMtsConstraintFlag;
bool m_bNoAffineMotionConstraintFlag;
#if JVET_M0451_INTEROPERABILITY_POINT_SYNTAX
bool m_bNoGbiConstraintFlag;
bool m_bNoMhIntraConstraintFlag;
bool m_bNoTriangleConstraintFlag;
#endif
bool m_bNoLadfConstraintFlag;
#if JVET_M0451_INTEROPERABILITY_POINT_SYNTAX
bool m_bNoCurrPicRefConstraintFlag;
bool m_bNoQpDeltaConstraintFlag;
#endif
bool m_bNoDepQuantConstraintFlag;
bool m_bNoSignDataHidingConstraintFlag;
......@@ -186,9 +178,7 @@ protected:
bool m_rdpcmEnabledFlag[NUMBER_OF_RDPCM_SIGNALLING_MODES];///< control flags for residual DPCM
bool m_persistentRiceAdaptationEnabledFlag; ///< control flag for Golomb-Rice parameter adaptation over each slice
bool m_cabacBypassAlignmentEnabledFlag;
#if JVET_M0102_INTRA_SUBPARTITIONS
bool m_useFastISP; ///< flag for enabling fast methods for ISP
#endif
// coding quality
#if QP_SWITCHING_FOR_PARALLEL
......@@ -205,13 +195,8 @@ protected:
int* m_aidQP; ///< array of slice QP values
int m_iMaxDeltaQP; ///< max. |delta QP|
uint32_t m_uiDeltaQpRD; ///< dQP range for multi-pass slice QP optimization
#if JVET_M0113_M0188_QG_SIZE
int m_cuQpDeltaSubdiv; ///< Maximum subdiv for CU luma Qp adjustment (0:default)
int m_cuChromaQpOffsetSubdiv; ///< If negative, then do not apply chroma qp offsets.
#else
int m_iMaxCuDQPDepth; ///< Max. depth for a minimum CuDQPSize (0:default)
int m_diffCuChromaQpOffsetDepth; ///< If negative, then do not apply chroma qp offsets.
#endif
bool m_bFastDeltaQP; ///< Fast Delta QP (false:default)
int m_cbQpOffset; ///< Chroma Cb QP Offset (0:default)
......@@ -251,23 +236,12 @@ protected:
bool m_AffineType;
bool m_BIO;
int m_LMChroma;
#if JVET_M0142_CCLM_COLLOCATED_CHROMA
bool m_cclmCollocatedChromaFlag;
#endif
#if JVET_M0464_UNI_MTS
int m_MTS; ///< XZ: Multiple Transform Set
int m_MTSIntraMaxCand; ///< XZ: Number of additional candidates to test
int m_MTSInterMaxCand; ///< XZ: Number of additional candidates to test
#else
int m_EMT; ///< XZ: Enhanced Multiple Transform
int m_FastEMT; ///< XZ: Fast Methods of Enhanced Multiple Transform
#endif
#if JVET_M0303_IMPLICIT_MTS
int m_MTSImplicit;
#endif
#if JVET_M0140_SBT
bool m_SBT; ///< Sub-Block Transform for inter blocks
#endif
bool m_compositeRefEnabled;
bool m_GBi;
......@@ -281,21 +255,11 @@ protected:
bool m_MHIntra;
bool m_Triangle;
#if JVET_M0253_HASH_ME
bool m_HashME;
#endif
#if JVET_M0255_FRACMMVD_SWITCH
bool m_allowDisFracMMVD;
#endif
#if JVET_M0246_AFFINE_AMVR
bool m_AffineAmvr;
#endif
#if JVET_M0247_AFFINE_AMVR_ENCOPT
bool m_AffineAmvrEncOpt;
#endif
#if JVET_M0147_DMVR
bool m_DMVR;
#endif
unsigned m_IBCMode;
unsigned m_IBCLocalSearchRangeX;
......@@ -309,15 +273,11 @@ protected:
unsigned m_wrapAroundOffset;
// ADD_NEW_TOOL : (encoder app) add tool enabling flags and associated parameters here
#if JVET_M0427_INLOOP_RESHAPER
bool m_lumaReshapeEnable;
uint32_t m_reshapeSignalType;
uint32_t m_intraCMD;
ReshapeCW m_reshapeCW;
#endif
#if JVET_M0428_ENC_DB_OPT
bool m_encDbOpt;
#endif
unsigned m_uiMaxCUWidth; ///< max. CU width in pixel
unsigned m_uiMaxCUHeight; ///< max. CU height in pixel
unsigned m_uiMaxCUDepth; ///< max. CU depth (as specified by command line)
......@@ -498,9 +458,7 @@ protected:
uint32_t m_greenMetadataType;
uint32_t m_xsdMetricType;
#if JVET_M0445_MCTS
bool m_MCTSEncConstraint;
#endif
// weighted prediction
bool m_useWeightedPred; ///< Use of weighted prediction in P slices
......@@ -589,9 +547,7 @@ protected:
int m_verbosity;
std::string m_decodeBitstreams[2]; ///< filename for decode bitstreams.
#if JVET_M0055_DEBUG_CTU
int m_debugCTU;
#endif
int m_switchPOC; ///< dbg poc.
int m_switchDQP; ///< switch DQP.
int m_fastForwardToPOC; ///< get to encoding the specified POC as soon as possible by skipping temporal layers irrelevant for the specified POC
......
......@@ -181,9 +181,7 @@ const char * NALU_TYPE[] =
"NAL_UNIT_SPS",
"NAL_UNIT_PPS",
#if JVET_M0132_APS
"NAL_UNIT_APS",
#endif
"NAL_UNIT_ACCESS_UNIT_DELIMITER",
"NAL_UNIT_EOS",
"NAL_UNIT_EOB",
......@@ -266,9 +264,6 @@ std::vector<uint8_t> filter_segment(const std::vector<uint8_t> & v, int idx, int
int poc = -1;
int poc_lsb = -1;
int new_poc = -1;
#if PRINT_NALUS
printf("NALU type: %s\n", NALU_TYPE[nalu_type]);
#endif
if(nalu_type == NAL_UNIT_CODED_SLICE_IDR_W_RADL || nalu_type == NAL_UNIT_CODED_SLICE_IDR_N_LP)
{
......@@ -339,11 +334,7 @@ std::vector<uint8_t> filter_segment(const std::vector<uint8_t> & v, int idx, int
#if HEVC_VPS
if((idx > 1 && (nalu_type == NAL_UNIT_CODED_SLICE_IDR_W_RADL || nalu_type == NAL_UNIT_CODED_SLICE_IDR_N_LP )) || ((idx>1 && !idr_found) && ( nalu_type == NAL_UNIT_VPS || nalu_type == NAL_UNIT_SPS || nalu_type == NAL_UNIT_PPS))
#else
#if JVET_M0132_APS
if((idx > 1 && (nalu_type == NAL_UNIT_CODED_SLICE_IDR_W_RADL || nalu_type == NAL_UNIT_CODED_SLICE_IDR_N_LP)) || ((idx > 1 && !idr_found) && (nalu_type == NAL_UNIT_SPS || nalu_type == NAL_UNIT_PPS || nalu_type == NAL_UNIT_APS))
#else
if((idx > 1 && (nalu_type == NAL_UNIT_CODED_SLICE_IDR_W_RADL || nalu_type == NAL_UNIT_CODED_SLICE_IDR_N_LP)) || ((idx > 1 && !idr_found) && (nalu_type == NAL_UNIT_SPS || nalu_type == NAL_UNIT_PPS ))
#endif
#endif
|| (nalu_type == NAL_UNIT_SUFFIX_SEI && skip_next_sei))
{
......
......@@ -104,13 +104,9 @@ void AdaptiveLoopFilter::ALFProcess( CodingStructure& cs, AlfSliceParam& alfSlic
{
Area blk( xPos, yPos, width, height );
deriveClassification( m_classifier, tmpYuv.get( COMPONENT_Y ), blk );
#if JVET_M0277_FIX_PCM_DISABLEFILTER
Area blkPCM(xPos, yPos, width, height);
resetPCMBlkClassInfo(cs, m_classifier, tmpYuv.get(COMPONENT_Y), blkPCM);
m_filter7x7Blk(m_classifier, recYuv, tmpYuv, blk, COMPONENT_Y, m_coeffFinal, m_clpRngs.comp[COMPONENT_Y], cs );
#else
m_filter7x7Blk(m_classifier, recYuv, tmpYuv, blk, COMPONENT_Y, m_coeffFinal, m_clpRngs.comp[COMPONENT_Y] );
#endif
}
for( int compIdx = 1; compIdx < MAX_NUM_COMPONENT; compIdx++ )
......@@ -123,11 +119,7 @@ void AdaptiveLoopFilter::ALFProcess( CodingStructure& cs, AlfSliceParam& alfSlic
{
Area blk( xPos >> chromaScaleX, yPos >> chromaScaleY, width >> chromaScaleX, height >> chromaScaleY );
#if JVET_M0277_FIX_PCM_DISABLEFILTER
m_filter5x5Blk( m_classifier, recYuv, tmpYuv, blk, compID, alfSliceParam.chromaCoeff, m_clpRngs.comp[compIdx], cs );
#else
m_filter5x5Blk( m_classifier, recYuv, tmpYuv, blk, compID, alfSliceParam.chromaCoeff, m_clpRngs.comp[compIdx] );
#endif
}
}
ctuIdx++;
......@@ -282,7 +274,6 @@ void AdaptiveLoopFilter::deriveClassification( AlfClassifier** classifier, const
}
}
}
#if JVET_M0277_FIX_PCM_DISABLEFILTER
void AdaptiveLoopFilter::resetPCMBlkClassInfo(CodingStructure & cs, AlfClassifier** classifier, const CPelBuf& srcLuma, const Area& blk)
{
if ( !cs.sps->getPCMFilterDisableFlag() )
......@@ -332,7 +323,6 @@ void AdaptiveLoopFilter::resetPCMBlkClassInfo(CodingStructure & cs, AlfClassifi
}
}
}
#endif
void AdaptiveLoopFilter::deriveClassificationBlk( AlfClassifier** classifier, int** laplacian[NUM_DIRECTIONS], const CPelBuf& srcLuma, const Area& blk, const int shift )
{
......@@ -506,23 +496,17 @@ void AdaptiveLoopFilter::deriveClassificationBlk( AlfClassifier** classifier, in
}
template<AlfFilterType filtType>
#if JVET_M0277_FIX_PCM_DISABLEFILTER
void AdaptiveLoopFilter::filterBlk( AlfClassifier** classifier, const PelUnitBuf &recDst, const CPelUnitBuf& recSrc, const Area& blk, const ComponentID compId, short* filterSet, const ClpRng& clpRng, CodingStructure& cs )
#else
void AdaptiveLoopFilter::filterBlk( AlfClassifier** classifier, const PelUnitBuf &recDst, const CPelUnitBuf& recSrc, const Area& blk, const ComponentID compId, short* filterSet, const ClpRng& clpRng )
#endif
{
const bool bChroma = isChroma( compId );
if( bChroma )
{
CHECK( filtType != 0, "Chroma needs to have filtType == 0" );
}
#if JVET_M0277_FIX_PCM_DISABLEFILTER
const SPS* sps = cs.slice->getSPS();
bool isDualTree =CS::isDualITree(cs);
bool isPCMFilterDisabled = sps->getPCMFilterDisableFlag();
ChromaFormat nChromaFormat = sps->getChromaFormatIdc();
#endif
const CPelBuf srcLuma = recSrc.get( compId );
PelBuf dstLuma = recDst.get( compId );
......@@ -589,15 +573,12 @@ void AdaptiveLoopFilter::filterBlk( AlfClassifier** classifier, const PelUnitBuf
{
AlfClassifier& cl = pClass[j];
transposeIdx = cl.transposeIdx;
#if JVET_M0277_FIX_PCM_DISABLEFILTER
if( isPCMFilterDisabled && cl.classIdx== m_ALF_UNUSED_CLASSIDX && transposeIdx== m_ALF_UNUSED_TRANSPOSIDX )
{
continue;
}
#endif
coef = filterSet + cl.classIdx * MAX_NUM_ALF_LUMA_COEFF;
}
#if JVET_M0277_FIX_PCM_DISABLEFILTER
else if( isPCMFilterDisabled )
{
int blkX, blkY;
......@@ -621,7 +602,6 @@ void AdaptiveLoopFilter::filterBlk( AlfClassifier** classifier, const PelUnitBuf
continue;
}
}
#endif
if( filtType == ALF_FILTER_7 )
......
......@@ -41,9 +41,7 @@
#include "CommonDef.h"
#include "Unit.h"
#if JVET_M0277_FIX_PCM_DISABLEFILTER
#include "UnitTools.h"
#endif
struct AlfClassifier
{
AlfClassifier() {}
......@@ -70,10 +68,8 @@ class AdaptiveLoopFilter
public:
static constexpr int m_NUM_BITS = 8;
static constexpr int m_CLASSIFICATION_BLK_SIZE = 32; //non-normative, local buffer size
#if JVET_M0277_FIX_PCM_DISABLEFILTER
static constexpr int m_ALF_UNUSED_CLASSIDX = 255;
static constexpr int m_ALF_UNUSED_TRANSPOSIDX = 255;
#endif
AdaptiveLoopFilter();
virtual ~AdaptiveLoopFilter() {}
......@@ -84,28 +80,17 @@ public:
void destroy();
static void deriveClassificationBlk( AlfClassifier** classifier, int** laplacian[NUM_DIRECTIONS], const CPelBuf& srcLuma, const Area& blk, const int shift );
void deriveClassification( AlfClassifier** classifier, const CPelBuf& srcLuma, const Area& blk );
#if JVET_M0277_FIX_PCM_DISABLEFILTER
void resetPCMBlkClassInfo(CodingStructure & cs, AlfClassifier** classifier, const CPelBuf& srcLuma, const Area& blk);
#endif
template<AlfFilterType filtType>
#if JVET_M0277_FIX_PCM_DISABLEFILTER
static void filterBlk( AlfClassifier** classifier, const PelUnitBuf &recDst, const CPelUnitBuf& recSrc, const Area& blk, const ComponentID compId, short* filterSet, 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 );
#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_M0277_FIX_PCM_DISABLEFILTER
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 );
#else
void( *m_filter5x5Blk )( AlfClassifier** classifier, const PelUnitBuf &recDst, const CPelUnitBuf& recSrc, const Area& blk, const ComponentID compId, short* filterSet, const ClpRng& clpRng );
void( *m_filter7x7Blk )( AlfClassifier** classifier, const PelUnitBuf &recDst, const CPelUnitBuf& recSrc, const Area& blk, const ComponentID compId, short* filterSet, const ClpRng& clpRng );
#endif
#ifdef TARGET_SIMD_X86
void initAdaptiveLoopFilterX86();
......
/* The copyright in this software is being made available under the BSD
* License, included below. This software may be subject to other third party
* and contributor rights, including patent rights, and no such rights are
* granted under this license.
*
* Copyright (c) 2010-2019, ITU/ISO/IEC
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* * Neither the name of the ITU/ISO/IEC nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
/** \file BinaryDecisionTree.cpp
* \brief defines a binary decision tree that can be used for automated optimal coding of multi-level decisions
*/
#include "BinaryDecisionTree.h"
#include "CommonDef.h"
#if !REMOVE_BIN_DECISION_TREE
#include <algorithm>
struct DecisionTreeBuilder
{
DecisionTreeBuilder( unsigned _id, unsigned _depth = 0 ) : left( nullptr ), right( nullptr ), depth( _depth ), id( _id ) { }
DecisionTreeBuilder* left;
DecisionTreeBuilder* right;
unsigned depth;
unsigned id;
};
DecisionTreeBuilder* decision( unsigned id, unsigned id0, unsigned id1 )
{
DecisionTreeBuilder* dtb = new DecisionTreeBuilder( id, 1 );
dtb->left = new DecisionTreeBuilder( id0 );
dtb->right = new DecisionTreeBuilder( id1 );
return dtb;
}
DecisionTreeBuilder* decision( unsigned id, DecisionTreeBuilder* sub0, unsigned id1 )
{
DecisionTreeBuilder* dtb = new DecisionTreeBuilder( id, sub0->depth + 1 );
dtb->left = sub0;
dtb->right = new DecisionTreeBuilder( id1, sub0->depth );
return dtb;
}
DecisionTreeBuilder* decision( unsigned id, DecisionTreeBuilder* sub0, DecisionTreeBuilder* sub1 )
{
DecisionTreeBuilder* dtb = new DecisionTreeBuilder( id, std::max( sub0->depth, sub1->depth ) + 1 );
dtb->left = sub0;
dtb->right = sub1;
return dtb;
}
DecisionTreeBuilder* decision( unsigned id, unsigned id0, DecisionTreeBuilder* sub1 )
{
DecisionTreeBuilder* dtb = new DecisionTreeBuilder( id, sub1->depth + 1 );
dtb->left = new DecisionTreeBuilder( id0, sub1->depth );
dtb->right = sub1;
return dtb;
}
DecisionTreeTemplate::DecisionTreeTemplate( unsigned _depth )
{
depth = _depth;
unsigned maxIds = 2 * ( 1u << depth );
memset( ids, 0xff, maxIds * sizeof( unsigned ) );
memset( hasSub, true, maxIds * sizeof( bool ) );
memset( mapping, 0xff, maxIds * sizeof( unsigned ) );
}
void compile( DecisionTreeTemplate& dtt, unsigned offset, unsigned depth, DecisionTreeBuilder* dtb )
{
dtt.ids[offset] = dtb->id;
if( dtb->left || dtb->right )
{
dtt.hasSub[offset] = true;
if( dtb->right )
{
compile( dtt, offset + 1, depth - 1, dtb->right );
}
if( dtb->left )
{
compile( dtt, offset + ( 1u << depth ), depth - 1, dtb->left );
}
}
else
{