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 (30)
Showing
with 267 additions and 18 deletions
......@@ -111,6 +111,7 @@ LMCSSignalType : 0 # Input signal type: 0:SDR, 1:HDR-PQ, 2:HD
LMCSUpdateCtrl : 1 # LMCS model update control: 0:RA, 1:AI, 2:LDB/LDP
MIP : 1
JointCbCr : 1 # joint coding of chroma residuals (if available): 0: disable, 1: enable
ChromaTS : 1
# Fast tools
PBIntraFast : 1
......
......@@ -133,6 +133,7 @@ MIP : 1
JointCbCr : 1 # joint coding of chroma residuals (if available): 0: disable, 1: enable
PROF : 1
PPSorSliceMode : 3
ChromaTS : 1
# Fast tools
PBIntraFast : 1
......
......@@ -137,6 +137,7 @@ MIP : 1
JointCbCr : 1 # joint coding of chroma residuals (if available): 0: disable, 1: enable
PROF : 1
PPSorSliceMode : 2
ChromaTS : 1
# Fast tools
PBIntraFast : 1
......
......@@ -165,6 +165,7 @@ AMaxBT : 1
FastMIP : 0
FastLFNST : 0
FastLocalDualTreeMode : 1
ChromaTS : 1
# Encoder optimization tools
AffineAmvrEncOpt : 1
......
......@@ -1342,6 +1342,12 @@ candidate is not evaluated if the merge skip mode was the best merge
mode for one of the previous candidates.
\\
\Option{SBT64RDO} &
%\ShortOption{\None} &
\Default{true} &
Enables or disables the use of more than 32 SBT in encoder RDO check. When enabled, more than 32 size SBT is checked in the RDO.
\\
\Option{RDpenalty} &
%\ShortOption{\None} &
\Default{0} &
......@@ -2214,6 +2220,16 @@ luma TUs are also skipped.
This option has no effect if TransformSkip is disabled.
\\
\Option{ChromaTS} &
%\ShortOption{\None} &
\Default{false} &
Enables or disables reduced testing of the transform-skipping mode
decision for chroma TUs. When disabled, no RDO search is performed for
chroma TUs.
\par
This option has no effect if TransformSkip is disabled.
\\
\Option{UseNonLinearAlfLuma} &
%\ShortOption{\None} &
\Default{true} &
......
......@@ -457,7 +457,7 @@ void DecApp::xWriteOutput( PicList* pcListPic, uint32_t tId )
if (!m_reconFileName.empty())
{
const Window &conf = pcPic->cs->pps->getConformanceWindow();
const Window &conf = pcPic->getConformanceWindow();
const SPS* sps = pcPic->cs->sps;
ChromaFormat chromaFormatIDC = sps->getChromaFormatIdc();
if( m_upscaledOutput )
......@@ -581,7 +581,7 @@ void DecApp::xFlushOutput( PicList* pcListPic )
if (!m_reconFileName.empty())
{
const Window &conf = pcPic->cs->pps->getConformanceWindow();
const Window &conf = pcPic->getConformanceWindow();
const SPS* sps = pcPic->cs->sps;
ChromaFormat chromaFormatIDC = sps->getChromaFormatIdc();
if( m_upscaledOutput )
......
......@@ -285,6 +285,9 @@ void EncApp::xInitLibCfg()
#endif
m_cEncLib.setImplicitMTS ( m_MTSImplicit );
m_cEncLib.setUseSBT ( m_SBT );
#if JVET_P0983_REMOVE_SPS_SBT_MAX_SIZE_FLAG
m_cEncLib.setUse64SBTRDOCheck (m_SBT64RDOCheck);
#endif
m_cEncLib.setUseCompositeRef ( m_compositeRefEnabled );
m_cEncLib.setUseSMVD ( m_SMVD );
m_cEncLib.setUseGBi ( m_GBi );
......@@ -367,6 +370,9 @@ void EncApp::xInitLibCfg()
m_cEncLib.setLog2SaoOffsetScale ( CHANNEL_TYPE_CHROMA, m_log2SaoOffsetScale[CHANNEL_TYPE_CHROMA] );
m_cEncLib.setUseTransformSkip ( m_useTransformSkip );
m_cEncLib.setUseTransformSkipFast ( m_useTransformSkipFast );
#if JVET_P0058_CHROMA_TS
m_cEncLib.setUseChromaTS ( m_useChromaTS && m_useTransformSkip);
#endif
m_cEncLib.setUseBDPCM ( m_useBDPCM );
m_cEncLib.setTransformSkipRotationEnabledFlag ( m_transformSkipRotationEnabledFlag );
m_cEncLib.setTransformSkipContextEnabledFlag ( m_transformSkipContextEnabledFlag );
......
......@@ -943,6 +943,9 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
("MTSInterMaxCand", m_MTSInterMaxCand, 4, "Number of additional candidates to test in encoder search for MTS in inter slices\n")
("MTSImplicit", m_MTSImplicit, 0, "Enable implicit MTS (when explicit MTS is off)\n")
( "SBT", m_SBT, false, "Enable Sub-Block Transform for inter blocks\n" )
#if JVET_P0983_REMOVE_SPS_SBT_MAX_SIZE_FLAG
("SBT64RDO", m_SBT64RDOCheck, (m_iSourceWidth >= 1920 ? true : false ), "Enable more than 32 SBT in encoder RDO check \n")
#endif
( "ISP", m_ISP, false, "Enable Intra Sub-Partitions\n" )
("SMVD", m_SMVD, false, "Enable Symmetric MVD\n")
("CompositeLTReference", m_compositeRefEnabled, false, "Enable Composite Long Term Reference Frame")
......@@ -1131,6 +1134,9 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
("TransformSkip", m_useTransformSkip, false, "Intra transform skipping")
("TransformSkipFast", m_useTransformSkipFast, false, "Fast encoder search for transform skipping, winner takes it all mode.")
("TransformSkipLog2MaxSize", m_log2MaxTransformSkipBlockSize, 5U, "Specify transform-skip maximum size. Minimum 2, Maximum 5. (not valid in V1 profiles)")
#if JVET_P0058_CHROMA_TS
("ChromaTS", m_useChromaTS, false, "Enable encoder search of chromaTS")
#endif
("BDPCM", m_useBDPCM, false, "BDPCM")
("ISPFast", m_useFastISP, false, "Fast encoder search for ISP")
("ImplicitResidualDPCM", m_rdpcmEnabledFlag[RDPCM_SIGNAL_IMPLICIT], false, "Enable implicitly signalled residual DPCM for intra (also known as sample-adaptive intra predict) (not valid in V1 profiles)")
......@@ -3583,6 +3589,9 @@ void EncAppCfg::xPrintParameter()
msg( VERBOSE, "TransformSkip:%d ", m_useTransformSkip );
msg( VERBOSE, "TransformSkipFast:%d ", m_useTransformSkipFast );
msg( VERBOSE, "TransformSkipLog2MaxSize:%d ", m_log2MaxTransformSkipBlockSize);
#if JVET_P0058_CHROMA_TS
msg(VERBOSE, "ChromaTS:%d ", m_useChromaTS);
#endif
msg( VERBOSE, "BDPCM:%d ", m_useBDPCM );
msg( VERBOSE, "Slice: M=%d ", int(m_sliceMode));
if (m_sliceMode!=NO_SLICES)
......
......@@ -280,7 +280,9 @@ protected:
int m_MTSInterMaxCand; ///< XZ: Number of additional candidates to test
int m_MTSImplicit;
bool m_SBT; ///< Sub-Block Transform for inter blocks
#if JVET_P0983_REMOVE_SPS_SBT_MAX_SIZE_FLAG
bool m_SBT64RDOCheck;
#endif
bool m_SMVD;
bool m_compositeRefEnabled;
bool m_GBi;
......@@ -303,6 +305,9 @@ protected:
int m_MmvdDisNum;
unsigned m_PLTMode;
bool m_JointCbCrMode;
#if JVET_P0058_CHROMA_TS
bool m_useChromaTS;
#endif
unsigned m_IBCMode;
unsigned m_IBCLocalSearchRangeX;
unsigned m_IBCLocalSearchRangeY;
......
......@@ -190,9 +190,25 @@ void CodingStructure::setDecomp(const UnitArea &_area, const bool _isCoded /*= t
const int CodingStructure::signalModeCons( const PartSplit split, Partitioner &partitioner, const ModeType modeTypeParent ) const
{
if( CS::isDualITree( *this ) || modeTypeParent != MODE_TYPE_ALL || partitioner.currArea().chromaFormat == CHROMA_444 )
#if JVET_P0406_YUV_FMT_GENERALIZATION_LDT
if (CS::isDualITree(*this) || modeTypeParent != MODE_TYPE_ALL || partitioner.currArea().chromaFormat == CHROMA_444 || partitioner.currArea().chromaFormat == CHROMA_400 )
#else
if (CS::isDualITree(*this) || modeTypeParent != MODE_TYPE_ALL || partitioner.currArea().chromaFormat == CHROMA_444 )
#endif
return LDT_MODE_TYPE_INHERIT;
#if JVET_P0406_YUV_FMT_GENERALIZATION_LDT
int minLumaArea = partitioner.currArea().lumaSize().area();
if (split == CU_QUAD_SPLIT || split == CU_TRIH_SPLIT || split == CU_TRIV_SPLIT) // the area is split into 3 or 4 parts
{
minLumaArea = minLumaArea >> 2;
}
else if (split == CU_VERT_SPLIT || split == CU_HORZ_SPLIT) // the area is split into 2 parts
{
minLumaArea = minLumaArea >> 1;
}
int minChromaBlock = minLumaArea >> (getChannelTypeScaleX(CHANNEL_TYPE_CHROMA, partitioner.currArea().chromaFormat) + getChannelTypeScaleY(CHANNEL_TYPE_CHROMA, partitioner.currArea().chromaFormat));
return minChromaBlock >= 16 ? LDT_MODE_TYPE_INHERIT : ((minLumaArea < 32) || slice->isIntra()) ? LDT_MODE_TYPE_INFER : LDT_MODE_TYPE_SIGNAL;
#else
int width = partitioner.currArea().lwidth();
int height = partitioner.currArea().lheight();
......@@ -214,6 +230,7 @@ const int CodingStructure::signalModeCons( const PartSplit split, Partitioner &p
{
return LDT_MODE_TYPE_INHERIT;
}
#endif
}
void CodingStructure::clearCuPuTuIdxMap( const UnitArea &_area, uint32_t numCu, uint32_t numPu, uint32_t numTu, uint32_t* pOffset )
......
......@@ -68,7 +68,11 @@ CoeffCodingContext::CoeffCodingContext( const TransformUnit& tu, ComponentID com
, m_lastOffsetY (0)
, m_lastShiftX (0)
, m_lastShiftY (0)
#if JVET_P0058_CHROMA_TS
, m_TrafoBypass (tu.cs->sps->getSpsRangeExtension().getTransformSkipContextEnabledFlag() && (tu.cu->transQuantBypass || tu.mtsIdx[m_compID] == MTS_SKIP))
#else
, m_TrafoBypass (tu.cs->sps->getSpsRangeExtension().getTransformSkipContextEnabledFlag() && (tu.cu->transQuantBypass || tu.mtsIdx==MTS_SKIP))
#endif
, m_scanPosLast (-1)
, m_subSetId (-1)
, m_subSetPos (-1)
......
......@@ -321,6 +321,23 @@ const CtxSet ContextSetCfg::CclmModeFlag = ContextSetCfg::addCtxSet
{ 4, },
});
#if JVET_P0615_CHROMAMODE_CLEANUP
const CtxSet ContextSetCfg::CclmModeIdx = ContextSetCfg::addCtxSet
({
{ 27, },
{ 27, },
{ 27, },
{ 9, },
});
const CtxSet ContextSetCfg::IntraChromaPredMode = ContextSetCfg::addCtxSet
({
{ 25, },
{ 18, },
{ 34, },
{ 5, },
});
#else
const CtxSet ContextSetCfg::IntraChromaPredMode = ContextSetCfg::addCtxSet
({
{ 25, },
......@@ -328,6 +345,7 @@ const CtxSet ContextSetCfg::IntraChromaPredMode = ContextSetCfg::addCtxSet
{ 19, },
{ 6, },
});
#endif
const CtxSet ContextSetCfg::MipFlag = ContextSetCfg::addCtxSet
({
......@@ -717,10 +735,17 @@ const CtxSet ContextSetCfg::RdpcmDir = ContextSetCfg::addCtxSet
const CtxSet ContextSetCfg::MTSIndex = ContextSetCfg::addCtxSet
({
#if JVET_P0058_CHROMA_TS
{ 29, CNU, CNU, CNU, CNU, CNU, 33, 18, 27, 0, CNU, CNU },
{ 29, CNU, CNU, CNU, CNU, CNU, 18, 33, 27, 0, CNU, CNU },
{ 20, CNU, CNU, CNU, CNU, CNU, 33, 0, 42, 0, CNU, CNU },
{ 8, DWS, DWS, DWS, DWS, DWS, 1, 0, 9, 0, DWS, 1 },
#else
{ 29, CNU, CNU, CNU, CNU, CNU, 33, 18, 27, 0, CNU, },
{ 29, CNU, CNU, CNU, CNU, CNU, 18, 33, 27, 0, CNU, },
{ 20, CNU, CNU, CNU, CNU, CNU, 33, 0, 42, 0, CNU, },
{ 8, DWS, DWS, DWS, DWS, DWS, 1, 0, 9, 0, DWS, },
#endif
});
const CtxSet ContextSetCfg::ISPMode = ContextSetCfg::addCtxSet
......
......@@ -208,6 +208,9 @@ public:
static const CtxSet IntraLumaMpmFlag;
static const CtxSet IntraLumaPlanarFlag;
static const CtxSet CclmModeFlag;
#if JVET_P0615_CHROMAMODE_CLEANUP
static const CtxSet CclmModeIdx;
#endif
static const CtxSet IntraChromaPredMode;
static const CtxSet MipFlag;
static const CtxSet DeltaQP;
......
......@@ -667,7 +667,12 @@ namespace DQIntern
{
CHECKD( lambda <= 0.0, "Lambda must be greater than 0" );
#if JVET_P0058_CHROMA_TS
const int qpDQ = cQP.Qp(tu.mtsIdx[compID] == MTS_SKIP) + 1;
#else
const int qpDQ = cQP.Qp(tu.mtsIdx==MTS_SKIP && isLuma(compID)) + 1;
#endif
const int qpPer = qpDQ / 6;
const int qpRem = qpDQ - 6 * qpPer;
const SPS& sps = *tu.cs->sps;
......@@ -676,7 +681,11 @@ namespace DQIntern
const int channelBitDepth = sps.getBitDepth( chType );
const int maxLog2TrDynamicRange = sps.getMaxLog2TrDynamicRange( chType );
const int nomTransformShift = getTransformShift( channelBitDepth, area.size(), maxLog2TrDynamicRange );
#if JVET_P0058_CHROMA_TS
const bool clipTransformShift = ( tu.mtsIdx[compID] == MTS_SKIP && sps.getSpsRangeExtension().getExtendedPrecisionProcessingFlag());
#else
const bool clipTransformShift = ( tu.mtsIdx==MTS_SKIP && sps.getSpsRangeExtension().getExtendedPrecisionProcessingFlag() );
#endif
const bool needsSqrt2ScaleAdjustment = TU::needsSqrt2Scale(tu, compID);
const int transformShift = ( clipTransformShift ? std::max<int>( 0, nomTransformShift ) : nomTransformShift ) + (needsSqrt2ScaleAdjustment?-1:0);
// quant parameters
......@@ -732,7 +741,11 @@ namespace DQIntern
}
//----- set dequant parameters -----
#if JVET_P0058_CHROMA_TS
const int qpDQ = cQP.Qp(tu.mtsIdx[compID] == MTS_SKIP) + 1;
#else
const int qpDQ = cQP.Qp(tu.mtsIdx==MTS_SKIP && isLuma(compID)) + 1;
#endif
const int qpPer = qpDQ / 6;
const int qpRem = qpDQ - 6 * qpPer;
const SPS& sps = *tu.cs->sps;
......@@ -742,7 +755,11 @@ namespace DQIntern
const TCoeff minTCoeff = -( 1 << maxLog2TrDynamicRange );
const TCoeff maxTCoeff = ( 1 << maxLog2TrDynamicRange ) - 1;
const int nomTransformShift = getTransformShift( channelBitDepth, area.size(), maxLog2TrDynamicRange );
#if JVET_P0058_CHROMA_TS
const bool clipTransformShift = ( tu.mtsIdx[compID] == MTS_SKIP && sps.getSpsRangeExtension().getExtendedPrecisionProcessingFlag());
#else
const bool clipTransformShift = ( tu.mtsIdx==MTS_SKIP && sps.getSpsRangeExtension().getExtendedPrecisionProcessingFlag() );
#endif
const bool needsSqrt2ScaleAdjustment = TU::needsSqrt2Scale(tu, compID);
const int transformShift = ( clipTransformShift ? std::max<int>( 0, nomTransformShift ) : nomTransformShift ) + (needsSqrt2ScaleAdjustment?-1:0);
Intermediate_Int shift = IQUANT_SHIFT + 1 - qpPer - transformShift + (enableScalingLists ? LOG2_SCALING_LIST_NEUTRAL_VALUE : 0);
......@@ -1469,7 +1486,11 @@ namespace DQIntern
bool zeroOut = false;
bool zeroOutforThres = false;
int effWidth = tuPars.m_width, effHeight = tuPars.m_height;
#if JVET_P0058_CHROMA_TS
if( ( tu.mtsIdx[compID] > MTS_SKIP || (tu.cs->sps->getUseMTS() && tu.cu->sbtInfo != 0 && tuPars.m_height <= 32 && tuPars.m_width <= 32)) && !tu.cu->transQuantBypass && compID == COMPONENT_Y)
#else
if( ( tu.mtsIdx > MTS_SKIP || ( tu.cs->sps->getUseMTS() && tu.cu->sbtInfo != 0 && tuPars.m_height <= 32 && tuPars.m_width <= 32 ) ) && !tu.cu->transQuantBypass && compID == COMPONENT_Y )
#endif
{
effHeight = (tuPars.m_height == 32) ? 16 : tuPars.m_height;
effWidth = (tuPars.m_width == 32) ? 16 : tuPars.m_width;
......@@ -1478,7 +1499,11 @@ namespace DQIntern
zeroOutforThres = zeroOut || (32 < tuPars.m_height || 32 < tuPars.m_width);
//===== find first test position =====
int firstTestPos = numCoeff - 1;
#if JVET_P0058_CHROMA_TS
if (lfnstIdx > 0 && tu.mtsIdx[compID] != MTS_SKIP && width >= 4 && height >= 4)
#else
if( lfnstIdx > 0 && tu.mtsIdx != MTS_SKIP && width >= 4 && height >= 4 )
#endif
{
firstTestPos = ( ( width == 4 && height == 4 ) || ( width == 8 && height == 8 ) ) ? 7 : 15 ;
}
......@@ -1583,10 +1608,18 @@ DepQuant::~DepQuant()
void DepQuant::quant( TransformUnit &tu, const ComponentID &compID, const CCoeffBuf &pSrc, TCoeff &uiAbsSum, const QpParam &cQP, const Ctx& ctx )
{
if( tu.cs->slice->getDepQuantEnabledFlag() && (tu.mtsIdx != MTS_SKIP || !isLuma(compID)) )
#if JVET_P0058_CHROMA_TS
if ( tu.cs->slice->getDepQuantEnabledFlag() && (tu.mtsIdx[compID] != MTS_SKIP) )
#else
if ( tu.cs->slice->getDepQuantEnabledFlag() && (tu.mtsIdx != MTS_SKIP || !isLuma(compID)) )
#endif
{
//===== scaling matrix ====
#if JVET_P0058_CHROMA_TS
const int qpDQ = cQP.Qp(tu.mtsIdx[compID] == MTS_SKIP) + 1;
#else
const int qpDQ = cQP.Qp(tu.mtsIdx==MTS_SKIP && isLuma(compID)) + 1;
#endif
const int qpPer = qpDQ / 6;
const int qpRem = qpDQ - 6 * qpPer;
const CompArea &rect = tu.blocks[compID];
......@@ -1596,7 +1629,11 @@ void DepQuant::quant( TransformUnit &tu, const ComponentID &compID, const CCoeff
CHECK(scalingListType >= SCALING_LIST_NUM, "Invalid scaling list");
const uint32_t log2TrWidth = floorLog2(width);
const uint32_t log2TrHeight = floorLog2(height);
#if JVET_P0058_CHROMA_TS
const bool enableScalingLists = getUseScalingList(width, height, (tu.mtsIdx[compID] == MTS_SKIP));
#else
const bool enableScalingLists = getUseScalingList(width, height, (tu.mtsIdx == MTS_SKIP && isLuma(compID)));
#endif
static_cast<DQIntern::DepQuant*>(p)->quant( tu, pSrc, compID, cQP, Quant::m_dLambda, ctx, uiAbsSum, enableScalingLists, Quant::getQuantCoeff(scalingListType, qpRem, log2TrWidth, log2TrHeight) );
}
else
......@@ -1607,9 +1644,17 @@ void DepQuant::quant( TransformUnit &tu, const ComponentID &compID, const CCoeff
void DepQuant::dequant( const TransformUnit &tu, CoeffBuf &dstCoeff, const ComponentID &compID, const QpParam &cQP )
{
#if JVET_P0058_CHROMA_TS
if( tu.cs->slice->getDepQuantEnabledFlag() && (tu.mtsIdx[compID] != MTS_SKIP))
#else
if( tu.cs->slice->getDepQuantEnabledFlag() && (tu.mtsIdx != MTS_SKIP || !isLuma(compID)) )
#endif
{
#if JVET_P0058_CHROMA_TS
const int qpDQ = cQP.Qp(tu.mtsIdx[compID] == MTS_SKIP) + 1;
#else
const int qpDQ = cQP.Qp(tu.mtsIdx==MTS_SKIP && isLuma(compID)) + 1;
#endif
const int qpPer = qpDQ / 6;
const int qpRem = qpDQ - 6 * qpPer;
const CompArea &rect = tu.blocks[compID];
......@@ -1619,8 +1664,11 @@ void DepQuant::dequant( const TransformUnit &tu, CoeffBuf &dstCoeff, const Compo
CHECK(scalingListType >= SCALING_LIST_NUM, "Invalid scaling list");
const uint32_t log2TrWidth = floorLog2(width);
const uint32_t log2TrHeight = floorLog2(height);
#if JVET_P0058_CHROMA_TS
const bool enableScalingLists = getUseScalingList(width, height, (tu.mtsIdx[compID] == MTS_SKIP));
#else
const bool enableScalingLists = getUseScalingList(width, height, (tu.mtsIdx == MTS_SKIP && isLuma(compID)));
#endif
static_cast<DQIntern::DepQuant*>(p)->dequant( tu, dstCoeff, compID, cQP, enableScalingLists, Quant::getDequantCoeff(scalingListType, qpRem, log2TrWidth, log2TrHeight) );
}
else
......
......@@ -860,7 +860,7 @@ void InterPrediction::xPredAffineBlk( const ComponentID& compID, const Predictio
enablePROF &= !subblkMVSpreadOverLimit;
const int profThres = 1 << (iBit + (m_isBi ? 1 : 0));
enablePROF &= !m_encOnly || pu.cu->slice->getCheckLDC() || iDMvHorX > profThres || iDMvHorY > profThres || iDMvVerX > profThres || iDMvVerY > profThres || iDMvHorX < -profThres || iDMvHorY < -profThres || iDMvVerX < -profThres || iDMvVerY < -profThres;
enablePROF &= pu.cs->pps->getPicWidthInLumaSamples() == refPic->cs->pps->getPicWidthInLumaSamples() && pu.cs->pps->getPicHeightInLumaSamples() == refPic->cs->pps->getPicHeightInLumaSamples();
enablePROF &= pu.cs->pps->getPicWidthInLumaSamples() == refPic->getPicWidthInLumaSamples() && pu.cs->pps->getPicHeightInLumaSamples() == refPic->getPicHeightInLumaSamples();
if (compID == COMPONENT_Y)
{
......@@ -1643,6 +1643,7 @@ void InterPrediction::motionCompensation( PredictionUnit &pu, PelUnitBuf &predBu
bioApplied = false;
}
}
bioApplied = PU::isRefPicSameSize( pu ) ? bioApplied : false;
bool dmvrApplied = false;
dmvrApplied = (pu.mvRefine) && PU::checkDMVRCondition(pu);
if ((pu.lumaSize().width > MAX_BDOF_APPLICATION_REGION || pu.lumaSize().height > MAX_BDOF_APPLICATION_REGION) && pu.mergeType != MRG_TYPE_SUBPU_ATMVP && (bioApplied && !dmvrApplied))
......@@ -2358,8 +2359,8 @@ bool InterPrediction::xPredInterBlkRPR( const std::pair<int, int>& scalingRatio,
if( scaled )
{
int row, col;
int refPicWidth = refPic->cs->pps->getPicWidthInLumaSamples();
int refPicHeight = refPic->cs->pps->getPicHeightInLumaSamples();
int refPicWidth = refPic->getPicWidthInLumaSamples();
int refPicHeight = refPic->getPicHeightInLumaSamples();
#if JVET_P0088_P0353_RPR_FILTERS
int xFilter = filterIndex;
......@@ -2407,10 +2408,10 @@ bool InterPrediction::xPredInterBlkRPR( const std::pair<int, int>& scalingRatio,
int vFilterSize = isLuma( compID ) ? NTAPS_LUMA : NTAPS_CHROMA;
int yInt0 = ( (int32_t)y0Int + offY ) >> posShift;
yInt0 = std::min( std::max( -4, yInt0 ), ( refPicHeight >> ::getComponentScaleY( compID, chFmt ) ) + 4 );
yInt0 = std::min( std::max( -(NTAPS_LUMA / 2), yInt0 ), ( refPicHeight >> ::getComponentScaleY( compID, chFmt ) ) + (NTAPS_LUMA / 2) );
int xInt0 = ( (int32_t)x0Int + offX ) >> posShift;
xInt0 = std::min( std::max( -4, xInt0 ), ( refPicWidth >> ::getComponentScaleX( compID, chFmt ) ) + 4 );
xInt0 = std::min( std::max( -(NTAPS_LUMA / 2), xInt0 ), ( refPicWidth >> ::getComponentScaleX( compID, chFmt ) ) + (NTAPS_LUMA / 2) );
int refHeight = ((((int32_t)y0Int + (height-1) * stepY) + offY ) >> posShift) - ((((int32_t)y0Int + 0 * stepY) + offY ) >> posShift) + 1;
......@@ -2428,7 +2429,7 @@ bool InterPrediction::xPredInterBlkRPR( const std::pair<int, int>& scalingRatio,
{
int posX = (int32_t)x0Int + col * stepX;
xInt = ( posX + offX ) >> posShift;
xInt = std::min( std::max( 0, xInt ), ( refPicWidth >> ::getComponentScaleX( compID, chFmt ) ) );
xInt = std::min( std::max( -(NTAPS_LUMA / 2), xInt ), ( refPicWidth >> ::getComponentScaleX( compID, chFmt ) ) + (NTAPS_LUMA / 2) );
int xFrac = ( ( posX + offX ) >> ( posShift - shiftHor ) ) & ( ( 1 << shiftHor ) - 1 );
CHECK( xInt0 > xInt, "Wrong horizontal starting point" );
......@@ -2448,7 +2449,7 @@ bool InterPrediction::xPredInterBlkRPR( const std::pair<int, int>& scalingRatio,
{
int posY = (int32_t)y0Int + row * stepY;
yInt = ( posY + offY ) >> posShift;
yInt = std::min( std::max( 0, yInt ), ( refPicHeight >> ::getComponentScaleY( compID, chFmt ) ) );
yInt = std::min( std::max( -(NTAPS_LUMA / 2), yInt ), ( refPicHeight >> ::getComponentScaleY( compID, chFmt ) ) + (NTAPS_LUMA / 2) );
int yFrac = ( ( posY + offY ) >> ( posShift - shiftVer ) ) & ( ( 1 << shiftVer ) - 1 );
CHECK( yInt0 > yInt, "Wrong vertical starting point" );
......
......@@ -864,33 +864,64 @@ void InterpolationFilter::xWeightedTriangleBlk( const PredictionUnit &pu, const
const int32_t offsetDefault = (1<<(shiftDefault-1)) + IF_INTERNAL_OFFS;
const int32_t shiftWeighted = std::max<int>(2, (IF_INTERNAL_PREC - clipbd)) + log2WeightBase;
const int32_t offsetWeighted = (1 << (shiftWeighted - 1)) + (IF_INTERNAL_OFFS << log2WeightBase);
#if JVET_P0530_TPM_WEIGHT_ALIGN
int32_t stepX = 1 << getComponentScaleX(compIdx, pu.chromaFormat);
int32_t stepY = 1 << getComponentScaleY(compIdx, pu.chromaFormat);
int32_t widthY = width << getComponentScaleX(compIdx, pu.chromaFormat);
int32_t heightY = height << getComponentScaleY(compIdx, pu.chromaFormat);
int32_t ratioWH = (widthY > heightY) ? (widthY / heightY) : 1;
int32_t ratioHW = (widthY > heightY) ? 1 : (heightY / widthY);
int32_t weightedLength = 7;
int32_t weightedStartPos = (splitDir == 0) ? (0 - (weightedLength >> 1) * ratioWH) : (widthY - ((weightedLength + 1) >> 1) * ratioWH);
#else
const int32_t ratioWH = (width > height) ? (width / height) : 1;
const int32_t ratioHW = (width > height) ? 1 : (height / width);
const bool longWeight = (compIdx == COMPONENT_Y);
const int32_t weightedLength = longWeight ? 7 : 3;
int32_t weightedStartPos = ( splitDir == 0 ) ? ( 0 - (weightedLength >> 1) * ratioWH ) : ( width - ((weightedLength + 1) >> 1) * ratioWH );
#endif
int32_t weightedEndPos = weightedStartPos + weightedLength * ratioWH - 1;
int32_t weightedPosoffset = ( splitDir == 0 ) ? ratioWH : -ratioWH;
Pel tmpPelWeighted;
int32_t weightIdx;
int32_t x, y, tmpX, tmpY, tmpWeightedStart, tmpWeightedEnd;
#if JVET_P0530_TPM_WEIGHT_ALIGN
for (y = 0; y < heightY; y += ratioHW)
{
if (y % stepY != 0)
{
weightedStartPos += weightedPosoffset;
weightedEndPos += weightedPosoffset;
continue;
}
for (tmpY = ratioHW; tmpY > 0; tmpY -= stepY)
{
for (x = 0; x < weightedStartPos; x += stepX)
{
#else
for( y = 0; y < height; y+= ratioHW )
{
for( tmpY = ratioHW; tmpY > 0; tmpY-- )
{
for( x = 0; x < weightedStartPos; x++ )
{
#endif
*dst++ = ClipPel( rightShift( (splitDir == 0 ? *src1 : *src0) + offsetDefault, shiftDefault), clipRng );
src0++;
src1++;
}
tmpWeightedStart = std::max((int32_t)0, weightedStartPos);
#if JVET_P0530_TPM_WEIGHT_ALIGN
tmpWeightedEnd = std::min(weightedEndPos, (int32_t)(widthY - 1));
#else
tmpWeightedEnd = std::min(weightedEndPos, (int32_t)(width - 1));
#endif
weightIdx = 1;
if( weightedStartPos < 0 )
{
......@@ -898,17 +929,35 @@ void InterpolationFilter::xWeightedTriangleBlk( const PredictionUnit &pu, const
}
for( x = tmpWeightedStart; x <= tmpWeightedEnd; x+= ratioWH )
{
#if JVET_P0530_TPM_WEIGHT_ALIGN
if (x % stepX != 0)
{
weightIdx++;
continue;
}
for (tmpX = ratioWH; tmpX > 0; tmpX -= stepX)
{
tmpPelWeighted = Clip3(1, 7, weightIdx);
#else
for( tmpX = ratioWH; tmpX > 0; tmpX-- )
{
tmpPelWeighted = Clip3( 1, 7, longWeight ? weightIdx : (weightIdx * 2));
#endif
tmpPelWeighted = splitDir ? ( 8 - tmpPelWeighted ) : tmpPelWeighted;
*dst++ = ClipPel( rightShift( (tmpPelWeighted*(*src0++) + ((8 - tmpPelWeighted) * (*src1++)) + offsetWeighted), shiftWeighted ), clipRng );
}
weightIdx ++;
}
#if JVET_P0530_TPM_WEIGHT_ALIGN
int32_t start = ((weightedEndPos + 1) % stepX != 0) ? (weightedEndPos + 2) : (weightedEndPos + 1);
for (x = start; x < widthY; x += stepX)
{
#else
for( x = weightedEndPos + 1; x < width; x++ )
{
#endif
*dst++ = ClipPel( rightShift( (splitDir == 0 ? *src0 : *src1) + offsetDefault, shiftDefault ), clipRng );
src0++;
src1++;
......
......@@ -806,10 +806,10 @@ Picture::Picture()
void Picture::create(const ChromaFormat &_chromaFormat, const Size &size, const unsigned _maxCUSize, const unsigned _margin, const bool _decoder)
{
UnitArea::operator=( UnitArea( _chromaFormat, Area( Position{ 0, 0 }, size ) ) );
margin = _margin;
margin = MAX_SCALING_RATIO*_margin;
const Area a = Area( Position(), size );
M_BUFS( 0, PIC_RECONSTRUCTION ).create( _chromaFormat, a, _maxCUSize, _margin, MEMORY_ALIGN_DEF_SIZE );
M_BUFS( 0, PIC_RECON_WRAP ).create( _chromaFormat, a, _maxCUSize, _margin, MEMORY_ALIGN_DEF_SIZE );
M_BUFS( 0, PIC_RECONSTRUCTION ).create( _chromaFormat, a, _maxCUSize, margin, MEMORY_ALIGN_DEF_SIZE );
M_BUFS( 0, PIC_RECON_WRAP ).create( _chromaFormat, a, _maxCUSize, margin, MEMORY_ALIGN_DEF_SIZE );
if( !_decoder )
{
......
......@@ -296,6 +296,19 @@ public:
std::deque<Slice*> slices;
SEIMessages SEIs;
uint32_t m_picWidthInLumaSamples;
uint32_t m_picHeightInLumaSamples;
Window m_conformanceWindow;
void setPicWidthInLumaSamples( uint32_t u ) { m_picWidthInLumaSamples = u; }
uint32_t getPicWidthInLumaSamples() const { return m_picWidthInLumaSamples; }
void setPicHeightInLumaSamples( uint32_t u ) { m_picHeightInLumaSamples = u; }
uint32_t getPicHeightInLumaSamples() const { return m_picHeightInLumaSamples; }
Window& getConformanceWindow() { return m_conformanceWindow; }
const Window& getConformanceWindow() const { return m_conformanceWindow; }
void setConformanceWindow( Window& conformanceWindow ) { m_conformanceWindow = conformanceWindow; }
void allocateNewSlice();
Slice *swapSliceObject(Slice * p, uint32_t i);
void clearSliceBuffer();
......
......@@ -369,7 +369,11 @@ void Quant::dequant(const TransformUnit &tu,
const int maxLog2TrDynamicRange = sps->getMaxLog2TrDynamicRange(toChannelType(compID));
const TCoeff transformMinimum = -(1 << maxLog2TrDynamicRange);
const TCoeff transformMaximum = (1 << maxLog2TrDynamicRange) - 1;
#if JVET_P0058_CHROMA_TS
const bool isTransformSkip = (tu.mtsIdx[compID] == MTS_SKIP);
#else
const bool isTransformSkip = tu.mtsIdx==MTS_SKIP && isLuma(compID);
#endif
const bool enableScalingLists = getUseScalingList(uiWidth, uiHeight, isTransformSkip);
const int scalingListType = getScalingListType(tu.cu->predMode, compID);
const int channelBitDepth = sps->getBitDepth(toChannelType(compID));
......@@ -389,7 +393,11 @@ void Quant::dequant(const TransformUnit &tu,
CHECK(uiWidth > m_uiMaxTrSize, "Unsupported transformation size");
// Represents scaling through forward transform
#if JVET_P0058_CHROMA_TS
const bool bClipTransformShiftTo0 = tu.mtsIdx[compID] != MTS_SKIP && sps->getSpsRangeExtension().getExtendedPrecisionProcessingFlag();
#else
const bool bClipTransformShiftTo0 = tu.mtsIdx!=MTS_SKIP && sps->getSpsRangeExtension().getExtendedPrecisionProcessingFlag();
#endif
const int originalTransformShift = getTransformShift(channelBitDepth, area.size(), maxLog2TrDynamicRange);
const bool needSqrtAdjustment = TU::needsBlockSizeTrafoScale( tu, compID );
const int iTransformShift = (bClipTransformShiftTo0 ? std::max<int>(0, originalTransformShift) : originalTransformShift) + (needSqrtAdjustment?-1:0);
......@@ -932,7 +940,11 @@ void Quant::quant(TransformUnit &tu, const ComponentID &compID, const CCoeffBuf
const CCoeffBuf &piCoef = pSrc;
CoeffBuf piQCoef = tu.getCoeffs(compID);
#if JVET_P0058_CHROMA_TS
const bool useTransformSkip = (tu.mtsIdx[compID] == MTS_SKIP);
#else
const bool useTransformSkip = tu.mtsIdx==MTS_SKIP && isLuma(compID);
#endif
const int maxLog2TrDynamicRange = sps.getMaxLog2TrDynamicRange(toChannelType(compID));
{
......@@ -1012,7 +1024,11 @@ bool Quant::xNeedRDOQ(TransformUnit &tu, const ComponentID &compID, const CCoeff
const CCoeffBuf piCoef = pSrc;
#if JVET_P0058_CHROMA_TS
const bool useTransformSkip = (tu.mtsIdx[compID] == MTS_SKIP);
#else
const bool useTransformSkip = tu.mtsIdx == MTS_SKIP && isLuma(compID);
#endif
const int maxLog2TrDynamicRange = sps.getMaxLog2TrDynamicRange(toChannelType(compID));
int scalingListType = getScalingListType(tu.cu->predMode, compID);
......@@ -1072,7 +1088,11 @@ 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 enableScalingLists = getUseScalingList(uiWidth, uiHeight, true);
#if JVET_P0058_CHROMA_TS
const bool useTransformSkip = (tu.mtsIdx[compID] == MTS_SKIP);
#else
const bool useTransformSkip = tu.mtsIdx == MTS_SKIP && isLuma(compID);
#endif
const int defaultQuantisationCoefficient = g_quantScales[0][cQP.rem(useTransformSkip)];
CHECK( scalingListType >= SCALING_LIST_NUM, "Invalid scaling list" );
......@@ -1124,8 +1144,13 @@ void Quant::invTrSkipDeQuantOneSample(TransformUnit &tu, const ComponentID &comp
const CompArea &rect = tu.blocks[compID];
const uint32_t uiWidth = rect.width;
const uint32_t uiHeight = rect.height;
#if JVET_P0058_CHROMA_TS
const int QP_per = cQP.per(tu.mtsIdx[compID] == MTS_SKIP);
const int QP_rem = cQP.rem(tu.mtsIdx[compID] == MTS_SKIP);
#else
const int QP_per = cQP.per(tu.mtsIdx==MTS_SKIP && isLuma(compID));
const int QP_rem = cQP.rem(tu.mtsIdx==MTS_SKIP && isLuma(compID));
#endif
const int maxLog2TrDynamicRange = sps.getMaxLog2TrDynamicRange(toChannelType(compID));
const int channelBitDepth = sps.getBitDepth(toChannelType(compID));
const int iTransformShift = getTransformShift(channelBitDepth, rect.size(), maxLog2TrDynamicRange);
......
......@@ -520,7 +520,11 @@ void QuantRDOQ::quant(TransformUnit &tu, const ComponentID &compID, const CCoeff
const CCoeffBuf &piCoef = pSrc;
CoeffBuf piQCoef = tu.getCoeffs(compID);
#if JVET_P0058_CHROMA_TS
const bool useTransformSkip = (tu.mtsIdx[compID] == MTS_SKIP);
#else
const bool useTransformSkip = tu.mtsIdx==MTS_SKIP && isLuma(compID);
#endif
bool useRDOQ = useTransformSkip ? m_useRDOQTS : m_useRDOQ;
......@@ -536,7 +540,11 @@ void QuantRDOQ::quant(TransformUnit &tu, const ComponentID &compID, const CCoeff
if (!m_useSelectiveRDOQ || xNeedRDOQ(tu, compID, piCoef, cQP))
{
#endif
#if JVET_P0058_CHROMA_TS
if( useTransformSkip )
#else
if( isLuma( compID ) && useTransformSkip )
#endif
{
if( tu.cu->bdpcmMode && isLuma(compID) )
{
......@@ -592,7 +600,11 @@ void QuantRDOQ::xRateDistOptQuant(TransformUnit &tu, const ComponentID &compID,
// Represents scaling through forward transform
int iTransformShift = getTransformShift(channelBitDepth, rect.size(), maxLog2TrDynamicRange);
#if JVET_P0058_CHROMA_TS
if (tu.mtsIdx[compID] == MTS_SKIP && extendedPrecision)
#else
if (tu.mtsIdx==MTS_SKIP && extendedPrecision)
#endif
{
iTransformShift = std::max<int>(0, iTransformShift);
}
......@@ -629,7 +641,11 @@ void QuantRDOQ::xRateDistOptQuant(TransformUnit &tu, const ComponentID &compID,
const bool needSqrtAdjustment= TU::needsBlockSizeTrafoScale( tu, compID );
#if JVET_P0058_CHROMA_TS
const bool isTransformSkip = (tu.mtsIdx[compID] == MTS_SKIP);
#else
const bool isTransformSkip = tu.mtsIdx==MTS_SKIP && isLuma(compID);
#endif
const double *const pdErrScale = xGetErrScaleCoeffSL(scalingListType, uiLog2BlockWidth, uiLog2BlockHeight, cQP.rem(isTransformSkip));
const int *const piQCoef = getQuantCoeff(scalingListType, cQP.rem(isTransformSkip), uiLog2BlockWidth, uiLog2BlockHeight);
const bool enableScalingLists = getUseScalingList(uiWidth, uiHeight, isTransformSkip);
......@@ -1220,7 +1236,11 @@ void QuantRDOQ::xRateDistOptQuantTS( TransformUnit &tu, const ComponentID &compI
m_bdpcm = 0;
const bool needsSqrt2Scale = TU::needsSqrt2Scale( tu, compID ); // should always be false - transform-skipped blocks don't require sqrt(2) compensation.
#if JVET_P0058_CHROMA_TS
const bool isTransformSkip = (tu.mtsIdx[compID] == MTS_SKIP);
#else
const bool isTransformSkip = tu.mtsIdx==MTS_SKIP && isLuma(compID);
#endif
const int qBits = QUANT_SHIFT + qp.per(isTransformSkip) + transformShift + ( needsSqrt2Scale ? -1 : 0 ); // Right shift of non-RDOQ quantizer; level = (coeff*uiQ + offset)>>q_bits
const int quantisationCoefficient = g_quantScales[needsSqrt2Scale?1:0][qp.rem(isTransformSkip)];
const double errorScale = xGetErrScaleCoeff( TU::needsSqrt2Scale( tu, compID ), width, height, qp.rem(isTransformSkip), maxLog2TrDynamicRange, channelBitDepth );
......@@ -1456,7 +1476,11 @@ void QuantRDOQ::forwardRDPCM( TransformUnit &tu, const ComponentID &compID, cons
m_bdpcm = dirMode;
const bool needsSqrt2Scale = TU::needsSqrt2Scale(tu, compID); // should always be false - transform-skipped blocks don't require sqrt(2) compensation.
#if JVET_P0058_CHROMA_TS
const bool isTransformSkip = (tu.mtsIdx[compID] == MTS_SKIP);
#else
const bool isTransformSkip = tu.mtsIdx==MTS_SKIP && isLuma(compID);
#endif
const int qBits = QUANT_SHIFT + qp.per(isTransformSkip) + transformShift + ( needsSqrt2Scale ? -1 : 0 ); // Right shift of non-RDOQ quantizer; level = (coeff*uiQ + offset)>>q_bits
const int quantisationCoefficient = g_quantScales[needsSqrt2Scale ? 1 : 0][qp.rem(isTransformSkip)];
const double errorScale = xGetErrScaleCoeff(TU::needsSqrt2Scale(tu, compID), width, height, qp.rem(isTransformSkip), maxLog2TrDynamicRange, channelBitDepth);
......