Commit fc031450 authored by Tapani Pihlajakuja's avatar Tapani Pihlajakuja
Browse files

Merge remote-tracking branch 'origin/main' into...

Merge remote-tracking branch 'origin/main' into 2149_basop_port_mr_2268_fix_object_editing_issues_remainders
parents d433c626 43b7b28d
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -184,7 +184,7 @@ target_include_directories(lib_util PRIVATE lib_lc3plus lib_isar)

if(NOT WMOPS)
  add_executable(ivas_lc3plus_unit_test ${CMAKE_SOURCE_DIR}/scripts/split_rendering/lc3plus_basop/ivas_lc3plus_unit_test.c)
  target_link_libraries(ivas_lc3plus_unit_test lib_rend lib_dec lib_util lib_basop lib_com lib_debug lib_isar)
  target_link_libraries(ivas_lc3plus_unit_test lib_rend lib_dec lib_util lib_com lib_basop lib_debug lib_isar)
endif()

file(GLOB libISARSrcs "lib_isar/*.c")
+11 −11
Original line number Diff line number Diff line
@@ -109,19 +109,20 @@
    <ClCompile Include="..\lib_lc3plus\basop_mpy_lc3plus.c" />
    <ClCompile Include="..\lib_lc3plus\basop_util_lc3plus.c" />
    <ClCompile Include="..\lib_lc3plus\constants.c" />
    <ClCompile Include="..\lib_lc3plus\com_entropy.c" />
    <ClCompile Include="..\lib_lc3plus\cutoff_bandwidth.c" />
    <ClCompile Include="..\lib_lc3plus\dct2_fx.c" />
    <ClCompile Include="..\lib_lc3plus\dct4_fx.c" />
    <ClCompile Include="..\lib_lc3plus\dec_entropy.c" />
    <ClCompile Include="..\lib_lc3plus\dec_lc3.c" />
    <ClCompile Include="..\lib_lc3plus\dec_lc3plus.c" />
    <ClCompile Include="..\lib_lc3plus\detect_cutoff_warped_fx.c" />
    <ClCompile Include="..\lib_lc3plus\dynmem.c" />
    <ClCompile Include="..\lib_lc3plus\enc_entropy.c" />
    <ClCompile Include="..\lib_lc3plus\enc_lc3.c" />
    <ClCompile Include="..\lib_lc3plus\enc_lc3plus.c" />
    <ClCompile Include="..\lib_lc3plus\estimate_global_gain_fx.c" />
    <ClCompile Include="..\lib_lc3plus\fft_lc3plus.c" />
    <ClCompile Include="..\lib_lc3plus\imdct_fx.c" />
    <ClCompile Include="..\lib_lc3plus\lc3.c" />
    <ClCompile Include="..\lib_lc3plus\lc3plus.c" />
    <ClCompile Include="..\lib_lc3plus\levinson_fx.c" />
    <ClCompile Include="..\lib_lc3plus\ltpf_coder_fx.c" />
    <ClCompile Include="..\lib_lc3plus\ltpf_decoder_fx.c" />
@@ -166,8 +167,9 @@
    <ClCompile Include="..\lib_lc3plus\residual_decoding_fx.c" />
    <ClCompile Include="..\lib_lc3plus\rom_basop_util_lc3plus.c" />
    <ClCompile Include="..\lib_lc3plus\scale_signal24_fx.c" />
    <ClCompile Include="..\lib_lc3plus\setup_dec_lc3.c" />
    <ClCompile Include="..\lib_lc3plus\setup_enc_lc3.c" />
    <ClCompile Include="..\lib_lc3plus\setup_com_lc3plus.c" />
    <ClCompile Include="..\lib_lc3plus\setup_dec_lc3plus.c" />
    <ClCompile Include="..\lib_lc3plus\setup_enc_lc3plus.c" />
    <ClCompile Include="..\lib_lc3plus\sns_compute_scf_fx.c" />
    <ClCompile Include="..\lib_lc3plus\sns_interpolate_scf_fx.c" />
    <ClCompile Include="..\lib_lc3plus\sns_quantize_scf_fx.c" />
