Commit 4aafdeac authored by emerit's avatar emerit
Browse files

Merge branch 'main' into...

Merge branch 'main' into 462-use-of-uninitialized-memory-in-external-hrtf-deallocation-in-decoder-together-with-br-switching
parents b20c4d1e a771c04e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1767,7 +1767,6 @@ static ivas_error decodeG192(
            }
        }


        /* Write current frame */
        if ( decodedGoodFrame )
        {
@@ -1853,6 +1852,7 @@ static ivas_error decodeG192(
     *------------------------------------------------------------------------------------------*/

    memset( pcmBuf, 0, delayNumSamples_orig[0] * nOutChannels * sizeof( int16_t ) );

    if ( ( error = AudioFileWriter_write( afWriter, pcmBuf, delayNumSamples_orig[0] * nOutChannels ) ) != IVAS_ERR_OK )
    {
        fprintf( stderr, "\nError writing output file: %s\n", ivas_error_to_string( error ) );
+14 −1
Original line number Diff line number Diff line
@@ -69,10 +69,17 @@ int32_t get_delay(
        {
            delay = IVAS_ENC_DELAY_NS;

#ifdef FIX_356_ISM_METADATA_SYNC
            if ( ivas_format == ISM_FORMAT || ivas_format == MASA_FORMAT )
            {
                delay = 0; /* All delay is compensated in the decoder with MASA/ISM */
            }
#else
            if ( ivas_format == MASA_FORMAT )
            {
                delay = 0; /* All delay is compensated in the decoder with MASA */
            }
#endif
        }

        if ( ivas_format == SBA_FORMAT )
@@ -104,11 +111,17 @@ int32_t get_delay(
                delay += IVAS_FB_DEC_DELAY_NS;
            }


#ifdef FIX_356_ISM_METADATA_SYNC
            if ( ivas_format == ISM_FORMAT || ivas_format == MASA_FORMAT )
            {
                delay += IVAS_ENC_DELAY_NS; /* Compensate also the encoder delay in the decoder with ISM/MASA */
            }
#else
            if ( ivas_format == MASA_FORMAT )
            {
                delay += IVAS_ENC_DELAY_NS; /* Compensate also the encoder delay in the decoder with MASA */
            }
#endif
        }
    }

+9 −6
Original line number Diff line number Diff line
@@ -58,12 +58,15 @@ typedef struct
{
    int16_t ism_metadata_flag;      /* flag whether metadata are coded in particular frame of particular object */
    int16_t last_ism_metadata_flag; /* last frame ism_metadata_flag */
    int16_t non_diegetic_flag;      /* Non-diegetic (non-headtracked) object flag */

    float azimuth;   /* azimuth value read from the input metadata file */
    float elevation;                /* azimuth value read from the input metadata file */
    float radius;
    float yaw;                            /* azimuth orientation value read from the input metadata file */
    float pitch;                          /* elevation orientation value read from the input metadata file */
    float elevation; /* elevation value read from the input metadata file */
    float radius;    /* radius value read from the input metadata file */
    float yaw;       /* yaw value read from the input metadata file */
    float pitch;     /* pitch value read from the input metadata file */

    int16_t non_diegetic_flag; /* Non-diegetic (non-headtracked) object flag */

    ISM_METADATA_ANGLE position_angle;    /* Angle structs for azimuth and elevation */
    ISM_METADATA_ANGLE orientation_angle; /* Angle structs for yaw and pitch */
    int16_t last_radius_idx;              /* last frame index of coded radius */
+36 −0
Original line number Diff line number Diff line
@@ -148,8 +148,44 @@

/*#define FIX_XXX_JBM_FIFO_BUFFER  */                   /* FhG: prevent wraparound of a length identifier in cause of large frames and many channels*/
#define HR_METADATA                                     /* Nok: Contribution #45: encode directional MASA metadata with more bits at 384k and 512k */

#define SBA_TD_RESIDUAL                                 /* Dlb : Issue 426: SBA encoder complexity optimization */

#define FIX_357_DTX_32K                                 /* Eri: issue 357 - Forced LP-CNG at 32k */
#define FIX_435_ISM_MERGE_BUG                           /* Eri: Merge bug fix for ISM NULL metadata and tcx_only cases */
#define FIX_355_REFACTOR_PARAMBIN_TO_5MS                /* Nokia: Fixes issue 355 by refactoring parametric binauralizer code to 5 ms mode */
#define FIX_411_EVS_BE_TESTS_ON_WINDOWS_FAILING         /* Eri: Fix incorrect use of stack variable used for channel aware config file */
#define COMBINED_FORMAT_SIGNALING                       /* VA: Introduce a signaling bit for combined format coding */

#define FIX_356_ISM_METADATA_SYNC                       /* Eri: issue 356: Metadata out-of-synch for -no_delay_comp */   

#define FIX_446_STEREO_DMX_CRASH                        /* FhG: fix discrepancy with EVS code that could cause crashes in rare cases */

#define FIX_386_CORECODER_RECONFIG_2                    /* VA: Issue 386: Resolve remaining ToDo comments in CoreCoder reconfig. */

#define FIX_439_OTR_PARAMS                              /* Philips: Issue 439: orientation tracking parameter aspects. */

#define FIX_440_PARAM_ISM_DIR_NOISE                     /* FhG: Issue 440: Fix directional background noise becoming diffuse in ParamISM */

#define LBR_SBA_DIRAC_FIX                               /* DLB: Bug fix for DirAC at low bitrates */

#define FIX_445_SNS_BUGFIXES                            /* FhG: bug fix for spectral tilt in SNS computation + necessary update of codebooks and converison to fixedpoint-compatible tables */
#define FIX_447_PARAMBIN_MASA_REGU_FAC                  /* Nokia: Issue 447: Fix issue by adjusting regularization factor minimum value. */
#define FIX_441_SBA_PARAMBIN_GAINS                      /* Nokia: Fix issue 441 by changing gains in SBA path of parametric binauralizer */

#define MC_PARAMUPMIX_MODE                              /* Dlb: Contribution 39: Multichannel Parametric Upmix */
#define FIX_469_BRSWITCH_PUPMIX                         /* Dlb: Fix issue 469 for Param Upmix bitrate switching */

#define HODIRAC                                         /* FhG: Contribution 32: Sector-based HO-DirAC method for SBA at high bitrates */
#define DIRAC_ALLOC_HARM                                /* VA: harmonize DirAC parameters allocation/deallocation */


#define COMPLEXITY_LEVEL_INDICATION

#define FIX_439_OTR_PARAMS                              /* Philips: Issue 439: orientation tracking parameter aspects. */

#define ARITH_HUFF_CODER_CHANGES                        /* DLB: Optimization of metadata memory for Huffman and arithmetic coders */

#define FIX_463_TD_RENDERER_DIRECTIVITY_RESET           /* Eri: Remove unintentional reset of directivity pattern */
#define FIX_642											/* FhG: Fix for issue 642, buggy DoA-array access in DirAC head rotation*/
#define FIX_443_FD_CNG_INIT                             /* FhG: correct bitrate value for FD-CNG init */
+22 −1
Original line number Diff line number Diff line
@@ -75,12 +75,22 @@ ivas_error ivas_td_binaural_renderer(
    const int16_t output_frame /* i  : output frame length               */
)
{
#ifdef FIX_356_ISM_METADATA_SYNC
    int16_t ism_md_subframe_update = 2;
    return ivas_td_binaural_renderer_unwrap(
        st_ivas->hReverb,
        st_ivas->transport_config,
        st_ivas->hBinRendererTd, st_ivas->nchan_transport, LFE_CHANNEL, st_ivas->ivas_format,
        st_ivas->hIsmMetaData, st_ivas->hDecoderConfig->Opt_Headrotation, ( st_ivas->hHeadTrackData != NULL ) ? st_ivas->hHeadTrackData->Quaternions : NULL,
        ( st_ivas->hHeadTrackData != NULL ) ? st_ivas->hHeadTrackData->Pos : NULL, ism_md_subframe_update, output, output_frame );
#else
    return ivas_td_binaural_renderer_unwrap(
        st_ivas->hReverb,
        st_ivas->transport_config,
        st_ivas->hBinRendererTd, st_ivas->nchan_transport, LFE_CHANNEL, st_ivas->ivas_format,
        st_ivas->hIsmMetaData, st_ivas->hDecoderConfig->Opt_Headrotation, ( st_ivas->hHeadTrackData != NULL ) ? st_ivas->hHeadTrackData->Quaternions : NULL,
        ( st_ivas->hHeadTrackData != NULL ) ? st_ivas->hHeadTrackData->Pos : NULL, output, output_frame );
#endif
}

#ifdef JBM_TSM_ON_TCS
@@ -102,6 +112,9 @@ void ObjRenderIVASSubframe(
    float *output_f_local[BINAURAL_CHANNELS];
    float *tc_local[MAX_TRANSPORT_CHANNELS];
    int16_t ch, slot_size, slots_to_render, output_frame;
#ifdef FIX_356_ISM_METADATA_SYNC
    int16_t ism_md_subframe_update_jbm = 0; /* Number of subframes to delay metadata to sync with audio */
#endif
    for ( ch = 0; ch < BINAURAL_CHANNELS; ch++ )
    {
        p_reverb_signal[ch] = reverb_signal[ch];
@@ -129,8 +142,13 @@ void ObjRenderIVASSubframe(
    for ( subframe_idx = first_sf; subframe_idx < last_sf; subframe_idx++ )
    {
        output_frame = st_ivas->hTcBuffer->subframe_nbslots[subframe_idx] * st_ivas->hTcBuffer->n_samples_granularity;

        /* Update object position(s) */
#ifdef FIX_356_ISM_METADATA_SYNC
        TDREND_Update_object_positions( st_ivas->hBinRendererTd, st_ivas->nchan_transport, st_ivas->ivas_format, st_ivas->hIsmMetaData );
#else
        TDREND_Update_object_positions( st_ivas->hBinRendererTd, st_ivas->nchan_transport, LFE_CHANNEL, st_ivas->ivas_format, st_ivas->hIsmMetaData, tc_local );
#endif

        /* Update the listener's location/orientation */
        TDREND_Update_listener_orientation( st_ivas->hBinRendererTd,
@@ -144,8 +162,11 @@ void ObjRenderIVASSubframe(
        }

        /* Render subframe */
#ifdef FIX_356_ISM_METADATA_SYNC
        TDREND_GetMix( st_ivas->hBinRendererTd, output_f_local, output_frame, 0, ism_md_subframe_update_jbm );
#else
        TDREND_GetMix( st_ivas->hBinRendererTd, output_f_local, output_frame, 0 );

#endif
        if ( st_ivas->hRenderConfig != NULL ) /* Renderer Configuration not enabled in TD standalone renderer */
        {
            if ( st_ivas->hRenderConfig->roomAcoustics.late_reverb_on )
Loading