Commit 17fb7e2e authored by vaillancour's avatar vaillancour
Browse files

Potential fix for 839

parent 4e186fa8
Loading
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -1412,7 +1412,12 @@ void stereo_icBWE_dec_fx(
    const Word16 *fb_synth_ref_fx,  /* i  : ref. high-band synthesis 16-20 kHz              */
    const Word16 *voice_factors_fx, /* i  : voicing factors                                 */
    const Word16 output_frame,      /* i  : frame length                                    */
    Word16 *Q_syn );
    Word16 *Q_syn 
#ifdef FIX_tmp_buffer_2
    ,
    const Word16 Q_white_exc        /* i  : Q of fb_synth_ref_fx                 */
#endif 
);

void decoder_tcx_tns_fx(
    Decoder_State *st,         /* i/o: coder memory state                      */
+2 −0
Original line number Diff line number Diff line
@@ -159,6 +159,8 @@
#define FIX_833_CORRECTION_to_826                   /* VA : fix indexing error introduced in 826 */
#endif
#define NONE_BE_FIX_816_LFE_PLC_FLOAT                   /* DLB: issue 816: reduce required precision to float for LFE-PLC*/
#define FIX_839_FB_CONTENT_SOMETIME_MISSING     /* VA : Fix scaling error for FB TB BWE */

/* ################## End DEVELOPMENT switches ######################### */

/* clang-format on */
+5 −1
Original line number Diff line number Diff line
@@ -1255,8 +1255,12 @@ ivas_error ivas_core_dec_fx(
                hCPE->hStereoDft->td_gain_fx[0] = 1;
                move32();
            }
            Scale_sig( tmp_buffer_fx, L_FRAME48k, sub( Q11, Q_white_exc ) );
#ifndef FIX_839_FB_CONTENT_SOMETIME_MISSING
            Scale_sig( tmp_buffer_fx, L_FRAME48k, sub( Q11, Q_white_exc ) );  // for small value, this was just mostly p
            stereo_icBWE_dec_fx( hCPE, hb_synth_32_fx[0], hb_synth_32_fx[1], tmp_buffer_fx /*fb_synth_ref*/, voice_factors_fx[0], output_frame, &q );
#else
            stereo_icBWE_dec_fx( hCPE, hb_synth_32_fx[0], hb_synth_32_fx[1], tmp_buffer_fx /*fb_synth_ref*/, voice_factors_fx[0], output_frame, &q, Q_white_exc );
#endif
#ifdef MSAN_FIX
            test();
            test();
+16 −1
Original line number Diff line number Diff line
@@ -556,10 +556,14 @@ void stereo_icBWE_dec_fx(
    CPE_DEC_HANDLE hCPE,            /* i/o: CPE decoder structure                           */
    Word32 *synthRef_fx,            /* i/o: Reference channel HB synthesis at output Fs      Q11 */
    Word32 *synth_fx,               /* o  : Non reference channel HB synthesis at output Fs  Q11 */
    const Word16 *fb_synth_ref_fx,  /* i  : ref. high-band synthesis 16-20 kHz               Q11 */
    const Word16 *fb_synth_ref_fx,  /* i  : ref. high-band synthesis 16-20 kHz               fb_synth_ref_fx */
    const Word16 *voice_factors_fx, /* i  : voicing factors                                  Q15 */
    const Word16 output_frame,      /* i  : frame length                                    */
    Word16 *Q_syn                   /* i  : Q of synth and synthRef buffers                 */
#ifdef FIX_839_FB_CONTENT_SOMETIME_MISSING
    ,
    const Word16 Q_white_exc        /* i  : Q of fb_synth_ref_fx                 */
#endif
)
{
    Word16 i, j, k, nbSubFr;
@@ -1330,11 +1334,22 @@ void stereo_icBWE_dec_fx(
    {

        // v_add( fb_synth_nonref_fx, synth_fx, synth_fx, L_FRAME48k, 0 );
#ifdef FIX_839_FB_CONTENT_SOMETIME_MISSING
        tmp = shl_sat( 1, sub( Q11 + 15, Q_white_exc ) );
        IF ( tmp != 0 )
        {
            FOR( i = 0; i < L_FRAME48k; i++ )
            {
                synth_fx[i] = L_mac( synth_fx[i], fb_synth_nonref_fx[i], tmp );
            }
        }
#else
        FOR( i = 0; i < L_FRAME48k; i++ )
        {
            synth_fx[i] = L_add( synth_fx[i], L_deposit_l( fb_synth_nonref_fx[i] ) );
            move32();
        }
#endif
    }

    /* copy to outputHB and reset hb_synth values */
+4 −0
Original line number Diff line number Diff line
@@ -4957,7 +4957,11 @@ void fb_tbe_dec_ivas_fx(
    test();
    IF( GE_16( st->element_mode, IVAS_CPE_DFT ) && ( st->idchan == 0 ) )
    {
#ifdef FIX_839_FB_CONTENT_SOMETIME_MISSING
        Copy_Scale_sig( fb_synth, fb_synth_ref, L_FRAME48k, sub( Q_fb_synth_ref, add( hb_synth_exp, 16 ) ) ); // scaling is required
#else
        Copy_Scale_sig( fb_synth, fb_synth_ref, L_FRAME48k, sub( Q_fb_synth_ref, hb_synth_exp ) ); // scaling is required
#endif
    }
    /* add the fb_synth component to the hb_synth component */
    /*  v_add_fx( hb_synth, fb_synth, hb_synth, L_FRAME48k );*/