Skip to content
Snippets Groups Projects
Commit c327e231 authored by Peter Chuang's avatar Peter Chuang
Browse files

Adding decoder checks

parent 0e68ff8d
No related branches found
No related tags found
1 merge request!1341Bugfix for JVET-Q0172
......@@ -443,6 +443,13 @@ DecLib::DecLib()
#if ENABLE_SIMD_OPT_BUFFER
g_pelBufOP.initPelBufOpsX86();
#endif
#if JVET_Q0172_CHROMA_FORMAT_BITDEPTH_CONSTRAINT
for (int i = 0; i < MAX_VPS_LAYERS; i++)
{
m_layerChromaFormat[i] = NOT_VALID;
m_layerBitDepth[i] = NOT_VALID;
}
#endif
}
DecLib::~DecLib()
......@@ -1926,6 +1933,32 @@ void DecLib::xDecodeSPS( InputNALUnit& nalu )
m_HLSReader.parseSPS( sps );
DTRACE( g_trace_ctx, D_QP_PER_CTU, "CTU Size: %dx%d", sps->getMaxCUWidth(), sps->getMaxCUHeight() );
m_parameterSetManager.storeSPS( sps, nalu.getBitstream().getFifo() );
#if JVET_Q0172_CHROMA_FORMAT_BITDEPTH_CONSTRAINT
if (m_vps != NULL && m_vps->getMaxLayers() > 1)
{
int curLayerIdx = m_vps->getGeneralLayerIdx(nalu.m_nuhLayerId);
int curLayerChromaFormat = sps->getChromaFormatIdc();
int curLayerBitDepth = sps->getBitDepth(CHANNEL_TYPE_LUMA);
if (m_layerChromaFormat[curLayerIdx] == NOT_VALID)
m_layerChromaFormat[curLayerIdx] = curLayerChromaFormat;
else
CHECK(m_layerChromaFormat[curLayerIdx] != curLayerChromaFormat, "Different chroma format in the same layer.");
if (m_layerBitDepth[curLayerIdx] == NOT_VALID)
m_layerBitDepth[curLayerIdx] = curLayerBitDepth;
else
CHECK(m_layerBitDepth[curLayerIdx] != curLayerBitDepth, "Different bit-depth in the same layer.");
for (int i = 0; i < curLayerIdx; i++)
{
if (m_vps->getDirectRefLayerFlag(curLayerIdx, i))
{
int refLayerChromaFormat = m_layerChromaFormat[i];
CHECK(curLayerChromaFormat != refLayerChromaFormat, "The chroma formats of the current layer and the reference layer are different");
int refLayerBitDepth = m_layerBitDepth[i];
CHECK(curLayerBitDepth != refLayerBitDepth, "The bit-depth of the current layer and the reference layer are different");
}
}
}
#endif
}
void DecLib::xDecodePPS( InputNALUnit& nalu )
......
......@@ -146,6 +146,10 @@ private:
VPS* m_vps;
bool m_scalingListUpdateFlag;
int m_PreScalingListAPSId;
#if JVET_Q0172_CHROMA_FORMAT_BITDEPTH_CONSTRAINT
int m_layerChromaFormat[MAX_VPS_LAYERS];
int m_layerBitDepth[MAX_VPS_LAYERS];
#endif
#if JVET_O1143_SUBPIC_DECCHECK
public:
......
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