diff --git a/source/Lib/CommonLib/SEI.h b/source/Lib/CommonLib/SEI.h index a77a94e2b9e5d9b8208483eeeb8a0a588be347fe..0c5944e0bf16c8c4d0c915625d2c24d31e5cc9c5 100644 --- a/source/Lib/CommonLib/SEI.h +++ b/source/Lib/CommonLib/SEI.h @@ -244,6 +244,7 @@ public: virtual ~SEIDecodedPictureHash() {} HashType method; + bool singleCompFlag; PictureHash m_pictureHash; }; diff --git a/source/Lib/DecoderLib/SEIread.cpp b/source/Lib/DecoderLib/SEIread.cpp index a5df827f2f90c27e14f79d1373dd4f2950f74eed..b4f80914d17c1a07505672b6b7612bf90354f522 100644 --- a/source/Lib/DecoderLib/SEIread.cpp +++ b/source/Lib/DecoderLib/SEIread.cpp @@ -440,6 +440,10 @@ void SEIReader::xParseSEIDecodedPictureHash(SEIDecodedPictureHash& sei, uint32_t uint32_t val; sei_read_code( pDecodedMessageOutputStream, 8, val, "dph_sei_hash_type"); sei.method = static_cast<HashType>(val); bytesRead++; + sei_read_code( pDecodedMessageOutputStream, 1, val, "dph_sei_single_component_flag"); + sei.singleCompFlag = val; + sei_read_code( pDecodedMessageOutputStream, 7, val, "dph_sei_reserved_zero_7bits"); + bytesRead++; const char *traceString="\0"; switch (sei.method) diff --git a/source/Lib/EncoderLib/SEIEncoder.cpp b/source/Lib/EncoderLib/SEIEncoder.cpp index a9ecad7caa99259ec7a2f10e8db0eba6f6fef31c..f3011b7a817eb477c37e280e90bc0cab809aaa91 100644 --- a/source/Lib/EncoderLib/SEIEncoder.cpp +++ b/source/Lib/EncoderLib/SEIEncoder.cpp @@ -460,6 +460,7 @@ void SEIEncoder::initDecodedPictureHashSEI(SEIDecodedPictureHash *decodedPicture CHECK(!(decodedPictureHashSEI!=NULL), "Unspecified error"); decodedPictureHashSEI->method = m_pcCfg->getDecodedPictureHashSEIType(); + decodedPictureHashSEI->singleCompFlag = (m_pcCfg->getChromaFormatIdc() == 0); switch (m_pcCfg->getDecodedPictureHashSEIType()) { case HASHTYPE_MD5: diff --git a/source/Lib/EncoderLib/SEIwrite.cpp b/source/Lib/EncoderLib/SEIwrite.cpp index d8e7f90653a6093f10ac4bb2b29196d1ca07f10c..03dbe98af53c1ecab117a07bf5da7605fa061194 100644 --- a/source/Lib/EncoderLib/SEIwrite.cpp +++ b/source/Lib/EncoderLib/SEIwrite.cpp @@ -228,6 +228,8 @@ void SEIWriter::xWriteSEIDecodedPictureHash(const SEIDecodedPictureHash& sei) if (traceString != 0) //use of this variable is needed to avoid a compiler error with G++ 4.6.1 { WRITE_CODE(sei.method, 8, "dph_sei_hash_type"); + WRITE_CODE(sei.singleCompFlag, 1, "dph_sei_single_component_flag"); + WRITE_CODE(0, 7, "dph_sei_reserved_zero_7bits"); for(uint32_t i=0; i<uint32_t(sei.m_pictureHash.hash.size()); i++) { WRITE_CODE(sei.m_pictureHash.hash[i], 8, traceString);