Commit be261767 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Merge branch '826-artifacts-for-low-level-signals' into 'main'

Resolve "Artifacts for low level signals"

See merge request !486
parents 701003c4 fcd8c70c
Loading
Loading
Loading
Loading
Loading
+14 −8
Original line number Diff line number Diff line
@@ -780,8 +780,11 @@ ivas_error ivas_cpe_dec_fx(
    const Word16 cpe_id,          /* i  : CPE # identifier                */
    Word32 *output[CPE_CHANNELS], /* o  : output synthesis signal         */
    const Word16 output_frame,    /* i  : output frame length per channel */
    const Word16 nb_bits_metadata, /* i  : number of metadata bits         */
    const Word16 nb_bits_metadata /* i  : number of metadata bits         */
#ifndef FIX_826_PRECISION_LOST_AND_COMPL
    ,
    Word16 *q_output /* i/o : Q of output synthesis signal         */
#endif
);

void ivas_post_proc_fx(
@@ -1326,8 +1329,11 @@ void stereo_icBWE_decproc_fx(
    Word32 outputHB[CPE_CHANNELS][L_FRAME48k], /* i  : HB synthesis                */
    const Word16 last_core,                    /* i  : last core, primary channel  */
    const Word16 last_bwidth,                  /* i  : last bandwidth              */
    const Word16 output_frame,                 /* i  : frame length                */
    const Word16 output_frame                  /* i  : frame length                */
#ifndef FIX_826_PRECISION_LOST_AND_COMPL
    ,
    Word16 q_output /* i  : Q-fac of output             */
#endif
);

void add_HB_to_mono_dmx_fx(
+1 −0
Original line number Diff line number Diff line
@@ -151,6 +151,7 @@
#define FIX_802__NON_BE_DECODING                    /* Fix possible difference float and fixed point when computing the GSC bit allocation */
#define FIX_802_1137_1137_GSC_IVAS_FXFLT_DECODING   /* VA: ISSUES 802 and 1137 Made sure that float and fixed point GCS bit allocation is the same during IVAS modes  */
#define FIX_810_PREVENT_UNECESSARY_SAT_IN_TC        /* VA : Prevent an unnecessary saturation that can happen in TC, have a minimal impact on most cases. Significant improvement for the last segment of LTV when TC is triggered */
#define FIX_826_PRECISION_LOST_AND_COMPL            /* VA : Fix lost of precision that leads to unnecessary high noise floor and to some framing artifacts */ 
/* ################## End DEVELOPMENT switches ######################### */

/* clang-format on */
+2354 −2344
Original line number Diff line number Diff line
@@ -1233,10 +1233,13 @@ ivas_error ivas_core_dec_fx(
            {
                Copy_Scale_sig_16_32( hb_synth_16_fx[n], hb_synth_32_fx[n], L_FRAME48k, ( Q11 + q ) );
            }
            Copy_Scale_sig_16_32( synth_fxl, synth_32_fx[n], L_FRAME48k, add( Q11, q ) );
            Scale_sig( st->hBWE_TD->state_lpc_syn_fx, LPC_SHB_ORDER, sub( st->prev_Q_bwe_syn, Q8 ) );
            Scale_sig32( st->hBWE_TD->genSHBsynth_Hilbert_Mem_fx, HILBERT_MEM_SIZE, sub( Q11, st->prev_Q_bwe_syn2 ) );
            Copy_Scale_sig_16_32( st->hBWE_TD->genSHBsynth_state_lsyn_filt_shb_local_fx, st->hBWE_TD->genSHBsynth_state_lsyn_filt_shb_local_fx_32, 2 * ALLPASSSECTIONS_STEEP, sub( Q11, st->prev_Q_bwe_syn2 ) );

#ifndef FIX_826_PRECISION_LOST_AND_COMPL
            Copy_Scale_sig_16_32( synth_fxl, synth_32_fx[n], L_FRAME48k, ( Q11 + q ) );
#endif
            Scale_sig( st->hBWE_TD->state_lpc_syn_fx, LPC_SHB_ORDER, -( Q8 - st->prev_Q_bwe_syn ) );
            Scale_sig32( st->hBWE_TD->genSHBsynth_Hilbert_Mem_fx, HILBERT_MEM_SIZE, -( st->prev_Q_bwe_syn2 - Q11 ) );
            Copy_Scale_sig_16_32( st->hBWE_TD->genSHBsynth_state_lsyn_filt_shb_local_fx, st->hBWE_TD->genSHBsynth_state_lsyn_filt_shb_local_fx_32, 2 * ALLPASSSECTIONS_STEEP, -( st->prev_Q_bwe_syn2 - Q11 ) );
        }

        /*-------------------------------------------------------------------*
@@ -1369,10 +1372,17 @@ ivas_error ivas_core_dec_fx(
                move16();
                FOR( i = 0; i < tmps; i++ )
                {

#ifndef FIX_826_PRECISION_LOST_AND_COMPL
                    tmp_buffer_fx[i] = round_fx( L_add( L_shr( L_mult( st->hb_prev_synth_buffer_fx[i], sin_table256_fx[255 - tmp16] ), 1 ), L_shr( L_mult( st->hb_prev_synth_buffer_fx[sub( sub( st->old_bwe_delay, 1 ), i )], sin_table256_fx[tmp16] ), 1 ) ) );
                    move16();
                    tmp_buffer_fx[i] = shl_sat( tmp_buffer_fx[i], 1 );
                    move16();
#else
                    tmp_buffer_fx[i] = round_fx_sat( L_mac_sat( L_mult( st->hb_prev_synth_buffer_fx[i], sin_table256_fx[255 - tmp16] ), st->hb_prev_synth_buffer_fx[sub( sub( st->old_bwe_delay, 1 ), i )], sin_table256_fx[tmp16] ) );
                    move16();
#endif

                    tmp16 = add( tmp16, incr );
                }
                Copy( tmp_buffer_fx, st->hb_prev_synth_buffer_fx, tmps );
+13 −6
Original line number Diff line number Diff line
@@ -66,8 +66,11 @@ ivas_error ivas_cpe_dec_fx(
    const Word16 cpe_id,          /* i  : CPE # identifier                */
    Word32 *output[CPE_CHANNELS], /* o  : output synthesis signal         */
    const Word16 output_frame,    /* i  : output frame length per channel */
    const Word16 nb_bits_metadata, /* i  : number of metadata bits         */
    const Word16 nb_bits_metadata /* i  : number of metadata bits         */
#ifndef FIX_826_PRECISION_LOST_AND_COMPL
    ,
    Word16 *q_output /* i/o : Q of output synthesis signal         */
#endif
)
{
    Word16 i, n, n_channels;
@@ -848,7 +851,11 @@ ivas_error ivas_cpe_dec_fx(
     * IC-BWE: output LB and HB mix in ACELP mode
     *----------------------------------------------------------------*/

#ifndef FIX_826_PRECISION_LOST_AND_COMPL
    stereo_icBWE_decproc_fx( hCPE, output, outputHB_fx, last_core, last_bwidth, output_frame, *q_output );
#else
    stereo_icBWE_decproc_fx( hCPE, output, outputHB_fx, last_core, last_bwidth, output_frame );
#endif

    smooth_dft2td_transition_fx( hCPE, output, output_frame );

+28 −0
Original line number Diff line number Diff line
@@ -175,7 +175,11 @@ ivas_error ivas_jbm_dec_tc_fx(
        set32_fx( &p_output_fx[0][0], 0, L_FRAME48k );
        set32_fx( &p_output_fx[1][0], 0, L_FRAME48k );

#ifndef FIX_826_PRECISION_LOST_AND_COMPL
        IF( ( error = ivas_cpe_dec_fx( st_ivas, 0, &p_output_fx[0], output_frame, 0, &q_output ) ) != IVAS_ERR_OK )
#else
        IF( ( error = ivas_cpe_dec_fx( st_ivas, 0, &p_output_fx[0], output_frame, 0 ) ) != IVAS_ERR_OK )
#endif
        {
            return error;
        }
@@ -338,7 +342,11 @@ ivas_error ivas_jbm_dec_tc_fx(
            set32_fx( &p_output_fx[0][0], 0, L_FRAME48k );
            set32_fx( &p_output_fx[1][0], 0, L_FRAME48k );

#ifndef FIX_826_PRECISION_LOST_AND_COMPL
            IF( ( error = ivas_cpe_dec_fx( st_ivas, 0, &p_output_fx[0], output_frame, nb_bits_metadata[0], &q_output ) ) != IVAS_ERR_OK )
#else
            IF( ( error = ivas_cpe_dec_fx( st_ivas, 0, &p_output_fx[0], output_frame, nb_bits_metadata[0] ) ) != IVAS_ERR_OK )
#endif
            {
                return error;
            }
@@ -719,7 +727,11 @@ ivas_error ivas_jbm_dec_tc_fx(
        }

        /* decode MASA channels */
#ifndef FIX_826_PRECISION_LOST_AND_COMPL
        IF( ( error = ivas_cpe_dec_fx( st_ivas, 0, p_output_fx, output_frame, nb_bits_metadata[0], &q_output ) ) != IVAS_ERR_OK )
#else
        IF( ( error = ivas_cpe_dec_fx( st_ivas, 0, p_output_fx, output_frame, nb_bits_metadata[0] ) ) != IVAS_ERR_OK )
#endif
        {
            return error;
        }
@@ -823,7 +835,11 @@ ivas_error ivas_jbm_dec_tc_fx(
        ELSE IF( EQ_16( st_ivas->nCPE, 1 ) )
        {

#ifndef FIX_826_PRECISION_LOST_AND_COMPL
            IF( ( error = ivas_cpe_dec_fx( st_ivas, 0, &p_output_fx[0], output_frame, nb_bits_metadata[0] + nb_bits_metadata[1], &q_output ) ) != IVAS_ERR_OK )
#else
            IF( ( error = ivas_cpe_dec_fx( st_ivas, 0, &p_output_fx[0], output_frame, nb_bits_metadata[0] + nb_bits_metadata[1] ) ) != IVAS_ERR_OK )
#endif
            {
                return error;
            }
@@ -1142,7 +1158,11 @@ ivas_error ivas_jbm_dec_tc_fx(
            {
                Word16 q_output = 11;

#ifndef FIX_826_PRECISION_LOST_AND_COMPL
                IF( ( error = ivas_cpe_dec_fx( st_ivas, 0, &p_output_fx[0], output_frame, nb_bits_metadata[0], &q_output ) ) != IVAS_ERR_OK )
#else
                IF( ( error = ivas_cpe_dec_fx( st_ivas, 0, &p_output_fx[0], output_frame, nb_bits_metadata[0] ) ) != IVAS_ERR_OK )
#endif
                {
                    return error;
                }
@@ -1202,7 +1222,11 @@ ivas_error ivas_jbm_dec_tc_fx(
                /* Decode the transport audio signals */
                Word16 q_output = 11;

#ifndef FIX_826_PRECISION_LOST_AND_COMPL
                IF( ( error = ivas_cpe_dec_fx( st_ivas, 0, &p_output_fx[0], output_frame, nb_bits_metadata[0], &q_output ) ) != IVAS_ERR_OK )
#else
                IF( ( error = ivas_cpe_dec_fx( st_ivas, 0, &p_output_fx[0], output_frame, nb_bits_metadata[0] ) ) != IVAS_ERR_OK )
#endif
                {
                    return error;
                }
@@ -1252,7 +1276,11 @@ ivas_error ivas_jbm_dec_tc_fx(
                ELSE IF( EQ_16( st_ivas->nCPE, 1 ) )
                {

#ifndef FIX_826_PRECISION_LOST_AND_COMPL
                    IF( ( error = ivas_cpe_dec_fx( st_ivas, 0, &p_output_fx[0], output_frame, nb_bits_metadata[0], &q_output ) ) != IVAS_ERR_OK )
#else
                    IF( ( error = ivas_cpe_dec_fx( st_ivas, 0, &p_output_fx[0], output_frame, nb_bits_metadata[0] ) ) != IVAS_ERR_OK )
#endif
                    {
                        return error;
                    }
Loading