Skip to content
Snippets Groups Projects
Commit 8bf04c28 authored by Brian Heng's avatar Brian Heng
Browse files

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

parent ec4bb116
No related branches found
No related tags found
1 merge request!1953Update output YUV shift if the bitdepth changes between two sequences.
......@@ -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
......
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