Commit caec709d authored by sbsarac's avatar sbsarac
Browse files

Merge branch '744_step3_code_changes' into...

Merge branch '744_step3_code_changes' into 922-use-precomputed-HRTF-average-LR-energies-and-IAC-in-all-renderers
parents c9d44c5c 8a5f643a
Loading
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
@@ -802,6 +802,18 @@ int main(
#ifdef NONBE_FIX_BINARY_BINAURAL_READING
        if ( ( error = create_SetOfHRTF_from_binary( *hSetOfHRTF, hrtfReader, arg.output_Fs ) ) != IVAS_ERR_OK )
        {
#ifdef FIX_OLD_BINARY_FORMAT
            cleanup_SetOfHRTF( hSetOfHRTF );
            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 = create_SetOfHRTF_from_binary( *hSetOfHRTF, hrtfReader, arg.output_Fs ) ) != IVAS_ERR_OK )
            {
                if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA )
                {
                    fprintf( stderr, "\nError in loading HRTF binary file %s \n\n", arg.hrtfFileName );
@@ -812,6 +824,18 @@ int main(
                    destroy_SetOfHRTF( hSetOfHRTF );
                }
            }
#else
            if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA )
            {
                fprintf( stderr, "\nError in loading HRTF binary file %s \n\n", arg.hrtfFileName );
                goto cleanup;
            }
            else
            {
                destroy_SetOfHRTF( hSetOfHRTF );
            }
#endif
        }
#else
        if ( ( error = create_SetOfHRTF_from_binary( hSetOfHRTF, hrtfReader, arg.output_Fs ) ) != IVAS_ERR_OK )
        {
+23 −0
Original line number Diff line number Diff line
@@ -1099,6 +1099,28 @@ int main(

            if ( ( error = create_SetOfHRTF_from_binary( *hSetOfHRTF, hrtfFileReader, args.sampleRate ) ) != IVAS_ERR_OK )
            {
#ifdef FIX_OLD_BINARY_FORMAT
                cleanup_SetOfHRTF( hSetOfHRTF );
                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: %s \n\n", args.customHrtfFilePath, ivas_error_to_string( error ) );
                    goto cleanup;
                }
                if ( ( error = create_SetOfHRTF_from_binary( *hSetOfHRTF, hrtfFileReader, args.sampleRate ) ) != IVAS_ERR_OK )
                {
                    if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA )
                    {
                        fprintf( stderr, "\nError in loading HRTF binary file %s:%s \n\n", args.customHrtfFilePath, ivas_error_to_string( error ) );
                        goto cleanup;
                    }
                    else
                    {
                        destroy_SetOfHRTF( hSetOfHRTF );
                    }
                }
#else
                if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA )
                {
                    fprintf( stderr, "\nError in loading HRTF binary file %s:%s \n\n", args.customHrtfFilePath, ivas_error_to_string( error ) );
@@ -1108,6 +1130,7 @@ int main(
                {
                    destroy_SetOfHRTF( hSetOfHRTF );
                }
#endif
            }

            if ( ( error = IVAS_REND_GetHrtfFastConvHandle( hIvasRend, &hHrtfFastConv ) ) != IVAS_ERR_OK )
+3 −0
Original line number Diff line number Diff line
@@ -1556,6 +1556,9 @@ typedef enum
#define MAX_SPLIT_MD_SUBFRAMES                  1
#define COMPLEX_MD_BAND_THRESH                  MAX_SPLIT_REND_MD_BANDS
#define COMPLEX_MD_BAND_THRESH_LOW              5
#ifdef SPLIT_REND_HF_TUNING
#define SPLIT_REND_RO_MD_BAND_THRESH            4
#endif

#define IVAS_SPLIT_REND_NUM_QUANT_STRATS        4
#define IVAS_SPLIT_REND_PRED_63QUANT_PNTS       63
+8 −0
Original line number Diff line number Diff line
@@ -150,6 +150,7 @@

/*#define FIX_I4_OL_PITCH*/                             /* fix open-loop pitch used for EVS core switching */
/*#define SPLIT_REND_WITH_HEAD_ROT  */                  /* Dlb,FhG: Split Rendering contributions 21 and 35 */
#define FIX_954_OTR_REF_VEC                             /* FhG: Fix forward vector direction for OTR REF VEC mode */

#define FIX_638_ENERGIE_IAC_ROM_TABLES                  /* Orange : Missing left/right and coherence late reverb tables in binary format*/
#define FIX_OLD_BINARY_FORMAT                           /* Orange: temporary to maintain bitexactness */
@@ -168,6 +169,13 @@
#define NONBE_FIX_856_TCX_LTP_SYNTH_FILTER                    /* FhG: issue 856: correct filtering length for tcx-ltp synth filtering*/
#define NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES             /* Philips: Use pre-computed HRTF average L/R energies and IAC in all renderers */
#define NONBE_FIX_944_FEC_OMASA_1SEP_OBJ_MASA                 /* Nokia: issue 944: fix FEC error in OMASA */
#define NONBE_FIX_949_MC_5MS_FRAMING                          /* Dlb: issue 949: fix for issue 949, distorted output in MC mode with 5ms framing*/

#ifdef SPLIT_REND_WITH_HEAD_ROT
#define SPLIT_REND_HF_TUNING                                  /* Dlb: issue 950: split rendering MD tuning change at high frequencies*/
#define SPLIT_REND_MC_FIX_LFE                                 /* Dlb: issue 950: split rendering LFE fix for 7.1 and 5.1 MC mode*/
#define SPLIT_EXT_REND_FIX_LIMITER_POS                        /* Dlb: issue 950: fixing limiter position in split rendering mode in external renderer*/
#endif

/* ##################### End NON-BE switches ########################### */

+10 −0
Original line number Diff line number Diff line
@@ -1539,6 +1539,9 @@ void ivas_binaural_add_LFE(
{
    int16_t render_lfe, idx_lfe;
    float gain;
#ifdef SPLIT_REND_MC_FIX_LFE
    float lfe_tc[L_FRAME48k];
#endif

    if ( st_ivas->hBinRenderer != NULL )
    {
@@ -1562,10 +1565,17 @@ void ivas_binaural_add_LFE(

        for ( idx_lfe = 0; idx_lfe < st_ivas->hIntSetup.num_lfe; idx_lfe++ )
        {
#ifdef SPLIT_REND_MC_FIX_LFE
            v_multc( input_f[st_ivas->hIntSetup.index_lfe[idx_lfe]], gain, lfe_tc, output_frame );
            /* copy LFE to left and right channels */
            v_add( output_f[0], lfe_tc, output_f[0], output_frame );
            v_add( output_f[1], lfe_tc, output_f[1], output_frame );
#else
            v_multc( input_f[st_ivas->hIntSetup.index_lfe[idx_lfe]], gain, input_f[st_ivas->hIntSetup.index_lfe[idx_lfe]], output_frame );
            /* copy LFE to left and right channels */
            v_add( output_f[0], input_f[st_ivas->hIntSetup.index_lfe[idx_lfe]], output_f[0], output_frame );
            v_add( output_f[1], input_f[st_ivas->hIntSetup.index_lfe[idx_lfe]], output_f[1], output_frame );
#endif
        }
    }

Loading