Commit bea7b87c authored by multrus's avatar multrus
Browse files

[cleanup] accept SIMPLIFY_SBA_RENDERING_LOGIC

parent 61ec1538
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -146,7 +146,6 @@
/*#define FIX_IVAS_185_MDCT_ST_PLC_FADEOUT*/            /* IVAS-185 fix bug in TCX-PLC fadeout for MDCT-Stereo and improve fadeout by fading to background noise instead of white noise */
/*#define FIX_I1_113*/                                  /* under review : MCT bit distribution optimization for SBA high bitrates*/

#define SIMPLIFY_SBA_RENDERING_LOGIC                    /* SBA rendering maintenance related to ticket #45 */
#define SBA_CLEANING                                    /* SBA maintenance related to ticket #45 */ 

#define DIRAC_DRCT_GAIN_TUNING                          /* issue 64: tuning of DirAC energy-compensation gains */
+0 −21
Original line number Diff line number Diff line
@@ -328,7 +328,6 @@ ivas_error ivas_dec(
        }

        /* Loudspeakers, Ambisonics or Binaural rendering */
#ifdef SIMPLIFY_SBA_RENDERING_LOGIC
        if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC )
        {
            ivas_dirac_dec_binaural( st_ivas, output, nchan_remapped );
@@ -348,26 +347,6 @@ ivas_error ivas_dec(
        {
            ivas_sba_upmixer_renderer( st_ivas, output, nchan_remapped, output_frame ); /* Note: ivas_sba_linear_renderer() or ivas_dirac_dec() are called internally */
        }
#else
        if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_DEC && st_ivas->sba_mode == SBA_MODE_DIRAC )
        {
            ivas_sba_linear_renderer( output, output_frame, nchan_remapped, output_config, st_ivas->hOutSetup, st_ivas->hoa_dec_mtx );
        }
        else if ( st_ivas->renderer_type == RENDERER_DIRAC && st_ivas->sba_mode != SBA_MODE_SPAR )
        {
            ivas_dirac_dec( st_ivas, output, nchan_remapped, NULL, NULL, -1 );
        }
        else if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC )
        {
            ivas_dirac_dec_binaural( st_ivas, output, nchan_remapped );
        }
        else if (
            ( ( st_ivas->renderer_type == RENDERER_DIRAC || st_ivas->renderer_type == RENDERER_SBA_LINEAR_DEC ) && st_ivas->sba_mode == SBA_MODE_SPAR ) ||
            ( ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) ) )
        {
            ivas_sba_upmixer_renderer( st_ivas, output, nchan_remapped, output_frame );
        }
#endif
    }
    else if ( st_ivas->ivas_format == MC_FORMAT )
    {
+0 −29
Original line number Diff line number Diff line
@@ -210,11 +210,7 @@ void ivas_sba_upmixer_renderer(
)
{
    int16_t i, ch, nchan_out;
#ifdef SIMPLIFY_SBA_RENDERING_LOGIC
    float temp;
#else
    float clip, temp;
#endif
    int16_t nchan_internal;

    wmops_sub_start( "ivas_sba_upmixer_renderer" );
@@ -253,47 +249,22 @@ void ivas_sba_upmixer_renderer(
        }
    }

#ifdef SIMPLIFY_SBA_RENDERING_LOGIC
    /* Upmixer + Renderer */
#else
    /* Upmixer */
#endif
    ivas_spar_dec_upmixer( st_ivas, output, nchan_internal, output_frame );

#ifndef SIMPLIFY_SBA_RENDERING_LOGIC
    /* Renderer */
    if ( st_ivas->hDirAC != NULL && st_ivas->renderer_type == RENDERER_DIRAC )
    {
        nchan_out = st_ivas->hDirAC->hOutSetup.nchan_out_woLFE + st_ivas->hDirAC->hOutSetup.num_lfe;
    }
#endif
    if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_DEC )
    {
        ivas_sba_linear_renderer( output, output_frame, st_ivas->hIntSetup.nchan_out_woLFE, st_ivas->hDecoderConfig->output_config, st_ivas->hOutSetup, st_ivas->hoa_dec_mtx );
    }

#ifndef SIMPLIFY_SBA_RENDERING_LOGIC
    clip = 1.0f;
#endif
    for ( ch = 0; ch < nchan_out; ch++ )
    {
        for ( i = 0; i < output_frame; i++ )
        {
#ifndef SIMPLIFY_SBA_RENDERING_LOGIC
            clip = max( clip, fabsf( output[ch][i] ) );
#endif
            output[ch][i] = output[ch][i] * PCM16_TO_FLT_FAC;
        }
    }

#ifndef SIMPLIFY_SBA_RENDERING_LOGIC
#ifdef DEBUGGING
    if ( clip > 1.0f )
    {
        fprintf( stderr, "IVAS Crend Clipped: max gain = %f\n", clip );
    }
#endif
#endif

    wmops_sub_end();