Skip to content
Snippets Groups Projects
Commit 6f22a27f authored by Karsten Suehring's avatar Karsten Suehring
Browse files

Improve file name handling for reconstructed /decode file

- don't add a layer id, if a single layer is encoded/decoded
- add the layer id before the last dot in the file name
- if no dot exists, append layer id to the file name
parent 6c8909d7
No related branches found
No related tags found
No related merge requests found
...@@ -603,7 +603,7 @@ Specifies the output coded bit stream file. ...@@ -603,7 +603,7 @@ Specifies the output coded bit stream file.
\Option{ReconFile (-o)} & \Option{ReconFile (-o)} &
%\ShortOption{-o} & %\ShortOption{-o} &
\Default{\NotSet} & \Default{\NotSet} &
Specifies the output locally reconstructed video file. Specifies the output locally reconstructed video file. If more than one layer is encoded (i.e. MaxLayers > 1), a reconstructed file is written for each layer and the layer index is added as suffix to ReconFile. If one or more dots exist in the file name, the layer id is added before the last dot, e.g. 'reconst.yuv' becomes 'reconst0.yuv' for layer id 0, 'reconst' becomes 'reconst0'.
\\ \\
\Option{SourceWidth (-wdt)}% \Option{SourceWidth (-wdt)}%
...@@ -1029,7 +1029,7 @@ Specifies the value of general_frame_only_constraint_flag ...@@ -1029,7 +1029,7 @@ Specifies the value of general_frame_only_constraint_flag
%% Layer parameters %% Layer parameters
%% %%
\begin{OptionTableNoShorthand}{Layer parameters}{tab:unit} \begin{OptionTableNoShorthand}{Layer parameters}{tab:layer}
\Option{MaxLayers} & \Option{MaxLayers} &
%\ShortOption{\None} & %\ShortOption{\None} &
\Default{1} & \Default{1} &
...@@ -3452,7 +3452,7 @@ Defines the input bit stream file name. ...@@ -3452,7 +3452,7 @@ Defines the input bit stream file name.
\Option{ReconFile (-o)} & \Option{ReconFile (-o)} &
%\ShortOption{-o} & %\ShortOption{-o} &
\Default{\NotSet} & \Default{\NotSet} &
Defines reconstructed YUV file name. If empty, no file is generated. For layered coding bitstream, each layer reconstructed YUV file name is formed by adding the layer index suffix to ReconFile. Defines the reconstructed video file name. If empty, no file is generated. If no single target layer is specified (i.e. TargetLayer=-1), a reconstructed file is written for each layer and the layer index is added as suffix to ReconFile. If one or more dots exist in the file name, the layer id is added before the last dot, e.g. 'decoded.yuv' becomes 'decoded0.yuv' for layer id 0, 'decoded' becomes 'decoded0'.
\\ \\
\Option{SkipFrames (-s)} & \Option{SkipFrames (-s)} &
......
...@@ -248,9 +248,20 @@ uint32_t DecApp::decode() ...@@ -248,9 +248,20 @@ uint32_t DecApp::decode()
#if JVET_N0278_FIXES #if JVET_N0278_FIXES
std::string reconFileName = m_reconFileName; std::string reconFileName = m_reconFileName;
if( m_reconFileName.compare( "/dev/null" ) ) if (m_iTargetLayer == -1)
{ {
reconFileName.insert( reconFileName.size() - 4, std::to_string( nalu.m_nuhLayerId ) ); if( m_reconFileName.compare( "/dev/null" ) || m_reconFileName.compare( "NULL" ))
{
size_t pos = reconFileName.find_last_of('.');
if (pos != string::npos)
{
reconFileName.insert( pos, std::to_string( nalu.m_nuhLayerId ) );
}
else
{
reconFileName.append( std::to_string( nalu.m_nuhLayerId ) );
}
}
} }
m_cVideoIOYuvReconFile[nalu.m_nuhLayerId].open( reconFileName, true, m_outputBitDepth, m_outputBitDepth, bitDepths.recon ); // write mode m_cVideoIOYuvReconFile[nalu.m_nuhLayerId].open( reconFileName, true, m_outputBitDepth, m_outputBitDepth, bitDepths.recon ); // write mode
#else #else
......
...@@ -715,9 +715,20 @@ void EncApp::xCreateLib( std::list<PelUnitBuf*>& recBufList ) ...@@ -715,9 +715,20 @@ void EncApp::xCreateLib( std::list<PelUnitBuf*>& recBufList )
#if JVET_N0278_FIXES #if JVET_N0278_FIXES
std::string reconFileName = m_reconFileName; std::string reconFileName = m_reconFileName;
if( m_reconFileName.compare( "/dev/null" ) ) if (m_maxLayers > 1)
{ {
reconFileName.insert( reconFileName.size() - 4, std::to_string( layerId ) ); if( m_reconFileName.compare( "/dev/null" ) || m_reconFileName.compare( "NULL" ))
{
size_t pos = reconFileName.find_last_of('.');
if (pos != string::npos)
{
reconFileName.insert( pos, std::to_string( layerId ) );
}
else
{
reconFileName.append( std::to_string( layerId ) );
}
}
} }
m_cVideoIOYuvReconFile.open( reconFileName, true, m_outputBitDepth, m_outputBitDepth, m_internalBitDepth ); // write mode m_cVideoIOYuvReconFile.open( reconFileName, true, m_outputBitDepth, m_outputBitDepth, m_internalBitDepth ); // write mode
#else #else
......
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