Commit d6414eb8 authored by vaclav's avatar vaclav
Browse files

Merge remote-tracking branch 'remotes/origin/main' into 1440-missing-amr-wb-io-memory-reset

parents 585fa06b 75599327
Loading
Loading
Loading
Loading
Loading
+62 −0
Original line number Diff line number Diff line
@@ -162,6 +162,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;

@@ -497,9 +500,15 @@ int main(
#ifdef IVAS_RTPDUMP
    arg.enableHeadRotation = arg.enableHeadRotation || arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM;
#endif
#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, 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, arg.dpidEnabled, aeID, arg.objEditEnabled, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK )
#endif
    {
        fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
        goto cleanup;
@@ -1143,6 +1152,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
     *-----------------------------------------------------------------*/
@@ -1639,6 +1652,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
@@ -1881,6 +1933,10 @@ static void usage_dec( void )
    fprintf( stdout, "-obj_edit File      : Object editing instructions file or NULL for built-in example\n" );
    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" );
#ifdef DEBUG_MODE_INFO
@@ -4632,9 +4688,15 @@ ivas_error restartDecoder(
    uint16_t aeID = arg->aeSequence.count > 0 ? arg->aeSequence.pID[0] : 65535;

    IVAS_AUDIO_CONFIG outputConfig = ( codec == IVAS_DEC_MODE_IVAS ) ? arg->outputConfig : IVAS_AUDIO_CONFIG_MONO;
#ifdef FIX_1318_ROOM_SIZE_CMD_LINE
    if ( ( error = IVAS_DEC_Configure( hIvasDec, arg->output_Fs, 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, arg->dpidEnabled, aeID, arg->objEditEnabled, arg->delayCompensationEnabled ) ) != IVAS_ERR_OK )
#else
    if ( ( error = IVAS_DEC_Configure( hIvasDec, arg->output_Fs, 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, arg->dpidEnabled, aeID, arg->objEditEnabled, arg->delayCompensationEnabled ) ) != IVAS_ERR_OK )
#endif
    {
        fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
        goto cleanup;
+75 −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[] = {
@@ -396,6 +404,14 @@ static const CmdLnParser_Option cliOptions[] = {
        .matchShort = "aeid",
        .description = "Acoustic environment ID (number > 0) alternatively, it can be\na text file where each line contains \"ID duration\" for\nBINAURAL_ROOM_REVERB output.",
    },
#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
};


@@ -1160,6 +1176,18 @@ int main(
        fprintf( stderr, "\nError in IVAS_REND_SetOrientationTrackingMode(): %s\n", ivas_error_to_string( error ) );
        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 )
@@ -2551,6 +2579,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(
@@ -2672,6 +2733,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;
}
@@ -2857,6 +2922,16 @@ static void parseOption(
            args->syncMdDelay = strtof( optionValues[0], NULL );
#endif
            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
@@ -173,6 +173,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;

+15 −0
Original line number Diff line number Diff line
@@ -1601,7 +1601,13 @@ typedef enum
#define RV_FILTER_MAX_HISTORY                   ( 512 - 160 )               /* for longest history */
#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
#ifdef IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT
#define IVAS_DEFAULT_AEID                       ( 65535 )
#endif
@@ -1609,6 +1615,15 @@ typedef enum
#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
@@ -179,6 +179,7 @@
#define FIX_1427_OBJ_EDITING_EXT_METADATA               /* Eri: Add support for extended metadata in object editing */
#define FIX_1419_MONO_STEREO_UMX                        /* FhG: fix for issue 1419 : support upmix to all output formats for mono and stereo */

#define FIX_1318_ROOM_SIZE_CMD_LINE                     /* Philips/Nokia: Default room sizes support */

/* #################### End BE switches ################################## */

Loading