Commit 7b07c5fa authored by Karsten Suehring's avatar Karsten Suehring

Merge branch 'fix_output_bitdepth' into 'master'

Update output YUV shift if the bitdepth changes between two sequences.

See merge request !1953
parents a46a3c30 8bf04c28
Pipeline #5937 passed with stage
in 14 minutes and 28 seconds
......@@ -325,6 +325,17 @@ uint32_t DecApp::decode()
m_cVideoIOYuvReconFile[nalu.m_nuhLayerId].open( reconFileName, true, m_outputBitDepth, m_outputBitDepth, bitDepths.recon ); // write mode
}
}
// update file bitdepth shift if recon bitdepth changed between sequences
for( uint32_t channelType = 0; channelType < MAX_NUM_CHANNEL_TYPE; channelType++ )
{
int reconBitdepth = pcListPic->front()->cs->sps->getBitDepth((ChannelType)channelType);
int fileBitdepth = m_cVideoIOYuvReconFile[nalu.m_nuhLayerId].getFileBitdepth(channelType);
int bitdepthShift = m_cVideoIOYuvReconFile[nalu.m_nuhLayerId].getBitdepthShift(channelType);
if( fileBitdepth + bitdepthShift != reconBitdepth )
{
m_cVideoIOYuvReconFile[nalu.m_nuhLayerId].setBitdepthShift(channelType, reconBitdepth - fileBitdepth);
}
}
// write reconstruction to file
if( bNewPicture )
{
......
......@@ -96,6 +96,9 @@ public:
bool isEof (); ///< check for end-of-file
bool isFail(); ///< check for failure
bool isOpen() { return m_cHandle.is_open(); }
void setBitdepthShift( int ch, int bd ) { m_bitdepthShift[ch] = bd; }
int getBitdepthShift( int ch ) { return m_bitdepthShift[ch]; }
int getFileBitdepth( int ch ) { return m_fileBitdepth[ch]; }
bool writeUpscaledPicture( const SPS& sps, const PPS& pps, const CPelUnitBuf& pic,
const InputColourSpaceConversion ipCSC, const bool bPackedYUVOutputMode, int outputChoice = 0, ChromaFormat format = NUM_CHROMA_FORMAT, const bool bClipToRec709 = false ); ///< write one upsaled YUV frame
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment