Commit 09ecac62 authored by Karl Sharman's avatar Karl Sharman
Browse files

remove macro ADD_RESET_ENCODER_DECISIONS_AFTER_IRAP

parent 36243477
......@@ -964,11 +964,7 @@ Bool TAppEncCfg::parseCfg( Int argc, TChar* argv[] )
("SaoEncodingRateChroma", m_saoEncodingRateChroma, 0.5, "The SAO early picture termination rate to use for chroma (when m_SaoEncodingRate is >0). If <=0, use results for luma")
("MaxNumOffsetsPerPic", m_maxNumOffsetsPerPic, 2048, "Max number of SAO offset per picture (Default: 2048)")
("SAOLcuBoundary", m_saoCtuBoundary, false, "0: right/bottom CTU boundary areas skipped from SAO parameter estimation, 1: non-deblocked pixels are used for those areas")
#if ADD_RESET_ENCODER_DECISIONS_AFTER_IRAP
("ResetEncoderStateAfterIRAP", m_resetEncoderStateAfterIRAP, true, "When true, resets the encoder's decisions after an IRAP (POC order). Enabled by default.")
#else
("SAOResetEncoderStateAfterIRAP", m_saoResetEncoderStateAfterIRAP, false, "When true, resets the encoder's SAO state after an IRAP (POC order). Disabled by default.")
#endif
("SliceMode", tmpSliceMode, Int(NO_SLICES), "0: Disable all Recon slice limits, 1: Enforce max # of CTUs, 2: Enforce max # of bytes, 3:specify tiles per dependent slice")
("SliceArgument", m_sliceArgument, 0, "Depending on SliceMode being:"
"\t1: max number of CTUs per slice"
......@@ -2314,8 +2310,6 @@ Void TAppEncCfg::xCheckParameter()
{
xConfirmPara( m_iIntraPeriod > 0 && m_iIntraPeriod <= m_iGOPSize , "Intra period must be larger than GOP size for periodic IDR pictures");
}
#if !ADD_RESET_ENCODER_DECISIONS_AFTER_IRAP
#endif
xConfirmPara( m_uiMaxCUDepth < 1, "MaxPartitionDepth must be greater than zero");
xConfirmPara( (m_uiMaxCUWidth >> m_uiMaxCUDepth) < 4, "Minimum partition width size should be larger than or equal to 8");
xConfirmPara( (m_uiMaxCUHeight >> m_uiMaxCUDepth) < 4, "Minimum partition height size should be larger than or equal to 8");
......
......@@ -225,11 +225,7 @@ protected:
Double m_saoEncodingRateChroma; ///< The SAO early picture termination rate to use for chroma (when m_SaoEncodingRate is >0). If <=0, use results for luma.
Int m_maxNumOffsetsPerPic; ///< SAO maximun number of offset per picture
Bool m_saoCtuBoundary; ///< SAO parameter estimation using non-deblocked pixels for CTU bottom and right boundary areas
#if ADD_RESET_ENCODER_DECISIONS_AFTER_IRAP
Bool m_resetEncoderStateAfterIRAP; ///< When true, encoder state will be reset following an IRAP.
#else
Bool m_saoResetEncoderStateAfterIRAP; ///< When true, SAO encoder state will be reset following an IRAP.
#endif
// coding tools (loop filter)
Bool m_bLoopFilterDisable; ///< flag for using deblocking filter
Bool m_loopFilterOffsetInPPS; ///< offset for deblocking filter in 0 = slice header, 1 = PPS
......
......@@ -282,11 +282,7 @@ Void TAppEncTop::xInitLibCfg()
m_cTEncTop.setMaxNumOffsetsPerPic ( m_maxNumOffsetsPerPic);
m_cTEncTop.setSaoCtuBoundary ( m_saoCtuBoundary);
#if ADD_RESET_ENCODER_DECISIONS_AFTER_IRAP
m_cTEncTop.setResetEncoderStateAfterIRAP ( m_resetEncoderStateAfterIRAP );
#else
m_cTEncTop.setSaoResetEncoderStateAfterIRAP ( m_saoResetEncoderStateAfterIRAP);
#endif
m_cTEncTop.setPCMInputBitDepthFlag ( m_bPCMInputBitDepthFlag);
m_cTEncTop.setPCMFilterDisableFlag ( m_bPCMFilterDisableFlag);
......
......@@ -104,7 +104,6 @@
#define SHUTTER_INTERVAL_SEI_MESSAGE 1 ///< support for shutter interval SEI message
#define SEI_ENCODER_CONTROL 1 ///< add encoder control for the following SEI: film grain characteristics, content light level, ambient viewing environment
#define ADD_RESET_ENCODER_DECISIONS_AFTER_IRAP 1 // Add support to reseting encoder decisions after IRAP, to enable independent/parallel coding of randomaccess configuration intra-periods.
#define DPB_ENCODER_USAGE_CHECK 1 ///< Adds DPB encoder usage check.
......
......@@ -213,11 +213,7 @@ protected:
Double m_saoEncodingRateChroma; // The SAO early picture termination rate to use for chroma (when m_SaoEncodingRate is >0). If <=0, use results for luma.
Int m_maxNumOffsetsPerPic;
Bool m_saoCtuBoundary;
#if ADD_RESET_ENCODER_DECISIONS_AFTER_IRAP
Bool m_resetEncoderStateAfterIRAP;
#else
Bool m_saoResetEncoderStateAfterIRAP;
#endif
//====== Motion search ========
Bool m_bDisableIntraPUsInInterSlices;
......@@ -845,13 +841,8 @@ public:
Int getMaxNumOffsetsPerPic () { return m_maxNumOffsetsPerPic; }
Void setSaoCtuBoundary (Bool val) { m_saoCtuBoundary = val; }
Bool getSaoCtuBoundary () { return m_saoCtuBoundary; }
#if ADD_RESET_ENCODER_DECISIONS_AFTER_IRAP
Void setResetEncoderStateAfterIRAP(Bool b) { m_resetEncoderStateAfterIRAP = b; }
Bool getResetEncoderStateAfterIRAP() const { return m_resetEncoderStateAfterIRAP; }
#else
Void setSaoResetEncoderStateAfterIRAP(Bool b) { m_saoResetEncoderStateAfterIRAP = b; }
Bool getSaoResetEncoderStateAfterIRAP() const { return m_saoResetEncoderStateAfterIRAP; }
#endif
Void setLFCrossTileBoundaryFlag ( Bool val ) { m_loopFilterAcrossTilesEnabledFlag = val; }
Bool getLFCrossTileBoundaryFlag () { return m_loopFilterAcrossTilesEnabledFlag; }
Void setTileUniformSpacingFlag ( Bool b ) { m_tileUniformSpacingFlag = b; }
......
......@@ -74,9 +74,7 @@ Int getLSB(Int poc, Int maxLSB)
TEncGOP::TEncGOP()
{
m_iLastIDR = 0;
#if ADD_RESET_ENCODER_DECISIONS_AFTER_IRAP
m_RASPOCforResetEncoder = MAX_INT;
#endif
m_iGopSize = 0;
m_iNumPicCoded = 0; //Niko
......@@ -1488,7 +1486,6 @@ Void TEncGOP::compressGOP( Int iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rc
}
#if ADD_RESET_ENCODER_DECISIONS_AFTER_IRAP
if (pcSlice->getPOC() > m_RASPOCforResetEncoder && m_pcCfg->getResetEncoderStateAfterIRAP())
{
// need to reset encoder decisions.
......@@ -1504,7 +1501,6 @@ Void TEncGOP::compressGOP( Int iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rc
{
m_RASPOCforResetEncoder = pcSlice->getPOC();
}
#endif
pcSlice->setEncCABACTableIdx(m_pcSliceEncoder->getEncCABACTableIdx());
#if MCTS_EXTRACTION
......@@ -1835,12 +1831,7 @@ Void TEncGOP::compressGOP( Int iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rc
m_pcCfg->getTestSAODisableAtPictureLevel(),
m_pcCfg->getSaoEncodingRate(),
m_pcCfg->getSaoEncodingRateChroma(),
#if ADD_RESET_ENCODER_DECISIONS_AFTER_IRAP
m_pcCfg->getSaoCtuBoundary());
#else
m_pcCfg->getSaoCtuBoundary(),
m_pcCfg->getSaoResetEncoderStateAfterIRAP());
#endif
m_pcSAO->PCMLFDisableProcess(pcPic);
m_pcEncTop->getRDGoOnSbacCoder()->setBitstream(NULL);
......
......@@ -107,9 +107,7 @@ private:
UInt m_ltRefPicPocLsbSps[MAX_NUM_LONG_TERM_REF_PICS];
Bool m_ltRefPicUsedByCurrPicFlag[MAX_NUM_LONG_TERM_REF_PICS];
Int m_iLastIDR;
#if ADD_RESET_ENCODER_DECISIONS_AFTER_IRAP
Int m_RASPOCforResetEncoder; // an IDR POC number, after which the next POC (in output order) will be reset. If MAX_INT, then no reset is pending.
#endif
Int m_iGopSize;
Int m_iNumPicCoded;
Bool m_bFirst;
......
......@@ -119,9 +119,6 @@ Void TEncSampleAdaptiveOffset::createEncData(Bool isPreDBFSamplesUsed)
}
::memset(m_saoDisabledRate, 0, sizeof(m_saoDisabledRate));
#if !ADD_RESET_ENCODER_DECISIONS_AFTER_IRAP
m_lastIRAPPoc = MAX_INT;
#endif
for(Int typeIdc=0; typeIdc < NUM_SAO_NEW_TYPES; typeIdc++)
{
......@@ -240,11 +237,7 @@ Void TEncSampleAdaptiveOffset::initRDOCabacCoder(TEncSbac* pcRDGoOnSbacCoder, TC
}
#if ADD_RESET_ENCODER_DECISIONS_AFTER_IRAP
Void TEncSampleAdaptiveOffset::SAOProcess(TComPic* pPic, Bool* sliceEnabled, const Double *lambdas, const Bool bTestSAODisableAtPictureLevel, const Double saoEncodingRate, const Double saoEncodingRateChroma, const Bool isPreDBFSamplesUsed )
#else
Void TEncSampleAdaptiveOffset::SAOProcess(TComPic* pPic, Bool* sliceEnabled, const Double *lambdas, const Bool bTestSAODisableAtPictureLevel, const Double saoEncodingRate, const Double saoEncodingRateChroma, const Bool isPreDBFSamplesUsed, const Bool bResetStateAfterIRAP )
#endif
{
TComPicYuv* orgYuv= pPic->getPicYuvOrg();
TComPicYuv* resYuv= pPic->getPicYuvRec();
......@@ -262,11 +255,7 @@ Void TEncSampleAdaptiveOffset::SAOProcess(TComPic* pPic, Bool* sliceEnabled, con
}
//slice on/off
#if ADD_RESET_ENCODER_DECISIONS_AFTER_IRAP
decidePicParams(sliceEnabled, pPic, saoEncodingRate, saoEncodingRateChroma);
#else
decidePicParams(sliceEnabled, pPic, saoEncodingRate, saoEncodingRateChroma, bResetStateAfterIRAP);
#endif
//block on/off
SAOBlkParam* reconParams = new SAOBlkParam[m_numCTUsPic]; //temporary parameter buffer for storing reconstructed SAO parameters
decideBlkParams(pPic, sliceEnabled, m_statData, srcYuv, resYuv, reconParams, pPic->getPicSym()->getSAOBlkParam(), bTestSAODisableAtPictureLevel, saoEncodingRate, saoEncodingRateChroma);
......@@ -339,7 +328,6 @@ Void TEncSampleAdaptiveOffset::getStatistics(SAOStatData*** blkStats, TComPicYuv
}
}
#if ADD_RESET_ENCODER_DECISIONS_AFTER_IRAP
Void TEncSampleAdaptiveOffset::resetEncoderDecisions()
{
for (Int compIdx = 0; compIdx < MAX_NUM_COMPONENT; compIdx++)
......@@ -353,25 +341,6 @@ Void TEncSampleAdaptiveOffset::resetEncoderDecisions()
Void TEncSampleAdaptiveOffset::decidePicParams(Bool* sliceEnabled, const TComPic* pic, const Double saoEncodingRate, const Double saoEncodingRateChroma)
{
#else
Void TEncSampleAdaptiveOffset::decidePicParams(Bool* sliceEnabled, const TComPic* pic, const Double saoEncodingRate, const Double saoEncodingRateChroma, const Bool bResetStateAfterIRAP)
{
if (bResetStateAfterIRAP && pic->getSlice(0)->getPOC() > m_lastIRAPPoc)
{ // reset
for (Int compIdx = 0; compIdx < MAX_NUM_COMPONENT; compIdx++)
{
for (Int tempLayer = 1; tempLayer < MAX_TLAYER; tempLayer++)
{
m_saoDisabledRate[compIdx][tempLayer] = 0.0;
}
}
m_lastIRAPPoc = MAX_INT;
}
if (pic->getSlice(0)->isIRAP())
{
m_lastIRAPPoc = pic->getSlice(0)->getPOC();
}
#endif
const Int picTempLayer = pic->getSlice(0)->getDepth();
//decide sliceEnabled[compIdx]
......
......@@ -102,21 +102,13 @@ public:
Void createEncData(Bool isPreDBFSamplesUsed);
Void destroyEncData();
Void initRDOCabacCoder(TEncSbac* pcRDGoOnSbacCoder, TComSlice* pcSlice) ;
#if ADD_RESET_ENCODER_DECISIONS_AFTER_IRAP
Void resetEncoderDecisions();
Void SAOProcess(TComPic* pPic, Bool* sliceEnabled, const Double *lambdas, const Bool bTestSAODisableAtPictureLevel, const Double saoEncodingRate, const Double saoEncodingRateChroma, const Bool isPreDBFSamplesUsed);
#else
Void SAOProcess(TComPic* pPic, Bool* sliceEnabled, const Double *lambdas, const Bool bTestSAODisableAtPictureLevel, const Double saoEncodingRate, const Double saoEncodingRateChroma, const Bool isPreDBFSamplesUsed, const Bool bResetStateAfterIRAP);
#endif
public: //methods
Void getPreDBFStatistics(TComPic* pPic);
private: //methods
Void getStatistics(SAOStatData*** blkStats, TComPicYuv* orgYuv, TComPicYuv* srcYuv,TComPic* pPic, Bool isCalculatePreDeblockSamples = false);
#if ADD_RESET_ENCODER_DECISIONS_AFTER_IRAP
Void decidePicParams(Bool* sliceEnabled, const TComPic* pic, const Double saoEncodingRate, const Double saoEncodingRateChroma);
#else
Void decidePicParams(Bool* sliceEnabled, const TComPic* pic, const Double saoEncodingRate, const Double saoEncodingRateChroma, const Bool bResetStateAfterIRAP);
#endif
Void decideBlkParams(TComPic* pic, Bool* sliceEnabled, SAOStatData*** blkStats, TComPicYuv* srcYuv, TComPicYuv* resYuv, SAOBlkParam* reconParams, SAOBlkParam* codedParams, const Bool bTestSAODisableAtPictureLevel, const Double saoEncodingRate, const Double saoEncodingRateChroma);
Void getBlkStats(const ComponentID compIdx, const Int channelBitDepth, SAOStatData* statsDataTypes, Pel* srcBlk, Pel* orgBlk, Int srcStride, Int orgStride, Int width, Int height, Bool isLeftAvail, Bool isRightAvail, Bool isAboveAvail, Bool isBelowAvail, Bool isAboveLeftAvail, Bool isAboveRightAvail, Bool isCalculatePreDeblockSamples);
Void deriveModeNewRDO(const BitDepths &bitDepths, Int ctuRsAddr, SAOBlkParam* mergeList[NUM_SAO_MERGE_TYPES], Bool* sliceEnabled, SAOStatData*** blkStats, SAOBlkParam& modeParam, Double& modeNormCost, TEncSbac** cabacCoderRDO, Int inCabacLabel);
......@@ -141,9 +133,6 @@ private: //members
SAOStatData*** m_statData; //[ctu][comp][classes]
SAOStatData*** m_preDBFstatData;
Double m_saoDisabledRate[MAX_NUM_COMPONENT][MAX_TLAYER];
#if !ADD_RESET_ENCODER_DECISIONS_AFTER_IRAP
Int m_lastIRAPPoc;
#endif
Int m_skipLinesR[MAX_NUM_COMPONENT][NUM_SAO_NEW_TYPES];
Int m_skipLinesB[MAX_NUM_COMPONENT][NUM_SAO_NEW_TYPES];
};
......
......@@ -111,9 +111,7 @@ public:
Void create ( Int iWidth, Int iHeight, ChromaFormat chromaFormat, UInt iMaxCUWidth, UInt iMaxCUHeight, UChar uhTotalDepth );
Void destroy ();
Void init ( TEncTop* pcEncTop );
#if ADD_RESET_ENCODER_DECISIONS_AFTER_IRAP
Void resetEncoderDecisions() { m_encCABACTableIdx = I_SLICE; }
#endif
/// preparation of slice encoding (reference marking, QP and lambda)
Void initEncSlice ( TComPic* pcPic, const Int pocLast, const Int pocCurr,
......
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