Commit 6ebdfb6f authored by emerit's avatar emerit
Browse files

Merge branch...

Merge branch '1070-usan-nullptr-with-offset-and-segfaults-in-7_1_4-to-binaural-and-binaural_room_reverb-decoding' into 'main'

[Non-BE] Resolve "USAN: nullptr-with-offset and Segfaults in 7_1_4 to BINAURAL and BINAURAL_ROOM_REVERB decoding with bitrate switching and head rotation"

See merge request !1524
parents 316bb0b0 9a7a8816
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -176,9 +176,9 @@
#define NONBE_FIX_ISM_XOVER_BR                          /* FhG: issue 1072: select OSBA coding method depending on number of object and bitrate */
#define NONBE_FIX_1028_1DB_TCX_LEVEL_DROP               /* VA: Harmonize the logic setting LP weighting factor between TCX encoder and TCX decoder */
#define NONBE_FIX_SBA_SIGNALING_BITS_B                  /* FhG: issue 1061: option B: signal sba order additionally in OSBA */
#define NONBE_FIX_1070_USAN_SEGFAULT_MC_TO_BIN_BTSW_HEADROT   /* fix 1070 USAN: nullptr-with-offset and Segfaults in 7_1_4 to BINAURAL and BINAURAL_ROOM_REVERB decoding with bitrate switching and head rotation*/ 
#define NONBE_FIX_MC_LFE_LPF                            /* Dlb: Adding the LFE LPF filter back for MC content. */


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

