Newer
Older
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
sei->m_sdiViewIdVal[i] = m_pcCfg->getSdiSEIViewIdVal(i);
}
sei->m_sdiAuxId.resize(sei->m_sdiMaxLayersMinus1 + 1);
if (sei->m_sdiAuxiliaryInfoFlag)
{
sei->m_sdiAuxId[i] = m_pcCfg->getSdiSEIAuxId(i);
sei->m_sdiNumAssociatedPrimaryLayersMinus1.resize(sei->m_sdiMaxLayersMinus1 + 1);
sei->m_sdiAssociatedPrimaryLayerIdx.resize(sei->m_sdiMaxLayersMinus1 + 1);
if (sei->m_sdiAuxId[i] > 0)
{
sei->m_sdiNumAssociatedPrimaryLayersMinus1[i] = m_pcCfg->getSdiSEINumAssociatedPrimaryLayersMinus1(i);
sei->m_sdiAssociatedPrimaryLayerIdx[i].resize(sei->m_sdiNumAssociatedPrimaryLayersMinus1[i] + 1);
for (int j = 0; j <= sei->m_sdiNumAssociatedPrimaryLayersMinus1[i]; j++)
{
sei->m_sdiAssociatedPrimaryLayerIdx[i][j] = 0;
}
}
}
}
sei->m_sdiNumViews = 1;
if (sei->m_sdiMultiviewInfoFlag)
{
for (int i = 1; i <= sei->m_sdiMaxLayersMinus1; i++)
{
bool newViewFlag = true;
for (int j = 0; j < i; j++)
{
if (sei->m_sdiViewIdVal[i] == sei->m_sdiViewIdVal[j])
{
newViewFlag = false;
}
}
if (newViewFlag)
{
sei->m_sdiNumViews++;
}
}
}
}
}
void SEIEncoder::initSEIMultiviewAcquisitionInfo(SEIMultiviewAcquisitionInfo *sei)
{
CHECK(!(m_isInitialized), "Multiview acquisition information SEI already initialized");
CHECK(!(sei != nullptr), "Need a seiMultiviewAcquisitionInfo for initialization (got nullptr)");
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
sei->m_maiIntrinsicParamFlag = m_pcCfg->getMaiSEIIntrinsicParamFlag();
sei->m_maiExtrinsicParamFlag = m_pcCfg->getMaiSEIExtrinsicParamFlag();
sei->m_maiNumViewsMinus1 = m_pcCfg->getMaiSEINumViewsMinus1();
if (sei->m_maiIntrinsicParamFlag)
{
sei->m_maiIntrinsicParamsEqualFlag = m_pcCfg->getMaiSEIIntrinsicParamsEqualFlag();
sei->m_maiPrecFocalLength = m_pcCfg->getMaiSEIPrecFocalLength();
sei->m_maiPrecPrincipalPoint = m_pcCfg->getMaiSEIPrecPrincipalPoint();
sei->m_maiPrecSkewFactor = m_pcCfg->getMaiSEIPrecSkewFactor();
int numViews = sei->m_maiIntrinsicParamsEqualFlag ? 1 : sei->m_maiNumViewsMinus1 + 1;
sei->m_maiSignFocalLengthX .resize( numViews );
sei->m_maiExponentFocalLengthX .resize( numViews );
sei->m_maiMantissaFocalLengthX .resize( numViews );
sei->m_maiSignFocalLengthY .resize( numViews );
sei->m_maiExponentFocalLengthY .resize( numViews );
sei->m_maiMantissaFocalLengthY .resize( numViews );
sei->m_maiSignPrincipalPointX .resize( numViews );
sei->m_maiExponentPrincipalPointX.resize( numViews );
sei->m_maiMantissaPrincipalPointX.resize( numViews );
sei->m_maiSignPrincipalPointY .resize( numViews );
sei->m_maiExponentPrincipalPointY.resize( numViews );
sei->m_maiMantissaPrincipalPointY.resize( numViews );
sei->m_maiSignSkewFactor .resize( numViews );
sei->m_maiExponentSkewFactor .resize( numViews );
sei->m_maiMantissaSkewFactor .resize( numViews );
for( int i = 0; i <= ( sei->m_maiIntrinsicParamsEqualFlag ? 0 : sei->m_maiNumViewsMinus1 ); i++ )
{
sei->m_maiSignFocalLengthX [i] = m_pcCfg->getMaiSEISignFocalLengthX(i);
sei->m_maiExponentFocalLengthX [i] = m_pcCfg->getMaiSEIExponentFocalLengthX(i);
sei->m_maiMantissaFocalLengthX [i] = m_pcCfg->getMaiSEIMantissaFocalLengthX(i);
sei->m_maiSignFocalLengthY [i] = m_pcCfg->getMaiSEISignFocalLengthY(i);
sei->m_maiExponentFocalLengthY [i] = m_pcCfg->getMaiSEIExponentFocalLengthY(i);
sei->m_maiMantissaFocalLengthY [i] = m_pcCfg->getMaiSEIMantissaFocalLengthY(i);
sei->m_maiSignPrincipalPointX [i] = m_pcCfg->getMaiSEISignPrincipalPointX(i);
sei->m_maiExponentPrincipalPointX[i] = m_pcCfg->getMaiSEIExponentPrincipalPointX(i);
sei->m_maiMantissaPrincipalPointX[i] = m_pcCfg->getMaiSEIMantissaPrincipalPointX(i);
sei->m_maiSignPrincipalPointY [i] = m_pcCfg->getMaiSEISignPrincipalPointY(i);
sei->m_maiExponentPrincipalPointY[i] = m_pcCfg->getMaiSEIExponentPrincipalPointY(i);
sei->m_maiMantissaPrincipalPointY[i] = m_pcCfg->getMaiSEIMantissaPrincipalPointY(i);
sei->m_maiSignSkewFactor [i] = m_pcCfg->getMaiSEISignSkewFactor(i);
sei->m_maiExponentSkewFactor [i] = m_pcCfg->getMaiSEIExponentSkewFactor(i);
sei->m_maiMantissaSkewFactor [i] = m_pcCfg->getMaiSEIMantissaSkewFactor(i);
}
}
if (sei->m_maiExtrinsicParamFlag)
{
sei->m_maiPrecRotationParam = m_pcCfg->getMaiSEIPrecRotationParam();
sei->m_maiPrecTranslationParam = m_pcCfg->getMaiSEIPrecTranslationParam();
sei->m_maiSignR.resize(sei->m_maiNumViewsMinus1 + 1);
sei->m_maiExponentR.resize(sei->m_maiNumViewsMinus1 + 1);
sei->m_maiMantissaR.resize(sei->m_maiNumViewsMinus1 + 1);
sei->m_maiSignT.resize(sei->m_maiNumViewsMinus1 + 1);
sei->m_maiExponentT.resize(sei->m_maiNumViewsMinus1 + 1);
sei->m_maiMantissaT.resize(sei->m_maiNumViewsMinus1 + 1);
for (int i = 0; i <= sei->m_maiNumViewsMinus1; i++)
{
sei->m_maiSignR[i].resize(3);
sei->m_maiExponentR[i].resize(3);
sei->m_maiMantissaR[i].resize(3);
sei->m_maiSignT[i].resize(3);
sei->m_maiExponentT[i].resize(3);
sei->m_maiMantissaT[i].resize(3);
for (int j = 0; j < 3; j++)
{
sei->m_maiSignR[i][j].resize(3);
sei->m_maiExponentR[i][j].resize(3);
sei->m_maiMantissaR[i][j].resize(3);
for (int k = 0; k < 3; k++)
{
sei->m_maiSignR[i][j][k] = 0;
sei->m_maiExponentR[i][j][k] = 0;
sei->m_maiMantissaR[i][j][k] = 0;
}
sei->m_maiSignT[i][j] = 0;
sei->m_maiExponentT[i][j] = 0;
sei->m_maiMantissaT[i][j] = 0;
}
}
}
}
void SEIEncoder::initSEIMultiviewViewPosition(SEIMultiviewViewPosition *sei)
{
CHECK(!(m_isInitialized), "Multiview view position SEI already initialized");
CHECK(!(sei != nullptr), "Need a seiMultiviewViewPosition for initialization (got nullptr)");
sei->m_mvpNumViewsMinus1 = m_pcCfg->getMvpSEINumViewsMinus1();
int numViews = sei->m_mvpNumViewsMinus1 + 1;
sei->m_mvpViewPosition.resize(numViews);
for (int i = 0; i <= sei->m_mvpNumViewsMinus1; i++)
{
sei->m_mvpViewPosition[i] = m_pcCfg->getMvpSEIViewPosition(i);
}
}
void SEIEncoder::initSEIAlphaChannelInfo(SEIAlphaChannelInfo *sei)
{
CHECK(!(m_isInitialized), "Alpha channel information SEI already initialized");
CHECK(!(sei != nullptr), "Need a seiAlphaChannelInfo for initialization (got nullptr)");
sei->m_aciCancelFlag = m_pcCfg->getAciSEICancelFlag();
sei->m_aciUseIdc = m_pcCfg->getAciSEIUseIdc();
sei->m_aciBitDepthMinus8 = m_pcCfg->getAciSEIBitDepthMinus8();
sei->m_aciTransparentValue = m_pcCfg->getAciSEITransparentValue();
sei->m_aciOpaqueValue = m_pcCfg->getAciSEIOpaqueValue();
sei->m_aciIncrFlag = m_pcCfg->getAciSEIIncrFlag();
sei->m_aciClipFlag = m_pcCfg->getAciSEIClipFlag();
sei->m_aciClipTypeFlag = m_pcCfg->getAciSEIClipTypeFlag();
}
void SEIEncoder::initSEIDepthRepresentationInfo(SEIDepthRepresentationInfo *sei)
{
CHECK(!(m_isInitialized), "Depth representation information SEI already initialized");
CHECK(!(sei != nullptr), "Need a seiDepthRepresentationInfo for initialization (got nullptr)");
sei->m_driZNearFlag = m_pcCfg->getDriSEIZNearFlag();
sei->m_driZFarFlag = m_pcCfg->getDriSEIZFarFlag();
sei->m_driDMinFlag = m_pcCfg->getDriSEIDMinFlag();
sei->m_driDMaxFlag = m_pcCfg->getDriSEIDMaxFlag();
sei->m_driZNear = m_pcCfg->getDriSEIZNear();
sei->m_driZFar = m_pcCfg->getDriSEIZFar();
sei->m_driDMin = m_pcCfg->getDriSEIDMin();
sei->m_driDMax = m_pcCfg->getDriSEIDMax();
sei->m_driDisparityRefViewId = m_pcCfg->getDriSEIDisparityRefViewId();
sei->m_driDepthRepresentationType = m_pcCfg->getDriSEIDepthRepresentationType();
sei->m_driDepthNonlinearRepresentationNumMinus1 = m_pcCfg->getDriSEINonlinearNumMinus1();
sei->m_driDepthNonlinearRepresentationModel.resize(sei->m_driDepthNonlinearRepresentationNumMinus1 + 1);
for(int i = 0; i < (sei->m_driDepthNonlinearRepresentationNumMinus1 + 1); i++)
{
sei->m_driDepthNonlinearRepresentationModel[i] = m_pcCfg->getDriSEINonlinearModel(i);
}
}
void SEIEncoder::initSEIColourTransformInfo(SEIColourTransformInfo* seiCTI)
{
CHECK(!(m_isInitialized), "Unspecified error");
CHECK(!(seiCTI != nullptr), "Unspecified error");
// Set SEI message parameters read from command line options
seiCTI->m_id = m_pcCfg->getCtiSEIId();
seiCTI->m_signalInfoFlag = m_pcCfg->getCtiSEISignalInfoFlag();
seiCTI->m_fullRangeFlag = m_pcCfg->getCtiSEIFullRangeFlag();
seiCTI->m_primaries = m_pcCfg->getCtiSEIPrimaries();
seiCTI->m_transferFunction = m_pcCfg->getCtiSEITransferFunction();
seiCTI->m_matrixCoefs = m_pcCfg->getCtiSEIMatrixCoefs();
seiCTI->m_crossComponentFlag = m_pcCfg->getCtiSEICrossComponentFlag();
seiCTI->m_crossComponentInferred = m_pcCfg->getCtiSEICrossComponentInferred();
seiCTI->m_numberChromaLutMinus1 = m_pcCfg->getCtiSEINbChromaLut() - 1;
seiCTI->m_chromaOffset = m_pcCfg->getCtiSEIChromaOffset();
seiCTI->m_bitdepth = m_pcCfg->getBitDepth(ChannelType::LUMA);
for (int i = 0; i < MAX_NUM_COMPONENT; i++) {
seiCTI->m_lut[i] = m_pcCfg->getCtiSEILut(i);
}
seiCTI->m_log2NumberOfPointsPerLut = floorLog2(seiCTI->m_lut[0].numLutValues - 1);
}
void SEIEncoder::initSEISubpictureLevelInfo(SEISubpicureLevelInfo *sei, const SPS *sps)
{
const EncCfgParam::CfgSEISubpictureLevel &cfgSubPicLevel = m_pcCfg->getSubpicureLevelInfoSEICfg();
sei->m_sliSublayerInfoPresentFlag = cfgSubPicLevel.m_sliSublayerInfoPresentFlag;
sei->m_sliMaxSublayers = cfgSubPicLevel.m_sliMaxSublayers;
sei->m_numRefLevels = cfgSubPicLevel.m_sliSublayerInfoPresentFlag ? (int)cfgSubPicLevel.m_refLevels.size() / cfgSubPicLevel.m_sliMaxSublayers : (int)cfgSubPicLevel.m_refLevels.size();
sei->m_numSubpics = cfgSubPicLevel.m_numSubpictures;
sei->m_explicitFractionPresentFlag = cfgSubPicLevel.m_explicitFraction;
sei->m_nonSubpicLayersFraction.resize(sei->m_numRefLevels);
sei->m_refLevelIdc.resize(sei->m_numRefLevels);
for (int level = 0; level < sei->m_numRefLevels; level++)
{
sei->m_nonSubpicLayersFraction[level].resize(sei->m_sliMaxSublayers);
sei->m_refLevelIdc[level].resize(sei->m_sliMaxSublayers);
for (int sublayer = 0; sublayer < sei->m_sliMaxSublayers; sublayer++)
{
sei->m_refLevelFraction.resize(sei->m_numRefLevels);
for (int level = 0; level < sei->m_numRefLevels; level++)
{
sei->m_refLevelFraction[level].resize(sei->m_numSubpics);
for (int subpic = 0; subpic < sei->m_numSubpics; subpic++)
{
sei->m_refLevelFraction[level][subpic].resize(sei->m_sliMaxSublayers);
for (int sublayer = 0; sublayer < sei->m_sliMaxSublayers; sublayer++)
{
sei->m_refLevelFraction[level][subpic][sublayer] = 0;
}
}
}
}
// set sei parameters according to the configured values
for (int sublayer = sei->m_sliSublayerInfoPresentFlag ? 0 : sei->m_sliMaxSublayers - 1, cnta = 0, cntb = 0; sublayer < sei->m_sliMaxSublayers; sublayer++)
{
for (int level = 0; level < sei->m_numRefLevels; level++)
{
sei->m_nonSubpicLayersFraction[level][sublayer] = cfgSubPicLevel.m_nonSubpicLayersFraction[cnta];
sei->m_refLevelIdc[level][sublayer] = cfgSubPicLevel.m_refLevels[cnta++];
if (sei->m_explicitFractionPresentFlag)
{
for (int subpic = 0; subpic < sei->m_numSubpics; subpic++)
{
sei->m_refLevelFraction[level][subpic][sublayer] = cfgSubPicLevel.m_fractions[cntb++];
}
// update the inference of m_refLevelIdc[][] and m_refLevelFraction[][][]
if (!sei->m_sliSublayerInfoPresentFlag)
{
for (int sublayer = sei->m_sliMaxSublayers - 2; sublayer >= 0; sublayer--)
{
for (int level = 0; level < sei->m_numRefLevels; level++)
{
sei->m_nonSubpicLayersFraction[level][sublayer] = sei->m_nonSubpicLayersFraction[level][sei->m_sliMaxSublayers - 1];
sei->m_refLevelIdc[level][sublayer] = sei->m_refLevelIdc[level][sei->m_sliMaxSublayers - 1];
if (sei->m_explicitFractionPresentFlag)
for (int subpic = 0; subpic < sei->m_numSubpics; subpic++)
{
sei->m_refLevelFraction[level][subpic][sublayer] = sei->m_refLevelFraction[level][subpic][sei->m_sliMaxSublayers - 1];
}
}
}
}
void SEIEncoder::initSEISEIManifest(SEIManifest *seiSeiManifest, const SEIMessages &seiMessages)
{
assert(m_isInitialized);
assert(seiSeiManifest != NULL);
seiSeiManifest->m_manifestNumSeiMsgTypes = 0;
for (auto &it: seiMessages)
{
seiSeiManifest->m_manifestNumSeiMsgTypes += 1;
auto tempPayloadType = it->payloadType();
seiSeiManifest->m_manifestSeiPayloadType.push_back(tempPayloadType);
auto description = seiSeiManifest->getSEIMessageDescription(tempPayloadType);
seiSeiManifest->m_manifestSeiDescription.push_back(description);
}
CHECK(seiSeiManifest->m_manifestNumSeiMsgTypes == 0, "No SEI messages available");
}
void SEIEncoder::initSEISEIPrefixIndication(SEIPrefixIndication *seiSeiPrefixIndications, const SEI *sei)
{
assert(m_isInitialized);
assert(seiSeiPrefixIndications != NULL);
seiSeiPrefixIndications->m_prefixSeiPayloadType = sei->payloadType();
seiSeiPrefixIndications->m_numSeiPrefixIndicationsMinus1 = seiSeiPrefixIndications->getNumsOfSeiPrefixIndications(sei) - 1;
seiSeiPrefixIndications->m_payload = sei;
}
void SEIEncoder::initSEINeuralNetworkPostFilterCharacteristics(SEINeuralNetworkPostFilterCharacteristics *sei, int filterIdx)
{
CHECK(!(m_isInitialized), "Unspecified error");
sei->m_purpose = m_pcCfg->getNNPostFilterSEICharacteristicsPurpose(filterIdx);
sei->m_id = m_pcCfg->getNNPostFilterSEICharacteristicsId(filterIdx);
sei->m_modeIdc = m_pcCfg->getNNPostFilterSEICharacteristicsModeIdc(filterIdx);
Maria Santamaria
committed
if (sei->m_modeIdc == POST_FILTER_MODE::URI)
{
sei->m_uriTag = m_pcCfg->getNNPostFilterSEICharacteristicsUriTag(filterIdx);
sei->m_uri = m_pcCfg->getNNPostFilterSEICharacteristicsUri(filterIdx);
}
sei->m_propertyPresentFlag = m_pcCfg->getNNPostFilterSEICharacteristicsPropertyPresentFlag(filterIdx);
if (sei->m_propertyPresentFlag)
sei->m_baseFlag = m_pcCfg->getNNPostFilterSEICharacteristicsBaseFlag(filterIdx);
sei->m_numberInputDecodedPicturesMinus1 = m_pcCfg->getNNPostFilterSEICharacteristicsNumberInputDecodedPicturesMinus1(filterIdx);
CHECK(sei->m_numberInputDecodedPicturesMinus1 > 63, "m_numberInputDecodedPicturesMinus1 shall be in the range of 0 to 63");
Antti Hallapuro
committed
#if JVET_AD0056_NNPFC_INPUT_PIC_OUTPUT_FLAG
sei->m_inputPicOutputFlag = m_pcCfg->getNNPostFilterSEICharacteristicsInputPicOutputFlag(filterIdx);
#endif
#if JVET_AD0054_NNPFC_ABSENT_INPUT_PIC_ZERO_FLAG
sei->m_absentInputPicZeroFlag = m_pcCfg->getNNPostFilterSEICharacteristicsAbsentInputPicZeroFlag(filterIdx);
#endif
if((sei->m_purpose & NNPC_PurposeType::CHROMA_UPSAMPLING) != 0)
Philip Cowan
committed
sei->m_outSubCFlag = m_pcCfg->getNNPostFilterSEICharacteristicsOutSubCFlag(filterIdx);
if((sei->m_purpose & NNPC_PurposeType::COLOURIZATION) != 0)
{
sei->m_outColourFormatIdc = m_pcCfg->getNNPostFilterSEICharacteristicsOutColourFormatIdc(filterIdx);
}
if((sei->m_purpose & NNPC_PurposeType::RESOLUTION_UPSAMPLING) != 0)
{
sei->m_picWidthInLumaSamples = m_pcCfg->getNNPostFilterSEICharacteristicsPicWidthInLumaSamples(filterIdx);
sei->m_picHeightInLumaSamples = m_pcCfg->getNNPostFilterSEICharacteristicsPicHeightInLumaSamples(filterIdx);
int confWinLeftOffset = m_pcEncLib->getPPS(0)->getConformanceWindow().getWindowLeftOffset();
int confWinTopOffset = m_pcEncLib->getPPS(0)->getConformanceWindow().getWindowTopOffset();
int confWinRightOffset = m_pcEncLib->getPPS(0)->getConformanceWindow().getWindowRightOffset();
int confWinBottomOffset = m_pcEncLib->getPPS(0)->getConformanceWindow().getWindowBottomOffset();
int ppsPicWidthInLumaSample = m_pcEncLib->getPPS(0)->getPicWidthInLumaSamples();
int ppsPicHeightInLumaSample = m_pcEncLib->getPPS(0)->getPicHeightInLumaSamples();
const ChromaFormat chromaFormatIdc = m_pcEncLib->getSPS(0)->getChromaFormatIdc();
uint8_t subWidthC;
uint8_t subHeightC;
if (chromaFormatIdc == ChromaFormat::_420)
{
subWidthC = 2;
subHeightC = 2;
}
else if (chromaFormatIdc == ChromaFormat::_422)
{
subWidthC = 2;
subHeightC = 1;
}
else
{
subWidthC = 1;
subHeightC = 1;
}
int croppedWidth = ppsPicWidthInLumaSample - subWidthC * (confWinRightOffset + confWinLeftOffset);
int croppedHeight = ppsPicHeightInLumaSample - subHeightC * (confWinBottomOffset + confWinTopOffset);
CHECK(!(sei->m_picWidthInLumaSamples >= croppedWidth && sei->m_picWidthInLumaSamples <= croppedWidth * 16 - 1), "m_picWidthInLumaSamples shall be in the range of croppedWidth to croppedWidth * 16 - 1");
CHECK(!(sei->m_picHeightInLumaSamples >= croppedHeight && sei->m_picHeightInLumaSamples <= croppedHeight * 16 - 1), "m_picHeightInLumaSamples shall be in the range of croppedHeight to croppedHeight * 16 - 1");
if((sei->m_purpose & NNPC_PurposeType::FRAME_RATE_UPSAMPLING) != 0)
Philip Cowan
committed
{
sei->m_numberInterpolatedPictures = m_pcCfg->getNNPostFilterSEICharacteristicsNumberInterpolatedPictures(filterIdx);
Antti Hallapuro
committed
#if !JVET_AD0056_NNPFC_INPUT_PIC_OUTPUT_FLAG
sei->m_inputPicOutputFlag = m_pcCfg->getNNPostFilterSEICharacteristicsInputPicOutputFlag(filterIdx);
Antti Hallapuro
committed
#endif
CHECK(sei->m_numberInputDecodedPicturesMinus1 <= 0, "If nnpfc_purpose is FRAME_RATE_UPSAMPLING, m_numberInputDecodedPicturesMinus1 shall be greater than 0");
Philip Cowan
committed
}
sei->m_componentLastFlag = m_pcCfg->getNNPostFilterSEICharacteristicsComponentLastFlag(filterIdx);
sei->m_inpFormatIdc = m_pcCfg->getNNPostFilterSEICharacteristicsInpFormatIdc(filterIdx);
if (sei->m_inpFormatIdc == 1)
{
Philip Cowan
committed
sei->m_inpTensorBitDepthLumaMinus8 = m_pcCfg->getNNPostFilterSEICharacteristicsInpTensorBitDepthLumaMinus8(filterIdx);
sei->m_inpTensorBitDepthChromaMinus8 = m_pcCfg->getNNPostFilterSEICharacteristicsInpTensorBitDepthChromaMinus8(filterIdx);
sei->m_inpOrderIdc = m_pcCfg->getNNPostFilterSEICharacteristicsInpOrderIdc(filterIdx);
sei->m_auxInpIdc = m_pcCfg->getNNPostFilterSEICharacteristicsAuxInpIdc(filterIdx);
sei->m_sepColDescriptionFlag = m_pcCfg->getNNPostFilterSEICharacteristicsSepColDescriptionFlag(filterIdx);
if (sei->m_sepColDescriptionFlag)
{
sei->m_colPrimaries = m_pcCfg->getNNPostFilterSEICharacteristicsColPrimaries(filterIdx);
sei->m_transCharacteristics = m_pcCfg->getNNPostFilterSEICharacteristicsTransCharacteristics(filterIdx);
sei->m_matrixCoeffs = m_pcCfg->getNNPostFilterSEICharacteristicsMatrixCoeffs(filterIdx);
sei->m_outFormatIdc = m_pcCfg->getNNPostFilterSEICharacteristicsOutFormatIdc(filterIdx);
if (sei->m_outFormatIdc == 1)
{
Philip Cowan
committed
sei->m_outTensorBitDepthLumaMinus8 = m_pcCfg->getNNPostFilterSEICharacteristicsOutTensorBitDepthLumaMinus8(filterIdx);
sei->m_outTensorBitDepthChromaMinus8 = m_pcCfg->getNNPostFilterSEICharacteristicsOutTensorBitDepthChromaMinus8(filterIdx);
sei->m_outOrderIdc = m_pcCfg->getNNPostFilterSEICharacteristicsOutOrderIdc(filterIdx);
sei->m_constantPatchSizeFlag = m_pcCfg->getNNPostFilterSEICharacteristicsConstantPatchSizeFlag(filterIdx);
sei->m_patchWidthMinus1 = m_pcCfg->getNNPostFilterSEICharacteristicsPatchWidthMinus1(filterIdx);
sei->m_patchHeightMinus1 = m_pcCfg->getNNPostFilterSEICharacteristicsPatchHeightMinus1(filterIdx);
if (sei->m_constantPatchSizeFlag == 0)
{
sei->m_extendedPatchWidthCdDeltaMinus1 = m_pcCfg->getNNPostFilterSEICharacteristicsExtendedPatchWidthCdDeltaMinus1(filterIdx);
sei->m_extendedPatchHeightCdDeltaMinus1 = m_pcCfg->getNNPostFilterSEICharacteristicsExtendedPatchHeightCdDeltaMinus1(filterIdx);
}
sei->m_overlap = m_pcCfg->getNNPostFilterSEICharacteristicsOverlap(filterIdx);
sei->m_paddingType = m_pcCfg->getNNPostFilterSEICharacteristicsPaddingType(filterIdx);
sei->m_lumaPadding = m_pcCfg->getNNPostFilterSEICharacteristicsLumaPadding(filterIdx);
sei->m_cbPadding = m_pcCfg->getNNPostFilterSEICharacteristicsCbPadding(filterIdx);
sei->m_crPadding = m_pcCfg->getNNPostFilterSEICharacteristicsCrPadding(filterIdx);
Martin Pettersson
committed
sei->m_complexityInfoPresentFlag = m_pcCfg->getNNPostFilterSEICharacteristicsComplexityInfoPresentFlag(filterIdx);
if (sei->m_complexityInfoPresentFlag)
{
sei->m_parameterTypeIdc = m_pcCfg->getNNPostFilterSEICharacteristicsParameterTypeIdc(filterIdx);
sei->m_log2ParameterBitLengthMinus3 = m_pcCfg->getNNPostFilterSEICharacteristicsLog2ParameterBitLengthMinus3(filterIdx);
sei->m_numParametersIdc = m_pcCfg->getNNPostFilterSEICharacteristicsNumParametersIdc(filterIdx);
sei->m_numKmacOperationsIdc = m_pcCfg->getNNPostFilterSEICharacteristicsNumKmacOperationsIdc(filterIdx);
Martin Pettersson
committed
sei->m_totalKilobyteSize = m_pcCfg->getNNPostFilterSEICharacteristicsTotalKilobyteSize(filterIdx);
if (sei->m_modeIdc == POST_FILTER_MODE::ISO_IEC_15938_17)
const std::string payloadFilename = m_pcCfg->getNNPostFilterSEICharacteristicsPayloadFilename(filterIdx);
std::ifstream bitstreamFile(payloadFilename.c_str(), std::ifstream::in | std::ifstream::binary);
if (!bitstreamFile)
{
EXIT( "Failed to open bitstream file " << payloadFilename.c_str() << " for reading" ) ;
}
bitstreamFile.seekg(0, std::ifstream::end);
sei->m_payloadLength = bitstreamFile.tellg();
bitstreamFile.seekg(0, std::ifstream::beg);
sei->m_payloadByte = new char[sei->m_payloadLength];
bitstreamFile.read(sei->m_payloadByte, sei->m_payloadLength);
bitstreamFile.close();
}
}
void SEIEncoder::initSEINeuralNetworkPostFilterActivation(SEINeuralNetworkPostFilterActivation *sei)
{
CHECK(!(m_isInitialized), "Unspecified error");
sei->m_targetId = m_pcCfg->getNnPostFilterSEIActivationTargetId();
sei->m_cancelFlag = m_pcCfg->getNnPostFilterSEIActivationCancelFlag();
if(!sei->m_cancelFlag)
{
sei->m_persistenceFlag = m_pcCfg->getNnPostFilterSEIActivationPersistenceFlag();
}