Commit d8b0d336 authored by vaclav's avatar vaclav
Browse files

formal improvements

parent d7e01c4f
Loading
Loading
Loading
Loading
+13 −3
Original line number Diff line number Diff line
@@ -752,8 +752,8 @@ int main(
    {
#ifndef NONBE_FIX_BINARY_BINAURAL_READING
        IVAS_DEC_HRTF_HANDLE hHrtfTD = NULL;
#endif

#endif
        if ( ( error = IVAS_DEC_GetHrtfHandle( hIvasDec, &hHrtfTD ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nIVAS_DEC_GetHrtfHandle failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
@@ -768,11 +768,13 @@ int main(
#ifdef FIX_OLD_BINARY_FORMAT
                hrtfFileReader_close( &hrtfReader );
                strcat( arg.hrtfFileName, "new" );

                if ( hrtfFileReader_open( arg.hrtfFileName, &hrtfReader ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "\nError in loading HRTF binary file %s \n\n", arg.hrtfFileName );
                    goto cleanup;
                }

                if ( ( error = load_HRTF_binary( *hHrtfTD, hrtfReader ) ) != IVAS_ERR_OK )
                {
                    if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA )
@@ -782,7 +784,11 @@ int main(
                    }
                    else
                    {
                        destroy_td_hrtf( hHrtfTD );
                        if ( ( error = destroy_td_hrtf( hHrtfTD ) ) != IVAS_ERR_OK )
                        {
                            fprintf( stderr, "\ndestroy_td_hrtf() failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
                            goto cleanup;
                        }
                    }
                }
#else
@@ -792,7 +798,11 @@ int main(
            }
            else
            {
                destroy_td_hrtf( hHrtfTD );
                if ( ( error = destroy_td_hrtf( hHrtfTD ) ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "\ndestroy_td_hrtf() failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
                    goto cleanup;
                }
            }
        }
#else
+16 −5
Original line number Diff line number Diff line
@@ -823,6 +823,7 @@ int main(
    cldfb_in_flag = 0;
#endif
#endif

    for ( i = 0; i < RENDERER_MAX_MC_INPUTS; ++i )
    {
        lfeRoutingConfigs[i] = NULL;
@@ -904,8 +905,8 @@ int main(
            exit( -1 );
        }
    }
#endif

#endif
    if ( !isEmptyString( args.renderConfigFilePath ) )
    {
        if ( RenderConfigReader_open( args.renderConfigFilePath, &renderConfigReader ) != IVAS_ERR_OK )
@@ -1044,7 +1045,6 @@ int main(
                                   args.nonDiegeticPan, args.nonDiegeticPanGain, (int16_t) args.render_framesize ) ) != IVAS_ERR_OK )
#else
#ifdef NONBE_FIX_BINARY_BINAURAL_READING

    if ( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig, !isEmptyString( args.customHrtfFilePath ),
#else
    if ( ( error = IVAS_REND_Open( &hIvasRend, args.sampleRate, args.outConfig.audioConfig,
@@ -1080,11 +1080,13 @@ int main(
#ifdef FIX_OLD_BINARY_FORMAT
                    hrtfFileReader_close( &hrtfFileReader );
                    strcat( args.customHrtfFilePath, "new" );

                    if ( hrtfFileReader_open( args.customHrtfFilePath, &hrtfFileReader ) != IVAS_ERR_OK )
                    {
                        fprintf( stderr, "\nError in loading HRTF binary file %s \n\n", args.customHrtfFilePath );
                        goto cleanup;
                    }

                    if ( ( error = load_HRTF_binary( *hHrtfTD, hrtfFileReader ) ) != IVAS_ERR_OK )
                    {
                        if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA )
@@ -1094,7 +1096,11 @@ int main(
                        }
                        else
                        {
                            destroy_td_hrtf( hHrtfTD );
                            if ( ( error = destroy_td_hrtf( hHrtfTD ) ) != IVAS_ERR_OK )
                            {
                                fprintf( stderr, "\ndestroy_td_hrtf() failed: \n\n" /*, IVAS_DEC_GetErrorMessage( error )*/ );
                                goto cleanup;
                            }
                        }
                    }
#else
@@ -1104,7 +1110,11 @@ int main(
                }
                else
                {
                    destroy_td_hrtf( hHrtfTD );
                    if ( ( error = destroy_td_hrtf( hHrtfTD ) ) != IVAS_ERR_OK )
                    {
                        fprintf( stderr, "\ndestroy_td_hrtf() failed: \n\n" /*, IVAS_DEC_GetErrorMessage( error )*/ );
                        goto cleanup;
                    }
                }
            }

@@ -1192,8 +1202,8 @@ int main(
#ifdef SPLIT_REND_WITH_HEAD_ROT
    CLDFBframeSize_smpls = 0;
    cldfb_in_flag = 0;
#endif

#endif
#endif
    if ( args.renderConfigFilePath[0] != '\0' )
    {
@@ -2274,6 +2284,7 @@ cleanup:
        free( bitsBufferData );
    }
#endif

    for ( i = 0; i < RENDERER_MAX_MASA_INPUTS; ++i )
    {
        MasaFileReader_close( &masaReaders[i] );
+5 −5
Original line number Diff line number Diff line
@@ -1631,11 +1631,6 @@ typedef enum
#define MAX_ANGULAR_STEP_INV                    ( 1.0f / MAX_ANGULAR_STEP )
#define MAX_INTERPOLATION_STEPS                 12

#define LR_IAC_LENGTH_NR_FC                     ( RV_LENGTH_NR_FC )
#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB
#define LR_IAC_LENGTH_NR_FC_16KHZ               ( RV_LENGTH_NR_FC_16KHZ )
#endif

/* ----- Enums - TD Renderer ----- */

typedef enum
@@ -1692,6 +1687,11 @@ typedef enum
#endif
#define IVAS_REVERB_DEFAULT_N_BANDS             31

#define LR_IAC_LENGTH_NR_FC                     ( RV_LENGTH_NR_FC )
#ifdef NONBE_FIX_AVG_IAC_CLDFB_REVERB
#define LR_IAC_LENGTH_NR_FC_16KHZ               ( RV_LENGTH_NR_FC_16KHZ )
#endif


/*----------------------------------------------------------------------------------*
 * FB mixer constants
+3 −3
Original line number Diff line number Diff line
@@ -2960,8 +2960,8 @@ void set_zero_l(
    float *vec,                                                 /* o  : input vector                            */
    const uint32_t lvec                                         /* i  : length of the vector                    */
);
#endif

#endif
ivas_error stereo_memory_enc(
    CPE_ENC_HANDLE hCPE,                                        /* i  : CPE encoder structure                   */
    const int32_t input_Fs,                                     /* i  : input sampling rate                     */
+2 −0
Original line number Diff line number Diff line
@@ -579,6 +579,7 @@ int16_t check_bounds_s(
    return value_adj;
}


#ifdef FIX_CRASH_LONG_BRIR
/*---------------------------------------------------------------------*
 * set_zero_l()
@@ -602,6 +603,7 @@ void set_zero_l(
}
#endif


/****************************************************************************/
/* matrix functions                                                         */
/* matrices are ordered column-wise in memory                               */
Loading