/* ################## End DEVELOPMENT switches ######################### */
+40 −0
Original line number Diff line number Diff line
@@ -1669,14 +1669,37 @@ ivas_error ivas_jbm_dec_flush_renderer(
        {
            if ( mc_mode_old == MC_MODE_MCT )
            {
#ifdef NONBE_FIX_1070_USAN_SEGFAULT_MC_TO_BIN_BTSW_HEADROT
                int16_t crendInPlaceRotation = FALSE;

                if ( st_ivas->transport_config != intern_config_old && ( intern_config_old == IVAS_AUDIO_CONFIG_FOA || intern_config_old == IVAS_AUDIO_CONFIG_HOA2 || intern_config_old == IVAS_AUDIO_CONFIG_HOA3 ) )
                {
                    if ( ( st_ivas->hTransSetup.nchan_out_woLFE + st_ivas->hTransSetup.num_lfe ) < ( hIntSetupOld->nchan_out_woLFE + hIntSetupOld->num_lfe ) )
                    {
                        crendInPlaceRotation = TRUE;
                        ivas_mc2sba( st_ivas->hTransSetup, hTcBuffer->tc, p_output, hTcBuffer->n_samples_granularity, hIntSetupOld->ambisonics_order, GAIN_LFE );
                    }
                }
#endif
                if ( renderer_type_old == RENDERER_BINAURAL_MIXER_CONV || renderer_type_old == RENDERER_BINAURAL_MIXER_CONV_ROOM )
                {
#ifdef NONBE_FIX_1070_USAN_SEGFAULT_MC_TO_BIN_BTSW_HEADROT
#if defined SPLIT_REND_WITH_HEAD_ROT
                    if ( ( error = ivas_rend_crendProcessSubframe( st_ivas->hCrendWrapper, intern_config_old, st_ivas->hOutSetup.output_config, st_ivas->hDecoderConfig, st_ivas->hCombinedOrientationData,
                                                                   hIntSetupOld, st_ivas->hEFAPdata, st_ivas->hTcBuffer, crendInPlaceRotation ? p_output : st_ivas->hTcBuffer->tc, p_output, hTcBuffer->n_samples_granularity, st_ivas->hDecoderConfig->output_Fs, 0 ) ) != IVAS_ERR_OK )
#else
                    if ( ( error = ivas_rend_crendProcessSubframe( st_ivas->hCrendWrapper, intern_config_old, st_ivas->hOutSetup.output_config, st_ivas->hDecoderConfig, st_ivas->hCombinedOrientationData,
                                                                   hIntSetupOld, st_ivas->hEFAPdata, st_ivas->hTcBuffer, crendInPlaceRotation ? p_output : st_ivas->hTcBuffer->tc, p_output, hTcBuffer->n_samples_granularity, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK )

#endif
#else
#if defined SPLIT_REND_WITH_HEAD_ROT
                    if ( ( error = ivas_rend_crendProcessSubframe( st_ivas->hCrendWrapper, intern_config_old, st_ivas->hOutSetup.output_config, st_ivas->hDecoderConfig, st_ivas->hCombinedOrientationData,
                                                                   hIntSetupOld, st_ivas->hEFAPdata, st_ivas->hTcBuffer, hTcBuffer->tc, p_output, hTcBuffer->n_samples_granularity, st_ivas->hDecoderConfig->output_Fs, 0 ) ) != IVAS_ERR_OK )
#else
                    if ( ( error = ivas_rend_crendProcessSubframe( st_ivas->hCrendWrapper, intern_config_old, st_ivas->hOutSetup.output_config, st_ivas->hDecoderConfig, st_ivas->hCombinedOrientationData,
                                                                   hIntSetupOld, st_ivas->hEFAPdata, st_ivas->hTcBuffer, hTcBuffer->tc, p_output, hTcBuffer->n_samples_granularity, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK )
#endif
#endif
                    {
                        return error;
@@ -2316,7 +2339,11 @@ ivas_error ivas_jbm_dec_tc_buffer_open(
    const int16_t n_samples_granularity     /* i  : granularity of the renderer/buffer  */
)
{
#ifdef NONBE_FIX_1070_USAN_SEGFAULT_MC_TO_BIN_BTSW_HEADROT
    int32_t nsamp_to_allocate;
#else
    int16_t nsamp_to_allocate;
#endif
    DECODER_TC_BUFFER_HANDLE hTcBuffer;
    int16_t nMaxSlotsPerSubframe;
    int16_t nchan_residual;
@@ -2395,7 +2422,11 @@ ivas_error ivas_jbm_dec_tc_buffer_open(
                {
                    return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for JBM TC Buffer\n" ) );
                }
#ifdef NONBE_FIX_1070_USAN_SEGFAULT_MC_TO_BIN_BTSW_HEADROT
                set_zero_l( hTcBuffer->tc_buffer, nsamp_to_allocate );
#else
                set_zero( hTcBuffer->tc_buffer, nsamp_to_allocate );
#endif

                offset = 0;
                for ( ch_idx = 0; ch_idx < hTcBuffer->nchan_buffer_full; ch_idx++ )
@@ -2441,7 +2472,12 @@ ivas_error ivas_jbm_dec_tc_buffer_reconfigure(
    const int16_t n_samples_granularity     /* i  : new granularity of the renderer/buffer  */
)
{
#ifdef NONBE_FIX_1070_USAN_SEGFAULT_MC_TO_BIN_BTSW_HEADROT
    int32_t nsamp_to_allocate, offset;
    int16_t n_samp_full, n_samp_residual, nchan_residual;
#else
    int16_t nsamp_to_allocate, n_samp_full, n_samp_residual, offset, nchan_residual;
#endif
    int16_t ch_idx;
    DECODER_TC_BUFFER_HANDLE hTcBuffer;

@@ -2528,7 +2564,11 @@ ivas_error ivas_jbm_dec_tc_buffer_reconfigure(
            {
                return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for JBM TC Buffer\n" ) );
            }
#ifdef NONBE_FIX_1070_USAN_SEGFAULT_MC_TO_BIN_BTSW_HEADROT
            set_zero_l( hTcBuffer->tc_buffer, nsamp_to_allocate );
#else
            set_zero( hTcBuffer->tc_buffer, nsamp_to_allocate );
#endif

            offset = 0;
            for ( ch_idx = 0; ch_idx < hTcBuffer->nchan_buffer_full; ch_idx++ )