Changeset 1548 in SHVCSoftware


Ignore:
Timestamp:
23 Mar 2016, 00:16:54 (8 years ago)
Author:
seregin
Message:

port rev 4731

Location:
branches/SHM-dev/source
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp

    r1545 r1548  
    13651365  ("MaxNumOffsetsPerPic",                             m_maxNumOffsetsPerPic,                             2048, "Max number of SAO offset per picture (Default: 2048)")
    13661366  ("SAOLcuBoundary",                                  m_saoCtuBoundary,                                 false, "0: right/bottom CTU boundary areas skipped from SAO parameter estimation, 1: non-deblocked pixels are used for those areas")
     1367#if OPTIONAL_RESET_SAO_ENCODING_AFTER_IRAP
     1368  ("SAOResetEncoderStateAfterIRAP",                   m_saoResetEncoderStateAfterIRAP,                  false, "When true, resets the encoder's SAO state after an IRAP (POC order). Disabled by default.")
     1369#endif
    13671370  ("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")
    13681371  ("SliceArgument",                                   m_sliceArgument,                                      0, "Depending on SliceMode being:"
     
    34643467    xConfirmPara( m_iIntraPeriod > 0 && m_iIntraPeriod <= m_iGOPSize ,                      "Intra period must be larger than GOP size for periodic IDR pictures");
    34653468  }
     3469#if OPTIONAL_RESET_SAO_ENCODING_AFTER_IRAP
     3470  if (m_saoResetEncoderStateAfterIRAP)
     3471  {
     3472    xConfirmPara( m_iIntraPeriod > 0 && m_iIntraPeriod <= m_iGOPSize ,                      "Intra period must be larger than GOP size when SAOResetEncoderStateAfterIRAP is enabled");
     3473  }
     3474#endif
    34663475  xConfirmPara( m_uiMaxCUDepth < 1,                                                         "MaxPartitionDepth must be greater than zero");
    34673476  xConfirmPara( (m_uiMaxCUWidth  >> m_uiMaxCUDepth) < 4,                                    "Minimum partition width size should be larger than or equal to 8");
  • branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.h

    r1545 r1548  
    322322  Int       m_maxNumOffsetsPerPic;                            ///< SAO maximun number of offset per picture
    323323  Bool      m_saoCtuBoundary;                                 ///< SAO parameter estimation using non-deblocked pixels for CTU bottom and right boundary areas
     324#if OPTIONAL_RESET_SAO_ENCODING_AFTER_IRAP
     325  Bool      m_saoResetEncoderStateAfterIRAP;                  ///< When true, SAO encoder state will be reset following an IRAP.
     326#endif
    324327  // coding tools (loop filter)
    325328  Bool      m_bLoopFilterDisable;                             ///< flag for using deblocking filter
  • branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp

    r1545 r1548  
    731731
    732732  m_cTEncTop.setSaoCtuBoundary                                    ( m_saoCtuBoundary);
     733#if OPTIONAL_RESET_SAO_ENCODING_AFTER_IRAP
     734  m_cTEncTop.setSaoResetEncoderStateAfterIRAP                     ( m_saoResetEncoderStateAfterIRAP);
     735#endif
    733736  m_cTEncTop.setPCMInputBitDepthFlag                              ( m_bPCMInputBitDepthFlag);
    734737  m_cTEncTop.setPCMFilterDisableFlag                              ( m_bPCMFilterDisableFlag);
  • branches/SHM-dev/source/Lib/TLibCommon/TComPic.h

    r1512 r1548  
    119119  Bool          getCheckLTMSBPresent     () { return m_bCheckLTMSB;}
    120120
    121   TComPicSym*   getPicSym()           { return  &m_picSym;    }
    122   const TComPicSym* getPicSym() const { return  &m_picSym;    }
    123   TComSlice*    getSlice(Int i)       { return  m_picSym.getSlice(i);  }
    124   Int           getPOC() const        { return  m_picSym.getSlice(m_uiCurrSliceIdx)->getPOC();  }
     121  TComPicSym*   getPicSym()                        { return  &m_picSym;    }
     122  const TComPicSym* getPicSym() const              { return  &m_picSym;    }
     123  TComSlice*    getSlice(Int i)                    { return  m_picSym.getSlice(i);  }
     124  const TComSlice* getSlice(Int i) const           { return  m_picSym.getSlice(i);  }
     125  Int           getPOC() const                     { return  m_picSym.getSlice(m_uiCurrSliceIdx)->getPOC();  }
    125126  TComDataCU*   getCtu( UInt ctuRsAddr )           { return  m_picSym.getCtu( ctuRsAddr ); }
    126127  const TComDataCU* getCtu( UInt ctuRsAddr ) const { return  m_picSym.getCtu( ctuRsAddr ); }
  • branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h

    r1547 r1548  
    172172#define U0033_ALTERNATIVE_TRANSFER_CHARACTERISTICS_SEI    1 ///< Alternative transfer characteristics SEI message (JCTVC-U0033, with syntax naming from V1005)
    173173#define W0062_RECALCULATE_QP_TO_ALIGN_WITH_LAMBDA         0 ///< This recalculates QP to align with the derived lambda (same relation as for all intra coding is used). Currently disabled by default.
     174#define OPTIONAL_RESET_SAO_ENCODING_AFTER_IRAP            1 ///< Adds command line option to reset SAO parameters after each IRAP.
    174175
    175176// ====================================================================================================================
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncCfg.h

    r1545 r1548  
    186186  Int       m_maxNumOffsetsPerPic;
    187187  Bool      m_saoCtuBoundary;
     188#if OPTIONAL_RESET_SAO_ENCODING_AFTER_IRAP
     189  Bool      m_saoResetEncoderStateAfterIRAP;
     190#endif
    188191
    189192  //====== Motion search ========
     
    802805  Void  setSaoCtuBoundary              (Bool val)                    { m_saoCtuBoundary = val; }
    803806  Bool  getSaoCtuBoundary              ()                            { return m_saoCtuBoundary; }
     807#if OPTIONAL_RESET_SAO_ENCODING_AFTER_IRAP
     808  Void  setSaoResetEncoderStateAfterIRAP(Bool b)                     { m_saoResetEncoderStateAfterIRAP = b; }
     809  Bool  getSaoResetEncoderStateAfterIRAP() const                     { return m_saoResetEncoderStateAfterIRAP; }
     810#endif
    804811  Void  setLFCrossTileBoundaryFlag               ( Bool   val  )     { m_loopFilterAcrossTilesEnabledFlag = val; }
    805812  Bool  getLFCrossTileBoundaryFlag               ()                  { return m_loopFilterAcrossTilesEnabledFlag;   }
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp

    r1545 r1548  
    25692569      m_pcEncTop->getRDGoOnSbacCoder()->setBitstream(&tempBitCounter);
    25702570      m_pcSAO->initRDOCabacCoder(m_pcEncTop->getRDGoOnSbacCoder(), pcSlice);
     2571#if OPTIONAL_RESET_SAO_ENCODING_AFTER_IRAP
     2572      m_pcSAO->SAOProcess(pcPic, sliceEnabled, pcPic->getSlice(0)->getLambdas(),
     2573                          m_pcCfg->getTestSAODisableAtPictureLevel(),
     2574                          m_pcCfg->getSaoEncodingRate(),
     2575                          m_pcCfg->getSaoEncodingRateChroma(),
     2576                          m_pcCfg->getSaoCtuBoundary(),
     2577                          m_pcCfg->getSaoResetEncoderStateAfterIRAP());
     2578#else
    25712579      m_pcSAO->SAOProcess(pcPic, sliceEnabled, pcPic->getSlice(0)->getLambdas(), m_pcCfg->getTestSAODisableAtPictureLevel(), m_pcCfg->getSaoEncodingRate(), m_pcCfg->getSaoEncodingRateChroma(), m_pcCfg->getSaoCtuBoundary());
     2580#endif
    25722581      m_pcSAO->PCMLFDisableProcess(pcPic);
    25732582      m_pcEncTop->getRDGoOnSbacCoder()->setBitstream(NULL);
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncSampleAdaptiveOffset.cpp

    r1502 r1548  
    120120
    121121  ::memset(m_saoDisabledRate, 0, sizeof(m_saoDisabledRate));
     122#if OPTIONAL_RESET_SAO_ENCODING_AFTER_IRAP
     123  m_lastIRAPPoc = MAX_INT;
     124#endif
    122125
    123126  for(Int typeIdc=0; typeIdc < NUM_SAO_NEW_TYPES; typeIdc++)
     
    239242
    240243
     244#if OPTIONAL_RESET_SAO_ENCODING_AFTER_IRAP
     245Void TEncSampleAdaptiveOffset::SAOProcess(TComPic* pPic, Bool* sliceEnabled, const Double *lambdas, const Bool bTestSAODisableAtPictureLevel, const Double saoEncodingRate, const Double saoEncodingRateChroma, const Bool isPreDBFSamplesUsed, const Bool bResetStateAfterIRAP )
     246#else
    241247Void TEncSampleAdaptiveOffset::SAOProcess(TComPic* pPic, Bool* sliceEnabled, const Double *lambdas, const Bool bTestSAODisableAtPictureLevel, const Double saoEncodingRate, const Double saoEncodingRateChroma, Bool isPreDBFSamplesUsed )
     248#endif
    242249{
    243250  TComPicYuv* orgYuv= pPic->getPicYuvOrg();
     
    255262    addPreDBFStatistics(m_statData);
    256263  }
     264
    257265  //slice on/off
     266#if OPTIONAL_RESET_SAO_ENCODING_AFTER_IRAP
     267  decidePicParams(sliceEnabled, pPic, saoEncodingRate, saoEncodingRateChroma, bResetStateAfterIRAP);
     268#else
    258269  decidePicParams(sliceEnabled, pPic->getSlice(0)->getDepth(), saoEncodingRate, saoEncodingRateChroma);
     270#endif
    259271
    260272  //block on/off
     
    330342}
    331343
     344#if OPTIONAL_RESET_SAO_ENCODING_AFTER_IRAP
     345Void TEncSampleAdaptiveOffset::decidePicParams(Bool* sliceEnabled, const TComPic* pic, const Double saoEncodingRate, const Double saoEncodingRateChroma, const Bool bResetStateAfterIRAP)
     346#else
    332347Void TEncSampleAdaptiveOffset::decidePicParams(Bool* sliceEnabled, Int picTempLayer, const Double saoEncodingRate, const Double saoEncodingRateChroma)
    333 {
     348#endif
     349{
     350#if OPTIONAL_RESET_SAO_ENCODING_AFTER_IRAP
     351  if (pic->getSlice(0)->isIRAP())
     352  {
     353    m_lastIRAPPoc = pic->getSlice(0)->getPOC();
     354  }
     355  if (bResetStateAfterIRAP && pic->getSlice(0)->getPOC() > m_lastIRAPPoc)
     356  { // reset
     357    for (Int compIdx = 0; compIdx < MAX_NUM_COMPONENT; compIdx++)
     358    {
     359      for (Int tempLayer = 1; tempLayer < MAX_TLAYER; tempLayer++)
     360      {
     361        m_saoDisabledRate[compIdx][tempLayer] = 0.0;
     362      }
     363    }
     364    m_lastIRAPPoc = MAX_INT;
     365  }
     366  const Int picTempLayer = pic->getSlice(0)->getDepth();
     367#endif
     368
    334369  //decide sliceEnabled[compIdx]
    335370  const Int numberOfComponents = getNumberValidComponents(m_chromaFormatIDC);
     
    810845        {
    811846          deriveModeNewRDO(pic->getPicSym()->getSPS().getBitDepths(), ctuRsAddr, mergeList, sliceEnabled, blkStats, modeParam, modeCost, m_pppcRDSbacCoder, SAO_CABACSTATE_BLK_CUR);
     847
    812848        }
    813849        break;
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncSampleAdaptiveOffset.h

    r1344 r1548  
    103103  Void destroyEncData();
    104104  Void initRDOCabacCoder(TEncSbac* pcRDGoOnSbacCoder, TComSlice* pcSlice) ;
     105#if OPTIONAL_RESET_SAO_ENCODING_AFTER_IRAP
     106  Void SAOProcess(TComPic* pPic, Bool* sliceEnabled, const Double *lambdas, const Bool bTestSAODisableAtPictureLevel, const Double saoEncodingRate, const Double saoEncodingRateChroma, const Bool isPreDBFSamplesUsed, const Bool bResetStateAfterIRAP);
     107#else
    105108  Void SAOProcess(TComPic* pPic, Bool* sliceEnabled, const Double *lambdas, const Bool bTestSAODisableAtPictureLevel, const Double saoEncodingRate, const Double saoEncodingRateChroma, Bool isPreDBFSamplesUsed);
     109#endif
    106110public: //methods
    107111  Void getPreDBFStatistics(TComPic* pPic);
    108112private: //methods
    109113  Void getStatistics(SAOStatData*** blkStats, TComPicYuv* orgYuv, TComPicYuv* srcYuv,TComPic* pPic, Bool isCalculatePreDeblockSamples = false);
     114#if OPTIONAL_RESET_SAO_ENCODING_AFTER_IRAP
     115  Void decidePicParams(Bool* sliceEnabled, const TComPic* pic, const Double saoEncodingRate, const Double saoEncodingRateChroma, const Bool bResetStateAfterIRAP);
     116#else
    110117  Void decidePicParams(Bool* sliceEnabled, Int picTempLayer, const Double saoEncodingRate, const Double saoEncodingRateChroma);
     118#endif
    111119  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);
    112120  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);
     
    133141  SAOStatData***         m_preDBFstatData;
    134142  Double                 m_saoDisabledRate[MAX_NUM_COMPONENT][MAX_TLAYER];
     143#if OPTIONAL_RESET_SAO_ENCODING_AFTER_IRAP
     144  Int                    m_lastIRAPPoc;
     145#endif
    135146  Int                    m_skipLinesR[MAX_NUM_COMPONENT][NUM_SAO_NEW_TYPES];
    136147  Int                    m_skipLinesB[MAX_NUM_COMPONENT][NUM_SAO_NEW_TYPES];
Note: See TracChangeset for help on using the changeset viewer.