Commit 75267d96 authored by norvell's avatar norvell
Browse files

Merge branch 'main' into 2192_basop_port-mr2337-from-float-object-editing-do-not-support-ext-md

parents f946e6d9 be1996c8
Loading
Loading
Loading
Loading
Loading
+56 −0
Original line number Diff line number Diff line
@@ -132,6 +132,9 @@ typedef struct
#ifdef FIX_1419_MONO_STEREO_UMX
    bool evsMode;
#endif
#ifdef FIX_1318_ROOM_SIZE_CMD_LINE
    IVAS_ROOM_SIZE_T roomSize;
#endif

} DecArguments;

@@ -413,9 +416,15 @@ int main(
    asked_frame_size = arg.renderFramesize;
    uint16_t aeID = arg.aeSequence.count > 0 ? arg.aeSequence.pID[0] : 65535;

#ifdef FIX_1318_ROOM_SIZE_CMD_LINE
    if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputConfig, arg.renderFramesize, arg.customLsOutputEnabled, arg.hrtfReaderEnabled,
                                       arg.enableHeadRotation, arg.enableExternalOrientation, arg.orientation_tracking, arg.renderConfigEnabled, arg.roomSize, arg.non_diegetic_pan_enabled,
                                       arg.non_diegetic_pan_gain_fx, arg.dpidEnabled, aeID, arg.objEditEnabled, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK )
#else
    if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputConfig, arg.renderFramesize, arg.customLsOutputEnabled, arg.hrtfReaderEnabled,
                                       arg.enableHeadRotation, arg.enableExternalOrientation, arg.orientation_tracking, arg.renderConfigEnabled,
                                       arg.non_diegetic_pan_enabled, arg.non_diegetic_pan_gain_fx, arg.dpidEnabled, aeID, arg.objEditEnabled, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK )
