Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions tools/legacy/sample_vpp/src/sample_vpp_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ mfxStatus ConfigVideoEnhancementFilters(sInputParams* pParams,
if (VPP_FILTER_ENABLED_CONFIGURED == pParams->srParam[paramID].mode) {
auto srConfig = pVppParam->AddExtBuffer<mfxExtVPPAISuperResolution>();
srConfig->SRMode = MFX_AI_SUPER_RESOLUTION_MODE_DEFAULT;
srConfig->SRAlgorithm =
static_cast<mfxAISuperResolutionAlgorithm>(pParams->srParam[paramID].algorithm);
}
#endif
if (VPP_FILTER_ENABLED_CONFIGURED == pParams->colorfillParam[paramID].mode) {
Expand Down
29 changes: 26 additions & 3 deletions tools/legacy/sample_vpp/src/sample_vpp_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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");

Expand Down Expand Up @@ -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);
Expand Down
12 changes: 10 additions & 2 deletions tools/legacy/sample_vpp/src/sample_vpp_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down