Commit 6a2b1e97 authored by multrus's avatar multrus
Browse files

merge from main

parents d728ed45 15b390a2
Loading
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1593,6 +1593,9 @@ typedef enum
#define DEG_360_IN_Q22                          ( 360 << Q22 )              /* Q22 */
#define DEG_180_IN_Q22                          ( 180 << Q22 )              /* Q22 */
#define DEG_90_IN_Q22                           ( 90 << Q22 )               /* Q22 */
#ifdef FIX_2235_TD_RENDERER_WORD16
#define DEG_90_IN_Q8                            ( 90 << Q8 )                /* Q8  */
#endif
#define ONE_BY_360_Q31                          ( 5965232 )                 /* Q31 */
#define ONE_BY_360_Q15                          ( 91 )                      /* Q15 */
#define ONE_BY_180_Q31                          ( 11930465 )                /* Q31 */
+3 −0
Original line number Diff line number Diff line
@@ -83,6 +83,7 @@
#define FIX_1990_SANITIZER_IN_REVERB_LOAD               /* Nokia: Fix issue part of issue 1990 by introducing missing free of structure - keep until #2059 is addressed */
#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_2235_TD_RENDERER_WORD16                     /* Eri: Use Word16 in TD renderer without converting to Word32*/
#define HARMONIZE_TBE2                                  /* VA: basop issue 2399: Remove duplicated code: TBE, step 2 */
#define HARMONIZE_2427_GETPLC                           /* FhG: basop issue : 2427 Harmonizing getPLCDecision functions:*/
#define HARM_FD_BWE                                     /* VA: harmonize core-coder FD BWE function duplications */
@@ -102,6 +103,8 @@
/* any switch which is non-be wrt. TS 26.251 V3.0 */