#endif
    {
        fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
        goto cleanup;
@@ -892,6 +901,10 @@ static bool parseCmdlIVAS_dec(
    arg->objEditEnabled = false;
    arg->objEditFileName = NULL;

#ifdef FIX_1318_ROOM_SIZE_CMD_LINE
    arg->roomSize = IVAS_ROOM_SIZE_AUTO;
#endif

    /*-----------------------------------------------------------------*
     * Initialization
     *-----------------------------------------------------------------*/
@@ -1374,6 +1387,45 @@ static bool parseCmdlIVAS_dec(
            i++;
        }
#endif
#ifdef FIX_1318_ROOM_SIZE_CMD_LINE
        else if ( strcmp( argv_to_upper, "-ROOM_SIZE" ) == 0 )
        {
            i++;
            if ( argc - i <= 3 || argv[i][0] == '-' )
            {
                fprintf( stderr, "Error: Room size selector not specified!\n\n" );
                usage_dec();
                return false;
            }

            if ( strlen( argv[i] ) != 1 )
            {
                fprintf( stderr, "Error: Unsupported room size selector %s!\n\n", argv[i] );
                usage_dec();
                return false;
            }
            switch ( argv[i][0] )
            {
                case 'S':
                case 's':
                    arg->roomSize = IVAS_ROOM_SIZE_SMALL;
                    break;
                case 'M':
                case 'm':
                    arg->roomSize = IVAS_ROOM_SIZE_MEDIUM;
                    break;
                case 'L':
                case 'l':
                    arg->roomSize = IVAS_ROOM_SIZE_LARGE;
                    break;
                default:
                    fprintf( stderr, "Error: Unsupported room size selector %s!\n\n", argv[i] );
                    usage_dec();
                    return false;
            }
            i++;
        }
#endif

        /*-----------------------------------------------------------------*
         * Option not recognized
@@ -1594,6 +1646,10 @@ static void usage_dec( void )

    fprintf( stdout, "-level level        : Complexity level, level = (1, 2, 3), will be defined after characterisation. \n" );
    fprintf( stdout, "                      Currently, all values default to level 3 (full functionality).\n" );
#ifdef FIX_1318_ROOM_SIZE_CMD_LINE
    fprintf( stdout, "-room_size (S|M|L)  : Selects default reverb based on a room size (S - small | M - medium | L - large)\n" );
    fprintf( stdout, "                      for BINAURAL_ROOM_REVERB output configuration,\n" );
#endif
    fprintf( stdout, "-q                  : Quiet mode, no frame counter\n" );
    fprintf( stdout, "                      default is deactivated\n" );
    fprintf( stdout, "\n" );
+76 −0
Original line number Diff line number Diff line
@@ -200,6 +200,9 @@ typedef struct
    IVAS_RENDER_FRAMESIZE render_framesize;
    uint16_t directivityPatternId[RENDERER_MAX_ISM_INPUTS];
    AcousticEnvironmentSequence aeSequence;
#ifdef FIX_1318_ROOM_SIZE_CMD_LINE
    IVAS_ROOM_SIZE_T reverbRoomSize;
#endif
} CmdlnArgs;

typedef enum
@@ -230,7 +233,12 @@ typedef enum
    CmdLnOptionId_framing,
    CmdLnOptionId_syncMdDelay,
    CmdLnOptionId_directivityPatternId,
#ifdef FIX_1318_ROOM_SIZE_CMD_LINE
    CmdLnOptionId_acousticEnvironmentId,
    CmdLnOptionId_roomSize,
#else
    CmdLnOptionId_acousticEnvironmentId
#endif
} CmdLnOptionId;

static const CmdLnParser_Option cliOptions[] = {
@@ -400,6 +408,14 @@ static const CmdLnParser_Option cliOptions[] = {
        .description = "Acoustic environment ID( number > 0 ) or a sequence thereof in the format [ID1:duration1,ID2:duration2...] without braces and spaces, with ':' character separating ID from duration and ',' separating ID and duration pairs, where duration is specified in frames for BINAURAL_ROOM_REVERB output configuration.",
#endif
    },
#ifdef FIX_1318_ROOM_SIZE_CMD_LINE
    {
        .id = CmdLnOptionId_roomSize,
        .match = "room_size",
        .matchShort = "rsz",
        .description = "Selects default reverb based on a room size (S - small | M - medium | L - large)",
    }
#endif
};


@@ -1252,6 +1268,19 @@ int main(
        goto cleanup;
    }

#ifdef FIX_1318_ROOM_SIZE_CMD_LINE

    /* Set reverb room size if specified */
    if ( args.reverbRoomSize != IVAS_ROOM_SIZE_AUTO )
    {
        if ( ( IVAS_REND_SetReverbRoomSize( hIvasRend, args.reverbRoomSize ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nError setting reverb room size\n" );
            goto cleanup;
        }
    }
#endif

    /* Set up output custom layout configuration */
    if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM )
    {
@@ -2760,6 +2789,39 @@ static bool parseAcousticEnvironmentIds(

    return true;
}
#ifdef FIX_1318_ROOM_SIZE_CMD_LINE


static bool parseReverbRoomSize(
    char *value,
    IVAS_ROOM_SIZE_T *reverbRoomSize )
{
    if ( strlen( value ) != 1 )
    {
        fprintf( stderr, "Error: Unsupported room size selector %s!\n\n", value );
        return false;
    }

    to_upper( value );
    switch ( value[0] )
    {
        case 'S':
            *reverbRoomSize = IVAS_ROOM_SIZE_SMALL;
            break;
        case 'M':
            *reverbRoomSize = IVAS_ROOM_SIZE_MEDIUM;
            break;
        case 'L':
            *reverbRoomSize = IVAS_ROOM_SIZE_LARGE;
            break;
        default:
            fprintf( stderr, "Error: Unsupported room size selector %s!\n\n", value );
            return false;
    }

    return true;
}
#endif


static bool checkRequiredArgs(
@@ -2881,6 +2943,10 @@ static CmdlnArgs defaultArgs(
    args.aeSequence.pValidity = NULL;
    args.aeSequence.selected = 0;
    args.aeSequence.frameCounter = 0;
#ifdef FIX_1318_ROOM_SIZE_CMD_LINE

    args.reverbRoomSize = IVAS_ROOM_SIZE_AUTO;
#endif

    return args;
}
@@ -3062,6 +3128,16 @@ static void parseOption(
            /* Metadata Delay to sync with audio delay in ms */
            args->syncMdDelay = (int16_t) strtol( optionValues[0], NULL, 10 );
            break;
#ifdef FIX_1318_ROOM_SIZE_CMD_LINE
        case CmdLnOptionId_roomSize:
            assert( numOptionValues == 1 );
            if ( !parseReverbRoomSize( optionValues[0], &args->reverbRoomSize ) )
            {
                fprintf( stderr, "Error: Unsupported room size selector %s!\n\n", optionValues[0] );
                exit( -1 );
            }
            break;
#endif
        default:
            assert( 0 && "This should be unreachable - all command line options should be explicitly handled." );
            break;
+10 −0
Original line number Diff line number Diff line
@@ -189,6 +189,16 @@ typedef enum

} IVAS_RENDER_FRAMESIZE;

#ifdef FIX_1318_ROOM_SIZE_CMD_LINE
typedef enum
{
    IVAS_ROOM_SIZE_AUTO = -1,
    IVAS_ROOM_SIZE_SMALL,
    IVAS_ROOM_SIZE_MEDIUM,
    IVAS_ROOM_SIZE_LARGE
} IVAS_ROOM_SIZE_T;
#endif

typedef struct ivas_masa_metadata_frame_struct *IVAS_MASA_METADATA_HANDLE;
typedef struct ivas_masa_decoder_ext_out_meta_struct *IVAS_MASA_DECODER_EXT_OUT_META_HANDLE;

+16 −0
Original line number Diff line number Diff line
@@ -1661,11 +1661,27 @@ typedef enum
#define RV_LENGTH_NR_FC                         ( RV_FILTER_MAX_FFT_SIZE / 2 ) + 1

#define RV_LENGTH_NR_FC_16KHZ                   ( RV_FILTER_MAX_FFT_SIZE / 4 ) + 1
#ifdef FIX_1318_ROOM_SIZE_CMD_LINE
#define IVAS_REVERB_DEFAULT_L_N_BANDS           31
#define IVAS_REVERB_DEFAULT_M_N_BANDS           31
#define IVAS_REVERB_DEFAULT_S_N_BANDS           60
#else
#define IVAS_REVERB_DEFAULT_N_BANDS             31
#endif

#define LR_IAC_LENGTH_NR_FC                     ( RV_LENGTH_NR_FC )
#define LR_IAC_LENGTH_NR_FC_16KHZ               ( RV_LENGTH_NR_FC_16KHZ )

#ifdef FIX_1318_ROOM_SIZE_CMD_LINE
typedef enum
{
    DEFAULT_REVERB_UNSET = -1,
    DEFAULT_REVERB_SMALL,
    DEFAULT_REVERB_MEDIUM,
    DEFAULT_REVERB_LARGE
} IVAS_DefaultReverbSize;
#endif


/*----------------------------------------------------------------------------------*
 * FB mixer constants
+1 −0
Original line number Diff line number Diff line
@@ -147,6 +147,7 @@
#define NONBE_1344_REND_MASA_LOW_FS                     /* Nokia: Issue 1344: Fix sanitizer errors when using IVAS_rend to render MASA with lower sampling rates */
#define FIX_1437_LC3PLUS_EXTREND_HIRES                  /* FhG: fix external renderer split bitstream header writing causing a crash for LC3plus High-res mode */
#define NONBE_1412_AVOID_ROUNDING_AZ_ELEV               /* FhG:  Avoid rounding when passing azimuth and elevation to efap_determine_gains() */
#define FIX_1318_ROOM_SIZE_CMD_LINE                     /* Philips/Nokia/FhG: Default room sizes support */

// object-editing feature porting
#define TMP_FIX_SPLIT_REND                              // temporary fix to split-rendering (it follows the later state of the framework but it is needed now because of current test-conditions)
Loading