Commit 6dc79421 authored by vaclav's avatar vaclav
Browse files

- Merge remote-tracking branch 'remotes/origin/ivas-float-update' into 1899-ref-PortFlpMr1645

parents d598a348 a644681f
Loading
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -414,6 +414,7 @@ int main(
        }
    }

#ifndef FIX_1158_FASTCONV_REVERB_HRTF
    /*------------------------------------------------------------------------------------------*
     * Open renderer configuration reader file
     *------------------------------------------------------------------------------------------*/
@@ -438,6 +439,7 @@ int main(
            goto cleanup;
        }
    }
#endif

    /*------------------------------------------------------------------------------------------*
     * Configure the decoder
@@ -640,6 +642,14 @@ int main(
            goto cleanup;
        }

#ifdef FIX_1158_FASTCONV_REVERB_HRTF
        if ( ( error = RenderConfigReader_open( arg.renderConfigFilename, &renderConfigReader ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nError: Can't open Renderer configuration file %s \n\n", arg.renderConfigFilename );
            goto cleanup;
        }
#endif

        if ( RenderConfigReader_read( renderConfigReader, arg.renderConfigFilename, &renderConfig ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "Failed to read renderer configuration from file %s\n\n", arg.renderConfigFilename );
@@ -3550,14 +3560,10 @@ static ivas_error decodeVoIP(
        }
        vec_pos_update = ( vec_pos_update + 1 ) % vec_pos_len;
        frame++;
#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE
        if ( vec_pos_update == 0 )
        {
            systemTime_ms += vec_pos_len * systemTimeInc_ms;
        }
#else
        systemTime_ms += systemTimeInc_ms;
#endif

#ifdef WMOPS
        update_mem();
@@ -3566,7 +3572,6 @@ static ivas_error decodeVoIP(
    }


#ifdef NONBE_FIX_864_JBM_RENDER_FRAMESIZE
    int16_t nSamplesFlushed = 0;

    /* decode and get samples */
@@ -3646,7 +3651,6 @@ static ivas_error decodeVoIP(
            }
        }
    }
#endif


    /*------------------------------------------------------------------------------------------*
+7 −26
Original line number Diff line number Diff line
@@ -147,30 +147,8 @@

/* ################### Start FIXES switches ########################### */

#define NON_BE_FIX_807_MASA_DTX_BRSW                     /* Nokia: adds fix to check existence of DTX encoder for secondary channel in TD mode */
#define NON_BE_FIX_BASOP_819_THRESHOLD_MASA2TOTAL        /* Nokia: add fix for precision limitation in comparison with masa2total energy ratio threshold */
#define FIX_828_PORT_1152_FROM_FLT_REPO                  /* FhG: fix for issue 828 - fix uninitialized value used in BASOP */
#define NONE_BE_FIX_816_LFE_PLC_FLOAT                   /* DLB: issue 816: reduce required precision to float for LFE-PLC*/
#define FIX_835_PARAMMC_BUFFER_VALUES                   /* FhG: issue 835: wide range of buffer values for cx in ParamMC */
#define NONBE_FIX_943_PORT_1208_DFT_STEREO_PLC_BURST    /* Ericsson: BASOP Issue 943, Float Issue 1208, fix for overflow of sample offset counter for burst error in DFT Stereo PLC. */
#define FIX_903_ZERO_OUT_IMDCT_BUFFERS_FOR_MCT_IGNORE   /* FhG: zero out all relevant imdct buffers in MCT decoding of channels with mct_chan_mode == MCT_CHAN_MODE_IGNORE */
#define FIX_853_DECODE_MASA_ISM_AZIMUTH_PREC_FP        /* Nokia: Fixes ivas_decode_masaism_metadata decision logic change due to precision difference; this is the fix in floating point */
#define NONBE_FIX_1205_TD_STEREO_MOD_CT                 /* VA: fix mismatch of coder_type (mod_ct) btw. TD stereo encoder and decoder */
#define NONBE_FIX_1213_SBA_DET_MAT_INV_3BY3             /*Dolby: issue 1213: fix for inverse of det < 0*/
#define NONBE_FIX_1204_MDCT_STEREO_NOISE_EST_SCALING    /* FhG: fixes for decoder-side noise level estimation in MDCT-Stereo to prevent noise bursts in stereo switching */
#define NONBE_1233_HQ_CLASSIFIER_DIV_BY_ZERO            /* Eri: issue 1233: Address possible division by zero in hf_spectrum_sparseness() */