#define NONBE_MR2809
#define FIX_2432_ISM_SPIKES_16KHZ                       /* VA: basop issue 2432: fix spikes in ISM decoding at 16kHz output sampling rate */
#define FIX_2448_RENDERER_MSAN_ERROR                    /* FhG: basop issue 2448: fix MSAN error with MSA rendering */
#define FIX_2283_ISM_MD_DELAY                           /* Dolby: Fix ISM metadata delay round-off */
#define FIX_2283_Q_CLDFB                                /* FhG: Fix Q format issue in CLDFB */
#define FIX_2283_ACCU_CLDFB                             /* FhG: Fix to consider Q-format differences in accumulateCLDFBArrayToBuffer_fx() */
+12 −5
Original line number Diff line number Diff line
@@ -71,7 +71,7 @@ ivas_error ivas_core_dec_fx(
    Word16 tmp16, tmp16_2, j;
    Word16 Q_white_exc;
    Word16 tmps, incr;
    Word16 flag_bwe_bws, flaf_swb_tbe;
    Word16 flag_bwe_bws, flag_swb_tbe;
    Word32 *bwe_exc_extended_fx[CPE_CHANNELS] = { NULL, NULL };
    Word16 voice_factors_fx[CPE_CHANNELS][NB_SUBFR16k]; // Q15
    Word16 core_switching_flag[CPE_CHANNELS];
@@ -922,7 +922,7 @@ ivas_error ivas_core_dec_fx(
        Q_synth_fx = Q_synth;
        move16();

        flaf_swb_tbe = 0;
        flag_swb_tbe = 0;
        move16();
        test();
        test();
@@ -934,7 +934,7 @@ ivas_error ivas_core_dec_fx(
        test();
        if ( EQ_16( st->extl, SWB_TBE ) || EQ_16( st->extl, FB_TBE ) || ( NE_16( st->coder_type, AUDIO ) && NE_16( st->coder_type, INACTIVE ) && GE_32( st->core_brate, SID_2k40 ) && EQ_16( st->core, ACELP_CORE ) && !st->con_tcx && GE_32( output_Fs, 32000 ) && GT_16( st->bwidth, NB ) && st->bws_cnt > 0 ) )
        {
            flaf_swb_tbe = 1;
            flag_swb_tbe = 1;
            move16();
        }

@@ -965,7 +965,7 @@ ivas_error ivas_core_dec_fx(
        }

        /* Memories  Re-Scaling */
        IF( !flaf_swb_tbe )
        IF( !flag_swb_tbe )
        {
            Copy_Scale_sig_16_32_no_sat( hb_synth_16_fx[n], hb_synth_32_fx[n], L_FRAME48k, sub( Q11, Q_hb_synth_fx ) ); // Q11
        }
@@ -997,7 +997,7 @@ ivas_error ivas_core_dec_fx(

        test();
        test();
        IF( flaf_swb_tbe )
        IF( flag_swb_tbe )
        {
            /* SWB TBE decoder */
            swb_tbe_dec_ivas_fx( st, hStereoICBWE, bwe_exc_extended_fx[n], st->Q_exc, voice_factors_fx[n], old_syn_12k8_16k_fx[n], tmp_buffer_fx /*fb_exc*/, hb_synth_32_fx[n], pitch_buf_fx[n], &Q_white_exc );
@@ -1031,7 +1031,14 @@ ivas_error ivas_core_dec_fx(
        test();
        test();
        test();
#ifdef FIX_2432_ISM_SPIKES_16KHZ
        test();
        test();
        test();
        IF( ( st->core == ACELP_CORE && ( EQ_16( st->extl, -1 ) || EQ_16( st->extl, SWB_CNG ) || ( EQ_16( st->extl, WB_BWE ) && st->bws_cnt > 0 && flag_swb_tbe == 0 ) ) ) && flag_bwe_bws == 0 )
#else
        IF( ( st->core == ACELP_CORE && ( EQ_16( st->extl, -1 ) || EQ_16( st->extl, SWB_CNG ) ) ) && flag_bwe_bws == 0 )
#endif
        {
            set32_fx( hb_synth_32_fx[n], 0, L_FRAME48k );
        }
+29 −14
Original line number Diff line number Diff line
@@ -4278,22 +4278,37 @@ static void ivas_masa_ext_dirac_render_sf_fx(
        hDirACRend->h_output_synthesis_psd_state.proto_power_smooth_prev_q[1] = s_min( hDirACRend->h_output_synthesis_psd_state.proto_power_smooth_q[1], hDirACRend->h_output_synthesis_psd_state.proto_power_smooth_prev_q[1] );
        move16();

#ifdef FIX_2448_RENDERER_MSAN_ERROR
        IF( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_fx )
#endif
        {
            Word16 proto_power_diff_smooth_prev_temp_q = getScaleFactor32( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_fx, hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_len );
            Scale_sig32( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_fx, hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_len, proto_power_diff_smooth_prev_temp_q ); // hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_q + proto_power_diff_smooth_prev_temp_q
            hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_q = add( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_q, proto_power_diff_smooth_prev_temp_q );
            move16();
        }

#ifdef FIX_2448_RENDERER_MSAN_ERROR
        IF( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_fx )
#endif
        {
            Word16 proto_power_diff_smooth_temp_q = getScaleFactor32( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_fx, hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_len );
            Scale_sig32( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_fx, hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_len, proto_power_diff_smooth_temp_q ); // hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_q + proto_power_diff_smooth_temp_q
            hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_q = add( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_q, proto_power_diff_smooth_temp_q );
            move16();
        }

#ifdef FIX_2448_RENDERER_MSAN_ERROR
        IF( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_fx )
#endif
        {
            Scale_sig32( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_fx, hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_len, sub( s_min( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_q, hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_q ), hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_q ) ); // s_min( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_q, hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_q )
            Scale_sig32( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_fx, hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_len, sub( s_min( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_q, hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_q ), hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_q ) );                // s_min( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_q, hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_q )
            hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_q = s_min( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_q, hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_q );
            move16();
            hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_q = s_min( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_q, hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_q );
            move16();
        }

        Scale_sig32( diffuseness_vector_fx, hSpatParamRendCom->num_freq_bands, 1 );

+82 −0
Original line number Diff line number Diff line
@@ -175,11 +175,19 @@ ivas_error ivas_HRTF_CRend_binary_open_fx(
}


#ifdef FIX_2235_TD_RENDERER_WORD16
/*-----------------------------------------------------------------------*
 * ivas_HRTF_binary_open_buffers_int16()
 *
 * Allocate buffer with dynamic length for HRTF binary handle
 *-----------------------------------------------------------------------*/
#else
/*-----------------------------------------------------------------------*
 * ivas_HRTF_CRend_binary_open_buffers_int16()
 *
 * Allocate buffer with dynamic length for HRTF binary Crend handle
 *-----------------------------------------------------------------------*/
#endif
ivas_error ivas_HRTF_binary_open_buffers_int16(
    Word16 **buffer,       /* o  : buffer to allocate      */
    const UWord32 mem_size /* i  : size of buffer          */
@@ -195,11 +203,19 @@ ivas_error ivas_HRTF_binary_open_buffers_int16(
    return IVAS_ERR_OK;
}

#ifdef FIX_2235_TD_RENDERER_WORD16
/*-----------------------------------------------------------------------*
 * ivas_HRTF_binary_open_buffers_uint16()
 *
 * Allocate buffer with dynamic length for HRTF binary handle
 *-----------------------------------------------------------------------*/
#else
/*-----------------------------------------------------------------------*
 * ivas_HRTF_binary_open_buffers_uint16()
 *
 * Allocate buffer with dynamic length for HRTF binary Crend handle
 *-----------------------------------------------------------------------*/
#endif
ivas_error ivas_HRTF_binary_open_buffers_uint16(
    UWord16 **buffer,       /* o  : buffer to allocate      */
    const uint32_t mem_size /* i  : size of buffer          */
@@ -215,11 +231,19 @@ ivas_error ivas_HRTF_binary_open_buffers_uint16(
    return IVAS_ERR_OK;
}

#ifdef FIX_2235_TD_RENDERER_WORD16
/*-----------------------------------------------------------------------*
 * ivas_HRTF_binary_open_buffers_int32()
 *
 * Allocate buffer with dynamic length for HRTF binary handle
 *-----------------------------------------------------------------------*/
#else
/*-----------------------------------------------------------------------*
 * ivas_HRTF_binary_open_buffers_int32()
 *
 * Allocate buffer with dynamic length for HRTF binary Crend handle
 *-----------------------------------------------------------------------*/
#endif
ivas_error ivas_HRTF_binary_open_buffers_int32(
    Word32 **buffer,        /* o  : buffer to allocate      */
    const uint32_t mem_size /* i  : size of buffer          */
@@ -235,11 +259,19 @@ ivas_error ivas_HRTF_binary_open_buffers_int32(
    return IVAS_ERR_OK;
}

#ifdef FIX_2235_TD_RENDERER_WORD16
/*-----------------------------------------------------------------------*
 * ivas_HRTF_binary_open_buffers_int32_ptr()
 *
 * Allocate buffer with dynamic length for HRTF binary handle
 *-----------------------------------------------------------------------*/
#else
/*-----------------------------------------------------------------------*
 * ivas_HRTF_binary_open_buffers_int32_ptr()
 *
 * Allocate buffer with dynamic length for HRTF binary Crend handle
 *-----------------------------------------------------------------------*/
#endif
ivas_error ivas_HRTF_binary_open_buffers_int32_ptr(
    Word32 ***buffer,       /* o  : buffer to allocate      */
    const uint32_t mem_size /* i  : size of buffer          */
@@ -255,11 +287,61 @@ ivas_error ivas_HRTF_binary_open_buffers_int32_ptr(
    return IVAS_ERR_OK;
}

#ifdef FIX_2235_TD_RENDERER_WORD16
/*-----------------------------------------------------------------------*
 * ivas_HRTF_binary_open_buffers_int16_ptr_const()
 *
 * Allocate buffer with dynamic length for HRTF binary handle
 *-----------------------------------------------------------------------*/
ivas_error ivas_HRTF_binary_open_buffers_int16_ptr_const(
    const Word16 ***buffer, /* o  : buffer to allocate      */
    const uint32_t mem_size /* i  : size of buffer          */
)
{
    *buffer = (const Word16 **) malloc( mem_size );

    if ( *buffer == NULL )
    {
        return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for HRTF binary data\n" );
    }

    return IVAS_ERR_OK;
}

/*-----------------------------------------------------------------------*
 * ivas_HRTF_binary_open_buffers_int16_ptr()
 *
 * Allocate buffer with dynamic length for HRTF binary handle
 *-----------------------------------------------------------------------*/
ivas_error ivas_HRTF_binary_open_buffers_int16_ptr(
    Word16 ***buffer,       /* o  : buffer to allocate      */
    const uint32_t mem_size /* i  : size of buffer          */
)
{
    *buffer = (Word16 **) malloc( mem_size );

    if ( *buffer == NULL )
    {
        return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for HRTF binary data\n" );
    }

    return IVAS_ERR_OK;
}
#endif

#ifdef FIX_2235_TD_RENDERER_WORD16
/*-----------------------------------------------------------------------*
 * ivas_HRTF_binary_open_buffers_int32_ptr_const()
 *
 * Allocate buffer with dynamic length for HRTF binary handle
 *-----------------------------------------------------------------------*/
#else
/*-----------------------------------------------------------------------*
 * ivas_HRTF_binary_open_buffers_int32_ptr_const()
 *
 * Allocate buffer with dynamic length for HRTF binary Crend handle
 *-----------------------------------------------------------------------*/
#endif
ivas_error ivas_HRTF_binary_open_buffers_int32_ptr_const(
    const Word32 ***buffer, /* o  : buffer to allocate      */
    const uint32_t mem_size /* i  : size of buffer          */
Loading