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
Showing with 688 additions and 9 deletions
......@@ -78,6 +78,9 @@ protected:
std::string m_SEICTIFileName; ///< output Recon with CTI file name
std::string m_SEIFGSFileName; ///< output file name for reconstructed sequence with film grain
std::string m_annotatedRegionsSEIFileName; ///< annotated regions file name
#if JVET_AI0153_OMI_SEI
std::string m_objectMaskInfoSEIFileName; ///< object mask information file name
#endif
std::vector<int> m_targetDecLayerIdSet; ///< set of LayerIds to be included in the sub-bitstream extraction process.
std::string m_outputDecodedSEIMessagesFilename; ///< filename to output decoded SEI messages to. If '-', then use stdout. If empty, do not output details.
#if JVET_S0257_DUMP_360SEI_MESSAGE
......
......@@ -998,6 +998,9 @@ void EncApp::xInitLibCfg( int layerIdx )
m_cEncLib.setOmniViewportSEIHorRange ( m_omniViewportSEIHorRange );
m_cEncLib.setOmniViewportSEIVerRange ( m_omniViewportSEIVerRange );
m_cEncLib.setAnnotatedRegionSEIFileRoot (m_arSEIFileRoot);
#if JVET_AI0153_OMI_SEI
m_cEncLib.setObjectMaskInfoSEIFileRoot (m_omiSEIFileRoot);
#endif
m_cEncLib.setRwpSEIEnabled (m_rwpSEIEnabled);
m_cEncLib.setRwpSEIRwpCancelFlag (m_rwpSEIRwpCancelFlag);
m_cEncLib.setRwpSEIRwpPersistenceFlag (m_rwpSEIRwpPersistenceFlag);
......@@ -1160,6 +1163,9 @@ void EncApp::xInitLibCfg( int layerIdx )
m_cEncLib.setSdiSEIViewIdVal (m_sdiSEIViewIdVal);
m_cEncLib.setSdiSEIAuxId (m_sdiSEIAuxId);
m_cEncLib.setSdiSEINumAssociatedPrimaryLayersMinus1 (m_sdiSEINumAssociatedPrimaryLayersMinus1);
#if JVET_AI0153_OMI_SEI
m_cEncLib.setSdiSEIAssociatedPrimaryLayerIdx (m_sdiSEIAssociatedPrimaryLayerIdx);
#endif
// multiview acquisition information sei
m_cEncLib.setMaiSEIEnabled (m_maiSEIEnabled);
m_cEncLib.setMaiSEIIntrinsicParamFlag (m_maiSEIIntrinsicParamFlag);
......@@ -1268,6 +1274,15 @@ void EncApp::xInitLibCfg( int layerIdx )
{
m_cEncLib.setNNPostFilterSEICharacteristicsNumberExtrapolatedPicturesMinus1( m_nnPostFilterSEICharacteristicsNumberExtrapolatedPicturesMinus1[i], i);
}
#if NNPFC_SPATIAL_EXTRAPOLATION
if ((m_cEncLib.getNNPostFilterSEICharacteristicsPurpose(i) & NNPC_PurposeType::SPATIAL_EXTRAPOLATION) != 0)
{
m_cEncLib.setNNPostFilterSEICharacteristicsSpatialExtrapolationLeftOffset (m_nnPostFilterSEICharacteristicsSpatialExtrapolationLeftOffset[i], i);
m_cEncLib.setNNPostFilterSEICharacteristicsSpatialExtrapolationRightOffset (m_nnPostFilterSEICharacteristicsSpatialExtrapolationRightOffset[i], i);
m_cEncLib.setNNPostFilterSEICharacteristicsSpatialExtrapolationTopOffset (m_nnPostFilterSEICharacteristicsSpatialExtrapolationTopOffset[i], i);
m_cEncLib.setNNPostFilterSEICharacteristicsSpatialExtrapolationBottomOffset(m_nnPostFilterSEICharacteristicsSpatialExtrapolationBottomOffset[i], i);
}
#endif
m_cEncLib.setNNPostFilterSEICharacteristicsAbsentInputPicZeroFlag (m_nnPostFilterSEICharacteristicsAbsentInputPicZeroFlag[i], i);
m_cEncLib.setNNPostFilterSEICharacteristicsComponentLastFlag (m_nnPostFilterSEICharacteristicsComponentLastFlag[i], i);
m_cEncLib.setNNPostFilterSEICharacteristicsInpFormatIdc (m_nnPostFilterSEICharacteristicsInpFormatIdc[i], i);
......
......@@ -696,6 +696,9 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
SMultiValueInput<uint32_t> cfg_sdiSEIViewIdVal (0, 63, 0, std::numeric_limits<uint32_t>::max());
SMultiValueInput<uint32_t> cfg_sdiSEIAuxId (0, 255, 0, 63);
SMultiValueInput<uint32_t> cfg_sdiSEINumAssociatedPrimaryLayersMinus1 (0, 63, 0, 63);
#if JVET_AI0153_OMI_SEI
SMultiValueInput<uint32_t> cfg_sdiSEIAssociatedPrimaryLayerIdx(0, 63, 0, 63);
#endif
SMultiValueInput<bool> cfg_maiSEISignFocalLengthX (0, 1, 0, std::numeric_limits<uint32_t>::max());
SMultiValueInput<uint32_t> cfg_maiSEIExponentFocalLengthX (0, 63, 0, std::numeric_limits<uint32_t>::max());
SMultiValueInput<uint32_t> cfg_maiSEIMantissaFocalLengthX (0, std::numeric_limits<uint32_t>::max(), 0, std::numeric_limits<uint32_t>::max());
......@@ -1467,6 +1470,9 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
("SEISubpicLevelInfoExplicitFraction", m_cfgSubpictureLevelInfoSEI.m_explicitFraction, false, "Enable sending of explicit fractions in Subpicture Level Information SEI messages")
("SEISubpicLevelInfoNumSubpics", m_cfgSubpictureLevelInfoSEI.m_numSubpictures, 1, "Number of subpictures for Subpicture Level Information SEI messages")
("SEIAnnotatedRegionsFileRoot,-ar", m_arSEIFileRoot, std::string(""), "Annotated region SEI parameters root file name (wo num ext); only the file name base is to be added. Underscore and POC would be automatically addded to . E.g. \"-ar ar\" will search for files ar_0.txt, ar_1.txt, ...")
#if JVET_AI0153_OMI_SEI
("SEIObjectMaskFileRoot,-omi", m_omiSEIFileRoot, std::string(""), "Object mask information SEI parameters root file name (wo num ext); only the file name base is to be added. Underscore and POC would be automatically added to . E.g. \"-omi omi\" will search for files omi_0.txt, omi_1.txt, ...")
#endif
("SEISubpicLevelInfoMaxSublayers", m_cfgSubpictureLevelInfoSEI.m_sliMaxSublayers, 1, "Number of sublayers for Subpicture Level Information SEI messages")
("SEISubpicLevelInfoSublayerInfoPresentFlag", m_cfgSubpictureLevelInfoSEI.hasSublayerInfo, false, "Enable sending of level information for all sublayers in Subpicture Level Information SEI messages")
("SEISubpicLevelInfoRefLevelFractions", cfg_sliFractions, cfg_sliFractions, "List of subpicture level fractions for Subpicture Level Information SEI messages")
......@@ -1613,6 +1619,9 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
("SEISDIViewIdVal", cfg_sdiSEIViewIdVal, cfg_sdiSEIViewIdVal, "List of the view identifiers in the scalaibility dimension information SEI message")
("SEISDIAuxId", cfg_sdiSEIAuxId, cfg_sdiSEIAuxId, "List of the auxiliary identifiers in the scalaibility dimension information SEI message")
("SEISDINumAssociatedPrimaryLayersMinus1", cfg_sdiSEINumAssociatedPrimaryLayersMinus1, cfg_sdiSEINumAssociatedPrimaryLayersMinus1, "List of the numbers of associated primary layers of i-th layer, which is an auxiliary layer.")
#if JVET_AI0153_OMI_SEI
("SEISDIAssociatedPrimaryLayerIdx", cfg_sdiSEIAssociatedPrimaryLayerIdx, cfg_sdiSEIAssociatedPrimaryLayerIdx, "List of the layer index of the j-th associated primary layer of the i-th layer, which is an auxiliary layer. It is a 1-d list and the number of the associated primary layer of the i-th auxiliary layer is indicated by cfg_sdiSEINumAssociatedPrimaryLayersMinus1 and cfg_sdiSEIAuxId.")
#endif
// multiview acquisition information SEI
("SEIMAIEnabled", m_maiSEIEnabled, false, "Control generation of multiview acquisition information SEI message")
("SEIMAIIntrinsicParamFlag", m_maiSEIIntrinsicParamFlag, false, "Specifies the presence of intrinsic camera parameters in the multiview acquisition information SEI message")
......@@ -2052,6 +2061,23 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
std::ostringstream numberExtrapolatedPicturesMinus1;
numberExtrapolatedPicturesMinus1 << "SEINNPFCNumberExtrapolatedPicsMinus1" << i;
opts.addOptions()(numberExtrapolatedPicturesMinus1.str(), m_nnPostFilterSEICharacteristicsNumberExtrapolatedPicturesMinus1[i], 0u, "Number of pictures to extrapolate");
#if NNPFC_SPATIAL_EXTRAPOLATION
std::ostringstream spatialExtrapolationLeftOffset;
spatialExtrapolationLeftOffset << "SEINNPFCSpatialExtrapolationLeftOffset" << i;
opts.addOptions()(spatialExtrapolationLeftOffset.str(), m_nnPostFilterSEICharacteristicsSpatialExtrapolationLeftOffset[i], 0, "Left offset of spatial extrapolation");
std::ostringstream spatialExtrapolationRightOffset;
spatialExtrapolationRightOffset << "SEINNPFCSpatialExtrapolationRightOffset" << i;
opts.addOptions()(spatialExtrapolationRightOffset.str(), m_nnPostFilterSEICharacteristicsSpatialExtrapolationRightOffset[i], 0, "Right offset of spatial extrapolation");
std::ostringstream spatialExtrapolationTopOffset;
spatialExtrapolationTopOffset << "SEINNPFCSpatialExtrapolationTopOffset" << i;
opts.addOptions()(spatialExtrapolationTopOffset.str(), m_nnPostFilterSEICharacteristicsSpatialExtrapolationTopOffset[i], 0, "Top offset of spatial extrapolation");
std::ostringstream spatialExtrapolationBottomOffset;
spatialExtrapolationBottomOffset << "SEINNPFCSpatialExtrapolationLeftOffset" << i;
opts.addOptions()(spatialExtrapolationBottomOffset.str(), m_nnPostFilterSEICharacteristicsSpatialExtrapolationBottomOffset[i], 0, "Bottom offset of spatial extrapolation");
#endif
std::ostringstream InputPicOutputFlag;
InputPicOutputFlag << "SEINNPFCInputPicOutputFlag" << i;
opts.addOptions()(InputPicOutputFlag.str(), cfg_nnPostFilterSEICharacteristicsInputPicOutputFlagList[i], cfg_nnPostFilterSEICharacteristicsInputPicOutputFlagList[i], "Indicates whether NNPF will generate a corresponding output picture for the input picture");
......@@ -3497,6 +3523,9 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
m_sdiSEIViewIdVal.resize(m_sdiSEIMaxLayersMinus1 + 1);
m_sdiSEIAuxId.resize(m_sdiSEIMaxLayersMinus1 + 1);
m_sdiSEINumAssociatedPrimaryLayersMinus1.resize(m_sdiSEIMaxLayersMinus1 + 1);
#if JVET_AI0153_OMI_SEI
uint32_t associatedPrimaryLayerIdxListCnt = 0;
#endif
for (int i = 0; i <= m_sdiSEIMaxLayersMinus1; i++)
{
m_sdiSEILayerId[i] = cfg_sdiSEILayerId.values[i];
......@@ -3510,6 +3539,14 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
if (m_sdiSEIAuxId[i] > 0)
{
m_sdiSEINumAssociatedPrimaryLayersMinus1[i] = cfg_sdiSEINumAssociatedPrimaryLayersMinus1.values[i];
#if JVET_AI0153_OMI_SEI
m_sdiSEIAssociatedPrimaryLayerIdx.resize(associatedPrimaryLayerIdxListCnt + m_sdiSEINumAssociatedPrimaryLayersMinus1[i] + 1);
for (uint32_t k = 0; k <= m_sdiSEINumAssociatedPrimaryLayersMinus1[i]; k++)
{
m_sdiSEIAssociatedPrimaryLayerIdx[associatedPrimaryLayerIdxListCnt + k] = cfg_sdiSEIAssociatedPrimaryLayerIdx.values[associatedPrimaryLayerIdxListCnt + k];
}
associatedPrimaryLayerIdxListCnt += (m_sdiSEINumAssociatedPrimaryLayersMinus1[i] + 1);
#endif
}
}
}
......@@ -5304,6 +5341,16 @@ bool EncAppCfg::xCheckParameter()
xConfirmPara(m_nnPostFilterSEICharacteristicsPurpose[i] > 127, "SEINNPFCPurpose must be in the range of 0 to 127");
xConfirmPara(m_nnPostFilterSEICharacteristicsNumberInputDecodedPicturesMinus1[i] > 63, "SEINNPFCNumberInputDecodedPicturesMinus1 must be in the range of 0 to 63");
xConfirmPara(m_nnPostFilterSEICharacteristicsNumberExtrapolatedPicturesMinus1[i] > 62, "SEINNPFCNumberExtrapolatedPicsMinus1 must be in the range of 0 to 62");
#if NNPFC_SPATIAL_EXTRAPOLATION
xConfirmPara(m_nnPostFilterSEICharacteristicsSpatialExtrapolationLeftOffset[i] < -65536 || m_nnPostFilterSEICharacteristicsSpatialExtrapolationLeftOffset[i] > 65536,
"SEINNPFCCharacteristicSpatialExtrapolationLeftOffset must be in the range of -65536 to 65536");
xConfirmPara(m_nnPostFilterSEICharacteristicsSpatialExtrapolationRightOffset[i] < -65536 || m_nnPostFilterSEICharacteristicsSpatialExtrapolationRightOffset[i] > 65536,
"SEINNPFCCharacteristicSpatialExtrapolationRightOffset must be in the range of -65536 to 65536");
xConfirmPara(m_nnPostFilterSEICharacteristicsSpatialExtrapolationTopOffset[i] < -65536 || m_nnPostFilterSEICharacteristicsSpatialExtrapolationTopOffset[i] > 65536,
"SEINNPFCCharacteristicSpatialExtrapolationTopOffset must be in the range of -65536 to 65536");
xConfirmPara(m_nnPostFilterSEICharacteristicsSpatialExtrapolationBottomOffset[i] < -65536 || m_nnPostFilterSEICharacteristicsSpatialExtrapolationBottomOffset[i] > 65536,
"SEINNPFCCharacteristicSpatialExtrapolationBottomOffset must be in the range of -65536 to 65536");
#endif
xConfirmPara(m_nnPostFilterSEICharacteristicsInpTensorBitDepthLumaMinus8[i] > 24, "SEINNPFCInpTensorBitDepthLumaMinus8 must be in the range of 0 to 24");
xConfirmPara(m_nnPostFilterSEICharacteristicsInpTensorBitDepthChromaMinus8[i] > 24, "SEINNPFCInpTensorBitDepthChromaMinus8 must be in the range of 0 to 24");
xConfirmPara(m_nnPostFilterSEICharacteristicsOutTensorBitDepthLumaMinus8[i] > 24, "SEINNPFCOutTensorBitDepthLumaMinus8 must be in the range of 0 to 24");
......
......@@ -626,6 +626,9 @@ protected:
std::vector<uint32_t> m_sdiSEIViewIdVal;
std::vector<uint32_t> m_sdiSEIAuxId;
std::vector<uint32_t> m_sdiSEINumAssociatedPrimaryLayersMinus1;
#if JVET_AI0153_OMI_SEI
std::vector<uint32_t> m_sdiSEIAssociatedPrimaryLayerIdx;
#endif
// multiview acquisition information sei
bool m_maiSEIEnabled;
bool m_maiSEIIntrinsicParamFlag;
......@@ -707,6 +710,9 @@ protected:
std::vector<uint32_t> m_omniViewportSEIHorRange;
std::vector<uint32_t> m_omniViewportSEIVerRange;
std::string m_arSEIFileRoot; // Annotated region SEI - initialized from external file
#if JVET_AI0153_OMI_SEI
std::string m_omiSEIFileRoot; // Object mask information SEI - initialized from external file
#endif
bool m_rwpSEIEnabled;
bool m_rwpSEIRwpCancelFlag;
bool m_rwpSEIRwpPersistenceFlag;
......@@ -818,6 +824,12 @@ protected:
uint32_t m_nnPostFilterSEICharacteristicsNumberInputDecodedPicturesMinus1[MAX_NUM_NN_POST_FILTERS];
std::vector<uint32_t> m_nnPostFilterSEICharacteristicsNumberInterpolatedPictures[MAX_NUM_NN_POST_FILTERS];
uint32_t m_nnPostFilterSEICharacteristicsNumberExtrapolatedPicturesMinus1[MAX_NUM_NN_POST_FILTERS];
#if NNPFC_SPATIAL_EXTRAPOLATION
int32_t m_nnPostFilterSEICharacteristicsSpatialExtrapolationLeftOffset[MAX_NUM_NN_POST_FILTERS];
int32_t m_nnPostFilterSEICharacteristicsSpatialExtrapolationRightOffset[MAX_NUM_NN_POST_FILTERS];
int32_t m_nnPostFilterSEICharacteristicsSpatialExtrapolationTopOffset[MAX_NUM_NN_POST_FILTERS];
int32_t m_nnPostFilterSEICharacteristicsSpatialExtrapolationBottomOffset[MAX_NUM_NN_POST_FILTERS];
#endif
std::vector<bool> m_nnPostFilterSEICharacteristicsInputPicOutputFlag[MAX_NUM_NN_POST_FILTERS];
bool m_nnPostFilterSEICharacteristicsAbsentInputPicZeroFlag[MAX_NUM_NN_POST_FILTERS];
bool m_nnPostFilterSEIActivationCancelFlag;
......
......@@ -1022,6 +1022,12 @@ SEINeuralNetworkPostFilterCharacteristics::SEINeuralNetworkPostFilterCharacteris
m_numberInputDecodedPicturesMinus1 = sei.m_numberInputDecodedPicturesMinus1;
m_numberInterpolatedPictures = sei.m_numberInterpolatedPictures;
m_numberExtrapolatedPicturesMinus1 = sei.m_numberExtrapolatedPicturesMinus1;
#if NNPFC_SPATIAL_EXTRAPOLATION
m_spatialExtrapolationLeftOffset = sei.m_spatialExtrapolationLeftOffset;
m_spatialExtrapolationRightOffset = sei.m_spatialExtrapolationRightOffset;
m_spatialExtrapolationTopOffset = sei.m_spatialExtrapolationTopOffset;
m_spatialExtrapolationBottomOffset = sei.m_spatialExtrapolationBottomOffset;
#endif
m_inputPicOutputFlag = sei.m_inputPicOutputFlag;
}
......@@ -1084,6 +1090,12 @@ bool SEINeuralNetworkPostFilterCharacteristics::operator == (const SEINeuralNetw
m_numberInputDecodedPicturesMinus1 == sei.m_numberInputDecodedPicturesMinus1 &&
m_numberInterpolatedPictures == sei.m_numberInterpolatedPictures &&
m_numberExtrapolatedPicturesMinus1 == sei.m_numberExtrapolatedPicturesMinus1 &&
#if NNPFC_SPATIAL_EXTRAPOLATION
m_spatialExtrapolationLeftOffset == sei.m_spatialExtrapolationLeftOffset &&
m_spatialExtrapolationRightOffset == sei.m_spatialExtrapolationRightOffset &&
m_spatialExtrapolationTopOffset == sei.m_spatialExtrapolationTopOffset &&
m_spatialExtrapolationBottomOffset == sei.m_spatialExtrapolationBottomOffset &&
#endif
m_inputPicOutputFlag == sei.m_inputPicOutputFlag &&
m_payloadLength == sei.m_payloadLength;
......
......@@ -107,9 +107,13 @@ public:
#if JVET_AG2034_SPTI_SEI
SOURCE_PICTURE_TIMING_INFO = 216,
#endif
#if JVET_AI0153_OMI_SEI
OBJECT_MASK_INFO = 217,
#endif
#if JVET_AH2006_TXTDESCRINFO_SEI
SEI_TEXT_DESCRIPTION = 219,
#endif
};
SEI() {}
......@@ -1275,6 +1279,60 @@ public:
std::vector<std::pair<AnnotatedRegionLabelIndex, AnnotatedRegionLabel> > m_annotatedLabels;
};
#if JVET_AI0153_OMI_SEI
class SEIObjectMaskInfos : public SEI
{
public:
PayloadType payloadType() const { return PayloadType::OBJECT_MASK_INFO; }
SEIObjectMaskInfos() {}
SEIObjectMaskInfos(const SEIObjectMaskInfos& sei) { copyFrom(sei); }
virtual ~SEIObjectMaskInfos() {}
void copyFrom(const SEIObjectMaskInfos& seiObjectMask) { (*this) = seiObjectMask; }
struct ObjectMaskInfo
{
ObjectMaskInfo() : maskCancel(false), maskBoundingBoxPresentFlag(false) {}
bool maskCancel;
uint32_t maskId;
uint32_t auxSampleValue;
bool maskBoundingBoxPresentFlag;
uint32_t maskTop;
uint32_t maskLeft;
uint32_t maskWidth;
uint32_t maskHeight;
uint32_t maskConfidence;
uint32_t maskDepth;
std::string maskLabel;
};
struct ObjectMaskInfoHeader
{
ObjectMaskInfoHeader() : m_cancelFlag(true), m_receivedSettingsOnce(false) {}
bool m_cancelFlag;
bool m_receivedSettingsOnce; // used for decoder conformance checking. Other confidence flags must be unchanged
// once this flag is set.
bool m_persistenceFlag;
uint32_t m_numAuxPicLayerMinus1;
uint32_t m_maskIdLengthMinus1;
uint32_t m_maskSampleValueLengthMinus8;
bool m_maskConfidenceInfoPresentFlag;
uint32_t m_maskConfidenceLengthMinus1; // Only valid if m_maskConfidenceInfoPresentFlag
bool m_maskDepthInfoPresentFlag;
uint32_t m_maskDepthLengthMinus1; // Only valid if m_maskDepthInfoPresentFlag
bool m_maskLabelInfoPresentFlag;
bool m_maskLabelLanguagePresentFlag; // Only valid if m_maskLabelInfoPresentFlag
// SEIOmiBitEqualToZero
std::string m_maskLabelLanguage; // Only valid if m_maskLabelLanguagePresentFlag
};
ObjectMaskInfoHeader m_hdr;
std::vector<uint32_t> m_maskPicUpdateFlag;
std::vector<uint32_t> m_numMaskInPicUpdate;
std::vector<ObjectMaskInfo> m_objectMaskInfos;
};
#endif
class SEIExtendedDrapIndication : public SEI
{
public:
......@@ -1377,6 +1435,12 @@ public:
, m_totalKilobyteSize(0)
, m_numberInputDecodedPicturesMinus1(0)
, m_numberExtrapolatedPicturesMinus1(0)
#if NNPFC_SPATIAL_EXTRAPOLATION
, m_spatialExtrapolationLeftOffset(0)
, m_spatialExtrapolationRightOffset(0)
, m_spatialExtrapolationTopOffset(0)
, m_spatialExtrapolationBottomOffset(0)
#endif
, m_absentInputPicZeroFlag(false)
, m_numInpPicsInOutputTensor(0)
{}
......@@ -1458,6 +1522,12 @@ public:
uint32_t m_numberInputDecodedPicturesMinus1;
std::vector<uint32_t> m_numberInterpolatedPictures;
uint32_t m_numberExtrapolatedPicturesMinus1;
#if NNPFC_SPATIAL_EXTRAPOLATION
int32_t m_spatialExtrapolationLeftOffset;
int32_t m_spatialExtrapolationRightOffset;
int32_t m_spatialExtrapolationTopOffset;
int32_t m_spatialExtrapolationBottomOffset;
#endif
std::vector<bool> m_inputPicOutputFlag;
bool m_absentInputPicZeroFlag;
uint32_t m_numInpPicsInOutputTensor;
......
......@@ -68,6 +68,8 @@
#define JVET_AI0071_NNPFC_SPO_USAGE_IDCS 1 // Indication of the user viewing and/or machine analysis usage in the NNPFC and SPO SEI messages
#define JVET_AI0153_OMI_SEI 1 // JVET-AI0153: OMI-SEI Implementation as JVET-AH0346
//########### place macros to be be kept below this line ###############
#define GDR_ENABLED 1
......@@ -90,6 +92,8 @@
#define JVET_AH2006_EOI_SEI 1 // Implementation of Encoder Optimizaion Information SEI message
#define NNPFC_SPATIAL_EXTRAPOLATION 1 // Implementation of the spatial extrapolation purpose
#define JVET_AH2006_TXTDESCRINFO_SEI 1 // Text description information message
#define REUSE_CU_RESULTS 1
......@@ -820,7 +824,10 @@ enum NNPC_PurposeType
FRAME_RATE_UPSAMPLING = 8,
BIT_DEPTH_UPSAMPLING = 16,
COLOURIZATION = 32,
TEMPORAL_EXTRAPOLATION = 64
TEMPORAL_EXTRAPOLATION = 64,
#if NNPFC_SPATIAL_EXTRAPOLATION
SPATIAL_EXTRAPOLATION = 128
#endif
};
enum POST_FILTER_MODE
......
......@@ -382,6 +382,12 @@ bool SEIReader::xReadSEImessage(SEIMessages& seis, const NalUnitType nalUnitType
sei = new SEIAnnotatedRegions;
xParseSEIAnnotatedRegions((SEIAnnotatedRegions &) *sei, payloadSize, pDecodedMessageOutputStream);
break;
#if JVET_AI0153_OMI_SEI
case SEI::PayloadType::OBJECT_MASK_INFO:
sei = new SEIObjectMaskInfos;
xParseSEIObjectMaskInfos((SEIObjectMaskInfos&) *sei, payloadSize, pDecodedMessageOutputStream);
break;
#endif
case SEI::PayloadType::PARAMETER_SETS_INCLUSION_INDICATION:
sei = new SEIParameterSetsInclusionIndication;
xParseSEIParameterSetsInclusionIndication((SEIParameterSetsInclusionIndication &) *sei, payloadSize,
......@@ -1870,6 +1876,141 @@ void SEIReader::xParseSEIAnnotatedRegions(SEIAnnotatedRegions& sei, uint32_t pay
}
}
#if JVET_AI0153_OMI_SEI
void SEIReader::xParseSEIObjectMaskInfos(SEIObjectMaskInfos& sei, uint32_t payloadSize, std::ostream* pDecodedMessageOutputStream)
{
output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize);
uint32_t val;
sei_read_flag(pDecodedMessageOutputStream, val, "omi_cancel_flag");
sei.m_hdr.m_cancelFlag = val;
if (!sei.m_hdr.m_cancelFlag)
{
sei_read_flag(pDecodedMessageOutputStream, val, "omi_persistence_flag");
sei.m_hdr.m_persistenceFlag = val;
sei_read_uvlc(pDecodedMessageOutputStream, val, "omi_num_aux_pic_layer_minus1");
sei.m_hdr.m_numAuxPicLayerMinus1 = val;
sei_read_uvlc(pDecodedMessageOutputStream, val, "omi_mask_id_length_minus1");
sei.m_hdr.m_maskIdLengthMinus1 = val;
sei_read_uvlc(pDecodedMessageOutputStream, val, "omi_mask_sample_value_length_minus8");
sei.m_hdr.m_maskSampleValueLengthMinus8 = val;
sei_read_flag(pDecodedMessageOutputStream, val, "omi_mask_confidence_info_present_flag");
sei.m_hdr.m_maskConfidenceInfoPresentFlag = val;
if (sei.m_hdr.m_maskConfidenceInfoPresentFlag)
{
sei_read_code(pDecodedMessageOutputStream, 4, val, "omi_mask_confidence_length_minus1");
sei.m_hdr.m_maskConfidenceLengthMinus1 = val;
}
sei_read_flag(pDecodedMessageOutputStream, val, "omi_mask_depth_info_present_flag");
sei.m_hdr.m_maskDepthInfoPresentFlag = val;
if (sei.m_hdr.m_maskDepthInfoPresentFlag)
{
sei_read_code(pDecodedMessageOutputStream, 4, val, "omi_mask_depth_length_minus1");
sei.m_hdr.m_maskDepthLengthMinus1 = val;
}
sei_read_flag(pDecodedMessageOutputStream, val, "omi_mask_label_info_present_flag");
sei.m_hdr.m_maskLabelInfoPresentFlag = val;
if (sei.m_hdr.m_maskLabelInfoPresentFlag)
{
sei_read_flag(pDecodedMessageOutputStream, val, "omi_mask_label_language_present_flag");
sei.m_hdr.m_maskLabelLanguagePresentFlag = val;
if (sei.m_hdr.m_maskLabelLanguagePresentFlag)
{
// byte alignment
while (!isByteAligned())
{
uint32_t code;
sei_read_flag(pDecodedMessageOutputStream, code, "omi_bit_equal_to_zero");
CHECK(code != 0, "non-zero value parsed for zero-bit");
}
sei.m_hdr.m_maskLabelLanguage.clear();
do
{
sei_read_code(pDecodedMessageOutputStream, 8, val, "omi_mask_lable_language");
if (val)
{
sei.m_hdr.m_maskLabelLanguage.push_back((char) val);
}
} while (val != '\0');
CHECK(sei.m_hdr.m_maskLabelLanguage.size() > 255, "label oversize");
}
}
sei.m_maskPicUpdateFlag.resize(sei.m_hdr.m_numAuxPicLayerMinus1 + 1);
sei.m_numMaskInPicUpdate.resize(sei.m_hdr.m_numAuxPicLayerMinus1 + 1);
for (uint32_t i = 0; i <= sei.m_hdr.m_numAuxPicLayerMinus1; i++)
{
sei_read_flag(pDecodedMessageOutputStream, val, "omi_mask_pic_update_flag[i]");
sei.m_maskPicUpdateFlag[i] = val;
if (sei.m_maskPicUpdateFlag[i])
{
sei_read_uvlc(pDecodedMessageOutputStream, val, "omi_num_mask_in_pic_update[i]");
sei.m_numMaskInPicUpdate[i] = val;
for (uint32_t j = 0; j < sei.m_numMaskInPicUpdate[i]; j++)
{
SEIObjectMaskInfos::ObjectMaskInfo objMaskInfo;
sei_read_code(pDecodedMessageOutputStream, sei.m_hdr.m_maskIdLengthMinus1 + 1, val, "omi_mask_id[i][j]");
objMaskInfo.maskId = val;
sei_read_code(pDecodedMessageOutputStream, sei.m_hdr.m_maskSampleValueLengthMinus8 + 8, val, "omi_aux_sample_value[i][j]");
objMaskInfo.auxSampleValue = val;
sei_read_flag(pDecodedMessageOutputStream, val, "omi_mask_cancel[i][j]");
objMaskInfo.maskCancel = val;
if (!objMaskInfo.maskCancel)
{
sei_read_flag(pDecodedMessageOutputStream, val, "omi_mask_bounding_box_present_flag[i][j]");
objMaskInfo.maskBoundingBoxPresentFlag = val;
if (objMaskInfo.maskBoundingBoxPresentFlag)
{
sei_read_code(pDecodedMessageOutputStream, 16, val, "omi_mask_top[i][j]");
objMaskInfo.maskTop = val;
sei_read_code(pDecodedMessageOutputStream, 16, val, "omi_mask_left[i][j]");
objMaskInfo.maskLeft = val;
sei_read_code(pDecodedMessageOutputStream, 16, val, "omi_mask_width[i][j]");
objMaskInfo.maskWidth = val;
sei_read_code(pDecodedMessageOutputStream, 16, val, "omi_mask_height[i][j]");
objMaskInfo.maskHeight = val;
}
if (sei.m_hdr.m_maskConfidenceInfoPresentFlag)
{
sei_read_code(pDecodedMessageOutputStream, sei.m_hdr.m_maskConfidenceLengthMinus1 + 1, val, "omi_mask_confidence[i][j]");
objMaskInfo.maskConfidence = val;
}
if (sei.m_hdr.m_maskDepthInfoPresentFlag)
{
sei_read_code(pDecodedMessageOutputStream, sei.m_hdr.m_maskDepthLengthMinus1 + 1, val, "omi_mask_depth[i][j]");
objMaskInfo.maskDepth = val;
}
// byte alignment
while (!isByteAligned())
{
uint32_t code;
sei_read_flag(pDecodedMessageOutputStream, code, "omi_bit_equal_to_zero");
CHECK(code != 0, "non-zero value parsed for zero-bit");
}
if (sei.m_hdr.m_maskLabelInfoPresentFlag)
{
objMaskInfo.maskLabel.clear();
do
{
sei_read_code(pDecodedMessageOutputStream, 8, val, "omi_mask_label[i][j][k]");
if (val)
{
objMaskInfo.maskLabel.push_back((char) val);
}
} while (val != '\0');
CHECK(objMaskInfo.maskLabel.size() > 255, "label oversize");
}
}
sei.m_objectMaskInfos.push_back(objMaskInfo);
}
}
}
}
}
#endif
#if JVET_AH2006_EOI_SEI
void SEIReader::xParseSEIEncoderOptimizationInfo(SEIEncoderOptimizationInfo& sei, uint32_t payloadSize, std::ostream* pDecodedMessageOutputStream)
{
......@@ -3035,6 +3176,21 @@ void SEIReader::xParseSEINNPostFilterCharacteristics(SEINeuralNetworkPostFilterC
sei.m_numberExtrapolatedPicturesMinus1 = val;
}
#if NNPFC_SPATIAL_EXTRAPOLATION
if((sei.m_purpose & NNPC_PurposeType::SPATIAL_EXTRAPOLATION) != 0)
{
int32_t value;
sei_read_svlc(pDecodedMessageOutputStream, value, "nnpfc_spatial_extrapolation_left_offset");
sei.m_spatialExtrapolationLeftOffset = value;
sei_read_svlc(pDecodedMessageOutputStream, value, "nnpfc_spatial_extrapolation_right_offset");
sei.m_spatialExtrapolationRightOffset = value;
sei_read_svlc(pDecodedMessageOutputStream, value, "nnpfc_spatial_extrapolation_top_offset");
sei.m_spatialExtrapolationTopOffset = value;
sei_read_svlc(pDecodedMessageOutputStream, value, "nnpfc_spatial_extrapolation_bottom_offset");
sei.m_spatialExtrapolationBottomOffset = value;
}
#endif
sei_read_flag(pDecodedMessageOutputStream, val, "nnpfc_component_last_flag");
sei.m_componentLastFlag = val;
......
......@@ -89,6 +89,9 @@ protected:
void xParseSEIParameterSetsInclusionIndication(SEIParameterSetsInclusionIndication& sei, uint32_t payloadSize, std::ostream* pDecodedMessageOutputStream);
void xParseSEIMasteringDisplayColourVolume (SEIMasteringDisplayColourVolume& sei, uint32_t payloadSize, std::ostream *pDecodedMessageOutputStream);
void xParseSEIAnnotatedRegions (SEIAnnotatedRegions& sei, uint32_t payloadSize, std::ostream *pDecodedMessageOutputStream);
#if JVET_AI0153_OMI_SEI
void xParseSEIObjectMaskInfos (SEIObjectMaskInfos& sei, uint32_t payloadSize, std::ostream* pDecodedMessageOutputStream);
#endif
void xParseSEIAlternativeTransferCharacteristics(SEIAlternativeTransferCharacteristics& sei, uint32_t payLoadSize, std::ostream *pDecodedMessageOutputStream);
#if JVET_AH2006_EOI_SEI
void xParseSEIEncoderOptimizationInfo(SEIEncoderOptimizationInfo& sei, uint32_t payloadSize, std::ostream* pDecodedMessageOutputStream);
......
......@@ -773,6 +773,12 @@ protected:
uint32_t m_nnPostFilterSEICharacteristicsNumberInputDecodedPicturesMinus1[MAX_NUM_NN_POST_FILTERS];
std::vector<uint32_t> m_nnPostFilterSEICharacteristicsNumberInterpolatedPictures[MAX_NUM_NN_POST_FILTERS];
uint32_t m_nnPostFilterSEICharacteristicsNumberExtrapolatedPicturesMinus1[MAX_NUM_NN_POST_FILTERS];
#if NNPFC_SPATIAL_EXTRAPOLATION
int32_t m_nnPostFilterSEICharacteristicsSpatialExtrapolationLeftOffset[MAX_NUM_NN_POST_FILTERS];
int32_t m_nnPostFilterSEICharacteristicsSpatialExtrapolationRightOffset[MAX_NUM_NN_POST_FILTERS];
int32_t m_nnPostFilterSEICharacteristicsSpatialExtrapolationTopOffset[MAX_NUM_NN_POST_FILTERS];
int32_t m_nnPostFilterSEICharacteristicsSpatialExtrapolationBottomOffset[MAX_NUM_NN_POST_FILTERS];
#endif
std::vector<bool> m_nnPostFilterSEICharacteristicsInputPicOutputFlag[MAX_NUM_NN_POST_FILTERS];
bool m_nnPostFilterSEICharacteristicsAbsentInputPicZeroFlag[MAX_NUM_NN_POST_FILTERS];
......@@ -873,6 +879,9 @@ protected:
std::vector<uint32_t> m_sdiSEIViewIdVal;
std::vector<uint32_t> m_sdiSEIAuxId;
std::vector<uint32_t> m_sdiSEINumAssociatedPrimaryLayersMinus1;
#if JVET_AI0153_OMI_SEI
std::vector<uint32_t> m_sdiSEIAssociatedPrimaryLayerIdx;
#endif
// mai sei
bool m_maiSEIEnabled;
bool m_maiSEIIntrinsicParamFlag;
......@@ -928,6 +937,9 @@ protected:
int m_driSEINonlinearNumMinus1;
std::vector<uint32_t> m_driSEINonlinearModel;
std::string m_arSEIFileRoot; // Annotated region SEI - initialized from external file
#if JVET_AI0153_OMI_SEI
std::string m_omiSEIFileRoot; // Object mask information SEI - initialized from external file
#endif
bool m_SEIManifestSEIEnabled;
bool m_SEIPrefixIndicationSEIEnabled;
......@@ -2160,6 +2172,16 @@ public:
const std::vector<uint32_t>& getNNPostFilterSEICharacteristicsNumberInterpolatedPictures(int filterIdx) { return m_nnPostFilterSEICharacteristicsNumberInterpolatedPictures[filterIdx]; }
void setNNPostFilterSEICharacteristicsNumberExtrapolatedPicturesMinus1(uint32_t value, int filterIdx) { m_nnPostFilterSEICharacteristicsNumberExtrapolatedPicturesMinus1[filterIdx] = value; }
uint32_t getNNPostFilterSEICharacteristicsNumberExtrapolatedPicturesMinus1(int filterIdx) { return m_nnPostFilterSEICharacteristicsNumberExtrapolatedPicturesMinus1[filterIdx]; }
#if NNPFC_SPATIAL_EXTRAPOLATION
void setNNPostFilterSEICharacteristicsSpatialExtrapolationLeftOffset(int32_t value, int filterIdx) { m_nnPostFilterSEICharacteristicsSpatialExtrapolationLeftOffset[filterIdx] = value; }
int32_t getNNPostFilterSEICharacteristicsSpatialExtrapolationLeftOffset(int filterIdx) { return m_nnPostFilterSEICharacteristicsSpatialExtrapolationLeftOffset[filterIdx]; }
void setNNPostFilterSEICharacteristicsSpatialExtrapolationRightOffset(int32_t value, int filterIdx) { m_nnPostFilterSEICharacteristicsSpatialExtrapolationRightOffset[filterIdx] = value; }
int32_t getNNPostFilterSEICharacteristicsSpatialExtrapolationRightOffset(int filterIdx) { return m_nnPostFilterSEICharacteristicsSpatialExtrapolationRightOffset[filterIdx]; }
void setNNPostFilterSEICharacteristicsSpatialExtrapolationTopOffset(int32_t value, int filterIdx) { m_nnPostFilterSEICharacteristicsSpatialExtrapolationTopOffset[filterIdx] = value; }
int32_t getNNPostFilterSEICharacteristicsSpatialExtrapolationTopOffset(int filterIdx) { return m_nnPostFilterSEICharacteristicsSpatialExtrapolationTopOffset[filterIdx]; }
void setNNPostFilterSEICharacteristicsSpatialExtrapolationBottomOffset(int32_t value, int filterIdx) { m_nnPostFilterSEICharacteristicsSpatialExtrapolationBottomOffset[filterIdx] = value; }
int32_t getNNPostFilterSEICharacteristicsSpatialExtrapolationBottomOffset(int filterIdx) { return m_nnPostFilterSEICharacteristicsSpatialExtrapolationBottomOffset[filterIdx]; }
#endif
void setNNPostFilterSEICharacteristicsInputPicOutputFlag(std::vector<bool> value, int filterIdx) { m_nnPostFilterSEICharacteristicsInputPicOutputFlag[filterIdx] = value; }
const std::vector<bool>& getNNPostFilterSEICharacteristicsInputPicOutputFlag(int filterIdx) { return m_nnPostFilterSEICharacteristicsInputPicOutputFlag[filterIdx]; }
void setNNPostFilterSEICharacteristicsAbsentInputPicZeroFlag(bool absentInputPicZeroFlag, int filterIdx) { m_nnPostFilterSEICharacteristicsAbsentInputPicZeroFlag[filterIdx] = absentInputPicZeroFlag; }
......@@ -2297,6 +2319,10 @@ public:
uint32_t getOmniViewportSEIVerRange(int idx) { return m_omniViewportSEIVerRange[idx]; }
void setAnnotatedRegionSEIFileRoot(const std::string &s) { m_arSEIFileRoot = s; m_arObjects.clear();}
const std::string &getAnnotatedRegionSEIFileRoot() const { return m_arSEIFileRoot; }
#if JVET_AI0153_OMI_SEI
void setObjectMaskInfoSEIFileRoot(const std::string& s) { m_omiSEIFileRoot = s; }
const std::string& getObjectMaskInfoSEIFileRoot() const { return m_omiSEIFileRoot; }
#endif
void setRwpSEIEnabled(bool b) { m_rwpSEIEnabled = b; }
bool getRwpSEIEnabled() { return m_rwpSEIEnabled; }
void setRwpSEIRwpCancelFlag(bool b) { m_rwpSEIRwpCancelFlag = b; }
......@@ -2586,6 +2612,10 @@ public:
uint32_t getSdiSEIAuxId(int idx) const { return m_sdiSEIAuxId[idx]; }
void setSdiSEINumAssociatedPrimaryLayersMinus1(const std::vector<uint32_t>& sdiSEINumAssociatedPrimaryLayersMinus1) { m_sdiSEINumAssociatedPrimaryLayersMinus1 = sdiSEINumAssociatedPrimaryLayersMinus1; }
uint32_t getSdiSEINumAssociatedPrimaryLayersMinus1(int idx) const { return m_sdiSEINumAssociatedPrimaryLayersMinus1[idx]; }
#if JVET_AI0153_OMI_SEI
void setSdiSEIAssociatedPrimaryLayerIdx(const std::vector<uint32_t>& sdiSEIAssociatedPrimaryLayerIdx) { m_sdiSEIAssociatedPrimaryLayerIdx = sdiSEIAssociatedPrimaryLayerIdx; }
uint32_t getSdiSEIAssociatedPrimaryLayerIdx(int idx) const { return m_sdiSEIAssociatedPrimaryLayerIdx[idx]; }
#endif
// multiview acquisition information SEI
void setMaiSEIEnabled(bool b) { m_maiSEIEnabled = b; }
bool getMaiSEIEnabled() const { return m_maiSEIEnabled; }
......
......@@ -1002,6 +1002,24 @@ void EncGOP::xCreatePerPictureSEIMessages (int picInGOP, SEIMessages& seiMessage
}
}
#if JVET_AI0153_OMI_SEI
if (!m_pcCfg->getObjectMaskInfoSEIFileRoot().empty())
{
// CHECK(!m_pcCfg->getSdiSEIEnabled(), "SDI-SEI has not enabled. (OMI-SEI depends on SDI-SEI)");
SEIObjectMaskInfos* seiObjectMaskInfo = new SEIObjectMaskInfos();
const bool success = m_seiEncoder.initSEIObjectMaskInfos(seiObjectMaskInfo, slice->getPOC());
if (success)
{
seiMessages.push_back(seiObjectMaskInfo);
}
else
{
delete seiObjectMaskInfo;
}
}
#endif
if (m_pcCfg->getFilmGrainCharactersticsSEIEnabled() && m_pcCfg->getFilmGrainCharactersticsSEIPerPictureSEI())
{
SEIFilmGrainCharacteristics *fgcSEI = new SEIFilmGrainCharacteristics;
......@@ -5346,7 +5364,13 @@ void EncGOP::xCalculateAddPSNR(Picture* pcPic, PelUnitBuf cPicD, const AccessUni
const uint64_t upscaledSSD = xFindDistortionPlane(p, o, 0);
#endif
upscaledPSNR[comp] = upscaledSSD ? 10.0 * log10((double) fRefValue / (double) upscaledSSD) : 999.99;
}
if (printMSSSIM)
{
const uint32_t upscaledWidth = o.width - ( m_pcEncLib->getSourcePadding( 0 ) >> ::getComponentScaleX( compID, format ) );
const uint32_t upscaledHeight = o.height - ( m_pcEncLib->getSourcePadding( 1 ) >> ( !!bPicIsField + ::getComponentScaleY( compID, format ) ) );
upscaledMsssim[comp] = xCalculateMSSSIM(o.bufAt(0, 0), o.stride, p.bufAt(0, 0), p.stride, upscaledWidth, upscaledHeight, bitDepth);
}
}
}
#if EXTENSION_360_VIDEO
......@@ -5605,16 +5629,14 @@ void EncGOP::xCalculateAddPSNR(Picture* pcPic, PelUnitBuf cPicD, const AccessUni
}
msg( NOTICE, "]" );
}
if (m_pcEncLib->isResChangeInClvsEnabled())
if (m_pcEncLib->isResChangeInClvsEnabled() || m_pcEncLib->isRefLayerRescaledAvailable())
{
msg( NOTICE, " [Y2 %6.4lf dB U2 %6.4lf dB V2 %6.4lf dB]", upscaledPSNR[COMPONENT_Y], upscaledPSNR[COMPONENT_Cb], upscaledPSNR[COMPONENT_Cr] );
msg( NOTICE, " MS-SSIM2: [Y %6.4lf U %6.4lf V %6.4lf ]", upscaledMsssim[COMPONENT_Y], upscaledMsssim[COMPONENT_Cb], upscaledMsssim[COMPONENT_Cr] );
if (printMSSSIM)
{
msg( NOTICE, " MS-SSIM2: [Y %1.6lf U %1.6lf V %1.6lf ]", upscaledMsssim[COMPONENT_Y], upscaledMsssim[COMPONENT_Cb], upscaledMsssim[COMPONENT_Cr] );
}
}
else if (m_pcEncLib->isRefLayerRescaledAvailable())
{
msg(NOTICE, " [Y2 %6.4lf dB U2 %6.4lf dB V2 %6.4lf dB]", upscaledPSNR[COMPONENT_Y], upscaledPSNR[COMPONENT_Cb], upscaledPSNR[COMPONENT_Cr]);
}
}
else if( g_verbosity >= INFO )
{
......
......@@ -932,6 +932,141 @@ void SEIEncoder::readAnnotatedRegionSEI(std::istream &fic, SEIAnnotatedRegions *
}
}
#if JVET_AI0153_OMI_SEI
void SEIEncoder::readObjectMaskInfoSEI(std::istream& fic, SEIObjectMaskInfos* seiObjMask, bool& failed)
{
readTokenValue(seiObjMask->m_hdr.m_cancelFlag, failed, fic, "SEIOmiCancelFlag");
if (!seiObjMask->m_hdr.m_cancelFlag)
{
readTokenValue(seiObjMask->m_hdr.m_persistenceFlag, failed, fic, "SEIOmiPersistenceFlag");
readTokenValueAndValidate<uint32_t>(seiObjMask->m_hdr.m_numAuxPicLayerMinus1, failed, fic, "SEIOmiNumAuxPicLayerMinus1", uint32_t(0), uint32_t(255));
if (m_pcCfg->getSdiSEIEnabled())
{
// Conformance Check: the value of omi_num_aux_pic_layer shall be equal to numAuxLayer
std::vector<std::vector<uint32_t>> associatedPrimaryLayerIdx;
uint32_t associatedPrimaryLayerIdxCnt = 0;
for (uint32_t i = 0; i <= m_pcCfg->getSdiSEIMaxLayersMinus1(); i++)
{
if (m_pcCfg->getSdiSEIAuxId(i))
{
associatedPrimaryLayerIdx.push_back(std::vector<uint32_t>(m_pcCfg->getSdiSEINumAssociatedPrimaryLayersMinus1(i) + 1));
for (uint32_t j = 0; j <= m_pcCfg->getSdiSEINumAssociatedPrimaryLayersMinus1(i); j++)
{
associatedPrimaryLayerIdx[i][j] = m_pcCfg->getSdiSEIAssociatedPrimaryLayerIdx(associatedPrimaryLayerIdxCnt++);
}
}
else
{
associatedPrimaryLayerIdx.push_back(std::vector<uint32_t>());
}
}
int primaryLayerId = m_pcEncLib->getLayerId();
uint32_t numAuxLayer = 0;
for (uint32_t i = 0; i <= m_pcCfg->getSdiSEIMaxLayersMinus1(); i++)
{
if (m_pcCfg->getSdiSEIAuxId(i) == 3)
{
for (uint32_t j = 0; j <= m_pcCfg->getSdiSEINumAssociatedPrimaryLayersMinus1(i); j++)
{
if (m_pcCfg->getSdiSEILayerId(associatedPrimaryLayerIdx[i][j]) == primaryLayerId)
{
numAuxLayer++;
}
}
}
}
CHECK(((seiObjMask->m_hdr.m_numAuxPicLayerMinus1 + 1) != numAuxLayer), "The value of omi_num_aux_pic_layer shall be equal to numAuxLayer.");
}
readTokenValueAndValidate<uint32_t>(seiObjMask->m_hdr.m_maskIdLengthMinus1, failed, fic, "SEIOmiMaskIdLengthMinus1",uint32_t(0), uint32_t(255));
readTokenValueAndValidate<uint32_t>(seiObjMask->m_hdr.m_maskSampleValueLengthMinus8, failed, fic,"SEIOmiMaskSampleValueLengthMinus8", uint32_t(0), uint32_t(8));
readTokenValue(seiObjMask->m_hdr.m_maskConfidenceInfoPresentFlag, failed, fic,"SEIOmiMaskConfidenceInfoPresentFlag");
if (seiObjMask->m_hdr.m_maskConfidenceInfoPresentFlag)
{
readTokenValueAndValidate<uint32_t>(seiObjMask->m_hdr.m_maskConfidenceLengthMinus1, failed, fic,"SEIOmiMaskConfidenceLengthMinus1", uint32_t(0), uint32_t(31));
}
readTokenValue(seiObjMask->m_hdr.m_maskDepthInfoPresentFlag, failed, fic, "SEIOmiMaskDepthInfoPresentFlag");
if (seiObjMask->m_hdr.m_maskDepthInfoPresentFlag)
{
readTokenValueAndValidate<uint32_t>(seiObjMask->m_hdr.m_maskDepthLengthMinus1, failed, fic,"SEIOmiMaskDepthLengthMinus1", uint32_t(0), uint32_t(31));
}
readTokenValue(seiObjMask->m_hdr.m_maskLabelInfoPresentFlag, failed, fic, "SEIOmiMaskLabelInfoPresentFlag");
if (seiObjMask->m_hdr.m_maskLabelInfoPresentFlag)
{
readTokenValue(seiObjMask->m_hdr.m_maskLabelLanguagePresentFlag, failed, fic,"SEIOmiMaskLabelLanguagePresentFlag");
if (seiObjMask->m_hdr.m_maskLabelLanguagePresentFlag)
{
readTokenValue(seiObjMask->m_hdr.m_maskLabelLanguage, failed, fic, "SEIOmiMaskLabelLanguage");
}
}
uint32_t objMaskInfoCnt = 0;
seiObjMask->m_maskPicUpdateFlag.resize(seiObjMask->m_hdr.m_numAuxPicLayerMinus1 + 1);
seiObjMask->m_numMaskInPicUpdate.resize(seiObjMask->m_hdr.m_numAuxPicLayerMinus1 + 1);
for (uint32_t i = 0; i <= seiObjMask->m_hdr.m_numAuxPicLayerMinus1; i++)
{
std::string cfgMaskPicUpdateFlagStr = "SEIOmiMaskPicUpdateFlag[" + std::to_string(i) + "]";
readTokenValue(seiObjMask->m_maskPicUpdateFlag[i], failed, fic, cfgMaskPicUpdateFlagStr.c_str());
if (seiObjMask->m_maskPicUpdateFlag[i])
{
std::string cfgNumMaskInPicUpdataStr = "SEIOmiNumMaskInPicUpdate[" + std::to_string(i) + "]";
readTokenValueAndValidate<uint32_t>(seiObjMask->m_numMaskInPicUpdate[i], failed, fic, cfgNumMaskInPicUpdataStr.c_str(), uint32_t(0), uint32_t((1 << (seiObjMask->m_hdr.m_maskIdLengthMinus1 + 1)) - 1));
seiObjMask->m_objectMaskInfos.resize(objMaskInfoCnt + seiObjMask->m_numMaskInPicUpdate[i]);
for (uint32_t j = 0; j < seiObjMask->m_numMaskInPicUpdate[i]; j++)
{
SEIObjectMaskInfos::ObjectMaskInfo& omi = seiObjMask->m_objectMaskInfos[objMaskInfoCnt];
std::string cfgMaskIdStr = "SEIOmiMaskId[" + std::to_string(i) + "][" + std::to_string(j) + "]";
std::string cfgAuxSampleValueStr = "SEIOmiAuxSampleValue[" + std::to_string(i) + "][" + std::to_string(j) + "]";
std::string cfgMaskCancelStr = "SEIOmiMaskCancel[" + std::to_string(i) + "][" + std::to_string(j) + "]";
readTokenValueAndValidate<uint32_t>(omi.maskId, failed, fic, cfgMaskIdStr.c_str(), uint32_t(0), uint32_t((1 << (seiObjMask->m_hdr.m_maskIdLengthMinus1 + 1)) - 1));
readTokenValueAndValidate<uint32_t>(omi.auxSampleValue, failed, fic, cfgAuxSampleValueStr.c_str(), uint32_t(0), uint32_t((1 << (seiObjMask->m_hdr.m_maskSampleValueLengthMinus8 + 8)) - 1));
readTokenValue(omi.maskCancel, failed, fic, cfgMaskCancelStr.c_str());
if (!omi.maskCancel)
{
std::string cfgMaskBoundingBoxPresentFlagStr = "SEIOmiBoundingBoxPresentFlag[" + std::to_string(i) + "][" + std::to_string(j) + "]";
readTokenValue(omi.maskBoundingBoxPresentFlag, failed, fic, cfgMaskBoundingBoxPresentFlagStr.c_str());
if (omi.maskBoundingBoxPresentFlag)
{
std::string cfgMaskTopStr = "SEIOmiMaskTop[" + std::to_string(i) + "][" + std::to_string(j) + "]";
std::string cfgMaskLeftStr = "SEIOmiMaskLeft[" + std::to_string(i) + "][" + std::to_string(j) + "]";
std::string cfgMaskWidthStr = "SEIOmiMaskWidth[" + std::to_string(i) + "][" + std::to_string(j) + "]";
std::string cfgMaskHeightStr = "SEIOmiMaskHeight[" + std::to_string(i) + "][" + std::to_string(j) + "]";
readTokenValueAndValidate(omi.maskTop, failed, fic, cfgMaskTopStr.c_str(), uint32_t(0), uint32_t(0xffff));
readTokenValueAndValidate(omi.maskLeft, failed, fic, cfgMaskLeftStr.c_str(), uint32_t(0), uint32_t(0xffff));
readTokenValueAndValidate(omi.maskWidth, failed, fic, cfgMaskWidthStr.c_str(), uint32_t(0),uint32_t(0xffff));
readTokenValueAndValidate(omi.maskHeight, failed, fic, cfgMaskHeightStr.c_str(), uint32_t(0),uint32_t(0xffff));
}
if (seiObjMask->m_hdr.m_maskConfidenceInfoPresentFlag)
{
std::string cfgMaskConfidenceStr = "SEIOmiMaskConfidence[" + std::to_string(i) + "][" + std::to_string(j) + "]";
readTokenValueAndValidate(omi.maskConfidence, failed, fic, cfgMaskConfidenceStr.c_str(), uint32_t(0), uint32_t((1 << (seiObjMask->m_hdr.m_maskConfidenceLengthMinus1 + 1)) - 1));
}
if (seiObjMask->m_hdr.m_maskDepthInfoPresentFlag)
{
std::string cfgMaskDepthStr = "SEIOmiMaskDepth[" + std::to_string(i) + "][" + std::to_string(j) + "]";
readTokenValueAndValidate(omi.maskDepth, failed, fic, cfgMaskDepthStr.c_str(), uint32_t(0), uint32_t((1 << (seiObjMask->m_hdr.m_maskDepthLengthMinus1 + 1)) - 1));
}
if (seiObjMask->m_hdr.m_maskLabelInfoPresentFlag)
{
std::string cfgMaskLabelStr = "SEIOmiMaskLabel[" + std::to_string(i) + "][" + std::to_string(j) + "]";
readTokenValue(omi.maskLabel, failed, fic, cfgMaskLabelStr.c_str());
}
}
objMaskInfoCnt++;
}
}
}
}
}
#endif
bool SEIEncoder::initSEIAnnotatedRegions(SEIAnnotatedRegions* SEIAnnoReg, int currPOC)
{
assert(m_isInitialized);
......@@ -965,6 +1100,38 @@ bool SEIEncoder::initSEIAnnotatedRegions(SEIAnnotatedRegions* SEIAnnoReg, int cu
return true;
}
#if JVET_AI0153_OMI_SEI
bool SEIEncoder::initSEIObjectMaskInfos(SEIObjectMaskInfos* SEIObjMask, int currPOC)
{
CHECK(m_isInitialized == 0, "SEI is uninitialized");
CHECK(SEIObjMask == nullptr, "ObjectMaskInfo SEI is undefined");
if (!m_pcCfg->getObjectMaskInfoSEIFileRoot().empty())
{
bool failed = false;
std::string ObjMaskSEIFileWithPoc(m_pcCfg->getObjectMaskInfoSEIFileRoot());
{
std::stringstream suffix;
suffix << "_" << currPOC << ".txt";
ObjMaskSEIFileWithPoc += suffix.str();
}
std::ifstream fic(ObjMaskSEIFileWithPoc.c_str());
if (!fic.good() || !fic.is_open())
{
std::cerr << "No Object Mask Informations SEI parameters file " << ObjMaskSEIFileWithPoc << " for POC " << currPOC
<< std::endl;
return false;
}
readObjectMaskInfoSEI(fic, SEIObjMask, failed);
if (failed)
{
std::cerr << "Error while reading Object Mask Informations SEI parameters file '" << ObjMaskSEIFileWithPoc << "'" << std::endl;
exit(EXIT_FAILURE);
}
}
return true;
}
#endif
void SEIEncoder::initSEIAlternativeTransferCharacteristics(SEIAlternativeTransferCharacteristics *seiAltTransCharacteristics)
{
......@@ -1093,6 +1260,9 @@ void SEIEncoder::initSEIScalabilityDimensionInfo(SEIScalabilityDimensionInfo *se
sei->m_sdiViewIdLenMinus1 = m_pcCfg->getSdiSEIViewIdLenMinus1();
}
sei->m_sdiLayerId.resize(sei->m_sdiMaxLayersMinus1 + 1);
#if JVET_AI0153_OMI_SEI
uint32_t associatedPrimaryLayerIdxCnt = 0;
#endif
for (int i = 0; i <= sei->m_sdiMaxLayersMinus1; i++)
{
sei->m_sdiLayerId[i] = m_pcCfg->getSdiSEILayerId(i);
......@@ -1113,7 +1283,11 @@ void SEIEncoder::initSEIScalabilityDimensionInfo(SEIScalabilityDimensionInfo *se
sei->m_sdiAssociatedPrimaryLayerIdx[i].resize(sei->m_sdiNumAssociatedPrimaryLayersMinus1[i] + 1);
for (int j = 0; j <= sei->m_sdiNumAssociatedPrimaryLayersMinus1[i]; j++)
{
#if JVET_AI0153_OMI_SEI
sei->m_sdiAssociatedPrimaryLayerIdx[i][j] = m_pcCfg->getSdiSEIAssociatedPrimaryLayerIdx(associatedPrimaryLayerIdxCnt++);
#else
sei->m_sdiAssociatedPrimaryLayerIdx[i][j] = 0;
#endif
}
}
}
......@@ -1478,6 +1652,15 @@ void SEIEncoder::initSEINeuralNetworkPostFilterCharacteristics(SEINeuralNetworkP
{
sei->m_numberExtrapolatedPicturesMinus1 = m_pcCfg->getNNPostFilterSEICharacteristicsNumberExtrapolatedPicturesMinus1(filterIdx);
}
#if NNPFC_SPATIAL_EXTRAPOLATION
if((sei->m_purpose & NNPC_PurposeType::SPATIAL_EXTRAPOLATION) != 0)
{
sei->m_spatialExtrapolationLeftOffset = m_pcCfg->getNNPostFilterSEICharacteristicsSpatialExtrapolationLeftOffset(filterIdx);
sei->m_spatialExtrapolationRightOffset = m_pcCfg->getNNPostFilterSEICharacteristicsSpatialExtrapolationRightOffset(filterIdx);
sei->m_spatialExtrapolationTopOffset = m_pcCfg->getNNPostFilterSEICharacteristicsSpatialExtrapolationTopOffset(filterIdx);
sei->m_spatialExtrapolationBottomOffset = m_pcCfg->getNNPostFilterSEICharacteristicsSpatialExtrapolationBottomOffset(filterIdx);
}
#endif
sei->m_componentLastFlag = m_pcCfg->getNNPostFilterSEICharacteristicsComponentLastFlag(filterIdx);
sei->m_inpFormatIdc = m_pcCfg->getNNPostFilterSEICharacteristicsInpFormatIdc(filterIdx);
......
......@@ -93,6 +93,11 @@ public:
void initSEISEIManifest(SEIManifest *seiSeiManifest, const SEIMessages &seiMessage);
void initSEISEIPrefixIndication(SEIPrefixIndication *seiSeiPrefixIndications, const SEI *sei);
#if JVET_AI0153_OMI_SEI
void readObjectMaskInfoSEI(std::istream& fic, SEIObjectMaskInfos* seiObjMask, bool& failed);
bool initSEIObjectMaskInfos(SEIObjectMaskInfos* sei, int currPOC);
#endif
#if JVET_AG2034_SPTI_SEI
void initSEISourcePictureTimingInfo(SEISourcePictureTimingInfo* SEISourcePictureTimingInfo);
#endif
......
......@@ -161,6 +161,11 @@ void SEIWriter::xWriteSEIpayloadData(OutputBitstream &bs, const SEI &sei, HRD &h
case SEI::PayloadType::ANNOTATED_REGIONS:
xWriteSEIAnnotatedRegions(*static_cast<const SEIAnnotatedRegions *>(&sei));
break;
#if JVET_AI0153_OMI_SEI
case SEI::PayloadType::OBJECT_MASK_INFO:
xWriteSEIObjectMaskInfos(*static_cast<const SEIObjectMaskInfos*>(&sei));
break;
#endif
case SEI::PayloadType::SEI_MANIFEST:
CHECK((SEIPrefixIndicationIdx), "wrong SEI prefix indication message");
xWriteSEISEIManifest(*static_cast<const SEIManifest *>(&sei));
......@@ -899,6 +904,102 @@ void SEIWriter::xWriteSEIAnnotatedRegions(const SEIAnnotatedRegions &sei)
}
}
}
#if JVET_AI0153_OMI_SEI
void SEIWriter::xWriteSEIObjectMaskInfos(const SEIObjectMaskInfos& sei)
{
xWriteFlag(sei.m_hdr.m_cancelFlag, "omi_cancel_flag");
if (!sei.m_hdr.m_cancelFlag)
{
xWriteFlag(sei.m_hdr.m_persistenceFlag, "omi_persistence_flag");
xWriteUvlc((uint32_t) sei.m_hdr.m_numAuxPicLayerMinus1, "omi_num_aux_pic_layer_minus1");
xWriteUvlc((uint32_t) sei.m_hdr.m_maskIdLengthMinus1, "omi_mask_id_length_minus1");
xWriteUvlc((uint32_t) sei.m_hdr.m_maskSampleValueLengthMinus8, "omi_mask_sample_value_length_minus8");
xWriteFlag(sei.m_hdr.m_maskConfidenceInfoPresentFlag, "omi_mask_confidence_info_present_flag");
if (sei.m_hdr.m_maskConfidenceInfoPresentFlag)
{
CHECK((sei.m_hdr.m_maskConfidenceLengthMinus1 > 15 || sei.m_hdr.m_maskConfidenceLengthMinus1 < 0), "The range of omi_mask_confidence_length_minus1 must be [0, 15]");
xWriteCode((sei.m_hdr.m_maskConfidenceLengthMinus1), 4, "omi_mask_confidence_length_minus1");
}
xWriteFlag(sei.m_hdr.m_maskDepthInfoPresentFlag, "omi_mask_depth_info_present_flag");
if (sei.m_hdr.m_maskDepthInfoPresentFlag)
{
CHECK((sei.m_hdr.m_maskDepthLengthMinus1 > 15 || sei.m_hdr.m_maskDepthLengthMinus1 < 0), "The range of omi_mask_depth_length_minus1 must be [0, 15]");
xWriteCode((sei.m_hdr.m_maskDepthLengthMinus1), 4, "omi_mask_depth_length_minus1");
}
xWriteFlag(sei.m_hdr.m_maskLabelInfoPresentFlag, "omi_mask_label_info_present_flag");
if (sei.m_hdr.m_maskLabelInfoPresentFlag)
{
xWriteFlag(sei.m_hdr.m_maskLabelLanguagePresentFlag, "omi_mask_label_language_present_flag");
if (sei.m_hdr.m_maskLabelLanguagePresentFlag)
{
while (!isByteAligned())
{
xWriteFlag(0, "omi_bit_equal_to_zero");
}
CHECK(sei.m_hdr.m_maskLabelLanguage.size() > 255, "label oversize");
for (uint32_t m = 0; m < sei.m_hdr.m_maskLabelLanguage.size(); m++)
{
char ch = sei.m_hdr.m_maskLabelLanguage[m];
xWriteCode(ch, 8, "omi_mask_lable_language");
}
xWriteCode('\0', 8, "omi_mask_lable_language");
}
}
uint32_t maskCnt = 0;
for (uint32_t i = 0; i <= sei.m_hdr.m_numAuxPicLayerMinus1; i++)
{
xWriteFlag(sei.m_maskPicUpdateFlag[i], "omi_mask_pic_update_flag[i]");
if (sei.m_maskPicUpdateFlag[i])
{
xWriteUvlc((uint32_t) sei.m_numMaskInPicUpdate[i], "omi_num_mask_in_pic_update[i]");
for (uint32_t j = 0; j < sei.m_numMaskInPicUpdate[i]; j++)
{
xWriteCode(sei.m_objectMaskInfos[maskCnt].maskId, sei.m_hdr.m_maskIdLengthMinus1 + 1, "omi_mask_id[i][j]");
xWriteCode(sei.m_objectMaskInfos[maskCnt].auxSampleValue, sei.m_hdr.m_maskSampleValueLengthMinus8 + 8, "omi_aux_sample_value[i][j]");
xWriteFlag(sei.m_objectMaskInfos[maskCnt].maskCancel, "omi_mask_cancel[i][j]");
if (!sei.m_objectMaskInfos[maskCnt].maskCancel)
{
xWriteFlag(sei.m_objectMaskInfos[maskCnt].maskBoundingBoxPresentFlag, "omi_mask_bounding_box_present_flag[i][j]");
if (sei.m_objectMaskInfos[maskCnt].maskBoundingBoxPresentFlag)
{
xWriteCode((uint32_t) sei.m_objectMaskInfos[maskCnt].maskTop, 16, "omi_mask_top[i][j]");
xWriteCode((uint32_t) sei.m_objectMaskInfos[maskCnt].maskLeft, 16, "omi_mask_left[i][j]");
xWriteCode((uint32_t) sei.m_objectMaskInfos[maskCnt].maskWidth, 16, "omi_mask_width[i][j]");
xWriteCode((uint32_t) sei.m_objectMaskInfos[maskCnt].maskHeight, 16, "omi_mask_height[i][j]");
}
if (sei.m_hdr.m_maskConfidenceInfoPresentFlag)
{
xWriteCode(sei.m_objectMaskInfos[maskCnt].maskConfidence, sei.m_hdr.m_maskConfidenceLengthMinus1 + 1, "omi_mask_confidence[i][j]");
}
if (sei.m_hdr.m_maskDepthInfoPresentFlag)
{
xWriteCode(sei.m_objectMaskInfos[maskCnt].maskDepth, sei.m_hdr.m_maskDepthLengthMinus1 + 1, "omi_mask_depth[i][j]");
}
while (!isByteAligned())
{
xWriteFlag(0, "omi_bit_equal_to_zero");
}
if (sei.m_hdr.m_maskLabelInfoPresentFlag)
{
CHECK(sei.m_objectMaskInfos[maskCnt].maskLabel.size() > 255, "label oversize");
for (uint32_t m = 0; m < sei.m_objectMaskInfos[maskCnt].maskLabel.size(); m++)
{
char ch = sei.m_objectMaskInfos[maskCnt].maskLabel[m];
xWriteCode(ch, 8, "omi_mask_label");
}
xWriteCode('\0', 8, "omi_mask_label");
}
}
maskCnt++;
}
}
}
}
}
#endif
void SEIWriter::xWriteByteAlign()
{
if( m_pcBitIf->getNumberOfWrittenBits() % 8 != 0)
......@@ -1825,6 +1926,16 @@ void SEIWriter::xWriteSEINeuralNetworkPostFilterCharacteristics(const SEINeuralN
xWriteUvlc(sei.m_numberExtrapolatedPicturesMinus1, "nnpfc_extrapolated_pics_minus1");
}
#if NNPFC_SPATIAL_EXTRAPOLATION
if((sei.m_purpose & NNPC_PurposeType::SPATIAL_EXTRAPOLATION) != 0)
{
xWriteSvlc(sei.m_spatialExtrapolationLeftOffset, "nnpfc_spatial_extrapolation_left_offset");
xWriteSvlc(sei.m_spatialExtrapolationRightOffset, "nnpfc_spatial_extrapolation_right_offset");
xWriteSvlc(sei.m_spatialExtrapolationTopOffset, "nnpfc_spatial_extrapolation_top_offset");
xWriteSvlc(sei.m_spatialExtrapolationBottomOffset, "nnpfc_spatial_extrapolation_right_offset");
}
#endif
xWriteFlag(sei.m_componentLastFlag, "nnpfc_component_last_flag");
xWriteUvlc(sei.m_inpFormatIdc, "nnpfc_inp_format_idc");
xWriteUvlc(sei.m_auxInpIdc, "nnpfc_auxiliary_inp_idc");
......
......@@ -102,6 +102,9 @@ protected:
void xWriteSEIColourTransformInfo(const SEIColourTransformInfo& sei);
void xWriteSEIAnnotatedRegions (const SEIAnnotatedRegions& sei);
#if JVET_AI0153_OMI_SEI
void xWriteSEIObjectMaskInfos(const SEIObjectMaskInfos& sei);
#endif
void xWriteSEIpayloadData(OutputBitstream &bs, const SEI &sei, HRD &hrd, const uint32_t temporalId,
int SEIPrefixIndicationIdx = 0);
void xWriteSEIShutterInterval(const SEIShutterIntervalInfo& sei);
......