Commit a9d3f905 authored by vaclav's avatar vaclav
Browse files

port float MR 2075

parent 220b7104
Loading
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -179,21 +179,16 @@
#define FIX_1113_EXTREND_ISAR                           /* FhG: issue 1113: fix external renderer asserts for FOA/HOA2 and CLDFB config */
#define FIX_1166_TDREND_DIV0                            /* FhG,Eri: issue 1166: potential divide by zero in TD Renderer */
#define NONBE_1203_MDCT2DFT_SWITCHING                   /* VA: issue 1203: fix severe artifacts during MDCT to DFT stereo switching when MDCT ITD is not used */
#define NONBE_1122_JBM_FIX_PLAYOUT_DELAY_IN_DTX         /* FhG: Avoid JBM ignoring safety margin and setting playout delay to 0 during DTX */
#define NONBE_1122_KEEP_EVS_MODE_UNCHANGED              /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR.  */
#define FIX_938_COMPILER_WARNING                        /* FhG: Fix compiler warning in ivas_mdct_core_reconstruct() */
#define FIX_1376_MISSING_ISM_METADATA                   /* FhG: IVAS_rend: throw error if there exists an ISM input without a corresponding metadata file path */
#define FIX_1385_INIT_IGF_STOP_FREQ                     /* FhG: Initialize infoIGFStopFreq in init_igf_dec() */
#define FIX_1387_INIT_PRM_SQQ                           /* FhG: initialize pointer prm_sqQ, which might be uninitialized in case of bfi == 1 */
#define NONBE_1296_TDREND_ITD_OUT_OF_BOUNDS_ACCESS      /* Eri: issue 1296: ITD resampling can occasionally read out of bounds, especially when the requested subframes are short (1.25 ms). Seen for headtracking+JBM. */
#define FIX_1349_TNS_CRASH                              /* FhG: Fix crash in TNS entropy coding, in case order of joint TNS coding is reduced to 0 */
#define NONBE_FIX_1180_HQMDCT_PHECU_LT_MUTING           /* Ericsson: issue 1180, corrected long term mute loop attnuation after 200ms  in PhECU-PLC  */ 
#define NONBE_1199_OMASA_JBM_BRATE_SW_FLUSH             /* VA: issue 1199: fix bug in renderer flush in OMASA JBM bitrate switching */
#define NONBE_1200_ISM_JBM_BRATE_SW_FLUSH               /* VA: issue 1200: fix bug in renderer flush in ISM JBM bitrate switching */
#define NONBE_1293_CRASH_FIRST_FRAME_LOST               /* VA: issue 1293: fix G.192 decoder crash when first frame is lost */
#define FIX_1384_MSAN_stereo_tcx_core_enc               /* VA: issue 1384: fix use-of-uninitialized value in stereo_tcx_core_enc() */
#define NONBE_FIX_1297_SPAR_JBM_MEM_SAN                 /* Dolby: issue 1297, SPAR + JBM + BR switch memory sanitizer */ 
#define NONBE_1303_GRANULARITY_OSBA_REND                /* VA: issue 1303: Correctly set the granularity in OSBA, Disc mode, and BINAURAL_ROOM_REVERB output */
#define NONBE_1303_REND_GRANULARITY                     /* VA: issue 1303: Renderer granularity revision */

// object-editing feature porting
+9 −23
Original line number Diff line number Diff line
@@ -263,9 +263,7 @@ static void trans_ana(
    const int16_t time_offs,     /* i  : Time offset                                          */
    const float est_mus_content, /* i  : 0.0=speech_like ... 1.0=Music    (==st->env_stab )   */
    const int16_t last_fec,      /* i  : signal that previous frame was concealed with fec_alg*/
#ifdef NONBE_FIX_1180_HQMDCT_PHECU_LT_MUTING
    const int16_t element_mode,  /* i :  element_mode req to handle EVS_MONO specific BE path  */
#endif
    float *alpha,                /* o  : Magnitude modification factors for fade to average   */
    float *beta,                 /* o  : Magnitude modification factors for fade to average   */
    float *beta_mute,            /* o  : Factor for long-term mute                            */
@@ -420,7 +418,6 @@ static void trans_ana(
                mag_chg[k] = 0;
            }

#ifdef NONBE_FIX_1180_HQMDCT_PHECU_LT_MUTING
            if ( element_mode != EVS_MONO )
            {
                if ( k == 0 && burst_len > BETA_MUTE_THR ) /* beta_mute final long term attenuation adjusted only once per frame in the first sub-band, Ref   Eq(184) in 26.447 */
@@ -435,12 +432,7 @@ static void trans_ana(
                    *beta_mute *= BETA_MUTE_FAC;
                }
            }
#else
            if ( burst_len > BETA_MUTE_THR )
            {
                *beta_mute *= BETA_MUTE_FAC;
            }
#endif

            alpha[k] = mag_chg[k];
            beta[k] = (float) ( sqrt( 1.0f - SQR( alpha[k] ) ) * *beta_mute );
            if ( k >= LGW32k - 1 )
@@ -2125,11 +2117,9 @@ static void hq_phase_ecu(
            *time_offs = 0;
        }
#endif
#ifdef NONBE_FIX_1180_HQMDCT_PHECU_LT_MUTING

        trans_ana( prevsynth + 2 * output_frame - Lprot - *time_offs + ph_ecu_lookahead, mag_chg, &ph_dith, mag_chg_1st, output_frame, *time_offs, env_stab, *last_fec, element_mode, alpha, beta, beta_mute, Xavg );
#else
        trans_ana( prevsynth + 2 * output_frame - Lprot - *time_offs + ph_ecu_lookahead, mag_chg, &ph_dith, mag_chg_1st, output_frame, *time_offs, env_stab, *last_fec, alpha, beta, beta_mute, Xavg );
#endif

        spec_ana( prevsynth + 2 * output_frame - Lprot - *time_offs + ph_ecu_lookahead, plocs, plocsi, num_p, X_sav, output_frame, bwidth, element_mode, &noise_fac, pcorr );

        if ( prev_bfi && *last_fec )
@@ -2170,11 +2160,7 @@ static void hq_phase_ecu(
#endif
        }

#ifdef NONBE_FIX_1180_HQMDCT_PHECU_LT_MUTING
        trans_ana( prevsynth + 2 * output_frame - Lprot, mag_chg, &ph_dith, mag_chg_1st, output_frame, *time_offs, env_stab, 0, element_mode, alpha, beta, beta_mute, Xavg ); /* 1.0 stable-music,  0.0 speech-like */
#else
        trans_ana( prevsynth + 2 * output_frame - Lprot, mag_chg, &ph_dith, mag_chg_1st, output_frame, *time_offs, env_stab, 0, alpha, beta, beta_mute, Xavg ); /* 1.0 stable-music,  0.0 speech-like */
#endif
    }

    mvr2r( X_sav, X, Lprot );
