Changeset 1548 in SHVCSoftware for branches/SHM-dev/source/Lib
- Timestamp:
- 23 Mar 2016, 00:16:54 (9 years ago)
- Location:
- branches/SHM-dev/source/Lib
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
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.