Commit ff571095 authored by vaclav's avatar vaclav
Browse files

Merge remote-tracking branch 'remotes/origin/main' into 733-public-api-enum-names

parents 911026bd 5c90c527
Loading
Loading
Loading
Loading
+9 −8
Original line number Diff line number Diff line
@@ -145,8 +145,8 @@
#define BASOP_NOGLOB                                    /* Disable global symbols in BASOPs, Overflow/Carry in BASOPs disabled, additional BASOPs in case of Overflow */


/* ################# Start BE DEVELOPMENT switches ######################## */
/* only BE switches wrt operation points tested in selection */
/* ################### Start BE switches ################################# */
/* only BE switches wrt selection floating point code */

/*#define FIX_I4_OL_PITCH*/                             /* fix open-loop pitch used for EVS core switching */

@@ -158,16 +158,17 @@
#define OSBA_SPLIT_RENDERING
#endif

/* #################### End BE switches ################################## */


/* ################## End BE DEVELOPMENT switches ######################### */
/* #################### Start NON-BE switches ############################ */
/* any switch which is non-be wrt selection floating point code */
/* all switches in this category should start with "NONBE_" */

/* #################### Start NON-BE CR switches ########################## */
/* any switch which is non-be wrt operation points tested in selection */
/* all switches in this category should start with "CR_" */
#define NONBE_FIX_736_FOA_BR_SWITCH                           /* FhG/Dlb : Issue 736: FOA bitrate switching decoding crashes in in ivas_spar_to_dirac */
#define NONBE_FIX_746_NONDIEGETIC_MD                          /* Eri: Issue 746: The non-diegetic panning flag affects the encoder bitstream even if extended metadata is not enabled. Crashes the decoder.*/


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

/* ################## End DEVELOPMENT switches ######################### */

+47 −2
Original line number Diff line number Diff line
@@ -183,7 +183,11 @@ ivas_error ivas_sba_dec_reconfigure(

    if ( hSpar != NULL )
    {
#ifdef NONBE_FIX_736_FOA_BR_SWITCH
        if ( ( hSpar->hPCA != NULL ) && ( ( hDecoderConfig->ivas_total_brate != PCA_BRATE ) || ( st_ivas->sba_order != 1 ) ) )
#else
        if ( ( hSpar->hPCA != NULL ) && ( ( hDecoderConfig->ivas_total_brate != PCA_BRATE ) || ( sba_order_internal != 1 ) ) )
#endif
        {
            free( st_ivas->hSpar->hPCA );
            hSpar->hPCA = NULL;
@@ -214,6 +218,18 @@ ivas_error ivas_sba_dec_reconfigure(
                return error;
            }
        }
#ifdef NONBE_FIX_736_FOA_BR_SWITCH
        if ( ( hSpar->hPCA == NULL ) &&
             ( st_ivas->hDecoderConfig->ivas_total_brate == PCA_BRATE && st_ivas->sba_order == 1 ) && ( st_ivas->ivas_format == SBA_FORMAT ) )
        {
            if ( ( hSpar->hPCA = (PCA_DEC_STATE *) malloc( sizeof( PCA_DEC_STATE ) ) ) == NULL )
            {
                return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for PCA decoder" );
            }

            ivas_pca_dec_init( hSpar->hPCA );
        }
#endif
        ivas_spar_config( ivas_total_brate, sba_order_internal, &st_ivas->nchan_transport, &st_ivas->nSCE, &st_ivas->nCPE, &hSpar->core_nominal_brate, st_ivas->sid_format );
    }
    else
@@ -273,8 +289,17 @@ ivas_error ivas_sba_dec_reconfigure(
    {
        ivas_binRenderer_close( &st_ivas->hBinRenderer );
    }

#ifdef NONBE_FIX_736_FOA_BR_SWITCH
    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 )
    {
        return error;
    }
#endif
#ifndef NONBE_FIX_736_FOA_BR_SWITCH
    if ( ( ( st_ivas->renderer_type != RENDERER_DISABLE ) && ( st_ivas->renderer_type != RENDERER_SBA_LINEAR_DEC ) ) || ( ( hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_FOA ) && ( st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_STEREO ) && ( st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_MONO ) ) || ( last_ivas_total_brate > IVAS_256k && ivas_total_brate <= IVAS_256k ) || ( last_ivas_total_brate <= IVAS_256k && ivas_total_brate > IVAS_256k ) )
#else
    if ( ( ( st_ivas->renderer_type != RENDERER_DISABLE ) && ( st_ivas->renderer_type != RENDERER_SBA_LINEAR_DEC ) ) || ( ( hDecoderConfig->output_config != AUDIO_CONFIG_FOA ) && ( st_ivas->hDecoderConfig->output_config != AUDIO_CONFIG_STEREO ) && ( st_ivas->hDecoderConfig->output_config != AUDIO_CONFIG_MONO ) ) )
#endif
    {
        DIRAC_CONFIG_FLAG flag_config;

@@ -299,12 +324,32 @@ ivas_error ivas_sba_dec_reconfigure(
            mvs2s( st_ivas->hTcBuffer->subframe_nbslots, st_ivas->hSpatParamRendCom->subframe_nbslots, MAX_JBM_SUBFRAMES_5MS );
        }
    }

#ifdef NONBE_FIX_736_FOA_BR_SWITCH
    else
    {
#endif
#ifndef NONBE_FIX_736_FOA_BR_SWITCH
    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 )
    {
        return error;
    }
#endif
#ifdef NONBE_FIX_736_FOA_BR_SWITCH
        int16_t band_grouping[IVAS_MAX_NUM_BANDS + 1];

        st_ivas->hSpar->enc_param_start_band = min( IVAS_MAX_NUM_BANDS, SPAR_DIRAC_SPLIT_START_BAND );
        if ( ivas_get_hodirac_flag( ivas_total_brate, st_ivas->sba_analysis_order ) )
        {
            st_ivas->hSpar->enc_param_start_band = 0;

            set_c( (int8_t *) st_ivas->hQMetaData->twoDirBands, (int8_t) 1, st_ivas->hQMetaData->q_direction[0].cfg.nbands );
            st_ivas->hQMetaData->numTwoDirBands = (uint8_t) st_ivas->hQMetaData->q_direction[0].cfg.nbands;
        }

        ivas_dirac_config_bands( band_grouping, IVAS_MAX_NUM_BANDS, (int16_t) ( st_ivas->hDecoderConfig->output_Fs * INV_CLDFB_BANDWIDTH + 0.5f ),
                                 st_ivas->hSpar->dirac_to_spar_md_bands, st_ivas->hQMetaData->useLowerBandRes, st_ivas->hSpar->enc_param_start_band, 0 );
    }
