Commit 1de9422f authored by reutelhuber's avatar reutelhuber
Browse files

more fixes for SBA-to-mono and SBA-to-stereo bitrate switching

parent 1a55422e
Loading
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -149,6 +149,13 @@ ivas_error ivas_corecoder_dec_reconfig(

        for ( cpe_id = st_ivas->nCPE; cpe_id < nCPE_old; cpe_id++ )
        {
#ifdef SBA2MONO
            /* don't deallocate first CPE in case of mono/stereo output of 1 TC SBA */
            if ( cpe_id == 0 && st_ivas->sba_dirac_stereo_flag )
            {
                continue;
            }
#endif
            destroy_cpe_dec( st_ivas->hCPE[cpe_id] );
            st_ivas->hCPE[cpe_id] = NULL;
        }
@@ -188,6 +195,13 @@ ivas_error ivas_corecoder_dec_reconfig(
                return error;
            }
        }
#ifdef SBA2MONO
        if ( st_ivas->sba_dirac_stereo_flag && st_ivas->nchan_transport == 1 && nchan_transport_old > 1 )
        {
            st_ivas->hCPE[0]->hCoreCoder[0] = st_ivas->hSCE[0]->hCoreCoder[0]; /* don't allocate unnecessary core coder, simply point to core coder of SCE element */
            st_ivas->hCPE[0]->hCoreCoder[1] = NULL;
        }
#endif

        for ( cpe_id = 0; cpe_id < nCPE_existing; cpe_id++ )
        {

lib_dec/ivas_sba_dec.c

100644 → 100755
+7 −0
Original line number Diff line number Diff line
@@ -215,11 +215,18 @@ ivas_error ivas_sba_dec_reconfigure(

            hSpar = st_ivas->hSpar;
        }

#ifndef SBA2MONO
        st_ivas->sba_dirac_stereo_flag = 0;
#endif

        sba_order_internal = min( st_ivas->sba_analysis_order, IVAS_MAX_SBA_ORDER );
        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 );

#ifdef SBA2MONO
        st_ivas->sba_dirac_stereo_flag = ( hDecoderConfig->output_config == AUDIO_CONFIG_STEREO || (hDecoderConfig->output_config == AUDIO_CONFIG_MONO && st_ivas->nchan_transport == 1 ) );
#endif

        if ( hDirAC == NULL && st_ivas->sba_mode == SBA_MODE_DIRAC )
        {
            if ( ( error = ivas_dirac_dec_open( st_ivas ) ) != IVAS_ERR_OK )