#define NONE_BE_FIX_BASOP_1044_OSBA_PRERENDER_MIX_GAINS /* DLB: adjust prerendering and mixing gain in OSBA encoder. This is fix to float codes*/
#define NONBE_1211_DTX_BR_SWITCHING                     /* VA: port float issue 1211: fix crash in MASA DTX bitrate switching */
#define NONBE_FIX_1189_GSC_IVAS_OMASA                   /* VA: Fix for issue 1189: Bitstream desynchornization due to reading/writing of the GSC_IVAS_mode parameter */
#define NONBE_FIX_1087_OOB_SBA_DTX_RS                   /* VA: issue 1087: Extend the length of the buffer for MCT decoding to avoid out-of-bound writing in SBA SID bitrate switching decoding */
#define NONBE_1273_ISM_METADATA_COUNTER                 /* VA: FLP issue 1273: fix counter overflow in ISM metadata encoder */
#define NONBE_FIX_GSC_BSTR                              /* VA: issue 1264 FLP (1189 BASOP): Fix bitstream synchronization between encoder and decoder in ACELP GSC in OMASA */
#define NONBE_FIX_1277_EVS_DTX_HIGH_RATE_THRESHOLD      /* VA/Eri: FLP issue 1277: Fix Mismatch in DTX high-rate threshold between EVS float and BASOP */

#define NONBE_1319_M2R_PRECISION_ALIGN                  /* Nokia: bring updates from PC code related to OMASA masa2total ratios */
#define NONBE_FIX_864_JBM_RENDER_FRAMESIZE                    /* FhG: issue #864: fix different behaviour of JBM TSM with different render frame sizes */
#define NONBE_FIX_TCX5_INTERLEAVING_FOR_FS_IN_UNEQUAL_FS_OUT  /* FhG: apply correct TCX5 grouping/interleaving when input_fs != output_fs */



/* #################### End FIXES switches ############################ */

@@ -208,10 +186,13 @@
#define NONBE_FIX_1174_MCMASA_LBR_LOOP_ERROR            /* Nokia: Fix issue 1174 by removing the unnecessary inner loop causing problems. */
#define NONBE_FIX_1052_SBA_EXT_FIX                      /* VA: SBA external output support fix - do not overwrite "output_config" parameter */
#define FIX_1113_CLDFB_REND_IN_ISAR                     /* issue 1113: fix the use of CLDFB renderer in split-rendering at the external renderer */

#define NONBE_FIX_1110_STEREO_DTX_BRATE_SWITCHING       /* VA: issue 1110: fix encoder crash in the stereo DTX bitrate switching condition */
#define NONBE_1894_OSBA_SCALING                         /* FhG: port OSBA scaling MRs (298,355,360) jointly */
#define NONBE_FIX_1141_OSBA_ROOM_RENDERING              /* FhG: Fix for issue 1141: render objects in OSBA decoder with room effect  */
#define NONBE_1360_LFE_DELAY                            /* Dlb: LFE delay alignment when rendering in CLDFB domain*/
#define NONBE_1229_FIX_ISM1_DPID                        /* Eri: issue 1229: fix bug causing ISM 1 to use default -dpid instead of the specified one */
#define NONBE_SVD_OPTIMIZATION
#define FIX_1158_FASTCONV_REVERB_HRTF                   /* Philips: issue 1158: Rendering with FastConv to BINAURAL_ROOM_REVERB uses BRIR convolution instead of HRTF */
#define FIX_745_FIX_DATA_TYPE_CONVERSION                /* VA: issue 745: implicit data type conversion when calling IVAS_DEC_Configure() */

/* #################### End BASOP porting switches ############################ */
+0 −8
Original line number Diff line number Diff line
@@ -1505,11 +1505,7 @@ void decoder_tcx_tns(
            hTcxCfg->tcx_last_overlap_mode = hTcxCfg->tcx_curr_overlap_mode;
        }

#ifdef NONBE_FIX_TCX5_INTERLEAVING_FOR_FS_IN_UNEQUAL_FS_OUT
        if ( ( hTcxCfg->fIsTNSAllowed && fUseTns != 0 && bfi != 1 && whitenedDomain ) || ( L_spec > L_frameTCX ) )