#endif
    if ( st_ivas->renderer_type == RENDERER_DISABLE )
    {
        ivas_dirac_rend_close( &( st_ivas->hDirACRend ) );
+4 −0
Original line number Diff line number Diff line
@@ -415,7 +415,11 @@ ivas_error ivas_ism_metadata_enc(
                    push_indice( hBstr, IND_ISM_NDP_FLAG, hIsmMeta[ch]->non_diegetic_flag, ISM_METADATA_IS_NDP_BITS );
                }

#ifdef NONBE_FIX_746_NONDIEGETIC_MD
                if ( hIsmMeta[ch]->non_diegetic_flag && ism_extended_metadata_flag )
#else
                if ( hIsmMeta[ch]->non_diegetic_flag )
#endif
                {
                    /* Map azimuth to panning range [-90:90] */
                    if ( hIsmMetaData->azimuth > 90.0f )
+2 −2
Original line number Diff line number Diff line
@@ -4752,7 +4752,7 @@ ivas_error IVAS_REND_FeedInputAudio(
         ( inputAudio.config.numSamplesPerChannel * 1000 / cldfb2tdSampleFact ) != ( BINAURAL_RENDERING_FRAME_SIZE_MS * hIvasRend->num_subframes ) * hIvasRend->sampleRateOut )
#else
    if ( getAudioConfigType( hIvasRend->outputConfig ) == IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL &&
         inputAudio.config.numSamplesPerChannel * 1000 != BINAURAL_RENDERING_FRAME_SIZE_MS * hIvasRend->sampleRateOut )
         inputAudio.config.numSamplesPerChannel * 1000 != ( BINAURAL_RENDERING_FRAME_SIZE_MS * hIvasRend->num_subframes ) * hIvasRend->sampleRateOut )
#endif
    {
        return IVAS_ERROR( IVAS_ERR_INVALID_BUFFER_SIZE, "Binaural rendering requires specific frame size" );
@@ -8707,7 +8707,7 @@ static ivas_error getSamplesInternal(
         ( outAudio.config.numSamplesPerChannel * 1000 / cldfb2tdSampleFact ) != ( hIvasRend->num_subframes * BINAURAL_RENDERING_FRAME_SIZE_MS ) * hIvasRend->sampleRateOut )
#else
    if ( getAudioConfigType( hIvasRend->outputConfig ) == IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL &&
         outAudio.config.numSamplesPerChannel * 1000 != BINAURAL_RENDERING_FRAME_SIZE_MS * hIvasRend->sampleRateOut )
         outAudio.config.numSamplesPerChannel * 1000 != ( hIvasRend->num_subframes * BINAURAL_RENDERING_FRAME_SIZE_MS ) * hIvasRend->sampleRateOut )
#endif
    {
        return IVAS_ERROR( IVAS_ERR_INVALID_BUFFER_SIZE, "Binaural rendering requires specific frame size" );
+0 −16
Original line number Diff line number Diff line
@@ -53,8 +53,6 @@ def test_ambisonics(test_info, in_fmt, out_fmt, framing_5ms):
@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI)
@pytest.mark.parametrize("framing_5ms", FRAMING_5MS_TO_TEST)
def test_ambisonics_binaural_static(test_info, in_fmt, out_fmt, framing_5ms):
    if framing_5ms != "5ms":
        pytest.xfail("Binaural output currently only supported with 5ms framing")

    run_renderer(
        in_fmt,
@@ -71,8 +69,6 @@ def test_ambisonics_binaural_static(test_info, in_fmt, out_fmt, framing_5ms):
def test_ambisonics_binaural_headrotation(
    test_info, in_fmt, out_fmt, trj_file, framing_5ms
):
    if framing_5ms != "5ms":
        pytest.xfail("Binaural output currently only supported with 5ms framing")

    run_renderer(
        in_fmt,
@@ -307,8 +303,6 @@ def test_multichannel(test_info, in_fmt, out_fmt, framing_5ms):
def test_multichannel_binaural_static(test_info, in_fmt, out_fmt, framing_5ms):
    if in_fmt in ["MONO", "STEREO"]:
        pytest.skip("MONO or STEREO to Binaural rendering unsupported")
    if framing_5ms != "5ms":
        pytest.xfail("Binaural output currently only supported with 5ms framing")

    run_renderer(
        in_fmt,
@@ -327,8 +321,6 @@ def test_multichannel_binaural_headrotation(
):
    if in_fmt in ["MONO", "STEREO"]:
        pytest.skip("MONO or STEREO to Binaural rendering unsupported")
    if framing_5ms != "5ms":
        pytest.xfail("Binaural output currently only supported with 5ms framing")

    if (in_fmt == "5_1" or in_fmt == "7_1") and out_fmt == "BINAURAL":
        run_renderer(
@@ -399,8 +391,6 @@ def test_ism(test_info, in_fmt, out_fmt, framing_5ms):
@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_ISM)
@pytest.mark.parametrize("framing_5ms", FRAMING_5MS_TO_TEST)
def test_ism_binaural_static(test_info, in_fmt, out_fmt, framing_5ms):
    if framing_5ms != "5ms":
        pytest.xfail("Binaural output currently only supported with 5ms framing")

    try:
        in_meta_files = FORMAT_TO_METADATA_FILES[in_fmt]
@@ -421,8 +411,6 @@ def test_ism_binaural_static(test_info, in_fmt, out_fmt, framing_5ms):
@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_ISM)
@pytest.mark.parametrize("framing_5ms", FRAMING_5MS_TO_TEST)
def test_ism_binaural_headrotation(test_info, in_fmt, out_fmt, trj_file, framing_5ms):
    if framing_5ms != "5ms":
        pytest.xfail("Binaural output currently only supported with 5ms framing")

    try:
        in_meta_files = FORMAT_TO_METADATA_FILES[in_fmt]
@@ -529,8 +517,6 @@ def test_custom_ls_input_output(test_info, in_fmt, out_fmt):
@pytest.mark.parametrize("in_layout", CUSTOM_LS_TO_TEST)
@pytest.mark.parametrize("framing_5ms", FRAMING_5MS_TO_TEST)
def test_custom_ls_input_binaural(test_info, in_layout, out_fmt, framing_5ms):
    if framing_5ms != "5ms":
        pytest.xfail("Binaural output currently only supported with 5ms framing")

    run_renderer(
        CUSTOM_LAYOUT_DIR.joinpath(f"{in_layout}.txt"),
@@ -547,8 +533,6 @@ def test_custom_ls_input_binaural(test_info, in_layout, out_fmt, framing_5ms):
def test_custom_ls_input_binaural_headrotation(
    test_info, in_layout, out_fmt, trj_file, framing_5ms
):
    if framing_5ms != "5ms":
        pytest.xfail("Binaural output currently only supported with 5ms framing")

    run_renderer(
        CUSTOM_LAYOUT_DIR.joinpath(f"{in_layout}.txt"),
Loading