Commit c444ec22 authored by multrus's avatar multrus
Browse files

replace erroneous division by if-else-statemment

parent 94fd13cb
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -133,6 +133,7 @@
#define FIX_2261_REMOVE_LP_RESCALING                    /* VA: Remove of unnecessary lpc coefficient rescaling */
#define FIX_2320_OOB_SCE_SWITCHING                      /* VA: basop issue 2320: Correct the length of the buffer to be scaled in SCE/CPE switching */
#define FIX_2302_LSF_CDBK_THRESHOLD                     /* VA: basop issue 2302: fix threshold for LSF Q codebook-type decision  */
#define FIX_2362_TOTAL_BRATE_CALCULATION                /* FhG: basop issue 2362: fix calculation of st->total_brate in ivas_cpe_enc_fx() */

/* ##################### End NON-BE switches ########################### */

+14 −1
Original line number Diff line number Diff line
@@ -632,7 +632,20 @@ ivas_error ivas_cpe_enc_fx(
            {
                sts[n]->bits_frame_nominal = extract_l( Mpy_32_32_r( hCPE->element_brate, ONE_BY_FRAMES_PER_SEC_Q31 ) );                             /* Q0 */
                sts[n]->bits_frame_channel = idiv1616( extract_l( Mpy_32_32_r( hCPE->element_brate, ONE_BY_FRAMES_PER_SEC_Q31 ) ), n_CoreChannels ); /* Q0 */
#ifdef FIX_2362_TOTAL_BRATE_CALCULATION
                /* sts[n]->total_brate = hCPE->element_brate / n_CoreChannels; */
                assert( n_CoreChannels == 1 || n_CoreChannels == 2 );
                IF( n_CoreChannels == 1 )
                {
                    sts[n]->total_brate = hCPE->element_brate;
                }
                ELSE IF( n_CoreChannels == 2 )
                {
                    sts[n]->total_brate = L_shr( hCPE->element_brate, 1 );
                }
#else
                sts[n]->total_brate = L_shl( div_l( hCPE->element_brate, n_CoreChannels ), 1 );                                                                                       /* Q0 */
#endif
                move32();
                move16();
                move16();