Commit 95f60589 authored by Vladimir Malenovsky's avatar Vladimir Malenovsky
Browse files

Merge branch 'main' into ci/encoder-stats-changes

parents d6010191 4afa239d
Loading
Loading
Loading
Loading
Loading
+48 −1
Original line number Diff line number Diff line
@@ -168,8 +168,12 @@ typedef struct
    IVAS_BIN_RENDERER_TYPE binaural_renderer_sec;
    IVAS_BIN_RENDERER_TYPE binaural_renderer_sec_old;

#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM
    IVAS_AUDIO_CONFIG hrtf_set_audio_cfg;
#else
    IVAS_AUDIO_CONFIG intern_audio_config;
    int16_t room_reverb_flag;
#endif

} IVAS_DEC_HRTF_BINARY_WRAPPER;

@@ -182,7 +186,11 @@ static bool parseCmdlIVAS_dec( int16_t argc, char **argv, DecArguments *arg );
static void usage_dec( void );
static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtf, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, ISAR_SPLIT_REND_BITS_DATA *splitRendBits, IVAS_DEC_HANDLE hIvasDec, int16_t *pcmBuf );
static ivas_error decodeVoIP( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtf, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, IVAS_DEC_HANDLE hIvasDec );
#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM
static ivas_error load_hrtf_from_file( IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtfBinary, IVAS_DEC_HANDLE hIvasDec, const IVAS_AUDIO_CONFIG OutputConfig, const int32_t output_Fs );
#else
static ivas_error IVAS_DEC_LoadHrtfFromFile( IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtfBinary, IVAS_DEC_HANDLE hIvasDec, const int32_t output_Fs );
#endif
#ifdef DEBUGGING
static ivas_error printBitstreamInfoVoip( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HANDLE hIvasDec );
static int16_t app_own_random( int16_t *seed );
@@ -712,7 +720,7 @@ int main(
    }

    /*------------------------------------------------------------------------------------------*
     * Load HRTF binary file data
     * Initialize HRTF binary file data
     *------------------------------------------------------------------------------------------*/

    if ( arg.hrtfReaderEnabled )
@@ -721,8 +729,12 @@ int main(
        hHrtfBinary.hrtfFileName = arg.hrtfFileName;
        hHrtfBinary.binaural_renderer = IVAS_BIN_RENDERER_TYPE_NONE;
        hHrtfBinary.binaural_renderer_sec = IVAS_BIN_RENDERER_TYPE_NONE;
#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM
        hHrtfBinary.hrtf_set_audio_cfg = IVAS_AUDIO_CONFIG_INVALID;
#else
        hHrtfBinary.room_reverb_flag = 0;
        hHrtfBinary.intern_audio_config = IVAS_AUDIO_CONFIG_INVALID;
#endif
    }

    /*------------------------------------------------------------------------------------------*
@@ -2353,7 +2365,11 @@ static ivas_error decodeG192(
                /* Read main parameters from the bitstream to set-up the decoder */
                hHrtfBinary->binaural_renderer_old = hHrtfBinary->binaural_renderer;
                hHrtfBinary->binaural_renderer_sec_old = hHrtfBinary->binaural_renderer_sec;
#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM
                if ( ( error = IVAS_DEC_ReadFormat( hIvasDec, &hHrtfBinary->binaural_renderer, &hHrtfBinary->binaural_renderer_sec, &hHrtfBinary->hrtf_set_audio_cfg ) ) != IVAS_ERR_OK )
#else
                if ( ( error = IVAS_DEC_ReadFormat( hIvasDec, &hHrtfBinary->binaural_renderer, &hHrtfBinary->binaural_renderer_sec, &hHrtfBinary->room_reverb_flag, &hHrtfBinary->intern_audio_config ) ) != IVAS_ERR_OK )
#endif
                {
                    return error;
                }
