Commit 7b032eb7 authored by Dominik Weckbecker's avatar Dominik Weckbecker 💬
Browse files

Merge branch 'main' into 527-coding-of-mono-signal-embedded-in-ambisonic-input

parents ad4cc8e9 d7e97f1f
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -164,7 +164,7 @@
#define FIX_470_MASA_JBM_EXT                            /* Nokia: Issue 470, fix MASA EXT output with JBM */
#define ISM_FB                                          /* issue 556: change SWB to FB coding in 1ISM at 24.4 kbps */
#define FIX_558_PLC_DISCONT                             /* FhG: issue 558: fix discontinuities in DFT Stereo when switching from TCX concealment to ACELP */

#define FIX_564                                         /* Nokia: Issue 564: Fix gains in JBM path for SBA with parametric binaural renderer */

#define FIX_527_SBA_MONO_INPUT                          /* FhG: fix issue 527, artifacts in mono signals coded in SBA mode */
/*#define FIX_527_MONO_HEURISTICS*/
+5 −0
Original line number Diff line number Diff line
@@ -403,6 +403,10 @@ ivas_error ivas_dec(
        }
        else if ( st_ivas->ivas_format == SBA_FORMAT && ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) )
        {
#ifdef FIX_564
            /* loudness correction */
            ivas_dirac_dec_binaural_gain( output, nchan_remapped, output_frame );
#else
            float gain;

            if ( nchan_remapped == 1 )
@@ -418,6 +422,7 @@ ivas_error ivas_dec(
            {
                v_multc( output[n], gain, output[n], output_frame );
            }
#endif
        }

        /* Loudspeakers, Ambisonics or Binaural rendering */
+5 −0
Original line number Diff line number Diff line
@@ -304,12 +304,17 @@ ivas_error ivas_jbm_dec_tc(
        }
        else if ( st_ivas->ivas_format == SBA_FORMAT && ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM ) )
        {
#ifdef FIX_564
            /* loudness correction */
            ivas_dirac_dec_binaural_gain( output, nchan_remapped, output_frame );
#else
            float gain = 0.8414f; /* Todo: Temporary gain for roughly matching the loudness. To be tuned later together with other outputs. Also, this is not inline with ivas_dec() */

            for ( n = 0; n < nchan_remapped; n++ )
            {
                v_multc( output[n], gain, output[n], output_frame );
            }
#endif
        }
    }
    else if ( st_ivas->ivas_format == MC_FORMAT )
+35 −0
Original line number Diff line number Diff line
@@ -408,6 +408,41 @@ void ivas_dirac_dec_binaural_render(
}


#ifdef FIX_564
/*-------------------------------------------------------------------------
 * ivas_dirac_dec_binaural_gain()
 *
 * loudness correction for parametric binaural renderer
 *------------------------------------------------------------------------*/

void ivas_dirac_dec_binaural_gain(
    float output[][L_FRAME48k],   /* i/o: synthesized core-coder transport channels/DirAC output    */
    const int16_t nchan_remapped, /* i  : num channels after remapping of TCs                       */
    const int16_t output_frame    /* i  : output frame length                                       */
)
{
    int16_t n;
    float gain;

    if ( nchan_remapped == 1 )
    {
        gain = 1.4454f;
    }
    else
    {
        gain = 1.3657f;
    }

    for ( n = 0; n < nchan_remapped; n++ )
    {
        v_multc( output[n], gain, output[n], output_frame );
    }

    return;
}
#endif


/*-------------------------------------------------------------------------
 * ivas_dirac_dec_binaural()
 *
+9 −0
Original line number Diff line number Diff line
@@ -149,6 +149,15 @@ ivas_error ivas_sba_get_hoa_dec_matrix(
    const int16_t ambisonics_order                              /* i  : Ambisonics order                        */
);

#ifdef FIX_564

void ivas_dirac_dec_binaural_gain(
    float output[][L_FRAME48k],                                 /* i/o: synthesized core-coder transport channels/DirAC output  */
    const int16_t nchan_remapped,                               /* i  : num channels after remapping of TCs                     */
    const int16_t output_frame                                  /* i  : output frame length                                     */
);
#endif

void ivas_dirac_dec_binaural(
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder structure                                  */
    COMBINED_ORIENTATION_HANDLE hCombinedOrientationData,       /* i  : combined orientation handle                             */