Skip to content
Snippets Groups Projects
Commit f1dd3768 authored by Alexey Filippov's avatar Alexey Filippov
Browse files

Support of opl-files for VVC conformance tests. If the -opl argument is not...

Support of opl-files for VVC conformance tests. If the -opl argument is not specified, VVC decoder behaviour is unchanged.
parent 2b6a7e1a
No related branches found
No related tags found
1 merge request!1299Add support for writing conformance log file
......@@ -95,6 +95,18 @@ uint32_t DecApp::decode()
}
}
#if JVET_P2008_OUTPUT_LOG
if (!m_oplFilename.empty() && m_oplFilename!="-")
{
m_oplFilename += ".opl";
m_oplFileStream.open(m_oplFilename.c_str(), std::ios::out);
if (!m_oplFileStream.is_open() || !m_oplFileStream.good())
{
EXIT( "Unable to open file "<< m_oplFilename.c_str() << " to write an opl-file for conformance testing (see JVET-P2008 for details)");
}
}
#endif //JVET_P2008_OUTPUT_LOG
// create & initialize internal classes
xCreateDecLib();
......@@ -656,6 +668,21 @@ bool DecApp::isNewAccessUnit( bool newPicture, ifstream *bitstreamFile, class In
return ret;
}
#if JVET_P2008_OUTPUT_LOG
void DecApp::writeLineToOutputLog(Picture * pcPic)
{
if (m_oplFileStream.is_open() && m_oplFileStream.good())
{
const SPS* sps = pcPic->cs->sps;
PictureHash recon_digest;
auto numChar = calcMD5(((const Picture*)pcPic)->getRecoBuf(), recon_digest, sps->getBitDepths());
m_oplFileStream << std::setw(8) << pcPic->getPOC() << "," << std::setw(5) << pcPic->Y().width << "," << std::setw(5) << pcPic->Y().height << "," << hashToString(recon_digest, numChar) << "\n";
}
}
#endif // JVET_P2008_OUTPUT_LOG
// ====================================================================================================================
// Protected member functions
// ====================================================================================================================
......@@ -802,6 +829,10 @@ void DecApp::xWriteOutput( PicList* pcListPic, uint32_t tId )
NUM_CHROMA_FORMAT, isTff );
}
}
#if JVET_P2008_OUTPUT_LOG
writeLineToOutputLog(pcPicTop);
writeLineToOutputLog(pcPicBottom);
#endif
// update POC of display order
m_iPOCLastDisplay = pcPicBottom->getPOC();
......@@ -860,6 +891,9 @@ void DecApp::xWriteOutput( PicList* pcListPic, uint32_t tId )
NUM_CHROMA_FORMAT, m_bClipOutputVideoToRec709Range );
}
}
#if JVET_P2008_OUTPUT_LOG
writeLineToOutputLog(pcPic);
#endif
#if HEVC_SEI
if (m_seiMessageFileStream.is_open())
......@@ -929,7 +963,10 @@ void DecApp::xFlushOutput( PicList* pcListPic, const int layerId )
conf.getWindowBottomOffset() * SPS::getWinUnitY( pcPicTop->cs->sps->getChromaFormatIdc() ),
NUM_CHROMA_FORMAT, isTff );
}
#if JVET_P2008_OUTPUT_LOG
writeLineToOutputLog(pcPicTop);
writeLineToOutputLog(pcPicBottom);
#endif
// update POC of display order
m_iPOCLastDisplay = pcPicBottom->getPOC();
......@@ -997,7 +1034,9 @@ void DecApp::xFlushOutput( PicList* pcListPic, const int layerId )
NUM_CHROMA_FORMAT, m_bClipOutputVideoToRec709Range );
}
}
#if JVET_P2008_OUTPUT_LOG
writeLineToOutputLog(pcPic);
#endif
#if HEVC_SEI
if (m_seiMessageFileStream.is_open())
{
......
......@@ -66,6 +66,12 @@ private:
// for output control
int m_iPOCLastDisplay; ///< last POC in display order
std::ofstream m_seiMessageFileStream; ///< Used for outputing SEI messages.
#if JVET_P2008_OUTPUT_LOG
std::ofstream m_oplFileStream; ///< Used to output log file for confomance testing
#endif //JVET_P2008_OUTPUT_LOG
#if HEVC_SEI
ColourRemapping m_cColourRemapping; ///< colour remapping handler
#endif
......@@ -86,6 +92,11 @@ private:
bool deriveOutputLayerSet(); ///< derive OLS and layer sets
bool isNewPicture(ifstream *bitstreamFile, class InputByteStream *bytestream); ///< check if next NAL unit will be the first NAL unit from a new picture
bool isNewAccessUnit(bool newPicture, ifstream *bitstreamFile, class InputByteStream *bytestream); ///< check if next NAL unit will be the first NAL unit from a new access unit
#if JVET_P2008_OUTPUT_LOG
void writeLineToOutputLog(Picture * pcPic);
#endif // JVET_P2008_OUTPUT_LOG
};
//! \}
......
......@@ -77,6 +77,10 @@ bool DecAppCfg::parseCfg( int argc, char* argv[] )
("BitstreamFile,b", m_bitstreamFileName, string(""), "bitstream input file name")
("ReconFile,o", m_reconFileName, string(""), "reconstructed YUV output file name\n")
#if JVET_P2008_OUTPUT_LOG
("OplFile,-opl", m_oplFilename , string(""), "opl-file name without extension for conformance testing\n")
#endif //JVET_P2008_OUTPUT_LOG
#if ENABLE_SIMD_OPT
("SIMD", ignore, string(""), "SIMD extension to use (SCALAR, SSE41, SSE42, AVX, AVX2, AVX512), default: the highest supported extension\n")
#endif
......@@ -223,6 +227,10 @@ bool DecAppCfg::parseCfg( int argc, char* argv[] )
DecAppCfg::DecAppCfg()
: m_bitstreamFileName()
, m_reconFileName()
#if JVET_P2008_OUTPUT_LOG
, m_oplFilename()
#endif //JVET_P2008_OUTPUT_LOG
, m_iSkipFrame(0)
// m_outputBitDepth array initialised below
, m_outputColourSpaceConvert(IPCOLOURSPACE_UNCHANGED)
......
......@@ -69,6 +69,12 @@ protected:
std::string m_colourRemapSEIFileName; ///< output Colour Remapping file name
std::vector<int> m_targetDecLayerIdSet; ///< set of LayerIds to be included in the sub-bitstream extraction process.
std::string m_outputDecodedSEIMessagesFilename; ///< filename to output decoded SEI messages to. If '-', then use stdout. If empty, do not output details.
#if JVET_P2008_OUTPUT_LOG
std::string m_oplFilename; ///< filename to output conformance log.
#endif //JVET_P2008_OUTPUT_LOG
bool m_bClipOutputVideoToRec709Range; ///< If true, clip the output video to the Rec 709 range on saving.
bool m_packedYUVMode; ///< If true, output 10-bit and 12-bit YUV data as 5-byte and 3-byte (respectively) packed YUV data
std::string m_cacheCfgFile; ///< Config file of cache model
......
......@@ -299,6 +299,10 @@ public:
int calcAndPrintHashStatus(const CPelUnitBuf& pic, const class SEIDecodedPictureHash* pictureHashSEI, const BitDepths &bitDepths, const MsgLevel msgl);
#if JVET_P2008_OUTPUT_LOG
uint32_t calcMD5(const CPelUnitBuf& pic, PictureHash &digest, const BitDepths &bitDepths);
std::string hashToString(const PictureHash &digest, int numChar);
#endif // JVET_P2008_OUTPUT_LOG
typedef std::list<Picture*> PicList;
......
......@@ -50,6 +50,7 @@
#include <assert.h>
#include <cassert>
#define JVET_P2008_OUTPUT_LOG 1 // Output log file for conformance tests
#define JVET_Q0110_Q0785_CHROMA_BDPCM_420 1 // JVET-Q0110/Q0785: Enable chroma BDPCM for 420, separate contexts for chroma BDPCM and bug-fixes.
#define JVET_Q0512_ENC_CHROMA_TS_ACT 1 // JVET-Q0512: encoder-side improvement on enabling chroma transform-skip for ACT
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment