Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • jvet/VVCSoftware_VTM
  • chenhuanbang/VVCSoftware_VTM
  • ezhizng/VVCSoftware_VTM
  • XZheng/VVCSoftware_VTM
  • YanZhang/VVCSoftware_VTM
  • xiaozhongxu/VVCSoftware_VTM
  • bossen/VVCSoftware_VTM
  • XiangLi/VVCSoftware_VTM
  • s.iwamura/VVCSoftware_VTM
  • yuling.hsiao/VVCSoftware_VTM
  • ccc2384823/VVCSoftware_VTM
  • yuchisu/VVCSoftware_VTM
  • schwarz/VVCSoftware_VTM
  • philippe.hanhart/VVCSoftware_VTM
  • nanh/VVCSoftware_VTM
  • guillaume.laroche/VVCSoftware_VTM
  • Kenneth/VVCSoftware_VTM
  • jonatan/VVCSoftware_VTM
  • Alexey/VVCSoftware_VTM
  • saintspear/VVCSoftware_VTM
  • xinzhao/VVCSoftware_VTM
  • Seungsoo/VVCSoftware_VTM
  • jamesxxiu/VVCSoftware_VTM
  • leolzhao/VVCSoftware_VTM
  • ywchen/VVCSoftware_VTM
  • kevin625/VVCSoftware_VTM
  • Zhang/VVCSoftware_VTM
  • zhangkai/VVCSoftware_VTM
  • YCSun/VVCSoftware_VTM
  • ksuehring/VVCSoftware_VTM
  • AbeKiyo/VVCSoftware_VTM
  • naeri.park/VVCSoftware_VTM
  • ling/VVCSoftware_VTM
  • aikiho/VVCSoftware_VTM
  • JangwonChoi/VVCSoftware_VTM
  • Shelly/VVCSoftware_VTM
  • blaeser/VVCSoftware_VTM
  • crhelmrich/VVCSoftware_VTM
  • keydel/VVCSoftware_VTM
  • adam_wieckowski/VVCSoftware_VTM
  • hashimry/VVCSoftware_VTM
  • yimingli/VVCSoftware_VTM
  • zhipin/VVCSoftware_VTM
  • chernyak/VVCSoftware_VTM
  • jvet-l-ahg-14/VVCSoftware_VTM
  • sauer/VVCSoftware_VTM
  • fbarbier/VVCSoftware_VTM
  • misrak/VVCSoftware_VTM
  • ikai/VVCSoftware_VTM
  • tlu/VVCSoftware_VTM
  • Yasugi/VVCSoftware_VTM
  • peterchuang/VVCSoftware_VTM
  • wanght99/VVCSoftware_VTM
  • yuhan/VVCSoftware_VTM
  • hongbin/VVCSoftware_VTM
  • jiahaoli/VVCSoftware_VTM
  • cfd/VVCSoftware_VTM
  • ruoyangyu/VVCSoftware_VTM
  • chujoh/VVCSoftware_VTM
  • lijingya/VVCSoftware_VTM
  • hinz/VVCSoftware_VTM
  • tamse.anish/VVCSoftware_VTM
  • mcoban/VVCSoftware_VTM
  • george/VVCSoftware_VTM
  • jeeva.raj/VVCSoftware_VTM
  • antoine/VVCSoftware_VTM
  • moonmo.koo/VVCSoftware_VTM
  • deluxan/VVCSoftware_VTM
  • bheng/VVCSoftware_VTM
  • lzz8246/VVCSoftware_VTM
  • delagrangep/VVCSoftware_VTM
  • jiechen/VVCSoftware_VTM
  • hendry197/VVCSoftware_VTM
  • LGE_VCC/VVCSoftware_VTM
  • asegall/VVCSoftware_VTM
  • pbcowan/VVCSoftware_VTM
  • forayr/VVCSoftware_VTM
  • JT/VVCSoftware_VTM
  • Zhou/VVCSoftware_VTM
  • yjpiao/VVCSoftware_VTM
  • fabrice.leleannec/VVCSoftware_VTM
  • tpoirier/VVCSoftware_VTM
  • PoHan.Lin/VVCSoftware_VTM
  • jzxu/VVCSoftware_VTM
  • junghak.nam/VVCSoftware_VTM
  • guichunli/VVCSoftware_VTM
  • xianglinwang/VVCSoftware_VTM
  • chunchic/VVCSoftware_VTM
  • chrisr12/VVCSoftware_VTM
  • ks_kashyap/VVCSoftware_VTM
  • minhua/VVCSoftware_VTM
  • Sheng-Yen.Lin/VVCSoftware_VTM
  • hegilmez/VVCSoftware_VTM
  • swongah/VVCSoftware_VTM
  • merkle/VVCSoftware_VTM
  • sunyucheng/VVCSoftware_VTM
  • kirchhoffer/VVCSoftware_VTM
  • vdrugeon/VVCSoftware_VTM
  • jennylai/VVCSoftware_VTM
  • rickxu/VVCSoftware_VTM
  • seuhong/VVCSoftware_VTM
  • chollmann/VVCSoftware_VTM
  • jvet-n-ce8-public/VVCSoftware_VTM
  • martin.m.pettersson/VVCSoftware_VTM
  • siekmann/VVCSoftware_VTM
  • aramasub/VVCSoftware_VTM
  • zhiyilin/VVCSoftware_VTM
  • EricLin/VVCSoftware_VTM
  • mengwang/VVCSoftware_VTM
  • m.sarwer/VVCSoftware_VTM
  • agnesedong/VVCSoftware_VTM
  • geonjungko/VVCSoftware_VTM
  • bray/VVCSoftware_VTM
  • yhchao/VVCSoftware_VTM
  • Zhu/VVCSoftware_VTM
  • ykato/VVCSoftware_VTM
  • ZhipinDeng/VVCSoftware_VTM
  • jasonjung/VVCSoftware_VTM
  • hanhuang/VVCSoftware_VTM
  • seregin/VVCSoftware_VTM
  • wchen1014/VVCSoftware_VTM
  • Auyeung/VVCSoftware_VTM
  • Morris/VVCSoftware_VTM
  • lphamvan/VVCSoftware_VTM
  • dmehlem/VVCSoftware_VTM
  • shih-ta.hsiang/VVCSoftware_VTM
  • ysanchez/VVCSoftware_VTM
  • baegn74/VVCSoftware_VTM
  • kazui/VVCSoftware_VTM
  • yuwenhe_vvc/VVCSoftware_VTM
  • rickard/VVCSoftware_VTM
  • wangyang.cs/VVCSoftware_VTM
  • xwmeng/VVCSoftware_VTM
  • takeshi.tsukuba/VVCSoftware_VTM
  • yixindu/VVCSoftware_VTM
  • baixiu.wz/VVCSoftware_VTM
  • hm.jang/VVCSoftware_VTM
  • Ted/VVCSoftware_VTM
  • nguyen/VVCSoftware_VTM
  • chaohsiu/VVCSoftware_VTM
  • francoise/VVCSoftware_VTM
  • Yin/VVCSoftware_VTM
  • Morigami/VVCSoftware_VTM
  • sagar.kotecha/VVCSoftware_VTM
  • hwsun/VVCSoftware_VTM
  • pierrick.bouvier/VVCSoftware_VTM
  • XiangMa/VVCSoftware_VTM
  • LouiseLee/VVCSoftware_VTM
  • chenps/VVCSoftware_VTM
  • karls/VVCSoftware_VTM
  • biaowang/VVCSoftware_VTM
  • hangao/VVCSoftware_VTM
  • Jin/VVCSoftware_VTM
  • analci/VVCSoftware_VTM
  • KuiFan/VVCSoftware_VTM
  • hobingzhang/VVCSoftware_VTM
  • audrey.turquin/VVCSoftware_VTM
  • rlliao/VVCSoftware_VTM
  • winken/VVCSoftware_VTM
  • hallapur/VVCSoftware_VTM
  • T.Hashimoto/VVCSoftware_VTM
  • AnandMeher/VVCSoftware_VTM
  • semihese/VVCSoftware_VTM
  • ouedraogo/VVCSoftware_VTM
  • arthurcerveira/VVCSoftware_VTM
  • sunmi.yoo/VVCSoftware_VTM
  • Cynthia/VVCSoftware_VTM
  • yang/VVCSoftware_VTM
  • yuyoon/VVCSoftware_VTM
  • jslee/VVCSoftware_VTM
  • weimin.zeng/VVCSoftware_VTM
  • edrthomas/VVCSoftware_VTM
  • Mitsuru.Katsumata/VVCSoftware_VTM
  • adybrowne/VVCSoftware_VTM
  • jack.enhorn/VVCSoftware_VTM
  • Palanivel/VVCSoftware_VTM
  • olena.chubach/VVCSoftware_VTM
  • juvenalluo/VVCSoftware_VTM
  • yylee/VVCSoftware_VTM
  • bross/VVCSoftware_VTM
  • jvet-ahg-nnvc/VVCSoftware_VTM
  • jacob/VVCSoftware_VTM
  • dmytro.rusanovskyy/VVCSoftware_VTM
  • karamnaser/VVCSoftware_VTM
  • milos.radosavljevic/VVCSoftware_VTM
  • Keming/VVCSoftware_VTM
  • pj/VVCSoftware_VTM
  • cwkuo/VVCSoftware_VTM
  • BD/VVCSoftware_VTM
  • bartnik/VVCSoftware_VTM
  • Fangjun.Pu/VVCSoftware_VTM
  • nikolay.shostak/VVCSoftware_VTM
  • kirill.suverov/VVCSoftware_VTM
  • Xile_Zhou/VVCSoftware_VTM
  • ksuehring/vvc-software-vtm-nnvc
  • guether/VVCSoftware_VTM
  • salmonc/VVCSoftware_VTM
  • eeehey/VVCSoftware_VTM
  • marie-pierre.gallasso/VVCSoftware_VTM
  • jvet-ahg-fgt/VTM
  • liaojq/VVCSoftware_VTM
  • axel.ricard/VVCSoftware_VTM
  • XiangLi/nnvc
  • sw.xie/VVCSoftware_VTM
  • jeeva.raj/vvc-software-vtm-tu-c
  • XiangLi/tu-c
  • msantamaria/nnvc
  • cjj490168650/VVCSoftware_VTM
  • Yun_li/VVCSoftware_VTM
  • Zhengang/vvc-software-vtm
  • lvzhuoyi/vvc-software-vtm-nnvc
  • Kenneth/vvc-software-vtm-nn
  • biatekt/vvc-software-vtm
  • jvet-ahg-gcc/VVCSoftware_VTM
  • JINGYING/VVCSoftware_VTM
  • furban/VVCSoftware_VTM
  • yanning/VVCSoftware_VTM
  • zhuochen/VVCSoftware_VTM
  • Kaifa/VVCSoftware_VTM_AJ0048
  • yueli/VVCSoftware_VTM
  • tokumo/VVCSoftware_VTM
