Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d4570c47 authored by Harish Mahendrakar's avatar Harish Mahendrakar
Browse files

lvm: Use fabs in Abs_Float

Bug: 120944950
Test: lvm/tests/build_and_run_all_unit_tests.sh
Test: lvm/tests/build_and_run_all_unit_tests_reverb.sh

Change-Id: Ie8d7deda7cea39535814abd7ba5bb924d25c4d7c
parent f18593bf
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -75,7 +75,6 @@ cc_library_static {
        "Common/src/dB_to_Lin32.cpp",
        "Common/src/Shift_Sat_v16xv16.cpp",
        "Common/src/Shift_Sat_v32xv32.cpp",
        "Common/src/Abs_32.cpp",
        "Common/src/From2iToMono_32.cpp",
        "Common/src/Mult3s_32x16.cpp",
        "Common/src/NonLinComp_D16.cpp",
@@ -158,7 +157,6 @@ cc_library_static {
        "Reverb/src/LVREV_Process.cpp",
        "Reverb/src/LVREV_SetControlParameters.cpp",
        "Reverb/src/LVREV_Tables.cpp",
        "Common/src/Abs_32.cpp",
        "Common/src/InstAlloc.cpp",
        "Common/src/LoadConst_32.cpp",
        "Common/src/From2iToMono_32.cpp",
+4 −2
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@
/*######################################################################################*/
/*  Include files                                                                       */
/*######################################################################################*/

#include <math.h>
#include "LVM_Types.h"

/*######################################################################################*/
@@ -30,7 +30,9 @@

/* Absolute value including the corner case for the extreme negative value */

LVM_FLOAT Abs_Float(LVM_FLOAT input);
static inline LVM_FLOAT Abs_Float(LVM_FLOAT input) {
    return fabs(input);
}

/****************************************************************************************
 *  Name        : dB_to_Lin32()
+0 −30
Original line number Diff line number Diff line
/*
 * Copyright (C) 2004-2010 NXP Software
 * Copyright (C) 2010 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/*######################################################################################*/
/*  Include files                                                                       */
/*######################################################################################*/

#include "ScalarArithmetic.h"

LVM_FLOAT Abs_Float(LVM_FLOAT input) {
    if (input < 0) {
        /* Negative input, so invert */
        input = (LVM_FLOAT)(-input);
    }
    return input;
}