From 1d03e1afe016b3f1260627002c5202d09dbf8204 Mon Sep 17 00:00:00 2001 From: vaclav Date: Mon, 14 Aug 2023 13:00:02 +0200 Subject: [PATCH] Implement complexity levels to renderer; under FIX_706_REND_COMPLEXITY_LEVELS --- apps/renderer.c | 29 +++++++++++++++++++++++++++++ lib_com/options.h | 2 ++ lib_rend/lib_rend.h | 9 +++++++++ 3 files changed, 40 insertions(+) diff --git a/apps/renderer.c b/apps/renderer.c index 4933849a38..91a7b9c179 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -165,6 +165,9 @@ typedef struct int8_t orientation_tracking; int16_t nonDiegeticPan; float nonDiegeticPanGain; +#ifdef FIX_706_REND_COMPLEXITY_LEVELS + IVAS_REND_COMPLEXITY_LEVEL complexityLevel; +#endif bool delayCompensationEnabled; bool quietModeEnabled; bool sceneDescriptionInput; @@ -195,6 +198,9 @@ typedef enum CmdLnOptionId_orientationTracking, CmdlnOptionId_lfePosition, CmdlnOptionId_lfeMatrix, +#ifdef FIX_706_REND_COMPLEXITY_LEVELS + CmdLnOptionId_complexityLevel, +#endif CmdLnOptionId_noDelayCmp, CmdLnOptionId_quietModeEnabled, CmdLnOptionId_inputMetadata, @@ -318,6 +324,14 @@ static const CmdLnParser_Option cliOptions[] = { .matchShort = "ndc", .description = "[flag] Turn off delay compensation", }, +#ifdef FIX_706_REND_COMPLEXITY_LEVELS + { + .id = CmdLnOptionId_complexityLevel, + .match = "complexity_level", + .matchShort = "level", + .description = "Complexity level, level = (1, 2, 3), will be defined after characterisation.", + }, +#endif { .id = CmdLnOptionId_quietModeEnabled, .match = "quiet", @@ -2657,6 +2671,21 @@ static void parseOption( strncpy( args->inLfePanningMatrixFile, optionValues[0], RENDERER_MAX_CLI_ARG_LENGTH - 1 ); args->lfeCustomRoutingEnabled = true; break; +#ifdef FIX_706_REND_COMPLEXITY_LEVELS + case CmdLnOptionId_complexityLevel: + assert( numOptionValues == 1 ); + args->complexityLevel = (int32_t) ( strtol( optionValues[0], NULL, 10 ) ); + if ( args->complexityLevel < IVAS_REND_COMPLEXITY_LEVEL_ONE || args->complexityLevel > IVAS_REND_COMPLEXITY_LEVEL_THREE ) + { + fprintf( stdout, "Invalid complexity level specified.\n" ); + exit( -1 ); + } + else if ( args->complexityLevel == IVAS_REND_COMPLEXITY_LEVEL_ONE || args->complexityLevel == IVAS_REND_COMPLEXITY_LEVEL_TWO ) + { + fprintf( stdout, "Complexity levels 1 and 2 will be defined after characterisation - default to level 3 (full functionality).\n" ); + } + break; +#endif case CmdLnOptionId_noDelayCmp: assert( numOptionValues == 0 ); args->delayCompensationEnabled = false; diff --git a/lib_com/options.h b/lib_com/options.h index 43d94c6659..016a9929af 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -173,6 +173,8 @@ #define FIX_694_OMASA_EXTREME /* Nokia: fix for crash in OMASA on extreme sample */ +#define FIX_706_REND_COMPLEXITY_LEVELS /* VoiceAge: Implement complexity levels to renderer */ + /* ################## End BE DEVELOPMENT switches ######################### */ diff --git a/lib_rend/lib_rend.h b/lib_rend/lib_rend.h index bd30a8cf32..8c871c1a5b 100644 --- a/lib_rend/lib_rend.h +++ b/lib_rend/lib_rend.h @@ -150,6 +150,15 @@ typedef enum typedef uint16_t IVAS_REND_InputId; +#ifdef FIX_706_REND_COMPLEXITY_LEVELS +typedef enum _IVAS_REND_COMPLEXITY_LEVEL +{ + IVAS_REND_COMPLEXITY_LEVEL_ONE = 1, + IVAS_REND_COMPLEXITY_LEVEL_TWO = 2, + IVAS_REND_COMPLEXITY_LEVEL_THREE = 3 +} IVAS_REND_COMPLEXITY_LEVEL; +#endif + /* clang-format off */ /*----------------------------------------------------------------------------------* -- GitLab