221 results
Show changes
Commits on Source (20)
Showing
with 594 additions and 37 deletions
......@@ -2233,6 +2233,18 @@ switched at CTB level. Set to 1 to disable alternative chroma filters.
Value shall be in the range 1..8.
\\
\Option{CCALF} &
%\ShortOption{\None} &
\Default{true} &
Enables cross-component ALF.
\\
\Option{CCALFQpTh} &
%\ShortOption{\None} &
\Default{37} &
QP threshold above which the encoder reduces cross-component ALF usage.
\\
\Option{SMVD} &
%\ShortOption{\None} &
\Default{false} &
......
......@@ -212,6 +212,9 @@ void EncApp::xInitLibCfg()
m_cEncLib.setNoPartitionConstraintsOverrideConstraintFlag ( !m_SplitConsOverrideEnabledFlag );
m_cEncLib.setNoSaoConstraintFlag ( !m_bUseSAO );
m_cEncLib.setNoAlfConstraintFlag ( !m_alf );
#if JVET_Q0795_CCALF
m_cEncLib.setNoAlfConstraintFlag ( !m_ccalf );
#endif
m_cEncLib.setNoRefWraparoundConstraintFlag ( m_bNoRefWraparoundConstraintFlag );
m_cEncLib.setNoTemporalMvpConstraintFlag ( m_TMVPModeId ? false : true );
m_cEncLib.setNoSbtmvpConstraintFlag ( m_SubPuMvpMode ? false : true );
......@@ -755,6 +758,10 @@ void EncApp::xInitLibCfg()
m_cEncLib.setForceSingleSplitThread ( m_forceSplitSequential );
#endif
m_cEncLib.setUseALF ( m_alf );
#if JVET_Q0795_CCALF
m_cEncLib.setUseCCALF ( m_ccalf );
m_cEncLib.setCCALFQpThreshold ( m_ccalfQpThreshold );
#endif
m_cEncLib.setLmcs ( m_lmcsEnabled );
m_cEncLib.setReshapeSignalType ( m_reshapeSignalType );
m_cEncLib.setReshapeIntraCMD ( m_intraCMD );
......
......@@ -87,6 +87,9 @@ EncAppCfg::EncAppCfg()
, m_noPartitionConstraintsOverrideConstraintFlag(false)
, m_bNoSaoConstraintFlag(false)
, m_bNoAlfConstraintFlag(false)
#if JVET_Q0795_CCALF
, m_noCCAlfConstraintFlag(false)
#endif
, m_bNoRefWraparoundConstraintFlag(false)
, m_bNoTemporalMvpConstraintFlag(false)
, m_bNoSbtmvpConstraintFlag(false)
......@@ -1357,7 +1360,11 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
("NumWppExtraLines", m_numWppExtraLines, 0, "Number of additional wpp lines to switch when threads are blocked")
("DebugCTU", m_debugCTU, -1, "If DebugBitstream is present, load frames up to this POC from this bitstream. Starting with DebugPOC-frame at CTUline containin debug CTU.")
("EnsureWppBitEqual", m_ensureWppBitEqual, false, "Ensure the results are equal to results with WPP-style parallelism, even if WPP is off")
( "ALF", m_alf, true, "Adpative Loop Filter\n" )
( "ALF", m_alf, true, "Adaptive Loop Filter\n" )
#if JVET_Q0795_CCALF
( "CCALF", m_ccalf, true, "Cross-component Adaptive Loop Filter" )
( "CCALFQpTh", m_ccalfQpThreshold, 37, "QP threshold above which encoder reduces CCALF usage")
#endif
( "ScalingRatioHor", m_scalingRatioHor, 1.0, "Scaling ratio in hor direction" )
( "ScalingRatioVer", m_scalingRatioVer, 1.0, "Scaling ratio in ver direction" )
( "FractionNumFrames", m_fractionOfFrames, 1.0, "Encode a fraction of the specified in FramesToBeEncoded frames" )
......@@ -2533,6 +2540,12 @@ bool EncAppCfg::xCheckParameter()
}
#if JVET_Q0795_CCALF
if (!m_alf)
{
xConfirmPara( m_ccalf, "CCALF cannot be enabled when ALF is disabled" );
}
#endif
xConfirmPara( m_iSourceWidth % SPS::getWinUnitX(m_chromaFormatIDC) != 0, "Picture width must be an integer multiple of the specified chroma subsampling");
......@@ -3422,6 +3435,9 @@ bool EncAppCfg::xCheckParameter()
#endif
xConfirmPara(m_useBDPCM < 0 || m_useBDPCM > 2, "BDPCM must be in range 0..2");
#if JVET_Q0820_ACT
xConfirmPara(m_useColorTrans && (m_log2MaxTbSize == 6), "Log2MaxTbSize must be less than 6 when ACT is enabled, otherwise ACT needs to be disabled");
#endif
#undef xConfirmPara
return check_failed;
......@@ -3604,6 +3620,9 @@ void EncAppCfg::xPrintParameter()
msg( VERBOSE, "MCTS:%d ", m_MCTSEncConstraint );
msg( VERBOSE, "SAO:%d ", (m_bUseSAO)?(1):(0));
msg( VERBOSE, "ALF:%d ", m_alf ? 1 : 0 );
#if JVET_Q0795_CCALF
msg( VERBOSE, "CCALF:%d ", m_ccalf ? 1 : 0 );
#endif
msg( VERBOSE, "WPP:%d ", (int)m_useWeightedPred);
msg( VERBOSE, "WPB:%d ", (int)m_useWeightedBiPred);
......@@ -3654,7 +3673,11 @@ void EncAppCfg::xPrintParameter()
msg(VERBOSE, "MmvdDisNum:%d ", m_MmvdDisNum);
msg(VERBOSE, "JointCbCr:%d ", m_JointCbCrMode);
}
#if JVET_Q0820_ACT
m_useColorTrans = (m_chromaFormatIDC == CHROMA_444) ? m_useColorTrans : 0u;
#else
m_useColorTrans = (m_chromaFormatIDC == CHROMA_444 && m_costMode != COST_LOSSLESS_CODING) ? m_useColorTrans : 0u;
#endif
msg(VERBOSE, "ACT:%d ", m_useColorTrans);
m_PLTMode = ( m_chromaFormatIDC == CHROMA_444) ? m_PLTMode : 0u;
msg(VERBOSE, "PLT:%d ", m_PLTMode);
......
......@@ -137,6 +137,9 @@ protected:
bool m_noPartitionConstraintsOverrideConstraintFlag;
bool m_bNoSaoConstraintFlag;
bool m_bNoAlfConstraintFlag;
#if JVET_Q0795_CCALF
bool m_noCCAlfConstraintFlag;
#endif
bool m_bNoRefWraparoundConstraintFlag;
bool m_bNoTemporalMvpConstraintFlag;
bool m_bNoSbtmvpConstraintFlag;
......@@ -664,6 +667,10 @@ protected:
bool m_forceDecodeBitstream1;
bool m_alf; ///< Adaptive Loop Filter
#if JVET_Q0795_CCALF
bool m_ccalf;
int m_ccalfQpThreshold;
#endif
double m_scalingRatioHor;
double m_scalingRatioVer;
......
......@@ -63,6 +63,9 @@ AdaptiveLoopFilter::AdaptiveLoopFilter()
}
m_deriveClassificationBlk = deriveClassificationBlk;
#if JVET_Q0795_CCALF
m_filterCcAlf = filterBlkCcAlf<CC_ALF>;
#endif
m_filter5x5Blk = filterBlk<ALF_FILTER_5>;
m_filter7x7Blk = filterBlk<ALF_FILTER_7>;
......@@ -285,6 +288,47 @@ const int AdaptiveLoopFilter::m_classToFilterMapping[NUM_FIXED_FILTER_SETS][MAX_
{ 16, 31, 32, 15, 60, 30, 4, 17, 19, 25, 22, 20, 4, 53, 19, 21, 22, 46, 25, 55, 26, 48, 63, 58, 55 },
};
#if JVET_Q0795_CCALF
void AdaptiveLoopFilter::applyCcAlfFilter(CodingStructure &cs, ComponentID compID, const PelBuf &dstBuf,
const PelUnitBuf &recYuvExt, uint8_t *filterControl,
const short filterSet[MAX_NUM_CC_ALF_FILTERS][MAX_NUM_CC_ALF_CHROMA_COEFF],
const int selectedFilterIdx)
{
int ctuIdx = 0;
for( int yPos = 0; yPos < m_picHeight; yPos += m_maxCUHeight )
{
for( int xPos = 0; xPos < m_picWidth; xPos += m_maxCUWidth )
{
const int width = ( xPos + m_maxCUWidth > m_picWidth ) ? ( m_picWidth - xPos ) : m_maxCUWidth;
const int height = ( yPos + m_maxCUHeight > m_picHeight ) ? ( m_picHeight - yPos ) : m_maxCUHeight;
const UnitArea area( m_chromaFormat, Area( xPos, yPos, width, height ) );
const int chromaScaleX = getComponentScaleX( compID, m_chromaFormat );
const int chromaScaleY = getComponentScaleY( compID, m_chromaFormat );
Area blkDst(xPos >> chromaScaleX, yPos >> chromaScaleY, width >> chromaScaleX, height >> chromaScaleY);
Area blkSrc(xPos, yPos, width, height);
int filterIdx =
(filterControl == nullptr)
? selectedFilterIdx
: filterControl[(yPos >> cs.pcv->maxCUHeightLog2) * cs.pcv->widthInCtus + (xPos >> cs.pcv->maxCUWidthLog2)];
bool skipFiltering = (filterControl != nullptr && filterIdx == 0) ? true : false;
if (!skipFiltering)
{
if (filterControl != nullptr)
filterIdx--;
const int16_t *filterCoeff = filterSet[filterIdx];
m_filterCcAlf(dstBuf, recYuvExt, blkDst, blkSrc, compID, filterCoeff, m_clpRngs, cs, m_alfVBLumaCTUHeight,
m_alfVBLumaPos);
}
ctuIdx++;
}
}
}
#endif
void AdaptiveLoopFilter::ALFProcess(CodingStructure& cs)
{
......@@ -342,6 +386,12 @@ void AdaptiveLoopFilter::ALFProcess(CodingStructure& cs)
for( int compIdx = 1; compIdx < MAX_NUM_COMPONENT; compIdx++ )
{
ctuEnableFlag |= m_ctuEnableFlag[compIdx][ctuIdx] > 0;
#if JVET_Q0795_CCALF
if (cu->slice->m_ccAlfFilterParam.ccAlfFilterEnabled[compIdx - 1])
{
ctuEnableFlag |= m_ccAlfFilterControl[compIdx - 1][ctuIdx] > 0;
}
#endif
}
int rasterSliceAlfPad = 0;
if( ctuEnableFlag && isCrossedByVirtualBoundaries( cs, xPos, yPos, width, height, clipTop, clipBottom, clipLeft, clipRight, numHorVirBndry, numVerVirBndry, horVirBndryPos, verVirBndryPos, rasterSliceAlfPad ) )
......@@ -417,6 +467,24 @@ void AdaptiveLoopFilter::ALFProcess(CodingStructure& cs)
, m_alfVBChmaCTUHeight
, m_alfVBChmaPos );
}
#if JVET_Q0795_CCALF
if (cu->slice->m_ccAlfFilterParam.ccAlfFilterEnabled[compIdx - 1])
{
const int filterIdx = m_ccAlfFilterControl[compIdx - 1][ctuIdx];
if (filterIdx != 0)
{
const Area blkSrc(0, 0, w >> chromaScaleX, h >> chromaScaleY);
Area blkDst(xPos >> chromaScaleX, yPos >> chromaScaleY, width >> chromaScaleX,
height >> chromaScaleY);
const int16_t *filterCoeff = m_ccAlfFilterParam.ccAlfCoeff[compIdx - 1][filterIdx - 1];
m_filterCcAlf(recYuv.get(compID), tmpYuv, blkDst, blkSrc, compID, filterCoeff, m_clpRngs, cs,
m_alfVBLumaCTUHeight, m_alfVBLumaPos);
}
}
#endif
}
xStart = xEnd;
......@@ -427,46 +495,63 @@ void AdaptiveLoopFilter::ALFProcess(CodingStructure& cs)
}
else
{
const UnitArea area( cs.area.chromaFormat, Area( xPos, yPos, width, height ) );
if( m_ctuEnableFlag[COMPONENT_Y][ctuIdx] )
{
Area blk( xPos, yPos, width, height );
deriveClassification( m_classifier, tmpYuv.get( COMPONENT_Y ), blk, blk );
short filterSetIndex = alfCtuFilterIndex[ctuIdx];
short *coeff;
short *clip;
if (filterSetIndex >= NUM_FIXED_FILTER_SETS)
const UnitArea area( cs.area.chromaFormat, Area( xPos, yPos, width, height ) );
if( m_ctuEnableFlag[COMPONENT_Y][ctuIdx] )
{
coeff = m_coeffApsLuma[filterSetIndex - NUM_FIXED_FILTER_SETS];
clip = m_clippApsLuma[filterSetIndex - NUM_FIXED_FILTER_SETS];
Area blk( xPos, yPos, width, height );
deriveClassification( m_classifier, tmpYuv.get( COMPONENT_Y ), blk, blk );
short filterSetIndex = alfCtuFilterIndex[ctuIdx];
short *coeff;
short *clip;
if (filterSetIndex >= NUM_FIXED_FILTER_SETS)
{
coeff = m_coeffApsLuma[filterSetIndex - NUM_FIXED_FILTER_SETS];
clip = m_clippApsLuma[filterSetIndex - NUM_FIXED_FILTER_SETS];
}
else
{
coeff = m_fixedFilterSetCoeffDec[filterSetIndex];
clip = m_clipDefault;
}
m_filter7x7Blk(m_classifier, recYuv, tmpYuv, blk, blk, COMPONENT_Y, coeff, clip, m_clpRngs.comp[COMPONENT_Y], cs
, m_alfVBLumaCTUHeight
, m_alfVBLumaPos
);
}
else
for( int compIdx = 1; compIdx < MAX_NUM_COMPONENT; compIdx++ )
{
coeff = m_fixedFilterSetCoeffDec[filterSetIndex];
clip = m_clipDefault;
}
m_filter7x7Blk(m_classifier, recYuv, tmpYuv, blk, blk, COMPONENT_Y, coeff, clip, m_clpRngs.comp[COMPONENT_Y], cs
, m_alfVBLumaCTUHeight
, m_alfVBLumaPos
);
}
ComponentID compID = ComponentID( compIdx );
const int chromaScaleX = getComponentScaleX( compID, tmpYuv.chromaFormat );
const int chromaScaleY = getComponentScaleY( compID, tmpYuv.chromaFormat );
for( int compIdx = 1; compIdx < MAX_NUM_COMPONENT; compIdx++ )
{
ComponentID compID = ComponentID( compIdx );
const int chromaScaleX = getComponentScaleX( compID, tmpYuv.chromaFormat );
const int chromaScaleY = getComponentScaleY( compID, tmpYuv.chromaFormat );
if (m_ctuEnableFlag[compIdx][ctuIdx])
{
Area blk(xPos >> chromaScaleX, yPos >> chromaScaleY, width >> chromaScaleX, height >> chromaScaleY);
uint8_t alt_num = m_ctuAlternative[compIdx][ctuIdx];
m_filter5x5Blk(m_classifier, recYuv, tmpYuv, blk, blk, compID, m_chromaCoeffFinal[alt_num],
m_chromaClippFinal[alt_num], m_clpRngs.comp[compIdx], cs, m_alfVBChmaCTUHeight,
m_alfVBChmaPos);
}
#if JVET_Q0795_CCALF
if (cu->slice->m_ccAlfFilterParam.ccAlfFilterEnabled[compIdx - 1])
{
const int filterIdx = m_ccAlfFilterControl[compIdx - 1][ctuIdx];
if( m_ctuEnableFlag[compIdx][ctuIdx] )
{
Area blk( xPos >> chromaScaleX, yPos >> chromaScaleY, width >> chromaScaleX, height >> chromaScaleY );
uint8_t alt_num = m_ctuAlternative[compIdx][ctuIdx];
m_filter5x5Blk(m_classifier, recYuv, tmpYuv, blk, blk, compID, m_chromaCoeffFinal[alt_num], m_chromaClippFinal[alt_num], m_clpRngs.comp[compIdx], cs
, m_alfVBChmaCTUHeight
, m_alfVBChmaPos);
if (filterIdx != 0)
{
Area blkDst(xPos >> chromaScaleX, yPos >> chromaScaleY, width >> chromaScaleX, height >> chromaScaleY);
Area blkSrc(xPos, yPos, width, height);
const int16_t *filterCoeff = m_ccAlfFilterParam.ccAlfCoeff[compIdx - 1][filterIdx - 1];
m_filterCcAlf(recYuv.get(compID), tmpYuv, blkDst, blkSrc, compID, filterCoeff, m_clpRngs, cs,
m_alfVBLumaCTUHeight, m_alfVBLumaPos);
}
}
#endif
}
}
}
ctuIdx++;
}
}
......@@ -581,6 +666,10 @@ void AdaptiveLoopFilter::create( const int picWidth, const int picHeight, const
m_numCTUsInWidth = ( m_picWidth / m_maxCUWidth ) + ( ( m_picWidth % m_maxCUWidth ) ? 1 : 0 );
m_numCTUsInHeight = ( m_picHeight / m_maxCUHeight ) + ( ( m_picHeight % m_maxCUHeight ) ? 1 : 0 );
m_numCTUsInPic = m_numCTUsInHeight * m_numCTUsInWidth;
#if JVET_Q0795_CCALF
m_filterShapesCcAlf[0].push_back(AlfFilterShape(size_CC_ALF));
m_filterShapesCcAlf[1].push_back(AlfFilterShape(size_CC_ALF));
#endif
m_filterShapes[CHANNEL_TYPE_LUMA].push_back( AlfFilterShape( 7 ) );
m_filterShapes[CHANNEL_TYPE_CHROMA].push_back( AlfFilterShape( 5 ) );
m_alfVBLumaPos = m_maxCUHeight - ALF_VB_POS_ABOVE_CTUROW_LUMA;
......@@ -657,6 +746,11 @@ void AdaptiveLoopFilter::create( const int picWidth, const int picHeight, const
m_clipDefault[i] = m_alfClippingValues[CHANNEL_TYPE_LUMA][0];
}
m_created = true;
#if JVET_Q0795_CCALF
m_ccAlfFilterControl[0] = new uint8_t[m_numCTUsInPic];
m_ccAlfFilterControl[1] = new uint8_t[m_numCTUsInPic];
#endif
}
void AdaptiveLoopFilter::destroy()
......@@ -678,6 +772,22 @@ void AdaptiveLoopFilter::destroy()
m_filterShapes[CHANNEL_TYPE_LUMA].clear();
m_filterShapes[CHANNEL_TYPE_CHROMA].clear();
m_created = false;
#if JVET_Q0795_CCALF
m_filterShapesCcAlf[0].clear();
m_filterShapesCcAlf[1].clear();
if ( m_ccAlfFilterControl[0] )
{
delete [] m_ccAlfFilterControl[0];
m_ccAlfFilterControl[0] = nullptr;
}
if ( m_ccAlfFilterControl[1] )
{
delete [] m_ccAlfFilterControl[1];
m_ccAlfFilterControl[1] = nullptr;
}
#endif
}
void AdaptiveLoopFilter::deriveClassification( AlfClassifier** classifier, const CPelBuf& srcLuma, const Area& blkDst, const Area& blk )
......@@ -1152,3 +1262,96 @@ void AdaptiveLoopFilter::filterBlk(AlfClassifier **classifier, const PelUnitBuf
pImgYPad6 += srcStride2;
}
}
#if JVET_Q0795_CCALF
template<AlfFilterType filtTypeCcAlf>
void AdaptiveLoopFilter::filterBlkCcAlf(const PelBuf &dstBuf, const CPelUnitBuf &recSrc, const Area &blkDst,
const Area &blkSrc, const ComponentID compId, const int16_t *filterCoeff,
const ClpRngs &clpRngs, CodingStructure &cs, int vbCTUHeight, int vbPos)
{
CHECK(1 << floorLog2(vbCTUHeight) != vbCTUHeight, "Not a power of 2");
CHECK(!isChroma(compId), "Must be chroma");
const SPS* sps = cs.slice->getSPS();
ChromaFormat nChromaFormat = sps->getChromaFormatIdc();
const int clsSizeY = 4;
const int clsSizeX = 4;
const int startHeight = blkDst.y;
const int endHeight = blkDst.y + blkDst.height;
const int startWidth = blkDst.x;
const int endWidth = blkDst.x + blkDst.width;
const int scaleX = getComponentScaleX(compId, nChromaFormat);
const int scaleY = getComponentScaleY(compId, nChromaFormat);
CHECK( startHeight % clsSizeY, "Wrong startHeight in filtering" );
CHECK( startWidth % clsSizeX, "Wrong startWidth in filtering" );
CHECK( ( endHeight - startHeight ) % clsSizeY, "Wrong endHeight in filtering" );
CHECK( ( endWidth - startWidth ) % clsSizeX, "Wrong endWidth in filtering" );
CPelBuf srcBuf = recSrc.get(COMPONENT_Y);
const int lumaStride = srcBuf.stride;
const Pel * lumaPtr = srcBuf.buf + blkSrc.y * lumaStride + blkSrc.x;
const int chromaStride = dstBuf.stride;
Pel * chromaPtr = dstBuf.buf + blkDst.y * chromaStride + blkDst.x;
for( int i = 0; i < endHeight - startHeight; i += clsSizeY )
{
for( int j = 0; j < endWidth - startWidth; j += clsSizeX )
{
for( int ii = 0; ii < clsSizeY; ii++ )
{
int row = ii;
int col = j;
Pel *srcSelf = chromaPtr + col + row * chromaStride;
int offset1 = lumaStride;
int offset2 = -lumaStride;
int offset3 = 2 * lumaStride;
row <<= scaleY;
col <<= scaleX;
const Pel *srcCross = lumaPtr + col + row * lumaStride;
int pos = ((startHeight + i + ii) << scaleY) & (vbCTUHeight - 1);
if (pos == (vbPos - 2) || pos == (vbPos + 1))
{
offset3 = offset1;
}
else if (pos == (vbPos - 1) || pos == vbPos)
{
offset1 = 0;
offset2 = 0;
offset3 = 0;
}
for (int jj = 0; jj < clsSizeX; jj++)
{
const int jj2 = (jj << scaleX);
const int offset0 = 0;
int sum = 0;
const Pel currSrcCross = srcCross[offset0 + jj2];
sum += filterCoeff[0] * (srcCross[offset2 + jj2 ] - currSrcCross);
sum += filterCoeff[1] * (srcCross[offset0 + jj2 - 1] - currSrcCross);
sum += filterCoeff[2] * (srcCross[offset0 + jj2 + 1] - currSrcCross);
sum += filterCoeff[3] * (srcCross[offset1 + jj2 - 1] - currSrcCross);
sum += filterCoeff[4] * (srcCross[offset1 + jj2 ] - currSrcCross);
sum += filterCoeff[5] * (srcCross[offset1 + jj2 + 1] - currSrcCross);
sum += filterCoeff[6] * (srcCross[offset3 + jj2 ] - currSrcCross);
sum = (sum + ((1 << m_scaleBits ) >> 1)) >> m_scaleBits;
const int offset = 1 << clpRngs.comp[compId].bd >> 1;
sum = ClipPel(sum + offset, clpRngs.comp[compId]) - offset;
sum += srcSelf[jj];
srcSelf[jj] = ClipPel(sum, clpRngs.comp[compId]);
}
}
}
chromaPtr += chromaStride * clsSizeY;
lumaPtr += lumaStride * clsSizeY << getComponentScaleY(compId, nChromaFormat);
}
}
#endif
......@@ -91,6 +91,13 @@ public:
const CPelBuf &srcLuma, const Area &blkDst, const Area &blk, const int shift,
const int vbCTUHeight, int vbPos);
void deriveClassification( AlfClassifier** classifier, const CPelBuf& srcLuma, const Area& blkDst, const Area& blk );
#if JVET_Q0795_CCALF
template<AlfFilterType filtTypeCcAlf>
static void filterBlkCcAlf(const PelBuf &dstBuf, const CPelUnitBuf &recSrc, const Area &blkDst, const Area &blkSrc,
const ComponentID compId, const int16_t *filterCoeff, const ClpRngs &clpRngs,
CodingStructure &cs, int vbCTUHeight, int vbPos);
#endif
template<AlfFilterType filtType>
static void filterBlk(AlfClassifier **classifier, const PelUnitBuf &recDst, const CPelUnitBuf &recSrc,
const Area &blkDst, const Area &blk, const ComponentID compId, const short *filterSet,
......@@ -100,6 +107,17 @@ public:
const Area &blkDst, const Area &blk, const int shift, const int vbCTUHeight,
int vbPos);
#if JVET_Q0795_CCALF
void (*m_filterCcAlf)(const PelBuf &dstBuf, const CPelUnitBuf &recSrc, const Area &blkDst, const Area &blkSrc,
const ComponentID compId, const int16_t *filterCoeff, const ClpRngs &clpRngs,
CodingStructure &cs, int vbCTUHeight, int vbPos);
void applyCcAlfFilter(CodingStructure &cs, ComponentID compID, const PelBuf &dstBuf, const PelUnitBuf &recYuvExt,
uint8_t * filterControl,
const short filterSet[MAX_NUM_CC_ALF_FILTERS][MAX_NUM_CC_ALF_CHROMA_COEFF],
const int selectedFilterIdx);
CcAlfFilterParam &getCcAlfFilterParam() { return m_ccAlfFilterParam; }
uint8_t* getCcAlfControlIdc(const ComponentID compID) { return m_ccAlfFilterControl[compID-1]; }
#endif
void (*m_filter5x5Blk)(AlfClassifier **classifier, const PelUnitBuf &recDst, const CPelUnitBuf &recSrc,
const Area &blkDst, const Area &blk, const ComponentID compId, const short *filterSet,
const short *fClipSet, const ClpRng &clpRng, CodingStructure &cs, const int vbCTUHeight,
......@@ -117,6 +135,11 @@ public:
protected:
bool isCrossedByVirtualBoundaries( const CodingStructure& cs, const int xPos, const int yPos, const int width, const int height, bool& clipTop, bool& clipBottom, bool& clipLeft, bool& clipRight, int& numHorVirBndry, int& numVerVirBndry, int horVirBndryPos[], int verVirBndryPos[], int& rasterSliceAlfPad );
#if JVET_Q0795_CCALF
static constexpr int m_scaleBits = 7; // 8-bits
CcAlfFilterParam m_ccAlfFilterParam;
uint8_t* m_ccAlfFilterControl[2];
#endif
static const int m_classToFilterMapping[NUM_FIXED_FILTER_SETS][MAX_NUM_ALF_CLASSES];
static const int m_fixedFilterSetCoeff[ALF_FIXED_FILTER_NUM][MAX_NUM_ALF_LUMA_COEFF];
short m_fixedFilterSetCoeffDec[NUM_FIXED_FILTER_SETS][MAX_NUM_ALF_CLASSES * MAX_NUM_ALF_LUMA_COEFF];
......@@ -127,6 +150,9 @@ protected:
short m_chromaCoeffFinal[MAX_NUM_ALF_ALTERNATIVES_CHROMA][MAX_NUM_ALF_CHROMA_COEFF];
AlfParam* m_alfParamChroma;
Pel m_alfClippingValues[MAX_NUM_CHANNEL_TYPE][MaxAlfNumClippingValues];
#if JVET_Q0795_CCALF
std::vector<AlfFilterShape> m_filterShapesCcAlf[2];
#endif
std::vector<AlfFilterShape> m_filterShapes[MAX_NUM_CHANNEL_TYPE];
AlfClassifier** m_classifier;
short m_coeffFinal[MAX_NUM_ALF_CLASSES * MAX_NUM_ALF_LUMA_COEFF];
......
......@@ -48,9 +48,17 @@ enum AlfFilterType
{
ALF_FILTER_5,
ALF_FILTER_7,
#if JVET_Q0795_CCALF
CC_ALF,
#endif
ALF_NUM_OF_FILTER_TYPES
};
#if JVET_Q0795_CCALF
static const int size_CC_ALF = -1;
#endif
struct AlfFilterShape
{
AlfFilterShape( int size )
......@@ -97,6 +105,16 @@ struct AlfFilterShape
filterType = ALF_FILTER_7;
}
#if JVET_Q0795_CCALF
else if (size == size_CC_ALF)
{
size = 4;
filterLength = 8;
numCoeff = 8;
filterSize = 8;
filterType = CC_ALF;
}
#endif
else
{
filterType = ALF_NUM_OF_FILTER_TYPES;
......@@ -231,6 +249,43 @@ struct AlfParam
}
};
#if JVET_Q0795_CCALF
struct CcAlfFilterParam
{
bool ccAlfFilterEnabled[2];
bool ccAlfFilterIdxEnabled[2][MAX_NUM_CC_ALF_FILTERS];
uint8_t ccAlfFilterCount[2];
short ccAlfCoeff[2][MAX_NUM_CC_ALF_FILTERS][MAX_NUM_CC_ALF_CHROMA_COEFF];
int newCcAlfFilter[2];
int numberValidComponents;
CcAlfFilterParam()
{
reset();
}
void reset()
{
std::memset( ccAlfFilterEnabled, false, sizeof( ccAlfFilterEnabled ) );
std::memset( ccAlfFilterIdxEnabled, false, sizeof( ccAlfFilterIdxEnabled ) );
std::memset( ccAlfCoeff, 0, sizeof( ccAlfCoeff ) );
ccAlfFilterCount[0] = ccAlfFilterCount[1] = MAX_NUM_CC_ALF_FILTERS;
numberValidComponents = 3;
newCcAlfFilter[0] = newCcAlfFilter[1] = 0;
}
const CcAlfFilterParam& operator = ( const CcAlfFilterParam& src )
{
std::memcpy( ccAlfFilterEnabled, src.ccAlfFilterEnabled, sizeof( ccAlfFilterEnabled ) );
std::memcpy( ccAlfFilterIdxEnabled, src.ccAlfFilterIdxEnabled, sizeof( ccAlfFilterIdxEnabled ) );
std::memcpy( ccAlfCoeff, src.ccAlfCoeff, sizeof( ccAlfCoeff ) );
ccAlfFilterCount[0] = src.ccAlfFilterCount[0];
ccAlfFilterCount[1] = src.ccAlfFilterCount[1];
numberValidComponents = src.numberValidComponents;
newCcAlfFilter[0] = src.newCcAlfFilter[0];
newCcAlfFilter[1] = src.newCcAlfFilter[1];
return *this;
}
};
#endif
//! \}
#endif // end of #ifndef __ALFPARAMETERS__
......@@ -779,7 +779,11 @@ const CPelUnitBuf PelStorage::getBuf( const UnitArea &unit ) const
}
template<>
#if JVET_Q0820_ACT
void UnitBuf<Pel>::colorSpaceConvert(const UnitBuf<Pel> &other, const bool forward, const ClpRng& clpRng)
#else
void UnitBuf<Pel>::colorSpaceConvert(const UnitBuf<Pel> &other, const bool forward)
#endif
{
const Pel* pOrg0 = bufs[COMPONENT_Y].buf;
const Pel* pOrg1 = bufs[COMPONENT_Cb].buf;
......@@ -793,6 +797,9 @@ void UnitBuf<Pel>::colorSpaceConvert(const UnitBuf<Pel> &other, const bool forwa
int width = bufs[COMPONENT_Y].width;
int height = bufs[COMPONENT_Y].height;
#if JVET_Q0820_ACT
int maxAbsclipBD = (1 << (clpRng.bd + 1)) - 1;
#endif
int r, g, b;
int y0, cg, co;
......@@ -810,12 +817,21 @@ void UnitBuf<Pel>::colorSpaceConvert(const UnitBuf<Pel> &other, const bool forwa
g = pOrg0[x];
b = pOrg1[x];
#if JVET_Q0820_ACT
co = r - b;
int t = b + (co >> 1);
cg = g - t;
pDst0[x] = t + (cg >> 1);
pDst1[x] = cg;
pDst2[x] = co;
#else
pDst0[x] = (g << 1) + r + b;
pDst1[x] = (g << 1) - r - b;
pDst2[x] = ((r - b) << 1);
pDst0[x] = (pDst0[x] + 2) >> 2;
pDst1[x] = (pDst1[x] + 2) >> 2;
pDst2[x] = (pDst2[x] + 2) >> 2;
#endif
}
pOrg0 += strideOrg;
pOrg1 += strideOrg;
......@@ -835,9 +851,20 @@ void UnitBuf<Pel>::colorSpaceConvert(const UnitBuf<Pel> &other, const bool forwa
cg = pOrg1[x];
co = pOrg2[x];
#if JVET_Q0820_ACT
y0 = Clip3((-maxAbsclipBD - 1), maxAbsclipBD, y0);
cg = Clip3((-maxAbsclipBD - 1), maxAbsclipBD, cg);
co = Clip3((-maxAbsclipBD - 1), maxAbsclipBD, co);
int t = y0 - (cg >> 1);
pDst0[x] = cg + t;
pDst1[x] = t - (co >> 1);
pDst2[x] = co + pDst1[x];
#else
pDst0[x] = (y0 + cg);
pDst1[x] = (y0 - cg - co);
pDst2[x] = (y0 - cg + co);
#endif
}
pOrg0 += strideOrg;
......
......@@ -779,7 +779,11 @@ struct UnitBuf
UnitBuf< T> subBuf (const UnitArea& subArea);
const UnitBuf<const T> subBuf (const UnitArea& subArea) const;
#if JVET_Q0820_ACT
void colorSpaceConvert(const UnitBuf<T> &other, const bool forward, const ClpRng& clpRng);
#else
void colorSpaceConvert(const UnitBuf<T> &other, const bool forward);
#endif
};
typedef UnitBuf< Pel> PelUnitBuf;
......@@ -880,13 +884,21 @@ void UnitBuf<T>::addAvg(const UnitBuf<const T> &other1, const UnitBuf<const T> &
}
template<typename T>
#if JVET_Q0820_ACT
void UnitBuf<T>::colorSpaceConvert(const UnitBuf<T> &other, const bool forward, const ClpRng& clpRng)
#else
void UnitBuf<T>::colorSpaceConvert(const UnitBuf<T> &other, const bool forward)
#endif
{
THROW("Type not supported");
}
template<>
#if JVET_Q0820_ACT
void UnitBuf<Pel>::colorSpaceConvert(const UnitBuf<Pel> &other, const bool forward, const ClpRng& clpRng);
#else
void UnitBuf<Pel>::colorSpaceConvert(const UnitBuf<Pel> &other, const bool forward);
#endif
template<typename T>
void UnitBuf<T>::extendSingleBorderPel()
......
......@@ -117,6 +117,9 @@ enum CodingStatisticsType
STATS__CABAC_BITS__MULTI_REF_LINE,
STATS__CABAC_BITS__SYMMVD_FLAG,
STATS__CABAC_BITS__BDPCM_MODE,
#if JVET_Q0795_CCALF
STATS__CABAC_BITS__CROSS_COMPONENT_ALF_BLOCK_LEVEL_IDC,
#endif
STATS__TOOL_TOTAL_FRAME,// This is a special case and is not included in the report.
STATS__TOOL_AFF,
STATS__TOOL_EMT,
......@@ -209,6 +212,9 @@ static inline const char* getName(CodingStatisticsType name)
"CABAC_BITS__MULTI_REF_LINE",
"CABAC_BITS__SYMMVD_FLAG",
"CABAC_BITS__BDPCM_MODE",
#if JVET_Q0795_CCALF
"CABAC_BITS__CROSS_COMPONENT_ALF_BLOCK_LEVEL_IDC",
#endif
"TOOL_FRAME",
"TOOL_AFFINE",
"TOOL_EMT",
......
......@@ -187,6 +187,12 @@ static const int MAX_NUM_ALF_CHROMA_COEFF = 7;
static const int MAX_ALF_FILTER_LENGTH = 7;
static const int MAX_NUM_ALF_COEFF = MAX_ALF_FILTER_LENGTH * MAX_ALF_FILTER_LENGTH / 2 + 1;
static const int MAX_ALF_PADDING_SIZE = 4;
#if JVET_Q0795_CCALF
#define MAX_NUM_CC_ALF_FILTERS 4
static constexpr int MAX_NUM_CC_ALF_CHROMA_COEFF = 8;
static constexpr int CCALF_DYNAMIC_RANGE = 6;
static constexpr int CCALF_BITS_PER_COEFF_LEVEL = 3;
#endif
static const int ALF_FIXED_FILTER_NUM = 64;
static const int ALF_CTB_MAX_NUM_APS = 8;
......@@ -479,8 +485,12 @@ static const int ENC_PPS_ID_RPR = 3;
static const int SCALE_RATIO_BITS = 14;
static const int MAX_SCALING_RATIO = 2; // max downsampling ratio for RPR
static const std::pair<int, int> SCALE_1X = std::pair<int, int>( 1 << SCALE_RATIO_BITS, 1 << SCALE_RATIO_BITS ); // scale ratio 1x
#if JVET_Q0820_ACT
static const int DELTA_QP_ACT[4] = { -5, 1, 3, 1 };
#else
static const int DELTA_QP_FOR_Y_Cg = -5;
static const int DELTA_QP_FOR_Co = -3;
#endif
// ====================================================================================================================
// Macro functions
......@@ -700,6 +710,11 @@ static inline int ceilLog2(uint32_t x)
#define PARL_PARAM0(DEF)
#endif
#if JVET_Q0795_CCALF
static const uint32_t CCALF_CANDS_COEFF_NR = 8;
static const int CCALF_SMALL_TAB[CCALF_CANDS_COEFF_NR] = { 0, 1, 2, 4, 8, 16, 32, 64 };
#endif
//! \}
#endif // end of #ifndef __COMMONDEF__
......
......@@ -416,6 +416,9 @@ public:
violatesLfnstConstrained[CHANNEL_TYPE_CHROMA] = false;
lfnstLastScanPos = false;
violatesMtsCoeffConstraint = false;
#if JVET_Q0516_MTS_SIGNALLING_DC_ONLY_COND
mtsLastScanPos = false;
#endif
}
CUCtx(int _qp) : isDQPCoded(false), isChromaQpAdjCoded(false),
qgStart(false),
......@@ -425,6 +428,9 @@ public:
violatesLfnstConstrained[CHANNEL_TYPE_CHROMA] = false;
lfnstLastScanPos = false;
violatesMtsCoeffConstraint = false;
#if JVET_Q0516_MTS_SIGNALLING_DC_ONLY_COND
mtsLastScanPos = false;
#endif
}
~CUCtx() {}
public:
......@@ -435,6 +441,9 @@ public:
int8_t qp; // used as a previous(last) QP and for QP prediction
bool violatesLfnstConstrained[MAX_NUM_CHANNEL_TYPE];
bool violatesMtsCoeffConstraint;
#if JVET_Q0516_MTS_SIGNALLING_DC_ONLY_COND
bool mtsLastScanPos;
#endif
};
class MergeCtx
......
......@@ -825,6 +825,16 @@ const CtxSet ContextSetCfg::AlfUseTemporalFilt = ContextSetCfg::addCtxSet
{ 0, },
});
#if JVET_Q0795_CCALF
const CtxSet ContextSetCfg::CcAlfFilterControlFlag = ContextSetCfg::addCtxSet
({
{ 35, 35, 35, 35, 35, 35 },
{ 35, 35, 35, 35, 35, 35 },
{ 35, 35, 35, 35, 35, 35 },
{ DWS, DWS, DWS, DWS, DWS, DWS },
});
#endif
const CtxSet ContextSetCfg::CiipFlag = ContextSetCfg::addCtxSet
({
{ 50, },
......
......@@ -263,6 +263,9 @@ public:
static const CtxSet ctbAlfFlag;
static const CtxSet ctbAlfAlternative;
static const CtxSet AlfUseTemporalFilt;
#if JVET_Q0795_CCALF
static const CtxSet CcAlfFilterControlFlag;
#endif
static const CtxSet CiipFlag;
static const CtxSet SmvdFlag;
static const CtxSet IBCFlag;
......
......@@ -1587,7 +1587,12 @@ void DepQuant::quant( TransformUnit &tu, const ComponentID &compID, const CCoeff
const uint32_t log2TrWidth = floorLog2(width);
const uint32_t log2TrHeight = floorLog2(height);
const bool disableSMForLFNST = tu.cs->picHeader->getScalingListPresentFlag() ? tu.cs->picHeader->getScalingListAPS()->getScalingList().getDisableScalingMatrixForLfnstBlks() : false;
#if JVET_Q0784_LFNST_COMBINATION
const bool isLfnstApplied = tu.cu->lfnstIdx > 0 && (tu.cu->isSepTree() ? true : isLuma(compID));
const bool enableScalingLists = getUseScalingList(width, height, (tu.mtsIdx[compID] == MTS_SKIP), isLfnstApplied, disableSMForLFNST);
#else
const bool enableScalingLists = getUseScalingList(width, height, (tu.mtsIdx[compID] == MTS_SKIP), tu.cu->lfnstIdx > 0, disableSMForLFNST);
#endif
static_cast<DQIntern::DepQuant*>(p)->quant( tu, pSrc, compID, cQP, Quant::m_dLambda, ctx, uiAbsSum, enableScalingLists, Quant::getQuantCoeff(scalingListType, qpRem, log2TrWidth, log2TrHeight) );
}
else
......@@ -1611,7 +1616,12 @@ void DepQuant::dequant( const TransformUnit &tu, CoeffBuf &dstCoeff, const Compo
const uint32_t log2TrWidth = floorLog2(width);
const uint32_t log2TrHeight = floorLog2(height);
const bool disableSMForLFNST = tu.cs->picHeader->getScalingListPresentFlag() ? tu.cs->picHeader->getScalingListAPS()->getScalingList().getDisableScalingMatrixForLfnstBlks() : false;
#if JVET_Q0784_LFNST_COMBINATION
const bool isLfnstApplied = tu.cu->lfnstIdx > 0 && (tu.cu->isSepTree() ? true : isLuma(compID));
const bool enableScalingLists = getUseScalingList(width, height, (tu.mtsIdx[compID] == MTS_SKIP), isLfnstApplied, disableSMForLFNST);
#else
const bool enableScalingLists = getUseScalingList(width, height, (tu.mtsIdx[compID] == MTS_SKIP), tu.cu->lfnstIdx > 0, disableSMForLFNST);
#endif
static_cast<DQIntern::DepQuant*>(p)->dequant( tu, dstCoeff, compID, cQP, enableScalingLists, Quant::getDequantCoeff(scalingListType, qpRem, log2TrWidth, log2TrHeight) );
}
else
......
......@@ -539,7 +539,11 @@ void InterPrediction::xPredInterBi(PredictionUnit &pu, PelUnitBuf &pcYuvPred, co
}
else
{
#if JVET_Q0128_DMVR_BDOF_ENABLING_CONDITION
const bool biocheck0 = !((wp0[COMPONENT_Y].bPresentFlag || wp0[COMPONENT_Cb].bPresentFlag || wp0[COMPONENT_Cr].bPresentFlag || wp1[COMPONENT_Y].bPresentFlag || wp1[COMPONENT_Cb].bPresentFlag || wp1[COMPONENT_Cr].bPresentFlag) && slice.getSliceType() == B_SLICE);
#else
const bool biocheck0 = !((wp0[COMPONENT_Y].bPresentFlag || wp1[COMPONENT_Y].bPresentFlag) && slice.getSliceType() == B_SLICE);
#endif
const bool biocheck1 = !(pps.getUseWP() && slice.getSliceType() == P_SLICE);
if (biocheck0
&& biocheck1
......@@ -1400,6 +1404,14 @@ void InterPrediction::xWeightedAverage(const PredictionUnit& pu, const CPelUnitB
yuvDstTmp->bufs[0].copyFrom(pcYuvDst.bufs[0]);
}
}
#if JVET_Q0128_DMVR_BDOF_ENABLING_CONDITION
if (!bioApplied && (lumaOnly || chromaOnly))
{
pcYuvDst.addAvg(pcYuvSrc0, pcYuvSrc1, clpRngs, chromaOnly, lumaOnly);
}
else
pcYuvDst.addAvg(pcYuvSrc0, pcYuvSrc1, clpRngs, bioApplied);
#else
if (pu.cs->pps->getWPBiPred())
{
const int iRefIdx0 = pu.refIdx[0];
......@@ -1427,6 +1439,7 @@ void InterPrediction::xWeightedAverage(const PredictionUnit& pu, const CPelUnitB
else
pcYuvDst.addAvg(pcYuvSrc0, pcYuvSrc1, clpRngs, bioApplied);
}
#endif
if (yuvDstTmp)
{
if (bioApplied)
......@@ -1539,7 +1552,11 @@ void InterPrediction::motionCompensation( PredictionUnit &pu, PelUnitBuf &predBu
}
else
{
#if JVET_Q0128_DMVR_BDOF_ENABLING_CONDITION
const bool biocheck0 = !((wp0[COMPONENT_Y].bPresentFlag || wp0[COMPONENT_Cb].bPresentFlag || wp0[COMPONENT_Cr].bPresentFlag || wp1[COMPONENT_Y].bPresentFlag || wp1[COMPONENT_Cb].bPresentFlag || wp1[COMPONENT_Cr].bPresentFlag) && slice.getSliceType() == B_SLICE);
#else
const bool biocheck0 = !((wp0[COMPONENT_Y].bPresentFlag || wp1[COMPONENT_Y].bPresentFlag) && slice.getSliceType() == B_SLICE);
#endif
const bool biocheck1 = !(pps.getUseWP() && slice.getSliceType() == P_SLICE);
if (biocheck0
&& biocheck1
......
......@@ -1406,8 +1406,9 @@ void IntraPrediction::xGetLumaRecPixels(const PredictionUnit &pu, CompArea chrom
bool isFirstRowOfCtu = ( lumaArea.y & ((pu.cs->sps)->getCTUSize() - 1) ) == 0;
const int strOffset = (CHROMA_444 == pu.chromaFormat) ? 0 : iRecStride;
#if !JVET_Q0500_CCLM_REF_PADDING
int c0_2tap = 1, c1_2tap = 1, offset_2tap = 1, shift_2tap = 1; //sum = 2
#endif
int c0_3tap = 2, c1_3tap = 1, c2_3tap = 1, offset_3tap = 2, shift_3tap = 2; //sum = 4
int c0_5tap = 1, c1_5tap = 4, c2_5tap = 1, c3_5tap = 1, c4_5tap = 1, offset_5tap = 4, shift_5tap = 3; //sum = 8
int c0_6tap = 2, c1_6tap = 1, c2_6tap = 1, c3_6tap = 2, c4_6tap = 1, c5_6tap = 1, offset_6tap = 4, shift_6tap = 3; //sum = 8
......@@ -1415,14 +1416,18 @@ void IntraPrediction::xGetLumaRecPixels(const PredictionUnit &pu, CompArea chrom
switch (pu.chromaFormat)
{
case CHROMA_422: //overwrite filter coefficient values for 422
#if !JVET_Q0500_CCLM_REF_PADDING
c0_2tap = 1, c1_2tap = 0, offset_2tap = 0, shift_2tap = 0; //sum = 1
#endif
c0_3tap = 2, c1_3tap = 1, c2_3tap = 1, offset_3tap = 2, shift_3tap = 2; //sum = 4
c0_5tap = 0, c1_5tap = 1, c2_5tap = 0, c3_5tap = 0, c4_5tap = 0, offset_5tap = 0, shift_5tap = 0; //sum = 1
c0_6tap = 2, c1_6tap = 1, c2_6tap = 1, c3_6tap = 0, c4_6tap = 0, c5_6tap = 0, offset_6tap = 2, shift_6tap = 2; //sum = 4
break;
case CHROMA_444: //overwrite filter coefficient values for 422
#if !JVET_Q0500_CCLM_REF_PADDING
c0_2tap = 1, c1_2tap = 0, offset_2tap = 0, shift_2tap = 0; //sum = 1
#endif
c0_3tap = 1, c1_3tap = 0, c2_3tap = 0, offset_3tap = 0, shift_3tap = 0; //sum = 1
c0_5tap = 0, c1_5tap = 1, c2_5tap = 0, c3_5tap = 0, c4_5tap = 0, offset_5tap = 0, shift_5tap = 0; //sum = 1
c0_6tap = 1, c1_6tap = 0, c2_6tap = 0, c3_6tap = 0, c4_6tap = 0, c5_6tap = 0, offset_6tap = 0, shift_6tap = 0; //sum = 1
......@@ -1448,7 +1453,11 @@ void IntraPrediction::xGetLumaRecPixels(const PredictionUnit &pu, CompArea chrom
if ((i == 0 && !bLeftAvaillable) || (i == uiCWidth + addedAboveRight - 1 + logSubWidthC))
{
#if JVET_Q0500_CCLM_REF_PADDING
pDst[i] = (piSrc[mult * i] * c0_3tap + piSrc[mult * i] * c1_3tap + piSrc[mult * i + 1] * c2_3tap + offset_3tap) >> shift_3tap;
#else
pDst[i] = piSrc[mult * i];
#endif
}
else
{
......@@ -1461,7 +1470,14 @@ void IntraPrediction::xGetLumaRecPixels(const PredictionUnit &pu, CompArea chrom
if ((i == 0 && !bLeftAvaillable) || (i == uiCWidth + addedAboveRight - 1 + logSubWidthC))
{
#if JVET_Q0500_CCLM_REF_PADDING
pDst[i] = (piSrc[mult * i - strOffset] * c0_5tap
+ piSrc[mult * i] * c1_5tap + piSrc[mult * i] * c2_5tap + piSrc[mult * i + 1] * c3_5tap
+ piSrc[mult * i + strOffset] * c4_5tap
+ offset_5tap) >> shift_5tap;
#else
pDst[i] = (piSrc[mult * i] * c0_3tap + piSrc[mult * i - strOffset] * c1_3tap + piSrc[mult * i + strOffset] * c2_3tap + offset_3tap) >> shift_3tap;
#endif
}
else
{
......@@ -1477,7 +1493,13 @@ void IntraPrediction::xGetLumaRecPixels(const PredictionUnit &pu, CompArea chrom
if ((i == 0 && !bLeftAvaillable) || (i == uiCWidth + addedAboveRight - 1 + logSubWidthC))
{
#if JVET_Q0500_CCLM_REF_PADDING
pDst[i] = ((piSrc[mult * i] * c0_6tap + piSrc[mult * i] * c1_6tap + piSrc[mult * i + 1] * c2_6tap)
+ (piSrc[mult * i + strOffset] * c3_6tap + piSrc[mult * i + strOffset] * c4_6tap + piSrc[mult * i + 1 + strOffset] * c5_6tap)
+ offset_6tap) >> shift_6tap;
#else
pDst[i] = (piSrc[mult * i] * c0_2tap + piSrc[mult * i + strOffset] * c1_2tap + offset_2tap) >> shift_2tap;
#endif
}
else
{
......@@ -1507,7 +1529,14 @@ void IntraPrediction::xGetLumaRecPixels(const PredictionUnit &pu, CompArea chrom
{
if ((j == 0 && !bAboveAvaillable) || (j == uiCHeight + addedLeftBelow - 1 + logSubWidthC))
{
#if JVET_Q0500_CCLM_REF_PADDING
pDst[0] = ( piSrc[1 ] * c0_5tap
+ piSrc[1 ] * c1_5tap + piSrc[0] * c2_5tap + piSrc[2] * c3_5tap
+ piSrc[1 + strOffset] * c4_5tap
+ offset_5tap ) >> shift_5tap;
#else
pDst[0] = ( piSrc[1] * c0_3tap + piSrc[0] * c1_3tap + piSrc[2] * c2_3tap + offset_3tap) >> shift_3tap;
#endif
}
else
{
......@@ -1540,16 +1569,37 @@ void IntraPrediction::xGetLumaRecPixels(const PredictionUnit &pu, CompArea chrom
{
if ( j == 0 && !bAboveAvaillable )
{
#if JVET_Q0500_CCLM_REF_PADDING
pDst0[i] = (pRecSrc0[mult * i] * c0_5tap
+ pRecSrc0[mult * i] * c1_5tap + pRecSrc0[mult * i] * c2_5tap + pRecSrc0[mult * i + 1] * c3_5tap
+ pRecSrc0[mult * i + strOffset] * c4_5tap
+ offset_5tap) >> shift_5tap;
#else
pDst0[i] = pRecSrc0[mult * i];
#endif
}
else
{
#if JVET_Q0500_CCLM_REF_PADDING
pDst0[i] = (pRecSrc0[mult * i - strOffset] * c0_5tap
+ pRecSrc0[mult * i] * c1_5tap + pRecSrc0[mult * i] * c2_5tap + pRecSrc0[mult * i + 1] * c3_5tap
+ pRecSrc0[mult * i + strOffset] * c4_5tap
+ offset_5tap) >> shift_5tap;
#else
pDst0[i] = (pRecSrc0[mult * i] * c0_3tap + pRecSrc0[mult * i - strOffset] * c1_3tap + pRecSrc0[mult * i + strOffset] * c2_3tap + offset_3tap) >> shift_3tap;
#endif
}
}
else if ( j == 0 && !bAboveAvaillable )
{
#if JVET_Q0500_CCLM_REF_PADDING
pDst0[i] = (pRecSrc0[mult * i] * c0_5tap
+ pRecSrc0[mult * i] * c1_5tap + pRecSrc0[mult * i - 1] * c2_5tap + pRecSrc0[mult * i + 1] * c3_5tap
+ pRecSrc0[mult * i + strOffset] * c4_5tap
+ offset_5tap) >> shift_5tap;
#else
pDst0[i] = (pRecSrc0[mult * i] * c0_3tap + pRecSrc0[mult * i - 1] * c1_3tap + pRecSrc0[mult * i + 1] * c2_3tap + offset_3tap) >> shift_3tap;
#endif
}
else
{
......@@ -1564,7 +1614,21 @@ void IntraPrediction::xGetLumaRecPixels(const PredictionUnit &pu, CompArea chrom
if ((i == 0 && !bLeftAvaillable) || (i == uiCWidth - 1 + logSubWidthC))
{
#if JVET_Q0500_CCLM_REF_PADDING
int s = offset_6tap;
s += pRecSrc0[mult * i] * c0_6tap;
s += pRecSrc0[mult * i + 1] * c1_6tap;
s += pRecSrc0[mult * i] * c2_6tap;
if (pu.chromaFormat == CHROMA_420)
{
s += pRecSrc0[mult * i + strOffset] * c3_6tap;
s += pRecSrc0[mult * i + 1 + strOffset] * c4_6tap;
s += pRecSrc0[mult * i + strOffset] * c5_6tap;
}
pDst0[i] = s >> shift_6tap;
#else
pDst0[i] = (pRecSrc0[mult * i] * c0_2tap + pRecSrc0[mult * i + strOffset] * c1_2tap + offset_2tap) >> shift_2tap;
#endif
}
else
{
......
......@@ -1227,8 +1227,13 @@ void LoopFilter::xEdgeFilterChroma(const CodingUnit& cu, const DeblockEdgeDir ed
const TransformUnit& tuQ = *cuQ.cs->getTU(posQ, cuQ.chType);
const TransformUnit& tuP = *cuP.cs->getTU(posP, cuP.chType);
#if JVET_Q0820_ACT
const QpParam cQP(tuP, ComponentID(chromaIdx + 1), -MAX_INT, false);
const QpParam cQQ(tuQ, ComponentID(chromaIdx + 1), -MAX_INT, false);
#else
const QpParam cQP(tuP, ComponentID(chromaIdx + 1));
const QpParam cQQ(tuQ, ComponentID(chromaIdx + 1));
#endif
const int qpBdOffset = tuP.cs->sps->getQpBDOffset(toChannelType(ComponentID(chromaIdx + 1)));
int baseQp_P = cQP.Qp(0) - qpBdOffset;
int baseQp_Q = cQQ.Qp(0) - qpBdOffset;
......
......@@ -729,7 +729,7 @@ void Picture::rescalePicture( const std::pair<int, int> scalingRatio,
beforeScale, scalingWindowBefore.getWindowLeftOffset(), scalingWindowBefore.getWindowTopOffset(),
afterScale, scalingWindowAfter.getWindowLeftOffset(), scalingWindowAfter.getWindowTopOffset(),
#endif
bitDepths.recon[comp], downsampling || useLumaFilter ? true : isLuma( compID ), downsampling,
bitDepths.recon[toChannelType(compID)], downsampling || useLumaFilter ? true : isLuma( compID ), downsampling,
isLuma( compID ) ? 1 : horCollocatedChromaFlag, isLuma( compID ) ? 1 : verCollocatedChromaFlag );
}
}
......
......@@ -70,6 +70,9 @@ QpParam::QpParam(const int qpy,
const ChromaFormat chFmt,
const int dqp
, const SPS *sps
#if JVET_Q0820_ACT
, const bool applyACTQpoffset
#endif
)
{
int baseQp;
......@@ -84,6 +87,12 @@ QpParam::QpParam(const int qpy,
baseQp = Clip3(-qpBdOffset, MAX_QP, baseQp + chromaQPOffset) + qpBdOffset;
}
#if JVET_Q0820_ACT
if (applyACTQpoffset)
{
baseQp += DELTA_QP_ACT[compID];
}
#endif
baseQp = Clip3( 0, MAX_QP+qpBdOffset, baseQp + dqp );
Qps[0] =baseQp;
......@@ -98,7 +107,11 @@ QpParam::QpParam(const int qpy,
rems[1] = baseQpTS % 6;
}
#if JVET_Q0820_ACT
QpParam::QpParam(const TransformUnit& tu, const ComponentID &compIDX, const int QP /*= -MAX_INT*/, const bool allowACTQpoffset /*= true*/)
#else
QpParam::QpParam(const TransformUnit& tu, const ComponentID &compIDX, const int QP /*= -MAX_INT*/)
#endif
{
int chromaQpOffset = 0;
ComponentID compID = MAP_CHROMA(compIDX);
......@@ -116,7 +129,12 @@ QpParam::QpParam(const TransformUnit& tu, const ComponentID &compIDX, const int
int dqp = 0;
const bool useJQP = isChroma(compID) && (abs(TU::getICTMode(tu)) == 2);
#if JVET_Q0820_ACT
bool applyACTQpoffset = tu.cu->colorTransform && allowACTQpoffset;
*this = QpParam(QP <= -MAX_INT ? tu.cu->qp : QP, useJQP ? JOINT_CbCr : compID, tu.cs->sps->getQpBDOffset(toChannelType(compID)), tu.cs->sps->getMinQpPrimeTsMinus4(toChannelType(compID)), chromaQpOffset, tu.chromaFormat, dqp, tu.cs->sps, applyACTQpoffset);
#else
*this = QpParam(QP <= -MAX_INT ? tu.cu->qp : QP, useJQP ? JOINT_CbCr : compID, tu.cs->sps->getQpBDOffset(toChannelType(compID)), tu.cs->sps->getMinQpPrimeTsMinus4(toChannelType(compID)), chromaQpOffset, tu.chromaFormat, dqp, tu.cs->sps);
#endif
}
......@@ -365,7 +383,12 @@ void Quant::dequant(const TransformUnit &tu,
const bool isTransformSkip = (tu.mtsIdx[compID] == MTS_SKIP);
const bool disableSMForLFNST = tu.cs->picHeader->getScalingListPresentFlag() ? tu.cs->picHeader->getScalingListAPS()->getScalingList().getDisableScalingMatrixForLfnstBlks() : false;
#if JVET_Q0784_LFNST_COMBINATION
const bool isLfnstApplied = tu.cu->lfnstIdx > 0 && (tu.cu->isSepTree() ? true : isLuma(compID));
const bool enableScalingLists = getUseScalingList(uiWidth, uiHeight, isTransformSkip, isLfnstApplied, disableSMForLFNST);
#else
const bool enableScalingLists = getUseScalingList(uiWidth, uiHeight, isTransformSkip, tu.cu->lfnstIdx > 0, disableSMForLFNST);
#endif
const int scalingListType = getScalingListType(tu.cu->predMode, compID);
const int channelBitDepth = sps->getBitDepth(toChannelType(compID));
......@@ -967,7 +990,12 @@ void Quant::quant(TransformUnit &tu, const ComponentID &compID, const CCoeffBuf
int *piQuantCoeff = getQuantCoeff(scalingListType, cQP.rem(useTransformSkip), uiLog2TrWidth, uiLog2TrHeight);
const bool disableSMForLFNST = tu.cs->picHeader->getScalingListPresentFlag() ? tu.cs->picHeader->getScalingListAPS()->getScalingList().getDisableScalingMatrixForLfnstBlks() : false;
#if JVET_Q0784_LFNST_COMBINATION
const bool isLfnstApplied = tu.cu->lfnstIdx > 0 && (tu.cu->isSepTree() ? true : isLuma(compID));
const bool enableScalingLists = getUseScalingList(uiWidth, uiHeight, useTransformSkip, isLfnstApplied, disableSMForLFNST);
#else
const bool enableScalingLists = getUseScalingList(uiWidth, uiHeight, useTransformSkip, tu.cu->lfnstIdx > 0, disableSMForLFNST);
#endif
// for blocks that where width*height != 4^N, the effective scaling applied during transformation cannot be
// compensated by a bit-shift (the quantised result will be sqrt(2) * larger than required).
......@@ -1041,7 +1069,12 @@ bool Quant::xNeedRDOQ(TransformUnit &tu, const ComponentID &compID, const CCoeff
int *piQuantCoeff = getQuantCoeff(scalingListType, cQP.rem(useTransformSkip), uiLog2TrWidth, uiLog2TrHeight);
const bool disableSMForLFNST = tu.cs->picHeader->getScalingListPresentFlag() ? tu.cs->picHeader->getScalingListAPS()->getScalingList().getDisableScalingMatrixForLfnstBlks() : false;
#if JVET_Q0784_LFNST_COMBINATION
const bool isLfnstApplied = tu.cu->lfnstIdx > 0 && (tu.cu->isSepTree() ? true : isLuma(compID));
const bool enableScalingLists = getUseScalingList(uiWidth, uiHeight, (useTransformSkip != 0), isLfnstApplied, disableSMForLFNST);
#else
const bool enableScalingLists = getUseScalingList(uiWidth, uiHeight, (useTransformSkip != 0), tu.cu->lfnstIdx > 0, disableSMForLFNST);
#endif
/* for 422 chroma blocks, the effective scaling applied during transformation is not a power of 2, hence it cannot be
* implemented as a bit-shift (the quantised result will be sqrt(2) * larger than required). Alternatively, adjust the
......@@ -1091,7 +1124,12 @@ void Quant::transformSkipQuantOneSample(TransformUnit &tu, const ComponentID &co
const int iTransformShift = getTransformShift(channelBitDepth, rect.size(), maxLog2TrDynamicRange);
const int scalingListType = getScalingListType(tu.cu->predMode, compID);
const bool disableSMForLFNST = tu.cs->picHeader->getScalingListPresentFlag() ? tu.cs->picHeader->getScalingListAPS()->getScalingList().getDisableScalingMatrixForLfnstBlks() : false;
#if JVET_Q0784_LFNST_COMBINATION
const bool isLfnstApplied = tu.cu->lfnstIdx > 0 && (tu.cu->isSepTree() ? true : isLuma(compID));
const bool enableScalingLists = getUseScalingList(uiWidth, uiHeight, true, isLfnstApplied, disableSMForLFNST);
#else
const bool enableScalingLists = getUseScalingList(uiWidth, uiHeight, true, tu.cu->lfnstIdx > 0, disableSMForLFNST);
#endif
const bool useTransformSkip = (tu.mtsIdx[compID] == MTS_SKIP);
const int defaultQuantisationCoefficient = g_quantScales[0][cQP.rem(useTransformSkip)];
......@@ -1150,8 +1188,12 @@ void Quant::invTrSkipDeQuantOneSample(TransformUnit &tu, const ComponentID &comp
const int iTransformShift = getTransformShift(channelBitDepth, rect.size(), maxLog2TrDynamicRange);
const int scalingListType = getScalingListType(tu.cu->predMode, compID);
const bool disableSMForLFNST = tu.cs->picHeader->getScalingListPresentFlag() ? tu.cs->picHeader->getScalingListAPS()->getScalingList().getDisableScalingMatrixForLfnstBlks() : false;
#if JVET_Q0784_LFNST_COMBINATION
const bool isLfnstApplied = tu.cu->lfnstIdx > 0 && (tu.cu->isSepTree() ? true : isLuma(compID));
const bool enableScalingLists = getUseScalingList(uiWidth, uiHeight, true, isLfnstApplied, disableSMForLFNST);
#else
const bool enableScalingLists = getUseScalingList(uiWidth, uiHeight, true, tu.cu->lfnstIdx > 0, disableSMForLFNST);
#endif
CHECK(scalingListType >= SCALING_LIST_NUM, "Invalid scaling list");
const bool isTransformSkip = (tu.mtsIdx[compID] == MTS_SKIP);
......@@ -1231,7 +1273,11 @@ void Quant::lambdaAdjustColorTrans(bool forward)
for (uint8_t component = 0; component < MAX_NUM_COMPONENT; component++)
{
ComponentID compID = (ComponentID)component;
#if JVET_Q0820_ACT
int delta_QP = DELTA_QP_ACT[compID];
#else
int delta_QP = (compID == COMPONENT_Cr ? DELTA_QP_FOR_Co : DELTA_QP_FOR_Y_Cg);
#endif
double lamdbaAdjustRate = pow(2.0, delta_QP / 3.0);
m_lambdasStore[0][component] = m_lambdas[component];
......