diff --git a/tools/legacy/sample_vpp/src/sample_vpp_config.cpp b/tools/legacy/sample_vpp/src/sample_vpp_config.cpp index 584fa51..3dee5d7 100644 --- a/tools/legacy/sample_vpp/src/sample_vpp_config.cpp +++ b/tools/legacy/sample_vpp/src/sample_vpp_config.cpp @@ -107,6 +107,8 @@ mfxStatus ConfigVideoEnhancementFilters(sInputParams* pParams, if (VPP_FILTER_ENABLED_CONFIGURED == pParams->srParam[paramID].mode) { auto srConfig = pVppParam->AddExtBuffer(); srConfig->SRMode = MFX_AI_SUPER_RESOLUTION_MODE_DEFAULT; + srConfig->SRAlgorithm = + static_cast(pParams->srParam[paramID].algorithm); } #endif if (VPP_FILTER_ENABLED_CONFIGURED == pParams->colorfillParam[paramID].mode) { diff --git a/tools/legacy/sample_vpp/src/sample_vpp_parser.cpp b/tools/legacy/sample_vpp/src/sample_vpp_parser.cpp index 6b21c32..ab6048f 100644 --- a/tools/legacy/sample_vpp/src/sample_vpp_parser.cpp +++ b/tools/legacy/sample_vpp/src/sample_vpp_parser.cpp @@ -272,6 +272,9 @@ void vppPrintHelp(const char* strAppName, const char* strErrorMessage) { " [-gamut:bt709] - enable BT.709 matrix transform (RGB->YUV conversion)(def: BT.601)\n\n"); printf(" [-frc:advanced] - enable advanced FRC algorithm (based on PTS) \n"); printf(" [-frc:interp] - enable FRC based on frame interpolation algorithm\n\n"); +#ifdef ONEVPL_EXPERIMENTAL + printf(" [-frc:ai_interp] - enable AI based FRC algorithm\n\n"); +#endif printf(" [-tcc:red] - enable color saturation algorithm (R component) \n"); printf(" [-tcc:green] - enable color saturation algorithm (G component)\n"); @@ -295,7 +298,11 @@ void vppPrintHelp(const char* strAppName, const char* strErrorMessage) { printf(" [-ssinr (id)] - specify YUV nominal range for input surface.\n"); printf(" [-dsinr (id)] - specify YUV nominal range for output surface.\n\n"); printf(" [-mirror (mode)] - mirror image using specified mode.\n"); - printf(" [-sr] - enable AI based super resolution.\n"); + printf(" [-sr (algorithm)] - enable AI based super resolution.\n"); + printf(" algorithm - algorithm of AI based super resolution\n"); + printf(" 0 - most appropriate sr algorithm for current hardware (default)\n"); + printf(" 1 - sr algorithm1\n"); + printf(" 2 - sr algorithm2 (expected to be better than algorithm1)\n"); printf(" [-n frames] - number of frames to VPP process\n\n"); @@ -1120,9 +1127,25 @@ mfxStatus vppParseInputString(char* strInput[], msdk_opt_read(strInput[i], pParams->mirroringParam[0].Type); } else if (msdk_match(strInput[i], "-sr")) { - VAL_CHECK(1 + i == nArgNum); - pParams->srParam[0].mode = VPP_FILTER_ENABLED_CONFIGURED; + + if (i + 1 < nArgNum) { + if (MFX_ERR_NONE != msdk_opt_read(strInput[i + 1], readData)) { + pParams->srParam[0].algorithm = 0; // default SR algorithm + } + else { + pParams->srParam[0].algorithm = (mfxU32)readData; + pParams->srParam[0].mode = VPP_FILTER_ENABLED_CONFIGURED; + i++; + + if (pParams->srParam[0].algorithm != 0 && + pParams->srParam[0].algorithm != 1 && + pParams->srParam[0].algorithm != 2) { + vppPrintHelp(strInput[0], "Invalid SR configuration"); + return MFX_ERR_UNSUPPORTED; + } + } + } } else if (msdk_match(strInput[i], "-sw")) { VAL_CHECK(1 + i == nArgNum); diff --git a/tools/legacy/sample_vpp/src/sample_vpp_utils.cpp b/tools/legacy/sample_vpp/src/sample_vpp_utils.cpp index c230e62..9a93850 100644 --- a/tools/legacy/sample_vpp/src/sample_vpp_utils.cpp +++ b/tools/legacy/sample_vpp/src/sample_vpp_utils.cpp @@ -217,10 +217,18 @@ void PrintStreamInfo(sInputParams* pParams, //printf("FRC:Advanced\t%s\n", (VPP_FILTER_DISABLED != pParams->frcParam.mode) ? "ON": "OFF"); #ifdef ONEVPL_EXPERIMENTAL if (VPP_FILTER_ENABLED_CONFIGURED == pParams->srParam[0].mode) { - printf("SR:AI-Default\tON\n"); + if (MFX_AI_SUPER_RESOLUTION_ALGORITHM_DEFAULT == pParams->srParam[0].algorithm) { + printf("SR:AI-Default\tON\n"); + } + else if (MFX_AI_SUPER_RESOLUTION_ALGORITHM_1 == pParams->srParam[0].algorithm) { + printf("SR:AI-Algo-1\tON\n"); + } + else if (MFX_AI_SUPER_RESOLUTION_ALGORITHM_2 == pParams->srParam[0].algorithm) { + printf("SR:AI-Algo-2\tON\n"); + } } else { - printf("SR:AI-Default\tOFF\n"); + printf("SR:AI\t\tOFF\n"); } #endif // MSDK 3.0