Commit d9f51f44 authored by Archit Tamarapu's avatar Archit Tamarapu
Browse files

[fix] gain application for OSBA and lower bitrate SBA BINAURAL_ROOM_REVERB rendering

parent d4d62a39
Loading
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -343,10 +343,13 @@ ivas_error ivas_dec_render(
        }
#ifdef FIX_1521_SBA_LOUDNESS_BINAURAL
        if ( st_ivas->ivas_format == SBA_FORMAT &&
             ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV ) )
             ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC ||
               st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ||
               st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV ) )
        {
            /* loudness correction for SBA binaural rendering */
            for ( n = 0; n < BINAURAL_CHANNELS; n++ )
            nchan_out_syn_output = ( st_ivas->hSplitBinRend != NULL ) ? st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses * BINAURAL_CHANNELS : BINAURAL_CHANNELS;
            for ( n = 0; n < nchan_out_syn_output; n++ )
            {
                v_multc( p_output[n], INV_SQRT2, p_output[n], *nSamplesRendered );
            }
+16 −2
Original line number Diff line number Diff line
@@ -910,11 +910,25 @@ void ivas_sba_dirac_stereo_dec(
    synchro_synthesis( st_ivas->hDecoderConfig->ivas_total_brate, hCPE, output, output_frame, 1 /*st_ivas->sba_dirac_stereo_flag*/ );

    /* output scaling */
#ifdef FIX_1521_SBA_LOUDNESS_STEREO
    if ( !sba_mono_flag )
#else
    if ( !sba_mono_flag && !( st_ivas->ivas_format == SBA_ISM_FORMAT && st_ivas->ism_mode == ISM_MODE_NONE ) )
#endif
    {
#ifdef FIX_1521_SBA_LOUDNESS_STEREO
        if ( st_ivas->ivas_format == SBA_ISM_FORMAT && st_ivas->ism_mode == ISM_MODE_NONE )
        {
            /* low bitrate OSBA needs a makeup gain of 2.f to compensate for the encoder side
                INV_SQRT2 * 2 = SQRT2  */
            v_multc( output[0], SQRT2, output[0], output_frame );
            v_multc( output[1], SQRT2, output[1], output_frame );
        }
        else
        {
            v_multc( output[0], INV_SQRT2, output[0], output_frame );
            v_multc( output[1], INV_SQRT2, output[1], output_frame );
        }
#else
        v_multc( output[0], 0.5f, output[0], output_frame );
        v_multc( output[1], 0.5f, output[1], output_frame );