Commit 0b33efae authored by vaclav's avatar vaclav
Browse files

Merge branch '1135-external-renderer-unnecessary-memory-allocated' into 'main'

Resolve "External renderer unnecessary memory allocated"

See merge request !1688
parents c4d22509 1dc774fa
Loading
Loading
Loading
Loading
Loading
+26 −0
Original line number Diff line number Diff line
@@ -169,6 +169,10 @@ typedef struct
    char customHrtfFilePath[RENDERER_MAX_CLI_ARG_LENGTH];
    char renderConfigFilePath[RENDERER_MAX_CLI_ARG_LENGTH];
    int8_t orientation_tracking;
#ifdef FIX_1135_EXT_RENDERER_HANDLES
    int16_t Opt_Headrotation;
    int16_t Opt_ExternalOrientation;
#endif
    int16_t nonDiegeticPan;
    float nonDiegeticPanGain;
    IVAS_REND_COMPLEXITY_LEVEL complexityLevel;
@@ -882,7 +886,11 @@ int main(

    const int16_t frameSize_smpls = (int16_t) ( ( args.render_framesize ) * args.sampleRate * 5 / ( 1000 ) );

#ifdef FIX_1135_EXT_RENDERER_HANDLES
    if ( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig, !isEmptyString( args.customHrtfFilePath ), args.nonDiegeticPan, args.nonDiegeticPanGain, args.Opt_Headrotation, args.Opt_ExternalOrientation, (int16_t) args.render_framesize ) ) != IVAS_ERR_OK )
#else
    if ( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig, !isEmptyString( args.customHrtfFilePath ), args.nonDiegeticPan, args.nonDiegeticPanGain, (int16_t) args.render_framesize ) ) != IVAS_ERR_OK )
#endif
    {
        fprintf( stderr, "Error opening renderer handle: %s\n", ivas_error_to_string( error ) );
        exit( -1 );
@@ -2510,7 +2518,12 @@ static CmdlnArgs defaultArgs(
    clearString( args.renderConfigFilePath );
    clearString( args.externalOrientationFilePath );

#ifdef FIX_1135_EXT_RENDERER_HANDLES
    args.Opt_Headrotation = 0;
    args.Opt_ExternalOrientation = 0;
#endif
    args.orientation_tracking = IVAS_HEAD_ORIENT_TRK_NONE;

    args.nonDiegeticPan = 0;
    args.nonDiegeticPanGain = 0.f;

@@ -2598,6 +2611,9 @@ static void parseOption(
            break;
        case CmdLnOptionId_trajFile:
            assert( numOptionValues == 1 );
#ifdef FIX_1135_EXT_RENDERER_HANDLES
            args->Opt_Headrotation = 1;
#endif
            strncpy( args->headRotationFilePath, optionValues[0], RENDERER_MAX_CLI_ARG_LENGTH - 1 );
            break;
        case CmdLnOptionId_outputMetadata:
@@ -2618,6 +2634,9 @@ static void parseOption(
            break;
        case CmdLnOptionId_exteriorOrientationFile:
            assert( numOptionValues == 1 );
#ifdef FIX_1135_EXT_RENDERER_HANDLES
            args->Opt_ExternalOrientation = 1;
#endif
            strncpy( args->externalOrientationFilePath, optionValues[0], RENDERER_MAX_CLI_ARG_LENGTH - 1 );
            break;
        case CmdLnOptionId_customHrtfFile:
@@ -2742,6 +2761,13 @@ static CmdlnArgs parseCmdlnArgs(
        exit( -1 ); /* Error printout handled by failing function */
    }

#ifdef FIX_1135_EXT_RENDERER_HANDLES
    if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
    {
        args.Opt_Headrotation = 1;
    }
#endif

    return args;
}

+1 −0
Original line number Diff line number Diff line
@@ -173,6 +173,7 @@
#define FIX_1129_EXT_REND_OUTPUT_HIGH                   /* Philips: issue 1129: External renderer BINAURAL_ROOM_REVERB format output level too high compared to internal rendering output */
#define FIX_1152_UNINIT_VAL_IN_ITD_VAD_COMPUTATION      /* FhG: fix uninitialized value being used in ITD VAD mid signal computation that does not affect synthesis, but crashes BASOPs */
#define FIX_1157_OBSOLETE_DMX_TABLE                     /* FhG: remove obsolte ParamMC DMX table ivas_param_mc_dmx_fac_CICP19_4tc[] */
#define FIX_1135_EXT_RENDERER_HANDLES                   /* VA: issue 1135: Memory usage reduction in external renderer: Allocate only handles that are really needed. */

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

+1 −1
Original line number Diff line number Diff line
@@ -993,7 +993,7 @@ typedef struct decoder_config_structure
    int16_t Opt_non_diegetic_pan;                /* indicates diegetic or not */
    float non_diegetic_pan_gain;                 /* non diegetic panning gain*/
    int16_t Opt_AMR_WB;                          /* flag indicating AMR-WB IO mode */
    int16_t Opt_ExternalOrientation;             /* indiates whether external orientations are used */
    int16_t Opt_ExternalOrientation;             /* indicates whether external orientations are used */
    int16_t Opt_dpid_on;                         /* indicates whether Directivity pattern option is used */
    int16_t Opt_aeid_on;                         /* indicates whether Acoustic environment option is used */
#ifdef DEBUGGING
+2 −0
Original line number Diff line number Diff line
@@ -484,11 +484,13 @@ ivas_error IVAS_DEC_Configure(
        hDecoderConfig->render_framesize = renderFramesize;
    }

#ifndef FIX_1135_EXT_RENDERER_HANDLES
    if ( hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
    {
        hDecoderConfig->Opt_Headrotation = TRUE;
    }

#endif
    /* Set decoder parameters to initial values */
    if ( ( error = ivas_init_decoder_front( st_ivas ) ) != IVAS_ERR_OK )
    {
+205 −15

File changed.

Preview size limit exceeded, changes collapsed.

Loading