Commit a97953d9 authored by reutelhuber's avatar reutelhuber
Browse files

Merge branch 'main' into 788-msan-error-in-sba-br-switching-with-dtx-in-foa-encoding

parents d0d4779a 332bc972
Loading
Loading
Loading
Loading
Loading
+29 −3
Original line number Original line Diff line number Diff line
@@ -162,7 +162,12 @@ ivas_error ivas_dirac_config(
    hConfig->dec_param_estim = FALSE;
    hConfig->dec_param_estim = FALSE;
    if ( ivas_format == SBA_FORMAT || ivas_format == SBA_ISM_FORMAT ) /* skip for MASA decoder */
    if ( ivas_format == SBA_FORMAT || ivas_format == SBA_ISM_FORMAT ) /* skip for MASA decoder */
    {
    {
        if ( ( error = ivas_dirac_sba_config( hQMetaData, element_mode, ivas_total_brate, sba_order, hConfig->nbands - spar_dirac_split_band ) ) != IVAS_ERR_OK )
        if ( ( error = ivas_dirac_sba_config( hQMetaData, element_mode, ivas_total_brate, sba_order, hConfig->nbands - spar_dirac_split_band
#ifdef NONBE_FIX_871_ACELP_CRASH_IN_OSBA
                                              ,
                                              ivas_format
#endif
                                              ) ) != IVAS_ERR_OK )
        {
        {
            return error;
            return error;
        }
        }
@@ -319,7 +324,12 @@ void ivas_get_dirac_sba_max_md_bits(
    int16_t *bits_frame_nominal,
    int16_t *bits_frame_nominal,
    int16_t *metadata_max_bits,
    int16_t *metadata_max_bits,
    int16_t *qmetadata_max_bit_req,
    int16_t *qmetadata_max_bit_req,
    const int16_t nbands )
    const int16_t nbands
#ifdef NONBE_FIX_871_ACELP_CRASH_IN_OSBA
    ,
    IVAS_FORMAT ivas_format
#endif
)
{
{
    if ( sba_total_brate <= IVAS_13k2 )
    if ( sba_total_brate <= IVAS_13k2 )
    {
    {
@@ -335,6 +345,13 @@ void ivas_get_dirac_sba_max_md_bits(
    {
    {
        *bits_frame_nominal = ACELP_16k40 / FRAMES_PER_SEC;
        *bits_frame_nominal = ACELP_16k40 / FRAMES_PER_SEC;
        *metadata_max_bits = 103;
        *metadata_max_bits = 103;
#ifdef NONBE_FIX_871_ACELP_CRASH_IN_OSBA
        /* OSBA needs an additional 2-bits safety margin to avoid acelp crashes */
        if ( ivas_format == SBA_ISM_FORMAT )
        {
            ( *metadata_max_bits ) -= 3;
        }
#endif
    }
    }
    else if ( sba_total_brate <= IVAS_32k )
    else if ( sba_total_brate <= IVAS_32k )
    {
    {
@@ -390,6 +407,10 @@ ivas_error ivas_dirac_sba_config(
    int32_t sba_total_brate,          /* i  : SBA total bitrate                                    */
    int32_t sba_total_brate,          /* i  : SBA total bitrate                                    */
    const int16_t sba_order,          /* i  : Ambisonic (SBA) order                                */
    const int16_t sba_order,          /* i  : Ambisonic (SBA) order                                */
    const int16_t nbands              /* i  : number of frequency bands                            */
    const int16_t nbands              /* i  : number of frequency bands                            */
#ifdef NONBE_FIX_871_ACELP_CRASH_IN_OSBA
    ,
    IVAS_FORMAT ivas_format
#endif
)
)
{
{
    int16_t nbands_coded;
    int16_t nbands_coded;
@@ -452,7 +473,12 @@ ivas_error ivas_dirac_sba_config(
        }
        }
    }
    }


    ivas_get_dirac_sba_max_md_bits( sba_total_brate, &hQMetaData->bits_frame_nominal, &hQMetaData->metadata_max_bits, &hQMetaData->qmetadata_max_bit_req, hQMetaData->q_direction[0].cfg.nbands );
    ivas_get_dirac_sba_max_md_bits( sba_total_brate, &hQMetaData->bits_frame_nominal, &hQMetaData->metadata_max_bits, &hQMetaData->qmetadata_max_bit_req, hQMetaData->q_direction[0].cfg.nbands
#ifdef NONBE_FIX_871_ACELP_CRASH_IN_OSBA
                                    ,
                                    ivas_format
#endif
    );


    return error;
    return error;
}
}
+8 −0
Original line number Original line Diff line number Diff line
@@ -3650,6 +3650,10 @@ void ivas_get_dirac_sba_max_md_bits(
    int16_t *metadata_max_bits,
    int16_t *metadata_max_bits,
    int16_t *qmetadata_max_bit_req,
    int16_t *qmetadata_max_bit_req,
    const int16_t nbands
    const int16_t nbands
#ifdef NONBE_FIX_871_ACELP_CRASH_IN_OSBA
	,
	IVAS_FORMAT ivas_format
#endif
);
);


ivas_error ivas_dirac_sba_config(
ivas_error ivas_dirac_sba_config(
@@ -3658,6 +3662,10 @@ ivas_error ivas_dirac_sba_config(
    int32_t sba_total_brate,                                    /* i  : SBA total bitrate                                    */
    int32_t sba_total_brate,                                    /* i  : SBA total bitrate                                    */
    const int16_t sba_order,                                    /* i  : Ambisonic (SBA) order                                */
    const int16_t sba_order,                                    /* i  : Ambisonic (SBA) order                                */
    const int16_t nbands                                        /* i  : number of frequency bands                            */
    const int16_t nbands                                        /* i  : number of frequency bands                            */
#ifdef NONBE_FIX_871_ACELP_CRASH_IN_OSBA
	,
	IVAS_FORMAT ivas_format
#endif
);
);


ivas_error ivas_dirac_dec_config(
ivas_error ivas_dirac_dec_config(
+2 −0
Original line number Original line Diff line number Diff line
@@ -164,7 +164,9 @@
#define NONBE_FIX_856_TCX_LTP_SYNTH_FILTER                    /* FhG: issue 856: correct filtering length for tcx-ltp synth filtering*/
#define NONBE_FIX_856_TCX_LTP_SYNTH_FILTER                    /* FhG: issue 856: correct filtering length for tcx-ltp synth filtering*/
#define NONBE_UNIFIED_DECODING_PATHS                          /* FhG: unify decoding paths   */
#define NONBE_UNIFIED_DECODING_PATHS                          /* FhG: unify decoding paths   */
#define NONBE_FIX_874_OMASA_BRSW_2TD                          /* Nokia: issue 874: Fixes the crashes with the long test vectors that prompted switching to TD*/
#define NONBE_FIX_874_OMASA_BRSW_2TD                          /* Nokia: issue 874: Fixes the crashes with the long test vectors that prompted switching to TD*/
#define NONBE_FIX_871_ACELP_CRASH_IN_OSBA                     /* FhG: isse 871: crash in ACELP core encoder with OSBA */
#define NONBE_FIX_225_MASA_EXT_REND                           /* Nokia: Resolve #225: Complete MASA external renderer implementation */
#define NONBE_FIX_225_MASA_EXT_REND                           /* Nokia: Resolve #225: Complete MASA external renderer implementation */
#define NONBE_FIX_897_USAN_WITH_MASA_RENDERING                /* Nokia: issue #897: USAN null pointer in MASA external renderer to Ambisonics */


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


+12 −2
Original line number Original line Diff line number Diff line
@@ -1363,7 +1363,12 @@ ivas_error ivas_init_decoder(
            }
            }
        }
        }


        if ( ( error = ivas_dirac_sba_config( st_ivas->hQMetaData, &st_ivas->element_mode_init, ivas_total_brate, st_ivas->sba_analysis_order, ivas_get_hodirac_flag( ivas_total_brate, st_ivas->sba_analysis_order ) ? IVAS_MAX_NUM_BANDS : ( IVAS_MAX_NUM_BANDS - SPAR_DIRAC_SPLIT_START_BAND ) ) ) != IVAS_ERR_OK )
        if ( ( error = ivas_dirac_sba_config( st_ivas->hQMetaData, &st_ivas->element_mode_init, ivas_total_brate, st_ivas->sba_analysis_order, ivas_get_hodirac_flag( ivas_total_brate, st_ivas->sba_analysis_order ) ? IVAS_MAX_NUM_BANDS : ( IVAS_MAX_NUM_BANDS - SPAR_DIRAC_SPLIT_START_BAND )
#ifdef NONBE_FIX_871_ACELP_CRASH_IN_OSBA
                                                                                                                                                   ,
                                              st_ivas->ivas_format
#endif
                                              ) ) != IVAS_ERR_OK )
        {
        {
            return error;
            return error;
        }
        }
@@ -1516,7 +1521,12 @@ ivas_error ivas_init_decoder(
            }
            }
        }
        }


        if ( ( error = ivas_dirac_sba_config( st_ivas->hQMetaData, &st_ivas->element_mode_init, ivas_total_brate, st_ivas->sba_analysis_order, ivas_get_hodirac_flag( ivas_total_brate, st_ivas->sba_analysis_order ) ? IVAS_MAX_NUM_BANDS : ( IVAS_MAX_NUM_BANDS - SPAR_DIRAC_SPLIT_START_BAND ) ) ) != IVAS_ERR_OK )
        if ( ( error = ivas_dirac_sba_config( st_ivas->hQMetaData, &st_ivas->element_mode_init, ivas_total_brate, st_ivas->sba_analysis_order, ivas_get_hodirac_flag( ivas_total_brate, st_ivas->sba_analysis_order ) ? IVAS_MAX_NUM_BANDS : ( IVAS_MAX_NUM_BANDS - SPAR_DIRAC_SPLIT_START_BAND )
#ifdef NONBE_FIX_871_ACELP_CRASH_IN_OSBA
                                                                                                                                                   ,
                                              st_ivas->ivas_format
#endif
                                              ) ) != IVAS_ERR_OK )
        {
        {
            return error;
            return error;
        }
        }
+6 −1
Original line number Original line Diff line number Diff line
@@ -392,7 +392,12 @@ ivas_error ivas_sba_dec_reconfigure(
        ivas_mono_dmx_renderer_close( &st_ivas->hMonoDmxRenderer );
        ivas_mono_dmx_renderer_close( &st_ivas->hMonoDmxRenderer );
    }
    }


    if ( ( error = ivas_dirac_sba_config( st_ivas->hQMetaData, &st_ivas->element_mode_init, ivas_total_brate, st_ivas->sba_analysis_order, ivas_get_hodirac_flag( ivas_total_brate, st_ivas->sba_analysis_order ) ? IVAS_MAX_NUM_BANDS : ( IVAS_MAX_NUM_BANDS - SPAR_DIRAC_SPLIT_START_BAND ) ) ) != IVAS_ERR_OK )
    if ( ( error = ivas_dirac_sba_config( st_ivas->hQMetaData, &st_ivas->element_mode_init, ivas_total_brate, st_ivas->sba_analysis_order, ivas_get_hodirac_flag( ivas_total_brate, st_ivas->sba_analysis_order ) ? IVAS_MAX_NUM_BANDS : ( IVAS_MAX_NUM_BANDS - SPAR_DIRAC_SPLIT_START_BAND )
#ifdef NONBE_FIX_871_ACELP_CRASH_IN_OSBA
                                                                                                                                               ,
                                          st_ivas->ivas_format
#endif
                                          ) ) != IVAS_ERR_OK )
    {
    {
        return error;
        return error;
    }
    }
Loading