Commit 76499842 authored by vaclav's avatar vaclav
Browse files

port fix

parent 41953b39
Loading
Loading
Loading
Loading
Loading
+1 −8
Original line number Diff line number Diff line
@@ -145,9 +145,6 @@ typedef struct
    char *piOutputFilename;
    bool rtpOutSR;
#endif
#ifdef FIX_1419_MONO_STEREO_UMX
    bool evsMode;
#endif
#ifdef FIX_1318_ROOM_SIZE_CMD_LINE
    IVAS_ROOM_SIZE_T roomSize;
#endif
@@ -965,9 +962,6 @@ static bool parseCmdlIVAS_dec(
    arg->output_Fs = IVAS_MAX_SAMPLING_RATE;
    arg->outputConfig = IVAS_AUDIO_CONFIG_MONO;
    arg->decMode = IVAS_DEC_MODE_IVAS;
#ifdef FIX_1419_MONO_STEREO_UMX
    arg->evsMode = false;
#endif
    arg->quietModeEnabled = false;
    arg->delayCompensationEnabled = true;
    arg->voipMode = false;
@@ -1530,7 +1524,6 @@ static bool parseCmdlIVAS_dec(
#ifdef FIX_1419_MONO_STEREO_UMX
        else if ( strcmp( argv_to_upper, "-EVS" ) == 0 )
        {
            arg->evsMode = true;
            arg->decMode = IVAS_DEC_MODE_EVS;
            i++;
        }
@@ -1625,7 +1618,7 @@ static bool parseCmdlIVAS_dec(
            return false;
        }
#ifdef FIX_1419_MONO_STEREO_UMX
        else if ( arg->non_diegetic_pan_enabled && arg->outputConfig == IVAS_AUDIO_CONFIG_STEREO && arg->evsMode )
        else if ( arg->non_diegetic_pan_enabled && arg->outputConfig == IVAS_AUDIO_CONFIG_STEREO && arg->decMode == IVAS_DEC_MODE_EVS )
        {
            fprintf( stderr, "Error: Both non-diegetic panning and stereo output specified!\n\n" );
            usage_dec();
+10 −3
Original line number Diff line number Diff line
@@ -1126,8 +1126,8 @@ void ivas_mono_stereo_downmix_mcmasa_fx(
);

void ivas_apply_non_diegetic_panning_fx(
    Word32 *input_f_fx,                                         /* i  : non-diegetic object                              */
    Word32 *output_fx[],                                        /* i/o: core-coder transport mono channel/stereo output  */
    Word32 *input_f_fx,                                         /* i  : non-diegetic object (mono channel)               */
    Word32 *output_fx[],                                        /* o  : stereo output channels                           */
    const Word16 non_diegetic_pan_gain_fx,                      /* i  : non-diegetic panning gain                        */
    const Word16 output_frame                                   /* i  : output frame length per channel                  */
);
@@ -3739,7 +3739,14 @@ void ivas_mc2sba_fx(
    const Word16 sba_order,                                     /* i  : Ambisonic (SBA) order                            */
    const Word16 gain_lfe                                       /* i  : gain for LFE, 0 = ignore LFE                     */
);
#ifdef FIX_1419_MONO_STEREO_UMX

void ivas_stereo2sba_fx(
    Word32 *input_fx[],                                         /* i  : core-coder transport stereo channels            */
    Word32 *output_fx[],                                        /* o  : SBA output channels                             */
    const Word16 output_frame                                   /* i  : output frame length per channel                 */
);
#endif
void ivas_param_mc_mc2sba_cldfb_fx(
    IVAS_OUTPUT_SETUP hTransSetup,                                                 /* i  : transported MC Format                                       */
    Word32 *hoa_encoder,                                                           /* i  : HOA3 encoder for the transported MC format                  */
@@ -3892,6 +3899,7 @@ void ivas_set_ism_importance_interformat_fx(
    const Word16 lp_noise_CPE_fx,                               /* i  : LP filtered total noise estimation          */
    Word16 ism_imp[]                                            /* o  : ISM importance flags                        */
);

void ivas_omasa_preProcessStereoTransportsForEditedObjects_fx(
    Decoder_Struct *st_ivas,
    Word32 inRe_fx[][CLDFB_SLOTS_PER_SUBFRAME][CLDFB_NO_CHANNELS_MAX], /*cldfb_buf_q*/
@@ -3901,7 +3909,6 @@ void ivas_omasa_preProcessStereoTransportsForEditedObjects_fx(
    const Word16 subframe
);


void ivas_omasa_decode_masa_to_total_fx(
    UWord16 *bit_stream,
    Word16 *index,
+1 −0
Original line number Diff line number Diff line
@@ -130,6 +130,7 @@
#define FIX_1330_JBM_MEMORY_FIX                         /* VA: basop issue: 2179 fix non-BE difference in FIX_1330_JBM_MEMORY */
#define FIX_1411_IGF_CRASH_BW_SWITCHING                 /* FhG: Fix for issue 1411: fixes crash that can happen for IGF with BW switching and DTX*/
#define FIX_1419_MONO_STEREO_UMX                        /* FhG: fix for issue 1419 : support upmix to all output formats for mono and stereo */
#define FIX_1435_MOVE_STEREO_PANNING                    /* VA: issue 1435: do the EVS stereo panning in the renderer */
#define NONBE_MDCT_ST_DTX_FIX_SUBOPT_SPATIAL_CNG       /* FhG: Fix MDCT-Stereo comfort noise for certain noise types */
#define FIX_1437_LC3PLUS_EXTREND_HIRES                  /* FhG: fix external renderer split bitstream header writing causing a crash for LC3plus High-res mode */
#define NONBE_1412_AVOID_ROUNDING_AZ_ELEV               /* FhG:  Avoid rounding when passing azimuth and elevation to efap_determine_gains() */
+2 −12
Original line number Diff line number Diff line
@@ -1218,6 +1218,7 @@ ivas_error ivas_dec_setup(
     * Initialize decoder in the first good frame based on IVAS format
     * and number of transport channels
     *-------------------------------------------------------------------*/

    test();
    IF( st_ivas->ini_frame == 0 && NE_32( st_ivas->ivas_format, UNDEFINED_FORMAT ) )
    {
@@ -1661,7 +1662,6 @@ ivas_error ivas_init_decoder_front(
     * Allocate and initialize Binaural Renderer configuration handle
     *--------------------------------------------------------------------*/


    test();
    test();
    test();
@@ -1811,14 +1811,6 @@ ivas_error ivas_init_decoder_fx(
        st_ivas->hOutSetup.nchan_out_woLFE = audioCfg2channels( st_ivas->intern_config );
        move16();
    }
#ifdef FIX_1419_MONO_STEREO_UMX

    test();
    IF( EQ_32( st_ivas->ivas_format, MONO_FORMAT ) || EQ_32( st_ivas->ivas_format, STEREO_FORMAT ) )
    {
        st_ivas->transport_config = EQ_32( st_ivas->ivas_format, MONO_FORMAT ) ? IVAS_AUDIO_CONFIG_MONO : IVAS_AUDIO_CONFIG_STEREO;
    }
#endif

    /* Only initialize transport setup if it is used */
    IF( NE_32( st_ivas->transport_config, IVAS_AUDIO_CONFIG_INVALID ) )
@@ -2000,10 +1992,8 @@ ivas_error ivas_init_decoder_fx(
    {
        st_ivas->nchan_transport = CPE_CHANNELS;
        move16();
#ifndef FIX_1419_MONO_STEREO_UMX /* already set now by renderer_select() */
        st_ivas->intern_config = IVAS_AUDIO_CONFIG_STEREO;
        move32();
#endif

        st_ivas->nSCE = 0;
        move16();
@@ -4093,6 +4083,7 @@ static ivas_error doSanityChecks_IVAS(
        {
            return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Incorrect output configuration specified!" );
        }

#ifdef FIX_1419_MONO_STEREO_UMX
        test();
        test();
@@ -4106,7 +4097,6 @@ static ivas_error doSanityChecks_IVAS(
    }
#endif


    test();
    test();
    IF( ( EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) && NE_32( output_Fs, 48000 ) )
+564 −548
Original line number Diff line number Diff line
@@ -1721,13 +1721,23 @@ ivas_error ivas_jbm_dec_render_fx(
    /*----------------------------------------------------------------*
     * Rendering
     *----------------------------------------------------------------*/

#ifdef FIX_1419_MONO_STEREO_UMX
    *nSamplesRendered = s_min( st_ivas->hTcBuffer->n_samples_available, nSamplesAskedLocal );
    move16();
#endif

    test();
#ifdef FIX_1419_MONO_STEREO_UMX
    test();
#endif
    IF( EQ_32( st_ivas->ivas_format, UNDEFINED_FORMAT ) )
    {
        assert( 0 );
    }
    ELSE IF( EQ_32( st_ivas->hTcBuffer->tc_buffer_mode, TC_BUFFER_MODE_BUFFER ) )
    {
#ifndef FIX_1419_MONO_STEREO_UMX
        Word16 slot_size, tmp, e;

        slot_size = st_ivas->hTcBuffer->n_samples_granularity;
@@ -1736,7 +1746,7 @@ ivas_error ivas_jbm_dec_render_fx(
        /* loop for synthesis, assume we always have to render in multiples of 5ms subframes with spills */
        tmp = BASOP_Util_Divide1616_Scale( nSamplesAsked, slot_size, &e );
        tmp = shr( tmp, sub( 15, e ) );

#endif
        ivas_jbm_dec_tc_buffer_playout_fx( st_ivas, nSamplesAskedLocal, nSamplesRendered, p_output_fx );
    }
#ifdef FIX_1419_MONO_STEREO_UMX
@@ -1745,39 +1755,24 @@ ivas_error ivas_jbm_dec_render_fx(
    ELSE IF( EQ_32( st_ivas->ivas_format, STEREO_FORMAT ) )
#endif
        {
#ifdef FIX_1419_MONO_STEREO_UMX
        *nSamplesRendered = s_min( st_ivas->hTcBuffer->n_samples_available, nSamplesAskedLocal );
        move16();
#endif

            /* Rendering */
        IF( EQ_32( st_ivas->renderer_type, RENDERER_MC ) )
        {
            IF( EQ_32( st_ivas->renderer_type, RENDERER_MC ) ){
#ifndef FIX_1419_MONO_STEREO_UMX
                    *nSamplesRendered = s_min( st_ivas->hTcBuffer->n_samples_available, nSamplesAskedLocal );
    move16();
#endif

    ivas_ls_setup_conversion_fx( st_ivas, st_ivas->nchan_transport, *nSamplesRendered, p_tc_fx, p_output_fx );
}
#ifdef FIX_1419_MONO_STEREO_UMX
        ELSE IF( EQ_32( st_ivas->renderer_type, RENDERER_SBA_LINEAR_ENC ) )
        {
            IF( EQ_32( st_ivas->ivas_format, MONO_FORMAT ) )
#ifdef FIX_1435_MOVE_STEREO_PANNING
ELSE IF( EQ_32( st_ivas->renderer_type, RENDERER_NON_DIEGETIC_DOWNMIX ) )
{
                /* routed to W */
                ivas_jbm_dec_tc_buffer_playout_fx( st_ivas, nSamplesAskedLocal, nSamplesRendered, p_output_fx );
    ivas_apply_non_diegetic_panning_fx( p_tc_fx[0], p_output_fx, st_ivas->hDecoderConfig->non_diegetic_pan_gain_fx, *nSamplesRendered );
}
            ELSE IF( EQ_32( st_ivas->ivas_format, STEREO_FORMAT ) )
            {
                FOR( n = 0; n < *nSamplesRendered; n++ )
#endif
#ifdef FIX_1419_MONO_STEREO_UMX
ELSE IF( EQ_32( st_ivas->renderer_type, RENDERER_SBA_LINEAR_ENC ) )
{
                    Word32 tmp;
                    tmp = p_output_fx[0][n];
                    p_output_fx[0][n] = L_shr( L_add( tmp, p_output_fx[1][n] ), 1 ); /* W = 0.5 * ( L + R ) */
                    p_output_fx[1][n] = L_shr( L_sub( tmp, p_output_fx[1][n] ), 1 ); /* Y = 0.5 * ( L - R ) */
                }
            }
    ivas_stereo2sba_fx( p_tc_fx, p_output_fx, *nSamplesRendered );
}
#endif /* FIX_1419_MONO_STEREO_UMX */
}
@@ -1806,9 +1801,10 @@ ivas_error ivas_jbm_dec_render_fx(
    }
    ELSE /* ISM_MODE_DISC */
    {
#ifndef FIX_1419_MONO_STEREO_UMX
        *nSamplesRendered = s_min( st_ivas->hTcBuffer->n_samples_available, nSamplesAskedLocal );
        move16();

#endif
        test();
        test();
        /* Loudspeaker or Ambisonics rendering */
@@ -1989,9 +1985,10 @@ ivas_error ivas_jbm_dec_render_fx(
        }
        ELSE IF( EQ_32( st_ivas->renderer_type, RENDERER_OSBA_STEREO ) )
        {
#ifndef FIX_1419_MONO_STEREO_UMX
            *nSamplesRendered = s_min( st_ivas->hTcBuffer->n_samples_available, nSamplesAskedLocal );
            move16();

#endif
            test();
            /* shift SBA channels to avoid overwrite by ISM upmix in 1 object case and non-TSM unified channel memory*/
            IF( EQ_16( st_ivas->nchan_ism, 1 ) && EQ_16( st_ivas->hDecoderConfig->Opt_tsm, 0 ) )
@@ -2074,8 +2071,10 @@ ivas_error ivas_jbm_dec_render_fx(
    {
        Word16 crendInPlaceRotation = FALSE;
        move16();
#ifndef FIX_1419_MONO_STEREO_UMX
        *nSamplesRendered = s_min( st_ivas->hTcBuffer->n_samples_available, nSamplesAskedLocal );
        move16();
#endif

        test();
        test();
@@ -2170,9 +2169,10 @@ ivas_error ivas_jbm_dec_render_fx(
        }
        ELSE IF( EQ_32( st_ivas->renderer_type, RENDERER_MC ) )
        {
#ifndef FIX_1419_MONO_STEREO_UMX
            *nSamplesRendered = s_min( st_ivas->hTcBuffer->n_samples_available, nSamplesAskedLocal );
            move16();

#endif
            ivas_ls_setup_conversion_fx( st_ivas, st_ivas->nchan_transport, *nSamplesRendered, p_tc_fx, p_output_fx );
        }
        ELSE IF( EQ_32( st_ivas->renderer_type, RENDERER_SBA_LINEAR_ENC ) )
@@ -3120,7 +3120,6 @@ Word16 ivas_jbm_dec_get_num_tc_channels_fx(
    Word32 ivas_total_brate;
    AUDIO_CONFIG output_config;


    IF( EQ_16( st_ivas->renderer_type, RENDERER_DISABLE ) )
    {
        num_tc = st_ivas->hDecoderConfig->nchan_out;
@@ -3140,6 +3139,15 @@ Word16 ivas_jbm_dec_get_num_tc_channels_fx(
    test();
    test();
    test();
#ifdef FIX_1435_MOVE_STEREO_PANNING
    test();
    IF( EQ_32( st_ivas->ivas_format, MONO_FORMAT ) )
    {
        num_tc = 1;
        move16();
    }
    ELSE IF( EQ_32( st_ivas->ivas_format, STEREO_FORMAT ) && EQ_16( st_ivas->hDecoderConfig->nchan_out, 1 ) )
#else
#ifndef FIX_1419_MONO_STEREO_UMX /* since we support more output formats for mono, this is no longer sensible; leave it at the default from above */
    IF( EQ_16( st_ivas->ivas_format, MONO_FORMAT ) )
    {
@@ -3149,6 +3157,7 @@ Word16 ivas_jbm_dec_get_num_tc_channels_fx(
    ELSE IF( EQ_16( st_ivas->ivas_format, STEREO_FORMAT ) && EQ_16( st_ivas->hDecoderConfig->nchan_out, 1 ) )
#else
    IF( EQ_16( st_ivas->ivas_format, STEREO_FORMAT ) && EQ_16( st_ivas->hDecoderConfig->nchan_out, 1 ) )
#endif
#endif
    {
        num_tc = 1;
@@ -3291,11 +3300,13 @@ Word16 ivas_jbm_dec_get_num_tc_channels_fx(
            }
        }
    }
#ifndef FIX_1435_MOVE_STEREO_PANNING
    ELSE IF( EQ_16( st_ivas->ivas_format, MONO_FORMAT ) && EQ_16( st_ivas->renderer_type, RENDERER_NON_DIEGETIC_DOWNMIX ) )
    {
        num_tc = MAX_OUTPUT_CHANNELS_IN_DIEGETIC_PAN;
        move16();
    }
#endif

    return num_tc;
}
@@ -3828,6 +3839,9 @@ TC_BUFFER_MODE ivas_jbm_dec_get_tc_buffer_mode_fx(
            buffer_mode = TC_BUFFER_MODE_BUFFER;
            move16();
            BREAK;
#ifdef FIX_1435_MOVE_STEREO_PANNING
        case RENDERER_NON_DIEGETIC_DOWNMIX:
#endif
        case RENDERER_TD_PANNING:
        case RENDERER_BINAURAL_OBJECTS_TD:
        case RENDERER_BINAURAL_FASTCONV:
@@ -3846,6 +3860,7 @@ TC_BUFFER_MODE ivas_jbm_dec_get_tc_buffer_mode_fx(
            buffer_mode = TC_BUFFER_MODE_RENDERER;
            move16();
            BREAK;
#ifndef FIX_1435_MOVE_STEREO_PANNING
        case RENDERER_NON_DIEGETIC_DOWNMIX:
            IF( EQ_32( st_ivas->ivas_format, MONO_FORMAT ) )
            {
@@ -3858,6 +3873,7 @@ TC_BUFFER_MODE ivas_jbm_dec_get_tc_buffer_mode_fx(
                move16();
            }
            break;
#endif
        case RENDERER_MC_PARAMMC:
            IF( EQ_32( st_ivas->hParamMC->synthesis_conf, PARAM_MC_SYNTH_MONO_STEREO ) )
            {
Loading