Newer
Older

Karsten Suehring
committed
iSwitchPOC = (int)( (double)iSwitchPOC / m_iGOPSize + 0.5 )*m_iGOPSize;
for ( int i=iSwitchPOC; i<m_framesToBeEncoded + m_iGOPSize + 1; i++ )
{
m_aidQP[i] = 1;
}
}
#endif

Karsten Suehring
committed
for(uint32_t ch=0; ch<MAX_NUM_CHANNEL_TYPE; ch++)
{
if (saoOffsetBitShift[ch]<0)
{
if (m_internalBitDepth[ch]>10)
{
m_log2SaoOffsetScale[ch]=uint32_t(Clip3<int>(0, m_internalBitDepth[ch]-10, int(m_internalBitDepth[ch]-10 + 0.165*m_iQP - 3.22 + 0.5) ) );
}
else
{
m_log2SaoOffsetScale[ch]=0;
}
}
else
{
m_log2SaoOffsetScale[ch]=uint32_t(saoOffsetBitShift[ch]);
}
}

Karsten Suehring
committed
#if SHARP_LUMA_DELTA_QP
CHECK( lumaLevelToDeltaQPMode >= LUMALVL_TO_DQP_NUM_MODES, "Error in cfg" );
m_lumaLevelToDeltaQPMapping.mode=LumaLevelToDQPMode(lumaLevelToDeltaQPMode);
if (m_lumaLevelToDeltaQPMapping.mode)
{
CHECK( cfg_lumaLeveltoDQPMappingLuma.values.size() != cfg_lumaLeveltoDQPMappingQP.values.size(), "Error in cfg" );
m_lumaLevelToDeltaQPMapping.mapping.resize(cfg_lumaLeveltoDQPMappingLuma.values.size());
for(uint32_t i=0; i<cfg_lumaLeveltoDQPMappingLuma.values.size(); i++)
{
m_lumaLevelToDeltaQPMapping.mapping[i]=std::pair<int,int>(cfg_lumaLeveltoDQPMappingLuma.values[i], cfg_lumaLeveltoDQPMappingQP.values[i]);
}
}
#endif
Adarsh Krishnan Ramasubramonian
committed
CHECK(cfg_qpInValCb.values.size() != cfg_qpOutValCb.values.size(), "Chroma QP table for Cb is incomplete.");
CHECK(cfg_qpInValCr.values.size() != cfg_qpOutValCr.values.size(), "Chroma QP table for Cr is incomplete.");
CHECK(cfg_qpInValCbCr.values.size() != cfg_qpOutValCbCr.values.size(), "Chroma QP table for CbCr is incomplete.");

Christian Helmrich
committed
if (m_useIdentityTableForNon420Chroma && m_chromaFormatIDC != CHROMA_420)
Adarsh Krishnan Ramasubramonian
committed
{
m_chromaQpMappingTableParams.m_sameCQPTableForAllChromaFlag = true;
cfg_qpInValCb.values = { 26 };
cfg_qpInValCr.values = { 26 };
cfg_qpInValCbCr.values = { 26 };
cfg_qpOutValCb.values = { 26 };
cfg_qpOutValCr.values = { 26 };
cfg_qpOutValCbCr.values = { 26 };
Adarsh Krishnan Ramasubramonian
committed
}
// Need to have at least 2 points in the set. Add second one if only one given
if (cfg_qpInValCb.values.size() == 1)
{
cfg_qpInValCb.values.push_back(cfg_qpInValCb.values[0] + 1);
cfg_qpOutValCb.values.push_back(cfg_qpOutValCb.values[0] + 1);
}
if (cfg_qpInValCr.values.size() == 1)
{
cfg_qpInValCr.values.push_back(cfg_qpInValCr.values[0] + 1);
cfg_qpOutValCr.values.push_back(cfg_qpOutValCr.values[0] + 1);
}
if (cfg_qpInValCbCr.values.size() == 1)
{
cfg_qpInValCbCr.values.push_back(cfg_qpInValCbCr.values[0] + 1);
cfg_qpOutValCbCr.values.push_back(cfg_qpOutValCbCr.values[0] + 1);
}
int qpBdOffsetC = 6 * (m_internalBitDepth[CHANNEL_TYPE_CHROMA] - 8);
m_chromaQpMappingTableParams.m_deltaQpInValMinus1[0].resize(cfg_qpInValCb.values.size());
m_chromaQpMappingTableParams.m_deltaQpOutVal[0].resize(cfg_qpOutValCb.values.size());
m_chromaQpMappingTableParams.m_numPtsInCQPTableMinus1[0] = (int) cfg_qpOutValCb.values.size() - 2;
m_chromaQpMappingTableParams.m_qpTableStartMinus26[0] = -26 + cfg_qpInValCb.values[0];
CHECK(m_chromaQpMappingTableParams.m_qpTableStartMinus26[0] < -26 - qpBdOffsetC || m_chromaQpMappingTableParams.m_qpTableStartMinus26[0] > 36, "qpTableStartMinus26[0] is out of valid range of -26 -qpBdOffsetC to 36, inclusive.")
CHECK(cfg_qpInValCb.values[0] != cfg_qpOutValCb.values[0], "First qpInValCb value should be equal to first qpOutValCb value");
Tangi Poirier
committed
for (int i = 0; i < cfg_qpInValCb.values.size() - 1; i++)
Adarsh Krishnan Ramasubramonian
committed
{
CHECK(cfg_qpInValCb.values[i] < -qpBdOffsetC || cfg_qpInValCb.values[i] > MAX_QP, "Some entries cfg_qpInValCb are out of valid range of -qpBdOffsetC to 63, inclusive.");
CHECK(cfg_qpOutValCb.values[i] < -qpBdOffsetC || cfg_qpOutValCb.values[i] > MAX_QP, "Some entries cfg_qpOutValCb are out of valid range of -qpBdOffsetC to 63, inclusive.");
Tangi Poirier
committed
m_chromaQpMappingTableParams.m_deltaQpInValMinus1[0][i] = cfg_qpInValCb.values[i + 1] - cfg_qpInValCb.values[i] - 1;
m_chromaQpMappingTableParams.m_deltaQpOutVal[0][i] = cfg_qpOutValCb.values[i + 1] - cfg_qpOutValCb.values[i];
Adarsh Krishnan Ramasubramonian
committed
}
if (!m_chromaQpMappingTableParams.m_sameCQPTableForAllChromaFlag)
Adarsh Krishnan Ramasubramonian
committed
{
m_chromaQpMappingTableParams.m_deltaQpInValMinus1[1].resize(cfg_qpInValCr.values.size());
m_chromaQpMappingTableParams.m_deltaQpOutVal[1].resize(cfg_qpOutValCr.values.size());
m_chromaQpMappingTableParams.m_numPtsInCQPTableMinus1[1] = (int) cfg_qpOutValCr.values.size() - 2;
m_chromaQpMappingTableParams.m_qpTableStartMinus26[1] = -26 + cfg_qpInValCr.values[0];
CHECK(m_chromaQpMappingTableParams.m_qpTableStartMinus26[1] < -26 - qpBdOffsetC || m_chromaQpMappingTableParams.m_qpTableStartMinus26[1] > 36, "qpTableStartMinus26[1] is out of valid range of -26 -qpBdOffsetC to 36, inclusive.")
CHECK(cfg_qpInValCr.values[0] != cfg_qpOutValCr.values[0], "First qpInValCr value should be equal to first qpOutValCr value");
Tangi Poirier
committed
for (int i = 0; i < cfg_qpInValCr.values.size() - 1; i++)
Adarsh Krishnan Ramasubramonian
committed
{
CHECK(cfg_qpInValCr.values[i] < -qpBdOffsetC || cfg_qpInValCr.values[i] > MAX_QP, "Some entries cfg_qpInValCr are out of valid range of -qpBdOffsetC to 63, inclusive.");
CHECK(cfg_qpOutValCr.values[i] < -qpBdOffsetC || cfg_qpOutValCr.values[i] > MAX_QP, "Some entries cfg_qpOutValCr are out of valid range of -qpBdOffsetC to 63, inclusive.");
Tangi Poirier
committed
m_chromaQpMappingTableParams.m_deltaQpInValMinus1[1][i] = cfg_qpInValCr.values[i + 1] - cfg_qpInValCr.values[i] - 1;
m_chromaQpMappingTableParams.m_deltaQpOutVal[1][i] = cfg_qpOutValCr.values[i + 1] - cfg_qpOutValCr.values[i];
Adarsh Krishnan Ramasubramonian
committed
}
m_chromaQpMappingTableParams.m_deltaQpInValMinus1[2].resize(cfg_qpInValCbCr.values.size());
m_chromaQpMappingTableParams.m_deltaQpOutVal[2].resize(cfg_qpOutValCbCr.values.size());
m_chromaQpMappingTableParams.m_numPtsInCQPTableMinus1[2] = (int) cfg_qpOutValCbCr.values.size() - 2;
m_chromaQpMappingTableParams.m_qpTableStartMinus26[2] = -26 + cfg_qpInValCbCr.values[0];
CHECK(m_chromaQpMappingTableParams.m_qpTableStartMinus26[2] < -26 - qpBdOffsetC || m_chromaQpMappingTableParams.m_qpTableStartMinus26[2] > 36, "qpTableStartMinus26[2] is out of valid range of -26 -qpBdOffsetC to 36, inclusive.")
CHECK(cfg_qpInValCbCr.values[0] != cfg_qpInValCbCr.values[0], "First qpInValCbCr value should be equal to first qpOutValCbCr value");
Tangi Poirier
committed
for (int i = 0; i < cfg_qpInValCbCr.values.size() - 1; i++)
Adarsh Krishnan Ramasubramonian
committed
{
CHECK(cfg_qpInValCbCr.values[i] < -qpBdOffsetC || cfg_qpInValCbCr.values[i] > MAX_QP, "Some entries cfg_qpInValCbCr are out of valid range of -qpBdOffsetC to 63, inclusive.");
CHECK(cfg_qpOutValCbCr.values[i] < -qpBdOffsetC || cfg_qpOutValCbCr.values[i] > MAX_QP, "Some entries cfg_qpOutValCbCr are out of valid range of -qpBdOffsetC to 63, inclusive.");
Tangi Poirier
committed
m_chromaQpMappingTableParams.m_deltaQpInValMinus1[2][i] = cfg_qpInValCbCr.values[i + 1] - cfg_qpInValCbCr.values[i] - 1;
m_chromaQpMappingTableParams.m_deltaQpOutVal[2][i] = cfg_qpInValCbCr.values[i + 1] - cfg_qpInValCbCr.values[i];
Adarsh Krishnan Ramasubramonian
committed
}
}

