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

Commit ff81743e authored by Andy Hung's avatar Andy Hung Committed by Automerger Merge Worker
Browse files

Merge "libeffects: Replace LoadConst_Float with memset for 0 loading." am:...

Merge "libeffects: Replace LoadConst_Float with memset for 0 loading." am: c293b926 am: c7a3fc10 am: fdd1f6bd

Original change: https://android-review.googlesource.com/c/platform/frameworks/av/+/1677105

Change-Id: I081750d2ac72759f1c2a98d5977deaa15524dc91
parents d9996aa2 fdd1f6bd
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -63,7 +63,6 @@ cc_library_static {
        "Common/src/DC_2I_D16_TRC_WRA_01_Init.cpp",
        "Common/src/Copy_16.cpp",
        "Common/src/MonoTo2I_32.cpp",
        "Common/src/LoadConst_32.cpp",
        "Common/src/dB_to_Lin32.cpp",
        "Common/src/Shift_Sat_v16xv16.cpp",
        "Common/src/Shift_Sat_v32xv32.cpp",
@@ -148,7 +147,6 @@ cc_library_static {
        "Reverb/src/LVREV_Process.cpp",
        "Reverb/src/LVREV_SetControlParameters.cpp",
        "Reverb/src/LVREV_Tables.cpp",
        "Common/src/LoadConst_32.cpp",
        "Common/src/From2iToMono_32.cpp",
        "Common/src/Mult3s_32x16.cpp",
        "Common/src/Copy_16.cpp",
+3 −3
Original line number Diff line number Diff line
@@ -137,9 +137,9 @@ LVM_ReturnStatus_en LVM_GetInstanceHandle(LVM_Handle_t* phInstance, LVM_InstPara

        pInstance->pBufferManagement->pScratch = (LVM_FLOAT*)pInstance->pScratch;

        LoadConst_Float(0, /* Clear the input delay buffer */
                        (LVM_FLOAT*)&pInstance->pBufferManagement->InDelayBuffer,
                        (LVM_INT16)(LVM_MAX_CHANNELS * MIN_INTERNAL_BLOCKSIZE));
        memset(pInstance->pBufferManagement->InDelayBuffer, 0,
                LVM_MAX_CHANNELS * MIN_INTERNAL_BLOCKSIZE *
                sizeof(pInstance->pBufferManagement->InDelayBuffer[0]));
        pInstance->pBufferManagement->InDelaySamples =
                MIN_INTERNAL_BLOCKSIZE;                    /* Set the number of delay samples */
        pInstance->pBufferManagement->OutDelaySamples = 0; /* No samples in the output buffer */
+0 −2
Original line number Diff line number Diff line
@@ -24,8 +24,6 @@
    VARIOUS FUNCTIONS
***********************************************************************************/

void LoadConst_Float(const LVM_FLOAT val, LVM_FLOAT* dst, LVM_INT16 n);

void Copy_Float(const LVM_FLOAT* src, LVM_FLOAT* dst, LVM_INT16 n);
void Copy_Float_Mc_Stereo(const LVM_FLOAT* src, LVM_FLOAT* dst, LVM_INT16 NrFrames,
                          LVM_INT32 NrChannels);
+3 −2
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@
   INCLUDE FILES
***********************************************************************************/

#include <string.h>
#include "LVC_Mixer_Private.h"
#include "VectorArithmetic.h"
#include "ScalarArithmetic.h"
@@ -68,7 +69,7 @@ void LVC_MixSoft_1St_D16C31_SAT(LVMixer3_1St_FLOAT_st* ptrInstance, const LVM_FL

    if (HardMixing) {
        if (pInstance->Target == 0)
            LoadConst_Float(0.0, dst, n);
            memset(dst, 0, n * sizeof(*dst));
        else {
            if ((pInstance->Target) != 1.0f)
                Mult3s_Float(src, (pInstance->Target), dst, n);
@@ -150,7 +151,7 @@ void LVC_MixSoft_Mc_D16C31_SAT(LVMixer3_1St_FLOAT_st* ptrInstance, const LVM_FLO

    if (HardMixing) {
        if (pInstance->Target == 0)
            LoadConst_Float(0.0, dst, NrFrames * NrChannels);
            memset(dst, 0, NrFrames * NrChannels * sizeof(*dst));
        else {
            if ((pInstance->Target) != 1.0f)
                Mult3s_Float(src, (pInstance->Target), dst, NrFrames * NrChannels);
+0 −38
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 "VectorArithmetic.h"

/**********************************************************************************
   FUNCTION LoadConst_32
***********************************************************************************/
void LoadConst_Float(const LVM_FLOAT val, LVM_FLOAT* dst, LVM_INT16 n) {
    LVM_INT16 ii;

    for (ii = n; ii != 0; ii--) {
        *dst = val;
        dst++;
    }

    return;
}

/**********************************************************************************/
Loading