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

Commit f8b667fd authored by Glenn Kasten's avatar Glenn Kasten
Browse files

Use mul from audioutils

I verified that the disassembled output is identical.

Change-Id: I34a76f0842ebc4aef2c923e079e38d0bc1f98b5c
parent f4aaf1f5
Loading
Loading
Loading
Loading
+0 −15
Original line number Diff line number Diff line
@@ -2505,21 +2505,6 @@ AudioFlinger::DirectOutputThread::~DirectOutputThread()
{
}

static inline
int32_t mul(int16_t in, int16_t v)
{
#if defined(__arm__) && !defined(__thumb__)
    int32_t out;
    asm( "smulbb %[out], %[in], %[v] \n"
         : [out]"=r"(out)
         : [in]"%r"(in), [v]"r"(v)
         : );
    return out;
#else
    return in * int32_t(v);
#endif
}

void AudioFlinger::DirectOutputThread::applyVolume(uint16_t leftVol, uint16_t rightVol, bool ramp)
{
    // Do not apply volume on compressed audio