Commit 6764d383 authored by Jan Kiene's avatar Jan Kiene
Browse files

Merge branch 'main' into 1397-apple-clang-16-release-vs-debug-differences-in-stereo-v2-second-part

parents 9f89c8fe ff68f8cc
Loading
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -1488,6 +1488,8 @@ test-long-self-test:
  stage: compare
  resource_group: ivas-long-self-test-resource
  timeout: "50 minutes"
  tags:
    - ivas-linux-fast
  rules:
    - if: $CI_PIPELINE_SOURCE == 'web' && $MANUAL_PIPELINE_TYPE == 'test-long-self-test'
  allow_failure:
@@ -2234,7 +2236,9 @@ sanitizer-test-osba-planar-hoa3-ism4:
    expire_in: 1 week

coverage-merge:
  extends: .rules-main-scheduled
  extends: 
    - .rules-main-scheduled
    - .test-job-linux-needs-testv-dir
  tags:
    - ivas-linux-fast
  stage: test
+11 −0
Original line number Diff line number Diff line
@@ -33,6 +33,9 @@
#include "lib_rend.h"
#include <assert.h>
#include <math.h>
#ifdef RENDERER_MD_SYNC_DELAY_TO_INTEGER
#include <stdint.h>
#endif
#include <string.h>
#include "audio_file_reader.h"
#include "audio_file_writer.h"
@@ -189,7 +192,11 @@ typedef struct
    float lfeConfigElevation;
    bool lfeCustomRoutingEnabled;
    char inLfePanningMatrixFile[RENDERER_MAX_CLI_ARG_LENGTH];
#ifdef RENDERER_MD_SYNC_DELAY_TO_INTEGER
    int16_t syncMdDelay;
#else
    float syncMdDelay;
#endif
    IVAS_RENDER_FRAMESIZE render_framesize;
    uint16_t directivityPatternId[RENDERER_MAX_ISM_INPUTS];
    AcousticEnvironmentSequence aeSequence;
