Commit e20ac7c9 authored by Marek Szczerba's avatar Marek Szczerba
Browse files

Merge branch...

Merge branch '1318-default-reverb-configuration-for-binaural_room_reverb-mode-cmd-line' into '1318-default-reverb-configuration-for-binaural_room_reverb-mode'

Resolve "Default reverb configuration for BINAURAL_ROOM_REVERB mode" - command line option

See merge request !2353
parents 80d72c44 2f3c020d
Loading
Loading
Loading
Loading
Loading
+56 −0
Original line number Diff line number Diff line
@@ -155,6 +155,9 @@ typedef struct
    uint16_t directivityPatternId[IVAS_MAX_NUM_OBJECTS];
    bool objEditEnabled;
    char *objEditFileName;
#ifdef FIX_1318_ROOM_SIZE_CMD_LINE
    IVAS_ROOM_SIZE_T roomSize;
#endif

} DecArguments;

@@ -455,9 +458,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;
@@ -1036,6 +1045,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
     *-----------------------------------------------------------------*/
@@ -1524,6 +1537,45 @@ static bool parseCmdlIVAS_dec(
            }
            i++;
        }
#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
@@ -1752,6 +1804,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
+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;

+1 −1
Original line number Diff line number Diff line
@@ -171,7 +171,7 @@
#define TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR      /* FhG: Temporary workaround for incorrect implementation of decoder flush with split rendering */
#define FIX_1413_IGF_INIT_PRINTOUT                      /* FhG: use correct variable for IGF initiliazation */
#define RENDERER_MD_SYNC_DELAY_TO_INTEGER               /* FhG: change data type of metadata sync delay in ext renderer to int16_t for better BASOP portability (and nicer code) */

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

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

+41 −2
Original line number Diff line number Diff line
@@ -1397,7 +1397,10 @@ ivas_error ivas_init_decoder(
        if ( st_ivas->hDecoderConfig->Opt_RendConfigCustom == 0 )
        {
            IVAS_DefaultReverbSize defaultReverbSize;

#ifdef FIX_1318_ROOM_SIZE_CMD_LINE
            switch ( st_ivas->hDecoderConfig->Opt_RoomSize )
            {
                case IVAS_ROOM_SIZE_AUTO:
                    switch ( st_ivas->ivas_format )
                    {
                        case ISM_FORMAT:
@@ -1421,7 +1424,43 @@ ivas_error ivas_init_decoder(
                        default:
                            defaultReverbSize = DEFAULT_REVERB_LARGE;
                    }

                    break;
                case IVAS_ROOM_SIZE_SMALL:
                    defaultReverbSize = DEFAULT_REVERB_SMALL;
                    break;
                case IVAS_ROOM_SIZE_MEDIUM:
                    defaultReverbSize = DEFAULT_REVERB_MEDIUM;
                    break;
                case IVAS_ROOM_SIZE_LARGE:
                default:
                    defaultReverbSize = DEFAULT_REVERB_LARGE;
                    break;
            }
#else
            switch ( st_ivas->ivas_format )
            {
                case ISM_FORMAT:
                    defaultReverbSize = DEFAULT_REVERB_MEDIUM;
                    break;
                case SBA_FORMAT:
                    defaultReverbSize = DEFAULT_REVERB_SMALL;
                    break;
                case MASA_FORMAT:
                    defaultReverbSize = DEFAULT_REVERB_SMALL;
                    break;
                case MC_FORMAT:
                    defaultReverbSize = DEFAULT_REVERB_MEDIUM;
                    break;
                case MASA_ISM_FORMAT:
                    defaultReverbSize = DEFAULT_REVERB_MEDIUM;
                    break;
                case SBA_ISM_FORMAT:
                    defaultReverbSize = DEFAULT_REVERB_MEDIUM;
                    break;
                default:
                    defaultReverbSize = DEFAULT_REVERB_LARGE;
            }
#endif
            if ( ( error = ivas_render_config_change_defaults( st_ivas->hRenderConfig, defaultReverbSize ) ) != IVAS_ERR_OK )
            {
                return error;
+3 −0
Original line number Diff line number Diff line
@@ -1016,6 +1016,9 @@ typedef struct decoder_config_structure
    int16_t Opt_HRTF_binary;                     /* indicates whether HRTF binary file is used */
    int16_t Opt_Headrotation;                    /* indicates whether head-rotation is used */
    int16_t Opt_RendConfigCustom;                /* indicates whether Renderer configuration custom setup is used */
#ifdef FIX_1318_ROOM_SIZE_CMD_LINE
    IVAS_ROOM_SIZE_T Opt_RoomSize; /* Selected room size */
#endif
    IVAS_HEAD_ORIENT_TRK_T orientation_tracking; /* indicates orientation tracking type */
    int16_t Opt_non_diegetic_pan;                /* indicates diegetic or not */
    float non_diegetic_pan_gain;                 /* non diegetic panning gain*/
Loading