Commit 1f4de7d9 authored by multrus's avatar multrus
Browse files

[cleanup] accept FIX_1435_MOVE_STEREO_PANNING

parent f9b8d5b2
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -85,7 +85,6 @@
#define FIX_1999_TEMPORARY_DISABLE_DIST_ATT_CHECK       /* Eri: Issue 1999: Range check on float values of distance attenuation, while the float values are not propagated to this function. The test is not correct, but configurable distance attenuation is not used in Characterization.*/
#define TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR      /* FhG: Temporary workaround for incorrect implementation of decoder flush with split rendering */
#define NONBE_1122_KEEP_EVS_MODE_UNCHANGED              /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR.  */
#define FIX_1435_MOVE_STEREO_PANNING                    /* VA: issue 1435: do the EVS stereo panning in the renderer */
#define FIX_2249_MEMORY_LEAK_IN_SBA                     /* OR : issue 2249 : Memory leak in SBA to BINAURAL_ROOM_REVERB with memory instrumentation */
#define FIX_2252_SCALING_SAVE_HB_SYNTH                  /* VA: issue 2252: fix use-of-uninit-value in save_hb_synth_fx[] scaling in FOA decoding with bitstream that starts with an SID */
#define FIX_2248_EVS_ASSERT                             /* VA: Include _sat in an EVS related part of the code */
+0 −39
Original line number Diff line number Diff line
@@ -1844,16 +1844,6 @@ ivas_error ivas_dec_render_fx(
    }
    ELSE IF( EQ_32( st_ivas->hTcBuffer->tc_buffer_mode, TC_BUFFER_MODE_BUFFER ) )
    {
#ifndef FIX_1435_MOVE_STEREO_PANNING
        Word16 slot_size, tmp, e;

        slot_size = st_ivas->hTcBuffer->n_samples_granularity;
        move16();

        /* 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_dec_tc_buffer_playout_fx( st_ivas, nSamplesAskedLocal, nSamplesRendered, p_output_fx );
    }
    ELSE IF( EQ_32( st_ivas->ivas_format, MONO_FORMAT ) || EQ_32( st_ivas->ivas_format, STEREO_FORMAT ) )
@@ -1863,12 +1853,10 @@ ivas_error ivas_dec_render_fx(
        {
            ivas_ls_setup_conversion_fx( st_ivas, st_ivas->nchan_transport, *nSamplesRendered, p_tc_fx, p_output_fx );
        }
#ifdef FIX_1435_MOVE_STEREO_PANNING
        ELSE IF( EQ_32( st_ivas->renderer_type, RENDERER_NON_DIEGETIC_DOWNMIX ) )
        {
            ivas_apply_non_diegetic_panning_fx( p_tc_fx[0], p_output_fx, st_ivas->hDecoderConfig->non_diegetic_pan_gain_fx, *nSamplesRendered );
        }
#endif
        ELSE IF( EQ_32( st_ivas->renderer_type, RENDERER_SBA_LINEAR_ENC ) )
        {
#ifdef FIX_1454_FIX_STEREO_TO_FOA_JBM
@@ -3232,7 +3220,6 @@ Word16 ivas_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 ) )
    {
@@ -3240,9 +3227,6 @@ Word16 ivas_dec_get_num_tc_channels_fx(
        move16();
    }
    ELSE IF( EQ_32( 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
    {
        num_tc = 1;
        move16();
@@ -3383,13 +3367,6 @@ Word16 ivas_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;
}
@@ -3920,9 +3897,7 @@ TC_BUFFER_MODE ivas_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:
@@ -3941,20 +3916,6 @@ TC_BUFFER_MODE ivas_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 ) )
            {
                buffer_mode = TC_BUFFER_MODE_BUFFER;
                move16();
            }
            ELSE
            {
                buffer_mode = TC_BUFFER_MODE_RENDERER;
                move16();
            }
            break;
#endif
        case RENDERER_MC_PARAMMC:
            IF( EQ_32( st_ivas->hParamMC->synthesis_conf, PARAM_MC_SYNTH_MONO_STEREO ) )
            {
+0 −33
Original line number Diff line number Diff line
@@ -283,22 +283,14 @@ void ivas_renderer_select(
     * Non-binaural rendering configurations
     *-----------------------------------------------------------------*/

#ifdef FIX_1435_MOVE_STEREO_PANNING
    ELSE IF( EQ_32( st_ivas->ivas_format, MONO_FORMAT ) || EQ_32( st_ivas->ivas_format, STEREO_FORMAT ) )
#else
    ELSE IF( EQ_32( st_ivas->ivas_format, MONO_FORMAT ) )
#endif
    {
        test();
        test();
        test();
        test();
        test();
#ifdef FIX_1435_MOVE_STEREO_PANNING
        IF( EQ_32( st_ivas->ivas_format, MONO_FORMAT ) && EQ_32( output_config, IVAS_AUDIO_CONFIG_STEREO ) )
#else
        IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_STEREO ) )
#endif
        {
            *renderer_type = RENDERER_NON_DIEGETIC_DOWNMIX;
            move16();
@@ -308,38 +300,13 @@ void ivas_renderer_select(
            *renderer_type = RENDERER_MC;
            move16();
        }
#ifdef FIX_1435_MOVE_STEREO_PANNING
        ELSE IF( EQ_32( st_ivas->ivas_format, STEREO_FORMAT ) &&
                 ( EQ_32( output_config, IVAS_AUDIO_CONFIG_FOA ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_HOA2 ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_HOA3 ) ) )
        {
            *renderer_type = RENDERER_SBA_LINEAR_ENC;
            move16();
        }
#endif
    }
