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 (83)
Showing
with 1 addition and 664 deletions
No preview for this file type
......@@ -205,7 +205,7 @@ fontsize=\footnotesize}
\maketitle
\begin{abstract}
This document is a user manual describing usage of the VTM reference software
for the VVC project. It applies to version 10.0 of the software.
for the VVC project. It applies to version 10.1 of the software.
\end{abstract}
\tableofcontents
......
......@@ -46,11 +46,7 @@
#include "EncoderLib/AnnexBwrite.h"
BitstreamExtractorApp::BitstreamExtractorApp()
#if JVET_S0154_R0068_ASPECT5
:m_vpsId(-1)
#else
:m_vpsId(0)
#endif
, m_removeTimingSEI (false)
{
......@@ -176,7 +172,6 @@ bool BitstreamExtractorApp::xCheckSliceSubpicture(InputNALUnit &nalu, int target
}
#endif
#if JVET_S0154_R0068_ASPECT5
bool BitstreamExtractorApp::xCheckSeiSubpicture(SEIMessages SEIs, int targetSubPicId, bool &rmAllFillerInSubpicExt, bool lastSliceWritten, bool isVclNalUnitRemoved)
{
bool isWriteSeiNalUnitToStream = true;
......@@ -247,7 +242,6 @@ bool BitstreamExtractorApp::xCheckSeiSubpicture(SEIMessages SEIs, int targetSubP
return isWriteSeiNalUnitToStream;
}
#endif
void BitstreamExtractorApp::xRewriteSPS (SPS &targetSPS, const SPS &sourceSPS, SubPic &subPic)
{
......@@ -261,7 +255,6 @@ void BitstreamExtractorApp::xRewriteSPS (SPS &targetSPS, const SPS &sourceSPS, S
targetSPS.setMaxPicWidthInLumaSamples(subPic.getSubPicWidthInLumaSample());
targetSPS.setMaxPicHeightInLumaSamples(subPic.getSubPicHeightInLumaSample());
#if JVET_R0093_SUBPICS_AND_CONF_WINDOW
// Set the new conformance window
Window& conf = targetSPS.getConformanceWindow();
int subpicConfWinLeftOffset = (subPic.getSubPicCtuTopLeftX() == 0) ? conf.getWindowLeftOffset() : 0;
......@@ -274,25 +267,16 @@ void BitstreamExtractorApp::xRewriteSPS (SPS &targetSPS, const SPS &sourceSPS, S
conf.setWindowRightOffset(subpicConfWinRightOffset);
conf.setWindowTopOffset(subpicConfWinTopOffset);
conf.setWindowBottomOffset(subpicConfWinBottomOffset);
#endif
}
#if JVET_S0154_R0068_ASPECT5
void BitstreamExtractorApp::xRewritePPS(PPS &targetPPS, const PPS &sourcePPS, const SPS &sourceSPS, SubPic &subPic)
#else
void BitstreamExtractorApp::xRewritePPS (PPS &targetPPS, const PPS &sourcePPS, SubPic &subPic)
#endif
{
targetPPS = sourcePPS;
// set number of subpictures to 1
targetPPS.setNumSubPics(1);
// set taget subpicture ID as first ID
#if JVET_S0154_R0068_ASPECT5
targetPPS.setSubPicId(0, subPic.getSubPicID());
#else
targetPPS.setSubPicId(0, m_subPicId);
#endif
// we send the ID in the SPS, so don't sent it in the PPS (hard coded decision)
targetPPS.setSubPicIdMappingInPpsFlag(false);
// picture size
......@@ -300,7 +284,6 @@ void BitstreamExtractorApp::xRewritePPS (PPS &targetPPS, const PPS &sourcePPS, S
targetPPS.setPicHeightInLumaSamples(subPic.getSubPicHeightInLumaSample());
// todo: Conformance window
#if JVET_S0154_R0068_ASPECT5
int subWidthC = SPS::getWinUnitX(sourceSPS.getChromaFormatIdc());
int subHeightC = SPS::getWinUnitY(sourceSPS.getChromaFormatIdc());
int subpicScalWinLeftOffset = sourcePPS.getScalingWindow().getWindowLeftOffset() - (int)subPic.getSubPicCtuTopLeftX() * sourceSPS.getCTUSize() / subWidthC;
......@@ -312,7 +295,6 @@ void BitstreamExtractorApp::xRewritePPS (PPS &targetPPS, const PPS &sourcePPS, S
Window scalingWindow;
scalingWindow.setWindow(subpicScalWinLeftOffset, subpicScalWinRightOffset, subpicScalWinTopOffset, subpicScalWinBotOffset);
targetPPS.setScalingWindow(scalingWindow);
#endif
// Tiles
int numTileCols = 1;
......@@ -448,22 +430,8 @@ void BitstreamExtractorApp::xWriteVPS(VPS *vps, std::ostream& out, int layerId,
m_hlSyntaxWriter.setBitstream( &naluOut.m_Bitstream );
m_hlSyntaxWriter.codeVPS( vps );
#if JVET_R0294_SUBPIC_HASH
NALUnitEBSP naluWithHeader(naluOut);
writeAnnexBNalUnit(out, naluWithHeader, true);
#else
// create a dummy AU
AccessUnit tmpAu;
// convert to EBSP (this adds emulation prevention!) and add into NAL unit
tmpAu.push_back(new NALUnitEBSP(naluOut));
// write the dummy AU
// note: The first NAL unit in an access unit will be written with a 4-byte start code
// Parameter sets are also coded with a 4-byte start code, so writing the dummy
// AU works without chaning the start code length.
// This cannot be done for VLC NAL units!
writeAnnexB (out, tmpAu);
#endif
}
void BitstreamExtractorApp::xWriteSPS(SPS *sps, std::ostream& out, int layerId, int temporalId)
......@@ -476,22 +444,8 @@ void BitstreamExtractorApp::xWriteSPS(SPS *sps, std::ostream& out, int layerId,
m_hlSyntaxWriter.setBitstream( &naluOut.m_Bitstream );
m_hlSyntaxWriter.codeSPS( sps );
#if JVET_R0294_SUBPIC_HASH
NALUnitEBSP naluWithHeader(naluOut);
writeAnnexBNalUnit(out, naluWithHeader, true);
#else
// create a dummy AU
AccessUnit tmpAu;
// convert to EBSP (this adds emulation prevention!) and add into NAL unit
tmpAu.push_back(new NALUnitEBSP(naluOut));
// write the dummy AU
// note: The first NAL unit in an access unit will be written with a 4-byte start code
// Parameter sets are also coded with a 4-byte start code, so writing the dummy
// AU works without chaning the start code length.
// This cannot be done for VLC NAL units!
writeAnnexB (out, tmpAu);
#endif
}
void BitstreamExtractorApp::xWritePPS(PPS *pps, std::ostream& out, int layerId, int temporalId)
......@@ -503,22 +457,8 @@ void BitstreamExtractorApp::xWritePPS(PPS *pps, std::ostream& out, int layerId,
m_hlSyntaxWriter.setBitstream( &naluOut.m_Bitstream );
m_hlSyntaxWriter.codePPS( pps );
#if JVET_R0294_SUBPIC_HASH
NALUnitEBSP naluWithHeader(naluOut);
writeAnnexBNalUnit(out, naluWithHeader, true);
#else
// create a dummy AU
AccessUnit tmpAu;
// convert to EBSP (this adds emulation prevention!) and add into NAL unit
tmpAu.push_back(new NALUnitEBSP(naluOut));
// write the dummy AU
// note: The first NAL unit in an access unit will be written with a 4-byte start code
// Parameter sets are also coded with a 4-byte start code, so writing the dummy
// AU works without chaning the start code length.
// This cannot be done for VLC NAL units!
writeAnnexB (out, tmpAu);
#endif
}
// returns true, if the NAL unit is to be discarded
......@@ -538,7 +478,6 @@ bool BitstreamExtractorApp::xCheckNumSubLayers(InputNALUnit &nalu, VPS *vps)
return retval;
}
#if JVET_R0294_SUBPIC_HASH
bool BitstreamExtractorApp::xCheckSEIsSubPicture(SEIMessages& SEIs, InputNALUnit& nalu, std::ostream& out, int subpicId)
{
SEIMessages scalableNestingSEIs = getSeisByType(SEIs, SEI::SCALABLE_NESTING);
......@@ -554,11 +493,7 @@ bool BitstreamExtractorApp::xCheckSEIsSubPicture(SEIMessages& SEIs, InputNALUnit
// does not apply to a subpicture -> remove
return false;
}
#if JVET_S0154_R0068_ASPECT5
if (std::find(sei->m_snSubpicId.begin(), sei->m_snSubpicId.end(), subpicId) != sei->m_snSubpicId.end())
#else
if (std::find(sei->m_snSubpicId.begin(), sei->m_snSubpicId.end(), m_subPicId) != sei->m_snSubpicId.end())
#endif
{
// applies to target subpicture -> extract
OutputNALUnit outNalu( nalu.m_nalUnitType, nalu.m_nuhLayerId, nalu.m_temporalId );
......@@ -582,9 +517,7 @@ bool BitstreamExtractorApp::xCheckSEIsSubPicture(SEIMessages& SEIs, InputNALUnit
// keep all other SEIs
return true;
}
#endif
#if JVET_S0158_SUB_BITSTREAM_EXT
bool BitstreamExtractorApp::xCheckScalableNestingSEI(SEIScalableNesting *seiNesting, InputNALUnit& nalu, VPS *vps)
{
int nestingLayerId;
......@@ -619,7 +552,6 @@ bool BitstreamExtractorApp::xCheckScalableNestingSEI(SEIScalableNesting *seiNest
return nestingAppliedInTargetOlsLayerId;
}
#endif
uint32_t BitstreamExtractorApp::decode()
{
......@@ -643,7 +575,6 @@ uint32_t BitstreamExtractorApp::decode()
std::vector<uint8_t> empty;
m_parameterSetManager.storeVPS(vpsIdZero, empty);
#if JVET_S0154_R0068_ASPECT5
int subpicIdTarget[MAX_VPS_LAYERS];
for (int i = 0; i < MAX_VPS_LAYERS; i++)
{
......@@ -652,7 +583,6 @@ uint32_t BitstreamExtractorApp::decode()
bool isVclNalUnitRemoved[MAX_VPS_LAYERS] = { false };
bool isMultiSubpicLayer[MAX_VPS_LAYERS] = { false };
bool rmAllFillerInSubpicExt[MAX_VPS_LAYERS] = { false };
#endif
while (!!bitstreamFileIn)
{
......@@ -703,11 +633,7 @@ uint32_t BitstreamExtractorApp::decode()
}
VPS *vps = nullptr;
#if JVET_S0154_R0068_ASPECT5
if (m_targetOlsIdx >= 0 && m_vpsId >=0 )
#else
if (m_targetOlsIdx >= 0)
#endif
{
// if there is no VPS nal unit, there shall be one OLS and one layer.
if (m_vpsId == 0)
......@@ -725,9 +651,7 @@ uint32_t BitstreamExtractorApp::decode()
}
uint32_t numOlss = vps->getTotalNumOLSs();
CHECK(m_targetOlsIdx <0 || m_targetOlsIdx >= numOlss, "target Ols shall be in the range of OLSs specified by the VPS");
#if JVET_S0158_SUB_BITSTREAM_EXT
CHECK(m_maxTemporalLayer < -1 || m_maxTemporalLayer > vps->getPtlMaxTemporalId(vps->getOlsPtlIdx(m_targetOlsIdx)), "MaxTemporalLayer shall either be equal -1 (for diabled) or in the range of 0 to vps_ptl_max_tid[ vps_ols_ptl_idx[ targetOlsIdx ] ], inclusive");
#endif
std::vector<int> layerIdInOls = vps->getLayerIdsInOls(m_targetOlsIdx);
bool isIncludedInTargetOls = std::find(layerIdInOls.begin(), layerIdInOls.end(), nalu.m_nuhLayerId) != layerIdInOls.end();
writeInpuNalUnitToStream &= (isSpecialNalTypes || isIncludedInTargetOls);
......@@ -750,7 +674,6 @@ uint32_t BitstreamExtractorApp::decode()
// *** add modifications here ***
// only write, if not dropped earlier
// rewrite the SPS
#if JVET_S0154_R0068_ASPECT5
isMultiSubpicLayer[nalu.m_nuhLayerId] = sps->getNumSubPics() > 1 ? true : false;
if (isMultiSubpicLayer[nalu.m_nuhLayerId])
{
......@@ -762,14 +685,6 @@ uint32_t BitstreamExtractorApp::decode()
CHECK(!sps->getSubPicTreatedAsPicFlag(m_subPicIdx), "sps_subpic_treated_as_pic_flag[subpicIdxTarget] should be equal to 1 for subpicture extraction");
xSetSPSUpdated(sps->getSPSId());
writeInpuNalUnitToStream = false;
#else
if (m_subPicId >= 0)
{
// we generally don't write SPS to the bitstream unless referred to by PPS
// but remember that the SPS got updated
xSetSPSUpdated(sps->getSPSId());
writeInpuNalUnitToStream = false;
#endif
}
if (writeInpuNalUnitToStream)
{
......@@ -815,28 +730,11 @@ uint32_t BitstreamExtractorApp::decode()
pps->initRectSliceMap(sps);
pps->initSubPic(*sps);
xPrintSubPicInfo (pps);
#if JVET_S0154_R0068_ASPECT5
if (m_subPicIdx >= 0 && isMultiSubpicLayer[nalu.m_nuhLayerId] && writeInpuNalUnitToStream)
{
SubPic subPic;
subPic = pps->getSubPic(m_subPicIdx);
subpicIdTarget[nalu.m_nuhLayerId] = subPic.getSubPicID();
#else
if (m_subPicId >= 0)
{
SubPic subPic;
bool found = false;
for (int i=0; i< pps->getNumSubPics() && !found; i++)
{
subPic = pps->getSubPic(i);
if (subPic.getSubPicID() == m_subPicId)
{
found=true;
}
}
CHECK (!found, "Target subpicture not found");
#endif
// if the referred SPS was updated, modify and write it
if (xIsSPSUpdate(sps->getSPSId()))
......@@ -849,11 +747,7 @@ uint32_t BitstreamExtractorApp::decode()
// rewrite the PPS
PPS targetPPS;
#if JVET_S0154_R0068_ASPECT5
xRewritePPS(targetPPS, *pps, *sps, subPic);
#else
xRewritePPS(targetPPS, *pps, subPic);
#endif
xWritePPS(&targetPPS, bitstreamFileOut, nalu.m_nuhLayerId, nalu.m_temporalId);
writeInpuNalUnitToStream = false;
}
......@@ -887,29 +781,13 @@ uint32_t BitstreamExtractorApp::decode()
{
xReadPicHeader(nalu);
}
#if JVET_R0294_SUBPIC_HASH
if ( (nalu.m_nalUnitType == NAL_UNIT_PREFIX_SEI) || (nalu.m_nalUnitType == NAL_UNIT_SUFFIX_SEI))
{
#else
if (m_targetOlsIdx>=0)
{
#if JVET_S0154_R0068_ASPECT5
if (nalu.m_nalUnitType == NAL_UNIT_PREFIX_SEI || nalu.m_nalUnitType == NAL_UNIT_SUFFIX_SEI)
#else
if (nalu.m_nalUnitType == NAL_UNIT_PREFIX_SEI)
#endif
{
#endif
// decode SEI
SEIMessages SEIs;
#if !JVET_R0294_SUBPIC_HASH
HRD hrd;
m_seiReader.parseSEImessage(&(nalu.getBitstream()), SEIs, nalu.m_nalUnitType, nalu.m_nuhLayerId, nalu.m_temporalId, vps, m_parameterSetManager.getActiveSPS(), hrd, &std::cout);
#else
m_seiReader.parseSEImessage(&(nalu.getBitstream()), SEIs, nalu.m_nalUnitType, nalu.m_nuhLayerId, nalu.m_temporalId, vps, m_parameterSetManager.getActiveSPS(), m_hrd, &std::cout);
if (m_targetOlsIdx>=0)
{
#endif
for (auto sei : SEIs)
{
// remove unqualified scalable nesting SEI
......@@ -929,7 +807,6 @@ uint32_t BitstreamExtractorApp::decode()
}
writeInpuNalUnitToStream &= targetOlsIdxInNestingAppliedOls;
}
#if JVET_S0158_SUB_BITSTREAM_EXT
else
{
writeInpuNalUnitToStream &= xCheckScalableNestingSEI(seiNesting, nalu, vps);
......@@ -937,42 +814,25 @@ uint32_t BitstreamExtractorApp::decode()
}
// remove unqualified timing related SEI
if (sei->payloadType() == SEI::BUFFERING_PERIOD || (m_removeTimingSEI && sei->payloadType() == SEI::PICTURE_TIMING) || sei->payloadType() == SEI::DECODING_UNIT_INFO || sei->payloadType() == SEI::SUBPICTURE_LEVEL_INFO)
#else
if (sei->payloadType() == SEI::BUFFERING_PERIOD || (m_removeTimingSEI && sei->payloadType() == SEI::PICTURE_TIMING ) || sei->payloadType() == SEI::DECODING_UNIT_INFO)
#endif
{
bool targetOlsIdxGreaterThanZero = m_targetOlsIdx > 0;
writeInpuNalUnitToStream &= !targetOlsIdxGreaterThanZero;
}
}
#if !JVET_R0294_SUBPIC_HASH
}
#endif
#if JVET_S0154_R0068_ASPECT5
if (m_subPicIdx >= 0 && writeInpuNalUnitToStream)
{
writeInpuNalUnitToStream = xCheckSeiSubpicture(SEIs, subpicIdTarget[nalu.m_nuhLayerId], rmAllFillerInSubpicExt[nalu.m_nuhLayerId], lastSliceWritten, isVclNalUnitRemoved[nalu.m_nuhLayerId]);
}
#endif
if (m_vpsId == -1)
{
delete vps;
}
}
#if JVET_R0294_SUBPIC_HASH
#if JVET_S0154_R0068_ASPECT5
if (m_subPicIdx >= 0)
{
writeInpuNalUnitToStream &= xCheckSEIsSubPicture(SEIs, nalu, bitstreamFileOut, subpicIdTarget[nalu.m_nuhLayerId]);
}
#else
if (m_subPicId>=0)
{
writeInpuNalUnitToStream &= xCheckSEIsSubPicture(SEIs, nalu, bitstreamFileOut);
}
#endif
}
#endif
#if JVET_R0107_BITSTREAM_EXTACTION
Slice slice;
......@@ -981,7 +841,6 @@ uint32_t BitstreamExtractorApp::decode()
slice = xParseSliceHeader(nalu);
}
#endif
#if JVET_S0154_R0068_ASPECT5
if (m_subPicIdx >= 0 && isMultiSubpicLayer[nalu.m_nuhLayerId] && writeInpuNalUnitToStream)
{
if (nalu.isSlice())
......@@ -1001,24 +860,6 @@ uint32_t BitstreamExtractorApp::decode()
{
m_prevPicPOC = slice.getPOC();
}
#else
if (m_subPicId>=0)
{
if ( nalu.isSlice() )
{
// check for subpicture ID
#if JVET_R0107_BITSTREAM_EXTACTION
writeInpuNalUnitToStream = xCheckSliceSubpicture(slice, m_subPicId);
#else
writeInpuNalUnitToStream = xCheckSliceSubpicture(nalu, m_subPicId);
#endif
}
if (nalu.m_nalUnitType == NAL_UNIT_FD)
{
writeInpuNalUnitToStream = lastSliceWritten;
}
}
#endif
unitCnt++;
if( writeInpuNalUnitToStream )
......
......@@ -50,9 +50,7 @@
#include "VLCWriter.h"
#include "SEIread.h"
#if JVET_R0294_SUBPIC_HASH
#include "SEIwrite.h"
#endif
class BitstreamExtractorApp : public BitstreamExtractorAppCfg
{
......@@ -66,12 +64,8 @@ protected:
void xPrintVPSInfo (VPS *vps);
void xPrintSubPicInfo (PPS *pps);
void xRewriteSPS (SPS &targetSPS, const SPS &sourceSPS, SubPic &subPic);
#if JVET_S0154_R0068_ASPECT5
void xRewritePPS (PPS &targetPPS, const PPS &sourcePPS, const SPS &sourceSPS, SubPic &subPic);
bool xCheckSeiSubpicture(SEIMessages SEIs, int targetSubPicId, bool &rmAllFillerInSubpicExt, bool lastSliceWritten, bool isVclNalUnitRemoved);
#else
void xRewritePPS (PPS &targetPPS, const PPS &sourcePPS, SubPic &subPic);
#endif
#if JVET_R0107_BITSTREAM_EXTACTION
Slice xParseSliceHeader(InputNALUnit &nalu);
......@@ -80,16 +74,8 @@ protected:
bool xCheckSliceSubpicture(InputNALUnit &nalu, int subPicId);
#endif
void xReadPicHeader(InputNALUnit &nalu);
#if JVET_R0294_SUBPIC_HASH
#if JVET_S0154_R0068_ASPECT5
bool xCheckSEIsSubPicture(SEIMessages& SEIs, InputNALUnit& nalu, std::ostream& out, int subpicId);
#else
bool xCheckSEIsSubPicture(SEIMessages& SEIs, InputNALUnit& nalu, std::ostream& out);
#endif
#endif
#if JVET_S0158_SUB_BITSTREAM_EXT
bool xCheckScalableNestingSEI(SEIScalableNesting *seiNesting, InputNALUnit& nalu, VPS *vps);
#endif
void xSetSPSUpdated(int spsId) { return m_updatedSPSList.push_back(spsId); }
bool xIsSPSUpdate(int spsId) { return (std::find(m_updatedSPSList.begin(),m_updatedSPSList.end(), spsId) != m_updatedSPSList.end()); }
......@@ -105,10 +91,8 @@ protected:
HLSyntaxReader m_hlSynaxReader;
HLSWriter m_hlSyntaxWriter;
SEIReader m_seiReader;
#if JVET_R0294_SUBPIC_HASH
SEIWriter m_seiWriter;
HRD m_hrd;
#endif
int m_vpsId;
bool m_removeTimingSEI;
......
......@@ -72,11 +72,7 @@ namespace po = df::program_options_lite;
("BitstreamFileOut,o", m_bitstreamFileNameOut, string(""), "bitstream output file name")
("MaxTemporalLayer,t", m_maxTemporalLayer, -1, "Maximum Temporal Layer to be decoded. -1 to decode all layers")
("TargetOutputLayerSet,p", m_targetOlsIdx, -1, "Target output layer set index")
#if JVET_S0154_R0068_ASPECT5
("SubPicIdx,s", m_subPicIdx, -1, "Target subpic index for target output layers that containing multiple subpictures. -1 to decode all subpictures")
#else
("SubPicId,s", m_subPicId, -1, "Target subpic ID")
#endif
#if ENABLE_TRACING
("TraceChannelsList", printTracingChannelsList, false, "List all available tracing channels" )
......@@ -125,9 +121,6 @@ namespace po = df::program_options_lite;
}
}
#if !JVET_S0158_SUB_BITSTREAM_EXT
CHECK(m_maxTemporalLayer < -1 || m_maxTemporalLayer > 6, "MaxTemporalLayer shall either be equal -1 (for diabled) or in the range of 0 to 6, inclusive");
#endif
if (m_bitstreamFileNameIn.empty())
{
......@@ -149,11 +142,7 @@ BitstreamExtractorAppCfg::BitstreamExtractorAppCfg()
, m_bitstreamFileNameOut()
, m_maxTemporalLayer( 0 )
, m_targetOlsIdx( 0 )
#if JVET_S0154_R0068_ASPECT5
, m_subPicIdx( -1 )
#else
, m_subPicId( -1 )
#endif
{
}
......
......@@ -50,11 +50,7 @@ protected:
std::string m_bitstreamFileNameOut; // input bitstream file name
int m_maxTemporalLayer;
int m_targetOlsIdx;
#if JVET_S0154_R0068_ASPECT5
int m_subPicIdx;
#else
int m_subPicId;
#endif
public:
BitstreamExtractorAppCfg();
......
......@@ -59,12 +59,10 @@
DecApp::DecApp()
: m_iPOCLastDisplay(-MAX_INT)
{
#if JVET_R0270
for (int i = 0; i < MAX_NUM_LAYER_IDS; i++)
{
m_newCLVS[i] = true;
}
#endif
}
// ====================================================================================================================
......@@ -130,11 +128,8 @@ uint32_t DecApp::decode()
bool bPicSkipped = false;
#if JVET_S0155_EOS_NALU_CHECK
bool isEosPresentInPu = false;
#endif
#if JVET_S0202_AT_LEAST_ONE_OUTPUT_PICTURE
bool outputPicturePresentInBitstream = false;
auto setOutputPicturePresentInStream = [&]()
{
......@@ -151,7 +146,6 @@ uint32_t DecApp::decode()
}
}
};
#endif
while (!!bitstreamFile)
{
......@@ -186,12 +180,9 @@ uint32_t DecApp::decode()
(nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_RADL ||
nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_N_LP))
{
#if JVET_R0270
m_newCLVS[nalu.m_nuhLayerId] = true; // An IDR picture starts a new CLVS
#endif
xFlushOutput(pcListPic, nalu.m_nuhLayerId);
}
#if JVET_R0270
if (m_cDecLib.getFirstSliceInPicture() && nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_CRA && isEosPresentInPu)
{
// A CRA that is immediately preceded by an EOS is a CLVSS
......@@ -202,7 +193,6 @@ uint32_t DecApp::decode()
// A CRA that is not immediately precede by an EOS is not a CLVSS
m_newCLVS[nalu.m_nuhLayerId] = false;
}
#endif
// parse NAL unit syntax if within target decoding layer
if( ( m_iMaxTemporalLayer < 0 || nalu.m_temporalId <= m_iMaxTemporalLayer ) && xIsNaluWithinTargetDecLayerIdSet( &nalu ) )
......@@ -238,21 +228,17 @@ uint32_t DecApp::decode()
bPicSkipped = true;
}
}
#if JVET_S0155_EOS_NALU_CHECK
// once an EOS NAL unit appears in the current PU, mark the variable isEosPresentInPu as true
if (nalu.m_nalUnitType == NAL_UNIT_EOS)
{
isEosPresentInPu = true;
#if JVET_R0270
m_newCLVS[nalu.m_nuhLayerId] = true; //The presence of EOS means that the next picture is the beginning of new CLVS
#endif
}
// within the current PU, only EOS and EOB are allowed to be sent after an EOS nal unit
if(isEosPresentInPu)
{
CHECK(nalu.m_nalUnitType != NAL_UNIT_EOS && nalu.m_nalUnitType != NAL_UNIT_EOB, "When an EOS NAL unit is present in a PU, it shall be the last NAL unit among all NAL units within the PU other than other EOS NAL units or an EOB NAL unit");
}
#endif
}
if ((bNewPicture || !bitstreamFile || nalu.m_nalUnitType == NAL_UNIT_EOS) && !m_cDecLib.getFirstSliceInSequence(nalu.m_nuhLayerId) && !bPicSkipped)
......@@ -260,11 +246,7 @@ uint32_t DecApp::decode()
if (!loopFiltered[nalu.m_nuhLayerId] || bitstreamFile)
{
m_cDecLib.executeLoopFilters();
#if JVET_R0270
m_cDecLib.finishPicture(poc, pcListPic, INFO, m_newCLVS[nalu.m_nuhLayerId]);
#else
m_cDecLib.finishPicture( poc, pcListPic );
#endif
}
loopFiltered[nalu.m_nuhLayerId] = (nalu.m_nalUnitType == NAL_UNIT_EOS);
if (nalu.m_nalUnitType == NAL_UNIT_EOS)
......@@ -322,16 +304,12 @@ uint32_t DecApp::decode()
// write reconstruction to file
if( bNewPicture )
{
#if JVET_S0202_AT_LEAST_ONE_OUTPUT_PICTURE
setOutputPicturePresentInStream();
#endif
xWriteOutput( pcListPic, nalu.m_temporalId );
}
if (nalu.m_nalUnitType == NAL_UNIT_EOS)
{
#if JVET_S0202_AT_LEAST_ONE_OUTPUT_PICTURE
setOutputPicturePresentInStream();
#endif
xWriteOutput( pcListPic, nalu.m_temporalId );
m_cDecLib.setFirstSliceInPicture (false);
}
......@@ -339,9 +317,7 @@ uint32_t DecApp::decode()
if (!bNewPicture && ((nalu.m_nalUnitType >= NAL_UNIT_CODED_SLICE_TRAIL && nalu.m_nalUnitType <= NAL_UNIT_RESERVED_IRAP_VCL_12)
|| (nalu.m_nalUnitType >= NAL_UNIT_CODED_SLICE_IDR_W_RADL && nalu.m_nalUnitType <= NAL_UNIT_CODED_SLICE_GDR)))
{
#if JVET_S0202_AT_LEAST_ONE_OUTPUT_PICTURE
setOutputPicturePresentInStream();
#endif
xWriteOutput( pcListPic, nalu.m_temporalId );
}
}
......@@ -349,10 +325,8 @@ uint32_t DecApp::decode()
{
m_cDecLib.checkSeiInPictureUnit();
m_cDecLib.resetPictureSeiNalus();
#if JVET_S0155_EOS_NALU_CHECK
// reset the EOS present status for the next PU check
isEosPresentInPu = false;
#endif
}
if (bNewPicture || !bitstreamFile || nalu.m_nalUnitType == NAL_UNIT_EOS)
{
......@@ -378,11 +352,9 @@ uint32_t DecApp::decode()
m_cDecLib.resetAccessUnitPicInfo();
}
}
#if JVET_S0202_AT_LEAST_ONE_OUTPUT_PICTURE
// May need to check again one more time as in case one the bitstream has only one picture, the first check may miss it
setOutputPicturePresentInStream();
CHECK(!outputPicturePresentInBitstream, "It is required that there shall be at least one picture with PictureOutputFlag equal to 1 in the bitstream")
#endif
xFlushOutput( pcListPic );
......@@ -423,9 +395,7 @@ void DecApp::writeLineToOutputLog(Picture * pcPic)
const int croppedWidth = pcPic->Y().width - leftOffset - rightOffset;
const int croppedHeight = pcPic->Y().height - topOffset - bottomOffset;
#if OPL_ADD_LAYER_ID
m_oplFileStream << std::setw(3) << pcPic->layerId << ",";
#endif
m_oplFileStream << std::setw(8) << pcPic->getPOC() << "," << std::setw(5) << croppedWidth << "," << std::setw(5)
<< croppedHeight << "," << hashToString(recon_digest, numChar) << "\n";
}
......
......@@ -68,9 +68,7 @@ private:
std::ofstream m_oplFileStream; ///< Used to output log file for confomance testing
#if JVET_R0270
bool m_newCLVS[MAX_NUM_LAYER_IDS]; ///< used to record a new CLVSS
#endif
private:
......
......@@ -95,11 +95,7 @@ void EncApp::xInitLibCfg()
vps.setMaxSubLayers(m_maxSublayers);
if (vps.getMaxLayers() > 1 && vps.getMaxSubLayers() > 1)
{
#if JVET_S0115_VPS
vps.setDefaultPtlDpbHrdMaxTidFlag(m_defaultPtlDpbHrdMaxTidFlag);
#else
vps.setAllLayersSameNumSublayersFlag(m_allLayersSameNumSublayersFlag);
#endif
}
if (vps.getMaxLayers() > 1)
{
......@@ -205,18 +201,12 @@ void EncApp::xInitLibCfg()
ptls[0].setLevelIdc ( m_level );
ptls[0].setProfileIdc ( m_profile);
ptls[0].setTierFlag ( m_levelTier );
#if JVET_S0138_GCI_PTL
ptls[0].setFrameOnlyConstraintFlag ( m_frameOnlyConstraintFlag);
ptls[0].setMultiLayerEnabledFlag ( m_multiLayerEnabledFlag);
#if JVET_S_PROFILES
CHECK((m_profile == Profile::MAIN_10 || m_profile == Profile::MAIN_10_444
|| m_profile == Profile::MAIN_10_STILL_PICTURE || m_profile == Profile::MAIN_10_444_STILL_PICTURE)
&& m_multiLayerEnabledFlag,
"ptl_multilayer_enabled_flag shall be equal to 0 for non-multilayer profiles");
#else
CHECK( (m_profile == Profile::MAIN_10 || m_profile == Profile::MAIN_444_10) && m_multiLayerEnabledFlag, "ptl_multilayer_enabled_flag shall be equal to 0 for Main 10 and Main 10 4:4:4 profiles");
#endif
#endif
ptls[0].setNumSubProfile ( m_numSubProfile );
for (int i = 0; i < m_numSubProfile; i++)
{
......@@ -230,10 +220,8 @@ void EncApp::xInitLibCfg()
vps.setVPSExtensionFlag ( false );
m_cEncLib.setProfile ( m_profile);
m_cEncLib.setLevel ( m_levelTier, m_level);
#if JVET_S0138_GCI_PTL
m_cEncLib.setFrameOnlyConstraintFlag ( m_frameOnlyConstraintFlag);
m_cEncLib.setMultiLayerEnabledFlag ( m_multiLayerEnabledFlag || m_maxLayers > 1);
#endif
m_cEncLib.setNumSubProfile ( m_numSubProfile );
for (int i = 0; i < m_numSubProfile; i++)
{
......@@ -253,9 +241,7 @@ void EncApp::xInitLibCfg()
m_cEncLib.setSourceHeight ( m_iSourceHeight );
m_cEncLib.setConformanceWindow ( m_confWinLeft / SPS::getWinUnitX( m_InputChromaFormatIDC ), m_confWinRight / SPS::getWinUnitX( m_InputChromaFormatIDC ), m_confWinTop / SPS::getWinUnitY( m_InputChromaFormatIDC ), m_confWinBottom / SPS::getWinUnitY( m_InputChromaFormatIDC ) );
m_cEncLib.setScalingRatio ( m_scalingRatioHor, m_scalingRatioVer );
#if JVET_Q0114_ASPECT5_GCI_FLAG
m_cEncLib.setRprEnabled (m_rprEnabledFlag);
#endif
m_cEncLib.setResChangeInClvsEnabled ( m_resChangeInClvsEnabled );
m_cEncLib.setSwitchPocPeriod ( m_switchPocPeriod );
m_cEncLib.setUpscaledOutput ( m_upscaledOutput );
......@@ -264,9 +250,7 @@ void EncApp::xInitLibCfg()
m_cEncLib.setAvoidIntraInDepLayer ( m_avoidIntraInDepLayer );
//====== SPS constraint flags =======
#if JVET_S0179_CONDITIONAL_SIGNAL_GCI
m_cEncLib.setGciPresentFlag ( m_gciPresentFlag );
#endif
if (m_cEncLib.getGciPresentFlag())
{
m_cEncLib.setNonPackedConstraintFlag(m_nonPackedConstraintFlag);
......@@ -274,7 +258,6 @@ void EncApp::xInitLibCfg()
m_cEncLib.setOneTilePerPicConstraintFlag(m_oneTilePerPicConstraintFlag);
m_cEncLib.setPicHeaderInSliceHeaderConstraintFlag(m_picHeaderInSliceHeaderConstraintFlag);
m_cEncLib.setOneSlicePerPicConstraintFlag(m_oneSlicePerPicConstraintFlag);
#if JVET_S0113_S0195_GCI
m_cEncLib.setNoIdrRplConstraintFlag(m_noIdrRplConstraintFlag);
CHECK(m_noIdrRplConstraintFlag&& m_idrRefParamList, "IDR RPL shall be deactivated when gci_no_idr_rpl_constraint_flag equal to 1");
......@@ -286,25 +269,12 @@ void EncApp::xInitLibCfg()
m_cEncLib.setNoSubpicInfoConstraintFlag(m_noSubpicInfoConstraintFlag);
CHECK(m_noSubpicInfoConstraintFlag&& m_subPicInfoPresentFlag, "Subpicture information shall not present when gci_no_subpic_info_constraint_flag equal to 1");
#else
m_cEncLib.setOneSubpicPerPicConstraintFlag(m_oneSubpicPerPicConstraintFlag);
#endif
#if !JVET_S0138_GCI_PTL
m_cEncLib.setFrameOnlyConstraintFlag(m_frameOnlyConstraintFlag);
#endif
m_cEncLib.setOnePictureOnlyConstraintFlag(m_onePictureOnlyConstraintFlag);
m_cEncLib.setIntraOnlyConstraintFlag(m_intraOnlyConstraintFlag);
m_cEncLib.setNoIdrConstraintFlag(m_noIdrConstraintFlag);
m_cEncLib.setNoGdrConstraintFlag(m_noGdrConstraintFlag);
#if !JVET_S0138_GCI_PTL
m_cEncLib.setSingleLayerConstraintFlag(m_singleLayerConstraintFlag);
#endif
m_cEncLib.setAllLayersIndependentConstraintFlag(m_allLayersIndependentConstraintFlag);
#if JVET_R0227_ASPECT3
m_cEncLib.setNoCuQpDeltaConstraintFlag(m_noCuQpDeltaConstraintFlag);
#else
m_cEncLib.setNoQpDeltaConstraintFlag(m_noQpDeltaConstraintFlag);
#endif
m_cEncLib.setNoTrailConstraintFlag(m_noTrailConstraintFlag);
CHECK(m_noTrailConstraintFlag && m_iIntraPeriod != 1, "TRAIL shall be deactivated when m_noTrailConstraintFlag is equal to 1");
......@@ -321,10 +291,8 @@ void EncApp::xInitLibCfg()
m_cEncLib.setNoCraConstraintFlag(m_noCraConstraintFlag);
CHECK(m_noCraConstraintFlag && (m_iDecodingRefreshType == 1), "CRA shall be deactivated when m_noCraConstraintFlag is equal to 1");
#if JVET_Q0114_ASPECT5_GCI_FLAG
m_cEncLib.setNoRprConstraintFlag(m_noRprConstraintFlag);
CHECK(m_noRprConstraintFlag && m_rprEnabledFlag, "Reference picture resampling shall be deactivated when m_noRprConstraintFlag is equal to 1");
#endif
m_cEncLib.setNoResChangeInClvsConstraintFlag(m_noResChangeInClvsConstraintFlag);
CHECK(m_noResChangeInClvsConstraintFlag && m_resChangeInClvsEnabled, "Resolution change in CLVS shall be deactivated when m_noResChangeInClvsConstraintFlag is equal to 1");
......@@ -335,19 +303,15 @@ void EncApp::xInitLibCfg()
m_cEncLib.setMaxChromaFormatConstraintIdc(m_maxChromaFormatConstraintIdc);
CHECK(m_chromaFormatIDC > m_maxChromaFormatConstraintIdc, "Chroma format Idc shall be less than or equal to m_maxBitDepthConstraintIdc");
#if JVET_S0058_GCI
m_cEncLib.setNoMttConstraintFlag(m_noMttConstraintFlag);
CHECK(m_noMttConstraintFlag && (m_uiMaxMTTHierarchyDepth || m_uiMaxMTTHierarchyDepthI || m_uiMaxMTTHierarchyDepthIChroma), "Mtt shall be deactivated when m_bNoMttConstraintFlag is equal to 1");
#endif
m_cEncLib.setNoQtbttDualTreeIntraConstraintFlag(m_noQtbttDualTreeIntraConstraintFlag);
CHECK(m_noQtbttDualTreeIntraConstraintFlag && m_dualTree, "Dual tree shall be deactivated when m_bNoQtbttDualTreeIntraConstraintFlag is equal to 1");
#if JVET_S0066_GCI
m_cEncLib.setMaxLog2CtuSizeConstraintIdc(m_maxLog2CtuSizeConstraintIdc);
CHECK( m_uiCTUSize > (1<<(m_maxLog2CtuSizeConstraintIdc)), "CTUSize shall be less than or equal to 1 << m_maxLog2CtuSize");
#endif
m_cEncLib.setNoPartitionConstraintsOverrideConstraintFlag(m_noPartitionConstraintsOverrideConstraintFlag);
CHECK(m_noPartitionConstraintsOverrideConstraintFlag && m_SplitConsOverrideEnabledFlag, "Partition override shall be deactivated when m_noPartitionConstraintsOverrideConstraintFlag is equal to 1");
......@@ -360,10 +324,8 @@ void EncApp::xInitLibCfg()
m_cEncLib.setNoCCAlfConstraintFlag(m_noCCAlfConstraintFlag);
CHECK(m_noCCAlfConstraintFlag && m_ccalf, "CCALF shall be deactivated when m_noCCAlfConstraintFlag is equal to 1");
#if JVET_S0058_GCI
m_cEncLib.setNoWeightedPredictionConstraintFlag(m_noWeightedPredictionConstraintFlag);
CHECK(m_noWeightedPredictionConstraintFlag && (m_useWeightedPred || m_useWeightedBiPred), "Weighted Prediction shall be deactivated when m_bNoWeightedPredictionConstraintFlag is equal to 1");
#endif
m_cEncLib.setNoRefWraparoundConstraintFlag(m_noRefWraparoundConstraintFlag);
CHECK(m_noRefWraparoundConstraintFlag && m_wrapAround, "Wrap around shall be deactivated when m_bNoRefWraparoundConstraintFlag is equal to 1");
......@@ -414,11 +376,9 @@ void EncApp::xInitLibCfg()
m_cEncLib.setNoTransformSkipConstraintFlag(m_noTransformSkipConstraintFlag);
CHECK(m_noTransformSkipConstraintFlag && m_useTransformSkip, "Transform skip shall be deactivated when m_noTransformSkipConstraintFlag is equal to 1");
#if JVET_S0066_GCI
m_cEncLib.setNoLumaTransformSize64ConstraintFlag(m_noLumaTransformSize64ConstraintFlag);
CHECK(m_noLumaTransformSize64ConstraintFlag && m_log2MaxTbSize > 5, "Max transform size shall be less than 64 when m_noLumaTransformSize64ConstraintFlag is equal to 1");
#endif
m_cEncLib.setNoBDPCMConstraintFlag(m_noBDPCMConstraintFlag);
CHECK(m_noBDPCMConstraintFlag && m_useBDPCM, "BDPCM shall be deactivated when m_noBDPCMConstraintFlag is equal to 1");
......@@ -464,56 +424,38 @@ void EncApp::xInitLibCfg()
m_cEncLib.setNoLmcsConstraintFlag(m_noLmcsConstraintFlag);
CHECK(m_noLmcsConstraintFlag && m_lmcsEnabled, "LMCS shall be deactivated when m_noLmcsConstraintFlag is equal to 1");
#if JVET_S0050_GCI
m_cEncLib.setNoExplicitScaleListConstraintFlag(m_noExplicitScaleListConstraintFlag);
CHECK(m_noExplicitScaleListConstraintFlag && m_useScalingListId != SCALING_LIST_OFF, "Explicit scaling list shall be deactivated when m_noExplicitScaleListConstraintFlag is equal to 1");
m_cEncLib.setNoVirtualBoundaryConstraintFlag(m_noVirtualBoundaryConstraintFlag);
CHECK(m_noVirtualBoundaryConstraintFlag && m_virtualBoundariesEnabledFlag, "Virtuall boundaries shall be deactivated when m_noVirtualBoundaryConstraintFlag is equal to 1");
#endif
#if JVET_R0341_GCI
m_cEncLib.setNoChromaQpOffsetConstraintFlag(m_noChromaQpOffsetConstraintFlag);
CHECK(m_noChromaQpOffsetConstraintFlag && m_cuChromaQpOffsetSubdiv, "Chroma Qp offset shall be 0 when m_noChromaQpOffsetConstraintFlag is equal to 1");
#endif
}
else
{
m_cEncLib.setNonPackedConstraintFlag(false);
m_cEncLib.setNonProjectedConstraintFlag(false);
#if !JVET_S0138_GCI_PTL
m_cEncLib.setSingleLayerConstraintFlag(false);
#endif
m_cEncLib.setAllLayersIndependentConstraintFlag(false);
m_cEncLib.setNoResChangeInClvsConstraintFlag(false);
m_cEncLib.setOneTilePerPicConstraintFlag(false);
m_cEncLib.setPicHeaderInSliceHeaderConstraintFlag(false);
m_cEncLib.setOneSlicePerPicConstraintFlag(false);
#if JVET_S0113_S0195_GCI
m_cEncLib.setNoIdrRplConstraintFlag(false);
m_cEncLib.setNoRectSliceConstraintFlag(false);
m_cEncLib.setOneSlicePerSubpicConstraintFlag(false);
m_cEncLib.setNoSubpicInfoConstraintFlag(false);
#else
m_cEncLib.setOneSubpicPerPicConstraintFlag(false);
#endif
#if !JVET_S0138_GCI_PTL
m_cEncLib.setFrameOnlyConstraintFlag(false);
#endif
m_cEncLib.setOnePictureOnlyConstraintFlag(false);
m_cEncLib.setIntraOnlyConstraintFlag(false);
m_cEncLib.setMaxBitDepthConstraintIdc(16);
m_cEncLib.setMaxChromaFormatConstraintIdc(3);
#if JVET_S0058_GCI
m_cEncLib.setNoMttConstraintFlag(false);
#endif
m_cEncLib.setNoQtbttDualTreeIntraConstraintFlag(false);
m_cEncLib.setNoPartitionConstraintsOverrideConstraintFlag(false);
m_cEncLib.setNoSaoConstraintFlag(false);
m_cEncLib.setNoAlfConstraintFlag(false);
m_cEncLib.setNoCCAlfConstraintFlag(false);
#if JVET_S0058_GCI
m_cEncLib.setNoWeightedPredictionConstraintFlag(false);
#endif
m_cEncLib.setNoRefWraparoundConstraintFlag(false);
m_cEncLib.setNoTemporalMvpConstraintFlag(false);
m_cEncLib.setNoSbtmvpConstraintFlag(false);
......@@ -532,11 +474,7 @@ void EncApp::xInitLibCfg()
m_cEncLib.setNoTransformSkipConstraintFlag(false);
m_cEncLib.setNoBDPCMConstraintFlag(false);
m_cEncLib.setNoJointCbCrConstraintFlag(false);
#if JVET_R0227_ASPECT3
m_cEncLib.setNoCuQpDeltaConstraintFlag(false);
#else
m_cEncLib.setNoQpDeltaConstraintFlag(false);
#endif
m_cEncLib.setNoDepQuantConstraintFlag(false);
m_cEncLib.setNoSignDataHidingConstraintFlag(false);
m_cEncLib.setNoTrailConstraintFlag(false);
......@@ -557,9 +495,7 @@ void EncApp::xInitLibCfg()
m_cEncLib.setNoPaletteConstraintFlag(false);
m_cEncLib.setNoActConstraintFlag(false);
m_cEncLib.setNoLmcsConstraintFlag(false);
#if JVET_R0341_GCI
m_cEncLib.setNoChromaQpOffsetConstraintFlag(false);
#endif
}
//====== Coding Structure ========
......@@ -679,9 +615,7 @@ void EncApp::xInitLibCfg()
if(m_subPicInfoPresentFlag)
{
m_cEncLib.setNumSubPics ( m_numSubPics );
#if JVET_S0071_SAME_SIZE_SUBPIC_LAYOUT
m_cEncLib.setSubPicSameSizeFlag ( m_subPicSameSizeFlag );
#endif
m_cEncLib.setSubPicCtuTopLeftX ( m_subPicCtuTopLeftX );
m_cEncLib.setSubPicCtuTopLeftY ( m_subPicCtuTopLeftY );
m_cEncLib.setSubPicWidth ( m_subPicWidth );
......@@ -880,9 +814,7 @@ void EncApp::xInitLibCfg()
m_cEncLib.setSaoGreedyMergeEnc ( m_saoGreedyMergeEnc);
m_cEncLib.setIntraSmoothingDisabledFlag (!m_enableIntraReferenceSmoothing );
m_cEncLib.setDecodedPictureHashSEIType ( m_decodedPictureHashSEIType );
#if JVET_R0294_SUBPIC_HASH
m_cEncLib.setSubpicDecodedPictureHashType ( m_subpicDecodedPictureHashType );
#endif
m_cEncLib.setDependentRAPIndicationSEIEnabled ( m_drapPeriod > 0 );
m_cEncLib.setBufferingPeriodSEIEnabled ( m_bufferingPeriodSEIEnabled );
m_cEncLib.setPictureTimingSEIEnabled ( m_pictureTimingSEIEnabled );
......@@ -1437,11 +1369,7 @@ void EncApp::xWriteOutput( int iNumEncoded, std::list<PelUnitBuf*>& recBufList )
void EncApp::outputAU( const AccessUnit& au )
{
#if JVET_R0294_SUBPIC_HASH
const vector<uint32_t>& stats = writeAnnexBAccessUnit(m_bitstream, au);
#else
const vector<uint32_t>& stats = writeAnnexB(m_bitstream, au);
#endif
rateStatsAccum(au, stats);
m_bitstream.flush();
}
......
This diff is collapsed.
......@@ -131,15 +131,10 @@ protected:
bool m_bClipOutputVideoToRec709Range;
bool m_packedYUVMode; ///< If true, output 10-bit and 12-bit YUV data as 5-byte and 3-byte (respectively) packed YUV data
#if JVET_S0179_CONDITIONAL_SIGNAL_GCI
bool m_gciPresentFlag;
#endif
bool m_bIntraOnlyConstraintFlag;
uint32_t m_maxBitDepthConstraintIdc;
int m_maxChromaFormatConstraintIdc;
#if !JVET_S0138_GCI_PTL
bool m_singleLayerConstraintFlag;
#endif
bool m_allLayersIndependentConstraintFlag;
bool m_noMrlConstraintFlag;
bool m_noIspConstraintFlag;
......@@ -151,27 +146,17 @@ protected:
bool m_noPaletteConstraintFlag;
bool m_noActConstraintFlag;
bool m_noLmcsConstraintFlag;
#if JVET_S0050_GCI
bool m_noExplicitScaleListConstraintFlag;
bool m_noVirtualBoundaryConstraintFlag;
#endif
#if JVET_S0058_GCI
bool m_noMttConstraintFlag;
#endif
#if JVET_R0341_GCI
bool m_noChromaQpOffsetConstraintFlag;
#endif
bool m_noQtbttDualTreeIntraConstraintFlag;
#if JVET_S0066_GCI
int m_maxLog2CtuSizeConstraintIdc;
#endif
bool m_noPartitionConstraintsOverrideConstraintFlag;
bool m_noSaoConstraintFlag;
bool m_noAlfConstraintFlag;
bool m_noCCAlfConstraintFlag;
#if JVET_S0058_GCI
bool m_noWeightedPredictionConstraintFlag;
#endif
bool m_noRefWraparoundConstraintFlag;
bool m_noTemporalMvpConstraintFlag;
bool m_noSbtmvpConstraintFlag;
......@@ -188,16 +173,10 @@ protected:
bool m_noGeoConstraintFlag;
bool m_noLadfConstraintFlag;
bool m_noTransformSkipConstraintFlag;
#if JVET_S0066_GCI
bool m_noLumaTransformSize64ConstraintFlag;
#endif
bool m_noBDPCMConstraintFlag;
bool m_noJointCbCrConstraintFlag;
#if JVET_R0227_ASPECT3
bool m_noCuQpDeltaConstraintFlag;
#else
bool m_noQpDeltaConstraintFlag;
#endif
bool m_noDepQuantConstraintFlag;
bool m_noSignDataHidingConstraintFlag;
bool m_noTrailConstraintFlag;
......@@ -213,10 +192,8 @@ protected:
Profile::Name m_profile;
Level::Tier m_levelTier;
Level::Name m_level;
#if JVET_S0138_GCI_PTL
bool m_frameOnlyConstraintFlag;
bool m_multiLayerEnabledFlag;
#endif
std::vector<uint32_t> m_subProfile;
uint8_t m_numSubProfile;
......@@ -226,24 +203,15 @@ protected:
bool m_intraOnlyConstraintFlag;
bool m_nonPackedConstraintFlag;
bool m_nonProjectedConstraintFlag;
#if JVET_Q0114_ASPECT5_GCI_FLAG
bool m_noRprConstraintFlag;
#endif
bool m_noResChangeInClvsConstraintFlag;
bool m_oneTilePerPicConstraintFlag;
bool m_picHeaderInSliceHeaderConstraintFlag;
bool m_oneSlicePerPicConstraintFlag;
#if JVET_S0113_S0195_GCI
bool m_noIdrRplConstraintFlag;
bool m_noRectSliceConstraintFlag;
bool m_oneSlicePerSubpicConstraintFlag;
bool m_noSubpicInfoConstraintFlag;
#else
bool m_oneSubpicPerPicConstraintFlag;
#endif
#if !JVET_S0138_GCI_PTL
bool m_frameOnlyConstraintFlag;
#endif
// coding structure
int m_iIntraPeriod; ///< period of I-slice (random access period)
int m_iDecodingRefreshType; ///< random access type
......@@ -319,9 +287,7 @@ protected:
unsigned m_uiCTUSize;
bool m_subPicInfoPresentFlag;
unsigned m_numSubPics;
#if JVET_S0071_SAME_SIZE_SUBPIC_LAYOUT
bool m_subPicSameSizeFlag;
#endif
std::vector<uint32_t> m_subPicCtuTopLeftX;
std::vector<uint32_t> m_subPicCtuTopLeftY;
std::vector<uint32_t> m_subPicWidth;
......@@ -517,9 +483,7 @@ protected:
bool m_bUseBLambdaForNonKeyLowDelayPictures;
HashType m_decodedPictureHashSEIType; ///< Checksum mode for decoded picture hash SEI message
#if JVET_R0294_SUBPIC_HASH
HashType m_subpicDecodedPictureHashType;
#endif
bool m_bufferingPeriodSEIEnabled;
bool m_pictureTimingSEIEnabled;
bool m_bpDeltasGOPStructure;
......@@ -732,9 +696,7 @@ protected:
bool m_ccalf;
int m_ccalfQpThreshold;
#if JVET_Q0114_ASPECT5_GCI_FLAG
bool m_rprEnabledFlag;
#endif
double m_scalingRatioHor;
double m_scalingRatioVer;
bool m_resChangeInClvsEnabled;
......@@ -753,11 +715,7 @@ protected:
int m_layerId[MAX_VPS_LAYERS];
int m_layerIdx;
int m_maxSublayers;
#if JVET_S0115_VPS
bool m_defaultPtlDpbHrdMaxTidFlag;
#else
bool m_allLayersSameNumSublayersFlag;
#endif
bool m_allIndependentLayersFlag;
std::string m_predDirectionArray;
......
......@@ -66,7 +66,6 @@ void ParcatHLSyntaxReader::parsePictureHeaderUpToPoc ( ParameterSetManager *para
PPS* pps = NULL;
SPS* sps = NULL;
#if JVET_S0076_ASPECT1
uint32_t uiTmp;
READ_FLAG(uiTmp, "ph_gdr_or_irap_pic_flag");
READ_FLAG(uiCode, "ph_non_ref_pic_flag");
......@@ -74,21 +73,11 @@ void ParcatHLSyntaxReader::parsePictureHeaderUpToPoc ( ParameterSetManager *para
{
READ_FLAG( uiCode, "ph_gdr_pic_flag" );
}
#else
READ_FLAG( uiCode, "ph_gdr_or_irap_pic_flag" );
if (uiCode)
{
READ_FLAG(uiCode, "ph_gdr_pic_flag");
}
#endif
READ_FLAG(uiCode, "ph_inter_slice_allowed_flag");
if (uiCode)
{
READ_FLAG(uiCode, "ph_intra_slice_allowed_flag");
}
#if !JVET_S0076_ASPECT1
READ_FLAG(uiCode, "non_reference_picture_flag");
#endif
// parameter sets
READ_UVLC(uiCode, "ph_pic_parameter_set_id");
pps = parameterSetManager->getPPS(uiCode);
......
......@@ -967,11 +967,7 @@ void SubpicMergeApp::generateMergedPic(ParameterSetManager &psManager, bool mixe
copyNalUnitsToAccessUnit(accessUnit, subpic0.nalus, (int)NAL_UNIT_EOS);
copyNalUnitsToAccessUnit(accessUnit, subpic0.nalus, (int)NAL_UNIT_EOB);
#if JVET_R0294_SUBPIC_HASH
writeAnnexBAccessUnit(m_outputStream, accessUnit);
#else
writeAnnexB(m_outputStream, accessUnit);
#endif
}
/**
......
......@@ -504,11 +504,7 @@ void AdaptiveLoopFilter::ALFProcess(CodingStructure& cs)
deriveClassification( m_classifier, buf.get(COMPONENT_Y), blkDst, blkSrc );
short filterSetIndex = alfCtuFilterIndex[ctuIdx];
short *coeff;
#if JVET_R0351_HIGH_BIT_DEPTH_SUPPORT
Pel *clip;
#else
short *clip;
#endif
if (filterSetIndex >= NUM_FIXED_FILTER_SETS)
{
coeff = m_coeffApsLuma[filterSetIndex - NUM_FIXED_FILTER_SETS];
......@@ -572,11 +568,7 @@ void AdaptiveLoopFilter::ALFProcess(CodingStructure& cs)
deriveClassification( m_classifier, tmpYuv.get( COMPONENT_Y ), blk, blk );
short filterSetIndex = alfCtuFilterIndex[ctuIdx];
short *coeff;
#if JVET_R0351_HIGH_BIT_DEPTH_SUPPORT
Pel *clip;
#else
short *clip;
#endif
if (filterSetIndex >= NUM_FIXED_FILTER_SETS)
{
coeff = m_coeffApsLuma[filterSetIndex - NUM_FIXED_FILTER_SETS];
......@@ -671,11 +663,7 @@ void AdaptiveLoopFilter::reconstructCoeff( AlfParam& alfParam, ChannelType chann
{
int numFilters = isLuma( channel ) ? alfParam.numLumaFilters : 1;
short* coeff = isLuma( channel ) ? alfParam.lumaCoeff : alfParam.chromaCoeff[altIdx];
#if JVET_R0351_HIGH_BIT_DEPTH_SUPPORT
Pel* clipp = isLuma( channel ) ? alfParam.lumaClipp : alfParam.chromaClipp[altIdx];
#else
short* clipp = isLuma( channel ) ? alfParam.lumaClipp : alfParam.chromaClipp[altIdx];
#endif
for( int filterIdx = 0; filterIdx < numFilters; filterIdx++ )
{
......@@ -1071,11 +1059,7 @@ void AdaptiveLoopFilter::deriveClassificationBlk(AlfClassifier **classifier, int
template<AlfFilterType filtType>
void AdaptiveLoopFilter::filterBlk(AlfClassifier **classifier, const PelUnitBuf &recDst, const CPelUnitBuf &recSrc,
const Area &blkDst, const Area &blk, const ComponentID compId,
#if JVET_R0351_HIGH_BIT_DEPTH_SUPPORT
const short *filterSet, const Pel *fClipSet, const ClpRng &clpRng,
#else
const short *filterSet, const short *fClipSet, const ClpRng &clpRng,
#endif
CodingStructure &cs, const int vbCTUHeight, int vbPos)
{
CHECK((vbCTUHeight & (vbCTUHeight - 1)) != 0, "vbCTUHeight must be a power of 2");
......@@ -1104,11 +1088,7 @@ void AdaptiveLoopFilter::filterBlk(AlfClassifier **classifier, const PelUnitBuf
const Pel *pImg0, *pImg1, *pImg2, *pImg3, *pImg4, *pImg5, *pImg6;
const short *coef = filterSet;
#if JVET_R0351_HIGH_BIT_DEPTH_SUPPORT
const Pel *clip = fClipSet;
#else
const short *clip = fClipSet;
#endif
const int shift = m_NUM_BITS - 1;
const int offset = 1 << ( shift - 1 );
......
......@@ -67,17 +67,10 @@ enum Direction
class AdaptiveLoopFilter
{
public:
#if JVET_R0351_HIGH_BIT_DEPTH_SUPPORT
static inline Pel clipALF(const Pel clip, const Pel ref, const Pel val0, const Pel val1)
{
return Clip3<Pel>(-clip, +clip, val0-ref) + Clip3<Pel>(-clip, +clip, val1-ref);
}
#else
static inline int clipALF(const int clip, const short ref, const short val0, const short val1)
{
return Clip3<int>(-clip, +clip, val0-ref) + Clip3<int>(-clip, +clip, val1-ref);
}
#endif
static constexpr int AlfNumClippingValues[MAX_NUM_CHANNEL_TYPE] = { 4, 4 };
static constexpr int MaxAlfNumClippingValues = 4;
......@@ -106,11 +99,7 @@ public:
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,
#if JVET_R0351_HIGH_BIT_DEPTH_SUPPORT
const Pel *fClipSet, const ClpRng &clpRng, CodingStructure &cs, const int vbCTUHeight,
#else
const short *fClipSet, const ClpRng &clpRng, CodingStructure &cs, const int vbCTUHeight,
#endif
int vbPos);
void (*m_deriveClassificationBlk)(AlfClassifier **classifier, int **laplacian[NUM_DIRECTIONS], const CPelBuf &srcLuma,
const Area &blkDst, const Area &blk, const int shift, const int vbCTUHeight,
......@@ -127,19 +116,11 @@ public:
uint8_t* getCcAlfControlIdc(const ComponentID compID) { return m_ccAlfFilterControl[compID-1]; }
void (*m_filter5x5Blk)(AlfClassifier **classifier, const PelUnitBuf &recDst, const CPelUnitBuf &recSrc,
const Area &blkDst, const Area &blk, const ComponentID compId, const short *filterSet,
#if JVET_R0351_HIGH_BIT_DEPTH_SUPPORT
const Pel *fClipSet, const ClpRng &clpRng, CodingStructure &cs, const int vbCTUHeight,
#else
const short *fClipSet, const ClpRng &clpRng, CodingStructure &cs, const int vbCTUHeight,
#endif
int vbPos);
void (*m_filter7x7Blk)(AlfClassifier **classifier, const PelUnitBuf &recDst, const CPelUnitBuf &recSrc,
const Area &blkDst, const Area &blk, const ComponentID compId, const short *filterSet,
#if JVET_R0351_HIGH_BIT_DEPTH_SUPPORT
const Pel *fClipSet, const ClpRng &clpRng, CodingStructure &cs, const int vbCTUHeight,
#else
const short *fClipSet, const ClpRng &clpRng, CodingStructure &cs, const int vbCTUHeight,
#endif
int vbPos);
#ifdef TARGET_SIMD_X86
......@@ -157,13 +138,8 @@ protected:
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];
short m_coeffApsLuma[ALF_CTB_MAX_NUM_APS][MAX_NUM_ALF_LUMA_COEFF * MAX_NUM_ALF_CLASSES];
#if JVET_R0351_HIGH_BIT_DEPTH_SUPPORT
Pel m_clippApsLuma[ALF_CTB_MAX_NUM_APS][MAX_NUM_ALF_LUMA_COEFF * MAX_NUM_ALF_CLASSES];
Pel m_clipDefault[MAX_NUM_ALF_CLASSES * MAX_NUM_ALF_LUMA_COEFF];
#else
short m_clippApsLuma[ALF_CTB_MAX_NUM_APS][MAX_NUM_ALF_LUMA_COEFF * MAX_NUM_ALF_CLASSES];
short m_clipDefault[MAX_NUM_ALF_CLASSES * MAX_NUM_ALF_LUMA_COEFF];
#endif
bool m_created = false;
short m_chromaCoeffFinal[MAX_NUM_ALF_ALTERNATIVES_CHROMA][MAX_NUM_ALF_CHROMA_COEFF];
AlfParam* m_alfParamChroma;
......@@ -172,13 +148,8 @@ protected:
std::vector<AlfFilterShape> m_filterShapes[MAX_NUM_CHANNEL_TYPE];
AlfClassifier** m_classifier;
short m_coeffFinal[MAX_NUM_ALF_CLASSES * MAX_NUM_ALF_LUMA_COEFF];
#if JVET_R0351_HIGH_BIT_DEPTH_SUPPORT
Pel m_clippFinal[MAX_NUM_ALF_CLASSES * MAX_NUM_ALF_LUMA_COEFF];
Pel m_chromaClippFinal[MAX_NUM_ALF_ALTERNATIVES_CHROMA][MAX_NUM_ALF_CHROMA_COEFF];
#else
short m_clippFinal[MAX_NUM_ALF_CLASSES * MAX_NUM_ALF_LUMA_COEFF];
short m_chromaClippFinal[MAX_NUM_ALF_ALTERNATIVES_CHROMA][MAX_NUM_ALF_CHROMA_COEFF];
#endif
int** m_laplacian[NUM_DIRECTIONS];
int * m_laplacianPtr[NUM_DIRECTIONS][m_CLASSIFICATION_BLK_SIZE + 5];
int m_laplacianData[NUM_DIRECTIONS][m_CLASSIFICATION_BLK_SIZE + 5][m_CLASSIFICATION_BLK_SIZE + 5];
......
......@@ -129,18 +129,10 @@ struct AlfParam
bool enabledFlag[MAX_NUM_COMPONENT]; // alf_slice_enable_flag, alf_chroma_idc
bool nonLinearFlag[MAX_NUM_CHANNEL_TYPE]; // alf_[luma/chroma]_clip_flag
short lumaCoeff[MAX_NUM_ALF_CLASSES * MAX_NUM_ALF_LUMA_COEFF]; // alf_coeff_luma_delta[i][j]
#if JVET_R0351_HIGH_BIT_DEPTH_SUPPORT
Pel lumaClipp[MAX_NUM_ALF_CLASSES * MAX_NUM_ALF_LUMA_COEFF]; // alf_clipp_luma_[i][j]
#else
short lumaClipp[MAX_NUM_ALF_CLASSES * MAX_NUM_ALF_LUMA_COEFF]; // alf_clipp_luma_[i][j]
#endif
int numAlternativesChroma; // alf_chroma_num_alts_minus_one + 1
short chromaCoeff[MAX_NUM_ALF_ALTERNATIVES_CHROMA][MAX_NUM_ALF_CHROMA_COEFF]; // alf_coeff_chroma[i]
#if JVET_R0351_HIGH_BIT_DEPTH_SUPPORT
Pel chromaClipp[MAX_NUM_ALF_ALTERNATIVES_CHROMA][MAX_NUM_ALF_CHROMA_COEFF]; // alf_clipp_chroma[i]
#else
short chromaClipp[MAX_NUM_ALF_ALTERNATIVES_CHROMA][MAX_NUM_ALF_CHROMA_COEFF]; // alf_clipp_chroma[i]
#endif
short filterCoeffDeltaIdx[MAX_NUM_ALF_CLASSES]; // filter_coeff_delta[i]
bool alfLumaCoeffFlag[MAX_NUM_ALF_CLASSES]; // alf_luma_coeff_flag[i]
int numLumaFilters; // number_of_filters_minus1 + 1
......
......@@ -94,32 +94,16 @@ void addBIOAvgCore(const Pel* src0, int src0Stride, const Pel* src1, int src1Str
for (int x = 0; x < width; x += 4)
{
b = tmpx * (gradX0[x] - gradX1[x]) + tmpy * (gradY0[x] - gradY1[x]);
#if JVET_R0351_HIGH_BIT_DEPTH_SUPPORT
dst[x] = ClipPel(rightShift((src0[x] + src1[x] + b + offset), shift), clpRng);
#else
dst[x] = ClipPel((int16_t)rightShift((src0[x] + src1[x] + b + offset), shift), clpRng);
#endif
b = tmpx * (gradX0[x + 1] - gradX1[x + 1]) + tmpy * (gradY0[x + 1] - gradY1[x + 1]);
#if JVET_R0351_HIGH_BIT_DEPTH_SUPPORT
dst[x + 1] = ClipPel(rightShift((src0[x + 1] + src1[x + 1] + b + offset), shift), clpRng);
#else
dst[x + 1] = ClipPel((int16_t)rightShift((src0[x + 1] + src1[x + 1] + b + offset), shift), clpRng);
#endif
b = tmpx * (gradX0[x + 2] - gradX1[x + 2]) + tmpy * (gradY0[x + 2] - gradY1[x + 2]);
#if JVET_R0351_HIGH_BIT_DEPTH_SUPPORT
dst[x + 2] = ClipPel(rightShift((src0[x + 2] + src1[x + 2] + b + offset), shift), clpRng);
#else
dst[x + 2] = ClipPel((int16_t)rightShift((src0[x + 2] + src1[x + 2] + b + offset), shift), clpRng);
#endif
b = tmpx * (gradX0[x + 3] - gradX1[x + 3]) + tmpy * (gradY0[x + 3] - gradY1[x + 3]);
#if JVET_R0351_HIGH_BIT_DEPTH_SUPPORT
dst[x + 3] = ClipPel(rightShift((src0[x + 3] + src1[x + 3] + b + offset), shift), clpRng);
#else
dst[x + 3] = ClipPel((int16_t)rightShift((src0[x + 3] + src1[x + 3] + b + offset), shift), clpRng);
#endif
}
dst += dstStride; src0 += src0Stride; src1 += src1Stride;
gradX0 += gradStride; gradX1 += gradStride; gradY0 += gradStride; gradY1 += gradStride;
......@@ -377,11 +361,7 @@ void AreaBuf<Pel>::addWeightedAvg(const AreaBuf<const Pel> &other1, const AreaBu
const unsigned src2Stride = other2.stride;
const unsigned destStride = stride;
const int clipbd = clpRng.bd;
#if JVET_R0351_HIGH_BIT_DEPTH_SUPPORT
const int shiftNum = IF_INTERNAL_FRAC_BITS(clipbd) + log2WeightBase;
#else
const int shiftNum = std::max<int>(2, (IF_INTERNAL_PREC - clipbd)) + log2WeightBase;
#endif
const int offset = (1 << (shiftNum - 1)) + (IF_INTERNAL_OFFS << log2WeightBase);
#define ADD_AVG_OP( ADDR ) dest[ADDR] = ClipPel( rightShift( ( src0[ADDR]*w0 + src2[ADDR]*w1 + offset ), shiftNum ), clpRng )
......@@ -474,11 +454,7 @@ void AreaBuf<Pel>::addAvg( const AreaBuf<const Pel> &other1, const AreaBuf<const
const unsigned src2Stride = other2.stride;
const unsigned destStride = stride;
const int clipbd = clpRng.bd;
#if JVET_R0351_HIGH_BIT_DEPTH_SUPPORT
const int shiftNum = IF_INTERNAL_FRAC_BITS(clipbd) + 1;
#else
const int shiftNum = std::max<int>(2, (IF_INTERNAL_PREC - clipbd)) + 1;
#endif
const int offset = (1 << (shiftNum - 1)) + 2 * IF_INTERNAL_OFFS;
#if ENABLE_SIMD_OPT_BUFFER && defined(TARGET_SIMD_X86)
......@@ -513,11 +489,7 @@ void AreaBuf<Pel>::toLast( const ClpRng& clpRng )
const uint32_t srcStride = stride;
const int clipbd = clpRng.bd;
#if JVET_R0351_HIGH_BIT_DEPTH_SUPPORT
const int shiftNum = IF_INTERNAL_FRAC_BITS(clipbd);
#else
const int shiftNum = std::max<int>(2, (IF_INTERNAL_PREC - clipbd));
#endif
const int offset = ( 1 << ( shiftNum - 1 ) ) + IF_INTERNAL_OFFS;
if (width == 1)
......@@ -590,11 +562,7 @@ void AreaBuf<Pel>::roundToOutputBitdepth( const AreaBuf<const Pel> &src, const C
const unsigned destStride = stride;
const int32_t clipbd = clpRng.bd;
#if JVET_R0351_HIGH_BIT_DEPTH_SUPPORT
const int32_t shiftDefault = IF_INTERNAL_FRAC_BITS(clipbd);
#else
const int32_t shiftDefault = std::max<int>(2, (IF_INTERNAL_PREC - clipbd));
#endif
const int32_t offsetDefault = (1<<(shiftDefault-1)) + IF_INTERNAL_OFFS;
if( width == 1 )
......
......@@ -439,29 +439,15 @@ void AreaBuf<T>::removeWeightHighFreq(const AreaBuf<T>& other, const bool bClip,
else
{
#endif
#if JVET_R0351_HIGH_BIT_DEPTH_SUPPORT_VS
Intermediate_Int normalizer = ((1 << 16) + (bcwWeight > 0 ? (bcwWeight >> 1) : -(bcwWeight >> 1))) / bcwWeight;
#else
int normalizer = ((1 << 16) + (bcwWeight > 0 ? (bcwWeight >> 1) : -(bcwWeight >> 1))) / bcwWeight;
#endif
#if JVET_R0351_HIGH_BIT_DEPTH_SUPPORT
Intermediate_Int weight0 = normalizer << log2WeightBase;
Intermediate_Int weight1 = bcwWeightOther * normalizer;
#else
int weight0 = normalizer << log2WeightBase;
int weight1 = bcwWeightOther * normalizer;
#endif
#define REM_HF_INC \
src += srcStride; \
dst += dstStride; \
#if JVET_R0351_HIGH_BIT_DEPTH_SUPPORT_VS
#define REM_HF_OP_CLIP( ADDR ) dst[ADDR] = ClipPel<T>( T((dst[ADDR]*weight0 - src[ADDR]*weight1 + (1<<15))>>16), clpRng )
#define REM_HF_OP( ADDR ) dst[ADDR] = T((dst[ADDR]*weight0 - src[ADDR]*weight1 + (1<<15))>>16)
#else
#define REM_HF_OP_CLIP( ADDR ) dst[ADDR] = ClipPel<T>( (dst[ADDR]*weight0 - src[ADDR]*weight1 + (1<<15))>>16, clpRng )
#define REM_HF_OP( ADDR ) dst[ADDR] = (dst[ADDR]*weight0 - src[ADDR]*weight1 + (1<<15))>>16
#endif
if(bClip)
{
......
......@@ -203,10 +203,6 @@ static const int MAX_BDOF_APPLICATION_REGION = 16;
static const int MAX_CPB_CNT = 32; ///< Upper bound of (cpb_cnt_minus1 + 1)
static const int MAX_NUM_LAYER_IDS = 64;
static const int COEF_REMAIN_BIN_REDUCTION = 5; ///< indicates the level at which the VLC transitions from Golomb-Rice to TU+EG(k)
#if !JVET_R0351_HIGH_BIT_DEPTH_SUPPORT
static const int COEFF_MIN = -32768;
static const int COEFF_MAX = 32767;
#endif
static const int CU_DQP_TU_CMAX = 5; ///< max number bins for truncated unary
static const int CU_DQP_EG_k = 0; ///< expgolomb order
......@@ -221,12 +217,7 @@ static const int NUM_APS_TYPE_LEN = 3; //Curren
static const int MAX_NUM_APS_TYPE = 8; //Currently APS Type has 3 bits so the max type is 8
static const int MAX_TILE_COLS = 20; ///< Maximum number of tile columns
#if JVET_S0156_LEVEL_DEFINITION
static const int MAX_TILES = 440; ///< Maximum number of tiles
#else
static const int MAX_TILE_ROWS = 22; ///< Maximum number of tile rows
static const int MAX_TILES = MAX_TILE_COLS * MAX_TILE_ROWS; ///< Maximum number of tiles
#endif
static const int MAX_SLICES = 600; ///< Maximum number of slices per picture
static const int MLS_GRP_NUM = 1024; ///< Max number of coefficient groups, max(16, 256)
......@@ -635,11 +626,7 @@ const char* read_x86_extension(const std::string &extStrId);
template <typename ValueType> inline ValueType leftShift (const ValueType value, const int shift) { return (shift >= 0) ? ( value << shift) : ( value >> -shift); }
template <typename ValueType> inline ValueType rightShift (const ValueType value, const int shift) { return (shift >= 0) ? ( value >> shift) : ( value << -shift); }
template <typename ValueType> inline ValueType leftShift_round (const ValueType value, const int shift) { return (shift >= 0) ? ( value << shift) : ((value + (ValueType(1) << (-shift - 1))) >> -shift); }
#if JVET_R0351_HIGH_BIT_DEPTH_SUPPORT
template <typename ValueType> inline ValueType rightShift_round(const ValueType value, const int shift) { return (shift > 0) ? ((value + (ValueType(1) << (shift - 1))) >> shift) : ( value << -shift); }
#else
template <typename ValueType> inline ValueType rightShift_round(const ValueType value, const int shift) { return (shift >= 0) ? ((value + (ValueType(1) << (shift - 1))) >> shift) : ( value << -shift); }
#endif
static inline int floorLog2(uint32_t x)
{
......
......@@ -69,10 +69,8 @@ CoeffCodingContext::CoeffCodingContext( const TransformUnit& tu, ComponentID com
, m_lastShiftX (0)
, m_lastShiftY (0)
, m_TrafoBypass (tu.cs->sps->getSpsRangeExtension().getTransformSkipContextEnabledFlag() && (tu.mtsIdx[m_compID] == MTS_SKIP))
#if JVET_R0351_HIGH_BIT_DEPTH_SUPPORT
, m_minCoeff (-(1 << tu.cs->sps->getMaxLog2TrDynamicRange(m_chType)))
, m_maxCoeff ((1 << tu.cs->sps->getMaxLog2TrDynamicRange(m_chType)) - 1)
#endif
, m_scanPosLast (-1)
, m_subSetId (-1)
, m_subSetPos (-1)
......