@@ -2844,7 +2851,11 @@ static void parseOption(
        case CmdLnOptionId_syncMdDelay:
            assert( numOptionValues == 1 );
            /* Metadata Delay to sync with audio delay in ms */
#ifdef RENDERER_MD_SYNC_DELAY_TO_INTEGER
            args->syncMdDelay = (int16_t) strtol( optionValues[0], NULL, 10 );
#else
            args->syncMdDelay = strtof( optionValues[0], NULL );
#endif
            break;
        default:
            assert( 0 && "This should be unreachable - all command line options should be explicitly handled." );
+3 −0
Original line number Diff line number Diff line
@@ -169,6 +169,7 @@
#define FIX_1119_SPLIT_RENDERING_VOIP                   /* FhG: Add split rendering support to decoder in VoIP mode */
#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) */


/* #################### End BE switches ################################## */
@@ -188,6 +189,8 @@
#define NONBE_FIX_NONBE_BETWEEN_OPTIMIZATION_LEVELS    /* FhG: fix non-BE in DFT stereo encoder between optimization levels */
#define NONBE_FIX_NONBE_BETWEEN_OPTIMIZATION_LEVELS_2  /* FhG: fix even more non-BEnesses */

/*#define NONBE_1324_TC_BUFFER_MEMOERY_KEEP*/               /* VA: issue 1324: do not reset TSM memory in JBM bitrate switching */

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

/* ################## End DEVELOPMENT switches ######################### */
+12 −0
Original line number Diff line number Diff line
@@ -2284,13 +2284,16 @@ ivas_error ivas_jbm_dec_tc_buffer_reconfigure(
    const int16_t n_samples_granularity     /* i  : new granularity of the renderer/buffer  */
)
{
#ifdef NONBE_1324_TC_BUFFER_MEMOERY_KEEP
    int16_t ch_idx, num_tc_buffer_mem, n_samples_still_available;
    float tc_buffer_mem[MAX_INTERN_CHANNELS][L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES - 1];
#endif
    ivas_error error;
    DECODER_TC_BUFFER_HANDLE hTcBuffer;

    hTcBuffer = st_ivas->hTcBuffer;

#ifdef NONBE_1324_TC_BUFFER_MEMOERY_KEEP
    num_tc_buffer_mem = 0;
    n_samples_still_available = 0;

@@ -2309,6 +2312,7 @@ ivas_error ivas_jbm_dec_tc_buffer_reconfigure(
        }
    }

#endif
    /* if granularity changes, adapt subframe_nb_slots */
    if ( n_samples_granularity != hTcBuffer->n_samples_granularity )
    {
@@ -2348,6 +2352,12 @@ ivas_error ivas_jbm_dec_tc_buffer_reconfigure(
    hTcBuffer->nchan_buffer_full = nchan_full;
    hTcBuffer->n_samples_granularity = n_samples_granularity;

#ifndef NONBE_1324_TC_BUFFER_MEMOERY_KEEP
#ifdef DEBUGGING
    /* what is remaining from last frames needs always be smaller than n_samples_granularity */
    assert( ( hTcBuffer->n_samples_buffered - hTcBuffer->n_samples_rendered ) < n_samples_granularity );
#endif
#endif
    /* reallocate TC audio buffers */

    ivas_jbm_dec_tc_audio_deallocate( hTcBuffer );
@@ -2357,12 +2367,14 @@ ivas_error ivas_jbm_dec_tc_buffer_reconfigure(
        return error;
    }

#ifdef NONBE_1324_TC_BUFFER_MEMOERY_KEEP
    /* propagate samples of the TC buffer from the previous frame */
    for ( ch_idx = 0; ch_idx < num_tc_buffer_mem; ch_idx++ )
    {
        mvr2r( tc_buffer_mem[ch_idx], hTcBuffer->tc_buffer_old[ch_idx], n_samples_still_available );
    }

#endif
    return IVAS_ERR_OK;
}

+29 −1
Original line number Diff line number Diff line
@@ -44,6 +44,9 @@
#include <math.h>
#include <stdbool.h>
#include "wmc_auto.h"
#ifdef RENDERER_MD_SYNC_DELAY_TO_INTEGER
#include <stdint.h>
#endif


/*-------------------------------------------------------------------*
@@ -123,7 +126,11 @@ typedef struct
    OMASA_ANA_HANDLE hOMasa;
    uint16_t total_num_objects;
    int16_t object_id;
#ifdef RENDERER_MD_SYNC_DELAY_TO_INTEGER
    int16_t ism_metadata_delay_ms;
#else
    float ism_metadata_delay_ms;
#endif
} input_ism;

typedef struct
@@ -1517,7 +1524,11 @@ static ivas_error alignInputDelay(
            if ( getAudioConfigType( inputBase->inConfig ) == IVAS_REND_AUDIO_CONFIG_TYPE_OBJECT_BASED )
            {
                inputIsm = (input_ism *) inputBase;
#ifdef RENDERER_MD_SYNC_DELAY_TO_INTEGER
                inputIsm->ism_metadata_delay_ms = (int16_t) roundf( inputIsm->ism_metadata_delay_ms + maxGlobalDelayNs / 1e6f );
#else
                inputIsm->ism_metadata_delay_ms = maxGlobalDelayNs / 1e6f;
#endif
            }
        }
    }
@@ -5485,7 +5496,12 @@ static ivas_error renderIsmToBinaural(

    push_wmops( "renderIsmToBinaural" );
    /* Metadata Delay to sync with audio delay converted from ms to 5ms (1000/50/4) subframe index */
#ifdef RENDERER_MD_SYNC_DELAY_TO_INTEGER
    ism_md_subframe_update_ext = (int16_t) roundf( ismInput->ism_metadata_delay_ms / (float) BINAURAL_RENDERING_FRAME_SIZE_MS );
#else
    ism_md_subframe_update_ext = (int16_t) roundf( ismInput->ism_metadata_delay_ms / ( 1000.f / FRAMES_PER_SEC / MAX_PARAM_SPATIAL_SUBFRAMES ) );
#endif

    copyBufferTo2dArray( ismInput->base.inputBuffer, tmpTDRendBuffer );

    if ( ( error = ivas_td_binaural_renderer_ext( &ismInput->tdRendWrapper, ismInput->base.inConfig, NULL, ismInput->base.ctx.pCombinedOrientationData, &ismInput->currentPos, ismInput->hReverb, ism_md_subframe_update_ext,
@@ -5689,7 +5705,11 @@ static ivas_error renderIsmToBinauralReverb(
    push_wmops( "renderIsmToBinauralRoom" );

    /* Metadata Delay to sync with audio delay converted from ms to 5ms (1000/50/4) subframe index */
#ifdef RENDERER_MD_SYNC_DELAY_TO_INTEGER
    ism_md_subframe_update_ext = (int16_t) roundf( ismInput->ism_metadata_delay_ms / (float) BINAURAL_RENDERING_FRAME_SIZE_MS );
#else
    ism_md_subframe_update_ext = (int16_t) roundf( ismInput->ism_metadata_delay_ms / ( 1000.f / FRAMES_PER_SEC / MAX_PARAM_SPATIAL_SUBFRAMES ) );
#endif

    copyBufferTo2dArray( ismInput->base.inputBuffer, tmpRendBuffer );

@@ -5869,7 +5889,11 @@ static ivas_error renderIsmToSplitBinaural(
    pMultiBinPoseData = &pSplitRendWrapper->multiBinPoseData;

    /* Metadata Delay to sync with audio delay converted from ms to 5ms (1000/50/4) subframe index */
#ifdef RENDERER_MD_SYNC_DELAY_TO_INTEGER
    ism_md_subframe_update_ext = (int16_t) roundf( ismInput->ism_metadata_delay_ms / (float) BINAURAL_RENDERING_FRAME_SIZE_MS );
#else
    ism_md_subframe_update_ext = (int16_t) roundf( ismInput->ism_metadata_delay_ms / ( 1000.f / FRAMES_PER_SEC / MAX_PARAM_SPATIAL_SUBFRAMES ) );
#endif

    pCombinedOrientationData = *ismInput->base.ctx.pCombinedOrientationData;

@@ -7685,7 +7709,11 @@ ivas_error IVAS_REND_SetTotalNumberOfObjects(

ivas_error IVAS_REND_SetIsmMetadataDelay(
    IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle    */
#ifdef RENDERER_MD_SYNC_DELAY_TO_INTEGER
    const int16_t sync_md_delay /* i  : ISM Metadata Delay in ms to sync with audio delay   */
#else
    const float sync_md_delay /* i  : ISM Metadata Delay in ms to sync with audio delay   */
#endif
)
{
    int16_t i;
Loading