Changeset 1331 in SHVCSoftware for branches/SHM-dev/source/Lib


Ignore:
Timestamp:
22 Jul 2015, 01:30:58 (9 years ago)
Author:
seregin
Message:

port rev 4409

Location:
branches/SHM-dev/source/Lib/TLibEncoder
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncCfg.h

    r1330 r1331  
    164164  Bool      m_DeblockingFilterMetric;
    165165  Bool      m_bUseSAO;
     166  Bool      m_bTestSAODisableAtPictureLevel;
    166167  Int       m_maxNumOffsetsPerPic;
    167168  Bool      m_saoCtuBoundary;
     
    721722  Void      setUseSAO                  (Bool bVal)                   { m_bUseSAO = bVal; }
    722723  Bool      getUseSAO                  ()                            { return m_bUseSAO; }
     724  Void  setTestSAODisableAtPictureLevel (Bool bVal)                  { m_bTestSAODisableAtPictureLevel = bVal; }
     725  Bool  getTestSAODisableAtPictureLevel ( ) const                    { return m_bTestSAODisableAtPictureLevel; }
    723726  Void  setMaxNumOffsetsPerPic                   (Int iVal)          { m_maxNumOffsetsPerPic = iVal; }
    724727  Int   getMaxNumOffsetsPerPic                   ()                  { return m_maxNumOffsetsPerPic; }
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp

    r1325 r1331  
    26152615      m_pcEncTop->getRDGoOnSbacCoder()->setBitstream(&tempBitCounter);
    26162616      m_pcSAO->initRDOCabacCoder(m_pcEncTop->getRDGoOnSbacCoder(), pcSlice);
    2617       m_pcSAO->SAOProcess(pcPic, sliceEnabled, pcPic->getSlice(0)->getLambdas()
     2617      m_pcSAO->SAOProcess(pcPic, sliceEnabled, pcPic->getSlice(0)->getLambdas(), m_pcCfg->getTestSAODisableAtPictureLevel()
    26182618#if SAO_ENCODE_ALLOW_USE_PREDEBLOCK
    26192619                          , m_pcCfg->getSaoCtuBoundary()
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncSampleAdaptiveOffset.cpp

    r1307 r1331  
    254254
    255255
    256 Void TEncSampleAdaptiveOffset::SAOProcess(TComPic* pPic, Bool* sliceEnabled, const Double *lambdas
     256Void TEncSampleAdaptiveOffset::SAOProcess(TComPic* pPic, Bool* sliceEnabled, const Double *lambdas, const Bool bTestSAODisableAtPictureLevel
    257257#if SAO_ENCODE_ALLOW_USE_PREDEBLOCK
    258258                                         , Bool isPreDBFSamplesUsed
     
    281281  //block on/off
    282282  SAOBlkParam* reconParams = new SAOBlkParam[m_numCTUsPic]; //temporary parameter buffer for storing reconstructed SAO parameters
    283   decideBlkParams(pPic, sliceEnabled, m_statData, srcYuv, resYuv, reconParams, pPic->getPicSym()->getSAOBlkParam());
     283  decideBlkParams(pPic, sliceEnabled, m_statData, srcYuv, resYuv, reconParams, pPic->getPicSym()->getSAOBlkParam(), bTestSAODisableAtPictureLevel);
    284284  delete[] reconParams;
    285285}
     
    791791}
    792792
    793 Void TEncSampleAdaptiveOffset::decideBlkParams(TComPic* pic, Bool* sliceEnabled, SAOStatData*** blkStats, TComPicYuv* srcYuv, TComPicYuv* resYuv, SAOBlkParam* reconParams, SAOBlkParam* codedParams)
     793Void TEncSampleAdaptiveOffset::decideBlkParams(TComPic* pic, Bool* sliceEnabled, SAOStatData*** blkStats, TComPicYuv* srcYuv, TComPicYuv* resYuv, SAOBlkParam* reconParams, SAOBlkParam* codedParams, const Bool bTestSAODisableAtPictureLevel)
    794794{
    795795  Bool allBlksDisabled = true;
     
    809809
    810810
    811 #if RD_TEST_SAO_DISABLE_AT_PICTURE_LEVEL
    812   Double totalCost = 0;
    813 #endif
     811  Double totalCost = 0; // Used if bTestSAODisableAtPictureLevel==true
    814812
    815813  for(Int ctuRsAddr=0; ctuRsAddr< m_numCTUsPic; ctuRsAddr++)
     
    872870    } //mode
    873871
    874 #if RD_TEST_SAO_DISABLE_AT_PICTURE_LEVEL
    875872    totalCost += minCost;
    876 #endif
    877873
    878874    m_pcRDGoOnSbacCoder->load(m_pppcRDSbacCoder[ SAO_CABACSTATE_BLK_NEXT ]);
     
    884880  } //ctuRsAddr
    885881
    886 #if RD_TEST_SAO_DISABLE_AT_PICTURE_LEVEL
    887   if (!allBlksDisabled && (totalCost >= 0)) //SAO is not beneficial - disable it
     882  if (!allBlksDisabled && (totalCost >= 0) && bTestSAODisableAtPictureLevel) //SAO has not beneficial in this case - disable it
    888883  {
    889884    for(Int ctuRsAddr = 0; ctuRsAddr < m_numCTUsPic; ctuRsAddr++)
     
    899894    m_pcRDGoOnSbacCoder->load(m_pppcRDSbacCoder[ SAO_CABACSTATE_PIC_INIT ]);
    900895  }
    901 #endif
    902896
    903897#if SAO_ENCODING_CHOICE
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncSampleAdaptiveOffset.h

    r1307 r1331  
    109109  Void destroyEncData();
    110110  Void initRDOCabacCoder(TEncSbac* pcRDGoOnSbacCoder, TComSlice* pcSlice) ;
    111   Void SAOProcess(TComPic* pPic, Bool* sliceEnabled, const Double *lambdas
     111  Void SAOProcess(TComPic* pPic, Bool* sliceEnabled, const Double *lambdas, const Bool bTestSAODisableAtPictureLevel
    112112#if SAO_ENCODE_ALLOW_USE_PREDEBLOCK
    113113                , Bool isPreDBFSamplesUsed
     
    125125                   );
    126126  Void decidePicParams(Bool* sliceEnabled, Int picTempLayer);
    127   Void decideBlkParams(TComPic* pic, Bool* sliceEnabled, SAOStatData*** blkStats, TComPicYuv* srcYuv, TComPicYuv* resYuv, SAOBlkParam* reconParams, SAOBlkParam* codedParams);
     127  Void decideBlkParams(TComPic* pic, Bool* sliceEnabled, SAOStatData*** blkStats, TComPicYuv* srcYuv, TComPicYuv* resYuv, SAOBlkParam* reconParams, SAOBlkParam* codedParams, const Bool bTestSAODisableAtPictureLevel);
    128128  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
    129129#if SAO_ENCODE_ALLOW_USE_PREDEBLOCK
Note: See TracChangeset for help on using the changeset viewer.