Commit fb1274d2 authored by multrus's avatar multrus
Browse files

Merge branch...

Merge branch '2056-replace-hard-coded-0x0290-1-frames_per_sec-in-q15-by-inv_frame_per_sec_q15' into 'main'

Resolve "Replace hard-coded 0x0290 (1/FRAMES_PER_SEC in Q15) by INV_FRAME_PER_SEC_Q15"

Closes #2056

See merge request !2296
parents b4b1218e ccc8c516
Loading
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -55,9 +55,9 @@ void open_decoder_LPD_fx(
    fscaleFB = sr2fscale_fx( st->output_Fs );

    /* initializing variables for frame lengths etc. right in the beginning */
    st->L_frame = extract_l( Mult_32_16( st->sr_core, 0x0290 ) );
    st->L_frame = extract_l( Mult_32_16( st->sr_core, INV_FRAME_PER_SEC_Q15 ) );
    move16();
    hTcxDec->L_frameTCX = extract_l( Mult_32_16( st->output_Fs, 0x0290 ) );
    hTcxDec->L_frameTCX = extract_l( Mult_32_16( st->output_Fs, INV_FRAME_PER_SEC_Q15 ) );
    move16();
    IF( st->ini_frame == 0 )
    {
@@ -1159,7 +1159,7 @@ void open_decoder_LPD_ivas_fx(
    move16();

    /* initializing variables for frame lengths etc. right in the beginning */
    st->L_frame = extract_l( Mult_32_16( st->sr_core, 0x0290 ) ); /* 0.02 in Q15 */
    st->L_frame = extract_l( Mult_32_16( st->sr_core, INV_FRAME_PER_SEC_Q15 ) );
    move16();
    if ( st->ini_frame == 0 )
    {
@@ -1169,7 +1169,7 @@ void open_decoder_LPD_ivas_fx(
    }
    IF( st->hTcxDec != NULL )
    {
        st->hTcxDec->L_frameTCX = extract_l( Mult_32_16( st->output_Fs, 0x0290 ) ); /* 0.02 in Q15 */
        st->hTcxDec->L_frameTCX = extract_l( Mult_32_16( st->output_Fs, INV_FRAME_PER_SEC_Q15 ) );
        move16();
        st->output_frame_fx = st->hTcxDec->L_frameTCX; /* Q0 */
        move16();
+5 −5
Original line number Diff line number Diff line
@@ -99,10 +99,10 @@ void mode_switch_decoder_LPD_fx(
        move16();
        st->fscale = fscale;
        move16();
        st->L_frame = extract_l( Mult_32_16( st->sr_core, 0x0290 ) ); /* Q0 */
        st->L_frame = extract_l( Mult_32_16( st->sr_core, INV_FRAME_PER_SEC_Q15 ) ); /* Q0 */
        IF( hTcxDec != NULL )
        {
            hTcxDec->L_frameTCX = extract_l( Mult_32_16( st->output_Fs, 0x0290 ) ); /* Q0 */
            hTcxDec->L_frameTCX = extract_l( Mult_32_16( st->output_Fs, INV_FRAME_PER_SEC_Q15 ) ); /* Q0 */
            move16();
        }
        IF( st->hTcxCfg != NULL )
@@ -320,7 +320,7 @@ void mode_switch_decoder_LPD_ivas_fx(
    test();
    test();

    assert( (Word16) ( st->sr_core / FRAMES_PER_SEC ) == extract_l( Mult_32_16( st->sr_core, 0x0290 ) ) );
    assert( (Word16) ( st->sr_core / FRAMES_PER_SEC ) == extract_l( Mult_32_16( st->sr_core, INV_FRAME_PER_SEC_Q15 ) ) );
    IF( NE_16( fscale, st->fscale ) || switchWB || bSwitchFromAmrwbIO || EQ_16( st->last_codec_mode, MODE1 ) || st->force_lpd_reset )
    {
        open_decoder_LPD_ivas_fx( st, total_brate, last_total_brate, bwidth, MCT_flag, last_element_mode, 0, Q_syn_Overl_TDAC, Q_fer_samples, Q_syn_Overl, Q_syn_Overl_TDACFB, Q_syn_OverlFB, Q_old_out, Q_old_outLB, Q_old_Aq_12_8 );
@@ -332,11 +332,11 @@ void mode_switch_decoder_LPD_ivas_fx(
        move16();
        st->fscale = fscale;
        move16();
        st->L_frame = extract_l( Mult_32_16( st->sr_core, 0x0290 ) );
        st->L_frame = extract_l( Mult_32_16( st->sr_core, INV_FRAME_PER_SEC_Q15 ) );
        move16();
        IF( st->hTcxDec != NULL )
        {
            st->hTcxDec->L_frameTCX = extract_l( Mult_32_16( st->output_Fs, 0x0290 ) ); /* Q0 */
            st->hTcxDec->L_frameTCX = extract_l( Mult_32_16( st->output_Fs, INV_FRAME_PER_SEC_Q15 ) ); /* Q0 */
            move16();
            st->output_frame_fx = st->hTcxDec->L_frameTCX; /* Q0 */
            move16();
+1 −1
Original line number Diff line number Diff line
@@ -4391,7 +4391,7 @@ static ivas_error evs_dec_main_fx(
    hCoreCoder = st_ivas->hSCE[0]->hCoreCoder;
    hCoreCoder[0]->total_brate = st_ivas->hDecoderConfig->ivas_total_brate;
    move32();
    hCoreCoder[0]->output_frame_fx = extract_l( Mult_32_16( hCoreCoder[0]->output_Fs, 0x0290 /*Q0*/ ) ); // Q0
    hCoreCoder[0]->output_frame_fx = extract_l( Mult_32_16( hCoreCoder[0]->output_Fs, INV_FRAME_PER_SEC_Q15 ) ); // Q0
    move16();

    mdct_switching_dec_fx( hCoreCoder[0] );
+4 −4
Original line number Diff line number Diff line
@@ -71,12 +71,12 @@ void init_coder_ace_plus_fx(
    /* Core Framing */
    L_frame_old = st->last_L_frame;
    move16();
    st->L_frame = extract_l( Mult_32_16( st->sr_core, 0x0290 /* 1/FRAMES_PER_SEC in Q15*/ ) );
    st->L_frame = extract_l( Mult_32_16( st->sr_core, INV_FRAME_PER_SEC_Q15 ) );
    st->L_frame_past = -1;
    move16();
    move16();

    hTcxEnc->L_frameTCX = extract_l( Mult_32_16( st->input_Fs, 0x0290 /* 1/FRAMES_PER_SEC in Q15*/ ) );
    hTcxEnc->L_frameTCX = extract_l( Mult_32_16( st->input_Fs, INV_FRAME_PER_SEC_Q15 ) );
    move16();
    st->nb_subfr = NB_SUBFR;
    move16();
@@ -960,14 +960,14 @@ void init_coder_ace_plus_ivas_fx(
    /* Core Framing */
    L_frame_old = st->last_L_frame;
    move16();
    st->L_frame = extract_l( Mult_32_16( st->sr_core, 0x0290 ) ); /* 0x0290  is 1/FRAMES_PER_SEC in Q15*/
    st->L_frame = extract_l( Mult_32_16( st->sr_core, INV_FRAME_PER_SEC_Q15 ) );
    move16();
    st->L_frame_past = -1;
    move16();

    IF( hTcxEnc != NULL )
    {
        hTcxEnc->L_frameTCX = extract_l( Mult_32_16( st->input_Fs, 0x0290 ) ); /* 0x0290  is 1/FRAMES_PER_SEC in Q15*/
        hTcxEnc->L_frameTCX = extract_l( Mult_32_16( st->input_Fs, INV_FRAME_PER_SEC_Q15 ) );
        move16();

        IF( st->ini_frame == 0 )
+2 −2
Original line number Diff line number Diff line
@@ -65,7 +65,7 @@ void core_coder_mode_switch_fx(
        move32();
        st->sr_core = sr_core;
        move32();
        st->L_frame = extract_l( Mult_32_16( st->sr_core, 0x0290 ) );
        st->L_frame = extract_l( Mult_32_16( st->sr_core, INV_FRAME_PER_SEC_Q15 ) );
        assert( st->L_frame == st->sr_core / 50 );
        st->tcxonly = (Word8) getTcxonly( st->total_brate );
        /* st->bits_frame_nominal = (int)( (float)st->L_frame/(float)st->fscale ) * (float)FSCALE_DENOM/128.0f * (float)st->bitrate/100.0f + 0.49f ; */
@@ -379,7 +379,7 @@ void core_coder_mode_switch_ivas_fx(
        move16();
        IF( hTcxEnc != NULL )
        {
            hTcxEnc->L_frameTCX = extract_l( Mult_32_16( st->input_Fs, 0x0290 ) ); /* 0x0290  is 1/FRAMES_PER_SEC in Q15*/
            hTcxEnc->L_frameTCX = extract_l( Mult_32_16( st->input_Fs, INV_FRAME_PER_SEC_Q15 ) );
            move16();
        }
        st->currEnergyHF_fx = 0;
Loading