@@ -181,13 +183,11 @@
    <ClInclude Include="..\lib_lc3plus\defines.h" />
    <ClInclude Include="..\lib_lc3plus\dynmem.h" />
    <ClInclude Include="..\lib_lc3plus\functions.h" />
    <ClInclude Include="..\lib_lc3plus\lc3.h" />
    <ClInclude Include="..\lib_lc3plus\lc3plus.h" />
    <ClInclude Include="..\lib_lc3plus\license.h" />
    <ClInclude Include="..\lib_lc3plus\rom_basop_util_lc3plus.h" />
    <ClInclude Include="..\lib_lc3plus\setup_dec_lc3.h" />
    <ClInclude Include="..\lib_lc3plus\setup_enc_lc3.h" />
    <ClInclude Include="..\lib_lc3plus\tinywavein_c.h" />
    <ClInclude Include="..\lib_lc3plus\tinywaveout_c.h" />
    <ClInclude Include="..\lib_lc3plus\setup_dec_lc3plus.h" />
    <ClInclude Include="..\lib_lc3plus\setup_enc_lc3plus.h" />
  </ItemGroup>
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
  <ImportGroup Label="ExtensionTargets">
+1 −1
Original line number Diff line number Diff line
@@ -6239,7 +6239,7 @@ TC_BUFFER_MODE ivas_jbm_dec_get_tc_buffer_mode_fx(
Word16 ivas_jbm_dec_get_render_granularity_fx(
    const RENDERER_TYPE renderer_type,                          /* i  : renderer type                                               */
    const RENDERER_TYPE renderer_type_sec,                      /* i  : secondary renderer type                                     */
    const int32_t output_Fs                                     /* i  : sampling rate                                               */
    const Word32 output_Fs                                      /* i  : sampling rate                                               */
);

ivas_error ivas_jbm_dec_tc_buffer_open_fx(
+5 −0
Original line number Diff line number Diff line
@@ -86,6 +86,10 @@
#define FIX_2166_ASSERT_OSBA_PLC_STEREO_OUT                  /* FhG: fix for issue 2166 - add missing averaging factor 0.5 in for the sum of energies in function stereo_dft_dmx_swb_nrg_fx()*/

#define FIX_1793_DEC_MC_TO_MONO_SCALING_ISSUE                /* FhG: Use dynamic Q factor for synth_fx and synthFB_fx to prevent overflow */
#define FIX_2082_FP_LEFTOVERS_OMASA_DEC                      /* Nokia: fix for issue 2082, cleaning remaining floating point code */
#define FIX_2174_JBM_BASOP_ALIGNMENT                         /* VoiceAge, Nokia: Fixes to JBM BASOP implementation and alignment to float */


/* ################### End FIXES switches ########################### */

/* #################### Start BASOP porting switches ############################ */
@@ -120,6 +124,7 @@
#define NONBE_1359_FIX_IVASREND_OMASA_BINAURAL_LOUDNESS /* Nokia: issue 1339: Apply scaling to the object-part of OMASA for binaural rendering in IVAS_rend. */
#define NONBE_1362_FIX_OMASA_TO_MASA1_RENDERING         /* Nokia: Fix OMASA to MASA1 rendering in IVAS_rend */
#define FIX_1383_HEAD_TRACK_SANITIZER                   /* Nok: issue 1383: Fix head tracking struc values reading in renderer */
#define FIX_1411_IGF_CRASH_BW_SWITCHING                 /* FhG: Fix for issue 1411: fixes crash that can happen for IGF with BW switching and DTX*/

// object-editing feature porting
#define TMP_FIX_SPLIT_REND                              // temporary fix to split-rendering (it follows the later state of the framework but it is needed now because of current test-conditions)
+28 −12
Original line number Diff line number Diff line
@@ -1090,8 +1090,6 @@ ivas_error ivas_jbm_dec_tc_fx(
    }
    ELSE IF( EQ_32( st_ivas->ivas_format, MC_FORMAT ) )
    {

        // st = (st_ivas->nSCE > 0) ? st_ivas->hSCE[0]->hCoreCoder[0] : st_ivas->hCPE[0]->hCoreCoder[0];
        IF( st_ivas->nSCE > 0 )
        {
            st = st_ivas->hSCE[0]->hCoreCoder[0];
@@ -1111,6 +1109,7 @@ ivas_error ivas_jbm_dec_tc_fx(
            {
                return error;
            }

            /* HP filtering */
            FOR( n = 0; n < st_ivas->nchan_transport; n++ )
            {
@@ -1169,6 +1168,7 @@ ivas_error ivas_jbm_dec_tc_fx(
            {
                return error;
            }

            /* HP filtering */
            FOR( n = 0; n < st_ivas->nchan_transport; n++ )
            {
@@ -1258,7 +1258,6 @@ ivas_error ivas_jbm_dec_tc_fx(
            }

            /* read McMASA parameters from the bitstream */

            IF( NE_32( ( error = ivas_masa_decode_fx( st_ivas, st, &nb_bits_metadata[0] ) ), IVAS_ERR_OK ) )
            {
                return error;
@@ -1285,13 +1284,12 @@ ivas_error ivas_jbm_dec_tc_fx(
                move16();

                /* Decode the separated channel to output[n] to be combined with the synthesized channels */

                set32_fx( p_output_fx[n], 0, L_FRAME48k );

                IF( NE_32( ( error = ivas_sce_dec_fx( st_ivas, 0, &p_output_fx[n], output_frame, 0 ) ), IVAS_ERR_OK ) )
                {
                    return error;
                }

                test();
                test();
                test();
@@ -1326,7 +1324,6 @@ ivas_error ivas_jbm_dec_tc_fx(
                }
                ELSE IF( EQ_16( st_ivas->nCPE, 1 ) )
                {

                    IF( NE_32( ( error = ivas_cpe_dec_fx( st_ivas, 0, &p_output_fx[0], output_frame, nb_bits_metadata[0] ) ), IVAS_ERR_OK ) )
                    {
                        return error;
@@ -1675,7 +1672,7 @@ void ivas_jbm_dec_feed_tc_to_renderer_fx(
    }
    ELSE IF( EQ_32( st_ivas->ivas_format, MC_FORMAT ) && EQ_32( st_ivas->mc_mode, MC_MODE_PARAMMC ) && EQ_32( hTcBuffer->tc_buffer_mode, TC_BUFFER_MODE_RENDERER ) )
    {
        ivas_param_mc_dec_digest_tc_fx( st_ivas, (uint8_t) n_render_timeslots, p_data_fx, Q11 );
        ivas_param_mc_dec_digest_tc_fx( st_ivas, (UWord8) n_render_timeslots, p_data_fx, Q11 );
    }

    hTcBuffer->n_samples_rendered = 0;
@@ -2549,7 +2546,11 @@ ivas_error ivas_jbm_dec_flush_renderer_fx(
        {
            /* move it at the beginning of the TC buffer with zero padding */
            Copy32( hTcBuffer->tc_buffer_old_fx[ch_idx], hTcBuffer->tc_fx[ch_idx], n_samples_to_render );
#ifdef FIX_2174_JBM_BASOP_ALIGNMENT
            set_zero_fx( hTcBuffer->tc_fx[ch_idx] + n_samples_to_render, sub( hTcBuffer->n_samples_granularity, n_samples_to_render ) );
#else
            set_zero_fx( hTcBuffer->tc_fx[ch_idx] + n_samples_to_render, hTcBuffer->n_samples_granularity - n_samples_to_render );
#endif
        }
#else
        /* render what is still there with zero padding */
@@ -2926,12 +2927,13 @@ void ivas_jbm_dec_get_adapted_linear_interpolator_fx(
    }
    ELSE
    {
        set16_fx( interpolator_fx, 0, idx + 1 );
        set16_fx( interpolator_fx, 0, add( idx, 1 ) );
    }

    return;
}


/*--------------------------------------------------------------------------*
 * ivas_jbm_dec_get_adapted_subframes()
 *
@@ -2948,6 +2950,7 @@ void ivas_jbm_dec_get_adapted_subframes(
    UWord16 nCldfbSlotsLocal = nCldfbTs;
    move16();
    Word16 temp, temp_e;

    /* get last subframe size from previous frame, determine how many slots have to be processed
               in the first subframe (i.e. potential leftover of a 5ms subframe) */
    nSlotsInFirstSubframe = ( sub( PARAM_MC_MAX_NSLOTS_IN_SUBFRAME, subframe_nbslots[*nb_subframes - 1] ) );
@@ -2983,6 +2986,8 @@ void ivas_jbm_dec_get_adapted_subframes(

    return;
}


/*--------------------------------------------------------------------------*
 * ivas_jbm_dec_get_adapted_linear_interpolator()
 *
@@ -3313,7 +3318,7 @@ Word16 ivas_jbm_dec_get_num_tc_channels_fx(
Word16 ivas_jbm_dec_get_render_granularity_fx(
    const RENDERER_TYPE renderer_type,     /* i  : renderer type            */
    const RENDERER_TYPE renderer_type_sec, /* i  : secondary renderer type  */
    const int32_t output_Fs                /* i  : sampling rate            */
    const Word32 output_Fs                 /* i  : sampling rate            */
)
{
    Word16 render_granularity;
@@ -3350,8 +3355,8 @@ Word16 ivas_jbm_dec_get_render_granularity_fx(

static ivas_error ivas_jbm_dec_tc_audio_allocate_fx(
    DECODER_TC_BUFFER_HANDLE hTcBuffer, /* i/o: JBM TSM buffer handle   */
    const int32_t output_Fs,            /* i  : output sampling rate    */
    const int16_t Opt_tsm               /* i  : TSM option flag         */
    const Word32 output_Fs,             /* i  : output sampling rate    */
    const Word16 Opt_tsm                /* i  : TSM option flag         */
)
{
    Word16 nsamp_to_allocate;
@@ -3360,7 +3365,11 @@ static ivas_error ivas_jbm_dec_tc_audio_allocate_fx(
    IF( Opt_tsm )
    {
        n_samp_full = NS2SA_FX2( output_Fs, MAX_JBM_L_FRAME_NS );
#ifdef FIX_2174_JBM_BASOP_ALIGNMENT
        n_samp_residual = sub( hTcBuffer->n_samples_granularity, 1 );
#else
        n_samp_residual = add( hTcBuffer->n_samples_granularity, 1 );
#endif
    }
    ELSE
    {
@@ -3369,7 +3378,11 @@ static ivas_error ivas_jbm_dec_tc_audio_allocate_fx(
        move16();
    }

#ifdef FIX_2174_JBM_BASOP_ALIGNMENT
    nsamp_to_allocate = imult1616( s_max( hTcBuffer->nchan_transport_jbm, hTcBuffer->nchan_buffer_full ), n_samp_full );
#else
    nsamp_to_allocate = s_max( hTcBuffer->nchan_transport_jbm, hTcBuffer->nchan_buffer_full ) * n_samp_full;
#endif

    IF( Opt_tsm )
    {
@@ -3382,7 +3395,11 @@ static ivas_error ivas_jbm_dec_tc_audio_allocate_fx(

        offset = 0;
        move16();
#ifdef FIX_2174_JBM_BASOP_ALIGNMENT
        FOR( ch_idx = 0; ch_idx < s_max( hTcBuffer->nchan_transport_jbm, hTcBuffer->nchan_buffer_full ); ch_idx++ )
#else
        FOR( ch_idx = 0; ch_idx < max( hTcBuffer->nchan_transport_jbm, hTcBuffer->nchan_buffer_full ); ch_idx++ )
#endif
        {
            hTcBuffer->tc_fx[ch_idx] = &hTcBuffer->tc_buffer_fx[offset];
            offset = add( offset, n_samp_full );
@@ -3470,7 +3487,6 @@ static void ivas_jbm_dec_tc_audio_deallocate_fx(
 * open and initialize JBM transport channel buffer
 *--------------------------------------------------------------------------*/


ivas_error ivas_jbm_dec_tc_buffer_open_fx(
    Decoder_Struct *st_ivas,               /* i/o: IVAS decoder structure              */
    const TC_BUFFER_MODE tc_buffer_mode,   /* i  : buffer mode                         */
Loading