@@ -2364,7 +2380,11 @@ static ivas_error decodeG192(
                /* Load HRTF binary file data */
                if ( arg.hrtfReaderEnabled )
                {
#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM
                    if ( ( error = load_hrtf_from_file( hHrtfBinary, hIvasDec, arg.outputConfig, arg.output_Fs ) ) != IVAS_ERR_OK )
#else
                    if ( ( error = IVAS_DEC_LoadHrtfFromFile( hHrtfBinary, hIvasDec, arg.output_Fs ) ) != IVAS_ERR_OK )
#endif
                    {
                        fprintf( stderr, "\nIVAS_DEC_LoadHrtfFromFile failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
                        goto cleanup;
@@ -3260,7 +3280,11 @@ static ivas_error decodeVoIP(
                /* Read main parameters from the bitstream to set-up the decoder */
                hHrtf->binaural_renderer_old = hHrtf->binaural_renderer;
                hHrtf->binaural_renderer_sec_old = hHrtf->binaural_renderer_sec;
#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM
                if ( ( error = IVAS_DEC_ReadFormat( hIvasDec, &hHrtf->binaural_renderer, &hHrtf->binaural_renderer_sec, &hHrtf->hrtf_set_audio_cfg ) ) != IVAS_ERR_OK )
#else
                if ( ( error = IVAS_DEC_ReadFormat( hIvasDec, &hHrtf->binaural_renderer, &hHrtf->binaural_renderer_sec, &hHrtf->room_reverb_flag, &hHrtf->intern_audio_config ) ) != IVAS_ERR_OK )
#endif
                {
                    return error;
                }
@@ -3271,7 +3295,11 @@ static ivas_error decodeVoIP(
                /* Load HRTF binary file data */
                if ( arg.hrtfReaderEnabled )
                {
#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM
                    if ( ( error = load_hrtf_from_file( hHrtf, hIvasDec, arg.outputConfig, arg.output_Fs ) ) != IVAS_ERR_OK )
#else
                    if ( ( error = IVAS_DEC_LoadHrtfFromFile( hHrtf, hIvasDec, arg.output_Fs ) ) != IVAS_ERR_OK )
#endif
                    {
                        fprintf( stderr, "\nIVAS_DEC_LoadHrtfFromFile failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
                        goto cleanup;
@@ -3662,6 +3690,20 @@ static IVAS_DEC_FORCED_REND_MODE parseForcedRendModeDec(
#endif


#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM
/*---------------------------------------------------------------------*
 * load_hrtf_from_file()
 *
 * Load HRTF coefficients from external binary file
 *---------------------------------------------------------------------*/

static ivas_error load_hrtf_from_file(
    IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtfBinary, /* i/o: HRTF binary wrapper handle   */
    IVAS_DEC_HANDLE hIvasDec,                  /* i/o: IVAS decoder handle          */
    const IVAS_AUDIO_CONFIG OutputConfig,      /* i  : output audio configuration   */
    const int32_t output_Fs                    /* i  : output sampling rate         */
)
#else
/*---------------------------------------------------------------------*
 * IVAS_DEC_LoadHrtfFromFile()
 *
@@ -3672,6 +3714,7 @@ static ivas_error IVAS_DEC_LoadHrtfFromFile(
    IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtfBinary,
    IVAS_DEC_HANDLE hIvasDec,
    const int32_t output_Fs )
#endif
{
    ivas_error error;
    IVAS_BIN_RENDERER_TYPE binaural_renderer, binaural_renderer_sec;
@@ -3774,7 +3817,11 @@ static ivas_error IVAS_DEC_LoadHrtfFromFile(
                return error;
            }

#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM
            if ( ( error = load_fastconv_HRTF_from_binary( *hHrtfFastConv, OutputConfig, hHrtfBinary->hrtf_set_audio_cfg, hHrtfBinary->hrtfReader ) ) != IVAS_ERR_OK )
#else
            if ( ( error = load_fastconv_HRTF_from_binary( *hHrtfFastConv, hHrtfBinary->room_reverb_flag, hHrtfBinary->intern_audio_config, hHrtfBinary->hrtfReader ) ) != IVAS_ERR_OK )
#endif
            {
                if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA )
                {
+4 −0
Original line number Diff line number Diff line
@@ -945,7 +945,11 @@ int main(
                goto cleanup;
            }

#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM
            if ( ( error = load_fastconv_HRTF_from_binary( *hHrtfFastConv, args.outConfig.audioConfig, args.inConfig.ambisonicsBuses->audioConfig, hrtfFileReader ) ) != IVAS_ERR_OK )
#else
            if ( ( error = load_fastconv_HRTF_from_binary( *hHrtfFastConv, 0, IVAS_AUDIO_CONFIG_INVALID, hrtfFileReader ) ) != IVAS_ERR_OK )
#endif
            {
                if ( error != IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA )
                {
+2 −0
Original line number Diff line number Diff line
@@ -1495,6 +1495,7 @@ typedef enum

#define BINAURAL_COHERENCE_DIFFERENCE_BINS      9                           /* Number of bins for direction-dependent diffuse-field binaural coherence */

#ifndef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM
typedef enum 
{
    BINAURAL_INPUT_AUDIO_CONFIG_INVALID,
@@ -1506,6 +1507,7 @@ typedef enum

} BINAURAL_INPUT_AUDIO_CONFIG;

#endif
#define HEADROT_ORDER                           3
#define HEADROT_SHMAT_DIM                       ( ( HEADROT_ORDER + 1 ) * ( HEADROT_ORDER + 1 ) )
#define HEADROT_SHMAT_DIM2                      ( HEADROT_SHMAT_DIM * HEADROT_SHMAT_DIM )
+5 −1
Original line number Diff line number Diff line
@@ -5136,9 +5136,13 @@ void ivas_init_binaural_hrtf(

ivas_error ivas_allocate_binaural_hrtf(
    HRTFS_FASTCONV *HrtfFastConv,                               /* i/o: FASTCONV HRTF structure                         */
#ifdef FIX_1226_FASTCONV_HRTF_LOADING_OPTIM
    const int16_t n_channels,                                   /* i : number of input channels                         */
#else
    const AUDIO_CONFIG input_config,                            /* i  : input audio configuration                       */
    const BINAURAL_INPUT_AUDIO_CONFIG bin_input_config,         /* i  : binaural input audio config                     */
    const RENDERER_TYPE renderer_type,                          /* i  : renderer type                                   */
#endif
    const int16_t allocate_init_flag                            /* i  : Memory allocation flag                          */
);

+3 −0
Original line number Diff line number Diff line
@@ -160,6 +160,7 @@

/*#define FIX_I4_OL_PITCH*/                             /* fix open-loop pitch used for EVS core switching */
#define TMP_FIX_1119_SPLIT_RENDERING_VOIP               /* FhG: Add error check for unsupported config: split rendering with VoIP mode */
#define FIX_1226_FASTCONV_HRTF_LOADING_OPTIM            /* VA: issue 1226: for FastConv binaural renderer in decoder, load only HTRT coefficient set that is needed */


/* #################### End BE switches ################################## */
@@ -170,7 +171,9 @@
/* all switches in this category should start with "NONBE_" */

#define NONBE_FIX_1176_OSBA_REVERB_JBM_ASAN_ERROR       /* Ericsson: Issue 1176, fix in TDREND_firfilt for subframes shorter than the filter length */
#define NONBE_FIX_1196_TD_HEADTRACKING_INTERPOLATION    /* Ericsson: Issue 1196, Always apply filter interpolation for each subframe */
#define NONBE_1220_OMASA_JBM_BRATE_SW_FLUSH             /* VA: issue 1220: fix bug in renderer flush in OMASA 1ISM JBM bitrate switching */
#define NONBE_1229_FIX_ISM1_DPID                        /* Eri: issue 1229: fix bug causing ISM 1 to use default -dpid instead of the specified one */

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

Loading