Commit 89c50400 authored by vaclav's avatar vaclav
Browse files

fix

parent afef1bd7
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3928,7 +3928,7 @@ ivas_error ivas_osba_render_sf_fx(
void ivas_osba_stereo_add_channels_fx(
    Word32 *tc_fx[],                                            /* i  : transport channels                          */
    Word32 *output_fx[],                                        /* i/o: output channels                             */
    const Word16 gain_bed_fx,                                   /* i  : gain bed value Q11                          */
    const Word32 gain_bed_fx,                                   /* i  : gain bed value Q11                          */
    const Word16 nchan_out,                                     /* i  : number of output channels                   */
    const Word16 nchan_ism,                                     /* i  : number of ISM channels                      */
    const Word16 ism_mode,                                      /* i  : ISM mode                                    */
+0 −1
Original line number Diff line number Diff line
@@ -129,7 +129,6 @@
#ifdef OBJ_EDITING_API
#define TMP_FIX_SPLIT_REND                              // temporary fix to split-rendering (it follows the later state of the framework but it is needed now because of current test-conditions)
#define TMP_FIX_OMASA_SR_BE                             // temporary fix to keep OMASA split-rendering BE

#define OBJ_EDITING_COMMANDLINE                         /* obj editing command-line option */
#define OBJ_EDITING_EXAMPLE                             /* obj editing example code in decoder.c */
#define OMASA_OBJECT_EDITING                            /* Nokia: object editing interface for OMASA */
+7 −2
Original line number Diff line number Diff line
@@ -994,8 +994,10 @@ void ivas_ism_dec_digest_tc_fx(
            IF( EQ_32( st_ivas->intern_config, IVAS_AUDIO_CONFIG_STEREO ) )
            {
#ifdef OBJ_EDITING_API
                Word16 gains_fx[2];
                Word16 gains_fx[CPE_CHANNELS];

                ivas_ism_get_stereo_gains_fx( (Word16) L_shr( st_ivas->hIsmMetaData[i]->azimuth_fx, 22 ), (Word16) L_shr( st_ivas->hIsmMetaData[i]->elevation_fx, 22 ), &gains_fx[0], &gains_fx[1] );

                st_ivas->hIsmRendererData->gains_fx[i][0] = L_shr( L_deposit_h( gains_fx[0] ), 1 ); // Q31 -> Q30
                move32();
                st_ivas->hIsmRendererData->gains_fx[i][1] = L_shr( L_deposit_h( gains_fx[1] ), 1 ); // Q31 -> Q30
@@ -1052,6 +1054,7 @@ void ivas_ism_dec_digest_tc_fx(
                    {
                        azimuth_fx = L_shl( azimuth_fx, Q22 );     // Q22
                        elevation_fx = L_shl( elevation_fx, Q22 ); // Q22

                        efap_determine_gains_fx( st_ivas->hEFAPdata, st_ivas->hIsmRendererData->gains_fx[i], azimuth_fx, elevation_fx, EFAP_MODE_EFAP );
#ifdef OBJ_EDITING_API
                        // TODO: align Q values properly
@@ -1070,7 +1073,9 @@ void ivas_ism_dec_digest_tc_fx(
                    /*get HOA gets for direction (ACN/SN3D)*/
                    Word16 azi = shr( extract_h( st_ivas->hIsmMetaData[i]->azimuth_fx ), 22 - 16 );   // Q0
                    Word16 ele = shr( extract_h( st_ivas->hIsmMetaData[i]->elevation_fx ), 22 - 16 ); // Q0

                    ivas_dirac_dec_get_response_fx( azi, ele, st_ivas->hIsmRendererData->gains_fx[i], st_ivas->hIntSetup.ambisonics_order, Q30 );

#ifdef OBJ_EDITING_API
                    // TODO: Align Q-values
                    IF( NE_32( st_ivas->hIsmMetaData[i]->edited_gain_fx, ONE_IN_Q29 ) )
@@ -2004,6 +2009,7 @@ void ivas_param_ism_dec_render_fx(
 *
 *
 *-------------------------------------------------------------------------*/

void ivas_param_ism_params_to_masa_param_mapping_fx(
    Decoder_Struct *st_ivas /* i/o: IVAS decoder structure      */
)
@@ -2025,7 +2031,6 @@ void ivas_param_ism_params_to_masa_param_mapping_fx(
    Word32 ivas_total_brate;
#endif


    hParamIsmDec = st_ivas->hParamIsmDec;
    move16();
    hSpatParamRendCom = st_ivas->hSpatParamRendCom;
+24 −12
Original line number Diff line number Diff line
@@ -198,7 +198,9 @@ ivas_error ivas_jbm_dec_tc_fx(
                    move16();
                }
            }

            ivas_ism_dtx_limit_noise_energy_for_near_silence_fx( st_ivas->hSCE, st_ivas->hISMDTX.sce_id_dtx, st_ivas->nchan_transport, Q_cngNoiseLevel );

#ifdef OBJ_EDITING_API
            ivas_param_ism_dec_dequant_md_fx( st_ivas );
#endif
@@ -209,6 +211,7 @@ ivas_error ivas_jbm_dec_tc_fx(
            {
                return error;
            }

#ifdef OBJ_EDITING_API
            ivas_param_ism_dec_dequant_md_fx( st_ivas );
#endif
@@ -4541,7 +4544,7 @@ void ivas_dec_prepare_renderer_fx(
    Decoder_Struct *st_ivas /* i/o: IVAS decoder structure  */
)
{
    Word16 n, n_render_timeslots, tmp, exp;
    Word16 n, n_render_timeslots, tmp, exp, shift;

    push_wmops( "ivas_dec_prepare_renderer" );

@@ -4549,7 +4552,7 @@ void ivas_dec_prepare_renderer_fx(
    tmp = BASOP_Util_Divide1616_Scale( st_ivas->hTcBuffer->n_samples_available, st_ivas->hTcBuffer->n_samples_granularity, &exp );
    n_render_timeslots = shr( tmp, sub( 15, exp ) ); // Q0


    test();
    IF( EQ_16( st_ivas->hTcBuffer->tc_buffer_mode, TC_BUFFER_MODE_BUFFER ) )
    {
        ivas_jbm_dec_td_renderers_adapt_subframes( st_ivas );
@@ -4571,6 +4574,7 @@ void ivas_dec_prepare_renderer_fx(
        /* Rendering */
        IF( EQ_16( st_ivas->ism_mode, ISM_MODE_PARAM ) )
        {
            test();
            test();
            test();
            IF( EQ_16( st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC ) || EQ_16( st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC_ROOM ) || EQ_16( st_ivas->renderer_type, RENDERER_STEREO_PARAMETRIC ) )
@@ -4593,7 +4597,7 @@ void ivas_dec_prepare_renderer_fx(
    {
        IF( st_ivas->hSCE[0] )
        {
            Word16 shift = getScaleFactor32( st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->cngNoiseLevel, FFTCLDFBLEN );
            shift = getScaleFactor32( st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->cngNoiseLevel, FFTCLDFBLEN );
            IF( LT_16( sub( st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->cngNoiseLevelExp, shift ), 4 ) )
            {
                shift = sub( st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->cngNoiseLevelExp, 4 );
@@ -4601,11 +4605,11 @@ void ivas_dec_prepare_renderer_fx(
            scale_sig32( st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->cngNoiseLevel, FFTCLDFBLEN, shift ); // Q(31-cngNoiseLevelExp+shift)
            st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->cngNoiseLevelExp = sub( st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->cngNoiseLevelExp, shift );
        }

        ivas_sba_dec_digest_tc_fx( st_ivas, n_render_timeslots, st_ivas->hTcBuffer->n_samples_available );
    }
    ELSE IF( EQ_16( st_ivas->ivas_format, SBA_ISM_FORMAT ) )
    {

        IF( EQ_16( st_ivas->ism_mode, ISM_SBA_MODE_DISC ) )
        {
            ivas_ism_dec_digest_tc_fx( st_ivas );
@@ -4614,6 +4618,8 @@ void ivas_dec_prepare_renderer_fx(
            test();
            test();
            test();
            test();
            test();
            /* delay the objects here for all renderers where it is needed */
            IF(
                (
@@ -4641,7 +4647,7 @@ void ivas_dec_prepare_renderer_fx(

                IF( st_ivas->hSCE[0] )
                {
                    Word16 shift = getScaleFactor32( st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->cngNoiseLevel, FFTCLDFBLEN );
                    shift = getScaleFactor32( st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->cngNoiseLevel, FFTCLDFBLEN );
                    if ( LT_16( sub( st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->cngNoiseLevelExp, shift ), 4 ) )
                    {
                        shift = sub( st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->cngNoiseLevelExp, 4 );
@@ -4658,7 +4664,7 @@ void ivas_dec_prepare_renderer_fx(

            IF( st_ivas->hSCE[0] )
            {
                Word16 shift = getScaleFactor32( st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->cngNoiseLevel, FFTCLDFBLEN );
                shift = getScaleFactor32( st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->cngNoiseLevel, FFTCLDFBLEN );
                if ( LT_16( sub( st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->cngNoiseLevelExp, shift ), 4 ) )
                {
                    shift = sub( st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->cngNoiseLevelExp, 4 );
@@ -4666,6 +4672,7 @@ void ivas_dec_prepare_renderer_fx(
                scale_sig32( st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->cngNoiseLevel, FFTCLDFBLEN, shift ); // Q(31-cngNoiseLevelExp+shift)
                st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->cngNoiseLevelExp = sub( st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->cngNoiseLevelExp, shift );
            }

            ivas_sba_dec_digest_tc_fx( st_ivas, n_render_timeslots, st_ivas->hTcBuffer->n_samples_available );
        }
    }
@@ -4675,6 +4682,7 @@ void ivas_dec_prepare_renderer_fx(
        IF( EQ_32( st_ivas->renderer_type, RENDERER_OMASA_MIX_EXT ) || EQ_32( st_ivas->renderer_type, RENDERER_OMASA_OBJECT_EXT ) )
        {
            ivas_jbm_dec_td_renderers_adapt_subframes( st_ivas );

            IF( st_ivas->hDecoderConfig->Opt_tsm )
            {
                ivas_jbm_masa_sf_to_slot_map( st_ivas, n_render_timeslots );
@@ -4690,7 +4698,7 @@ void ivas_dec_prepare_renderer_fx(

            IF( st_ivas->hSCE[0] )
            {
                Word16 shift = getScaleFactor32( st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->cngNoiseLevel, FFTCLDFBLEN );
                shift = getScaleFactor32( st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->cngNoiseLevel, FFTCLDFBLEN );
                if ( LT_16( sub( st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->cngNoiseLevelExp, shift ), 4 ) )
                {
                    shift = sub( st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->cngNoiseLevelExp, 4 );
@@ -4699,6 +4707,7 @@ void ivas_dec_prepare_renderer_fx(
                st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->cngNoiseLevelExp = sub( st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->cngNoiseLevelExp, shift );
                move16();
            }

            ivas_sba_dec_digest_tc_fx( st_ivas, n_render_timeslots, st_ivas->hTcBuffer->n_samples_available );

            IF( EQ_16( st_ivas->ism_mode, ISM_MASA_MODE_DISC ) )
@@ -4750,6 +4759,7 @@ void ivas_dec_prepare_renderer_fx(
                delay_signal32_fx( st_ivas->hTcBuffer->tc_fx[CPE_CHANNELS + n], st_ivas->hTcBuffer->n_samples_available, st_ivas->hMasaIsmData->delayBuffer_fx[n], st_ivas->hMasaIsmData->delayBuffer_size );
                // TODO: check if tis is a bug in main already
            }

#ifdef OMASA_OBJECT_EDITING
            test();
            IF( EQ_16( st_ivas->ism_mode, ISM_MASA_MODE_DISC ) && EQ_16( st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC ) )
@@ -4784,6 +4794,7 @@ void ivas_dec_prepare_renderer_fx(
            Word16 nchan_out_cov;
            test();
            test();

            IF( EQ_16( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV ) || EQ_16( st_ivas->renderer_type, RENDERER_BINAURAL_FASTCONV_ROOM ) )
            {
                nchan_out_cov = add( st_ivas->hTransSetup.nchan_out_woLFE, st_ivas->hTransSetup.num_lfe );
@@ -4811,7 +4822,7 @@ void ivas_dec_prepare_renderer_fx(

            scale_sig32( st_ivas->hParamMC->proto_matrix_int_fx, st_ivas->hParamMC->proto_matrix_int_len, 1 ); // Q(31-1+1)

            Word16 shift;
            shift;
            FOR( Word16 param_band_idx = 0; param_band_idx < st_ivas->hParamMC->num_param_bands_synth; param_band_idx++ )
            {
                shift = getScaleFactor32( st_ivas->hParamMC->h_output_synthesis_cov_state.cx_old_fx[param_band_idx], s_min( st_ivas->hParamMC->h_output_synthesis_cov_state.cx_old_len, nchan_transport * nchan_transport ) );
@@ -4829,7 +4840,7 @@ void ivas_dec_prepare_renderer_fx(
        {
            IF( st_ivas->hSCE[0] )
            {
                Word16 shift = getScaleFactor32( st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->cngNoiseLevel, FFTCLDFBLEN );
                shift = getScaleFactor32( st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->cngNoiseLevel, FFTCLDFBLEN );
                if ( LT_16( sub( st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->cngNoiseLevelExp, shift ), 4 ) )
                {
                    shift = sub( st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->cngNoiseLevelExp, 4 );
@@ -4838,6 +4849,7 @@ void ivas_dec_prepare_renderer_fx(
                st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->cngNoiseLevelExp = sub( st_ivas->hSCE[0]->hCoreCoder[0]->hFdCngDec->hFdCngCom->cngNoiseLevelExp, shift );
                move16();
            }

            ivas_sba_dec_digest_tc_fx( st_ivas, n_render_timeslots, st_ivas->hTcBuffer->n_samples_available );
        }
    }
+1 −1
Original line number Diff line number Diff line
@@ -333,7 +333,7 @@ ivas_error ivas_osba_render_sf_fx(
void ivas_osba_stereo_add_channels_fx(
    Word32 *tc_fx[],                  /* i  : transport channels                */
    Word32 *output_fx[],              /* i/o: output channels                   */
    const Word16 gain_bed_fx,         /* i  : gain bed value                    */
    const Word32 gain_bed_fx,         /* i  : gain bed value                    */
    const Word16 nchan_out,           /* i  : number of output channels         */
    const Word16 nchan_ism,           /* i  : number of ISM channels            */
    const Word16 ism_mode,            /* i  : ISM mode                          */