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

Commit 26f4c378 authored by Sneha Patil's avatar Sneha Patil
Browse files

ReverbContext: Add Bypass Functionality

Skip processing when bypass is set to true

Bug: 305866207
Test: atest VtsHalEnvironmentalReverbTargetTest
Change-Id: Ia0d5693c37f68a4fa5679a98b6842949797465cd
parent 5e742388
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@
#define LOG_TAG "ReverbContext"
#include <android-base/logging.h>
#include <Utils.h>
#include <audio_utils/primitives.h>

#include "ReverbContext.h"
#include "VectorArithmetic.h"
@@ -347,6 +348,15 @@ IEffect::Status ReverbContext::process(float* in, float* out, int samples) {
            mCommon.output.base.channelMask);
    int frameCount = mCommon.input.frameCount;

    if (mBypass) {
        if (isAuxiliary()) {
            memset(out, 0, getOutputFrameSize() * frameCount);
        } else {
            memcpy_to_float_from_float_with_clamping(out, in, samples, 1);
        }
        return {STATUS_OK, samples, outChannels * frameCount};
    }

    // Reverb only effects the stereo channels in multichannel source.
    if (channels < 1 || channels > LVM_MAX_CHANNELS) {
        LOG(ERROR) << __func__ << " process invalid PCM channels " << channels;