Changeset 1572 in SHVCSoftware
- Timestamp:
- 20 Jun 2016, 18:41:36 (8 years ago)
- Location:
- branches/SHM-dev/source
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp
r1569 r1572 1619 1619 ("SEIPreferredTransferCharacterisics", m_preferredTransferCharacteristics, -1, "Value for the preferred_transfer_characteristics field of the Alternative transfer characteristics SEI which will override the corresponding entry in the VUI. If negative, do not produce the respective SEI message") 1620 1620 #endif 1621 ("SEIGreenMetadataType", m_greenMetadataType, 0u, "Value for the green_metadata_type specifies the type of metadata that is present in the SEI message. If green_metadata_type is 1, then metadata enabling quality recovery after low-power encoding is present") 1622 ("SEIXSDMetricType", m_xsdMetricType, 0u, "Value for the xsd_metric_type indicates the type of the objective quality metric. PSNR is the only type currently supported") 1621 1623 1622 1624 #if LAYERS_NOT_PRESENT_SEI -
branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.h
r1569 r1572 454 454 Int m_preferredTransferCharacteristics; 455 455 #endif 456 UInt m_greenMetadataType; 457 UInt m_xsdMetricType; 456 458 457 459 // weighted prediction -
branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp
r1569 r1572 812 812 m_cTEncTop.setSEIPreferredTransferCharacteristics ( UChar(m_preferredTransferCharacteristics) ); 813 813 #endif 814 m_cTEncTop.setSEIGreenMetadataInfoSEIEnable ( m_greenMetadataType > 0 ); 815 m_cTEncTop.setSEIGreenMetadataType ( UChar(m_greenMetadataType) ); 816 m_cTEncTop.setSEIXSDMetricType ( UChar(m_xsdMetricType) ); 814 817 815 818 m_cTEncTop.setTileUniformSpacingFlag ( m_tileUniformSpacingFlag ); -
branches/SHM-dev/source/Lib/TLibCommon/SEI.cpp
r1550 r1572 136 136 case SEI::FRAME_PACKING: return "Frame packing arrangement"; 137 137 case SEI::DISPLAY_ORIENTATION: return "Display orientation"; 138 case SEI::GREEN_METADATA: return "Green metadata information"; 138 139 case SEI::SOP_DESCRIPTION: return "Structure of pictures information"; 139 140 case SEI::ACTIVE_PARAMETER_SETS: return "Active parameter sets"; -
branches/SHM-dev/source/Lib/TLibCommon/SEI.h
r1550 r1572 77 77 FRAME_PACKING = 45, 78 78 DISPLAY_ORIENTATION = 47, 79 GREEN_METADATA = 56, 79 80 SOP_DESCRIPTION = 128, 80 81 ACTIVE_PARAMETER_SETS = 129, … … 650 651 #endif 651 652 653 class SEIGreenMetadataInfo : public SEI 654 { 655 public: 656 PayloadType payloadType() const { return GREEN_METADATA; } 657 SEIGreenMetadataInfo() {} 658 659 virtual ~SEIGreenMetadataInfo() {} 660 661 UInt m_greenMetadataType; 662 UInt m_xsdMetricType; 663 UInt m_xsdMetricValue; 664 }; 665 652 666 #if P0123_ALPHA_CHANNEL_SEI 653 667 class SEIAlphaChannelInfo : public SEI -
branches/SHM-dev/source/Lib/TLibDecoder/SEIread.cpp
r1549 r1572 414 414 xParseSEIDecodedPictureHash((SEIDecodedPictureHash&) *sei, payloadSize, pDecodedMessageOutputStream); 415 415 break; 416 case SEI::GREEN_METADATA: 417 sei = new SEIGreenMetadataInfo; 418 xParseSEIGreenMetadataInfo((SEIGreenMetadataInfo&) *sei, payloadSize, pDecodedMessageOutputStream); 419 break; 416 420 default: 417 421 for (UInt i = 0; i < payloadSize; i++) … … 1460 1464 } 1461 1465 #endif 1466 1467 Void SEIReader::xParseSEIGreenMetadataInfo(SEIGreenMetadataInfo& sei, UInt payloadSize, ostream* pDecodedMessageOutputStream) 1468 { 1469 UInt code; 1470 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 1471 1472 sei_read_code(pDecodedMessageOutputStream, 8, code, "green_metadata_type"); 1473 sei.m_greenMetadataType = code; 1474 1475 sei_read_code(pDecodedMessageOutputStream, 8, code, "xsd_metric_type"); 1476 sei.m_xsdMetricType = code; 1477 1478 sei_read_code(pDecodedMessageOutputStream, 16, code, "xsd_metric_value"); 1479 sei.m_xsdMetricValue = code; 1480 } 1462 1481 1463 1482 #if SVC_EXTENSION -
branches/SHM-dev/source/Lib/TLibDecoder/SEIread.h
r1549 r1572 112 112 Void xParseSEIAlternativeTransferCharacteristics(SEIAlternativeTransferCharacteristics& sei, UInt payLoadSize, std::ostream *pDecodedMessageOutputStream); 113 113 #endif 114 Void xParseSEIGreenMetadataInfo (SEIGreenMetadataInfo& sei, UInt payLoadSize, std::ostream *pDecodedMessageOutputStream); 114 115 115 116 Void sei_read_code(std::ostream *pOS, UInt uiLength, UInt& ruiCode, const TChar *pSymbolName); -
branches/SHM-dev/source/Lib/TLibEncoder/SEIEncoder.cpp
r1549 r1572 680 680 #endif 681 681 682 Void SEIEncoder::initSEIGreenMetadataInfo(SEIGreenMetadataInfo *seiGreenMetadataInfo, UInt u) 683 { 684 assert (m_isInitialized); 685 assert (seiGreenMetadataInfo!=NULL); 686 687 seiGreenMetadataInfo->m_greenMetadataType = m_pcCfg->getSEIGreenMetadataType(); 688 seiGreenMetadataInfo->m_xsdMetricType = m_pcCfg->getSEIXSDMetricType(); 689 seiGreenMetadataInfo->m_xsdMetricValue = u; 690 } 691 682 692 #if LAYERS_NOT_PRESENT_SEI 683 693 Void SEIEncoder::initSEILayersNotPresent(SEILayersNotPresent *seiLayersNotPresent) -
branches/SHM-dev/source/Lib/TLibEncoder/SEIEncoder.h
r1549 r1572 105 105 Void initDecodedPictureHashSEI(SEIDecodedPictureHash *sei, TComPic *pcPic, std::string &rHashString, const BitDepths &bitDepths); 106 106 Void initTemporalLevel0IndexSEI(SEITemporalLevel0Index *sei, TComSlice *slice); 107 Void initSEIGreenMetadataInfo(SEIGreenMetadataInfo *sei, UInt u); 107 108 108 109 private: -
branches/SHM-dev/source/Lib/TLibEncoder/SEIwrite.cpp
r1549 r1572 163 163 break; 164 164 #endif 165 case SEI::GREEN_METADATA: 166 xWriteSEIGreenMetadataInfo(*static_cast<const SEIGreenMetadataInfo*>(&sei)); 167 break; 165 168 166 169 #if SVC_EXTENSION … … 1086 1089 #endif 1087 1090 1091 Void SEIWriter::xWriteSEIGreenMetadataInfo(const SEIGreenMetadataInfo& sei) 1092 { 1093 WRITE_CODE(sei.m_greenMetadataType, 8, "green_metadata_type"); 1094 1095 WRITE_CODE(sei.m_xsdMetricType, 8, "xsd_metric_type"); 1096 WRITE_CODE(sei.m_xsdMetricValue, 16, "xsd_metric_value"); 1097 } 1098 1088 1099 #if SVC_EXTENSION 1089 1100 #if LAYERS_NOT_PRESENT_SEI -
branches/SHM-dev/source/Lib/TLibEncoder/SEIwrite.h
r1549 r1572 94 94 Void xWriteSEIAlternativeTransferCharacteristics(const SEIAlternativeTransferCharacteristics& sei); 95 95 #endif 96 Void xWriteSEIGreenMetadataInfo(const SEIGreenMetadataInfo &sei); 96 97 97 98 #if O0164_MULTI_LAYER_HRD -
branches/SHM-dev/source/Lib/TLibEncoder/TEncCfg.h
r1569 r1572 348 348 UChar m_preferredTransferCharacteristics; 349 349 #endif 350 Bool m_greenMetadataInfoSEIEnabled; 351 UChar m_greenMetadataType; 352 UChar m_xsdMetricType; 350 353 //====== Weighted Prediction ======== 351 354 Bool m_useWeightedPred; //< Use of Weighting Prediction (P_SLICE) … … 958 961 UChar getSEIPreferredTransferCharacteristics() const { return m_preferredTransferCharacteristics; } 959 962 #endif 963 Void setSEIGreenMetadataInfoSEIEnable( Bool b) { m_greenMetadataInfoSEIEnabled = b; } 964 Bool getSEIGreenMetadataInfoSEIEnable( ) const { return m_greenMetadataInfoSEIEnabled; } 965 Void setSEIGreenMetadataType(UChar v) { m_greenMetadataType = v; } 966 UChar getSEIGreenMetadataType() const { return m_greenMetadataType; } 967 Void setSEIXSDMetricType(UChar v) { m_xsdMetricType = v; } 968 UChar getSEIXSDMetricType() const { return m_xsdMetricType; } 969 960 970 const TComSEIMasteringDisplay &getMasteringDisplaySEI() const { return m_masteringDisplay; } 961 971 Void setUseWP ( Bool b ) { m_useWeightedPred = b; } -
branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp
r1570 r1572 2746 2746 } 2747 2747 2748 m_pcCfg->setEncodedFlag(iGOPid, true); 2749 2750 Double PSNR_Y; 2751 xCalculateAddPSNRs( isField, isTff, iGOPid, pcPic, accessUnit, rcListPic, dEncTime, snr_conversion, printFrameMSE, &PSNR_Y ); 2752 2753 // Only produce the Green Metadata SEI message with the last picture. 2754 if( m_pcCfg->getSEIGreenMetadataInfoSEIEnable() && pcSlice->getPOC() == ( m_pcCfg->getFramesToBeEncoded() - 1 ) ) 2755 { 2756 SEIGreenMetadataInfo *seiGreenMetadataInfo = new SEIGreenMetadataInfo; 2757 m_seiEncoder.initSEIGreenMetadataInfo(seiGreenMetadataInfo, (UInt)(PSNR_Y * 100 + 0.5)); 2758 trailingSeiMessages.push_back(seiGreenMetadataInfo); 2759 } 2760 2748 2761 #if O0164_MULTI_LAYER_HRD 2749 2762 xWriteTrailingSEIMessages(trailingSeiMessages, accessUnit, pcSlice->getTLayer(), pcSlice->getVPS(), pcSlice->getSPS()); … … 2751 2764 xWriteTrailingSEIMessages(trailingSeiMessages, accessUnit, pcSlice->getTLayer(), pcSlice->getSPS()); 2752 2765 #endif 2753 2754 m_pcCfg->setEncodedFlag(iGOPid, true); 2755 2756 xCalculateAddPSNRs( isField, isTff, iGOPid, pcPic, accessUnit, rcListPic, dEncTime, snr_conversion, printFrameMSE ); 2757 2766 2758 2767 printHash(m_pcCfg->getDecodedPictureHashSEIType(), digestStr); 2759 2768 … … 3021 3030 } 3022 3031 3023 Void TEncGOP::xCalculateAddPSNRs( const Bool isField, const Bool isFieldTopFieldFirst, const Int iGOPid, TComPic* pcPic, const AccessUnit&accessUnit, TComList<TComPic*> &rcListPic, const Double dEncTime, const InputColourSpaceConversion snr_conversion, const Bool printFrameMSE )3024 { 3025 xCalculateAddPSNR( pcPic, pcPic->getPicYuvRec(), accessUnit, dEncTime, snr_conversion, printFrameMSE );3032 Void TEncGOP::xCalculateAddPSNRs( const Bool isField, const Bool isFieldTopFieldFirst, const Int iGOPid, TComPic* pcPic, const AccessUnit&accessUnit, TComList<TComPic*> &rcListPic, const Double dEncTime, const InputColourSpaceConversion snr_conversion, const Bool printFrameMSE, Double* PSNR_Y ) 3033 { 3034 xCalculateAddPSNR( pcPic, pcPic->getPicYuvRec(), accessUnit, dEncTime, snr_conversion, printFrameMSE, PSNR_Y ); 3026 3035 3027 3036 //In case of field coding, compute the interlaced PSNR for both fields … … 3078 3087 if( (pcPic->isTopField() && isFieldTopFieldFirst) || (!pcPic->isTopField() && !isFieldTopFieldFirst)) 3079 3088 { 3080 xCalculateInterlacedAddPSNR(pcPic, correspondingFieldPic, pcPic->getPicYuvRec(), correspondingFieldPic->getPicYuvRec(), snr_conversion, printFrameMSE );3089 xCalculateInterlacedAddPSNR(pcPic, correspondingFieldPic, pcPic->getPicYuvRec(), correspondingFieldPic->getPicYuvRec(), snr_conversion, printFrameMSE, PSNR_Y ); 3081 3090 } 3082 3091 else 3083 3092 { 3084 xCalculateInterlacedAddPSNR(correspondingFieldPic, pcPic, correspondingFieldPic->getPicYuvRec(), pcPic->getPicYuvRec(), snr_conversion, printFrameMSE );3085 } 3086 } 3087 } 3088 } 3089 3090 Void TEncGOP::xCalculateAddPSNR( TComPic* pcPic, TComPicYuv* pcPicD, const AccessUnit& accessUnit, Double dEncTime, const InputColourSpaceConversion conversion, const Bool printFrameMSE )3093 xCalculateInterlacedAddPSNR(correspondingFieldPic, pcPic, correspondingFieldPic->getPicYuvRec(), pcPic->getPicYuvRec(), snr_conversion, printFrameMSE, PSNR_Y ); 3094 } 3095 } 3096 } 3097 } 3098 3099 Void TEncGOP::xCalculateAddPSNR( TComPic* pcPic, TComPicYuv* pcPicD, const AccessUnit& accessUnit, Double dEncTime, const InputColourSpaceConversion conversion, const Bool printFrameMSE, Double* PSNR_Y ) 3091 3100 { 3092 3101 Double dPSNR[MAX_NUM_COMPONENT]; … … 3166 3175 { 3167 3176 m_gcAnalyzeI.addResult (dPSNR, (Double)uibits, MSEyuvframe); 3177 *PSNR_Y = dPSNR[COMPONENT_Y]; 3168 3178 } 3169 3179 if (pcSlice->isInterP()) 3170 3180 { 3171 3181 m_gcAnalyzeP.addResult (dPSNR, (Double)uibits, MSEyuvframe); 3182 *PSNR_Y = dPSNR[COMPONENT_Y]; 3172 3183 } 3173 3184 if (pcSlice->isInterB()) 3174 3185 { 3175 3186 m_gcAnalyzeB.addResult (dPSNR, (Double)uibits, MSEyuvframe); 3187 *PSNR_Y = dPSNR[COMPONENT_Y]; 3176 3188 } 3177 3189 … … 3282 3294 Void TEncGOP::xCalculateInterlacedAddPSNR( TComPic* pcPicOrgFirstField, TComPic* pcPicOrgSecondField, 3283 3295 TComPicYuv* pcPicRecFirstField, TComPicYuv* pcPicRecSecondField, 3284 const InputColourSpaceConversion conversion, const Bool printFrameMSE )3296 const InputColourSpaceConversion conversion, const Bool printFrameMSE, Double* PSNR_Y ) 3285 3297 { 3286 3298 const TComSPS &sps=pcPicOrgFirstField->getPicSym()->getSPS(); … … 3355 3367 //===== add PSNR ===== 3356 3368 m_gcAnalyzeAll_in.addResult (dPSNR, (Double)uibits, MSEyuvframe); 3369 3370 *PSNR_Y = dPSNR[COMPONENT_Y]; 3357 3371 3358 3372 printf("\n Interlaced frame %d: [Y %6.4lf dB U %6.4lf dB V %6.4lf dB]", pcPicOrgSecondField->getPOC()/2 , dPSNR[COMPONENT_Y], dPSNR[COMPONENT_Cb], dPSNR[COMPONENT_Cr] ); -
branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.h
r1549 r1572 228 228 Void xGetBuffer ( TComList<TComPic*>& rcListPic, TComList<TComPicYuv*>& rcListPicYuvRecOut, Int iNumPicRcvd, Int iTimeOffset, TComPic*& rpcPic, TComPicYuv*& rpcPicYuvRecOut, Int pocCurr, Bool isField ); 229 229 230 Void xCalculateAddPSNRs ( const Bool isField, const Bool isFieldTopFieldFirst, const Int iGOPid, TComPic* pcPic, const AccessUnit&accessUnit, TComList<TComPic*> &rcListPic, Double dEncTime, const InputColourSpaceConversion snr_conversion, const Bool printFrameMSE );231 Void xCalculateAddPSNR ( TComPic* pcPic, TComPicYuv* pcPicD, const AccessUnit&, Double dEncTime, const InputColourSpaceConversion snr_conversion, const Bool printFrameMSE );230 Void xCalculateAddPSNRs ( const Bool isField, const Bool isFieldTopFieldFirst, const Int iGOPid, TComPic* pcPic, const AccessUnit&accessUnit, TComList<TComPic*> &rcListPic, Double dEncTime, const InputColourSpaceConversion snr_conversion, const Bool printFrameMSE, Double* PSNR_Y ); 231 Void xCalculateAddPSNR ( TComPic* pcPic, TComPicYuv* pcPicD, const AccessUnit&, Double dEncTime, const InputColourSpaceConversion snr_conversion, const Bool printFrameMSE, Double* PSNR_Y ); 232 232 Void xCalculateInterlacedAddPSNR( TComPic* pcPicOrgFirstField, TComPic* pcPicOrgSecondField, 233 233 TComPicYuv* pcPicRecFirstField, TComPicYuv* pcPicRecSecondField, 234 const InputColourSpaceConversion snr_conversion, const Bool printFrameMSE );234 const InputColourSpaceConversion snr_conversion, const Bool printFrameMSE, Double* PSNR_Y ); 235 235 236 236 UInt64 xFindDistortionFrame (TComPicYuv* pcPic0, TComPicYuv* pcPic1, const BitDepths &bitDepths);
Note: See TracChangeset for help on using the changeset viewer.