Commit 483f400d authored by Philippe de Lagrange's avatar Philippe de Lagrange
Browse files

Configuration: removed interdependencies between chroma QP config parameters....

Configuration: removed interdependencies between chroma QP config parameters. Warning: not backward compatible. MaxCuChromaQpOffsetSubdiv <0 is no more used to disable the feature. Empty QP offset lists play this role. To enable the feature, now you have to specify chroma QP offset lists.
parent b3f364e8
......@@ -2327,21 +2327,21 @@ Indicates if the designated colour space of scaling matrices is equal to the ori
\Option{MaxCuChromaQpOffsetSubdiv} &
%\ShortOption{\None} &
\Default{0} &
Specifies the maximum subdiv for CU chroma QP adjustment.
Specifies the maximum subdiv for CU chroma QP adjustment. Has no effect if CbQpOffsetList, etc. are left empty.
\\
\Option{CuChromaQpOffsetEnabled} &
\Option{SliceCuChromaQpOffsetEnabled} &
%\ShortOption{\None} &
\Default{0} &
Specifies whether CU chroma QP adjustment is enabled at slice level.
If unspecified and either MaxCuChromaQpOffsetSubdiv or Cb/Cr/CbCrQpOffsetList are specified, is it automatically set to 1.
\Default{true} &
Specifies whether CU chroma QP adjustment is enabled at slice level. Has no effect if CbQpOffsetList, etc. are left empty.
\\
\Option{CbQpOffsetList, CrQpOffsetList, CbCrQpOffsetList} &
\Option{CbQpOffsetList}%
\Option{CrQpOffsetList}%
\Option{CbCrQpOffsetList} &
%\ShortOption{\None} &
\Default{6, 6, 6} &
\Default{\NotSet} &
Comma-separated value lists specifying the Cb/Cr/CbCr QP offsets for each chroma QP adjustment index. Each list shall be the same length.
If chroma QP offsets are enabled (e.g. by specifying MaxCuChromaQpOffsetSubdiv or setting CuChromaQpOffsetEnabled equal to 1) and offset lists are unspecified, they are set to default values (a single +6 value for each list), otherwise the lists are left empty.
CbCrQpOffsetList may be omitted whereas CbQpOffsetList and CrQpOffsetList are specified, in which case it is filled with zeros.
Note that when CbCrQpOffset and CbCrQpOffsetList values are all zero, pps_joint_cbcr_qp_offset_present_flag will be automatically set to zero.
\\
......
......@@ -1044,8 +1044,8 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
("DeltaQpRD,-dqr", m_uiDeltaQpRD, 0u, "max dQp offset for slice")
("MaxDeltaQP,d", m_iMaxDeltaQP, 0, "max dQp offset for block")
("MaxCuDQPSubdiv,-dqd", m_cuQpDeltaSubdiv, 0, "Maximum subdiv for CU luma Qp adjustment")
("MaxCuChromaQpOffsetSubdiv", m_cuChromaQpOffsetSubdiv, -1, "Maximum subdiv for CU chroma Qp adjustment")
("CuChromaQpOffsetEnabled", m_cuChromaQpOffsetEnabled, -1, "Enable local chroma QP offsets (slice level flag)")
("MaxCuChromaQpOffsetSubdiv", m_cuChromaQpOffsetSubdiv, 0, "Maximum subdiv for CU chroma Qp adjustment")
("SliceCuChromaQpOffsetEnabled", m_cuChromaQpOffsetEnabled, true, "Enable local chroma QP offsets (slice level flag)")
("FastDeltaQP", m_bFastDeltaQP, false, "Fast Delta QP Algorithm")
#if SHARP_LUMA_DELTA_QP
("LumaLevelToDeltaQPMode", lumaLevelToDeltaQPMode, 0u, "Luma based Delta QP 0(default): not used. 1: Based on CTU average, 2: Based on Max luma in CTU")
......@@ -2142,25 +2142,12 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
}
/* Local chroma QP offsets configuration */
if (m_cuChromaQpOffsetEnabled < 0)
{
m_cuChromaQpOffsetEnabled = (m_cuChromaQpOffsetSubdiv >= 0 || cfg_cbQpOffsetList.values.size() > 0); // auto-enable if unspecified
}
if (m_cuChromaQpOffsetSubdiv < 0)
{
m_cuChromaQpOffsetSubdiv = 0; // default = 0 (CTU-level)
}
CHECK(m_cuChromaQpOffsetSubdiv < 0, "MaxCuChromaQpOffsetSubdiv shall be >= 0");
CHECK(cfg_crQpOffsetList.values.size() != cfg_cbQpOffsetList.values.size(), "Chroma QP offset lists shall be the same size");
CHECK(cfg_cbCrQpOffsetList.values.size() != cfg_cbQpOffsetList.values.size() && cfg_cbCrQpOffsetList.values.size() > 0, "Chroma QP offset list for joint CbCr shall be either the same size as Cb and Cr or empty");
/* generate default chroma QP offset lists if none provided */
if (cfg_cbQpOffsetList.values.size() == 0 && m_cuChromaQpOffsetEnabled)
if (m_cuChromaQpOffsetSubdiv > 0 && !cfg_cbQpOffsetList.values.size())
{
for (int i=0; i < sizeof(cQpOffsets)/sizeof(int); i++)
{
cfg_cbQpOffsetList.values.push_back(cQpOffsets[i]);
cfg_crQpOffsetList.values.push_back(cQpOffsets[i]);
cfg_cbCrQpOffsetList.values.push_back(cQpOffsets[i]);
}
msg(WARNING, "MaxCuChromaQpOffsetSubdiv has no effect when chroma QP offset lists are empty\n");
}
m_cuChromaQpOffsetList.resize(cfg_cbQpOffsetList.values.size());
for (int i=0; i < cfg_cbQpOffsetList.values.size(); i++)
......@@ -3918,7 +3905,7 @@ void EncAppCfg::xPrintParameter()
(i+1 < m_cuChromaQpOffsetList.size() ? ", " : ")\n") );
}
msg( DETAILS, "cu_chroma_qp_offset_subdiv : %d\n", m_cuChromaQpOffsetSubdiv);
msg( DETAILS, "cu_chroma_qp_offset_enabled_flag : %d\n", m_cuChromaQpOffsetEnabled);
msg( DETAILS, "cu_chroma_qp_offset_enabled_flag : %s\n", (m_cuChromaQpOffsetEnabled ? "Enabled" : "Disabled") );
}
else
{
......
......@@ -257,7 +257,7 @@ protected:
int m_cuQpDeltaSubdiv; ///< Maximum subdiv for CU luma Qp adjustment (0:default)
int m_cuChromaQpOffsetSubdiv; ///< If negative, then do not apply chroma qp offsets.
std::vector<ChromaQpAdj> m_cuChromaQpOffsetList; ///< Local chroma QP offsets list (to be signalled in PPS)
int m_cuChromaQpOffsetEnabled; ///< Enable local chroma QP offsets (slice level flag)
bool m_cuChromaQpOffsetEnabled; ///< Enable local chroma QP offsets (slice level flag)
bool m_bFastDeltaQP; ///< Fast Delta QP (false:default)
int m_cbQpOffset; ///< Chroma Cb QP Offset (0:default)
......
Supports Markdown
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