Changeset 1459 in SHVCSoftware for branches/SHM-dev/source/Lib
- Timestamp:
- 20 Aug 2015, 19:49:34 (9 years ago)
- Location:
- branches/SHM-dev/source/Lib
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified branches/SHM-dev/source/Lib/TLibCommon/SEI.h ¶
r1442 r1459 158 158 virtual ~SEIDecodedPictureHash() {} 159 159 160 enum Method 161 { 162 MD5, 163 CRC, 164 CHECKSUM, 165 RESERVED, 166 } method; 160 HashType method; 167 161 168 162 TComPictureHash m_pictureHash; -
TabularUnified branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h ¶
r1442 r1459 558 558 FIXED_NUMBER_OF_BYTES = 2, ///< Limit maximum number of bytes in a slice / slice segment 559 559 FIXED_NUMBER_OF_TILES = 3, ///< slices / slice segments span an integer number of tiles 560 NUMBER_OF_SLICE_CONSTRAINT_MODES = 4 561 }; 562 563 // For use with decoded picture hash SEI messages, generated by encoder. 564 enum HashType 565 { 566 HASHTYPE_MD5 = 0, 567 HASHTYPE_CRC = 1, 568 HASHTYPE_CHECKSUM = 2, 569 HASHTYPE_NONE = 3, 570 NUMBER_OF_HASHTYPES = 4 560 571 }; 561 572 -
TabularUnified branches/SHM-dev/source/Lib/TLibDecoder/SEIread.cpp ¶
r1442 r1459 520 520 UInt val; 521 521 sei_read_code( pDecodedMessageOutputStream, 8, val, "hash_type"); 522 sei.method = static_cast< SEIDecodedPictureHash::Method>(val); bytesRead++;522 sei.method = static_cast<HashType>(val); bytesRead++; 523 523 524 524 const TChar *traceString="\0"; 525 525 switch (sei.method) 526 526 { 527 case SEIDecodedPictureHash::MD5: traceString="picture_md5"; break;528 case SEIDecodedPictureHash::CRC: traceString="picture_crc"; break;529 case SEIDecodedPictureHash::CHECKSUM: traceString="picture_checksum"; break;527 case HASHTYPE_MD5: traceString="picture_md5"; break; 528 case HASHTYPE_CRC: traceString="picture_crc"; break; 529 case HASHTYPE_CHECKSUM: traceString="picture_checksum"; break; 530 530 default: assert(false); break; 531 531 } -
TabularUnified branches/SHM-dev/source/Lib/TLibDecoder/TDecGop.cpp ¶
r1442 r1459 95 95 #if SVC_EXTENSION 96 96 Void TDecGop::init( TDecTop** ppcDecTop, 97 TDecEntropy*pcEntropyDecoder,97 TDecEntropy* pcEntropyDecoder, 98 98 #else 99 99 Void TDecGop::init( TDecEntropy* pcEntropyDecoder, … … 290 290 switch (pictureHashSEI->method) 291 291 { 292 case SEIDecodedPictureHash::MD5:292 case HASHTYPE_MD5: 293 293 { 294 294 hashType = "MD5"; … … 296 296 break; 297 297 } 298 case SEIDecodedPictureHash::CRC:298 case HASHTYPE_CRC: 299 299 { 300 300 hashType = "CRC"; … … 302 302 break; 303 303 } 304 case SEIDecodedPictureHash::CHECKSUM:304 case HASHTYPE_CHECKSUM: 305 305 { 306 306 hashType = "Checksum"; -
TabularUnified branches/SHM-dev/source/Lib/TLibEncoder/SEIEncoder.cpp ¶
r1434 r1459 312 312 assert (pcPic!=NULL); 313 313 314 if(m_pcCfg->getDecodedPictureHashSEIEnabled() == 1) 315 { 316 decodedPictureHashSEI->method = SEIDecodedPictureHash::MD5; 317 UInt numChar=calcMD5(*pcPic->getPicYuvRec(), decodedPictureHashSEI->m_pictureHash, bitDepths); 318 rHashString = hashToString(decodedPictureHashSEI->m_pictureHash, numChar); 319 } 320 else if(m_pcCfg->getDecodedPictureHashSEIEnabled() == 2) 321 { 322 decodedPictureHashSEI->method = SEIDecodedPictureHash::CRC; 323 UInt numChar=calcCRC(*pcPic->getPicYuvRec(), decodedPictureHashSEI->m_pictureHash, bitDepths); 324 rHashString = hashToString(decodedPictureHashSEI->m_pictureHash, numChar); 325 } 326 else if(m_pcCfg->getDecodedPictureHashSEIEnabled() == 3) 327 { 328 decodedPictureHashSEI->method = SEIDecodedPictureHash::CHECKSUM; 329 UInt numChar=calcChecksum(*pcPic->getPicYuvRec(), decodedPictureHashSEI->m_pictureHash, bitDepths); 330 rHashString = hashToString(decodedPictureHashSEI->m_pictureHash, numChar); 314 decodedPictureHashSEI->method = m_pcCfg->getDecodedPictureHashSEIType(); 315 switch (m_pcCfg->getDecodedPictureHashSEIType()) 316 { 317 case HASHTYPE_MD5: 318 { 319 UInt numChar=calcMD5(*pcPic->getPicYuvRec(), decodedPictureHashSEI->m_pictureHash, bitDepths); 320 rHashString = hashToString(decodedPictureHashSEI->m_pictureHash, numChar); 321 } 322 break; 323 case HASHTYPE_CRC: 324 { 325 UInt numChar=calcCRC(*pcPic->getPicYuvRec(), decodedPictureHashSEI->m_pictureHash, bitDepths); 326 rHashString = hashToString(decodedPictureHashSEI->m_pictureHash, numChar); 327 } 328 break; 329 case HASHTYPE_CHECKSUM: 330 default: 331 { 332 UInt numChar=calcChecksum(*pcPic->getPicYuvRec(), decodedPictureHashSEI->m_pictureHash, bitDepths); 333 rHashString = hashToString(decodedPictureHashSEI->m_pictureHash, numChar); 334 } 335 break; 331 336 } 332 337 } -
TabularUnified branches/SHM-dev/source/Lib/TLibEncoder/SEIwrite.cpp ¶
r1442 r1459 309 309 switch (sei.method) 310 310 { 311 case SEIDecodedPictureHash::MD5: traceString="picture_md5"; break;312 case SEIDecodedPictureHash::CRC: traceString="picture_crc"; break;313 case SEIDecodedPictureHash::CHECKSUM: traceString="picture_checksum"; break;311 case HASHTYPE_MD5: traceString="picture_md5"; break; 312 case HASHTYPE_CRC: traceString="picture_crc"; break; 313 case HASHTYPE_CHECKSUM: traceString="picture_checksum"; break; 314 314 default: assert(false); break; 315 315 } -
TabularUnified branches/SHM-dev/source/Lib/TLibEncoder/TEncCfg.h ¶
r1442 r1459 257 257 std::vector<Int> m_tileRowHeight; 258 258 259 Int m_iWaveFrontSynchro;260 261 Int m_decodedPictureHashSEIEnabled; ///< Checksum(3)/CRC(2)/MD5(1)/disable(0) acting on decoded picture hash SEI message262 Intm_bufferingPeriodSEIEnabled;263 Intm_pictureTimingSEIEnabled;264 Intm_recoveryPointSEIEnabled;259 Bool m_entropyCodingSyncEnabledFlag; 260 261 HashType m_decodedPictureHashSEIType; 262 Bool m_bufferingPeriodSEIEnabled; 263 Bool m_pictureTimingSEIEnabled; 264 Bool m_recoveryPointSEIEnabled; 265 265 Bool m_toneMappingInfoSEIEnabled; 266 266 Int m_toneMapId; … … 290 290 Int* m_codedPivotValue; 291 291 Int* m_targetPivotValue; 292 Intm_framePackingSEIEnabled;292 Bool m_framePackingSEIEnabled; 293 293 Int m_framePackingSEIType; 294 294 Int m_framePackingSEIId; 295 295 Int m_framePackingSEIQuincunx; 296 296 Int m_framePackingSEIInterpretation; 297 Intm_segmentedRectFramePackingSEIEnabled;297 Bool m_segmentedRectFramePackingSEIEnabled; 298 298 Bool m_segmentedRectFramePackingSEICancel; 299 299 Int m_segmentedRectFramePackingSEIType; 300 300 Bool m_segmentedRectFramePackingSEIPersistence; 301 301 Int m_displayOrientationSEIAngle; 302 Intm_temporalLevel0IndexSEIEnabled;303 Intm_gradualDecodingRefreshInfoEnabled;302 Bool m_temporalLevel0IndexSEIEnabled; 303 Bool m_gradualDecodingRefreshInfoEnabled; 304 304 Int m_noDisplaySEITLayer; 305 Intm_decodingUnitInfoSEIEnabled;306 Intm_SOPDescriptionSEIEnabled;307 Intm_scalableNestingSEIEnabled;305 Bool m_decodingUnitInfoSEIEnabled; 306 Bool m_SOPDescriptionSEIEnabled; 307 Bool m_scalableNestingSEIEnabled; 308 308 Bool m_tmctsSEIEnabled; 309 309 Bool m_timeCodeSEIEnabled; … … 780 780 UInt getRowHeight ( UInt rowIdx ) { return m_tileRowHeight[rowIdx]; } 781 781 Void xCheckGSParameters(); 782 Void set WaveFrontSynchro(Int iWaveFrontSynchro) { m_iWaveFrontSynchro = iWaveFrontSynchro; }783 Int getWaveFrontsynchro() { return m_iWaveFrontSynchro; }784 Void setDecodedPictureHashSEI Enabled(Int b) { m_decodedPictureHashSEIEnabled = b; }785 Int getDecodedPictureHashSEIEnabled() { return m_decodedPictureHashSEIEnabled; }786 Void setBufferingPeriodSEIEnabled( Int b){ m_bufferingPeriodSEIEnabled = b; }787 Int getBufferingPeriodSEIEnabled(){ return m_bufferingPeriodSEIEnabled; }788 Void setPictureTimingSEIEnabled( Int b){ m_pictureTimingSEIEnabled = b; }789 Int getPictureTimingSEIEnabled(){ return m_pictureTimingSEIEnabled; }790 Void setRecoveryPointSEIEnabled( Int b){ m_recoveryPointSEIEnabled = b; }791 Int getRecoveryPointSEIEnabled(){ return m_recoveryPointSEIEnabled; }782 Void setEntropyCodingSyncEnabledFlag(Bool b) { m_entropyCodingSyncEnabledFlag = b; } 783 Bool getEntropyCodingSyncEnabledFlag() const { return m_entropyCodingSyncEnabledFlag; } 784 Void setDecodedPictureHashSEIType(HashType m) { m_decodedPictureHashSEIType = m; } 785 HashType getDecodedPictureHashSEIType() const { return m_decodedPictureHashSEIType; } 786 Void setBufferingPeriodSEIEnabled(Bool b) { m_bufferingPeriodSEIEnabled = b; } 787 Bool getBufferingPeriodSEIEnabled() const { return m_bufferingPeriodSEIEnabled; } 788 Void setPictureTimingSEIEnabled(Bool b) { m_pictureTimingSEIEnabled = b; } 789 Bool getPictureTimingSEIEnabled() const { return m_pictureTimingSEIEnabled; } 790 Void setRecoveryPointSEIEnabled(Bool b) { m_recoveryPointSEIEnabled = b; } 791 Bool getRecoveryPointSEIEnabled() const { return m_recoveryPointSEIEnabled; } 792 792 Void setToneMappingInfoSEIEnabled(Bool b) { m_toneMappingInfoSEIEnabled = b; } 793 793 Bool getToneMappingInfoSEIEnabled() { return m_toneMappingInfoSEIEnabled; } … … 844 844 Void setTMISEIExtendedWhiteLevelLumaCodeValue(Int b) { m_extendedWhiteLevelLumaCodeValue =b; } 845 845 Int getTMISEIExtendedWhiteLevelLumaCodeValue() { return m_extendedWhiteLevelLumaCodeValue; } 846 Void setFramePackingArrangementSEIEnabled( Int b){ m_framePackingSEIEnabled = b; }847 Int getFramePackingArrangementSEIEnabled(){ return m_framePackingSEIEnabled; }846 Void setFramePackingArrangementSEIEnabled(Bool b) { m_framePackingSEIEnabled = b; } 847 Bool getFramePackingArrangementSEIEnabled() const { return m_framePackingSEIEnabled; } 848 848 Void setFramePackingArrangementSEIType(Int b) { m_framePackingSEIType = b; } 849 849 Int getFramePackingArrangementSEIType() { return m_framePackingSEIType; } … … 854 854 Void setFramePackingArrangementSEIInterpretation(Int b) { m_framePackingSEIInterpretation = b; } 855 855 Int getFramePackingArrangementSEIInterpretation() { return m_framePackingSEIInterpretation; } 856 Void setSegmentedRectFramePackingArrangementSEIEnabled( Int b){ m_segmentedRectFramePackingSEIEnabled = b; }857 Int getSegmentedRectFramePackingArrangementSEIEnabled(){ return m_segmentedRectFramePackingSEIEnabled; }856 Void setSegmentedRectFramePackingArrangementSEIEnabled(Bool b) { m_segmentedRectFramePackingSEIEnabled = b; } 857 Bool getSegmentedRectFramePackingArrangementSEIEnabled() const { return m_segmentedRectFramePackingSEIEnabled; } 858 858 Void setSegmentedRectFramePackingArrangementSEICancel(Int b) { m_segmentedRectFramePackingSEICancel = b; } 859 859 Int getSegmentedRectFramePackingArrangementSEICancel() { return m_segmentedRectFramePackingSEICancel; } … … 864 864 Void setDisplayOrientationSEIAngle(Int b) { m_displayOrientationSEIAngle = b; } 865 865 Int getDisplayOrientationSEIAngle() { return m_displayOrientationSEIAngle; } 866 Void setTemporalLevel0IndexSEIEnabled( Int b){ m_temporalLevel0IndexSEIEnabled = b; }867 Int getTemporalLevel0IndexSEIEnabled(){ return m_temporalLevel0IndexSEIEnabled; }868 Void setGradualDecodingRefreshInfoEnabled( Int b){ m_gradualDecodingRefreshInfoEnabled = b; }869 Int getGradualDecodingRefreshInfoEnabled(){ return m_gradualDecodingRefreshInfoEnabled; }866 Void setTemporalLevel0IndexSEIEnabled(Bool b) { m_temporalLevel0IndexSEIEnabled = b; } 867 Bool getTemporalLevel0IndexSEIEnabled() const { return m_temporalLevel0IndexSEIEnabled; } 868 Void setGradualDecodingRefreshInfoEnabled(Bool b) { m_gradualDecodingRefreshInfoEnabled = b; } 869 Bool getGradualDecodingRefreshInfoEnabled() const { return m_gradualDecodingRefreshInfoEnabled; } 870 870 Void setNoDisplaySEITLayer(Int b) { m_noDisplaySEITLayer = b; } 871 871 Int getNoDisplaySEITLayer() { return m_noDisplaySEITLayer; } 872 Void setDecodingUnitInfoSEIEnabled( Int b){ m_decodingUnitInfoSEIEnabled = b; }873 Int getDecodingUnitInfoSEIEnabled(){ return m_decodingUnitInfoSEIEnabled; }874 Void setSOPDescriptionSEIEnabled( Int b){ m_SOPDescriptionSEIEnabled = b; }875 Int getSOPDescriptionSEIEnabled(){ return m_SOPDescriptionSEIEnabled; }876 Void setScalableNestingSEIEnabled( Int b){ m_scalableNestingSEIEnabled = b; }877 Int getScalableNestingSEIEnabled(){ return m_scalableNestingSEIEnabled; }872 Void setDecodingUnitInfoSEIEnabled(Bool b) { m_decodingUnitInfoSEIEnabled = b; } 873 Bool getDecodingUnitInfoSEIEnabled() const { return m_decodingUnitInfoSEIEnabled; } 874 Void setSOPDescriptionSEIEnabled(Bool b) { m_SOPDescriptionSEIEnabled = b; } 875 Bool getSOPDescriptionSEIEnabled() const { return m_SOPDescriptionSEIEnabled; } 876 Void setScalableNestingSEIEnabled(Bool b) { m_scalableNestingSEIEnabled = b; } 877 Bool getScalableNestingSEIEnabled() const { return m_scalableNestingSEIEnabled; } 878 878 Void setTMCTSSEIEnabled(Bool b) { m_tmctsSEIEnabled = b; } 879 879 Bool getTMCTSSEIEnabled() { return m_tmctsSEIEnabled; } -
TabularUnified branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp ¶
r1442 r1459 1139 1139 1140 1140 // The last DU may have a trailing SEI 1141 if (m_pcCfg->getDecodedPictureHashSEI Enabled())1141 if (m_pcCfg->getDecodedPictureHashSEIType()!=HASHTYPE_NONE) 1142 1142 { 1143 1143 duData.back().accumBitsDU += ( 20 << 3 ); // probably around 20 bytes - should be further adjusted, e.g. by type … … 1473 1473 { 1474 1474 return 1; 1475 } 1476 } 1477 1478 1479 static Void 1480 printHash(const HashType hashType, const std::string &digestStr) 1481 { 1482 const TChar *decodedPictureHashModeName; 1483 switch (hashType) 1484 { 1485 case HASHTYPE_MD5: 1486 decodedPictureHashModeName = "MD5"; 1487 break; 1488 case HASHTYPE_CRC: 1489 decodedPictureHashModeName = "CRC"; 1490 break; 1491 case HASHTYPE_CHECKSUM: 1492 decodedPictureHashModeName = "Checksum"; 1493 break; 1494 default: 1495 decodedPictureHashModeName = NULL; 1496 break; 1497 } 1498 if (decodedPictureHashModeName != NULL) 1499 { 1500 if (digestStr.empty()) 1501 { 1502 printf(" [%s:%s]", decodedPictureHashModeName, "?"); 1503 } 1504 else 1505 { 1506 printf(" [%s:%s]", decodedPictureHashModeName, digestStr.c_str()); 1507 } 1475 1508 } 1476 1509 } … … 2833 2866 2834 2867 std::string digestStr; 2835 if (m_pcCfg->getDecodedPictureHashSEI Enabled())2868 if (m_pcCfg->getDecodedPictureHashSEIType()!=HASHTYPE_NONE) 2836 2869 { 2837 2870 SEIDecodedPictureHash *decodedPictureHashSei = new SEIDecodedPictureHash(); … … 2854 2887 xCalculateAddPSNRs( isField, isTff, iGOPid, pcPic, accessUnit, rcListPic, dEncTime, snr_conversion, printFrameMSE ); 2855 2888 2856 if (!digestStr.empty()) 2857 { 2858 if(m_pcCfg->getDecodedPictureHashSEIEnabled() == 1) 2859 { 2860 printf(" [MD5:%s]", digestStr.c_str()); 2861 } 2862 else if(m_pcCfg->getDecodedPictureHashSEIEnabled() == 2) 2863 { 2864 printf(" [CRC:%s]", digestStr.c_str()); 2865 } 2866 else if(m_pcCfg->getDecodedPictureHashSEIEnabled() == 3) 2867 { 2868 printf(" [Checksum:%s]", digestStr.c_str()); 2869 } 2870 } 2889 printHash(m_pcCfg->getDecodedPictureHashSEIType(), digestStr); 2871 2890 2872 2891 if ( m_pcCfg->getUseRateCtrl() ) -
TabularUnified branches/SHM-dev/source/Lib/TLibEncoder/TEncSlice.cpp ¶
r1401 r1459 859 859 { 860 860 // This will only occur if dependent slice-segments (m_entropyCodingSyncContextState=true) are being used. 861 if( pCurrentTile->getTileWidthInCtus() >= 2 || !m_pcCfg->get WaveFrontsynchro() )861 if( pCurrentTile->getTileWidthInCtus() >= 2 || !m_pcCfg->getEntropyCodingSyncEnabledFlag() ) 862 862 { 863 863 m_pppcRDSbacCoder[0][CI_CURR_BEST]->loadContexts( &m_lastSliceSegmentEndContextState ); … … 884 884 m_pppcRDSbacCoder[0][CI_CURR_BEST]->resetEntropy(pcSlice); 885 885 } 886 else if ( ctuXPosInCtus == tileXPosInCtus && m_pcCfg->get WaveFrontsynchro())886 else if ( ctuXPosInCtus == tileXPosInCtus && m_pcCfg->getEntropyCodingSyncEnabledFlag()) 887 887 { 888 888 // reset and then update contexts to the state at the end of the top-right CTU (if within current slice and tile). … … 1007 1007 1008 1008 // Store probabilities of second CTU in line into buffer - used only if wavefront-parallel-processing is enabled. 1009 if ( ctuXPosInCtus == tileXPosInCtus+1 && m_pcCfg->get WaveFrontsynchro())1009 if ( ctuXPosInCtus == tileXPosInCtus+1 && m_pcCfg->getEntropyCodingSyncEnabledFlag()) 1010 1010 { 1011 1011 m_entropyCodingSyncContextState.loadContexts(m_pppcRDSbacCoder[0][CI_CURR_BEST]); -
TabularUnified branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.cpp ¶
r1442 r1459 204 204 delete [] m_pppcRDSbacCoder; 205 205 delete [] m_pppcBinCoderCABAC; 206 206 207 207 #if SVC_EXTENSION 208 208 for(Int i=0; i<MAX_NUM_REF; i++) … … 909 909 910 910 m_cSPS.setLog2MinCodingBlockSize(log2MinCUSize); 911 911 912 912 #if SVC_EXTENSION 913 913 m_cSPS.setSPSId ( m_iSPSIdCnt ); 914 914 #endif 915 915 916 916 m_cSPS.setPCMLog2MinSize (m_uiPCMLog2MinSize); 917 917 m_cSPS.setUsePCM ( m_usePCM ); … … 1255 1255 m_cPPS.setQpOffset(COMPONENT_Cr, m_chromaCrQpOffset ); 1256 1256 1257 m_cPPS.setEntropyCodingSyncEnabledFlag( m_ iWaveFrontSynchro > 0);1257 m_cPPS.setEntropyCodingSyncEnabledFlag( m_entropyCodingSyncEnabledFlag ); 1258 1258 m_cPPS.setTilesEnabledFlag( (m_iNumColumnsMinus1 > 0 || m_iNumRowsMinus1 > 0) ); 1259 1259 m_cPPS.setUseWP( m_useWeightedPred );
Note: See TracChangeset for help on using the changeset viewer.