Ignore:
Timestamp:
26 May 2016, 15:03:18 (8 years ago)
Author:
tech
Message:

Initial merge of HM-16.9.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-16.1-dev/source/Lib/TLibEncoder/TEncSampleAdaptiveOffset.cpp

    r1401 r1402  
    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();
     
    256263  }
    257264  //slice on/off
     265#if OPTIONAL_RESET_SAO_ENCODING_AFTER_IRAP
     266  decidePicParams(sliceEnabled, pPic, saoEncodingRate, saoEncodingRateChroma, bResetStateAfterIRAP);
     267#else
    258268  decidePicParams(sliceEnabled, pPic->getSlice(0)->getDepth(), saoEncodingRate, saoEncodingRateChroma);
     269#endif
    259270
    260271  //block on/off
     
    330341}
    331342
     343#if OPTIONAL_RESET_SAO_ENCODING_AFTER_IRAP
     344Void TEncSampleAdaptiveOffset::decidePicParams(Bool* sliceEnabled, const TComPic* pic, const Double saoEncodingRate, const Double saoEncodingRateChroma, const Bool bResetStateAfterIRAP)
     345#else
    332346Void TEncSampleAdaptiveOffset::decidePicParams(Bool* sliceEnabled, Int picTempLayer, const Double saoEncodingRate, const Double saoEncodingRateChroma)
    333 {
     347#endif
     348{
     349#if OPTIONAL_RESET_SAO_ENCODING_AFTER_IRAP
     350  if (pic->getSlice(0)->isIRAP())
     351  {
     352    m_lastIRAPPoc = pic->getSlice(0)->getPOC();
     353  }
     354  if (bResetStateAfterIRAP && pic->getSlice(0)->getPOC() > m_lastIRAPPoc)
     355  { // reset
     356    for (Int compIdx = 0; compIdx < MAX_NUM_COMPONENT; compIdx++)
     357{
     358      for (Int tempLayer = 1; tempLayer < MAX_TLAYER; tempLayer++)
     359      {
     360        m_saoDisabledRate[compIdx][tempLayer] = 0.0;
     361      }
     362    }
     363    m_lastIRAPPoc = MAX_INT;
     364  }
     365  const Int picTempLayer = pic->getSlice(0)->getDepth();
     366#endif
     367
    334368  //decide sliceEnabled[compIdx]
    335369  const Int numberOfComponents = getNumberValidComponents(m_chromaFormatIDC);
Note: See TracChangeset for help on using the changeset viewer.