+1 −16
Original line number Diff line number Diff line
@@ -1749,15 +1749,12 @@ ivas_error ivas_jbm_dec_flush_renderer(
        }
        else if ( st_ivas->ivas_format == SBA_ISM_FORMAT )
        {
#ifdef NONBE_FIX_1297_SPAR_JBM_MEM_SAN
            if ( ism_mode_old == ISM_SBA_MODE_DISC )
            {
#endif
                float *tc_local[MAX_TRANSPORT_CHANNELS];
                int16_t last_spar_md_idx;
                int16_t last_dirac_md_idx;
                uint16_t nSamplesAvailableNext;
#ifdef NONBE_FIX_1297_SPAR_JBM_MEM_SAN
                ISM_MODE ism_mode_orig;
                RENDERER_TYPE renderer_type_orig;
                int32_t ivas_total_brate;
@@ -1767,27 +1764,16 @@ ivas_error ivas_jbm_dec_flush_renderer(
                st_ivas->ism_mode = ism_mode_old;
                st_ivas->renderer_type = renderer_type_old;
                st_ivas->hDecoderConfig->ivas_total_brate = st_ivas->hDecoderConfig->last_ivas_total_brate;
#endif

                last_spar_md_idx = st_ivas->hSpar->render_to_md_map[st_ivas->hSpar->slots_rendered - 1];
                last_dirac_md_idx = st_ivas->hSpatParamRendCom->render_to_md_map[st_ivas->hSpatParamRendCom->slots_rendered - 1];
#ifdef NONBE_FIX_1297_SPAR_JBM_MEM_SAN
#ifdef DEBUGGING
                assert( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV );
#endif
#else
#ifdef DEBUGGING
            assert( ism_mode_old == ISM_SBA_MODE_DISC && st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV );
#endif
#endif
                /* copy from ISM delay buffer to the correct place in tcs */
                for ( ch_idx = 0; ch_idx < st_ivas->nchan_ism; ch_idx++ )
                {
#ifdef NONBE_FIX_1297_SPAR_JBM_MEM_SAN
                    tc_local[ch_idx] = &st_ivas->hTcBuffer->tc[ch_idx][hTcBuffer->n_samples_rendered];
#else
                tc_local[ch_idx] = &st_ivas->hTcBuffer->tc[ch_idx + 2][hTcBuffer->n_samples_rendered];
#endif
                    mvr2r( st_ivas->hSbaIsmData->delayBuffer[ch_idx], tc_local[ch_idx], st_ivas->hSbaIsmData->delayBuffer_size );
                }

@@ -1812,12 +1798,11 @@ ivas_error ivas_jbm_dec_flush_renderer(
                {
                    return error;
                }
#ifdef NONBE_FIX_1297_SPAR_JBM_MEM_SAN

                st_ivas->ism_mode = ism_mode_orig;
                st_ivas->renderer_type = renderer_type_orig;
                st_ivas->hDecoderConfig->ivas_total_brate = ivas_total_brate;
            }
#endif
        }
        else
        {
+0 −4
Original line number Diff line number Diff line
@@ -184,11 +184,7 @@ ivas_error ivas_sba_dec_reconfigure(
        }
        else
        {
#ifdef NONBE_1303_GRANULARITY_OSBA_REND
            if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
#else
            if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
#endif
            {
                renderer_type_new = RENDERER_BINAURAL_FASTCONV;
            }
+0 −7
Original line number Diff line number Diff line
@@ -683,7 +683,6 @@ static void JB4_targetPlayoutDelay(
        *targetStartUp = ( *targetMin + *targetMax ) / 2;
    }

#ifdef NONBE_1122_JBM_FIX_PLAYOUT_DELAY_IN_DTX
#ifdef NONBE_1122_KEEP_EVS_MODE_UNCHANGED
    if ( !h->evsMode )
    {
@@ -693,12 +692,6 @@ static void JB4_targetPlayoutDelay(
    }
#endif
    *targetStartUp = JB4_MAX( *targetStartUp, (uint32_t) h->safetyMargin );
#else
    if ( *targetStartUp < 60 )
    {
        *targetStartUp = 60;
    }
#endif

    return;
}
Loading