#ifndef FIX_1435_MOVE_STEREO_PANNING
    ELSE IF( EQ_32( st_ivas->ivas_format, STEREO_FORMAT ) )
    {
        test();
        test();
        test();
        test();
        test();
        test();
        test();
        test();
        IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_FOA ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_HOA2 ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_HOA3 ) )
        {
            *renderer_type = RENDERER_SBA_LINEAR_ENC;
            move16();
        }
        ELSE IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_5_1 ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_5_1_2 ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_5_1_4 ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_7_1 ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_7_1_4 ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_LS_CUSTOM ) )
        {
            *renderer_type = RENDERER_MC;
            move16();
        }
    }
#endif
    ELSE IF( EQ_32( st_ivas->ivas_format, ISM_FORMAT ) )
    {
        test();
+0 −4
Original line number Diff line number Diff line
@@ -690,11 +690,7 @@ UWord8 apa_exec_fx(
)
{
    UWord16 i;
#ifdef FIX_1435_MOVE_STEREO_PANNING
    Word16 frm_in[APA_BUF_PER_CHANNEL]; /* NOTE: this buffer could be smaller if alocated dynamically based on the actual sampling rate */
#else
    Word16 frm_in[CPE_CHANNELS * APA_BUF / APA_MAX_NUM_CHANNELS]; /* in EVS, 2 output channels */ /* NOTE: this buffer could be smaller if alocated dynamically based on the actual sampling rate and number of channels */
#endif
    UWord16 l_frm_out;
    Word16 l_rem;
    Word32 dl_scaled, dl_copied, l_frm_out_target;
+0 −42
Original line number Diff line number Diff line
@@ -1637,18 +1637,7 @@ static ivas_error ivas_dec_setup_all(

    IF( EQ_16( (Word16) hIvasDec->mode, IVAS_DEC_MODE_EVS ) )
    {
#ifdef FIX_1435_MOVE_STEREO_PANNING
        *nTransportChannels = 1;
#else
        IF( EQ_16( (Word16) hIvasDec->st_ivas->renderer_type, RENDERER_NON_DIEGETIC_DOWNMIX ) )
        {
            *nTransportChannels = MAX_OUTPUT_CHANNELS_IN_DIEGETIC_PAN;
        }
        ELSE
        {
            *nTransportChannels = 1;
        }
#endif
        move16();
    }
    ELSE
@@ -3852,11 +3841,7 @@ static ivas_error apa_exec_evs_wrapper(
{
    Word16 ch;
    UWord16 apa_buff_len;
#ifdef FIX_1435_MOVE_STEREO_PANNING
    Word16 tmp_apaExecBuffer[APA_BUF_PER_CHANNEL];
#else
    Word16 tmp_apaExecBuffer[CPE_CHANNELS * APA_BUF / APA_MAX_NUM_CHANNELS]; /* in EVS, 2 output channels */
#endif
    DECODER_TC_BUFFER_HANDLE hTcBuffer;

    test();
@@ -5645,14 +5630,8 @@ static ivas_error evs_dec_main_fx(
    Decoder_Struct *st_ivas )
{
    DEC_CORE_HANDLE *hCoreCoder;
#ifndef FIX_1435_MOVE_STEREO_PANNING
    Word16 mixer_left_fx, mixer_right_fx;
    Word32 *p_output_fx[MAX_TRANSPORT_CHANNELS];
    Word16 ch, i, nOutSamples;
#else
    Word32 *p_output_fx[1];
    Word16 i, nOutSamples;
#endif
    Word16 output_16[L_FRAME48k];
    ivas_error error;

@@ -5666,18 +5645,7 @@ static ivas_error evs_dec_main_fx(

    mdct_switching_dec_fx( hCoreCoder[0] );

#ifdef FIX_1435_MOVE_STEREO_PANNING
    p_output_fx[0] = st_ivas->p_output_fx[0];
#else
    FOR( ch = 0; ch < MAX_TRANSPORT_CHANNELS; ch++ )
    {
        p_output_fx[ch] = st_ivas->p_output_fx[ch]; // Q0
        IF( p_output_fx[ch] != NULL )
        {
            set_zero_fx( p_output_fx[ch], L_FRAME48k );
        }
    }
#endif

    /* run the main EVS decoding routine */
    IF( EQ_16( hCoreCoder[0]->codec_mode, MODE1 ) )
@@ -5729,16 +5697,6 @@ static ivas_error evs_dec_main_fx(

    st_ivas->BER_detect = hCoreCoder[0]->BER_detect;
    move16();
#ifndef FIX_1435_MOVE_STEREO_PANNING
    IF( EQ_16( st_ivas->renderer_type, RENDERER_NON_DIEGETIC_DOWNMIX ) )
    {
        mixer_left_fx = add( shr( st_ivas->hDecoderConfig->non_diegetic_pan_gain_fx, Q1 ), ONE_IN_Q14 ); // Q14
        mixer_right_fx = sub( MAX16B, mixer_left_fx );

        v_multc_fx_16( p_output_fx[0], mixer_right_fx, p_output_fx[1], nOutSamples ); /* Q11 */
        v_multc_fx_16( p_output_fx[0], mixer_left_fx, p_output_fx[0], nOutSamples );  /* Q11 */
    }
#endif

    /*if ( st_ivas->hDecoderConfig->Opt_tsm && st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_MONO )*/
    {