Karsten Suehring
committed
Shunsuke Iwamura
committed
#if LUMA_ADAPTIVE_DEBLOCKING_FILTER_QP_OFFSET
if ( m_LadfEnabed )
{
CHECK( m_LadfNumIntervals != cfg_LadfQpOffset.values.size(), "size of LadfQpOffset must be equal to LadfNumIntervals");
CHECK( m_LadfNumIntervals - 1 != cfg_LadfIntervalLowerBound.values.size(), "size of LadfIntervalLowerBound must be equal to LadfNumIntervals - 1");
m_LadfQpOffset = cfg_LadfQpOffset.values;
m_LadfIntervalLowerBound[0] = 0;
Shunsuke Iwamura
committed
for (int k = 1; k < m_LadfNumIntervals; k++)
{
m_LadfIntervalLowerBound[k] = cfg_LadfIntervalLowerBound.values[k - 1];
}
}
#endif
#if JVET_O0756_CONFIG_HDRMETRICS && !JVET_O0756_CALCULATE_HDRMETRICS
if ( m_calculateHdrMetrics == true)
{
printf ("Warning: Configuration enables HDR metric calculations. However, HDR metric support was not linked when compiling the VTM.\n");
m_calculateHdrMetrics = false;
}
#endif
#if JVET_Q0246_VIRTUAL_BOUNDARY_ENABLE_FLAG
m_virtualBoundariesEnabledFlag = 0;
if( m_numVerVirtualBoundaries > 0 || m_numHorVirtualBoundaries > 0 )
m_virtualBoundariesEnabledFlag = 1;
if( m_virtualBoundariesEnabledFlag )
Sheng-Yen Lin
committed
{
#if JVET_Q0210_SUBPIC_VIRTUAL_BOUNDARY_CONSTRAINT
CHECK( m_subPicInfoPresentFlag && m_virtualBoundariesPresentFlag != 1, "When subpicture signalling is present, the signalling of virtual boundaries, if present, shall be in the SPS" );
#endif
if( m_virtualBoundariesPresentFlag )
Sheng-Yen Lin
committed
{
#else
if ( m_loopFilterAcrossVirtualBoundariesDisabledFlag )
Sheng-Yen Lin
committed
{
#endif
CHECK( m_numVerVirtualBoundaries > 3, "Number of vertical virtual boundaries must be comprised between 0 and 3 included" );
CHECK( m_numHorVirtualBoundaries > 3, "Number of horizontal virtual boundaries must be comprised between 0 and 3 included" );
CHECK( m_numVerVirtualBoundaries != cfg_virtualBoundariesPosX.values.size(), "Size of VirtualBoundariesPosX must be equal to NumVerVirtualBoundaries");
CHECK( m_numHorVirtualBoundaries != cfg_virtualBoundariesPosY.values.size(), "Size of VirtualBoundariesPosY must be equal to NumHorVirtualBoundaries");
m_virtualBoundariesPosX = cfg_virtualBoundariesPosX.values;
if (m_numVerVirtualBoundaries > 1)
Sheng-Yen Lin
committed
{
sort(m_virtualBoundariesPosX.begin(), m_virtualBoundariesPosX.end());
Sheng-Yen Lin
committed
}
for (unsigned i = 0; i < m_numVerVirtualBoundaries; i++)
Sheng-Yen Lin
committed
{
CHECK( m_virtualBoundariesPosX[i] == 0 || m_virtualBoundariesPosX[i] >= m_iSourceWidth, "The vertical virtual boundary must be within the picture" );
CHECK( m_virtualBoundariesPosX[i] % 8, "The vertical virtual boundary must be a multiple of 8 luma samples" );
if (i > 0)
{
CHECK( m_virtualBoundariesPosX[i] - m_virtualBoundariesPosX[i-1] < m_uiCTUSize, "The distance between any two vertical virtual boundaries shall be greater than or equal to the CTU size" );
}
}
m_virtualBoundariesPosY = cfg_virtualBoundariesPosY.values;
if (m_numHorVirtualBoundaries > 1)
{
sort(m_virtualBoundariesPosY.begin(), m_virtualBoundariesPosY.end());
}
for (unsigned i = 0; i < m_numHorVirtualBoundaries; i++)
{
CHECK( m_virtualBoundariesPosY[i] == 0 || m_virtualBoundariesPosY[i] >= m_iSourceHeight, "The horizontal virtual boundary must be within the picture" );
CHECK( m_virtualBoundariesPosY[i] % 8, "The horizontal virtual boundary must be a multiple of 8 luma samples" );
if (i > 0)
{
CHECK( m_virtualBoundariesPosY[i] - m_virtualBoundariesPosY[i-1] < m_uiCTUSize, "The distance between any two horizontal virtual boundaries shall be greater than or equal to the CTU size" );
}
Sheng-Yen Lin
committed
}
}
#if JVET_Q0246_VIRTUAL_BOUNDARY_ENABLE_FLAG
Sheng-Yen Lin
committed
}
Sheng-Yen Lin
committed
if ( m_alf )
{
CHECK( m_maxNumAlfAlternativesChroma < 1 || m_maxNumAlfAlternativesChroma > MAX_NUM_ALF_ALTERNATIVES_CHROMA, std::string("The maximum number of ALF Chroma filter alternatives must be in the range (1-") + std::to_string(MAX_NUM_ALF_ALTERNATIVES_CHROMA) + std::string (", inclusive)") );
}

Karsten Suehring
committed
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
// reading external dQP description from file
if ( !m_dQPFileName.empty() )
{
FILE* fpt=fopen( m_dQPFileName.c_str(), "r" );
if ( fpt )
{
int iValue;
int iPOC = 0;
while ( iPOC < m_framesToBeEncoded )
{
if ( fscanf(fpt, "%d", &iValue ) == EOF )
{
break;
}
m_aidQP[ iPOC ] = iValue;
iPOC++;
}
fclose(fpt);
}
}
if( m_masteringDisplay.colourVolumeSEIEnabled )
{
for(uint32_t idx=0; idx<6; idx++)
{
m_masteringDisplay.primaries[idx/2][idx%2] = uint16_t((cfg_DisplayPrimariesCode.values.size() > idx) ? cfg_DisplayPrimariesCode.values[idx] : 0);
}
for(uint32_t idx=0; idx<2; idx++)
{
m_masteringDisplay.whitePoint[idx] = uint16_t((cfg_DisplayWhitePointCode.values.size() > idx) ? cfg_DisplayWhitePointCode.values[idx] : 0);
}
}
if ( m_omniViewportSEIEnabled && !m_omniViewportSEICancelFlag )
{
CHECK (!( m_omniViewportSEICntMinus1 >= 0 && m_omniViewportSEICntMinus1 < 16 ), "SEIOmniViewportCntMinus1 must be in the range of 0 to 16");
m_omniViewportSEIAzimuthCentre.resize (m_omniViewportSEICntMinus1+1);
m_omniViewportSEIElevationCentre.resize(m_omniViewportSEICntMinus1+1);
m_omniViewportSEITiltCentre.resize (m_omniViewportSEICntMinus1+1);
m_omniViewportSEIHorRange.resize (m_omniViewportSEICntMinus1+1);
m_omniViewportSEIVerRange.resize (m_omniViewportSEICntMinus1+1);
for(int i=0; i<(m_omniViewportSEICntMinus1+1); i++)
{
m_omniViewportSEIAzimuthCentre[i] = cfg_omniViewportSEIAzimuthCentre .values.size() > i ? cfg_omniViewportSEIAzimuthCentre .values[i] : 0;
m_omniViewportSEIElevationCentre[i] = cfg_omniViewportSEIElevationCentre.values.size() > i ? cfg_omniViewportSEIElevationCentre.values[i] : 0;
m_omniViewportSEITiltCentre[i] = cfg_omniViewportSEITiltCentre .values.size() > i ? cfg_omniViewportSEITiltCentre .values[i] : 0;
m_omniViewportSEIHorRange[i] = cfg_omniViewportSEIHorRange .values.size() > i ? cfg_omniViewportSEIHorRange .values[i] : 0;
m_omniViewportSEIVerRange[i] = cfg_omniViewportSEIVerRange .values.size() > i ? cfg_omniViewportSEIVerRange .values[i] : 0;
}
}
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
if(!m_rwpSEIRwpCancelFlag && m_rwpSEIEnabled)
{
CHECK (!( m_rwpSEINumPackedRegions > 0 && m_rwpSEINumPackedRegions <= std::numeric_limits<uint8_t>::max() ), "SEIRwpNumPackedRegions must be in the range of 1 to 255");
CHECK (!(cfg_rwpSEIRwpTransformType.values.size() == m_rwpSEINumPackedRegions), "Number of must SEIRwpTransformType values be equal to SEIRwpNumPackedRegions");
CHECK (!(cfg_rwpSEIRwpGuardBandFlag.values.size() == m_rwpSEINumPackedRegions), "Number of must SEIRwpGuardBandFlag values must be equal to SEIRwpNumPackedRegions");
CHECK (!(cfg_rwpSEIProjRegionWidth.values.size() == m_rwpSEINumPackedRegions), "Number of must SEIProjRegionWidth values must be equal to SEIRwpNumPackedRegions");
CHECK (!(cfg_rwpSEIProjRegionHeight.values.size() == m_rwpSEINumPackedRegions), "Number of must SEIProjRegionHeight values must be equal to SEIRwpNumPackedRegions");
CHECK (!(cfg_rwpSEIRwpSEIProjRegionTop.values.size() == m_rwpSEINumPackedRegions), "Number of must SEIRwpSEIProjRegionTop values must be equal to SEIRwpNumPackedRegions");
CHECK (!(cfg_rwpSEIProjRegionLeft.values.size() == m_rwpSEINumPackedRegions), "Number of must SEIProjRegionLeft values must be equal to SEIRwpNumPackedRegions");
CHECK (!(cfg_rwpSEIPackedRegionWidth.values.size() == m_rwpSEINumPackedRegions), "Number of must SEIPackedRegionWidth values must be equal to SEIRwpNumPackedRegions");
CHECK (!(cfg_rwpSEIPackedRegionHeight.values.size() == m_rwpSEINumPackedRegions), "Number of must SEIPackedRegionHeight values must be equal to SEIRwpNumPackedRegions");
CHECK (!(cfg_rwpSEIPackedRegionTop.values.size() == m_rwpSEINumPackedRegions), "Number of must SEIPackedRegionTop values must be equal to SEIRwpNumPackedRegions");
CHECK (!(cfg_rwpSEIPackedRegionLeft.values.size() == m_rwpSEINumPackedRegions), "Number of must SEIPackedRegionLeft values must be equal to SEIRwpNumPackedRegions");
m_rwpSEIRwpTransformType.resize(m_rwpSEINumPackedRegions);
m_rwpSEIRwpGuardBandFlag.resize(m_rwpSEINumPackedRegions);
m_rwpSEIProjRegionWidth.resize(m_rwpSEINumPackedRegions);
m_rwpSEIProjRegionHeight.resize(m_rwpSEINumPackedRegions);
m_rwpSEIRwpSEIProjRegionTop.resize(m_rwpSEINumPackedRegions);
m_rwpSEIProjRegionLeft.resize(m_rwpSEINumPackedRegions);
m_rwpSEIPackedRegionWidth.resize(m_rwpSEINumPackedRegions);
m_rwpSEIPackedRegionHeight.resize(m_rwpSEINumPackedRegions);
m_rwpSEIPackedRegionTop.resize(m_rwpSEINumPackedRegions);
m_rwpSEIPackedRegionLeft.resize(m_rwpSEINumPackedRegions);
m_rwpSEIRwpLeftGuardBandWidth.resize(m_rwpSEINumPackedRegions);
m_rwpSEIRwpRightGuardBandWidth.resize(m_rwpSEINumPackedRegions);
m_rwpSEIRwpTopGuardBandHeight.resize(m_rwpSEINumPackedRegions);
m_rwpSEIRwpBottomGuardBandHeight.resize(m_rwpSEINumPackedRegions);
m_rwpSEIRwpGuardBandNotUsedForPredFlag.resize(m_rwpSEINumPackedRegions);
m_rwpSEIRwpGuardBandType.resize(4*m_rwpSEINumPackedRegions);
for( int i=0; i < m_rwpSEINumPackedRegions; i++ )
{
m_rwpSEIRwpTransformType[i] = cfg_rwpSEIRwpTransformType.values[i];
CHECK (!( m_rwpSEIRwpTransformType[i] >= 0 && m_rwpSEIRwpTransformType[i] <= 7 ), "SEIRwpTransformType must be in the range of 0 to 7");
m_rwpSEIRwpGuardBandFlag[i] = cfg_rwpSEIRwpGuardBandFlag.values[i];
m_rwpSEIProjRegionWidth[i] = cfg_rwpSEIProjRegionWidth.values[i];
m_rwpSEIProjRegionHeight[i] = cfg_rwpSEIProjRegionHeight.values[i];
m_rwpSEIRwpSEIProjRegionTop[i] = cfg_rwpSEIRwpSEIProjRegionTop.values[i];
m_rwpSEIProjRegionLeft[i] = cfg_rwpSEIProjRegionLeft.values[i];
m_rwpSEIPackedRegionWidth[i] = cfg_rwpSEIPackedRegionWidth.values[i];
m_rwpSEIPackedRegionHeight[i] = cfg_rwpSEIPackedRegionHeight.values[i];
m_rwpSEIPackedRegionTop[i] = cfg_rwpSEIPackedRegionTop.values[i];
m_rwpSEIPackedRegionLeft[i] = cfg_rwpSEIPackedRegionLeft.values[i];
if( m_rwpSEIRwpGuardBandFlag[i] )
{
m_rwpSEIRwpLeftGuardBandWidth[i] = cfg_rwpSEIRwpLeftGuardBandWidth.values[i];
m_rwpSEIRwpRightGuardBandWidth[i] = cfg_rwpSEIRwpRightGuardBandWidth.values[i];
m_rwpSEIRwpTopGuardBandHeight[i] = cfg_rwpSEIRwpTopGuardBandHeight.values[i];
m_rwpSEIRwpBottomGuardBandHeight[i] = cfg_rwpSEIRwpBottomGuardBandHeight.values[i];
CHECK (! ( m_rwpSEIRwpLeftGuardBandWidth[i] > 0 || m_rwpSEIRwpRightGuardBandWidth[i] > 0 || m_rwpSEIRwpTopGuardBandHeight[i] >0 || m_rwpSEIRwpBottomGuardBandHeight[i] >0 ), "At least one of the RWP guard band parameters mut be greater than zero");
m_rwpSEIRwpGuardBandNotUsedForPredFlag[i] = cfg_rwpSEIRwpGuardBandNotUsedForPredFlag.values[i];
for( int j=0; j < 4; j++ )
{
m_rwpSEIRwpGuardBandType[i*4 + j] = cfg_rwpSEIRwpGuardBandType.values[i*4 + j];
}
}
}
}
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
if (m_gcmpSEIEnabled && !m_gcmpSEICancelFlag)
{
int numFace = m_gcmpSEIPackingType == 4 || m_gcmpSEIPackingType == 5 ? 5 : 6;
CHECK (!(cfg_gcmpSEIFaceIndex.values.size() == numFace), "Number of SEIGcmpFaceIndex must be equal to 5 when SEIGcmpPackingType is equal to 4 or 5, otherwise, it must be equal to 6");
CHECK (!(cfg_gcmpSEIFaceRotation.values.size() == numFace), "Number of SEIGcmpFaceRotation must be equal to 5 when SEIGcmpPackingType is equal to 4 or 5, otherwise, it must be equal to 6");
m_gcmpSEIFaceIndex.resize(numFace);
m_gcmpSEIFaceRotation.resize(numFace);
if (m_gcmpSEIMappingFunctionType == 2)
{
CHECK (!(cfg_gcmpSEIFunctionCoeffU.values.size() == numFace), "Number of SEIGcmpFunctionCoeffU must be equal to 5 when SEIGcmpPackingType is equal to 4 or 5, otherwise, it must be equal to 6");
CHECK (!(cfg_gcmpSEIFunctionUAffectedByVFlag.values.size() == numFace), "Number of SEIGcmpFunctionUAffectedByVFlag must be equal to 5 when SEIGcmpPackingType is equal to 4 or 5, otherwise, it must be equal to 6");
CHECK (!(cfg_gcmpSEIFunctionCoeffV.values.size() == numFace), "Number of SEIGcmpFunctionCoeffV must be equal to 5 when SEIGcmpPackingType is equal to 4 or 5, otherwise, it must be equal to 6");
CHECK (!(cfg_gcmpSEIFunctionVAffectedByUFlag.values.size() == numFace), "Number of SEIGcmpFunctionVAffectedByUFlag must be equal to 5 when SEIGcmpPackingType is equal to 4 or 5, otherwise, it must be equal to 6");
m_gcmpSEIFunctionCoeffU.resize(numFace);
m_gcmpSEIFunctionUAffectedByVFlag.resize(numFace);
m_gcmpSEIFunctionCoeffV.resize(numFace);
m_gcmpSEIFunctionVAffectedByUFlag.resize(numFace);
}
for (int i = 0; i < numFace; i++)
{
m_gcmpSEIFaceIndex[i] = cfg_gcmpSEIFaceIndex.values[i];
m_gcmpSEIFaceRotation[i] = cfg_gcmpSEIFaceRotation.values[i];
if (m_gcmpSEIMappingFunctionType == 2)
{
m_gcmpSEIFunctionCoeffU[i] = cfg_gcmpSEIFunctionCoeffU.values[i];
m_gcmpSEIFunctionUAffectedByVFlag[i] = cfg_gcmpSEIFunctionUAffectedByVFlag.values[i];
m_gcmpSEIFunctionCoeffV[i] = cfg_gcmpSEIFunctionCoeffV.values[i];
m_gcmpSEIFunctionVAffectedByUFlag[i] = cfg_gcmpSEIFunctionVAffectedByUFlag.values[i];
}
}
}
m_reshapeCW.binCW.resize(3);
m_reshapeCW.rspFps = m_iFrameRate;
m_reshapeCW.rspPicSize = m_iSourceWidth*m_iSourceHeight;
m_reshapeCW.rspFpsToIp = std::max(16, 16 * (int)(round((double)m_iFrameRate /16.0)));
m_reshapeCW.updateCtrl = m_updateCtrl;
m_reshapeCW.adpOption = m_adpOption;
m_reshapeCW.initialCW = m_initialCW;

Karsten Suehring
committed
#if ENABLE_TRACING
g_trace_ctx = tracing_init(sTracingFile, sTracingRule);
if( bTracingChannelsList && g_trace_ctx )
{
std::string sChannelsList;
g_trace_ctx->getChannelsList( sChannelsList );
msg( INFO, "\n Using tracing channels:\n\n%s\n", sChannelsList.c_str() );
}
#endif
#if ENABLE_QPA

Christian Helmrich
committed
if (m_bUsePerceptQPA && !m_bUseAdaptiveQP && m_dualTree && (m_cbQpOffsetDualTree != 0 || m_crQpOffsetDualTree != 0 || m_cbCrQpOffsetDualTree != 0))
{
msg( WARNING, "*************************************************************************\n" );
msg( WARNING, "* WARNING: chroma QPA on, ignoring nonzero dual-tree chroma QP offsets! *\n" );
msg( WARNING, "*************************************************************************\n" );
}

Christian Helmrich
committed
#if ENABLE_QPA_SUB_CTU
#if QP_SWITCHING_FOR_PARALLEL
if ((m_iQP < 38) && m_bUsePerceptQPA && !m_bUseAdaptiveQP && (m_iSourceWidth <= 2048) && (m_iSourceHeight <= 1280)

Christian Helmrich
committed
#else
if (((int)m_fQP < 38) && m_bUsePerceptQPA && !m_bUseAdaptiveQP && (m_iSourceWidth <= 2048) && (m_iSourceHeight <= 1280)

Christian Helmrich
committed
#endif
#if WCG_EXT && ER_CHROMA_QP_WCG_PPS
&& (!m_wcgChromaQpControl.enabled)
#endif
&& ((1 << (m_log2MaxTbSize + 1)) == m_uiCTUSize) && (m_iSourceWidth > 512 || m_iSourceHeight > 320))

Christian Helmrich
committed
{

Christian Helmrich
committed
}
#else
#if QP_SWITCHING_FOR_PARALLEL
if( ( m_iQP < 38 ) && ( m_iGOPSize > 4 ) && m_bUsePerceptQPA && !m_bUseAdaptiveQP && ( m_iSourceHeight <= 1280 ) && ( m_iSourceWidth <= 2048 ) )
#else
if( ( ( int ) m_fQP < 38 ) && ( m_iGOPSize > 4 ) && m_bUsePerceptQPA && !m_bUseAdaptiveQP && ( m_iSourceHeight <= 1280 ) && ( m_iSourceWidth <= 2048 ) )
#endif

Karsten Suehring
committed
{
msg( WARNING, "*************************************************************************\n" );
msg( WARNING, "* WARNING: QPA on with large CTU for <=HD sequences, limiting CTU size! *\n" );
msg( WARNING, "*************************************************************************\n" );

Karsten Suehring
committed
m_uiCTUSize = m_uiMaxCUWidth;
if( ( 1u << m_log2MaxTbSize ) > m_uiCTUSize ) m_log2MaxTbSize--;

Karsten Suehring
committed
}

Christian Helmrich
committed
#endif
#endif // ENABLE_QPA

Karsten Suehring
committed
#if JVET_AHG14_LOSSLESS_ENC_QP_FIX
if( m_costMode == COST_LOSSLESS_CODING )
{
m_iQP = LOSSLESS_AND_MIXED_LOSSLESS_RD_COST_TEST_QP - ( ( m_internalBitDepth[CHANNEL_TYPE_LUMA] - 8 ) * 6 );
}
#endif
#if !JVET_Q0468_Q0469_MIN_LUMA_CB_AND_MIN_QT_FIX
const int minCuSize = 1 << MIN_CU_LOG2;
m_uiMaxCodingDepth = 0;
while( ( m_uiCTUSize >> m_uiMaxCodingDepth ) > minCuSize )

Karsten Suehring
committed
{
m_uiMaxCodingDepth++;
}
m_uiLog2DiffMaxMinCodingBlockSize = m_uiMaxCodingDepth;
#endif
#if !JVET_Q0468_Q0469_MIN_LUMA_CB_AND_MIN_QT_FIX
#endif

Karsten Suehring
committed
// check validity of input parameters
if( xCheckParameter() )
{
// return check failed
return false;
}
// print-out parameters
xPrintParameter();
return true;
}
// ====================================================================================================================
// Private member functions
// ====================================================================================================================
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
///< auto determine the profile to use given the other configuration settings. Returns 1 if erred. Can select profile 'NONE'
int EncAppCfg::xAutoDetermineProfile()
{
const int maxBitDepth= std::max(m_internalBitDepth[CHANNEL_TYPE_LUMA], m_internalBitDepth[m_chromaFormatIDC==ChromaFormat::CHROMA_400 ? CHANNEL_TYPE_LUMA : CHANNEL_TYPE_CHROMA]);
m_profile=Profile::NONE;
if (m_chromaFormatIDC==ChromaFormat::CHROMA_400 || m_chromaFormatIDC==ChromaFormat::CHROMA_420)
{
if (maxBitDepth<=10)
{
m_profile=Profile::MAIN_10;
}
}
else if (m_chromaFormatIDC==ChromaFormat::CHROMA_422 || m_chromaFormatIDC==ChromaFormat::CHROMA_444)
{
if (maxBitDepth<=10)
{
m_profile=Profile::MAIN_444_10;
}
}
else
{
return 1; // unknown chroma format
}
return 0;
}

Karsten Suehring
committed
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
bool EncAppCfg::xCheckParameter()
{
msg( NOTICE, "\n" );
if (m_decodedPictureHashSEIType==HASHTYPE_NONE)
{
msg( DETAILS, "******************************************************************\n");
msg( DETAILS, "** WARNING: --SEIDecodedPictureHash is now disabled by default. **\n");
msg( DETAILS, "** Automatic verification of decoded pictures by a **\n");
msg( DETAILS, "** decoder requires this option to be enabled. **\n");
msg( DETAILS, "******************************************************************\n");
}
if( m_profile==Profile::NONE )
{
msg( DETAILS, "***************************************************************************\n");
msg( DETAILS, "** WARNING: For conforming bitstreams a valid Profile value must be set! **\n");
msg( DETAILS, "***************************************************************************\n");
}
if( m_level==Level::NONE )
{
msg( DETAILS, "***************************************************************************\n");
msg( DETAILS, "** WARNING: For conforming bitstreams a valid Level value must be set! **\n");
msg( DETAILS, "***************************************************************************\n");
}
bool check_failed = false; /* abort if there is a fatal configuration problem */
#define xConfirmPara(a,b) check_failed |= confirmPara(a,b)
if( m_depQuantEnabledFlag )
{
xConfirmPara( !m_useRDOQ || !m_useRDOQTS, "RDOQ and RDOQTS must be equal to 1 if dependent quantization is enabled" );
xConfirmPara( m_signDataHidingEnabledFlag, "SignHideFlag must be equal to 0 if dependent quantization is enabled" );
}

Karsten Suehring
committed
#if JVET_Q0468_Q0469_MIN_LUMA_CB_AND_MIN_QT_FIX
const int minCUSize = 1 << m_log2MinCuSize;
xConfirmPara(m_wrapAroundOffset <= m_uiCTUSize + minCUSize, "Wrap-around offset must be greater than CtbSizeY + MinCbSize");
xConfirmPara(m_wrapAroundOffset > m_iSourceWidth, "Wrap-around offset must not be greater than the source picture width");
#else
xConfirmPara( m_wrapAroundOffset <= m_uiCTUSize + (m_uiMaxCUWidth >> m_uiLog2DiffMaxMinCodingBlockSize), "Wrap-around offset must be greater than CtbSizeY + MinCbSize" );
xConfirmPara( m_wrapAroundOffset > m_iSourceWidth, "Wrap-around offset must not be greater than the source picture width" );

Karsten Suehring
committed
int minCUSize = m_uiCTUSize >> m_uiLog2DiffMaxMinCodingBlockSize;
#endif

Karsten Suehring
committed
xConfirmPara( m_wrapAroundOffset % minCUSize != 0, "Wrap-around offset must be an integer multiple of the specified minimum CU size" );

Karsten Suehring
committed
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
}
#if ENABLE_SPLIT_PARALLELISM
xConfirmPara( m_numSplitThreads < 1, "Number of used threads cannot be smaller than 1" );
xConfirmPara( m_numSplitThreads > PARL_SPLIT_MAX_NUM_THREADS, "Number of used threads cannot be higher than the number of actual jobs" );
#else
xConfirmPara( m_numSplitThreads != 1, "ENABLE_SPLIT_PARALLELISM is disabled, numSplitThreads has to be 1" );
#endif
xConfirmPara( m_numWppThreads != 1, "ENABLE_WPP_PARALLELISM is disabled, numWppThreads has to be 1" );
xConfirmPara( m_ensureWppBitEqual, "ENABLE_WPP_PARALLELISM is disabled, cannot ensure being WPP bit-equal" );
#if SHARP_LUMA_DELTA_QP && ENABLE_QPA
xConfirmPara( m_bUsePerceptQPA && m_lumaLevelToDeltaQPMapping.mode >= 2, "QPA and SharpDeltaQP mode 2 cannot be used together" );
if( m_bUsePerceptQPA && m_lumaLevelToDeltaQPMapping.mode == LUMALVL_TO_DQP_AVG_METHOD )
{
msg( WARNING, "*********************************************************************************\n" );
msg( WARNING, "** WARNING: Applying custom luma-based QPA with activity-based perceptual QPA! **\n" );
msg( WARNING, "*********************************************************************************\n" );
m_lumaLevelToDeltaQPMapping.mode = LUMALVL_TO_DQP_NUM_MODES; // special QPA mode
}
#endif
xConfirmPara( m_useAMaxBT && !m_SplitConsOverrideEnabledFlag, "AMaxBt can only be used with PartitionConstriantsOverride enabled" );

Karsten Suehring
committed
xConfirmPara(m_bitstreamFileName.empty(), "A bitstream file name must be specified (BitstreamFile)");
xConfirmPara(m_internalBitDepth[CHANNEL_TYPE_CHROMA] != m_internalBitDepth[CHANNEL_TYPE_LUMA], "The internalBitDepth must be the same for luma and chroma");
if (m_profile==Profile::MAIN_10 || m_profile==Profile::MAIN_444_10)
{

Karsten Suehring
committed
#if !REMOVE_PPS_REXT
xConfirmPara(m_crossComponentPredictionEnabledFlag==true, "CrossComponentPrediction must not be used for given profile.");

Karsten Suehring
committed
#endif
xConfirmPara(m_log2MaxTransformSkipBlockSize>=6, "Transform Skip Log2 Max Size must be less or equal to 5 for given profile.");
xConfirmPara(m_transformSkipRotationEnabledFlag==true, "UseResidualRotation must not be enabled for given profile.");
xConfirmPara(m_transformSkipContextEnabledFlag==true, "UseSingleSignificanceMapContext must not be enabled for given profile.");
xConfirmPara(m_rdpcmEnabledFlag[RDPCM_SIGNAL_IMPLICIT]==true, "ImplicitResidualDPCM must not be enabled for given profile.");
xConfirmPara(m_rdpcmEnabledFlag[RDPCM_SIGNAL_EXPLICIT]==true, "ExplicitResidualDPCM must not be enabled for given profile.");
xConfirmPara(m_persistentRiceAdaptationEnabledFlag==true, "GolombRiceParameterAdaption must not be enabled for given profile.");
xConfirmPara(m_extendedPrecisionProcessingFlag==true, "UseExtendedPrecision must not be enabled for given profile.");
xConfirmPara(m_highPrecisionOffsetsEnabledFlag==true, "UseHighPrecisionPredictionWeighting must not be enabled for given profile.");
xConfirmPara(m_enableIntraReferenceSmoothing==false, "EnableIntraReferenceSmoothing must be enabled for given profile.");
xConfirmPara(m_cabacBypassAlignmentEnabledFlag, "AlignCABACBeforeBypass cannot be enabled for given profile.");
}

Karsten Suehring
committed
// check range of parameters
xConfirmPara( m_inputBitDepth[CHANNEL_TYPE_LUMA ] < 8, "InputBitDepth must be at least 8" );
xConfirmPara( m_inputBitDepth[CHANNEL_TYPE_CHROMA] < 8, "InputBitDepthC must be at least 8" );
if( (m_internalBitDepth[CHANNEL_TYPE_LUMA] < m_inputBitDepth[CHANNEL_TYPE_LUMA]) || (m_internalBitDepth[CHANNEL_TYPE_CHROMA] < m_inputBitDepth[CHANNEL_TYPE_CHROMA]) )
{
msg(WARNING, "*****************************************************************************\n");
msg(WARNING, "** WARNING: InternalBitDepth is set to the lower value than InputBitDepth! **\n");
msg(WARNING, "** min_qp_prime_ts_minus4 will be clipped to 0 at the low end! **\n");
msg(WARNING, "*****************************************************************************\n");
}
Alexey Filippov
committed
#if !RExt__HIGH_BIT_DEPTH_SUPPORT

Karsten Suehring
committed
if (m_extendedPrecisionProcessingFlag)
{
for (uint32_t channelType = 0; channelType < MAX_NUM_CHANNEL_TYPE; channelType++)
{
xConfirmPara((m_internalBitDepth[channelType] > 8) , "Model is not configured to support high enough internal accuracies - enable RExt__HIGH_BIT_DEPTH_SUPPORT to use increased precision internal data types etc...");
}
}
else
{
for (uint32_t channelType = 0; channelType < MAX_NUM_CHANNEL_TYPE; channelType++)
{
xConfirmPara((m_internalBitDepth[channelType] > 12) , "Model is not configured to support high enough internal accuracies - enable RExt__HIGH_BIT_DEPTH_SUPPORT to use increased precision internal data types etc...");
}
}
Alexey Filippov
committed
#endif

Karsten Suehring
committed
xConfirmPara( (m_MSBExtendedBitDepth[CHANNEL_TYPE_LUMA ] < m_inputBitDepth[CHANNEL_TYPE_LUMA ]), "MSB-extended bit depth for luma channel (--MSBExtendedBitDepth) must be greater than or equal to input bit depth for luma channel (--InputBitDepth)" );
xConfirmPara( (m_MSBExtendedBitDepth[CHANNEL_TYPE_CHROMA] < m_inputBitDepth[CHANNEL_TYPE_CHROMA]), "MSB-extended bit depth for chroma channel (--MSBExtendedBitDepthC) must be greater than or equal to input bit depth for chroma channel (--InputBitDepthC)" );

Karsten Suehring
committed
xConfirmPara( m_log2SaoOffsetScale[CHANNEL_TYPE_LUMA] > (m_internalBitDepth[CHANNEL_TYPE_LUMA ]<10?0:(m_internalBitDepth[CHANNEL_TYPE_LUMA ]-10)), "SaoLumaOffsetBitShift must be in the range of 0 to InternalBitDepth-10, inclusive");
xConfirmPara( m_log2SaoOffsetScale[CHANNEL_TYPE_CHROMA] > (m_internalBitDepth[CHANNEL_TYPE_CHROMA]<10?0:(m_internalBitDepth[CHANNEL_TYPE_CHROMA]-10)), "SaoChromaOffsetBitShift must be in the range of 0 to InternalBitDepth-10, inclusive");

Karsten Suehring
committed
xConfirmPara( m_chromaFormatIDC >= NUM_CHROMA_FORMAT, "ChromaFormatIDC must be either 400, 420, 422 or 444" );
std::string sTempIPCSC="InputColourSpaceConvert must be empty, "+getListOfColourSpaceConverts(true);
xConfirmPara( m_inputColourSpaceConvert >= NUMBER_INPUT_COLOUR_SPACE_CONVERSIONS, sTempIPCSC.c_str() );
xConfirmPara( m_InputChromaFormatIDC >= NUM_CHROMA_FORMAT, "InputChromaFormatIDC must be either 400, 420, 422 or 444" );
xConfirmPara( m_iFrameRate <= 0, "Frame rate must be more than 1" );
xConfirmPara( m_framesToBeEncoded <= 0, "Total Number Of Frames encoded must be more than 0" );
xConfirmPara( m_framesToBeEncoded < m_switchPOC, "debug POC out of range" );
xConfirmPara( m_iGOPSize < 1 , "GOP Size must be greater or equal to 1" );
xConfirmPara( m_iGOPSize > 1 && m_iGOPSize % 2, "GOP Size must be a multiple of 2, if GOP Size is greater than 1" );
xConfirmPara( (m_iIntraPeriod > 0 && m_iIntraPeriod < m_iGOPSize) || m_iIntraPeriod == 0, "Intra period must be more than GOP size, or -1 , not 0" );
xConfirmPara( m_drapPeriod < 0, "DRAP period must be greater or equal to 0" );

Karsten Suehring
committed
xConfirmPara( m_iDecodingRefreshType < 0 || m_iDecodingRefreshType > 3, "Decoding Refresh Type must be comprised between 0 and 3 included" );

Karsten Suehring
committed
if (m_isField)
{
if (!m_frameFieldInfoSEIEnabled)
{
msg( WARNING, "*************************************************************************************\n");
msg( WARNING, "** WARNING: Frame field information SEI should be enabled for field coding! **\n");
msg( WARNING, "*************************************************************************************\n");
}

Karsten Suehring
committed
}

Karsten Suehring
committed
if ( m_pictureTimingSEIEnabled && (!m_bufferingPeriodSEIEnabled))
{
msg( WARNING, "****************************************************************************\n");
msg( WARNING, "** WARNING: Picture Timing SEI requires Buffering Period SEI. Disabling. **\n");
msg( WARNING, "****************************************************************************\n");
m_pictureTimingSEIEnabled = false;
}

Karsten Suehring
committed

Karsten Suehring
committed
#if !REMOVE_PPS_REXT

Karsten Suehring
committed
if(m_crossComponentPredictionEnabledFlag && (m_chromaFormatIDC != CHROMA_444))
{
msg( WARNING, "****************************************************************************\n");
msg( WARNING, "** WARNING: Cross-component prediction is specified for 4:4:4 format only **\n");
msg( WARNING, "****************************************************************************\n");
m_crossComponentPredictionEnabledFlag = false;
}

Karsten Suehring
committed
#endif

Karsten Suehring
committed
xConfirmPara( m_bufferingPeriodSEIEnabled == true && m_RCCpbSize == 0, "RCCpbSize must be greater than zero, when buffering period SEI is enabled" );

Karsten Suehring
committed
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
xConfirmPara (m_log2MaxTransformSkipBlockSize < 2, "Transform Skip Log2 Max Size must be at least 2 (4x4)");
if( m_SubPuMvpMode == 3 && m_maxNumMergeCand < 7 )
{
msg( WARNING, "****************************************************************************\n" );
msg( WARNING, "** WARNING: Allowing less than 7 merge candidates, although both **\n" );
msg( WARNING, "** advanced sup-pu temporal merging modes are enabled. **\n" );
msg( WARNING, "****************************************************************************\n" );
}
else if( m_SubPuMvpMode != 0 && m_maxNumMergeCand < 6 )
{
msg( WARNING, "****************************************************************************\n" );
msg( WARNING, "** WARNING: Allowing less than 6 merge candidates, although **\n" );
msg( WARNING, "** an advanced sup-pu temporal merging mode is enabled. **\n" );
msg( WARNING, "****************************************************************************\n" );
}
xConfirmPara( m_iQP < -6 * (m_internalBitDepth[CHANNEL_TYPE_LUMA] - 8) || m_iQP > MAX_QP, "QP exceeds supported range (-QpBDOffsety to 63)" );
#if W0038_DB_OPT
xConfirmPara( m_deblockingFilterMetric!=0 && (m_bLoopFilterDisable || m_loopFilterOffsetInPPS), "If DeblockingFilterMetric is non-zero then both LoopFilterDisable and LoopFilterOffsetInPPS must be 0");
#else
xConfirmPara( m_DeblockingFilterMetric && (m_bLoopFilterDisable || m_loopFilterOffsetInPPS), "If DeblockingFilterMetric is true then both LoopFilterDisable and LoopFilterOffsetInPPS must be 0");
#endif
#if JVET_Q0121_DEBLOCKING_CONTROL_PARAMETERS
xConfirmPara( m_loopFilterBetaOffsetDiv2 < -12 || m_loopFilterBetaOffsetDiv2 > 12, "Loop Filter Beta Offset div. 2 exceeds supported range (-12 to 12" );
xConfirmPara( m_loopFilterTcOffsetDiv2 < -12 || m_loopFilterTcOffsetDiv2 > 12, "Loop Filter Tc Offset div. 2 exceeds supported range (-12 to 12)" );
xConfirmPara( m_loopFilterCbBetaOffsetDiv2 < -12 || m_loopFilterCbBetaOffsetDiv2 > 12, "Loop Filter Beta Offset div. 2 exceeds supported range (-12 to 12" );
xConfirmPara( m_loopFilterCbTcOffsetDiv2 < -12 || m_loopFilterCbTcOffsetDiv2 > 12, "Loop Filter Tc Offset div. 2 exceeds supported range (-12 to 12)" );
xConfirmPara( m_loopFilterCrBetaOffsetDiv2 < -12 || m_loopFilterCrBetaOffsetDiv2 > 12, "Loop Filter Beta Offset div. 2 exceeds supported range (-12 to 12" );
xConfirmPara( m_loopFilterCrTcOffsetDiv2 < -12 || m_loopFilterCrTcOffsetDiv2 > 12, "Loop Filter Tc Offset div. 2 exceeds supported range (-12 to 12)" );
#else

Karsten Suehring
committed
xConfirmPara( m_loopFilterBetaOffsetDiv2 < -6 || m_loopFilterBetaOffsetDiv2 > 6, "Loop Filter Beta Offset div. 2 exceeds supported range (-6 to 6)" );
xConfirmPara( m_loopFilterTcOffsetDiv2 < -6 || m_loopFilterTcOffsetDiv2 > 6, "Loop Filter Tc Offset div. 2 exceeds supported range (-6 to 6)" );

Karsten Suehring
committed
xConfirmPara( m_iSearchRange < 0 , "Search Range must be more than 0" );
xConfirmPara( m_bipredSearchRange < 0 , "Bi-prediction refinement search range must be more than 0" );
xConfirmPara( m_minSearchWindow < 0, "Minimum motion search window size for the adaptive window ME must be greater than or equal to 0" );
xConfirmPara( m_iMaxDeltaQP > MAX_DELTA_QP, "Absolute Delta QP exceeds supported range (0 to 7)" );
#if ENABLE_QPA
xConfirmPara( m_bUsePerceptQPA && m_uiDeltaQpRD > 0, "Perceptual QPA cannot be used together with slice-level multiple-QP optimization" );
#endif

Karsten Suehring
committed
#if SHARP_LUMA_DELTA_QP
xConfirmPara( m_lumaLevelToDeltaQPMapping.mode && m_uiDeltaQpRD > 0, "Luma-level-based Delta QP cannot be used together with slice level multiple-QP optimization\n" );
#endif
if (m_lumaLevelToDeltaQPMapping.mode && m_lmcsEnabled)
msg(WARNING, "For HDR-PQ, LMCS should be used mutual-exclusively with Luma-level-based Delta QP. If use LMCS, turn lumaDQP off.\n");
m_lumaLevelToDeltaQPMapping.mode = LUMALVL_TO_DQP_DISABLED;
if (!m_lmcsEnabled)
if (m_lmcsEnabled && m_reshapeSignalType == RESHAPE_SIGNAL_PQ)
else if (m_lmcsEnabled && (m_reshapeSignalType == RESHAPE_SIGNAL_SDR || m_reshapeSignalType == RESHAPE_SIGNAL_HLG))
m_lmcsEnabled = false;
if (m_lmcsEnabled)
{
xConfirmPara(m_updateCtrl < 0, "Min. LMCS Update Control is 0");
xConfirmPara(m_updateCtrl > 2, "Max. LMCS Update Control is 2");
xConfirmPara(m_adpOption < 0, "Min. LMCS Adaptation Option is 0");
xConfirmPara(m_adpOption > 4, "Max. LMCS Adaptation Option is 4");
xConfirmPara(m_initialCW < 0, "Min. Initial Total Codeword is 0");
xConfirmPara(m_initialCW > 1023, "Max. Initial Total Codeword is 1023");
xConfirmPara(m_CSoffset < -7, "Min. LMCS Offset value is -7");
xConfirmPara(m_CSoffset > 7, "Max. LMCS Offset value is 7");
if (m_updateCtrl > 0 && m_adpOption > 2) { m_adpOption -= 2; }
}

Karsten Suehring
committed
xConfirmPara( m_cbQpOffset < -12, "Min. Chroma Cb QP Offset is -12" );
xConfirmPara( m_cbQpOffset > 12, "Max. Chroma Cb QP Offset is 12" );
xConfirmPara( m_crQpOffset < -12, "Min. Chroma Cr QP Offset is -12" );
xConfirmPara( m_crQpOffset > 12, "Max. Chroma Cr QP Offset is 12" );
xConfirmPara( m_cbQpOffsetDualTree < -12, "Min. Chroma Cb QP Offset for dual tree is -12" );
xConfirmPara( m_cbQpOffsetDualTree > 12, "Max. Chroma Cb QP Offset for dual tree is 12" );
xConfirmPara( m_crQpOffsetDualTree < -12, "Min. Chroma Cr QP Offset for dual tree is -12" );
xConfirmPara( m_crQpOffsetDualTree > 12, "Max. Chroma Cr QP Offset for dual tree is 12" );
#if JVET_Q0438_MONOCHROME_BUGFIXES
if (m_dualTree && (m_chromaFormatIDC == CHROMA_400))
{
msg( WARNING, "****************************************************************************\n");
msg( WARNING, "** WARNING: --DualITree has been disabled because the chromaFormat is 400 **\n");
msg( WARNING, "****************************************************************************\n");
m_dualTree = false;
}
if (m_ccalf && (m_chromaFormatIDC == CHROMA_400))
{
msg( WARNING, "****************************************************************************\n");
msg( WARNING, "** WARNING: --CCALF has been disabled because the chromaFormat is 400 **\n");
msg( WARNING, "****************************************************************************\n");
m_ccalf = false;
}
#endif
if (m_JointCbCrMode && (m_chromaFormatIDC == CHROMA_400))
{
msg( WARNING, "****************************************************************************\n");

Christian Helmrich
committed
msg( WARNING, "** WARNING: --JointCbCr has been disabled because the chromaFormat is 400 **\n");
msg( WARNING, "****************************************************************************\n");
xConfirmPara( m_cbCrQpOffset < -12, "Min. Joint Cb-Cr QP Offset is -12");
xConfirmPara( m_cbCrQpOffset > 12, "Max. Joint Cb-Cr QP Offset is 12");
xConfirmPara( m_cbCrQpOffsetDualTree < -12, "Min. Joint Cb-Cr QP Offset for dual tree is -12");
xConfirmPara( m_cbCrQpOffsetDualTree > 12, "Max. Joint Cb-Cr QP Offset for dual tree is 12");

Karsten Suehring
committed
xConfirmPara( m_iQPAdaptationRange <= 0, "QP Adaptation Range must be more than 0" );
if (m_iDecodingRefreshType == 2)
{
xConfirmPara( m_iIntraPeriod > 0 && m_iIntraPeriod <= m_iGOPSize , "Intra period must be larger than GOP size for periodic IDR pictures");
}
#if !JVET_Q0468_Q0469_MIN_LUMA_CB_AND_MIN_QT_FIX

Karsten Suehring
committed
xConfirmPara( m_uiMaxCUDepth > MAX_CU_DEPTH, "MaxPartitionDepth exceeds predefined MAX_CU_DEPTH limit");
#endif

Karsten Suehring
committed
xConfirmPara( m_uiMaxCUWidth > MAX_CU_SIZE, "MaxCUWith exceeds predefined MAX_CU_SIZE limit");
#if JVET_Q0468_Q0469_MIN_LUMA_CB_AND_MIN_QT_FIX
const int minCuSize = 1 << m_log2MinCuSize;
xConfirmPara( m_uiMinQT[0] < minCuSize, "Min Luma QT size in I slices should be larger than or equal to minCuSize");
xConfirmPara( m_uiMinQT[1] < minCuSize, "Min Luma QT size in non-I slices should be larger than or equal to minCuSize");
xConfirmPara((m_iSourceWidth % minCuSize ) || (m_iSourceHeight % minCuSize), "Picture width or height is not a multiple of minCuSize");
const int minDiff = (int)floorLog2(m_uiMinQT[2]) - std::max(MIN_CU_LOG2, (int)m_log2MinCuSize - (int)getChannelTypeScaleX(CHANNEL_TYPE_CHROMA, m_chromaFormatIDC));
xConfirmPara( minDiff < 0 , "Min Chroma QT size in I slices is smaller than Min Luma CU size even considering color format");
xConfirmPara( (m_uiMinQT[2] << (int)getChannelTypeScaleX(CHANNEL_TYPE_CHROMA, m_chromaFormatIDC)) > std::min(64, (int)m_uiCTUSize),
"Min Chroma QT size in I slices should be smaller than or equal to CTB size or CB size after implicit split of CTB");
#else

Karsten Suehring
committed
xConfirmPara( m_uiMinQT[0] < 1<<MIN_CU_LOG2, "Minimum QT size should be larger than or equal to 4");
xConfirmPara( m_uiMinQT[1] < 1<<MIN_CU_LOG2, "Minimum QT size should be larger than or equal to 4");
#endif
xConfirmPara( m_uiCTUSize < 32, "CTUSize must be greater than or equal to 32");
xConfirmPara( m_uiCTUSize > 128, "CTUSize must be less than or equal to 128");
xConfirmPara( m_uiCTUSize != 32 && m_uiCTUSize != 64 && m_uiCTUSize != 128, "CTUSize must be a power of 2 (32, 64, or 128)");
#if !JVET_Q0468_Q0469_MIN_LUMA_CB_AND_MIN_QT_FIX

Karsten Suehring
committed
xConfirmPara( m_uiMaxCUDepth < 1, "MaxPartitionDepth must be greater than zero");
xConfirmPara( (m_uiMaxCUWidth >> m_uiMaxCUDepth) < 4, "Minimum partition width size should be larger than or equal to 8");
xConfirmPara( (m_uiMaxCUHeight >> m_uiMaxCUDepth) < 4, "Minimum partition height size should be larger than or equal to 8");
#endif

Karsten Suehring
committed
xConfirmPara( m_uiMaxCUWidth < 16, "Maximum partition width size should be larger than or equal to 16");
xConfirmPara( m_uiMaxCUHeight < 16, "Maximum partition height size should be larger than or equal to 16");
Jie Chen
committed
#if JVET_Q0330_BLOCK_PARTITION
xConfirmPara( m_uiMaxBT[0] < m_uiMinQT[0], "Maximum BT size for luma block in I slice should be larger than minimum QT size");
xConfirmPara( m_uiMaxBT[0] > m_uiCTUSize, "Maximum BT size for luma block in I slice should be smaller than or equal to CTUSize");
xConfirmPara( m_uiMaxBT[1] < m_uiMinQT[1], "Maximum BT size for luma block in non I slice should be larger than minimum QT size");
xConfirmPara( m_uiMaxBT[1] > m_uiCTUSize, "Maximum BT size for luma block in non I slice should be smaller than or equal to CTUSize");
xConfirmPara( m_uiMaxBT[2] < (m_uiMinQT[2] << (int)getChannelTypeScaleX(CHANNEL_TYPE_CHROMA, m_chromaFormatIDC)),
"Maximum BT size for chroma block in I slice should be larger than minimum QT size");
Jie Chen
committed
xConfirmPara( m_uiMaxBT[2] > m_uiCTUSize, "Maximum BT size for chroma block in I slice should be smaller than or equal to CTUSize");
xConfirmPara( m_uiMaxTT[0] < m_uiMinQT[0], "Maximum TT size for luma block in I slice should be larger than minimum QT size");
xConfirmPara( m_uiMaxTT[0] > m_uiCTUSize, "Maximum TT size for luma block in I slice should be smaller than or equal to CTUSize");
xConfirmPara( m_uiMaxTT[1] < m_uiMinQT[1], "Maximum TT size for luma block in non I slice should be larger than minimum QT size");
xConfirmPara( m_uiMaxTT[1] > m_uiCTUSize, "Maximum TT size for luma block in non I slice should be smaller than or equal to CTUSize");
xConfirmPara( m_uiMaxTT[2] < (m_uiMinQT[2] << (int)getChannelTypeScaleX(CHANNEL_TYPE_CHROMA, m_chromaFormatIDC)),
"Maximum TT size for chroma block in I slice should be larger than minimum QT size");
Jie Chen
committed
xConfirmPara( m_uiMaxTT[2] > m_uiCTUSize, "Maximum TT size for chroma block in I slice should be smaller than or equal to CTUSize");
#endif
#if JVET_Q0468_Q0469_MIN_LUMA_CB_AND_MIN_QT_FIX
xConfirmPara( (m_iSourceWidth % (std::max(8u, m_log2MinCuSize))) != 0, "Resulting coded frame width must be a multiple of Max(8, the minimum CU size)");
xConfirmPara( (m_iSourceHeight % (std::max(8u, m_log2MinCuSize))) != 0, "Resulting coded frame height must be a multiple of Max(8, the minimum CU size)");
#else
xConfirmPara( (m_iSourceWidth % (std::max(8, int(m_uiMaxCUWidth >> (m_uiMaxCUDepth - 1))))) != 0, "Resulting coded frame width must be a multiple of Max(8, the minimum CU size)");
xConfirmPara( (m_iSourceHeight % (std::max(8, int(m_uiMaxCUHeight >> (m_uiMaxCUDepth - 1))))) != 0, "Resulting coded frame height must be a multiple of Max(8, the minimum CU size)");
#endif
Xiang Li
committed
if (m_uiMaxMTTHierarchyDepthI == 0)
{
xConfirmPara(m_uiMaxBT[0] != m_uiMinQT[0], "MaxBTLumaISlice shall be equal to MinQTLumaISlice when MaxMTTHierarchyDepthISliceL is 0.");
xConfirmPara(m_uiMaxTT[0] != m_uiMinQT[0], "MaxTTLumaISlice shall be equal to MinQTLumaISlice when MaxMTTHierarchyDepthISliceL is 0.");
}
if (m_uiMaxMTTHierarchyDepthIChroma == 0)
{
xConfirmPara(m_uiMaxBT[2] != (m_uiMinQT[2] << (int)getChannelTypeScaleX(CHANNEL_TYPE_CHROMA, m_chromaFormatIDC)), "MaxBTChromaISlice shall be equal to MinQTChromaISlice when MaxMTTHierarchyDepthISliceC is 0.");
xConfirmPara(m_uiMaxTT[2] != (m_uiMinQT[2] << (int)getChannelTypeScaleX(CHANNEL_TYPE_CHROMA, m_chromaFormatIDC)), "MaxTTChromaISlice shall be equal to MinQTChromaISlice when MaxMTTHierarchyDepthISliceC is 0.");
Xiang Li
committed
}
if (m_uiMaxMTTHierarchyDepthI == 0)
{
xConfirmPara(m_uiMaxBT[1] != m_uiMinQT[1], "MaxBTNonISlice shall be equal to MinQTNonISlice when MaxMTTHierarchyDepth is 0.");
xConfirmPara(m_uiMaxTT[1] != m_uiMinQT[1], "MaxTTNonISlice shall be equal to MinQTNonISlice when MaxMTTHierarchyDepth is 0.");
}
xConfirmPara( m_log2MaxTbSize > 6, "Log2MaxTbSize must be 6 or smaller." );
xConfirmPara( m_log2MaxTbSize < 5, "Log2MaxTbSize must be 5 or greater." );
xConfirmPara( m_maxNumMergeCand < 1, "MaxNumMergeCand must be 1 or greater.");
xConfirmPara( m_maxNumMergeCand > MRG_MAX_NUM_CANDS, "MaxNumMergeCand must be no more than MRG_MAX_NUM_CANDS." );
#if !JVET_Q0806
#if JVET_Q0798_SPS_NUMBER_MERGE_CANDIDATE
xConfirmPara(m_maxNumGeoCand > TRIANGLE_MAX_NUM_UNI_CANDS, "MaxNumTriangleCand must be no more than TRIANGLE_MAX_NUM_UNI_CANDS.");
xConfirmPara(m_maxNumGeoCand > m_maxNumMergeCand, "MaxNumTriangleCand must be no more than MaxNumMergeCand.");
xConfirmPara(0 < m_maxNumGeoCand && m_maxNumGeoCand < 2, "MaxNumTriangleCand must be no less than 2 unless MaxNumTriangleCand is 0.");
#else
xConfirmPara( m_maxNumTriangleCand > TRIANGLE_MAX_NUM_UNI_CANDS, "MaxNumTriangleCand must be no more than TRIANGLE_MAX_NUM_UNI_CANDS." );
xConfirmPara( m_maxNumTriangleCand > m_maxNumMergeCand, "MaxNumTriangleCand must be no more than MaxNumMergeCand." );
xConfirmPara( 0 < m_maxNumTriangleCand && m_maxNumTriangleCand < 2, "MaxNumTriangleCand must be no less than 2 unless MaxNumTriangleCand is 0." );
#else
xConfirmPara( m_maxNumGeoCand > GEO_MAX_NUM_UNI_CANDS, "MaxNumGeoCand must be no more than GEO_MAX_NUM_UNI_CANDS." );
xConfirmPara( m_maxNumGeoCand > m_maxNumMergeCand, "MaxNumGeoCand must be no more than MaxNumMergeCand." );
xConfirmPara( 0 < m_maxNumGeoCand && m_maxNumGeoCand < 2, "MaxNumGeoCand must be no less than 2 unless MaxNumGeoCand is 0." );
#endif
xConfirmPara( m_maxNumIBCMergeCand < 1, "MaxNumIBCMergeCand must be 1 or greater." );
xConfirmPara( m_maxNumIBCMergeCand > IBC_MRG_MAX_NUM_CANDS, "MaxNumIBCMergeCand must be no more than IBC_MRG_MAX_NUM_CANDS." );
xConfirmPara( m_maxNumAffineMergeCand < 1, "MaxNumAffineMergeCand must be 1 or greater." );
xConfirmPara( m_maxNumAffineMergeCand > AFFINE_MRG_MAX_NUM_CANDS, "MaxNumAffineMergeCand must be no more than AFFINE_MRG_MAX_NUM_CANDS." );
if ( m_Affine == 0 )
{
m_maxNumAffineMergeCand = m_SubPuMvpMode;
if (m_PROF) msg(WARNING, "PROF is forcefully disabled when Affine is off \n");
m_PROF = false;
xConfirmPara( m_MTS < 0 || m_MTS > 3, "MTS must be greater than 0 smaller than 4" );
xConfirmPara( m_MTSIntraMaxCand < 0 || m_MTSIntraMaxCand > 5, "m_MTSIntraMaxCand must be greater than 0 and smaller than 6" );
xConfirmPara( m_MTSInterMaxCand < 0 || m_MTSInterMaxCand > 5, "m_MTSInterMaxCand must be greater than 0 and smaller than 6" );
xConfirmPara( m_MTS != 0 && m_MTSImplicit != 0, "Both explicit and implicit MTS cannot be enabled at the same time" );

Karsten Suehring
committed
if (m_useBDPCM)
{
xConfirmPara(!m_useTransformSkip, "BDPCM cannot be used when transform skip is disabled.");
}

Karsten Suehring
committed
#if JVET_Q0795_CCALF
if (!m_alf)
{
xConfirmPara( m_ccalf, "CCALF cannot be enabled when ALF is disabled" );
}
#endif

Karsten Suehring
committed
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
xConfirmPara( m_iSourceWidth % SPS::getWinUnitX(m_chromaFormatIDC) != 0, "Picture width must be an integer multiple of the specified chroma subsampling");
xConfirmPara( m_iSourceHeight % SPS::getWinUnitY(m_chromaFormatIDC) != 0, "Picture height must be an integer multiple of the specified chroma subsampling");
xConfirmPara( m_aiPad[0] % SPS::getWinUnitX(m_chromaFormatIDC) != 0, "Horizontal padding must be an integer multiple of the specified chroma subsampling");
xConfirmPara( m_aiPad[1] % SPS::getWinUnitY(m_chromaFormatIDC) != 0, "Vertical padding must be an integer multiple of the specified chroma subsampling");
xConfirmPara( m_confWinLeft % SPS::getWinUnitX(m_chromaFormatIDC) != 0, "Left conformance window offset must be an integer multiple of the specified chroma subsampling");
xConfirmPara( m_confWinRight % SPS::getWinUnitX(m_chromaFormatIDC) != 0, "Right conformance window offset must be an integer multiple of the specified chroma subsampling");
xConfirmPara( m_confWinTop % SPS::getWinUnitY(m_chromaFormatIDC) != 0, "Top conformance window offset must be an integer multiple of the specified chroma subsampling");
xConfirmPara( m_confWinBottom % SPS::getWinUnitY(m_chromaFormatIDC) != 0, "Bottom conformance window offset must be an integer multiple of the specified chroma subsampling");
// max CU width and height should be power of 2
uint32_t ui = m_uiMaxCUWidth;
while(ui)
{
ui >>= 1;
if( (ui & 1) == 1)
{
xConfirmPara( ui != 1 , "Width should be 2^n");
}
}
ui = m_uiMaxCUHeight;
while(ui)
{
ui >>= 1;
if( (ui & 1) == 1)
{
xConfirmPara( ui != 1 , "Height should be 2^n");
}
}
/* if this is an intra-only sequence, ie IntraPeriod=1, don't verify the GOP structure
* This permits the ability to omit a GOP structure specification */
if (m_iIntraPeriod == 1 && m_GOPList[0].m_POC == -1)
{
m_GOPList[0] = GOPEntry();
m_GOPList[0].m_QPFactor = 1;
m_GOPList[0].m_betaOffsetDiv2 = 0;
m_GOPList[0].m_tcOffsetDiv2 = 0;
#if JVET_Q0121_DEBLOCKING_CONTROL_PARAMETERS
m_GOPList[0].m_CbBetaOffsetDiv2 = 0;
m_GOPList[0].m_CbTcOffsetDiv2 = 0;
m_GOPList[0].m_CrBetaOffsetDiv2 = 0;
m_GOPList[0].m_CrTcOffsetDiv2 = 0;
#endif

Karsten Suehring
committed
m_GOPList[0].m_POC = 1;
m_RPLList0[0] = RPLEntry();
m_RPLList1[0] = RPLEntry();
m_RPLList0[0].m_POC = m_RPLList1[0].m_POC = 1;
m_RPLList0[0].m_numRefPicsActive = 4;
m_GOPList[0].m_numRefPicsActive0 = 4;

Karsten Suehring
committed
}
else
{
xConfirmPara( m_intraConstraintFlag, "IntraConstraintFlag cannot be 1 for inter sequences");
}
int multipleFactor = m_compositeRefEnabled ? 2 : 1;

Karsten Suehring
committed
bool verifiedGOP=false;
bool errorGOP=false;
int checkGOP=1;
int numRefs = m_isField ? 2 : 1;
int refList[MAX_NUM_REF_PICS+1] = {0};

Karsten Suehring
committed
if(m_isField)
{
refList[1] = 1;
}
bool isOK[MAX_GOP];
for(int i=0; i<MAX_GOP; i++)
{
isOK[i]=false;
}
int numOK=0;
xConfirmPara( m_iIntraPeriod >=0&&(m_iIntraPeriod%m_iGOPSize!=0), "Intra period must be a multiple of GOPSize, or -1" );
for(int i=0; i<m_iGOPSize; i++)
{
if (m_GOPList[i].m_POC == m_iGOPSize * multipleFactor)

Karsten Suehring
committed
{
xConfirmPara( m_GOPList[i].m_temporalId!=0 , "The last frame in each GOP must have temporal ID = 0 " );
}
}
if ( (m_iIntraPeriod != 1) && !m_loopFilterOffsetInPPS && (!m_bLoopFilterDisable) )
{
for(int i=0; i<m_iGOPSize; i++)
{
#if JVET_Q0121_DEBLOCKING_CONTROL_PARAMETERS
xConfirmPara( (m_GOPList[i].m_betaOffsetDiv2 + m_loopFilterBetaOffsetDiv2) < -12 || (m_GOPList[i].m_betaOffsetDiv2 + m_loopFilterBetaOffsetDiv2) > 12, "Loop Filter Beta Offset div. 2 for one of the GOP entries exceeds supported range (-12 to 12)" );
xConfirmPara( (m_GOPList[i].m_tcOffsetDiv2 + m_loopFilterTcOffsetDiv2) < -12 || (m_GOPList[i].m_tcOffsetDiv2 + m_loopFilterTcOffsetDiv2) > 12, "Loop Filter Tc Offset div. 2 for one of the GOP entries exceeds supported range (-12 to 12)" );
xConfirmPara( (m_GOPList[i].m_CbBetaOffsetDiv2 + m_loopFilterCbBetaOffsetDiv2) < -12 || (m_GOPList[i].m_CbBetaOffsetDiv2 + m_loopFilterCbBetaOffsetDiv2) > 12, "Loop Filter Beta Offset div. 2 for one of the GOP entries exceeds supported range (-12 to 12)" );
xConfirmPara( (m_GOPList[i].m_CbTcOffsetDiv2 + m_loopFilterCbTcOffsetDiv2) < -12 || (m_GOPList[i].m_CbTcOffsetDiv2 + m_loopFilterCbTcOffsetDiv2) > 12, "Loop Filter Tc Offset div. 2 for one of the GOP entries exceeds supported range (-12 to 12)" );
xConfirmPara( (m_GOPList[i].m_CrBetaOffsetDiv2 + m_loopFilterCrBetaOffsetDiv2) < -12 || (m_GOPList[i].m_CrBetaOffsetDiv2 + m_loopFilterCrBetaOffsetDiv2) > 12, "Loop Filter Beta Offset div. 2 for one of the GOP entries exceeds supported range (-12 to 12)" );
xConfirmPara( (m_GOPList[i].m_CrTcOffsetDiv2 + m_loopFilterCrTcOffsetDiv2) < -12 || (m_GOPList[i].m_CrTcOffsetDiv2 + m_loopFilterCrTcOffsetDiv2) > 12, "Loop Filter Tc Offset div. 2 for one of the GOP entries exceeds supported range (-12 to 12)" );
#else

Karsten Suehring
committed
xConfirmPara( (m_GOPList[i].m_betaOffsetDiv2 + m_loopFilterBetaOffsetDiv2) < -6 || (m_GOPList[i].m_betaOffsetDiv2 + m_loopFilterBetaOffsetDiv2) > 6, "Loop Filter Beta Offset div. 2 for one of the GOP entries exceeds supported range (-6 to 6)" );
xConfirmPara( (m_GOPList[i].m_tcOffsetDiv2 + m_loopFilterTcOffsetDiv2) < -6 || (m_GOPList[i].m_tcOffsetDiv2 + m_loopFilterTcOffsetDiv2) > 6, "Loop Filter Tc Offset div. 2 for one of the GOP entries exceeds supported range (-6 to 6)" );

Karsten Suehring
committed
}
}
#if W0038_CQP_ADJ
for(int i=0; i<m_iGOPSize; i++)
{
xConfirmPara( abs(m_GOPList[i].m_CbQPoffset ) > 12, "Cb QP Offset for one of the GOP entries exceeds supported range (-12 to 12)" );
xConfirmPara( abs(m_GOPList[i].m_CbQPoffset + m_cbQpOffset) > 12, "Cb QP Offset for one of the GOP entries, when combined with the PPS Cb offset, exceeds supported range (-12 to 12)" );
xConfirmPara( abs(m_GOPList[i].m_CrQPoffset ) > 12, "Cr QP Offset for one of the GOP entries exceeds supported range (-12 to 12)" );
xConfirmPara( abs(m_GOPList[i].m_CrQPoffset + m_crQpOffset) > 12, "Cr QP Offset for one of the GOP entries, when combined with the PPS Cr offset, exceeds supported range (-12 to 12)" );
}
xConfirmPara( abs(m_sliceChromaQpOffsetIntraOrPeriodic[0] ) > 12, "Intra/periodic Cb QP Offset exceeds supported range (-12 to 12)" );
xConfirmPara( abs(m_sliceChromaQpOffsetIntraOrPeriodic[0] + m_cbQpOffset ) > 12, "Intra/periodic Cb QP Offset, when combined with the PPS Cb offset, exceeds supported range (-12 to 12)" );
xConfirmPara( abs(m_sliceChromaQpOffsetIntraOrPeriodic[1] ) > 12, "Intra/periodic Cr QP Offset exceeds supported range (-12 to 12)" );
xConfirmPara( abs(m_sliceChromaQpOffsetIntraOrPeriodic[1] + m_crQpOffset ) > 12, "Intra/periodic Cr QP Offset, when combined with the PPS Cr offset, exceeds supported range (-12 to 12)" );
#endif
xConfirmPara( m_fastLocalDualTreeMode < 0 || m_fastLocalDualTreeMode > 2, "FastLocalDualTreeMode must be in range [0..2]" );