Skip to content
Snippets Groups Projects
Commit 17dfc4f3 authored by Frank Bossen's avatar Frank Bossen
Browse files

Merge branch 'xlxiangli/fix_rpr_y4m' into 'master'

Fix y4m header writing when RPR is used and UpscaledOutput=2

See merge request !2690
parents adf69c9c d92f246c
No related branches found
No related tags found
No related merge requests found
......@@ -490,11 +490,21 @@ uint32_t DecApp::decode()
msg(WARNING, "\nWarning: No frame rate info found in the bitstream, default 50 fps is used.\n");
}
const auto pps = pcListPic->front()->cs->pps;
auto confWindow = pps->getConformanceWindow();
const auto sx = SPS::getWinUnitX(sps->getChromaFormatIdc());
const auto sy = SPS::getWinUnitY(sps->getChromaFormatIdc());
const int picWidth = pps->getPicWidthInLumaSamples() - (confWindow.getWindowLeftOffset() + confWindow.getWindowRightOffset()) * sx;
const int picHeight = pps->getPicHeightInLumaSamples() - (confWindow.getWindowTopOffset() + confWindow.getWindowBottomOffset()) * sy;
int picWidth = 0, picHeight = 0;
if (m_upscaledOutput == 2)
{
auto confWindow = sps->getConformanceWindow();
picWidth = sps->getMaxPicWidthInLumaSamples() -(confWindow.getWindowLeftOffset() + confWindow.getWindowRightOffset()) * sx;
picHeight = sps->getMaxPicHeightInLumaSamples() - (confWindow.getWindowTopOffset() + confWindow.getWindowBottomOffset()) * sy;
}
else
{
auto confWindow = pps->getConformanceWindow();
picWidth = pps->getPicWidthInLumaSamples() - (confWindow.getWindowLeftOffset() + confWindow.getWindowRightOffset()) * sx;
picHeight = pps->getPicHeightInLumaSamples() - (confWindow.getWindowTopOffset() + confWindow.getWindowBottomOffset()) * sy;
}
m_cVideoIOYuvReconFile[nalu.m_nuhLayerId].setOutputY4mInfo(
picWidth, picHeight, frameRate, layerOutputBitDepth[ChannelType::LUMA], sps->getChromaFormatIdc(),
sps->getVuiParameters()->getChromaSampleLocType());
......
......@@ -127,7 +127,7 @@ bool DecAppCfg::parseCfg( int argc, char* argv[] )
#endif
("MCTSCheck", m_mctsCheck, false, "If enabled, the decoder checks for violations of mc_exact_sample_value_match_flag in Temporal MCTS ")
("targetSubPicIdx", m_targetSubPicIdx, 0, "Specify which subpicture shall be written to output, using subpic index, 0: disabled, subpicIdx=m_targetSubPicIdx-1 \n" )
( "UpscaledOutput", m_upscaledOutput, 0, "Upscaled output for RPR" )
("UpscaledOutput", m_upscaledOutput, 0, "Output upscaled (2), decoded but in full resolution buffer (1) or decoded cropped (0, default) picture for RPR" )
("UpscaleFilterForDisplay", m_upscaleFilterForDisplay, 1, "Filters used for upscaling reconstruction to full resolution (2: ECM 12 - tap luma and 6 - tap chroma MC filters, 1 : Alternative 12 - tap luma and 6 - tap chroma filters, 0 : VVC 8 - tap luma and 4 - tap chroma MC filters)")
#if GDR_LEAK_TEST
("RandomAccessPos", m_gdrPocRandomAccess, 0, "POC of GDR Random access picture\n")
......
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