Changeset 1548 in SHVCSoftware
- Timestamp:
- 23 Mar 2016, 00:16:54 (9 years ago)
- Location:
- branches/SHM-dev/source
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp
r1545 r1548 1365 1365 ("MaxNumOffsetsPerPic", m_maxNumOffsetsPerPic, 2048, "Max number of SAO offset per picture (Default: 2048)") 1366 1366 ("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 1367 1370 ("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") 1368 1371 ("SliceArgument", m_sliceArgument, 0, "Depending on SliceMode being:" … … 3464 3467 xConfirmPara( m_iIntraPeriod > 0 && m_iIntraPeriod <= m_iGOPSize , "Intra period must be larger than GOP size for periodic IDR pictures"); 3465 3468 } 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 3466 3475 xConfirmPara( m_uiMaxCUDepth < 1, "MaxPartitionDepth must be greater than zero"); 3467 3476 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 322 322 Int m_maxNumOffsetsPerPic; ///< SAO maximun number of offset per picture 323 323 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 324 327 // coding tools (loop filter) 325 328 Bool m_bLoopFilterDisable; ///< flag for using deblocking filter -
branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp
r1545 r1548 731 731 732 732 m_cTEncTop.setSaoCtuBoundary ( m_saoCtuBoundary); 733 #if OPTIONAL_RESET_SAO_ENCODING_AFTER_IRAP 734 m_cTEncTop.setSaoResetEncoderStateAfterIRAP ( m_saoResetEncoderStateAfterIRAP); 735 #endif 733 736 m_cTEncTop.setPCMInputBitDepthFlag ( m_bPCMInputBitDepthFlag); 734 737 m_cTEncTop.setPCMFilterDisableFlag ( m_bPCMFilterDisableFlag); -
branches/SHM-dev/source/Lib/TLibCommon/TComPic.h
r1512 r1548 119 119 Bool getCheckLTMSBPresent () { return m_bCheckLTMSB;} 120 120 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(); } 125 126 TComDataCU* getCtu( UInt ctuRsAddr ) { return m_picSym.getCtu( ctuRsAddr ); } 126 127 const TComDataCU* getCtu( UInt ctuRsAddr ) const { return m_picSym.getCtu( ctuRsAddr ); } -
branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h
r1547 r1548 172 172 #define U0033_ALTERNATIVE_TRANSFER_CHARACTERISTICS_SEI 1 ///< Alternative transfer characteristics SEI message (JCTVC-U0033, with syntax naming from V1005) 173 173 #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. 174 175 175 176 // ==================================================================================================================== -
branches/SHM-dev/source/Lib/TLibEncoder/TEncCfg.h
r1545 r1548 186 186 Int m_maxNumOffsetsPerPic; 187 187 Bool m_saoCtuBoundary; 188 #if OPTIONAL_RESET_SAO_ENCODING_AFTER_IRAP 189 Bool m_saoResetEncoderStateAfterIRAP; 190 #endif 188 191 189 192 //====== Motion search ======== … … 802 805 Void setSaoCtuBoundary (Bool val) { m_saoCtuBoundary = val; } 803 806 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 804 811 Void setLFCrossTileBoundaryFlag ( Bool val ) { m_loopFilterAcrossTilesEnabledFlag = val; } 805 812 Bool getLFCrossTileBoundaryFlag () { return m_loopFilterAcrossTilesEnabledFlag; } -
branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp
r1545 r1548 2569 2569 m_pcEncTop->getRDGoOnSbacCoder()->setBitstream(&tempBitCounter); 2570 2570 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 2571 2579 m_pcSAO->SAOProcess(pcPic, sliceEnabled, pcPic->getSlice(0)->getLambdas(), m_pcCfg->getTestSAODisableAtPictureLevel(), m_pcCfg->getSaoEncodingRate(), m_pcCfg->getSaoEncodingRateChroma(), m_pcCfg->getSaoCtuBoundary()); 2580 #endif 2572 2581 m_pcSAO->PCMLFDisableProcess(pcPic); 2573 2582 m_pcEncTop->getRDGoOnSbacCoder()->setBitstream(NULL); -
branches/SHM-dev/source/Lib/TLibEncoder/TEncSampleAdaptiveOffset.cpp
r1502 r1548 120 120 121 121 ::memset(m_saoDisabledRate, 0, sizeof(m_saoDisabledRate)); 122 #if OPTIONAL_RESET_SAO_ENCODING_AFTER_IRAP 123 m_lastIRAPPoc = MAX_INT; 124 #endif 122 125 123 126 for(Int typeIdc=0; typeIdc < NUM_SAO_NEW_TYPES; typeIdc++) … … 239 242 240 243 244 #if OPTIONAL_RESET_SAO_ENCODING_AFTER_IRAP 245 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 ) 246 #else 241 247 Void TEncSampleAdaptiveOffset::SAOProcess(TComPic* pPic, Bool* sliceEnabled, const Double *lambdas, const Bool bTestSAODisableAtPictureLevel, const Double saoEncodingRate, const Double saoEncodingRateChroma, Bool isPreDBFSamplesUsed ) 248 #endif 242 249 { 243 250 TComPicYuv* orgYuv= pPic->getPicYuvOrg(); … … 255 262 addPreDBFStatistics(m_statData); 256 263 } 264 257 265 //slice on/off 266 #if OPTIONAL_RESET_SAO_ENCODING_AFTER_IRAP 267 decidePicParams(sliceEnabled, pPic, saoEncodingRate, saoEncodingRateChroma, bResetStateAfterIRAP); 268 #else 258 269 decidePicParams(sliceEnabled, pPic->getSlice(0)->getDepth(), saoEncodingRate, saoEncodingRateChroma); 270 #endif 259 271 260 272 //block on/off … … 330 342 } 331 343 344 #if OPTIONAL_RESET_SAO_ENCODING_AFTER_IRAP 345 Void TEncSampleAdaptiveOffset::decidePicParams(Bool* sliceEnabled, const TComPic* pic, const Double saoEncodingRate, const Double saoEncodingRateChroma, const Bool bResetStateAfterIRAP) 346 #else 332 347 Void 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 334 369 //decide sliceEnabled[compIdx] 335 370 const Int numberOfComponents = getNumberValidComponents(m_chromaFormatIDC); … … 810 845 { 811 846 deriveModeNewRDO(pic->getPicSym()->getSPS().getBitDepths(), ctuRsAddr, mergeList, sliceEnabled, blkStats, modeParam, modeCost, m_pppcRDSbacCoder, SAO_CABACSTATE_BLK_CUR); 847 812 848 } 813 849 break; -
branches/SHM-dev/source/Lib/TLibEncoder/TEncSampleAdaptiveOffset.h
r1344 r1548 103 103 Void destroyEncData(); 104 104 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 105 108 Void SAOProcess(TComPic* pPic, Bool* sliceEnabled, const Double *lambdas, const Bool bTestSAODisableAtPictureLevel, const Double saoEncodingRate, const Double saoEncodingRateChroma, Bool isPreDBFSamplesUsed); 109 #endif 106 110 public: //methods 107 111 Void getPreDBFStatistics(TComPic* pPic); 108 112 private: //methods 109 113 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 110 117 Void decidePicParams(Bool* sliceEnabled, Int picTempLayer, const Double saoEncodingRate, const Double saoEncodingRateChroma); 118 #endif 111 119 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); 112 120 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); … … 133 141 SAOStatData*** m_preDBFstatData; 134 142 Double m_saoDisabledRate[MAX_NUM_COMPONENT][MAX_TLAYER]; 143 #if OPTIONAL_RESET_SAO_ENCODING_AFTER_IRAP 144 Int m_lastIRAPPoc; 145 #endif 135 146 Int m_skipLinesR[MAX_NUM_COMPONENT][NUM_SAO_NEW_TYPES]; 136 147 Int m_skipLinesB[MAX_NUM_COMPONENT][NUM_SAO_NEW_TYPES];
Note: See TracChangeset for help on using the changeset viewer.