Changeset 1331 in SHVCSoftware
- Timestamp:
- 22 Jul 2015, 01:30:58 (9 years ago)
- Location:
- branches/SHM-dev/source
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp
r1330 r1331 1363 1363 ("AlignCABACBeforeBypass", m_cabacBypassAlignmentEnabledFlag, false, "Align the CABAC engine to a defined fraction of a bit prior to coding bypass data. Must be 1 in high bit rate profile, 0 otherwise" ) 1364 1364 ("SAO", m_bUseSAO, true, "Enable Sample Adaptive Offset") 1365 ("TestSAODisableAtPictureLevel", m_bTestSAODisableAtPictureLevel, false, "Enables the testing of disabling SAO at the picture level after having analysed all blocks") 1365 1366 ("MaxNumOffsetsPerPic", m_maxNumOffsetsPerPic, 2048, "Max number of SAO offset per picture (Default: 2048)") 1366 1367 ("SAOLcuBoundary", m_saoCtuBoundary, false, "0: right/bottom CTU boundary areas skipped from SAO parameter estimation, 1: non-deblocked pixels are used for those areas") -
branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.h
r1330 r1331 248 248 // coding tool (SAO) 249 249 Bool m_bUseSAO; 250 Bool m_bTestSAODisableAtPictureLevel; 250 251 Int m_maxNumOffsetsPerPic; ///< SAO maximun number of offset per picture 251 252 Bool m_saoCtuBoundary; ///< SAO parameter estimation using non-deblocked pixels for CTU bottom and right boundary areas -
branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp
r1330 r1331 474 474 m_acTEncTop[layer].setFastUDIUseMPMEnabled ( m_bFastUDIUseMPMEnabled ); 475 475 m_acTEncTop[layer].setFastMEForGenBLowDelayEnabled ( m_bFastMEForGenBLowDelayEnabled ); 476 m_acTEncTop[layer]. .setUseBLambdaForNonKeyLowDelayPictures( m_bUseBLambdaForNonKeyLowDelayPictures );476 m_acTEncTop[layer].setUseBLambdaForNonKeyLowDelayPictures ( m_bUseBLambdaForNonKeyLowDelayPictures ); 477 477 m_acTEncTop[layer].setPCMLog2MinSize ( m_uiPCMLog2MinSize); 478 478 m_acTEncTop[layer].setUsePCM ( m_usePCM ); … … 519 519 m_acTEncTop[layer].setLFCrossSliceBoundaryFlag ( m_bLFCrossSliceBoundaryFlag ); 520 520 m_acTEncTop[layer].setUseSAO ( m_bUseSAO ); 521 m_acTEncTop[layer].setTestSAODisableAtPictureLevel ( m_bTestSAODisableAtPictureLevel ); 521 522 m_acTEncTop[layer].setMaxNumOffsetsPerPic ( m_maxNumOffsetsPerPic ); 522 523 … … 952 953 m_cTEncTop.setLFCrossSliceBoundaryFlag ( m_bLFCrossSliceBoundaryFlag ); 953 954 m_cTEncTop.setUseSAO ( m_bUseSAO ); 955 m_cTEncTop.setTestSAODisableAtPictureLevel ( m_bTestSAODisableAtPictureLevel ); 954 956 m_cTEncTop.setMaxNumOffsetsPerPic ( m_maxNumOffsetsPerPic); 955 957 -
branches/SHM-dev/source/Lib/TLibEncoder/TEncCfg.h
r1330 r1331 164 164 Bool m_DeblockingFilterMetric; 165 165 Bool m_bUseSAO; 166 Bool m_bTestSAODisableAtPictureLevel; 166 167 Int m_maxNumOffsetsPerPic; 167 168 Bool m_saoCtuBoundary; … … 721 722 Void setUseSAO (Bool bVal) { m_bUseSAO = bVal; } 722 723 Bool getUseSAO () { return m_bUseSAO; } 724 Void setTestSAODisableAtPictureLevel (Bool bVal) { m_bTestSAODisableAtPictureLevel = bVal; } 725 Bool getTestSAODisableAtPictureLevel ( ) const { return m_bTestSAODisableAtPictureLevel; } 723 726 Void setMaxNumOffsetsPerPic (Int iVal) { m_maxNumOffsetsPerPic = iVal; } 724 727 Int getMaxNumOffsetsPerPic () { return m_maxNumOffsetsPerPic; } -
branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp
r1325 r1331 2615 2615 m_pcEncTop->getRDGoOnSbacCoder()->setBitstream(&tempBitCounter); 2616 2616 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() 2618 2618 #if SAO_ENCODE_ALLOW_USE_PREDEBLOCK 2619 2619 , m_pcCfg->getSaoCtuBoundary() -
branches/SHM-dev/source/Lib/TLibEncoder/TEncSampleAdaptiveOffset.cpp
r1307 r1331 254 254 255 255 256 Void TEncSampleAdaptiveOffset::SAOProcess(TComPic* pPic, Bool* sliceEnabled, const Double *lambdas 256 Void TEncSampleAdaptiveOffset::SAOProcess(TComPic* pPic, Bool* sliceEnabled, const Double *lambdas, const Bool bTestSAODisableAtPictureLevel 257 257 #if SAO_ENCODE_ALLOW_USE_PREDEBLOCK 258 258 , Bool isPreDBFSamplesUsed … … 281 281 //block on/off 282 282 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); 284 284 delete[] reconParams; 285 285 } … … 791 791 } 792 792 793 Void TEncSampleAdaptiveOffset::decideBlkParams(TComPic* pic, Bool* sliceEnabled, SAOStatData*** blkStats, TComPicYuv* srcYuv, TComPicYuv* resYuv, SAOBlkParam* reconParams, SAOBlkParam* codedParams )793 Void TEncSampleAdaptiveOffset::decideBlkParams(TComPic* pic, Bool* sliceEnabled, SAOStatData*** blkStats, TComPicYuv* srcYuv, TComPicYuv* resYuv, SAOBlkParam* reconParams, SAOBlkParam* codedParams, const Bool bTestSAODisableAtPictureLevel) 794 794 { 795 795 Bool allBlksDisabled = true; … … 809 809 810 810 811 #if RD_TEST_SAO_DISABLE_AT_PICTURE_LEVEL 812 Double totalCost = 0; 813 #endif 811 Double totalCost = 0; // Used if bTestSAODisableAtPictureLevel==true 814 812 815 813 for(Int ctuRsAddr=0; ctuRsAddr< m_numCTUsPic; ctuRsAddr++) … … 872 870 } //mode 873 871 874 #if RD_TEST_SAO_DISABLE_AT_PICTURE_LEVEL875 872 totalCost += minCost; 876 #endif877 873 878 874 m_pcRDGoOnSbacCoder->load(m_pppcRDSbacCoder[ SAO_CABACSTATE_BLK_NEXT ]); … … 884 880 } //ctuRsAddr 885 881 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 888 883 { 889 884 for(Int ctuRsAddr = 0; ctuRsAddr < m_numCTUsPic; ctuRsAddr++) … … 899 894 m_pcRDGoOnSbacCoder->load(m_pppcRDSbacCoder[ SAO_CABACSTATE_PIC_INIT ]); 900 895 } 901 #endif902 896 903 897 #if SAO_ENCODING_CHOICE -
branches/SHM-dev/source/Lib/TLibEncoder/TEncSampleAdaptiveOffset.h
r1307 r1331 109 109 Void destroyEncData(); 110 110 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 112 112 #if SAO_ENCODE_ALLOW_USE_PREDEBLOCK 113 113 , Bool isPreDBFSamplesUsed … … 125 125 ); 126 126 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); 128 128 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 129 129 #if SAO_ENCODE_ALLOW_USE_PREDEBLOCK
Note: See TracChangeset for help on using the changeset viewer.