Commit 606a5b19 authored by FANGJUN PU's avatar FANGJUN PU
Browse files

Fix!36: add Shutter Interval SEI message processing constrain and warning info

parent 8eaa2cac
......@@ -250,11 +250,18 @@ Void TAppDecTop::decode()
UInt numUnitsLFR = seiShutterIntervalInfo->m_siiSubLayerNumUnitsInSI[0];
UInt numUnitsHFR = seiShutterIntervalInfo->m_siiSubLayerNumUnitsInSI[arraySize - 1];
setShutterFilterFlag(numUnitsLFR == 2 * numUnitsHFR);
const TComSPS* activeSPS = &(pcListPic->front()->getPicSym()->getSPS());
if (numUnitsLFR == 2 * numUnitsHFR && activeSPS->getMaxTLayers() == 1 && activeSPS->getMaxDecPicBuffering(0) == 1)
{
fprintf(stderr, "Warning: Shutter Interval SEI message processing is disabled for single TempLayer and single frame in DPB\n");
setShutterFilterFlag(false);
}
}
}
if ((!m_shutterIntervalPostFileName.empty()) && (!openedPostFile) && getShutterFilterFlag())
{
const BitDepths &bitDepths = pcListPic->front()->getPicSym()->getSPS().getBitDepths(); // use bit depths of first reconstructed picture.
const BitDepths &bitDepths = pcListPic->front()->getPicSym()->getSPS().getBitDepths();
for (UInt channelType = 0; channelType < MAX_NUM_CHANNEL_TYPE; channelType++)
{
if (m_outputBitDepth[channelType] == 0)
......
......@@ -2032,13 +2032,17 @@ Bool TAppEncCfg::parseCfg( Int argc, TChar* argv[] )
if (arraySize > 1 && m_siiSEISubLayerNumUnitsInSI[0] == 2 * m_siiSEISubLayerNumUnitsInSI[arraySize - 1])
{
m_ShutterFilterEnable = true;
const double shutterAngle = 360.0;
double fpsHFR = (double)m_iFrameRate, fpsLFR = (double)m_iFrameRate / 2.0;
UInt numUnitsHFR = (UInt)(((double)m_siiSEITimeScale / fpsHFR) * (shutterAngle / 360.0));
UInt numUnitsLFR = (UInt)(((double)m_siiSEITimeScale / fpsLFR) * (shutterAngle / 360.0));
const Double shutterAngle = 360.0;
Double fpsHFR = (Double)m_iFrameRate, fpsLFR = (Double)m_iFrameRate / 2.0;
UInt numUnitsHFR = (UInt)(((Double)m_siiSEITimeScale / fpsHFR) * (shutterAngle / 360.0));
UInt numUnitsLFR = (UInt)(((Double)m_siiSEITimeScale / fpsLFR) * (shutterAngle / 360.0));
for (Int i = 0; i < arraySize - 1; i++) m_siiSEISubLayerNumUnitsInSI[i] = numUnitsLFR;
m_siiSEISubLayerNumUnitsInSI[arraySize - 1] = numUnitsHFR;
}
else
{
printf("Warning: Input number of units in Sii SEI should be greater than 1 and number of LFR units should be 2 times of number of HFR units\n");
}
#endif
}
#endif
......@@ -2947,6 +2951,14 @@ Void TAppEncCfg::xCheckParameter()
}
#endif
#if SHUTTER_INTERVAL_SEI_PROCESSING
if (m_siiSEIEnabled && m_ShutterFilterEnable && m_maxTempLayer == 1 && m_maxDecPicBuffering[0] == 1)
{
printf("Warning: Shutter Interval SEI message processing is disabled for single TempLayer and single frame in DPB\n");
m_ShutterFilterEnable = false;
}
#endif
if(m_timeCodeSEIEnabled)
{
xConfirmPara(m_timeCodeSEINumTs > MAX_TIMECODE_SEI_SETS, "Number of time sets cannot exceed 3");
......
......@@ -148,7 +148,7 @@ protected:
Double m_dXPSNRWeight[MAX_NUM_COMPONENT];
Bool m_cabacZeroWordPaddingEnabled;
#if SHUTTER_INTERVAL_SEI_PROCESSING
bool m_ShutterFilterEnable; ///< enable Pre-Filtering with Shutter Interval SEI
Bool m_ShutterFilterEnable; ///< enable Pre-Filtering with Shutter Interval SEI
#endif
/* profile & level */
......
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