Commit 9c792502 authored by vaclav's avatar vaclav
Browse files

avoid double to single point float data type conversions

parent 5af216f0
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -696,9 +696,9 @@ static void ivas_mc_paramupmix_dmx(
        for ( l = 0; l < input_frame; l++ )
        {
            /* mid */
            hMCParamUpmix->midside[i][0][l] = ( data_f[chan1s[i]][l] + data_f[chan2s[i]][l] ) * (float) 0.5;
            hMCParamUpmix->midside[i][0][l] = ( data_f[chan1s[i]][l] + data_f[chan2s[i]][l] ) * 0.5f;
            /* side */
            hMCParamUpmix->midside[i][1][l] = ( data_f[chan1s[i]][l] - data_f[chan2s[i]][l] ) * (float) 0.5;
            hMCParamUpmix->midside[i][1][l] = ( data_f[chan1s[i]][l] - data_f[chan2s[i]][l] ) * 0.5f;
            data_f[chanOut[i]][l] = hMCParamUpmix->midside[i][0][l];
        }
    }
@@ -831,14 +831,14 @@ static void ivas_mc_paramupmix_param_est_enc(
            rxy = hMCParamUpmix->cov_real[b][1][0][bnd];
            ryy = hMCParamUpmix->cov_real[b][1][1][bnd];
            cmat = rxy / ( ryy + EPSILON );
            alphas[b][bnd] = (float) 2.0 * cmat - (float) 1.0;
            alphas[b][bnd] = 2.0f * cmat - 1.0f;

            rxx = hMCParamUpmix->cov_real[b][0][0][bnd];
            rxxest = cmat * cmat * ryy;
            drxx = rxx - rxxest;
            drxx = (float) max( drxx, 0.0 );
            wetaux = (float) sqrt( drxx / ( ryy + EPSILON ) );
            betas[b][bnd] = (float) 2.0 * wetaux;
            drxx = max( drxx, 0.0f );
            wetaux = sqrtf( drxx / ( ryy + EPSILON ) );
            betas[b][bnd] = 2.0f * wetaux;
        }
    }
#ifdef FIX_468_16KHZ_PUPMIX
@@ -848,8 +848,8 @@ static void ivas_mc_paramupmix_param_est_enc(
        {
            for ( bnd = maxbands; bnd < IVAS_MAX_NUM_BANDS; bnd++ )
            {
                alphas[b][bnd] = 0.0;
                betas[b][bnd] = 0.0;
                alphas[b][bnd] = 0.0f;
                betas[b][bnd] = 0.0f;
            }
        }
    }