#else
        if ( ( hTcxCfg->fIsTNSAllowed && fUseTns != 0 && bfi != 1 ) || ( L_spec > L_frameTCX ) )
#endif
        {
            L = L_spec;
        }
@@ -1552,11 +1548,7 @@ void decoder_tcx_tns(
        if ( ( L_frame == st->L_frame >> 1 ) && st->tcxonly && isTCX5 )
        {

#ifdef NONBE_FIX_TCX5_INTERLEAVING_FOR_FS_IN_UNEQUAL_FS_OUT
            if ( st->element_mode == EVS_MONO || ( L_spec < L_frameTCX && !whitenedDomain ) ) /* todo: this is temporary to maintain EVS BE, this is a bug and should be fixed also for EVS (see issue 13) */
#else
            if ( st->element_mode == EVS_MONO || L_spec < L_frameTCX ) /* todo: this is temporary to maintain EVS BE, this is a bug and should be fixed also for EVS (see issue 13) */
#endif
            {
                tcx5TnsUngrouping( L_frameTCX >> 1, hTcxCfg->tnsConfig[0][0].iFilterBorders[0] >> 1, x, DEC );
            }
+42 −9
Original line number Diff line number Diff line
@@ -2241,27 +2241,40 @@ void ivas_dirac_dec_render_sf(
        /* render objects in combined format onto the CICP19 channels for BINAURAL_ROOM_IR */
        if ( st_ivas->ivas_format == SBA_ISM_FORMAT && st_ivas->ism_mode == ISM_SBA_MODE_DISC && st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM )
        {
#ifndef NONBE_FIX_1141_OSBA_ROOM_RENDERING
            int16_t in_ch;
            for ( in_ch = 0; in_ch < st_ivas->nchan_ism; in_ch++ )
            {
                int16_t j, k, j2, l;
                int16_t num_objects, nchan_out_woLFE, lfe_index;
#endif
                int16_t j, k, l;
#ifndef NONBE_FIX_1141_OSBA_ROOM_RENDERING
                int16_t j2, lfe_index;
#endif
                int16_t num_objects, nchan_out_woLFE;
                int16_t az1, el1;
                int16_t n_slots_to_render;
                int16_t n_samples_to_render;
#ifndef NONBE_FIX_1141_OSBA_ROOM_RENDERING
                int16_t interp_offset;
#endif
                float gain, prev_gain;

                num_objects = st_ivas->nchan_ism;
                nchan_out_woLFE = st_ivas->hIntSetup.nchan_out_woLFE;
                n_slots_to_render = st_ivas->hSpar->subframe_nbslots[st_ivas->hSpar->subframes_rendered];
                n_samples_to_render = hSpatParamRendCom->num_freq_bands * n_slots_to_render;
#ifndef NONBE_FIX_1141_OSBA_ROOM_RENDERING
                interp_offset = st_ivas->hTcBuffer->n_samples_rendered;
#endif

                if ( st_ivas->hCombinedOrientationData && st_ivas->hCombinedOrientationData->enableCombinedOrientation[0] )
                {
                    ivas_jbm_dec_get_adapted_linear_interpolator( n_samples_to_render, n_samples_to_render, st_ivas->hIsmRendererData->interpolator );
#ifdef NONBE_FIX_1141_OSBA_ROOM_RENDERING
                    st_ivas->hIsmRendererData->interp_offset = 0;
#else
                interp_offset = 0;
#endif
                }

                for ( i = 0; i < num_objects; i++ )
@@ -2276,14 +2289,19 @@ void ivas_dirac_dec_render_sf(
                        }
                    }

#ifdef NONBE_FIX_1141_OSBA_ROOM_RENDERING
                    for ( j = 0; j < nchan_out_woLFE; j++ )
#else
                lfe_index = 0;
                for ( j = 0, j2 = 0; j < nchan_out_woLFE; j++, j2++ )
#endif
                    {
#ifndef NONBE_FIX_1141_OSBA_ROOM_RENDERING
                        if ( ( st_ivas->hIntSetup.num_lfe > 0 ) && ( st_ivas->hIntSetup.index_lfe[lfe_index] == j ) )
                        {
                            ( lfe_index < ( st_ivas->hIntSetup.num_lfe - 1 ) ) ? ( lfe_index++, j2++ ) : j2++;
                        }

#endif
                        gain = st_ivas->hIsmRendererData->gains[i][j];
                        prev_gain = st_ivas->hIsmRendererData->prev_gains[i][j];
                        if ( fabsf( gain ) > 0.0f || fabsf( prev_gain ) > 0.0f )
@@ -2291,7 +2309,12 @@ void ivas_dirac_dec_render_sf(
                            float *tc_re, *tc_im;
                            float *w1, w2;

#ifdef NONBE_FIX_1141_OSBA_ROOM_RENDERING
                            w1 = &st_ivas->hIsmRendererData->interpolator[st_ivas->hIsmRendererData->interp_offset];
#else
                        w1 = &st_ivas->hIsmRendererData->interpolator[interp_offset];
#endif

                            tc_re = pppQMfFrame_ts_re[nchan_transport + i][0];
                            tc_im = pppQMfFrame_ts_im[nchan_transport + i][0];

@@ -2304,8 +2327,13 @@ void ivas_dirac_dec_render_sf(

                                for ( l = 0; l < hSpatParamRendCom->num_freq_bands; l++ )
                                {
#ifdef NONBE_FIX_1141_OSBA_ROOM_RENDERING
                                    Cldfb_RealBuffer[j][k][l] += g * *( tc_re++ );
                                    Cldfb_ImagBuffer[j][k][l] += g * *( tc_im++ );
#else
                                Cldfb_RealBuffer[j2][k][l] += g * *( tc_re++ );
                                Cldfb_ImagBuffer[j2][k][l] += g * *( tc_im++ );
#endif
                                }
                                w1 += hSpatParamRendCom->num_freq_bands;
                            }
@@ -2318,7 +2346,12 @@ void ivas_dirac_dec_render_sf(
                        }
                    }
                }
#ifndef NONBE_FIX_1141_OSBA_ROOM_RENDERING
            }
#endif
#ifdef NONBE_FIX_1141_OSBA_ROOM_RENDERING
            st_ivas->hIsmRendererData->interp_offset += hSpatParamRendCom->num_freq_bands * st_ivas->hSpar->subframe_nbslots[st_ivas->hSpar->subframes_rendered];
#endif
        }

        if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
+13 −2
Original line number Diff line number Diff line
@@ -711,7 +711,11 @@ void ivas_ism_dec_digest_tc(

            if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC ||
                 st_ivas->renderer_type == RENDERER_OSBA_AMBI ||
                 st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV )
                 st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV
#ifdef NONBE_FIX_1141_OSBA_ROOM_RENDERING
                 || ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM && st_ivas->ivas_format == SBA_ISM_FORMAT && st_ivas->ism_mode == ISM_SBA_MODE_DISC )
#endif
            )
            {
                st_ivas->hIsmRendererData->interpolator[0] = 0.0f;
                for ( i = 1; i < interpolator_length; i++ )
@@ -731,6 +735,9 @@ void ivas_ism_dec_digest_tc(
        {
            ivas_jbm_dec_get_adapted_linear_interpolator( (int16_t) ( st_ivas->hDecoderConfig->output_Fs / FRAMES_PER_SEC ), st_ivas->hTcBuffer->n_samples_available, st_ivas->hIsmRendererData->interpolator );
        }
#ifdef NONBE_FIX_1141_OSBA_ROOM_RENDERING
        st_ivas->hIsmRendererData->interp_offset = 0;
#endif

        /* also get the gains here */
        for ( i = 0; i < st_ivas->nchan_ism; i++ )
@@ -749,7 +756,11 @@ void ivas_ism_dec_digest_tc(

                if ( ( st_ivas->renderer_type == RENDERER_TD_PANNING ||
                       st_ivas->renderer_type == RENDERER_OSBA_LS ||
                       st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) &&
                       st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM
#ifdef NONBE_FIX_1141_OSBA_ROOM_RENDERING
                       || ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM && st_ivas->ivas_format == SBA_ISM_FORMAT && st_ivas->ism_mode == ISM_SBA_MODE_DISC )
#endif
                           ) &&
                     st_ivas->hCombinedOrientationData == NULL )
                {
                    if ( st_ivas->hIntSetup.is_planar_setup )
Loading