Merge "MediaTesting: Add Mpeg4 H263 Encoder Test"
diff --git a/apex/testing/Android.bp b/apex/testing/Android.bp
index 477c371..376d3e4 100644
--- a/apex/testing/Android.bp
+++ b/apex/testing/Android.bp
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-apex {
+apex_test {
name: "test_com.android.media",
manifest: "test_manifest.json",
file_contexts: ":com.android.media-file_contexts",
@@ -20,7 +20,7 @@
installable: false,
}
-apex {
+apex_test {
name: "test_com.android.media.swcodec",
manifest: "test_manifest_codec.json",
file_contexts: ":com.android.media.swcodec-file_contexts",
diff --git a/camera/include/camera/VendorTagDescriptor.h b/camera/include/camera/VendorTagDescriptor.h
index 6f55890..b2fbf3a 100644
--- a/camera/include/camera/VendorTagDescriptor.h
+++ b/camera/include/camera/VendorTagDescriptor.h
@@ -188,8 +188,8 @@
sp<android::VendorTagDescriptor> *desc /*out*/);
// Parcelable interface
- status_t writeToParcel(Parcel* parcel) const override;
- status_t readFromParcel(const Parcel* parcel) override;
+ status_t writeToParcel(android::Parcel* parcel) const override;
+ status_t readFromParcel(const android::Parcel* parcel) override;
// Returns the number of vendor tags defined.
int getTagCount(metadata_vendor_id_t id) const;
diff --git a/media/codec2/hidl/1.0/utils/Android.bp b/media/codec2/hidl/1.0/utils/Android.bp
index bdff29a..a2930a6 100644
--- a/media/codec2/hidl/1.0/utils/Android.bp
+++ b/media/codec2/hidl/1.0/utils/Android.bp
@@ -63,6 +63,7 @@
],
header_libs: [
+ "libbinder_headers",
"libsystem_headers",
"libcodec2_internal", // private
],
diff --git a/media/codec2/hidl/client/client.cpp b/media/codec2/hidl/client/client.cpp
index c620bad..c747190 100644
--- a/media/codec2/hidl/client/client.cpp
+++ b/media/codec2/hidl/client/client.cpp
@@ -125,6 +125,9 @@
if (!mClient) {
mClient = Codec2Client::_CreateFromIndex(mIndex);
}
+ CHECK(mClient) << "Failed to create Codec2Client to service \""
+ << GetServiceNames()[mIndex] << "\". (Index = "
+ << mIndex << ").";
return mClient;
}
@@ -832,6 +835,7 @@
c2_status_t Codec2Client::ForAllServices(
const std::string &key,
+ size_t numberOfAttempts,
std::function<c2_status_t(const std::shared_ptr<Codec2Client>&)>
predicate) {
c2_status_t status = C2_NO_INIT; // no IComponentStores present
@@ -860,23 +864,31 @@
for (size_t index : indices) {
Cache& cache = Cache::List()[index];
- std::shared_ptr<Codec2Client> client{cache.getClient()};
- if (client) {
+ for (size_t tries = numberOfAttempts; tries > 0; --tries) {
+ std::shared_ptr<Codec2Client> client{cache.getClient()};
status = predicate(client);
if (status == C2_OK) {
std::scoped_lock lock{key2IndexMutex};
key2Index[key] = index; // update last known client index
return C2_OK;
+ } else if (status == C2_TRANSACTION_FAILED) {
+ LOG(WARNING) << "\"" << key << "\" failed for service \""
+ << client->getName()
+ << "\" due to transaction failure. "
+ << "(Service may have crashed.)"
+ << (tries > 1 ? " Retrying..." : "");
+ cache.invalidate();
+ continue;
}
- }
- if (wasMapped) {
- LOG(INFO) << "Could not find \"" << key << "\""
- " in the last instance. Retrying...";
- wasMapped = false;
- cache.invalidate();
+ if (wasMapped) {
+ LOG(INFO) << "\"" << key << "\" became invalid in service \""
+ << client->getName() << "\". Retrying...";
+ wasMapped = false;
+ }
+ break;
}
}
- return status; // return the last status from a valid client
+ return status; // return the last status from a valid client
}
std::shared_ptr<Codec2Client::Component>
@@ -885,35 +897,37 @@
const std::shared_ptr<Listener>& listener,
std::shared_ptr<Codec2Client>* owner,
size_t numberOfAttempts) {
- while (true) {
- std::shared_ptr<Component> component;
- c2_status_t status = ForAllServices(
- componentName,
- [owner, &component, componentName, &listener](
- const std::shared_ptr<Codec2Client> &client)
- -> c2_status_t {
- c2_status_t status = client->createComponent(componentName,
- listener,
- &component);
- if (status == C2_OK) {
- if (owner) {
- *owner = client;
- }
- } else if (status != C2_NOT_FOUND) {
- LOG(DEBUG) << "IComponentStore("
- << client->getServiceName()
- << ")::createComponent(\"" << componentName
- << "\") returned status = "
- << status << ".";
+ std::string key{"create:"};
+ key.append(componentName);
+ std::shared_ptr<Component> component;
+ c2_status_t status = ForAllServices(
+ key,
+ numberOfAttempts,
+ [owner, &component, componentName, &listener](
+ const std::shared_ptr<Codec2Client> &client)
+ -> c2_status_t {
+ c2_status_t status = client->createComponent(componentName,
+ listener,
+ &component);
+ if (status == C2_OK) {
+ if (owner) {
+ *owner = client;
}
- return status;
- });
- if (numberOfAttempts > 0 && status == C2_TRANSACTION_FAILED) {
- --numberOfAttempts;
- continue;
- }
- return component;
+ } else if (status != C2_NOT_FOUND) {
+ LOG(DEBUG) << "IComponentStore("
+ << client->getServiceName()
+ << ")::createComponent(\"" << componentName
+ << "\") returned status = "
+ << status << ".";
+ }
+ return status;
+ });
+ if (status != C2_OK) {
+ LOG(DEBUG) << "Failed to create component \"" << componentName
+ << "\" from all known services. "
+ "Last returned status = " << status << ".";
}
+ return component;
}
std::shared_ptr<Codec2Client::Interface>
@@ -921,34 +935,36 @@
const char* interfaceName,
std::shared_ptr<Codec2Client>* owner,
size_t numberOfAttempts) {
- while (true) {
- std::shared_ptr<Interface> interface;
- c2_status_t status = ForAllServices(
- interfaceName,
- [owner, &interface, interfaceName](
- const std::shared_ptr<Codec2Client> &client)
- -> c2_status_t {
- c2_status_t status = client->createInterface(interfaceName,
- &interface);
- if (status == C2_OK) {
- if (owner) {
- *owner = client;
- }
- } else if (status != C2_NOT_FOUND) {
- LOG(DEBUG) << "IComponentStore("
- << client->getServiceName()
- << ")::createInterface(\"" << interfaceName
- << "\") returned status = "
- << status << ".";
+ std::string key{"create:"};
+ key.append(interfaceName);
+ std::shared_ptr<Interface> interface;
+ c2_status_t status = ForAllServices(
+ key,
+ numberOfAttempts,
+ [owner, &interface, interfaceName](
+ const std::shared_ptr<Codec2Client> &client)
+ -> c2_status_t {
+ c2_status_t status = client->createInterface(interfaceName,
+ &interface);
+ if (status == C2_OK) {
+ if (owner) {
+ *owner = client;
}
- return status;
- });
- if (numberOfAttempts > 0 && status == C2_TRANSACTION_FAILED) {
- --numberOfAttempts;
- continue;
- }
- return interface;
+ } else if (status != C2_NOT_FOUND) {
+ LOG(DEBUG) << "IComponentStore("
+ << client->getServiceName()
+ << ")::createInterface(\"" << interfaceName
+ << "\") returned status = "
+ << status << ".";
+ }
+ return status;
+ });
+ if (status != C2_OK) {
+ LOG(DEBUG) << "Failed to create interface \"" << interfaceName
+ << "\" from all known services. "
+ "Last returned status = " << status << ".";
}
+ return interface;
}
std::vector<C2Component::Traits> const& Codec2Client::ListComponents() {
diff --git a/media/codec2/hidl/client/include/codec2/hidl/client.h b/media/codec2/hidl/client/include/codec2/hidl/client.h
index 848901d..c37407f 100644
--- a/media/codec2/hidl/client/include/codec2/hidl/client.h
+++ b/media/codec2/hidl/client/include/codec2/hidl/client.h
@@ -208,11 +208,25 @@
protected:
sp<Base> mBase;
- // Finds the first store where the predicate returns OK, and returns the last
- // predicate result. Uses key to remember the last store found, and if cached,
- // it tries that store before trying all stores (one retry).
+ // Finds the first store where the predicate returns C2_OK and returns the
+ // last predicate result. The predicate will be tried on all stores. The
+ // function will return C2_OK the first time the predicate returns C2_OK,
+ // or it will return the value from the last time that predicate is tried.
+ // (The latter case corresponds to a failure on every store.) The order of
+ // the stores to try is the same as the return value of GetServiceNames().
+ //
+ // key is used to remember the last store with which the predicate last
+ // succeeded. If the last successful store is cached, it will be tried
+ // first before all the stores are tried. Note that the last successful
+ // store will be tried twice---first before all the stores, and another time
+ // with all the stores.
+ //
+ // If an attempt to evaluate the predicate results in a transaction failure,
+ // repeated attempts will be made until the predicate returns without a
+ // transaction failure or numberOfAttempts attempts have been made.
static c2_status_t ForAllServices(
const std::string& key,
+ size_t numberOfAttempts,
std::function<c2_status_t(std::shared_ptr<Codec2Client> const&)>
predicate);
diff --git a/media/codec2/vndk/Android.bp b/media/codec2/vndk/Android.bp
index 6fbad0a..52cc7ad 100644
--- a/media/codec2/vndk/Android.bp
+++ b/media/codec2/vndk/Android.bp
@@ -71,8 +71,6 @@
"libutils",
],
- tidy: false, // b/146435095, clang-tidy segmentation fault
-
cflags: [
"-Werror",
"-Wall",
diff --git a/media/extractors/tests/AndroidTest.xml b/media/extractors/tests/AndroidTest.xml
new file mode 100644
index 0000000..6bb2c8a
--- /dev/null
+++ b/media/extractors/tests/AndroidTest.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2020 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.
+-->
+<configuration description="Test module config for extractor unit tests">
+ <option name="test-suite-tag" value="ExtractorUnitTest" />
+ <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
+ <option name="cleanup" value="true" />
+ <option name="push" value="ExtractorUnitTest->/data/local/tmp/ExtractorUnitTest" />
+ <option name="push-file"
+ key="https://storage.googleapis.com/android_media/frameworks/av/media/extractors/tests/extractor.zip?unzip=true"
+ value="/data/local/tmp/ExtractorUnitTestRes/" />
+ </target_preparer>
+
+ <test class="com.android.tradefed.testtype.GTest" >
+ <option name="native-test-device-path" value="/data/local/tmp" />
+ <option name="module-name" value="ExtractorUnitTest" />
+ <option name="native-test-flag" value="-P /data/local/tmp/ExtractorUnitTestRes/" />
+ </test>
+</configuration>
diff --git a/media/extractors/tests/README.md b/media/extractors/tests/README.md
index 6e02d3e..69538b6 100644
--- a/media/extractors/tests/README.md
+++ b/media/extractors/tests/README.md
@@ -22,8 +22,8 @@
adb push ${OUT}/data/nativetest/ExtractorUnitTest/ExtractorUnitTest /data/local/tmp/
```
-The resource file for the tests is taken from [here](https://drive.google.com/drive/folders/1Z9nCIRB6pGLvb5mPkF8BURa5Nc6cY9pY). Push these files into device for testing.
-Download extractor folder and push all the files in this folder to /data/local/tmp/ on the device.
+The resource file for the tests is taken from [here](https://storage.googleapis.com/android_media/frameworks/av/media/extractors/tests/extractor.zip). Download, unzip and push these files into device for testing.
+
```
adb push extractor /data/local/tmp/
```
@@ -32,3 +32,8 @@
```
adb shell /data/local/tmp/ExtractorUnitTest -P /data/local/tmp/extractor/
```
+Alternatively, the test can also be run using atest command.
+
+```
+atest ExtractorUnitTest -- --enable-module-dynamic-download=true
+```
diff --git a/media/libaudiohal/Android.bp b/media/libaudiohal/Android.bp
index 74b48f3..1709d1e 100644
--- a/media/libaudiohal/Android.bp
+++ b/media/libaudiohal/Android.bp
@@ -4,6 +4,7 @@
srcs: [
"DevicesFactoryHalInterface.cpp",
"EffectsFactoryHalInterface.cpp",
+ "FactoryHalHidl.cpp",
],
cflags: [
@@ -12,11 +13,17 @@
"-Werror",
],
- shared_libs: [
+ required: [
"libaudiohal@2.0",
"libaudiohal@4.0",
"libaudiohal@5.0",
"libaudiohal@6.0",
+ ],
+
+ shared_libs: [
+ "libdl",
+ "libhidlbase",
+ "liblog",
"libutils",
],
diff --git a/media/libaudiohal/DevicesFactoryHalInterface.cpp b/media/libaudiohal/DevicesFactoryHalInterface.cpp
index d5336fa..325a547 100644
--- a/media/libaudiohal/DevicesFactoryHalInterface.cpp
+++ b/media/libaudiohal/DevicesFactoryHalInterface.cpp
@@ -14,16 +14,15 @@
* limitations under the License.
*/
-#include <libaudiohal/FactoryHalHidl.h>
-
#include <media/audiohal/DevicesFactoryHalInterface.h>
+#include <media/audiohal/FactoryHalHidl.h>
namespace android {
// static
sp<DevicesFactoryHalInterface> DevicesFactoryHalInterface::create() {
- return createPreferedImpl<DevicesFactoryHalInterface>();
+ return createPreferredImpl<DevicesFactoryHalInterface>(
+ "android.hardware.audio", "IDevicesFactory");
}
} // namespace android
-
diff --git a/media/libaudiohal/EffectsFactoryHalInterface.cpp b/media/libaudiohal/EffectsFactoryHalInterface.cpp
index d15b14e..bc3b4c1 100644
--- a/media/libaudiohal/EffectsFactoryHalInterface.cpp
+++ b/media/libaudiohal/EffectsFactoryHalInterface.cpp
@@ -14,15 +14,15 @@
* limitations under the License.
*/
-#include <libaudiohal/FactoryHalHidl.h>
-
#include <media/audiohal/EffectsFactoryHalInterface.h>
+#include <media/audiohal/FactoryHalHidl.h>
namespace android {
// static
sp<EffectsFactoryHalInterface> EffectsFactoryHalInterface::create() {
- return createPreferedImpl<EffectsFactoryHalInterface>();
+ return createPreferredImpl<EffectsFactoryHalInterface>(
+ "android.hardware.audio.effect", "IEffectsFactory");
}
// static
diff --git a/media/libaudiohal/FactoryHalHidl.cpp b/media/libaudiohal/FactoryHalHidl.cpp
new file mode 100644
index 0000000..5985ef0
--- /dev/null
+++ b/media/libaudiohal/FactoryHalHidl.cpp
@@ -0,0 +1,107 @@
+/*
+ * Copyright (C) 2020 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.
+ */
+
+#define LOG_TAG "FactoryHalHidl"
+
+#include <media/audiohal/FactoryHalHidl.h>
+
+#include <dlfcn.h>
+
+#include <android/hidl/manager/1.0/IServiceManager.h>
+#include <hidl/ServiceManagement.h>
+#include <hidl/Status.h>
+#include <utils/Log.h>
+
+namespace android::detail {
+
+namespace {
+/** Supported HAL versions, in order of preference.
+ */
+const char* sAudioHALVersions[] = {
+ "6.0",
+ "5.0",
+ "4.0",
+ "2.0",
+ nullptr
+};
+
+bool createHalService(const std::string& version, const std::string& interface,
+ void** rawInterface) {
+ const std::string libName = "libaudiohal@" + version + ".so";
+ const std::string factoryFunctionName = "create" + interface;
+ constexpr int dlMode = RTLD_LAZY;
+ void* handle = nullptr;
+ dlerror(); // clear
+ handle = dlopen(libName.c_str(), dlMode);
+ if (handle == nullptr) {
+ const char* error = dlerror();
+ ALOGE("Failed to dlopen %s: %s", libName.c_str(),
+ error != nullptr ? error : "unknown error");
+ return false;
+ }
+ void* (*factoryFunction)();
+ *(void **)(&factoryFunction) = dlsym(handle, factoryFunctionName.c_str());
+ if (!factoryFunction) {
+ const char* error = dlerror();
+ ALOGE("Factory function %s not found in library %s: %s",
+ factoryFunctionName.c_str(), libName.c_str(),
+ error != nullptr ? error : "unknown error");
+ dlclose(handle);
+ return false;
+ }
+ *rawInterface = (*factoryFunction)();
+ ALOGW_IF(!*rawInterface, "Factory function %s from %s returned nullptr",
+ factoryFunctionName.c_str(), libName.c_str());
+ return true;
+}
+
+bool hasHalService(const std::string& package, const std::string& version,
+ const std::string& interface) {
+ using ::android::hidl::manager::V1_0::IServiceManager;
+ sp<IServiceManager> sm = ::android::hardware::defaultServiceManager();
+ if (!sm) {
+ ALOGE("Failed to obtain HIDL ServiceManager");
+ return false;
+ }
+ // Since audio HAL doesn't support multiple clients, avoid instantiating
+ // the interface right away. Instead, query the transport type for it.
+ using ::android::hardware::Return;
+ using Transport = IServiceManager::Transport;
+ const std::string fqName = package + "@" + version + "::" + interface;
+ const std::string instance = "default";
+ Return<Transport> transport = sm->getTransport(fqName, instance);
+ if (!transport.isOk()) {
+ ALOGE("Failed to obtain transport type for %s/%s: %s",
+ fqName.c_str(), instance.c_str(), transport.description().c_str());
+ return false;
+ }
+ return transport != Transport::EMPTY;
+}
+
+} // namespace
+
+void* createPreferredImpl(const std::string& package, const std::string& interface) {
+ for (auto version = detail::sAudioHALVersions; version != nullptr; ++version) {
+ void* rawInterface = nullptr;
+ if (hasHalService(package, *version, interface)
+ && createHalService(*version, interface, &rawInterface)) {
+ return rawInterface;
+ }
+ }
+ return nullptr;
+}
+
+} // namespace android::detail
diff --git a/media/libaudiohal/impl/Android.bp b/media/libaudiohal/impl/Android.bp
index e96a68c..967fba1 100644
--- a/media/libaudiohal/impl/Android.bp
+++ b/media/libaudiohal/impl/Android.bp
@@ -16,12 +16,11 @@
"StreamHalHidl.cpp",
],
- export_include_dirs: ["include"],
-
cflags: [
"-Wall",
"-Wextra",
"-Werror",
+ "-fvisibility=hidden",
],
shared_libs: [
"android.hardware.audio.common-util",
diff --git a/media/libaudiohal/impl/DevicesFactoryHalHidl.cpp b/media/libaudiohal/impl/DevicesFactoryHalHidl.cpp
index c30da3c..e6e9688 100644
--- a/media/libaudiohal/impl/DevicesFactoryHalHidl.cpp
+++ b/media/libaudiohal/impl/DevicesFactoryHalHidl.cpp
@@ -20,7 +20,7 @@
#define LOG_TAG "DevicesFactoryHalHidl"
//#define LOG_NDEBUG 0
-#include "android/hidl/manager/1.0/IServiceManager.h"
+#include <android/hidl/manager/1.0/IServiceManager.h>
#include PATH(android/hardware/audio/FILE_VERSION/IDevice.h)
#include <media/audiohal/hidl/HalDeathHandler.h>
#include <utils/Log.h>
diff --git a/media/libaudiohal/impl/DevicesFactoryHalHybrid.cpp b/media/libaudiohal/impl/DevicesFactoryHalHybrid.cpp
index a5aef1b..52f150a 100644
--- a/media/libaudiohal/impl/DevicesFactoryHalHybrid.cpp
+++ b/media/libaudiohal/impl/DevicesFactoryHalHybrid.cpp
@@ -20,7 +20,6 @@
#include "DevicesFactoryHalHidl.h"
#include "DevicesFactoryHalHybrid.h"
#include "DevicesFactoryHalLocal.h"
-#include <libaudiohal/FactoryHalHidl.h>
namespace android {
namespace CPP_VERSION {
@@ -47,8 +46,7 @@
} // namespace CPP_VERSION
-template <>
-sp<DevicesFactoryHalInterface> createFactoryHal<AudioHALVersion::CPP_VERSION>() {
+extern "C" __attribute__((visibility("default"))) void* createIDevicesFactory() {
auto service = hardware::audio::CPP_VERSION::IDevicesFactory::getService();
return service ? new CPP_VERSION::DevicesFactoryHalHybrid(service) : nullptr;
}
diff --git a/media/libaudiohal/impl/EffectsFactoryHalHidl.cpp b/media/libaudiohal/impl/EffectsFactoryHalHidl.cpp
index 867b72d..9192a31 100644
--- a/media/libaudiohal/impl/EffectsFactoryHalHidl.cpp
+++ b/media/libaudiohal/impl/EffectsFactoryHalHidl.cpp
@@ -24,7 +24,6 @@
#include "EffectHalHidl.h"
#include "EffectsFactoryHalHidl.h"
#include "HidlUtils.h"
-#include <libaudiohal/FactoryHalHidl.h>
using ::android::hardware::audio::common::CPP_VERSION::implementation::HidlUtils;
using ::android::hardware::Return;
@@ -162,8 +161,7 @@
} // namespace CPP_VERSION
} // namespace effect
-template<>
-sp<EffectsFactoryHalInterface> createFactoryHal<AudioHALVersion::CPP_VERSION>() {
+extern "C" __attribute__((visibility("default"))) void* createIEffectsFactory() {
auto service = hardware::audio::effect::CPP_VERSION::IEffectsFactory::getService();
return service ? new effect::CPP_VERSION::EffectsFactoryHalHidl(service) : nullptr;
}
diff --git a/media/libaudiohal/impl/include/libaudiohal/FactoryHalHidl.h b/media/libaudiohal/impl/include/libaudiohal/FactoryHalHidl.h
deleted file mode 100644
index 271bafc..0000000
--- a/media/libaudiohal/impl/include/libaudiohal/FactoryHalHidl.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright (C) 2018 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.
- */
-
-#ifndef ANDROID_HARDWARE_FACTORY_HAL_HIDL_H
-#define ANDROID_HARDWARE_FACTORY_HAL_HIDL_H
-
-/** @file Library entry points to create the HAL factories. */
-
-#include <media/audiohal/DevicesFactoryHalInterface.h>
-#include <media/audiohal/EffectsFactoryHalInterface.h>
-#include <utils/StrongPointer.h>
-
-#include <array>
-#include <utility>
-
-namespace android {
-
-/** Supported HAL versions, in order of preference.
- * Implementation should use specialize the `create*FactoryHal` for their version.
- * Client should use `createPreferedImpl<*FactoryHal>()` to instantiate
- * the preferred available impl.
- */
-enum class AudioHALVersion {
- V6_0,
- V5_0,
- V4_0,
- V2_0,
- end, // used for iterating over supported versions
-};
-
-/** Template function to fully specialized for each version and each Interface. */
-template <AudioHALVersion, class Interface>
-sp<Interface> createFactoryHal();
-
-/** @Return the preferred available implementation or nullptr if none are available. */
-template <class Interface, AudioHALVersion version = AudioHALVersion{}>
-static sp<Interface> createPreferedImpl() {
- if constexpr (version == AudioHALVersion::end) {
- return nullptr; // tried all version, all returned nullptr
- } else {
- if (auto created = createFactoryHal<version, Interface>(); created != nullptr) {
- return created;
- }
-
- using Raw = std::underlying_type_t<AudioHALVersion>; // cast as enum class do not support ++
- return createPreferedImpl<Interface, AudioHALVersion(Raw(version) + 1)>();
- }
-}
-
-
-} // namespace android
-
-#endif // ANDROID_HARDWARE_FACTORY_HAL_HIDL_H
diff --git a/media/libaudiohal/include/media/audiohal/FactoryHalHidl.h b/media/libaudiohal/include/media/audiohal/FactoryHalHidl.h
new file mode 100644
index 0000000..d353ed0
--- /dev/null
+++ b/media/libaudiohal/include/media/audiohal/FactoryHalHidl.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2018 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.
+ */
+
+#ifndef ANDROID_HARDWARE_FACTORY_HAL_HIDL_H
+#define ANDROID_HARDWARE_FACTORY_HAL_HIDL_H
+
+#include <string>
+
+#include <utils/StrongPointer.h>
+
+namespace android {
+
+namespace detail {
+
+void* createPreferredImpl(const std::string& package, const std::string& interface);
+
+} // namespace detail
+
+/** @Return the preferred available implementation or nullptr if none are available. */
+template <class Interface>
+static sp<Interface> createPreferredImpl(const std::string& package, const std::string& interface) {
+ return sp<Interface>{static_cast<Interface*>(detail::createPreferredImpl(package, interface))};
+}
+
+} // namespace android
+
+#endif // ANDROID_HARDWARE_FACTORY_HAL_HIDL_H
diff --git a/media/libaudioprocessing/Android.bp b/media/libaudioprocessing/Android.bp
index 9b5d58c..e756ada 100644
--- a/media/libaudioprocessing/Android.bp
+++ b/media/libaudioprocessing/Android.bp
@@ -19,6 +19,25 @@
// uncomment to disable NEON on architectures that actually do support NEON, for benchmarking
// "-DUSE_NEON=false",
],
+
+ arch: {
+ x86: {
+ avx2: {
+ cflags: [
+ "-mavx2",
+ "-mfma",
+ ],
+ },
+ },
+ x86_64: {
+ avx2: {
+ cflags: [
+ "-mavx2",
+ "-mfma",
+ ],
+ },
+ },
+ },
}
cc_library_shared {
diff --git a/media/libaudioprocessing/AudioResamplerFirOps.h b/media/libaudioprocessing/AudioResamplerFirOps.h
index 2e4cee3..a3f5ff5 100644
--- a/media/libaudioprocessing/AudioResamplerFirOps.h
+++ b/media/libaudioprocessing/AudioResamplerFirOps.h
@@ -36,13 +36,20 @@
#include <arm_neon.h>
#endif
-#if defined(__SSSE3__) // Should be supported in x86 ABI for both 32 & 64-bit.
+#if defined(__AVX2__) // Should be supported in x86 ABI for both 32 & 64-bit.
+#define USE_AVX2 (true) // Inference AVX2/FMA Intrinsics
#define USE_SSE (true)
+#include <immintrin.h>
+#elif defined(__SSSE3__) // Should be supported in x86 ABI for both 32 & 64-bit.
+#define USE_SSE (true) // Inference SSE Intrinsics
+#define USE_AVX2 (false)
#include <tmmintrin.h>
#else
#define USE_SSE (false)
+#define USE_AVX2(false)
#endif
+
template<typename T, typename U>
struct is_same
{
diff --git a/media/libaudioprocessing/AudioResamplerFirProcessSSE.h b/media/libaudioprocessing/AudioResamplerFirProcessSSE.h
index 30233b5..1c16bc4 100644
--- a/media/libaudioprocessing/AudioResamplerFirProcessSSE.h
+++ b/media/libaudioprocessing/AudioResamplerFirProcessSSE.h
@@ -80,11 +80,16 @@
posCoef1 = _mm_sub_ps(posCoef1, posCoef);
negCoef = _mm_sub_ps(negCoef, negCoef1);
+
+ #if USE_AVX2
+ posCoef = _mm_fmadd_ps(posCoef1, interp, posCoef);
+ negCoef = _mm_fmadd_ps(negCoef, interp, negCoef1);
+ #else
posCoef1 = _mm_mul_ps(posCoef1, interp);
negCoef = _mm_mul_ps(negCoef, interp);
-
posCoef = _mm_add_ps(posCoef1, posCoef);
negCoef = _mm_add_ps(negCoef, negCoef1);
+ #endif //USE_AVX2
}
switch (CHANNELS) {
case 1: {
@@ -94,11 +99,17 @@
sN += 4;
posSamp = _mm_shuffle_ps(posSamp, posSamp, 0x1B);
+
+ #if USE_AVX2
+ accL = _mm_fmadd_ps(posSamp, posCoef, accL);
+ accL = _mm_fmadd_ps(negSamp, negCoef, accL);
+ #else
posSamp = _mm_mul_ps(posSamp, posCoef);
negSamp = _mm_mul_ps(negSamp, negCoef);
-
accL = _mm_add_ps(accL, posSamp);
accL = _mm_add_ps(accL, negSamp);
+ #endif
+
} break;
case 2: {
__m128 posSamp0 = _mm_loadu_ps(sP);
@@ -114,15 +125,23 @@
__m128 negSampL = _mm_shuffle_ps(negSamp0, negSamp1, 0x88);
__m128 negSampR = _mm_shuffle_ps(negSamp0, negSamp1, 0xDD);
- posSampL = _mm_mul_ps(posSampL, posCoef);
- posSampR = _mm_mul_ps(posSampR, posCoef);
- negSampL = _mm_mul_ps(negSampL, negCoef);
- negSampR = _mm_mul_ps(negSampR, negCoef);
+ #if USE_AVX2
+ accL = _mm_fmadd_ps(posSampL, posCoef, accL);
+ accR = _mm_fmadd_ps(posSampR, posCoef, accR);
+ accL = _mm_fmadd_ps(negSampL, negCoef, accL);
+ accR = _mm_fmadd_ps(negSampR, negCoef, accR);
+ #else
+ posSampL = _mm_mul_ps(posSampL, posCoef);
+ posSampR = _mm_mul_ps(posSampR, posCoef);
+ negSampL = _mm_mul_ps(negSampL, negCoef);
+ negSampR = _mm_mul_ps(negSampR, negCoef);
- accL = _mm_add_ps(accL, posSampL);
- accR = _mm_add_ps(accR, posSampR);
- accL = _mm_add_ps(accL, negSampL);
- accR = _mm_add_ps(accR, negSampR);
+ accL = _mm_add_ps(accL, posSampL);
+ accR = _mm_add_ps(accR, posSampR);
+ accL = _mm_add_ps(accL, negSampL);
+ accR = _mm_add_ps(accR, negSampR);
+ #endif
+
} break;
}
} while (count -= 4);
@@ -144,9 +163,13 @@
outAccum = _mm_hadd_ps(accL, accR);
outAccum = _mm_hadd_ps(outAccum, outAccum);
}
-
+ #if USE_AVX2
+ outSamp = _mm_fmadd_ps(outAccum, vLR,outSamp);
+ #else
outAccum = _mm_mul_ps(outAccum, vLR);
outSamp = _mm_add_ps(outSamp, outAccum);
+ #endif
+
_mm_storel_pi(reinterpret_cast<__m64*>(out), outSamp);
}
diff --git a/media/libeffects/lvm/lib/Android.bp b/media/libeffects/lvm/lib/Android.bp
index 6d998d1..1f2a5e1 100644
--- a/media/libeffects/lvm/lib/Android.bp
+++ b/media/libeffects/lvm/lib/Android.bp
@@ -137,8 +137,6 @@
],
cppflags: [
"-fvisibility=hidden",
- "-DBUILD_FLOAT",
- "-DHIGHER_FS",
"-DSUPPORT_MC",
"-Wall",
@@ -208,8 +206,6 @@
cppflags: [
"-fvisibility=hidden",
- "-DBUILD_FLOAT",
- "-DHIGHER_FS",
"-Wall",
"-Werror",
diff --git a/media/libeffects/lvm/lib/Bass/lib/LVDBE.h b/media/libeffects/lvm/lib/Bass/lib/LVDBE.h
index 261a21a..948d79c 100644
--- a/media/libeffects/lvm/lib/Bass/lib/LVDBE.h
+++ b/media/libeffects/lvm/lib/Bass/lib/LVDBE.h
@@ -55,8 +55,6 @@
#ifndef __LVDBE_H__
#define __LVDBE_H__
-
-
/****************************************************************************************/
/* */
/* Includes */
@@ -65,7 +63,6 @@
#include "LVM_Types.h"
-
/****************************************************************************************/
/* */
/* Definitions */
@@ -82,7 +79,6 @@
#define LVDBE_EFFECT_12DB 12
#define LVDBE_EFFECT_15DB 15
-
/****************************************************************************************/
/* */
/* Types */
@@ -92,7 +88,6 @@
/* Instance handle */
typedef void *LVDBE_Handle_t;
-
/* Operating modes */
typedef enum
{
@@ -101,7 +96,6 @@
LVDBE_MODE_MAX = LVM_MAXINT_32
} LVDBE_Mode_en;
-
/* High pass filter */
typedef enum
{
@@ -110,7 +104,6 @@
LVDBE_HPF_MAX = LVM_MAXINT_32
} LVDBE_FilterSelect_en;
-
/* Volume control */
typedef enum
{
@@ -119,7 +112,6 @@
LVDBE_VOLUME_MAX = LVM_MAXINT_32
} LVDBE_Volume_en;
-
/* Memory Types */
typedef enum
{
@@ -131,7 +123,6 @@
} LVDBE_MemoryTypes_en;
-
/* Function return status */
typedef enum
{
@@ -143,7 +134,6 @@
LVDBE_STATUS_MAX = LVM_MAXINT_32
} LVDBE_ReturnStatus_en;
-
/****************************************************************************************/
/* */
/* Linked enumerated type and capability definitions */
@@ -182,7 +172,6 @@
LVDBE_CENTRE_MAX = LVM_MAXINT_32
} LVDBE_CentreFreq_en;
-
/*
* Supported sample rates in samples per second
*/
@@ -195,12 +184,10 @@
#define LVDBE_CAP_FS_32000 64
#define LVDBE_CAP_FS_44100 128
#define LVDBE_CAP_FS_48000 256
-#if defined(BUILD_FLOAT) && defined(HIGHER_FS)
#define LVDBE_CAP_FS_88200 512
#define LVDBE_CAP_FS_96000 1024
#define LVDBE_CAP_FS_176400 2048
#define LVDBE_CAP_FS_192000 4096
-#endif
typedef enum
{
@@ -213,16 +200,13 @@
LVDBE_FS_32000 = 6,
LVDBE_FS_44100 = 7,
LVDBE_FS_48000 = 8,
-#if defined(BUILD_FLOAT) && defined(HIGHER_FS)
LVDBE_FS_88200 = 9,
LVDBE_FS_96000 = 10,
LVDBE_FS_176400 = 11,
LVDBE_FS_192000 = 12,
-#endif
LVDBE_FS_MAX = LVM_MAXINT_32
} LVDBE_Fs_en;
-
/****************************************************************************************/
/* */
/* Structures */
@@ -238,14 +222,12 @@
void *pBaseAddress; /* Pointer to the region base address */
} LVDBE_MemoryRegion_t;
-
/* Memory table containing the region definitions */
typedef struct
{
LVDBE_MemoryRegion_t Region[LVDBE_NR_MEMORY_REGIONS]; /* One definition for each region */
} LVDBE_MemTab_t;
-
/* Parameter structure */
typedef struct
{
@@ -263,7 +245,6 @@
} LVDBE_Params_t;
-
/* Capability structure */
typedef struct
{
@@ -272,7 +253,6 @@
LVM_UINT16 MaxBlockSize; /* Maximum block size in sample pairs */
} LVDBE_Capabilities_t;
-
/****************************************************************************************/
/* */
/* Function Prototypes */
@@ -314,7 +294,6 @@
LVDBE_MemTab_t *pMemoryTable,
LVDBE_Capabilities_t *pCapabilities);
-
/****************************************************************************************/
/* */
/* FUNCTION: LVDBE_Init */
@@ -352,7 +331,6 @@
LVDBE_MemTab_t *pMemoryTable,
LVDBE_Capabilities_t *pCapabilities);
-
/****************************************************************************************/
/* */
/* FUNCTION: LVDBE_GetParameters */
@@ -376,7 +354,6 @@
LVDBE_ReturnStatus_en LVDBE_GetParameters(LVDBE_Handle_t hInstance,
LVDBE_Params_t *pParams);
-
/****************************************************************************************/
/* */
/* FUNCTION: LVDBE_GetCapabilities */
@@ -400,7 +377,6 @@
LVDBE_ReturnStatus_en LVDBE_GetCapabilities(LVDBE_Handle_t hInstance,
LVDBE_Capabilities_t *pCapabilities);
-
/****************************************************************************************/
/* */
/* FUNCTION: LVDBE_Control */
@@ -441,7 +417,6 @@
LVDBE_ReturnStatus_en LVDBE_Control(LVDBE_Handle_t hInstance,
LVDBE_Params_t *pParams);
-
/****************************************************************************************/
/* */
/* FUNCTION: LVDBE_Process */
@@ -462,17 +437,9 @@
/* NOTES: */
/* */
/****************************************************************************************/
-#ifdef BUILD_FLOAT
LVDBE_ReturnStatus_en LVDBE_Process(LVDBE_Handle_t hInstance,
const LVM_FLOAT *pInData,
LVM_FLOAT *pOutData,
LVM_UINT16 NumSamples);
-#else
-LVDBE_ReturnStatus_en LVDBE_Process(LVDBE_Handle_t hInstance,
- const LVM_INT16 *pInData,
- LVM_INT16 *pOutData,
- LVM_UINT16 NumSamples);
-#endif
-
#endif /* __LVDBE_H__ */
diff --git a/media/libeffects/lvm/lib/Bass/src/LVDBE_Coeffs.h b/media/libeffects/lvm/lib/Bass/src/LVDBE_Coeffs.h
index 8f058e8..b364dae 100644
--- a/media/libeffects/lvm/lib/Bass/src/LVDBE_Coeffs.h
+++ b/media/libeffects/lvm/lib/Bass/src/LVDBE_Coeffs.h
@@ -18,8 +18,6 @@
#ifndef __LVDBE_COEFFS_H__
#define __LVDBE_COEFFS_H__
-
-#ifndef BUILD_FLOAT
/************************************************************************************/
/* */
/* General */
@@ -28,504 +26,6 @@
#define LVDBE_SCALESHIFT 10 /* As a power of 2 */
-
-/************************************************************************************/
-/* */
-/* High Pass Filter coefficients */
-/* */
-/************************************************************************************/
-
- /* Coefficients for centre frequency 55Hz */
-#define HPF_Fs8000_Fc55_A0 1029556328 /* Floating point value 0.958849 */
-#define HPF_Fs8000_Fc55_A1 (-2059112655) /* Floating point value -1.917698 */
-#define HPF_Fs8000_Fc55_A2 1029556328 /* Floating point value 0.958849 */
-#define HPF_Fs8000_Fc55_B1 (-2081986375) /* Floating point value -1.939001 */
-#define HPF_Fs8000_Fc55_B2 1010183914 /* Floating point value 0.940807 */
-#define HPF_Fs11025_Fc55_A0 1038210831 /* Floating point value 0.966909 */
-#define HPF_Fs11025_Fc55_A1 (-2076421662) /* Floating point value -1.933818 */
-#define HPF_Fs11025_Fc55_A2 1038210831 /* Floating point value 0.966909 */
-#define HPF_Fs11025_Fc55_B1 (-2099950710) /* Floating point value -1.955732 */
-#define HPF_Fs11025_Fc55_B2 1027238450 /* Floating point value 0.956690 */
-#define HPF_Fs12000_Fc55_A0 1040079943 /* Floating point value 0.968650 */
-#define HPF_Fs12000_Fc55_A1 (-2080159885) /* Floating point value -1.937300 */
-#define HPF_Fs12000_Fc55_A2 1040079943 /* Floating point value 0.968650 */
-#define HPF_Fs12000_Fc55_B1 (-2103811702) /* Floating point value -1.959327 */
-#define HPF_Fs12000_Fc55_B2 1030940477 /* Floating point value 0.960138 */
-#define HPF_Fs16000_Fc55_A0 1045381988 /* Floating point value 0.973588 */
-#define HPF_Fs16000_Fc55_A1 (-2090763976) /* Floating point value -1.947176 */
-#define HPF_Fs16000_Fc55_A2 1045381988 /* Floating point value 0.973588 */
-#define HPF_Fs16000_Fc55_B1 (-2114727793) /* Floating point value -1.969494 */
-#define HPF_Fs16000_Fc55_B2 1041478147 /* Floating point value 0.969952 */
-#define HPF_Fs22050_Fc55_A0 1049766523 /* Floating point value 0.977671 */
-#define HPF_Fs22050_Fc55_A1 (-2099533046) /* Floating point value -1.955343 */
-#define HPF_Fs22050_Fc55_A2 1049766523 /* Floating point value 0.977671 */
-#define HPF_Fs22050_Fc55_B1 (-2123714381) /* Floating point value -1.977863 */
-#define HPF_Fs22050_Fc55_B2 1050232780 /* Floating point value 0.978105 */
-#define HPF_Fs24000_Fc55_A0 1050711051 /* Floating point value 0.978551 */
-#define HPF_Fs24000_Fc55_A1 (-2101422103) /* Floating point value -1.957102 */
-#define HPF_Fs24000_Fc55_A2 1050711051 /* Floating point value 0.978551 */
-#define HPF_Fs24000_Fc55_B1 (-2125645498) /* Floating point value -1.979662 */
-#define HPF_Fs24000_Fc55_B2 1052123526 /* Floating point value 0.979866 */
-#define HPF_Fs32000_Fc55_A0 1053385759 /* Floating point value 0.981042 */
-#define HPF_Fs32000_Fc55_A1 (-2106771519) /* Floating point value -1.962084 */
-#define HPF_Fs32000_Fc55_A2 1053385759 /* Floating point value 0.981042 */
-#define HPF_Fs32000_Fc55_B1 (-2131104794) /* Floating point value -1.984746 */
-#define HPF_Fs32000_Fc55_B2 1057486949 /* Floating point value 0.984861 */
-#define HPF_Fs44100_Fc55_A0 1055592498 /* Floating point value 0.983097 */
-#define HPF_Fs44100_Fc55_A1 (-2111184995) /* Floating point value -1.966194 */
-#define HPF_Fs44100_Fc55_A2 1055592498 /* Floating point value 0.983097 */
-#define HPF_Fs44100_Fc55_B1 (-2135598658) /* Floating point value -1.988931 */
-#define HPF_Fs44100_Fc55_B2 1061922249 /* Floating point value 0.988992 */
-#define HPF_Fs48000_Fc55_A0 1056067276 /* Floating point value 0.983539 */
-#define HPF_Fs48000_Fc55_A1 (-2112134551) /* Floating point value -1.967079 */
-#define HPF_Fs48000_Fc55_A2 1056067276 /* Floating point value 0.983539 */
-#define HPF_Fs48000_Fc55_B1 (-2136564296) /* Floating point value -1.989831 */
-#define HPF_Fs48000_Fc55_B2 1062877714 /* Floating point value 0.989882 */
-
- /* Coefficients for centre frequency 66Hz */
-#define HPF_Fs8000_Fc66_A0 1023293271 /* Floating point value 0.953016 */
-#define HPF_Fs8000_Fc66_A1 (-2046586542) /* Floating point value -1.906032 */
-#define HPF_Fs8000_Fc66_A2 1023293271 /* Floating point value 0.953016 */
-#define HPF_Fs8000_Fc66_B1 (-2068896860) /* Floating point value -1.926810 */
-#define HPF_Fs8000_Fc66_B2 997931110 /* Floating point value 0.929396 */
-#define HPF_Fs11025_Fc66_A0 1033624228 /* Floating point value 0.962638 */
-#define HPF_Fs11025_Fc66_A1 (-2067248455) /* Floating point value -1.925275 */
-#define HPF_Fs11025_Fc66_A2 1033624228 /* Floating point value 0.962638 */
-#define HPF_Fs11025_Fc66_B1 (-2090448000) /* Floating point value -1.946881 */
-#define HPF_Fs11025_Fc66_B2 1018182305 /* Floating point value 0.948256 */
-#define HPF_Fs12000_Fc66_A0 1035857662 /* Floating point value 0.964718 */
-#define HPF_Fs12000_Fc66_A1 (-2071715325) /* Floating point value -1.929435 */
-#define HPF_Fs12000_Fc66_A2 1035857662 /* Floating point value 0.964718 */
-#define HPF_Fs12000_Fc66_B1 (-2095080333) /* Floating point value -1.951196 */
-#define HPF_Fs12000_Fc66_B2 1022587158 /* Floating point value 0.952359 */
-#define HPF_Fs16000_Fc66_A0 1042197528 /* Floating point value 0.970622 */
-#define HPF_Fs16000_Fc66_A1 (-2084395056) /* Floating point value -1.941244 */
-#define HPF_Fs16000_Fc66_A2 1042197528 /* Floating point value 0.970622 */
-#define HPF_Fs16000_Fc66_B1 (-2108177912) /* Floating point value -1.963394 */
-#define HPF_Fs16000_Fc66_B2 1035142690 /* Floating point value 0.964052 */
-#define HPF_Fs22050_Fc66_A0 1047445145 /* Floating point value 0.975509 */
-#define HPF_Fs22050_Fc66_A1 (-2094890289) /* Floating point value -1.951019 */
-#define HPF_Fs22050_Fc66_A2 1047445145 /* Floating point value 0.975509 */
-#define HPF_Fs22050_Fc66_B1 (-2118961025) /* Floating point value -1.973436 */
-#define HPF_Fs22050_Fc66_B2 1045593102 /* Floating point value 0.973784 */
-#define HPF_Fs24000_Fc66_A0 1048576175 /* Floating point value 0.976563 */
-#define HPF_Fs24000_Fc66_A1 (-2097152349) /* Floating point value -1.953125 */
-#define HPF_Fs24000_Fc66_A2 1048576175 /* Floating point value 0.976563 */
-#define HPF_Fs24000_Fc66_B1 (-2121278255) /* Floating point value -1.975594 */
-#define HPF_Fs24000_Fc66_B2 1047852379 /* Floating point value 0.975889 */
-#define HPF_Fs32000_Fc66_A0 1051780119 /* Floating point value 0.979547 */
-#define HPF_Fs32000_Fc66_A1 (-2103560237) /* Floating point value -1.959093 */
-#define HPF_Fs32000_Fc66_A2 1051780119 /* Floating point value 0.979547 */
-#define HPF_Fs32000_Fc66_B1 (-2127829187) /* Floating point value -1.981695 */
-#define HPF_Fs32000_Fc66_B2 1054265623 /* Floating point value 0.981861 */
-#define HPF_Fs44100_Fc66_A0 1054424722 /* Floating point value 0.982010 */
-#define HPF_Fs44100_Fc66_A1 (-2108849444) /* Floating point value -1.964019 */
-#define HPF_Fs44100_Fc66_A2 1054424722 /* Floating point value 0.982010 */
-#define HPF_Fs44100_Fc66_B1 (-2133221723) /* Floating point value -1.986718 */
-#define HPF_Fs44100_Fc66_B2 1059573993 /* Floating point value 0.986805 */
-#define HPF_Fs48000_Fc66_A0 1054993851 /* Floating point value 0.982540 */
-#define HPF_Fs48000_Fc66_A1 (-2109987702) /* Floating point value -1.965079 */
-#define HPF_Fs48000_Fc66_A2 1054993851 /* Floating point value 0.982540 */
-#define HPF_Fs48000_Fc66_B1 (-2134380475) /* Floating point value -1.987797 */
-#define HPF_Fs48000_Fc66_B2 1060718118 /* Floating point value 0.987871 */
-
- /* Coefficients for centre frequency 78Hz */
-#define HPF_Fs8000_Fc78_A0 1016504203 /* Floating point value 0.946693 */
-#define HPF_Fs8000_Fc78_A1 (-2033008405) /* Floating point value -1.893387 */
-#define HPF_Fs8000_Fc78_A2 1016504203 /* Floating point value 0.946693 */
-#define HPF_Fs8000_Fc78_B1 (-2054623390) /* Floating point value -1.913517 */
-#define HPF_Fs8000_Fc78_B2 984733853 /* Floating point value 0.917105 */
-#define HPF_Fs11025_Fc78_A0 1028643741 /* Floating point value 0.957999 */
-#define HPF_Fs11025_Fc78_A1 (-2057287482) /* Floating point value -1.915998 */
-#define HPF_Fs11025_Fc78_A2 1028643741 /* Floating point value 0.957999 */
-#define HPF_Fs11025_Fc78_B1 (-2080083769) /* Floating point value -1.937229 */
-#define HPF_Fs11025_Fc78_B2 1008393904 /* Floating point value 0.939140 */
-#define HPF_Fs12000_Fc78_A0 1031271067 /* Floating point value 0.960446 */
-#define HPF_Fs12000_Fc78_A1 (-2062542133) /* Floating point value -1.920892 */
-#define HPF_Fs12000_Fc78_A2 1031271067 /* Floating point value 0.960446 */
-#define HPF_Fs12000_Fc78_B1 (-2085557048) /* Floating point value -1.942326 */
-#define HPF_Fs12000_Fc78_B2 1013551620 /* Floating point value 0.943944 */
-#define HPF_Fs16000_Fc78_A0 1038734628 /* Floating point value 0.967397 */
-#define HPF_Fs16000_Fc78_A1 (-2077469256) /* Floating point value -1.934794 */
-#define HPF_Fs16000_Fc78_A2 1038734628 /* Floating point value 0.967397 */
-#define HPF_Fs16000_Fc78_B1 (-2101033380) /* Floating point value -1.956740 */
-#define HPF_Fs16000_Fc78_B2 1028275228 /* Floating point value 0.957656 */
-#define HPF_Fs22050_Fc78_A0 1044918584 /* Floating point value 0.973156 */
-#define HPF_Fs22050_Fc78_A1 (-2089837169) /* Floating point value -1.946313 */
-#define HPF_Fs22050_Fc78_A2 1044918584 /* Floating point value 0.973156 */
-#define HPF_Fs22050_Fc78_B1 (-2113775854) /* Floating point value -1.968607 */
-#define HPF_Fs22050_Fc78_B2 1040555007 /* Floating point value 0.969092 */
-#define HPF_Fs24000_Fc78_A0 1046252164 /* Floating point value 0.974398 */
-#define HPF_Fs24000_Fc78_A1 (-2092504328) /* Floating point value -1.948797 */
-#define HPF_Fs24000_Fc78_A2 1046252164 /* Floating point value 0.974398 */
-#define HPF_Fs24000_Fc78_B1 (-2116514229) /* Floating point value -1.971157 */
-#define HPF_Fs24000_Fc78_B2 1043212719 /* Floating point value 0.971568 */
-#define HPF_Fs32000_Fc78_A0 1050031301 /* Floating point value 0.977918 */
-#define HPF_Fs32000_Fc78_A1 (-2100062603) /* Floating point value -1.955836 */
-#define HPF_Fs32000_Fc78_A2 1050031301 /* Floating point value 0.977918 */
-#define HPF_Fs32000_Fc78_B1 (-2124255900) /* Floating point value -1.978367 */
-#define HPF_Fs32000_Fc78_B2 1050762639 /* Floating point value 0.978599 */
-#define HPF_Fs44100_Fc78_A0 1053152258 /* Floating point value 0.980824 */
-#define HPF_Fs44100_Fc78_A1 (-2106304516) /* Floating point value -1.961649 */
-#define HPF_Fs44100_Fc78_A2 1053152258 /* Floating point value 0.980824 */
-#define HPF_Fs44100_Fc78_B1 (-2130628742) /* Floating point value -1.984303 */
-#define HPF_Fs44100_Fc78_B2 1057018180 /* Floating point value 0.984425 */
-#define HPF_Fs48000_Fc78_A0 1053824087 /* Floating point value 0.981450 */
-#define HPF_Fs48000_Fc78_A1 (-2107648173) /* Floating point value -1.962900 */
-#define HPF_Fs48000_Fc78_A2 1053824087 /* Floating point value 0.981450 */
-#define HPF_Fs48000_Fc78_B1 (-2131998154) /* Floating point value -1.985578 */
-#define HPF_Fs48000_Fc78_B2 1058367200 /* Floating point value 0.985681 */
-
- /* Coefficients for centre frequency 90Hz */
-#define HPF_Fs8000_Fc90_A0 1009760053 /* Floating point value 0.940412 */
-#define HPF_Fs8000_Fc90_A1 (-2019520105) /* Floating point value -1.880825 */
-#define HPF_Fs8000_Fc90_A2 1009760053 /* Floating point value 0.940412 */
-#define HPF_Fs8000_Fc90_B1 (-2040357139) /* Floating point value -1.900231 */
-#define HPF_Fs8000_Fc90_B2 971711129 /* Floating point value 0.904977 */
-#define HPF_Fs11025_Fc90_A0 1023687217 /* Floating point value 0.953383 */
-#define HPF_Fs11025_Fc90_A1 (-2047374434) /* Floating point value -1.906766 */
-#define HPF_Fs11025_Fc90_A2 1023687217 /* Floating point value 0.953383 */
-#define HPF_Fs11025_Fc90_B1 (-2069722397) /* Floating point value -1.927579 */
-#define HPF_Fs11025_Fc90_B2 998699604 /* Floating point value 0.930111 */
-#define HPF_Fs12000_Fc90_A0 1026704754 /* Floating point value 0.956193 */
-#define HPF_Fs12000_Fc90_A1 (-2053409508) /* Floating point value -1.912387 */
-#define HPF_Fs12000_Fc90_A2 1026704754 /* Floating point value 0.956193 */
-#define HPF_Fs12000_Fc90_B1 (-2076035996) /* Floating point value -1.933459 */
-#define HPF_Fs12000_Fc90_B2 1004595918 /* Floating point value 0.935603 */
-#define HPF_Fs16000_Fc90_A0 1035283225 /* Floating point value 0.964183 */
-#define HPF_Fs16000_Fc90_A1 (-2070566451) /* Floating point value -1.928365 */
-#define HPF_Fs16000_Fc90_A2 1035283225 /* Floating point value 0.964183 */
-#define HPF_Fs16000_Fc90_B1 (-2093889811) /* Floating point value -1.950087 */
-#define HPF_Fs16000_Fc90_B2 1021453326 /* Floating point value 0.951303 */
-#define HPF_Fs22050_Fc90_A0 1042398116 /* Floating point value 0.970809 */
-#define HPF_Fs22050_Fc90_A1 (-2084796232) /* Floating point value -1.941618 */
-#define HPF_Fs22050_Fc90_A2 1042398116 /* Floating point value 0.970809 */
-#define HPF_Fs22050_Fc90_B1 (-2108591057) /* Floating point value -1.963778 */
-#define HPF_Fs22050_Fc90_B2 1035541188 /* Floating point value 0.964423 */
-#define HPF_Fs24000_Fc90_A0 1043933302 /* Floating point value 0.972239 */
-#define HPF_Fs24000_Fc90_A1 (-2087866604) /* Floating point value -1.944477 */
-#define HPF_Fs24000_Fc90_A2 1043933302 /* Floating point value 0.972239 */
-#define HPF_Fs24000_Fc90_B1 (-2111750495) /* Floating point value -1.966721 */
-#define HPF_Fs24000_Fc90_B2 1038593601 /* Floating point value 0.967266 */
-#define HPF_Fs32000_Fc90_A0 1048285391 /* Floating point value 0.976292 */
-#define HPF_Fs32000_Fc90_A1 (-2096570783) /* Floating point value -1.952584 */
-#define HPF_Fs32000_Fc90_A2 1048285391 /* Floating point value 0.976292 */
-#define HPF_Fs32000_Fc90_B1 (-2120682737) /* Floating point value -1.975040 */
-#define HPF_Fs32000_Fc90_B2 1047271295 /* Floating point value 0.975347 */
-#define HPF_Fs44100_Fc90_A0 1051881330 /* Floating point value 0.979641 */
-#define HPF_Fs44100_Fc90_A1 (-2103762660) /* Floating point value -1.959282 */
-#define HPF_Fs44100_Fc90_A2 1051881330 /* Floating point value 0.979641 */
-#define HPF_Fs44100_Fc90_B1 (-2128035809) /* Floating point value -1.981888 */
-#define HPF_Fs44100_Fc90_B2 1054468533 /* Floating point value 0.982050 */
-#define HPF_Fs48000_Fc90_A0 1052655619 /* Floating point value 0.980362 */
-#define HPF_Fs48000_Fc90_A1 (-2105311238) /* Floating point value -1.960724 */
-#define HPF_Fs48000_Fc90_A2 1052655619 /* Floating point value 0.980362 */
-#define HPF_Fs48000_Fc90_B1 (-2129615871) /* Floating point value -1.983359 */
-#define HPF_Fs48000_Fc90_B2 1056021492 /* Floating point value 0.983497 */
-
-
-/************************************************************************************/
-/* */
-/* Band Pass Filter coefficients */
-/* */
-/************************************************************************************/
-
- /* Coefficients for centre frequency 55Hz */
-#define BPF_Fs8000_Fc55_A0 9875247 /* Floating point value 0.009197 */
-#define BPF_Fs8000_Fc55_A1 0 /* Floating point value 0.000000 */
-#define BPF_Fs8000_Fc55_A2 (-9875247) /* Floating point value -0.009197 */
-#define BPF_Fs8000_Fc55_B1 (-2125519830) /* Floating point value -1.979545 */
-#define BPF_Fs8000_Fc55_B2 1053762629 /* Floating point value 0.981393 */
-#define BPF_Fs11025_Fc55_A0 7183952 /* Floating point value 0.006691 */
-#define BPF_Fs11025_Fc55_A1 0 /* Floating point value 0.000000 */
-#define BPF_Fs11025_Fc55_A2 (-7183952) /* Floating point value -0.006691 */
-#define BPF_Fs11025_Fc55_B1 (-2131901658) /* Floating point value -1.985488 */
-#define BPF_Fs11025_Fc55_B2 1059207548 /* Floating point value 0.986464 */
-#define BPF_Fs12000_Fc55_A0 6603871 /* Floating point value 0.006150 */
-#define BPF_Fs12000_Fc55_A1 0 /* Floating point value 0.000000 */
-#define BPF_Fs12000_Fc55_A2 (-6603871) /* Floating point value -0.006150 */
-#define BPF_Fs12000_Fc55_B1 (-2133238092) /* Floating point value -1.986733 */
-#define BPF_Fs12000_Fc55_B2 1060381143 /* Floating point value 0.987557 */
-#define BPF_Fs16000_Fc55_A0 4960591 /* Floating point value 0.004620 */
-#define BPF_Fs16000_Fc55_A1 0 /* Floating point value 0.000000 */
-#define BPF_Fs16000_Fc55_A2 (-4960591) /* Floating point value -0.004620 */
-#define BPF_Fs16000_Fc55_B1 (-2136949052) /* Floating point value -1.990189 */
-#define BPF_Fs16000_Fc55_B2 1063705760 /* Floating point value 0.990653 */
-#define BPF_Fs22050_Fc55_A0 3604131 /* Floating point value 0.003357 */
-#define BPF_Fs22050_Fc55_A1 0 /* Floating point value 0.000000 */
-#define BPF_Fs22050_Fc55_A2 (-3604131) /* Floating point value -0.003357 */
-#define BPF_Fs22050_Fc55_B1 (-2139929085) /* Floating point value -1.992964 */
-#define BPF_Fs22050_Fc55_B2 1066450095 /* Floating point value 0.993209 */
-#define BPF_Fs24000_Fc55_A0 3312207 /* Floating point value 0.003085 */
-#define BPF_Fs24000_Fc55_A1 0 /* Floating point value 0.000000 */
-#define BPF_Fs24000_Fc55_A2 (-3312207) /* Floating point value -0.003085 */
-#define BPF_Fs24000_Fc55_B1 (-2140560606) /* Floating point value -1.993552 */
-#define BPF_Fs24000_Fc55_B2 1067040703 /* Floating point value 0.993759 */
-#define BPF_Fs32000_Fc55_A0 2486091 /* Floating point value 0.002315 */
-#define BPF_Fs32000_Fc55_A1 0 /* Floating point value 0.000000 */
-#define BPF_Fs32000_Fc55_A2 (-2486091) /* Floating point value -0.002315 */
-#define BPF_Fs32000_Fc55_B1 (-2142328962) /* Floating point value -1.995199 */
-#define BPF_Fs32000_Fc55_B2 1068712067 /* Floating point value 0.995316 */
-#define BPF_Fs44100_Fc55_A0 1805125 /* Floating point value 0.001681 */
-#define BPF_Fs44100_Fc55_A1 0 /* Floating point value 0.000000 */
-#define BPF_Fs44100_Fc55_A2 (-1805125) /* Floating point value -0.001681 */
-#define BPF_Fs44100_Fc55_B1 (-2143765772) /* Floating point value -1.996537 */
-#define BPF_Fs44100_Fc55_B2 1070089770 /* Floating point value 0.996599 */
-#define BPF_Fs48000_Fc55_A0 1658687 /* Floating point value 0.001545 */
-#define BPF_Fs48000_Fc55_A1 0 /* Floating point value 0.000000 */
-#define BPF_Fs48000_Fc55_A2 (-1658687) /* Floating point value -0.001545 */
-#define BPF_Fs48000_Fc55_B1 (-2144072292) /* Floating point value -1.996823 */
-#define BPF_Fs48000_Fc55_B2 1070386036 /* Floating point value 0.996875 */
-
- /* Coefficients for centre frequency 66Hz */
-#define BPF_Fs8000_Fc66_A0 13580189 /* Floating point value 0.012648 */
-#define BPF_Fs8000_Fc66_A1 0 /* Floating point value 0.000000 */
-#define BPF_Fs8000_Fc66_A2 (-13580189) /* Floating point value -0.012648 */
-#define BPF_Fs8000_Fc66_B1 (-2117161175) /* Floating point value -1.971760 */
-#define BPF_Fs8000_Fc66_B2 1046266945 /* Floating point value 0.974412 */
-#define BPF_Fs11025_Fc66_A0 9888559 /* Floating point value 0.009209 */
-#define BPF_Fs11025_Fc66_A1 0 /* Floating point value 0.000000 */
-#define BPF_Fs11025_Fc66_A2 (-9888559) /* Floating point value -0.009209 */
-#define BPF_Fs11025_Fc66_B1 (-2125972738) /* Floating point value -1.979966 */
-#define BPF_Fs11025_Fc66_B2 1053735698 /* Floating point value 0.981368 */
-#define BPF_Fs12000_Fc66_A0 9091954 /* Floating point value 0.008468 */
-#define BPF_Fs12000_Fc66_A1 0 /* Floating point value 0.000000 */
-#define BPF_Fs12000_Fc66_A2 (-9091954) /* Floating point value -0.008468 */
-#define BPF_Fs12000_Fc66_B1 (-2127818004) /* Floating point value -1.981685 */
-#define BPF_Fs12000_Fc66_B2 1055347356 /* Floating point value 0.982869 */
-#define BPF_Fs16000_Fc66_A0 6833525 /* Floating point value 0.006364 */
-#define BPF_Fs16000_Fc66_A1 0 /* Floating point value 0.000000 */
-#define BPF_Fs16000_Fc66_A2 (-6833525) /* Floating point value -0.006364 */
-#define BPF_Fs16000_Fc66_B1 (-2132941739) /* Floating point value -1.986457 */
-#define BPF_Fs16000_Fc66_B2 1059916517 /* Floating point value 0.987124 */
-#define BPF_Fs22050_Fc66_A0 4967309 /* Floating point value 0.004626 */
-#define BPF_Fs22050_Fc66_A1 0 /* Floating point value 0.000000 */
-#define BPF_Fs22050_Fc66_A2 (-4967309) /* Floating point value -0.004626 */
-#define BPF_Fs22050_Fc66_B1 (-2137056003) /* Floating point value -1.990288 */
-#define BPF_Fs22050_Fc66_B2 1063692170 /* Floating point value 0.990641 */
-#define BPF_Fs24000_Fc66_A0 4565445 /* Floating point value 0.004252 */
-#define BPF_Fs24000_Fc66_A1 0 /* Floating point value 0.000000 */
-#define BPF_Fs24000_Fc66_A2 (-4565445) /* Floating point value -0.004252 */
-#define BPF_Fs24000_Fc66_B1 (-2137927842) /* Floating point value -1.991100 */
-#define BPF_Fs24000_Fc66_B2 1064505202 /* Floating point value 0.991398 */
-#define BPF_Fs32000_Fc66_A0 3427761 /* Floating point value 0.003192 */
-#define BPF_Fs32000_Fc66_A1 0 /* Floating point value 0.000000 */
-#define BPF_Fs32000_Fc66_A2 (-3427761) /* Floating point value -0.003192 */
-#define BPF_Fs32000_Fc66_B1 (-2140369007) /* Floating point value -1.993374 */
-#define BPF_Fs32000_Fc66_B2 1066806920 /* Floating point value 0.993541 */
-#define BPF_Fs44100_Fc66_A0 2489466 /* Floating point value 0.002318 */
-#define BPF_Fs44100_Fc66_A1 0 /* Floating point value 0.000000 */
-#define BPF_Fs44100_Fc66_A2 (-2489466) /* Floating point value -0.002318 */
-#define BPF_Fs44100_Fc66_B1 (-2142352342) /* Floating point value -1.995221 */
-#define BPF_Fs44100_Fc66_B2 1068705240 /* Floating point value 0.995309 */
-#define BPF_Fs48000_Fc66_A0 2287632 /* Floating point value 0.002131 */
-#define BPF_Fs48000_Fc66_A1 0 /* Floating point value 0.000000 */
-#define BPF_Fs48000_Fc66_A2 (-2287632) /* Floating point value -0.002131 */
-#define BPF_Fs48000_Fc66_B1 (-2142775436) /* Floating point value -1.995615 */
-#define BPF_Fs48000_Fc66_B2 1069113581 /* Floating point value 0.995690 */
-
- /* Coefficients for centre frequency 78Hz */
-#define BPF_Fs8000_Fc78_A0 19941180 /* Floating point value 0.018572 */
-#define BPF_Fs8000_Fc78_A1 0 /* Floating point value 0.000000 */
-#define BPF_Fs8000_Fc78_A2 (-19941180) /* Floating point value -0.018572 */
-#define BPF_Fs8000_Fc78_B1 (-2103186749) /* Floating point value -1.958745 */
-#define BPF_Fs8000_Fc78_B2 1033397648 /* Floating point value 0.962427 */
-#define BPF_Fs11025_Fc78_A0 14543934 /* Floating point value 0.013545 */
-#define BPF_Fs11025_Fc78_A1 0 /* Floating point value 0.000000 */
-#define BPF_Fs11025_Fc78_A2 (-14543934) /* Floating point value -0.013545 */
-#define BPF_Fs11025_Fc78_B1 (-2115966638) /* Floating point value -1.970647 */
-#define BPF_Fs11025_Fc78_B2 1044317135 /* Floating point value 0.972596 */
-#define BPF_Fs12000_Fc78_A0 13376999 /* Floating point value 0.012458 */
-#define BPF_Fs12000_Fc78_A1 0 /* Floating point value 0.000000 */
-#define BPF_Fs12000_Fc78_A2 (-13376999) /* Floating point value -0.012458 */
-#define BPF_Fs12000_Fc78_B1 (-2118651708) /* Floating point value -1.973148 */
-#define BPF_Fs12000_Fc78_B2 1046678029 /* Floating point value 0.974795 */
-#define BPF_Fs16000_Fc78_A0 10064222 /* Floating point value 0.009373 */
-#define BPF_Fs16000_Fc78_A1 0 /* Floating point value 0.000000 */
-#define BPF_Fs16000_Fc78_A2 (-10064222) /* Floating point value -0.009373 */
-#define BPF_Fs16000_Fc78_B1 (-2126124342) /* Floating point value -1.980108 */
-#define BPF_Fs16000_Fc78_B2 1053380304 /* Floating point value 0.981037 */
-#define BPF_Fs22050_Fc78_A0 7321780 /* Floating point value 0.006819 */
-#define BPF_Fs22050_Fc78_A1 0 /* Floating point value 0.000000 */
-#define BPF_Fs22050_Fc78_A2 (-7321780) /* Floating point value -0.006819 */
-#define BPF_Fs22050_Fc78_B1 (-2132143771) /* Floating point value -1.985714 */
-#define BPF_Fs22050_Fc78_B2 1058928700 /* Floating point value 0.986204 */
-#define BPF_Fs24000_Fc78_A0 6730640 /* Floating point value 0.006268 */
-#define BPF_Fs24000_Fc78_A1 0 /* Floating point value 0.000000 */
-#define BPF_Fs24000_Fc78_A2 (-6730640) /* Floating point value -0.006268 */
-#define BPF_Fs24000_Fc78_B1 (-2133421607) /* Floating point value -1.986904 */
-#define BPF_Fs24000_Fc78_B2 1060124669 /* Floating point value 0.987318 */
-#define BPF_Fs32000_Fc78_A0 5055965 /* Floating point value 0.004709 */
-#define BPF_Fs32000_Fc78_A1 0 /* Floating point value 0.000000 */
-#define BPF_Fs32000_Fc78_A2 (-5055965) /* Floating point value -0.004709 */
-#define BPF_Fs32000_Fc78_B1 (-2137003977) /* Floating point value -1.990240 */
-#define BPF_Fs32000_Fc78_B2 1063512802 /* Floating point value 0.990473 */
-#define BPF_Fs44100_Fc78_A0 3673516 /* Floating point value 0.003421 */
-#define BPF_Fs44100_Fc78_A1 0 /* Floating point value 0.000000 */
-#define BPF_Fs44100_Fc78_A2 (-3673516) /* Floating point value -0.003421 */
-#define BPF_Fs44100_Fc78_B1 (-2139919394) /* Floating point value -1.992955 */
-#define BPF_Fs44100_Fc78_B2 1066309718 /* Floating point value 0.993078 */
-#define BPF_Fs48000_Fc78_A0 3375990 /* Floating point value 0.003144 */
-#define BPF_Fs48000_Fc78_A1 0 /* Floating point value 0.000000 */
-#define BPF_Fs48000_Fc78_A2 (-3375990) /* Floating point value -0.003144 */
-#define BPF_Fs48000_Fc78_B1 (-2140541906) /* Floating point value -1.993535 */
-#define BPF_Fs48000_Fc78_B2 1066911660 /* Floating point value 0.993639 */
-
- /* Coefficients for centre frequency 90Hz */
-#define BPF_Fs8000_Fc90_A0 24438548 /* Floating point value 0.022760 */
-#define BPF_Fs8000_Fc90_A1 0 /* Floating point value 0.000000 */
-#define BPF_Fs8000_Fc90_A2 (-24438548) /* Floating point value -0.022760 */
-#define BPF_Fs8000_Fc90_B1 (-2092801347) /* Floating point value -1.949073 */
-#define BPF_Fs8000_Fc90_B2 1024298757 /* Floating point value 0.953953 */
-#define BPF_Fs11025_Fc90_A0 17844385 /* Floating point value 0.016619 */
-#define BPF_Fs11025_Fc90_A1 0 /* Floating point value 0.000000 */
-#define BPF_Fs11025_Fc90_A2 (-17844385) /* Floating point value -0.016619 */
-#define BPF_Fs11025_Fc90_B1 (-2108604921) /* Floating point value -1.963791 */
-#define BPF_Fs11025_Fc90_B2 1037639797 /* Floating point value 0.966377 */
-#define BPF_Fs12000_Fc90_A0 16416707 /* Floating point value 0.015289 */
-#define BPF_Fs12000_Fc90_A1 0 /* Floating point value 0.000000 */
-#define BPF_Fs12000_Fc90_A2 (-16416707) /* Floating point value -0.015289 */
-#define BPF_Fs12000_Fc90_B1 (-2111922936) /* Floating point value -1.966882 */
-#define BPF_Fs12000_Fc90_B2 1040528216 /* Floating point value 0.969067 */
-#define BPF_Fs16000_Fc90_A0 12359883 /* Floating point value 0.011511 */
-#define BPF_Fs16000_Fc90_A1 0 /* Floating point value 0.000000 */
-#define BPF_Fs16000_Fc90_A2 (-12359883) /* Floating point value -0.011511 */
-#define BPF_Fs16000_Fc90_B1 (-2121152162) /* Floating point value -1.975477 */
-#define BPF_Fs16000_Fc90_B2 1048735817 /* Floating point value 0.976711 */
-#define BPF_Fs22050_Fc90_A0 8997173 /* Floating point value 0.008379 */
-#define BPF_Fs22050_Fc90_A1 0 /* Floating point value 0.000000 */
-#define BPF_Fs22050_Fc90_A2 (-8997173) /* Floating point value -0.008379 */
-#define BPF_Fs22050_Fc90_B1 (-2128580762) /* Floating point value -1.982395 */
-#define BPF_Fs22050_Fc90_B2 1055539113 /* Floating point value 0.983047 */
-#define BPF_Fs24000_Fc90_A0 8271818 /* Floating point value 0.007704 */
-#define BPF_Fs24000_Fc90_A1 0 /* Floating point value 0.000000 */
-#define BPF_Fs24000_Fc90_A2 (-8271818) /* Floating point value -0.007704 */
-#define BPF_Fs24000_Fc90_B1 (-2130157013) /* Floating point value -1.983863 */
-#define BPF_Fs24000_Fc90_B2 1057006621 /* Floating point value 0.984414 */
-#define BPF_Fs32000_Fc90_A0 6215918 /* Floating point value 0.005789 */
-#define BPF_Fs32000_Fc90_A1 0 /* Floating point value 0.000000 */
-#define BPF_Fs32000_Fc90_A2 (-6215918) /* Floating point value -0.005789 */
-#define BPF_Fs32000_Fc90_B1 (-2134574521) /* Floating point value -1.987977 */
-#define BPF_Fs32000_Fc90_B2 1061166033 /* Floating point value 0.988288 */
-#define BPF_Fs44100_Fc90_A0 4517651 /* Floating point value 0.004207 */
-#define BPF_Fs44100_Fc90_A1 0 /* Floating point value 0.000000 */
-#define BPF_Fs44100_Fc90_A2 (-4517651) /* Floating point value -0.004207 */
-#define BPF_Fs44100_Fc90_B1 (-2138167926) /* Floating point value -1.991324 */
-#define BPF_Fs44100_Fc90_B2 1064601898 /* Floating point value 0.991488 */
-#define BPF_Fs48000_Fc90_A0 4152024 /* Floating point value 0.003867 */
-#define BPF_Fs48000_Fc90_A1 0 /* Floating point value 0.000000 */
-#define BPF_Fs48000_Fc90_A2 (-4152024) /* Floating point value -0.003867 */
-#define BPF_Fs48000_Fc90_B1 (-2138935002) /* Floating point value -1.992038 */
-#define BPF_Fs48000_Fc90_B2 1065341620 /* Floating point value 0.992177 */
-
-
-/************************************************************************************/
-/* */
-/* Automatic Gain Control time constants and gain settings */
-/* */
-/************************************************************************************/
-
-/* AGC Time constants */
-#define AGC_ATTACK_Fs8000 27571 /* Floating point value 0.841395 */
-#define AGC_ATTACK_Fs11025 28909 /* Floating point value 0.882223 */
-#define AGC_ATTACK_Fs12000 29205 /* Floating point value 0.891251 */
-#define AGC_ATTACK_Fs16000 30057 /* Floating point value 0.917276 */
-#define AGC_ATTACK_Fs22050 30778 /* Floating point value 0.939267 */
-#define AGC_ATTACK_Fs24000 30935 /* Floating point value 0.944061 */
-#define AGC_ATTACK_Fs32000 31383 /* Floating point value 0.957745 */
-#define AGC_ATTACK_Fs44100 31757 /* Floating point value 0.969158 */
-#define AGC_ATTACK_Fs48000 31838 /* Floating point value 0.971628 */
-#define DECAY_SHIFT 10 /* As a power of 2 */
-#define AGC_DECAY_Fs8000 44 /* Floating point value 0.000042 */
-#define AGC_DECAY_Fs11025 32 /* Floating point value 0.000030 */
-#define AGC_DECAY_Fs12000 29 /* Floating point value 0.000028 */
-#define AGC_DECAY_Fs16000 22 /* Floating point value 0.000021 */
-#define AGC_DECAY_Fs22050 16 /* Floating point value 0.000015 */
-#define AGC_DECAY_Fs24000 15 /* Floating point value 0.000014 */
-#define AGC_DECAY_Fs32000 11 /* Floating point value 0.000010 */
-#define AGC_DECAY_Fs44100 8 /* Floating point value 0.000008 */
-#define AGC_DECAY_Fs48000 7 /* Floating point value 0.000007 */
-
-/* AGC Gain settings */
-#define AGC_GAIN_SCALE 31 /* As a power of 2 */
-#define AGC_GAIN_SHIFT 4 /* As a power of 2 */
-#define AGC_TARGETLEVEL 33170337 /* Floating point value -0.100000dB */
-#define AGC_HPFGAIN_0dB 110739704 /* Floating point value 0.412538 */
-#define AGC_GAIN_0dB 0 /* Floating point value 0.000000 */
-#define AGC_HPFGAIN_1dB 157006071 /* Floating point value 0.584893 */
-#define AGC_GAIN_1dB 32754079 /* Floating point value 0.122018 */
-#define AGC_HPFGAIN_2dB 208917788 /* Floating point value 0.778279 */
-#define AGC_GAIN_2dB 69504761 /* Floating point value 0.258925 */
-#define AGC_HPFGAIN_3dB 267163693 /* Floating point value 0.995262 */
-#define AGC_GAIN_3dB 110739704 /* Floating point value 0.412538 */
-#define AGC_HPFGAIN_4dB 332516674 /* Floating point value 1.238721 */
-#define AGC_GAIN_4dB 157006071 /* Floating point value 0.584893 */
-#define AGC_HPFGAIN_5dB 405843924 /* Floating point value 1.511886 */
-#define AGC_GAIN_5dB 208917788 /* Floating point value 0.778279 */
-#define AGC_HPFGAIN_6dB 488118451 /* Floating point value 1.818383 */
-#define AGC_GAIN_6dB 267163693 /* Floating point value 0.995262 */
-#define AGC_HPFGAIN_7dB 580431990 /* Floating point value 2.162278 */
-#define AGC_GAIN_7dB 332516674 /* Floating point value 1.238721 */
-#define AGC_HPFGAIN_8dB 684009483 /* Floating point value 2.548134 */
-#define AGC_GAIN_8dB 405843924 /* Floating point value 1.511886 */
-#define AGC_HPFGAIN_9dB 800225343 /* Floating point value 2.981072 */
-#define AGC_GAIN_9dB 488118451 /* Floating point value 1.818383 */
-#define AGC_HPFGAIN_10dB 930621681 /* Floating point value 3.466836 */
-#define AGC_GAIN_10dB 580431990 /* Floating point value 2.162278 */
-#define AGC_HPFGAIN_11dB 1076928780 /* Floating point value 4.011872 */
-#define AGC_GAIN_11dB 684009483 /* Floating point value 2.548134 */
-#define AGC_HPFGAIN_12dB 1241088045 /* Floating point value 4.623413 */
-#define AGC_GAIN_12dB 800225343 /* Floating point value 2.981072 */
-#define AGC_HPFGAIN_13dB 1425277769 /* Floating point value 5.309573 */
-#define AGC_GAIN_13dB 930621681 /* Floating point value 3.466836 */
-#define AGC_HPFGAIN_14dB 1631942039 /* Floating point value 6.079458 */
-#define AGC_GAIN_14dB 1076928780 /* Floating point value 4.011872 */
-#define AGC_HPFGAIN_15dB 1863823163 /* Floating point value 6.943282 */
-#define AGC_GAIN_15dB 1241088045 /* Floating point value 4.623413 */
-
-
-/************************************************************************************/
-/* */
-/* Volume control */
-/* */
-/************************************************************************************/
-
-/* Volume control gain */
-#define VOLUME_MAX 0 /* In dBs */
-#define VOLUME_SHIFT 0 /* In dBs */
-
-/* Volume control time constants */
-#define VOL_TC_SHIFT 21 /* As a power of 2 */
-#define VOL_TC_Fs8000 25889 /* Floating point value 0.024690 */
-#define VOL_TC_Fs11025 18850 /* Floating point value 0.017977 */
-#define VOL_TC_Fs12000 17331 /* Floating point value 0.016529 */
-#define VOL_TC_Fs16000 13026 /* Floating point value 0.012422 */
-#define VOL_TC_Fs22050 9468 /* Floating point value 0.009029 */
-#define VOL_TC_Fs24000 8702 /* Floating point value 0.008299 */
-#define VOL_TC_Fs32000 6533 /* Floating point value 0.006231 */
-#define VOL_TC_Fs44100 4745 /* Floating point value 0.004525 */
-#define VOL_TC_Fs48000 4360 /* Floating point value 0.004158 */
-#define MIX_TC_Fs8000 29365 /* Floating point value 0.896151 */
-#define MIX_TC_Fs11025 30230 /* Floating point value 0.922548 */
-#define MIX_TC_Fs12000 30422 /* Floating point value 0.928415 */
-#define MIX_TC_Fs16000 30978 /* Floating point value 0.945387 */
-#define MIX_TC_Fs22050 31451 /* Floating point value 0.959804 */
-#define MIX_TC_Fs24000 31554 /* Floating point value 0.962956 */
-#define MIX_TC_Fs32000 31850 /* Floating point value 0.971973 */
-#define MIX_TC_Fs44100 32097 /* Floating point value 0.979515 */
-#define MIX_TC_Fs48000 32150 /* Floating point value 0.981150 */
-
-#else /*BUILD_FLOAT*/
-
-/************************************************************************************/
-/* */
-/* General */
-/* */
-/************************************************************************************/
-
-#define LVDBE_SCALESHIFT 10 /* As a power of 2 */
-
-
/************************************************************************************/
/* */
/* High Pass Filter coefficients */
@@ -579,7 +79,6 @@
#define HPF_Fs48000_Fc55_B1 (-1.989831f)
#define HPF_Fs48000_Fc55_B2 0.989882f
-#ifdef HIGHER_FS
#define HPF_Fs88200_Fc55_A0 0.985818f
#define HPF_Fs88200_Fc55_A1 (-1.971636f)
#define HPF_Fs88200_Fc55_A2 0.985818f
@@ -603,8 +102,6 @@
#define HPF_Fs192000_Fc55_A2 0.987294f
#define HPF_Fs192000_Fc55_B1 (-1.997458f)
#define HPF_Fs192000_Fc55_B2 0.997461f
-#endif
-
/* Coefficients for centre frequency 66Hz */
#define HPF_Fs8000_Fc66_A0 0.953016f
@@ -653,7 +150,6 @@
#define HPF_Fs48000_Fc66_B1 (-1.987797f)
#define HPF_Fs48000_Fc66_B2 0.987871f
-#ifdef HIGHER_FS
#define HPF_Fs88200_Fc66_A0 0.985273f
#define HPF_Fs88200_Fc66_A1 (-1.970546f)
#define HPF_Fs88200_Fc66_A2 0.985273f
@@ -677,7 +173,6 @@
#define HPF_Fs192000_Fc66_A2 0.987043f
#define HPF_Fs192000_Fc66_B1 (-1.996949f)
#define HPF_Fs192000_Fc66_B2 0.996954f
-#endif
/* Coefficients for centre frequency 78Hz */
#define HPF_Fs8000_Fc78_A0 0.946693f
@@ -726,7 +221,6 @@
#define HPF_Fs48000_Fc78_B1 (-1.985578f)
#define HPF_Fs48000_Fc78_B2 0.985681f
-#ifdef HIGHER_FS
#define HPF_Fs88200_Fc78_A0 0.984678f
#define HPF_Fs88200_Fc78_A1 (-1.969356f)
#define HPF_Fs88200_Fc78_A2 0.984678f
@@ -750,7 +244,6 @@
#define HPF_Fs192000_Fc78_A2 0.986769f
#define HPF_Fs192000_Fc78_B1 (-1.996394f)
#define HPF_Fs192000_Fc78_B2 0.996401f
-#endif
/* Coefficients for centre frequency 90Hz */
#define HPF_Fs8000_Fc90_A0 0.940412f
@@ -799,7 +292,6 @@
#define HPF_Fs48000_Fc90_B1 (-1.983359f)
#define HPF_Fs48000_Fc90_B2 0.983497f
-#ifdef HIGHER_FS
#define HPF_Fs88200_Fc90_A0 0.984084f
#define HPF_Fs88200_Fc90_A1 (-1.968168f)
#define HPF_Fs88200_Fc90_A2 0.984084f
@@ -823,7 +315,6 @@
#define HPF_Fs192000_Fc90_A2 0.986496f
#define HPF_Fs192000_Fc90_B1 (-1.995840f)
#define HPF_Fs192000_Fc90_B2 0.995848f
-#endif
/************************************************************************************/
/* */
@@ -878,7 +369,6 @@
#define BPF_Fs48000_Fc55_B1 (-1.996823f)
#define BPF_Fs48000_Fc55_B2 0.996875f
-#ifdef HIGHER_FS
#define BPF_Fs88200_Fc55_A0 0.000831f
#define BPF_Fs88200_Fc55_A1 0.000000f
#define BPF_Fs88200_Fc55_A2 (-0.000831f)
@@ -902,7 +392,6 @@
#define BPF_Fs192000_Fc55_A2 (-0.000381f)
#define BPF_Fs192000_Fc55_B1 (-1.999234f)
#define BPF_Fs192000_Fc55_B2 0.999238f
-#endif
/* Coefficients for centre frequency 66Hz */
#define BPF_Fs8000_Fc66_A0 0.012648f
@@ -951,7 +440,6 @@
#define BPF_Fs48000_Fc66_B1 (-1.995615f)
#define BPF_Fs48000_Fc66_B2 0.995690f
-#ifdef HIGHER_FS
#define BPF_Fs88200_Fc66_A0 0.001146f
#define BPF_Fs88200_Fc66_A1 0.000000f
#define BPF_Fs88200_Fc66_A2 (-0.001146f)
@@ -975,7 +463,6 @@
#define BPF_Fs192000_Fc66_A2 (-0.000528f)
#define BPF_Fs192000_Fc66_B1 (-1.998939f)
#define BPF_Fs192000_Fc66_B2 0.998945f
-#endif
/* Coefficients for centre frequency 78Hz */
#define BPF_Fs8000_Fc78_A0 0.018572f
@@ -1024,7 +511,6 @@
#define BPF_Fs48000_Fc78_B1 (-1.993535f)
#define BPF_Fs48000_Fc78_B2 0.993639f
-#ifdef HIGHER_FS
#define BPF_Fs88200_Fc78_A0 0.001693f
#define BPF_Fs88200_Fc78_A1 0.000000f
#define BPF_Fs88200_Fc78_A2 (-0.001693f)
@@ -1048,7 +534,6 @@
#define BPF_Fs192000_Fc78_A2 (-0.000778f)
#define BPF_Fs192000_Fc78_B1 (-1.998437f)
#define BPF_Fs192000_Fc78_B2 0.998444f
-#endif
/* Coefficients for centre frequency 90Hz */
#define BPF_Fs8000_Fc90_A0 0.022760f
@@ -1097,7 +582,6 @@
#define BPF_Fs48000_Fc90_B1 (-1.992038f)
#define BPF_Fs48000_Fc90_B2 0.992177f
-#ifdef HIGHER_FS
#define BPF_Fs88200_Fc90_A0 0.002083f
#define BPF_Fs88200_Fc90_A1 0.000000f
#define BPF_Fs88200_Fc90_A2 (-0.002083f)
@@ -1121,7 +605,6 @@
#define BPF_Fs192000_Fc90_A2 (-0.000958f)
#define BPF_Fs192000_Fc90_B1 (-1.998075f)
#define BPF_Fs192000_Fc90_B2 0.998085f
-#endif
/************************************************************************************/
/* */
@@ -1140,12 +623,10 @@
#define AGC_ATTACK_Fs44100 0.969158f
#define AGC_ATTACK_Fs48000 0.971628f
-#ifdef HIGHER_FS
#define AGC_ATTACK_Fs88200 0.984458f
#define AGC_ATTACK_Fs96000 0.985712f
#define AGC_ATTACK_Fs176400 0.992199f
#define AGC_ATTACK_Fs192000 0.992830f
-#endif
#define DECAY_SHIFT 10
@@ -1159,12 +640,10 @@
#define AGC_DECAY_Fs44100 0.000008f
#define AGC_DECAY_Fs48000 0.000007f
-#ifdef HIGHER_FS
#define AGC_DECAY_Fs88200 0.0000038f
#define AGC_DECAY_FS96000 0.0000035f
#define AGC_DECAY_Fs176400 0.00000188f
#define AGC_DECAY_FS192000 0.00000175f
-#endif
/* AGC Gain settings */
#define AGC_GAIN_SCALE 31 /* As a power of 2 */
@@ -1224,12 +703,10 @@
#define VOL_TC_Fs32000 0.006231f
#define VOL_TC_Fs44100 0.004525f
#define VOL_TC_Fs48000 0.004158f
-#ifdef HIGHER_FS
#define VOL_TC_Fs88200 0.002263f
#define VOL_TC_Fs96000 0.002079f
#define VOL_TC_Fs176400 0.001131f
#define VOL_TC_Fs192000 0.001039f
-#endif
#define MIX_TC_Fs8000 29365 /* Floating point value 0.896151 */
#define MIX_TC_Fs11025 30230 /* Floating point value 0.922548 */
#define MIX_TC_Fs12000 30422 /* Floating point value 0.928415 */
@@ -1239,14 +716,11 @@
#define MIX_TC_Fs32000 31850 /* Floating point value 0.971973 */
#define MIX_TC_Fs44100 32097 /* Floating point value 0.979515 */
#define MIX_TC_Fs48000 32150 /* Floating point value 0.981150 */
-#ifdef HIGHER_FS
/* Floating point value 0.989704 */
#define MIX_TC_Fs88200 32430
#define MIX_TC_Fs96000 32456 /* Floating point value 0.990530 */
/* Floating point value 0.994838 */
#define MIX_TC_Fs176400 32598
#define MIX_TC_Fs192000 32611 /* Floating point value 0.992524 */
-#endif
-#endif /*BUILD_FLOAT*/
#endif
diff --git a/media/libeffects/lvm/lib/Bass/src/LVDBE_Control.cpp b/media/libeffects/lvm/lib/Bass/src/LVDBE_Control.cpp
index 513c67a..53feae8 100644
--- a/media/libeffects/lvm/lib/Bass/src/LVDBE_Control.cpp
+++ b/media/libeffects/lvm/lib/Bass/src/LVDBE_Control.cpp
@@ -58,7 +58,6 @@
return(LVDBE_SUCCESS);
}
-
/************************************************************************************/
/* */
/* FUNCTION: LVDBE_GetCapabilities */
@@ -89,7 +88,6 @@
return(LVDBE_SUCCESS);
}
-
/************************************************************************************/
/* */
/* FUNCTION: LVDBE_SetFilters */
@@ -107,72 +105,33 @@
LVDBE_Params_t *pParams)
{
-#if defined(BUILD_FLOAT) && defined(HIGHER_FS)
/*
* Calculate the table offsets
*/
LVM_UINT16 Offset = (LVM_UINT16)((LVM_UINT16)pParams->SampleRate + \
(LVM_UINT16)(pParams->CentreFrequency * (1+LVDBE_FS_192000)));
-#else
- /*
- * Calculate the table offsets
- */
- LVM_UINT16 Offset = (LVM_UINT16)((LVM_UINT16)pParams->SampleRate + \
- (LVM_UINT16)(pParams->CentreFrequency * (1+LVDBE_FS_48000)));
-#endif
/*
* Setup the high pass filter
*/
-#ifndef BUILD_FLOAT
- LoadConst_16(0, /* Clear the history, value 0 */
- (void *)&pInstance->pData->HPFTaps, /* Destination Cast to void: \
- no dereferencing in function*/
- sizeof(pInstance->pData->HPFTaps)/sizeof(LVM_INT16)); /* Number of words */
-#else
LoadConst_Float(0, /* Clear the history, value 0 */
- (LVM_FLOAT *)&pInstance->pData->HPFTaps, /* Destination Cast to void: \
- no dereferencing in function*/
+ (LVM_FLOAT *)&pInstance->pData->HPFTaps, /* Destination */
sizeof(pInstance->pData->HPFTaps) / sizeof(LVM_FLOAT)); /* Number of words */
-#endif
-#ifndef BUILD_FLOAT
- BQ_2I_D32F32Cll_TRC_WRA_01_Init(&pInstance->pCoef->HPFInstance, /* Initialise the filter */
- &pInstance->pData->HPFTaps,
- (BQ_C32_Coefs_t *)&LVDBE_HPF_Table[Offset]);
-#else
BQ_2I_D32F32Cll_TRC_WRA_01_Init(&pInstance->pCoef->HPFInstance, /* Initialise the filter */
&pInstance->pData->HPFTaps,
(BQ_FLOAT_Coefs_t *)&LVDBE_HPF_Table[Offset]);
-#endif
-
/*
* Setup the band pass filter
*/
-#ifndef BUILD_FLOAT
- LoadConst_16(0, /* Clear the history, value 0 */
- (void *)&pInstance->pData->BPFTaps, /* Destination Cast to void: \
- no dereferencing in function*/
- sizeof(pInstance->pData->BPFTaps)/sizeof(LVM_INT16)); /* Number of words */
-#else
LoadConst_Float(0, /* Clear the history, value 0 */
- (LVM_FLOAT *)&pInstance->pData->BPFTaps, /* Destination Cast to void: \
- no dereferencing in function*/
+ (LVM_FLOAT *)&pInstance->pData->BPFTaps, /* Destination */
sizeof(pInstance->pData->BPFTaps) / sizeof(LVM_FLOAT)); /* Number of words */
-#endif
-#ifndef BUILD_FLOAT
- BP_1I_D32F32Cll_TRC_WRA_02_Init(&pInstance->pCoef->BPFInstance, /* Initialise the filter */
- &pInstance->pData->BPFTaps,
- (BP_C32_Coefs_t *)&LVDBE_BPF_Table[Offset]);
-#else
BP_1I_D32F32Cll_TRC_WRA_02_Init(&pInstance->pCoef->BPFInstance, /* Initialise the filter */
&pInstance->pData->BPFTaps,
(BP_FLOAT_Coefs_t *)&LVDBE_BPF_Table[Offset]);
-#endif
}
-
-
/************************************************************************************/
/* */
/* FUNCTION: LVDBE_SetAGC */
@@ -196,7 +155,6 @@
pInstance->pData->AGCInstance.AGC_Attack = LVDBE_AGC_ATTACK_Table[(LVM_UINT16)pParams->SampleRate]; /* Attack multiplier */
pInstance->pData->AGCInstance.AGC_Decay = LVDBE_AGC_DECAY_Table[(LVM_UINT16)pParams->SampleRate]; /* Decay multipler */
-
/*
* Get the boost gain
*/
@@ -208,14 +166,10 @@
{
pInstance->pData->AGCInstance.AGC_MaxGain = LVDBE_AGC_GAIN_Table[(LVM_UINT16)pParams->EffectLevel]; /* High pass filter off */
}
-#ifndef BUILD_FLOAT
- pInstance->pData->AGCInstance.AGC_GainShift = AGC_GAIN_SHIFT;
-#endif
pInstance->pData->AGCInstance.AGC_Target = AGC_TARGETLEVEL;
}
-
/************************************************************************************/
/* */
/* FUNCTION: LVDBE_SetVolume */
@@ -247,9 +201,7 @@
LVM_UINT16 dBOffset; /* Table offset */
LVM_INT16 Volume = 0; /* Required volume in dBs */
-#ifdef BUILD_FLOAT
LVM_FLOAT dBShifts_fac;
-#endif
/*
* Apply the volume if enabled
*/
@@ -268,68 +220,41 @@
}
}
-
/*
* Calculate the required gain and shifts
*/
dBOffset = (LVM_UINT16)(6 + Volume % 6); /* Get the dBs 0-5 */
dBShifts = (LVM_UINT16)(Volume / -6); /* Get the 6dB shifts */
-#ifdef BUILD_FLOAT
dBShifts_fac = (LVM_FLOAT)(1 << dBShifts);
-#endif
/*
* When DBE is enabled use AGC volume
*/
-#ifndef BUILD_FLOAT
- pInstance->pData->AGCInstance.Target = ((LVM_INT32)LVDBE_VolumeTable[dBOffset] << 16);
- pInstance->pData->AGCInstance.Target = pInstance->pData->AGCInstance.Target >> dBShifts;
-#else
pInstance->pData->AGCInstance.Target = (LVDBE_VolumeTable[dBOffset]);
pInstance->pData->AGCInstance.Target = pInstance->pData->AGCInstance.Target / dBShifts_fac;
-#endif
pInstance->pData->AGCInstance.VolumeTC = LVDBE_VolumeTCTable[(LVM_UINT16)pParams->SampleRate]; /* Volume update time constant */
-#ifndef BUILD_FLOAT
- pInstance->pData->AGCInstance.VolumeShift = VOLUME_SHIFT+1;
-#endif
/*
* When DBE is disabled use the bypass volume control
*/
if(dBShifts > 0)
{
-#ifndef BUILD_FLOAT
- LVC_Mixer_SetTarget(&pInstance->pData->BypassVolume.MixerStream[0],(((LVM_INT32)LVDBE_VolumeTable[dBOffset]) >> dBShifts));
-#else
LVC_Mixer_SetTarget(&pInstance->pData->BypassVolume.MixerStream[0],
LVDBE_VolumeTable[dBOffset] / dBShifts_fac);
-#endif
}
else
{
-#ifndef BUILD_FLOAT
- LVC_Mixer_SetTarget(&pInstance->pData->BypassVolume.MixerStream[0],(LVM_INT32)LVDBE_VolumeTable[dBOffset]);
-#else
LVC_Mixer_SetTarget(&pInstance->pData->BypassVolume.MixerStream[0],
LVDBE_VolumeTable[dBOffset]);
-#endif
}
pInstance->pData->BypassVolume.MixerStream[0].CallbackSet = 1;
-#ifndef BUILD_FLOAT
LVC_Mixer_VarSlope_SetTimeConstant(&pInstance->pData->BypassVolume.MixerStream[0],
LVDBE_MIXER_TC,
(LVM_Fs_en)pInstance->Params.SampleRate,
2);
-#else
- LVC_Mixer_VarSlope_SetTimeConstant(&pInstance->pData->BypassVolume.MixerStream[0],
- LVDBE_MIXER_TC,
- (LVM_Fs_en)pInstance->Params.SampleRate,
- 2);
-#endif
}
-
/****************************************************************************************/
/* */
/* FUNCTION: LVDBE_Control */
@@ -372,12 +297,7 @@
{
LVDBE_Instance_t *pInstance =(LVDBE_Instance_t *)hInstance;
-#ifndef BUILD_FLOAT
- LVMixer3_2St_st *pBypassMixer_Instance = &pInstance->pData->BypassMixer;
-#else
LVMixer3_2St_FLOAT_st *pBypassMixer_Instance = &pInstance->pData->BypassMixer;
-#endif
-
/*
* Update the filters
@@ -389,7 +309,6 @@
pParams); /* New parameters */
}
-
/*
* Update the AGC is the effect level has changed
*/
@@ -399,24 +318,14 @@
{
LVDBE_SetAGC(pInstance, /* Instance pointer */
pParams); /* New parameters */
-#ifndef BUILD_FLOAT
- LVC_Mixer_SetTimeConstant(&pBypassMixer_Instance->MixerStream[0],
- LVDBE_BYPASS_MIXER_TC,(LVM_Fs_en)pParams->SampleRate,2);
-
- LVC_Mixer_SetTimeConstant(&pBypassMixer_Instance->MixerStream[1],
- LVDBE_BYPASS_MIXER_TC,(LVM_Fs_en)pParams->SampleRate,2);
-#else
LVC_Mixer_SetTimeConstant(&pBypassMixer_Instance->MixerStream[0],
LVDBE_BYPASS_MIXER_TC,(LVM_Fs_en)pParams->SampleRate, 2);
LVC_Mixer_SetTimeConstant(&pBypassMixer_Instance->MixerStream[1],
LVDBE_BYPASS_MIXER_TC,(LVM_Fs_en)pParams->SampleRate, 2);
-#endif
-
}
-
/*
* Update the Volume if the volume demand has changed
*/
@@ -431,23 +340,13 @@
if (pInstance->Params.OperatingMode==LVDBE_ON && pParams->OperatingMode==LVDBE_OFF)
{
-#ifndef BUILD_FLOAT
- LVC_Mixer_SetTarget(&pInstance->pData->BypassMixer.MixerStream[0],0);
- LVC_Mixer_SetTarget(&pInstance->pData->BypassMixer.MixerStream[1],0x00007FFF);
-#else
LVC_Mixer_SetTarget(&pInstance->pData->BypassMixer.MixerStream[0], 0);
LVC_Mixer_SetTarget(&pInstance->pData->BypassMixer.MixerStream[1], 1.0f);
-#endif
}
if (pInstance->Params.OperatingMode==LVDBE_OFF && pParams->OperatingMode==LVDBE_ON)
{
-#ifndef BUILD_FLOAT
- LVC_Mixer_SetTarget(&pInstance->pData->BypassMixer.MixerStream[0],0x00007FFF);
- LVC_Mixer_SetTarget(&pInstance->pData->BypassMixer.MixerStream[1],0);
-#else
LVC_Mixer_SetTarget(&pInstance->pData->BypassMixer.MixerStream[0], 1.0f);
LVC_Mixer_SetTarget(&pInstance->pData->BypassMixer.MixerStream[1], 0);
-#endif
}
/*
@@ -455,6 +354,5 @@
*/
pInstance->Params = *pParams;
-
return(LVDBE_SUCCESS);
}
diff --git a/media/libeffects/lvm/lib/Bass/src/LVDBE_Init.cpp b/media/libeffects/lvm/lib/Bass/src/LVDBE_Init.cpp
index a5500ba..ad77696 100644
--- a/media/libeffects/lvm/lib/Bass/src/LVDBE_Init.cpp
+++ b/media/libeffects/lvm/lib/Bass/src/LVDBE_Init.cpp
@@ -63,7 +63,6 @@
LVM_UINT32 ScratchSize;
LVDBE_Instance_t *pInstance = (LVDBE_Instance_t *)hInstance;
-
/*
* Fill in the memory table
*/
@@ -80,11 +79,7 @@
/*
* Data memory
*/
-#ifdef BUILD_FLOAT
pMemoryTable->Region[LVDBE_MEMREGION_PERSISTENT_DATA].Size = sizeof(LVDBE_Data_FLOAT_t);
-#else
- pMemoryTable->Region[LVDBE_MEMREGION_PERSISTENT_DATA].Size = sizeof(LVDBE_Data_t);
-#endif
pMemoryTable->Region[LVDBE_MEMREGION_PERSISTENT_DATA].Alignment = LVDBE_PERSISTENT_DATA_ALIGN;
pMemoryTable->Region[LVDBE_MEMREGION_PERSISTENT_DATA].Type = LVDBE_PERSISTENT_DATA;
pMemoryTable->Region[LVDBE_MEMREGION_PERSISTENT_DATA].pBaseAddress = LVM_NULL;
@@ -92,11 +87,7 @@
/*
* Coef memory
*/
-#ifdef BUILD_FLOAT
pMemoryTable->Region[LVDBE_MEMREGION_PERSISTENT_COEF].Size = sizeof(LVDBE_Coef_FLOAT_t);
-#else
- pMemoryTable->Region[LVDBE_MEMREGION_PERSISTENT_COEF].Size = sizeof(LVDBE_Coef_t);
-#endif
pMemoryTable->Region[LVDBE_MEMREGION_PERSISTENT_COEF].Alignment = LVDBE_PERSISTENT_COEF_ALIGN;
pMemoryTable->Region[LVDBE_MEMREGION_PERSISTENT_COEF].Type = LVDBE_PERSISTENT_COEF;
pMemoryTable->Region[LVDBE_MEMREGION_PERSISTENT_COEF].pBaseAddress = LVM_NULL;
@@ -104,12 +95,8 @@
/*
* Scratch memory
*/
-#ifdef BUILD_FLOAT
ScratchSize = (LVM_UINT32)(LVDBE_SCRATCHBUFFERS_INPLACE*sizeof(LVM_FLOAT) * \
pCapabilities->MaxBlockSize);
-#else /*BUILD_FLOAT*/
- ScratchSize = (LVM_UINT32)(LVDBE_SCRATCHBUFFERS_INPLACE*sizeof(LVM_INT16)*pCapabilities->MaxBlockSize);
-#endif
pMemoryTable->Region[LVDBE_MEMREGION_SCRATCH].Size = ScratchSize;
pMemoryTable->Region[LVDBE_MEMREGION_SCRATCH].Alignment = LVDBE_SCRATCH_ALIGN;
pMemoryTable->Region[LVDBE_MEMREGION_SCRATCH].Type = LVDBE_SCRATCH;
@@ -124,7 +111,6 @@
return(LVDBE_SUCCESS);
}
-
/****************************************************************************************/
/* */
/* FUNCTION: LVDBE_Init */
@@ -164,18 +150,11 @@
{
LVDBE_Instance_t *pInstance;
-#ifdef BUILD_FLOAT
LVMixer3_1St_FLOAT_st *pMixer_Instance;
LVMixer3_2St_FLOAT_st *pBypassMixer_Instance;
LVM_FLOAT MixGain;
-#else
- LVMixer3_1St_st *pMixer_Instance;
- LVMixer3_2St_st *pBypassMixer_Instance;
- LVM_INT32 MixGain;
-#endif
LVM_INT16 i;
-
/*
* Set the instance handle if not already initialised
*/
@@ -185,7 +164,6 @@
}
pInstance =(LVDBE_Instance_t *)*phInstance;
-
/*
* Check the memory table for NULL pointers and incorrectly aligned data
*/
@@ -203,19 +181,16 @@
}
}
-
/*
* Save the memory table in the instance structure
*/
pInstance->Capabilities = *pCapabilities;
-
/*
* Save the memory table in the instance structure
*/
pInstance->MemoryTable = *pMemoryTable;
-
/*
* Set the default instance parameters
*/
@@ -228,7 +203,6 @@
pInstance->Params.VolumeControl = LVDBE_VOLUME_OFF;
pInstance->Params.VolumedB = 0;
-
/*
* Set pointer to data and coef memory
*/
@@ -237,14 +211,12 @@
pInstance->pCoef =
(LVDBE_Coef_FLOAT_t *)pMemoryTable->Region[LVDBE_MEMREGION_PERSISTENT_COEF].pBaseAddress;
-
/*
* Initialise the filters
*/
LVDBE_SetFilters(pInstance, /* Set the filter taps and coefficients */
&pInstance->Params);
-
/*
* Initialise the AGC
*/
@@ -256,11 +228,7 @@
// initialize the mixer with some fixes values since otherwise LVDBE_SetVolume ends up
// reading uninitialized data
pMixer_Instance = &pInstance->pData->BypassVolume;
-#ifndef BUILD_FLOAT
- LVC_Mixer_Init(&pMixer_Instance->MixerStream[0],0x00007FFF,0x00007FFF);
-#else
LVC_Mixer_Init(&pMixer_Instance->MixerStream[0], 1.0, 1.0);
-#endif
/*
* Initialise the volume
@@ -270,13 +238,8 @@
pInstance->pData->AGCInstance.Volume = pInstance->pData->AGCInstance.Target;
/* Initialise as the target */
-#ifndef BUILD_FLOAT
- MixGain = LVC_Mixer_GetTarget(&pMixer_Instance->MixerStream[0]);
- LVC_Mixer_Init(&pMixer_Instance->MixerStream[0],MixGain,MixGain);
-#else
MixGain = LVC_Mixer_GetTarget(&pMixer_Instance->MixerStream[0]);
LVC_Mixer_Init(&pMixer_Instance->MixerStream[0], MixGain, MixGain);
-#endif
/* Configure the mixer process path */
pMixer_Instance->MixerStream[0].CallbackParam = 0;
@@ -309,15 +272,9 @@
pBypassMixer_Instance->MixerStream[1].pCallbackHandle = LVM_NULL;
pBypassMixer_Instance->MixerStream[1].pCallBack = LVM_NULL;
pBypassMixer_Instance->MixerStream[1].CallbackSet=0;
-#ifndef BUILD_FLOAT
- LVC_Mixer_Init(&pBypassMixer_Instance->MixerStream[1],0x00007FFF,0x00007FFF);
- LVC_Mixer_SetTimeConstant(&pBypassMixer_Instance->MixerStream[1],
- LVDBE_BYPASS_MIXER_TC,(LVM_Fs_en)pInstance->Params.SampleRate,2);
-#else
LVC_Mixer_Init(&pBypassMixer_Instance->MixerStream[1], 1.0, 1.0);
LVC_Mixer_SetTimeConstant(&pBypassMixer_Instance->MixerStream[1],
LVDBE_BYPASS_MIXER_TC,(LVM_Fs_en)pInstance->Params.SampleRate, 2);
-#endif
return(LVDBE_SUCCESS);
}
diff --git a/media/libeffects/lvm/lib/Bass/src/LVDBE_Private.h b/media/libeffects/lvm/lib/Bass/src/LVDBE_Private.h
index 458e9e8..f3faaed 100644
--- a/media/libeffects/lvm/lib/Bass/src/LVDBE_Private.h
+++ b/media/libeffects/lvm/lib/Bass/src/LVDBE_Private.h
@@ -27,8 +27,6 @@
#ifndef __LVDBE_PRIVATE_H__
#define __LVDBE_PRIVATE_H__
-
-
/****************************************************************************************/
/* */
/* Includes */
@@ -40,7 +38,6 @@
#include "LVC_Mixer.h"
#include "AGC.h"
-
/****************************************************************************************/
/* */
/* Defines */
@@ -71,7 +68,6 @@
#define LVDBE_MIXER_TC 5 /* Mixer time */
#define LVDBE_BYPASS_MIXER_TC 100 /* Bypass mixer time */
-
/****************************************************************************************/
/* */
/* Structures */
@@ -79,29 +75,6 @@
/****************************************************************************************/
/* Data structure */
-#ifndef BUILD_FLOAT
-typedef struct
-{
- /* AGC parameters */
- AGC_MIX_VOL_2St1Mon_D32_t AGCInstance; /* AGC instance parameters */
-
- /* Process variables */
- Biquad_2I_Order2_Taps_t HPFTaps; /* High pass filter taps */
- Biquad_1I_Order2_Taps_t BPFTaps; /* Band pass filter taps */
- LVMixer3_1St_st BypassVolume; /* Bypass volume scaler */
- LVMixer3_2St_st BypassMixer; /* Bypass Mixer for Click Removal */
-
-} LVDBE_Data_t;
-
-/* Coefs structure */
-typedef struct
-{
- /* Process variables */
- Biquad_Instance_t HPFInstance; /* High pass filter instance */
- Biquad_Instance_t BPFInstance; /* Band pass filter instance */
-
-} LVDBE_Coef_t;
-#else
/* Data structure */
typedef struct
{
@@ -123,7 +96,6 @@
Biquad_FLOAT_Instance_t HPFInstance; /* High pass filter instance */
Biquad_FLOAT_Instance_t BPFInstance; /* Band pass filter instance */
} LVDBE_Coef_FLOAT_t;
-#endif
/* Instance structure */
typedef struct
{
@@ -133,16 +105,10 @@
LVDBE_Capabilities_t Capabilities; /* Instance capabilities */
/* Data and coefficient pointers */
-#ifndef BUILD_FLOAT
- LVDBE_Data_t *pData; /* Instance data */
- LVDBE_Coef_t *pCoef; /* Instance coefficients */
-#else
LVDBE_Data_FLOAT_t *pData; /* Instance data */
LVDBE_Coef_FLOAT_t *pCoef; /* Instance coefficients */
-#endif
} LVDBE_Instance_t;
-
/****************************************************************************************/
/* */
/* Function prototypes */
@@ -152,14 +118,10 @@
void LVDBE_SetAGC(LVDBE_Instance_t *pInstance,
LVDBE_Params_t *pParams);
-
void LVDBE_SetVolume(LVDBE_Instance_t *pInstance,
LVDBE_Params_t *pParams);
-
void LVDBE_SetFilters(LVDBE_Instance_t *pInstance,
LVDBE_Params_t *pParams);
-
-
#endif /* __LVDBE_PRIVATE_H__ */
diff --git a/media/libeffects/lvm/lib/Bass/src/LVDBE_Process.cpp b/media/libeffects/lvm/lib/Bass/src/LVDBE_Process.cpp
index c4d3403..b4a71c7 100644
--- a/media/libeffects/lvm/lib/Bass/src/LVDBE_Process.cpp
+++ b/media/libeffects/lvm/lib/Bass/src/LVDBE_Process.cpp
@@ -73,119 +73,6 @@
/* overall end to end gain is odB. */
/* */
/********************************************************************************************/
-#ifndef BUILD_FLOAT
-LVDBE_ReturnStatus_en LVDBE_Process(LVDBE_Handle_t hInstance,
- const LVM_INT16 *pInData, LVM_INT16 *pOutData, LVM_UINT16 NumSamples) {
-
- LVDBE_Instance_t *pInstance = (LVDBE_Instance_t *) hInstance;
- LVM_INT32 *pScratch =
- (LVM_INT32 *) pInstance->MemoryTable.Region[LVDBE_MEMREGION_SCRATCH].pBaseAddress;
- LVM_INT32 *pMono;
- LVM_INT16 *pInput = (LVM_INT16 *) pInData;
-
- /* Scratch for Volume Control starts at offset of 2*NumSamples short values from pScratch */
- LVM_INT16 *pScratchVol = (LVM_INT16 *) (&pScratch[NumSamples]);
-
- /* Scratch for Mono path starts at offset of 2*NumSamples 32-bit values from pScratch */
- pMono = &pScratch[2 * NumSamples];
-
- /*
- * Check the number of samples is not too large
- */
- if (NumSamples > pInstance->Capabilities.MaxBlockSize) {
- return (LVDBE_TOOMANYSAMPLES);
- }
-
- /*
- * Check if the algorithm is enabled
- */
- /* DBE path is processed when DBE is ON or during On/Off transitions */
- if ((pInstance->Params.OperatingMode == LVDBE_ON)
- || (LVC_Mixer_GetCurrent(
- &pInstance->pData->BypassMixer.MixerStream[0])
- != LVC_Mixer_GetTarget(
- &pInstance->pData->BypassMixer.MixerStream[0]))) {
-
- /*
- * Convert 16-bit samples to 32-bit and scale
- * (For a 16-bit implementation apply headroom loss here)
- */
- Int16LShiftToInt32_16x32(pInput, /* Source 16-bit data */
- pScratch, /* Dest. 32-bit data */
- (LVM_INT16) (2 * NumSamples), /* Left and right */
- LVDBE_SCALESHIFT); /* Shift scale */
-
- /*
- * Apply the high pass filter if selected
- */
- if (pInstance->Params.HPFSelect == LVDBE_HPF_ON) {
- BQ_2I_D32F32C30_TRC_WRA_01(&pInstance->pCoef->HPFInstance,/* Filter instance */
- (LVM_INT32 *) pScratch, /* Source */
- (LVM_INT32 *) pScratch, /* Destination */
- (LVM_INT16) NumSamples); /* Number of samples */
- }
-
- /*
- * Create the mono stream
- */
- From2iToMono_32(pScratch, /* Stereo source */
- pMono, /* Mono destination */
- (LVM_INT16) NumSamples); /* Number of samples */
-
- /*
- * Apply the band pass filter
- */
- BP_1I_D32F32C30_TRC_WRA_02(&pInstance->pCoef->BPFInstance, /* Filter instance */
- (LVM_INT32 *) pMono, /* Source */
- (LVM_INT32 *) pMono, /* Destination */
- (LVM_INT16) NumSamples); /* Number of samples */
-
- /*
- * Apply the AGC and mix
- */
- AGC_MIX_VOL_2St1Mon_D32_WRA(&pInstance->pData->AGCInstance, /* Instance pointer */
- pScratch, /* Stereo source */
- pMono, /* Mono band pass source */
- pScratch, /* Stereo destination */
- NumSamples); /* Number of samples */
-
- /*
- * Convert 32-bit samples to 16-bit and saturate
- * (Not required for 16-bit implemenations)
- */
- Int32RShiftToInt16_Sat_32x16(pScratch, /* Source 32-bit data */
- (LVM_INT16 *) pScratch, /* Dest. 16-bit data */
- (LVM_INT16) (2 * NumSamples), /* Left and right */
- LVDBE_SCALESHIFT); /* Shift scale */
-
- }
-
- /* Bypass Volume path is processed when DBE is OFF or during On/Off transitions */
- if ((pInstance->Params.OperatingMode == LVDBE_OFF)
- || (LVC_Mixer_GetCurrent(
- &pInstance->pData->BypassMixer.MixerStream[1])
- != LVC_Mixer_GetTarget(
- &pInstance->pData->BypassMixer.MixerStream[1]))) {
-
- /*
- * The algorithm is disabled but volume management is required to compensate for
- * headroom and volume (if enabled)
- */
- LVC_MixSoft_1St_D16C31_SAT(&pInstance->pData->BypassVolume, pInData,
- pScratchVol, (LVM_INT16) (2 * NumSamples)); /* Left and right */
-
- }
-
- /*
- * Mix DBE processed path and bypass volume path
- */
- LVC_MixSoft_2St_D16C31_SAT(&pInstance->pData->BypassMixer,
- (LVM_INT16 *) pScratch, pScratchVol, pOutData,
- (LVM_INT16) (2 * NumSamples));
-
- return (LVDBE_SUCCESS);
-}
-#else /*BUILD_FLOAT*/
LVDBE_ReturnStatus_en LVDBE_Process(LVDBE_Handle_t hInstance,
const LVM_FLOAT *pInData,
LVM_FLOAT *pOutData,
@@ -362,4 +249,3 @@
#endif
return LVDBE_SUCCESS;
}
-#endif
diff --git a/media/libeffects/lvm/lib/Bass/src/LVDBE_Tables.cpp b/media/libeffects/lvm/lib/Bass/src/LVDBE_Tables.cpp
index 058dcf6..728575c 100644
--- a/media/libeffects/lvm/lib/Bass/src/LVDBE_Tables.cpp
+++ b/media/libeffects/lvm/lib/Bass/src/LVDBE_Tables.cpp
@@ -15,7 +15,6 @@
* limitations under the License.
*/
-
/************************************************************************************/
/* */
/* Includes */
@@ -27,7 +26,6 @@
#include "LVDBE_Tables.h"
#include "BIQUAD.h"
-
/************************************************************************************/
/* */
/* Coefficients constant table */
@@ -37,11 +35,7 @@
/*
* High Pass Filter Coefficient table
*/
-#ifndef BUILD_FLOAT
-const BQ_C32_Coefs_t LVDBE_HPF_Table[] = {
-#else /*BUILD_FLOAT*/
const BQ_FLOAT_Coefs_t LVDBE_HPF_Table[] = {
-#endif /*BUILD_FLOAT*/
/* Coefficients for 55Hz centre frequency */
{HPF_Fs8000_Fc55_A2, /* 8kS/s coefficients */
HPF_Fs8000_Fc55_A1,
@@ -88,7 +82,6 @@
HPF_Fs48000_Fc55_A0,
-HPF_Fs48000_Fc55_B2,
-HPF_Fs48000_Fc55_B1},
-#ifdef HIGHER_FS
{HPF_Fs88200_Fc55_A2, /* 88kS/s coefficients */
HPF_Fs88200_Fc55_A1,
HPF_Fs88200_Fc55_A0,
@@ -109,7 +102,6 @@
HPF_Fs192000_Fc55_A0,
-HPF_Fs192000_Fc55_B2,
-HPF_Fs192000_Fc55_B1},
-#endif
/* Coefficients for 66Hz centre frequency */
{HPF_Fs8000_Fc66_A2, /* 8kS/s coefficients */
@@ -157,7 +149,6 @@
HPF_Fs48000_Fc66_A0,
-HPF_Fs48000_Fc66_B2,
-HPF_Fs48000_Fc66_B1},
-#ifdef HIGHER_FS
{HPF_Fs88200_Fc66_A2, /* 88kS/s coefficients */
HPF_Fs88200_Fc66_A1,
HPF_Fs88200_Fc66_A0,
@@ -178,8 +169,6 @@
HPF_Fs192000_Fc66_A0,
-HPF_Fs192000_Fc66_B2,
-HPF_Fs192000_Fc66_B1},
-#endif
-
/* Coefficients for 78Hz centre frequency */
{HPF_Fs8000_Fc78_A2, /* 8kS/s coefficients */
@@ -227,7 +216,6 @@
HPF_Fs48000_Fc78_A0,
-HPF_Fs48000_Fc78_B2,
-HPF_Fs48000_Fc78_B1},
-#ifdef HIGHER_FS
{HPF_Fs88200_Fc78_A2, /* 88kS/s coefficients */
HPF_Fs88200_Fc78_A1,
HPF_Fs88200_Fc78_A0,
@@ -248,8 +236,6 @@
HPF_Fs192000_Fc78_A0,
-HPF_Fs192000_Fc78_B2,
-HPF_Fs192000_Fc78_B1},
-#endif
-
/* Coefficients for 90Hz centre frequency */
{HPF_Fs8000_Fc90_A2, /* 8kS/s coefficients */
@@ -298,7 +284,6 @@
-HPF_Fs48000_Fc90_B2,
-HPF_Fs48000_Fc90_B1}
-#ifdef HIGHER_FS
,
{HPF_Fs88200_Fc90_A2, /* 88kS/s coefficients */
HPF_Fs88200_Fc90_A1,
@@ -320,18 +305,13 @@
HPF_Fs192000_Fc90_A0,
-HPF_Fs192000_Fc90_B2,
-HPF_Fs192000_Fc90_B1}
-#endif
};
/*
* Band Pass Filter coefficient table
*/
-#ifndef BUILD_FLOAT
-const BP_C32_Coefs_t LVDBE_BPF_Table[] = {
-#else /*BUILD_FLOAT*/
const BP_FLOAT_Coefs_t LVDBE_BPF_Table[] = {
-#endif /*BUILD_FLOAT*/
/* Coefficients for 55Hz centre frequency */
{BPF_Fs8000_Fc55_A0, /* 8kS/s coefficients */
-BPF_Fs8000_Fc55_B2,
@@ -360,7 +340,6 @@
{BPF_Fs48000_Fc55_A0, /* 48kS/s coefficients */
-BPF_Fs48000_Fc55_B2,
-BPF_Fs48000_Fc55_B1},
-#ifdef HIGHER_FS
{BPF_Fs88200_Fc55_A0, /* 88kS/s coefficients */
-BPF_Fs88200_Fc55_B2,
-BPF_Fs88200_Fc55_B1},
@@ -373,7 +352,6 @@
{BPF_Fs192000_Fc55_A0, /* 192kS/s coefficients */
-BPF_Fs192000_Fc55_B2,
-BPF_Fs192000_Fc55_B1},
-#endif
/* Coefficients for 66Hz centre frequency */
{BPF_Fs8000_Fc66_A0, /* 8kS/s coefficients */
@@ -403,7 +381,6 @@
{BPF_Fs48000_Fc66_A0, /* 48kS/s coefficients */
-BPF_Fs48000_Fc66_B2,
-BPF_Fs48000_Fc66_B1},
-#ifdef HIGHER_FS
{BPF_Fs88200_Fc66_A0, /* 88kS/s coefficients */
-BPF_Fs88200_Fc66_B2,
-BPF_Fs88200_Fc66_B1},
@@ -416,7 +393,6 @@
{BPF_Fs192000_Fc66_A0, /* 192kS/s coefficients */
-BPF_Fs192000_Fc66_B2,
-BPF_Fs192000_Fc66_B1},
-#endif
/* Coefficients for 78Hz centre frequency */
{BPF_Fs8000_Fc78_A0, /* 8kS/s coefficients */
@@ -446,7 +422,6 @@
{BPF_Fs48000_Fc78_A0, /* 48kS/s coefficients */
-BPF_Fs48000_Fc78_B2,
-BPF_Fs48000_Fc78_B1},
-#ifdef HIGHER_FS
{BPF_Fs88200_Fc66_A0, /* 88kS/s coefficients */
-BPF_Fs88200_Fc66_B2,
-BPF_Fs88200_Fc66_B1},
@@ -459,7 +434,6 @@
{BPF_Fs192000_Fc78_A0, /* 192kS/s coefficients */
-BPF_Fs192000_Fc78_B2,
-BPF_Fs192000_Fc78_B1},
-#endif
/* Coefficients for 90Hz centre frequency */
{BPF_Fs8000_Fc90_A0, /* 8kS/s coefficients */
@@ -489,7 +463,6 @@
{BPF_Fs48000_Fc90_A0, /* 48kS/s coefficients */
-BPF_Fs48000_Fc90_B2,
-BPF_Fs48000_Fc90_B1}
-#ifdef HIGHER_FS
,
{BPF_Fs88200_Fc90_A0, /* 88kS/s coefficients */
-BPF_Fs88200_Fc90_B2,
@@ -503,12 +476,9 @@
{BPF_Fs192000_Fc90_A0, /* 192kS/s coefficients */
-BPF_Fs192000_Fc90_B2,
-BPF_Fs192000_Fc90_B1}
-#endif
-
};
-
/************************************************************************************/
/* */
/* AGC constant tables */
@@ -516,11 +486,7 @@
/************************************************************************************/
/* Attack time (signal too large) */
-#ifndef BUILD_FLOAT
-const LVM_INT16 LVDBE_AGC_ATTACK_Table[] = {
-#else /*BUILD_FLOAT*/
const LVM_FLOAT LVDBE_AGC_ATTACK_Table[] = {
-#endif /*BUILD_FLOAT*/
AGC_ATTACK_Fs8000,
AGC_ATTACK_Fs11025,
AGC_ATTACK_Fs12000,
@@ -530,21 +496,15 @@
AGC_ATTACK_Fs32000,
AGC_ATTACK_Fs44100,
AGC_ATTACK_Fs48000
-#ifdef HIGHER_FS
,AGC_ATTACK_Fs88200
,AGC_ATTACK_Fs96000
,AGC_ATTACK_Fs176400
,AGC_ATTACK_Fs192000
-#endif
};
/* Decay time (signal too small) */
-#ifndef BUILD_FLOAT
-const LVM_INT16 LVDBE_AGC_DECAY_Table[] = {
-#else /*BUILD_FLOAT*/
const LVM_FLOAT LVDBE_AGC_DECAY_Table[] = {
-#endif /*BUILD_FLOAT*/
AGC_DECAY_Fs8000,
AGC_DECAY_Fs11025,
AGC_DECAY_Fs12000,
@@ -554,21 +514,15 @@
AGC_DECAY_Fs32000,
AGC_DECAY_Fs44100,
AGC_DECAY_Fs48000
-#ifdef HIGHER_FS
,AGC_DECAY_Fs88200
,AGC_DECAY_FS96000
,AGC_DECAY_Fs176400
,AGC_DECAY_FS192000
-#endif
};
/* Gain for use without the high pass filter */
-#ifndef BUILD_FLOAT
-const LVM_INT32 LVDBE_AGC_GAIN_Table[] = {
-#else /*BUILD_FLOAT*/
const LVM_FLOAT LVDBE_AGC_GAIN_Table[] = {
-#endif /*BUILD_FLOAT*/
AGC_GAIN_0dB,
AGC_GAIN_1dB,
AGC_GAIN_2dB,
@@ -587,11 +541,7 @@
AGC_GAIN_15dB};
/* Gain for use with the high pass filter */
-#ifndef BUILD_FLOAT
-const LVM_INT32 LVDBE_AGC_HPFGAIN_Table[] = {
-#else /*BUILD_FLOAT*/
const LVM_FLOAT LVDBE_AGC_HPFGAIN_Table[] = {
-#endif /*BUILD_FLOAT*/
AGC_HPFGAIN_0dB,
AGC_HPFGAIN_1dB,
AGC_HPFGAIN_2dB,
@@ -609,7 +559,6 @@
AGC_HPFGAIN_14dB,
AGC_HPFGAIN_15dB};
-
/************************************************************************************/
/* */
/* Volume control gain and time constant tables */
@@ -617,16 +566,6 @@
/************************************************************************************/
/* dB to linear conversion table */
-#ifndef BUILD_FLOAT
-const LVM_INT16 LVDBE_VolumeTable[] = {
- 0x4000, /* -6dB */
- 0x47FB, /* -5dB */
- 0x50C3, /* -4dB */
- 0x5A9E, /* -3dB */
- 0x65AD, /* -2dB */
- 0x7215, /* -1dB */
- 0x7FFF}; /* 0dB */
-#else /*BUILD_FLOAT*/
const LVM_FLOAT LVDBE_VolumeTable[] = {
0.500000f, /* -6dB */
0.562341f, /* -5dB */
@@ -635,13 +574,8 @@
0.794328f, /* -2dB */
0.891251f, /* -1dB */
1.000000f}; /* 0dB */
-#endif /*BUILD_FLOAT*/
-#ifndef BUILD_FLOAT
-const LVM_INT16 LVDBE_VolumeTCTable[] = {
-#else /*BUILD_FLOAT*/
const LVM_FLOAT LVDBE_VolumeTCTable[] = {
-#endif /*BUILD_FLOAT*/
VOL_TC_Fs8000,
VOL_TC_Fs11025,
VOL_TC_Fs12000,
@@ -651,16 +585,12 @@
VOL_TC_Fs32000,
VOL_TC_Fs44100,
VOL_TC_Fs48000
-#ifdef HIGHER_FS
,VOL_TC_Fs88200
,VOL_TC_Fs96000
,VOL_TC_Fs176400
,VOL_TC_Fs192000
-#endif
};
-
-
const LVM_INT16 LVDBE_MixerTCTable[] = {
MIX_TC_Fs8000,
@@ -672,11 +602,9 @@
MIX_TC_Fs32000,
MIX_TC_Fs44100,
MIX_TC_Fs48000
-#ifdef HIGHER_FS
,MIX_TC_Fs88200
,MIX_TC_Fs96000
,MIX_TC_Fs176400
,MIX_TC_Fs192000
-#endif
};
diff --git a/media/libeffects/lvm/lib/Bass/src/LVDBE_Tables.h b/media/libeffects/lvm/lib/Bass/src/LVDBE_Tables.h
index fea09f3..6eabdd2 100644
--- a/media/libeffects/lvm/lib/Bass/src/LVDBE_Tables.h
+++ b/media/libeffects/lvm/lib/Bass/src/LVDBE_Tables.h
@@ -15,7 +15,6 @@
* limitations under the License.
*/
-
/************************************************************************************/
/* */
/* Includes */
@@ -24,58 +23,9 @@
#ifndef __LVBDE_TABLES_H__
#define __LVBDE_TABLES_H__
-
#include "BIQUAD.h"
#include "LVM_Types.h"
-#ifndef BUILD_FLOAT
-/************************************************************************************/
-/* */
-/* Coefficients constant table */
-/* */
-/************************************************************************************/
-
-/*
- * High Pass Filter Coefficient table
- */
-extern const BQ_C32_Coefs_t LVDBE_HPF_Table[];
-
-/*
- * Band Pass Filter coefficient table
- */
-extern const BP_C32_Coefs_t LVDBE_BPF_Table[];
-
-/************************************************************************************/
-/* */
-/* AGC constant tables */
-/* */
-/************************************************************************************/
-
-/* Attack time (signal too large) */
-extern const LVM_INT16 LVDBE_AGC_ATTACK_Table[];
-
-/* Decay time (signal too small) */
-extern const LVM_INT16 LVDBE_AGC_DECAY_Table[];
-
-/* Gain for use without the high pass filter */
-extern const LVM_INT32 LVDBE_AGC_GAIN_Table[];
-
-/* Gain for use with the high pass filter */
-extern const LVM_INT32 LVDBE_AGC_HPFGAIN_Table[];
-
-/************************************************************************************/
-/* */
-/* Volume control gain and time constant tables */
-/* */
-/************************************************************************************/
-
-/* dB to linear conversion table */
-extern const LVM_INT16 LVDBE_VolumeTable[];
-
-extern const LVM_INT16 LVDBE_VolumeTCTable[];
-
-#else /*BUILD_FLOAT*/
-
/************************************************************************************/
/* */
/* Coefficients constant table */
@@ -120,10 +70,6 @@
extern const LVM_FLOAT LVDBE_VolumeTable[];
extern const LVM_FLOAT LVDBE_VolumeTCTable[];
-#endif /*BUILD_FLOAT*/
-
extern const LVM_INT16 LVDBE_MixerTCTable[];
-
-
#endif /* __LVBDE_TABLES_H__ */
diff --git a/media/libeffects/lvm/lib/Bundle/lib/LVM.h b/media/libeffects/lvm/lib/Bundle/lib/LVM.h
index 3c089a0..e4e8450 100644
--- a/media/libeffects/lvm/lib/Bundle/lib/LVM.h
+++ b/media/libeffects/lvm/lib/Bundle/lib/LVM.h
@@ -53,8 +53,6 @@
#ifndef __LVM_H__
#define __LVM_H__
-
-
/****************************************************************************************/
/* */
/* Includes */
@@ -63,7 +61,6 @@
#include "LVM_Types.h"
-
/****************************************************************************************/
/* */
/* Definitions */
@@ -105,7 +102,6 @@
/* Instance handle */
typedef void *LVM_Handle_t;
-
/* Status return values */
typedef enum
{
@@ -120,7 +116,6 @@
LVM_RETURNSTATUS_DUMMY = LVM_MAXENUM
} LVM_ReturnStatus_en;
-
/* Buffer Management mode */
typedef enum
{
@@ -224,7 +219,6 @@
LVM_CHAR *pPlatform; /* Pointer to the library platform type */
} LVM_VersionInfo_st;
-
/****************************************************************************************/
/* */
/* Structures */
@@ -245,7 +239,6 @@
LVM_UINT16 QFactor; /* Band quality factor (x100) */
} LVM_EQNB_BandDef_t;
-
/* Headroom band definition */
typedef struct
{
@@ -254,7 +247,6 @@
LVM_INT16 Headroom_Offset; /* Headroom = biggest band gain - Headroom_Offset */
} LVM_HeadroomBandDef_t;
-
/* Control Parameter structure */
typedef struct
{
@@ -300,7 +292,6 @@
} LVM_ControlParams_t;
-
/* Instance Parameter structure */
typedef struct
{
@@ -330,7 +321,6 @@
/* */
/****************************************************************************************/
-
/****************************************************************************************/
/* */
/* FUNCTION: LVM_GetVersionInfo */
@@ -351,7 +341,6 @@
/****************************************************************************************/
LVM_ReturnStatus_en LVM_GetVersionInfo(LVM_VersionInfo_st *pVersion);
-
/****************************************************************************************/
/* */
/* FUNCTION: LVM_GetMemoryTable */
@@ -388,7 +377,6 @@
LVM_MemTab_t *pMemoryTable,
LVM_InstParams_t *pInstParams);
-
/****************************************************************************************/
/* */
/* FUNCTION: LVM_GetInstanceHandle */
@@ -415,7 +403,6 @@
LVM_MemTab_t *pMemoryTable,
LVM_InstParams_t *pInstParams);
-
/****************************************************************************************/
/* */
/* FUNCTION: LVM_ClearAudioBuffers */
@@ -436,7 +423,6 @@
/****************************************************************************************/
LVM_ReturnStatus_en LVM_ClearAudioBuffers(LVM_Handle_t hInstance);
-
/****************************************************************************************/
/* */
/* FUNCTION: LVM_GetControlParameters */
@@ -460,7 +446,6 @@
LVM_ReturnStatus_en LVM_GetControlParameters(LVM_Handle_t hInstance,
LVM_ControlParams_t *pParams);
-
/****************************************************************************************/
/* */
/* FUNCTION: LVM_SetControlParameters */
@@ -484,7 +469,6 @@
LVM_ReturnStatus_en LVM_SetControlParameters(LVM_Handle_t hInstance,
LVM_ControlParams_t *pParams);
-
/****************************************************************************************/
/* */
/* FUNCTION: LVM_Process */
@@ -515,20 +499,11 @@
/* STEREO the number of sample pairs in the block */
/* */
/****************************************************************************************/
-#ifdef BUILD_FLOAT
LVM_ReturnStatus_en LVM_Process(LVM_Handle_t hInstance,
const LVM_FLOAT *pInData,
LVM_FLOAT *pOutData,
LVM_UINT16 NumSamples,
LVM_UINT32 AudioTime);
-#else
-LVM_ReturnStatus_en LVM_Process(LVM_Handle_t hInstance,
- const LVM_INT16 *pInData,
- LVM_INT16 *pOutData,
- LVM_UINT16 NumSamples,
- LVM_UINT32 AudioTime);
-#endif
-
/****************************************************************************************/
/* */
@@ -552,7 +527,6 @@
LVM_ReturnStatus_en LVM_SetHeadroomParams( LVM_Handle_t hInstance,
LVM_HeadroomParams_t *pHeadroomParams);
-
/****************************************************************************************/
/* */
/* FUNCTION: LVM_GetHeadroomParams */
@@ -575,7 +549,6 @@
LVM_ReturnStatus_en LVM_GetHeadroomParams( LVM_Handle_t hInstance,
LVM_HeadroomParams_t *pHeadroomParams);
-
/****************************************************************************************/
/* */
/* FUNCTION: LVM_GetSpectrum */
@@ -629,7 +602,5 @@
LVM_ReturnStatus_en LVM_SetVolumeNoSmoothing( LVM_Handle_t hInstance,
LVM_ControlParams_t *pParams);
-
-
#endif /* __LVM_H__ */
diff --git a/media/libeffects/lvm/lib/Bundle/src/LVM_API_Specials.cpp b/media/libeffects/lvm/lib/Bundle/src/LVM_API_Specials.cpp
index 62d9ee3..e241cdd 100644
--- a/media/libeffects/lvm/lib/Bundle/src/LVM_API_Specials.cpp
+++ b/media/libeffects/lvm/lib/Bundle/src/LVM_API_Specials.cpp
@@ -15,7 +15,6 @@
* limitations under the License.
*/
-
/****************************************************************************************/
/* */
/* Includes */
@@ -60,7 +59,6 @@
pLVPSA_Handle_t *hPSAInstance;
LVPSA_RETURN LVPSA_Status;
-
if(pInstance == LVM_NULL)
{
return LVM_NULLADDRESS;
@@ -80,7 +78,6 @@
return LVM_NULLADDRESS;
}
-
/*
* Update new parameters if necessary
*/
@@ -115,7 +112,6 @@
return(LVM_SUCCESS);
}
-
/****************************************************************************************/
/* */
/* FUNCTION: LVM_SetVolumeNoSmoothing */
diff --git a/media/libeffects/lvm/lib/Bundle/src/LVM_Buffers.cpp b/media/libeffects/lvm/lib/Bundle/src/LVM_Buffers.cpp
index bdca5e3..3aeddbb 100644
--- a/media/libeffects/lvm/lib/Bundle/src/LVM_Buffers.cpp
+++ b/media/libeffects/lvm/lib/Bundle/src/LVM_Buffers.cpp
@@ -15,7 +15,6 @@
* limitations under the License.
*/
-
/****************************************************************************************/
/* */
/* Includes */
@@ -50,7 +49,6 @@
/* NOTES: */
/* */
/****************************************************************************************/
-#ifdef BUILD_FLOAT
void LVM_BufferManagedIn(LVM_Handle_t hInstance,
const LVM_FLOAT *pInData,
LVM_FLOAT **pToProcess,
@@ -94,7 +92,6 @@
pBuffer->SamplesToOutput = 0; /* Samples to output is same as
number read for inplace processing */
-
/*
* Calculate the number of samples to process this call and update the buffer state
*/
@@ -131,7 +128,6 @@
}
*pNumSamples = (LVM_UINT16)SampleCount; /* Set the number of samples to process this call */
-
/*
* Copy samples from the delay buffer as required
*/
@@ -147,7 +143,6 @@
pDest += NumChannels * pBuffer->InDelaySamples; /* Update the destination pointer */
}
-
/*
* Copy the rest of the samples for this call from the input buffer
*/
@@ -165,7 +160,6 @@
pBuffer->SamplesToOutput = (LVM_INT16)(pBuffer->SamplesToOutput + NumSamples);
}
-
/*
* Update the sample count and input pointer
*/
@@ -173,7 +167,6 @@
pInstance->SamplesToProcess = (LVM_INT16)(pInstance->SamplesToProcess - SampleCount);
pInstance->pInputSamples = pStart; /* Update input sample pointer */
-
/*
* Save samples to the delay buffer if any left unprocessed
*/
@@ -190,7 +183,6 @@
(LVM_INT16)(NumChannels * NumSamples)); /* Number of input samples */
}
-
/*
* Update the delay sample count
*/
@@ -198,147 +190,6 @@
pInstance->SamplesToProcess = 0; /* All Samples used */
}
}
-#else
-void LVM_BufferManagedIn(LVM_Handle_t hInstance,
- const LVM_INT16 *pInData,
- LVM_INT16 **pToProcess,
- LVM_INT16 **pProcessed,
- LVM_UINT16 *pNumSamples)
-{
-
- LVM_INT16 SampleCount; /* Number of samples to be processed this call */
- LVM_INT16 NumSamples; /* Number of samples in scratch buffer */
- LVM_INT16 *pStart;
- LVM_Instance_t *pInstance = (LVM_Instance_t *)hInstance;
- LVM_Buffer_t *pBuffer;
- LVM_INT16 *pDest;
- LVM_INT16 NumChannels = 2;
-
- /*
- * Set the processing address pointers
- */
- pBuffer = pInstance->pBufferManagement;
- pDest = pBuffer->pScratch;
- *pToProcess = pBuffer->pScratch;
- *pProcessed = pBuffer->pScratch;
-
- /*
- * Check if it is the first call of a block
- */
- if (pInstance->SamplesToProcess == 0)
- {
- /*
- * First call for a new block of samples
- */
- pInstance->SamplesToProcess = (LVM_INT16)(*pNumSamples + pBuffer->InDelaySamples);
- pInstance->pInputSamples = (LVM_INT16 *)pInData;
- pBuffer->BufferState = LVM_FIRSTCALL;
- }
- pStart = pInstance->pInputSamples; /* Pointer to the input samples */
- pBuffer->SamplesToOutput = 0; /* Samples to output is same as number read for inplace processing */
-
-
- /*
- * Calculate the number of samples to process this call and update the buffer state
- */
- if (pInstance->SamplesToProcess > pInstance->InternalBlockSize)
- {
- /*
- * Process the maximum bock size of samples.
- */
- SampleCount = pInstance->InternalBlockSize;
- NumSamples = pInstance->InternalBlockSize;
- }
- else
- {
- /*
- * Last call for the block, so calculate how many frames and samples to process
- */
- LVM_INT16 NumFrames;
-
- NumSamples = pInstance->SamplesToProcess;
- NumFrames = (LVM_INT16)(NumSamples >> MIN_INTERNAL_BLOCKSHIFT);
- SampleCount = (LVM_INT16)(NumFrames << MIN_INTERNAL_BLOCKSHIFT);
-
- /*
- * Update the buffer state
- */
- if (pBuffer->BufferState == LVM_FIRSTCALL)
- {
- pBuffer->BufferState = LVM_FIRSTLASTCALL;
- }
- else
- {
- pBuffer->BufferState = LVM_LASTCALL;
- }
- }
- *pNumSamples = (LVM_UINT16)SampleCount; /* Set the number of samples to process this call */
-
-
- /*
- * Copy samples from the delay buffer as required
- */
- if (((pBuffer->BufferState == LVM_FIRSTCALL) ||
- (pBuffer->BufferState == LVM_FIRSTLASTCALL)) &&
- (pBuffer->InDelaySamples != 0))
- {
- Copy_16(&pBuffer->InDelayBuffer[0], /* Source */
- pDest, /* Destination */
- (LVM_INT16)(NumChannels*pBuffer->InDelaySamples)); /* Number of delay samples, left and right */
- NumSamples = (LVM_INT16)(NumSamples - pBuffer->InDelaySamples); /* Update sample count */
- pDest += NumChannels * pBuffer->InDelaySamples; /* Update the destination pointer */
- }
-
-
- /*
- * Copy the rest of the samples for this call from the input buffer
- */
- if (NumSamples > 0)
- {
- Copy_16(pStart, /* Source */
- pDest, /* Destination */
- (LVM_INT16)(NumChannels*NumSamples)); /* Number of input samples */
- pStart += NumChannels * NumSamples; /* Update the input pointer */
-
- /*
- * Update the input data pointer and samples to output
- */
- pBuffer->SamplesToOutput = (LVM_INT16)(pBuffer->SamplesToOutput + NumSamples); /* Update samples to output */
- }
-
-
- /*
- * Update the sample count and input pointer
- */
- pInstance->SamplesToProcess = (LVM_INT16)(pInstance->SamplesToProcess - SampleCount); /* Update the count of samples */
- pInstance->pInputSamples = pStart; /* Update input sample pointer */
-
-
- /*
- * Save samples to the delay buffer if any left unprocessed
- */
- if ((pBuffer->BufferState == LVM_FIRSTLASTCALL) ||
- (pBuffer->BufferState == LVM_LASTCALL))
- {
- NumSamples = pInstance->SamplesToProcess;
- pStart = pBuffer->pScratch; /* Start of the buffer */
- pStart += NumChannels*SampleCount; /* Offset by the number of processed samples */
- if (NumSamples != 0)
- {
- Copy_16(pStart, /* Source */
- &pBuffer->InDelayBuffer[0], /* Destination */
- (LVM_INT16)(NumChannels*NumSamples)); /* Number of input samples */
- }
-
-
- /*
- * Update the delay sample count
- */
- pBuffer->InDelaySamples = NumSamples; /* Number of delay sample pairs */
- pInstance->SamplesToProcess = 0; /* All Samples used */
- }
-}
-#endif
/****************************************************************************************/
/* */
@@ -362,7 +213,6 @@
/* NOTES: */
/* */
/****************************************************************************************/
-#ifdef BUILD_FLOAT
void LVM_BufferUnmanagedIn(LVM_Handle_t hInstance,
LVM_FLOAT **pToProcess,
LVM_FLOAT **pProcessed,
@@ -371,7 +221,6 @@
LVM_Instance_t *pInstance = (LVM_Instance_t *)hInstance;
-
/*
* Check if this is the first call of a block
*/
@@ -382,7 +231,6 @@
pInstance->pInputSamples = *pToProcess; /* Get the I/O pointers */
pInstance->pOutputSamples = *pProcessed;
-
/*
* Set te block size to process
*/
@@ -402,46 +250,6 @@
*pToProcess = pInstance->pInputSamples;
*pProcessed = pInstance->pOutputSamples;
}
-#else
-void LVM_BufferUnmanagedIn(LVM_Handle_t hInstance,
- LVM_INT16 **pToProcess,
- LVM_INT16 **pProcessed,
- LVM_UINT16 *pNumSamples)
-{
-
- LVM_Instance_t *pInstance = (LVM_Instance_t *)hInstance;
-
-
- /*
- * Check if this is the first call of a block
- */
- if (pInstance->SamplesToProcess == 0)
- {
- pInstance->SamplesToProcess = (LVM_INT16)*pNumSamples; /* Get the number of samples on first call */
- pInstance->pInputSamples = *pToProcess; /* Get the I/O pointers */
- pInstance->pOutputSamples = *pProcessed;
-
-
- /*
- * Set te block size to process
- */
- if (pInstance->SamplesToProcess > pInstance->InternalBlockSize)
- {
- *pNumSamples = (LVM_UINT16)pInstance->InternalBlockSize;
- }
- else
- {
- *pNumSamples = (LVM_UINT16)pInstance->SamplesToProcess;
- }
- }
-
- /*
- * Set the process pointers
- */
- *pToProcess = pInstance->pInputSamples;
- *pProcessed = pInstance->pOutputSamples;
-}
-#endif
/****************************************************************************************/
/* */
@@ -467,146 +275,6 @@
/* */
/****************************************************************************************/
-#ifndef BUILD_FLOAT
-void LVM_BufferOptimisedIn(LVM_Handle_t hInstance,
- const LVM_INT16 *pInData,
- LVM_INT16 **pToProcess,
- LVM_INT16 **pProcessed,
- LVM_UINT16 *pNumSamples)
-{
-
- LVM_Instance_t *pInstance = (LVM_Instance_t *)hInstance;
- LVM_Buffer_t *pBuffer = pInstance->pBufferManagement;
- LVM_INT16 *pDest;
- LVM_INT16 SampleCount;
- LVM_INT16 NumSamples;
- LVM_INT16 NumFrames;
-
- /*
- * Check if it is the first call for this block
- */
- if (pInstance->SamplesToProcess == 0)
- {
- /*
- * First call for a new block of samples
- */
- pBuffer->BufferState = LVM_FIRSTCALL;
- pInstance->pInputSamples = (LVM_INT16 *)pInData;
- pInstance->SamplesToProcess = (LVM_INT16)*pNumSamples;
- pBuffer->SamplesToOutput = (LVM_INT16)*pNumSamples;
- pDest = *pProcessed; /* The start of the output buffer */
-
-
- /*
- * Copy the already processed samples to the output buffer
- */
- if (pBuffer->OutDelaySamples != 0)
- {
- Copy_16(&pBuffer->OutDelayBuffer[0], /* Source */
- pDest, /* Destination */
- (LVM_INT16)(2*pBuffer->OutDelaySamples)); /* Number of delay samples */
- pDest += 2 * pBuffer->OutDelaySamples; /* Update the output pointer */
- pBuffer->SamplesToOutput = (LVM_INT16)(pBuffer->SamplesToOutput - pBuffer->OutDelaySamples); /* Update the numbr of samples to output */
- }
- *pToProcess = pDest; /* Set the address to start processing */
- *pProcessed = pDest; /* Process in the output buffer, now inplace */
-
- /*
- * Copy the input delay buffer (unprocessed) samples to the output buffer
- */
- if (pBuffer->InDelaySamples != 0)
- {
- Copy_16(&pBuffer->InDelayBuffer[0], /* Source */
- pDest, /* Destination */
- (LVM_INT16)(2*pBuffer->InDelaySamples)); /* Number of delay samples */
- pDest += 2 * pBuffer->InDelaySamples; /* Update the output pointer */
- }
-
-
- /*
- * Calculate how many input samples to process and copy
- */
- NumSamples = (LVM_INT16)(*pNumSamples - pBuffer->OutDelaySamples); /* Number that will fit in the output buffer */
- if (NumSamples >= pInstance->InternalBlockSize)
- {
- NumSamples = pInstance->InternalBlockSize;
- }
- NumFrames = (LVM_INT16)(NumSamples >> MIN_INTERNAL_BLOCKSHIFT);
- SampleCount = (LVM_INT16)(NumFrames << MIN_INTERNAL_BLOCKSHIFT);
- *pNumSamples = (LVM_UINT16)SampleCount; /* The number of samples to process */
- pBuffer->SamplesToOutput = (LVM_INT16)(pBuffer->SamplesToOutput - SampleCount); /* Update the number of samples to output */
- SampleCount = (LVM_INT16)(SampleCount - pBuffer->InDelaySamples); /* The number of samples to copy from the input */
-
-
- /*
- * Copy samples from the input buffer and update counts and pointers
- */
- Copy_16(pInstance->pInputSamples, /* Source */
- pDest, /* Destination */
- (LVM_INT16)(2*SampleCount)); /* Number of input samples */
- pInstance->pInputSamples += 2 * SampleCount; /* Update the input pointer */
- pInstance->pOutputSamples = pDest + (2 * SampleCount); /* Update the output pointer */
- pInstance->SamplesToProcess = (LVM_INT16)(pInstance->SamplesToProcess - SampleCount); /* Samples left in the input buffer */
- }
- else
- {
- /*
- * Second or subsequent call in optimised mode
- */
- if (pBuffer->SamplesToOutput >= MIN_INTERNAL_BLOCKSIZE)
- {
- /*
- * More samples can be processed directly in the output buffer
- */
- *pToProcess = pInstance->pOutputSamples; /* Set the address to start processing */
- *pProcessed = pInstance->pOutputSamples; /* Process in the output buffer, now inplace */
- NumSamples = pBuffer->SamplesToOutput; /* Number that will fit in the output buffer */
- if (NumSamples >= pInstance->InternalBlockSize)
- {
- NumSamples = pInstance->InternalBlockSize;
- }
- NumFrames = (LVM_INT16)(NumSamples >> MIN_INTERNAL_BLOCKSHIFT);
- SampleCount = (LVM_INT16)(NumFrames << MIN_INTERNAL_BLOCKSHIFT);
- *pNumSamples = (LVM_UINT16)SampleCount; /* The number of samples to process */
-
-
- /*
- * Copy samples from the input buffer and update counts and pointers
- */
- Copy_16(pInstance->pInputSamples, /* Source */
- pInstance->pOutputSamples, /* Destination */
- (LVM_INT16)(2*SampleCount)); /* Number of input samples */
- pInstance->pInputSamples += 2 * SampleCount; /* Update the input pointer */
- pInstance->pOutputSamples += 2 * SampleCount; /* Update the output pointer */
- pInstance->SamplesToProcess = (LVM_INT16)(pInstance->SamplesToProcess - SampleCount); /* Samples left in the input buffer */
- pBuffer->SamplesToOutput = (LVM_INT16)(pBuffer->SamplesToOutput - SampleCount); /* Number that will fit in the output buffer */
- }
- else
- {
- /*
- * The remaining samples can not be processed in the output buffer
- */
- pBuffer->BufferState = LVM_LASTCALL; /* Indicate this is the last bock to process */
- *pToProcess = pBuffer->pScratch; /* Set the address to start processing */
- *pProcessed = pBuffer->pScratch; /* Process in the output buffer, now inplace */
- NumSamples = pInstance->SamplesToProcess; /* Number left to be processed */
- NumFrames = (LVM_INT16)(NumSamples >> MIN_INTERNAL_BLOCKSHIFT);
- SampleCount = (LVM_INT16)(NumFrames << MIN_INTERNAL_BLOCKSHIFT);
- *pNumSamples = (LVM_UINT16)SampleCount; /* The number of samples to process */
-
-
- /*
- * Copy samples from the input buffer and update counts and pointers
- */
- Copy_16(pInstance->pInputSamples, /* Source */
- pBuffer->pScratch, /* Destination */
- (LVM_INT16)(2*SampleCount)); /* Number of input samples */
- pInstance->pInputSamples += 2 * SampleCount; /* Update the input pointer */
- pInstance->SamplesToProcess = (LVM_INT16)(pInstance->SamplesToProcess - SampleCount); /* Samples left in the input buffer */
- }
- }
-}
-#endif
/****************************************************************************************/
/* */
/* FUNCTION: LVM_BufferIn */
@@ -661,7 +329,6 @@
/* NOTES: */
/* */
/****************************************************************************************/
-#ifdef BUILD_FLOAT
void LVM_BufferIn(LVM_Handle_t hInstance,
const LVM_FLOAT *pInData,
LVM_FLOAT **pToProcess,
@@ -671,7 +338,6 @@
LVM_Instance_t *pInstance = (LVM_Instance_t *)hInstance;
-
/*
* Check which mode, managed or unmanaged
*/
@@ -691,37 +357,6 @@
pNumSamples);
}
}
-#else
-void LVM_BufferIn(LVM_Handle_t hInstance,
- const LVM_INT16 *pInData,
- LVM_INT16 **pToProcess,
- LVM_INT16 **pProcessed,
- LVM_UINT16 *pNumSamples)
-{
-
- LVM_Instance_t *pInstance = (LVM_Instance_t *)hInstance;
-
-
- /*
- * Check which mode, managed or unmanaged
- */
- if (pInstance->InstParams.BufferMode == LVM_MANAGED_BUFFERS)
- {
- LVM_BufferManagedIn(hInstance,
- pInData,
- pToProcess,
- pProcessed,
- pNumSamples);
- }
- else
- {
- LVM_BufferUnmanagedIn(hInstance,
- pToProcess,
- pProcessed,
- pNumSamples);
- }
-}
-#endif
/****************************************************************************************/
/* */
/* FUNCTION: LVM_BufferManagedOut */
@@ -742,7 +377,6 @@
/* NOTES: */
/* */
/****************************************************************************************/
-#ifdef BUILD_FLOAT
void LVM_BufferManagedOut(LVM_Handle_t hInstance,
LVM_FLOAT *pOutData,
LVM_UINT16 *pNumSamples)
@@ -777,7 +411,6 @@
}
pDest = pInstance->pOutputSamples; /* Set the output address */
-
/*
* If the number of samples is non-zero then there are still samples to send to
* the output buffer
@@ -859,7 +492,6 @@
}
}
-
/*
* Copy the processed results to the output
*/
@@ -920,7 +552,6 @@
}
}
-
/*
* Copy the remaining processed data to the output delay buffer
*/
@@ -950,157 +581,6 @@
/* This will terminate the loop when all samples processed */
*pNumSamples = (LVM_UINT16)pInstance->SamplesToProcess;
}
-#else
-void LVM_BufferManagedOut(LVM_Handle_t hInstance,
- LVM_INT16 *pOutData,
- LVM_UINT16 *pNumSamples)
-{
-
- LVM_Instance_t *pInstance = (LVM_Instance_t *)hInstance;
- LVM_Buffer_t *pBuffer = pInstance->pBufferManagement;
- LVM_INT16 SampleCount = (LVM_INT16)*pNumSamples;
- LVM_INT16 NumSamples;
- LVM_INT16 *pStart;
- LVM_INT16 *pDest;
-
-
- /*
- * Set the pointers
- */
- NumSamples = pBuffer->SamplesToOutput;
- pStart = pBuffer->pScratch;
-
-
- /*
- * check if it is the first call of a block
- */
- if ((pBuffer->BufferState == LVM_FIRSTCALL) ||
- (pBuffer->BufferState == LVM_FIRSTLASTCALL))
- {
- /* First call for a new block */
- pInstance->pOutputSamples = pOutData; /* Initialise the destination */
- }
- pDest = pInstance->pOutputSamples; /* Set the output address */
-
-
- /*
- * If the number of samples is non-zero then there are still samples to send to
- * the output buffer
- */
- if ((NumSamples != 0) &&
- (pBuffer->OutDelaySamples != 0))
- {
- /*
- * Copy the delayed output buffer samples to the output
- */
- if (pBuffer->OutDelaySamples <= NumSamples)
- {
- /*
- * Copy all output delay samples to the output
- */
- Copy_16(&pBuffer->OutDelayBuffer[0], /* Source */
- pDest, /* Detsination */
- (LVM_INT16)(2*pBuffer->OutDelaySamples)); /* Number of delay samples */
-
- /*
- * Update the pointer and sample counts
- */
- pDest += 2*pBuffer->OutDelaySamples; /* Output sample pointer */
- NumSamples = (LVM_INT16)(NumSamples - pBuffer->OutDelaySamples); /* Samples left to send */
- pBuffer->OutDelaySamples = 0; /* No samples left in the buffer */
-
- }
- else
- {
- /*
- * Copy only some of the ouput delay samples to the output
- */
- Copy_16(&pBuffer->OutDelayBuffer[0], /* Source */
- pDest, /* Detsination */
- (LVM_INT16)(2*NumSamples)); /* Number of delay samples */
-
- /*
- * Update the pointer and sample counts
- */
- pDest += 2*NumSamples; /* Output sample pointer */
- pBuffer->OutDelaySamples = (LVM_INT16)(pBuffer->OutDelaySamples - NumSamples); /* No samples left in the buffer */
-
-
- /*
- * Realign the delay buffer data to avoid using circular buffer management
- */
- Copy_16(&pBuffer->OutDelayBuffer[2*NumSamples], /* Source */
- &pBuffer->OutDelayBuffer[0], /* Destination */
- (LVM_INT16)(2*pBuffer->OutDelaySamples)); /* Number of samples to move */
- NumSamples = 0; /* Samples left to send */
- }
- }
-
-
- /*
- * Copy the processed results to the output
- */
- if ((NumSamples != 0) &&
- (SampleCount != 0))
- {
- if (SampleCount <= NumSamples)
- {
- /*
- * Copy all processed samples to the output
- */
- Copy_16(pStart, /* Source */
- pDest, /* Detsination */
- (LVM_INT16)(2*SampleCount)); /* Number of processed samples */
-
- /*
- * Update the pointer and sample counts
- */
- pDest += 2 * SampleCount; /* Output sample pointer */
- NumSamples = (LVM_INT16)(NumSamples - SampleCount); /* Samples left to send */
- SampleCount = 0; /* No samples left in the buffer */
- }
- else
- {
- /*
- * Copy only some processed samples to the output
- */
- Copy_16(pStart, /* Source */
- pDest, /* Destination */
- (LVM_INT16)(2*NumSamples)); /* Number of processed samples */
-
-
- /*
- * Update the pointers and sample counts
- */
- pStart += 2 * NumSamples; /* Processed sample pointer */
- pDest += 2 * NumSamples; /* Output sample pointer */
- SampleCount = (LVM_INT16)(SampleCount - NumSamples); /* Processed samples left */
- NumSamples = 0; /* Clear the sample count */
- }
- }
-
-
- /*
- * Copy the remaining processed data to the output delay buffer
- */
- if (SampleCount != 0)
- {
- Copy_16(pStart, /* Source */
- &pBuffer->OutDelayBuffer[2*pBuffer->OutDelaySamples], /* Destination */
- (LVM_INT16)(2*SampleCount)); /* Number of processed samples */
- pBuffer->OutDelaySamples = (LVM_INT16)(pBuffer->OutDelaySamples + SampleCount); /* Update the buffer count */
- }
-
-
- /*
- * pointers, counts and set default buffer processing
- */
- pBuffer->SamplesToOutput = NumSamples; /* Samples left to send */
- pInstance->pOutputSamples = pDest; /* Output sample pointer */
- pBuffer->BufferState = LVM_MAXBLOCKCALL; /* Set for the default call block size */
- *pNumSamples = (LVM_UINT16)pInstance->SamplesToProcess; /* This will terminate the loop when all samples processed */
-}
-#endif
/****************************************************************************************/
/* */
@@ -1139,7 +619,6 @@
LVM_INT16 NumChannels = 2;
#endif
-
/*
* Update sample counts
*/
@@ -1164,7 +643,6 @@
}
}
-
/****************************************************************************************/
/* */
/* FUNCTION: LVM_BufferOptimisedOut */
@@ -1184,73 +662,6 @@
/* */
/****************************************************************************************/
-#ifndef BUILD_FLOAT
-void LVM_BufferOptimisedOut(LVM_Handle_t hInstance,
- LVM_UINT16 *pNumSamples)
-{
-
- LVM_Instance_t *pInstance = (LVM_Instance_t *)hInstance;
- LVM_Buffer_t *pBuffer = pInstance->pBufferManagement;
-
- /*
- * Check if it is the last block to process
- */
- if (pBuffer->BufferState == LVM_LASTCALL)
- {
- LVM_INT16 *pSrc = pBuffer->pScratch;
-
- /*
- * Copy the unprocessed samples to the input delay buffer
- */
- if (pInstance->SamplesToProcess != 0)
- {
- Copy_16(pInstance->pInputSamples, /* Source */
- &pBuffer->InDelayBuffer[0], /* Destination */
- (LVM_INT16)(2*pInstance->SamplesToProcess)); /* Number of input samples */
- pBuffer->InDelaySamples = pInstance->SamplesToProcess;
- pInstance->SamplesToProcess = 0;
- }
- else
- {
- pBuffer->InDelaySamples = 0;
- }
-
-
- /*
- * Fill the last empty spaces in the output buffer
- */
- if (pBuffer->SamplesToOutput != 0)
- {
- Copy_16(pSrc, /* Source */
- pInstance->pOutputSamples, /* Destination */
- (LVM_INT16)(2*pBuffer->SamplesToOutput)); /* Number of input samples */
- *pNumSamples = (LVM_UINT16)(*pNumSamples - pBuffer->SamplesToOutput);
- pSrc += 2 * pBuffer->SamplesToOutput; /* Update scratch pointer */
- pBuffer->SamplesToOutput = 0; /* No more samples in this block */
- }
-
-
- /*
- * Save any remaining processed samples in the output delay buffer
- */
- if (*pNumSamples != 0)
- {
- Copy_16(pSrc, /* Source */
- &pBuffer->OutDelayBuffer[0], /* Destination */
- (LVM_INT16)(2**pNumSamples)); /* Number of input samples */
-
- pBuffer->OutDelaySamples = (LVM_INT16)*pNumSamples;
-
- *pNumSamples = 0; /* No more samples in this block */
- }
- else
- {
- pBuffer->OutDelaySamples = 0;
- }
- }
-}
-#endif
-
/****************************************************************************************/
/* */
/* FUNCTION: LVM_BufferOut */
@@ -1287,7 +698,6 @@
/* NOTES: */
/* */
/****************************************************************************************/
-#ifdef BUILD_FLOAT
void LVM_BufferOut(LVM_Handle_t hInstance,
LVM_FLOAT *pOutData,
LVM_UINT16 *pNumSamples)
@@ -1295,7 +705,6 @@
LVM_Instance_t *pInstance = (LVM_Instance_t *)hInstance;
-
/*
* Check which mode, managed or unmanaged
*/
@@ -1311,28 +720,3 @@
pNumSamples);
}
}
-#else
-void LVM_BufferOut(LVM_Handle_t hInstance,
- LVM_INT16 *pOutData,
- LVM_UINT16 *pNumSamples)
-{
-
- LVM_Instance_t *pInstance = (LVM_Instance_t *)hInstance;
-
-
- /*
- * Check which mode, managed or unmanaged
- */
- if (pInstance->InstParams.BufferMode == LVM_MANAGED_BUFFERS)
- {
- LVM_BufferManagedOut(hInstance,
- pOutData,
- pNumSamples);
- }
- else
- {
- LVM_BufferUnmanagedOut(hInstance,
- pNumSamples);
- }
-}
-#endif
diff --git a/media/libeffects/lvm/lib/Bundle/src/LVM_Coeffs.h b/media/libeffects/lvm/lib/Bundle/src/LVM_Coeffs.h
index bab4049..812f8e5 100644
--- a/media/libeffects/lvm/lib/Bundle/src/LVM_Coeffs.h
+++ b/media/libeffects/lvm/lib/Bundle/src/LVM_Coeffs.h
@@ -18,7 +18,6 @@
#ifndef __LVM_COEFFS_H__
#define __LVM_COEFFS_H__
-
/************************************************************************************/
/* */
/* High Pass Shelving Filter coefficients */
@@ -29,7 +28,6 @@
#define TrebleBoostMinRate 4
#define TrebleBoostSteps 15
-#ifdef BUILD_FLOAT
/* Coefficients for sample rate 22050Hz */
/* Gain = 1.000000 dB */
#define HPF_Fs22050_Gain1_A0 1.038434
@@ -486,7 +484,6 @@
#define HPF_Fs48000_Gain15_B1 (-0.267949)
#define HPF_Fs48000_Gain15_B2 0.000000
-#ifdef HIGHER_FS
/* Coefficients for sample rate 88200 */
/* Gain = 1.000000 dB */
#define HPF_Fs88200_Gain1_A0 1.094374f
@@ -856,547 +853,3 @@
#define HPF_Fs192000_Gain15_B2 0.000000
#endif
-
-#else
-/* Coefficients for sample rate 22050Hz */
- /* Gain = 1.000000 dB */
-#define HPF_Fs22050_Gain1_A0 5383 /* Floating point value 0.164291 */
-#define HPF_Fs22050_Gain1_A1 16859 /* Floating point value 0.514492 */
-#define HPF_Fs22050_Gain1_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs22050_Gain1_B1 12125 /* Floating point value 0.370033 */
-#define HPF_Fs22050_Gain1_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs22050_Gain1_Shift 1 /* Shift value */
- /* Gain = 2.000000 dB */
-#define HPF_Fs22050_Gain2_A0 4683 /* Floating point value 0.142925 */
-#define HPF_Fs22050_Gain2_A1 17559 /* Floating point value 0.535858 */
-#define HPF_Fs22050_Gain2_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs22050_Gain2_B1 12125 /* Floating point value 0.370033 */
-#define HPF_Fs22050_Gain2_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs22050_Gain2_Shift 1 /* Shift value */
- /* Gain = 3.000000 dB */
-#define HPF_Fs22050_Gain3_A0 3898 /* Floating point value 0.118953 */
-#define HPF_Fs22050_Gain3_A1 18345 /* Floating point value 0.559830 */
-#define HPF_Fs22050_Gain3_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs22050_Gain3_B1 12125 /* Floating point value 0.370033 */
-#define HPF_Fs22050_Gain3_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs22050_Gain3_Shift 1 /* Shift value */
- /* Gain = 4.000000 dB */
-#define HPF_Fs22050_Gain4_A0 3016 /* Floating point value 0.092055 */
-#define HPF_Fs22050_Gain4_A1 19226 /* Floating point value 0.586728 */
-#define HPF_Fs22050_Gain4_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs22050_Gain4_B1 12125 /* Floating point value 0.370033 */
-#define HPF_Fs22050_Gain4_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs22050_Gain4_Shift 1 /* Shift value */
- /* Gain = 5.000000 dB */
-#define HPF_Fs22050_Gain5_A0 2028 /* Floating point value 0.061876 */
-#define HPF_Fs22050_Gain5_A1 20215 /* Floating point value 0.616907 */
-#define HPF_Fs22050_Gain5_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs22050_Gain5_B1 12125 /* Floating point value 0.370033 */
-#define HPF_Fs22050_Gain5_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs22050_Gain5_Shift 1 /* Shift value */
- /* Gain = 6.000000 dB */
-#define HPF_Fs22050_Gain6_A0 918 /* Floating point value 0.028013 */
-#define HPF_Fs22050_Gain6_A1 21324 /* Floating point value 0.650770 */
-#define HPF_Fs22050_Gain6_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs22050_Gain6_B1 12125 /* Floating point value 0.370033 */
-#define HPF_Fs22050_Gain6_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs22050_Gain6_Shift 1 /* Shift value */
- /* Gain = 7.000000 dB */
-#define HPF_Fs22050_Gain7_A0 (-164) /* Floating point value -0.005002 */
-#define HPF_Fs22050_Gain7_A1 11311 /* Floating point value 0.345199 */
-#define HPF_Fs22050_Gain7_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs22050_Gain7_B1 12125 /* Floating point value 0.370033 */
-#define HPF_Fs22050_Gain7_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs22050_Gain7_Shift 2 /* Shift value */
- /* Gain = 8.000000 dB */
-#define HPF_Fs22050_Gain8_A0 (-864) /* Floating point value -0.026368 */
-#define HPF_Fs22050_Gain8_A1 12012 /* Floating point value 0.366565 */
-#define HPF_Fs22050_Gain8_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs22050_Gain8_B1 12125 /* Floating point value 0.370033 */
-#define HPF_Fs22050_Gain8_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs22050_Gain8_Shift 2 /* Shift value */
- /* Gain = 9.000000 dB */
-#define HPF_Fs22050_Gain9_A0 (-1650) /* Floating point value -0.050340 */
-#define HPF_Fs22050_Gain9_A1 12797 /* Floating point value 0.390537 */
-#define HPF_Fs22050_Gain9_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs22050_Gain9_B1 12125 /* Floating point value 0.370033 */
-#define HPF_Fs22050_Gain9_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs22050_Gain9_Shift 2 /* Shift value */
- /* Gain = 10.000000 dB */
-#define HPF_Fs22050_Gain10_A0 (-2531) /* Floating point value -0.077238 */
-#define HPF_Fs22050_Gain10_A1 13679 /* Floating point value 0.417435 */
-#define HPF_Fs22050_Gain10_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs22050_Gain10_B1 12125 /* Floating point value 0.370033 */
-#define HPF_Fs22050_Gain10_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs22050_Gain10_Shift 2 /* Shift value */
- /* Gain = 11.000000 dB */
-#define HPF_Fs22050_Gain11_A0 (-3520) /* Floating point value -0.107417 */
-#define HPF_Fs22050_Gain11_A1 14667 /* Floating point value 0.447615 */
-#define HPF_Fs22050_Gain11_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs22050_Gain11_B1 12125 /* Floating point value 0.370033 */
-#define HPF_Fs22050_Gain11_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs22050_Gain11_Shift 2 /* Shift value */
- /* Gain = 12.000000 dB */
-#define HPF_Fs22050_Gain12_A0 (-4629) /* Floating point value -0.141279 */
-#define HPF_Fs22050_Gain12_A1 15777 /* Floating point value 0.481477 */
-#define HPF_Fs22050_Gain12_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs22050_Gain12_B1 12125 /* Floating point value 0.370033 */
-#define HPF_Fs22050_Gain12_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs22050_Gain12_Shift 2 /* Shift value */
- /* Gain = 13.000000 dB */
-#define HPF_Fs22050_Gain13_A0 (-2944) /* Floating point value -0.089849 */
-#define HPF_Fs22050_Gain13_A1 8531 /* Floating point value 0.260352 */
-#define HPF_Fs22050_Gain13_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs22050_Gain13_B1 12125 /* Floating point value 0.370033 */
-#define HPF_Fs22050_Gain13_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs22050_Gain13_Shift 3 /* Shift value */
- /* Gain = 14.000000 dB */
-#define HPF_Fs22050_Gain14_A0 (-3644) /* Floating point value -0.111215 */
-#define HPF_Fs22050_Gain14_A1 9231 /* Floating point value 0.281718 */
-#define HPF_Fs22050_Gain14_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs22050_Gain14_B1 12125 /* Floating point value 0.370033 */
-#define HPF_Fs22050_Gain14_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs22050_Gain14_Shift 3 /* Shift value */
- /* Gain = 15.000000 dB */
-#define HPF_Fs22050_Gain15_A0 (-4430) /* Floating point value -0.135187 */
-#define HPF_Fs22050_Gain15_A1 10017 /* Floating point value 0.305690 */
-#define HPF_Fs22050_Gain15_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs22050_Gain15_B1 12125 /* Floating point value 0.370033 */
-#define HPF_Fs22050_Gain15_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs22050_Gain15_Shift 3 /* Shift value */
-
-
-/* Coefficients for sample rate 24000Hz */
- /* Gain = 1.000000 dB */
-#define HPF_Fs24000_Gain1_A0 3625 /* Floating point value 0.110628 */
-#define HPF_Fs24000_Gain1_A1 16960 /* Floating point value 0.517578 */
-#define HPF_Fs24000_Gain1_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs24000_Gain1_B1 8780 /* Floating point value 0.267949 */
-#define HPF_Fs24000_Gain1_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs24000_Gain1_Shift 1 /* Shift value */
- /* Gain = 2.000000 dB */
-#define HPF_Fs24000_Gain2_A0 2811 /* Floating point value 0.085800 */
-#define HPF_Fs24000_Gain2_A1 17774 /* Floating point value 0.542406 */
-#define HPF_Fs24000_Gain2_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs24000_Gain2_B1 8780 /* Floating point value 0.267949 */
-#define HPF_Fs24000_Gain2_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs24000_Gain2_Shift 1 /* Shift value */
- /* Gain = 3.000000 dB */
-#define HPF_Fs24000_Gain3_A0 1899 /* Floating point value 0.057943 */
-#define HPF_Fs24000_Gain3_A1 18686 /* Floating point value 0.570263 */
-#define HPF_Fs24000_Gain3_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs24000_Gain3_B1 8780 /* Floating point value 0.267949 */
-#define HPF_Fs24000_Gain3_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs24000_Gain3_Shift 1 /* Shift value */
- /* Gain = 4.000000 dB */
-#define HPF_Fs24000_Gain4_A0 874 /* Floating point value 0.026687 */
-#define HPF_Fs24000_Gain4_A1 19711 /* Floating point value 0.601519 */
-#define HPF_Fs24000_Gain4_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs24000_Gain4_B1 8780 /* Floating point value 0.267949 */
-#define HPF_Fs24000_Gain4_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs24000_Gain4_Shift 1 /* Shift value */
- /* Gain = 5.000000 dB */
-#define HPF_Fs24000_Gain5_A0 (-275) /* Floating point value -0.008383 */
-#define HPF_Fs24000_Gain5_A1 20860 /* Floating point value 0.636589 */
-#define HPF_Fs24000_Gain5_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs24000_Gain5_B1 8780 /* Floating point value 0.267949 */
-#define HPF_Fs24000_Gain5_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs24000_Gain5_Shift 1 /* Shift value */
- /* Gain = 6.000000 dB */
-#define HPF_Fs24000_Gain6_A0 (-1564) /* Floating point value -0.047733 */
-#define HPF_Fs24000_Gain6_A1 22149 /* Floating point value 0.675938 */
-#define HPF_Fs24000_Gain6_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs24000_Gain6_B1 8780 /* Floating point value 0.267949 */
-#define HPF_Fs24000_Gain6_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs24000_Gain6_Shift 1 /* Shift value */
- /* Gain = 7.000000 dB */
-#define HPF_Fs24000_Gain7_A0 (-1509) /* Floating point value -0.046051 */
-#define HPF_Fs24000_Gain7_A1 11826 /* Floating point value 0.360899 */
-#define HPF_Fs24000_Gain7_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs24000_Gain7_B1 8780 /* Floating point value 0.267949 */
-#define HPF_Fs24000_Gain7_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs24000_Gain7_Shift 2 /* Shift value */
- /* Gain = 8.000000 dB */
-#define HPF_Fs24000_Gain8_A0 (-2323) /* Floating point value -0.070878 */
-#define HPF_Fs24000_Gain8_A1 12640 /* Floating point value 0.385727 */
-#define HPF_Fs24000_Gain8_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs24000_Gain8_B1 8780 /* Floating point value 0.267949 */
-#define HPF_Fs24000_Gain8_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs24000_Gain8_Shift 2 /* Shift value */
- /* Gain = 9.000000 dB */
-#define HPF_Fs24000_Gain9_A0 (-3235) /* Floating point value -0.098736 */
-#define HPF_Fs24000_Gain9_A1 13552 /* Floating point value 0.413584 */
-#define HPF_Fs24000_Gain9_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs24000_Gain9_B1 8780 /* Floating point value 0.267949 */
-#define HPF_Fs24000_Gain9_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs24000_Gain9_Shift 2 /* Shift value */
- /* Gain = 10.000000 dB */
-#define HPF_Fs24000_Gain10_A0 (-4260) /* Floating point value -0.129992 */
-#define HPF_Fs24000_Gain10_A1 14577 /* Floating point value 0.444841 */
-#define HPF_Fs24000_Gain10_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs24000_Gain10_B1 8780 /* Floating point value 0.267949 */
-#define HPF_Fs24000_Gain10_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs24000_Gain10_Shift 2 /* Shift value */
- /* Gain = 11.000000 dB */
-#define HPF_Fs24000_Gain11_A0 (-5409) /* Floating point value -0.165062 */
-#define HPF_Fs24000_Gain11_A1 15726 /* Floating point value 0.479911 */
-#define HPF_Fs24000_Gain11_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs24000_Gain11_B1 8780 /* Floating point value 0.267949 */
-#define HPF_Fs24000_Gain11_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs24000_Gain11_Shift 2 /* Shift value */
- /* Gain = 12.000000 dB */
-#define HPF_Fs24000_Gain12_A0 (-6698) /* Floating point value -0.204411 */
-#define HPF_Fs24000_Gain12_A1 17015 /* Floating point value 0.519260 */
-#define HPF_Fs24000_Gain12_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs24000_Gain12_B1 8780 /* Floating point value 0.267949 */
-#define HPF_Fs24000_Gain12_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs24000_Gain12_Shift 2 /* Shift value */
- /* Gain = 13.000000 dB */
-#define HPF_Fs24000_Gain13_A0 (-4082) /* Floating point value -0.124576 */
-#define HPF_Fs24000_Gain13_A1 9253 /* Floating point value 0.282374 */
-#define HPF_Fs24000_Gain13_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs24000_Gain13_B1 8780 /* Floating point value 0.267949 */
-#define HPF_Fs24000_Gain13_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs24000_Gain13_Shift 3 /* Shift value */
- /* Gain = 14.000000 dB */
-#define HPF_Fs24000_Gain14_A0 (-4896) /* Floating point value -0.149404 */
-#define HPF_Fs24000_Gain14_A1 10066 /* Floating point value 0.307202 */
-#define HPF_Fs24000_Gain14_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs24000_Gain14_B1 8780 /* Floating point value 0.267949 */
-#define HPF_Fs24000_Gain14_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs24000_Gain14_Shift 3 /* Shift value */
- /* Gain = 15.000000 dB */
-#define HPF_Fs24000_Gain15_A0 (-5808) /* Floating point value -0.177261 */
-#define HPF_Fs24000_Gain15_A1 10979 /* Floating point value 0.335059 */
-#define HPF_Fs24000_Gain15_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs24000_Gain15_B1 8780 /* Floating point value 0.267949 */
-#define HPF_Fs24000_Gain15_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs24000_Gain15_Shift 3 /* Shift value */
-
-
-/* Coefficients for sample rate 32000Hz */
- /* Gain = 1.000000 dB */
-#define HPF_Fs32000_Gain1_A0 17225 /* Floating point value 0.525677 */
-#define HPF_Fs32000_Gain1_A1 (-990) /* Floating point value -0.030227 */
-#define HPF_Fs32000_Gain1_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs32000_Gain1_B1 0 /* Floating point value -0.000000 */
-#define HPF_Fs32000_Gain1_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs32000_Gain1_Shift 1 /* Shift value */
- /* Gain = 2.000000 dB */
-#define HPF_Fs32000_Gain2_A0 18337 /* Floating point value 0.559593 */
-#define HPF_Fs32000_Gain2_A1 (-2102) /* Floating point value -0.064142 */
-#define HPF_Fs32000_Gain2_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs32000_Gain2_B1 0 /* Floating point value -0.000000 */
-#define HPF_Fs32000_Gain2_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs32000_Gain2_Shift 1 /* Shift value */
- /* Gain = 3.000000 dB */
-#define HPF_Fs32000_Gain3_A0 19584 /* Floating point value 0.597646 */
-#define HPF_Fs32000_Gain3_A1 (-3349) /* Floating point value -0.102196 */
-#define HPF_Fs32000_Gain3_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs32000_Gain3_B1 0 /* Floating point value -0.000000 */
-#define HPF_Fs32000_Gain3_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs32000_Gain3_Shift 1 /* Shift value */
- /* Gain = 4.000000 dB */
-#define HPF_Fs32000_Gain4_A0 20983 /* Floating point value 0.640343 */
-#define HPF_Fs32000_Gain4_A1 (-4748) /* Floating point value -0.144893 */
-#define HPF_Fs32000_Gain4_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs32000_Gain4_B1 0 /* Floating point value -0.000000 */
-#define HPF_Fs32000_Gain4_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs32000_Gain4_Shift 1 /* Shift value */
- /* Gain = 5.000000 dB */
-#define HPF_Fs32000_Gain5_A0 22553 /* Floating point value 0.688250 */
-#define HPF_Fs32000_Gain5_A1 (-6318) /* Floating point value -0.192799 */
-#define HPF_Fs32000_Gain5_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs32000_Gain5_B1 0 /* Floating point value -0.000000 */
-#define HPF_Fs32000_Gain5_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs32000_Gain5_Shift 1 /* Shift value */
- /* Gain = 6.000000 dB */
-#define HPF_Fs32000_Gain6_A0 24314 /* Floating point value 0.742002 */
-#define HPF_Fs32000_Gain6_A1 (-8079) /* Floating point value -0.246551 */
-#define HPF_Fs32000_Gain6_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs32000_Gain6_B1 0 /* Floating point value -0.000000 */
-#define HPF_Fs32000_Gain6_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs32000_Gain6_Shift 1 /* Shift value */
- /* Gain = 7.000000 dB */
-#define HPF_Fs32000_Gain7_A0 13176 /* Floating point value 0.402109 */
-#define HPF_Fs32000_Gain7_A1 (-5040) /* Floating point value -0.153795 */
-#define HPF_Fs32000_Gain7_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs32000_Gain7_B1 0 /* Floating point value -0.000000 */
-#define HPF_Fs32000_Gain7_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs32000_Gain7_Shift 2 /* Shift value */
- /* Gain = 8.000000 dB */
-#define HPF_Fs32000_Gain8_A0 14288 /* Floating point value 0.436024 */
-#define HPF_Fs32000_Gain8_A1 (-6151) /* Floating point value -0.187711 */
-#define HPF_Fs32000_Gain8_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs32000_Gain8_B1 0 /* Floating point value -0.000000 */
-#define HPF_Fs32000_Gain8_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs32000_Gain8_Shift 2 /* Shift value */
- /* Gain = 9.000000 dB */
-#define HPF_Fs32000_Gain9_A0 15535 /* Floating point value 0.474078 */
-#define HPF_Fs32000_Gain9_A1 (-7398) /* Floating point value -0.225764 */
-#define HPF_Fs32000_Gain9_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs32000_Gain9_B1 0 /* Floating point value -0.000000 */
-#define HPF_Fs32000_Gain9_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs32000_Gain9_Shift 2 /* Shift value */
- /* Gain = 10.000000 dB */
-#define HPF_Fs32000_Gain10_A0 16934 /* Floating point value 0.516774 */
-#define HPF_Fs32000_Gain10_A1 (-8797) /* Floating point value -0.268461 */
-#define HPF_Fs32000_Gain10_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs32000_Gain10_B1 0 /* Floating point value -0.000000 */
-#define HPF_Fs32000_Gain10_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs32000_Gain10_Shift 2 /* Shift value */
- /* Gain = 11.000000 dB */
-#define HPF_Fs32000_Gain11_A0 18503 /* Floating point value 0.564681 */
-#define HPF_Fs32000_Gain11_A1 (-10367) /* Floating point value -0.316368 */
-#define HPF_Fs32000_Gain11_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs32000_Gain11_B1 0 /* Floating point value -0.000000 */
-#define HPF_Fs32000_Gain11_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs32000_Gain11_Shift 2 /* Shift value */
- /* Gain = 12.000000 dB */
-#define HPF_Fs32000_Gain12_A0 20265 /* Floating point value 0.618433 */
-#define HPF_Fs32000_Gain12_A1 (-12128) /* Floating point value -0.370120 */
-#define HPF_Fs32000_Gain12_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs32000_Gain12_B1 0 /* Floating point value -0.000000 */
-#define HPF_Fs32000_Gain12_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs32000_Gain12_Shift 2 /* Shift value */
- /* Gain = 13.000000 dB */
-#define HPF_Fs32000_Gain13_A0 11147 /* Floating point value 0.340178 */
-#define HPF_Fs32000_Gain13_A1 (-7069) /* Floating point value -0.215726 */
-#define HPF_Fs32000_Gain13_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs32000_Gain13_B1 0 /* Floating point value -0.000000 */
-#define HPF_Fs32000_Gain13_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs32000_Gain13_Shift 3 /* Shift value */
- /* Gain = 14.000000 dB */
-#define HPF_Fs32000_Gain14_A0 12258 /* Floating point value 0.374093 */
-#define HPF_Fs32000_Gain14_A1 (-8180) /* Floating point value -0.249642 */
-#define HPF_Fs32000_Gain14_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs32000_Gain14_B1 0 /* Floating point value -0.000000 */
-#define HPF_Fs32000_Gain14_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs32000_Gain14_Shift 3 /* Shift value */
- /* Gain = 15.000000 dB */
-#define HPF_Fs32000_Gain15_A0 13505 /* Floating point value 0.412147 */
-#define HPF_Fs32000_Gain15_A1 (-9427) /* Floating point value -0.287695 */
-#define HPF_Fs32000_Gain15_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs32000_Gain15_B1 0 /* Floating point value -0.000000 */
-#define HPF_Fs32000_Gain15_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs32000_Gain15_Shift 3 /* Shift value */
-
-
-/* Coefficients for sample rate 44100Hz */
- /* Gain = 1.000000 dB */
-#define HPF_Fs44100_Gain1_A0 17442 /* Floating point value 0.532294 */
-#define HPF_Fs44100_Gain1_A1 (-4761) /* Floating point value -0.145294 */
-#define HPF_Fs44100_Gain1_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs44100_Gain1_B1 (-7173) /* Floating point value -0.218894 */
-#define HPF_Fs44100_Gain1_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs44100_Gain1_Shift 1 /* Shift value */
- /* Gain = 2.000000 dB */
-#define HPF_Fs44100_Gain2_A0 18797 /* Floating point value 0.573633 */
-#define HPF_Fs44100_Gain2_A1 (-6116) /* Floating point value -0.186634 */
-#define HPF_Fs44100_Gain2_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs44100_Gain2_B1 (-7173) /* Floating point value -0.218894 */
-#define HPF_Fs44100_Gain2_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs44100_Gain2_Shift 1 /* Shift value */
- /* Gain = 3.000000 dB */
-#define HPF_Fs44100_Gain3_A0 20317 /* Floating point value 0.620016 */
-#define HPF_Fs44100_Gain3_A1 (-7635) /* Floating point value -0.233017 */
-#define HPF_Fs44100_Gain3_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs44100_Gain3_B1 (-7173) /* Floating point value -0.218894 */
-#define HPF_Fs44100_Gain3_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs44100_Gain3_Shift 1 /* Shift value */
- /* Gain = 4.000000 dB */
-#define HPF_Fs44100_Gain4_A0 22022 /* Floating point value 0.672059 */
-#define HPF_Fs44100_Gain4_A1 (-9341) /* Floating point value -0.285060 */
-#define HPF_Fs44100_Gain4_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs44100_Gain4_B1 (-7173) /* Floating point value -0.218894 */
-#define HPF_Fs44100_Gain4_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs44100_Gain4_Shift 1 /* Shift value */
- /* Gain = 5.000000 dB */
-#define HPF_Fs44100_Gain5_A0 23935 /* Floating point value 0.730452 */
-#define HPF_Fs44100_Gain5_A1 (-11254) /* Floating point value -0.343453 */
-#define HPF_Fs44100_Gain5_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs44100_Gain5_B1 (-7173) /* Floating point value -0.218894 */
-#define HPF_Fs44100_Gain5_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs44100_Gain5_Shift 1 /* Shift value */
- /* Gain = 6.000000 dB */
-#define HPF_Fs44100_Gain6_A0 26082 /* Floating point value 0.795970 */
-#define HPF_Fs44100_Gain6_A1 (-13401) /* Floating point value -0.408971 */
-#define HPF_Fs44100_Gain6_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs44100_Gain6_B1 (-7173) /* Floating point value -0.218894 */
-#define HPF_Fs44100_Gain6_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs44100_Gain6_Shift 1 /* Shift value */
- /* Gain = 7.000000 dB */
-#define HPF_Fs44100_Gain7_A0 14279 /* Floating point value 0.435774 */
-#define HPF_Fs44100_Gain7_A1 (-7924) /* Floating point value -0.241815 */
-#define HPF_Fs44100_Gain7_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs44100_Gain7_B1 (-7173) /* Floating point value -0.218894 */
-#define HPF_Fs44100_Gain7_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs44100_Gain7_Shift 2 /* Shift value */
- /* Gain = 8.000000 dB */
-#define HPF_Fs44100_Gain8_A0 15634 /* Floating point value 0.477113 */
-#define HPF_Fs44100_Gain8_A1 (-9278) /* Floating point value -0.283154 */
-#define HPF_Fs44100_Gain8_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs44100_Gain8_B1 (-7173) /* Floating point value -0.218894 */
-#define HPF_Fs44100_Gain8_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs44100_Gain8_Shift 2 /* Shift value */
- /* Gain = 9.000000 dB */
-#define HPF_Fs44100_Gain9_A0 17154 /* Floating point value 0.523496 */
-#define HPF_Fs44100_Gain9_A1 (-10798) /* Floating point value -0.329537 */
-#define HPF_Fs44100_Gain9_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs44100_Gain9_B1 (-7173) /* Floating point value -0.218894 */
-#define HPF_Fs44100_Gain9_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs44100_Gain9_Shift 2 /* Shift value */
- /* Gain = 10.000000 dB */
-#define HPF_Fs44100_Gain10_A0 18859 /* Floating point value 0.575539 */
-#define HPF_Fs44100_Gain10_A1 (-12504) /* Floating point value -0.381580 */
-#define HPF_Fs44100_Gain10_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs44100_Gain10_B1 (-7173) /* Floating point value -0.218894 */
-#define HPF_Fs44100_Gain10_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs44100_Gain10_Shift 2 /* Shift value */
- /* Gain = 11.000000 dB */
-#define HPF_Fs44100_Gain11_A0 20773 /* Floating point value 0.633932 */
-#define HPF_Fs44100_Gain11_A1 (-14417) /* Floating point value -0.439973 */
-#define HPF_Fs44100_Gain11_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs44100_Gain11_B1 (-7173) /* Floating point value -0.218894 */
-#define HPF_Fs44100_Gain11_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs44100_Gain11_Shift 2 /* Shift value */
- /* Gain = 12.000000 dB */
-#define HPF_Fs44100_Gain12_A0 22920 /* Floating point value 0.699450 */
-#define HPF_Fs44100_Gain12_A1 (-16564) /* Floating point value -0.505491 */
-#define HPF_Fs44100_Gain12_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs44100_Gain12_B1 (-7173) /* Floating point value -0.218894 */
-#define HPF_Fs44100_Gain12_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs44100_Gain12_Shift 2 /* Shift value */
- /* Gain = 13.000000 dB */
-#define HPF_Fs44100_Gain13_A0 12694 /* Floating point value 0.387399 */
-#define HPF_Fs44100_Gain13_A1 (-9509) /* Floating point value -0.290189 */
-#define HPF_Fs44100_Gain13_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs44100_Gain13_B1 (-7173) /* Floating point value -0.218894 */
-#define HPF_Fs44100_Gain13_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs44100_Gain13_Shift 3 /* Shift value */
- /* Gain = 14.000000 dB */
-#define HPF_Fs44100_Gain14_A0 14049 /* Floating point value 0.428738 */
-#define HPF_Fs44100_Gain14_A1 (-10864) /* Floating point value -0.331528 */
-#define HPF_Fs44100_Gain14_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs44100_Gain14_B1 (-7173) /* Floating point value -0.218894 */
-#define HPF_Fs44100_Gain14_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs44100_Gain14_Shift 3 /* Shift value */
- /* Gain = 15.000000 dB */
-#define HPF_Fs44100_Gain15_A0 15569 /* Floating point value 0.475121 */
-#define HPF_Fs44100_Gain15_A1 (-12383) /* Floating point value -0.377912 */
-#define HPF_Fs44100_Gain15_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs44100_Gain15_B1 (-7173) /* Floating point value -0.218894 */
-#define HPF_Fs44100_Gain15_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs44100_Gain15_Shift 3 /* Shift value */
-
-
-/* Coefficients for sample rate 48000Hz */
- /* Gain = 1.000000 dB */
-#define HPF_Fs48000_Gain1_A0 17491 /* Floating point value 0.533777 */
-#define HPF_Fs48000_Gain1_A1 (-5606) /* Floating point value -0.171082 */
-#define HPF_Fs48000_Gain1_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs48000_Gain1_B1 (-8780) /* Floating point value -0.267949 */
-#define HPF_Fs48000_Gain1_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs48000_Gain1_Shift 1 /* Shift value */
- /* Gain = 2.000000 dB */
-#define HPF_Fs48000_Gain2_A0 18900 /* Floating point value 0.576779 */
-#define HPF_Fs48000_Gain2_A1 (-7015) /* Floating point value -0.214085 */
-#define HPF_Fs48000_Gain2_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs48000_Gain2_B1 (-8780) /* Floating point value -0.267949 */
-#define HPF_Fs48000_Gain2_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs48000_Gain2_Shift 1 /* Shift value */
- /* Gain = 3.000000 dB */
-#define HPF_Fs48000_Gain3_A0 20481 /* Floating point value 0.625029 */
-#define HPF_Fs48000_Gain3_A1 (-8596) /* Floating point value -0.262335 */
-#define HPF_Fs48000_Gain3_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs48000_Gain3_B1 (-8780) /* Floating point value -0.267949 */
-#define HPF_Fs48000_Gain3_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs48000_Gain3_Shift 1 /* Shift value */
- /* Gain = 4.000000 dB */
-#define HPF_Fs48000_Gain4_A0 22255 /* Floating point value 0.679167 */
-#define HPF_Fs48000_Gain4_A1 (-10370) /* Floating point value -0.316472 */
-#define HPF_Fs48000_Gain4_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs48000_Gain4_B1 (-8780) /* Floating point value -0.267949 */
-#define HPF_Fs48000_Gain4_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs48000_Gain4_Shift 1 /* Shift value */
- /* Gain = 5.000000 dB */
-#define HPF_Fs48000_Gain5_A0 24245 /* Floating point value 0.739910 */
-#define HPF_Fs48000_Gain5_A1 (-12361) /* Floating point value -0.377215 */
-#define HPF_Fs48000_Gain5_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs48000_Gain5_B1 (-8780) /* Floating point value -0.267949 */
-#define HPF_Fs48000_Gain5_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs48000_Gain5_Shift 1 /* Shift value */
- /* Gain = 6.000000 dB */
-#define HPF_Fs48000_Gain6_A0 26479 /* Floating point value 0.808065 */
-#define HPF_Fs48000_Gain6_A1 (-14594) /* Floating point value -0.445370 */
-#define HPF_Fs48000_Gain6_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs48000_Gain6_B1 (-8780) /* Floating point value -0.267949 */
-#define HPF_Fs48000_Gain6_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs48000_Gain6_Shift 1 /* Shift value */
- /* Gain = 7.000000 dB */
-#define HPF_Fs48000_Gain7_A0 14527 /* Floating point value 0.443318 */
-#define HPF_Fs48000_Gain7_A1 (-8570) /* Floating point value -0.261540 */
-#define HPF_Fs48000_Gain7_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs48000_Gain7_B1 (-8780) /* Floating point value -0.267949 */
-#define HPF_Fs48000_Gain7_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs48000_Gain7_Shift 2 /* Shift value */
- /* Gain = 8.000000 dB */
-#define HPF_Fs48000_Gain8_A0 15936 /* Floating point value 0.486321 */
-#define HPF_Fs48000_Gain8_A1 (-9979) /* Floating point value -0.304543 */
-#define HPF_Fs48000_Gain8_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs48000_Gain8_B1 (-8780) /* Floating point value -0.267949 */
-#define HPF_Fs48000_Gain8_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs48000_Gain8_Shift 2 /* Shift value */
- /* Gain = 9.000000 dB */
-#define HPF_Fs48000_Gain9_A0 17517 /* Floating point value 0.534571 */
-#define HPF_Fs48000_Gain9_A1 (-11560) /* Floating point value -0.352793 */
-#define HPF_Fs48000_Gain9_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs48000_Gain9_B1 (-8780) /* Floating point value -0.267949 */
-#define HPF_Fs48000_Gain9_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs48000_Gain9_Shift 2 /* Shift value */
- /* Gain = 10.000000 dB */
-#define HPF_Fs48000_Gain10_A0 19291 /* Floating point value 0.588708 */
-#define HPF_Fs48000_Gain10_A1 (-13334) /* Floating point value -0.406930 */
-#define HPF_Fs48000_Gain10_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs48000_Gain10_B1 (-8780) /* Floating point value -0.267949 */
-#define HPF_Fs48000_Gain10_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs48000_Gain10_Shift 2 /* Shift value */
- /* Gain = 11.000000 dB */
-#define HPF_Fs48000_Gain11_A0 21281 /* Floating point value 0.649452 */
-#define HPF_Fs48000_Gain11_A1 (-15325) /* Floating point value -0.467674 */
-#define HPF_Fs48000_Gain11_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs48000_Gain11_B1 (-8780) /* Floating point value -0.267949 */
-#define HPF_Fs48000_Gain11_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs48000_Gain11_Shift 2 /* Shift value */
- /* Gain = 12.000000 dB */
-#define HPF_Fs48000_Gain12_A0 23515 /* Floating point value 0.717607 */
-#define HPF_Fs48000_Gain12_A1 (-17558) /* Floating point value -0.535829 */
-#define HPF_Fs48000_Gain12_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs48000_Gain12_B1 (-8780) /* Floating point value -0.267949 */
-#define HPF_Fs48000_Gain12_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs48000_Gain12_Shift 2 /* Shift value */
- /* Gain = 13.000000 dB */
-#define HPF_Fs48000_Gain13_A0 13041 /* Floating point value 0.397982 */
-#define HPF_Fs48000_Gain13_A1 (-10056) /* Floating point value -0.306877 */
-#define HPF_Fs48000_Gain13_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs48000_Gain13_B1 (-8780) /* Floating point value -0.267949 */
-#define HPF_Fs48000_Gain13_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs48000_Gain13_Shift 3 /* Shift value */
- /* Gain = 14.000000 dB */
-#define HPF_Fs48000_Gain14_A0 14450 /* Floating point value 0.440984 */
-#define HPF_Fs48000_Gain14_A1 (-11465) /* Floating point value -0.349880 */
-#define HPF_Fs48000_Gain14_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs48000_Gain14_B1 (-8780) /* Floating point value -0.267949 */
-#define HPF_Fs48000_Gain14_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs48000_Gain14_Shift 3 /* Shift value */
- /* Gain = 15.000000 dB */
-#define HPF_Fs48000_Gain15_A0 16031 /* Floating point value 0.489234 */
-#define HPF_Fs48000_Gain15_A1 (-13046) /* Floating point value -0.398130 */
-#define HPF_Fs48000_Gain15_A2 0 /* Floating point value 0.000000 */
-#define HPF_Fs48000_Gain15_B1 (-8780) /* Floating point value -0.267949 */
-#define HPF_Fs48000_Gain15_B2 0 /* Floating point value 0.000000 */
-#define HPF_Fs48000_Gain15_Shift 3 /* Shift value */
-
-
-#endif
-#endif
diff --git a/media/libeffects/lvm/lib/Bundle/src/LVM_Control.cpp b/media/libeffects/lvm/lib/Bundle/src/LVM_Control.cpp
index ab1c078..ff2c90a 100644
--- a/media/libeffects/lvm/lib/Bundle/src/LVM_Control.cpp
+++ b/media/libeffects/lvm/lib/Bundle/src/LVM_Control.cpp
@@ -15,7 +15,6 @@
* limitations under the License.
*/
-
/****************************************************************************************/
/* */
/* Includes */
@@ -56,7 +55,6 @@
{
LVM_Instance_t *pInstance =(LVM_Instance_t *)hInstance;
-
if ((pParams == LVM_NULL) || (hInstance == LVM_NULL))
{
return (LVM_NULLADDRESS);
@@ -67,17 +65,11 @@
if(
/* General parameters */
((pParams->OperatingMode != LVM_MODE_OFF) && (pParams->OperatingMode != LVM_MODE_ON)) ||
-#if defined(BUILD_FLOAT) && defined(HIGHER_FS)
((pParams->SampleRate != LVM_FS_8000) && (pParams->SampleRate != LVM_FS_11025) && (pParams->SampleRate != LVM_FS_12000) &&
(pParams->SampleRate != LVM_FS_16000) && (pParams->SampleRate != LVM_FS_22050) && (pParams->SampleRate != LVM_FS_24000) &&
(pParams->SampleRate != LVM_FS_32000) && (pParams->SampleRate != LVM_FS_44100) && (pParams->SampleRate != LVM_FS_48000) &&
(pParams->SampleRate != LVM_FS_88200) && (pParams->SampleRate != LVM_FS_96000) &&
(pParams->SampleRate != LVM_FS_176400) && (pParams->SampleRate != LVM_FS_192000)) ||
-#else
- ((pParams->SampleRate != LVM_FS_8000) && (pParams->SampleRate != LVM_FS_11025) && (pParams->SampleRate != LVM_FS_12000) &&
- (pParams->SampleRate != LVM_FS_16000) && (pParams->SampleRate != LVM_FS_22050) && (pParams->SampleRate != LVM_FS_24000) &&
- (pParams->SampleRate != LVM_FS_32000) && (pParams->SampleRate != LVM_FS_44100) && (pParams->SampleRate != LVM_FS_48000)) ||
-#endif
#ifdef SUPPORT_MC
((pParams->SourceFormat != LVM_STEREO) &&
(pParams->SourceFormat != LVM_MONOINSTEREO) &&
@@ -204,7 +196,6 @@
return (LVM_OUTOFRANGE);
}
-
/*
* Set the flag to indicate there are new parameters to use
*
@@ -218,7 +209,6 @@
return(LVM_SUCCESS);
}
-
/****************************************************************************************/
/* */
/* FUNCTION: LVM_GetControlParameters */
@@ -245,7 +235,6 @@
{
LVM_Instance_t *pInstance =(LVM_Instance_t *)hInstance;
-
/*
* Check pointer
*/
@@ -272,7 +261,6 @@
return(LVM_SUCCESS);
}
-
/****************************************************************************************/
/* */
/* FUNCTION: LVM_SetTrebleBoost */
@@ -289,11 +277,7 @@
void LVM_SetTrebleBoost(LVM_Instance_t *pInstance,
LVM_ControlParams_t *pParams)
{
-#ifdef BUILD_FLOAT
extern FO_FLOAT_LShx_Coefs_t LVM_TrebleBoostCoefs[];
-#else
- extern FO_C16_LShx_Coefs_t LVM_TrebleBoostCoefs[];
-#endif
LVM_INT16 Offset;
LVM_INT16 EffectLevel = 0;
@@ -324,7 +308,6 @@
* Load the coefficients and enabled the treble boost
*/
Offset = (LVM_INT16)(EffectLevel - 1 + TrebleBoostSteps * (pParams->SampleRate - TrebleBoostMinRate));
-#ifdef BUILD_FLOAT
FO_2I_D16F32Css_LShx_TRC_WRA_01_Init(&pInstance->pTE_State->TrebleBoost_State,
&pInstance->pTE_Taps->TrebleBoost_Taps,
&LVM_TrebleBoostCoefs[Offset]);
@@ -337,19 +320,6 @@
Cast to void: no dereferencing in function */
(LVM_UINT16)(sizeof(pInstance->pTE_Taps->TrebleBoost_Taps) / \
sizeof(LVM_FLOAT))); /* Number of words */
-#else
- FO_2I_D16F32Css_LShx_TRC_WRA_01_Init(&pInstance->pTE_State->TrebleBoost_State,
- &pInstance->pTE_Taps->TrebleBoost_Taps,
- &LVM_TrebleBoostCoefs[Offset]);
-
- /*
- * Clear the taps
- */
- LoadConst_16((LVM_INT16)0, /* Value */
- (void *)&pInstance->pTE_Taps->TrebleBoost_Taps, /* Destination.\
- Cast to void: no dereferencing in function */
- (LVM_UINT16)(sizeof(pInstance->pTE_Taps->TrebleBoost_Taps)/sizeof(LVM_INT16))); /* Number of words */
-#endif
}
}
else
@@ -363,7 +333,6 @@
return;
}
-
/************************************************************************************/
/* */
/* FUNCTION: LVM_SetVolume */
@@ -383,9 +352,7 @@
LVM_UINT16 dBShifts; /* 6dB shifts */
LVM_UINT16 dBOffset; /* Table offset */
LVM_INT16 Volume = 0; /* Required volume in dBs */
-#ifdef BUILD_FLOAT
LVM_FLOAT Temp;
-#endif
/*
* Limit the gain to the maximum allowed
@@ -439,56 +406,36 @@
dBOffset = (LVM_UINT16)((-Volume) % 6); /* Get the dBs 0-5 */
dBShifts = (LVM_UINT16)(Volume / -6); /* Get the 6dB shifts */
-
/*
* Set the parameters
*/
if(dBShifts == 0)
{
-#ifdef BUILD_FLOAT
LVC_Mixer_SetTarget(&pInstance->VC_Volume.MixerStream[0],
(LVM_FLOAT)LVM_VolumeTable[dBOffset]);
-#else
- LVC_Mixer_SetTarget(&pInstance->VC_Volume.MixerStream[0],
- (LVM_INT32)LVM_VolumeTable[dBOffset]);
-#endif
}
else
{
-#ifdef BUILD_FLOAT
Temp = LVM_VolumeTable[dBOffset];
while(dBShifts) {
Temp = Temp / 2.0f;
dBShifts--;
}
LVC_Mixer_SetTarget(&pInstance->VC_Volume.MixerStream[0], Temp);
-#else
- LVC_Mixer_SetTarget(&pInstance->VC_Volume.MixerStream[0],
- (((LVM_INT32)LVM_VolumeTable[dBOffset])>>dBShifts));
-#endif
}
pInstance->VC_Volume.MixerStream[0].CallbackSet = 1;
if(pInstance->NoSmoothVolume == LVM_TRUE)
{
-#ifdef BUILD_FLOAT
LVC_Mixer_SetTimeConstant(&pInstance->VC_Volume.MixerStream[0], 0,
pInstance->Params.SampleRate, 2);
-#else
- LVC_Mixer_SetTimeConstant(&pInstance->VC_Volume.MixerStream[0],0,pInstance->Params.SampleRate,2);
-#endif
}
else
{
-#ifdef BUILD_FLOAT
LVC_Mixer_VarSlope_SetTimeConstant(&pInstance->VC_Volume.MixerStream[0],
LVM_VC_MIXER_TIME, pInstance->Params.SampleRate, 2);
-#else
- LVC_Mixer_VarSlope_SetTimeConstant(&pInstance->VC_Volume.MixerStream[0],LVM_VC_MIXER_TIME,pInstance->Params.SampleRate,2);
-#endif
}
}
-
/************************************************************************************/
/* */
/* FUNCTION: LVM_SetHeadroom */
@@ -513,7 +460,6 @@
LVM_INT16 Headroom = 0;
LVM_INT16 MaxGain = 0;
-
if (((LVEQNB_Mode_en)pParams->EQNB_OperatingMode == LVEQNB_ON)
&& (pInstance->HeadroomParams.Headroom_OperatingMode == LVM_HEADROOM_ON))
{
@@ -546,7 +492,6 @@
}
-
/****************************************************************************************/
/* */
/* FUNCTION: LVM_ApplyNewSettings */
@@ -571,7 +516,6 @@
LVM_ControlParams_t LocalParams;
LVM_INT16 Count = 5;
-
/*
* Copy the new parameters but make sure they didn't change while copying
*/
@@ -628,13 +572,8 @@
/* Configure Mixer module for gradual changes to volume*/
if(LocalParams.VC_Balance < 0)
{
-#ifdef BUILD_FLOAT
LVM_FLOAT Target_Float;
-#else
- LVM_INT32 Target;
-#endif
/* Drop in right channel volume*/
-#ifdef BUILD_FLOAT
Target_Float = LVM_MAXFLOAT;
LVC_Mixer_SetTarget(&pInstance->VC_BalanceMix.MixerStream[0], Target_Float);
LVC_Mixer_VarSlope_SetTimeConstant(&pInstance->VC_BalanceMix.MixerStream[0],
@@ -644,25 +583,11 @@
LVC_Mixer_SetTarget(&pInstance->VC_BalanceMix.MixerStream[1], Target_Float);
LVC_Mixer_VarSlope_SetTimeConstant(&pInstance->VC_BalanceMix.MixerStream[1],
LVM_VC_MIXER_TIME, LocalParams.SampleRate, 1);
-#else
- Target = LVM_MAXINT_16;
- LVC_Mixer_SetTarget(&pInstance->VC_BalanceMix.MixerStream[0],Target);
- LVC_Mixer_VarSlope_SetTimeConstant(&pInstance->VC_BalanceMix.MixerStream[0],LVM_VC_MIXER_TIME,LocalParams.SampleRate,1);
-
- Target = dB_to_Lin32((LVM_INT16)(LocalParams.VC_Balance<<4));
- LVC_Mixer_SetTarget(&pInstance->VC_BalanceMix.MixerStream[1],Target);
- LVC_Mixer_VarSlope_SetTimeConstant(&pInstance->VC_BalanceMix.MixerStream[1],LVM_VC_MIXER_TIME,LocalParams.SampleRate,1);
-#endif
}
else if(LocalParams.VC_Balance >0)
{
-#ifdef BUILD_FLOAT
LVM_FLOAT Target_Float;
-#else
- LVM_INT32 Target;
-#endif
/* Drop in left channel volume*/
-#ifdef BUILD_FLOAT
Target_Float = dB_to_LinFloat((LVM_INT16)((-LocalParams.VC_Balance) << 4));
LVC_Mixer_SetTarget(&pInstance->VC_BalanceMix.MixerStream[0], Target_Float);
LVC_Mixer_VarSlope_SetTimeConstant(&pInstance->VC_BalanceMix.MixerStream[0],
@@ -672,30 +597,12 @@
LVC_Mixer_SetTarget(&pInstance->VC_BalanceMix.MixerStream[1], Target_Float);
LVC_Mixer_VarSlope_SetTimeConstant(&pInstance->VC_BalanceMix.MixerStream[1],
LVM_VC_MIXER_TIME, LocalParams.SampleRate, 1);
-#else
- Target = dB_to_Lin32((LVM_INT16)((-LocalParams.VC_Balance)<<4));
- LVC_Mixer_SetTarget(&pInstance->VC_BalanceMix.MixerStream[0],Target);
- LVC_Mixer_VarSlope_SetTimeConstant(&pInstance->VC_BalanceMix.MixerStream[0],LVM_VC_MIXER_TIME,LocalParams.SampleRate,1);
-
- Target = LVM_MAXINT_16;
- LVC_Mixer_SetTarget(&pInstance->VC_BalanceMix.MixerStream[1],Target);
- LVC_Mixer_VarSlope_SetTimeConstant(&pInstance->VC_BalanceMix.MixerStream[1],LVM_VC_MIXER_TIME,LocalParams.SampleRate,1);
-#endif
}
else
{
-#ifdef BUILD_FLOAT
LVM_FLOAT Target_Float;
-#else
- LVM_INT32 Target;
-#endif
/* No drop*/
-#ifdef BUILD_FLOAT
Target_Float = LVM_MAXFLOAT;
-#else
- Target = LVM_MAXINT_16;
-#endif
-#ifdef BUILD_FLOAT
LVC_Mixer_SetTarget(&pInstance->VC_BalanceMix.MixerStream[0],Target_Float);
LVC_Mixer_VarSlope_SetTimeConstant(&pInstance->VC_BalanceMix.MixerStream[0],
LVM_VC_MIXER_TIME,LocalParams.SampleRate, 1);
@@ -703,13 +610,6 @@
LVC_Mixer_SetTarget(&pInstance->VC_BalanceMix.MixerStream[1],Target_Float);
LVC_Mixer_VarSlope_SetTimeConstant(&pInstance->VC_BalanceMix.MixerStream[1],
LVM_VC_MIXER_TIME,LocalParams.SampleRate, 1);
-#else
- LVC_Mixer_SetTarget(&pInstance->VC_BalanceMix.MixerStream[0],Target);
- LVC_Mixer_VarSlope_SetTimeConstant(&pInstance->VC_BalanceMix.MixerStream[0],LVM_VC_MIXER_TIME,LocalParams.SampleRate,1);
-
- LVC_Mixer_SetTarget(&pInstance->VC_BalanceMix.MixerStream[1],Target);
- LVC_Mixer_VarSlope_SetTimeConstant(&pInstance->VC_BalanceMix.MixerStream[1],LVM_VC_MIXER_TIME,LocalParams.SampleRate,1);
-#endif
}
}
/*
@@ -720,7 +620,6 @@
LVDBE_Params_t DBE_Params;
LVDBE_Handle_t *hDBEInstance = (LVDBE_Handle_t *)pInstance->hDBEInstance;
-
/*
* Set the new parameters
*/
@@ -749,7 +648,6 @@
DBE_Status = LVDBE_Control(hDBEInstance,
&DBE_Params);
-
/*
* Quit if the changes were not accepted
*/
@@ -758,7 +656,6 @@
return((LVM_ReturnStatus_en)DBE_Status);
}
-
/*
* Set the control flag
*/
@@ -773,7 +670,6 @@
LVEQNB_Params_t EQNB_Params;
LVEQNB_Handle_t *hEQNBInstance = (LVEQNB_Handle_t *)pInstance->hEQNBInstance;
-
/*
* Set the new parameters
*/
@@ -830,7 +726,6 @@
EQNB_Status = LVEQNB_Control(hEQNBInstance,
&EQNB_Params);
-
/*
* Quit if the changes were not accepted
*/
@@ -841,7 +736,6 @@
}
-
/*
* Update concert sound
*/
@@ -917,7 +811,6 @@
CS_Status = LVCS_Control(hCSInstance,
&CS_Params);
-
/*
* Quit if the changes were not accepted
*/
@@ -936,7 +829,6 @@
LVPSA_ControlParams_t PSA_Params;
pLVPSA_Handle_t *hPSAInstance = (pLVPSA_Handle_t *)pInstance->hPSAInstance;
-
/*
* Set the new parameters
*/
@@ -973,11 +865,9 @@
pInstance->NoSmoothVolume = LVM_FALSE;
pInstance->Params = LocalParams;
-
return(LVM_SUCCESS);
}
-
/****************************************************************************************/
/* */
/* FUNCTION: LVM_SetHeadroomParams */
@@ -1071,14 +961,12 @@
pHeadroomParams->NHeadroomBands = pInstance->NewHeadroomParams.NHeadroomBands;
-
/* Copy settings in memory */
for(ii = 0; ii < pInstance->NewHeadroomParams.NHeadroomBands; ii++)
{
pInstance->pHeadroom_UserDefs[ii] = pInstance->pHeadroom_BandDefs[ii];
}
-
pHeadroomParams->pHeadroomDefinition = pInstance->pHeadroom_UserDefs;
pHeadroomParams->Headroom_OperatingMode = pInstance->NewHeadroomParams.Headroom_OperatingMode;
return(LVM_SUCCESS);
@@ -1157,30 +1045,17 @@
short CallBackParam)
{
LVM_Instance_t *pInstance =(LVM_Instance_t *)pBundleHandle;
-#ifdef BUILD_FLOAT
LVM_FLOAT Target;
-#else
- LVM_INT32 Target;
-#endif
(void) pGeneralPurpose;
(void) CallBackParam;
/* When volume mixer has reached 0 dB target then stop it to avoid
unnecessary processing. */
-#ifdef BUILD_FLOAT
Target = LVC_Mixer_GetTarget(&pInstance->VC_Volume.MixerStream[0]);
if(Target == 1.0f)
{
pInstance->VC_Active = LVM_FALSE;
}
-#else
- Target = LVC_Mixer_GetTarget(&pInstance->VC_Volume.MixerStream[0]);
-
- if(Target == 0x7FFF)
- {
- pInstance->VC_Active = LVM_FALSE;
- }
-#endif
return 1;
}
diff --git a/media/libeffects/lvm/lib/Bundle/src/LVM_Init.cpp b/media/libeffects/lvm/lib/Bundle/src/LVM_Init.cpp
index d773910..5620529 100644
--- a/media/libeffects/lvm/lib/Bundle/src/LVM_Init.cpp
+++ b/media/libeffects/lvm/lib/Bundle/src/LVM_Init.cpp
@@ -139,7 +139,6 @@
INST_ALLOC AllocMem[LVM_NR_MEMORY_REGIONS];
LVM_INT16 i;
-
/*
* Check parameters
*/
@@ -148,7 +147,6 @@
return LVM_NULLADDRESS;
}
-
/*
* Return memory table if the instance has already been created
*/
@@ -227,20 +225,15 @@
InstAlloc_AddMember(&AllocMem[LVM_MEMREGION_PERSISTENT_SLOW_DATA],
sizeof(LVM_Instance_t));
-
/*
* Set the algorithm and bundle scratch requirements
*/
AlgScratchSize = 0;
if (pInstParams->BufferMode == LVM_MANAGED_BUFFERS)
{
-#ifdef BUILD_FLOAT
BundleScratchSize = 3 * LVM_MAX_CHANNELS \
* (MIN_INTERNAL_BLOCKSIZE + InternalBlockSize) \
* sizeof(LVM_FLOAT);
-#else
- BundleScratchSize = 6 * (MIN_INTERNAL_BLOCKSIZE + InternalBlockSize) * sizeof(LVM_INT16);
-#endif
InstAlloc_AddMember(&AllocMem[LVM_MEMREGION_TEMPORARY_FAST], /* Scratch buffer */
BundleScratchSize);
InstAlloc_AddMember(&AllocMem[LVM_MEMREGION_PERSISTENT_SLOW_DATA],
@@ -293,7 +286,6 @@
}
-
/*
* Dynamic Bass Enhancement requirements
*/
@@ -304,7 +296,6 @@
/*
* Set the capabilities
*/
-#if defined(BUILD_FLOAT) && defined(HIGHER_FS)
DBE_Capabilities.SampleRate = LVDBE_CAP_FS_8000 | LVDBE_CAP_FS_11025 |
LVDBE_CAP_FS_12000 | LVDBE_CAP_FS_16000 |
LVDBE_CAP_FS_22050 | LVDBE_CAP_FS_24000 |
@@ -312,9 +303,6 @@
LVDBE_CAP_FS_48000 | LVDBE_CAP_FS_88200 |
LVDBE_CAP_FS_96000 | LVDBE_CAP_FS_176400 |
LVDBE_CAP_FS_192000;
-#else
- DBE_Capabilities.SampleRate = LVDBE_CAP_FS_8000 | LVDBE_CAP_FS_11025 | LVDBE_CAP_FS_12000 | LVDBE_CAP_FS_16000 | LVDBE_CAP_FS_22050 | LVDBE_CAP_FS_24000 | LVDBE_CAP_FS_32000 | LVDBE_CAP_FS_44100 | LVDBE_CAP_FS_48000;
-#endif
DBE_Capabilities.CentreFrequency = LVDBE_CAP_CENTRE_55Hz | LVDBE_CAP_CENTRE_55Hz | LVDBE_CAP_CENTRE_66Hz | LVDBE_CAP_CENTRE_78Hz | LVDBE_CAP_CENTRE_90Hz;
DBE_Capabilities.MaxBlockSize = InternalBlockSize;
@@ -336,7 +324,6 @@
}
-
/*
* N-Band equaliser requirements
*/
@@ -347,7 +334,6 @@
/*
* Set the capabilities
*/
-#if defined(BUILD_FLOAT) && defined(HIGHER_FS)
EQNB_Capabilities.SampleRate = LVEQNB_CAP_FS_8000 | LVEQNB_CAP_FS_11025 |
LVEQNB_CAP_FS_12000 | LVEQNB_CAP_FS_16000 |
LVEQNB_CAP_FS_22050 | LVEQNB_CAP_FS_24000 |
@@ -355,9 +341,6 @@
LVEQNB_CAP_FS_48000 | LVEQNB_CAP_FS_88200 |
LVEQNB_CAP_FS_96000 | LVEQNB_CAP_FS_176400 |
LVEQNB_CAP_FS_192000;
-#else
- EQNB_Capabilities.SampleRate = LVEQNB_CAP_FS_8000 | LVEQNB_CAP_FS_11025 | LVEQNB_CAP_FS_12000 | LVEQNB_CAP_FS_16000 | LVEQNB_CAP_FS_22050 | LVEQNB_CAP_FS_24000 | LVEQNB_CAP_FS_32000 | LVEQNB_CAP_FS_44100 | LVEQNB_CAP_FS_48000;
-#endif
EQNB_Capabilities.SourceFormat = LVEQNB_CAP_STEREO | LVEQNB_CAP_MONOINSTEREO;
EQNB_Capabilities.MaxBlockSize = InternalBlockSize;
EQNB_Capabilities.MaxBands = pInstParams->EQNB_NumBands;
@@ -388,7 +371,6 @@
InstAlloc_AddMember(&AllocMem[LVM_MEMREGION_PERSISTENT_FAST_DATA],
(LVM_HEADROOM_MAX_NBANDS * sizeof(LVM_HeadroomBandDef_t)));
-
/*
* Spectrum Analyzer memory requirements
*/
@@ -441,13 +423,8 @@
PSA_MemTab.Region[LVM_PERSISTENT_FAST_COEF].Size);
/* Fast Temporary */
-#ifdef BUILD_FLOAT
InstAlloc_AddMember(&AllocMem[LVM_TEMPORARY_FAST],
MAX_INTERNAL_BLOCKSIZE * sizeof(LVM_FLOAT));
-#else
- InstAlloc_AddMember(&AllocMem[LVM_TEMPORARY_FAST],
- MAX_INTERNAL_BLOCKSIZE * sizeof(LVM_INT16));
-#endif
if (PSA_MemTab.Region[LVM_TEMPORARY_FAST].Size > AlgScratchSize)
{
@@ -493,7 +470,6 @@
}
-
/****************************************************************************************/
/* */
/* FUNCTION: LVM_GetInstanceHandle */
@@ -529,7 +505,6 @@
LVM_UINT16 InternalBlockSize;
LVM_INT32 BundleScratchSize;
-
/*
* Check valid points have been given
*/
@@ -592,7 +567,6 @@
pMemoryTable->Region[i].pBaseAddress);
}
-
/*
* Set the instance handle
*/
@@ -600,14 +574,12 @@
sizeof(LVM_Instance_t));
pInstance =(LVM_Instance_t *)*phInstance;
-
/*
* Save the memory table, parameters and capabilities
*/
pInstance->MemoryTable = *pMemoryTable;
pInstance->InstParams = *pInstParams;
-
/*
* Set the bundle scratch memory and initialse the buffer management
*/
@@ -624,7 +596,6 @@
}
pInstance->InternalBlockSize = (LVM_INT16)InternalBlockSize;
-
/*
* Common settings for managed and unmanaged buffers
*/
@@ -637,33 +608,22 @@
pInstance->pBufferManagement = (LVM_Buffer_t *)
InstAlloc_AddMember(&AllocMem[LVM_MEMREGION_PERSISTENT_SLOW_DATA],
sizeof(LVM_Buffer_t));
-#ifdef BUILD_FLOAT
BundleScratchSize = (LVM_INT32)
(3 * LVM_MAX_CHANNELS \
* (MIN_INTERNAL_BLOCKSIZE + InternalBlockSize) \
* sizeof(LVM_FLOAT));
-#else
- BundleScratchSize = (LVM_INT32)(6 * (MIN_INTERNAL_BLOCKSIZE + InternalBlockSize) * sizeof(LVM_INT16));
-#endif
pInstance->pBufferManagement->pScratch = (LVM_FLOAT *)
InstAlloc_AddMember(
&AllocMem[LVM_MEMREGION_TEMPORARY_FAST], /* Scratch 1 buffer */
(LVM_UINT32)BundleScratchSize);
-#ifdef BUILD_FLOAT
LoadConst_Float(0, /* Clear the input delay buffer */
(LVM_FLOAT *)&pInstance->pBufferManagement->InDelayBuffer,
(LVM_INT16)(LVM_MAX_CHANNELS * MIN_INTERNAL_BLOCKSIZE));
-#else
- LoadConst_16(0, /* Clear the input delay buffer */
- (LVM_INT16 *)&pInstance->pBufferManagement->InDelayBuffer,
- (LVM_INT16)(2 * MIN_INTERNAL_BLOCKSIZE));
-#endif
pInstance->pBufferManagement->InDelaySamples = MIN_INTERNAL_BLOCKSIZE; /* Set the number of delay samples */
pInstance->pBufferManagement->OutDelaySamples = 0; /* No samples in the output buffer */
pInstance->pBufferManagement->BufferState = LVM_FIRSTCALL; /* Set the state ready for the first call */
}
-
/*
* Set default parameters
*/
@@ -679,7 +639,6 @@
*/
pInstance->CallBack = LVM_AlgoCallBack;
-
/*
* DC removal filter
*/
@@ -701,7 +660,6 @@
pInstance->Params.TE_EffectLevel = 0;
pInstance->TE_Active = LVM_FALSE;
-
/*
* Set the volume control and initialise Current to Target
*/
@@ -713,26 +671,14 @@
/* In managed buffering, start with low signal level as delay in buffer management causes a click*/
if (pInstParams->BufferMode == LVM_MANAGED_BUFFERS)
{
-#ifdef BUILD_FLOAT
LVC_Mixer_Init(&pInstance->VC_Volume.MixerStream[0], 0, 0);
-#else
- LVC_Mixer_Init(&pInstance->VC_Volume.MixerStream[0],0,0);
-#endif
}
else
{
-#ifdef BUILD_FLOAT
LVC_Mixer_Init(&pInstance->VC_Volume.MixerStream[0], LVM_MAXFLOAT, LVM_MAXFLOAT);
-#else
- LVC_Mixer_Init(&pInstance->VC_Volume.MixerStream[0],LVM_MAXINT_16,LVM_MAXINT_16);
-#endif
}
-#ifdef BUILD_FLOAT
LVC_Mixer_SetTimeConstant(&pInstance->VC_Volume.MixerStream[0],0,LVM_FS_8000,2);
-#else
- LVC_Mixer_SetTimeConstant(&pInstance->VC_Volume.MixerStream[0], 0, LVM_FS_8000, 2);
-#endif
pInstance->VC_VolumedB = 0;
pInstance->VC_AVLFixedVolume = 0;
@@ -742,22 +688,14 @@
pInstance->VC_BalanceMix.MixerStream[0].CallbackSet = 0;
pInstance->VC_BalanceMix.MixerStream[0].pCallbackHandle = pInstance;
pInstance->VC_BalanceMix.MixerStream[0].pCallBack = LVM_VCCallBack;
-#ifdef BUILD_FLOAT
LVC_Mixer_Init(&pInstance->VC_BalanceMix.MixerStream[0], LVM_MAXFLOAT, LVM_MAXFLOAT);
-#else
- LVC_Mixer_Init(&pInstance->VC_BalanceMix.MixerStream[0],LVM_MAXINT_16,LVM_MAXINT_16);
-#endif
LVC_Mixer_VarSlope_SetTimeConstant(&pInstance->VC_BalanceMix.MixerStream[0],LVM_VC_MIXER_TIME,LVM_FS_8000,2);
pInstance->VC_BalanceMix.MixerStream[1].CallbackParam = 0;
pInstance->VC_BalanceMix.MixerStream[1].CallbackSet = 0;
pInstance->VC_BalanceMix.MixerStream[1].pCallbackHandle = pInstance;
pInstance->VC_BalanceMix.MixerStream[1].pCallBack = LVM_VCCallBack;
-#ifdef BUILD_FLOAT
LVC_Mixer_Init(&pInstance->VC_BalanceMix.MixerStream[1], LVM_MAXFLOAT, LVM_MAXFLOAT);
-#else
- LVC_Mixer_Init(&pInstance->VC_BalanceMix.MixerStream[1],LVM_MAXINT_16,LVM_MAXINT_16);
-#endif
LVC_Mixer_VarSlope_SetTimeConstant(&pInstance->VC_BalanceMix.MixerStream[1],LVM_VC_MIXER_TIME,LVM_FS_8000,2);
/*
@@ -770,7 +708,6 @@
(LVM_EQNB_BandDef_t *)InstAlloc_AddMember(&AllocMem[LVM_MEMREGION_PERSISTENT_FAST_DATA],
(pInstParams->EQNB_NumBands * sizeof(LVM_EQNB_BandDef_t)));
-
/*
* Initialise the Concert Sound module
*/
@@ -795,7 +732,6 @@
CS_Capabilities.CallBack = pInstance->CallBack;
CS_Capabilities.pBundleInstance = (void*)pInstance;
-
/*
* Get the memory requirements and then set the address pointers, forcing alignment
*/
@@ -831,7 +767,6 @@
LVDBE_Capabilities_t DBE_Capabilities; /* Initial capabilities */
LVDBE_ReturnStatus_en LVDBE_Status; /* Function call status */
-
/*
* Set the initialisation parameters
*/
@@ -842,12 +777,9 @@
pInstance->DBE_Active = LVM_FALSE;
-
-
/*
* Set the initialisation capabilities
*/
-#if defined(BUILD_FLOAT) && defined(HIGHER_FS)
DBE_Capabilities.SampleRate = LVDBE_CAP_FS_8000 | LVDBE_CAP_FS_11025 |
LVDBE_CAP_FS_12000 | LVDBE_CAP_FS_16000 |
LVDBE_CAP_FS_22050 | LVDBE_CAP_FS_24000 |
@@ -855,13 +787,9 @@
LVDBE_CAP_FS_48000 | LVDBE_CAP_FS_88200 |
LVDBE_CAP_FS_96000 | LVDBE_CAP_FS_176400 |
LVDBE_CAP_FS_192000;
-#else
- DBE_Capabilities.SampleRate = LVDBE_CAP_FS_8000 | LVDBE_CAP_FS_11025 | LVDBE_CAP_FS_12000 | LVDBE_CAP_FS_16000 | LVDBE_CAP_FS_22050 | LVDBE_CAP_FS_24000 | LVDBE_CAP_FS_32000 | LVDBE_CAP_FS_44100 | LVDBE_CAP_FS_48000;
-#endif
DBE_Capabilities.CentreFrequency = LVDBE_CAP_CENTRE_55Hz | LVDBE_CAP_CENTRE_55Hz | LVDBE_CAP_CENTRE_66Hz | LVDBE_CAP_CENTRE_78Hz | LVDBE_CAP_CENTRE_90Hz;
DBE_Capabilities.MaxBlockSize = (LVM_UINT16)InternalBlockSize;
-
/*
* Get the memory requirements and then set the address pointers
*/
@@ -876,7 +804,6 @@
DBE_MemTab.Region[LVDBE_MEMREGION_SCRATCH].pBaseAddress = (void *)InstAlloc_AddMember(&AllocMem[LVM_MEMREGION_TEMPORARY_FAST],
0);
-
/*
* Initialise the Dynamic Bass Enhancement instance and save the instance handle
*/
@@ -888,7 +815,6 @@
pInstance->hDBEInstance = hDBEInstance; /* Save the instance handle */
}
-
/*
* Initialise the N-Band Equaliser module
*/
@@ -898,7 +824,6 @@
LVEQNB_Capabilities_t EQNB_Capabilities; /* Initial capabilities */
LVEQNB_ReturnStatus_en LVEQNB_Status; /* Function call status */
-
/*
* Set the initialisation parameters
*/
@@ -907,11 +832,9 @@
pInstance->Params.pEQNB_BandDefinition = LVM_NULL;
pInstance->EQNB_Active = LVM_FALSE;
-
/*
* Set the initialisation capabilities
*/
-#if defined(BUILD_FLOAT) && defined(HIGHER_FS)
EQNB_Capabilities.SampleRate = LVEQNB_CAP_FS_8000 | LVEQNB_CAP_FS_11025 |
LVEQNB_CAP_FS_12000 | LVEQNB_CAP_FS_16000 |
LVEQNB_CAP_FS_22050 | LVEQNB_CAP_FS_24000 |
@@ -919,16 +842,12 @@
LVEQNB_CAP_FS_48000 | LVEQNB_CAP_FS_88200 |
LVEQNB_CAP_FS_96000 | LVEQNB_CAP_FS_176400 |
LVEQNB_CAP_FS_192000;
-#else
- EQNB_Capabilities.SampleRate = LVEQNB_CAP_FS_8000 | LVEQNB_CAP_FS_11025 | LVEQNB_CAP_FS_12000 | LVEQNB_CAP_FS_16000 | LVEQNB_CAP_FS_22050 | LVEQNB_CAP_FS_24000 | LVEQNB_CAP_FS_32000 | LVEQNB_CAP_FS_44100 | LVEQNB_CAP_FS_48000;
-#endif
EQNB_Capabilities.MaxBlockSize = (LVM_UINT16)InternalBlockSize;
EQNB_Capabilities.MaxBands = pInstParams->EQNB_NumBands;
EQNB_Capabilities.SourceFormat = LVEQNB_CAP_STEREO | LVEQNB_CAP_MONOINSTEREO;
EQNB_Capabilities.CallBack = pInstance->CallBack;
EQNB_Capabilities.pBundleInstance = (void*)pInstance;
-
/*
* Get the memory requirements and then set the address pointers, forcing alignment
*/
@@ -943,7 +862,6 @@
EQNB_MemTab.Region[LVEQNB_MEMREGION_SCRATCH].pBaseAddress = (void *)InstAlloc_AddMember(&AllocMem[LVM_MEMREGION_TEMPORARY_FAST],
0);
-
/*
* Initialise the Dynamic Bass Enhancement instance and save the instance handle
*/
@@ -980,7 +898,6 @@
pInstance->Headroom =0;
}
-
/*
* Initialise the PSA module
*/
@@ -1017,28 +934,20 @@
PSA_MemTab.Region[LVM_PERSISTENT_SLOW_DATA].pBaseAddress = (void *)InstAlloc_AddMember(&AllocMem[LVM_MEMREGION_PERSISTENT_SLOW_DATA],
PSA_MemTab.Region[LVM_PERSISTENT_SLOW_DATA].Size);
-
/* Fast Data */
PSA_MemTab.Region[LVM_PERSISTENT_FAST_DATA].pBaseAddress = (void *)InstAlloc_AddMember(&AllocMem[LVM_MEMREGION_PERSISTENT_FAST_DATA],
PSA_MemTab.Region[LVM_PERSISTENT_FAST_DATA].Size);
-
/* Fast Coef */
PSA_MemTab.Region[LVM_PERSISTENT_FAST_COEF].pBaseAddress = (void *)InstAlloc_AddMember(&AllocMem[LVM_MEMREGION_PERSISTENT_FAST_COEF],
PSA_MemTab.Region[LVM_PERSISTENT_FAST_COEF].Size);
/* Fast Temporary */
-#ifdef BUILD_FLOAT
pInstance->pPSAInput = (LVM_FLOAT *)InstAlloc_AddMember(&AllocMem[LVM_TEMPORARY_FAST],
(LVM_UINT32) MAX_INTERNAL_BLOCKSIZE * \
sizeof(LVM_FLOAT));
-#else
- pInstance->pPSAInput = InstAlloc_AddMember(&AllocMem[LVM_TEMPORARY_FAST],
- (LVM_UINT32) MAX_INTERNAL_BLOCKSIZE * sizeof(LVM_INT16));
-#endif
PSA_MemTab.Region[LVM_TEMPORARY_FAST].pBaseAddress = (void *)InstAlloc_AddMember(&AllocMem[LVM_MEMREGION_TEMPORARY_FAST],0);
-
/*Initialise PSA instance and save the instance handle*/
pInstance->PSA_ControlParams.Fs = LVM_FS_48000;
pInstance->PSA_ControlParams.LevelDetectionSpeed = LVPSA_SPEED_MEDIUM;
@@ -1073,7 +982,6 @@
*/
pInstance->NewParams = pInstance->Params;
-
/*
* Create configuration number
*/
@@ -1100,7 +1008,6 @@
return(Status);
}
-
/****************************************************************************************/
/* */
/* FUNCTION: LVM_ClearAudioBuffers */
@@ -1128,7 +1035,6 @@
LVM_Instance_t *pInstance = (LVM_Instance_t *)hInstance; /* Pointer to Instance */
LVM_HeadroomParams_t HeadroomParams;
-
if(hInstance == LVM_NULL){
return LVM_NULLADDRESS;
}
@@ -1166,5 +1072,3 @@
return LVM_SUCCESS;
}
-
-
diff --git a/media/libeffects/lvm/lib/Bundle/src/LVM_Private.h b/media/libeffects/lvm/lib/Bundle/src/LVM_Private.h
index 2bae702..ddaac99 100644
--- a/media/libeffects/lvm/lib/Bundle/src/LVM_Private.h
+++ b/media/libeffects/lvm/lib/Bundle/src/LVM_Private.h
@@ -27,8 +27,6 @@
#ifndef __LVM_PRIVATE_H__
#define __LVM_PRIVATE_H__
-
-
/************************************************************************************/
/* */
/* Includes */
@@ -44,7 +42,6 @@
#include "LVEQNB_Private.h" /* N-Band equaliser */
#include "LVPSA_Private.h" /* Parametric Spectrum Analyzer */
-
/************************************************************************************/
/* */
/* Defines */
@@ -110,7 +107,6 @@
#define LVM_TE_MASK 32
#define LVM_PSA_MASK 2048
-
/************************************************************************************/
/* */
/* Structures */
@@ -126,16 +122,13 @@
void *pBaseAddress; /* Pointer to the region base address */
} LVM_IntMemoryRegion_t;
-
/* Memory table containing the region definitions */
typedef struct
{
LVM_IntMemoryRegion_t Region[LVM_NR_MEMORY_REGIONS]; /* One definition for each region */
} LVM_IntMemTab_t;
-
/* Buffer Management */
-#ifdef BUILD_FLOAT
typedef struct
{
LVM_FLOAT *pScratch; /* Bundle scratch buffer */
@@ -158,39 +151,17 @@
left and right */
LVM_INT16 SamplesToOutput; /* Samples to write to the output */
} LVM_Buffer_t;
-#else
-typedef struct
-{
- LVM_INT16 *pScratch; /* Bundle scratch buffer */
-
- LVM_INT16 BufferState; /* Buffer status */
- LVM_INT16 InDelayBuffer[6*MIN_INTERNAL_BLOCKSIZE]; /* Input buffer delay line, left and right */
- LVM_INT16 InDelaySamples; /* Number of samples in the input delay buffer */
-
- LVM_INT16 OutDelayBuffer[2*MIN_INTERNAL_BLOCKSIZE]; /* Output buffer delay line */
- LVM_INT16 OutDelaySamples; /* Number of samples in the output delay buffer, left and right */
- LVM_INT16 SamplesToOutput; /* Samples to write to the output */
-} LVM_Buffer_t;
-#endif
/* Filter taps */
typedef struct
{
-#ifdef BUILD_FLOAT
Biquad_2I_Order1_FLOAT_Taps_t TrebleBoost_Taps; /* Treble boost Taps */
-#else
- Biquad_2I_Order1_Taps_t TrebleBoost_Taps; /* Treble boost Taps */
-#endif
} LVM_TE_Data_t;
/* Coefficients */
typedef struct
{
-#ifdef BUILD_FLOAT
Biquad_FLOAT_Instance_t TrebleBoost_State; /* State for the treble boost filter */
-#else
- Biquad_Instance_t TrebleBoost_State; /* State for the treble boost filter */
-#endif
} LVM_TE_Coefs_t;
typedef struct
@@ -208,24 +179,15 @@
LVM_INT16 InternalBlockSize; /* Maximum internal block size */
LVM_Buffer_t *pBufferManagement; /* Buffer management variables */
LVM_INT16 SamplesToProcess; /* Input samples left to process */
-#ifdef BUILD_FLOAT
LVM_FLOAT *pInputSamples; /* External input sample pointer */
LVM_FLOAT *pOutputSamples; /* External output sample pointer */
-#else
- LVM_INT16 *pInputSamples; /* External input sample pointer */
- LVM_INT16 *pOutputSamples; /* External output sample pointer */
-#endif
/* Configuration number */
LVM_INT32 ConfigurationNumber;
LVM_INT32 BlickSizeMultiple;
/* DC removal */
-#ifdef BUILD_FLOAT
Biquad_FLOAT_Instance_t DC_RemovalInstance; /* DC removal filter instance */
-#else
- Biquad_Instance_t DC_RemovalInstance; /* DC removal filter instance */
-#endif
/* Concert Sound */
LVCS_Handle_t hCSInstance; /* Concert Sound instance handle */
@@ -245,16 +207,8 @@
LVM_INT16 DBE_Active; /* Control flag */
/* Volume Control */
-#ifdef BUILD_FLOAT
LVMixer3_1St_FLOAT_st VC_Volume; /* Volume scaler */
-#else
- LVMixer3_1St_st VC_Volume; /* Volume scaler */
-#endif
-#ifdef BUILD_FLOAT
LVMixer3_2St_FLOAT_st VC_BalanceMix; /* VC balance mixer */
-#else
- LVMixer3_2St_st VC_BalanceMix; /* VC balance mixer */
-#endif
LVM_INT16 VC_VolumedB; /* Gain in dB */
LVM_INT16 VC_Active; /* Control flag */
LVM_INT16 VC_AVLFixedVolume; /* AVL fixed volume */
@@ -278,11 +232,7 @@
LVPSA_ControlParams_t PSA_ControlParams; /* Spectrum Analyzer control parameters */
LVM_INT16 PSA_GainOffset; /* Tone control flag */
LVM_Callback CallBack;
-#ifdef BUILD_FLOAT
LVM_FLOAT *pPSAInput; /* PSA input pointer */
-#else
- LVM_INT16 *pPSAInput; /* PSA input pointer */
-#endif
LVM_INT16 NoSmoothVolume; /* Enable or disable smooth volume changes*/
@@ -293,7 +243,6 @@
} LVM_Instance_t;
-
/************************************************************************************/
/* */
/* Function Prototypes */
@@ -314,33 +263,18 @@
void LVM_SetHeadroom( LVM_Instance_t *pInstance,
LVM_ControlParams_t *pParams);
-#ifdef BUILD_FLOAT
void LVM_BufferIn( LVM_Handle_t hInstance,
const LVM_FLOAT *pInData,
LVM_FLOAT **pToProcess,
LVM_FLOAT **pProcessed,
LVM_UINT16 *pNumSamples);
-#else
-void LVM_BufferIn( LVM_Handle_t hInstance,
- const LVM_INT16 *pInData,
- LVM_INT16 **pToProcess,
- LVM_INT16 **pProcessed,
- LVM_UINT16 *pNumSamples);
-#endif
-#ifdef BUILD_FLOAT
void LVM_BufferOut( LVM_Handle_t hInstance,
LVM_FLOAT *pOutData,
LVM_UINT16 *pNumSamples);
-#else
-void LVM_BufferOut( LVM_Handle_t hInstance,
- LVM_INT16 *pOutData,
- LVM_UINT16 *pNumSamples);
-#endif
LVM_INT32 LVM_AlgoCallBack( void *pBundleHandle,
void *pData,
LVM_INT16 callbackId);
-
#endif /* __LVM_PRIVATE_H__ */
diff --git a/media/libeffects/lvm/lib/Bundle/src/LVM_Process.cpp b/media/libeffects/lvm/lib/Bundle/src/LVM_Process.cpp
index bc666a9..dc86cfd 100644
--- a/media/libeffects/lvm/lib/Bundle/src/LVM_Process.cpp
+++ b/media/libeffects/lvm/lib/Bundle/src/LVM_Process.cpp
@@ -15,7 +15,6 @@
* limitations under the License.
*/
-
/****************************************************************************************/
/* */
/* Includes */
@@ -52,7 +51,6 @@
/* NOTES: */
/* */
/****************************************************************************************/
-#ifdef BUILD_FLOAT
LVM_ReturnStatus_en LVM_Process(LVM_Handle_t hInstance,
const LVM_FLOAT *pInData,
LVM_FLOAT *pOutData,
@@ -80,7 +78,6 @@
return(LVM_SUCCESS);
}
-
/*
* Check valid points have been given
*/
@@ -111,7 +108,6 @@
}
}
-
/*
* Update new parameters if necessary
*/
@@ -130,7 +126,6 @@
}
}
-
/*
* Convert from Mono if necessary
*/
@@ -147,7 +142,6 @@
#endif
}
-
/*
* Process the data with managed buffers
*/
@@ -333,226 +327,3 @@
return(LVM_SUCCESS);
}
-#else
-LVM_ReturnStatus_en LVM_Process(LVM_Handle_t hInstance,
- const LVM_INT16 *pInData,
- LVM_INT16 *pOutData,
- LVM_UINT16 NumSamples,
- LVM_UINT32 AudioTime)
-{
-
- LVM_Instance_t *pInstance = (LVM_Instance_t *)hInstance;
- LVM_UINT16 SampleCount = NumSamples;
- LVM_INT16 *pInput = (LVM_INT16 *)pInData;
- LVM_INT16 *pToProcess = (LVM_INT16 *)pInData;
- LVM_INT16 *pProcessed = pOutData;
- LVM_ReturnStatus_en Status;
-
- /*
- * Check if the number of samples is zero
- */
- if (NumSamples == 0)
- {
- return(LVM_SUCCESS);
- }
-
-
- /*
- * Check valid points have been given
- */
- if ((hInstance == LVM_NULL) || (pInData == LVM_NULL) || (pOutData == LVM_NULL))
- {
- return (LVM_NULLADDRESS);
- }
-
- /*
- * For unmanaged mode only
- */
- if(pInstance->InstParams.BufferMode == LVM_UNMANAGED_BUFFERS)
- {
- /*
- * Check if the number of samples is a good multiple (unmanaged mode only)
- */
- if((NumSamples % pInstance->BlickSizeMultiple) != 0)
- {
- return(LVM_INVALIDNUMSAMPLES);
- }
-
- /*
- * Check the buffer alignment
- */
- if((((uintptr_t)pInData % 4) != 0) || (((uintptr_t)pOutData % 4) != 0))
- {
- return(LVM_ALIGNMENTERROR);
- }
- }
-
-
- /*
- * Update new parameters if necessary
- */
- if (pInstance->ControlPending == LVM_TRUE)
- {
- Status = LVM_ApplyNewSettings(hInstance);
-
- if(Status != LVM_SUCCESS)
- {
- return Status;
- }
- }
-
-
- /*
- * Convert from Mono if necessary
- */
- if (pInstance->Params.SourceFormat == LVM_MONO)
- {
- MonoTo2I_16(pInData, /* Source */
- pOutData, /* Destination */
- (LVM_INT16)NumSamples); /* Number of input samples */
- pInput = pOutData;
- pToProcess = pOutData;
- }
-
-
- /*
- * Process the data with managed buffers
- */
- while (SampleCount != 0)
- {
- /*
- * Manage the input buffer and frame processing
- */
- LVM_BufferIn(hInstance,
- pInput,
- &pToProcess,
- &pProcessed,
- &SampleCount);
-
- /*
- * Only process data when SampleCount is none zero, a zero count can occur when
- * the BufferIn routine is working in managed mode.
- */
- if (SampleCount != 0)
- {
-
- /*
- * Apply ConcertSound if required
- */
- if (pInstance->CS_Active == LVM_TRUE)
- {
- (void)LVCS_Process(pInstance->hCSInstance, /* Concert Sound instance handle */
- pToProcess,
- pProcessed,
- SampleCount);
- pToProcess = pProcessed;
- }
-
- /*
- * Apply volume if required
- */
- if (pInstance->VC_Active!=0)
- {
- LVC_MixSoft_1St_D16C31_SAT(&pInstance->VC_Volume,
- pToProcess,
- pProcessed,
- (LVM_INT16)(2*SampleCount)); /* Left and right*/
- pToProcess = pProcessed;
- }
-
- /*
- * Call N-Band equaliser if enabled
- */
- if (pInstance->EQNB_Active == LVM_TRUE)
- {
- LVEQNB_Process(pInstance->hEQNBInstance, /* N-Band equaliser instance handle */
- pToProcess,
- pProcessed,
- SampleCount);
- pToProcess = pProcessed;
- }
-
- /*
- * Call bass enhancement if enabled
- */
- if (pInstance->DBE_Active == LVM_TRUE)
- {
- LVDBE_Process(pInstance->hDBEInstance, /* Dynamic Bass Enhancement instance handle */
- pToProcess,
- pProcessed,
- SampleCount);
- pToProcess = pProcessed;
- }
-
- /*
- * Bypass mode or everything off, so copy the input to the output
- */
- if (pToProcess != pProcessed)
- {
- Copy_16(pToProcess, /* Source */
- pProcessed, /* Destination */
- (LVM_INT16)(2*SampleCount)); /* Left and right */
- }
-
- /*
- * Apply treble boost if required
- */
- if (pInstance->TE_Active == LVM_TRUE)
- {
- /*
- * Apply the filter
- */
- FO_2I_D16F32C15_LShx_TRC_WRA_01(&pInstance->pTE_State->TrebleBoost_State,
- pProcessed,
- pProcessed,
- (LVM_INT16)SampleCount);
-
- }
-
- /*
- * Volume balance
- */
- LVC_MixSoft_1St_2i_D16C31_SAT(&pInstance->VC_BalanceMix,
- pProcessed,
- pProcessed,
- SampleCount);
-
- /*
- * Perform Parametric Spectum Analysis
- */
- if ((pInstance->Params.PSA_Enable == LVM_PSA_ON)&&(pInstance->InstParams.PSA_Included==LVM_PSA_ON))
- {
- From2iToMono_16(pProcessed,
- pInstance->pPSAInput,
- (LVM_INT16) (SampleCount));
-
- LVPSA_Process(pInstance->hPSAInstance,
- pInstance->pPSAInput,
- (LVM_UINT16) (SampleCount),
- AudioTime);
- }
-
-
- /*
- * DC removal
- */
- DC_2I_D16_TRC_WRA_01(&pInstance->DC_RemovalInstance,
- pProcessed,
- pProcessed,
- (LVM_INT16)SampleCount);
-
-
- }
-
- /*
- * Manage the output buffer
- */
- LVM_BufferOut(hInstance,
- pOutData,
- &SampleCount);
-
- }
-
- return(LVM_SUCCESS);
-}
-#endif
diff --git a/media/libeffects/lvm/lib/Bundle/src/LVM_Tables.cpp b/media/libeffects/lvm/lib/Bundle/src/LVM_Tables.cpp
index a5356d2..66392e2 100644
--- a/media/libeffects/lvm/lib/Bundle/src/LVM_Tables.cpp
+++ b/media/libeffects/lvm/lib/Bundle/src/LVM_Tables.cpp
@@ -29,7 +29,6 @@
/* Treble Boost Filter Coefficients */
/* */
/************************************************************************************/
-#ifdef BUILD_FLOAT
FO_FLOAT_LShx_Coefs_t LVM_TrebleBoostCoefs[] = {
@@ -267,7 +266,6 @@
{HPF_Fs48000_Gain15_A1, /* Gain setting 15 */
HPF_Fs48000_Gain15_A0,
-HPF_Fs48000_Gain15_B1}
-#ifdef HIGHER_FS
,
/* 88kHz Sampling rate */
{HPF_Fs88200_Gain1_A1, /* Gain Setting 1 */
@@ -456,322 +454,7 @@
{HPF_Fs192000_Gain15_A1, /* Gain setting 15 */
HPF_Fs192000_Gain15_A0,
-HPF_Fs192000_Gain15_B1}
-#endif
};
-#else
-FO_C16_LShx_Coefs_t LVM_TrebleBoostCoefs[] = {
-
- /* 22kHz sampling rate */
- {HPF_Fs22050_Gain1_A1, /* Gain setting 1 */
- HPF_Fs22050_Gain1_A0,
- -HPF_Fs22050_Gain1_B1,
- HPF_Fs22050_Gain1_Shift},
- {HPF_Fs22050_Gain2_A1, /* Gain setting 2 */
- HPF_Fs22050_Gain2_A0,
- -HPF_Fs22050_Gain2_B1,
- HPF_Fs22050_Gain2_Shift},
- {HPF_Fs22050_Gain3_A1, /* Gain setting 3 */
- HPF_Fs22050_Gain3_A0,
- -HPF_Fs22050_Gain3_B1,
- HPF_Fs22050_Gain3_Shift},
- {HPF_Fs22050_Gain4_A1, /* Gain setting 4 */
- HPF_Fs22050_Gain4_A0,
- -HPF_Fs22050_Gain4_B1,
- HPF_Fs22050_Gain4_Shift},
- {HPF_Fs22050_Gain5_A1, /* Gain setting 5 */
- HPF_Fs22050_Gain5_A0,
- -HPF_Fs22050_Gain5_B1,
- HPF_Fs22050_Gain5_Shift},
- {HPF_Fs22050_Gain6_A1, /* Gain setting 6 */
- HPF_Fs22050_Gain6_A0,
- -HPF_Fs22050_Gain6_B1,
- HPF_Fs22050_Gain6_Shift},
- {HPF_Fs22050_Gain7_A1, /* Gain setting 7 */
- HPF_Fs22050_Gain7_A0,
- -HPF_Fs22050_Gain7_B1,
- HPF_Fs22050_Gain7_Shift},
- {HPF_Fs22050_Gain8_A1, /* Gain setting 8 */
- HPF_Fs22050_Gain8_A0,
- -HPF_Fs22050_Gain8_B1,
- HPF_Fs22050_Gain8_Shift},
- {HPF_Fs22050_Gain9_A1, /* Gain setting 9 */
- HPF_Fs22050_Gain9_A0,
- -HPF_Fs22050_Gain9_B1,
- HPF_Fs22050_Gain9_Shift},
- {HPF_Fs22050_Gain10_A1, /* Gain setting 10 */
- HPF_Fs22050_Gain10_A0,
- -HPF_Fs22050_Gain10_B1,
- HPF_Fs22050_Gain10_Shift},
- {HPF_Fs22050_Gain11_A1, /* Gain setting 11 */
- HPF_Fs22050_Gain11_A0,
- -HPF_Fs22050_Gain11_B1,
- HPF_Fs22050_Gain11_Shift},
- {HPF_Fs22050_Gain12_A1, /* Gain setting 12 */
- HPF_Fs22050_Gain12_A0,
- -HPF_Fs22050_Gain12_B1,
- HPF_Fs22050_Gain12_Shift},
- {HPF_Fs22050_Gain13_A1, /* Gain setting 13 */
- HPF_Fs22050_Gain13_A0,
- -HPF_Fs22050_Gain13_B1,
- HPF_Fs22050_Gain13_Shift},
- {HPF_Fs22050_Gain14_A1, /* Gain setting 14 */
- HPF_Fs22050_Gain14_A0,
- -HPF_Fs22050_Gain14_B1,
- HPF_Fs22050_Gain14_Shift},
- {HPF_Fs22050_Gain15_A1, /* Gain setting 15 */
- HPF_Fs22050_Gain15_A0,
- -HPF_Fs22050_Gain15_B1,
- HPF_Fs22050_Gain15_Shift},
-
- /* 24kHz sampling rate */
- {HPF_Fs24000_Gain1_A1, /* Gain setting 1 */
- HPF_Fs24000_Gain1_A0,
- -HPF_Fs24000_Gain1_B1,
- HPF_Fs24000_Gain1_Shift},
- {HPF_Fs24000_Gain2_A1, /* Gain setting 2 */
- HPF_Fs24000_Gain2_A0,
- -HPF_Fs24000_Gain2_B1,
- HPF_Fs24000_Gain2_Shift},
- {HPF_Fs24000_Gain3_A1, /* Gain setting 3 */
- HPF_Fs24000_Gain3_A0,
- -HPF_Fs24000_Gain3_B1,
- HPF_Fs24000_Gain3_Shift},
- {HPF_Fs24000_Gain4_A1, /* Gain setting 4 */
- HPF_Fs24000_Gain4_A0,
- -HPF_Fs24000_Gain4_B1,
- HPF_Fs24000_Gain4_Shift},
- {HPF_Fs24000_Gain5_A1, /* Gain setting 5 */
- HPF_Fs24000_Gain5_A0,
- -HPF_Fs24000_Gain5_B1,
- HPF_Fs24000_Gain5_Shift},
- {HPF_Fs24000_Gain6_A1, /* Gain setting 6 */
- HPF_Fs24000_Gain6_A0,
- -HPF_Fs24000_Gain6_B1,
- HPF_Fs24000_Gain6_Shift},
- {HPF_Fs24000_Gain7_A1, /* Gain setting 7 */
- HPF_Fs24000_Gain7_A0,
- -HPF_Fs24000_Gain7_B1,
- HPF_Fs24000_Gain7_Shift},
- {HPF_Fs24000_Gain8_A1, /* Gain setting 8 */
- HPF_Fs24000_Gain8_A0,
- -HPF_Fs24000_Gain8_B1,
- HPF_Fs24000_Gain8_Shift},
- {HPF_Fs24000_Gain9_A1, /* Gain setting 9 */
- HPF_Fs24000_Gain9_A0,
- -HPF_Fs24000_Gain9_B1,
- HPF_Fs24000_Gain9_Shift},
- {HPF_Fs24000_Gain10_A1, /* Gain setting 10 */
- HPF_Fs24000_Gain10_A0,
- -HPF_Fs24000_Gain10_B1,
- HPF_Fs24000_Gain10_Shift},
- {HPF_Fs24000_Gain11_A1, /* Gain setting 11 */
- HPF_Fs24000_Gain11_A0,
- -HPF_Fs24000_Gain11_B1,
- HPF_Fs24000_Gain11_Shift},
- {HPF_Fs24000_Gain12_A1, /* Gain setting 12 */
- HPF_Fs24000_Gain12_A0,
- -HPF_Fs24000_Gain12_B1,
- HPF_Fs24000_Gain12_Shift},
- {HPF_Fs24000_Gain13_A1, /* Gain setting 13 */
- HPF_Fs24000_Gain13_A0,
- -HPF_Fs24000_Gain13_B1,
- HPF_Fs24000_Gain13_Shift},
- {HPF_Fs24000_Gain14_A1, /* Gain setting 14 */
- HPF_Fs24000_Gain14_A0,
- -HPF_Fs24000_Gain14_B1,
- HPF_Fs24000_Gain14_Shift},
- {HPF_Fs24000_Gain15_A1, /* Gain setting 15 */
- HPF_Fs24000_Gain15_A0,
- -HPF_Fs24000_Gain15_B1,
- HPF_Fs24000_Gain15_Shift},
-
- /* 32kHz sampling rate */
- {HPF_Fs32000_Gain1_A1, /* Gain setting 1 */
- HPF_Fs32000_Gain1_A0,
- -HPF_Fs32000_Gain1_B1,
- HPF_Fs32000_Gain1_Shift},
- {HPF_Fs32000_Gain2_A1, /* Gain setting 2 */
- HPF_Fs32000_Gain2_A0,
- -HPF_Fs32000_Gain2_B1,
- HPF_Fs32000_Gain2_Shift},
- {HPF_Fs32000_Gain3_A1, /* Gain setting 3 */
- HPF_Fs32000_Gain3_A0,
- -HPF_Fs32000_Gain3_B1,
- HPF_Fs32000_Gain3_Shift},
- {HPF_Fs32000_Gain4_A1, /* Gain setting 4 */
- HPF_Fs32000_Gain4_A0,
- -HPF_Fs32000_Gain4_B1,
- HPF_Fs32000_Gain4_Shift},
- {HPF_Fs32000_Gain5_A1, /* Gain setting 5 */
- HPF_Fs32000_Gain5_A0,
- -HPF_Fs32000_Gain5_B1,
- HPF_Fs32000_Gain5_Shift},
- {HPF_Fs32000_Gain6_A1, /* Gain setting 6 */
- HPF_Fs32000_Gain6_A0,
- -HPF_Fs32000_Gain6_B1,
- HPF_Fs32000_Gain6_Shift},
- {HPF_Fs32000_Gain7_A1, /* Gain setting 7 */
- HPF_Fs32000_Gain7_A0,
- -HPF_Fs32000_Gain7_B1,
- HPF_Fs32000_Gain7_Shift},
- {HPF_Fs32000_Gain8_A1, /* Gain setting 8 */
- HPF_Fs32000_Gain8_A0,
- -HPF_Fs32000_Gain8_B1,
- HPF_Fs32000_Gain8_Shift},
- {HPF_Fs32000_Gain9_A1, /* Gain setting 9 */
- HPF_Fs32000_Gain9_A0,
- -HPF_Fs32000_Gain9_B1,
- HPF_Fs32000_Gain9_Shift},
- {HPF_Fs32000_Gain10_A1, /* Gain setting 10 */
- HPF_Fs32000_Gain10_A0,
- -HPF_Fs32000_Gain10_B1,
- HPF_Fs32000_Gain10_Shift},
- {HPF_Fs32000_Gain11_A1, /* Gain setting 11 */
- HPF_Fs32000_Gain11_A0,
- -HPF_Fs32000_Gain11_B1,
- HPF_Fs32000_Gain11_Shift},
- {HPF_Fs32000_Gain12_A1, /* Gain setting 12 */
- HPF_Fs32000_Gain12_A0,
- -HPF_Fs32000_Gain12_B1,
- HPF_Fs32000_Gain12_Shift},
- {HPF_Fs32000_Gain13_A1, /* Gain setting 13 */
- HPF_Fs32000_Gain13_A0,
- -HPF_Fs32000_Gain13_B1,
- HPF_Fs32000_Gain13_Shift},
- {HPF_Fs32000_Gain14_A1, /* Gain setting 14 */
- HPF_Fs32000_Gain14_A0,
- -HPF_Fs32000_Gain14_B1,
- HPF_Fs32000_Gain14_Shift},
- {HPF_Fs32000_Gain15_A1, /* Gain setting 15 */
- HPF_Fs32000_Gain15_A0,
- -HPF_Fs32000_Gain15_B1,
- HPF_Fs32000_Gain15_Shift},
-
- /* 44kHz sampling rate */
- {HPF_Fs44100_Gain1_A1, /* Gain setting 1 */
- HPF_Fs44100_Gain1_A0,
- -HPF_Fs44100_Gain1_B1,
- HPF_Fs44100_Gain1_Shift},
- {HPF_Fs44100_Gain2_A1, /* Gain setting 2 */
- HPF_Fs44100_Gain2_A0,
- -HPF_Fs44100_Gain2_B1,
- HPF_Fs44100_Gain2_Shift},
- {HPF_Fs44100_Gain3_A1, /* Gain setting 3 */
- HPF_Fs44100_Gain3_A0,
- -HPF_Fs44100_Gain3_B1,
- HPF_Fs44100_Gain3_Shift},
- {HPF_Fs44100_Gain4_A1, /* Gain setting 4 */
- HPF_Fs44100_Gain4_A0,
- -HPF_Fs44100_Gain4_B1,
- HPF_Fs44100_Gain4_Shift},
- {HPF_Fs44100_Gain5_A1, /* Gain setting 5 */
- HPF_Fs44100_Gain5_A0,
- -HPF_Fs44100_Gain5_B1,
- HPF_Fs44100_Gain5_Shift},
- {HPF_Fs44100_Gain6_A1, /* Gain setting 6 */
- HPF_Fs44100_Gain6_A0,
- -HPF_Fs44100_Gain6_B1,
- HPF_Fs44100_Gain6_Shift},
- {HPF_Fs44100_Gain7_A1, /* Gain setting 7 */
- HPF_Fs44100_Gain7_A0,
- -HPF_Fs44100_Gain7_B1,
- HPF_Fs44100_Gain7_Shift},
- {HPF_Fs44100_Gain8_A1, /* Gain setting 8 */
- HPF_Fs44100_Gain8_A0,
- -HPF_Fs44100_Gain8_B1,
- HPF_Fs44100_Gain8_Shift},
- {HPF_Fs44100_Gain9_A1, /* Gain setting 9 */
- HPF_Fs44100_Gain9_A0,
- -HPF_Fs44100_Gain9_B1,
- HPF_Fs44100_Gain9_Shift},
- {HPF_Fs44100_Gain10_A1, /* Gain setting 10 */
- HPF_Fs44100_Gain10_A0,
- -HPF_Fs44100_Gain10_B1,
- HPF_Fs44100_Gain10_Shift},
- {HPF_Fs44100_Gain11_A1, /* Gain setting 11 */
- HPF_Fs44100_Gain11_A0,
- -HPF_Fs44100_Gain11_B1,
- HPF_Fs44100_Gain11_Shift},
- {HPF_Fs44100_Gain12_A1, /* Gain setting 12 */
- HPF_Fs44100_Gain12_A0,
- -HPF_Fs44100_Gain12_B1,
- HPF_Fs44100_Gain12_Shift},
- {HPF_Fs44100_Gain13_A1, /* Gain setting 13 */
- HPF_Fs44100_Gain13_A0,
- -HPF_Fs44100_Gain13_B1,
- HPF_Fs44100_Gain13_Shift},
- {HPF_Fs44100_Gain14_A1, /* Gain setting 14 */
- HPF_Fs44100_Gain14_A0,
- -HPF_Fs44100_Gain14_B1,
- HPF_Fs44100_Gain14_Shift},
- {HPF_Fs44100_Gain15_A1, /* Gain setting 15 */
- HPF_Fs44100_Gain15_A0,
- -HPF_Fs44100_Gain15_B1,
- HPF_Fs44100_Gain15_Shift},
-
- /* 48kHz sampling rate */
- {HPF_Fs48000_Gain1_A1, /* Gain setting 1 */
- HPF_Fs48000_Gain1_A0,
- -HPF_Fs48000_Gain1_B1,
- HPF_Fs48000_Gain1_Shift},
- {HPF_Fs48000_Gain2_A1, /* Gain setting 2 */
- HPF_Fs48000_Gain2_A0,
- -HPF_Fs48000_Gain2_B1,
- HPF_Fs48000_Gain2_Shift},
- {HPF_Fs48000_Gain3_A1, /* Gain setting 3 */
- HPF_Fs48000_Gain3_A0,
- -HPF_Fs48000_Gain3_B1,
- HPF_Fs48000_Gain3_Shift},
- {HPF_Fs48000_Gain4_A1, /* Gain setting 4 */
- HPF_Fs48000_Gain4_A0,
- -HPF_Fs48000_Gain4_B1,
- HPF_Fs48000_Gain4_Shift},
- {HPF_Fs48000_Gain5_A1, /* Gain setting 5 */
- HPF_Fs48000_Gain5_A0,
- -HPF_Fs48000_Gain5_B1,
- HPF_Fs48000_Gain5_Shift},
- {HPF_Fs48000_Gain6_A1, /* Gain setting 6 */
- HPF_Fs48000_Gain6_A0,
- -HPF_Fs48000_Gain6_B1,
- HPF_Fs48000_Gain6_Shift},
- {HPF_Fs48000_Gain7_A1, /* Gain setting 7 */
- HPF_Fs48000_Gain7_A0,
- -HPF_Fs48000_Gain7_B1,
- HPF_Fs48000_Gain7_Shift},
- {HPF_Fs48000_Gain8_A1, /* Gain setting 8 */
- HPF_Fs48000_Gain8_A0,
- -HPF_Fs48000_Gain8_B1,
- HPF_Fs48000_Gain8_Shift},
- {HPF_Fs48000_Gain9_A1, /* Gain setting 9 */
- HPF_Fs48000_Gain9_A0,
- -HPF_Fs48000_Gain9_B1,
- HPF_Fs48000_Gain9_Shift},
- {HPF_Fs48000_Gain10_A1, /* Gain setting 10 */
- HPF_Fs48000_Gain10_A0,
- -HPF_Fs48000_Gain10_B1,
- HPF_Fs48000_Gain10_Shift},
- {HPF_Fs48000_Gain11_A1, /* Gain setting 11 */
- HPF_Fs48000_Gain11_A0,
- -HPF_Fs48000_Gain11_B1,
- HPF_Fs48000_Gain11_Shift},
- {HPF_Fs48000_Gain12_A1, /* Gain setting 12 */
- HPF_Fs48000_Gain12_A0,
- -HPF_Fs48000_Gain12_B1,
- HPF_Fs48000_Gain12_Shift},
- {HPF_Fs48000_Gain13_A1, /* Gain setting 13 */
- HPF_Fs48000_Gain13_A0,
- -HPF_Fs48000_Gain13_B1,
- HPF_Fs48000_Gain13_Shift},
- {HPF_Fs48000_Gain14_A1, /* Gain setting 14 */
- HPF_Fs48000_Gain14_A0,
- -HPF_Fs48000_Gain14_B1,
- HPF_Fs48000_Gain14_Shift},
- {HPF_Fs48000_Gain15_A1, /* Gain setting 15 */
- HPF_Fs48000_Gain15_A0,
- -HPF_Fs48000_Gain15_B1,
- HPF_Fs48000_Gain15_Shift}
- };
-#endif
/************************************************************************************/
/* */
@@ -780,7 +463,6 @@
/************************************************************************************/
/* dB to linear conversion table */
-#ifdef BUILD_FLOAT
const LVM_FLOAT LVM_VolumeTable[] = {
1.000f, /* 0dB */
0.891f, /* -1dB */
@@ -789,16 +471,6 @@
0.631f, /* -4dB */
0.562f, /* -5dB */
0.501f}; /* -6dB */
-#else
-const LVM_INT16 LVM_VolumeTable[] = {
- 0x7FFF, /* 0dB */
- 0x7215, /* -1dB */
- 0x65AD, /* -2dB */
- 0x5A9E, /* -3dB */
- 0x50C3, /* -4dB */
- 0x47FB, /* -5dB */
- 0x4000}; /* -6dB */
-#endif
/************************************************************************************/
/* */
@@ -816,7 +488,6 @@
#define LVM_MIX_TC_Fs44100 32734 /* Floating point value 0.998962402 */
#define LVM_MIX_TC_Fs48000 32737 /* Floating point value 0.999053955 */
-
const LVM_INT16 LVM_MixerTCTable[] = {
LVM_MIX_TC_Fs8000,
LVM_MIX_TC_Fs11025,
diff --git a/media/libeffects/lvm/lib/Bundle/src/LVM_Tables.h b/media/libeffects/lvm/lib/Bundle/src/LVM_Tables.h
index 3fd2f89..fc82194 100644
--- a/media/libeffects/lvm/lib/Bundle/src/LVM_Tables.h
+++ b/media/libeffects/lvm/lib/Bundle/src/LVM_Tables.h
@@ -18,7 +18,6 @@
#ifndef __LVM_TABLES_H__
#define __LVM_TABLES_H__
-
/************************************************************************************/
/* */
/* Includes */
@@ -34,27 +33,16 @@
/* */
/************************************************************************************/
-#ifdef BUILD_FLOAT
extern FO_FLOAT_LShx_Coefs_t LVM_TrebleBoostCoefs[];
-#else
-extern FO_C16_LShx_Coefs_t LVM_TrebleBoostCoefs[];
-#endif
/************************************************************************************/
/* */
/* Volume control gain and time constant tables */
/* */
/************************************************************************************/
-#ifdef BUILD_FLOAT
extern const LVM_FLOAT LVM_VolumeTable[];
-#else
-extern const LVM_INT16 LVM_VolumeTable[];
-#endif
extern const LVM_INT16 LVM_MixerTCTable[];
-
-
#endif /* __LVM_TABLES_H__ */
-
diff --git a/media/libeffects/lvm/lib/Common/lib/AGC.h b/media/libeffects/lvm/lib/Common/lib/AGC.h
index f75d983..bef7fa1 100644
--- a/media/libeffects/lvm/lib/Common/lib/AGC.h
+++ b/media/libeffects/lvm/lib/Common/lib/AGC.h
@@ -18,8 +18,6 @@
#ifndef __AGC_H__
#define __AGC_H__
-
-
/**********************************************************************************/
/* */
/* Includes */
@@ -28,28 +26,11 @@
#include "LVM_Types.h"
-
/**********************************************************************************/
/* */
/* Types */
/* */
/**********************************************************************************/
-#ifndef BUILD_FLOAT
-typedef struct
-{
- LVM_INT32 AGC_Gain; /* The current AGC gain */
- LVM_INT32 AGC_MaxGain; /* The maximum AGC gain */
- LVM_INT32 Volume; /* The current volume setting */
- LVM_INT32 Target; /* The target volume setting */
- LVM_INT32 AGC_Target; /* AGC target level */
- LVM_INT16 AGC_Attack; /* AGC attack scaler */
- LVM_INT16 AGC_Decay; /* AGC decay scaler */
- LVM_INT16 AGC_GainShift; /* The gain shift */
- LVM_INT16 VolumeShift; /* Volume shift scaling */
- LVM_INT16 VolumeTC; /* Volume update time constant */
-
-} AGC_MIX_VOL_2St1Mon_D32_t;
-#else
typedef struct
{
LVM_FLOAT AGC_Gain; /* The current AGC gain */
@@ -62,14 +43,12 @@
LVM_FLOAT VolumeTC; /* Volume update time constant */
} AGC_MIX_VOL_2St1Mon_FLOAT_t;
-#endif
/**********************************************************************************/
/* */
/* Function Prototypes */
/* */
/**********************************************************************************/
-#ifdef BUILD_FLOAT
void AGC_MIX_VOL_2St1Mon_D32_WRA(AGC_MIX_VOL_2St1Mon_FLOAT_t *pInstance, /* Instance pointer */
const LVM_FLOAT *pStSrc, /* Stereo source */
const LVM_FLOAT *pMonoSrc, /* Mono source */
@@ -84,23 +63,5 @@
LVM_UINT16 NrChannels); /* Number of channels */
#endif
-#else
-void AGC_MIX_VOL_2St1Mon_D32_WRA(AGC_MIX_VOL_2St1Mon_D32_t *pInstance, /* Instance pointer */
- const LVM_INT32 *pStSrc, /* Stereo source */
- const LVM_INT32 *pMonoSrc, /* Mono source */
- LVM_INT32 *pDst, /* Stereo destination */
- LVM_UINT16 n); /* Number of samples */
-#endif
-
-
#endif /* __AGC_H__ */
-
-
-
-
-
-
-
-
-
diff --git a/media/libeffects/lvm/lib/Common/lib/BIQUAD.h b/media/libeffects/lvm/lib/Common/lib/BIQUAD.h
index 2baba7c..c050cd0 100644
--- a/media/libeffects/lvm/lib/Common/lib/BIQUAD.h
+++ b/media/libeffects/lvm/lib/Common/lib/BIQUAD.h
@@ -18,13 +18,10 @@
#ifndef _BIQUAD_H_
#define _BIQUAD_H_
-
-
#include "LVM_Types.h"
/**********************************************************************************
INSTANCE MEMORY TYPE DEFINITION
***********************************************************************************/
-#ifdef BUILD_FLOAT
typedef struct
{
#ifdef SUPPORT_MC
@@ -39,19 +36,11 @@
LVM_FLOAT Storage[6];
#endif
} Biquad_FLOAT_Instance_t;
-#else
-typedef struct
-{
- LVM_INT32 Storage[6];
-
-} Biquad_Instance_t;
-#endif
/**********************************************************************************
COEFFICIENT TYPE DEFINITIONS
***********************************************************************************/
/*** Biquad coefficients **********************************************************/
-#ifdef BUILD_FLOAT
typedef struct
{
LVM_FLOAT A2; /* a2 */
@@ -60,93 +49,31 @@
LVM_FLOAT B2; /* -b2! */
LVM_FLOAT B1; /* -b1! */
} BQ_FLOAT_Coefs_t;
-#else
-typedef struct
-{
- LVM_INT16 A2; /* a2 */
- LVM_INT16 A1; /* a1 */
- LVM_INT16 A0; /* a0 */
- LVM_INT16 B2; /* -b2! */
- LVM_INT16 B1; /* -b1! */
-} BQ_C16_Coefs_t;
-
-typedef struct
-{
- LVM_INT32 A2; /* a2 */
- LVM_INT32 A1; /* a1 */
- LVM_INT32 A0; /* a0 */
- LVM_INT32 B2; /* -b2! */
- LVM_INT32 B1; /* -b1! */
-} BQ_C32_Coefs_t;
-#endif
/*** First order coefficients *****************************************************/
-#ifdef BUILD_FLOAT
typedef struct
{
LVM_FLOAT A1; /* a1 */
LVM_FLOAT A0; /* a0 */
LVM_FLOAT B1; /* -b1! */
} FO_FLOAT_Coefs_t;
-#else
-typedef struct
-{
- LVM_INT16 A1; /* a1 */
- LVM_INT16 A0; /* a0 */
- LVM_INT16 B1; /* -b1! */
-} FO_C16_Coefs_t;
-
-typedef struct
-{
- LVM_INT32 A1; /* a1 */
- LVM_INT32 A0; /* a0 */
- LVM_INT32 B1; /* -b1! */
-} FO_C32_Coefs_t;
-#endif
/*** First order coefficients with Shift*****************************************************/
-#ifdef BUILD_FLOAT
typedef struct
{
LVM_FLOAT A1; /* a1 */
LVM_FLOAT A0; /* a0 */
LVM_FLOAT B1; /* -b1! */
} FO_FLOAT_LShx_Coefs_t;
-#else
-typedef struct
-{
- LVM_INT16 A1; /* a1 */
- LVM_INT16 A0; /* a0 */
- LVM_INT16 B1; /* -b1! */
- LVM_INT16 Shift; /* Shift */
-} FO_C16_LShx_Coefs_t;
-#endif
/*** Band pass coefficients *******************************************************/
-#ifdef BUILD_FLOAT
typedef struct
{
LVM_FLOAT A0; /* a0 */
LVM_FLOAT B2; /* -b2! */
LVM_FLOAT B1; /* -b1! */
} BP_FLOAT_Coefs_t;
-#else
-typedef struct
-{
- LVM_INT16 A0; /* a0 */
- LVM_INT16 B2; /* -b2! */
- LVM_INT16 B1; /* -b1! */
-} BP_C16_Coefs_t;
-
-typedef struct
-{
- LVM_INT32 A0; /* a0 */
- LVM_INT32 B2; /* -b2! */
- LVM_INT32 B1; /* -b1! */
-} BP_C32_Coefs_t;
-#endif
/*** Peaking coefficients *********************************************************/
-#ifdef BUILD_FLOAT
typedef struct
{
LVM_FLOAT A0; /* a0 */
@@ -154,30 +81,12 @@
LVM_FLOAT B1; /* -b1! */
LVM_FLOAT G; /* Gain */
} PK_FLOAT_Coefs_t;
-#else
-typedef struct
-{
- LVM_INT16 A0; /* a0 */
- LVM_INT16 B2; /* -b2! */
- LVM_INT16 B1; /* -b1! */
- LVM_INT16 G; /* Gain */
-} PK_C16_Coefs_t;
-
-typedef struct
-{
- LVM_INT32 A0; /* a0 */
- LVM_INT32 B2; /* -b2! */
- LVM_INT32 B1; /* -b1! */
- LVM_INT16 G; /* Gain */
-} PK_C32_Coefs_t;
-#endif
/**********************************************************************************
TAPS TYPE DEFINITIONS
***********************************************************************************/
/*** Types used for first order and shelving filter *******************************/
-#ifdef BUILD_FLOAT
typedef struct
{
LVM_FLOAT Storage[ (1 * 2) ]; /* One channel, two taps of size LVM_INT32 */
@@ -192,20 +101,8 @@
LVM_FLOAT Storage[ (2 * 2) ]; /* Two channels, two taps of size LVM_FLOAT */
#endif
} Biquad_2I_Order1_FLOAT_Taps_t;
-#else
-typedef struct
-{
- LVM_INT32 Storage[ (1*2) ]; /* One channel, two taps of size LVM_INT32 */
-} Biquad_1I_Order1_Taps_t;
-
-typedef struct
-{
- LVM_INT32 Storage[ (2*2) ]; /* Two channels, two taps of size LVM_INT32 */
-} Biquad_2I_Order1_Taps_t;
-#endif
/*** Types used for biquad, band pass and peaking filter **************************/
-#ifdef BUILD_FLOAT
typedef struct
{
LVM_FLOAT Storage[ (1 * 4) ]; /* One channel, four taps of size LVM_FLOAT */
@@ -220,17 +117,6 @@
LVM_FLOAT Storage[ (2 * 4) ]; /* Two channels, four taps of size LVM_FLOAT */
#endif
} Biquad_2I_Order2_FLOAT_Taps_t;
-#else
-typedef struct
-{
- LVM_INT32 Storage[ (1*4) ]; /* One channel, four taps of size LVM_INT32 */
-} Biquad_1I_Order2_Taps_t;
-
-typedef struct
-{
- LVM_INT32 Storage[ (2*4) ]; /* Two channels, four taps of size LVM_INT32 */
-} Biquad_2I_Order2_Taps_t;
-#endif
/* The names of the functions are changed to satisfy QAC rules: Name should be Unique withing 16 characters*/
#define BQ_2I_D32F32Cll_TRC_WRA_01_Init Init_BQ_2I_D32F32Cll_TRC_WRA_01
#define BP_1I_D32F32C30_TRC_WRA_02 TWO_BP_1I_D32F32C30_TRC_WRA_02
@@ -241,140 +127,57 @@
/*** 16 bit data path *************************************************************/
-
-#ifdef BUILD_FLOAT
void BQ_2I_D16F32Css_TRC_WRA_01_Init ( Biquad_FLOAT_Instance_t *pInstance,
Biquad_2I_Order2_FLOAT_Taps_t *pTaps,
BQ_FLOAT_Coefs_t *pCoef);
-#else
-void BQ_2I_D16F32Css_TRC_WRA_01_Init ( Biquad_Instance_t *pInstance,
- Biquad_2I_Order2_Taps_t *pTaps,
- BQ_C16_Coefs_t *pCoef);
-#endif
-#ifdef BUILD_FLOAT
void BQ_2I_D16F32C15_TRC_WRA_01 ( Biquad_FLOAT_Instance_t *pInstance,
LVM_FLOAT *pDataIn,
LVM_FLOAT *pDataOut,
LVM_INT16 NrSamples);
-#else
-void BQ_2I_D16F32C15_TRC_WRA_01 ( Biquad_Instance_t *pInstance,
- LVM_INT16 *pDataIn,
- LVM_INT16 *pDataOut,
- LVM_INT16 NrSamples);
-#endif
-#ifdef BUILD_FLOAT
void BQ_2I_D16F32C14_TRC_WRA_01 ( Biquad_FLOAT_Instance_t *pInstance,
LVM_FLOAT *pDataIn,
LVM_FLOAT *pDataOut,
LVM_INT16 NrSamples);
-#else
-void BQ_2I_D16F32C14_TRC_WRA_01 ( Biquad_Instance_t *pInstance,
- LVM_INT16 *pDataIn,
- LVM_INT16 *pDataOut,
- LVM_INT16 NrSamples);
-#endif
-
-#ifdef BUILD_FLOAT
void BQ_2I_D16F32C13_TRC_WRA_01 ( Biquad_FLOAT_Instance_t *pInstance,
LVM_FLOAT *pDataIn,
LVM_FLOAT *pDataOut,
LVM_INT16 NrSamples);
-#else
-void BQ_2I_D16F32C13_TRC_WRA_01 ( Biquad_Instance_t *pInstance,
- LVM_INT16 *pDataIn,
- LVM_INT16 *pDataOut,
- LVM_INT16 NrSamples);
-#endif
-
-#ifdef BUILD_FLOAT
void BQ_2I_D16F16Css_TRC_WRA_01_Init ( Biquad_FLOAT_Instance_t *pInstance,
Biquad_2I_Order2_FLOAT_Taps_t *pTaps,
BQ_FLOAT_Coefs_t *pCoef);
-#else
-void BQ_2I_D16F16Css_TRC_WRA_01_Init ( Biquad_Instance_t *pInstance,
- Biquad_2I_Order2_Taps_t *pTaps,
- BQ_C16_Coefs_t *pCoef);
-#endif
-
-#ifdef BUILD_FLOAT
void BQ_2I_D16F16C15_TRC_WRA_01( Biquad_FLOAT_Instance_t *pInstance,
LVM_FLOAT *pDataIn,
LVM_FLOAT *pDataOut,
LVM_INT16 NrSamples);
-#else
-void BQ_2I_D16F16C15_TRC_WRA_01( Biquad_Instance_t *pInstance,
- LVM_INT16 *pDataIn,
- LVM_INT16 *pDataOut,
- LVM_INT16 NrSamples);
-#endif
-
-#ifdef BUILD_FLOAT
void BQ_2I_D16F16C14_TRC_WRA_01( Biquad_FLOAT_Instance_t *pInstance,
LVM_FLOAT *pDataIn,
LVM_FLOAT *pDataOut,
LVM_INT16 NrSamples);
-#else
-void BQ_2I_D16F16C14_TRC_WRA_01( Biquad_Instance_t *pInstance,
- LVM_INT16 *pDataIn,
- LVM_INT16 *pDataOut,
- LVM_INT16 NrSamples);
-#endif
-#ifdef BUILD_FLOAT
void BQ_1I_D16F16Css_TRC_WRA_01_Init ( Biquad_FLOAT_Instance_t *pInstance,
Biquad_1I_Order2_FLOAT_Taps_t *pTaps,
BQ_FLOAT_Coefs_t *pCoef);
-#else
-void BQ_1I_D16F16Css_TRC_WRA_01_Init ( Biquad_Instance_t *pInstance,
- Biquad_1I_Order2_Taps_t *pTaps,
- BQ_C16_Coefs_t *pCoef);
-#endif
-
-#ifdef BUILD_FLOAT
void BQ_1I_D16F16C15_TRC_WRA_01 ( Biquad_FLOAT_Instance_t *pInstance,
LVM_FLOAT *pDataIn,
LVM_FLOAT *pDataOut,
LVM_INT16 NrSamples);
-#else
-void BQ_1I_D16F16C15_TRC_WRA_01( Biquad_Instance_t *pInstance,
- LVM_INT16 *pDataIn,
- LVM_INT16 *pDataOut,
- LVM_INT16 NrSamples);
-#endif
-
-#ifdef BUILD_FLOAT
void BQ_1I_D16F32Css_TRC_WRA_01_Init ( Biquad_FLOAT_Instance_t *pInstance,
Biquad_1I_Order2_FLOAT_Taps_t *pTaps,
BQ_FLOAT_Coefs_t *pCoef);
-#else
-void BQ_1I_D16F32Css_TRC_WRA_01_Init ( Biquad_Instance_t *pInstance,
- Biquad_1I_Order2_Taps_t *pTaps,
- BQ_C16_Coefs_t *pCoef);
-#endif
-
-#ifdef BUILD_FLOAT
void BQ_1I_D16F32C14_TRC_WRA_01 ( Biquad_FLOAT_Instance_t *pInstance,
LVM_FLOAT *pDataIn,
LVM_FLOAT *pDataOut,
LVM_INT16 NrSamples);
-#else
-void BQ_1I_D16F32C14_TRC_WRA_01 ( Biquad_Instance_t *pInstance,
- LVM_INT16 *pDataIn,
- LVM_INT16 *pDataOut,
- LVM_INT16 NrSamples);
-
-#endif
/*** 32 bit data path *************************************************************/
-#ifdef BUILD_FLOAT
void BQ_2I_D32F32Cll_TRC_WRA_01_Init ( Biquad_FLOAT_Instance_t *pInstance,
Biquad_2I_Order2_FLOAT_Taps_t *pTaps,
BQ_FLOAT_Coefs_t *pCoef);
@@ -389,67 +192,30 @@
LVM_INT16 NrFrames,
LVM_INT16 NrChannels);
#endif
-#else
-void BQ_2I_D32F32Cll_TRC_WRA_01_Init ( Biquad_Instance_t *pInstance,
- Biquad_2I_Order2_Taps_t *pTaps,
- BQ_C32_Coefs_t *pCoef);
-
-void BQ_2I_D32F32C30_TRC_WRA_01 ( Biquad_Instance_t *pInstance,
- LVM_INT32 *pDataIn,
- LVM_INT32 *pDataOut,
- LVM_INT16 NrSamples);
-#endif
/**********************************************************************************
FUNCTION PROTOTYPES: FIRST ORDER FILTERS
***********************************************************************************/
/*** 16 bit data path *************************************************************/
-#ifdef BUILD_FLOAT
void FO_1I_D16F16Css_TRC_WRA_01_Init( Biquad_FLOAT_Instance_t *pInstance,
Biquad_1I_Order1_FLOAT_Taps_t *pTaps,
FO_FLOAT_Coefs_t *pCoef);
-#else
-void FO_1I_D16F16Css_TRC_WRA_01_Init( Biquad_Instance_t *pInstance,
- Biquad_1I_Order1_Taps_t *pTaps,
- FO_C16_Coefs_t *pCoef);
-#endif
-#ifdef BUILD_FLOAT
void FO_1I_D16F16C15_TRC_WRA_01( Biquad_FLOAT_Instance_t *pInstance,
LVM_FLOAT *pDataIn,
LVM_FLOAT *pDataOut,
LVM_INT16 NrSamples);
-#else
-void FO_1I_D16F16C15_TRC_WRA_01( Biquad_Instance_t *pInstance,
- LVM_INT16 *pDataIn,
- LVM_INT16 *pDataOut,
- LVM_INT16 NrSamples);
-#endif
-#ifdef BUILD_FLOAT
void FO_2I_D16F32Css_LShx_TRC_WRA_01_Init(Biquad_FLOAT_Instance_t *pInstance,
Biquad_2I_Order1_FLOAT_Taps_t *pTaps,
FO_FLOAT_LShx_Coefs_t *pCoef);
-#else
-void FO_2I_D16F32Css_LShx_TRC_WRA_01_Init(Biquad_Instance_t *pInstance,
- Biquad_2I_Order1_Taps_t *pTaps,
- FO_C16_LShx_Coefs_t *pCoef);
-#endif
-#ifdef BUILD_FLOAT
void FO_2I_D16F32C15_LShx_TRC_WRA_01(Biquad_FLOAT_Instance_t *pInstance,
LVM_FLOAT *pDataIn,
LVM_FLOAT *pDataOut,
LVM_INT16 NrSamples);
-#else
-void FO_2I_D16F32C15_LShx_TRC_WRA_01(Biquad_Instance_t *pInstance,
- LVM_INT16 *pDataIn,
- LVM_INT16 *pDataOut,
- LVM_INT16 NrSamples);
-#endif
/*** 32 bit data path *************************************************************/
-#ifdef BUILD_FLOAT
void FO_1I_D32F32Cll_TRC_WRA_01_Init( Biquad_FLOAT_Instance_t *pInstance,
Biquad_1I_Order1_FLOAT_Taps_t *pTaps,
FO_FLOAT_Coefs_t *pCoef);
@@ -464,22 +230,11 @@
LVM_INT16 NrFrames,
LVM_INT16 NrChannels);
#endif
-#else
-void FO_1I_D32F32Cll_TRC_WRA_01_Init( Biquad_Instance_t *pInstance,
- Biquad_1I_Order1_Taps_t *pTaps,
- FO_C32_Coefs_t *pCoef);
-
-void FO_1I_D32F32C31_TRC_WRA_01( Biquad_Instance_t *pInstance,
- LVM_INT32 *pDataIn,
- LVM_INT32 *pDataOut,
- LVM_INT16 NrSamples);
-#endif
/**********************************************************************************
FUNCTION PROTOTYPES: BAND PASS FILTERS
***********************************************************************************/
/*** 16 bit data path *************************************************************/
-#ifdef BUILD_FLOAT
void BP_1I_D16F16Css_TRC_WRA_01_Init( Biquad_FLOAT_Instance_t *pInstance,
Biquad_1I_Order2_FLOAT_Taps_t *pTaps,
BP_FLOAT_Coefs_t *pCoef);
@@ -494,27 +249,7 @@
LVM_FLOAT *pDataIn,
LVM_FLOAT *pDataOut,
LVM_INT16 NrSamples);
-#else
-void BP_1I_D16F16Css_TRC_WRA_01_Init ( Biquad_Instance_t *pInstance,
- Biquad_1I_Order2_Taps_t *pTaps,
- BP_C16_Coefs_t *pCoef);
-
-void BP_1I_D16F16C14_TRC_WRA_01 ( Biquad_Instance_t *pInstance,
- LVM_INT16 *pDataIn,
- LVM_INT16 *pDataOut,
- LVM_INT16 NrSamples);
-
-void BP_1I_D16F32Cll_TRC_WRA_01_Init ( Biquad_Instance_t *pInstance,
- Biquad_1I_Order2_Taps_t *pTaps,
- BP_C32_Coefs_t *pCoef);
-
-void BP_1I_D16F32C30_TRC_WRA_01 ( Biquad_Instance_t *pInstance,
- LVM_INT16 *pDataIn,
- LVM_INT16 *pDataOut,
- LVM_INT16 NrSamples);
-#endif
/*** 32 bit data path *************************************************************/
-#ifdef BUILD_FLOAT
void BP_1I_D32F32Cll_TRC_WRA_02_Init ( Biquad_FLOAT_Instance_t *pInstance,
Biquad_1I_Order2_FLOAT_Taps_t *pTaps,
BP_FLOAT_Coefs_t *pCoef);
@@ -522,37 +257,11 @@
LVM_FLOAT *pDataIn,
LVM_FLOAT *pDataOut,
LVM_INT16 NrSamples);
-#else
-void BP_1I_D32F32Cll_TRC_WRA_02_Init ( Biquad_Instance_t *pInstance,
- Biquad_1I_Order2_Taps_t *pTaps,
- BP_C32_Coefs_t *pCoef);
-
-void BP_1I_D32F32C30_TRC_WRA_02( Biquad_Instance_t *pInstance,
- LVM_INT32 *pDataIn,
- LVM_INT32 *pDataOut,
- LVM_INT16 NrSamples);
-#endif
/*** 32 bit data path STEREO ******************************************************/
-#ifndef BUILD_FLOAT
-void PK_2I_D32F32CllGss_TRC_WRA_01_Init ( Biquad_Instance_t *pInstance,
- Biquad_2I_Order2_Taps_t *pTaps,
- PK_C32_Coefs_t *pCoef);
-void PK_2I_D32F32C30G11_TRC_WRA_01 ( Biquad_Instance_t *pInstance,
- LVM_INT32 *pDataIn,
- LVM_INT32 *pDataOut,
- LVM_INT16 NrSamples);
-#endif
-#ifdef BUILD_FLOAT
void PK_2I_D32F32CssGss_TRC_WRA_01_Init ( Biquad_FLOAT_Instance_t *pInstance,
Biquad_2I_Order2_FLOAT_Taps_t *pTaps,
PK_FLOAT_Coefs_t *pCoef);
-#else
-void PK_2I_D32F32CssGss_TRC_WRA_01_Init ( Biquad_Instance_t *pInstance,
- Biquad_2I_Order2_Taps_t *pTaps,
- PK_C16_Coefs_t *pCoef);
-#endif
-#ifdef BUILD_FLOAT
void PK_2I_D32F32C14G11_TRC_WRA_01( Biquad_FLOAT_Instance_t *pInstance,
LVM_FLOAT *pDataIn,
LVM_FLOAT *pDataOut,
@@ -564,19 +273,12 @@
LVM_INT16 NrFrames,
LVM_INT16 NrChannels);
#endif
-#else
-void PK_2I_D32F32C14G11_TRC_WRA_01 ( Biquad_Instance_t *pInstance,
- LVM_INT32 *pDataIn,
- LVM_INT32 *pDataOut,
- LVM_INT16 NrSamples);
-#endif
/**********************************************************************************
FUNCTION PROTOTYPES: DC REMOVAL FILTERS
***********************************************************************************/
/*** 16 bit data path STEREO ******************************************************/
-#ifdef BUILD_FLOAT
#ifdef SUPPORT_MC
void DC_Mc_D16_TRC_WRA_01_Init ( Biquad_FLOAT_Instance_t *pInstance);
@@ -593,15 +295,6 @@
LVM_FLOAT *pDataOut,
LVM_INT16 NrSamples);
#endif
-#else
-void DC_2I_D16_TRC_WRA_01_Init ( Biquad_Instance_t *pInstance);
-
-void DC_2I_D16_TRC_WRA_01 ( Biquad_Instance_t *pInstance,
- LVM_INT16 *pDataIn,
- LVM_INT16 *pDataOut,
- LVM_INT16 NrSamples);
-#endif
-
/**********************************************************************************/
diff --git a/media/libeffects/lvm/lib/Common/lib/CompLim.h b/media/libeffects/lvm/lib/Common/lib/CompLim.h
index 4e7addd..5b7cb1b 100644
--- a/media/libeffects/lvm/lib/Common/lib/CompLim.h
+++ b/media/libeffects/lvm/lib/Common/lib/CompLim.h
@@ -18,8 +18,6 @@
#ifndef _COMP_LIM_H
#define _COMP_LIM_H
-
-
/************************************************************************************/
/* */
/* Includes */
@@ -28,7 +26,6 @@
#include "LVM_Types.h"
-
/************************************************************************************/
/* */
/* Structures */
@@ -54,28 +51,17 @@
LVM_INT32 CompIntSlow; /* Compressor slow integrator current value */
LVM_INT32 CompIntFast; /* Compressor fast integrator current value */
-
} CompLim_Instance_t;
-
/************************************************************************************/
/* */
/* Function Prototypes */
/* */
/************************************************************************************/
-#ifdef BUILD_FLOAT
void NonLinComp_Float(LVM_FLOAT Gain,
LVM_FLOAT *pDataIn,
LVM_FLOAT *pDataOut,
LVM_INT32 BlockLength);
-#else
-void NonLinComp_D16(LVM_INT16 Gain,
- LVM_INT16 *pSterBfIn,
- LVM_INT16 *pSterBfOut,
- LVM_INT32 BlockLength);
-#endif
#endif /* #ifndef _COMP_LIM_H */
-
-
diff --git a/media/libeffects/lvm/lib/Common/lib/Filter.h b/media/libeffects/lvm/lib/Common/lib/Filter.h
index 3133ce2..1eeb321 100644
--- a/media/libeffects/lvm/lib/Common/lib/Filter.h
+++ b/media/libeffects/lvm/lib/Common/lib/Filter.h
@@ -18,36 +18,27 @@
#ifndef _FILTER_H_
#define _FILTER_H_
-
/**********************************************************************************
INCLUDES
***********************************************************************************/
#include "LVM_Types.h"
#include "BIQUAD.h"
-
/**********************************************************************************
DEFINES
***********************************************************************************/
#define FILTER_LOSS 32730 /* -0.01dB loss to avoid wrapping due to band ripple */
-#ifdef BUILD_FLOAT
#define FILTER_LOSS_FLOAT 0.998849f
-#endif
/**********************************************************************************
FUNCTION PROTOTYPES
***********************************************************************************/
-#ifdef BUILD_FLOAT
LVM_FLOAT LVM_Power10( LVM_FLOAT X);
LVM_FLOAT LVM_Polynomial(LVM_UINT16 N,
LVM_FLOAT *pCoefficients,
LVM_FLOAT X);
-#ifdef HIGHER_FS
LVM_FLOAT LVM_GetOmega(LVM_UINT32 Fc,
-#else
-LVM_FLOAT LVM_GetOmega(LVM_UINT16 Fc,
-#endif
LVM_Fs_en SampleRate);
LVM_FLOAT LVM_FO_LPF( LVM_FLOAT w,
@@ -55,22 +46,6 @@
LVM_FLOAT LVM_FO_HPF( LVM_FLOAT w,
FO_FLOAT_Coefs_t *pCoeffs);
-#else
-LVM_INT32 LVM_Polynomial(LVM_UINT16 N,
- LVM_INT32 *pCoefficients,
- LVM_INT32 X);
-
-LVM_INT32 LVM_Power10( LVM_INT32 X);
-
-LVM_INT32 LVM_FO_LPF( LVM_INT32 w,
- FO_C32_Coefs_t *pCoeffs);
-
-LVM_INT32 LVM_FO_HPF( LVM_INT32 w,
- FO_C32_Coefs_t *pCoeffs);
-
-LVM_INT32 LVM_GetOmega(LVM_UINT16 Fc,
- LVM_Fs_en SampleRate);
-#endif
/**********************************************************************************/
#endif /** _FILTER_H_ **/
diff --git a/media/libeffects/lvm/lib/Common/lib/InstAlloc.h b/media/libeffects/lvm/lib/Common/lib/InstAlloc.h
index 10b5775..bae84e7 100644
--- a/media/libeffects/lvm/lib/Common/lib/InstAlloc.h
+++ b/media/libeffects/lvm/lib/Common/lib/InstAlloc.h
@@ -18,7 +18,6 @@
#ifndef __INSTALLOC_H__
#define __INSTALLOC_H__
-
#include "LVM_Types.h"
/*######################################################################################*/
/* Type declarations */
@@ -29,7 +28,6 @@
uintptr_t pNextMember; /* Pointer to the next instance member to be allocated */
} INST_ALLOC;
-
/*######################################################################################*/
/* Function prototypes */
/*######################################################################################*/
@@ -45,7 +43,6 @@
void InstAlloc_Init( INST_ALLOC *pms, void *StartAddr );
-
/****************************************************************************************
* Name : InstAlloc_AddMember()
* Input : pms - Pointer to the INST_ALLOC instance
@@ -82,5 +79,4 @@
void InstAlloc_InitAll_NULL( INST_ALLOC *pms);
-
#endif /* __JBS_INSTALLOC_H__ */
diff --git a/media/libeffects/lvm/lib/Common/lib/LVM_Common.h b/media/libeffects/lvm/lib/Common/lib/LVM_Common.h
index 96da872..49f16ad 100644
--- a/media/libeffects/lvm/lib/Common/lib/LVM_Common.h
+++ b/media/libeffects/lvm/lib/Common/lib/LVM_Common.h
@@ -23,12 +23,9 @@
/* */
/****************************************************************************************/
-
#ifndef __LVM_COMMON_H__
#define __LVM_COMMON_H__
-
-
/****************************************************************************************/
/* */
/* Includes */
@@ -36,7 +33,6 @@
/****************************************************************************************/
#include "LVM_Types.h"
-
/****************************************************************************************/
/* */
/* Definitions */
@@ -50,6 +46,5 @@
#define ALGORITHM_VC_ID 0x0500
#define ALGORITHM_TE_ID 0x0600
-
#endif /* __LVM_COMMON_H__ */
diff --git a/media/libeffects/lvm/lib/Common/lib/LVM_Macros.h b/media/libeffects/lvm/lib/Common/lib/LVM_Macros.h
index 2ecc7f8..1a15125 100644
--- a/media/libeffects/lvm/lib/Common/lib/LVM_Macros.h
+++ b/media/libeffects/lvm/lib/Common/lib/LVM_Macros.h
@@ -18,7 +18,6 @@
#ifndef _LVM_MACROS_H_
#define _LVM_MACROS_H_
-
/**********************************************************************************
MUL32x32INTO32(A,B,C,ShiftR)
C = (A * B) >> ShiftR
@@ -29,7 +28,6 @@
of overflow is undefined.
***********************************************************************************/
-#ifndef MUL32x32INTO32
#define MUL32x32INTO32(A,B,C,ShiftR) \
{LVM_INT32 MUL32x32INTO32_temp,MUL32x32INTO32_temp2,MUL32x32INTO32_mask,MUL32x32INTO32_HH,MUL32x32INTO32_HL,MUL32x32INTO32_LH,MUL32x32INTO32_LL;\
LVM_INT32 shiftValue;\
@@ -55,7 +53,6 @@
}\
(C) = MUL32x32INTO32_temp2;\
}
-#endif
/**********************************************************************************
MUL32x16INTO32(A,B,C,ShiftR)
@@ -68,7 +65,6 @@
of overflow is undefined.
***********************************************************************************/
-#ifndef MUL32x16INTO32
#define MUL32x16INTO32(A,B,C,ShiftR) \
{LVM_INT32 MUL32x16INTO32_mask,MUL32x16INTO32_HH,MUL32x16INTO32_LL;\
LVM_INT32 shiftValue;\
@@ -88,7 +84,6 @@
else {\
(C)=MUL32x16INTO32_HH>>(shiftValue-16);}\
}
-#endif
/**********************************************************************************
ADD2_SAT_32x32(A,B,C)
@@ -96,7 +91,6 @@
A,B and C are 32 bit SIGNED numbers.
***********************************************************************************/
-#ifndef ADD2_SAT_32x32
#define ADD2_SAT_32x32(A,B,C) \
{(C)=(A)+(B);\
if ((((C) ^ (A)) & ((C) ^ (B))) >> 31)\
@@ -107,9 +101,6 @@
(C)=0x7FFFFFFFl;\
}\
}
-#endif
-
-
#endif /* _LVM_MACROS_H_ */
diff --git a/media/libeffects/lvm/lib/Common/lib/LVM_Timer.h b/media/libeffects/lvm/lib/Common/lib/LVM_Timer.h
index 9722bf5..dbf9e6a 100644
--- a/media/libeffects/lvm/lib/Common/lib/LVM_Timer.h
+++ b/media/libeffects/lvm/lib/Common/lib/LVM_Timer.h
@@ -33,8 +33,6 @@
/* The timer currently does not suport changes in sampling rate while timing. */
/****************************************************************************************/
-
-
/****************************************************************************************/
/* TYPE DEFINITIONS */
/****************************************************************************************/
@@ -71,14 +69,11 @@
void LVM_Timer_Init ( LVM_Timer_Instance_t *pInstance,
LVM_Timer_Params_t *pParams );
-
void LVM_Timer ( LVM_Timer_Instance_t *pInstance,
LVM_INT16 BlockSize );
-
/****************************************************************************************/
/* END OF HEADER */
/****************************************************************************************/
-
#endif /* __LVM_TIMER_H__ */
diff --git a/media/libeffects/lvm/lib/Common/lib/LVM_Types.h b/media/libeffects/lvm/lib/Common/lib/LVM_Types.h
index 3eae70e..8b687f6 100644
--- a/media/libeffects/lvm/lib/Common/lib/LVM_Types.h
+++ b/media/libeffects/lvm/lib/Common/lib/LVM_Types.h
@@ -25,7 +25,6 @@
#ifndef LVM_TYPES_H
#define LVM_TYPES_H
-
#include <stdint.h>
/****************************************************************************************/
@@ -93,32 +92,15 @@
typedef uint32_t LVM_UINT32; /* Unsigned 32-bit word */
typedef int64_t LVM_INT64; /* Signed 64-bit word */
-#ifdef BUILD_FLOAT
-
#define LVM_MAXFLOAT 1.f
typedef float LVM_FLOAT; /* single precision floating point */
-// If NATIVE_FLOAT_BUFFER is defined, we expose effects as floating point format;
-// otherwise we expose as integer 16 bit and translate to float for the effect libraries.
-// Hence, NATIVE_FLOAT_BUFFER should only be enabled under BUILD_FLOAT compilation.
-
-#define NATIVE_FLOAT_BUFFER
-
-#endif // BUILD_FLOAT
-
// Select whether we expose int16_t or float buffers.
-#ifdef NATIVE_FLOAT_BUFFER
#define EFFECT_BUFFER_FORMAT AUDIO_FORMAT_PCM_FLOAT
typedef float effect_buffer_t;
-#else // NATIVE_FLOAT_BUFFER
-
-#define EFFECT_BUFFER_FORMAT AUDIO_FORMAT_PCM_16_BIT
-typedef int16_t effect_buffer_t;
-
-#endif // NATIVE_FLOAT_BUFFER
#ifdef SUPPORT_MC
#define LVM_MAX_CHANNELS 8 // FCC_8
@@ -140,7 +122,6 @@
LVM_MODE_DUMMY = LVM_MAXENUM
} LVM_Mode_en;
-
/* Format */
typedef enum
{
@@ -153,7 +134,6 @@
LVM_SOURCE_DUMMY = LVM_MAXENUM
} LVM_Format_en;
-
/* LVM sampling rates */
typedef enum
{
@@ -166,17 +146,14 @@
LVM_FS_32000 = 6,
LVM_FS_44100 = 7,
LVM_FS_48000 = 8,
-#ifdef HIGHER_FS
LVM_FS_88200 = 9,
LVM_FS_96000 = 10,
LVM_FS_176400 = 11,
LVM_FS_192000 = 12,
-#endif
LVM_FS_INVALID = LVM_MAXENUM-1,
LVM_FS_DUMMY = LVM_MAXENUM
} LVM_Fs_en;
-
/* Memory Types */
typedef enum
{
@@ -187,7 +164,6 @@
LVM_MEMORYTYPE_DUMMY = LVM_MAXENUM
} LVM_MemoryTypes_en;
-
/* Memory region definition */
typedef struct
{
@@ -196,14 +172,12 @@
void *pBaseAddress; /* Pointer to the region base address */
} LVM_MemoryRegion_st;
-
/* Memory table containing the region definitions */
typedef struct
{
LVM_MemoryRegion_st Region[LVM_NR_MEMORY_REGIONS]; /* One definition for each region */
} LVM_MemoryTable_st;
-
/****************************************************************************************/
/* */
/* Standard Function Prototypes */
@@ -213,12 +187,10 @@
void *pGeneralPurpose, /* General purpose pointer (e.g. to a data structure needed in the callback) */
LVM_INT16 GeneralPurpose ); /* General purpose variable (e.g. to be used as callback ID) */
-
/****************************************************************************************/
/* */
/* End of file */
/* */
/****************************************************************************************/
-
#endif /* LVM_TYPES_H */
diff --git a/media/libeffects/lvm/lib/Common/lib/Mixer.h b/media/libeffects/lvm/lib/Common/lib/Mixer.h
index c63d882..b2e0195 100644
--- a/media/libeffects/lvm/lib/Common/lib/Mixer.h
+++ b/media/libeffects/lvm/lib/Common/lib/Mixer.h
@@ -18,16 +18,12 @@
#ifndef __MIXER_H__
#define __MIXER_H__
-
-
-
#include "LVM_Types.h"
/**********************************************************************************
INSTANCE MEMORY TYPE DEFINITION
***********************************************************************************/
-#ifdef BUILD_FLOAT /* BUILD_FLOAT*/
typedef struct
{
LVM_FLOAT Alpha; /* Time constant. Set by calling application. \
@@ -63,52 +59,11 @@
void *pGeneralPurpose2;
LVM_Callback pCallBack2;
} Mix_2St_Cll_FLOAT_t;
-#else
-typedef struct
-{
- LVM_INT32 Alpha; /* Time constant. Set by calling application. Can be changed at any time */
- LVM_INT32 Target; /* Target value. Set by calling application. Can be changed at any time */
- LVM_INT32 Current; /* Current value. Set by the mixer function. */
- LVM_INT16 CallbackSet; /* Boolean. Should be set by calling application each time the target value is updated */
- LVM_INT16 CallbackParam; /* Parameter that will be used in the calback function */
- void *pCallbackHandle; /* Pointer to the instance of the callback function */
- void *pGeneralPurpose; /* Pointer for general purpose usage */
- LVM_Callback pCallBack; /* Pointer to the callback function */
-} Mix_1St_Cll_t;
-
-typedef struct
-{
- LVM_INT32 Alpha1;
- LVM_INT32 Target1;
- LVM_INT32 Current1;
- LVM_INT16 CallbackSet1;
- LVM_INT16 CallbackParam1;
- void *pCallbackHandle1;
- void *pGeneralPurpose1;
- LVM_Callback pCallBack1;
-
- LVM_INT32 Alpha2; /* Warning the address of this location is passed as a pointer to Mix_1St_Cll_t in some functions */
- LVM_INT32 Target2;
- LVM_INT32 Current2;
- LVM_INT16 CallbackSet2;
- LVM_INT16 CallbackParam2;
- void *pCallbackHandle2;
- void *pGeneralPurpose2;
- LVM_Callback pCallBack2;
-
-} Mix_2St_Cll_t;
-
-#endif
/*** General functions ************************************************************/
-#ifdef BUILD_FLOAT
LVM_FLOAT LVM_Mixer_TimeConstant(LVM_UINT32 tc,
-#ifdef HIGHER_FS
LVM_UINT32 Fs,
-#else
- LVM_UINT16 Fs,
-#endif
LVM_UINT16 NumChannels);
void MixSoft_1St_D32C31_WRA( Mix_1St_Cll_FLOAT_t *pInstance,
@@ -126,34 +81,10 @@
const LVM_FLOAT *src,
LVM_FLOAT *dst,
LVM_INT16 n);
-#else
-LVM_UINT32 LVM_Mixer_TimeConstant(LVM_UINT32 tc,
- LVM_UINT16 Fs,
- LVM_UINT16 NumChannels);
-
-
-void MixSoft_1St_D32C31_WRA( Mix_1St_Cll_t *pInstance,
- const LVM_INT32 *src,
- LVM_INT32 *dst,
- LVM_INT16 n);
-
-void MixSoft_2St_D32C31_SAT( Mix_2St_Cll_t *pInstance,
- const LVM_INT32 *src1,
- const LVM_INT32 *src2,
- LVM_INT32 *dst,
- LVM_INT16 n);
-
-void MixInSoft_D32C31_SAT( Mix_1St_Cll_t *pInstance,
- const LVM_INT32 *src,
- LVM_INT32 *dst,
- LVM_INT16 n);
-
-#endif
/**********************************************************************************
FUNCTION PROTOTYPES (LOW LEVEL SUBFUNCTIONS)
***********************************************************************************/
-#ifdef BUILD_FLOAT
void Core_MixSoft_1St_D32C31_WRA( Mix_1St_Cll_FLOAT_t *pInstance,
const LVM_FLOAT *src,
LVM_FLOAT *dst,
@@ -167,24 +98,6 @@
const LVM_FLOAT *src,
LVM_FLOAT *dst,
LVM_INT16 n);
-#else
-void Core_MixSoft_1St_D32C31_WRA( Mix_1St_Cll_t *pInstance,
- const LVM_INT32 *src,
- LVM_INT32 *dst,
- LVM_INT16 n);
-
-void Core_MixHard_2St_D32C31_SAT( Mix_2St_Cll_t *pInstance,
- const LVM_INT32 *src1,
- const LVM_INT32 *src2,
- LVM_INT32 *dst,
- LVM_INT16 n);
-
-void Core_MixInSoft_D32C31_SAT( Mix_1St_Cll_t *pInstance,
- const LVM_INT32 *src,
- LVM_INT32 *dst,
- LVM_INT16 n);
-#endif
-
/**********************************************************************************/
diff --git a/media/libeffects/lvm/lib/Common/lib/ScalarArithmetic.h b/media/libeffects/lvm/lib/Common/lib/ScalarArithmetic.h
index a492a13..ae54419 100644
--- a/media/libeffects/lvm/lib/Common/lib/ScalarArithmetic.h
+++ b/media/libeffects/lvm/lib/Common/lib/ScalarArithmetic.h
@@ -18,8 +18,6 @@
#ifndef __SCALARARITHMETIC_H__
#define __SCALARARITHMETIC_H__
-
-
/*######################################################################################*/
/* Include files */
/*######################################################################################*/
@@ -32,11 +30,7 @@
/* Absolute value including the corner case for the extreme negative value */
-#ifdef BUILD_FLOAT
LVM_FLOAT Abs_Float(LVM_FLOAT input);
-#else
-LVM_INT32 Abs_32(LVM_INT32 input);
-#endif
/****************************************************************************************
* Name : dB_to_Lin32()
@@ -50,13 +44,7 @@
* (15->01) = decimal part
* Returns : Lin value format 1.16.15
****************************************************************************************/
-#ifdef BUILD_FLOAT
LVM_FLOAT dB_to_LinFloat(LVM_INT16 db_fix);
-#else
-LVM_INT32 dB_to_Lin32(LVM_INT16 db_fix);
-#endif
-
#endif /* __SCALARARITHMETIC_H__ */
-
diff --git a/media/libeffects/lvm/lib/Common/lib/VectorArithmetic.h b/media/libeffects/lvm/lib/Common/lib/VectorArithmetic.h
index 5acb363..2af1eeb 100644
--- a/media/libeffects/lvm/lib/Common/lib/VectorArithmetic.h
+++ b/media/libeffects/lvm/lib/Common/lib/VectorArithmetic.h
@@ -18,29 +18,16 @@
#ifndef _VECTOR_ARITHMETIC_H_
#define _VECTOR_ARITHMETIC_H_
-
-
#include "LVM_Types.h"
/**********************************************************************************
VARIOUS FUNCTIONS
***********************************************************************************/
-#ifdef BUILD_FLOAT
void LoadConst_Float( const LVM_FLOAT val,
LVM_FLOAT *dst,
LVM_INT16 n );
-#else
-void LoadConst_16( const LVM_INT16 val,
- LVM_INT16 *dst,
- LVM_INT16 n );
-void LoadConst_32( const LVM_INT32 val,
- LVM_INT32 *dst,
- LVM_INT16 n );
-#endif
-
-#ifdef BUILD_FLOAT
void Copy_Float( const LVM_FLOAT *src,
LVM_FLOAT *dst,
LVM_INT16 n );
@@ -54,11 +41,6 @@
LVM_INT16 NrFrames,
LVM_INT32 NrChannels);
#endif
-#else
-void Copy_16( const LVM_INT16 *src,
- LVM_INT16 *dst,
- LVM_INT16 n );
-#endif
/*********************************************************************************
* note: In Mult3s_16x16() saturation of result is not taken care when *
@@ -68,17 +50,10 @@
* This is the only case which will give wrong result. *
* For more information refer to Vector_Arithmetic.doc in /doc folder *
*********************************************************************************/
-#ifdef BUILD_FLOAT
void Mult3s_Float( const LVM_FLOAT *src,
const LVM_FLOAT val,
LVM_FLOAT *dst,
LVM_INT16 n);
-#else
-void Mult3s_16x16( const LVM_INT16 *src,
- const LVM_INT16 val,
- LVM_INT16 *dst,
- LVM_INT16 n);
-#endif
/*********************************************************************************
* note: In Mult3s_32x16() saturation of result is not taken care when *
@@ -92,55 +67,24 @@
const LVM_INT16 val,
LVM_INT32 *dst,
LVM_INT16 n);
-#ifdef BUILD_FLOAT
void DelayMix_Float(const LVM_FLOAT *src, /* Source 1, to be delayed */
LVM_FLOAT *delay, /* Delay buffer */
LVM_INT16 size, /* Delay size */
LVM_FLOAT *dst, /* Source/destination */
LVM_INT16 *pOffset, /* Delay offset */
LVM_INT16 n) ; /* Number of stereo samples */
-#else
-void DelayMix_16x16( const LVM_INT16 *src,
- LVM_INT16 *delay,
- LVM_INT16 size,
- LVM_INT16 *dst,
- LVM_INT16 *pOffset,
- LVM_INT16 n);
-#endif
void DelayWrite_32( const LVM_INT32 *src, /* Source 1, to be delayed */
LVM_INT32 *delay, /* Delay buffer */
LVM_UINT16 size, /* Delay size */
LVM_UINT16 *pOffset, /* Delay offset */
LVM_INT16 n);
-#ifdef BUILD_FLOAT
void Add2_Sat_Float( const LVM_FLOAT *src,
LVM_FLOAT *dst,
LVM_INT16 n );
-#else
-void Add2_Sat_16x16( const LVM_INT16 *src,
- LVM_INT16 *dst,
- LVM_INT16 n );
-
-void Add2_Sat_32x32( const LVM_INT32 *src,
- LVM_INT32 *dst,
- LVM_INT16 n );
-#endif
-#ifdef BUILD_FLOAT
void Mac3s_Sat_Float( const LVM_FLOAT *src,
const LVM_FLOAT val,
LVM_FLOAT *dst,
LVM_INT16 n);
-#else
-void Mac3s_Sat_16x16( const LVM_INT16 *src,
- const LVM_INT16 val,
- LVM_INT16 *dst,
- LVM_INT16 n);
-
-void Mac3s_Sat_32x16( const LVM_INT32 *src,
- const LVM_INT16 val,
- LVM_INT32 *dst,
- LVM_INT16 n);
-#endif
void DelayAllPass_Sat_32x16To32( LVM_INT32 *delay, /* Delay buffer */
LVM_UINT16 size, /* Delay size */
LVM_INT16 coeff, /* All pass filter coefficient */
@@ -152,39 +96,16 @@
/**********************************************************************************
SHIFT FUNCTIONS
***********************************************************************************/
-#ifdef BUILD_FLOAT
void Shift_Sat_Float (const LVM_INT16 val,
const LVM_FLOAT *src,
LVM_FLOAT *dst,
LVM_INT16 n);
-#else
-void Shift_Sat_v16xv16 ( const LVM_INT16 val,
- const LVM_INT16 *src,
- LVM_INT16 *dst,
- LVM_INT16 n);
-
-void Shift_Sat_v32xv32 ( const LVM_INT16 val,
- const LVM_INT32 *src,
- LVM_INT32 *dst,
- LVM_INT16 n);
-#endif
/**********************************************************************************
AUDIO FORMAT CONVERSION FUNCTIONS
***********************************************************************************/
-#ifdef BUILD_FLOAT
void MonoTo2I_Float( const LVM_FLOAT *src,
LVM_FLOAT *dst,
LVM_INT16 n);
-#else
-void MonoTo2I_16( const LVM_INT16 *src,
- LVM_INT16 *dst,
- LVM_INT16 n);
-
-void MonoTo2I_32( const LVM_INT32 *src,
- LVM_INT32 *dst,
- LVM_INT16 n);
-#endif
-#ifdef BUILD_FLOAT
void From2iToMono_Float( const LVM_FLOAT *src,
LVM_FLOAT *dst,
LVM_INT16 n);
@@ -194,47 +115,18 @@
LVM_INT16 NrFrames,
LVM_INT16 NrChannels);
#endif
-#else
-void From2iToMono_32( const LVM_INT32 *src,
- LVM_INT32 *dst,
- LVM_INT16 n);
-#endif
-#ifdef BUILD_FLOAT
void MSTo2i_Sat_Float( const LVM_FLOAT *srcM,
const LVM_FLOAT *srcS,
LVM_FLOAT *dst,
LVM_INT16 n );
-#else
-void MSTo2i_Sat_16x16( const LVM_INT16 *srcM,
- const LVM_INT16 *srcS,
- LVM_INT16 *dst,
- LVM_INT16 n );
-#endif
-#ifdef BUILD_FLOAT
void From2iToMS_Float( const LVM_FLOAT *src,
LVM_FLOAT *dstM,
LVM_FLOAT *dstS,
LVM_INT16 n );
-#else
-void From2iToMS_16x16( const LVM_INT16 *src,
- LVM_INT16 *dstM,
- LVM_INT16 *dstS,
- LVM_INT16 n );
-#endif
-#ifdef BUILD_FLOAT
void JoinTo2i_Float( const LVM_FLOAT *srcL,
const LVM_FLOAT *srcR,
LVM_FLOAT *dst,
LVM_INT16 n );
-#else
-void From2iToMono_16( const LVM_INT16 *src,
- LVM_INT16 *dst,
- LVM_INT16 n);
-void JoinTo2i_32x32( const LVM_INT32 *srcL,
- const LVM_INT32 *srcR,
- LVM_INT32 *dst,
- LVM_INT16 n );
-#endif
/**********************************************************************************
DATA TYPE CONVERSION FUNCTIONS
@@ -250,8 +142,6 @@
LVM_INT16 n,
LVM_INT16 shift );
-
-
/**********************************************************************************/
#endif /* _VECTOR_ARITHMETIC_H_ */
diff --git a/media/libeffects/lvm/lib/Common/src/AGC_MIX_VOL_2St1Mon_D32_WRA.cpp b/media/libeffects/lvm/lib/Common/src/AGC_MIX_VOL_2St1Mon_D32_WRA.cpp
index 5c8655f..e18aa78 100644
--- a/media/libeffects/lvm/lib/Common/src/AGC_MIX_VOL_2St1Mon_D32_WRA.cpp
+++ b/media/libeffects/lvm/lib/Common/src/AGC_MIX_VOL_2St1Mon_D32_WRA.cpp
@@ -24,7 +24,6 @@
#include "AGC.h"
#include "ScalarArithmetic.h"
-
/****************************************************************************************/
/* */
/* Defines */
@@ -33,10 +32,8 @@
#define VOL_TC_SHIFT 21 /* As a power of 2 */
#define DECAY_SHIFT 10 /* As a power of 2 */
-#ifdef BUILD_FLOAT
#define VOL_TC_FLOAT 2.0f /* As a power of 2 */
#define DECAY_FAC_FLOAT 64.0f /* As a power of 2 */
-#endif
/****************************************************************************************/
/* */
@@ -72,131 +69,6 @@
/* NOTES: */
/* */
/****************************************************************************************/
-#ifndef BUILD_FLOAT
-void AGC_MIX_VOL_2St1Mon_D32_WRA(AGC_MIX_VOL_2St1Mon_D32_t *pInstance, /* Instance pointer */
- const LVM_INT32 *pStSrc, /* Stereo source */
- const LVM_INT32 *pMonoSrc, /* Mono source */
- LVM_INT32 *pDst, /* Stereo destination */
- LVM_UINT16 NumSamples) /* Number of samples */
-{
-
- /*
- * General variables
- */
- LVM_UINT16 i; /* Sample index */
- LVM_INT32 Left; /* Left sample */
- LVM_INT32 Right; /* Right sample */
- LVM_INT32 Mono; /* Mono sample */
- LVM_INT32 AbsPeak; /* Absolute peak signal */
- LVM_INT32 HighWord; /* High word in intermediate calculations */
- LVM_INT32 LowWord; /* Low word in intermediate calculations */
- LVM_INT16 AGC_Mult; /* Short AGC gain */
- LVM_INT16 Vol_Mult; /* Short volume */
-
-
- /*
- * Instance control variables
- */
- LVM_INT32 AGC_Gain = pInstance->AGC_Gain; /* Get the current AGC gain */
- LVM_INT32 AGC_MaxGain = pInstance->AGC_MaxGain; /* Get maximum AGC gain */
- LVM_INT16 AGC_GainShift = pInstance->AGC_GainShift; /* Get the AGC shift */
- LVM_INT16 AGC_Attack = pInstance->AGC_Attack; /* Attack scaler */
- LVM_INT16 AGC_Decay = pInstance->AGC_Decay; /* Decay scaler */
- LVM_INT32 AGC_Target = pInstance->AGC_Target; /* Get the target level */
- LVM_INT32 Vol_Current = pInstance->Volume; /* Actual volume setting */
- LVM_INT32 Vol_Target = pInstance->Target; /* Target volume setting */
- LVM_INT16 Vol_Shift = pInstance->VolumeShift; /* Volume shift scaling */
- LVM_INT16 Vol_TC = pInstance->VolumeTC; /* Time constant */
-
-
- /*
- * Process on a sample by sample basis
- */
- for (i=0;i<NumSamples;i++) /* For each sample */
- {
-
- /*
- * Get the short scalers
- */
- AGC_Mult = (LVM_INT16)(AGC_Gain >> 16); /* Get the short AGC gain */
- Vol_Mult = (LVM_INT16)(Vol_Current >> 16); /* Get the short volume gain */
-
-
- /*
- * Get the input samples
- */
- Left = *pStSrc++; /* Get the left sample */
- Right = *pStSrc++; /* Get the right sample */
- Mono = *pMonoSrc++; /* Get the mono sample */
-
-
- /*
- * Apply the AGC gain to the mono input and mix with the stereo signal
- */
- HighWord = (AGC_Mult * (Mono >> 16)); /* signed long (Mono) by unsigned short (AGC_Mult) multiply */
- LowWord = (AGC_Mult * (Mono & 0xffff));
- Mono = (HighWord + (LowWord >> 16)) << (AGC_GainShift);
- Left += Mono; /* Mix in the mono signal */
- Right += Mono;
-
-
- /*
- * Apply the volume and write to the output stream
- */
- HighWord = (Vol_Mult * (Left >> 16)); /* signed long (Left) by unsigned short (Vol_Mult) multiply */
- LowWord = (Vol_Mult * (Left & 0xffff));
- Left = (HighWord + (LowWord >> 16)) << (Vol_Shift);
- HighWord = (Vol_Mult * (Right >> 16)); /* signed long (Right) by unsigned short (Vol_Mult) multiply */
- LowWord = (Vol_Mult * (Right & 0xffff));
- Right = (HighWord + (LowWord >> 16)) << (Vol_Shift);
- *pDst++ = Left; /* Save the results */
- *pDst++ = Right;
-
-
- /*
- * Update the AGC gain
- */
- AbsPeak = (Abs_32(Left)>Abs_32(Right)) ? Abs_32(Left) : Abs_32(Right); /* Get the absolute peak */
- if (AbsPeak > AGC_Target)
- {
- /*
- * The signal is too large so decrease the gain
- */
- HighWord = (AGC_Attack * (AGC_Gain >> 16)); /* signed long (AGC_Gain) by unsigned short (AGC_Attack) multiply */
- LowWord = (AGC_Attack * (AGC_Gain & 0xffff));
- AGC_Gain = (HighWord + (LowWord >> 16)) << 1;
- }
- else
- {
- /*
- * The signal is too small so increase the gain
- */
- if (AGC_Gain > AGC_MaxGain)
- {
- AGC_Gain -= (AGC_Decay << DECAY_SHIFT);
- }
- else
- {
- AGC_Gain += (AGC_Decay << DECAY_SHIFT);
- }
- }
-
- /*
- * Update the gain
- */
- Vol_Current += Vol_TC * ((Vol_Target - Vol_Current) >> VOL_TC_SHIFT);
- }
-
-
- /*
- * Update the parameters
- */
- pInstance->Volume = Vol_Current; /* Actual volume setting */
- pInstance->AGC_Gain = AGC_Gain;
-
- return;
-}
-#else
void AGC_MIX_VOL_2St1Mon_D32_WRA(AGC_MIX_VOL_2St1Mon_FLOAT_t *pInstance, /* Instance pointer */
const LVM_FLOAT *pStSrc, /* Stereo source */
const LVM_FLOAT *pMonoSrc, /* Mono source */
@@ -215,7 +87,6 @@
LVM_FLOAT AGC_Mult; /* Short AGC gain */
LVM_FLOAT Vol_Mult; /* Short volume */
-
/*
* Instance control variables
*/
@@ -228,7 +99,6 @@
LVM_FLOAT Vol_Target = pInstance->Target; /* Target volume setting */
LVM_FLOAT Vol_TC = pInstance->VolumeTC; /* Time constant */
-
/*
* Process on a sample by sample basis
*/
@@ -241,7 +111,6 @@
AGC_Mult = (LVM_FLOAT)(AGC_Gain); /* Get the short AGC gain */
Vol_Mult = (LVM_FLOAT)(Vol_Current); /* Get the short volume gain */
-
/*
* Get the input samples
*/
@@ -249,7 +118,6 @@
Right = *pStSrc++; /* Get the right sample */
Mono = *pMonoSrc++; /* Get the mono sample */
-
/*
* Apply the AGC gain to the mono input and mix with the stereo signal
*/
@@ -296,7 +164,6 @@
Vol_Current += (Vol_Target - Vol_Current) * ((LVM_FLOAT)Vol_TC / VOL_TC_FLOAT);
}
-
/*
* Update the parameters
*/
@@ -360,7 +227,6 @@
LVM_FLOAT AGC_Mult; /* Short AGC gain */
LVM_FLOAT Vol_Mult; /* Short volume */
-
/*
* Instance control variables
*/
@@ -374,7 +240,6 @@
LVM_FLOAT Vol_Target = pInstance->Target; /* Target volume setting */
LVM_FLOAT Vol_TC = pInstance->VolumeTC; /* Time constant */
-
/*
* Process on a sample by sample basis
*/
@@ -441,7 +306,6 @@
Vol_Current += (Vol_Target - Vol_Current) * ((LVM_FLOAT)Vol_TC / VOL_TC_FLOAT);
}
-
/*
* Update the parameters
*/
@@ -451,4 +315,3 @@
return;
}
#endif /*SUPPORT_MC*/
-#endif /*BUILD_FLOAT*/
diff --git a/media/libeffects/lvm/lib/Common/src/Abs_32.cpp b/media/libeffects/lvm/lib/Common/src/Abs_32.cpp
index 84fabd8..e013809 100644
--- a/media/libeffects/lvm/lib/Common/src/Abs_32.cpp
+++ b/media/libeffects/lvm/lib/Common/src/Abs_32.cpp
@@ -47,7 +47,6 @@
}
return input;
}
-#ifdef BUILD_FLOAT
LVM_FLOAT Abs_Float(LVM_FLOAT input)
{
if(input < 0)
@@ -57,4 +56,3 @@
}
return input;
}
-#endif
diff --git a/media/libeffects/lvm/lib/Common/src/Add2_Sat_32x32.cpp b/media/libeffects/lvm/lib/Common/src/Add2_Sat_32x32.cpp
index 66d6adb..a48e668 100644
--- a/media/libeffects/lvm/lib/Common/src/Add2_Sat_32x32.cpp
+++ b/media/libeffects/lvm/lib/Common/src/Add2_Sat_32x32.cpp
@@ -21,7 +21,6 @@
#include "VectorArithmetic.h"
-
/**********************************************************************************
FUNCTION ADD2_SAT_32X32
***********************************************************************************/
@@ -57,7 +56,6 @@
return;
}
-#ifdef BUILD_FLOAT
void Add2_Sat_Float( const LVM_FLOAT *src,
LVM_FLOAT *dst,
LVM_INT16 n )
@@ -85,5 +83,4 @@
}
return;
}
-#endif
/**********************************************************************************/
diff --git a/media/libeffects/lvm/lib/Common/src/BP_1I_D16F16C14_TRC_WRA_01.cpp b/media/libeffects/lvm/lib/Common/src/BP_1I_D16F16C14_TRC_WRA_01.cpp
index 88f9986..1a5e07f 100644
--- a/media/libeffects/lvm/lib/Common/src/BP_1I_D16F16C14_TRC_WRA_01.cpp
+++ b/media/libeffects/lvm/lib/Common/src/BP_1I_D16F16C14_TRC_WRA_01.cpp
@@ -19,7 +19,6 @@
#include "BP_1I_D16F16Css_TRC_WRA_01_Private.h"
#include "LVM_Macros.h"
-
/**************************************************************************
ASSUMPTIONS:
COEFS-
@@ -33,13 +32,11 @@
pBiquadState->pDelays[2] is y(n-1)L in Q0 format
pBiquadState->pDelays[3] is y(n-2)L in Q0 format
***************************************************************************/
-#ifdef BUILD_FLOAT
void BP_1I_D16F16C14_TRC_WRA_01 ( Biquad_FLOAT_Instance_t *pInstance,
LVM_FLOAT *pDataIn,
LVM_FLOAT *pDataOut,
LVM_INT16 NrSamples)
-
{
LVM_FLOAT ynL;
LVM_INT16 ii;
@@ -48,7 +45,6 @@
for (ii = NrSamples; ii != 0; ii--)
{
-
/**************************************************************************
PROCESSING OF THE LEFT CHANNEL
***************************************************************************/
@@ -77,50 +73,4 @@
}
}
-#else
-void BP_1I_D16F16C14_TRC_WRA_01 ( Biquad_Instance_t *pInstance,
- LVM_INT16 *pDataIn,
- LVM_INT16 *pDataOut,
- LVM_INT16 NrSamples)
-
-
- {
- LVM_INT32 ynL;
- LVM_INT16 ii;
- PFilter_State pBiquadState = (PFilter_State) pInstance;
-
- for (ii = NrSamples; ii != 0; ii--)
- {
-
-
- /**************************************************************************
- PROCESSING OF THE LEFT CHANNEL
- ***************************************************************************/
- // ynL= (A0 (Q14) * (x(n)L (Q0) - x(n-2)L (Q0) ) ) in Q14
- ynL=(LVM_INT32)pBiquadState->coefs[0]* ((*pDataIn)-pBiquadState->pDelays[1]);
-
- // ynL+= ((-B2 (Q14) * y(n-2)L (Q0) ) ) in Q14
- ynL+=(LVM_INT32)pBiquadState->coefs[1]*pBiquadState->pDelays[3];
-
- // ynL+= ((-B1 (Q30) * y(n-1)L (Q0) ) ) in Q14
- ynL+=(LVM_INT32)pBiquadState->coefs[2]*pBiquadState->pDelays[2];
-
- ynL=(LVM_INT16)(ynL>>14); // ynL in Q0
- /**************************************************************************
- UPDATING THE DELAYS
- ***************************************************************************/
- pBiquadState->pDelays[3]=pBiquadState->pDelays[2]; // y(n-2)L=y(n-1)L
- pBiquadState->pDelays[1]=pBiquadState->pDelays[0]; // x(n-2)L=x(n-1)L
- pBiquadState->pDelays[2]=ynL; // Update y(n-1)L in Q0
- pBiquadState->pDelays[0]=(*pDataIn++); // Update x(n-1)L in Q0
-
- /**************************************************************************
- WRITING THE OUTPUT
- ***************************************************************************/
- *pDataOut++=(LVM_INT16)ynL; // Write Left output in Q0
-
- }
-
- }
-#endif
diff --git a/media/libeffects/lvm/lib/Common/src/BP_1I_D16F16Css_TRC_WRA_01_Init.cpp b/media/libeffects/lvm/lib/Common/src/BP_1I_D16F16Css_TRC_WRA_01_Init.cpp
index 27ab57a..60b6c16 100644
--- a/media/libeffects/lvm/lib/Common/src/BP_1I_D16F16Css_TRC_WRA_01_Init.cpp
+++ b/media/libeffects/lvm/lib/Common/src/BP_1I_D16F16Css_TRC_WRA_01_Init.cpp
@@ -19,7 +19,6 @@
#include "BIQUAD.h"
#include "BP_1I_D16F16Css_TRC_WRA_01_Private.h"
-
/*-------------------------------------------------------------------------*/
/* FUNCTION: */
/* BP_1I_D16F16Css_TRC_WRA_01_Init */
@@ -38,7 +37,6 @@
/* RETURNS: */
/* void return code */
/*-------------------------------------------------------------------------*/
-#ifdef BUILD_FLOAT
void BP_1I_D16F16Css_TRC_WRA_01_Init ( Biquad_FLOAT_Instance_t *pInstance,
Biquad_1I_Order2_FLOAT_Taps_t *pTaps,
BP_FLOAT_Coefs_t *pCoef)
@@ -50,19 +48,6 @@
pBiquadState->coefs[1] = pCoef->B2;
pBiquadState->coefs[2] = pCoef->B1;
}
-#else
-void BP_1I_D16F16Css_TRC_WRA_01_Init ( Biquad_Instance_t *pInstance,
- Biquad_1I_Order2_Taps_t *pTaps,
- BP_C16_Coefs_t *pCoef)
-{
- PFilter_State pBiquadState = (PFilter_State) pInstance;
- pBiquadState->pDelays =(LVM_INT32 *) pTaps;
-
- pBiquadState->coefs[0]=pCoef->A0;
- pBiquadState->coefs[1]=pCoef->B2;
- pBiquadState->coefs[2]=pCoef->B1;
- }
-#endif
/*-------------------------------------------------------------------------*/
/* End Of File: BP_1I_D16F16Css_TRC_WRA_01_Init.c */
diff --git a/media/libeffects/lvm/lib/Common/src/BP_1I_D16F16Css_TRC_WRA_01_Private.h b/media/libeffects/lvm/lib/Common/src/BP_1I_D16F16Css_TRC_WRA_01_Private.h
index e194f92..8a000b6 100644
--- a/media/libeffects/lvm/lib/Common/src/BP_1I_D16F16Css_TRC_WRA_01_Private.h
+++ b/media/libeffects/lvm/lib/Common/src/BP_1I_D16F16Css_TRC_WRA_01_Private.h
@@ -27,7 +27,6 @@
typedef Filter_State * PFilter_State ;
-#ifdef BUILD_FLOAT
typedef struct _Filter_State_FLOAT
{
@@ -35,5 +34,4 @@
LVM_FLOAT coefs[3]; /* pointer to the filter coefficients */
}Filter_State_FLOAT;
typedef Filter_State_FLOAT * PFilter_State_FLOAT ;
-#endif
#endif /*_BP_1I_D16F16CSS_TRC_WRA_01_PRIVATE_H_*/
diff --git a/media/libeffects/lvm/lib/Common/src/BP_1I_D16F32C30_TRC_WRA_01.cpp b/media/libeffects/lvm/lib/Common/src/BP_1I_D16F32C30_TRC_WRA_01.cpp
index 3abdd43..c844d03 100644
--- a/media/libeffects/lvm/lib/Common/src/BP_1I_D16F32C30_TRC_WRA_01.cpp
+++ b/media/libeffects/lvm/lib/Common/src/BP_1I_D16F32C30_TRC_WRA_01.cpp
@@ -19,7 +19,6 @@
#include "BP_1I_D16F32Cll_TRC_WRA_01_Private.h"
#include "LVM_Macros.h"
-
/**************************************************************************
ASSUMPTIONS:
COEFS-
@@ -33,7 +32,6 @@
pBiquadState->pDelays[2] is y(n-1)L in Q16 format
pBiquadState->pDelays[3] is y(n-2)L in Q16 format
***************************************************************************/
-#ifdef BUILD_FLOAT
void BP_1I_D16F32C30_TRC_WRA_01 ( Biquad_FLOAT_Instance_t *pInstance,
LVM_FLOAT *pDataIn,
LVM_FLOAT *pDataOut,
@@ -74,51 +72,3 @@
*pDataOut++ = (ynL); // Write Left output
}
}
-#else
-void BP_1I_D16F32C30_TRC_WRA_01 ( Biquad_Instance_t *pInstance,
- LVM_INT16 *pDataIn,
- LVM_INT16 *pDataOut,
- LVM_INT16 NrSamples)
-
-
- {
- LVM_INT32 ynL,templ;
- LVM_INT16 ii;
- PFilter_State pBiquadState = (PFilter_State) pInstance;
-
- for (ii = NrSamples; ii != 0; ii--)
- {
-
-
- /**************************************************************************
- PROCESSING OF THE LEFT CHANNEL
- ***************************************************************************/
- // ynL= (A0 (Q30) * (x(n)L (Q0) - x(n-2)L (Q0) ) >>14) in Q16
- templ= (LVM_INT32) *pDataIn-pBiquadState->pDelays[1];
- MUL32x32INTO32(pBiquadState->coefs[0],templ,ynL,14)
-
- // ynL+= ((-B2 (Q30) * y(n-2)L (Q16) ) >>30) in Q16
- MUL32x32INTO32(pBiquadState->coefs[1],pBiquadState->pDelays[3],templ,30)
- ynL+=templ;
-
- // ynL+= ((-B1 (Q30) * y(n-1)L (Q16) ) >>30) in Q16
- MUL32x32INTO32(pBiquadState->coefs[2],pBiquadState->pDelays[2],templ,30)
- ynL+=templ;
-
- /**************************************************************************
- UPDATING THE DELAYS
- ***************************************************************************/
- pBiquadState->pDelays[3]=pBiquadState->pDelays[2]; // y(n-2)L=y(n-1)L
- pBiquadState->pDelays[1]=pBiquadState->pDelays[0]; // x(n-2)L=x(n-1)L
- pBiquadState->pDelays[2]=ynL; // Update y(n-1)L in Q16
- pBiquadState->pDelays[0]=(*pDataIn++); // Update x(n-1)L in Q0
-
- /**************************************************************************
- WRITING THE OUTPUT
- ***************************************************************************/
- *pDataOut++=(LVM_INT16)(ynL>>16); // Write Left output in Q0
-
- }
-
- }
-#endif
diff --git a/media/libeffects/lvm/lib/Common/src/BP_1I_D16F32Cll_TRC_WRA_01_Init.cpp b/media/libeffects/lvm/lib/Common/src/BP_1I_D16F32Cll_TRC_WRA_01_Init.cpp
index d6e047a..eb15032 100644
--- a/media/libeffects/lvm/lib/Common/src/BP_1I_D16F32Cll_TRC_WRA_01_Init.cpp
+++ b/media/libeffects/lvm/lib/Common/src/BP_1I_D16F32Cll_TRC_WRA_01_Init.cpp
@@ -19,7 +19,6 @@
#include "BIQUAD.h"
#include "BP_1I_D16F32Cll_TRC_WRA_01_Private.h"
-
/*-------------------------------------------------------------------------*/
/* FUNCTION: */
/* BP_1I_D16F32Cll_TRC_WRA_01_Init */
@@ -48,7 +47,6 @@
/* RETURNS: */
/* void return code */
/*-------------------------------------------------------------------------*/
-#ifdef BUILD_FLOAT
void BP_1I_D16F32Cll_TRC_WRA_01_Init ( Biquad_FLOAT_Instance_t *pInstance,
Biquad_1I_Order2_FLOAT_Taps_t *pTaps,
BP_FLOAT_Coefs_t *pCoef)
@@ -56,24 +54,10 @@
PFilter_State_FLOAT pBiquadState = (PFilter_State_FLOAT) pInstance;
pBiquadState->pDelays =(LVM_FLOAT *) pTaps;
-
pBiquadState->coefs[0] = pCoef->A0;
pBiquadState->coefs[1] = pCoef->B2;
pBiquadState->coefs[2] = pCoef->B1;
}
-#else
-void BP_1I_D16F32Cll_TRC_WRA_01_Init ( Biquad_Instance_t *pInstance,
- Biquad_1I_Order2_Taps_t *pTaps,
- BP_C32_Coefs_t *pCoef)
-{
- PFilter_State pBiquadState = (PFilter_State) pInstance;
- pBiquadState->pDelays =(LVM_INT32 *) pTaps;
-
- pBiquadState->coefs[0] = pCoef->A0;
- pBiquadState->coefs[1] = pCoef->B2;
- pBiquadState->coefs[2] = pCoef->B1;
-}
-#endif
/*-------------------------------------------------------------------------*/
/* End Of File: BP_1I_D16F32Cll_TRC_WRA_01_Init.c */
diff --git a/media/libeffects/lvm/lib/Common/src/BP_1I_D16F32Cll_TRC_WRA_01_Private.h b/media/libeffects/lvm/lib/Common/src/BP_1I_D16F32Cll_TRC_WRA_01_Private.h
index aa9e669..6d754e2 100644
--- a/media/libeffects/lvm/lib/Common/src/BP_1I_D16F32Cll_TRC_WRA_01_Private.h
+++ b/media/libeffects/lvm/lib/Common/src/BP_1I_D16F32Cll_TRC_WRA_01_Private.h
@@ -26,12 +26,10 @@
}Filter_State;
typedef Filter_State * PFilter_State ;
-#ifdef BUILD_FLOAT
typedef struct _Filter_State_FLOAT
{
LVM_FLOAT * pDelays; /* pointer to the delayed samples (data of 32 bits) */
LVM_FLOAT coefs[3]; /* pointer to the filter coefficients */
}Filter_State_Float;
typedef Filter_State_Float * PFilter_State_FLOAT ;
-#endif
#endif /*_BP_1I_D16F32CLL_TRC_WRA_01_PRIVATE_H_*/
diff --git a/media/libeffects/lvm/lib/Common/src/BP_1I_D32F32C30_TRC_WRA_02.cpp b/media/libeffects/lvm/lib/Common/src/BP_1I_D32F32C30_TRC_WRA_02.cpp
index abdb2f7..d0ba206 100644
--- a/media/libeffects/lvm/lib/Common/src/BP_1I_D32F32C30_TRC_WRA_02.cpp
+++ b/media/libeffects/lvm/lib/Common/src/BP_1I_D32F32C30_TRC_WRA_02.cpp
@@ -19,7 +19,6 @@
#include "BP_1I_D32F32Cll_TRC_WRA_02_Private.h"
#include "LVM_Macros.h"
-
/**************************************************************************
ASSUMPTIONS:
COEFS-
@@ -33,7 +32,6 @@
pBiquadState->pDelays[2] is y(n-1)L in Q0 format
pBiquadState->pDelays[3] is y(n-2)L in Q0 format
***************************************************************************/
-#ifdef BUILD_FLOAT
void BP_1I_D32F32C30_TRC_WRA_02 ( Biquad_FLOAT_Instance_t *pInstance,
LVM_FLOAT *pDataIn,
LVM_FLOAT *pDataOut,
@@ -46,7 +44,6 @@
for (ii = NrSamples; ii != 0; ii--)
{
-
/**************************************************************************
PROCESSING OF THE LEFT CHANNEL
***************************************************************************/
@@ -78,49 +75,3 @@
}
}
-#else
-void BP_1I_D32F32C30_TRC_WRA_02 ( Biquad_Instance_t *pInstance,
- LVM_INT32 *pDataIn,
- LVM_INT32 *pDataOut,
- LVM_INT16 NrSamples)
- {
- LVM_INT32 ynL,templ;
- LVM_INT16 ii;
- PFilter_State pBiquadState = (PFilter_State) pInstance;
-
- for (ii = NrSamples; ii != 0; ii--)
- {
-
-
- /**************************************************************************
- PROCESSING OF THE LEFT CHANNEL
- ***************************************************************************/
- // ynL= (A0 (Q30) * (x(n)L (Q0) - x(n-2)L (Q0) ) >>30) in Q0
- templ=(*pDataIn)-pBiquadState->pDelays[1];
- MUL32x32INTO32(pBiquadState->coefs[0],templ,ynL,30)
-
- // ynL+= ((-B2 (Q30) * y(n-2)L (Q0) ) >>30) in Q0
- MUL32x32INTO32(pBiquadState->coefs[1],pBiquadState->pDelays[3],templ,30)
- ynL+=templ;
-
- // ynL+= ((-B1 (Q30) * y(n-1)L (Q0) ) >>30) in Q0
- MUL32x32INTO32(pBiquadState->coefs[2],pBiquadState->pDelays[2],templ,30)
- ynL+=templ;
-
- /**************************************************************************
- UPDATING THE DELAYS
- ***************************************************************************/
- pBiquadState->pDelays[3]=pBiquadState->pDelays[2]; // y(n-2)L=y(n-1)L
- pBiquadState->pDelays[1]=pBiquadState->pDelays[0]; // x(n-2)L=x(n-1)L
- pBiquadState->pDelays[2]=ynL; // Update y(n-1)L in Q0
- pBiquadState->pDelays[0]=(*pDataIn++); // Update x(n-1)L in Q0
-
- /**************************************************************************
- WRITING THE OUTPUT
- ***************************************************************************/
- *pDataOut++=ynL; // Write Left output in Q0
-
- }
-
- }
-#endif
diff --git a/media/libeffects/lvm/lib/Common/src/BP_1I_D32F32Cll_TRC_WRA_02_Init.cpp b/media/libeffects/lvm/lib/Common/src/BP_1I_D32F32Cll_TRC_WRA_02_Init.cpp
index 5590c32..6f7d0b5 100644
--- a/media/libeffects/lvm/lib/Common/src/BP_1I_D32F32Cll_TRC_WRA_02_Init.cpp
+++ b/media/libeffects/lvm/lib/Common/src/BP_1I_D32F32Cll_TRC_WRA_02_Init.cpp
@@ -37,7 +37,6 @@
/* RETURNS: */
/* void return code */
/*-------------------------------------------------------------------------*/
-#ifdef BUILD_FLOAT
void BP_1I_D32F32Cll_TRC_WRA_02_Init ( Biquad_FLOAT_Instance_t *pInstance,
Biquad_1I_Order2_FLOAT_Taps_t *pTaps,
BP_FLOAT_Coefs_t *pCoef)
@@ -51,21 +50,6 @@
pBiquadState->coefs[2] = pCoef->B1;
}
-#else
-void BP_1I_D32F32Cll_TRC_WRA_02_Init ( Biquad_Instance_t *pInstance,
- Biquad_1I_Order2_Taps_t *pTaps,
- BP_C32_Coefs_t *pCoef)
-{
- PFilter_State pBiquadState = (PFilter_State) pInstance;
- pBiquadState->pDelays =(LVM_INT32 *) pTaps;
-
- pBiquadState->coefs[0]=pCoef->A0;
-
- pBiquadState->coefs[1]=pCoef->B2;
-
- pBiquadState->coefs[2]=pCoef->B1;
-}
-#endif
/*-------------------------------------------------------------------------*/
/* End Of File: BP_1I_D32F32Cll_TRC_WRA_02_Init.c */
diff --git a/media/libeffects/lvm/lib/Common/src/BP_1I_D32F32Cll_TRC_WRA_02_Private.h b/media/libeffects/lvm/lib/Common/src/BP_1I_D32F32Cll_TRC_WRA_02_Private.h
index 80c3920..9f1c66a 100644
--- a/media/libeffects/lvm/lib/Common/src/BP_1I_D32F32Cll_TRC_WRA_02_Private.h
+++ b/media/libeffects/lvm/lib/Common/src/BP_1I_D32F32Cll_TRC_WRA_02_Private.h
@@ -26,13 +26,11 @@
}Filter_State;
typedef Filter_State * PFilter_State ;
-#ifdef BUILD_FLOAT
typedef struct _Filter_State_FLOAT
{
LVM_FLOAT * pDelays; /* pointer to the delayed samples (data of 32 bits) */
LVM_FLOAT coefs[3]; /* pointer to the filter coefficients */
}Filter_State_Float;
typedef Filter_State_Float* PFilter_State_FLOAT ;
-#endif
#endif /*_BP_1I_D32F32CLL_TRC_WRA_02_PRIVATE_H_*/
diff --git a/media/libeffects/lvm/lib/Common/src/BQ_1I_D16F16C15_TRC_WRA_01.cpp b/media/libeffects/lvm/lib/Common/src/BQ_1I_D16F16C15_TRC_WRA_01.cpp
index ee9bf7a..9aecc40 100644
--- a/media/libeffects/lvm/lib/Common/src/BQ_1I_D16F16C15_TRC_WRA_01.cpp
+++ b/media/libeffects/lvm/lib/Common/src/BQ_1I_D16F16C15_TRC_WRA_01.cpp
@@ -32,7 +32,6 @@
pBiquadState->pDelays[2] is y(n-1)L in Q0 format
pBiquadState->pDelays[3] is y(n-2)L in Q0 format
***************************************************************************/
-#ifdef BUILD_FLOAT
void BQ_1I_D16F16C15_TRC_WRA_01 ( Biquad_FLOAT_Instance_t *pInstance,
LVM_FLOAT *pDataIn,
LVM_FLOAT *pDataOut,
@@ -45,7 +44,6 @@
for (ii = NrSamples; ii != 0; ii--)
{
-
/**************************************************************************
PROCESSING OF THE LEFT CHANNEL
***************************************************************************/
@@ -77,58 +75,6 @@
***************************************************************************/
*pDataOut++ = (LVM_FLOAT)ynL; // Write Left output in Q0
-
}
}
-#else
-void BQ_1I_D16F16C15_TRC_WRA_01 ( Biquad_Instance_t *pInstance,
- LVM_INT16 *pDataIn,
- LVM_INT16 *pDataOut,
- LVM_INT16 NrSamples)
- {
- LVM_INT32 ynL;
- LVM_INT16 ii;
- PFilter_State pBiquadState = (PFilter_State) pInstance;
-
- for (ii = NrSamples; ii != 0; ii--)
- {
-
-
- /**************************************************************************
- PROCESSING OF THE LEFT CHANNEL
- ***************************************************************************/
- // ynL=A2 (Q15) * x(n-2)L (Q0) in Q15
- ynL=(LVM_INT32)pBiquadState->coefs[0]* pBiquadState->pDelays[1];
-
- // ynL+=A1 (Q15) * x(n-1)L (Q0) in Q15
- ynL+=(LVM_INT32)pBiquadState->coefs[1]* pBiquadState->pDelays[0];
-
- // ynL+=A0 (Q15) * x(n)L (Q0) in Q15
- ynL+=(LVM_INT32)pBiquadState->coefs[2]* (*pDataIn);
-
- // ynL+= (-B2 (Q15) * y(n-2)L (Q0) ) in Q15
- ynL+=(LVM_INT32)pBiquadState->coefs[3]*pBiquadState->pDelays[3];
-
- // ynL+= (-B1 (Q15) * y(n-1)L (Q0) ) in Q15
- ynL+=(LVM_INT32)pBiquadState->coefs[4]*pBiquadState->pDelays[2];
-
- ynL=ynL>>15; // ynL in Q0 format
- /**************************************************************************
- UPDATING THE DELAYS
- ***************************************************************************/
- pBiquadState->pDelays[3]=pBiquadState->pDelays[2]; // y(n-2)L=y(n-1)L
- pBiquadState->pDelays[1]=pBiquadState->pDelays[0]; // x(n-2)L=x(n-1)L
- pBiquadState->pDelays[2]=ynL; // Update y(n-1)L in Q0
- pBiquadState->pDelays[0]=(*pDataIn++); // Update x(n-1)L in Q0
-
- /**************************************************************************
- WRITING THE OUTPUT
- ***************************************************************************/
- *pDataOut++=(LVM_INT16)ynL; // Write Left output in Q0
-
-
- }
-
- }
-#endif
diff --git a/media/libeffects/lvm/lib/Common/src/BQ_1I_D16F16Css_TRC_WRA_01_Init.cpp b/media/libeffects/lvm/lib/Common/src/BQ_1I_D16F16Css_TRC_WRA_01_Init.cpp
index 3d5befa..f0b5d06 100644
--- a/media/libeffects/lvm/lib/Common/src/BQ_1I_D16F16Css_TRC_WRA_01_Init.cpp
+++ b/media/libeffects/lvm/lib/Common/src/BQ_1I_D16F16Css_TRC_WRA_01_Init.cpp
@@ -37,7 +37,6 @@
/* RETURNS: */
/* void return code */
/*-------------------------------------------------------------------------*/
-#ifdef BUILD_FLOAT
void BQ_1I_D16F16Css_TRC_WRA_01_Init ( Biquad_FLOAT_Instance_t *pInstance,
Biquad_1I_Order2_FLOAT_Taps_t *pTaps,
BQ_FLOAT_Coefs_t *pCoef)
@@ -56,27 +55,6 @@
temp = pCoef->B1;
pBiquadState->coefs[4] = temp;
}
-#else
-void BQ_1I_D16F16Css_TRC_WRA_01_Init ( Biquad_Instance_t *pInstance,
- Biquad_1I_Order2_Taps_t *pTaps,
- BQ_C16_Coefs_t *pCoef)
-{
- LVM_INT16 temp;
- PFilter_State pBiquadState = (PFilter_State) pInstance;
- pBiquadState->pDelays =(LVM_INT32 *) pTaps ;
-
- temp=pCoef->A2;
- pBiquadState->coefs[0]=temp;
- temp=pCoef->A1;
- pBiquadState->coefs[1]=temp;
- temp=pCoef->A0;
- pBiquadState->coefs[2]=temp;
- temp=pCoef->B2;
- pBiquadState->coefs[3]=temp;
- temp=pCoef->B1;
- pBiquadState->coefs[4]=temp;
-}
-#endif
/*-------------------------------------------------------------------------*/
/* End Of File: BQ_1I_D16F16Css_TRC_WRA_01_Init.c */
diff --git a/media/libeffects/lvm/lib/Common/src/BQ_1I_D16F16Css_TRC_WRA_01_Private.h b/media/libeffects/lvm/lib/Common/src/BQ_1I_D16F16Css_TRC_WRA_01_Private.h
index 811da8b..fad345d 100644
--- a/media/libeffects/lvm/lib/Common/src/BQ_1I_D16F16Css_TRC_WRA_01_Private.h
+++ b/media/libeffects/lvm/lib/Common/src/BQ_1I_D16F16Css_TRC_WRA_01_Private.h
@@ -27,7 +27,6 @@
typedef Filter_State * PFilter_State ;
-#ifdef BUILD_FLOAT
typedef struct _Filter_State_FLOAT
{
LVM_FLOAT * pDelays; /* pointer to the delayed samples (data of 32 bits) */
@@ -35,5 +34,4 @@
}Filter_State_FLOAT;
typedef Filter_State_FLOAT * PFilter_State_FLOAT ;
-#endif
#endif /*_BQ_1I_D16F16CSS_TRC_WRA_01_PRIVATE_H_ */
diff --git a/media/libeffects/lvm/lib/Common/src/BQ_1I_D16F32C14_TRC_WRA_01.cpp b/media/libeffects/lvm/lib/Common/src/BQ_1I_D16F32C14_TRC_WRA_01.cpp
index c74a137..043bc5f 100644
--- a/media/libeffects/lvm/lib/Common/src/BQ_1I_D16F32C14_TRC_WRA_01.cpp
+++ b/media/libeffects/lvm/lib/Common/src/BQ_1I_D16F32C14_TRC_WRA_01.cpp
@@ -32,7 +32,6 @@
pBiquadState->pDelays[2] is y(n-1)L in Q16 format
pBiquadState->pDelays[3] is y(n-2)L in Q16 format
***************************************************************************/
-#ifdef BUILD_FLOAT
void BQ_1I_D16F32C14_TRC_WRA_01 ( Biquad_FLOAT_Instance_t *pInstance,
LVM_FLOAT *pDataIn,
LVM_FLOAT *pDataOut,
@@ -45,7 +44,6 @@
for (ii = NrSamples; ii != 0; ii--)
{
-
/**************************************************************************
PROCESSING OF THE LEFT CHANNEL
***************************************************************************/
@@ -79,53 +77,3 @@
}
}
-#else
-void BQ_1I_D16F32C14_TRC_WRA_01 ( Biquad_Instance_t *pInstance,
- LVM_INT16 *pDataIn,
- LVM_INT16 *pDataOut,
- LVM_INT16 NrSamples)
- {
- LVM_INT32 ynL,templ;
- LVM_INT16 ii;
- PFilter_State pBiquadState = (PFilter_State) pInstance;
-
- for (ii = NrSamples; ii != 0; ii--)
- {
-
-
- /**************************************************************************
- PROCESSING OF THE LEFT CHANNEL
- ***************************************************************************/
- // ynL=A2 (Q14) * x(n-2)L (Q0) in Q14
- ynL=(LVM_INT32)pBiquadState->coefs[0]* pBiquadState->pDelays[1];
-
- // ynL+=A1 (Q14) * x(n-1)L (Q0) in Q14
- ynL+=(LVM_INT32)pBiquadState->coefs[1]* pBiquadState->pDelays[0];
-
- // ynL+=A0 (Q14) * x(n)L (Q0) in Q14
- ynL+=(LVM_INT32)pBiquadState->coefs[2]* (*pDataIn);
-
- // ynL+= ( (-B2 (Q14) * y(n-2)L (Q16) )>>16) in Q14
- MUL32x16INTO32(pBiquadState->pDelays[3],pBiquadState->coefs[3],templ,16)
- ynL+=templ;
-
- // ynL+= ( (-B1 (Q14) * y(n-1)L (Q16) )>>16) in Q14
- MUL32x16INTO32(pBiquadState->pDelays[2],pBiquadState->coefs[4],templ,16)
- ynL+=templ;
-
- /**************************************************************************
- UPDATING THE DELAYS
- ***************************************************************************/
- pBiquadState->pDelays[3]=pBiquadState->pDelays[2]; // y(n-2)L=y(n-1)L
- pBiquadState->pDelays[1]=pBiquadState->pDelays[0]; // x(n-2)L=x(n-1)L
- pBiquadState->pDelays[2]=ynL<<2; // Update y(n-1)L in Q16
- pBiquadState->pDelays[0]=(*pDataIn++); // Update x(n-1)L in Q0
-
- /**************************************************************************
- WRITING THE OUTPUT
- ***************************************************************************/
- *pDataOut++=(LVM_INT16)(ynL>>14); // Write Left output in Q0
-
- }
- }
-#endif
diff --git a/media/libeffects/lvm/lib/Common/src/BQ_1I_D16F32Css_TRC_WRA_01_Private.h b/media/libeffects/lvm/lib/Common/src/BQ_1I_D16F32Css_TRC_WRA_01_Private.h
index 9812274..6a61d9a 100644
--- a/media/libeffects/lvm/lib/Common/src/BQ_1I_D16F32Css_TRC_WRA_01_Private.h
+++ b/media/libeffects/lvm/lib/Common/src/BQ_1I_D16F32Css_TRC_WRA_01_Private.h
@@ -27,7 +27,6 @@
typedef Filter_State * PFilter_State ;
-#ifdef BUILD_FLOAT
typedef struct _Filter_State_FLOAT
{
LVM_FLOAT * pDelays; /* pointer to the delayed samples (data of 32 bits) */
@@ -35,5 +34,4 @@
}Filter_State_FLOAT;
typedef Filter_State_FLOAT * PFilter_State_FLOAT ;
-#endif
#endif /*_BQ_1I_D16F32CSS_TRC_WRA_01_PRIVATE_H_*/
diff --git a/media/libeffects/lvm/lib/Common/src/BQ_1I_D16F32Css_TRC_WRA_01_init.cpp b/media/libeffects/lvm/lib/Common/src/BQ_1I_D16F32Css_TRC_WRA_01_init.cpp
index feae20d..2b80691 100644
--- a/media/libeffects/lvm/lib/Common/src/BQ_1I_D16F32Css_TRC_WRA_01_init.cpp
+++ b/media/libeffects/lvm/lib/Common/src/BQ_1I_D16F32Css_TRC_WRA_01_init.cpp
@@ -19,7 +19,6 @@
#include "BIQUAD.h"
#include "BQ_1I_D16F32Css_TRC_WRA_01_Private.h"
-
/*-------------------------------------------------------------------------*/
/* FUNCTION: */
/* BQ_1I_D16F32Css_TRC_WRA_01_Init */
@@ -38,7 +37,6 @@
/* RETURNS: */
/* void return code */
/*-------------------------------------------------------------------------*/
-#ifdef BUILD_FLOAT
void BQ_1I_D16F32Css_TRC_WRA_01_Init ( Biquad_FLOAT_Instance_t *pInstance,
Biquad_1I_Order2_FLOAT_Taps_t *pTaps,
BQ_FLOAT_Coefs_t *pCoef)
@@ -58,27 +56,6 @@
temp = pCoef->B1;
pBiquadState->coefs[4] = temp;
}
-#else
-void BQ_1I_D16F32Css_TRC_WRA_01_Init ( Biquad_Instance_t *pInstance,
- Biquad_1I_Order2_Taps_t *pTaps,
- BQ_C16_Coefs_t *pCoef)
-{
- LVM_INT16 temp;
- PFilter_State pBiquadState = (PFilter_State) pInstance;
- pBiquadState->pDelays =(LVM_INT32 *) pTaps ;
-
- temp=pCoef->A2;
- pBiquadState->coefs[0]=temp;
- temp=pCoef->A1;
- pBiquadState->coefs[1]=temp;
- temp=pCoef->A0;
- pBiquadState->coefs[2]=temp;
- temp=pCoef->B2;
- pBiquadState->coefs[3]=temp;
- temp=pCoef->B1;
- pBiquadState->coefs[4]=temp;
-}
-#endif
/*-------------------------------------------------------------------------*/
/* End Of File: BQ_1I_D16F32Css_TRC_WRA_01_Init */
diff --git a/media/libeffects/lvm/lib/Common/src/BQ_2I_D16F16C14_TRC_WRA_01.cpp b/media/libeffects/lvm/lib/Common/src/BQ_2I_D16F16C14_TRC_WRA_01.cpp
index 8ee76c9..51cd918 100644
--- a/media/libeffects/lvm/lib/Common/src/BQ_2I_D16F16C14_TRC_WRA_01.cpp
+++ b/media/libeffects/lvm/lib/Common/src/BQ_2I_D16F16C14_TRC_WRA_01.cpp
@@ -19,7 +19,6 @@
#include "BQ_2I_D16F16Css_TRC_WRA_01_Private.h"
#include "LVM_Macros.h"
-
/**************************************************************************
ASSUMPTIONS:
COEFS-
@@ -37,7 +36,6 @@
pBiquadState->pDelays[6] is y(n-2)L in Q0 format
pBiquadState->pDelays[7] is y(n-2)R in Q0 format
***************************************************************************/
-#ifdef BUILD_FLOAT
void BQ_2I_D16F16C14_TRC_WRA_01 ( Biquad_FLOAT_Instance_t *pInstance,
LVM_FLOAT *pDataIn,
LVM_FLOAT *pDataOut,
@@ -68,8 +66,6 @@
// ynL+=( -B1 * y(n-1)L )
ynL += (LVM_FLOAT)pBiquadState->coefs[4] * pBiquadState->pDelays[4];
-
-
/**************************************************************************
PROCESSING OF THE RIGHT CHANNEL
***************************************************************************/
@@ -88,7 +84,6 @@
// ynR+=( -B1 * y(n-1)R )
ynR += (LVM_FLOAT)pBiquadState->coefs[4] * pBiquadState->pDelays[5];
-
/**************************************************************************
UPDATING THE DELAYS
***************************************************************************/
@@ -107,83 +102,6 @@
*pDataOut++ = (LVM_FLOAT)ynL; // Write Left output
*pDataOut++ = (LVM_FLOAT)ynR; // Write Right ouput
-
}
}
-#else
-void BQ_2I_D16F16C14_TRC_WRA_01 ( Biquad_Instance_t *pInstance,
- LVM_INT16 *pDataIn,
- LVM_INT16 *pDataOut,
- LVM_INT16 NrSamples)
- {
- LVM_INT32 ynL,ynR;
- LVM_INT16 ii;
- PFilter_State pBiquadState = (PFilter_State) pInstance;
-
- for (ii = NrSamples; ii != 0; ii--)
- {
-
- /**************************************************************************
- PROCESSING OF THE LEFT CHANNEL
- ***************************************************************************/
- // ynL=A2 (Q14) * x(n-2)L (Q0) in Q14
- ynL=(LVM_INT32)pBiquadState->coefs[0]* pBiquadState->pDelays[2];
-
- // ynL+=A1 (Q14) * x(n-1)L (Q0) in Q14
- ynL+=(LVM_INT32)pBiquadState->coefs[1]* pBiquadState->pDelays[0];
-
- // ynL+=A0 (Q14) * x(n)L (Q0) in Q14
- ynL+=(LVM_INT32)pBiquadState->coefs[2]* (*pDataIn);
-
- // ynL+= ( -B2 (Q14) * y(n-2)L (Q0) ) in Q14
- ynL+=(LVM_INT32)pBiquadState->coefs[3]*pBiquadState->pDelays[6];
-
- // ynL+=( -B1 (Q14) * y(n-1)L (Q0) ) in Q14
- ynL+=(LVM_INT32)pBiquadState->coefs[4]*pBiquadState->pDelays[4];
-
- ynL=ynL>>14; // ynL in Q0 format
-
- /**************************************************************************
- PROCESSING OF THE RIGHT CHANNEL
- ***************************************************************************/
- // ynR=A2 (Q14) * x(n-2)R (Q0) in Q14
- ynR=(LVM_INT32)pBiquadState->coefs[0]*pBiquadState->pDelays[3];
-
- // ynR+=A1 (Q14) * x(n-1)R (Q0) in Q14
- ynR+=(LVM_INT32)pBiquadState->coefs[1]*pBiquadState->pDelays[1];
-
- // ynR+=A0 (Q14) * x(n)R (Q0) in Q14
- ynR+=(LVM_INT32)pBiquadState->coefs[2]*(*(pDataIn+1));
-
- // ynR+= ( -B2 (Q14) * y(n-2)R (Q0) ) in Q14
- ynR+=(LVM_INT32)pBiquadState->coefs[3]*pBiquadState->pDelays[7];
-
- // ynR+=( -B1 (Q14) * y(n-1)R (Q0) ) in Q14
- ynR+=(LVM_INT32)pBiquadState->coefs[4]*pBiquadState->pDelays[5];
-
- ynR=ynR>>14; // ynL in Q0 format
- /**************************************************************************
- UPDATING THE DELAYS
- ***************************************************************************/
- pBiquadState->pDelays[7]=pBiquadState->pDelays[5]; // y(n-2)R=y(n-1)R
- pBiquadState->pDelays[6]=pBiquadState->pDelays[4]; // y(n-2)L=y(n-1)L
- pBiquadState->pDelays[3]=pBiquadState->pDelays[1]; // x(n-2)R=x(n-1)R
- pBiquadState->pDelays[2]=pBiquadState->pDelays[0]; // x(n-2)L=x(n-1)L
- pBiquadState->pDelays[5]=ynR; // Update y(n-1)R in Q0
- pBiquadState->pDelays[4]=ynL; // Update y(n-1)L in Q0
- pBiquadState->pDelays[0]=(*pDataIn++); // Update x(n-1)L in Q0
- pBiquadState->pDelays[1]=(*pDataIn++); // Update x(n-1)R in Q0
-
- /**************************************************************************
- WRITING THE OUTPUT
- ***************************************************************************/
- *pDataOut++=(LVM_INT16)ynL; // Write Left output in Q0
- *pDataOut++=(LVM_INT16)ynR; // Write Right ouput in Q0
-
-
- }
-
- }
-
-#endif
diff --git a/media/libeffects/lvm/lib/Common/src/BQ_2I_D16F16C15_TRC_WRA_01.cpp b/media/libeffects/lvm/lib/Common/src/BQ_2I_D16F16C15_TRC_WRA_01.cpp
index f24db8f..8f74749 100644
--- a/media/libeffects/lvm/lib/Common/src/BQ_2I_D16F16C15_TRC_WRA_01.cpp
+++ b/media/libeffects/lvm/lib/Common/src/BQ_2I_D16F16C15_TRC_WRA_01.cpp
@@ -19,7 +19,6 @@
#include "BQ_2I_D16F16Css_TRC_WRA_01_Private.h"
#include "LVM_Macros.h"
-
/**************************************************************************
ASSUMPTIONS:
COEFS-
@@ -37,7 +36,6 @@
pBiquadState->pDelays[6] is y(n-2)L in Q0 format
pBiquadState->pDelays[7] is y(n-2)R in Q0 format
***************************************************************************/
-#ifdef BUILD_FLOAT
void BQ_2I_D16F16C15_TRC_WRA_01 ( Biquad_FLOAT_Instance_t *pInstance,
LVM_FLOAT *pDataIn,
LVM_FLOAT *pDataOut,
@@ -50,7 +48,6 @@
for (ii = NrSamples; ii != 0; ii--)
{
-
/**************************************************************************
PROCESSING OF THE LEFT CHANNEL
***************************************************************************/
@@ -69,8 +66,6 @@
// ynL+=( -B1 * y(n-1)L
ynL += (LVM_FLOAT)pBiquadState->coefs[4] * pBiquadState->pDelays[4];
-
-
/**************************************************************************
PROCESSING OF THE RIGHT CHANNEL
***************************************************************************/
@@ -89,7 +84,6 @@
// ynR+=( -B1 * y(n-1)R )
ynR += (LVM_FLOAT)pBiquadState->coefs[4] * pBiquadState->pDelays[5];
-
/**************************************************************************
UPDATING THE DELAYS
***************************************************************************/
@@ -111,78 +105,3 @@
}
}
-#else
-void BQ_2I_D16F16C15_TRC_WRA_01 ( Biquad_Instance_t *pInstance,
- LVM_INT16 *pDataIn,
- LVM_INT16 *pDataOut,
- LVM_INT16 NrSamples)
- {
- LVM_INT32 ynL,ynR;
- LVM_INT16 ii;
- PFilter_State pBiquadState = (PFilter_State) pInstance;
-
- for (ii = NrSamples; ii != 0; ii--)
- {
-
-
- /**************************************************************************
- PROCESSING OF THE LEFT CHANNEL
- ***************************************************************************/
- // ynL=A2 (Q15) * x(n-2)L (Q0) in Q15
- ynL=(LVM_INT32)pBiquadState->coefs[0]* pBiquadState->pDelays[2];
-
- // ynL+=A1 (Q15) * x(n-1)L (Q0) in Q15
- ynL+=(LVM_INT32)pBiquadState->coefs[1]* pBiquadState->pDelays[0];
-
- // ynL+=A0 (Q15) * x(n)L (Q0) in Q15
- ynL+=(LVM_INT32)pBiquadState->coefs[2]* (*pDataIn);
-
- // ynL+= ( -B2 (Q15) * y(n-2)L (Q0) ) in Q15
- ynL+=(LVM_INT32)pBiquadState->coefs[3]*pBiquadState->pDelays[6];
-
- // ynL+=( -B1 (Q15) * y(n-1)L (Q0) ) in Q15
- ynL+=(LVM_INT32)pBiquadState->coefs[4]*pBiquadState->pDelays[4];
-
- ynL=ynL>>15; // ynL in Q0 format
-
- /**************************************************************************
- PROCESSING OF THE RIGHT CHANNEL
- ***************************************************************************/
- // ynR=A2 (Q15) * x(n-2)R (Q0) in Q15
- ynR=(LVM_INT32)pBiquadState->coefs[0]*pBiquadState->pDelays[3];
-
- // ynR+=A1 (Q15) * x(n-1)R (Q0) in Q15
- ynR+=(LVM_INT32)pBiquadState->coefs[1]*pBiquadState->pDelays[1];
-
- // ynR+=A0 (Q15) * x(n)R (Q0) in Q15
- ynR+=(LVM_INT32)pBiquadState->coefs[2]*(*(pDataIn+1));
-
- // ynR+= ( -B2 (Q15) * y(n-2)R (Q0) ) in Q15
- ynR+=(LVM_INT32)pBiquadState->coefs[3]*pBiquadState->pDelays[7];
-
- // ynR+=( -B1 (Q15) * y(n-1)R (Q0) ) in Q15
- ynR+=(LVM_INT32)pBiquadState->coefs[4]*pBiquadState->pDelays[5];
-
- ynR=ynR>>15; // ynL in Q0 format
- /**************************************************************************
- UPDATING THE DELAYS
- ***************************************************************************/
- pBiquadState->pDelays[7]=pBiquadState->pDelays[5]; // y(n-2)R=y(n-1)R
- pBiquadState->pDelays[6]=pBiquadState->pDelays[4]; // y(n-2)L=y(n-1)L
- pBiquadState->pDelays[3]=pBiquadState->pDelays[1]; // x(n-2)R=x(n-1)R
- pBiquadState->pDelays[2]=pBiquadState->pDelays[0]; // x(n-2)L=x(n-1)L
- pBiquadState->pDelays[5]=ynR; // Update y(n-1)R in Q0
- pBiquadState->pDelays[4]=ynL; // Update y(n-1)L in Q0
- pBiquadState->pDelays[0]=(*pDataIn++); // Update x(n-1)L in Q0
- pBiquadState->pDelays[1]=(*pDataIn++); // Update x(n-1)R in Q0
-
- /**************************************************************************
- WRITING THE OUTPUT
- ***************************************************************************/
- *pDataOut++=(LVM_INT16)ynL; // Write Left output in Q0
- *pDataOut++=(LVM_INT16)ynR; // Write Right ouput in Q0
-
- }
-
- }
-#endif
diff --git a/media/libeffects/lvm/lib/Common/src/BQ_2I_D16F16Css_TRC_WRA_01_Init.cpp b/media/libeffects/lvm/lib/Common/src/BQ_2I_D16F16Css_TRC_WRA_01_Init.cpp
index 39e1bda..987cbcf 100644
--- a/media/libeffects/lvm/lib/Common/src/BQ_2I_D16F16Css_TRC_WRA_01_Init.cpp
+++ b/media/libeffects/lvm/lib/Common/src/BQ_2I_D16F16Css_TRC_WRA_01_Init.cpp
@@ -19,7 +19,6 @@
#include "BIQUAD.h"
#include "BQ_2I_D16F16Css_TRC_WRA_01_Private.h"
-
/*-------------------------------------------------------------------------*/
/* FUNCTION: */
/* BQ_2I_D16F16Css_TRC_WRA_01_Init */
@@ -38,7 +37,6 @@
/* RETURNS: */
/* void return code */
/*-------------------------------------------------------------------------*/
-#ifdef BUILD_FLOAT
void BQ_2I_D16F16Css_TRC_WRA_01_Init ( Biquad_FLOAT_Instance_t *pInstance,
Biquad_2I_Order2_FLOAT_Taps_t *pTaps,
BQ_FLOAT_Coefs_t *pCoef)
@@ -58,27 +56,6 @@
temp = pCoef->B1;
pBiquadState->coefs[4] = temp;
}
-#else
-void BQ_2I_D16F16Css_TRC_WRA_01_Init ( Biquad_Instance_t *pInstance,
- Biquad_2I_Order2_Taps_t *pTaps,
- BQ_C16_Coefs_t *pCoef)
-{
- LVM_INT16 temp;
- PFilter_State pBiquadState = (PFilter_State) pInstance;
- pBiquadState->pDelays =(LVM_INT32 *) pTaps ;
-
- temp=pCoef->A2;
- pBiquadState->coefs[0]=temp;
- temp=pCoef->A1;
- pBiquadState->coefs[1]=temp;
- temp=pCoef->A0;
- pBiquadState->coefs[2]=temp;
- temp=pCoef->B2;
- pBiquadState->coefs[3]=temp;
- temp=pCoef->B1;
- pBiquadState->coefs[4]=temp;
-}
-#endif
/*-------------------------------------------------------------------------*/
/* End Of File: BQ_2I_D16F16Css_TRC_WRA_01_Init.c */
diff --git a/media/libeffects/lvm/lib/Common/src/BQ_2I_D16F16Css_TRC_WRA_01_Private.h b/media/libeffects/lvm/lib/Common/src/BQ_2I_D16F16Css_TRC_WRA_01_Private.h
index 0691b8c..5a9a0e9 100644
--- a/media/libeffects/lvm/lib/Common/src/BQ_2I_D16F16Css_TRC_WRA_01_Private.h
+++ b/media/libeffects/lvm/lib/Common/src/BQ_2I_D16F16Css_TRC_WRA_01_Private.h
@@ -28,7 +28,6 @@
typedef Filter_State * PFilter_State ;
-#ifdef BUILD_FLOAT
typedef struct _Filter_State_FLOAT
{
LVM_FLOAT * pDelays; /* pointer to the delayed samples (data of 32 bits) */
@@ -36,6 +35,5 @@
}Filter_State_FLOAT;
typedef Filter_State_FLOAT * PFilter_State_FLOAT ;
-#endif
#endif /* _BQ_2I_D16F16CSS_TRC_WRA_01_PRIVATE_H_ */
diff --git a/media/libeffects/lvm/lib/Common/src/BQ_2I_D16F32C13_TRC_WRA_01.cpp b/media/libeffects/lvm/lib/Common/src/BQ_2I_D16F32C13_TRC_WRA_01.cpp
index 61c07c7..331c97f 100644
--- a/media/libeffects/lvm/lib/Common/src/BQ_2I_D16F32C13_TRC_WRA_01.cpp
+++ b/media/libeffects/lvm/lib/Common/src/BQ_2I_D16F32C13_TRC_WRA_01.cpp
@@ -19,7 +19,6 @@
#include "BQ_2I_D16F32Css_TRC_WRA_01_Private.h"
#include "LVM_Macros.h"
-
/**************************************************************************
ASSUMPTIONS:
COEFS-
@@ -37,7 +36,6 @@
pBiquadState->pDelays[6] is y(n-2)L in Q16 format
pBiquadState->pDelays[7] is y(n-2)R in Q16 format
***************************************************************************/
-#ifdef BUILD_FLOAT
void BQ_2I_D16F32C13_TRC_WRA_01 ( Biquad_FLOAT_Instance_t *pInstance,
LVM_FLOAT *pDataIn,
LVM_FLOAT *pDataOut,
@@ -109,82 +107,3 @@
pDataOut++;
}
}
-#else
-void BQ_2I_D16F32C13_TRC_WRA_01 ( Biquad_Instance_t *pInstance,
- LVM_INT16 *pDataIn,
- LVM_INT16 *pDataOut,
- LVM_INT16 NrSamples)
- {
- LVM_INT32 ynL,ynR,templ;
- LVM_INT16 ii;
- PFilter_State pBiquadState = (PFilter_State) pInstance;
-
- for (ii = NrSamples; ii != 0; ii--)
- {
-
-
- /**************************************************************************
- PROCESSING OF THE LEFT CHANNEL
- ***************************************************************************/
- /* ynL=A2 (Q13) * x(n-2)L (Q0) in Q13*/
- ynL=(LVM_INT32)pBiquadState->coefs[0]* pBiquadState->pDelays[2];
-
- /* ynL+=A1 (Q13) * x(n-1)L (Q0) in Q13*/
- ynL+=(LVM_INT32)pBiquadState->coefs[1]* pBiquadState->pDelays[0];
-
- /* ynL+=A0 (Q13) * x(n)L (Q0) in Q13*/
- ynL+=(LVM_INT32)pBiquadState->coefs[2]* (*pDataIn);
-
- /* ynL+= ( (-B2 (Q13) * y(n-2)L (Q16) )>>16) in Q13 */
- MUL32x16INTO32(pBiquadState->pDelays[6],pBiquadState->coefs[3],templ,16)
- ynL+=templ;
-
- /* ynL+=( (-B1 (Q13) * y(n-1)L (Q16) )>>16) in Q13 */
- MUL32x16INTO32(pBiquadState->pDelays[4],pBiquadState->coefs[4],templ,16)
- ynL+=templ;
-
- /**************************************************************************
- PROCESSING OF THE RIGHT CHANNEL
- ***************************************************************************/
- /* ynR=A2 (Q13) * x(n-2)R (Q0) in Q13*/
- ynR=(LVM_INT32)pBiquadState->coefs[0]*pBiquadState->pDelays[3];
-
- /* ynR+=A1 (Q13) * x(n-1)R (Q0) in Q13*/
- ynR+=(LVM_INT32)pBiquadState->coefs[1]*pBiquadState->pDelays[1];
-
- /* ynR+=A0 (Q13) * x(n)R (Q0) in Q13*/
- ynR+=(LVM_INT32)pBiquadState->coefs[2]*(*(pDataIn+1));
-
- /* ynR+= ( (-B2 (Q13) * y(n-2)R (Q16) )>>16) in Q13*/
- MUL32x16INTO32(pBiquadState->pDelays[7],pBiquadState->coefs[3],templ,16)
- ynR+=templ;
-
- /* ynR+=( (-B1 (Q13) * y(n-1)R (Q16) )>>16) in Q13 */
- MUL32x16INTO32(pBiquadState->pDelays[5],pBiquadState->coefs[4],templ,16)
- ynR+=templ;
-
- /**************************************************************************
- UPDATING THE DELAYS
- ***************************************************************************/
- pBiquadState->pDelays[7]=pBiquadState->pDelays[5]; /* y(n-2)R=y(n-1)R*/
- pBiquadState->pDelays[6]=pBiquadState->pDelays[4]; /* y(n-2)L=y(n-1)L*/
- pBiquadState->pDelays[3]=pBiquadState->pDelays[1]; /* x(n-2)R=x(n-1)R*/
- pBiquadState->pDelays[2]=pBiquadState->pDelays[0]; /* x(n-2)L=x(n-1)L*/
- pBiquadState->pDelays[5]=ynR<<3; /* Update y(n-1)R in Q16*/
- pBiquadState->pDelays[4]=ynL<<3; /* Update y(n-1)L in Q16*/
- pBiquadState->pDelays[0]=(*pDataIn); /* Update x(n-1)L in Q0*/
- pDataIn++;
- pBiquadState->pDelays[1]=(*pDataIn); /* Update x(n-1)R in Q0*/
- pDataIn++;
-
- /**************************************************************************
- WRITING THE OUTPUT
- ***************************************************************************/
- *pDataOut=(LVM_INT16)(ynL>>13); /* Write Left output in Q0*/
- pDataOut++;
- *pDataOut=(LVM_INT16)(ynR>>13); /* Write Right ouput in Q0*/
- pDataOut++;
- }
-
- }
-#endif
diff --git a/media/libeffects/lvm/lib/Common/src/BQ_2I_D16F32C14_TRC_WRA_01.cpp b/media/libeffects/lvm/lib/Common/src/BQ_2I_D16F32C14_TRC_WRA_01.cpp
index cf19e06..3a396df 100644
--- a/media/libeffects/lvm/lib/Common/src/BQ_2I_D16F32C14_TRC_WRA_01.cpp
+++ b/media/libeffects/lvm/lib/Common/src/BQ_2I_D16F32C14_TRC_WRA_01.cpp
@@ -36,7 +36,6 @@
pBiquadState->pDelays[6] is y(n-2)L in Q16 format
pBiquadState->pDelays[7] is y(n-2)R in Q16 format
***************************************************************************/
-#ifdef BUILD_FLOAT
void BQ_2I_D16F32C14_TRC_WRA_01 ( Biquad_FLOAT_Instance_t *pInstance,
LVM_FLOAT *pDataIn,
LVM_FLOAT *pDataOut,
@@ -49,7 +48,6 @@
for (ii = NrSamples; ii != 0; ii--)
{
-
/**************************************************************************
PROCESSING OF THE LEFT CHANNEL
***************************************************************************/
@@ -65,7 +63,6 @@
/* ynL+= ( (-B2 * y(n-2)L ))*/
ynL += pBiquadState->pDelays[6] * pBiquadState->coefs[3];
-
/* ynL+=( (-B1 * y(n-1)L )) */
ynL += pBiquadState->pDelays[4] * pBiquadState->coefs[4];
@@ -111,82 +108,3 @@
}
}
-#else
-void BQ_2I_D16F32C14_TRC_WRA_01 ( Biquad_Instance_t *pInstance,
- LVM_INT16 *pDataIn,
- LVM_INT16 *pDataOut,
- LVM_INT16 NrSamples)
- {
- LVM_INT32 ynL,ynR,templ;
- LVM_INT16 ii;
- PFilter_State pBiquadState = (PFilter_State) pInstance;
-
- for (ii = NrSamples; ii != 0; ii--)
- {
-
-
- /**************************************************************************
- PROCESSING OF THE LEFT CHANNEL
- ***************************************************************************/
- /* ynL=A2 (Q14) * x(n-2)L (Q0) in Q14*/
- ynL=(LVM_INT32)pBiquadState->coefs[0]* pBiquadState->pDelays[2];
-
- /* ynL+=A1 (Q14) * x(n-1)L (Q0) in Q14*/
- ynL+=(LVM_INT32)pBiquadState->coefs[1]* pBiquadState->pDelays[0];
-
- /* ynL+=A0 (Q14) * x(n)L (Q0) in Q14*/
- ynL+=(LVM_INT32)pBiquadState->coefs[2]* (*pDataIn);
-
- /* ynL+= ( (-B2 (Q14) * y(n-2)L (Q16) )>>16) in Q14 */
- MUL32x16INTO32(pBiquadState->pDelays[6],pBiquadState->coefs[3],templ,16)
- ynL+=templ;
-
- /* ynL+=( (-B1 (Q14) * y(n-1)L (Q16) )>>16) in Q14 */
- MUL32x16INTO32(pBiquadState->pDelays[4],pBiquadState->coefs[4],templ,16)
- ynL+=templ;
-
- /**************************************************************************
- PROCESSING OF THE RIGHT CHANNEL
- ***************************************************************************/
- /* ynR=A2 (Q14) * x(n-2)R (Q0) in Q14*/
- ynR=(LVM_INT32)pBiquadState->coefs[0]*pBiquadState->pDelays[3];
-
- /* ynR+=A1 (Q14) * x(n-1)R (Q0) in Q14*/
- ynR+=(LVM_INT32)pBiquadState->coefs[1]*pBiquadState->pDelays[1];
-
- /* ynR+=A0 (Q14) * x(n)R (Q0) in Q14*/
- ynR+=(LVM_INT32)pBiquadState->coefs[2]*(*(pDataIn+1));
-
- /* ynR+= ( (-B2 (Q14) * y(n-2)R (Q16) )>>16) in Q14*/
- MUL32x16INTO32(pBiquadState->pDelays[7],pBiquadState->coefs[3],templ,16)
- ynR+=templ;
-
- /* ynR+=( (-B1 (Q14) * y(n-1)R (Q16) )>>16) in Q14 */
- MUL32x16INTO32(pBiquadState->pDelays[5],pBiquadState->coefs[4],templ,16)
- ynR+=templ;
-
- /**************************************************************************
- UPDATING THE DELAYS
- ***************************************************************************/
- pBiquadState->pDelays[7]=pBiquadState->pDelays[5]; /* y(n-2)R=y(n-1)R*/
- pBiquadState->pDelays[6]=pBiquadState->pDelays[4]; /* y(n-2)L=y(n-1)L*/
- pBiquadState->pDelays[3]=pBiquadState->pDelays[1]; /* x(n-2)R=x(n-1)R*/
- pBiquadState->pDelays[2]=pBiquadState->pDelays[0]; /* x(n-2)L=x(n-1)L*/
- pBiquadState->pDelays[5]=ynR<<2; /* Update y(n-1)R in Q16*/
- pBiquadState->pDelays[4]=ynL<<2; /* Update y(n-1)L in Q16*/
- pBiquadState->pDelays[0]=(*pDataIn); /* Update x(n-1)L in Q0*/
- pDataIn++;
- pBiquadState->pDelays[1]=(*pDataIn); /* Update x(n-1)R in Q0*/
- pDataIn++;
-
- /**************************************************************************
- WRITING THE OUTPUT
- ***************************************************************************/
- *pDataOut=(LVM_INT16)(ynL>>14); /* Write Left output in Q0*/
- pDataOut++;
- *pDataOut=(LVM_INT16)(ynR>>14); /* Write Right ouput in Q0*/
- pDataOut++;
- }
-
- }
-#endif
diff --git a/media/libeffects/lvm/lib/Common/src/BQ_2I_D16F32C15_TRC_WRA_01.cpp b/media/libeffects/lvm/lib/Common/src/BQ_2I_D16F32C15_TRC_WRA_01.cpp
index 2611b19..1cbff1a 100644
--- a/media/libeffects/lvm/lib/Common/src/BQ_2I_D16F32C15_TRC_WRA_01.cpp
+++ b/media/libeffects/lvm/lib/Common/src/BQ_2I_D16F32C15_TRC_WRA_01.cpp
@@ -36,7 +36,6 @@
pBiquadState->pDelays[6] is y(n-2)L in Q16 format
pBiquadState->pDelays[7] is y(n-2)R in Q16 format
***************************************************************************/
-#ifdef BUILD_FLOAT
void BQ_2I_D16F32C15_TRC_WRA_01 ( Biquad_FLOAT_Instance_t *pInstance,
LVM_FLOAT *pDataIn,
LVM_FLOAT *pDataOut,
@@ -49,7 +48,6 @@
for (ii = NrSamples; ii != 0; ii--)
{
-
/**************************************************************************
PROCESSING OF THE LEFT CHANNEL
***************************************************************************/
@@ -65,11 +63,9 @@
/* ynL+= ( (-B2 * y(n-2)L ) */
ynL += pBiquadState->pDelays[6] * pBiquadState->coefs[3];
-
/* ynL+=( (-B1 * y(n-1)L )) */
ynL += pBiquadState->pDelays[4] * pBiquadState->coefs[4];
-
/**************************************************************************
PROCESSING OF THE RIGHT CHANNEL
***************************************************************************/
@@ -85,7 +81,6 @@
/* ynR+= ( (-B2 * y(n-2)R ) */
ynR += pBiquadState->pDelays[7] * pBiquadState->coefs[3];
-
/* ynR+=( (-B1 * y(n-1)R )) in Q15 */
ynR += pBiquadState->pDelays[5] * pBiquadState->coefs[4];
@@ -113,82 +108,3 @@
}
}
-#else
-void BQ_2I_D16F32C15_TRC_WRA_01 ( Biquad_Instance_t *pInstance,
- LVM_INT16 *pDataIn,
- LVM_INT16 *pDataOut,
- LVM_INT16 NrSamples)
- {
- LVM_INT32 ynL,ynR,templ;
- LVM_INT16 ii;
- PFilter_State pBiquadState = (PFilter_State) pInstance;
-
- for (ii = NrSamples; ii != 0; ii--)
- {
-
-
- /**************************************************************************
- PROCESSING OF THE LEFT CHANNEL
- ***************************************************************************/
- /* ynL=A2 (Q15) * x(n-2)L (Q0) in Q15*/
- ynL=(LVM_INT32)pBiquadState->coefs[0]* pBiquadState->pDelays[2];
-
- /* ynL+=A1 (Q15) * x(n-1)L (Q0) in Q15*/
- ynL+=(LVM_INT32)pBiquadState->coefs[1]* pBiquadState->pDelays[0];
-
- /* ynL+=A0 (Q15) * x(n)L (Q0) in Q15*/
- ynL+=(LVM_INT32)pBiquadState->coefs[2]* (*pDataIn);
-
- /* ynL+= ( (-B2 (Q15) * y(n-2)L (Q16) )>>16) in Q15 */
- MUL32x16INTO32(pBiquadState->pDelays[6],pBiquadState->coefs[3],templ,16)
- ynL+=templ;
-
- /* ynL+=( (-B1 (Q15) * y(n-1)L (Q16) )>>16) in Q15 */
- MUL32x16INTO32(pBiquadState->pDelays[4],pBiquadState->coefs[4],templ,16)
- ynL+=templ;
-
- /**************************************************************************
- PROCESSING OF THE RIGHT CHANNEL
- ***************************************************************************/
- /* ynR=A2 (Q15) * x(n-2)R (Q0) in Q15*/
- ynR=(LVM_INT32)pBiquadState->coefs[0]*pBiquadState->pDelays[3];
-
- /* ynR+=A1 (Q15) * x(n-1)R (Q0) in Q15*/
- ynR+=(LVM_INT32)pBiquadState->coefs[1]*pBiquadState->pDelays[1];
-
- /* ynR+=A0 (Q15) * x(n)R (Q0) in Q15*/
- ynR+=(LVM_INT32)pBiquadState->coefs[2]*(*(pDataIn+1));
-
- /* ynR+= ( (-B2 (Q15) * y(n-2)R (Q16) )>>16) in Q15 */
- MUL32x16INTO32(pBiquadState->pDelays[7],pBiquadState->coefs[3],templ,16)
- ynR+=templ;
-
- /* ynR+=( (-B1 (Q15) * y(n-1)R (Q16) )>>16) in Q15 */
- MUL32x16INTO32(pBiquadState->pDelays[5],pBiquadState->coefs[4],templ,16)
- ynR+=templ;
-
- /**************************************************************************
- UPDATING THE DELAYS
- ***************************************************************************/
- pBiquadState->pDelays[7]=pBiquadState->pDelays[5]; /* y(n-2)R=y(n-1)R*/
- pBiquadState->pDelays[6]=pBiquadState->pDelays[4]; /* y(n-2)L=y(n-1)L*/
- pBiquadState->pDelays[3]=pBiquadState->pDelays[1]; /* x(n-2)R=x(n-1)R*/
- pBiquadState->pDelays[2]=pBiquadState->pDelays[0]; /* x(n-2)L=x(n-1)L*/
- pBiquadState->pDelays[5]=ynR<<1; /* Update y(n-1)R in Q16*/
- pBiquadState->pDelays[4]=ynL<<1; /* Update y(n-1)L in Q16*/
- pBiquadState->pDelays[0]=(*pDataIn); /* Update x(n-1)L in Q0*/
- pDataIn++;
- pBiquadState->pDelays[1]=(*pDataIn); /* Update x(n-1)R in Q0*/
- pDataIn++;
-
- /**************************************************************************
- WRITING THE OUTPUT
- ***************************************************************************/
- *pDataOut=(LVM_INT16)(ynL>>15); /* Write Left output in Q0*/
- pDataOut++;
- *pDataOut=(LVM_INT16)(ynR>>15); /* Write Right ouput in Q0*/
- pDataOut++;
- }
-
- }
-#endif
diff --git a/media/libeffects/lvm/lib/Common/src/BQ_2I_D16F32Css_TRC_WRA_01_Private.h b/media/libeffects/lvm/lib/Common/src/BQ_2I_D16F32Css_TRC_WRA_01_Private.h
index c0319c9..314388a 100644
--- a/media/libeffects/lvm/lib/Common/src/BQ_2I_D16F32Css_TRC_WRA_01_Private.h
+++ b/media/libeffects/lvm/lib/Common/src/BQ_2I_D16F32Css_TRC_WRA_01_Private.h
@@ -28,7 +28,6 @@
typedef Filter_State * PFilter_State ;
-#ifdef BUILD_FLOAT
typedef struct _Filter_State_FLOAT
{
LVM_FLOAT * pDelays; /* pointer to the delayed samples \
@@ -36,6 +35,5 @@
LVM_FLOAT coefs[5]; /* pointer to the filter coefficients */
}Filter_State_FLOAT;
typedef Filter_State_FLOAT * PFilter_State_FLOAT ;
-#endif
#endif /* _BQ_2I_D16F32CSS_TRC_WRA_01_PRIVATE_H_ */
diff --git a/media/libeffects/lvm/lib/Common/src/BQ_2I_D16F32Css_TRC_WRA_01_init.cpp b/media/libeffects/lvm/lib/Common/src/BQ_2I_D16F32Css_TRC_WRA_01_init.cpp
index 4d9bbfe..058541a 100644
--- a/media/libeffects/lvm/lib/Common/src/BQ_2I_D16F32Css_TRC_WRA_01_init.cpp
+++ b/media/libeffects/lvm/lib/Common/src/BQ_2I_D16F32Css_TRC_WRA_01_init.cpp
@@ -18,7 +18,6 @@
#include "BIQUAD.h"
#include "BQ_2I_D16F32Css_TRC_WRA_01_Private.h"
-
/*-------------------------------------------------------------------------*/
/* FUNCTION: */
/* BQ_2I_D16F32Css_TRC_WRA_01_Init */
@@ -37,7 +36,6 @@
/* RETURNS: */
/* void return code */
/*-------------------------------------------------------------------------*/
-#ifdef BUILD_FLOAT
void BQ_2I_D16F32Css_TRC_WRA_01_Init ( Biquad_FLOAT_Instance_t *pInstance,
Biquad_2I_Order2_FLOAT_Taps_t *pTaps,
BQ_FLOAT_Coefs_t *pCoef)
@@ -56,27 +54,6 @@
temp = pCoef->B1;
pBiquadState->coefs[4] = temp;
}
-#else
-void BQ_2I_D16F32Css_TRC_WRA_01_Init ( Biquad_Instance_t *pInstance,
- Biquad_2I_Order2_Taps_t *pTaps,
- BQ_C16_Coefs_t *pCoef)
-{
- LVM_INT16 temp;
- PFilter_State pBiquadState = (PFilter_State) pInstance;
- pBiquadState->pDelays =(LVM_INT32 *) pTaps ;
-
- temp=pCoef->A2;
- pBiquadState->coefs[0]=temp;
- temp=pCoef->A1;
- pBiquadState->coefs[1]=temp;
- temp=pCoef->A0;
- pBiquadState->coefs[2]=temp;
- temp=pCoef->B2;
- pBiquadState->coefs[3]=temp;
- temp=pCoef->B1;
- pBiquadState->coefs[4]=temp;
-}
-#endif
/*-------------------------------------------------------------------------*/
/* End Of File: BQ_2I_D16F32Css_TRC_WRA_01_Init */
diff --git a/media/libeffects/lvm/lib/Common/src/BQ_2I_D32F32C30_TRC_WRA_01.cpp b/media/libeffects/lvm/lib/Common/src/BQ_2I_D32F32C30_TRC_WRA_01.cpp
index d63365c..78d1ba1 100644
--- a/media/libeffects/lvm/lib/Common/src/BQ_2I_D32F32C30_TRC_WRA_01.cpp
+++ b/media/libeffects/lvm/lib/Common/src/BQ_2I_D32F32C30_TRC_WRA_01.cpp
@@ -36,13 +36,11 @@
pBiquadState->pDelays[6] is y(n-2)L in Q0 format
pBiquadState->pDelays[7] is y(n-2)R in Q0 format
***************************************************************************/
-#ifdef BUILD_FLOAT
void BQ_2I_D32F32C30_TRC_WRA_01 ( Biquad_FLOAT_Instance_t *pInstance,
LVM_FLOAT *pDataIn,
LVM_FLOAT *pDataOut,
LVM_INT16 NrSamples)
-
{
LVM_FLOAT ynL,ynR,templ,tempd;
LVM_INT16 ii;
@@ -51,7 +49,6 @@
for (ii = NrSamples; ii != 0; ii--)
{
-
/**************************************************************************
PROCESSING OF THE LEFT CHANNEL
***************************************************************************/
@@ -119,7 +116,6 @@
*pDataOut = (LVM_FLOAT)ynR; /* Write Right ouput */
pDataOut++;
-
}
}
@@ -151,7 +147,6 @@
LVM_INT16 NrFrames,
LVM_INT16 NrChannels)
-
{
LVM_FLOAT yn, temp;
LVM_INT16 ii, jj;
@@ -204,91 +199,3 @@
}
#endif /*SUPPORT_MC*/
-#else
-void BQ_2I_D32F32C30_TRC_WRA_01 ( Biquad_Instance_t *pInstance,
- LVM_INT32 *pDataIn,
- LVM_INT32 *pDataOut,
- LVM_INT16 NrSamples)
-
-
- {
- LVM_INT32 ynL,ynR,templ,tempd;
- LVM_INT16 ii;
- PFilter_State pBiquadState = (PFilter_State) pInstance;
-
- for (ii = NrSamples; ii != 0; ii--)
- {
-
-
- /**************************************************************************
- PROCESSING OF THE LEFT CHANNEL
- ***************************************************************************/
- /* ynL= ( A2 (Q30) * x(n-2)L (Q0) ) >>30 in Q0*/
- MUL32x32INTO32(pBiquadState->coefs[0],pBiquadState->pDelays[2],ynL,30)
-
- /* ynL+= ( A1 (Q30) * x(n-1)L (Q0) ) >> 30 in Q0*/
- MUL32x32INTO32(pBiquadState->coefs[1],pBiquadState->pDelays[0],templ,30)
- ynL+=templ;
-
- /* ynL+= ( A0 (Q30) * x(n)L (Q0) ) >> 30 in Q0*/
- MUL32x32INTO32(pBiquadState->coefs[2],*pDataIn,templ,30)
- ynL+=templ;
-
- /* ynL+= (-B2 (Q30) * y(n-2)L (Q0) ) >> 30 in Q0*/
- MUL32x32INTO32(pBiquadState->coefs[3],pBiquadState->pDelays[6],templ,30)
- ynL+=templ;
-
- /* ynL+= (-B1 (Q30) * y(n-1)L (Q0) ) >> 30 in Q0 */
- MUL32x32INTO32(pBiquadState->coefs[4],pBiquadState->pDelays[4],templ,30)
- ynL+=templ;
-
- /**************************************************************************
- PROCESSING OF THE RIGHT CHANNEL
- ***************************************************************************/
- /* ynR= ( A2 (Q30) * x(n-2)R (Q0) ) >> 30 in Q0*/
- MUL32x32INTO32(pBiquadState->coefs[0],pBiquadState->pDelays[3],ynR,30)
-
- /* ynR+= ( A1 (Q30) * x(n-1)R (Q0) ) >> 30 in Q0*/
- MUL32x32INTO32(pBiquadState->coefs[1],pBiquadState->pDelays[1],templ,30)
- ynR+=templ;
-
- /* ynR+= ( A0 (Q30) * x(n)R (Q0) ) >> 30 in Q0*/
- tempd=*(pDataIn+1);
- MUL32x32INTO32(pBiquadState->coefs[2],tempd,templ,30)
- ynR+=templ;
-
- /* ynR+= (-B2 (Q30) * y(n-2)R (Q0) ) >> 30 in Q0*/
- MUL32x32INTO32(pBiquadState->coefs[3],pBiquadState->pDelays[7],templ,30)
- ynR+=templ;
-
- /* ynR+= (-B1 (Q30) * y(n-1)R (Q0) ) >> 30 in Q0 */
- MUL32x32INTO32(pBiquadState->coefs[4],pBiquadState->pDelays[5],templ,30)
- ynR+=templ;
-
- /**************************************************************************
- UPDATING THE DELAYS
- ***************************************************************************/
- pBiquadState->pDelays[7]=pBiquadState->pDelays[5]; /* y(n-2)R=y(n-1)R*/
- pBiquadState->pDelays[6]=pBiquadState->pDelays[4]; /* y(n-2)L=y(n-1)L*/
- pBiquadState->pDelays[3]=pBiquadState->pDelays[1]; /* x(n-2)R=x(n-1)R*/
- pBiquadState->pDelays[2]=pBiquadState->pDelays[0]; /* x(n-2)L=x(n-1)L*/
- pBiquadState->pDelays[5]=(LVM_INT32)ynR; /* Update y(n-1)R in Q0*/
- pBiquadState->pDelays[4]=(LVM_INT32)ynL; /* Update y(n-1)L in Q0*/
- pBiquadState->pDelays[0]=(*pDataIn); /* Update x(n-1)L in Q0*/
- pDataIn++;
- pBiquadState->pDelays[1]=(*pDataIn); /* Update x(n-1)R in Q0*/
- pDataIn++;
-
- /**************************************************************************
- WRITING THE OUTPUT
- ***************************************************************************/
- *pDataOut=(LVM_INT32)ynL; /* Write Left output in Q0*/
- pDataOut++;
- *pDataOut=(LVM_INT32)ynR; /* Write Right ouput in Q0*/
- pDataOut++;
-
-
- }
-
- }
-#endif /*BUILD_FLOAT*/
diff --git a/media/libeffects/lvm/lib/Common/src/BQ_2I_D32F32Cll_TRC_WRA_01_Init.cpp b/media/libeffects/lvm/lib/Common/src/BQ_2I_D32F32Cll_TRC_WRA_01_Init.cpp
index fff05ed..492a9e0 100644
--- a/media/libeffects/lvm/lib/Common/src/BQ_2I_D32F32Cll_TRC_WRA_01_Init.cpp
+++ b/media/libeffects/lvm/lib/Common/src/BQ_2I_D32F32Cll_TRC_WRA_01_Init.cpp
@@ -37,7 +37,6 @@
/* RETURNS: */
/* void return code */
/*-------------------------------------------------------------------------*/
-#ifdef BUILD_FLOAT
void BQ_2I_D32F32Cll_TRC_WRA_01_Init ( Biquad_FLOAT_Instance_t *pInstance,
Biquad_2I_Order2_FLOAT_Taps_t *pTaps,
BQ_FLOAT_Coefs_t *pCoef)
@@ -56,27 +55,6 @@
temp = pCoef->B1;
pBiquadState->coefs[4] = temp;
}
-#else
-void BQ_2I_D32F32Cll_TRC_WRA_01_Init ( Biquad_Instance_t *pInstance,
- Biquad_2I_Order2_Taps_t *pTaps,
- BQ_C32_Coefs_t *pCoef)
-{
- LVM_INT32 temp;
- PFilter_State pBiquadState = (PFilter_State) pInstance;
- pBiquadState->pDelays =(LVM_INT32 *) pTaps ;
-
- temp=pCoef->A2;
- pBiquadState->coefs[0]=temp;
- temp=pCoef->A1;
- pBiquadState->coefs[1]=temp;
- temp=pCoef->A0;
- pBiquadState->coefs[2]=temp;
- temp=pCoef->B2;
- pBiquadState->coefs[3]=temp;
- temp=pCoef->B1;
- pBiquadState->coefs[4]=temp;
-}
-#endif
/*-------------------------------------------------------------------------*/
/* End Of File: BQ_2I_D32F32C32_TRC_WRA_01_Init.c */
diff --git a/media/libeffects/lvm/lib/Common/src/BQ_2I_D32F32Cll_TRC_WRA_01_Private.h b/media/libeffects/lvm/lib/Common/src/BQ_2I_D32F32Cll_TRC_WRA_01_Private.h
index c0f0dcc..7eb6474 100644
--- a/media/libeffects/lvm/lib/Common/src/BQ_2I_D32F32Cll_TRC_WRA_01_Private.h
+++ b/media/libeffects/lvm/lib/Common/src/BQ_2I_D32F32Cll_TRC_WRA_01_Private.h
@@ -18,7 +18,6 @@
#ifndef _BQ_2I_D32F32CLL_TRC_WRA_01_PRIVATE_H_
#define _BQ_2I_D32F32CLL_TRC_WRA_01_PRIVATE_H_
-
/* The internal state variables are implemented in a (for the user) hidden structure */
/* In this (private) file, the internal structure is declared fro private use. */
typedef struct _Filter_State_
@@ -29,7 +28,6 @@
typedef Filter_State * PFilter_State ;
-#ifdef BUILD_FLOAT
typedef struct _Filter_State_FLOAT
{
LVM_FLOAT * pDelays; /* pointer to the delayed samples \
@@ -37,6 +35,5 @@
LVM_FLOAT coefs[5]; /* pointer to the filter coefficients */
}Filter_State_FLOAT;
typedef Filter_State_FLOAT * PFilter_State_FLOAT ;
-#endif
#endif /* _BQ_2I_D32F32CLL_TRC_WRA_01_PRIVATE_H_*/
diff --git a/media/libeffects/lvm/lib/Common/src/Copy_16.cpp b/media/libeffects/lvm/lib/Common/src/Copy_16.cpp
index 3858450..7cb642f 100644
--- a/media/libeffects/lvm/lib/Common/src/Copy_16.cpp
+++ b/media/libeffects/lvm/lib/Common/src/Copy_16.cpp
@@ -54,7 +54,6 @@
return;
}
-#ifdef BUILD_FLOAT
void Copy_Float( const LVM_FLOAT *src,
LVM_FLOAT *dst,
LVM_INT16 n )
@@ -144,5 +143,4 @@
}
}
#endif
-#endif
/**********************************************************************************/
diff --git a/media/libeffects/lvm/lib/Common/src/Core_MixHard_2St_D32C31_SAT.cpp b/media/libeffects/lvm/lib/Common/src/Core_MixHard_2St_D32C31_SAT.cpp
index ea98041..5e77335 100644
--- a/media/libeffects/lvm/lib/Common/src/Core_MixHard_2St_D32C31_SAT.cpp
+++ b/media/libeffects/lvm/lib/Common/src/Core_MixHard_2St_D32C31_SAT.cpp
@@ -25,7 +25,6 @@
/**********************************************************************************
FUNCTION CORE_MIXHARD_2ST_D32C31_SAT
***********************************************************************************/
-#ifdef BUILD_FLOAT
void Core_MixHard_2St_D32C31_SAT( Mix_2St_Cll_FLOAT_t *pInstance,
const LVM_FLOAT *src1,
const LVM_FLOAT *src2,
@@ -55,35 +54,4 @@
*dst++ = Temp2;
}
}
-#else
-void Core_MixHard_2St_D32C31_SAT( Mix_2St_Cll_t *pInstance,
- const LVM_INT32 *src1,
- const LVM_INT32 *src2,
- LVM_INT32 *dst,
- LVM_INT16 n)
-{
- LVM_INT32 Temp1,Temp2,Temp3;
- LVM_INT16 ii;
- LVM_INT16 Current1Short;
- LVM_INT16 Current2Short;
-
- Current1Short = (LVM_INT16)(pInstance->Current1 >> 16);
- Current2Short = (LVM_INT16)(pInstance->Current2 >> 16);
-
- for (ii = n; ii != 0; ii--){
- Temp1=*src1++;
- MUL32x16INTO32(Temp1,Current1Short,Temp3,15)
- Temp2=*src2++;
- MUL32x16INTO32(Temp2,Current2Short,Temp1,15)
- Temp2=(Temp1>>1)+(Temp3>>1);
- if (Temp2 > 0x3FFFFFFF)
- Temp2 = 0x7FFFFFFF;
- else if (Temp2 < - 0x40000000)
- Temp2 = 0x80000000;
- else
- Temp2=(Temp2<<1);
- *dst++ = Temp2;
- }
-}
-#endif
/**********************************************************************************/
diff --git a/media/libeffects/lvm/lib/Common/src/Core_MixInSoft_D32C31_SAT.cpp b/media/libeffects/lvm/lib/Common/src/Core_MixInSoft_D32C31_SAT.cpp
index 2814f19..8f5c0ae 100644
--- a/media/libeffects/lvm/lib/Common/src/Core_MixInSoft_D32C31_SAT.cpp
+++ b/media/libeffects/lvm/lib/Common/src/Core_MixInSoft_D32C31_SAT.cpp
@@ -26,7 +26,6 @@
FUNCTION CORE_MIXSOFT_1ST_D32C31_WRA
***********************************************************************************/
-#ifdef BUILD_FLOAT /* BUILD_FLOAT */
void Core_MixInSoft_D32C31_SAT( Mix_1St_Cll_FLOAT_t *pInstance,
const LVM_FLOAT *src,
LVM_FLOAT *dst,
@@ -39,7 +38,6 @@
LVM_FLOAT CurrentTimesAlpha;
LVM_INT16 ii,jj;
-
InLoop = (LVM_INT16)(n >> 2); /* Process per 4 samples */
OutLoop = (LVM_INT16)(n - (InLoop << 2));
@@ -89,69 +87,4 @@
}
}
}
-#else
-void Core_MixInSoft_D32C31_SAT( Mix_1St_Cll_t *pInstance,
- const LVM_INT32 *src,
- LVM_INT32 *dst,
- LVM_INT16 n)
-{
- LVM_INT32 Temp1,Temp2,Temp3;
- LVM_INT16 OutLoop;
- LVM_INT16 InLoop;
- LVM_INT32 TargetTimesOneMinAlpha;
- LVM_INT32 CurrentTimesAlpha;
- LVM_INT16 ii,jj;
- LVM_INT16 CurrentShort;
-
- InLoop = (LVM_INT16)(n >> 2); /* Process per 4 samples */
- OutLoop = (LVM_INT16)(n - (InLoop << 2));
-
- MUL32x32INTO32((0x7FFFFFFF-pInstance->Alpha),pInstance->Target,TargetTimesOneMinAlpha,31); /* Q31 * Q0 in Q0 */
- if (pInstance->Target >= pInstance->Current){
- TargetTimesOneMinAlpha +=2; /* Ceil*/
- }
-
- if (OutLoop){
- MUL32x32INTO32(pInstance->Current,pInstance->Alpha,CurrentTimesAlpha,31); /* Q0 * Q31 in Q0 */
- pInstance->Current = TargetTimesOneMinAlpha + CurrentTimesAlpha; /* Q0 + Q0 into Q0*/
- CurrentShort = (LVM_INT16)(pInstance->Current>>16); /* From Q31 to Q15*/
-
- for (ii = OutLoop; ii != 0; ii--){
- Temp1=*src++;
- Temp2=*dst;
- MUL32x16INTO32(Temp1,CurrentShort,Temp3,15)
- Temp1=(Temp2>>1)+(Temp3>>1);
-
- if (Temp1 > 0x3FFFFFFF)
- Temp1 = 0x7FFFFFFF;
- else if (Temp1 < - 0x40000000)
- Temp1 = 0x80000000;
- else
- Temp1=(Temp1<<1);
- *dst++ = Temp1;
- }
- }
-
- for (ii = InLoop; ii != 0; ii--){
- MUL32x32INTO32(pInstance->Current,pInstance->Alpha,CurrentTimesAlpha,31); /* Q0 * Q31 in Q0 */
- pInstance->Current = TargetTimesOneMinAlpha + CurrentTimesAlpha; /* Q0 + Q0 into Q0*/
- CurrentShort = (LVM_INT16)(pInstance->Current>>16); /* From Q31 to Q15*/
-
- for (jj = 4; jj!=0 ; jj--){
- Temp1=*src++;
- Temp2=*dst;
- MUL32x16INTO32(Temp1,CurrentShort,Temp3,15)
- Temp1=(Temp2>>1)+(Temp3>>1);
-
- if (Temp1 > 0x3FFFFFFF)
- Temp1 = 0x7FFFFFFF;
- else if (Temp1 < - 0x40000000)
- Temp1 = 0x80000000;
- else
- Temp1=(Temp1<<1);
- *dst++ = Temp1;
- }
- }
-}
-#endif
/**********************************************************************************/
diff --git a/media/libeffects/lvm/lib/Common/src/Core_MixSoft_1St_D32C31_WRA.cpp b/media/libeffects/lvm/lib/Common/src/Core_MixSoft_1St_D32C31_WRA.cpp
index 814ccee..6ff7853 100644
--- a/media/libeffects/lvm/lib/Common/src/Core_MixSoft_1St_D32C31_WRA.cpp
+++ b/media/libeffects/lvm/lib/Common/src/Core_MixSoft_1St_D32C31_WRA.cpp
@@ -25,7 +25,6 @@
/**********************************************************************************
FUNCTION CORE_MIXSOFT_1ST_D32C31_WRA
***********************************************************************************/
-#ifdef BUILD_FLOAT
void Core_MixSoft_1St_D32C31_WRA( Mix_1St_Cll_FLOAT_t *pInstance,
const LVM_FLOAT *src,
LVM_FLOAT *dst,
@@ -97,78 +96,4 @@
dst++;
}
}
-#else
-void Core_MixSoft_1St_D32C31_WRA( Mix_1St_Cll_t *pInstance,
- const LVM_INT32 *src,
- LVM_INT32 *dst,
- LVM_INT16 n)
-{
- LVM_INT32 Temp1,Temp2;
- LVM_INT16 OutLoop;
- LVM_INT16 InLoop;
- LVM_INT32 TargetTimesOneMinAlpha;
- LVM_INT32 CurrentTimesAlpha;
- LVM_INT16 CurrentShort;
- LVM_INT16 ii;
-
- InLoop = (LVM_INT16)(n >> 2); /* Process per 4 samples */
- OutLoop = (LVM_INT16)(n - (InLoop << 2));
-
- MUL32x32INTO32((0x7FFFFFFF-pInstance->Alpha),pInstance->Target,TargetTimesOneMinAlpha,31) /* Q31 * Q31 in Q31 */
- if (pInstance->Target >= pInstance->Current)
- {
- TargetTimesOneMinAlpha +=2; /* Ceil*/
- }
-
- if (OutLoop!=0)
- {
- MUL32x32INTO32(pInstance->Current,pInstance->Alpha,CurrentTimesAlpha,31) /* Q31 * Q31 in Q31 */
- pInstance->Current = TargetTimesOneMinAlpha + CurrentTimesAlpha; /* Q31 + Q31 into Q31*/
- CurrentShort = (LVM_INT16)(pInstance->Current>>16); /* From Q31 to Q15*/
-
- for (ii = OutLoop; ii != 0; ii--)
- {
- Temp1=*src;
- src++;
-
- MUL32x16INTO32(Temp1,CurrentShort,Temp2,15)
- *dst = Temp2;
- dst++;
- }
- }
-
- for (ii = InLoop; ii != 0; ii--)
- {
- MUL32x32INTO32(pInstance->Current,pInstance->Alpha,CurrentTimesAlpha,31) /* Q31 * Q31 in Q31 */
- pInstance->Current = TargetTimesOneMinAlpha + CurrentTimesAlpha; /* Q31 + Q31 into Q31*/
- CurrentShort = (LVM_INT16)(pInstance->Current>>16); /* From Q31 to Q15*/
- Temp1=*src;
- src++;
-
- MUL32x16INTO32(Temp1,CurrentShort,Temp2,15)
- *dst = Temp2;
- dst++;
-
- Temp1=*src;
- src++;
-
- MUL32x16INTO32(Temp1,CurrentShort,Temp2,15)
- *dst = Temp2;
- dst++;
-
- Temp1=*src;
- src++;
-
- MUL32x16INTO32(Temp1,CurrentShort,Temp2,15)
- *dst = Temp2;
- dst++;
-
- Temp1=*src;
- src++;
- MUL32x16INTO32(Temp1,CurrentShort,Temp2,15)
- *dst = Temp2;
- dst++;
- }
-}
-#endif
/**********************************************************************************/
diff --git a/media/libeffects/lvm/lib/Common/src/DC_2I_D16_TRC_WRA_01.cpp b/media/libeffects/lvm/lib/Common/src/DC_2I_D16_TRC_WRA_01.cpp
index 13fac5e..a7ce4d3 100644
--- a/media/libeffects/lvm/lib/Common/src/DC_2I_D16_TRC_WRA_01.cpp
+++ b/media/libeffects/lvm/lib/Common/src/DC_2I_D16_TRC_WRA_01.cpp
@@ -18,7 +18,6 @@
#include "BIQUAD.h"
#include "DC_2I_D16_TRC_WRA_01_Private.h"
#include "LVM_Macros.h"
-#ifdef BUILD_FLOAT
void DC_2I_D16_TRC_WRA_01( Biquad_FLOAT_Instance_t *pInstance,
LVM_FLOAT *pDataIn,
LVM_FLOAT *pDataOut,
@@ -45,7 +44,6 @@
else {
LeftDC += DC_FLOAT_STEP; }
-
/* Subtract DC an saturate */
Diff =* (pDataIn++) - (RightDC);
if (Diff > 1.0f) {
@@ -62,7 +60,6 @@
pBiquadState->LeftDC = LeftDC;
pBiquadState->RightDC = RightDC;
-
}
#ifdef SUPPORT_MC
/*
@@ -116,50 +113,3 @@
}
#endif
-#else
-void DC_2I_D16_TRC_WRA_01( Biquad_Instance_t *pInstance,
- LVM_INT16 *pDataIn,
- LVM_INT16 *pDataOut,
- LVM_INT16 NrSamples)
- {
- LVM_INT32 LeftDC,RightDC;
- LVM_INT32 Diff;
- LVM_INT32 j;
- PFilter_State pBiquadState = (PFilter_State) pInstance;
-
- LeftDC = pBiquadState->LeftDC;
- RightDC = pBiquadState->RightDC;
- for(j=NrSamples-1;j>=0;j--)
- {
- /* Subtract DC an saturate */
- Diff=*(pDataIn++)-(LeftDC>>16);
- if (Diff > 32767) {
- Diff = 32767; }
- else if (Diff < -32768) {
- Diff = -32768; }
- *(pDataOut++)=(LVM_INT16)Diff;
- if (Diff < 0) {
- LeftDC -= DC_D16_STEP; }
- else {
- LeftDC += DC_D16_STEP; }
-
-
- /* Subtract DC an saturate */
- Diff=*(pDataIn++)-(RightDC>>16);
- if (Diff > 32767) {
- Diff = 32767; }
- else if (Diff < -32768) {
- Diff = -32768; }
- *(pDataOut++)=(LVM_INT16)Diff;
- if (Diff < 0) {
- RightDC -= DC_D16_STEP; }
- else {
- RightDC += DC_D16_STEP; }
-
- }
- pBiquadState->LeftDC = LeftDC;
- pBiquadState->RightDC = RightDC;
-
-
- }
-#endif
diff --git a/media/libeffects/lvm/lib/Common/src/DC_2I_D16_TRC_WRA_01_Init.cpp b/media/libeffects/lvm/lib/Common/src/DC_2I_D16_TRC_WRA_01_Init.cpp
index 0f941a0..beee112 100644
--- a/media/libeffects/lvm/lib/Common/src/DC_2I_D16_TRC_WRA_01_Init.cpp
+++ b/media/libeffects/lvm/lib/Common/src/DC_2I_D16_TRC_WRA_01_Init.cpp
@@ -17,7 +17,6 @@
#include "BIQUAD.h"
#include "DC_2I_D16_TRC_WRA_01_Private.h"
-#ifdef BUILD_FLOAT
void DC_2I_D16_TRC_WRA_01_Init(Biquad_FLOAT_Instance_t *pInstance)
{
PFilter_FLOAT_State pBiquadState = (PFilter_FLOAT_State) pInstance;
@@ -35,11 +34,3 @@
}
}
#endif
-#else
-void DC_2I_D16_TRC_WRA_01_Init(Biquad_Instance_t *pInstance)
-{
- PFilter_State pBiquadState = (PFilter_State) pInstance;
- pBiquadState->LeftDC = 0;
- pBiquadState->RightDC = 0;
-}
-#endif
diff --git a/media/libeffects/lvm/lib/Common/src/DC_2I_D16_TRC_WRA_01_Private.h b/media/libeffects/lvm/lib/Common/src/DC_2I_D16_TRC_WRA_01_Private.h
index db3a6d3..6508b73 100644
--- a/media/libeffects/lvm/lib/Common/src/DC_2I_D16_TRC_WRA_01_Private.h
+++ b/media/libeffects/lvm/lib/Common/src/DC_2I_D16_TRC_WRA_01_Private.h
@@ -18,16 +18,10 @@
#ifndef _DC_2I_D16_TRC_WRA_01_PRIVATE_H_
#define _DC_2I_D16_TRC_WRA_01_PRIVATE_H_
-#ifdef BUILD_FLOAT
#define DC_FLOAT_STEP 0.0000002384f;
-#else
-#define DC_D16_STEP 0x200;
-#endif
-
/* The internal state variables are implemented in a (for the user) hidden structure */
/* In this (private) file, the internal structure is declared fro private use.*/
-#ifdef BUILD_FLOAT
typedef struct _Filter_FLOAT_State_
{
LVM_FLOAT LeftDC; /* LeftDC */
@@ -41,13 +35,4 @@
} Filter_FLOAT_State_Mc;
typedef Filter_FLOAT_State_Mc * PFilter_FLOAT_State_Mc ;
#endif
-#else
-typedef struct _Filter_State_
-{
- LVM_INT32 LeftDC; /* LeftDC */
- LVM_INT32 RightDC; /* RightDC */
-}Filter_State;
-
-typedef Filter_State * PFilter_State ;
-#endif
#endif /* _DC_2I_D16_TRC_WRA_01_PRIVATE_H_ */
diff --git a/media/libeffects/lvm/lib/Common/src/DelayAllPass_Sat_32x16To32.cpp b/media/libeffects/lvm/lib/Common/src/DelayAllPass_Sat_32x16To32.cpp
index b04e98e..771fae2 100644
--- a/media/libeffects/lvm/lib/Common/src/DelayAllPass_Sat_32x16To32.cpp
+++ b/media/libeffects/lvm/lib/Common/src/DelayAllPass_Sat_32x16To32.cpp
@@ -63,7 +63,6 @@
*dst = c;
dst++;
-
MUL32x16INTO32(c, -coeff, temp, 15)
a = temp;
b = delay[AllPassOffset];
diff --git a/media/libeffects/lvm/lib/Common/src/DelayMix_16x16.cpp b/media/libeffects/lvm/lib/Common/src/DelayMix_16x16.cpp
index f502716..52d263f 100644
--- a/media/libeffects/lvm/lib/Common/src/DelayMix_16x16.cpp
+++ b/media/libeffects/lvm/lib/Common/src/DelayMix_16x16.cpp
@@ -47,7 +47,6 @@
Offset++;
src++;
-
/* Right channel */
temp = (LVM_INT16)((LVM_UINT32)((LVM_INT32)(*dst) - (LVM_INT32)delay[Offset]) >> 1);
*dst = temp;
@@ -69,7 +68,6 @@
return;
}
-#ifdef BUILD_FLOAT
void DelayMix_Float(const LVM_FLOAT *src, /* Source 1, to be delayed */
LVM_FLOAT *delay, /* Delay buffer */
LVM_INT16 size, /* Delay size */
@@ -92,7 +90,6 @@
Offset++;
src++;
-
/* Right channel */
temp = (LVM_FLOAT)((LVM_FLOAT)(*dst - (LVM_FLOAT)delay[Offset]) / 2.0f);
*dst = temp;
@@ -114,5 +111,4 @@
return;
}
-#endif
/**********************************************************************************/
diff --git a/media/libeffects/lvm/lib/Common/src/FO_1I_D16F16C15_TRC_WRA_01.cpp b/media/libeffects/lvm/lib/Common/src/FO_1I_D16F16C15_TRC_WRA_01.cpp
index 039c88c..bef0d62 100644
--- a/media/libeffects/lvm/lib/Common/src/FO_1I_D16F16C15_TRC_WRA_01.cpp
+++ b/media/libeffects/lvm/lib/Common/src/FO_1I_D16F16C15_TRC_WRA_01.cpp
@@ -31,7 +31,6 @@
pBiquadState->pDelays[1] is y(n-1)L in Q0 format
***************************************************************************/
-#ifdef BUILD_FLOAT
void FO_1I_D16F16C15_TRC_WRA_01( Biquad_FLOAT_Instance_t *pInstance,
LVM_FLOAT *pDataIn,
LVM_FLOAT *pDataOut,
@@ -70,45 +69,3 @@
}
}
-#else
-void FO_1I_D16F16C15_TRC_WRA_01( Biquad_Instance_t *pInstance,
- LVM_INT16 *pDataIn,
- LVM_INT16 *pDataOut,
- LVM_INT16 NrSamples)
- {
- LVM_INT32 ynL;
- LVM_INT16 ii;
- PFilter_State pBiquadState = (PFilter_State) pInstance;
-
- for (ii = NrSamples; ii != 0; ii--)
- {
-
- /**************************************************************************
- PROCESSING OF THE LEFT CHANNEL
- ***************************************************************************/
- // ynL=A1 (Q15) * x(n-1)L (Q0) in Q15
- ynL=(LVM_INT32)pBiquadState->coefs[0]* pBiquadState->pDelays[0];
-
- // ynL+=A0 (Q15) * x(n)L (Q0) in Q15
- ynL+=(LVM_INT32)pBiquadState->coefs[1]* (*pDataIn);
-
- // ynL+= (-B1 (Q15) * y(n-1)L (Q0) ) in Q15
- ynL+=(LVM_INT32)pBiquadState->coefs[2]*pBiquadState->pDelays[1];
-
-
- ynL=(LVM_INT16)(ynL>>15); // ynL in Q0 format
- /**************************************************************************
- UPDATING THE DELAYS
- ***************************************************************************/
- pBiquadState->pDelays[1]=ynL; // Update y(n-1)L in Q0
- pBiquadState->pDelays[0]=(*pDataIn++); // Update x(n-1)L in Q0
-
- /**************************************************************************
- WRITING THE OUTPUT
- ***************************************************************************/
- *pDataOut++=(LVM_INT16)ynL; // Write Left output in Q0
-
- }
-
- }
-#endif
diff --git a/media/libeffects/lvm/lib/Common/src/FO_1I_D16F16Css_TRC_WRA_01_Init.cpp b/media/libeffects/lvm/lib/Common/src/FO_1I_D16F16Css_TRC_WRA_01_Init.cpp
index b21b8a4..161225e 100644
--- a/media/libeffects/lvm/lib/Common/src/FO_1I_D16F16Css_TRC_WRA_01_Init.cpp
+++ b/media/libeffects/lvm/lib/Common/src/FO_1I_D16F16Css_TRC_WRA_01_Init.cpp
@@ -19,7 +19,6 @@
#include "BIQUAD.h"
#include "FO_1I_D16F16Css_TRC_WRA_01_Private.h"
-
/*-------------------------------------------------------------------------*/
/* FUNCTION: */
/* FO_1I_D16F16Css_TRC_WRA_01_Init */
@@ -38,7 +37,6 @@
/* RETURNS: */
/* void return code */
/*-------------------------------------------------------------------------*/
-#ifdef BUILD_FLOAT
void FO_1I_D16F16Css_TRC_WRA_01_Init( Biquad_FLOAT_Instance_t *pInstance,
Biquad_1I_Order1_FLOAT_Taps_t *pTaps,
FO_FLOAT_Coefs_t *pCoef)
@@ -53,23 +51,6 @@
temp = pCoef->B1;
pBiquadState->coefs[2] = temp;
}
-#else
-void FO_1I_D16F16Css_TRC_WRA_01_Init( Biquad_Instance_t *pInstance,
- Biquad_1I_Order1_Taps_t *pTaps,
- FO_C16_Coefs_t *pCoef)
-{
- LVM_INT16 temp;
- PFilter_State pBiquadState = (PFilter_State) pInstance;
- pBiquadState->pDelays =(LVM_INT32 *) pTaps;
-
- temp=pCoef->A1;
- pBiquadState->coefs[0]=temp;
- temp=pCoef->A0;
- pBiquadState->coefs[1]=temp;
- temp=pCoef->B1;
- pBiquadState->coefs[2]=temp;
-}
-#endif
/*------------------------------------------------*/
/* End Of File: FO_1I_D16F16Css_TRC_WRA_01_Init.c */
diff --git a/media/libeffects/lvm/lib/Common/src/FO_1I_D16F16Css_TRC_WRA_01_Private.h b/media/libeffects/lvm/lib/Common/src/FO_1I_D16F16Css_TRC_WRA_01_Private.h
index 6fdb039..34f3df9 100644
--- a/media/libeffects/lvm/lib/Common/src/FO_1I_D16F16Css_TRC_WRA_01_Private.h
+++ b/media/libeffects/lvm/lib/Common/src/FO_1I_D16F16Css_TRC_WRA_01_Private.h
@@ -28,7 +28,6 @@
typedef Filter_State * PFilter_State ;
-#ifdef BUILD_FLOAT
typedef struct _Filter_State_FLOAT
{
LVM_FLOAT * pDelays; /* pointer to the delayed samples \
@@ -37,5 +36,4 @@
}Filter_State_FLOAT;
typedef Filter_State_FLOAT * PFilter_State_FLOAT ;
-#endif
#endif /* _FO_1I_D16F16CSS_TRC_WRA_01_PRIVATE_H_ */
diff --git a/media/libeffects/lvm/lib/Common/src/FO_1I_D32F32C31_TRC_WRA_01.cpp b/media/libeffects/lvm/lib/Common/src/FO_1I_D32F32C31_TRC_WRA_01.cpp
index 416e8eb..e3efad7 100644
--- a/media/libeffects/lvm/lib/Common/src/FO_1I_D32F32C31_TRC_WRA_01.cpp
+++ b/media/libeffects/lvm/lib/Common/src/FO_1I_D32F32C31_TRC_WRA_01.cpp
@@ -19,7 +19,6 @@
#include "FO_1I_D32F32Cll_TRC_WRA_01_Private.h"
#include "LVM_Macros.h"
-
/**************************************************************************
ASSUMPTIONS:
COEFS-
@@ -31,7 +30,6 @@
pBiquadState->pDelays[0] is x(n-1)L in Q0 format
pBiquadState->pDelays[1] is y(n-1)L in Q0 format
***************************************************************************/
-#ifdef BUILD_FLOAT
void FO_1I_D32F32C31_TRC_WRA_01( Biquad_FLOAT_Instance_t *pInstance,
LVM_FLOAT *pDataIn,
LVM_FLOAT *pDataOut,
@@ -71,44 +69,3 @@
}
}
-#else
-void FO_1I_D32F32C31_TRC_WRA_01( Biquad_Instance_t *pInstance,
- LVM_INT32 *pDataIn,
- LVM_INT32 *pDataOut,
- LVM_INT16 NrSamples)
- {
- LVM_INT32 ynL,templ;
- LVM_INT16 ii;
- PFilter_State pBiquadState = (PFilter_State) pInstance;
-
- for (ii = NrSamples; ii != 0; ii--)
- {
-
- /**************************************************************************
- PROCESSING OF THE LEFT CHANNEL
- ***************************************************************************/
- // ynL=A1 (Q31) * x(n-1)L (Q0) >>31 in Q0
- MUL32x32INTO32(pBiquadState->coefs[0],pBiquadState->pDelays[0],ynL,31)
-
- // ynL+=A0 (Q31) * x(n)L (Q0) >> 31 in Q0
- MUL32x32INTO32(pBiquadState->coefs[1],*pDataIn,templ,31)
- ynL+=templ;
-
- // ynL+= (-B1 (Q31) * y(n-1)L (Q0) ) >> 31 in Q0
- MUL32x32INTO32(pBiquadState->coefs[2],pBiquadState->pDelays[1],templ,31)
- ynL+=templ;
-
- /**************************************************************************
- UPDATING THE DELAYS
- ***************************************************************************/
- pBiquadState->pDelays[1]=ynL; // Update y(n-1)L in Q0
- pBiquadState->pDelays[0]=(*pDataIn++); // Update x(n-1)L in Q0
-
- /**************************************************************************
- WRITING THE OUTPUT
- ***************************************************************************/
- *pDataOut++=(LVM_INT32)ynL; // Write Left output in Q0
- }
-
- }
-#endif
diff --git a/media/libeffects/lvm/lib/Common/src/FO_1I_D32F32Cll_TRC_WRA_01_Init.cpp b/media/libeffects/lvm/lib/Common/src/FO_1I_D32F32Cll_TRC_WRA_01_Init.cpp
index f33d24d..bb5295c 100644
--- a/media/libeffects/lvm/lib/Common/src/FO_1I_D32F32Cll_TRC_WRA_01_Init.cpp
+++ b/media/libeffects/lvm/lib/Common/src/FO_1I_D32F32Cll_TRC_WRA_01_Init.cpp
@@ -18,7 +18,6 @@
#include "BIQUAD.h"
#include "FO_1I_D32F32Cll_TRC_WRA_01_Private.h"
-
/*-------------------------------------------------------------------------*/
/* FUNCTION: */
/* FO_1I_D32F32Cll_TRC_WRA_01_Init */
@@ -37,7 +36,6 @@
/* RETURNS: */
/* void return code */
/*-------------------------------------------------------------------------*/
-#ifdef BUILD_FLOAT
void FO_1I_D32F32Cll_TRC_WRA_01_Init( Biquad_FLOAT_Instance_t *pInstance,
Biquad_1I_Order1_FLOAT_Taps_t *pTaps,
FO_FLOAT_Coefs_t *pCoef)
@@ -53,23 +51,6 @@
temp = pCoef->B1;
pBiquadState->coefs[2] = temp;
}
-#else
-void FO_1I_D32F32Cll_TRC_WRA_01_Init( Biquad_Instance_t *pInstance,
- Biquad_1I_Order1_Taps_t *pTaps,
- FO_C32_Coefs_t *pCoef)
-{
- LVM_INT32 temp;
- PFilter_State pBiquadState = (PFilter_State) pInstance;
- pBiquadState->pDelays = (LVM_INT32 *) pTaps;
-
- temp=pCoef->A1;
- pBiquadState->coefs[0]=temp;
- temp=pCoef->A0;
- pBiquadState->coefs[1]=temp;
- temp=pCoef->B1;
- pBiquadState->coefs[2]=temp;
-}
-#endif
/*------------------------------------------------*/
/* End Of File: FO_1I_D32F32Cll_TRC_WRA_01_Init.c */
diff --git a/media/libeffects/lvm/lib/Common/src/FO_1I_D32F32Cll_TRC_WRA_01_Private.h b/media/libeffects/lvm/lib/Common/src/FO_1I_D32F32Cll_TRC_WRA_01_Private.h
index fdb528b..67d1384 100644
--- a/media/libeffects/lvm/lib/Common/src/FO_1I_D32F32Cll_TRC_WRA_01_Private.h
+++ b/media/libeffects/lvm/lib/Common/src/FO_1I_D32F32Cll_TRC_WRA_01_Private.h
@@ -18,7 +18,6 @@
#ifndef _FO_1I_D32F32CLL_TRC_WRA_01_PRIVATE_H_
#define _FO_1I_D32F32CLL_TRC_WRA_01_PRIVATE_H_
-
/* The internal state variables are implemented in a (for the user) hidden structure */
/* In this (private) file, the internal structure is declared fro private use. */
typedef struct _Filter_State_
@@ -29,7 +28,6 @@
typedef Filter_State * PFilter_State ;
-#ifdef BUILD_FLOAT
typedef struct _Filter_State_FLOAT_
{
LVM_FLOAT * pDelays; /* pointer to the delayed samples (data of 32 bits) */
@@ -37,5 +35,4 @@
}Filter_State_FLOAT;
typedef Filter_State_FLOAT * PFilter_State_FLOAT ;
-#endif
#endif /* _FO_1I_D32F32CLL_TRC_WRA_01_PRIVATE_H_ */
diff --git a/media/libeffects/lvm/lib/Common/src/FO_2I_D16F32C15_LShx_TRC_WRA_01.cpp b/media/libeffects/lvm/lib/Common/src/FO_2I_D16F32C15_LShx_TRC_WRA_01.cpp
index 2a50f18..6ca819a 100644
--- a/media/libeffects/lvm/lib/Common/src/FO_2I_D16F32C15_LShx_TRC_WRA_01.cpp
+++ b/media/libeffects/lvm/lib/Common/src/FO_2I_D16F32C15_LShx_TRC_WRA_01.cpp
@@ -32,7 +32,6 @@
pBiquadState->pDelays[2] is x(n-1)R in Q15 format
pBiquadState->pDelays[3] is y(n-1)R in Q30 format
***************************************************************************/
-#ifdef BUILD_FLOAT
void FO_2I_D16F32C15_LShx_TRC_WRA_01(Biquad_FLOAT_Instance_t *pInstance,
LVM_FLOAT *pDataIn,
LVM_FLOAT *pDataOut,
@@ -59,13 +58,11 @@
// ynR =A1 * x(n-1)R
ynR = (LVM_FLOAT)pBiquadState->coefs[0] * pBiquadState->pDelays[2];
-
// ynL+=A0 * x(n)L
ynL += (LVM_FLOAT)pBiquadState->coefs[1] * (*pDataIn);
// ynR+=A0 * x(n)L
ynR += (LVM_FLOAT)pBiquadState->coefs[1] * (*(pDataIn+1));
-
// ynL += (-B1 * y(n-1)L )
Temp = pBiquadState->pDelays[1] * pBiquadState->coefs[2];
ynL += Temp;
@@ -73,7 +70,6 @@
Temp = pBiquadState->pDelays[3] * pBiquadState->coefs[2];
ynR += Temp;
-
/**************************************************************************
UPDATING THE DELAYS
***************************************************************************/
@@ -157,9 +153,6 @@
LVM_FLOAT A1 = pCoefs[0];
LVM_FLOAT B1 = pCoefs[2];
-
-
-
for (ii = NrFrames; ii != 0; ii--)
{
@@ -178,7 +171,6 @@
Temp = B1 * pDelays[1];
yn += Temp;
-
/**************************************************************************
UPDATING THE DELAYS
***************************************************************************/
@@ -204,97 +196,3 @@
}
}
#endif
-#else
-void FO_2I_D16F32C15_LShx_TRC_WRA_01(Biquad_Instance_t *pInstance,
- LVM_INT16 *pDataIn,
- LVM_INT16 *pDataOut,
- LVM_INT16 NrSamples)
- {
- LVM_INT32 ynL,ynR;
- LVM_INT32 Temp;
- LVM_INT32 NegSatValue;
- LVM_INT16 ii;
- LVM_INT16 Shift;
- PFilter_State pBiquadState = (PFilter_State) pInstance;
-
- NegSatValue = LVM_MAXINT_16 +1;
- NegSatValue = -NegSatValue;
-
- Shift = pBiquadState->Shift;
-
-
- for (ii = NrSamples; ii != 0; ii--)
- {
-
- /**************************************************************************
- PROCESSING OF THE LEFT CHANNEL
- ***************************************************************************/
-
- // ynL =A1 (Q15) * x(n-1)L (Q15) in Q30
- ynL=(LVM_INT32)pBiquadState->coefs[0]* pBiquadState->pDelays[0];
- // ynR =A1 (Q15) * x(n-1)R (Q15) in Q30
- ynR=(LVM_INT32)pBiquadState->coefs[0]* pBiquadState->pDelays[2];
-
-
- // ynL+=A0 (Q15) * x(n)L (Q15) in Q30
- ynL+=(LVM_INT32)pBiquadState->coefs[1]* (*pDataIn);
- // ynR+=A0 (Q15) * x(n)L (Q15) in Q30
- ynR+=(LVM_INT32)pBiquadState->coefs[1]* (*(pDataIn+1));
-
-
- // ynL += (-B1 (Q15) * y(n-1)L (Q30) ) in Q30
- MUL32x16INTO32(pBiquadState->pDelays[1],pBiquadState->coefs[2],Temp,15);
- ynL +=Temp;
- // ynR += (-B1 (Q15) * y(n-1)R (Q30) ) in Q30
- MUL32x16INTO32(pBiquadState->pDelays[3],pBiquadState->coefs[2],Temp,15);
- ynR +=Temp;
-
-
- /**************************************************************************
- UPDATING THE DELAYS
- ***************************************************************************/
- pBiquadState->pDelays[1]=ynL; // Update y(n-1)L in Q30
- pBiquadState->pDelays[0]=(*pDataIn++); // Update x(n-1)L in Q15
-
- pBiquadState->pDelays[3]=ynR; // Update y(n-1)R in Q30
- pBiquadState->pDelays[2]=(*pDataIn++); // Update x(n-1)R in Q15
-
- /**************************************************************************
- WRITING THE OUTPUT
- ***************************************************************************/
- /*Apply shift: Instead of left shift on 16-bit result, right shift of (15-shift) is applied
- for better SNR*/
- ynL = ynL>>(15-Shift);
- ynR = ynR>>(15-Shift);
-
- /*Saturate results*/
- if(ynL > LVM_MAXINT_16)
- {
- ynL = LVM_MAXINT_16;
- }
- else
- {
- if(ynL < NegSatValue)
- {
- ynL = NegSatValue;
- }
- }
-
- if(ynR > LVM_MAXINT_16)
- {
- ynR = LVM_MAXINT_16;
- }
- else
- {
- if(ynR < NegSatValue)
- {
- ynR = NegSatValue;
- }
- }
-
- *pDataOut++=(LVM_INT16)ynL;
- *pDataOut++=(LVM_INT16)ynR;
- }
-
- }
-#endif
diff --git a/media/libeffects/lvm/lib/Common/src/FO_2I_D16F32Css_LShx_TRC_WRA_01_Init.cpp b/media/libeffects/lvm/lib/Common/src/FO_2I_D16F32Css_LShx_TRC_WRA_01_Init.cpp
index 33ca6cf..b81b976 100644
--- a/media/libeffects/lvm/lib/Common/src/FO_2I_D16F32Css_LShx_TRC_WRA_01_Init.cpp
+++ b/media/libeffects/lvm/lib/Common/src/FO_2I_D16F32Css_LShx_TRC_WRA_01_Init.cpp
@@ -37,7 +37,6 @@
/* RETURNS: */
/* void return code */
/*-------------------------------------------------------------------------*/
-#ifdef BUILD_FLOAT
void FO_2I_D16F32Css_LShx_TRC_WRA_01_Init(Biquad_FLOAT_Instance_t *pInstance,
Biquad_2I_Order1_FLOAT_Taps_t *pTaps,
FO_FLOAT_LShx_Coefs_t *pCoef)
@@ -53,26 +52,6 @@
temp = pCoef->B1;
pBiquadState->coefs[2] = temp;
}
-#else
-void FO_2I_D16F32Css_LShx_TRC_WRA_01_Init(Biquad_Instance_t *pInstance,
- Biquad_2I_Order1_Taps_t *pTaps,
- FO_C16_LShx_Coefs_t *pCoef)
-{
- LVM_INT16 temp;
- PFilter_State pBiquadState = (PFilter_State) pInstance;
- pBiquadState->pDelays =(LVM_INT32 *) pTaps ;
-
- temp=pCoef->A1;
- pBiquadState->coefs[0]=temp;
- temp=pCoef->A0;
- pBiquadState->coefs[1]=temp;
- temp=pCoef->B1;
- pBiquadState->coefs[2]=temp;
-
- temp=pCoef->Shift;
- pBiquadState->Shift = temp;
-}
-#endif
/*-------------------------------------------------------------------------*/
/* End Of File: FO_2I_D16F32Css_LShx_TRC_WRA_01_Init.c */
diff --git a/media/libeffects/lvm/lib/Common/src/FO_2I_D16F32Css_LShx_TRC_WRA_01_Private.h b/media/libeffects/lvm/lib/Common/src/FO_2I_D16F32Css_LShx_TRC_WRA_01_Private.h
index 368bfce..5022500 100644
--- a/media/libeffects/lvm/lib/Common/src/FO_2I_D16F32Css_LShx_TRC_WRA_01_Private.h
+++ b/media/libeffects/lvm/lib/Common/src/FO_2I_D16F32Css_LShx_TRC_WRA_01_Private.h
@@ -20,7 +20,6 @@
/* The internal state variables are implemented in a (for the user) hidden structure */
/* In this (private) file, the internal structure is declared fro private use. */
-#ifdef BUILD_FLOAT
typedef struct _Filter_State_
{
LVM_FLOAT *pDelays; /* pointer to the delayed samples (data of 32 bits) */
@@ -28,14 +27,4 @@
}Filter_Float_State;
typedef Filter_Float_State * PFilter_Float_State ;
-#else
-typedef struct _Filter_State_
-{
- LVM_INT32 *pDelays; /* pointer to the delayed samples (data of 32 bits) */
- LVM_INT16 coefs[3]; /* pointer to the filter coefficients */
- LVM_INT16 Shift; /* Shift value*/
-}Filter_State;
-
-typedef Filter_State * PFilter_State ;
-#endif
#endif /* _FO_2I_D16F32CSS_LSHX_TRC_WRA_01_PRIVATE_H_ */
diff --git a/media/libeffects/lvm/lib/Common/src/Filters.h b/media/libeffects/lvm/lib/Common/src/Filters.h
index 14b7226..b5db8f4 100644
--- a/media/libeffects/lvm/lib/Common/src/Filters.h
+++ b/media/libeffects/lvm/lib/Common/src/Filters.h
@@ -18,7 +18,6 @@
#ifndef FILTERS_H
#define FILTERS_H
-
#include "LVM_Types.h"
/************************************************************************************/
@@ -31,17 +30,6 @@
* Biquad with coefficients A0, A1, A2, B1 and B2 coefficients
*/
/* Single precision (16-bit) Biquad section coefficients */
-#ifndef BUILD_FLOAT
-typedef struct
-{
- LVM_INT16 A0;
- LVM_INT16 A1;
- LVM_INT16 A2;
- LVM_INT16 B1;
- LVM_INT16 B2;
- LVM_UINT16 Scale;
-} BiquadA012B12CoefsSP_t;
-#else
typedef struct
{
LVM_FLOAT A0;
@@ -51,20 +39,10 @@
LVM_FLOAT B2;
LVM_UINT16 Scale;
} BiquadA012B12CoefsSP_t;
-#endif
/*
* Biquad with coefficients A0, A1 and B1 coefficients
*/
/* Single precision (16-bit) Biquad section coefficients */
-#ifndef BUILD_FLOAT
-typedef struct
-{
- LVM_INT16 A0;
- LVM_INT16 A1;
- LVM_INT16 B1;
- LVM_UINT16 Scale;
-} BiquadA01B1CoefsSP_t;
-#else
typedef struct
{
LVM_FLOAT A0;
@@ -72,7 +50,6 @@
LVM_FLOAT B1;
LVM_UINT16 Scale;
} BiquadA01B1CoefsSP_t;
-#endif
#endif /* FILTERS_H */
diff --git a/media/libeffects/lvm/lib/Common/src/From2iToMS_16x16.cpp b/media/libeffects/lvm/lib/Common/src/From2iToMS_16x16.cpp
index 2c6e6c3..c3f6648 100644
--- a/media/libeffects/lvm/lib/Common/src/From2iToMS_16x16.cpp
+++ b/media/libeffects/lvm/lib/Common/src/From2iToMS_16x16.cpp
@@ -53,7 +53,6 @@
return;
}
-#ifdef BUILD_FLOAT
void From2iToMS_Float( const LVM_FLOAT *src,
LVM_FLOAT *dstM,
LVM_FLOAT *dstS,
@@ -82,5 +81,4 @@
return;
}
-#endif
/**********************************************************************************/
diff --git a/media/libeffects/lvm/lib/Common/src/From2iToMono_32.cpp b/media/libeffects/lvm/lib/Common/src/From2iToMono_32.cpp
index d02af88..a8688b4 100644
--- a/media/libeffects/lvm/lib/Common/src/From2iToMono_32.cpp
+++ b/media/libeffects/lvm/lib/Common/src/From2iToMono_32.cpp
@@ -46,7 +46,6 @@
return;
}
-#ifdef BUILD_FLOAT
void From2iToMono_Float( const LVM_FLOAT *src,
LVM_FLOAT *dst,
LVM_INT16 n)
@@ -110,5 +109,4 @@
}
#endif
-#endif
/**********************************************************************************/
diff --git a/media/libeffects/lvm/lib/Common/src/InstAlloc.cpp b/media/libeffects/lvm/lib/Common/src/InstAlloc.cpp
index a89a5c3..a039bf5 100644
--- a/media/libeffects/lvm/lib/Common/src/InstAlloc.cpp
+++ b/media/libeffects/lvm/lib/Common/src/InstAlloc.cpp
@@ -33,7 +33,6 @@
pms->pNextMember = (((uintptr_t)StartAddr + 3) & (uintptr_t)~3);
}
-
/****************************************************************************************
* Name : InstAlloc_AddMember()
* Input : pms - Pointer to the INST_ALLOC instance
@@ -59,7 +58,6 @@
return(NewMemberAddress);
}
-
/****************************************************************************************
* Name : InstAlloc_GetTotal()
* Input : pms - Pointer to the INST_ALLOC instance
@@ -80,7 +78,6 @@
}
}
-
void InstAlloc_InitAll( INST_ALLOC *pms,
LVM_MemoryTable_st *pMemoryTable)
{
@@ -91,19 +88,16 @@
pms[0].TotalSize = 3;
pms[0].pNextMember = ((StartAddr + 3) & (uintptr_t)~3);
-
StartAddr = (uintptr_t)pMemoryTable->Region[LVM_PERSISTENT_FAST_DATA].pBaseAddress;
pms[1].TotalSize = 3;
pms[1].pNextMember = ((StartAddr + 3) & (uintptr_t)~3);
-
StartAddr = (uintptr_t)pMemoryTable->Region[LVM_PERSISTENT_FAST_COEF].pBaseAddress;
pms[2].TotalSize = 3;
pms[2].pNextMember = ((StartAddr + 3) & (uintptr_t)~3);
-
StartAddr = (uintptr_t)pMemoryTable->Region[LVM_TEMPORARY_FAST].pBaseAddress;
pms[3].TotalSize = 3;
@@ -125,7 +119,6 @@
pms[0].TotalSize = 3;
pms[0].pNextMember = 0;
-
pms[1].TotalSize = 3;
pms[1].pNextMember = 0;
@@ -137,7 +130,6 @@
}
-
void* InstAlloc_AddMemberAll( INST_ALLOC *pms,
LVM_UINT32 Size[],
LVM_MemoryTable_st *pMemoryTable)
@@ -172,7 +164,6 @@
return(NewMemberAddress);
}
-
void* InstAlloc_AddMemberAllRet( INST_ALLOC *pms,
LVM_UINT32 Size[],
void **ptr)
diff --git a/media/libeffects/lvm/lib/Common/src/JoinTo2i_32x32.cpp b/media/libeffects/lvm/lib/Common/src/JoinTo2i_32x32.cpp
index ebc477e..05df656 100644
--- a/media/libeffects/lvm/lib/Common/src/JoinTo2i_32x32.cpp
+++ b/media/libeffects/lvm/lib/Common/src/JoinTo2i_32x32.cpp
@@ -49,7 +49,6 @@
return;
}
-#ifdef BUILD_FLOAT
void JoinTo2i_Float( const LVM_FLOAT *srcL,
const LVM_FLOAT *srcR,
LVM_FLOAT *dst,
@@ -74,6 +73,5 @@
return;
}
-#endif
/**********************************************************************************/
diff --git a/media/libeffects/lvm/lib/Common/src/LVC_Core_MixHard_1St_2i_D16C31_SAT.cpp b/media/libeffects/lvm/lib/Common/src/LVC_Core_MixHard_1St_2i_D16C31_SAT.cpp
index db76cd1..14d61bd 100644
--- a/media/libeffects/lvm/lib/Common/src/LVC_Core_MixHard_1St_2i_D16C31_SAT.cpp
+++ b/media/libeffects/lvm/lib/Common/src/LVC_Core_MixHard_1St_2i_D16C31_SAT.cpp
@@ -23,11 +23,9 @@
#include "LVM_Macros.h"
#include "ScalarArithmetic.h"
-
/**********************************************************************************
FUNCTION LVC_Core_MixHard_1St_2i_D16C31_SAT
***********************************************************************************/
-#ifdef BUILD_FLOAT
void LVC_Core_MixHard_1St_2i_D16C31_SAT( LVMixer3_FLOAT_st *ptrInstance1,
LVMixer3_FLOAT_st *ptrInstance2,
const LVM_FLOAT *src,
@@ -57,7 +55,6 @@
*dst++ = (LVM_FLOAT)Temp;
}
-
}
#ifdef SUPPORT_MC
void LVC_Core_MixHard_1St_MC_float_SAT (Mix_Private_FLOAT_st **ptrInstance,
@@ -84,44 +81,4 @@
}
}
#endif
-#else
-void LVC_Core_MixHard_1St_2i_D16C31_SAT( LVMixer3_st *ptrInstance1,
- LVMixer3_st *ptrInstance2,
- const LVM_INT16 *src,
- LVM_INT16 *dst,
- LVM_INT16 n)
-{
- LVM_INT32 Temp;
- LVM_INT16 ii;
- LVM_INT16 Current1Short;
- LVM_INT16 Current2Short;
- Mix_Private_st *pInstance1=(Mix_Private_st *)(ptrInstance1->PrivateParams);
- Mix_Private_st *pInstance2=(Mix_Private_st *)(ptrInstance2->PrivateParams);
-
-
- Current1Short = (LVM_INT16)(pInstance1->Current >> 16);
- Current2Short = (LVM_INT16)(pInstance2->Current >> 16);
-
- for (ii = n; ii != 0; ii--)
- {
- Temp = ((LVM_INT32)*(src++) * (LVM_INT32)Current1Short)>>15;
- if (Temp > 0x00007FFF)
- *dst++ = 0x7FFF;
- else if (Temp < -0x00008000)
- *dst++ = - 0x8000;
- else
- *dst++ = (LVM_INT16)Temp;
-
- Temp = ((LVM_INT32)*(src++) * (LVM_INT32)Current2Short)>>15;
- if (Temp > 0x00007FFF)
- *dst++ = 0x7FFF;
- else if (Temp < -0x00008000)
- *dst++ = - 0x8000;
- else
- *dst++ = (LVM_INT16)Temp;
- }
-
-
-}
-#endif
/**********************************************************************************/
diff --git a/media/libeffects/lvm/lib/Common/src/LVC_Core_MixHard_2St_D16C31_SAT.cpp b/media/libeffects/lvm/lib/Common/src/LVC_Core_MixHard_2St_D16C31_SAT.cpp
index ec0baaf..841fa1e 100644
--- a/media/libeffects/lvm/lib/Common/src/LVC_Core_MixHard_2St_D16C31_SAT.cpp
+++ b/media/libeffects/lvm/lib/Common/src/LVC_Core_MixHard_2St_D16C31_SAT.cpp
@@ -24,7 +24,6 @@
/**********************************************************************************
FUNCTION LVCore_MIXHARD_2ST_D16C31_SAT
***********************************************************************************/
-#ifdef BUILD_FLOAT
void LVC_Core_MixHard_2St_D16C31_SAT( LVMixer3_FLOAT_st *ptrInstance1,
LVMixer3_FLOAT_st *ptrInstance2,
const LVM_FLOAT *src1,
@@ -39,7 +38,6 @@
Mix_Private_FLOAT_st *pInstance1 = (Mix_Private_FLOAT_st *)(ptrInstance1->PrivateParams);
Mix_Private_FLOAT_st *pInstance2 = (Mix_Private_FLOAT_st *)(ptrInstance2->PrivateParams);
-
Current1 = (pInstance1->Current);
Current2 = (pInstance2->Current);
@@ -54,35 +52,4 @@
*dst++ = Temp;
}
}
-#else
-void LVC_Core_MixHard_2St_D16C31_SAT( LVMixer3_st *ptrInstance1,
- LVMixer3_st *ptrInstance2,
- const LVM_INT16 *src1,
- const LVM_INT16 *src2,
- LVM_INT16 *dst,
- LVM_INT16 n)
-{
- LVM_INT32 Temp;
- LVM_INT16 ii;
- LVM_INT16 Current1Short;
- LVM_INT16 Current2Short;
- Mix_Private_st *pInstance1=(Mix_Private_st *)(ptrInstance1->PrivateParams);
- Mix_Private_st *pInstance2=(Mix_Private_st *)(ptrInstance2->PrivateParams);
-
-
- Current1Short = (LVM_INT16)(pInstance1->Current >> 16);
- Current2Short = (LVM_INT16)(pInstance2->Current >> 16);
-
- for (ii = n; ii != 0; ii--){
- Temp = (((LVM_INT32)*(src1++) * (LVM_INT32)Current1Short)>>15) +
- (((LVM_INT32)*(src2++) * (LVM_INT32)Current2Short)>>15);
- if (Temp > 0x00007FFF)
- *dst++ = 0x7FFF;
- else if (Temp < -0x00008000)
- *dst++ = - 0x8000;
- else
- *dst++ = (LVM_INT16)Temp;
- }
-}
-#endif
/**********************************************************************************/
diff --git a/media/libeffects/lvm/lib/Common/src/LVC_Core_MixInSoft_D16C31_SAT.cpp b/media/libeffects/lvm/lib/Common/src/LVC_Core_MixInSoft_D16C31_SAT.cpp
index 419c7c5..318138d 100644
--- a/media/libeffects/lvm/lib/Common/src/LVC_Core_MixInSoft_D16C31_SAT.cpp
+++ b/media/libeffects/lvm/lib/Common/src/LVC_Core_MixInSoft_D16C31_SAT.cpp
@@ -25,7 +25,6 @@
/**********************************************************************************
FUNCTION LVCore_MIXSOFT_1ST_D16C31_WRA
***********************************************************************************/
-#ifdef BUILD_FLOAT
void LVC_Core_MixInSoft_D16C31_SAT(LVMixer3_FLOAT_st *ptrInstance,
const LVM_FLOAT *src,
LVM_FLOAT *dst,
@@ -247,103 +246,4 @@
}
#endif
-#else
-void LVC_Core_MixInSoft_D16C31_SAT( LVMixer3_st *ptrInstance,
- const LVM_INT16 *src,
- LVM_INT16 *dst,
- LVM_INT16 n)
-{
-
- LVM_INT16 OutLoop;
- LVM_INT16 InLoop;
- LVM_INT16 CurrentShort;
- LVM_INT32 ii,jj;
- Mix_Private_st *pInstance=(Mix_Private_st *)(ptrInstance->PrivateParams);
- LVM_INT32 Delta=pInstance->Delta;
- LVM_INT32 Current=pInstance->Current;
- LVM_INT32 Target=pInstance->Target;
- LVM_INT32 Temp;
-
- InLoop = (LVM_INT16)(n >> 2); /* Process per 4 samples */
- OutLoop = (LVM_INT16)(n - (InLoop << 2));
-
- if(Current<Target){
- if (OutLoop){
- ADD2_SAT_32x32(Current,Delta,Temp); /* Q31 + Q31 into Q31*/
- Current=Temp;
- if (Current > Target)
- Current = Target;
-
- CurrentShort = (LVM_INT16)(Current>>16); /* From Q31 to Q15*/
-
- for (ii = OutLoop; ii != 0; ii--){
- Temp = ((LVM_INT32)*dst) + (((LVM_INT32)*(src++) * CurrentShort)>>15); /* Q15 + Q15*Q15>>15 into Q15 */
- if (Temp > 0x00007FFF)
- *dst++ = 0x7FFF;
- else if (Temp < -0x00008000)
- *dst++ = - 0x8000;
- else
- *dst++ = (LVM_INT16)Temp;
- }
- }
-
- for (ii = InLoop; ii != 0; ii--){
- ADD2_SAT_32x32(Current,Delta,Temp); /* Q31 + Q31 into Q31*/
- Current=Temp;
- if (Current > Target)
- Current = Target;
-
- CurrentShort = (LVM_INT16)(Current>>16); /* From Q31 to Q15*/
-
- for (jj = 4; jj!=0 ; jj--){
- Temp = ((LVM_INT32)*dst) + (((LVM_INT32)*(src++) * CurrentShort)>>15); /* Q15 + Q15*Q15>>15 into Q15 */
- if (Temp > 0x00007FFF)
- *dst++ = 0x7FFF;
- else if (Temp < -0x00008000)
- *dst++ = - 0x8000;
- else
- *dst++ = (LVM_INT16)Temp;
- }
- }
- }
- else{
- if (OutLoop){
- Current -= Delta; /* Q31 + Q31 into Q31*/
- if (Current < Target)
- Current = Target;
-
- CurrentShort = (LVM_INT16)(Current>>16); /* From Q31 to Q15*/
-
- for (ii = OutLoop; ii != 0; ii--){
- Temp = ((LVM_INT32)*dst) + (((LVM_INT32)*(src++) * CurrentShort)>>15); /* Q15 + Q15*Q15>>15 into Q15 */
- if (Temp > 0x00007FFF)
- *dst++ = 0x7FFF;
- else if (Temp < -0x00008000)
- *dst++ = - 0x8000;
- else
- *dst++ = (LVM_INT16)Temp;
- }
- }
-
- for (ii = InLoop; ii != 0; ii--){
- Current -= Delta; /* Q31 + Q31 into Q31*/
- if (Current < Target)
- Current = Target;
-
- CurrentShort = (LVM_INT16)(Current>>16); /* From Q31 to Q15*/
-
- for (jj = 4; jj!=0 ; jj--){
- Temp = ((LVM_INT32)*dst) + (((LVM_INT32)*(src++) * CurrentShort)>>15); /* Q15 + Q15*Q15>>15 into Q15 */
- if (Temp > 0x00007FFF)
- *dst++ = 0x7FFF;
- else if (Temp < -0x00008000)
- *dst++ = - 0x8000;
- else
- *dst++ = (LVM_INT16)Temp;
- }
- }
- }
- pInstance->Current=Current;
-}
-#endif
/**********************************************************************************/
diff --git a/media/libeffects/lvm/lib/Common/src/LVC_Core_MixSoft_1St_2i_D16C31_WRA.cpp b/media/libeffects/lvm/lib/Common/src/LVC_Core_MixSoft_1St_2i_D16C31_WRA.cpp
index 56b5dae..1f4b08a 100644
--- a/media/libeffects/lvm/lib/Common/src/LVC_Core_MixSoft_1St_2i_D16C31_WRA.cpp
+++ b/media/libeffects/lvm/lib/Common/src/LVC_Core_MixSoft_1St_2i_D16C31_WRA.cpp
@@ -26,7 +26,6 @@
/**********************************************************************************
FUNCTION LVC_Core_MixSoft_1St_2i_D16C31_WRA
***********************************************************************************/
-#ifdef BUILD_FLOAT
static LVM_FLOAT ADD2_SAT_FLOAT(LVM_FLOAT a,
LVM_FLOAT b,
LVM_FLOAT c)
@@ -191,119 +190,4 @@
}
}
#endif
-#else
-void LVC_Core_MixSoft_1St_2i_D16C31_WRA( LVMixer3_st *ptrInstance1,
- LVMixer3_st *ptrInstance2,
- const LVM_INT16 *src,
- LVM_INT16 *dst,
- LVM_INT16 n)
-{
- LVM_INT16 OutLoop;
- LVM_INT16 InLoop;
- LVM_INT16 CurrentShortL;
- LVM_INT16 CurrentShortR;
- LVM_INT32 ii;
- Mix_Private_st *pInstanceL=(Mix_Private_st *)(ptrInstance1->PrivateParams);
- Mix_Private_st *pInstanceR=(Mix_Private_st *)(ptrInstance2->PrivateParams);
-
- LVM_INT32 DeltaL=pInstanceL->Delta;
- LVM_INT32 CurrentL=pInstanceL->Current;
- LVM_INT32 TargetL=pInstanceL->Target;
-
- LVM_INT32 DeltaR=pInstanceR->Delta;
- LVM_INT32 CurrentR=pInstanceR->Current;
- LVM_INT32 TargetR=pInstanceR->Target;
-
- LVM_INT32 Temp;
-
- InLoop = (LVM_INT16)(n >> 2); /* Process per 4 samples */
- OutLoop = (LVM_INT16)(n - (InLoop << 2));
-
- if (OutLoop)
- {
- if(CurrentL<TargetL)
- {
- ADD2_SAT_32x32(CurrentL,DeltaL,Temp); /* Q31 + Q31 into Q31*/
- CurrentL=Temp;
- if (CurrentL > TargetL)
- CurrentL = TargetL;
- }
- else
- {
- CurrentL -= DeltaL; /* Q31 + Q31 into Q31*/
- if (CurrentL < TargetL)
- CurrentL = TargetL;
- }
-
- if(CurrentR<TargetR)
- {
- ADD2_SAT_32x32(CurrentR,DeltaR,Temp); /* Q31 + Q31 into Q31*/
- CurrentR=Temp;
- if (CurrentR > TargetR)
- CurrentR = TargetR;
- }
- else
- {
- CurrentR -= DeltaR; /* Q31 + Q31 into Q31*/
- if (CurrentR < TargetR)
- CurrentR = TargetR;
- }
-
- CurrentShortL = (LVM_INT16)(CurrentL>>16); /* From Q31 to Q15*/
- CurrentShortR = (LVM_INT16)(CurrentR>>16); /* From Q31 to Q15*/
-
- for (ii = OutLoop*2; ii != 0; ii-=2)
- {
- *(dst++) = (LVM_INT16)(((LVM_INT32)*(src++) * (LVM_INT32)CurrentShortL)>>15); /* Q15*Q15>>15 into Q15 */
- *(dst++) = (LVM_INT16)(((LVM_INT32)*(src++) * (LVM_INT32)CurrentShortR)>>15); /* Q15*Q15>>15 into Q15 */
- }
- }
-
- for (ii = InLoop*2; ii != 0; ii-=2)
- {
- if(CurrentL<TargetL)
- {
- ADD2_SAT_32x32(CurrentL,DeltaL,Temp); /* Q31 + Q31 into Q31*/
- CurrentL=Temp;
- if (CurrentL > TargetL)
- CurrentL = TargetL;
- }
- else
- {
- CurrentL -= DeltaL; /* Q31 + Q31 into Q31*/
- if (CurrentL < TargetL)
- CurrentL = TargetL;
- }
-
- if(CurrentR<TargetR)
- {
- ADD2_SAT_32x32(CurrentR,DeltaR,Temp); /* Q31 + Q31 into Q31*/
- CurrentR=Temp;
- if (CurrentR > TargetR)
- CurrentR = TargetR;
- }
- else
- {
- CurrentR -= DeltaR; /* Q31 + Q31 into Q31*/
- if (CurrentR < TargetR)
- CurrentR = TargetR;
- }
-
- CurrentShortL = (LVM_INT16)(CurrentL>>16); /* From Q31 to Q15*/
- CurrentShortR = (LVM_INT16)(CurrentR>>16); /* From Q31 to Q15*/
-
- *(dst++) = (LVM_INT16)(((LVM_INT32)*(src++) * (LVM_INT32)CurrentShortL)>>15); /* Q15*Q15>>15 into Q15 */
- *(dst++) = (LVM_INT16)(((LVM_INT32)*(src++) * (LVM_INT32)CurrentShortR)>>15); /* Q15*Q15>>15 into Q15 */
- *(dst++) = (LVM_INT16)(((LVM_INT32)*(src++) * (LVM_INT32)CurrentShortL)>>15);
- *(dst++) = (LVM_INT16)(((LVM_INT32)*(src++) * (LVM_INT32)CurrentShortR)>>15);
- *(dst++) = (LVM_INT16)(((LVM_INT32)*(src++) * (LVM_INT32)CurrentShortL)>>15);
- *(dst++) = (LVM_INT16)(((LVM_INT32)*(src++) * (LVM_INT32)CurrentShortR)>>15);
- *(dst++) = (LVM_INT16)(((LVM_INT32)*(src++) * (LVM_INT32)CurrentShortL)>>15);
- *(dst++) = (LVM_INT16)(((LVM_INT32)*(src++) * (LVM_INT32)CurrentShortR)>>15);
- }
- pInstanceL->Current=CurrentL;
- pInstanceR->Current=CurrentR;
-
-}
-#endif
/**********************************************************************************/
diff --git a/media/libeffects/lvm/lib/Common/src/LVC_Core_MixSoft_1St_D16C31_WRA.cpp b/media/libeffects/lvm/lib/Common/src/LVC_Core_MixSoft_1St_D16C31_WRA.cpp
index 5bfdad8..5d8aadc 100644
--- a/media/libeffects/lvm/lib/Common/src/LVC_Core_MixSoft_1St_D16C31_WRA.cpp
+++ b/media/libeffects/lvm/lib/Common/src/LVC_Core_MixSoft_1St_D16C31_WRA.cpp
@@ -26,7 +26,6 @@
/**********************************************************************************
FUNCTION LVCore_MIXSOFT_1ST_D16C31_WRA
***********************************************************************************/
-#ifdef BUILD_FLOAT
void LVC_Core_MixSoft_1St_D16C31_WRA(LVMixer3_FLOAT_st *ptrInstance,
const LVM_FLOAT *src,
LVM_FLOAT *dst,
@@ -106,7 +105,6 @@
pInstance->Current=Current;
}
-
#ifdef SUPPORT_MC
/*
* FUNCTION: LVC_Core_MixSoft_Mc_D16C31_WRA
@@ -218,80 +216,4 @@
}
#endif
-#else
-void LVC_Core_MixSoft_1St_D16C31_WRA( LVMixer3_st *ptrInstance,
- const LVM_INT16 *src,
- LVM_INT16 *dst,
- LVM_INT16 n)
-{
- LVM_INT16 OutLoop;
- LVM_INT16 InLoop;
- LVM_INT16 CurrentShort;
- LVM_INT32 ii;
- Mix_Private_st *pInstance=(Mix_Private_st *)(ptrInstance->PrivateParams);
- LVM_INT32 Delta=pInstance->Delta;
- LVM_INT32 Current=pInstance->Current;
- LVM_INT32 Target=pInstance->Target;
- LVM_INT32 Temp;
-
- InLoop = (LVM_INT16)(n >> 2); /* Process per 4 samples */
- OutLoop = (LVM_INT16)(n - (InLoop << 2));
-
- if(Current<Target){
- if (OutLoop){
- ADD2_SAT_32x32(Current,Delta,Temp); /* Q31 + Q31 into Q31*/
- Current=Temp;
- if (Current > Target)
- Current = Target;
-
- CurrentShort = (LVM_INT16)(Current>>16); /* From Q31 to Q15*/
-
- for (ii = OutLoop; ii != 0; ii--){
- *(dst++) = (LVM_INT16)(((LVM_INT32)*(src++) * (LVM_INT32)CurrentShort)>>15); /* Q15*Q15>>15 into Q15 */
- }
- }
-
- for (ii = InLoop; ii != 0; ii--){
- ADD2_SAT_32x32(Current,Delta,Temp); /* Q31 + Q31 into Q31*/
- Current=Temp;
- if (Current > Target)
- Current = Target;
-
- CurrentShort = (LVM_INT16)(Current>>16); /* From Q31 to Q15*/
-
- *(dst++) = (LVM_INT16)(((LVM_INT32)*(src++) * (LVM_INT32)CurrentShort)>>15); /* Q15*Q15>>15 into Q15 */
- *(dst++) = (LVM_INT16)(((LVM_INT32)*(src++) * (LVM_INT32)CurrentShort)>>15);
- *(dst++) = (LVM_INT16)(((LVM_INT32)*(src++) * (LVM_INT32)CurrentShort)>>15);
- *(dst++) = (LVM_INT16)(((LVM_INT32)*(src++) * (LVM_INT32)CurrentShort)>>15);
- }
- }
- else{
- if (OutLoop){
- Current -= Delta; /* Q31 + Q31 into Q31*/
- if (Current < Target)
- Current = Target;
-
- CurrentShort = (LVM_INT16)(Current>>16); /* From Q31 to Q15*/
-
- for (ii = OutLoop; ii != 0; ii--){
- *(dst++) = (LVM_INT16)(((LVM_INT32)*(src++) * (LVM_INT32)CurrentShort)>>15); /* Q15*Q15>>15 into Q15 */
- }
- }
-
- for (ii = InLoop; ii != 0; ii--){
- Current -= Delta; /* Q31 + Q31 into Q31*/
- if (Current < Target)
- Current = Target;
-
- CurrentShort = (LVM_INT16)(Current>>16); /* From Q31 to Q15*/
-
- *(dst++) = (LVM_INT16)(((LVM_INT32)*(src++) * (LVM_INT32)CurrentShort)>>15); /* Q15*Q15>>15 into Q15 */
- *(dst++) = (LVM_INT16)(((LVM_INT32)*(src++) * (LVM_INT32)CurrentShort)>>15);
- *(dst++) = (LVM_INT16)(((LVM_INT32)*(src++) * (LVM_INT32)CurrentShort)>>15);
- *(dst++) = (LVM_INT16)(((LVM_INT32)*(src++) * (LVM_INT32)CurrentShort)>>15);
- }
- }
- pInstance->Current=Current;
-}
-#endif
/**********************************************************************************/
diff --git a/media/libeffects/lvm/lib/Common/src/LVC_MixInSoft_D16C31_SAT.cpp b/media/libeffects/lvm/lib/Common/src/LVC_MixInSoft_D16C31_SAT.cpp
index 65956f7..2bec3be 100644
--- a/media/libeffects/lvm/lib/Common/src/LVC_MixInSoft_D16C31_SAT.cpp
+++ b/media/libeffects/lvm/lib/Common/src/LVC_MixInSoft_D16C31_SAT.cpp
@@ -33,7 +33,6 @@
/**********************************************************************************
FUNCTION MIXINSOFT_D16C31_SAT
***********************************************************************************/
-#ifdef BUILD_FLOAT
void LVC_MixInSoft_D16C31_SAT(LVMixer3_1St_FLOAT_st *ptrInstance,
const LVM_FLOAT *src,
LVM_FLOAT *dst,
@@ -84,7 +83,6 @@
}
}
-
/******************************************************************************
CALL BACK
*******************************************************************************/
@@ -107,8 +105,6 @@
}
-
-
#ifdef SUPPORT_MC
/*
* FUNCTION: LVC_MixInSoft_Mc_D16C31_SAT
@@ -185,7 +181,6 @@
}
}
-
/******************************************************************************
CALL BACK
*******************************************************************************/
@@ -209,81 +204,4 @@
}
#endif
-
-#else
-void LVC_MixInSoft_D16C31_SAT( LVMixer3_1St_st *ptrInstance,
- LVM_INT16 *src,
- LVM_INT16 *dst,
- LVM_INT16 n)
-{
- char HardMixing = TRUE;
- LVM_INT32 TargetGain;
- Mix_Private_st *pInstance=(Mix_Private_st *)(ptrInstance->MixerStream[0].PrivateParams);
-
- if(n<=0) return;
-
- /******************************************************************************
- SOFT MIXING
- *******************************************************************************/
- if (pInstance->Current != pInstance->Target)
- {
- if(pInstance->Delta == 0x7FFFFFFF){
- pInstance->Current = pInstance->Target;
- TargetGain=pInstance->Target>>(16-pInstance->Shift); // TargetGain in Q16.15 format
- LVC_Mixer_SetTarget(&(ptrInstance->MixerStream[0]),TargetGain);
- }else if (Abs_32(pInstance->Current-pInstance->Target) < pInstance->Delta){
- pInstance->Current = pInstance->Target; /* Difference is not significant anymore. Make them equal. */
- TargetGain=pInstance->Target>>(16-pInstance->Shift); // TargetGain in Q16.15 format
- LVC_Mixer_SetTarget(&(ptrInstance->MixerStream[0]),TargetGain);
- }else{
- /* Soft mixing has to be applied */
- HardMixing = FALSE;
- if(pInstance->Shift!=0){
- Shift_Sat_v16xv16 ((LVM_INT16)pInstance->Shift,src,src,n);
- LVC_Core_MixInSoft_D16C31_SAT( &(ptrInstance->MixerStream[0]), src, dst, n);
- }
- else
- LVC_Core_MixInSoft_D16C31_SAT( &(ptrInstance->MixerStream[0]), src, dst, n);
- }
- }
-
- /******************************************************************************
- HARD MIXING
- *******************************************************************************/
-
- if (HardMixing){
- if (pInstance->Target != 0){ /* Nothing to do in case Target = 0 */
- if ((pInstance->Target>>16) == 0x7FFF){
- if(pInstance->Shift!=0)
- Shift_Sat_v16xv16 ((LVM_INT16)pInstance->Shift,src,src,n);
- Add2_Sat_16x16( src, dst, n );
- }
- else{
- if(pInstance->Shift!=0)
- Shift_Sat_v16xv16 ((LVM_INT16)pInstance->Shift,src,src,n);
- Mac3s_Sat_16x16(src,(LVM_INT16)(pInstance->Target>>16),dst,n);
- pInstance->Current = pInstance->Target; /* In case the LVCore function would have changed the Current value */
- }
- }
- }
-
-
- /******************************************************************************
- CALL BACK
- *******************************************************************************/
-
- if (ptrInstance->MixerStream[0].CallbackSet){
- if (Abs_32(pInstance->Current-pInstance->Target) < pInstance->Delta){
- pInstance->Current = pInstance->Target; /* Difference is not significant anymore. Make them equal. */
- TargetGain=pInstance->Target>>(16-pInstance->Shift); // TargetGain in Q16.15 format
- LVC_Mixer_SetTarget(ptrInstance->MixerStream,TargetGain);
- ptrInstance->MixerStream[0].CallbackSet = FALSE;
- if (ptrInstance->MixerStream[0].pCallBack != 0){
- (*ptrInstance->MixerStream[0].pCallBack) ( ptrInstance->MixerStream[0].pCallbackHandle, ptrInstance->MixerStream[0].pGeneralPurpose,ptrInstance->MixerStream[0].CallbackParam );
- }
- }
- }
-
-}
-#endif
/**********************************************************************************/
diff --git a/media/libeffects/lvm/lib/Common/src/LVC_MixSoft_1St_2i_D16C31_SAT.cpp b/media/libeffects/lvm/lib/Common/src/LVC_MixSoft_1St_2i_D16C31_SAT.cpp
index a4682d3..3153ada 100644
--- a/media/libeffects/lvm/lib/Common/src/LVC_MixSoft_1St_2i_D16C31_SAT.cpp
+++ b/media/libeffects/lvm/lib/Common/src/LVC_MixSoft_1St_2i_D16C31_SAT.cpp
@@ -37,7 +37,6 @@
/**********************************************************************************
FUNCTION LVC_MixSoft_1St_2i_D16C31_SAT
***********************************************************************************/
-#ifdef BUILD_FLOAT
#ifdef SUPPORT_MC
/* This threshold is used to decide on the processing to be applied on
* front center and back center channels
@@ -363,120 +362,4 @@
}
}
}
-#else
-void LVC_MixSoft_1St_2i_D16C31_SAT( LVMixer3_2St_st *ptrInstance,
- const LVM_INT16 *src,
- LVM_INT16 *dst,
- LVM_INT16 n)
-{
- char HardMixing = TRUE;
- LVM_INT32 TargetGain;
- Mix_Private_st *pInstance1=(Mix_Private_st *)(ptrInstance->MixerStream[0].PrivateParams);
- Mix_Private_st *pInstance2=(Mix_Private_st *)(ptrInstance->MixerStream[1].PrivateParams);
-
- if(n<=0) return;
-
- /******************************************************************************
- SOFT MIXING
- *******************************************************************************/
- if ((pInstance1->Current != pInstance1->Target)||(pInstance2->Current != pInstance2->Target))
- {
- if(pInstance1->Delta == 0x7FFFFFFF)
- {
- pInstance1->Current = pInstance1->Target;
- TargetGain=pInstance1->Target>>16; // TargetGain in Q16.15 format, no integer part
- LVC_Mixer_SetTarget(&(ptrInstance->MixerStream[0]),TargetGain);
- }
- else if (Abs_32(pInstance1->Current-pInstance1->Target) < pInstance1->Delta)
- {
- pInstance1->Current = pInstance1->Target; /* Difference is not significant anymore. Make them equal. */
- TargetGain=pInstance1->Target>>16; // TargetGain in Q16.15 format, no integer part
- LVC_Mixer_SetTarget(&(ptrInstance->MixerStream[0]),TargetGain);
- }
- else
- {
- /* Soft mixing has to be applied */
- HardMixing = FALSE;
- }
-
- if(HardMixing == TRUE)
- {
- if(pInstance2->Delta == 0x7FFFFFFF)
- {
- pInstance2->Current = pInstance2->Target;
- TargetGain=pInstance2->Target>>16; // TargetGain in Q16.15 format, no integer part
- LVC_Mixer_SetTarget(&(ptrInstance->MixerStream[1]),TargetGain);
- }
- else if (Abs_32(pInstance2->Current-pInstance2->Target) < pInstance2->Delta)
- {
- pInstance2->Current = pInstance2->Target; /* Difference is not significant anymore. Make them equal. */
- TargetGain=pInstance2->Target>>16; // TargetGain in Q16.15 format, no integer part
- LVC_Mixer_SetTarget(&(ptrInstance->MixerStream[1]),TargetGain);
- }
- else
- {
- /* Soft mixing has to be applied */
- HardMixing = FALSE;
- }
- }
-
- if(HardMixing == FALSE)
- {
- LVC_Core_MixSoft_1St_2i_D16C31_WRA( &(ptrInstance->MixerStream[0]),&(ptrInstance->MixerStream[1]), src, dst, n);
- }
- }
-
- /******************************************************************************
- HARD MIXING
- *******************************************************************************/
-
- if (HardMixing)
- {
- if (((pInstance1->Target>>16) == 0x7FFF)&&((pInstance2->Target>>16) == 0x7FFF))
- {
- if(src!=dst)
- {
- Copy_16(src, dst, n);
- }
- }
- else
- {
- LVC_Core_MixHard_1St_2i_D16C31_SAT(&(ptrInstance->MixerStream[0]),&(ptrInstance->MixerStream[1]), src, dst, n);
- }
- }
-
- /******************************************************************************
- CALL BACK
- *******************************************************************************/
-
- if (ptrInstance->MixerStream[0].CallbackSet)
- {
- if (Abs_32(pInstance1->Current-pInstance1->Target) < pInstance1->Delta)
- {
- pInstance1->Current = pInstance1->Target; /* Difference is not significant anymore. Make them equal. */
- TargetGain=pInstance1->Target>>(16-pInstance1->Shift); // TargetGain in Q16.15 format
- LVC_Mixer_SetTarget(&ptrInstance->MixerStream[0],TargetGain);
- ptrInstance->MixerStream[0].CallbackSet = FALSE;
- if (ptrInstance->MixerStream[0].pCallBack != 0)
- {
- (*ptrInstance->MixerStream[0].pCallBack) ( ptrInstance->MixerStream[0].pCallbackHandle, ptrInstance->MixerStream[0].pGeneralPurpose,ptrInstance->MixerStream[0].CallbackParam );
- }
- }
- }
- if (ptrInstance->MixerStream[1].CallbackSet)
- {
- if (Abs_32(pInstance2->Current-pInstance2->Target) < pInstance2->Delta)
- {
- pInstance2->Current = pInstance2->Target; /* Difference is not significant anymore. Make them equal. */
- TargetGain=pInstance2->Target>>(16-pInstance2->Shift); // TargetGain in Q16.15 format
- LVC_Mixer_SetTarget(&ptrInstance->MixerStream[1],TargetGain);
- ptrInstance->MixerStream[1].CallbackSet = FALSE;
- if (ptrInstance->MixerStream[1].pCallBack != 0)
- {
- (*ptrInstance->MixerStream[1].pCallBack) ( ptrInstance->MixerStream[1].pCallbackHandle, ptrInstance->MixerStream[1].pGeneralPurpose,ptrInstance->MixerStream[1].CallbackParam );
- }
- }
- }
-}
-#endif
/**********************************************************************************/
diff --git a/media/libeffects/lvm/lib/Common/src/LVC_MixSoft_1St_D16C31_SAT.cpp b/media/libeffects/lvm/lib/Common/src/LVC_MixSoft_1St_D16C31_SAT.cpp
index 0678ae0..4d229da 100644
--- a/media/libeffects/lvm/lib/Common/src/LVC_MixSoft_1St_D16C31_SAT.cpp
+++ b/media/libeffects/lvm/lib/Common/src/LVC_MixSoft_1St_D16C31_SAT.cpp
@@ -33,7 +33,6 @@
/**********************************************************************************
FUNCTION LVMixer3_MIXSOFT_1ST_D16C31_SAT
***********************************************************************************/
-#ifdef BUILD_FLOAT
void LVC_MixSoft_1St_D16C31_SAT( LVMixer3_1St_FLOAT_st *ptrInstance,
const LVM_FLOAT *src,
LVM_FLOAT *dst,
@@ -198,79 +197,4 @@
#endif
-#else
-void LVC_MixSoft_1St_D16C31_SAT( LVMixer3_1St_st *ptrInstance,
- const LVM_INT16 *src,
- LVM_INT16 *dst,
- LVM_INT16 n)
-{
- char HardMixing = TRUE;
- LVM_INT32 TargetGain;
- Mix_Private_st *pInstance=(Mix_Private_st *)(ptrInstance->MixerStream[0].PrivateParams);
-
- if(n<=0) return;
-
- /******************************************************************************
- SOFT MIXING
- *******************************************************************************/
- if (pInstance->Current != pInstance->Target)
- {
- if(pInstance->Delta == 0x7FFFFFFF){
- pInstance->Current = pInstance->Target;
- TargetGain=pInstance->Target>>(16-pInstance->Shift); // TargetGain in Q16.15 format
- LVC_Mixer_SetTarget(&(ptrInstance->MixerStream[0]),TargetGain);
- }else if (Abs_32(pInstance->Current-pInstance->Target) < pInstance->Delta){
- pInstance->Current = pInstance->Target; /* Difference is not significant anymore. Make them equal. */
- TargetGain=pInstance->Target>>(16-pInstance->Shift); // TargetGain in Q16.15 format
- LVC_Mixer_SetTarget(&(ptrInstance->MixerStream[0]),TargetGain);
- }else{
- /* Soft mixing has to be applied */
- HardMixing = FALSE;
- if(pInstance->Shift!=0){
- Shift_Sat_v16xv16 ((LVM_INT16)pInstance->Shift,src,dst,n);
- LVC_Core_MixSoft_1St_D16C31_WRA( &(ptrInstance->MixerStream[0]), dst, dst, n);
- }
- else
- LVC_Core_MixSoft_1St_D16C31_WRA( &(ptrInstance->MixerStream[0]), src, dst, n);
- }
- }
-
- /******************************************************************************
- HARD MIXING
- *******************************************************************************/
-
- if (HardMixing){
- if (pInstance->Target == 0)
- LoadConst_16(0, dst, n);
- else if(pInstance->Shift!=0){
- Shift_Sat_v16xv16 ((LVM_INT16)pInstance->Shift,src,dst,n);
- if ((pInstance->Target>>16) != 0x7FFF)
- Mult3s_16x16( dst, (LVM_INT16)(pInstance->Target>>16), dst, n );
- }
- else {
- if ((pInstance->Target>>16) != 0x7FFF)
- Mult3s_16x16( src, (LVM_INT16)(pInstance->Target>>16), dst, n );
- else if(src!=dst)
- Copy_16(src, dst, n);
- }
-
- }
-
- /******************************************************************************
- CALL BACK
- *******************************************************************************/
-
- if (ptrInstance->MixerStream[0].CallbackSet){
- if (Abs_32(pInstance->Current-pInstance->Target) < pInstance->Delta){
- pInstance->Current = pInstance->Target; /* Difference is not significant anymore. Make them equal. */
- TargetGain=pInstance->Target>>(16-pInstance->Shift); // TargetGain in Q16.15 format
- LVC_Mixer_SetTarget(ptrInstance->MixerStream,TargetGain);
- ptrInstance->MixerStream[0].CallbackSet = FALSE;
- if (ptrInstance->MixerStream[0].pCallBack != 0){
- (*ptrInstance->MixerStream[0].pCallBack) ( ptrInstance->MixerStream[0].pCallbackHandle, ptrInstance->MixerStream[0].pGeneralPurpose,ptrInstance->MixerStream[0].CallbackParam );
- }
- }
- }
-}
-#endif/*BUILD_FLOAT*/
/**********************************************************************************/
diff --git a/media/libeffects/lvm/lib/Common/src/LVC_MixSoft_2St_D16C31_SAT.cpp b/media/libeffects/lvm/lib/Common/src/LVC_MixSoft_2St_D16C31_SAT.cpp
index 8a89de1..54ab79d 100644
--- a/media/libeffects/lvm/lib/Common/src/LVC_MixSoft_2St_D16C31_SAT.cpp
+++ b/media/libeffects/lvm/lib/Common/src/LVC_MixSoft_2St_D16C31_SAT.cpp
@@ -25,7 +25,6 @@
/**********************************************************************************
FUNCTION LVC_MixSoft_2St_D16C31_SAT.c
***********************************************************************************/
-#ifdef BUILD_FLOAT
void LVC_MixSoft_2St_D16C31_SAT(LVMixer3_2St_FLOAT_st *ptrInstance,
const LVM_FLOAT *src1,
const LVM_FLOAT *src2,
@@ -131,46 +130,4 @@
}
#endif
-#else
-void LVC_MixSoft_2St_D16C31_SAT( LVMixer3_2St_st *ptrInstance,
- const LVM_INT16 *src1,
- LVM_INT16 *src2,
- LVM_INT16 *dst,
- LVM_INT16 n)
-{
- Mix_Private_st *pInstance1=(Mix_Private_st *)(ptrInstance->MixerStream[0].PrivateParams);
- Mix_Private_st *pInstance2=(Mix_Private_st *)(ptrInstance->MixerStream[1].PrivateParams);
-
- if(n<=0) return;
-
- /******************************************************************************
- SOFT MIXING
- *******************************************************************************/
- if ((pInstance1->Current == pInstance1->Target)&&(pInstance1->Current == 0)){
- LVC_MixSoft_1St_D16C31_SAT( (LVMixer3_1St_st *)(&ptrInstance->MixerStream[1]), src2, dst, n);
- }
- else if ((pInstance2->Current == pInstance2->Target)&&(pInstance2->Current == 0)){
- LVC_MixSoft_1St_D16C31_SAT( (LVMixer3_1St_st *)(&ptrInstance->MixerStream[0]), src1, dst, n);
- }
- else if ((pInstance1->Current != pInstance1->Target) || (pInstance2->Current != pInstance2->Target))
- {
- LVC_MixSoft_1St_D16C31_SAT((LVMixer3_1St_st *)(&ptrInstance->MixerStream[0]), src1, dst, n);
- LVC_MixInSoft_D16C31_SAT( (LVMixer3_1St_st *)(&ptrInstance->MixerStream[1]), src2, dst, n);
- }
- else{
- /******************************************************************************
- HARD MIXING
- *******************************************************************************/
- if(pInstance2->Shift!=0)
- Shift_Sat_v16xv16 ((LVM_INT16)pInstance2->Shift,src2,src2,n);
- if(pInstance1->Shift!=0)
- {
- Shift_Sat_v16xv16 ((LVM_INT16)pInstance1->Shift,src1,dst,n);
- LVC_Core_MixHard_2St_D16C31_SAT( &ptrInstance->MixerStream[0], &ptrInstance->MixerStream[1], dst, src2, dst, n);
- }
- else
- LVC_Core_MixHard_2St_D16C31_SAT( &ptrInstance->MixerStream[0], &ptrInstance->MixerStream[1], src1, src2, dst, n);
- }
-}
-#endif /*BUILD_FLOAT*/
/**********************************************************************************/
diff --git a/media/libeffects/lvm/lib/Common/src/LVC_Mixer.h b/media/libeffects/lvm/lib/Common/src/LVC_Mixer.h
index eac9726..ce42d2e 100644
--- a/media/libeffects/lvm/lib/Common/src/LVC_Mixer.h
+++ b/media/libeffects/lvm/lib/Common/src/LVC_Mixer.h
@@ -18,9 +18,6 @@
#ifndef __LVC_MIXER_H__
#define __LVC_MIXER_H__
-
-
-
#include "LVM_Types.h"
/**********************************************************************************
@@ -28,7 +25,6 @@
***********************************************************************************/
/* LVMixer3_st structure stores Instance parameters for one audio stream */
-#ifdef BUILD_FLOAT
typedef struct
{
LVM_FLOAT PrivateParams[3]; /* Private Instance params for \
@@ -40,45 +36,14 @@
void *pGeneralPurpose; /* Pointer for general purpose usage */
LVM_Callback pCallBack; /* Pointer to the callback function */
} LVMixer3_FLOAT_st;
-#else
-typedef struct
-{
- LVM_INT32 PrivateParams[4]; /* Private Instance params for Audio Stream */
- LVM_INT16 CallbackSet; /* Boolean. Should be set by calling application each time the target value is updated */
- LVM_INT16 CallbackParam; /* Parameter that will be used in the calback function */
- void *pCallbackHandle; /* Pointer to the instance of the callback function */
- void *pGeneralPurpose; /* Pointer for general purpose usage */
- LVM_Callback pCallBack; /* Pointer to the callback function */
-} LVMixer3_st;
-#endif
-#ifdef BUILD_FLOAT
typedef struct
{
LVMixer3_FLOAT_st MixerStream[1]; /* Instance Params for one Audio Stream */
} LVMixer3_1St_FLOAT_st;
-#else
-typedef struct
-{
- LVMixer3_st MixerStream[1]; /* Instance Params for one Audio Stream */
-} LVMixer3_1St_st;
-#endif
-#ifdef BUILD_FLOAT
typedef struct
{
LVMixer3_FLOAT_st MixerStream[2]; /* Instance Params for two Audio Streams */
} LVMixer3_2St_FLOAT_st;
-#else
-typedef struct
-{
- LVMixer3_st MixerStream[2]; /* Instance Params for two Audio Streams */
-} LVMixer3_2St_st;
-#endif
-#ifndef BUILD_FLOAT
-typedef struct
-{
- LVMixer3_st MixerStream[3]; /* Instance Params for three Audio Streams */
-} LVMixer3_3St_st;
-#endif
/**********************************************************************************
FUNCTION PROTOTYPES (HIGH LEVEL FUNCTIONS)
***********************************************************************************/
@@ -89,7 +54,6 @@
#define LVMixer3_MixSoft_2St_D16C31_SAT LVMixer3_2St_D16C31_SAT_MixSoft
#define LVMixer3_MixSoft_3St_D16C31_SAT LVMixer3_3St_D16C31_SAT_MixSoft
-
/*** General functions ************************************************************/
/**********************************************************************************/
@@ -98,62 +62,28 @@
/* then the calculation will give an incorrect value for alpha, see the mixer */
/* documentation for further details. */
/* ********************************************************************************/
-#ifdef BUILD_FLOAT
void LVC_Mixer_SetTarget( LVMixer3_FLOAT_st *pStream,
LVM_FLOAT TargetGain);
-#else
-void LVC_Mixer_SetTarget( LVMixer3_st *pStream,
- LVM_INT32 TargetGain);
-#endif
-#ifdef BUILD_FLOAT
LVM_FLOAT LVC_Mixer_GetTarget( LVMixer3_FLOAT_st *pStream);
-#else
-LVM_INT32 LVC_Mixer_GetTarget( LVMixer3_st *pStream);
-#endif
-#ifdef BUILD_FLOAT
LVM_FLOAT LVC_Mixer_GetCurrent( LVMixer3_FLOAT_st *pStream);
-#else
-LVM_INT32 LVC_Mixer_GetCurrent( LVMixer3_st *pStream);
-#endif
-#ifdef BUILD_FLOAT
void LVC_Mixer_Init( LVMixer3_FLOAT_st *pStream,
LVM_FLOAT TargetGain,
LVM_FLOAT CurrentGain);
-#else
-void LVC_Mixer_Init( LVMixer3_st *pStream,
- LVM_INT32 TargetGain,
- LVM_INT32 CurrentGain);
-#endif
-#ifdef BUILD_FLOAT
void LVC_Mixer_SetTimeConstant( LVMixer3_FLOAT_st *pStream,
LVM_INT32 Tc_millisec,
LVM_Fs_en Fs,
LVM_INT16 NumChannels);
-#else
-void LVC_Mixer_SetTimeConstant( LVMixer3_st *pStream,
- LVM_INT32 Tc_millisec,
- LVM_Fs_en Fs,
- LVM_INT16 NumChannels);
-#endif
-#ifdef BUILD_FLOAT
void LVC_Mixer_VarSlope_SetTimeConstant( LVMixer3_FLOAT_st *pStream,
LVM_INT32 Tc_millisec,
LVM_Fs_en Fs,
LVM_INT16 NumChannels);
-#else
-void LVC_Mixer_VarSlope_SetTimeConstant( LVMixer3_st *pStream,
- LVM_INT32 Tc_millisec,
- LVM_Fs_en Fs,
- LVM_INT16 NumChannels);
-#endif
/*** 16 bit functions *************************************************************/
-#ifdef BUILD_FLOAT
void LVC_MixSoft_1St_D16C31_SAT(LVMixer3_1St_FLOAT_st *pInstance,
const LVM_FLOAT *src,
LVM_FLOAT *dst,
@@ -166,14 +96,6 @@
LVM_INT16 NrChannels);
#endif
-#else
-void LVC_MixSoft_1St_D16C31_SAT( LVMixer3_1St_st *pInstance,
- const LVM_INT16 *src,
- LVM_INT16 *dst,
- LVM_INT16 n);
-#endif
-
-#ifdef BUILD_FLOAT
void LVC_MixInSoft_D16C31_SAT(LVMixer3_1St_FLOAT_st *pInstance,
const LVM_FLOAT *src,
LVM_FLOAT *dst,
@@ -186,14 +108,6 @@
LVM_INT16 NrChannels);
#endif
-#else
-void LVC_MixInSoft_D16C31_SAT( LVMixer3_1St_st *pInstance,
- LVM_INT16 *src,
- LVM_INT16 *dst,
- LVM_INT16 n);
-#endif
-
-#ifdef BUILD_FLOAT
void LVC_MixSoft_2St_D16C31_SAT(LVMixer3_2St_FLOAT_st *pInstance,
const LVM_FLOAT *src1,
const LVM_FLOAT *src2,
@@ -207,20 +121,12 @@
LVM_INT16 NrFrames,
LVM_INT16 NrChannels);
#endif
-#else
-void LVC_MixSoft_2St_D16C31_SAT( LVMixer3_2St_st *pInstance,
- const LVM_INT16 *src1,
- LVM_INT16 *src2,
- LVM_INT16 *dst, /* dst cannot be equal to src2 */
- LVM_INT16 n);
-#endif
/**********************************************************************************/
/* For applying different gains to Left and right chennals */
/* MixerStream[0] applies to Left channel */
/* MixerStream[1] applies to Right channel */
/* Gain values should not be more that 1.0 */
/**********************************************************************************/
-#ifdef BUILD_FLOAT
#ifdef SUPPORT_MC
void LVC_MixSoft_1St_MC_float_SAT(LVMixer3_2St_FLOAT_st *pInstance,
const LVM_FLOAT *src,
@@ -233,12 +139,6 @@
const LVM_FLOAT *src,
LVM_FLOAT *dst, /* dst can be equal to src */
LVM_INT16 n); /* Number of stereo samples */
-#else
-void LVC_MixSoft_1St_2i_D16C31_SAT( LVMixer3_2St_st *pInstance,
- const LVM_INT16 *src,
- LVM_INT16 *dst, /* dst can be equal to src */
- LVM_INT16 n); /* Number of stereo samples */
-#endif
/**********************************************************************************/
diff --git a/media/libeffects/lvm/lib/Common/src/LVC_Mixer_GetCurrent.cpp b/media/libeffects/lvm/lib/Common/src/LVC_Mixer_GetCurrent.cpp
index 5990412..d0b50e6 100644
--- a/media/libeffects/lvm/lib/Common/src/LVC_Mixer_GetCurrent.cpp
+++ b/media/libeffects/lvm/lib/Common/src/LVC_Mixer_GetCurrent.cpp
@@ -19,7 +19,6 @@
#include "LVM_Macros.h"
#include "LVC_Mixer_Private.h"
-
/************************************************************************/
/* FUNCTION: */
/* LVMixer3_GetCurrent */
@@ -31,7 +30,6 @@
/* CurrentGain - CurrentGain value in Q 16.15 format */
/* */
/************************************************************************/
-#ifdef BUILD_FLOAT
LVM_FLOAT LVC_Mixer_GetCurrent( LVMixer3_FLOAT_st *pStream)
{
LVM_FLOAT CurrentGain;
@@ -39,12 +37,3 @@
CurrentGain = pInstance->Current; // CurrentGain
return CurrentGain;
}
-#else
-LVM_INT32 LVC_Mixer_GetCurrent( LVMixer3_st *pStream)
-{
- LVM_INT32 CurrentGain;
- Mix_Private_st *pInstance=(Mix_Private_st *)pStream->PrivateParams;
- CurrentGain=pInstance->Current>>(16-pInstance->Shift); // CurrentGain in Q16.15 format
- return CurrentGain;
-}
-#endif
diff --git a/media/libeffects/lvm/lib/Common/src/LVC_Mixer_GetTarget.cpp b/media/libeffects/lvm/lib/Common/src/LVC_Mixer_GetTarget.cpp
index 507eefa..3ae5ba4 100644
--- a/media/libeffects/lvm/lib/Common/src/LVC_Mixer_GetTarget.cpp
+++ b/media/libeffects/lvm/lib/Common/src/LVC_Mixer_GetTarget.cpp
@@ -30,7 +30,6 @@
/* TargetGain - TargetGain value in Q 16.15 format */
/* */
/************************************************************************/
-#ifdef BUILD_FLOAT
LVM_FLOAT LVC_Mixer_GetTarget( LVMixer3_FLOAT_st *pStream)
{
LVM_FLOAT TargetGain;
@@ -39,14 +38,3 @@
TargetGain = pInstance->Target; // TargetGain
return TargetGain;
}
-#else
-LVM_INT32 LVC_Mixer_GetTarget( LVMixer3_st *pStream)
-{
- LVM_INT32 TargetGain;
- Mix_Private_st *pInstance=(Mix_Private_st *)pStream->PrivateParams;
-
- TargetGain=pInstance->Target>>(16-pInstance->Shift); // TargetGain in Q16.15 format
-
- return TargetGain;
-}
-#endif
diff --git a/media/libeffects/lvm/lib/Common/src/LVC_Mixer_Init.cpp b/media/libeffects/lvm/lib/Common/src/LVC_Mixer_Init.cpp
index 737e26b..c9fd344 100644
--- a/media/libeffects/lvm/lib/Common/src/LVC_Mixer_Init.cpp
+++ b/media/libeffects/lvm/lib/Common/src/LVC_Mixer_Init.cpp
@@ -44,7 +44,6 @@
/* void */
/* */
/************************************************************************/
-#ifdef BUILD_FLOAT
void LVC_Mixer_Init( LVMixer3_FLOAT_st *pStream,
LVM_FLOAT TargetGain,
LVM_FLOAT CurrentGain)
@@ -56,24 +55,3 @@
pInstance->Target = TargetGain; // Update fractional gain Target
pInstance->Current = CurrentGain; // Update fractional gain Current
}
-#else
-void LVC_Mixer_Init( LVMixer3_st *pStream,
- LVM_INT32 TargetGain,
- LVM_INT32 CurrentGain)
-{
- LVM_INT16 Shift=0;
- LVM_INT32 MaxGain=TargetGain; // MaxGain is in Q16.15 format
- Mix_Private_st *pInstance=(Mix_Private_st *)pStream->PrivateParams;
- if(CurrentGain>MaxGain)
- MaxGain=CurrentGain; // MaxGain=max(CurrentGain,TargetGain)
-
- MaxGain=MaxGain>>15; // MaxGain in Q31.0 format i.e Integer part only
- while(MaxGain>0){ // Update Shift required to provide integer gain
- Shift++;
- MaxGain=MaxGain>>1;
- }
- pInstance->Target=TargetGain<<(16-Shift); // Update fractional gain Target
- pInstance->Current=CurrentGain<<(16-Shift); // Update fractional gain Current
- pInstance->Shift=Shift; // Update Shift
-}
-#endif
diff --git a/media/libeffects/lvm/lib/Common/src/LVC_Mixer_Private.h b/media/libeffects/lvm/lib/Common/src/LVC_Mixer_Private.h
index 453a6a5..123d22b 100644
--- a/media/libeffects/lvm/lib/Common/src/LVC_Mixer_Private.h
+++ b/media/libeffects/lvm/lib/Common/src/LVC_Mixer_Private.h
@@ -26,7 +26,6 @@
#include "VectorArithmetic.h"
/* Instance parameter structure */
-#ifdef BUILD_FLOAT
typedef struct
{
/* General */
@@ -34,16 +33,6 @@
LVM_FLOAT Current; /*number specifying value of Current Gain */
LVM_FLOAT Delta; /*number specifying value of Delta Gain */
} Mix_Private_FLOAT_st;
-#else
-typedef struct
-{
- /* General */
- LVM_INT32 Target; /* 32 bit number specifying fractional value of Target Gain */
- LVM_INT32 Current; /* 32 bit number specifying fractional valude of Current Gain */
- LVM_INT32 Shift; /* Left Shift for Integer part of Gain */
- LVM_INT32 Delta; /* 32 bit number specifying the fractional value of Delta Gain */
-} Mix_Private_st;
-#endif
/**********************************************************************************
DEFINITIONS
@@ -57,7 +46,6 @@
***********************************************************************************/
/*** 16 bit functions *************************************************************/
-#ifdef BUILD_FLOAT
void LVC_Core_MixInSoft_D16C31_SAT( LVMixer3_FLOAT_st *ptrInstance,
const LVM_FLOAT *src,
LVM_FLOAT *dst,
@@ -69,13 +57,6 @@
LVM_INT16 NrFrames,
LVM_INT16 NrChannels);
#endif
-#else
-void LVC_Core_MixInSoft_D16C31_SAT( LVMixer3_st *pInstance,
- const LVM_INT16 *src,
- LVM_INT16 *dst,
- LVM_INT16 n);
-#endif
-#ifdef BUILD_FLOAT
void LVC_Core_MixSoft_1St_D16C31_WRA( LVMixer3_FLOAT_st *ptrInstance,
const LVM_FLOAT *src,
LVM_FLOAT *dst,
@@ -87,27 +68,12 @@
LVM_INT16 NrFrames,
LVM_INT16 NrChannels);
#endif
-#else
-void LVC_Core_MixSoft_1St_D16C31_WRA( LVMixer3_st *pInstance,
- const LVM_INT16 *src,
- LVM_INT16 *dst,
- LVM_INT16 n);
-#endif
-#ifdef BUILD_FLOAT
void LVC_Core_MixHard_2St_D16C31_SAT( LVMixer3_FLOAT_st *pInstance1,
LVMixer3_FLOAT_st *pInstance2,
const LVM_FLOAT *src1,
const LVM_FLOAT *src2,
LVM_FLOAT *dst,
LVM_INT16 n);
-#else
-void LVC_Core_MixHard_2St_D16C31_SAT( LVMixer3_st *pInstance1,
- LVMixer3_st *pInstance2,
- const LVM_INT16 *src1,
- const LVM_INT16 *src2,
- LVM_INT16 *dst,
- LVM_INT16 n);
-#endif
/**********************************************************************************/
/* For applying different gains to Left and right chennals */
@@ -115,7 +81,6 @@
/* ptrInstance2 applies to Right channel */
/* Gain values should not be more that 1.0 */
/**********************************************************************************/
-#ifdef BUILD_FLOAT
#ifdef SUPPORT_MC
void LVC_Core_MixSoft_1St_MC_float_WRA(Mix_Private_FLOAT_st **ptrInstance,
const LVM_FLOAT *src,
@@ -128,13 +93,6 @@
const LVM_FLOAT *src,
LVM_FLOAT *dst,
LVM_INT16 n);
-#else
-void LVC_Core_MixSoft_1St_2i_D16C31_WRA( LVMixer3_st *ptrInstance1,
- LVMixer3_st *ptrInstance2,
- const LVM_INT16 *src,
- LVM_INT16 *dst, /* dst can be equal to src */
- LVM_INT16 n); /* Number of stereo samples */
-#endif
/**********************************************************************************/
/* For applying different gains to Left and right chennals */
@@ -142,7 +100,6 @@
/* ptrInstance2 applies to Right channel */
/* Gain values should not be more that 1.0 */
/**********************************************************************************/
-#ifdef BUILD_FLOAT
#ifdef SUPPORT_MC
void LVC_Core_MixHard_1St_MC_float_SAT(Mix_Private_FLOAT_st **ptrInstance,
const LVM_FLOAT *src,
@@ -155,43 +112,9 @@
const LVM_FLOAT *src,
LVM_FLOAT *dst,
LVM_INT16 n);
-#else
-void LVC_Core_MixHard_1St_2i_D16C31_SAT( LVMixer3_st *ptrInstance1,
- LVMixer3_st *ptrInstance2,
- const LVM_INT16 *src,
- LVM_INT16 *dst, /* dst can be equal to src */
- LVM_INT16 n); /* Number of stereo samples */
-#endif
/*** 32 bit functions *************************************************************/
-#ifndef BUILD_FLOAT
-void LVC_Core_MixInSoft_D32C31_SAT( LVMixer3_st *pInstance,
- const LVM_INT32 *src,
- LVM_INT32 *dst,
- LVM_INT16 n);
-
-void LVC_Core_MixSoft_1St_D32C31_WRA( LVMixer3_st *pInstance,
- const LVM_INT32 *src,
- LVM_INT32 *dst,
- LVM_INT16 n);
-
-void LVC_Core_MixHard_2St_D32C31_SAT( LVMixer3_st *pInstance1,
- LVMixer3_st *pInstance2,
- const LVM_INT32 *src1,
- const LVM_INT32 *src2,
- LVM_INT32 *dst,
- LVM_INT16 n);
-#endif
/**********************************************************************************/
#endif //#ifndef __LVC_MIXER_PRIVATE_H__
-
-
-
-
-
-
-
-
-
diff --git a/media/libeffects/lvm/lib/Common/src/LVC_Mixer_SetTarget.cpp b/media/libeffects/lvm/lib/Common/src/LVC_Mixer_SetTarget.cpp
index 577179d..47b0cec 100644
--- a/media/libeffects/lvm/lib/Common/src/LVC_Mixer_SetTarget.cpp
+++ b/media/libeffects/lvm/lib/Common/src/LVC_Mixer_SetTarget.cpp
@@ -43,32 +43,9 @@
/* void */
/* */
/************************************************************************/
-#ifdef BUILD_FLOAT
void LVC_Mixer_SetTarget(LVMixer3_FLOAT_st *pStream,
LVM_FLOAT TargetGain)
{
Mix_Private_FLOAT_st *pInstance = (Mix_Private_FLOAT_st *)pStream->PrivateParams;
pInstance->Target = TargetGain; // Update gain Target
}
-#else
-void LVC_Mixer_SetTarget(LVMixer3_st *pStream,
- LVM_INT32 TargetGain)
-{
- LVM_INT32 Shift=0;
- LVM_INT32 CurrentGain;
- LVM_INT32 MaxGain=TargetGain; // MaxGain is in Q16.15 format
- Mix_Private_st *pInstance=(Mix_Private_st *)pStream->PrivateParams;
- CurrentGain=pInstance->Current>>(16-pInstance->Shift); // CurrentGain in Q16.15 format
- if(CurrentGain>MaxGain)
- MaxGain=CurrentGain; // MaxGain=max(CurrentGain,TargetGain)
-
- MaxGain=MaxGain>>15; // MaxGain in Q31.0 format i.e Integer part only
- while(MaxGain>0){ // Update Shift required to provide integer gain
- Shift++;
- MaxGain=MaxGain>>1;
- }
- pInstance->Target=TargetGain<<(16-Shift); // Update fractional gain Target
- pInstance->Current=CurrentGain<<(16-Shift); // Update fractional gain Current
- pInstance->Shift=Shift; // Update Shift
-}
-#endif
diff --git a/media/libeffects/lvm/lib/Common/src/LVC_Mixer_SetTimeConstant.cpp b/media/libeffects/lvm/lib/Common/src/LVC_Mixer_SetTimeConstant.cpp
index 9d3ee88..1a8da7a 100644
--- a/media/libeffects/lvm/lib/Common/src/LVC_Mixer_SetTimeConstant.cpp
+++ b/media/libeffects/lvm/lib/Common/src/LVC_Mixer_SetTimeConstant.cpp
@@ -44,13 +44,11 @@
/* RETURNS: */
/* void */
/************************************************************************/
-#ifdef BUILD_FLOAT
void LVC_Mixer_SetTimeConstant(LVMixer3_FLOAT_st *pStream,
LVM_INT32 Tc_millisec,
LVM_Fs_en Fs,
LVM_INT16 NumChannels)
{
-#ifdef HIGHER_FS
LVM_FLOAT DeltaTable[13] = {0.500000f,/*8000*/
0.362812f,/*11025*/
0.333333f,/*12000*/
@@ -64,17 +62,6 @@
0.041667f,/*96000*/
0.022676f,/*176400*/
0.020833f};/*192000*/
-#else
- LVM_FLOAT DeltaTable[9] = {0.500000f,/*8000*/
- 0.362812f,/*11025*/
- 0.333333f,/*12000*/
- 0.250000f,/*16000*/
- 0.181406f,/*22050*/
- 0.166666f,/*24000*/
- 0.125000f,/*32000*/
- 0.090703f,/*44100*/
- 0.083333f};/*48000*/
-#endif
Mix_Private_FLOAT_st *pInstance = (Mix_Private_FLOAT_st *)pStream->PrivateParams;
LVM_FLOAT Delta = DeltaTable[Fs];
@@ -90,33 +77,3 @@
assign minimum value to Delta */
pInstance->Delta = Delta; // Delta=(2147483647*4*1000)/(NumChannels*SampleRate*Tc_millisec)
}
-#else
-void LVC_Mixer_SetTimeConstant(LVMixer3_st *pStream,
- LVM_INT32 Tc_millisec,
- LVM_Fs_en Fs,
- LVM_INT16 NumChannels)
-{
- LVM_INT32 DeltaTable[9]={1073741824,
- 779132389,
- 715827882,
- 536870912,
- 389566194,
- 357913941,
- 268435456,
- 194783097,
- 178956971};
- Mix_Private_st *pInstance=(Mix_Private_st *)pStream->PrivateParams;
- LVM_INT32 Delta=DeltaTable[Fs];
- Delta=Delta>>(NumChannels-1);
-
- if(Tc_millisec==0)
- Delta=0x7FFFFFFF;
- else
- Delta=Delta/Tc_millisec;
-
- if(Delta==0)
- Delta=1; // If Time Constant is so large that Delta is 0, assign minimum value to Delta
-
- pInstance->Delta=Delta; // Delta=(2147483647*4*1000)/(NumChannels*SampleRate*Tc_millisec) in Q 0.31 format
-}
-#endif
diff --git a/media/libeffects/lvm/lib/Common/src/LVC_Mixer_VarSlope_SetTimeConstant.cpp b/media/libeffects/lvm/lib/Common/src/LVC_Mixer_VarSlope_SetTimeConstant.cpp
index 0e0acf1..f335a1e 100644
--- a/media/libeffects/lvm/lib/Common/src/LVC_Mixer_VarSlope_SetTimeConstant.cpp
+++ b/media/libeffects/lvm/lib/Common/src/LVC_Mixer_VarSlope_SetTimeConstant.cpp
@@ -19,7 +19,6 @@
#include "LVM_Macros.h"
#include "LVC_Mixer_Private.h"
-
/************************************************************************/
/* FUNCTION: */
/* LVMixer3_VarSlope_SetTimeConstant */
@@ -45,13 +44,11 @@
/* RETURNS: */
/* void */
/************************************************************************/
-#ifdef BUILD_FLOAT
void LVC_Mixer_VarSlope_SetTimeConstant( LVMixer3_FLOAT_st *pStream,
LVM_INT32 Tc_millisec,
LVM_Fs_en Fs,
LVM_INT16 NumChannels)
{
-#ifdef HIGHER_FS
LVM_FLOAT DeltaTable[13] = {0.500000f,/*8000*/
0.362812f,/*11025*/
0.333333f,/*12000*/
@@ -65,17 +62,6 @@
0.041666f,/*96000*/
0.022676f,/*176400*/
0.020833f};/*192000*/
-#else
- LVM_FLOAT DeltaTable[9] = {0.500000f,/*8000*/
- 0.362812f,/*11025*/
- 0.333333f,/*12000*/
- 0.250000f,/*16000*/
- 0.181406f,/*22050*/
- 0.166666f,/*24000*/
- 0.125000f,/*32000*/
- 0.090703f,/*44100*/
- 0.083333f};/*48000*/
-#endif
LVM_FLOAT Tc_millisec_float;
Mix_Private_FLOAT_st *pInstance = (Mix_Private_FLOAT_st *)pStream->PrivateParams;
LVM_FLOAT Delta = DeltaTable[Fs];
@@ -112,52 +98,3 @@
pInstance->Delta = Delta; // Delta=(2147483647*4*1000)/(NumChannels*SampleRate*Tc_millisec)
}
-#else
-void LVC_Mixer_VarSlope_SetTimeConstant( LVMixer3_st *pStream,
- LVM_INT32 Tc_millisec,
- LVM_Fs_en Fs,
- LVM_INT16 NumChannels)
-{
- LVM_INT32 DeltaTable[9]={1073741824,
- 779132389,
- 715827882,
- 536870912,
- 389566194,
- 357913941,
- 268435456,
- 194783097,
- 178956971};
- Mix_Private_st *pInstance=(Mix_Private_st *)pStream->PrivateParams;
- LVM_INT32 Delta=DeltaTable[Fs];
-
- LVM_INT32 Current;
- LVM_INT32 Target;
-
- Delta=Delta>>(NumChannels-1);
-
- /* Get gain values */
- Current = LVC_Mixer_GetCurrent( pStream );
- Target = LVC_Mixer_GetTarget( pStream );
-
- if (Current != Target)
- {
- Tc_millisec = Tc_millisec * 32767 / (Current - Target);
- if (Tc_millisec<0) Tc_millisec = -Tc_millisec;
-
- if(Tc_millisec==0)
- Delta=0x7FFFFFFF;
- else
- Delta=Delta/Tc_millisec;
-
- if(Delta==0)
- Delta=1; // If Time Constant is so large that Delta is 0, assign minimum value to Delta
- }
- else
- {
- Delta =1; // Minimum value for proper call-backs (setting it to zero has some problems, to be corrected)
- }
-
-
- pInstance->Delta=Delta; // Delta=(2147483647*4*1000)/(NumChannels*SampleRate*Tc_millisec) in Q 0.31 format
-}
-#endif
diff --git a/media/libeffects/lvm/lib/Common/src/LVM_FO_HPF.cpp b/media/libeffects/lvm/lib/Common/src/LVM_FO_HPF.cpp
index 9094622..2497d29 100644
--- a/media/libeffects/lvm/lib/Common/src/LVM_FO_HPF.cpp
+++ b/media/libeffects/lvm/lib/Common/src/LVM_FO_HPF.cpp
@@ -21,7 +21,6 @@
#include "BIQUAD.h"
#include "Filter.h"
-
/*-------------------------------------------------------------------------*/
/* FUNCTION: */
/* void LVM_FO_LPF( LVM_INT32 w , */
@@ -68,7 +67,6 @@
/* RETURNS: */
/* */
/*-------------------------------------------------------------------------*/
-#ifdef BUILD_FLOAT
LVM_FLOAT LVM_FO_HPF( LVM_FLOAT w,
FO_FLOAT_Coefs_t *pCoeffs)
{
@@ -97,33 +95,3 @@
return 1;
}
-#else
-LVM_INT32 LVM_FO_HPF( LVM_INT32 w,
- FO_C32_Coefs_t *pCoeffs)
-{
- LVM_INT32 Y,Coefficients[13]={ -8388571,
- 33547744,
- -66816791,
- 173375308,
- -388437573,
- 752975383,
- -1103016663,
- 1121848567,
- -688078159,
- 194669577,
- 8,
- 0,
- 0};
- Y=LVM_Polynomial( (LVM_UINT16)9,
- Coefficients,
- w);
- pCoeffs->B1=-Y; /* Store -B1 in filter structure instead of B1!*/
- /* A0=(1-B1)/2= B1/2 - 0.5*/
- Y=Y>>1; /* A0=Y=B1/2*/
- Y=Y-0x40000000; /* A0=Y=(B1/2 - 0.5)*/
- MUL32x16INTO32(Y, FILTER_LOSS ,pCoeffs->A0 ,15) /* Apply loss to avoid overflow*/
- pCoeffs->A1=-pCoeffs->A0; /* Store A1=-A0*/
-
- return 1;
-}
-#endif
diff --git a/media/libeffects/lvm/lib/Common/src/LVM_FO_LPF.cpp b/media/libeffects/lvm/lib/Common/src/LVM_FO_LPF.cpp
index 9fe67f8..7bc6046 100644
--- a/media/libeffects/lvm/lib/Common/src/LVM_FO_LPF.cpp
+++ b/media/libeffects/lvm/lib/Common/src/LVM_FO_LPF.cpp
@@ -21,7 +21,6 @@
#include "BIQUAD.h"
#include "Filter.h"
-
/*-------------------------------------------------------------------------*/
/* FUNCTION: */
/* void LVM_FO_LPF( LVM_INT32 w , */
@@ -68,7 +67,6 @@
/* RETURNS: */
/* */
/*-------------------------------------------------------------------------*/
-#ifdef BUILD_FLOAT
LVM_FLOAT LVM_FO_LPF( LVM_FLOAT w,
FO_FLOAT_Coefs_t *pCoeffs)
{
@@ -94,30 +92,3 @@
return 1;
}
-#else
-LVM_INT32 LVM_FO_LPF( LVM_INT32 w,
- FO_C32_Coefs_t *pCoeffs)
-{
- LVM_INT32 Y,Coefficients[13]={ -8388571,
- 33547744,
- -66816791,
- 173375308,
- -388437573,
- 752975383,
- -1103016663,
- 1121848567,
- -688078159,
- 194669577,
- 8};
- Y=LVM_Polynomial( (LVM_UINT16)9,
- Coefficients,
- w);
- pCoeffs->B1=-Y; // Store -B1 in filter structure instead of B1!
- // A0=(1+B1)/2= B1/2 + 0.5
- Y=Y>>1; // A0=Y=B1/2
- Y=Y+0x40000000; // A0=Y=(B1/2 + 0.5)
- MUL32x16INTO32(Y, FILTER_LOSS ,pCoeffs->A0 ,15) // Apply loss to avoid overflow
- pCoeffs->A1=pCoeffs->A0;
- return 1;
-}
-#endif
diff --git a/media/libeffects/lvm/lib/Common/src/LVM_GetOmega.cpp b/media/libeffects/lvm/lib/Common/src/LVM_GetOmega.cpp
index ed8e1fa..2a7cca2 100644
--- a/media/libeffects/lvm/lib/Common/src/LVM_GetOmega.cpp
+++ b/media/libeffects/lvm/lib/Common/src/LVM_GetOmega.cpp
@@ -32,16 +32,6 @@
#define LVVDL_2PiByFs_SHIFT1 12 /* Qformat shift for 8kHz, 11.025kHz and 12kHz i.e. 12=41-29 */
#define LVVDL_2PiByFs_SHIFT2 13 /* Qformat shift for 16kHz, 22.050kHz and 24kHz i.e. 13=42-29 */
#define LVVDL_2PiByFs_SHIFT3 14 /* Qformat shift for 32kHz, 44.1kHz and 48kHz i.e. 14=43-29 */
-#ifndef BUILD_FLOAT
-const LVM_INT32 LVVDL_2PiOnFsTable[] = {LVVDL_2PiBy_8000 , /* 8kHz in Q41, 16kHz in Q42, 32kHz in Q43 */
- LVVDL_2PiBy_11025, /* 11025 Hz in Q41, 22050Hz in Q42, 44100 Hz in Q43*/
- LVVDL_2PiBy_12000}; /* 12kHz in Q41, 24kHz in Q42, 48kHz in Q43 */
-
-const LVM_INT32 LVVDL_2PiOnFsShiftTable[]={LVVDL_2PiByFs_SHIFT1 , /* 8kHz, 11025Hz, 12kHz */
- LVVDL_2PiByFs_SHIFT2, /* 16kHz, 22050Hz, 24kHz*/
- LVVDL_2PiByFs_SHIFT3}; /* 32kHz, 44100Hz, 48kHz */
-#endif
-#ifdef BUILD_FLOAT
#define LVVDL_2PiBy_8000_f 0.000785398f
#define LVVDL_2PiBy_11025_f 0.000569903f
#define LVVDL_2PiBy_12000_f 0.000523599f
@@ -52,12 +42,10 @@
#define LVVDL_2PiBy_44100_f 0.000142476f
#define LVVDL_2PiBy_48000_f 0.000130900f
-#ifdef HIGHER_FS
#define LVVDL_2PiBy_88200_f 0.000071238f
#define LVVDL_2PiBy_96000_f 0.000065450f
#define LVVDL_2PiBy_176400_f 0.000035619f
#define LVVDL_2PiBy_192000_f 0.000032725f
-#endif
const LVM_FLOAT LVVDL_2PiOnFsTable[] = {LVVDL_2PiBy_8000_f,
LVVDL_2PiBy_11025_f,
LVVDL_2PiBy_12000_f,
@@ -67,14 +55,11 @@
LVVDL_2PiBy_32000_f,
LVVDL_2PiBy_44100_f,
LVVDL_2PiBy_48000_f
-#ifdef HIGHER_FS
,LVVDL_2PiBy_88200_f
,LVVDL_2PiBy_96000_f
,LVVDL_2PiBy_176400_f
,LVVDL_2PiBy_192000_f
-#endif
};
-#endif
/*-------------------------------------------------------------------------*/
/* FUNCTION: */
/* LVM_GetOmega */
@@ -92,25 +77,10 @@
/* RETURNS: */
/* w=2*pi*Fc/Fs in Q2.29 format */
/*-------------------------------------------------------------------------*/
-#ifdef BUILD_FLOAT
-#ifdef HIGHER_FS
LVM_FLOAT LVM_GetOmega(LVM_UINT32 Fc,
LVM_Fs_en Fs)
-#else
-LVM_FLOAT LVM_GetOmega(LVM_UINT16 Fc,
- LVM_Fs_en Fs)
-#endif
{
LVM_FLOAT w;
w = (LVM_FLOAT)Fc * LVVDL_2PiOnFsTable[Fs];
return w;
}
-#else
-LVM_INT32 LVM_GetOmega(LVM_UINT16 Fc,
- LVM_Fs_en Fs)
-{
- LVM_INT32 w;
- MUL32x32INTO32((LVM_INT32)Fc,LVVDL_2PiOnFsTable[Fs%3],w,LVVDL_2PiOnFsShiftTable[Fs/3])
- return w;
-}
-#endif
diff --git a/media/libeffects/lvm/lib/Common/src/LVM_Mixer_FilterCoeffs.h b/media/libeffects/lvm/lib/Common/src/LVM_Mixer_FilterCoeffs.h
index f1e45fa..244f09d 100644
--- a/media/libeffects/lvm/lib/Common/src/LVM_Mixer_FilterCoeffs.h
+++ b/media/libeffects/lvm/lib/Common/src/LVM_Mixer_FilterCoeffs.h
@@ -27,7 +27,6 @@
#ifndef __LVM_MIXER_FILTER_COEFFS_H__
#define __LVM_MIXER_FILTER_COEFFS_H__
-
/************************************************************************************/
/* */
/* Alpha Time Constant table */
@@ -87,7 +86,6 @@
#define ALPHA_49 0 /* Floating point Alpha = 0.000000 */
#define ALPHA_50 0 /* Floating point Alpha = 0.000000 */
-#ifdef BUILD_FLOAT /* BUILD_FLOAT */
#define ALPHA_Float_0 0.999999f
#define ALPHA_Float_1 0.999998f
#define ALPHA_Float_2 0.999997f
@@ -139,6 +137,5 @@
#define ALPHA_Float_48 0.000000f
#define ALPHA_Float_49 0.000000f
#define ALPHA_Float_50 0.000000f
-#endif
#endif
diff --git a/media/libeffects/lvm/lib/Common/src/LVM_Mixer_TimeConstant.cpp b/media/libeffects/lvm/lib/Common/src/LVM_Mixer_TimeConstant.cpp
index 18b2782..73da2cf 100644
--- a/media/libeffects/lvm/lib/Common/src/LVM_Mixer_TimeConstant.cpp
+++ b/media/libeffects/lvm/lib/Common/src/LVM_Mixer_TimeConstant.cpp
@@ -20,7 +20,6 @@
#include "Mixer.h"
#include "LVM_Mixer_FilterCoeffs.h"
-
/************************************************************************/
/* FUNCTION: */
/* LVM_Mix_GetTimeConstant */
@@ -57,13 +56,8 @@
/* Alpha - the filter coefficient Q31 format */
/* */
/************************************************************************/
-#ifdef BUILD_FLOAT
LVM_FLOAT LVM_Mixer_TimeConstant(LVM_UINT32 tc,
-#ifdef HIGHER_FS
LVM_UINT32 Fs,
-#else
- LVM_UINT16 Fs,
-#endif
LVM_UINT16 NumChannels)
{
@@ -160,101 +154,3 @@
return ProductFloat;
}
-#else
-LVM_UINT32 LVM_Mixer_TimeConstant(LVM_UINT32 tc,
- LVM_UINT16 Fs,
- LVM_UINT16 NumChannels)
-{
-
- LVM_UINT32 Product;
- LVM_INT16 Interpolate;
- LVM_UINT16 Shift;
- LVM_INT32 Diff;
- LVM_UINT32 Table[] = {ALPHA_0, /* Log spaced look-up table */
- ALPHA_1,
- ALPHA_2,
- ALPHA_3,
- ALPHA_4,
- ALPHA_5,
- ALPHA_6,
- ALPHA_7,
- ALPHA_8,
- ALPHA_9,
- ALPHA_10,
- ALPHA_11,
- ALPHA_12,
- ALPHA_13,
- ALPHA_14,
- ALPHA_15,
- ALPHA_16,
- ALPHA_17,
- ALPHA_18,
- ALPHA_19,
- ALPHA_20,
- ALPHA_21,
- ALPHA_22,
- ALPHA_23,
- ALPHA_24,
- ALPHA_25,
- ALPHA_26,
- ALPHA_27,
- ALPHA_28,
- ALPHA_29,
- ALPHA_30,
- ALPHA_31,
- ALPHA_32,
- ALPHA_33,
- ALPHA_34,
- ALPHA_35,
- ALPHA_36,
- ALPHA_37,
- ALPHA_38,
- ALPHA_39,
- ALPHA_40,
- ALPHA_41,
- ALPHA_42,
- ALPHA_43,
- ALPHA_44,
- ALPHA_45,
- ALPHA_46,
- ALPHA_47,
- ALPHA_48,
- ALPHA_49,
- ALPHA_50};
-
-
- /* Calculate the product of the time constant and the sample rate */
- Product = ((tc >> 16) * (LVM_UINT32)Fs) << 13; /* Stereo value */
- Product = Product + (((tc & 0x0000FFFF) * (LVM_UINT32)Fs) >> 3);
-
- if (NumChannels == 1)
- {
- Product = Product >> 1; /* Mono value */
- }
-
- /* Normalize to get the table index and interpolation factor */
- for (Shift=0; Shift<((Alpha_TableSize-1)/2); Shift++)
- {
- if ((Product & 0x80000000)!=0)
- {
- break;
- }
-
- Product = Product << 1;
- }
- Shift = (LVM_UINT16)((Shift << 1));
-
- if ((Product & 0x40000000)==0)
- {
- Shift++;
- }
-
- Interpolate = (LVM_INT16)((Product >> 15) & 0x00007FFF);
-
- Diff = (LVM_INT32)(Table[Shift] - Table[Shift+1]);
- MUL32x16INTO32(Diff,Interpolate,Diff,15)
- Product = Table[Shift+1] + (LVM_UINT32)Diff;
-
- return Product;
-}
-#endif
diff --git a/media/libeffects/lvm/lib/Common/src/LVM_Polynomial.cpp b/media/libeffects/lvm/lib/Common/src/LVM_Polynomial.cpp
index cd57767..2c3e9ec 100644
--- a/media/libeffects/lvm/lib/Common/src/LVM_Polynomial.cpp
+++ b/media/libeffects/lvm/lib/Common/src/LVM_Polynomial.cpp
@@ -40,7 +40,6 @@
/* RETURNS: */
/* The result of the polynomial expansion in Q1.31 format */
/*-------------------------------------------------------------------------*/
-#ifdef BUILD_FLOAT
LVM_FLOAT LVM_Polynomial(LVM_UINT16 N,
LVM_FLOAT *pCoefficients,
LVM_FLOAT X)
@@ -62,7 +61,6 @@
sign *= Temp;
}
-
}
else
{
@@ -81,57 +79,3 @@
}
return Y;
}
-#else
-LVM_INT32 LVM_Polynomial(LVM_UINT16 N,
- LVM_INT32 *pCoefficients,
- LVM_INT32 X)
-{
- LVM_INT32 i;
- LVM_INT32 Y,A,XTemp,Temp,sign;
-
- Y=*pCoefficients; /* Y=A0*/
- pCoefficients++;
-
- if((LVM_UINT32)X==0x80000000)
- {
- Temp=-1;
- sign=Temp;
- for(i=1;i<=N;i++)
- {
- Y+=((*pCoefficients)*sign);
- pCoefficients++;
- sign*=Temp;
- }
-
-
- }
- else
- {
- XTemp=X;
- for(i=N-1;i>=0;i--)
- {
- A=*pCoefficients;
- pCoefficients++;
-
- MUL32x32INTO32(A,XTemp,Temp,31)
- Y+=Temp;
-
- MUL32x32INTO32(XTemp,X,Temp,31)
- XTemp=Temp;
- }
- }
- A=*pCoefficients;
- pCoefficients++;
-
- if(A<0)
- {
- A=Abs_32(A);
- Y=Y>>A;
- }
- else
- {
- Y = Y<<A;
- }
- return Y;
-}
-#endif
diff --git a/media/libeffects/lvm/lib/Common/src/LVM_Power10.cpp b/media/libeffects/lvm/lib/Common/src/LVM_Power10.cpp
index 8785594..ae8e9d1 100644
--- a/media/libeffects/lvm/lib/Common/src/LVM_Power10.cpp
+++ b/media/libeffects/lvm/lib/Common/src/LVM_Power10.cpp
@@ -20,7 +20,6 @@
#include "ScalarArithmetic.h"
#include "Filter.h"
-
/*-------------------------------------------------------------------------*/
/* FUNCTION: */
/* LVM_Power10 */
@@ -54,7 +53,6 @@
/* RETURNS: */
/* The result of the 10x expansion in Q8.24 format */
/*-------------------------------------------------------------------------*/
-#ifdef BUILD_FLOAT
LVM_FLOAT LVM_Power10(LVM_FLOAT X)
{
LVM_FLOAT Y,Coefficients[13]={0.999906f,
@@ -75,25 +73,3 @@
X);
return Y;
}
-#else
-LVM_INT32 LVM_Power10(LVM_INT32 X)
-{
- LVM_INT32 Y,Coefficients[13]={ 16775636,
- 77258249,
- 178024032,
- 273199333,
- 312906284,
- 288662365,
- 228913700,
- 149470921,
- 71094558,
- 37565524,
- 31223618,
- 12619311,
- 0};
- Y=LVM_Polynomial((LVM_UINT16)11,
- Coefficients,
- X);
- return Y;
-}
-#endif
diff --git a/media/libeffects/lvm/lib/Common/src/LVM_Timer_Private.h b/media/libeffects/lvm/lib/Common/src/LVM_Timer_Private.h
index 0dd4272..a372b82 100644
--- a/media/libeffects/lvm/lib/Common/src/LVM_Timer_Private.h
+++ b/media/libeffects/lvm/lib/Common/src/LVM_Timer_Private.h
@@ -18,9 +18,6 @@
#ifndef LVM_TIMER_PRIVATE_H
#define LVM_TIMER_PRIVATE_H
-
-
-
#include "LVM_Types.h"
/****************************************************************************************/
@@ -42,5 +39,4 @@
/* END OF HEADER */
/****************************************************************************************/
-
#endif /* LVM_TIMER_PRIVATE_H */
diff --git a/media/libeffects/lvm/lib/Common/src/LoadConst_32.cpp b/media/libeffects/lvm/lib/Common/src/LoadConst_32.cpp
index 9e14c3b..c789756 100644
--- a/media/libeffects/lvm/lib/Common/src/LoadConst_32.cpp
+++ b/media/libeffects/lvm/lib/Common/src/LoadConst_32.cpp
@@ -24,7 +24,6 @@
/**********************************************************************************
FUNCTION LoadConst_32
***********************************************************************************/
-#ifdef BUILD_FLOAT
void LoadConst_Float(const LVM_FLOAT val,
LVM_FLOAT *dst,
LVM_INT16 n )
@@ -39,21 +38,5 @@
return;
}
-#else
-void LoadConst_32(const LVM_INT32 val,
- LVM_INT32 *dst,
- LVM_INT16 n )
-{
- LVM_INT16 ii;
-
- for (ii = n; ii != 0; ii--)
- {
- *dst = val;
- dst++;
- }
-
- return;
-}
-#endif
/**********************************************************************************/
diff --git a/media/libeffects/lvm/lib/Common/src/MSTo2i_Sat_16x16.cpp b/media/libeffects/lvm/lib/Common/src/MSTo2i_Sat_16x16.cpp
index 02c906a..1ea765a 100644
--- a/media/libeffects/lvm/lib/Common/src/MSTo2i_Sat_16x16.cpp
+++ b/media/libeffects/lvm/lib/Common/src/MSTo2i_Sat_16x16.cpp
@@ -33,7 +33,6 @@
LVM_INT32 temp,mVal,sVal;
LVM_INT16 ii;
-
for (ii = n; ii != 0; ii--)
{
mVal=(LVM_INT32)*srcM;
@@ -77,7 +76,6 @@
return;
}
-#ifdef BUILD_FLOAT
void MSTo2i_Sat_Float(const LVM_FLOAT *srcM,
const LVM_FLOAT *srcS,
LVM_FLOAT *dst,
@@ -86,7 +84,6 @@
LVM_FLOAT temp,mVal,sVal;
LVM_INT16 ii;
-
for (ii = n; ii != 0; ii--)
{
mVal = (LVM_FLOAT)*srcM;
@@ -130,5 +127,4 @@
return;
}
-#endif
/**********************************************************************************/
diff --git a/media/libeffects/lvm/lib/Common/src/Mac3s_Sat_16x16.cpp b/media/libeffects/lvm/lib/Common/src/Mac3s_Sat_16x16.cpp
index ef04ae8..6584251 100644
--- a/media/libeffects/lvm/lib/Common/src/Mac3s_Sat_16x16.cpp
+++ b/media/libeffects/lvm/lib/Common/src/Mac3s_Sat_16x16.cpp
@@ -44,7 +44,6 @@
LVM_INT16 srcval;
LVM_INT32 Temp,dInVal;
-
for (ii = n; ii != 0; ii--)
{
srcval=*src;
@@ -77,5 +76,3 @@
/**********************************************************************************/
-
-
diff --git a/media/libeffects/lvm/lib/Common/src/Mac3s_Sat_32x16.cpp b/media/libeffects/lvm/lib/Common/src/Mac3s_Sat_32x16.cpp
index 17fd833..5d5564f 100644
--- a/media/libeffects/lvm/lib/Common/src/Mac3s_Sat_32x16.cpp
+++ b/media/libeffects/lvm/lib/Common/src/Mac3s_Sat_32x16.cpp
@@ -34,7 +34,6 @@
LVM_INT16 ii;
LVM_INT32 srcval,temp, dInVal, dOutVal;
-
for (ii = n; ii != 0; ii--)
{
srcval=*src;
@@ -45,7 +44,6 @@
dInVal = *dst;
dOutVal = temp + dInVal;
-
if ((((dOutVal ^ temp) & (dOutVal ^ dInVal)) >> 31)!=0) /* overflow / underflow */
{
if(temp<0)
@@ -64,7 +62,6 @@
return;
}
-#ifdef BUILD_FLOAT
void Mac3s_Sat_Float(const LVM_FLOAT *src,
const LVM_FLOAT val,
LVM_FLOAT *dst,
@@ -101,8 +98,5 @@
return;
}
-#endif
/**********************************************************************************/
-
-
diff --git a/media/libeffects/lvm/lib/Common/src/MixInSoft_D32C31_SAT.cpp b/media/libeffects/lvm/lib/Common/src/MixInSoft_D32C31_SAT.cpp
index 16e367b..7c7b36f 100644
--- a/media/libeffects/lvm/lib/Common/src/MixInSoft_D32C31_SAT.cpp
+++ b/media/libeffects/lvm/lib/Common/src/MixInSoft_D32C31_SAT.cpp
@@ -32,7 +32,6 @@
/**********************************************************************************
FUNCTION MIXINSOFT_D32C31_SAT
***********************************************************************************/
-#ifdef BUILD_FLOAT
void MixInSoft_D32C31_SAT( Mix_1St_Cll_FLOAT_t *pInstance,
const LVM_FLOAT *src,
LVM_FLOAT *dst,
@@ -96,64 +95,4 @@
}
}
}
-#else
-void MixInSoft_D32C31_SAT( Mix_1St_Cll_t *pInstance,
- const LVM_INT32 *src,
- LVM_INT32 *dst,
- LVM_INT16 n)
-{
- char HardMixing = TRUE;
-
- if(n<=0) return;
-
- /******************************************************************************
- SOFT MIXING
- *******************************************************************************/
- if (pInstance->Current != pInstance->Target)
- {
- if(pInstance->Alpha == 0){
- pInstance->Current = pInstance->Target;
- }else if ((pInstance->Current-pInstance->Target <POINT_ZERO_ONE_DB)&&
- (pInstance->Current-pInstance->Target > -POINT_ZERO_ONE_DB)){
- pInstance->Current = pInstance->Target; /* Difference is not significant anymore. Make them equal. */
- }else{
- /* Soft mixing has to be applied */
- HardMixing = FALSE;
- Core_MixInSoft_D32C31_SAT( pInstance, src, dst, n);
- }
- }
-
- /******************************************************************************
- HARD MIXING
- *******************************************************************************/
-
- if (HardMixing){
- if (pInstance->Target != 0){ /* Nothing to do in case Target = 0 */
- if ((pInstance->Target>>16) == 0x7FFF)
- Add2_Sat_32x32( src, dst, n );
- else{
- Core_MixInSoft_D32C31_SAT( pInstance, src, dst, n);
- pInstance->Current = pInstance->Target; /* In case the core function would have changed the Current value */
- }
- }
- }
-
- /******************************************************************************
- CALL BACK
- *******************************************************************************/
- /* Call back before the hard mixing, because in this case, hard mixing makes
- use of the core soft mix function which can change the Current value! */
-
- if (pInstance->CallbackSet){
- if ((pInstance->Current-pInstance->Target <POINT_ZERO_ONE_DB)&&
- (pInstance->Current-pInstance->Target > -POINT_ZERO_ONE_DB)){
- pInstance->Current = pInstance->Target; /* Difference is not significant anymore. Make them equal. */
- pInstance->CallbackSet = FALSE;
- if (pInstance->pCallBack != 0){
- (*pInstance->pCallBack) ( pInstance->pCallbackHandle, pInstance->pGeneralPurpose,pInstance->CallbackParam );
- }
- }
- }
-}
-#endif
/**********************************************************************************/
diff --git a/media/libeffects/lvm/lib/Common/src/MixSoft_1St_D32C31_WRA.cpp b/media/libeffects/lvm/lib/Common/src/MixSoft_1St_D32C31_WRA.cpp
index 869293b..d3325ec 100644
--- a/media/libeffects/lvm/lib/Common/src/MixSoft_1St_D32C31_WRA.cpp
+++ b/media/libeffects/lvm/lib/Common/src/MixSoft_1St_D32C31_WRA.cpp
@@ -29,12 +29,9 @@
#define TRUE 1
#define FALSE 0
-
-
/**********************************************************************************
FUNCTION MIXSOFT_1ST_D32C31_WRA
***********************************************************************************/
-#ifdef BUILD_FLOAT
void MixSoft_1St_D32C31_WRA( Mix_1St_Cll_FLOAT_t *pInstance,
const LVM_FLOAT *src,
LVM_FLOAT *dst,
@@ -95,62 +92,4 @@
}
}
}
-#else
-void MixSoft_1St_D32C31_WRA( Mix_1St_Cll_t *pInstance,
- const LVM_INT32 *src,
- LVM_INT32 *dst,
- LVM_INT16 n)
-{
- char HardMixing = TRUE;
-
- if(n<=0) return;
-
- /******************************************************************************
- SOFT MIXING
- *******************************************************************************/
- if (pInstance->Current != pInstance->Target)
- {
- if(pInstance->Alpha == 0){
- pInstance->Current = pInstance->Target;
- }else if ((pInstance->Current-pInstance->Target <POINT_ZERO_ONE_DB)&&
- (pInstance->Current-pInstance->Target > -POINT_ZERO_ONE_DB)){
- pInstance->Current = pInstance->Target; /* Difference is not significant anymore. Make them equal. */
- }else{
- /* Soft mixing has to be applied */
- HardMixing = FALSE;
- Core_MixSoft_1St_D32C31_WRA( pInstance, src, dst, n);
- }
- }
-
- /******************************************************************************
- HARD MIXING
- *******************************************************************************/
-
- if (HardMixing){
- if (pInstance->Target == 0)
- LoadConst_32(0, dst, n);
- else if ((pInstance->Target>>16) == 0x7FFF){
- if (src != dst)
- Copy_16((LVM_INT16*)src, (LVM_INT16*)dst, (LVM_INT16)(n * 2));
- }
- else
- Mult3s_32x16( src, (LVM_INT16)(pInstance->Current>>16), dst, n );
- }
-
- /******************************************************************************
- CALL BACK
- *******************************************************************************/
-
- if (pInstance->CallbackSet){
- if ((pInstance->Current-pInstance->Target <POINT_ZERO_ONE_DB)&&
- (pInstance->Current-pInstance->Target > -POINT_ZERO_ONE_DB)){
- pInstance->Current = pInstance->Target; /* Difference is not significant anymore. Make them equal. */
- pInstance->CallbackSet = FALSE;
- if (pInstance->pCallBack != 0){
- (*pInstance->pCallBack) ( pInstance->pCallbackHandle, pInstance->pGeneralPurpose,pInstance->CallbackParam );
- }
- }
- }
-}
-#endif
/**********************************************************************************/
diff --git a/media/libeffects/lvm/lib/Common/src/MixSoft_2St_D32C31_SAT.cpp b/media/libeffects/lvm/lib/Common/src/MixSoft_2St_D32C31_SAT.cpp
index e6faa74..b002738 100644
--- a/media/libeffects/lvm/lib/Common/src/MixSoft_2St_D32C31_SAT.cpp
+++ b/media/libeffects/lvm/lib/Common/src/MixSoft_2St_D32C31_SAT.cpp
@@ -22,11 +22,9 @@
#include "Mixer_private.h"
#include "VectorArithmetic.h"
-
/**********************************************************************************
FUNCTION MIXSOFT_2ST_D32C31_SAT
***********************************************************************************/
-#ifdef BUILD_FLOAT
void MixSoft_2St_D32C31_SAT( Mix_2St_Cll_FLOAT_t *pInstance,
const LVM_FLOAT *src1,
const LVM_FLOAT *src2,
@@ -64,41 +62,5 @@
Core_MixHard_2St_D32C31_SAT(pInstance, src1, src2, dst, n);
}
}
-#else
-void MixSoft_2St_D32C31_SAT( Mix_2St_Cll_t *pInstance,
- const LVM_INT32 *src1,
- const LVM_INT32 *src2,
- LVM_INT32 *dst,
- LVM_INT16 n)
-{
-
- if(n<=0) return;
-
- /******************************************************************************
- SOFT MIXING
- *******************************************************************************/
- if ((pInstance->Current1 != pInstance->Target1) || (pInstance->Current2 != pInstance->Target2))
- {
- MixSoft_1St_D32C31_WRA( (Mix_1St_Cll_t*) pInstance, src1, dst, n);
- MixInSoft_D32C31_SAT( (void *) &pInstance->Alpha2, /* Cast to void: no dereferencing in function*/
- src2, dst, n);
- }
-
- /******************************************************************************
- HARD MIXING
- *******************************************************************************/
-
- else
- {
- if (pInstance->Current1 == 0)
- MixSoft_1St_D32C31_WRA( (void *) &pInstance->Alpha2, /* Cast to void: no dereferencing in function*/
- src2, dst, n);
- else if (pInstance->Current2 == 0)
- MixSoft_1St_D32C31_WRA( (Mix_1St_Cll_t*) pInstance, src1, dst, n);
- else
- Core_MixHard_2St_D32C31_SAT( pInstance, src1, src2, dst, n);
- }
-}
-#endif
/**********************************************************************************/
diff --git a/media/libeffects/lvm/lib/Common/src/Mixer_private.h b/media/libeffects/lvm/lib/Common/src/Mixer_private.h
index 00d55ed..1d653bb 100644
--- a/media/libeffects/lvm/lib/Common/src/Mixer_private.h
+++ b/media/libeffects/lvm/lib/Common/src/Mixer_private.h
@@ -26,10 +26,8 @@
#define POINT_ZERO_ONE_DB 2473805 /* 0.01 dB on a full scale signal = (10^(0.01/20) -1) * 2^31 */
-#ifdef BUILD_FLOAT
#define POINT_ZERO_ONE_DB_FLOAT 0.001152 /* 0.01 dB on a full scale \
signal = (10^(0.01/20) -1) * 2^31 */
-#endif
/**********************************************************************************
DEFINITIONS
***********************************************************************************/
diff --git a/media/libeffects/lvm/lib/Common/src/MonoTo2I_32.cpp b/media/libeffects/lvm/lib/Common/src/MonoTo2I_32.cpp
index 796a15c..603d1fc 100644
--- a/media/libeffects/lvm/lib/Common/src/MonoTo2I_32.cpp
+++ b/media/libeffects/lvm/lib/Common/src/MonoTo2I_32.cpp
@@ -45,7 +45,6 @@
return;
}
-#ifdef BUILD_FLOAT
void MonoTo2I_Float( const LVM_FLOAT *src,
LVM_FLOAT *dst,
LVM_INT16 n)
@@ -66,5 +65,4 @@
return;
}
-#endif
/**********************************************************************************/
diff --git a/media/libeffects/lvm/lib/Common/src/Mult3s_32x16.cpp b/media/libeffects/lvm/lib/Common/src/Mult3s_32x16.cpp
index c758560..370c39a 100644
--- a/media/libeffects/lvm/lib/Common/src/Mult3s_32x16.cpp
+++ b/media/libeffects/lvm/lib/Common/src/Mult3s_32x16.cpp
@@ -47,7 +47,6 @@
return;
}
-#ifdef BUILD_FLOAT
void Mult3s_Float( const LVM_FLOAT *src,
const LVM_FLOAT val,
LVM_FLOAT *dst,
@@ -65,5 +64,4 @@
}
return;
}
-#endif
/**********************************************************************************/
diff --git a/media/libeffects/lvm/lib/Common/src/NonLinComp_D16.cpp b/media/libeffects/lvm/lib/Common/src/NonLinComp_D16.cpp
index 5156edc..36d1149 100644
--- a/media/libeffects/lvm/lib/Common/src/NonLinComp_D16.cpp
+++ b/media/libeffects/lvm/lib/Common/src/NonLinComp_D16.cpp
@@ -71,7 +71,6 @@
LVM_INT32 SampleNo; /* Sample index */
LVM_INT16 Temp;
-
/*
* Process a block of samples
*/
@@ -84,7 +83,6 @@
Sample = *pDataIn;
pDataIn++;
-
/*
* Apply the compander, this compresses the signal at the expense of
* harmonic distortion. The amount of compression is control by the
@@ -103,18 +101,15 @@
}
}
-
/*
* Save the output
*/
*pDataOut = Sample;
pDataOut++;
-
}
}
-#ifdef BUILD_FLOAT
void NonLinComp_Float(LVM_FLOAT Gain,
LVM_FLOAT *pDataIn,
LVM_FLOAT *pDataOut,
@@ -125,7 +120,6 @@
LVM_INT32 SampleNo; /* Sample index */
LVM_FLOAT Temp;
-
/*
* Process a block of samples
*/
@@ -137,7 +131,6 @@
Sample = *pDataIn;
pDataIn++;
-
/*
* Apply the compander, this compresses the signal at the expense of
* harmonic distortion. The amount of compression is control by the
@@ -156,7 +149,6 @@
}
}
-
/*
* Save the output
*/
@@ -164,4 +156,3 @@
pDataOut++;
}
}
-#endif
diff --git a/media/libeffects/lvm/lib/Common/src/PK_2I_D32F32C14G11_TRC_WRA_01.cpp b/media/libeffects/lvm/lib/Common/src/PK_2I_D32F32C14G11_TRC_WRA_01.cpp
index 6c8b2db..3f62f99 100644
--- a/media/libeffects/lvm/lib/Common/src/PK_2I_D32F32C14G11_TRC_WRA_01.cpp
+++ b/media/libeffects/lvm/lib/Common/src/PK_2I_D32F32C14G11_TRC_WRA_01.cpp
@@ -27,7 +27,6 @@
pBiquadState->coefs[2] is -B1, these are in Q14 format
pBiquadState->coefs[3] is Gain, in Q11 format
-
DELAYS-
pBiquadState->pDelays[0] is x(n-1)L in Q0 format
pBiquadState->pDelays[1] is x(n-1)R in Q0 format
@@ -38,7 +37,6 @@
pBiquadState->pDelays[6] is y(n-2)L in Q0 format
pBiquadState->pDelays[7] is y(n-2)R in Q0 format
***************************************************************************/
-#ifdef BUILD_FLOAT
void PK_2I_D32F32C14G11_TRC_WRA_01 ( Biquad_FLOAT_Instance_t *pInstance,
LVM_FLOAT *pDataIn,
LVM_FLOAT *pDataOut,
@@ -51,7 +49,6 @@
for (ii = NrSamples; ii != 0; ii--)
{
-
/**************************************************************************
PROCESSING OF THE LEFT CHANNEL
***************************************************************************/
@@ -193,85 +190,3 @@
}
#endif
-#else
-void PK_2I_D32F32C14G11_TRC_WRA_01 ( Biquad_Instance_t *pInstance,
- LVM_INT32 *pDataIn,
- LVM_INT32 *pDataOut,
- LVM_INT16 NrSamples)
- {
- LVM_INT32 ynL,ynR,ynLO,ynRO,templ;
- LVM_INT16 ii;
- PFilter_State pBiquadState = (PFilter_State) pInstance;
-
- for (ii = NrSamples; ii != 0; ii--)
- {
-
-
- /**************************************************************************
- PROCESSING OF THE LEFT CHANNEL
- ***************************************************************************/
- /* ynL= (A0 (Q14) * (x(n)L (Q0) - x(n-2)L (Q0) ) >>14) in Q0*/
- templ=(*pDataIn)-pBiquadState->pDelays[2];
- MUL32x16INTO32(templ,pBiquadState->coefs[0],ynL,14)
-
- /* ynL+= ((-B2 (Q14) * y(n-2)L (Q0) ) >>14) in Q0*/
- MUL32x16INTO32(pBiquadState->pDelays[6],pBiquadState->coefs[1],templ,14)
- ynL+=templ;
-
- /* ynL+= ((-B1 (Q14) * y(n-1)L (Q0) ) >>14) in Q0 */
- MUL32x16INTO32(pBiquadState->pDelays[4],pBiquadState->coefs[2],templ,14)
- ynL+=templ;
-
- /* ynLO= ((Gain (Q11) * ynL (Q0))>>11) in Q0*/
- MUL32x16INTO32(ynL,pBiquadState->coefs[3],ynLO,11)
-
- /* ynLO=( ynLO(Q0) + x(n)L (Q0) ) in Q0*/
- ynLO+= (*pDataIn);
-
- /**************************************************************************
- PROCESSING OF THE RIGHT CHANNEL
- ***************************************************************************/
- /* ynR= (A0 (Q14) * (x(n)R (Q0) - x(n-2)R (Q0) ) >>14) in Q0*/
- templ=(*(pDataIn+1))-pBiquadState->pDelays[3];
- MUL32x16INTO32(templ,pBiquadState->coefs[0],ynR,14)
-
- /* ynR+= ((-B2 (Q14) * y(n-2)R (Q0) ) >>14) in Q0*/
- MUL32x16INTO32(pBiquadState->pDelays[7],pBiquadState->coefs[1],templ,14)
- ynR+=templ;
-
- /* ynR+= ((-B1 (Q14) * y(n-1)R (Q0) ) >>14) in Q0 */
- MUL32x16INTO32(pBiquadState->pDelays[5],pBiquadState->coefs[2],templ,14)
- ynR+=templ;
-
- /* ynRO= ((Gain (Q11) * ynR (Q0))>>11) in Q0*/
- MUL32x16INTO32(ynR,pBiquadState->coefs[3],ynRO,11)
-
- /* ynRO=( ynRO(Q0) + x(n)R (Q0) ) in Q0*/
- ynRO+= (*(pDataIn+1));
-
- /**************************************************************************
- UPDATING THE DELAYS
- ***************************************************************************/
- pBiquadState->pDelays[7]=pBiquadState->pDelays[5]; /* y(n-2)R=y(n-1)R*/
- pBiquadState->pDelays[6]=pBiquadState->pDelays[4]; /* y(n-2)L=y(n-1)L*/
- pBiquadState->pDelays[3]=pBiquadState->pDelays[1]; /* x(n-2)R=x(n-1)R*/
- pBiquadState->pDelays[2]=pBiquadState->pDelays[0]; /* x(n-2)L=x(n-1)L*/
- pBiquadState->pDelays[5]=ynR; /* Update y(n-1)R in Q0*/
- pBiquadState->pDelays[4]=ynL; /* Update y(n-1)L in Q0*/
- pBiquadState->pDelays[0]=(*pDataIn); /* Update x(n-1)L in Q0*/
- pDataIn++;
- pBiquadState->pDelays[1]=(*pDataIn); /* Update x(n-1)R in Q0*/
- pDataIn++;
-
- /**************************************************************************
- WRITING THE OUTPUT
- ***************************************************************************/
- *pDataOut=ynLO; /* Write Left output in Q0*/
- pDataOut++;
- *pDataOut=ynRO; /* Write Right ouput in Q0*/
- pDataOut++;
-
- }
-
- }
-#endif
diff --git a/media/libeffects/lvm/lib/Common/src/PK_2I_D32F32C30G11_TRC_WRA_01.cpp b/media/libeffects/lvm/lib/Common/src/PK_2I_D32F32C30G11_TRC_WRA_01.cpp
index f705cbf..41de1de 100644
--- a/media/libeffects/lvm/lib/Common/src/PK_2I_D32F32C30G11_TRC_WRA_01.cpp
+++ b/media/libeffects/lvm/lib/Common/src/PK_2I_D32F32C30G11_TRC_WRA_01.cpp
@@ -27,7 +27,6 @@
pBiquadState->coefs[2] is -B1, these are in Q30 format
pBiquadState->coefs[3] is Gain, in Q11 format
-
DELAYS-
pBiquadState->pDelays[0] is x(n-1)L in Q0 format
pBiquadState->pDelays[1] is x(n-1)R in Q0 format
@@ -38,83 +37,3 @@
pBiquadState->pDelays[6] is y(n-2)L in Q0 format
pBiquadState->pDelays[7] is y(n-2)R in Q0 format
***************************************************************************/
-#ifndef BUILD_FLOAT
-void PK_2I_D32F32C30G11_TRC_WRA_01 ( Biquad_Instance_t *pInstance,
- LVM_INT32 *pDataIn,
- LVM_INT32 *pDataOut,
- LVM_INT16 NrSamples)
- {
- LVM_INT32 ynL,ynR,ynLO,ynRO,templ;
- LVM_INT16 ii;
- PFilter_State pBiquadState = (PFilter_State) pInstance;
-
- for (ii = NrSamples; ii != 0; ii--)
- {
-
-
- /**************************************************************************
- PROCESSING OF THE LEFT CHANNEL
- ***************************************************************************/
- /* ynL= (A0 (Q30) * (x(n)L (Q0) - x(n-2)L (Q0) ) >>30) in Q0*/
- templ=(*pDataIn)-pBiquadState->pDelays[2];
- MUL32x32INTO32(templ,pBiquadState->coefs[0],ynL,30)
-
- /* ynL+= ((-B2 (Q30) * y(n-2)L (Q0) ) >>30) in Q0*/
- MUL32x32INTO32(pBiquadState->pDelays[6],pBiquadState->coefs[1],templ,30)
- ynL+=templ;
-
- /* ynL+= ((-B1 (Q30) * y(n-1)L (Q0) ) >>30) in Q0 */
- MUL32x32INTO32(pBiquadState->pDelays[4],pBiquadState->coefs[2],templ,30)
- ynL+=templ;
-
- /* ynLO= ((Gain (Q11) * ynL (Q0))>>11) in Q0*/
- MUL32x16INTO32(ynL,pBiquadState->coefs[3],ynLO,11)
- /* ynLO=( ynLO(Q0) + x(n)L (Q0) ) in Q0*/
- ynLO+= (*pDataIn);
-
- /**************************************************************************
- PROCESSING OF THE RIGHT CHANNEL
- ***************************************************************************/
- /* ynR= (A0 (Q30) * (x(n)R (Q0) - x(n-2)R (Q0) ) >>30) in Q0*/
- templ=(*(pDataIn+1))-pBiquadState->pDelays[3];
- MUL32x32INTO32(templ,pBiquadState->coefs[0],ynR,30)
-
- /* ynR+= ((-B2 (Q30) * y(n-2)R (Q0) ) >>30) in Q0*/
- MUL32x32INTO32(pBiquadState->pDelays[7],pBiquadState->coefs[1],templ,30)
- ynR+=templ;
-
- /* ynR+= ((-B1 (Q30) * y(n-1)R (Q0) ) >>30) in Q0 */
- MUL32x32INTO32(pBiquadState->pDelays[5],pBiquadState->coefs[2],templ,30)
- ynR+=templ;
-
- /* ynRO= ((Gain (Q11) * ynR (Q0))>>11) in Q0*/
- MUL32x16INTO32(ynR,pBiquadState->coefs[3],ynRO,11)
-
- /* ynRO=( ynRO(Q0) + x(n)R (Q0) ) in Q0*/
- ynRO+= (*(pDataIn+1));
-
- /**************************************************************************
- UPDATING THE DELAYS
- ***************************************************************************/
- pBiquadState->pDelays[7]=pBiquadState->pDelays[5]; /* y(n-2)R=y(n-1)R*/
- pBiquadState->pDelays[6]=pBiquadState->pDelays[4]; /* y(n-2)L=y(n-1)L*/
- pBiquadState->pDelays[3]=pBiquadState->pDelays[1]; /* x(n-2)R=x(n-1)R*/
- pBiquadState->pDelays[2]=pBiquadState->pDelays[0]; /* x(n-2)L=x(n-1)L*/
- pBiquadState->pDelays[5]=ynR; /* Update y(n-1)R in Q0*/
- pBiquadState->pDelays[4]=ynL; /* Update y(n-1)L in Q0*/
- pBiquadState->pDelays[0]=(*pDataIn); /* Update x(n-1)L in Q0*/
- pDataIn++;
- pBiquadState->pDelays[1]=(*pDataIn); /* Update x(n-1)R in Q0*/
- pDataIn++;
-
- /**************************************************************************
- WRITING THE OUTPUT
- ***************************************************************************/
- *pDataOut=ynLO; /* Write Left output in Q0*/
- pDataOut++;
- *pDataOut=ynRO; /* Write Right ouput in Q0*/
- pDataOut++;
- }
-
- }
-#endif
diff --git a/media/libeffects/lvm/lib/Common/src/PK_2I_D32F32CllGss_TRC_WRA_01_Init.cpp b/media/libeffects/lvm/lib/Common/src/PK_2I_D32F32CllGss_TRC_WRA_01_Init.cpp
index 65475a3..714aa52 100644
--- a/media/libeffects/lvm/lib/Common/src/PK_2I_D32F32CllGss_TRC_WRA_01_Init.cpp
+++ b/media/libeffects/lvm/lib/Common/src/PK_2I_D32F32CllGss_TRC_WRA_01_Init.cpp
@@ -18,21 +18,3 @@
#include "BIQUAD.h"
#include "PK_2I_D32F32CllGss_TRC_WRA_01_Private.h"
-#ifndef BUILD_FLOAT
-void PK_2I_D32F32CllGss_TRC_WRA_01_Init(Biquad_Instance_t *pInstance,
- Biquad_2I_Order2_Taps_t *pTaps,
- PK_C32_Coefs_t *pCoef)
-{
- PFilter_State pBiquadState = (PFilter_State) pInstance;
- pBiquadState->pDelays =(LVM_INT32 *) pTaps;
-
- pBiquadState->coefs[0]=pCoef->A0;
-
- pBiquadState->coefs[1]=pCoef->B2;
-
- pBiquadState->coefs[2]=pCoef->B1;
-
- pBiquadState->coefs[3]=pCoef->G;
-
-}
-#endif
diff --git a/media/libeffects/lvm/lib/Common/src/PK_2I_D32F32CssGss_TRC_WRA_01_Init.cpp b/media/libeffects/lvm/lib/Common/src/PK_2I_D32F32CssGss_TRC_WRA_01_Init.cpp
index a36330e..f6c05da 100644
--- a/media/libeffects/lvm/lib/Common/src/PK_2I_D32F32CssGss_TRC_WRA_01_Init.cpp
+++ b/media/libeffects/lvm/lib/Common/src/PK_2I_D32F32CssGss_TRC_WRA_01_Init.cpp
@@ -17,7 +17,6 @@
#include "BIQUAD.h"
#include "PK_2I_D32F32CssGss_TRC_WRA_01_Private.h"
-#ifdef BUILD_FLOAT
void PK_2I_D32F32CssGss_TRC_WRA_01_Init(Biquad_FLOAT_Instance_t *pInstance,
Biquad_2I_Order2_FLOAT_Taps_t *pTaps,
PK_FLOAT_Coefs_t *pCoef)
@@ -33,21 +32,3 @@
pBiquadState->coefs[3] = pCoef->G;
}
-#else
-void PK_2I_D32F32CssGss_TRC_WRA_01_Init(Biquad_Instance_t *pInstance,
- Biquad_2I_Order2_Taps_t *pTaps,
- PK_C16_Coefs_t *pCoef)
-{
- PFilter_State pBiquadState = (PFilter_State) pInstance;
- pBiquadState->pDelays =(LVM_INT32 *) pTaps;
-
- pBiquadState->coefs[0]=pCoef->A0;
-
- pBiquadState->coefs[1]=pCoef->B2;
-
- pBiquadState->coefs[2]=pCoef->B1;
-
- pBiquadState->coefs[3]=pCoef->G;
-
-}
-#endif
diff --git a/media/libeffects/lvm/lib/Common/src/PK_2I_D32F32CssGss_TRC_WRA_01_Private.h b/media/libeffects/lvm/lib/Common/src/PK_2I_D32F32CssGss_TRC_WRA_01_Private.h
index 1e32062..cc924c4 100644
--- a/media/libeffects/lvm/lib/Common/src/PK_2I_D32F32CssGss_TRC_WRA_01_Private.h
+++ b/media/libeffects/lvm/lib/Common/src/PK_2I_D32F32CssGss_TRC_WRA_01_Private.h
@@ -18,11 +18,9 @@
#ifndef _PK_2I_D32F32CSSGSS_TRC_WRA_01_PRIVATE_H_
#define _PK_2I_D32F32CSSGSS_TRC_WRA_01_PRIVATE_H_
-
/* The internal state variables are implemented in a (for the user) hidden structure */
/* In this (private) file, the internal structure is declared fro private use. */
-#ifdef BUILD_FLOAT
typedef struct _Filter_State_Float_
{
LVM_FLOAT * pDelays; /* pointer to the delayed samples (data of 32 bits) */
@@ -30,7 +28,6 @@
}Filter_State_Float;
typedef Filter_State_Float * PFilter_State_Float ;
-#endif
typedef struct _Filter_State_
{
LVM_INT32 * pDelays; /* pointer to the delayed samples (data of 32 bits) */
diff --git a/media/libeffects/lvm/lib/Common/src/Shift_Sat_v16xv16.cpp b/media/libeffects/lvm/lib/Common/src/Shift_Sat_v16xv16.cpp
index 28fea65..668a4b6 100644
--- a/media/libeffects/lvm/lib/Common/src/Shift_Sat_v16xv16.cpp
+++ b/media/libeffects/lvm/lib/Common/src/Shift_Sat_v16xv16.cpp
@@ -24,58 +24,4 @@
/**********************************************************************************
FUNCTION Shift_Sat_v16xv16
***********************************************************************************/
-#ifndef BUILD_FLOAT
-void Shift_Sat_v16xv16 (const LVM_INT16 val,
- const LVM_INT16 *src,
- LVM_INT16 *dst,
- LVM_INT16 n)
-{
- LVM_INT32 temp;
- LVM_INT32 ii;
- LVM_INT16 RShift;
- if(val>0)
- {
- for (ii = n; ii != 0; ii--)
- {
- temp = (LVM_INT32)*src;
- src++;
-
- temp = temp << val;
-
- if (temp > 0x00007FFF)
- {
- *dst = 0x7FFF;
- }
- else if (temp < -0x00008000)
- {
- *dst = - 0x8000;
- }
- else
- {
- *dst = (LVM_INT16)temp;
- }
- dst++;
- }
- }
- else if(val<0)
- {
- RShift=(LVM_INT16)(-val);
-
- for (ii = n; ii != 0; ii--)
- {
- *dst = (LVM_INT16)(*src >> RShift);
- dst++;
- src++;
- }
- }
- else
- {
- if(src!=dst)
- {
- Copy_16(src,dst,n);
- }
- }
- return;
-}
-#endif
/**********************************************************************************/
diff --git a/media/libeffects/lvm/lib/Common/src/Shift_Sat_v32xv32.cpp b/media/libeffects/lvm/lib/Common/src/Shift_Sat_v32xv32.cpp
index fac9de7..97a04c1 100644
--- a/media/libeffects/lvm/lib/Common/src/Shift_Sat_v32xv32.cpp
+++ b/media/libeffects/lvm/lib/Common/src/Shift_Sat_v32xv32.cpp
@@ -24,7 +24,6 @@
/**********************************************************************************
FUNCTION Shift_Sat_v32xv32
***********************************************************************************/
-#ifdef BUILD_FLOAT
void Shift_Sat_Float (const LVM_INT16 val,
const LVM_FLOAT *src,
LVM_FLOAT *dst,
@@ -79,60 +78,4 @@
}
return;
}
-#else
-void Shift_Sat_v32xv32 (const LVM_INT16 val,
- const LVM_INT32 *src,
- LVM_INT32 *dst,
- LVM_INT16 n)
-{
- LVM_INT32 ii;
- LVM_INT16 RShift;
-
- if(val>0)
- {
- LVM_INT32 a,b;
-
- for (ii = n; ii != 0; ii--)
- {
- a=*src;
- src++;
-
- b=(a<<val);
-
- if( (b>>val) != a ) /* if overflow occured, right shift will show difference*/
- {
- if(a<0)
- {
- b=0x80000000l;
- }
- else
- {
- b=0x7FFFFFFFl;
- }
- }
-
- *dst = b;
- dst++;
- }
- }
- else if(val<0)
- {
- RShift=(LVM_INT16)(-val);
- for (ii = n; ii != 0; ii--)
- {
- *dst = (*src >> RShift);
- dst++;
- src++;
- }
- }
- else
- {
- if(src!=dst)
- {
- Copy_16((LVM_INT16 *)src,(LVM_INT16 *)dst,(LVM_INT16)(n<<1));
- }
- }
- return;
-}
-#endif
/**********************************************************************************/
diff --git a/media/libeffects/lvm/lib/Common/src/dB_to_Lin32.cpp b/media/libeffects/lvm/lib/Common/src/dB_to_Lin32.cpp
index 9a726f2..4da2013 100644
--- a/media/libeffects/lvm/lib/Common/src/dB_to_Lin32.cpp
+++ b/media/libeffects/lvm/lib/Common/src/dB_to_Lin32.cpp
@@ -29,10 +29,7 @@
/*######################################################################################*/
#include "ScalarArithmetic.h"
-#ifdef BUILD_FLOAT
#include <math.h>
-#endif
-
/****************************************************************************************
* Name : dB_to_Lin32()
@@ -67,7 +64,6 @@
#define SECOND_COEF 38836
#define MAX_VALUE 1536 /* 96 * 16 */
-#ifdef BUILD_FLOAT
LVM_FLOAT dB_to_LinFloat(LVM_INT16 db_fix)
{
LVM_FLOAT dB_Float;
@@ -78,47 +74,3 @@
return LinFloat;
}
-#else
-LVM_INT32 dB_to_Lin32(LVM_INT16 db_fix)
-{
- LVM_INT32 Lin_val_32;
- LVM_INT16 Shift;
- LVM_INT32 Remain;
-
-
- /*
- * Check sign of the input
- */
- if (db_fix<0)
- {
- if (db_fix > -MAX_VALUE)
- {
- Shift = (LVM_INT16)((((LVM_UINT32)(-db_fix) >> 4) * FOUR_OVER_SIX) >> 17); /* Number of 6dB steps in Q11.4 format */
- Remain = -db_fix - (Shift * SIX_DB);
- Remain = (0x7FFFFFFF - (Remain * FIRST_COEF_NEG)) + (Remain * Remain * SECOND_COEF);
- Lin_val_32 = (LVM_INT32)((LVM_UINT32)Remain >> (16 + Shift));
- }
- else
- {
- Lin_val_32 = 0;
- }
- }
- else
- {
- if (db_fix < MAX_VALUE)
- {
- Shift = (LVM_INT16)((((LVM_UINT32)db_fix >> 4) * FOUR_OVER_SIX) >> 17); /* Number of 6dB steps in Q11.4 format */
- Remain = db_fix - (Shift * SIX_DB);
- Remain = 0x3FFFFFFF + (Remain * FIRST_COEF_POS) + (Remain * Remain * SECOND_COEF);
- Lin_val_32 = (LVM_INT32)((LVM_UINT32)Remain >> (15 - Shift));
- }
- else
- {
- Lin_val_32 = 0x7FFFFFFF;
- }
- }
-
-
- return Lin_val_32; /* format 1.16.15 */
-}
-#endif
diff --git a/media/libeffects/lvm/lib/Eq/lib/LVEQNB.h b/media/libeffects/lvm/lib/Eq/lib/LVEQNB.h
index 7e2c3a4..c5ddf77 100644
--- a/media/libeffects/lvm/lib/Eq/lib/LVEQNB.h
+++ b/media/libeffects/lvm/lib/Eq/lib/LVEQNB.h
@@ -68,12 +68,9 @@
/* */
/****************************************************************************************/
-
#ifndef __LVEQNB_H__
#define __LVEQNB_H__
-
-
/****************************************************************************************/
/* */
/* Includes */
@@ -109,7 +106,6 @@
/* Instance handle */
typedef void *LVEQNB_Handle_t;
-
/* Operating modes */
typedef enum
{
@@ -118,7 +114,6 @@
LVEQNB_MODE_MAX = LVM_MAXINT_32
} LVEQNB_Mode_en;
-
/* Filter mode control */
typedef enum
{
@@ -127,7 +122,6 @@
LVEQNB_FILTER_DUMMY = LVM_MAXINT_32
} LVEQNB_FilterMode_en;
-
/* Memory Types */
typedef enum
{
@@ -138,7 +132,6 @@
LVEQNB_MEMORY_MAX = LVM_MAXINT_32
} LVEQNB_MemoryTypes_en;
-
/* Function return status */
typedef enum
{
@@ -149,7 +142,6 @@
LVEQNB_STATUS_MAX = LVM_MAXINT_32
} LVEQNB_ReturnStatus_en;
-
/****************************************************************************************/
/* */
/* Linked enumerated type and capability definitions */
@@ -187,7 +179,6 @@
LVEQNB_SOURCE_MAX = LVM_MAXINT_32
} LVEQNB_SourceFormat_en;
-
/*
* Supported sample rates in samples per second
*/
@@ -200,12 +191,10 @@
#define LVEQNB_CAP_FS_32000 64
#define LVEQNB_CAP_FS_44100 128
#define LVEQNB_CAP_FS_48000 256
-#if defined(BUILD_FLOAT) && defined(HIGHER_FS)
#define LVEQNB_CAP_FS_88200 512
#define LVEQNB_CAP_FS_96000 1024
#define LVEQNB_CAP_FS_176400 2048
#define LVEQNB_CAP_FS_192000 4096
-#endif
typedef enum
{
@@ -218,16 +207,13 @@
LVEQNB_FS_32000 = 6,
LVEQNB_FS_44100 = 7,
LVEQNB_FS_48000 = 8,
-#ifdef HIGHER_FS
LVEQNB_FS_88200 = 9,
LVEQNB_FS_96000 = 10,
LVEQNB_FS_176400 = 11,
LVEQNB_FS_192000 = 12,
-#endif
LVEQNB_FS_MAX = LVM_MAXINT_32
} LVEQNB_Fs_en;
-
/****************************************************************************************/
/* */
/* Structures */
@@ -243,14 +229,12 @@
void *pBaseAddress; /* Pointer to the region base address */
} LVEQNB_MemoryRegion_t;
-
/* Memory table containing the region definitions */
typedef struct
{
LVEQNB_MemoryRegion_t Region[LVEQNB_NR_MEMORY_REGIONS]; /* One definition for each region */
} LVEQNB_MemTab_t;
-
/* Equaliser band definition */
typedef struct
{
@@ -259,7 +243,6 @@
LVM_UINT16 QFactor; /* Band quality factor */
} LVEQNB_BandDef_t;
-
/* Parameter structure */
typedef struct
{
@@ -276,7 +259,6 @@
#endif
} LVEQNB_Params_t;
-
/* Capability structure */
typedef struct
{
@@ -293,7 +275,6 @@
} LVEQNB_Capabilities_t;
-
/****************************************************************************************/
/* */
/* Function Prototypes */
@@ -336,7 +317,6 @@
LVEQNB_MemTab_t *pMemoryTable,
LVEQNB_Capabilities_t *pCapabilities);
-
/****************************************************************************************/
/* */
/* FUNCTION: LVEQNB_Init */
@@ -376,7 +356,6 @@
LVEQNB_MemTab_t *pMemoryTable,
LVEQNB_Capabilities_t *pCapabilities);
-
/****************************************************************************************/
/* */
/* FUNCTION: LVEQNB_GetParameters */
@@ -401,7 +380,6 @@
LVEQNB_ReturnStatus_en LVEQNB_GetParameters(LVEQNB_Handle_t hInstance,
LVEQNB_Params_t *pParams);
-
/****************************************************************************************/
/* */
/* FUNCTION: LVEQNB_GetCapabilities */
@@ -426,7 +404,6 @@
LVEQNB_ReturnStatus_en LVEQNB_GetCapabilities(LVEQNB_Handle_t hInstance,
LVEQNB_Capabilities_t *pCapabilities);
-
/****************************************************************************************/
/* */
/* FUNCTION: LVEQNB_Control */
@@ -452,7 +429,6 @@
LVEQNB_ReturnStatus_en LVEQNB_Control(LVEQNB_Handle_t hInstance,
LVEQNB_Params_t *pParams);
-
/****************************************************************************************/
/* */
/* FUNCTION: LVEQNB_Process */
@@ -475,20 +451,10 @@
/* NOTES: */
/* */
/****************************************************************************************/
-#ifdef BUILD_FLOAT
LVEQNB_ReturnStatus_en LVEQNB_Process(LVEQNB_Handle_t hInstance,
const LVM_FLOAT *pInData,
LVM_FLOAT *pOutData,
LVM_UINT16 NumSamples);
-#else
-LVEQNB_ReturnStatus_en LVEQNB_Process(LVEQNB_Handle_t hInstance,
- const LVM_INT16 *pInData,
- LVM_INT16 *pOutData,
- LVM_UINT16 NumSamples);
-#endif
-
-
-
#endif /* __LVEQNB__ */
diff --git a/media/libeffects/lvm/lib/Eq/src/LVEQNB_CalcCoef.cpp b/media/libeffects/lvm/lib/Eq/src/LVEQNB_CalcCoef.cpp
index 482e3ba..c3c0fad 100644
--- a/media/libeffects/lvm/lib/Eq/src/LVEQNB_CalcCoef.cpp
+++ b/media/libeffects/lvm/lib/Eq/src/LVEQNB_CalcCoef.cpp
@@ -22,9 +22,7 @@
/****************************************************************************************/
#include "LVEQNB_Private.h"
-#ifdef BUILD_FLOAT
#include <math.h>
-#endif
/****************************************************************************************/
/* */
@@ -78,101 +76,6 @@
/* */
/****************************************************************************************/
-
-#ifndef BUILD_FLOAT
-LVEQNB_ReturnStatus_en LVEQNB_DoublePrecCoefs(LVM_UINT16 Fs,
- LVEQNB_BandDef_t *pFilterDefinition,
- PK_C32_Coefs_t *pCoefficients)
-{
-
- extern LVM_INT16 LVEQNB_GainTable[];
- extern LVM_INT16 LVEQNB_TwoPiOnFsTable[];
- extern LVM_INT16 LVEQNB_DTable[];
- extern LVM_INT16 LVEQNB_DPCosCoef[];
-
- /*
- * Get the filter definition
- */
- LVM_INT16 Gain = pFilterDefinition->Gain;
- LVM_UINT16 Frequency = pFilterDefinition->Frequency;
- LVM_UINT16 QFactor = pFilterDefinition->QFactor;
-
- /*
- * Intermediate variables and temporary values
- */
- LVM_INT32 T0;
- LVM_INT16 D;
- LVM_INT32 A0;
- LVM_INT32 B1;
- LVM_INT32 B2;
- LVM_INT32 Dt0;
- LVM_INT32 B2_Den;
- LVM_INT32 B2_Num;
- LVM_INT32 CosErr;
- LVM_INT16 coef;
- LVM_INT32 factor;
- LVM_INT16 t0;
- LVM_INT16 i;
-
- /*
- * Calculating the intermediate values
- */
- T0 = (LVM_INT32)Frequency * LVEQNB_TwoPiOnFsTable[Fs]; /* T0 = 2 * Pi * Fc / Fs */
- if (Gain >= 0)
- {
- D = LVEQNB_DTable[15]; /* D = 1 if GaindB >= 0 */
- }
- else
- {
- D = LVEQNB_DTable[Gain+15]; /* D = 1 / (1 + G) if GaindB < 0 */
- }
-
- /*
- * Calculate the B2 coefficient
- */
- Dt0 = D * (T0 >> 10);
- B2_Den = ((LVM_INT32)QFactor << 19) + (Dt0 >> 2);
- B2_Num = (Dt0 >> 3) - ((LVM_INT32)QFactor << 18);
- B2 = (B2_Num / (B2_Den >> 16)) << 15;
-
- /*
- * Calculate the cosine error by a polynomial expansion using the equation:
- *
- * CosErr += coef(n) * t0^n For n = 0 to 4
- */
- T0 = (T0 >> 6) * 0x7f53; /* Scale to 1.0 in 16-bit for range 0 to fs/50 */
- t0 = (LVM_INT16)(T0 >> 16);
- factor = 0x7fff; /* Initialise to 1.0 for the a0 coefficient */
- CosErr = 0; /* Initialise the error to zero */
- for (i=1; i<5; i++)
- {
- coef = LVEQNB_DPCosCoef[i]; /* Get the nth coefficient */
- CosErr += (factor * coef) >> 5; /* The nth partial sum */
- factor = (factor * t0) >> 15; /* Calculate t0^n */
- }
- CosErr = CosErr << (LVEQNB_DPCosCoef[0]); /* Correct the scaling */
-
- /*
- * Calculate the B1 and A0 coefficients
- */
- B1 = (0x40000000 - B2); /* B1 = (0.5 - b2/2) */
- A0 = ((B1 >> 16) * (CosErr >> 10)) >> 6; /* Temporary storage for (0.5 - b2/2) * coserr(t0) */
- B1 -= A0; /* B1 = (0.5 - b2/2) * (1 - coserr(t0)) */
- A0 = (0x40000000 + B2) >> 1; /* A0 = (0.5 + b2) */
-
- /*
- * Write coeff into the data structure
- */
- pCoefficients->A0 = A0;
- pCoefficients->B1 = B1;
- pCoefficients->B2 = B2;
- pCoefficients->G = LVEQNB_GainTable[Gain+15];
-
- return(LVEQNB_SUCCESS);
-
-}
-#endif
-
/****************************************************************************************/
/* */
/* FUNCTION: LVEQNB_SinglePrecCoefs */
@@ -208,7 +111,6 @@
/* */
/****************************************************************************************/
-#ifdef BUILD_FLOAT
LVEQNB_ReturnStatus_en LVEQNB_SinglePrecCoefs(LVM_UINT16 Fs,
LVEQNB_BandDef_t *pFilterDefinition,
PK_FLOAT_Coefs_t *pCoefficients)
@@ -218,7 +120,6 @@
extern LVM_FLOAT LVEQNB_TwoPiOnFsTable[];
extern LVM_FLOAT LVEQNB_DTable[];
-
/*
* Get the filter definition
*/
@@ -227,7 +128,6 @@
/* As mentioned in effectbundle.h */
LVM_FLOAT QFactor = (LVM_FLOAT)pFilterDefinition->QFactor / 100.0f;
-
/*
* Intermediate variables and temporary values
*/
@@ -268,95 +168,3 @@
return(LVEQNB_SUCCESS);
}
-#else
-LVEQNB_ReturnStatus_en LVEQNB_SinglePrecCoefs(LVM_UINT16 Fs,
- LVEQNB_BandDef_t *pFilterDefinition,
- PK_C16_Coefs_t *pCoefficients)
-{
-
- extern LVM_INT16 LVEQNB_GainTable[];
- extern LVM_INT16 LVEQNB_TwoPiOnFsTable[];
- extern LVM_INT16 LVEQNB_DTable[];
- extern LVM_INT16 LVEQNB_CosCoef[];
-
-
- /*
- * Get the filter definition
- */
- LVM_INT16 Gain = pFilterDefinition->Gain;
- LVM_UINT16 Frequency = pFilterDefinition->Frequency;
- LVM_UINT16 QFactor = pFilterDefinition->QFactor;
-
-
- /*
- * Intermediate variables and temporary values
- */
- LVM_INT32 T0;
- LVM_INT16 D;
- LVM_INT32 A0;
- LVM_INT32 B1;
- LVM_INT32 B2;
- LVM_INT32 Dt0;
- LVM_INT32 B2_Den;
- LVM_INT32 B2_Num;
- LVM_INT32 COS_T0;
- LVM_INT16 coef;
- LVM_INT32 factor;
- LVM_INT16 t0;
- LVM_INT16 i;
-
- /*
- * Calculating the intermediate values
- */
- T0 = (LVM_INT32)Frequency * LVEQNB_TwoPiOnFsTable[Fs]; /* T0 = 2 * Pi * Fc / Fs */
- if (Gain >= 0)
- {
- D = LVEQNB_DTable[15]; /* D = 1 if GaindB >= 0 */
- }
- else
- {
- D = LVEQNB_DTable[Gain+15]; /* D = 1 / (1 + G) if GaindB < 0 */
- }
-
- /*
- * Calculate the B2 coefficient
- */
- Dt0 = D * (T0 >> 10);
- B2_Den = ((LVM_INT32)QFactor << 19) + (Dt0 >> 2);
- B2_Num = (Dt0 >> 3) - ((LVM_INT32)QFactor << 18);
- B2 = (B2_Num / (B2_Den >> 16)) << 15;
-
- /*
- * Calculate the cosine by a polynomial expansion using the equation:
- *
- * Cos += coef(n) * t0^n For n = 0 to 6
- */
- T0 = (T0 >> 10) * 20859; /* Scale to 1.0 in 16-bit for range 0 to fs/2 */
- t0 = (LVM_INT16)(T0 >> 16);
- factor = 0x7fff; /* Initialise to 1.0 for the a0 coefficient */
- COS_T0 = 0; /* Initialise the error to zero */
- for (i=1; i<7; i++)
- {
- coef = LVEQNB_CosCoef[i]; /* Get the nth coefficient */
- COS_T0 += (factor * coef) >> 5; /* The nth partial sum */
- factor = (factor * t0) >> 15; /* Calculate t0^n */
- }
- COS_T0 = COS_T0 << (LVEQNB_CosCoef[0]+6); /* Correct the scaling */
-
-
- B1 = ((0x40000000 - B2) >> 16) * (COS_T0 >> 16); /* B1 = (0.5 - b2/2) * cos(t0) */
- A0 = (0x40000000 + B2) >> 1; /* A0 = (0.5 + b2/2) */
-
- /*
- * Write coeff into the data structure
- */
- pCoefficients->A0 = (LVM_INT16)(A0>>16);
- pCoefficients->B1 = (LVM_INT16)(B1>>15);
- pCoefficients->B2 = (LVM_INT16)(B2>>16);
- pCoefficients->G = LVEQNB_GainTable[Gain+15];
-
-
- return(LVEQNB_SUCCESS);
-
-}
-#endif
diff --git a/media/libeffects/lvm/lib/Eq/src/LVEQNB_Coeffs.h b/media/libeffects/lvm/lib/Eq/src/LVEQNB_Coeffs.h
index 755141e..6329181 100644
--- a/media/libeffects/lvm/lib/Eq/src/LVEQNB_Coeffs.h
+++ b/media/libeffects/lvm/lib/Eq/src/LVEQNB_Coeffs.h
@@ -15,17 +15,14 @@
* limitations under the License.
*/
-
#ifndef __LVEQNB_COEFFS_H__
#define __LVEQNB_COEFFS_H__
-
/************************************************************************************/
/* */
/* Gain table for (10^(Gain/20) - 1) */
/* */
/************************************************************************************/
-#ifdef BUILD_FLOAT
#define LVEQNB_Gain_Neg15_dB (-0.822172f)
#define LVEQNB_Gain_Neg14_dB (-0.800474f)
#define LVEQNB_Gain_Neg13_dB (-0.776128f)
@@ -57,47 +54,12 @@
#define LVEQNB_Gain_13_dB 3.466836f
#define LVEQNB_Gain_14_dB 4.011872f
#define LVEQNB_Gain_15_dB 4.623413f
-#else
-#define LVEQNB_GAINSHIFT 11 /* As a power of 2 */
-#define LVEQNB_Gain_Neg15_dB (-1684) /* Floating point value -0.822172 */
-#define LVEQNB_Gain_Neg14_dB (-1639) /* Floating point value -0.800474 */
-#define LVEQNB_Gain_Neg13_dB (-1590) /* Floating point value -0.776128 */
-#define LVEQNB_Gain_Neg12_dB (-1534) /* Floating point value -0.748811 */
-#define LVEQNB_Gain_Neg11_dB (-1471) /* Floating point value -0.718162 */
-#define LVEQNB_Gain_Neg10_dB (-1400) /* Floating point value -0.683772 */
-#define LVEQNB_Gain_Neg9_dB (-1321) /* Floating point value -0.645187 */
-#define LVEQNB_Gain_Neg8_dB (-1233) /* Floating point value -0.601893 */
-#define LVEQNB_Gain_Neg7_dB (-1133) /* Floating point value -0.553316 */
-#define LVEQNB_Gain_Neg6_dB (-1022) /* Floating point value -0.498813 */
-#define LVEQNB_Gain_Neg5_dB (-896) /* Floating point value -0.437659 */
-#define LVEQNB_Gain_Neg4_dB (-756) /* Floating point value -0.369043 */
-#define LVEQNB_Gain_Neg3_dB (-598) /* Floating point value -0.292054 */
-#define LVEQNB_Gain_Neg2_dB (-421) /* Floating point value -0.205672 */
-#define LVEQNB_Gain_Neg1_dB (-223) /* Floating point value -0.108749 */
-#define LVEQNB_Gain_0_dB 0 /* Floating point value 0.000000 */
-#define LVEQNB_Gain_1_dB 250 /* Floating point value 0.122018 */
-#define LVEQNB_Gain_2_dB 530 /* Floating point value 0.258925 */
-#define LVEQNB_Gain_3_dB 845 /* Floating point value 0.412538 */
-#define LVEQNB_Gain_4_dB 1198 /* Floating point value 0.584893 */
-#define LVEQNB_Gain_5_dB 1594 /* Floating point value 0.778279 */
-#define LVEQNB_Gain_6_dB 2038 /* Floating point value 0.995262 */
-#define LVEQNB_Gain_7_dB 2537 /* Floating point value 1.238721 */
-#define LVEQNB_Gain_8_dB 3096 /* Floating point value 1.511886 */
-#define LVEQNB_Gain_9_dB 3724 /* Floating point value 1.818383 */
-#define LVEQNB_Gain_10_dB 4428 /* Floating point value 2.162278 */
-#define LVEQNB_Gain_11_dB 5219 /* Floating point value 2.548134 */
-#define LVEQNB_Gain_12_dB 6105 /* Floating point value 2.981072 */
-#define LVEQNB_Gain_13_dB 7100 /* Floating point value 3.466836 */
-#define LVEQNB_Gain_14_dB 8216 /* Floating point value 4.011872 */
-#define LVEQNB_Gain_15_dB 9469 /* Floating point value 4.623413 */
-#endif
/************************************************************************************/
/* */
/* Frequency table for 2*Pi/Fs */
/* */
/************************************************************************************/
-#ifdef BUILD_FLOAT
#define LVEQNB_2PiOn_8000 0.000785f
#define LVEQNB_2PiOn_11025 0.000570f
#define LVEQNB_2PiOn_12000 0.000524f
@@ -108,32 +70,16 @@
#define LVEQNB_2PiOn_44100 0.000142f
#define LVEQNB_2PiOn_48000 0.000131f
-#ifdef HIGHER_FS
#define LVEQNB_2PiOn_88200 0.000071f
#define LVEQNB_2PiOn_96000 0.000065f
#define LVEQNB_2PiOn_176400 0.000036f
#define LVEQNB_2PiOn_192000 0.000033f
-#endif
-
-#else
-#define LVEQNB_FREQSHIFT 25 /* As a power of 2 */
-#define LVEQNB_2PiOn_8000 26354 /* Floating point value 0.000785 */
-#define LVEQNB_2PiOn_11025 19123 /* Floating point value 0.000570 */
-#define LVEQNB_2PiOn_12000 17569 /* Floating point value 0.000524 */
-#define LVEQNB_2PiOn_16000 13177 /* Floating point value 0.000393 */
-#define LVEQNB_2PiOn_22050 9561 /* Floating point value 0.000285 */
-#define LVEQNB_2PiOn_24000 8785 /* Floating point value 0.000262 */
-#define LVEQNB_2PiOn_32000 6588 /* Floating point value 0.000196 */
-#define LVEQNB_2PiOn_44100 4781 /* Floating point value 0.000142 */
-#define LVEQNB_2PiOn_48000 4392 /* Floating point value 0.000131 */
-#endif
/************************************************************************************/
/* */
/* 50D table for 50 / ( 1 + Gain ) */
/* */
/************************************************************************************/
-#ifdef BUILD_FLOAT
#define LVEQNB_100D_Neg15_dB 5.623413f
#define LVEQNB_100D_Neg14_dB 5.011872f
#define LVEQNB_100D_Neg13_dB 4.466836f
@@ -150,24 +96,5 @@
#define LVEQNB_100D_Neg2_dB 1.258925f
#define LVEQNB_100D_Neg1_dB 1.122018f
#define LVEQNB_100D_0_dB 1.000000f
-#else
-#define LVEQNB_100DSHIFT 5 /* As a power of 2 */
-#define LVEQNB_100D_Neg15_dB 17995 /* Floating point value 5.623413 */
-#define LVEQNB_100D_Neg14_dB 16038 /* Floating point value 5.011872 */
-#define LVEQNB_100D_Neg13_dB 14294 /* Floating point value 4.466836 */
-#define LVEQNB_100D_Neg12_dB 12739 /* Floating point value 3.981072 */
-#define LVEQNB_100D_Neg11_dB 11354 /* Floating point value 3.548134 */
-#define LVEQNB_100D_Neg10_dB 10119 /* Floating point value 3.162278 */
-#define LVEQNB_100D_Neg9_dB 9019 /* Floating point value 2.818383 */
-#define LVEQNB_100D_Neg8_dB 8038 /* Floating point value 2.511886 */
-#define LVEQNB_100D_Neg7_dB 7164 /* Floating point value 2.238721 */
-#define LVEQNB_100D_Neg6_dB 6385 /* Floating point value 1.995262 */
-#define LVEQNB_100D_Neg5_dB 5690 /* Floating point value 1.778279 */
-#define LVEQNB_100D_Neg4_dB 5072 /* Floating point value 1.584893 */
-#define LVEQNB_100D_Neg3_dB 4520 /* Floating point value 1.412538 */
-#define LVEQNB_100D_Neg2_dB 4029 /* Floating point value 1.258925 */
-#define LVEQNB_100D_Neg1_dB 3590 /* Floating point value 1.122018 */
-#define LVEQNB_100D_0_dB 3200 /* Floating point value 1.000000 */
-#endif
#endif
diff --git a/media/libeffects/lvm/lib/Eq/src/LVEQNB_Control.cpp b/media/libeffects/lvm/lib/Eq/src/LVEQNB_Control.cpp
index 7b0f341..6bb4a7e 100644
--- a/media/libeffects/lvm/lib/Eq/src/LVEQNB_Control.cpp
+++ b/media/libeffects/lvm/lib/Eq/src/LVEQNB_Control.cpp
@@ -26,7 +26,6 @@
#include "VectorArithmetic.h"
#include "BIQUAD.h"
-
/****************************************************************************************/
/* */
/* Defines */
@@ -76,7 +75,6 @@
return(LVEQNB_SUCCESS);
}
-
/************************************************************************************/
/* */
/* FUNCTION: LVEQNB_GetCapabilities */
@@ -114,7 +112,6 @@
return(LVEQNB_SUCCESS);
}
-
/************************************************************************************/
/* */
/* FUNCTION: LVEQNB_SetFilters */
@@ -140,18 +137,13 @@
void LVEQNB_SetFilters(LVEQNB_Instance_t *pInstance,
LVEQNB_Params_t *pParams)
{
-#ifdef HIGHER_FS
extern const LVM_UINT32 LVEQNB_SampleRateTab[]; /* Sample rate table */
-#else
- extern const LVM_UINT16 LVEQNB_SampleRateTab[]; /* Sample rate table */
-#endif
LVM_UINT16 i; /* Filter band index */
LVM_UINT32 fs = (LVM_UINT32)LVEQNB_SampleRateTab[(LVM_UINT16)pParams->SampleRate]; /* Sample rate */
LVM_UINT32 fc; /* Filter centre frequency */
LVM_INT16 QFactor; /* Filter Q factor */
-
pInstance->NBands = pParams->NBands;
for (i=0; i<pParams->NBands; i++)
@@ -162,30 +154,7 @@
fc = (LVM_UINT32)pParams->pBandDefinition[i].Frequency; /* Get the band centre frequency */
QFactor = (LVM_INT16)pParams->pBandDefinition[i].QFactor; /* Get the band Q factor */
-#ifdef BUILD_FLOAT
pInstance->pBiquadType[i] = LVEQNB_SinglePrecision_Float; /* Default to single precision */
-#else
- /*
- * For each filter set the type of biquad required
- */
- pInstance->pBiquadType[i] = LVEQNB_SinglePrecision; /* Default to single precision */
-#endif
-#ifndef BUILD_FLOAT
- if ((fc << 15) <= (LOW_FREQ * fs))
- {
- /*
- * fc <= fs/110
- */
- pInstance->pBiquadType[i] = LVEQNB_DoublePrecision;
- }
- else if (((fc << 15) <= (HIGH_FREQ * fs)) && (QFactor > 300))
- {
- /*
- * (fs/110 < fc < fs/85) & (Q>3)
- */
- pInstance->pBiquadType[i] = LVEQNB_DoublePrecision;
- }
-#endif
/*
* Check for out of range frequencies
@@ -195,7 +164,6 @@
pInstance->pBiquadType[i] = LVEQNB_OutOfRange;
}
-
/*
* Copy the filter definition to persistant memory
*/
@@ -204,7 +172,6 @@
}
}
-
/************************************************************************************/
/* */
/* FUNCTION: LVEQNB_SetCoefficients */
@@ -225,7 +192,6 @@
LVM_UINT16 i; /* Filter band index */
LVEQNB_BiquadType_en BiquadType; /* Filter biquad type */
-
/*
* Set the coefficients for each band by the init function
*/
@@ -238,7 +204,6 @@
BiquadType = pInstance->pBiquadType[i];
switch (BiquadType)
{
-#ifdef BUILD_FLOAT
case LVEQNB_SinglePrecision_Float:
{
PK_FLOAT_Coefs_t Coefficients;
@@ -256,47 +221,6 @@
&Coefficients);
break;
}
-#else
- case LVEQNB_DoublePrecision:
- {
- PK_C32_Coefs_t Coefficients;
-
- /*
- * Calculate the double precision coefficients
- */
- LVEQNB_DoublePrecCoefs((LVM_UINT16)pInstance->Params.SampleRate,
- &pInstance->pBandDefinitions[i],
- &Coefficients);
-
- /*
- * Set the coefficients
- */
- PK_2I_D32F32CllGss_TRC_WRA_01_Init(&pInstance->pEQNB_FilterState[i],
- &pInstance->pEQNB_Taps[i],
- &Coefficients);
- break;
- }
-
- case LVEQNB_SinglePrecision:
- {
- PK_C16_Coefs_t Coefficients;
-
- /*
- * Calculate the single precision coefficients
- */
- LVEQNB_SinglePrecCoefs((LVM_UINT16)pInstance->Params.SampleRate,
- &pInstance->pBandDefinitions[i],
- &Coefficients);
-
- /*
- * Set the coefficients
- */
- PK_2I_D32F32CssGss_TRC_WRA_01_Init(&pInstance->pEQNB_FilterState[i],
- &pInstance->pEQNB_Taps[i],
- &Coefficients);
- break;
- }
-#endif
default:
break;
}
@@ -304,7 +228,6 @@
}
-
/************************************************************************************/
/* */
/* FUNCTION: LVEQNB_ClearFilterHistory */
@@ -316,24 +239,6 @@
/* pInstance Pointer to the instance */
/* */
/************************************************************************************/
-#ifndef BUILD_FLOAT
-void LVEQNB_ClearFilterHistory(LVEQNB_Instance_t *pInstance)
-{
- LVM_INT16 *pTapAddress;
- LVM_INT16 NumTaps;
-
-
- pTapAddress = (LVM_INT16 *)pInstance->pEQNB_Taps;
- NumTaps = (LVM_INT16)((pInstance->Capabilities.MaxBands * sizeof(Biquad_2I_Order2_Taps_t))/sizeof(LVM_INT16));
-
- if (NumTaps != 0)
- {
- LoadConst_16(0, /* Clear the history, value 0 */
- pTapAddress, /* Destination */
- NumTaps); /* Number of words */
- }
-}
-#else
void LVEQNB_ClearFilterHistory(LVEQNB_Instance_t *pInstance)
{
LVM_FLOAT *pTapAddress;
@@ -350,7 +255,6 @@
NumTaps); /* Number of words */
}
}
-#endif
/****************************************************************************************/
/* */
/* FUNCTION: LVEQNB_Control */
@@ -404,7 +308,6 @@
LVC_Mixer_VarSlope_SetTimeConstant(&pInstance->BypassMixer.MixerStream[1],LVEQNB_BYPASS_MIXER_TC,(LVM_Fs_en)pParams->SampleRate,2);
}
-
if( (pInstance->Params.NBands != pParams->NBands ) ||
(pInstance->Params.OperatingMode != pParams->OperatingMode ) ||
(pInstance->Params.pBandDefinition != pParams->pBandDefinition ) ||
@@ -429,7 +332,6 @@
}
}
-
// During operating mode transition, there is a race condition where the mode
// is still LVEQNB_ON, but the effect is considered disabled in the upper layers.
// modeChange handles this special race condition.
@@ -453,7 +355,6 @@
*/
pInstance->Params = *pParams;
-
/*
* Reset the filters except if the algo is switched off
*/
@@ -473,13 +374,8 @@
if (modeChange) {
if(pParams->OperatingMode == LVEQNB_ON)
{
-#ifdef BUILD_FLOAT
LVC_Mixer_SetTarget(&pInstance->BypassMixer.MixerStream[0], 1.0f);
LVC_Mixer_SetTarget(&pInstance->BypassMixer.MixerStream[1], 0.0f);
-#else
- LVC_Mixer_SetTarget(&pInstance->BypassMixer.MixerStream[0],LVM_MAXINT_16);
- LVC_Mixer_SetTarget(&pInstance->BypassMixer.MixerStream[1],0);
-#endif
pInstance->BypassMixer.MixerStream[0].CallbackSet = 1;
pInstance->BypassMixer.MixerStream[1].CallbackSet = 1;
}
@@ -489,13 +385,8 @@
// This may introduce a state race condition if the effect is enabled again
// while in transition. This is fixed in the modeChange logic.
pInstance->Params.OperatingMode = LVEQNB_ON;
-#ifdef BUILD_FLOAT
LVC_Mixer_SetTarget(&pInstance->BypassMixer.MixerStream[0], 0.0f);
LVC_Mixer_SetTarget(&pInstance->BypassMixer.MixerStream[1], 1.0f);
-#else
- LVC_Mixer_SetTarget(&pInstance->BypassMixer.MixerStream[0],0);
- LVC_Mixer_SetTarget(&pInstance->BypassMixer.MixerStream[1],LVM_MAXINT_16);
-#endif
pInstance->BypassMixer.MixerStream[0].CallbackSet = 1;
pInstance->BypassMixer.MixerStream[1].CallbackSet = 1;
}
@@ -508,7 +399,6 @@
return(LVEQNB_SUCCESS);
}
-
/****************************************************************************************/
/* */
/* FUNCTION: LVEQNB_BypassMixerCallBack */
@@ -530,13 +420,8 @@
/*
* Send an ALGOFF event if the ON->OFF switch transition is finished
*/
-#ifdef BUILD_FLOAT
if((LVC_Mixer_GetTarget(&pInstance->BypassMixer.MixerStream[0]) == 0) &&
(CallbackParam == 0)){
-#else
- if((LVC_Mixer_GetTarget(&pInstance->BypassMixer.MixerStream[0]) == 0x00000000) &&
- (CallbackParam == 0)){
-#endif
pInstance->Params.OperatingMode = LVEQNB_BYPASS;
if (CallBack != LVM_NULL){
CallBack(pInstance->Capabilities.pBundleInstance, LVM_NULL, ALGORITHM_EQNB_ID|LVEQNB_EVENT_ALGOFF);
diff --git a/media/libeffects/lvm/lib/Eq/src/LVEQNB_Init.cpp b/media/libeffects/lvm/lib/Eq/src/LVEQNB_Init.cpp
index 8e3c627..271a914 100644
--- a/media/libeffects/lvm/lib/Eq/src/LVEQNB_Init.cpp
+++ b/media/libeffects/lvm/lib/Eq/src/LVEQNB_Init.cpp
@@ -15,7 +15,6 @@
* limitations under the License.
*/
-
/****************************************************************************************/
/* */
/* Includes */
@@ -67,13 +66,11 @@
INST_ALLOC AllocMem;
LVEQNB_Instance_t *pInstance = (LVEQNB_Instance_t *)hInstance;
-
if((pMemoryTable == LVM_NULL)|| (pCapabilities == LVM_NULL))
{
return LVEQNB_NULLADDRESS;
}
-
/*
* Fill in the memory table
*/
@@ -91,13 +88,11 @@
pMemoryTable->Region[LVEQNB_MEMREGION_INSTANCE].Type = LVEQNB_PERSISTENT;
pMemoryTable->Region[LVEQNB_MEMREGION_INSTANCE].pBaseAddress = LVM_NULL;
-
/*
* Persistant data memory
*/
InstAlloc_Init(&AllocMem,
LVM_NULL);
-#ifdef BUILD_FLOAT
InstAlloc_AddMember(&AllocMem, /* Low pass filter */
sizeof(Biquad_2I_Order2_FLOAT_Taps_t));
InstAlloc_AddMember(&AllocMem, /* High pass filter */
@@ -111,18 +106,6 @@
/* Biquad types */
InstAlloc_AddMember(&AllocMem,
(pCapabilities->MaxBands * sizeof(LVEQNB_BiquadType_en)));
-#else
- InstAlloc_AddMember(&AllocMem, /* Low pass filter */
- sizeof(Biquad_2I_Order2_Taps_t));
- InstAlloc_AddMember(&AllocMem, /* High pass filter */
- sizeof(Biquad_2I_Order2_Taps_t));
- InstAlloc_AddMember(&AllocMem,
- (pCapabilities->MaxBands * sizeof(Biquad_2I_Order2_Taps_t))); /* Equaliser Biquad Taps */
- InstAlloc_AddMember(&AllocMem,
- (pCapabilities->MaxBands * sizeof(LVEQNB_BandDef_t))); /* Filter definitions */
- InstAlloc_AddMember(&AllocMem,
- (pCapabilities->MaxBands * sizeof(LVEQNB_BiquadType_en))); /* Biquad types */
-#endif
pMemoryTable->Region[LVEQNB_MEMREGION_PERSISTENT_DATA].Size = InstAlloc_GetTotal(&AllocMem);
pMemoryTable->Region[LVEQNB_MEMREGION_PERSISTENT_DATA].Alignment = LVEQNB_DATA_ALIGN;
pMemoryTable->Region[LVEQNB_MEMREGION_PERSISTENT_DATA].Type = LVEQNB_PERSISTENT_DATA;
@@ -133,7 +116,6 @@
*/
InstAlloc_Init(&AllocMem,
LVM_NULL);
-#ifdef BUILD_FLOAT
InstAlloc_AddMember(&AllocMem, /* Low pass filter */
sizeof(Biquad_FLOAT_Instance_t));
InstAlloc_AddMember(&AllocMem, /* High pass filter */
@@ -141,14 +123,6 @@
/* Equaliser Biquad Instance */
InstAlloc_AddMember(&AllocMem,
pCapabilities->MaxBands * sizeof(Biquad_FLOAT_Instance_t));
-#else
- InstAlloc_AddMember(&AllocMem, /* Low pass filter */
- sizeof(Biquad_Instance_t));
- InstAlloc_AddMember(&AllocMem, /* High pass filter */
- sizeof(Biquad_Instance_t));
- InstAlloc_AddMember(&AllocMem,
- pCapabilities->MaxBands * sizeof(Biquad_Instance_t)); /* Equaliser Biquad Instance */
-#endif
pMemoryTable->Region[LVEQNB_MEMREGION_PERSISTENT_COEF].Size = InstAlloc_GetTotal(&AllocMem);
pMemoryTable->Region[LVEQNB_MEMREGION_PERSISTENT_COEF].Alignment = LVEQNB_COEF_ALIGN;
pMemoryTable->Region[LVEQNB_MEMREGION_PERSISTENT_COEF].Type = LVEQNB_PERSISTENT_COEF;
@@ -159,14 +133,9 @@
*/
InstAlloc_Init(&AllocMem,
LVM_NULL);
-#ifdef BUILD_FLOAT
InstAlloc_AddMember(&AllocMem, /* Low pass filter */
LVEQNB_SCRATCHBUFFERS * sizeof(LVM_FLOAT) * \
pCapabilities->MaxBlockSize);
-#else
- InstAlloc_AddMember(&AllocMem, /* Low pass filter */
- LVEQNB_SCRATCHBUFFERS*sizeof(LVM_INT16)*pCapabilities->MaxBlockSize);
-#endif
pMemoryTable->Region[LVEQNB_MEMREGION_SCRATCH].Size = InstAlloc_GetTotal(&AllocMem);
pMemoryTable->Region[LVEQNB_MEMREGION_SCRATCH].Alignment = LVEQNB_SCRATCH_ALIGN;
pMemoryTable->Region[LVEQNB_MEMREGION_SCRATCH].Type = LVEQNB_SCRATCH;
@@ -181,7 +150,6 @@
return(LVEQNB_SUCCESS);
}
-
/****************************************************************************************/
/* */
/* FUNCTION: LVEQNB_Init */
@@ -260,14 +228,11 @@
}
pInstance =(LVEQNB_Instance_t *)*phInstance;
-
-
/*
* Save the memory table in the instance structure
*/
pInstance->Capabilities = *pCapabilities;
-
/*
* Save the memory table in the instance structure and
* set the structure pointers
@@ -280,17 +245,10 @@
InstAlloc_Init(&AllocMem,
pMemoryTable->Region[LVEQNB_MEMREGION_PERSISTENT_COEF].pBaseAddress);
-#ifdef BUILD_FLOAT
/* Equaliser Biquad Instance */
pInstance->pEQNB_FilterState_Float = (Biquad_FLOAT_Instance_t *)
InstAlloc_AddMember(&AllocMem, pCapabilities->MaxBands * \
sizeof(Biquad_FLOAT_Instance_t));
-#else
- pInstance->pEQNB_FilterState = InstAlloc_AddMember(&AllocMem,
- pCapabilities->MaxBands * sizeof(Biquad_Instance_t)); /* Equaliser Biquad Instance */
-#endif
-
-
/*
* Allocate data memory
@@ -298,15 +256,9 @@
InstAlloc_Init(&AllocMem,
pMemoryTable->Region[LVEQNB_MEMREGION_PERSISTENT_DATA].pBaseAddress);
-#ifdef BUILD_FLOAT
MemSize = (pCapabilities->MaxBands * sizeof(Biquad_2I_Order2_FLOAT_Taps_t));
pInstance->pEQNB_Taps_Float = (Biquad_2I_Order2_FLOAT_Taps_t *)InstAlloc_AddMember(&AllocMem,
MemSize);
-#else
- MemSize = (pCapabilities->MaxBands * sizeof(Biquad_2I_Order2_Taps_t));
- pInstance->pEQNB_Taps = (Biquad_2I_Order2_Taps_t *)InstAlloc_AddMember(&AllocMem,
- MemSize);
-#endif
MemSize = (pCapabilities->MaxBands * sizeof(LVEQNB_BandDef_t));
pInstance->pBandDefinitions = (LVEQNB_BandDef_t *)InstAlloc_AddMember(&AllocMem,
MemSize);
@@ -317,20 +269,14 @@
pInstance->pBiquadType = (LVEQNB_BiquadType_en *)InstAlloc_AddMember(&AllocMem,
MemSize);
-
/*
* Internally map, structure and allign scratch memory
*/
InstAlloc_Init(&AllocMem,
pMemoryTable->Region[LVEQNB_MEMREGION_SCRATCH].pBaseAddress);
-#ifdef BUILD_FLOAT
pInstance->pFastTemporary = (LVM_FLOAT *)InstAlloc_AddMember(&AllocMem,
sizeof(LVM_FLOAT));
-#else
- pInstance->pFastTemporary = (LVM_INT16 *)InstAlloc_AddMember(&AllocMem,
- sizeof(LVM_INT16));
-#endif
/*
* Update the instance parameters
@@ -362,18 +308,12 @@
LVC_Mixer_Init(&pInstance->BypassMixer.MixerStream[0],0,0);
LVC_Mixer_SetTimeConstant(&pInstance->BypassMixer.MixerStream[0],0,LVM_FS_8000,2);
-
pInstance->BypassMixer.MixerStream[1].CallbackSet = 1;
pInstance->BypassMixer.MixerStream[1].CallbackParam = 0;
pInstance->BypassMixer.MixerStream[1].pCallbackHandle = LVM_NULL;
pInstance->BypassMixer.MixerStream[1].pCallBack = LVM_NULL;
-#ifdef BUILD_FLOAT
LVC_Mixer_Init(&pInstance->BypassMixer.MixerStream[1], 0, 1.0f);
LVC_Mixer_SetTimeConstant(&pInstance->BypassMixer.MixerStream[1], 0, LVM_FS_8000, 2);
-#else
- LVC_Mixer_Init(&pInstance->BypassMixer.MixerStream[1],0,LVM_MAXINT_16);
- LVC_Mixer_SetTimeConstant(&pInstance->BypassMixer.MixerStream[1],0,LVM_FS_8000,2);
-#endif
pInstance->bInOperatingModeTransition = LVM_FALSE;
diff --git a/media/libeffects/lvm/lib/Eq/src/LVEQNB_Private.h b/media/libeffects/lvm/lib/Eq/src/LVEQNB_Private.h
index 4f70eec..40facfb 100644
--- a/media/libeffects/lvm/lib/Eq/src/LVEQNB_Private.h
+++ b/media/libeffects/lvm/lib/Eq/src/LVEQNB_Private.h
@@ -18,8 +18,6 @@
#ifndef __LVEQNB_PRIVATE_H__
#define __LVEQNB_PRIVATE_H__
-
-
/****************************************************************************************/
/* */
/* Includes */
@@ -62,24 +60,19 @@
/* Filter biquad types */
typedef enum
{
-#ifdef BUILD_FLOAT
LVEQNB_SinglePrecision_Float = -1,
-#endif
LVEQNB_SinglePrecision = 0,
LVEQNB_DoublePrecision = 1,
LVEQNB_OutOfRange = 2,
LVEQNB_BIQUADTYPE_MAX = LVM_MAXINT_32
} LVEQNB_BiquadType_en;
-
/****************************************************************************************/
/* */
/* Structures */
/* */
/****************************************************************************************/
-
-
/* Instance structure */
typedef struct
{
@@ -89,20 +82,10 @@
LVEQNB_Capabilities_t Capabilities; /* Instance capabilities */
/* Aligned memory pointers */
-#ifdef BUILD_FLOAT
LVM_FLOAT *pFastTemporary; /* Fast temporary data base address */
-#else
- LVM_INT16 *pFastTemporary; /* Fast temporary data base address */
-#endif
-#ifdef BUILD_FLOAT
Biquad_2I_Order2_FLOAT_Taps_t *pEQNB_Taps_Float; /* Equaliser Taps */
Biquad_FLOAT_Instance_t *pEQNB_FilterState_Float; /* State for each filter band */
-#else
- /* Process variables */
- Biquad_2I_Order2_Taps_t *pEQNB_Taps; /* Equaliser Taps */
- Biquad_Instance_t *pEQNB_FilterState; /* State for each filter band */
-#endif
/* Filter definitions and call back */
LVM_UINT16 NBands; /* Number of bands */
@@ -110,17 +93,12 @@
LVEQNB_BiquadType_en *pBiquadType; /* Filter biquad types */
/* Bypass variable */
-#ifdef BUILD_FLOAT
LVMixer3_2St_FLOAT_st BypassMixer;
-#else
- LVMixer3_2St_st BypassMixer; /* Bypass mixer used in transitions */
-#endif
LVM_INT16 bInOperatingModeTransition; /* Operating mode transition flag */
} LVEQNB_Instance_t;
-
/****************************************************************************************/
/* */
/* Function prototypes */
@@ -133,22 +111,11 @@
void LVEQNB_SetCoefficients(LVEQNB_Instance_t *pInstance);
void LVEQNB_ClearFilterHistory(LVEQNB_Instance_t *pInstance);
-#ifdef BUILD_FLOAT
LVEQNB_ReturnStatus_en LVEQNB_SinglePrecCoefs(LVM_UINT16 Fs,
LVEQNB_BandDef_t *pFilterDefinition,
PK_FLOAT_Coefs_t *pCoefficients);
-#else
-LVEQNB_ReturnStatus_en LVEQNB_SinglePrecCoefs(LVM_UINT16 Fs,
- LVEQNB_BandDef_t *pFilterDefinition,
- PK_C16_Coefs_t *pCoefficients);
-
-LVEQNB_ReturnStatus_en LVEQNB_DoublePrecCoefs(LVM_UINT16 Fs,
- LVEQNB_BandDef_t *pFilterDefinition,
- PK_C32_Coefs_t *pCoefficients);
-#endif
LVM_INT32 LVEQNB_BypassMixerCallBack (void* hInstance, void *pGeneralPurpose, LVM_INT16 CallbackParam);
-
#endif /* __LVEQNB_PRIVATE_H__ */
diff --git a/media/libeffects/lvm/lib/Eq/src/LVEQNB_Process.cpp b/media/libeffects/lvm/lib/Eq/src/LVEQNB_Process.cpp
index d188c0e..65eff53 100644
--- a/media/libeffects/lvm/lib/Eq/src/LVEQNB_Process.cpp
+++ b/media/libeffects/lvm/lib/Eq/src/LVEQNB_Process.cpp
@@ -58,7 +58,6 @@
/* NOTES: */
/* */
/****************************************************************************************/
-#ifdef BUILD_FLOAT
LVEQNB_ReturnStatus_en LVEQNB_Process(LVEQNB_Handle_t hInstance,
const LVM_FLOAT *pInData,
LVM_FLOAT *pOutData,
@@ -123,7 +122,6 @@
*/
Biquad_FLOAT_Instance_t *pBiquad = &pInstance->pEQNB_FilterState_Float[i];
-
/*
* Select single or double precision as required
*/
@@ -152,7 +150,6 @@
}
}
-
if(pInstance->bInOperatingModeTransition == LVM_TRUE){
#ifdef SUPPORT_MC
LVC_MixSoft_2Mc_D16C31_SAT(&pInstance->BypassMixer,
@@ -194,145 +191,3 @@
return LVEQNB_SUCCESS;
}
-#else
-LVEQNB_ReturnStatus_en LVEQNB_Process(LVEQNB_Handle_t hInstance,
- const LVM_INT16 *pInData,
- LVM_INT16 *pOutData,
- LVM_UINT16 NumSamples)
-{
-
- LVM_UINT16 i;
- Biquad_Instance_t *pBiquad;
- LVEQNB_Instance_t *pInstance = (LVEQNB_Instance_t *)hInstance;
- LVM_INT32 *pScratch;
-
-
- /* Check for NULL pointers */
- if((hInstance == LVM_NULL) || (pInData == LVM_NULL) || (pOutData == LVM_NULL))
- {
- return LVEQNB_NULLADDRESS;
- }
-
- /* Check if the input and output data buffers are 32-bit aligned */
- if ((((uintptr_t)pInData % 4) != 0) || (((uintptr_t)pOutData % 4) != 0))
- {
- return LVEQNB_ALIGNMENTERROR;
- }
-
- pScratch = (LVM_INT32 *)pInstance->pFastTemporary;
-
- /*
- * Check the number of samples is not too large
- */
- if (NumSamples > pInstance->Capabilities.MaxBlockSize)
- {
- return(LVEQNB_TOOMANYSAMPLES);
- }
-
- if (pInstance->Params.OperatingMode == LVEQNB_ON)
- {
- /*
- * Convert from 16-bit to 32-bit
- */
- Int16LShiftToInt32_16x32((LVM_INT16 *)pInData, /* Source */
- pScratch, /* Destination */
- (LVM_INT16)(2*NumSamples), /* Left and Right */
- SHIFT); /* Scaling shift */
-
- /*
- * For each section execte the filter unless the gain is 0dB
- */
- if (pInstance->NBands != 0)
- {
- for (i=0; i<pInstance->NBands; i++)
- {
- /*
- * Check if band is non-zero dB gain
- */
- if (pInstance->pBandDefinitions[i].Gain != 0)
- {
- /*
- * Get the address of the biquad instance
- */
- pBiquad = &pInstance->pEQNB_FilterState[i];
-
-
- /*
- * Select single or double precision as required
- */
- switch (pInstance->pBiquadType[i])
- {
- case LVEQNB_SinglePrecision:
- {
- PK_2I_D32F32C14G11_TRC_WRA_01(pBiquad,
- (LVM_INT32 *)pScratch,
- (LVM_INT32 *)pScratch,
- (LVM_INT16)NumSamples);
- break;
- }
-
- case LVEQNB_DoublePrecision:
- {
- PK_2I_D32F32C30G11_TRC_WRA_01(pBiquad,
- (LVM_INT32 *)pScratch,
- (LVM_INT32 *)pScratch,
- (LVM_INT16)NumSamples);
- break;
- }
- default:
- break;
- }
- }
- }
- }
-
-
- if(pInstance->bInOperatingModeTransition == LVM_TRUE){
- /*
- * Convert from 32-bit to 16- bit and saturate
- */
- Int32RShiftToInt16_Sat_32x16(pScratch, /* Source */
- (LVM_INT16 *)pScratch, /* Destination */
- (LVM_INT16)(2*NumSamples), /* Left and Right */
- SHIFT); /* Scaling shift */
-
- LVC_MixSoft_2St_D16C31_SAT(&pInstance->BypassMixer,
- (LVM_INT16 *)pScratch,
- (LVM_INT16 *)pInData,
- (LVM_INT16 *)pScratch,
- (LVM_INT16)(2*NumSamples));
-
- Copy_16((LVM_INT16*)pScratch, /* Source */
- pOutData, /* Destination */
- (LVM_INT16)(2*NumSamples)); /* Left and Right samples */
- }
- else{
-
- /*
- * Convert from 32-bit to 16- bit and saturate
- */
- Int32RShiftToInt16_Sat_32x16(pScratch, /* Source */
- pOutData, /* Destination */
- (LVM_INT16 )(2*NumSamples), /* Left and Right */
- SHIFT); /* Scaling shift */
- }
- }
- else
- {
- /*
- * Mode is OFF so copy the data if necessary
- */
- if (pInData != pOutData)
- {
- Copy_16(pInData, /* Source */
- pOutData, /* Destination */
- (LVM_INT16)(2*NumSamples)); /* Left and Right samples */
- }
- }
-
-
-
- return(LVEQNB_SUCCESS);
-
-}
-#endif
diff --git a/media/libeffects/lvm/lib/Eq/src/LVEQNB_Tables.cpp b/media/libeffects/lvm/lib/Eq/src/LVEQNB_Tables.cpp
index d3d4ba0..0628114 100644
--- a/media/libeffects/lvm/lib/Eq/src/LVEQNB_Tables.cpp
+++ b/media/libeffects/lvm/lib/Eq/src/LVEQNB_Tables.cpp
@@ -15,7 +15,6 @@
* limitations under the License.
*/
-
/************************************************************************************/
/* */
/* Includes */
@@ -26,7 +25,6 @@
#include "LVEQNB_Coeffs.h"
#include "LVEQNB_Tables.h"
-
/************************************************************************************/
/* */
/* Sample rate table */
@@ -37,7 +35,6 @@
* Sample rate table for converting between the enumerated type and the actual
* frequency
*/
-#if defined(BUILD_FLOAT) && defined(HIGHER_FS)
const LVM_UINT32 LVEQNB_SampleRateTab[] = {8000, /* 8kS/s */
11025,
12000,
@@ -52,18 +49,6 @@
176400,
192000
};
-#else
-const LVM_UINT16 LVEQNB_SampleRateTab[] = {8000, /* 8kS/s */
- 11025,
- 12000,
- 16000,
- 22050,
- 24000,
- 32000,
- 44100,
- 48000
-};
-#endif
/************************************************************************************/
/* */
@@ -74,7 +59,6 @@
/*
* Table for 2 * Pi / Fs
*/
-#ifdef BUILD_FLOAT
const LVM_FLOAT LVEQNB_TwoPiOnFsTable[] = {LVEQNB_2PiOn_8000, /* 8kS/s */
LVEQNB_2PiOn_11025,
LVEQNB_2PiOn_12000,
@@ -84,29 +68,15 @@
LVEQNB_2PiOn_32000,
LVEQNB_2PiOn_44100,
LVEQNB_2PiOn_48000
-#ifdef HIGHER_FS
,LVEQNB_2PiOn_88200
,LVEQNB_2PiOn_96000
,LVEQNB_2PiOn_176400
,LVEQNB_2PiOn_192000
-#endif
};
-#else
-const LVM_INT16 LVEQNB_TwoPiOnFsTable[] = {LVEQNB_2PiOn_8000, /* 8kS/s */
- LVEQNB_2PiOn_11025,
- LVEQNB_2PiOn_12000,
- LVEQNB_2PiOn_16000,
- LVEQNB_2PiOn_22050,
- LVEQNB_2PiOn_24000,
- LVEQNB_2PiOn_32000,
- LVEQNB_2PiOn_44100,
- LVEQNB_2PiOn_48000}; /* 48kS/s */
-#endif
/*
* Gain table
*/
-#ifdef BUILD_FLOAT
const LVM_FLOAT LVEQNB_GainTable[] = {LVEQNB_Gain_Neg15_dB, /* -15dB gain */
LVEQNB_Gain_Neg14_dB,
LVEQNB_Gain_Neg13_dB,
@@ -138,44 +108,9 @@
LVEQNB_Gain_13_dB,
LVEQNB_Gain_14_dB,
LVEQNB_Gain_15_dB}; /* +15dB gain */
-#else
-const LVM_INT16 LVEQNB_GainTable[] = {LVEQNB_Gain_Neg15_dB, /* -15dB gain */
- LVEQNB_Gain_Neg14_dB,
- LVEQNB_Gain_Neg13_dB,
- LVEQNB_Gain_Neg12_dB,
- LVEQNB_Gain_Neg11_dB,
- LVEQNB_Gain_Neg10_dB,
- LVEQNB_Gain_Neg9_dB,
- LVEQNB_Gain_Neg8_dB,
- LVEQNB_Gain_Neg7_dB,
- LVEQNB_Gain_Neg6_dB,
- LVEQNB_Gain_Neg5_dB,
- LVEQNB_Gain_Neg4_dB,
- LVEQNB_Gain_Neg3_dB,
- LVEQNB_Gain_Neg2_dB,
- LVEQNB_Gain_Neg1_dB,
- LVEQNB_Gain_0_dB, /* 0dB gain */
- LVEQNB_Gain_1_dB,
- LVEQNB_Gain_2_dB,
- LVEQNB_Gain_3_dB,
- LVEQNB_Gain_4_dB,
- LVEQNB_Gain_5_dB,
- LVEQNB_Gain_6_dB,
- LVEQNB_Gain_7_dB,
- LVEQNB_Gain_8_dB,
- LVEQNB_Gain_9_dB,
- LVEQNB_Gain_10_dB,
- LVEQNB_Gain_11_dB,
- LVEQNB_Gain_12_dB,
- LVEQNB_Gain_13_dB,
- LVEQNB_Gain_14_dB,
- LVEQNB_Gain_15_dB}; /* +15dB gain */
-
-#endif
/*
* D table for 100 / (Gain + 1)
*/
-#ifdef BUILD_FLOAT
const LVM_FLOAT LVEQNB_DTable[] = {LVEQNB_100D_Neg15_dB, /* -15dB gain */
LVEQNB_100D_Neg14_dB,
LVEQNB_100D_Neg13_dB,
@@ -192,25 +127,6 @@
LVEQNB_100D_Neg2_dB,
LVEQNB_100D_Neg1_dB,
LVEQNB_100D_0_dB}; /* 0dB gain */
-#else
-const LVM_INT16 LVEQNB_DTable[] = {LVEQNB_100D_Neg15_dB, /* -15dB gain */
- LVEQNB_100D_Neg14_dB,
- LVEQNB_100D_Neg13_dB,
- LVEQNB_100D_Neg12_dB,
- LVEQNB_100D_Neg11_dB,
- LVEQNB_100D_Neg10_dB,
- LVEQNB_100D_Neg9_dB,
- LVEQNB_100D_Neg8_dB,
- LVEQNB_100D_Neg7_dB,
- LVEQNB_100D_Neg6_dB,
- LVEQNB_100D_Neg5_dB,
- LVEQNB_100D_Neg4_dB,
- LVEQNB_100D_Neg3_dB,
- LVEQNB_100D_Neg2_dB,
- LVEQNB_100D_Neg1_dB,
- LVEQNB_100D_0_dB}; /* 0dB gain */
-
-#endif
/************************************************************************************/
/* */
/* Filter polynomial coefficients */
@@ -254,4 +170,3 @@
16586, /* a2 */
-44}; /* a3 */
-
diff --git a/media/libeffects/lvm/lib/Eq/src/LVEQNB_Tables.h b/media/libeffects/lvm/lib/Eq/src/LVEQNB_Tables.h
index dc3fbb6..a71eeb9 100644
--- a/media/libeffects/lvm/lib/Eq/src/LVEQNB_Tables.h
+++ b/media/libeffects/lvm/lib/Eq/src/LVEQNB_Tables.h
@@ -27,11 +27,7 @@
* Sample rate table for converting between the enumerated type and the actual
* frequency
*/
-#ifdef HIGHER_FS
extern const LVM_UINT32 LVEQNB_SampleRateTab[];
-#else
-extern const LVM_UINT16 LVEQNB_SampleRateTab[];
-#endif
/************************************************************************************/
/* */
diff --git a/media/libeffects/lvm/lib/Reverb/lib/LVREV.h b/media/libeffects/lvm/lib/Reverb/lib/LVREV.h
index 4f052b1..8c91ea9 100644
--- a/media/libeffects/lvm/lib/Reverb/lib/LVREV.h
+++ b/media/libeffects/lvm/lib/Reverb/lib/LVREV.h
@@ -28,8 +28,6 @@
#ifndef __LVREV_H__
#define __LVREV_H__
-
-
/****************************************************************************************/
/* */
/* Includes */
@@ -37,7 +35,6 @@
/****************************************************************************************/
#include "LVM_Types.h"
-
/****************************************************************************************/
/* */
/* Definitions */
@@ -50,7 +47,6 @@
/* Memory table*/
#define LVREV_NR_MEMORY_REGIONS 4 /* Number of memory regions */
-
/****************************************************************************************/
/* */
/* Types */
@@ -59,7 +55,6 @@
/* Instance handle */
typedef void *LVREV_Handle_t;
-
/* Status return values */
typedef enum
{
@@ -70,7 +65,6 @@
LVREV_RETURNSTATUS_DUMMY = LVM_MAXENUM
} LVREV_ReturnStatus_en;
-
/* Reverb delay lines */
typedef enum
{
@@ -80,7 +74,6 @@
LVREV_DELAYLINES_DUMMY = LVM_MAXENUM
} LVREV_NumDelayLines_en;
-
/****************************************************************************************/
/* */
/* Structures */
@@ -93,7 +86,6 @@
LVM_MemoryRegion_st Region[LVREV_NR_MEMORY_REGIONS]; /* One definition for each region */
} LVREV_MemoryTable_st;
-
/* Control Parameter structure */
typedef struct
{
@@ -104,13 +96,8 @@
/* Parameters for REV */
LVM_UINT16 Level; /* Level, 0 to 100 representing percentage of reverb */
-#ifndef HIGHER_FS
- LVM_UINT16 LPF; /* Low pass filter, in Hz */
- LVM_UINT16 HPF; /* High pass filter, in Hz */
-#else
LVM_UINT32 LPF; /* Low pass filter, in Hz */
LVM_UINT32 HPF; /* High pass filter, in Hz */
-#endif
LVM_UINT16 T60; /* Decay time constant, in ms */
LVM_UINT16 Density; /* Echo density, 0 to 100 for minimum to maximum density */
@@ -119,7 +106,6 @@
} LVREV_ControlParams_st;
-
/* Instance Parameter structure */
typedef struct
{
@@ -132,7 +118,6 @@
} LVREV_InstanceParams_st;
-
/****************************************************************************************/
/* */
/* Function Prototypes */
@@ -179,7 +164,6 @@
LVREV_MemoryTable_st *pMemoryTable,
LVREV_InstanceParams_st *pInstanceParams);
-
/****************************************************************************************/
/* */
/* FUNCTION: LVREV_GetInstanceHandle */
@@ -210,7 +194,6 @@
LVREV_MemoryTable_st *pMemoryTable,
LVREV_InstanceParams_st *pInstanceParams);
-
/****************************************************************************************/
/* */
/* FUNCTION: LVXX_GetControlParameters */
@@ -234,7 +217,6 @@
LVREV_ReturnStatus_en LVREV_GetControlParameters(LVREV_Handle_t hInstance,
LVREV_ControlParams_st *pControlParams);
-
/****************************************************************************************/
/* */
/* FUNCTION: LVREV_SetControlParameters */
@@ -257,7 +239,6 @@
LVREV_ReturnStatus_en LVREV_SetControlParameters(LVREV_Handle_t hInstance,
LVREV_ControlParams_st *pNewParams);
-
/****************************************************************************************/
/* */
/* FUNCTION: LVREV_ClearAudioBuffers */
@@ -278,7 +259,6 @@
/****************************************************************************************/
LVREV_ReturnStatus_en LVREV_ClearAudioBuffers(LVREV_Handle_t hInstance);
-
/****************************************************************************************/
/* */
/* FUNCTION: LVREV_Process */
@@ -300,18 +280,10 @@
/* 1. The input and output buffers must be 32-bit aligned */
/* */
/****************************************************************************************/
-#ifdef BUILD_FLOAT
LVREV_ReturnStatus_en LVREV_Process(LVREV_Handle_t hInstance,
const LVM_FLOAT *pInData,
LVM_FLOAT *pOutData,
const LVM_UINT16 NumSamples);
-#else
-LVREV_ReturnStatus_en LVREV_Process(LVREV_Handle_t hInstance,
- const LVM_INT32 *pInData,
- LVM_INT32 *pOutData,
- const LVM_UINT16 NumSamples);
-#endif
-
#endif /* __LVREV_H__ */
diff --git a/media/libeffects/lvm/lib/Reverb/src/LVREV_ApplyNewSettings.cpp b/media/libeffects/lvm/lib/Reverb/src/LVREV_ApplyNewSettings.cpp
index 2c46baa..1f0d39b 100644
--- a/media/libeffects/lvm/lib/Reverb/src/LVREV_ApplyNewSettings.cpp
+++ b/media/libeffects/lvm/lib/Reverb/src/LVREV_ApplyNewSettings.cpp
@@ -41,567 +41,12 @@
/* */
/****************************************************************************************/
-#ifndef BUILD_FLOAT
LVREV_ReturnStatus_en LVREV_ApplyNewSettings (LVREV_Instance_st *pPrivate)
{
LVM_Mode_en OperatingMode;
LVM_INT32 NumberOfDelayLines;
-
- /* Check for NULL pointer */
- if(pPrivate == LVM_NULL)
- {
- return LVREV_NULLADDRESS;
- }
-
- OperatingMode = pPrivate->NewParams.OperatingMode;
-
- if(pPrivate->InstanceParams.NumDelays == LVREV_DELAYLINES_4)
- {
- NumberOfDelayLines = 4;
- }
- else if(pPrivate->InstanceParams.NumDelays == LVREV_DELAYLINES_2)
- {
- NumberOfDelayLines = 2;
- }
- else
- {
- NumberOfDelayLines = 1;
- }
-
- /*
- * Update the high pass filter coefficients
- */
- if((pPrivate->NewParams.HPF != pPrivate->CurrentParams.HPF) ||
- (pPrivate->NewParams.SampleRate != pPrivate->CurrentParams.SampleRate) ||
- (pPrivate->bFirstControl == LVM_TRUE))
- {
- LVM_INT32 Omega;
- FO_C32_Coefs_t Coeffs;
-
- Omega = LVM_GetOmega(pPrivate->NewParams.HPF, pPrivate->NewParams.SampleRate);
- LVM_FO_HPF(Omega, &Coeffs);
- FO_1I_D32F32Cll_TRC_WRA_01_Init( &pPrivate->pFastCoef->HPCoefs, &pPrivate->pFastData->HPTaps, &Coeffs);
- LoadConst_32(0,
- (void *)&pPrivate->pFastData->HPTaps, /* Destination Cast to void: no dereferencing in function*/
- sizeof(Biquad_1I_Order1_Taps_t)/sizeof(LVM_INT32));
- }
-
-
- /*
- * Update the low pass filter coefficients
- */
- if((pPrivate->NewParams.LPF != pPrivate->CurrentParams.LPF) ||
- (pPrivate->NewParams.SampleRate != pPrivate->CurrentParams.SampleRate) ||
- (pPrivate->bFirstControl == LVM_TRUE))
- {
- LVM_INT32 Omega;
- FO_C32_Coefs_t Coeffs;
-
-
- Coeffs.A0 = 0x7FFFFFFF;
- Coeffs.A1 = 0;
- Coeffs.B1 = 0;
- if(pPrivate->NewParams.LPF <= (LVM_FsTable[pPrivate->NewParams.SampleRate] >> 1))
- {
- Omega = LVM_GetOmega(pPrivate->NewParams.LPF, pPrivate->NewParams.SampleRate);
-
- /*
- * Do not apply filter if w =2*pi*fc/fs >= 2.9
- */
- if(Omega<=LVREV_2_9_INQ29)
- {
- LVM_FO_LPF(Omega, &Coeffs);
- }
- }
- FO_1I_D32F32Cll_TRC_WRA_01_Init( &pPrivate->pFastCoef->LPCoefs, &pPrivate->pFastData->LPTaps, &Coeffs);
- LoadConst_32(0,
- (void *)&pPrivate->pFastData->LPTaps, /* Destination Cast to void: no dereferencing in function*/
- sizeof(Biquad_1I_Order1_Taps_t)/sizeof(LVM_INT32));
- }
-
-
- /*
- * Calculate the room size parameter
- */
- if( pPrivate->NewParams.RoomSize != pPrivate->CurrentParams.RoomSize)
- {
- /* Room size range is 10ms to 200ms
- * 0% -- 10ms
- * 50% -- 65ms
- * 100% -- 120ms
- */
- pPrivate->RoomSizeInms = 10 + (((pPrivate->NewParams.RoomSize*11) + 5)/10);
- }
-
-
- /*
- * Update the T delay number of samples and the all pass delay number of samples
- */
- if( (pPrivate->NewParams.RoomSize != pPrivate->CurrentParams.RoomSize) ||
- (pPrivate->NewParams.SampleRate != pPrivate->CurrentParams.SampleRate) ||
- (pPrivate->bFirstControl == LVM_TRUE))
- {
-
- LVM_UINT32 Temp;
- LVM_INT32 APDelaySize;
- LVM_INT32 Fs = LVM_GetFsFromTable(pPrivate->NewParams.SampleRate);
- LVM_UINT32 DelayLengthSamples = (LVM_UINT32)(Fs * pPrivate->RoomSizeInms);
- LVM_INT16 i;
- LVM_INT16 ScaleTable[] = {LVREV_T_3_Power_minus0_on_4, LVREV_T_3_Power_minus1_on_4, LVREV_T_3_Power_minus2_on_4, LVREV_T_3_Power_minus3_on_4};
- LVM_INT16 MaxT_Delay[] = {LVREV_MAX_T0_DELAY, LVREV_MAX_T1_DELAY, LVREV_MAX_T2_DELAY, LVREV_MAX_T3_DELAY};
- LVM_INT16 MaxAP_Delay[] = {LVREV_MAX_AP0_DELAY, LVREV_MAX_AP1_DELAY, LVREV_MAX_AP2_DELAY, LVREV_MAX_AP3_DELAY};
-
-
- /*
- * For each delay line
- */
- for (i=0; i<NumberOfDelayLines; i++)
- {
- if (i != 0)
- {
- LVM_INT32 Temp1; /* to avoid QAC warning on type conversion */
- LVM_INT32 Temp2; /* to avoid QAC warning on type conversion */
-
- Temp2=(LVM_INT32)DelayLengthSamples;
- MUL32x16INTO32(Temp2, ScaleTable[i], Temp1, 15)
- Temp=(LVM_UINT32)Temp1;
- }
- else
- {
- Temp = DelayLengthSamples;
- }
- APDelaySize = Temp / 1500;
-
-
- /*
- * Set the fixed delay
- */
- Temp = (MaxT_Delay[i] - MaxAP_Delay[i]) * Fs / 48000;
- pPrivate->Delay_AP[i] = pPrivate->T[i] - Temp;
-
-
- /*
- * Set the tap selection
- */
- if (pPrivate->AB_Selection)
- {
- /* Smooth from tap A to tap B */
- pPrivate->pOffsetB[i] = &pPrivate->pDelay_T[i][pPrivate->T[i] - Temp - APDelaySize];
- pPrivate->B_DelaySize[i] = APDelaySize;
- pPrivate->Mixer_APTaps[i].Target1 = 0;
- pPrivate->Mixer_APTaps[i].Target2 = 0x7fffffff;
- }
- else
- {
- /* Smooth from tap B to tap A */
- pPrivate->pOffsetA[i] = &pPrivate->pDelay_T[i][pPrivate->T[i] - Temp - APDelaySize];
- pPrivate->A_DelaySize[i] = APDelaySize;
- pPrivate->Mixer_APTaps[i].Target2 = 0;
- pPrivate->Mixer_APTaps[i].Target1 = 0x7fffffff;
- }
-
- /*
- * Set the maximum block size to the smallest delay size
- */
- pPrivate->MaxBlkLen = Temp;
- if (pPrivate->MaxBlkLen > pPrivate->A_DelaySize[i])
- {
- pPrivate->MaxBlkLen = pPrivate->A_DelaySize[i];
- }
- if (pPrivate->MaxBlkLen > pPrivate->B_DelaySize[i])
- {
- pPrivate->MaxBlkLen = pPrivate->B_DelaySize[i];
- }
- }
- if (pPrivate->AB_Selection)
- {
- pPrivate->AB_Selection = 0;
- }
- else
- {
- pPrivate->AB_Selection = 1;
- }
-
-
- /*
- * Limit the maximum block length
- */
- pPrivate->MaxBlkLen=pPrivate->MaxBlkLen-2; /* Just as a precausion, but no problem if we remove this line */
- if(pPrivate->MaxBlkLen > pPrivate->InstanceParams.MaxBlockSize)
- {
- pPrivate->MaxBlkLen = (LVM_INT32)pPrivate->InstanceParams.MaxBlockSize;
- }
- }
-
-
- /*
- * Update the low pass filter coefficient
- */
- if( (pPrivate->NewParams.Damping != pPrivate->CurrentParams.Damping) ||
- (pPrivate->NewParams.SampleRate != pPrivate->CurrentParams.SampleRate) ||
- (pPrivate->bFirstControl == LVM_TRUE))
- {
-
- LVM_INT32 Temp;
- LVM_INT32 Omega;
- FO_C32_Coefs_t Coeffs;
- LVM_INT16 i;
- LVM_INT16 Damping = (LVM_INT16)((pPrivate->NewParams.Damping * 100) + 1000);
- LVM_INT32 ScaleTable[] = {LVREV_T_3_Power_0_on_4, LVREV_T_3_Power_1_on_4, LVREV_T_3_Power_2_on_4, LVREV_T_3_Power_3_on_4};
-
-
- /*
- * For each filter
- */
- for (i=0; i<NumberOfDelayLines; i++)
- {
- if (i != 0)
- {
- MUL32x16INTO32(ScaleTable[i], Damping, Temp, 15)
- }
- else
- {
- Temp = Damping;
- }
- if(Temp <= (LVM_FsTable[pPrivate->NewParams.SampleRate] >> 1))
- {
- Omega = LVM_GetOmega((LVM_UINT16)Temp, pPrivate->NewParams.SampleRate);
- LVM_FO_LPF(Omega, &Coeffs);
- }
- else
- {
- Coeffs.A0 = 0x7FF00000;
- Coeffs.A1 = 0;
- Coeffs.B1 = 0;
- }
- FO_1I_D32F32Cll_TRC_WRA_01_Init(&pPrivate->pFastCoef->RevLPCoefs[i], &pPrivate->pFastData->RevLPTaps[i], &Coeffs);
- }
- }
-
-
- /*
- * Update All-pass filter mixer time constants
- */
- if( (pPrivate->NewParams.RoomSize != pPrivate->CurrentParams.RoomSize) ||
- (pPrivate->NewParams.SampleRate != pPrivate->CurrentParams.SampleRate) ||
- (pPrivate->NewParams.Density != pPrivate->CurrentParams.Density))
- {
- LVM_INT16 i;
- LVM_INT32 Alpha = (LVM_INT32)LVM_Mixer_TimeConstant(LVREV_ALLPASS_TC, LVM_GetFsFromTable(pPrivate->NewParams.SampleRate), 1);
- LVM_INT32 AlphaTap = (LVM_INT32)LVM_Mixer_TimeConstant(LVREV_ALLPASS_TAP_TC, LVM_GetFsFromTable(pPrivate->NewParams.SampleRate), 1);
-
- for (i=0; i<4; i++)
- {
- pPrivate->Mixer_APTaps[i].Alpha1 = AlphaTap;
- pPrivate->Mixer_APTaps[i].Alpha2 = AlphaTap;
- pPrivate->Mixer_SGFeedback[i].Alpha = Alpha;
- pPrivate->Mixer_SGFeedforward[i].Alpha = Alpha;
- }
- }
-
-
- /*
- * Update the feed back gain
- */
- if( (pPrivate->NewParams.RoomSize != pPrivate->CurrentParams.RoomSize) ||
- (pPrivate->NewParams.SampleRate != pPrivate->CurrentParams.SampleRate) ||
- (pPrivate->NewParams.T60 != pPrivate->CurrentParams.T60) ||
- (pPrivate->bFirstControl == LVM_TRUE))
- {
-
- LVM_INT32 G[4]; /* Feedback gain (Q7.24) */
-
- if(pPrivate->NewParams.T60 == 0)
- {
- G[3] = 0;
- G[2] = 0;
- G[1] = 0;
- G[0] = 0;
- }
- else
- {
- LVM_INT32 Temp1;
- LVM_INT32 Temp2;
- LVM_INT16 i;
- LVM_INT16 ScaleTable[] = {LVREV_T_3_Power_minus0_on_4, LVREV_T_3_Power_minus1_on_4, LVREV_T_3_Power_minus2_on_4, LVREV_T_3_Power_minus3_on_4};
-
-
- /*
- * For each delay line
- */
- for (i=0; i<NumberOfDelayLines; i++)
- {
- Temp1 = (3 * pPrivate->RoomSizeInms * ScaleTable[i]) / pPrivate->NewParams.T60;
- if(Temp1 >= (4 << 15))
- {
- G[i] = 0;
- }
- else if((Temp1 >= (2 << 15)))
- {
- Temp2 = LVM_Power10(-(Temp1 << 14));
- Temp1 = LVM_Power10(-(Temp1 << 14));
- MUL32x32INTO32(Temp1,Temp2,Temp1,24)
- }
- else
- {
- Temp1 = LVM_Power10(-(Temp1 << 15));
- }
- if (NumberOfDelayLines == 1)
- {
- G[i] = Temp1;
- }
- else
- {
- LVM_INT32 TempG;
- MUL32x16INTO32(Temp1,ONE_OVER_SQRT_TWO,TempG,15)
- G[i]=TempG;
- }
- }
- }
-
- /* Set up the feedback mixers for four delay lines */
- pPrivate->FeedbackMixer[0].Target=G[0]<<7;
- pPrivate->FeedbackMixer[1].Target=G[1]<<7;
- pPrivate->FeedbackMixer[2].Target=G[2]<<7;
- pPrivate->FeedbackMixer[3].Target=G[3]<<7;
- }
-
-
- /*
- * Calculate the gain correction
- */
- if((pPrivate->NewParams.RoomSize != pPrivate->CurrentParams.RoomSize) ||
- (pPrivate->NewParams.Level != pPrivate->CurrentParams.Level) ||
- (pPrivate->NewParams.T60 != pPrivate->CurrentParams.T60) )
- {
- LVM_INT32 Index=0;
- LVM_INT32 i=0;
- LVM_INT32 Gain=0;
- LVM_INT32 RoomSize=0;
- LVM_INT32 T60;
- LVM_INT32 Coefs[5];
-
- if(pPrivate->NewParams.RoomSize==0)
- {
- RoomSize=1;
- }
- else
- {
- RoomSize=(LVM_INT32)pPrivate->NewParams.RoomSize;
- }
-
- if(pPrivate->NewParams.T60<100)
- {
- T60 = 100 * LVREV_T60_SCALE;
- }
- else
- {
- T60 = pPrivate->NewParams.T60 * LVREV_T60_SCALE;
- }
-
- /* Find the nearest room size in table */
- for(i=0;i<24;i++)
- {
- if(RoomSize<= LVREV_GainPolyTable[i][0])
- {
- Index=i;
- break;
- }
- }
-
-
- if(RoomSize==LVREV_GainPolyTable[Index][0])
- {
- /* Take table values if the room size is in table */
- for(i=1;i<5;i++)
- {
- Coefs[i-1]=LVREV_GainPolyTable[Index][i];
- }
- Coefs[4]=0;
- Gain=LVM_Polynomial(3,Coefs,T60); /* Q.24 result */
- }
- else
- {
- /* Interpolate the gain between nearest room sizes */
-
- LVM_INT32 Gain1,Gain2;
- LVM_INT32 Tot_Dist,Dist;
-
- Tot_Dist=LVREV_GainPolyTable[Index][0]-LVREV_GainPolyTable[Index-1][0];
- Dist=RoomSize-LVREV_GainPolyTable[Index-1][0];
-
-
- /* Get gain for first */
- for(i=1;i<5;i++)
- {
- Coefs[i-1]=LVREV_GainPolyTable[Index-1][i];
- }
- Coefs[4]=0;
-
- Gain1=LVM_Polynomial(3,Coefs,T60); /* Q.24 result */
-
- /* Get gain for second */
- for(i=1;i<5;i++)
- {
- Coefs[i-1]=LVREV_GainPolyTable[Index][i];
- }
- Coefs[4]=0;
-
- Gain2=LVM_Polynomial(3,Coefs,T60); /* Q.24 result */
-
- /* Linear Interpolate the gain */
- Gain = Gain1+ (((Gain2-Gain1)*Dist)/(Tot_Dist));
- }
-
-
- /*
- * Get the inverse of gain: Q.15
- * Gain is mostly above one except few cases, take only gains above 1
- */
- if(Gain < 16777216L)
- {
- pPrivate->Gain= 32767;
- }
- else
- {
- pPrivate->Gain=(LVM_INT16)(LVM_MAXINT_32/(Gain>>8));
- }
-
-
- Index=((32767*100)/(100+pPrivate->NewParams.Level));
- pPrivate->Gain=(LVM_INT16)((pPrivate->Gain*Index)>>15);
- pPrivate->GainMixer.Target = pPrivate->Gain*Index;
- }
-
-
- /*
- * Update the all pass comb filter coefficient
- */
- if( (pPrivate->NewParams.Density != pPrivate->CurrentParams.Density) ||
- (pPrivate->bFirstControl == LVM_TRUE))
- {
- LVM_INT16 i;
- LVM_INT32 b = pPrivate->NewParams.Density * LVREV_B_8_on_1000;
-
- for (i=0;i<4; i++)
- {
- pPrivate->Mixer_SGFeedback[i].Target = b;
- pPrivate->Mixer_SGFeedforward[i].Target = b;
- }
- }
-
-
- /*
- * Update the bypass mixer time constant
- */
- if((pPrivate->NewParams.SampleRate != pPrivate->CurrentParams.SampleRate) ||
- (pPrivate->bFirstControl == LVM_TRUE))
- {
- LVM_UINT16 NumChannels = 1; /* Assume MONO format */
- LVM_INT32 Alpha;
-
- Alpha = (LVM_INT32)LVM_Mixer_TimeConstant(LVREV_FEEDBACKMIXER_TC, LVM_GetFsFromTable(pPrivate->NewParams.SampleRate), NumChannels);
- pPrivate->FeedbackMixer[0].Alpha=Alpha;
- pPrivate->FeedbackMixer[1].Alpha=Alpha;
- pPrivate->FeedbackMixer[2].Alpha=Alpha;
- pPrivate->FeedbackMixer[3].Alpha=Alpha;
-
- NumChannels = 2; /* Always stereo output */
- pPrivate->BypassMixer.Alpha1 = (LVM_INT32)LVM_Mixer_TimeConstant(LVREV_BYPASSMIXER_TC, LVM_GetFsFromTable(pPrivate->NewParams.SampleRate), NumChannels);
- pPrivate->BypassMixer.Alpha2 = pPrivate->BypassMixer.Alpha1;
- pPrivate->GainMixer.Alpha = pPrivate->BypassMixer.Alpha1;
- }
-
-
- /*
- * Update the bypass mixer targets
- */
- if( (pPrivate->NewParams.Level != pPrivate->CurrentParams.Level) &&
- (pPrivate->NewParams.OperatingMode == LVM_MODE_ON))
- {
- pPrivate->BypassMixer.Target2 = ((LVM_INT32)(pPrivate->NewParams.Level * 32767)/100)<<16;
- pPrivate->BypassMixer.Target1 = 0x00000000;
- if ((pPrivate->NewParams.Level == 0) && (pPrivate->bFirstControl == LVM_FALSE))
- {
- pPrivate->BypassMixer.CallbackSet2 = LVM_TRUE;
- }
- if (pPrivate->NewParams.Level != 0)
- {
- pPrivate->bDisableReverb = LVM_FALSE;
- }
- }
-
- if(pPrivate->NewParams.OperatingMode != pPrivate->CurrentParams.OperatingMode)
- {
- if(pPrivate->NewParams.OperatingMode == LVM_MODE_ON)
- {
- pPrivate->BypassMixer.Target2 = ((LVM_INT32)(pPrivate->NewParams.Level * 32767)/100)<<16;
- pPrivate->BypassMixer.Target1 = 0x00000000;
-
- pPrivate->BypassMixer.CallbackSet2 = LVM_FALSE;
- OperatingMode = LVM_MODE_ON;
- if (pPrivate->NewParams.Level == 0)
- {
- pPrivate->bDisableReverb = LVM_TRUE;
- }
- else
- {
- pPrivate->bDisableReverb = LVM_FALSE;
- }
- }
- else if (pPrivate->bFirstControl == LVM_FALSE)
- {
- pPrivate->BypassMixer.Target2 = 0x00000000;
- pPrivate->BypassMixer.Target1 = 0x00000000;
- pPrivate->BypassMixer.CallbackSet2 = LVM_TRUE;
- pPrivate->GainMixer.Target = 0x03FFFFFF;
- OperatingMode = LVM_MODE_ON;
- }
- else
- {
- OperatingMode = LVM_MODE_OFF;
- }
- }
-
-
- /*
- * If it is the first call to ApplyNew settings force the current to the target to begin immediate playback of the effect
- */
- if(pPrivate->bFirstControl == LVM_TRUE)
- {
- pPrivate->BypassMixer.Current1 = pPrivate->BypassMixer.Target1;
- pPrivate->BypassMixer.Current2 = pPrivate->BypassMixer.Target2;
- }
-
-
- /*
- * Copy the new parameters
- */
- pPrivate->CurrentParams = pPrivate->NewParams;
- pPrivate->CurrentParams.OperatingMode = OperatingMode;
-
-
- /*
- * Update flag
- */
- if(pPrivate->bFirstControl == LVM_TRUE)
- {
- pPrivate->bFirstControl = LVM_FALSE;
- }
-
-
- return LVREV_SUCCESS;
-}
-#else /* BUILD_FLOAT*/
-LVREV_ReturnStatus_en LVREV_ApplyNewSettings (LVREV_Instance_st *pPrivate)
-{
-
- LVM_Mode_en OperatingMode;
- LVM_INT32 NumberOfDelayLines;
-
-
/* Check for NULL pointer */
if(pPrivate == LVM_NULL)
{
@@ -638,12 +83,10 @@
FO_1I_D32F32Cll_TRC_WRA_01_Init( &pPrivate->pFastCoef->HPCoefs,
&pPrivate->pFastData->HPTaps, &Coeffs);
LoadConst_Float(0,
- (LVM_FLOAT *)&pPrivate->pFastData->HPTaps, /* Destination Cast to void: \
- no dereferencing in function*/
+ (LVM_FLOAT *)&pPrivate->pFastData->HPTaps,
sizeof(Biquad_1I_Order1_FLOAT_Taps_t) / sizeof(LVM_FLOAT));
}
-
/*
* Update the low pass filter coefficients
*/
@@ -672,12 +115,10 @@
FO_1I_D32F32Cll_TRC_WRA_01_Init( &pPrivate->pFastCoef->LPCoefs,
&pPrivate->pFastData->LPTaps, &Coeffs);
LoadConst_Float(0,
- (LVM_FLOAT *)&pPrivate->pFastData->LPTaps, /* Destination Cast to void: \
- no dereferencing in function*/
+ (LVM_FLOAT *)&pPrivate->pFastData->LPTaps,
sizeof(Biquad_1I_Order1_FLOAT_Taps_t) / sizeof(LVM_FLOAT));
}
-
/*
* Calculate the room size parameter
*/
@@ -691,7 +132,6 @@
pPrivate->RoomSizeInms = 10 + (((pPrivate->NewParams.RoomSize*11) + 5) / 10);
}
-
/*
* Update the T delay number of samples and the all pass delay number of samples
*/
@@ -712,7 +152,6 @@
LVM_INT16 MaxAP_Delay[] = {LVREV_MAX_AP0_DELAY, LVREV_MAX_AP1_DELAY, \
LVREV_MAX_AP2_DELAY, LVREV_MAX_AP3_DELAY};
-
/*
* For each delay line
*/
@@ -731,19 +170,13 @@
}
APDelaySize = Temp / 1500;
-
/*
* Set the fixed delay
*/
-#ifdef HIGHER_FS
Temp = (MaxT_Delay[i] - MaxAP_Delay[i]) * Fs / 192000;
-#else
- Temp = (MaxT_Delay[i] - MaxAP_Delay[i]) * Fs / 48000;
-#endif
pPrivate->Delay_AP[i] = pPrivate->T[i] - Temp;
-
/*
* Set the tap selection
*/
@@ -788,7 +221,6 @@
pPrivate->AB_Selection = 1;
}
-
/*
* Limit the maximum block length
*/
@@ -800,8 +232,6 @@
}
}
-
-
/*
* Update the low pass filter coefficient
*/
@@ -818,7 +248,6 @@
LVM_FLOAT ScaleTable[] = {LVREV_T_3_Power_0_on_4, LVREV_T_3_Power_1_on_4,
LVREV_T_3_Power_2_on_4, LVREV_T_3_Power_3_on_4};
-
/*
* For each filter
*/
@@ -848,7 +277,6 @@
}
}
-
/*
* Update All-pass filter mixer time constants
*/
@@ -877,7 +305,6 @@
}
}
-
/*
* Update the feed back gain
*/
@@ -904,7 +331,6 @@
LVM_FLOAT ScaleTable[] = {LVREV_T_3_Power_minus0_on_4, LVREV_T_3_Power_minus1_on_4,
LVREV_T_3_Power_minus2_on_4, LVREV_T_3_Power_minus3_on_4};
-
/*
* For each delay line
*/
@@ -945,7 +371,6 @@
pPrivate->FeedbackMixer[3].Target=G[3];
}
-
/*
* Calculate the gain correction
*/
@@ -961,7 +386,6 @@
LVM_FLOAT T60;
LVM_FLOAT Coefs[5];
-
if(pPrivate->NewParams.RoomSize == 0)
{
RoomSize = 1;
@@ -971,7 +395,6 @@
RoomSize = (LVM_INT32)pPrivate->NewParams.RoomSize;
}
-
if(pPrivate->NewParams.T60 < 100)
{
T60 = 100 * LVREV_T60_SCALE;
@@ -991,7 +414,6 @@
}
}
-
if(RoomSize == LVREV_GainPolyTable[Index][0])
{
/* Take table values if the room size is in table */
@@ -1013,7 +435,6 @@
(LVM_UINT32)LVREV_GainPolyTable[Index-1][0];
Dist = RoomSize - (LVM_UINT32)LVREV_GainPolyTable[Index - 1][0];
-
/* Get gain for first */
for(i = 1; i < 5; i++)
{
@@ -1036,7 +457,6 @@
Gain = Gain1 + (((Gain2 - Gain1) * Dist) / (Tot_Dist));
}
-
/*
* Get the inverse of gain: Q.15
* Gain is mostly above one except few cases, take only gains above 1
@@ -1055,7 +475,6 @@
pPrivate->GainMixer.Target = (pPrivate->Gain*Index_FLOAT) / 2;
}
-
/*
* Update the all pass comb filter coefficient
*/
@@ -1072,7 +491,6 @@
}
}
-
/*
* Update the bypass mixer time constant
*/
@@ -1097,7 +515,6 @@
pPrivate->GainMixer.Alpha = pPrivate->BypassMixer.Alpha1;
}
-
/*
* Update the bypass mixer targets
*/
@@ -1148,7 +565,6 @@
}
}
-
/* If it is the first call to ApplyNew settings force the current to the target \
to begin immediate playback of the effect */
if(pPrivate->bFirstControl == LVM_TRUE)
@@ -1157,14 +573,12 @@
pPrivate->BypassMixer.Current2 = pPrivate->BypassMixer.Target2;
}
-
/*
* Copy the new parameters
*/
pPrivate->CurrentParams = pPrivate->NewParams;
pPrivate->CurrentParams.OperatingMode = OperatingMode;
-
/*
* Update flag
*/
@@ -1173,10 +587,8 @@
pPrivate->bFirstControl = LVM_FALSE;
}
-
return LVREV_SUCCESS;
}
-#endif /*BUILD_FLOAT*/
/****************************************************************************************/
/* */
/* FUNCTION: BypassMixer_Callback */
@@ -1201,14 +613,12 @@
LVREV_Instance_st *pLVREV_Private = (LVREV_Instance_st *)pCallbackData;
-
/*
* Avoid build warnings
*/
(void)pGeneralPurpose;
(void)GeneralPurpose;
-
/*
* Turn off
*/
@@ -1216,7 +626,6 @@
pLVREV_Private->bDisableReverb = LVM_TRUE;
LVREV_ClearAudioBuffers((LVREV_Handle_t)pCallbackData);
-
return 0;
}
diff --git a/media/libeffects/lvm/lib/Reverb/src/LVREV_ClearAudioBuffers.cpp b/media/libeffects/lvm/lib/Reverb/src/LVREV_ClearAudioBuffers.cpp
index 0f41f09..586539f 100644
--- a/media/libeffects/lvm/lib/Reverb/src/LVREV_ClearAudioBuffers.cpp
+++ b/media/libeffects/lvm/lib/Reverb/src/LVREV_ClearAudioBuffers.cpp
@@ -23,7 +23,6 @@
#include "LVREV_Private.h"
#include "VectorArithmetic.h"
-
/****************************************************************************************/
/* */
/* FUNCTION: LVREV_ClearAudioBuffers */
@@ -47,7 +46,6 @@
LVREV_Instance_st *pLVREV_Private = (LVREV_Instance_st *)hInstance;
-
/*
* Check for error conditions
*/
@@ -61,36 +59,14 @@
* Clear all filter tap data, delay-lines and other signal related data
*/
-#ifdef BUILD_FLOAT
LoadConst_Float(0,
- (LVM_FLOAT *)&pLVREV_Private->pFastData->HPTaps, /* Destination Cast to void: \
- no dereferencing in function*/
+ (LVM_FLOAT *)&pLVREV_Private->pFastData->HPTaps,
2);
LoadConst_Float(0,
- (LVM_FLOAT *)&pLVREV_Private->pFastData->LPTaps, /* Destination Cast to void: \
- no dereferencing in function*/
+ (LVM_FLOAT *)&pLVREV_Private->pFastData->LPTaps,
2);
-#else
- LoadConst_32(0,
- (void *)&pLVREV_Private->pFastData->HPTaps, /* Destination Cast to void: no dereferencing in function*/
- 2);
- LoadConst_32(0,
- (void *)&pLVREV_Private->pFastData->LPTaps, /* Destination Cast to void: no dereferencing in function*/
- 2);
-#endif
if((LVM_UINT16)pLVREV_Private->InstanceParams.NumDelays == LVREV_DELAYLINES_4)
{
-#ifndef BUILD_FLOAT
- LoadConst_32(0, (LVM_INT32 *)&pLVREV_Private->pFastData->RevLPTaps[3], 2);
- LoadConst_32(0, (LVM_INT32 *)&pLVREV_Private->pFastData->RevLPTaps[2], 2);
- LoadConst_32(0, (LVM_INT32 *)&pLVREV_Private->pFastData->RevLPTaps[1], 2);
- LoadConst_32(0, (LVM_INT32 *)&pLVREV_Private->pFastData->RevLPTaps[0], 2);
-
- LoadConst_32(0,pLVREV_Private->pDelay_T[3], (LVM_INT16)LVREV_MAX_T3_DELAY);
- LoadConst_32(0,pLVREV_Private->pDelay_T[2], (LVM_INT16)LVREV_MAX_T2_DELAY);
- LoadConst_32(0,pLVREV_Private->pDelay_T[1], (LVM_INT16)LVREV_MAX_T1_DELAY);
- LoadConst_32(0,pLVREV_Private->pDelay_T[0], (LVM_INT16)LVREV_MAX_T0_DELAY);
-#else
LoadConst_Float(0, (LVM_FLOAT *)&pLVREV_Private->pFastData->RevLPTaps[3], 2);
LoadConst_Float(0, (LVM_FLOAT *)&pLVREV_Private->pFastData->RevLPTaps[2], 2);
LoadConst_Float(0, (LVM_FLOAT *)&pLVREV_Private->pFastData->RevLPTaps[1], 2);
@@ -100,35 +76,21 @@
LoadConst_Float(0, pLVREV_Private->pDelay_T[2], LVREV_MAX_T2_DELAY);
LoadConst_Float(0, pLVREV_Private->pDelay_T[1], LVREV_MAX_T1_DELAY);
LoadConst_Float(0, pLVREV_Private->pDelay_T[0], LVREV_MAX_T0_DELAY);
-#endif
}
if((LVM_UINT16)pLVREV_Private->InstanceParams.NumDelays >= LVREV_DELAYLINES_2)
{
-#ifndef BUILD_FLOAT
- LoadConst_32(0, (LVM_INT32 *)&pLVREV_Private->pFastData->RevLPTaps[1], 2);
- LoadConst_32(0, (LVM_INT32 *)&pLVREV_Private->pFastData->RevLPTaps[0], 2);
-
- LoadConst_32(0,pLVREV_Private->pDelay_T[1], (LVM_INT16)LVREV_MAX_T1_DELAY);
- LoadConst_32(0,pLVREV_Private->pDelay_T[0], (LVM_INT16)LVREV_MAX_T0_DELAY);
-#else
LoadConst_Float(0, (LVM_FLOAT *)&pLVREV_Private->pFastData->RevLPTaps[1], 2);
LoadConst_Float(0, (LVM_FLOAT *)&pLVREV_Private->pFastData->RevLPTaps[0], 2);
LoadConst_Float(0, pLVREV_Private->pDelay_T[1], LVREV_MAX_T1_DELAY);
LoadConst_Float(0, pLVREV_Private->pDelay_T[0], LVREV_MAX_T0_DELAY);
-#endif
}
if((LVM_UINT16)pLVREV_Private->InstanceParams.NumDelays >= LVREV_DELAYLINES_1)
{
-#ifndef BUILD_FLOAT
- LoadConst_32(0, (LVM_INT32 *)&pLVREV_Private->pFastData->RevLPTaps[0], 2);
- LoadConst_32(0,pLVREV_Private->pDelay_T[0], (LVM_INT16)LVREV_MAX_T0_DELAY);
-#else
LoadConst_Float(0, (LVM_FLOAT *)&pLVREV_Private->pFastData->RevLPTaps[0], 2);
LoadConst_Float(0, pLVREV_Private->pDelay_T[0], LVREV_MAX_T0_DELAY);
-#endif
}
return LVREV_SUCCESS;
}
diff --git a/media/libeffects/lvm/lib/Reverb/src/LVREV_GetControlParameters.cpp b/media/libeffects/lvm/lib/Reverb/src/LVREV_GetControlParameters.cpp
index 7cee26d..e0b0142 100644
--- a/media/libeffects/lvm/lib/Reverb/src/LVREV_GetControlParameters.cpp
+++ b/media/libeffects/lvm/lib/Reverb/src/LVREV_GetControlParameters.cpp
@@ -22,7 +22,6 @@
/****************************************************************************************/
#include "LVREV_Private.h"
-
/****************************************************************************************/
/* */
/* FUNCTION: LVREV_GetControlParameters */
@@ -49,7 +48,6 @@
LVREV_Instance_st *pLVREV_Private = (LVREV_Instance_st *)hInstance;
-
/*
* Check for error conditions
*/
diff --git a/media/libeffects/lvm/lib/Reverb/src/LVREV_GetInstanceHandle.cpp b/media/libeffects/lvm/lib/Reverb/src/LVREV_GetInstanceHandle.cpp
index 8a27371..68f883a 100644
--- a/media/libeffects/lvm/lib/Reverb/src/LVREV_GetInstanceHandle.cpp
+++ b/media/libeffects/lvm/lib/Reverb/src/LVREV_GetInstanceHandle.cpp
@@ -23,7 +23,6 @@
#include "LVREV_Private.h"
#include "InstAlloc.h"
-
/****************************************************************************************/
/* */
/* FUNCTION: LVREV_GetInstanceHandle */
@@ -59,7 +58,6 @@
LVM_INT16 i;
LVM_UINT16 MaxBlockSize;
-
/*
* Check for error conditions
*/
@@ -108,7 +106,6 @@
/*
* Zero all memory regions
*/
-#ifdef BUILD_FLOAT
LoadConst_Float(0,
(LVM_FLOAT *)pMemoryTable->Region[LVM_PERSISTENT_SLOW_DATA].pBaseAddress,
(LVM_INT16)((pMemoryTable->Region[LVM_PERSISTENT_SLOW_DATA].Size) / \
@@ -125,12 +122,6 @@
(LVM_FLOAT *)pMemoryTable->Region[LVM_TEMPORARY_FAST].pBaseAddress,
(LVM_INT16)((pMemoryTable->Region[LVM_TEMPORARY_FAST].Size) / \
sizeof(LVM_FLOAT)));
-#else
- LoadConst_16(0, (LVM_INT16 *)pMemoryTable->Region[LVM_PERSISTENT_SLOW_DATA].pBaseAddress, (LVM_INT16)((pMemoryTable->Region[LVM_PERSISTENT_SLOW_DATA].Size)/sizeof(LVM_INT16)));
- LoadConst_16(0, (LVM_INT16 *)pMemoryTable->Region[LVM_PERSISTENT_FAST_DATA].pBaseAddress, (LVM_INT16)((pMemoryTable->Region[LVM_PERSISTENT_FAST_DATA].Size)/sizeof(LVM_INT16)));
- LoadConst_16(0, (LVM_INT16 *)pMemoryTable->Region[LVM_PERSISTENT_FAST_COEF].pBaseAddress, (LVM_INT16)((pMemoryTable->Region[LVM_PERSISTENT_FAST_COEF].Size)/sizeof(LVM_INT16)));
- LoadConst_16(0, (LVM_INT16 *)pMemoryTable->Region[LVM_TEMPORARY_FAST].pBaseAddress, (LVM_INT16)((pMemoryTable->Region[LVM_TEMPORARY_FAST].Size)/sizeof(LVM_INT16)));
-#endif
/*
* Set the instance handle if not already initialised
*/
@@ -159,58 +150,12 @@
MaxBlockSize=pInstanceParams->MaxBlockSize;
}
-
/*
* Set the data, coefficient and temporary memory pointers
*/
/* Fast data memory base address */
pLVREV_Private->pFastData = (LVREV_FastData_st *)
InstAlloc_AddMember(&FastData, sizeof(LVREV_FastData_st));
-#ifndef BUILD_FLOAT
- if(pInstanceParams->NumDelays == LVREV_DELAYLINES_4)
- {
- pLVREV_Private->pDelay_T[3] = InstAlloc_AddMember(&FastData, LVREV_MAX_T3_DELAY * sizeof(LVM_INT32));
- pLVREV_Private->pDelay_T[2] = InstAlloc_AddMember(&FastData, LVREV_MAX_T2_DELAY * sizeof(LVM_INT32));
- pLVREV_Private->pDelay_T[1] = InstAlloc_AddMember(&FastData, LVREV_MAX_T1_DELAY * sizeof(LVM_INT32));
- pLVREV_Private->pDelay_T[0] = InstAlloc_AddMember(&FastData, LVREV_MAX_T0_DELAY * sizeof(LVM_INT32));
-
- for( i = 0; i < 4; i++)
- {
- pLVREV_Private->pScratchDelayLine[i] = InstAlloc_AddMember(&Temporary, sizeof(LVM_INT32) * MaxBlockSize); /* Scratch for each delay line output */
- }
-
- LoadConst_32(0,pLVREV_Private->pDelay_T[3] ,(LVM_INT16)LVREV_MAX_T3_DELAY);
- LoadConst_32(0,pLVREV_Private->pDelay_T[2] ,(LVM_INT16)LVREV_MAX_T2_DELAY);
- LoadConst_32(0,pLVREV_Private->pDelay_T[1] ,(LVM_INT16)LVREV_MAX_T1_DELAY);
- LoadConst_32(0,pLVREV_Private->pDelay_T[0] ,(LVM_INT16)LVREV_MAX_T0_DELAY);
- }
-
- if(pInstanceParams->NumDelays == LVREV_DELAYLINES_2)
- {
- pLVREV_Private->pDelay_T[1] = InstAlloc_AddMember(&FastData, LVREV_MAX_T1_DELAY * sizeof(LVM_INT32));
- pLVREV_Private->pDelay_T[0] = InstAlloc_AddMember(&FastData, LVREV_MAX_T0_DELAY * sizeof(LVM_INT32));
-
- for( i = 0; i < 2; i++)
- {
- pLVREV_Private->pScratchDelayLine[i] = InstAlloc_AddMember(&Temporary, sizeof(LVM_INT32) * MaxBlockSize); /* Scratch for each delay line output */
- }
-
- LoadConst_32(0,pLVREV_Private->pDelay_T[1] , (LVM_INT16)LVREV_MAX_T1_DELAY);
- LoadConst_32(0,pLVREV_Private->pDelay_T[0] , (LVM_INT16)LVREV_MAX_T0_DELAY);
- }
-
- if(pInstanceParams->NumDelays == LVREV_DELAYLINES_1)
- {
- pLVREV_Private->pDelay_T[0] = InstAlloc_AddMember(&FastData, LVREV_MAX_T0_DELAY * sizeof(LVM_INT32));
-
- for( i = 0; i < 1; i++)
- {
- pLVREV_Private->pScratchDelayLine[i] = InstAlloc_AddMember(&Temporary, sizeof(LVM_INT32) * MaxBlockSize); /* Scratch for each delay line output */
- }
-
- LoadConst_32(0,pLVREV_Private->pDelay_T[0] , (LVM_INT16)LVREV_MAX_T0_DELAY);
- }
-#else
if(pInstanceParams->NumDelays == LVREV_DELAYLINES_4)
{
pLVREV_Private->pDelay_T[3] =
@@ -276,7 +221,6 @@
LoadConst_Float(0, pLVREV_Private->pDelay_T[0], (LVM_INT16)LVREV_MAX_T0_DELAY);
}
-#endif
/* All-pass delay buffer addresses and sizes */
pLVREV_Private->T[0] = LVREV_MAX_T0_DELAY;
pLVREV_Private->T[1] = LVREV_MAX_T1_DELAY;
@@ -287,15 +231,6 @@
/* Fast coefficient memory base address */
pLVREV_Private->pFastCoef =
(LVREV_FastCoef_st *)InstAlloc_AddMember(&FastCoef, sizeof(LVREV_FastCoef_st));
-#ifndef BUILD_FLOAT
- /* General purpose scratch */
- pLVREV_Private->pScratch =
- (LVM_FLOAT *)InstAlloc_AddMember(&Temporary, sizeof(LVM_INT32) * MaxBlockSize);
- /* Mono->stereo input save for end mix */
- pLVREV_Private->pInputSave =
- (LVM_FLOAT *)InstAlloc_AddMember(&Temporary, 2 * sizeof(LVM_INT32) * MaxBlockSize);
- LoadConst_32(0, pLVREV_Private->pInputSave, (LVM_INT16)(MaxBlockSize*2));
-#else
/* General purpose scratch */
pLVREV_Private->pScratch =
(LVM_FLOAT *)InstAlloc_AddMember(&Temporary, sizeof(LVM_FLOAT) * \
@@ -305,14 +240,12 @@
(LVM_FLOAT *)InstAlloc_AddMember(&Temporary, 2 * sizeof(LVM_FLOAT) * \
MaxBlockSize);
LoadConst_Float(0, pLVREV_Private->pInputSave, (LVM_INT16)(MaxBlockSize * 2));
-#endif
/*
* Save the instance parameters in the instance structure
*/
pLVREV_Private->InstanceParams = *pInstanceParams;
-
/*
* Set the parameters to invalid
*/
@@ -324,7 +257,6 @@
pLVREV_Private->bFirstControl = LVM_TRUE;
pLVREV_Private->bDisableReverb = LVM_FALSE;
-
/*
* Set mixer parameters
*/
@@ -345,7 +277,6 @@
pLVREV_Private->RoomSizeInms = 100; // 100 msec
-
/*
* Set the output gain mixer parameters
*/
@@ -354,13 +285,8 @@
pLVREV_Private->GainMixer.pGeneralPurpose = LVM_NULL;
pLVREV_Private->GainMixer.pCallBack = LVM_NULL;
pLVREV_Private->GainMixer.CallbackSet = LVM_FALSE;
-#ifndef BUILD_FLOAT
- pLVREV_Private->GainMixer.Current = 0x03ffffff;
- pLVREV_Private->GainMixer.Target = 0x03ffffff;
-#else
pLVREV_Private->GainMixer.Current = 0.03125f;//0x03ffffff;
pLVREV_Private->GainMixer.Target = 0.03125f;//0x03ffffff;
-#endif
/*
* Set the All-Pass Filter mixers
@@ -383,11 +309,7 @@
pLVREV_Private->Mixer_APTaps[i].pCallBack1 = LVM_NULL;
pLVREV_Private->Mixer_APTaps[i].CallbackSet1 = LVM_FALSE;
pLVREV_Private->Mixer_APTaps[i].Current1 = 0;
-#ifndef BUILD_FLOAT
- pLVREV_Private->Mixer_APTaps[i].Target1 = 0x7fffffff;
-#else
pLVREV_Private->Mixer_APTaps[i].Target1 = 1;
-#endif
/* Feedforward mixer */
pLVREV_Private->Mixer_SGFeedforward[i].CallbackParam = 0;
pLVREV_Private->Mixer_SGFeedforward[i].pCallbackHandle = LVM_NULL;
@@ -423,7 +345,6 @@
pLVREV_Private->A_DelaySize[3] = LVREV_MAX_AP3_DELAY;
pLVREV_Private->B_DelaySize[3] = LVREV_MAX_AP3_DELAY;
-
LVREV_ClearAudioBuffers(*phInstance);
return LVREV_SUCCESS;
diff --git a/media/libeffects/lvm/lib/Reverb/src/LVREV_GetMemoryTable.cpp b/media/libeffects/lvm/lib/Reverb/src/LVREV_GetMemoryTable.cpp
index f6d446b..f59933c 100644
--- a/media/libeffects/lvm/lib/Reverb/src/LVREV_GetMemoryTable.cpp
+++ b/media/libeffects/lvm/lib/Reverb/src/LVREV_GetMemoryTable.cpp
@@ -68,7 +68,6 @@
LVM_INT16 i;
LVM_UINT16 MaxBlockSize;
-
/*
* Check for error conditions
*/
@@ -109,7 +108,6 @@
InstAlloc_Init(&FastCoef, (void *)LVM_NULL);
InstAlloc_Init(&Temporary, (void *)LVM_NULL);
-
/*
* Fill in the memory table
*/
@@ -123,7 +121,6 @@
return(LVREV_NULLADDRESS);
}
-
/*
* Select the maximum internal block size
*/
@@ -145,7 +142,6 @@
MaxBlockSize=pInstanceParams->MaxBlockSize;
}
-
/*
* Slow data memory
*/
@@ -154,51 +150,33 @@
pMemoryTable->Region[LVM_PERSISTENT_SLOW_DATA].Type = LVM_PERSISTENT_SLOW_DATA;
pMemoryTable->Region[LVM_PERSISTENT_SLOW_DATA].pBaseAddress = LVM_NULL;
-
/*
* Persistent fast data memory
*/
InstAlloc_AddMember(&FastData, sizeof(LVREV_FastData_st));
if(pInstanceParams->NumDelays == LVREV_DELAYLINES_4)
{
-#ifndef BUILD_FLOAT
- InstAlloc_AddMember(&FastData, LVREV_MAX_T3_DELAY * sizeof(LVM_INT32));
- InstAlloc_AddMember(&FastData, LVREV_MAX_T2_DELAY * sizeof(LVM_INT32));
- InstAlloc_AddMember(&FastData, LVREV_MAX_T1_DELAY * sizeof(LVM_INT32));
- InstAlloc_AddMember(&FastData, LVREV_MAX_T0_DELAY * sizeof(LVM_INT32));
-#else
InstAlloc_AddMember(&FastData, LVREV_MAX_T3_DELAY * sizeof(LVM_FLOAT));
InstAlloc_AddMember(&FastData, LVREV_MAX_T2_DELAY * sizeof(LVM_FLOAT));
InstAlloc_AddMember(&FastData, LVREV_MAX_T1_DELAY * sizeof(LVM_FLOAT));
InstAlloc_AddMember(&FastData, LVREV_MAX_T0_DELAY * sizeof(LVM_FLOAT));
-#endif
}
if(pInstanceParams->NumDelays == LVREV_DELAYLINES_2)
{
-#ifndef BUILD_FLOAT
- InstAlloc_AddMember(&FastData, LVREV_MAX_T1_DELAY * sizeof(LVM_INT32));
- InstAlloc_AddMember(&FastData, LVREV_MAX_T0_DELAY * sizeof(LVM_INT32));
-#else
InstAlloc_AddMember(&FastData, LVREV_MAX_T1_DELAY * sizeof(LVM_FLOAT));
InstAlloc_AddMember(&FastData, LVREV_MAX_T0_DELAY * sizeof(LVM_FLOAT));
-#endif
}
if(pInstanceParams->NumDelays == LVREV_DELAYLINES_1)
{
-#ifndef BUILD_FLOAT
- InstAlloc_AddMember(&FastData, LVREV_MAX_T0_DELAY * sizeof(LVM_INT32));
-#else
InstAlloc_AddMember(&FastData, LVREV_MAX_T0_DELAY * sizeof(LVM_FLOAT));
-#endif
}
pMemoryTable->Region[LVM_PERSISTENT_FAST_DATA].Size = InstAlloc_GetTotal(&FastData);
pMemoryTable->Region[LVM_PERSISTENT_FAST_DATA].Type = LVM_PERSISTENT_FAST_DATA;
pMemoryTable->Region[LVM_PERSISTENT_FAST_DATA].pBaseAddress = LVM_NULL;
-
/*
* Persistent fast coefficient memory
*/
@@ -207,29 +185,19 @@
pMemoryTable->Region[LVM_PERSISTENT_FAST_COEF].Type = LVM_PERSISTENT_FAST_COEF;
pMemoryTable->Region[LVM_PERSISTENT_FAST_COEF].pBaseAddress = LVM_NULL;
-
/*
* Temporary fast memory
*/
-#ifndef BUILD_FLOAT
- InstAlloc_AddMember(&Temporary, sizeof(LVM_INT32) * MaxBlockSize); /* General purpose scratch memory */
- InstAlloc_AddMember(&Temporary, 2*sizeof(LVM_INT32) * MaxBlockSize); /* Mono->stereo input saved for end mix */
-#else
/* General purpose scratch memory */
InstAlloc_AddMember(&Temporary, sizeof(LVM_FLOAT) * MaxBlockSize);
/* Mono->stereo input saved for end mix */
InstAlloc_AddMember(&Temporary, 2 * sizeof(LVM_FLOAT) * MaxBlockSize);
-#endif
if(pInstanceParams->NumDelays == LVREV_DELAYLINES_4)
{
for(i=0; i<4; i++)
{
-#ifndef BUILD_FLOAT
- InstAlloc_AddMember(&Temporary, sizeof(LVM_INT32) * MaxBlockSize); /* A Scratch buffer for each delay line */
-#else
/* A Scratch buffer for each delay line */
InstAlloc_AddMember(&Temporary, sizeof(LVM_FLOAT) * MaxBlockSize);
-#endif
}
}
@@ -237,12 +205,8 @@
{
for(i=0; i<2; i++)
{
-#ifndef BUILD_FLOAT
- InstAlloc_AddMember(&Temporary, sizeof(LVM_INT32) * MaxBlockSize); /* A Scratch buffer for each delay line */
-#else
/* A Scratch buffer for each delay line */
InstAlloc_AddMember(&Temporary, sizeof(LVM_FLOAT) * MaxBlockSize);
-#endif
}
}
@@ -250,12 +214,8 @@
{
for(i=0; i<1; i++)
{
-#ifndef BUILD_FLOAT
- InstAlloc_AddMember(&Temporary, sizeof(LVM_INT32) * MaxBlockSize); /* A Scratch buffer for each delay line */
-#else
/* A Scratch buffer for each delay line */
InstAlloc_AddMember(&Temporary, sizeof(LVM_FLOAT) * MaxBlockSize);
-#endif
}
}
@@ -268,14 +228,12 @@
{
LVREV_Instance_st *pLVREV_Private = (LVREV_Instance_st *)hInstance;
-
/*
* Read back memory allocation table
*/
*pMemoryTable = pLVREV_Private->MemoryTable;
}
-
return(LVREV_SUCCESS);
}
diff --git a/media/libeffects/lvm/lib/Reverb/src/LVREV_Private.h b/media/libeffects/lvm/lib/Reverb/src/LVREV_Private.h
index 3379d65..2c27c6e 100644
--- a/media/libeffects/lvm/lib/Reverb/src/LVREV_Private.h
+++ b/media/libeffects/lvm/lib/Reverb/src/LVREV_Private.h
@@ -18,8 +18,6 @@
#ifndef __LVREV_PRIVATE_H__
#define __LVREV_PRIVATE_H__
-
-
/****************************************************************************************/
/* */
/* Includes */
@@ -33,43 +31,22 @@
#include "Mixer.h"
#include "LVM_Macros.h"
-
/****************************************************************************************/
/* */
/* Defines */
/* */
/****************************************************************************************/
-#ifndef BUILD_FLOAT
-/* General */
-#define ONE_OVER_SQRT_TWO 23170 /* 1/sqrt(2) * 2^15 */
-#define LVREV_B_8_on_1000 17179869 /* 0.8 * 2^31 */
-#define LVREV_HEADROOM 8192 /* -12dB * 2^15 */
-#define LVREV_2_9_INQ29 1583769190L /* 2.9 in Q29 format */
-#define LVREV_MIN3DB 0x5A82 /* -3dB in Q15 format */
-#else
/* General */
#define ONE_OVER_SQRT_TWO 0.707107f /* 1/sqrt(2) * 2^15 */
#define LVREV_B_8_on_1000 0.008f /* 0.8 * 2^31 */
#define LVREV_HEADROOM 0.25f /* -12dB * 2^15 */
#define LVREV_2_9_INQ29 2.9f /* 2.9 in Q29 format */
#define LVREV_MIN3DB 0.7079457f /* -3dB in Q15 format */
-#endif
/* Intenal constants */
#define LVREV_LP_Poly_Order 4
#define LVREV_LP_Poly_Shift 5
-#ifndef BUILD_FLOAT
-#define LVREV_T_3_Power_0_on_4 32768
-#define LVREV_T_3_Power_1_on_4 43125
-#define LVREV_T_3_Power_2_on_4 56755
-#define LVREV_T_3_Power_3_on_4 74694
-#define LVREV_T60_SCALE 306774 /*(32767/7000)<<16 */
-#define LVREV_T_3_Power_minus0_on_4 32767 /* 3^(-0/4) * 2^15 */
-#define LVREV_T_3_Power_minus1_on_4 24898 /* 3^(-1/4) * 2^15 */
-#define LVREV_T_3_Power_minus2_on_4 18919 /* 3^(-2/4) * 2^15 */
-#define LVREV_T_3_Power_minus3_on_4 14375 /* 3^(-3/4) * 2^15 */
-#else/*BUILD_FLOAT*/
#define LVREV_T60_SCALE 0.000142f /*(1/7000) */
#define LVREV_T_3_Power_0_on_4 1.0f
@@ -80,18 +57,7 @@
#define LVREV_T_3_Power_minus1_on_4 0.759836f /* 3^(-1/4) * 2^15 */
#define LVREV_T_3_Power_minus2_on_4 0.577350f /* 3^(-2/4) * 2^15 */
#define LVREV_T_3_Power_minus3_on_4 0.438691f /* 3^(-3/4) * 2^15 */
-#endif
-#ifndef HIGHER_FS
-#define LVREV_MAX_T3_DELAY 2527 /* ((48000 * 120 * LVREV_T_3_Power_minus3_on_4) >> 15) / 1000 */
-#define LVREV_MAX_T2_DELAY 3326 /* ((48000 * 120 * LVREV_T_3_Power_minus2_on_4) >> 15) / 1000 */
-#define LVREV_MAX_T1_DELAY 4377 /* ((48000 * 120 * LVREV_T_3_Power_minus1_on_4) >> 15) / 1000 */
-#define LVREV_MAX_T0_DELAY 5760 /* ((48000 * 120 * LVREV_T_3_Power_minus0_on_4) >> 15) / 1000 */
-#define LVREV_MAX_AP3_DELAY 1685 /* ((48000 * 120 * LVREV_T_3_Power_minus3_on_4) >> 15) / 1500 */
-#define LVREV_MAX_AP2_DELAY 2218 /* ((48000 * 120 * LVREV_T_3_Power_minus2_on_4) >> 15) / 1500 */
-#define LVREV_MAX_AP1_DELAY 2918 /* ((48000 * 120 * LVREV_T_3_Power_minus1_on_4) >> 15) / 1500 */
-#define LVREV_MAX_AP0_DELAY 3840 /* ((48000 * 120 * LVREV_T_3_Power_minus0_on_4) >> 15) / 1500 */
-#else
/* ((192000 * 120 * LVREV_T_3_Power_minus3_on_4) >> 15) / 1000 */
#define LVREV_MAX_T3_DELAY 10108
/* ((192000 * 120 * LVREV_T_3_Power_minus2_on_4) >> 15) / 1000 */
@@ -108,7 +74,6 @@
#define LVREV_MAX_AP1_DELAY 11672
/* ((192000 * 120 * LVREV_T_3_Power_minus0_on_4) >> 15) / 1500 */
#define LVREV_MAX_AP0_DELAY 15360
-#endif
#define LVREV_BYPASSMIXER_TC 1000 /* Bypass mixer time constant*/
#define LVREV_ALLPASS_TC 1000 /* All-pass filter time constant */
@@ -117,11 +82,7 @@
#define LVREV_OUTPUTGAIN_SHIFT 5 /* Bits shift for output gain correction */
/* Parameter limits */
-#ifndef HIGHER_FS
-#define LVREV_NUM_FS 9 /* Number of supported sample rates */
-#else
#define LVREV_NUM_FS 13 /* Number of supported sample rates */
-#endif
#define LVREV_MAXBLKSIZE_LIMIT 64 /* Maximum block size low limit */
#define LVREV_MAX_LEVEL 100 /* Maximum level, 100% */
@@ -134,81 +95,11 @@
#define LVREV_MAX_DAMPING 100 /* Maximum damping, 100% */
#define LVREV_MAX_ROOMSIZE 100 /* Maximum room size, 100% */
-
-
/****************************************************************************************/
/* */
/* Structures */
/* */
/****************************************************************************************/
-#ifndef BUILD_FLOAT
-/* Fast data structure */
-typedef struct
-{
-
- Biquad_1I_Order1_Taps_t HPTaps; /* High pass filter taps */
- Biquad_1I_Order1_Taps_t LPTaps; /* Low pass filter taps */
- Biquad_1I_Order1_Taps_t RevLPTaps[4]; /* Reverb low pass filters taps */
-
-} LVREV_FastData_st;
-
-
-/* Fast coefficient structure */
-typedef struct
-{
-
- Biquad_Instance_t HPCoefs; /* High pass filter coefficients */
- Biquad_Instance_t LPCoefs; /* Low pass filter coefficients */
- Biquad_Instance_t RevLPCoefs[4]; /* Reverb low pass filters coefficients */
-
-} LVREV_FastCoef_st;
-
-
-/* Instance parameter structure */
-typedef struct
-{
- /* General */
- LVREV_InstanceParams_st InstanceParams; /* Initialisation time instance parameters */
- LVREV_MemoryTable_st MemoryTable; /* Memory table */
- LVREV_ControlParams_st CurrentParams; /* Parameters being used */
- LVREV_ControlParams_st NewParams; /* New parameters from the calling application */
- LVM_CHAR bControlPending; /* Flag to indicate new parameters are available */
- LVM_CHAR bFirstControl; /* Flag to indicate that the control function is called for the first time */
- LVM_CHAR bDisableReverb; /* Flag to indicate that the mix level is 0% and the reverb can be disabled */
- LVM_INT32 RoomSizeInms; /* Room size in msec */
- LVM_INT32 MaxBlkLen; /* Maximum block size for internal processing */
-
- /* Aligned memory pointers */
- LVREV_FastData_st *pFastData; /* Fast data memory base address */
- LVREV_FastCoef_st *pFastCoef; /* Fast coefficient memory base address */
- LVM_INT32 *pScratchDelayLine[4]; /* Delay line scratch memory */
- LVM_INT32 *pScratch; /* Multi ussge scratch */
- LVM_INT32 *pInputSave; /* Reverb block input save for dry/wet mixing*/
-
- /* Feedback matrix */
- Mix_1St_Cll_t FeedbackMixer[4]; /* Mixer for Pop and Click Supression caused by feedback Gain */
-
- /* All-Pass Filter */
- LVM_INT32 T[4]; /* Maximum delay size of buffer */
- LVM_INT32 *pDelay_T[4]; /* Pointer to delay buffers */
- LVM_INT32 Delay_AP[4]; /* Offset to AP delay buffer start */
- LVM_INT16 AB_Selection; /* Smooth from tap A to B when 1 otherwise B to A */
- LVM_INT32 A_DelaySize[4]; /* A delay length in samples */
- LVM_INT32 B_DelaySize[4]; /* B delay length in samples */
- LVM_INT32 *pOffsetA[4]; /* Offset for the A delay tap */
- LVM_INT32 *pOffsetB[4]; /* Offset for the B delay tap */
- Mix_2St_Cll_t Mixer_APTaps[4]; /* Smoothed AP delay mixer */
- Mix_1St_Cll_t Mixer_SGFeedback[4]; /* Smoothed SAfeedback gain */
- Mix_1St_Cll_t Mixer_SGFeedforward[4]; /* Smoothed AP feedforward gain */
-
- /* Output gain */
- Mix_2St_Cll_t BypassMixer; /* Dry/wet mixer */
- LVM_INT16 Gain; /* Gain applied to output to maintain average signal power */
- Mix_1St_Cll_t GainMixer; /* Gain smoothing */
-
-} LVREV_Instance_st;
-
-#else /* BUILD_FLOAT */
/* Fast data structure */
typedef struct
@@ -219,7 +110,6 @@
} LVREV_FastData_st;
-
/* Fast coefficient structure */
typedef struct
{
@@ -259,7 +149,6 @@
Mix_1St_Cll_FLOAT_t FeedbackMixer[4]; /* Mixer for Pop and Click Supression \
caused by feedback Gain */
-
/* All-Pass Filter */
LVM_INT32 T[4]; /* Maximum delay size of buffer */
LVM_FLOAT *pDelay_T[4]; /* Pointer to delay buffers */
@@ -282,7 +171,6 @@
} LVREV_Instance_st;
-#endif
/****************************************************************************************/
/* */
/* Function prototypes */
@@ -290,23 +178,14 @@
/****************************************************************************************/
LVREV_ReturnStatus_en LVREV_ApplyNewSettings(LVREV_Instance_st *pPrivate);
-#ifdef BUILD_FLOAT
void ReverbBlock(LVM_FLOAT *pInput,
LVM_FLOAT *pOutput,
LVREV_Instance_st *pPrivate,
LVM_UINT16 NumSamples);
-#else
-void ReverbBlock(LVM_INT32 *pInput,
- LVM_INT32 *pOutput,
- LVREV_Instance_st *pPrivate,
- LVM_UINT16 NumSamples);
-#endif
LVM_INT32 BypassMixer_Callback(void *pCallbackData,
void *pGeneralPurpose,
LVM_INT16 GeneralPurpose );
-
-
#endif /** __LVREV_PRIVATE_H__ **/
/* End of file */
diff --git a/media/libeffects/lvm/lib/Reverb/src/LVREV_Process.cpp b/media/libeffects/lvm/lib/Reverb/src/LVREV_Process.cpp
index 1d1283e..35f9ad8 100644
--- a/media/libeffects/lvm/lib/Reverb/src/LVREV_Process.cpp
+++ b/media/libeffects/lvm/lib/Reverb/src/LVREV_Process.cpp
@@ -23,7 +23,6 @@
#include "LVREV_Private.h"
#include "VectorArithmetic.h"
-
/****************************************************************************************/
/* */
/* FUNCTION: LVREV_Process */
@@ -46,26 +45,14 @@
/* 1. The input and output buffers must be 32-bit aligned */
/* */
/****************************************************************************************/
-#ifdef BUILD_FLOAT
LVREV_ReturnStatus_en LVREV_Process(LVREV_Handle_t hInstance,
const LVM_FLOAT *pInData,
LVM_FLOAT *pOutData,
const LVM_UINT16 NumSamples)
-#else
-LVREV_ReturnStatus_en LVREV_Process(LVREV_Handle_t hInstance,
- const LVM_INT32 *pInData,
- LVM_INT32 *pOutData,
- const LVM_UINT16 NumSamples)
-#endif
{
LVREV_Instance_st *pLVREV_Private = (LVREV_Instance_st *)hInstance;
-#ifdef BUILD_FLOAT
LVM_FLOAT *pInput = (LVM_FLOAT *)pInData;
LVM_FLOAT *pOutput = pOutData;
-#else
- LVM_INT32 *pInput = (LVM_INT32 *)pInData;
- LVM_INT32 *pOutput = pOutData;
-#endif
LVM_INT32 SamplesToProcess, RemainingSamples;
LVM_INT32 format = 1;
@@ -117,15 +104,6 @@
/*
* Copy the data to the output buffer, convert to stereo is required
*/
-#ifndef BUILD_FLOAT
- if(pLVREV_Private->CurrentParams.SourceFormat == LVM_MONO){
- MonoTo2I_32(pInput, pOutput, NumSamples);
- } else {
- Copy_16((LVM_INT16 *)pInput,
- (LVM_INT16 *)pOutput,
- (LVM_INT16)(NumSamples << 2)); // 32 bit data, stereo
- }
-#else
if(pLVREV_Private->CurrentParams.SourceFormat == LVM_MONO){
MonoTo2I_Float(pInput, pOutput, NumSamples);
} else {
@@ -133,7 +111,6 @@
pOutput,
(LVM_INT16)(NumSamples << 1)); // 32 bit data, stereo
}
-#endif
}
return LVREV_SUCCESS;
@@ -164,20 +141,13 @@
}
ReverbBlock(pInput, pOutput, pLVREV_Private, (LVM_UINT16)SamplesToProcess);
-#ifdef BUILD_FLOAT
pInput = (LVM_FLOAT *)(pInput + (SamplesToProcess * format));
pOutput = (LVM_FLOAT *)(pOutput + (SamplesToProcess * 2)); // Always stereo output
-#else
- pInput = (LVM_INT32 *)(pInput +(SamplesToProcess*format));
- pOutput = (LVM_INT32 *)(pOutput+(SamplesToProcess*2));
-#endif
}
return LVREV_SUCCESS;
}
-
-
/****************************************************************************************/
/* */
/* FUNCTION: ReverbBlock */
@@ -200,311 +170,6 @@
/* 1. The input and output buffers must be 32-bit aligned */
/* */
/****************************************************************************************/
-#ifndef BUILD_FLOAT
-void ReverbBlock(LVM_INT32 *pInput, LVM_INT32 *pOutput, LVREV_Instance_st *pPrivate, LVM_UINT16 NumSamples)
-{
- LVM_INT16 j, size;
- LVM_INT32 *pDelayLine;
- LVM_INT32 *pDelayLineInput = pPrivate->pScratch;
- LVM_INT32 *pScratch = pPrivate->pScratch;
- LVM_INT32 *pIn;
- LVM_INT32 *pTemp = pPrivate->pInputSave;
- LVM_INT32 NumberOfDelayLines;
-
- /******************************************************************************
- * All calculations will go into the buffer pointed to by pTemp, this will *
- * then be mixed with the original input to create the final output. *
- * *
- * When INPLACE processing is selected this must be a temporary buffer and *
- * hence this is the worst case, so for simplicity this will ALWAYS be so *
- * *
- * The input buffer will remain untouched until the output of the mixer if *
- * INPLACE processing is selected. *
- * *
- * The temp buffer will always be NumSamples in size regardless of MONO or *
- * STEREO input. In the case of stereo input all processing is done in MONO *
- * and the final output is converted to STEREO after the mixer *
- ******************************************************************************/
-
- if(pPrivate->InstanceParams.NumDelays == LVREV_DELAYLINES_4 )
- {
- NumberOfDelayLines = 4;
- }
- else if(pPrivate->InstanceParams.NumDelays == LVREV_DELAYLINES_2 )
- {
- NumberOfDelayLines = 2;
- }
- else
- {
- NumberOfDelayLines = 1;
- }
-
- if(pPrivate->CurrentParams.SourceFormat == LVM_MONO)
- {
- pIn = pInput;
- }
- else
- {
- /*
- * Stereo to mono conversion
- */
-
- From2iToMono_32( pInput,
- pTemp,
- (LVM_INT16)NumSamples);
-
- pIn = pTemp;
- }
-
- Mult3s_32x16(pIn,
- (LVM_INT16)LVREV_HEADROOM,
- pTemp,
- (LVM_INT16)NumSamples);
-
- /*
- * High pass filter
- */
- FO_1I_D32F32C31_TRC_WRA_01( &pPrivate->pFastCoef->HPCoefs,
- pTemp,
- pTemp,
- (LVM_INT16)NumSamples);
- /*
- * Low pass filter
- */
- FO_1I_D32F32C31_TRC_WRA_01( &pPrivate->pFastCoef->LPCoefs,
- pTemp,
- pTemp,
- (LVM_INT16)NumSamples);
-
- /*
- * Process all delay lines
- */
-
- for(j = 0; j < NumberOfDelayLines; j++)
- {
- pDelayLine = pPrivate->pScratchDelayLine[j];
-
- /*
- * All-pass filter with pop and click suppression
- */
- /* Get the smoothed, delayed output. Put it in the output buffer */
- MixSoft_2St_D32C31_SAT(&pPrivate->Mixer_APTaps[j],
- pPrivate->pOffsetA[j],
- pPrivate->pOffsetB[j],
- pDelayLine,
- (LVM_INT16)NumSamples);
- /* Re-align the all pass filter delay buffer and copying the fixed delay data to the AP delay in the process */
- Copy_16((LVM_INT16 *)&pPrivate->pDelay_T[j][NumSamples],
- (LVM_INT16 *)pPrivate->pDelay_T[j],
- (LVM_INT16)((pPrivate->T[j]-NumSamples) << 1)); /* 32-bit data */
- /* Apply the smoothed feedback and save to fixed delay input (currently empty) */
- MixSoft_1St_D32C31_WRA(&pPrivate->Mixer_SGFeedback[j],
- pDelayLine,
- &pPrivate->pDelay_T[j][pPrivate->T[j]-NumSamples],
- (LVM_INT16)NumSamples);
- /* Sum into the AP delay line */
- Mac3s_Sat_32x16(&pPrivate->pDelay_T[j][pPrivate->T[j]-NumSamples],
- -0x7fff, /* Invert since the feedback coefficient is negative */
- &pPrivate->pDelay_T[j][pPrivate->Delay_AP[j]-NumSamples],
- (LVM_INT16)NumSamples);
- /* Apply smoothed feedforward sand save to fixed delay input (currently empty) */
- MixSoft_1St_D32C31_WRA(&pPrivate->Mixer_SGFeedforward[j],
- &pPrivate->pDelay_T[j][pPrivate->Delay_AP[j]-NumSamples],
- &pPrivate->pDelay_T[j][pPrivate->T[j]-NumSamples],
- (LVM_INT16)NumSamples);
- /* Sum into the AP output */
- Mac3s_Sat_32x16(&pPrivate->pDelay_T[j][pPrivate->T[j]-NumSamples],
- 0x7fff,
- pDelayLine,
- (LVM_INT16)NumSamples);
-
- /*
- * Feedback gain
- */
- MixSoft_1St_D32C31_WRA(&pPrivate->FeedbackMixer[j], pDelayLine, pDelayLine, NumSamples);
-
- /*
- * Low pass filter
- */
- FO_1I_D32F32C31_TRC_WRA_01( &pPrivate->pFastCoef->RevLPCoefs[j],
- pDelayLine,
- pDelayLine,
- (LVM_INT16)NumSamples);
- }
-
- /*
- * Apply rotation matrix and delay samples
- */
- for(j = 0; j < NumberOfDelayLines; j++)
- {
-
- Copy_16( (LVM_INT16*)(pTemp),
- (LVM_INT16*)(pDelayLineInput),
- (LVM_INT16)(NumSamples << 1));
-
- /*
- * Rotation matrix mix
- */
- switch(j)
- {
- case 3:
- /*
- * Add delay line 1 and 2 contribution
- */
- Mac3s_Sat_32x16(pPrivate->pScratchDelayLine[1], -0x8000, pDelayLineInput, (LVM_INT16)NumSamples);
- Mac3s_Sat_32x16(pPrivate->pScratchDelayLine[2], -0x8000, pDelayLineInput, (LVM_INT16)NumSamples);
-
- break;
- case 2:
-
- /*
- * Add delay line 0 and 3 contribution
- */
- Mac3s_Sat_32x16(pPrivate->pScratchDelayLine[0], -0x8000, pDelayLineInput, (LVM_INT16)NumSamples);
- Mac3s_Sat_32x16(pPrivate->pScratchDelayLine[3], -0x8000, pDelayLineInput, (LVM_INT16)NumSamples);
-
- break;
- case 1:
- if(pPrivate->InstanceParams.NumDelays == LVREV_DELAYLINES_4)
- {
- /*
- * Add delay line 0 and 3 contribution
- */
- Mac3s_Sat_32x16(pPrivate->pScratchDelayLine[0], -0x8000, pDelayLineInput, (LVM_INT16)NumSamples);
- Add2_Sat_32x32(pPrivate->pScratchDelayLine[3], pDelayLineInput, (LVM_INT16)NumSamples);
-
- }
- else
- {
- /*
- * Add delay line 0 and 1 contribution
- */
- Mac3s_Sat_32x16(pPrivate->pScratchDelayLine[0], -0x8000, pDelayLineInput, (LVM_INT16)NumSamples);
- Mac3s_Sat_32x16(pPrivate->pScratchDelayLine[1], -0x8000, pDelayLineInput, (LVM_INT16)NumSamples);
-
- }
- break;
- case 0:
- if(pPrivate->InstanceParams.NumDelays == LVREV_DELAYLINES_4)
- {
- /*
- * Add delay line 1 and 2 contribution
- */
- Mac3s_Sat_32x16(pPrivate->pScratchDelayLine[1], -0x8000, pDelayLineInput, (LVM_INT16)NumSamples);
- Add2_Sat_32x32(pPrivate->pScratchDelayLine[2], pDelayLineInput, (LVM_INT16)NumSamples);
-
- }
- else if(pPrivate->InstanceParams.NumDelays == LVREV_DELAYLINES_2)
- {
- /*
- * Add delay line 0 and 1 contribution
- */
- Add2_Sat_32x32(pPrivate->pScratchDelayLine[0], pDelayLineInput, (LVM_INT16)NumSamples);
- Mac3s_Sat_32x16(pPrivate->pScratchDelayLine[1], -0x8000, pDelayLineInput, (LVM_INT16)NumSamples);
-
- }
- else
- {
- /*
- * Add delay line 0 contribution
- */
-
- /* SOURCE DESTINATION*/
- Add2_Sat_32x32(pPrivate->pScratchDelayLine[0], pDelayLineInput, (LVM_INT16)NumSamples);
- }
- break;
- default:
- break;
- }
-
- /*
- * Delay samples
- */
- Copy_16((LVM_INT16 *)pDelayLineInput,
- (LVM_INT16 *)&pPrivate->pDelay_T[j][pPrivate->T[j]-NumSamples],
- (LVM_INT16)(NumSamples << 1)); /* 32-bit data */
-
- }
-
-
- /*
- * Create stereo output
- */
- switch(pPrivate->InstanceParams.NumDelays)
- {
- case LVREV_DELAYLINES_4:
- Add2_Sat_32x32(pPrivate->pScratchDelayLine[3],
- pPrivate->pScratchDelayLine[0],
- (LVM_INT16)NumSamples);
- Add2_Sat_32x32(pPrivate->pScratchDelayLine[2],
- pPrivate->pScratchDelayLine[1],
- (LVM_INT16)NumSamples);
-
-
- JoinTo2i_32x32(pPrivate->pScratchDelayLine[0],
- pPrivate->pScratchDelayLine[1],
- pTemp,
- (LVM_INT16)NumSamples);
-
-
- break;
- case LVREV_DELAYLINES_2:
-
- Copy_16( (LVM_INT16*)pPrivate->pScratchDelayLine[1],
- (LVM_INT16*)pScratch,
- (LVM_INT16)(NumSamples << 1));
-
- Mac3s_Sat_32x16(pPrivate->pScratchDelayLine[0],
- -0x8000,
- pScratch,
- (LVM_INT16)NumSamples);
-
- Add2_Sat_32x32(pPrivate->pScratchDelayLine[1],
- pPrivate->pScratchDelayLine[0],
- (LVM_INT16)NumSamples);
-
-
- JoinTo2i_32x32(pPrivate->pScratchDelayLine[0],
- pScratch,
- pTemp,
- (LVM_INT16)NumSamples);
- break;
- case LVREV_DELAYLINES_1:
- MonoTo2I_32(pPrivate->pScratchDelayLine[0],
- pTemp,
- (LVM_INT16)NumSamples);
- break;
- default:
- break;
- }
-
-
- /*
- * Dry/wet mixer
- */
-
- size = (LVM_INT16)(NumSamples << 1);
- MixSoft_2St_D32C31_SAT(&pPrivate->BypassMixer,
- pTemp,
- pTemp,
- pOutput,
- size);
-
- /* Apply Gain*/
-
- Shift_Sat_v32xv32 (LVREV_OUTPUTGAIN_SHIFT,
- pOutput,
- pOutput,
- size);
-
- MixSoft_1St_D32C31_WRA(&pPrivate->GainMixer,
- pOutput,
- pOutput,
- size);
-
- return;
-}
-#else
void ReverbBlock(LVM_FLOAT *pInput, LVM_FLOAT *pOutput,
LVREV_Instance_st *pPrivate, LVM_UINT16 NumSamples)
{
@@ -742,7 +407,6 @@
(LVM_INT16)(NumSamples)); /* 32-bit data */
}
-
/*
* Create stereo output
*/
@@ -756,13 +420,11 @@
pPrivate->pScratchDelayLine[1],
(LVM_INT16)NumSamples);
-
JoinTo2i_Float(pPrivate->pScratchDelayLine[0],
pPrivate->pScratchDelayLine[1],
pTemp,
(LVM_INT16)NumSamples);
-
break;
case LVREV_DELAYLINES_2:
@@ -779,7 +441,6 @@
pPrivate->pScratchDelayLine[0],
(LVM_INT16)NumSamples);
-
JoinTo2i_Float(pPrivate->pScratchDelayLine[0],
pScratch,
pTemp,
@@ -794,7 +455,6 @@
break;
}
-
/*
* Dry/wet mixer
*/
@@ -820,6 +480,5 @@
return;
}
-#endif
/* End of file */
diff --git a/media/libeffects/lvm/lib/Reverb/src/LVREV_SetControlParameters.cpp b/media/libeffects/lvm/lib/Reverb/src/LVREV_SetControlParameters.cpp
index dfed28e..2a75559 100644
--- a/media/libeffects/lvm/lib/Reverb/src/LVREV_SetControlParameters.cpp
+++ b/media/libeffects/lvm/lib/Reverb/src/LVREV_SetControlParameters.cpp
@@ -48,7 +48,6 @@
LVREV_Instance_st *pLVREV_Private = (LVREV_Instance_st *)hInstance;
-
/*
* Check for error conditions
*/
@@ -67,10 +66,8 @@
(pNewParams->SampleRate != LVM_FS_32000) &&
(pNewParams->SampleRate != LVM_FS_44100) &&
(pNewParams->SampleRate != LVM_FS_48000)
-#ifdef HIGHER_FS
&& (pNewParams->SampleRate != LVM_FS_88200) && (pNewParams->SampleRate != LVM_FS_96000)
&& (pNewParams->SampleRate != LVM_FS_176400) && (pNewParams->SampleRate != LVM_FS_192000)
-#endif
)
#ifdef SUPPORT_MC
|| ((pNewParams->SourceFormat != LVM_STEREO) &&
@@ -84,7 +81,6 @@
return (LVREV_OUTOFRANGE);
}
-
if (pNewParams->Level > LVREV_MAX_LEVEL)
{
return LVREV_OUTOFRANGE;
@@ -120,8 +116,6 @@
return LVREV_OUTOFRANGE;
}
-
-
/*
* Copy the new parameters and set the flag to indicate they are available
*/
diff --git a/media/libeffects/lvm/lib/Reverb/src/LVREV_Tables.cpp b/media/libeffects/lvm/lib/Reverb/src/LVREV_Tables.cpp
index 1ea10a2..5cd623e 100644
--- a/media/libeffects/lvm/lib/Reverb/src/LVREV_Tables.cpp
+++ b/media/libeffects/lvm/lib/Reverb/src/LVREV_Tables.cpp
@@ -30,19 +30,6 @@
/****************************************************************************************/
/* Table with supported sampling rates. The table can be indexed using LVM_Fs_en */
-#ifndef HIGHER_FS
-const LVM_UINT16 LVM_FsTable[] = {
- 8000 ,
- 11025,
- 12000,
- 16000,
- 22050,
- 24000,
- 32000,
- 44100,
- 48000
-};
-#else
const LVM_UINT32 LVM_FsTable[] = {
8000 ,
11025,
@@ -58,23 +45,13 @@
176400,
192000
};
-#endif
/* Table with supported sampling rates. The table can be indexed using LVM_Fs_en */
-#ifndef HIGHER_FS
-LVM_UINT16 LVM_GetFsFromTable(LVM_Fs_en FsIndex){
- if (FsIndex > LVM_FS_48000)
- return 0;
-
- return (LVM_FsTable[FsIndex]);
-}
-#else
LVM_UINT32 LVM_GetFsFromTable(LVM_Fs_en FsIndex){
if (FsIndex > LVM_FS_192000)
return 0;
return (LVM_FsTable[FsIndex]);
}
-#endif
/* In order to maintain consistant input and out put signal strengths
output gain/attenuation is applied. This gain depends on T60 and Rooms
@@ -96,33 +73,6 @@
*/
/* Normalizing output including Reverb Level part (only shift up)*/
-#ifndef BUILD_FLOAT
-const LVM_INT32 LVREV_GainPolyTable[24][5]={{1,17547434,128867434,-120988896,50761228,},
- {2,18256869,172666902,-193169292,88345744,},
- {3,16591311,139250151,-149667234,66770059,},
- {4,17379977,170835131,-173579321,76278163,},
- {5,18963512,210364934,-228623519,103435022,},
- {6,17796318,135756417,-144084053,64327698,},
- {7,17454695,174593214,-187513064,85146582,},
- {8,17229257,140715570,-145790588,65361740,},
- {9,17000547,163195946,-176733969,79562130,},
- {10,16711699,142476304,-133339887,58366547,},
- {13,18108419,149223697,-161762020,74397589,},
- {15,16682043,124844884,-134284487,60082180,},
- {17,16627346,120936430,-121766674,53146421,},
- {20,17338325,125432694,-126616983,56534237,},
- {25,16489146,99218217,-94597467,40616506,},
- {30,15582373,84479043,-75365006,30952348,},
- {40,16000669,84896611,-75031127,30696306,},
- {50,15087054,71695031,-59349268,23279669,},
- {60,15830714,68672971,-58211201,23671158,},
- {70,15536061,66657972,-55901437,22560153,},
- {75,15013145,48179917,-24138354,5232074,},
- {80,15688738,50195036,-34206760,11515792,},
- {90,16003322,48323661,-35607378,13153872,},
- {100,15955223,48558201,-33706865,11715792,},
- };
-#else
const LVM_FLOAT LVREV_GainPolyTable[24][5]={{1,1.045909f,7.681098f,-7.211500f,3.025605f,},
{2,1.088194f,10.291749f,-11.513787f,5.265817f,},
{3,0.988919f,8.299956f,-8.920862f,3.979806f,},
@@ -148,6 +98,5 @@
{90,0.953872f,2.880315f,-2.122365f,0.784032f,},
{100,0.951005f,2.894294f,-2.009086f,0.698316f,},
};
-#endif
/* End of file */
diff --git a/media/libeffects/lvm/lib/Reverb/src/LVREV_Tables.h b/media/libeffects/lvm/lib/Reverb/src/LVREV_Tables.h
index 06b534c..e100d8a 100644
--- a/media/libeffects/lvm/lib/Reverb/src/LVREV_Tables.h
+++ b/media/libeffects/lvm/lib/Reverb/src/LVREV_Tables.h
@@ -15,12 +15,9 @@
* limitations under the License.
*/
-
#ifndef _LVREV_TABLES_H_
#define _LVREV_TABLES_H_
-
-
/****************************************************************************************/
/* */
/* Includes */
@@ -34,19 +31,10 @@
/* */
/****************************************************************************************/
-#ifndef HIGHER_FS
-extern const LVM_UINT16 LVM_FsTable[];
-extern LVM_UINT16 LVM_GetFsFromTable(LVM_Fs_en FsIndex);
-#else
extern const LVM_UINT32 LVM_FsTable[];
extern LVM_UINT32 LVM_GetFsFromTable(LVM_Fs_en FsIndex);
-#endif
-#ifndef BUILD_FLOAT
-extern LVM_INT32 LVREV_GainPolyTable[24][5];
-#else
extern const LVM_FLOAT LVREV_GainPolyTable[24][5];
-#endif
#endif /** _LVREV_TABLES_H_ **/
diff --git a/media/libeffects/lvm/lib/SpectrumAnalyzer/lib/LVPSA.h b/media/libeffects/lvm/lib/SpectrumAnalyzer/lib/LVPSA.h
index 1377655..c9fa7ad 100644
--- a/media/libeffects/lvm/lib/SpectrumAnalyzer/lib/LVPSA.h
+++ b/media/libeffects/lvm/lib/SpectrumAnalyzer/lib/LVPSA.h
@@ -18,11 +18,8 @@
#ifndef _LVPSA_H_
#define _LVPSA_H_
-
#include "LVM_Types.h"
-
-
/****************************************************************************************/
/* */
/* CONSTANTS DEFINITIONS */
@@ -113,8 +110,6 @@
LVPSA_RETURN_DUMMY = LVM_MAXINT_32 /* Force 32 bits enum, don't use it! */
} LVPSA_RETURN;
-
-
/*********************************************************************************************************************************
FUNCTIONS PROTOTYPE
**********************************************************************************************************************************/
@@ -213,17 +208,10 @@
/* otherwise Error due to bad parameters */
/* */
/*********************************************************************************************************************************/
-#ifdef BUILD_FLOAT
LVPSA_RETURN LVPSA_Process ( pLVPSA_Handle_t hInstance,
LVM_FLOAT *pLVPSA_InputSamples,
LVM_UINT16 InputBlockSize,
LVPSA_Time AudioTime );
-#else
-LVPSA_RETURN LVPSA_Process ( pLVPSA_Handle_t hInstance,
- LVM_INT16 *pLVPSA_InputSamples,
- LVM_UINT16 InputBlockSize,
- LVPSA_Time AudioTime );
-#endif
/*********************************************************************************************************************************/
/* */
/* FUNCTION: LVPSA_GetSpectrum */
@@ -285,6 +273,4 @@
LVPSA_RETURN LVPSA_GetInitParams ( pLVPSA_Handle_t hInstance,
LVPSA_InitParams_t *pParams );
-
-
#endif /* _LVPSA_H */
diff --git a/media/libeffects/lvm/lib/SpectrumAnalyzer/src/LVPSA_Control.cpp b/media/libeffects/lvm/lib/SpectrumAnalyzer/src/LVPSA_Control.cpp
index f6c4ea7..deafaa7 100644
--- a/media/libeffects/lvm/lib/SpectrumAnalyzer/src/LVPSA_Control.cpp
+++ b/media/libeffects/lvm/lib/SpectrumAnalyzer/src/LVPSA_Control.cpp
@@ -28,7 +28,6 @@
LVPSA_RETURN LVPSA_SetQPFCoefficients( LVPSA_InstancePr_t *pInst,
LVPSA_ControlParams_t *pParams );
-#ifdef BUILD_FLOAT
LVPSA_RETURN LVPSA_BPSinglePrecCoefs( LVM_UINT16 Fs,
LVPSA_FilterParam_t *pFilterParams,
BP_FLOAT_Coefs_t *pCoefficients);
@@ -36,27 +35,11 @@
LVPSA_RETURN LVPSA_BPDoublePrecCoefs( LVM_UINT16 Fs,
LVPSA_FilterParam_t *pFilterParams,
BP_FLOAT_Coefs_t *pCoefficients);
-#else
-LVPSA_RETURN LVPSA_BPSinglePrecCoefs( LVM_UINT16 Fs,
- LVPSA_FilterParam_t *pFilterParams,
- BP_C16_Coefs_t *pCoefficients);
-
-LVPSA_RETURN LVPSA_BPDoublePrecCoefs( LVM_UINT16 Fs,
- LVPSA_FilterParam_t *pFilterParams,
- BP_C32_Coefs_t *pCoefficients);
-
-LVPSA_RETURN LVPSA_BPDoublePrecCoefs( LVM_UINT16 Fs,
- LVPSA_FilterParam_t *pFilterParams,
- BP_C32_Coefs_t *pCoefficients);
-#endif
LVPSA_RETURN LVPSA_SetBPFCoefficients( LVPSA_InstancePr_t *pInst,
LVPSA_ControlParams_t *pParams );
LVPSA_RETURN LVPSA_ClearFilterHistory( LVPSA_InstancePr_t *pInst);
-
-
-
/************************************************************************************/
/* */
/* FUNCTION: LVPSA_Control */
@@ -129,7 +112,6 @@
return(LVPSA_OK);
}
-
/************************************************************************************/
/* */
/* FUNCTION: LVPSA_GetInitParams */
@@ -163,7 +145,6 @@
return(LVPSA_OK);
}
-
/************************************************************************************/
/* */
/* FUNCTION: LVPSA_ApplyNewSettings */
@@ -188,14 +169,9 @@
LVM_UINT16 Freq;
LVPSA_ControlParams_t Params;
extern LVM_INT16 LVPSA_nSamplesBufferUpdate[];
-#ifndef HIGHER_FS
- extern LVM_UINT16 LVPSA_SampleRateTab[];
-#else
extern LVM_UINT32 LVPSA_SampleRateTab[];
-#endif
extern LVM_UINT16 LVPSA_DownSamplingFactor[];
-
if(pInst == 0)
{
return(LVPSA_ERROR_NULLADDRESS);
@@ -280,11 +256,7 @@
LVPSA_RETURN LVPSA_SetBPFiltersType ( LVPSA_InstancePr_t *pInst,
LVPSA_ControlParams_t *pParams )
{
-#ifndef HIGHER_FS
- extern LVM_UINT16 LVPSA_SampleRateTab[]; /* Sample rate table */
-#else
extern LVM_UINT32 LVPSA_SampleRateTab[]; /* Sample rate table */
-#endif
LVM_UINT16 ii; /* Filter band index */
LVM_UINT32 fs = (LVM_UINT32)LVPSA_SampleRateTab[(LVM_UINT16)pParams->Fs]; /* Sample rate */
LVM_UINT32 fc; /* Filter centre frequency */
@@ -298,7 +270,6 @@
fc = (LVM_UINT32)pInst->pFiltersParams[ii].CenterFrequency; /* Get the band centre frequency */
QFactor =(LVM_INT16) pInst->pFiltersParams[ii].QFactor; /* Get the band Q factor */
-
/*
* For each filter set the type of biquad required
*/
@@ -358,22 +329,6 @@
{
case LVPSA_DoublePrecisionFilter:
{
-#ifndef BUILD_FLOAT
- BP_C32_Coefs_t Coefficients;
-
- /*
- * Calculate the double precision coefficients
- */
- LVPSA_BPDoublePrecCoefs((LVM_UINT16)pParams->Fs,
- &pInst->pFiltersParams[ii],
- &Coefficients);
- /*
- * Set the coefficients
- */
- BP_1I_D16F32Cll_TRC_WRA_01_Init ( &pInst->pBP_Instances[ii],
- &pInst->pBP_Taps[ii],
- &Coefficients);
-#else
BP_FLOAT_Coefs_t Coefficients;
/*
* Calculate the double precision coefficients
@@ -387,29 +342,11 @@
BP_1I_D16F32Cll_TRC_WRA_01_Init ( &pInst->pBP_Instances[ii],
&pInst->pBP_Taps[ii],
&Coefficients);
-#endif
break;
}
case LVPSA_SimplePrecisionFilter:
{
-#ifndef BUILD_FLOAT
- BP_C16_Coefs_t Coefficients;
-
- /*
- * Calculate the single precision coefficients
- */
- LVPSA_BPSinglePrecCoefs((LVM_UINT16)pParams->Fs,
- &pInst->pFiltersParams[ii],
- &Coefficients);
-
- /*
- * Set the coefficients
- */
- BP_1I_D16F16Css_TRC_WRA_01_Init (&pInst->pBP_Instances[ii],
- &pInst->pBP_Taps[ii],
- &Coefficients);
-#else
BP_FLOAT_Coefs_t Coefficients;
/*
@@ -425,7 +362,6 @@
BP_1I_D16F16Css_TRC_WRA_01_Init (&pInst->pBP_Instances[ii],
&pInst->pBP_Taps[ii],
&Coefficients);
-#endif
break;
}
}
@@ -434,7 +370,6 @@
return(LVPSA_OK);
}
-
/************************************************************************************/
/* */
/* FUNCTION: LVPSA_SetQPFCoefficients */
@@ -458,31 +393,17 @@
{
LVM_UINT16 ii;
LVM_Fs_en Fs = pParams->Fs;
-#ifndef BUILD_FLOAT
- QPD_C32_Coefs *pCoefficients;
- extern QPD_C32_Coefs LVPSA_QPD_Coefs[];
-
- pCoefficients = &LVPSA_QPD_Coefs[(pParams->LevelDetectionSpeed * LVPSA_NR_SUPPORTED_RATE) + Fs];
-#else
QPD_FLOAT_Coefs *pCoefficients;
extern QPD_FLOAT_Coefs LVPSA_QPD_Float_Coefs[];
pCoefficients = &LVPSA_QPD_Float_Coefs[(pParams->LevelDetectionSpeed * \
LVPSA_NR_SUPPORTED_RATE) + Fs];
-#endif
-
for (ii = 0; ii < pInst->nRelevantFilters; ii++)
{
-#ifndef BUILD_FLOAT
- LVPSA_QPD_Init (&pInst->pQPD_States[ii],
- &pInst->pQPD_Taps[ii],
- pCoefficients );
-#else
LVPSA_QPD_Init_Float (&pInst->pQPD_States[ii],
&pInst->pQPD_Taps[ii],
pCoefficients );
-#endif
}
return(LVPSA_OK);
@@ -522,7 +443,6 @@
/* of the n bands equalizer (LVEQNB */
/* */
/****************************************************************************************/
-#ifdef BUILD_FLOAT
LVPSA_RETURN LVPSA_BPSinglePrecCoefs( LVM_UINT16 Fs,
LVPSA_FilterParam_t *pFilterParams,
BP_FLOAT_Coefs_t *pCoefficients)
@@ -531,7 +451,6 @@
extern LVM_FLOAT LVPSA_Float_TwoPiOnFsTable[];
extern LVM_FLOAT LVPSA_Float_CosCoef[];
-
/*
* Intermediate variables and temporary values
*/
@@ -549,7 +468,6 @@
LVM_FLOAT t0;
LVM_INT16 i;
-
/*
* Get the filter definition
*/
@@ -589,7 +507,6 @@
}
COS_T0 = COS_T0 * 8; /*LVPSA_CosCoef_float[0]*/ /* Correct the scaling */
-
B1 = ((LVM_FLOAT)0.5 - B2) * (COS_T0); /* B1 = (0.5 - b2) * cos(t0) */
A0 = ((LVM_FLOAT)0.5 + B2) / 2; /* A0 = (0.5 + b2) / 2 */
@@ -602,89 +519,6 @@
return(LVPSA_OK);
}
-#else
-LVPSA_RETURN LVPSA_BPSinglePrecCoefs( LVM_UINT16 Fs,
- LVPSA_FilterParam_t *pFilterParams,
- BP_C16_Coefs_t *pCoefficients)
-{
-
- extern LVM_INT16 LVPSA_TwoPiOnFsTable[];
- extern LVM_INT16 LVPSA_CosCoef[];
-
-
- /*
- * Intermediate variables and temporary values
- */
- LVM_INT32 T0;
- LVM_INT16 D;
- LVM_INT32 A0;
- LVM_INT32 B1;
- LVM_INT32 B2;
- LVM_INT32 Dt0;
- LVM_INT32 B2_Den;
- LVM_INT32 B2_Num;
- LVM_INT32 COS_T0;
- LVM_INT16 coef;
- LVM_INT32 factor;
- LVM_INT16 t0;
- LVM_INT16 i;
-
-
- /*
- * Get the filter definition
- */
- LVM_UINT16 Frequency = pFilterParams->CenterFrequency;
- LVM_UINT16 QFactor = pFilterParams->QFactor;
-
-
- /*
- * Calculating the intermediate values
- */
- T0 = (LVM_INT32)Frequency * LVPSA_TwoPiOnFsTable[Fs]; /* T0 = 2 * Pi * Fc / Fs */
- D = 3200; /* Floating point value 1.000000 (1*100*2^5) */
- /* Force D = 1 : the function was originally used for a peaking filter.
- The D parameter do not exist for a BandPass filter coefficients */
-
- /*
- * Calculate the B2 coefficient
- */
- Dt0 = D * (T0 >> 10);
- B2_Den = (LVM_INT32)(((LVM_UINT32)QFactor << 19) + (LVM_UINT32)(Dt0 >> 2));
- B2_Num = (LVM_INT32)((LVM_UINT32)(Dt0 >> 3) - ((LVM_UINT32)QFactor << 18));
- B2 = (B2_Num / (B2_Den >> 16)) << 15;
-
- /*
- * Calculate the cosine by a polynomial expansion using the equation:
- *
- * Cos += coef(n) * t0^n For n = 0 to 6
- */
- T0 = (T0 >> 10) * 20859; /* Scale to 1.0 in 16-bit for range 0 to fs/2 */
- t0 = (LVM_INT16)(T0 >> 16);
- factor = 0x7fff; /* Initialise to 1.0 for the a0 coefficient */
- COS_T0 = 0; /* Initialise the error to zero */
- for (i=1; i<7; i++)
- {
- coef = LVPSA_CosCoef[i]; /* Get the nth coefficient */
- COS_T0 += (factor * coef) >> 5; /* The nth partial sum */
- factor = (factor * t0) >> 15; /* Calculate t0^n */
- }
- COS_T0 = COS_T0 << (LVPSA_CosCoef[0]+6); /* Correct the scaling */
-
-
- B1 = ((0x40000000 - B2) >> 16) * (COS_T0 >> 16); /* B1 = (0.5 - b2) * cos(t0) */
- A0 = (0x40000000 + B2) >> 1; /* A0 = (0.5 + b2) / 2 */
-
- /*
- * Write coeff into the data structure
- */
- pCoefficients->A0 = (LVM_INT16)(A0>>16);
- pCoefficients->B1 = (LVM_INT16)(B1>>15);
- pCoefficients->B2 = (LVM_INT16)(B2>>16);
-
-
- return(LVPSA_OK);
-}
-#endif
/****************************************************************************************/
/* */
/* FUNCTION: LVPSA_BPDoublePrecCoefs */
@@ -727,7 +561,6 @@
/* of the n bands equalizer (LVEQNB */
/* */
/****************************************************************************************/
-#ifdef BUILD_FLOAT
LVPSA_RETURN LVPSA_BPDoublePrecCoefs( LVM_UINT16 Fs,
LVPSA_FilterParam_t *pFilterParams,
BP_FLOAT_Coefs_t *pCoefficients)
@@ -759,7 +592,6 @@
LVM_FLOAT Frequency = (LVM_FLOAT)(pFilterParams->CenterFrequency);
LVM_FLOAT QFactor = ((LVM_FLOAT)(pFilterParams->QFactor)) / 100;
-
/*
* Calculating the intermediate values
*/
@@ -810,90 +642,6 @@
return(LVPSA_OK);
}
-#else
-LVPSA_RETURN LVPSA_BPDoublePrecCoefs( LVM_UINT16 Fs,
- LVPSA_FilterParam_t *pFilterParams,
- BP_C32_Coefs_t *pCoefficients)
-{
-
- extern LVM_INT16 LVPSA_TwoPiOnFsTable[];
- extern LVM_INT16 LVPSA_DPCosCoef[];
-
- /*
- * Intermediate variables and temporary values
- */
- LVM_INT32 T0;
- LVM_INT16 D;
- LVM_INT32 A0;
- LVM_INT32 B1;
- LVM_INT32 B2;
- LVM_INT32 Dt0;
- LVM_INT32 B2_Den;
- LVM_INT32 B2_Num;
- LVM_INT32 CosErr;
- LVM_INT16 coef;
- LVM_INT32 factor;
- LVM_INT16 t0;
- LVM_INT16 i;
-
- /*
- * Get the filter definition
- */
- LVM_UINT16 Frequency = pFilterParams->CenterFrequency;
- LVM_UINT16 QFactor = pFilterParams->QFactor;
-
-
- /*
- * Calculating the intermediate values
- */
- T0 = (LVM_INT32)Frequency * LVPSA_TwoPiOnFsTable[Fs]; /* T0 = 2 * Pi * Fc / Fs */
- D = 3200; /* Floating point value 1.000000 (1*100*2^5) */
- /* Force D = 1 : the function was originally used for a peaking filter.
- The D parameter do not exist for a BandPass filter coefficients */
-
- /*
- * Calculate the B2 coefficient
- */
- Dt0 = D * (T0 >> 10);
- B2_Den = (LVM_INT32)(((LVM_UINT32)QFactor << 19) + (LVM_UINT32)(Dt0 >> 2));
- B2_Num = (LVM_INT32)((LVM_UINT32)(Dt0 >> 3) - ((LVM_UINT32)QFactor << 18));
- B2 = (B2_Num / (B2_Den >> 16)) << 15;
-
- /*
- * Calculate the cosine error by a polynomial expansion using the equation:
- *
- * CosErr += coef(n) * t0^n For n = 0 to 4
- */
- T0 = (T0 >> 6) * 0x7f53; /* Scale to 1.0 in 16-bit for range 0 to fs/50 */
- t0 = (LVM_INT16)(T0 >> 16);
- factor = 0x7fff; /* Initialise to 1.0 for the a0 coefficient */
- CosErr = 0; /* Initialise the error to zero */
- for (i=1; i<5; i++)
- {
- coef = LVPSA_DPCosCoef[i]; /* Get the nth coefficient */
- CosErr += (factor * coef) >> 5; /* The nth partial sum */
- factor = (factor * t0) >> 15; /* Calculate t0^n */
- }
- CosErr = CosErr << (LVPSA_DPCosCoef[0]); /* Correct the scaling */
-
- /*
- * Calculate the B1 and A0 coefficients
- */
- B1 = (0x40000000 - B2); /* B1 = (0.5 - b2) */
- A0 = ((B1 >> 16) * (CosErr >> 10)) >> 6; /* Temporary storage for (0.5 - b2) * coserr(t0) */
- B1 -= A0; /* B1 = (0.5 - b2) * (1 - coserr(t0)) */
- A0 = (0x40000000 + B2) >> 1; /* A0 = (0.5 + b2) / 2 */
-
- /*
- * Write coeff into the data structure
- */
- pCoefficients->A0 = A0;
- pCoefficients->B1 = B1;
- pCoefficients->B2 = B2;
-
- return(LVPSA_OK);
-}
-#endif
/************************************************************************************/
/* */
/* FUNCTION: LVPSA_ClearFilterHistory */
@@ -917,17 +665,10 @@
/* Band Pass filters taps */
pTapAddress = (LVM_INT8 *)pInst->pBP_Taps;
-#ifdef BUILD_FLOAT
for(i = 0; i < pInst->nBands * sizeof(Biquad_1I_Order2_FLOAT_Taps_t); i++)
{
pTapAddress[i] = 0;
}
-#else
- for(i = 0; i < pInst->nBands * sizeof(Biquad_1I_Order2_Taps_t); i++)
- {
- pTapAddress[i] = 0;
- }
-#endif
/* Quasi-peak filters taps */
pTapAddress = (LVM_INT8 *)pInst->pQPD_Taps;
for(i = 0; i < pInst->nBands * sizeof(QPD_Taps_t); i++)
diff --git a/media/libeffects/lvm/lib/SpectrumAnalyzer/src/LVPSA_Init.cpp b/media/libeffects/lvm/lib/SpectrumAnalyzer/src/LVPSA_Init.cpp
index ff4b275..9fcd82f 100644
--- a/media/libeffects/lvm/lib/SpectrumAnalyzer/src/LVPSA_Init.cpp
+++ b/media/libeffects/lvm/lib/SpectrumAnalyzer/src/LVPSA_Init.cpp
@@ -47,11 +47,7 @@
LVPSA_InstancePr_t *pLVPSA_Inst;
LVPSA_RETURN errorCode = LVPSA_OK;
LVM_UINT32 ii;
-#ifndef BUILD_FLOAT
- extern LVM_INT16 LVPSA_GainTable[];
-#else
extern LVM_FLOAT LVPSA_Float_GainTable[];
-#endif
LVM_UINT32 BufferLength = 0;
/* Ints_Alloc instances, needed for memory alignment management */
@@ -87,14 +83,12 @@
}
}
-
/*Inst_Alloc instances initialization */
InstAlloc_Init( &Instance , pMemoryTable->Region[LVPSA_MEMREGION_INSTANCE].pBaseAddress);
InstAlloc_Init( &Scratch , pMemoryTable->Region[LVPSA_MEMREGION_SCRATCH].pBaseAddress);
InstAlloc_Init( &Data , pMemoryTable->Region[LVPSA_MEMREGION_PERSISTENT_DATA].pBaseAddress);
InstAlloc_Init( &Coef , pMemoryTable->Region[LVPSA_MEMREGION_PERSISTENT_COEF].pBaseAddress);
-
/* Set the instance handle if not already initialised */
if (*phInstance == LVM_NULL)
{
@@ -102,7 +96,6 @@
}
pLVPSA_Inst =(LVPSA_InstancePr_t*)*phInstance;
-
/* Check the memory table for NULL pointers */
for (ii = 0; ii < LVPSA_NR_MEMORY_REGIONS; ii++)
{
@@ -143,14 +136,9 @@
pLVPSA_Inst->SpectralDataBufferLength = BufferLength;
}
-
/* Assign the pointers */
-#ifndef BUILD_FLOAT
- pLVPSA_Inst->pPostGains = InstAlloc_AddMember( &Instance, pInitParams->nBands * sizeof(LVM_UINT16) );
-#else
pLVPSA_Inst->pPostGains =
(LVM_FLOAT *)InstAlloc_AddMember(&Instance, pInitParams->nBands * sizeof(LVM_FLOAT));
-#endif
pLVPSA_Inst->pFiltersParams = (LVPSA_FilterParam_t *)
InstAlloc_AddMember(&Instance, pInitParams->nBands * sizeof(LVPSA_FilterParam_t));
pLVPSA_Inst->pSpectralDataBufferStart = (LVM_UINT8 *)
@@ -161,30 +149,19 @@
pLVPSA_Inst->pBPFiltersPrecision = (LVPSA_BPFilterPrecision_en *)
InstAlloc_AddMember(&Instance, pInitParams->nBands * \
sizeof(LVPSA_BPFilterPrecision_en));
-#ifndef BUILD_FLOAT
- pLVPSA_Inst->pBP_Instances = InstAlloc_AddMember( &Coef, pInitParams->nBands * sizeof(Biquad_Instance_t) );
- pLVPSA_Inst->pQPD_States = InstAlloc_AddMember( &Coef, pInitParams->nBands * sizeof(QPD_State_t) );
-#else
pLVPSA_Inst->pBP_Instances = (Biquad_FLOAT_Instance_t *)
InstAlloc_AddMember(&Coef, pInitParams->nBands * \
sizeof(Biquad_FLOAT_Instance_t));
pLVPSA_Inst->pQPD_States = (QPD_FLOAT_State_t *)
InstAlloc_AddMember(&Coef, pInitParams->nBands * \
sizeof(QPD_FLOAT_State_t));
-#endif
-#ifndef BUILD_FLOAT
- pLVPSA_Inst->pBP_Taps = InstAlloc_AddMember( &Data, pInitParams->nBands * sizeof(Biquad_1I_Order2_Taps_t) );
- pLVPSA_Inst->pQPD_Taps = InstAlloc_AddMember( &Data, pInitParams->nBands * sizeof(QPD_Taps_t) );
-
-#else
pLVPSA_Inst->pBP_Taps = (Biquad_1I_Order2_FLOAT_Taps_t *)
InstAlloc_AddMember(&Data, pInitParams->nBands * \
sizeof(Biquad_1I_Order2_FLOAT_Taps_t));
pLVPSA_Inst->pQPD_Taps = (QPD_FLOAT_Taps_t *)
InstAlloc_AddMember(&Data, pInitParams->nBands * \
sizeof(QPD_FLOAT_Taps_t));
-#endif
/* Copy filters parameters in the private instance */
for(ii = 0; ii < pLVPSA_Inst->nBands; ii++)
@@ -195,16 +172,11 @@
/* Set Post filters gains*/
for(ii = 0; ii < pLVPSA_Inst->nBands; ii++)
{
-#ifndef BUILD_FLOAT
- pLVPSA_Inst->pPostGains[ii] =(LVM_UINT16) LVPSA_GainTable[pInitParams->pFiltersParams[ii].PostGain + 15];
-#else
pLVPSA_Inst->pPostGains[ii] = LVPSA_Float_GainTable[15 + \
pInitParams->pFiltersParams[ii].PostGain];
-#endif
}
pLVPSA_Inst->pSpectralDataBufferWritePointer = pLVPSA_Inst->pSpectralDataBufferStart;
-
/* Initialize control dependant internal parameters */
errorCode = LVPSA_Control (*phInstance, pControlParams);
diff --git a/media/libeffects/lvm/lib/SpectrumAnalyzer/src/LVPSA_Memory.cpp b/media/libeffects/lvm/lib/SpectrumAnalyzer/src/LVPSA_Memory.cpp
index 06a8f9d..eafcbe6 100644
--- a/media/libeffects/lvm/lib/SpectrumAnalyzer/src/LVPSA_Memory.cpp
+++ b/media/libeffects/lvm/lib/SpectrumAnalyzer/src/LVPSA_Memory.cpp
@@ -59,19 +59,16 @@
INST_ALLOC Coef;
LVPSA_InstancePr_t *pLVPSA_Inst = (LVPSA_InstancePr_t*)hInstance;
-
InstAlloc_Init( &Instance , LVM_NULL);
InstAlloc_Init( &Scratch , LVM_NULL);
InstAlloc_Init( &Data , LVM_NULL);
InstAlloc_Init( &Coef , LVM_NULL);
-
if((pMemoryTable == LVM_NULL) || (pInitParams == LVM_NULL))
{
return(LVPSA_ERROR_NULLADDRESS);
}
-
/*
* Fill in the memory table
*/
@@ -106,11 +103,7 @@
*/
InstAlloc_AddMember( &Instance, sizeof(LVPSA_InstancePr_t) );
-#ifdef BUILD_FLOAT
InstAlloc_AddMember( &Instance, pInitParams->nBands * sizeof(LVM_FLOAT) );
-#else
- InstAlloc_AddMember( &Instance, pInitParams->nBands * sizeof(LVM_UINT16) );
-#endif
InstAlloc_AddMember( &Instance, pInitParams->nBands * sizeof(LVPSA_FilterParam_t) );
{
@@ -123,7 +116,6 @@
BufferLength=(LVM_UINT32)BL;
}
-
if((BufferLength * LVPSA_InternalRefreshTime) != pInitParams->SpectralDataBufferDuration)
{
BufferLength++;
@@ -138,11 +130,7 @@
/*
* Scratch memory
*/
-#ifndef BUILD_FLOAT
- InstAlloc_AddMember( &Scratch, 2 * pInitParams->MaxInputBlockSize * sizeof(LVM_INT16) );
-#else
InstAlloc_AddMember( &Scratch, 2 * pInitParams->MaxInputBlockSize * sizeof(LVM_FLOAT) );
-#endif
pMemoryTable->Region[LVPSA_MEMREGION_SCRATCH].Size = InstAlloc_GetTotal(&Scratch);
pMemoryTable->Region[LVPSA_MEMREGION_SCRATCH].Type = LVPSA_SCRATCH;
pMemoryTable->Region[LVPSA_MEMREGION_SCRATCH].pBaseAddress = LVM_NULL;
@@ -150,13 +138,8 @@
/*
* Persistent coefficients memory
*/
-#ifndef BUILD_FLOAT
- InstAlloc_AddMember( &Coef, pInitParams->nBands * sizeof(Biquad_Instance_t) );
- InstAlloc_AddMember( &Coef, pInitParams->nBands * sizeof(QPD_State_t) );
-#else
InstAlloc_AddMember( &Coef, pInitParams->nBands * sizeof(Biquad_FLOAT_Instance_t) );
InstAlloc_AddMember( &Coef, pInitParams->nBands * sizeof(QPD_FLOAT_State_t) );
-#endif
pMemoryTable->Region[LVPSA_MEMREGION_PERSISTENT_COEF].Size = InstAlloc_GetTotal(&Coef);
pMemoryTable->Region[LVPSA_MEMREGION_PERSISTENT_COEF].Type = LVPSA_PERSISTENT_COEF;
pMemoryTable->Region[LVPSA_MEMREGION_PERSISTENT_COEF].pBaseAddress = LVM_NULL;
@@ -164,13 +147,8 @@
/*
* Persistent data memory
*/
-#ifndef BUILD_FLOAT
- InstAlloc_AddMember( &Data, pInitParams->nBands * sizeof(Biquad_1I_Order2_Taps_t) );
- InstAlloc_AddMember( &Data, pInitParams->nBands * sizeof(QPD_Taps_t) );
-#else
InstAlloc_AddMember( &Data, pInitParams->nBands * sizeof(Biquad_1I_Order2_FLOAT_Taps_t) );
InstAlloc_AddMember( &Data, pInitParams->nBands * sizeof(QPD_FLOAT_Taps_t) );
-#endif
pMemoryTable->Region[LVPSA_MEMREGION_PERSISTENT_DATA].Size = InstAlloc_GetTotal(&Data);
pMemoryTable->Region[LVPSA_MEMREGION_PERSISTENT_DATA].Type = LVPSA_PERSISTENT_DATA;
pMemoryTable->Region[LVPSA_MEMREGION_PERSISTENT_DATA].pBaseAddress = LVM_NULL;
diff --git a/media/libeffects/lvm/lib/SpectrumAnalyzer/src/LVPSA_Private.h b/media/libeffects/lvm/lib/SpectrumAnalyzer/src/LVPSA_Private.h
index bce23c9..61987b5 100644
--- a/media/libeffects/lvm/lib/SpectrumAnalyzer/src/LVPSA_Private.h
+++ b/media/libeffects/lvm/lib/SpectrumAnalyzer/src/LVPSA_Private.h
@@ -23,9 +23,6 @@
#include "LVPSA_QPD.h"
#include "LVM_Macros.h"
-
-
-
/**********************************************************************************
CONSTANT DEFINITIONS
***********************************************************************************/
@@ -40,11 +37,7 @@
#define LVPSA_MEMREGION_PERSISTENT_COEF 1 /* Offset to persistent coefficients memory region in memory table */
#define LVPSA_MEMREGION_PERSISTENT_DATA 2 /* Offset to persistent taps memory region in memory table */
#define LVPSA_MEMREGION_SCRATCH 3 /* Offset to scratch memory region in memory table */
-#ifndef HIGHER_FS
-#define LVPSA_NR_SUPPORTED_RATE 9 /* From 8000Hz to 48000Hz*/
-#else
#define LVPSA_NR_SUPPORTED_RATE 13 /* From 8000Hz to 192000Hz*/
-#endif
#define LVPSA_NR_SUPPORTED_SPEED 3 /* LOW, MEDIUM, HIGH */
#define LVPSA_MAXBUFFERDURATION 4000 /* Maximum length in ms of the levels buffer */
@@ -74,7 +67,6 @@
#define LVPSA_InternalRefreshTimeInv 0x0666 /* 1/20ms left shifted by 15 */
#define LVPSA_InternalRefreshTimeShift 15
-
/* Precision of the filter */
typedef enum
{
@@ -93,12 +85,6 @@
LVPSA_MemTab_t MemoryTable;
LVPSA_BPFilterPrecision_en *pBPFiltersPrecision; /* Points a nBands elements array that contains the filter precision for each band */
-#ifndef BUILD_FLOAT
- Biquad_Instance_t *pBP_Instances; /* Points a nBands elements array that contains the band pass filter instance for each band */
- Biquad_1I_Order2_Taps_t *pBP_Taps; /* Points a nBands elements array that contains the band pass filter taps for each band */
- QPD_State_t *pQPD_States; /* Points a nBands elements array that contains the QPD filter instance for each band */
- QPD_Taps_t *pQPD_Taps; /* Points a nBands elements array that contains the QPD filter taps for each band */
-#else
Biquad_FLOAT_Instance_t *pBP_Instances;
/* Points a nBands elements array that contains the band pass filter taps for each band */
Biquad_1I_Order2_FLOAT_Taps_t *pBP_Taps;
@@ -106,17 +92,11 @@
QPD_FLOAT_State_t *pQPD_States;
/* Points a nBands elements array that contains the QPD filter taps for each band */
QPD_FLOAT_Taps_t *pQPD_Taps;
-#endif
-#ifndef BUILD_FLOAT
- LVM_UINT16 *pPostGains; /* Points a nBands elements array that contains the post-filter gains for each band */
-#else
/* Points a nBands elements array that contains the post-filter gains for each band */
LVM_FLOAT *pPostGains;
-#endif
LVPSA_FilterParam_t *pFiltersParams; /* Copy of the filters parameters from the input parameters */
-
LVM_UINT16 nSamplesBufferUpdate; /* Number of samples to make 20ms */
LVM_INT32 BufferUpdateSamplesCount; /* Counter used to know when to put a new value in the buffer */
LVM_UINT16 nRelevantFilters; /* Number of relevent filters depending on sampling frequency and bands center frequency */
@@ -137,8 +117,6 @@
}LVPSA_InstancePr_t, *pLVPSA_InstancePr_t;
-
-
/**********************************************************************************
FUNCTIONS PROTOTYPE
***********************************************************************************/
@@ -159,5 +137,4 @@
/************************************************************************************/
LVPSA_RETURN LVPSA_ApplyNewSettings (LVPSA_InstancePr_t *pInst);
-
#endif /* _LVPSA_PRIVATE_H */
diff --git a/media/libeffects/lvm/lib/SpectrumAnalyzer/src/LVPSA_Process.cpp b/media/libeffects/lvm/lib/SpectrumAnalyzer/src/LVPSA_Process.cpp
index 61899fe..81a88c5 100644
--- a/media/libeffects/lvm/lib/SpectrumAnalyzer/src/LVPSA_Process.cpp
+++ b/media/libeffects/lvm/lib/SpectrumAnalyzer/src/LVPSA_Process.cpp
@@ -54,7 +54,6 @@
/* otherwise Error due to bad parameters */
/* */
/************************************************************************************/
-#ifdef BUILD_FLOAT
LVPSA_RETURN LVPSA_Process ( pLVPSA_Handle_t hInstance,
LVM_FLOAT *pLVPSA_InputSamples,
LVM_UINT16 InputBlockSize,
@@ -121,7 +120,6 @@
break;
}
-
LVPSA_QPD_Process_Float ( pLVPSA_Inst,
pScratch + InputBlockSize,
(LVM_INT16)InputBlockSize,
@@ -143,95 +141,6 @@
return(LVPSA_OK);
}
-#else
-LVPSA_RETURN LVPSA_Process ( pLVPSA_Handle_t hInstance,
- LVM_INT16 *pLVPSA_InputSamples,
- LVM_UINT16 InputBlockSize,
- LVPSA_Time AudioTime )
-
-{
- LVPSA_InstancePr_t *pLVPSA_Inst = (LVPSA_InstancePr_t*)hInstance;
- LVM_INT16 *pScratch;
- LVM_INT16 ii;
- LVM_INT32 AudioTimeInc;
- extern LVM_UINT32 LVPSA_SampleRateInvTab[];
- LVM_UINT8 *pWrite_Save; /* Position of the write pointer at the beginning of the process */
-
- /******************************************************************************
- CHECK PARAMETERS
- *******************************************************************************/
- if(hInstance == LVM_NULL || pLVPSA_InputSamples == LVM_NULL)
- {
- return(LVPSA_ERROR_NULLADDRESS);
- }
- if(InputBlockSize == 0 || InputBlockSize > pLVPSA_Inst->MaxInputBlockSize)
- {
- return(LVPSA_ERROR_INVALIDPARAM);
- }
-
- pScratch = (LVM_INT16*)pLVPSA_Inst->MemoryTable.Region[LVPSA_MEMREGION_SCRATCH].pBaseAddress;
- pWrite_Save = pLVPSA_Inst->pSpectralDataBufferWritePointer;
-
- /******************************************************************************
- APPLY NEW SETTINGS IF NEEDED
- *******************************************************************************/
- if (pLVPSA_Inst->bControlPending == LVM_TRUE)
- {
- pLVPSA_Inst->bControlPending = 0;
- LVPSA_ApplyNewSettings( pLVPSA_Inst);
- }
-
- /******************************************************************************
- PROCESS SAMPLES
- *******************************************************************************/
- /* Put samples in range [-0.5;0.5[ for BP filters (see Biquads documentation) */
- Copy_16( pLVPSA_InputSamples,pScratch,(LVM_INT16)InputBlockSize);
- Shift_Sat_v16xv16(-1,pScratch,pScratch,(LVM_INT16)InputBlockSize);
-
- for (ii = 0; ii < pLVPSA_Inst->nRelevantFilters; ii++)
- {
- switch(pLVPSA_Inst->pBPFiltersPrecision[ii])
- {
- case LVPSA_SimplePrecisionFilter:
- BP_1I_D16F16C14_TRC_WRA_01 ( &pLVPSA_Inst->pBP_Instances[ii],
- pScratch,
- pScratch + InputBlockSize,
- (LVM_INT16)InputBlockSize);
- break;
-
- case LVPSA_DoublePrecisionFilter:
- BP_1I_D16F32C30_TRC_WRA_01 ( &pLVPSA_Inst->pBP_Instances[ii],
- pScratch,
- pScratch + InputBlockSize,
- (LVM_INT16)InputBlockSize);
- break;
- default:
- break;
- }
-
-
- LVPSA_QPD_Process ( pLVPSA_Inst,
- pScratch + InputBlockSize,
- (LVM_INT16)InputBlockSize,
- ii);
- }
-
- /******************************************************************************
- UPDATE SpectralDataBufferAudioTime
- *******************************************************************************/
-
- if(pLVPSA_Inst->pSpectralDataBufferWritePointer != pWrite_Save)
- {
- MUL32x32INTO32((AudioTime + (LVM_INT32)((LVM_INT32)pLVPSA_Inst->LocalSamplesCount*1000)),
- (LVM_INT32)LVPSA_SampleRateInvTab[pLVPSA_Inst->CurrentParams.Fs],
- AudioTimeInc,
- LVPSA_FsInvertShift)
- pLVPSA_Inst->SpectralDataBufferAudioTime = AudioTime + AudioTimeInc;
- }
-
- return(LVPSA_OK);
-}
-#endif
/************************************************************************************/
/* */
@@ -269,7 +178,6 @@
return(LVPSA_ERROR_NULLADDRESS);
}
-
/* First find the place where to look in the status buffer */
if(GetSpectrumAudioTime <= pLVPSA_Inst->SpectralDataBufferAudioTime)
{
@@ -320,7 +228,6 @@
pRead = pLVPSA_Inst->pSpectralDataBufferWritePointer - StatusDelta * pLVPSA_Inst->nBands;
}
-
/* Read the status buffer and fill the output buffers */
for(ii = 0; ii < pLVPSA_Inst->nBands; ii++)
{
diff --git a/media/libeffects/lvm/lib/SpectrumAnalyzer/src/LVPSA_QPD.h b/media/libeffects/lvm/lib/SpectrumAnalyzer/src/LVPSA_QPD.h
index 552703b..609a485 100644
--- a/media/libeffects/lvm/lib/SpectrumAnalyzer/src/LVPSA_QPD.h
+++ b/media/libeffects/lvm/lib/SpectrumAnalyzer/src/LVPSA_QPD.h
@@ -20,22 +20,18 @@
#include "LVM_Types.h"
-
-
typedef struct
{
LVM_INT32 *pDelay; /* pointer to the delayed samples (data of 32 bits) */
LVM_INT32 Coefs[2]; /* pointer to the filter coefficients */
}QPD_State_t, *pQPD_State_t;
-#ifdef BUILD_FLOAT
typedef struct
{
/* pointer to the delayed samples (data of 32 bits) */
LVM_FLOAT *pDelay;
LVM_FLOAT Coefs[2]; /* pointer to the filter coefficients */
}QPD_FLOAT_State_t, *pQPD_FLOAT_State_t;
-#endif
typedef struct
{
@@ -44,15 +40,12 @@
} QPD_C32_Coefs, *PQPD_C32_Coefs;
-#ifdef BUILD_FLOAT
typedef struct
{
LVM_FLOAT KP; /*should store a0*/
LVM_FLOAT KM; /*should store b2*/
} QPD_FLOAT_Coefs, *PQPD_FLOAT_Coefs;
-#endif
-
typedef struct
{
@@ -60,14 +53,12 @@
} QPD_Taps_t, *pQPD_Taps_t;
-#ifdef BUILD_FLOAT
typedef struct
{
LVM_FLOAT Storage[1];
} QPD_FLOAT_Taps_t, *pQPD_FLOAT_Taps_t;
-#endif
/************************************************************************************/
/* */
/* FUNCTION: LVPSA_QPD_Process */
@@ -86,12 +77,10 @@
LVM_INT16 numSamples,
LVM_INT16 BandIndex);
-#ifdef BUILD_FLOAT
void LVPSA_QPD_Process_Float ( void *hInstance,
LVM_FLOAT *pInSamps,
LVM_INT16 numSamples,
LVM_INT16 BandIndex);
-#endif
/************************************************************************************/
/* */
/* FUNCTION: LVPSA_QPD_Init */
@@ -110,12 +99,10 @@
void LVPSA_QPD_Init ( QPD_State_t *pInstance,
QPD_Taps_t *pTaps,
QPD_C32_Coefs *pCoef );
-#ifdef BUILD_FLOAT
void LVPSA_QPD_Init_Float ( QPD_FLOAT_State_t *pInstance,
QPD_FLOAT_Taps_t *pTaps,
QPD_FLOAT_Coefs *pCoef );
-#endif
#endif
diff --git a/media/libeffects/lvm/lib/SpectrumAnalyzer/src/LVPSA_QPD_Init.cpp b/media/libeffects/lvm/lib/SpectrumAnalyzer/src/LVPSA_QPD_Init.cpp
index 2cc32ab..2dbf694 100644
--- a/media/libeffects/lvm/lib/SpectrumAnalyzer/src/LVPSA_QPD_Init.cpp
+++ b/media/libeffects/lvm/lib/SpectrumAnalyzer/src/LVPSA_QPD_Init.cpp
@@ -41,7 +41,6 @@
pQPD_State->Coefs[1] = pCoef->KM;
}
-#ifdef BUILD_FLOAT
void LVPSA_QPD_Init_Float ( pQPD_FLOAT_State_t pQPD_State,
QPD_FLOAT_Taps_t *pTaps,
QPD_FLOAT_Coefs *pCoef )
@@ -50,4 +49,3 @@
pQPD_State->Coefs[0] = ((LVM_FLOAT)pCoef->KP);
pQPD_State->Coefs[1] = ((LVM_FLOAT)pCoef->KM);
}
-#endif
diff --git a/media/libeffects/lvm/lib/SpectrumAnalyzer/src/LVPSA_QPD_Process.cpp b/media/libeffects/lvm/lib/SpectrumAnalyzer/src/LVPSA_QPD_Process.cpp
index e233172..8805420 100644
--- a/media/libeffects/lvm/lib/SpectrumAnalyzer/src/LVPSA_QPD_Process.cpp
+++ b/media/libeffects/lvm/lib/SpectrumAnalyzer/src/LVPSA_QPD_Process.cpp
@@ -39,12 +39,10 @@
LVM_INT16 BandIndex,
LVM_INT16 Value );
-#ifdef BUILD_FLOAT
void LVPSA_QPD_WritePeak_Float( pLVPSA_InstancePr_t pLVPSA_Inst,
LVM_UINT8 **ppWrite,
LVM_INT16 BandIndex,
LVM_FLOAT Value );
-#endif
/************************************************************************************/
/* */
/* FUNCTION: LVPSA_QPD_Process */
@@ -58,127 +56,6 @@
/* RETURNS: void */
/* */
/************************************************************************************/
-#ifndef BUILD_FLOAT
-void LVPSA_QPD_Process ( void *hInstance,
- LVM_INT16 *pInSamps,
- LVM_INT16 numSamples,
- LVM_INT16 BandIndex)
-{
-
- /******************************************************************************
- PARAMETERS
- *******************************************************************************/
- LVPSA_InstancePr_t *pLVPSA_Inst = (LVPSA_InstancePr_t*)hInstance;
- QPD_State_t *pQPDState = (QPD_State_t*)&pLVPSA_Inst->pQPD_States[BandIndex];
-
- /* Pointer to taps */
- LVM_INT32* pDelay = pQPDState->pDelay;
-
- /* Parameters needed during quasi peak calculations */
- LVM_INT32 X0;
- LVM_INT32 temp,temp2;
- LVM_INT32 accu;
- LVM_INT16 Xg0;
- LVM_INT16 D0;
- LVM_INT16 V0 = (LVM_INT16)(*pDelay);
-
- /* Filter's coef */
- LVM_INT32 Kp = pQPDState->Coefs[0];
- LVM_INT32 Km = pQPDState->Coefs[1];
-
- LVM_INT16 ii = numSamples;
-
- LVM_UINT8 *pWrite = pLVPSA_Inst->pSpectralDataBufferWritePointer;
- LVM_INT32 BufferUpdateSamplesCount = pLVPSA_Inst->BufferUpdateSamplesCount;
- LVM_UINT16 DownSamplingFactor = pLVPSA_Inst->DownSamplingFactor;
-
- /******************************************************************************
- INITIALIZATION
- *******************************************************************************/
- /* Correct the pointer to take the first down sampled signal sample */
- pInSamps += pLVPSA_Inst->DownSamplingCount;
- /* Correct also the number of samples */
- ii = (LVM_INT16)(ii - (LVM_INT16)pLVPSA_Inst->DownSamplingCount);
-
- while (ii > 0)
- {
- /* Apply post gain */
- X0 = ((*pInSamps) * pLVPSA_Inst->pPostGains[BandIndex]) >> (LVPSA_GAINSHIFT-1); /* - 1 to compensate scaling in process function*/
- pInSamps = pInSamps + DownSamplingFactor;
-
- /* Saturate and take absolute value */
- if(X0 < 0)
- X0 = -X0;
- if (X0 > 0x7FFF)
- Xg0 = 0x7FFF;
- else
- Xg0 = (LVM_INT16)(X0);
-
-
- /* Quasi peak filter calculation */
- D0 = (LVM_INT16)(Xg0 - V0);
-
- temp2 = (LVM_INT32)D0;
- MUL32x32INTO32(temp2,Kp,accu,31);
-
- D0 = (LVM_INT16)(D0>>1);
- if (D0 < 0){
- D0 = (LVM_INT16)(-D0);
- }
-
- temp2 = (LVM_INT32)D0;
- MUL32x32INTO32((LVM_INT32)D0,Km,temp,31);
- accu +=temp + Xg0;
-
- if (accu > 0x7FFF)
- accu = 0x7FFF;
- else if(accu < 0)
- accu = 0x0000;
-
- V0 = (LVM_INT16)accu;
-
- if(((pLVPSA_Inst->nSamplesBufferUpdate - BufferUpdateSamplesCount) < DownSamplingFactor))
- {
- LVPSA_QPD_WritePeak( pLVPSA_Inst,
- &pWrite,
- BandIndex,
- V0);
- BufferUpdateSamplesCount -= pLVPSA_Inst->nSamplesBufferUpdate;
- pLVPSA_Inst->LocalSamplesCount = (LVM_UINT16)(numSamples - ii);
- }
- BufferUpdateSamplesCount+=DownSamplingFactor;
-
- ii = (LVM_INT16)(ii-DownSamplingFactor);
-
- }
-
- /* Store last taps in memory */
- *pDelay = (LVM_INT32)(V0);
-
- /* If this is the last call to the function after last band processing,
- update the parameters. */
- if(BandIndex == (pLVPSA_Inst->nRelevantFilters-1))
- {
- pLVPSA_Inst->pSpectralDataBufferWritePointer = pWrite;
- /* Adjustment for 11025Hz input, 220,5 is normally
- the exact number of samples for 20ms.*/
- if((pLVPSA_Inst->pSpectralDataBufferWritePointer != pWrite)&&(pLVPSA_Inst->CurrentParams.Fs == LVM_FS_11025))
- {
- if(pLVPSA_Inst->nSamplesBufferUpdate == 220)
- {
- pLVPSA_Inst->nSamplesBufferUpdate = 221;
- }
- else
- {
- pLVPSA_Inst->nSamplesBufferUpdate = 220;
- }
- }
- pLVPSA_Inst->pSpectralDataBufferWritePointer = pWrite;
- pLVPSA_Inst->BufferUpdateSamplesCount = BufferUpdateSamplesCount;
- pLVPSA_Inst->DownSamplingCount = (LVM_UINT16)(-ii);
- }
-}
-#else
void LVPSA_QPD_Process_Float ( void *hInstance,
LVM_FLOAT *pInSamps,
LVM_INT16 numSamples,
@@ -235,7 +112,6 @@
else
Xg0 =X0;
-
/* Quasi peak filter calculation */
D0 = Xg0 - V0;
@@ -302,7 +178,6 @@
pLVPSA_Inst->DownSamplingCount = (LVM_UINT16)(-ii);
}
}
-#endif
/************************************************************************************/
/* */
/* FUNCTION: LVPSA_QPD_WritePeak */
@@ -326,7 +201,6 @@
{
LVM_UINT8 *pWrite = *ppWrite;
-
/* Write the value and update the write pointer */
*(pWrite + BandIndex) = (LVM_UINT8)(Value>>7);
pWrite += pLVPSA_Inst->nBands;
@@ -338,7 +212,6 @@
*ppWrite = pWrite;
}
-#ifdef BUILD_FLOAT
void LVPSA_QPD_WritePeak_Float( pLVPSA_InstancePr_t pLVPSA_Inst,
LVM_UINT8 **ppWrite,
LVM_INT16 BandIndex,
@@ -357,4 +230,3 @@
*ppWrite = pWrite;
}
-#endif
diff --git a/media/libeffects/lvm/lib/SpectrumAnalyzer/src/LVPSA_Tables.cpp b/media/libeffects/lvm/lib/SpectrumAnalyzer/src/LVPSA_Tables.cpp
index 045a502..9f0aa02 100644
--- a/media/libeffects/lvm/lib/SpectrumAnalyzer/src/LVPSA_Tables.cpp
+++ b/media/libeffects/lvm/lib/SpectrumAnalyzer/src/LVPSA_Tables.cpp
@@ -15,7 +15,6 @@
* limitations under the License.
*/
-
/************************************************************************************/
/* */
/* Includes */
@@ -35,17 +34,6 @@
* Sample rate table for converting between the enumerated type and the actual
* frequency
*/
-#ifndef HIGHER_FS
-const LVM_UINT16 LVPSA_SampleRateTab[] = { 8000, /* 8kS/s */
- 11025,
- 12000,
- 16000,
- 22050,
- 24000,
- 32000,
- 44100,
- 48000}; /* 48kS/s */
-#else
const LVM_UINT32 LVPSA_SampleRateTab[] = { 8000, /* 8kS/s */
11025,
12000,
@@ -59,7 +47,6 @@
96000,
176400,
192000}; /* 192kS/s */
-#endif
/************************************************************************************/
/* */
@@ -80,16 +67,12 @@
67109,
48696,
44739
-#ifdef HIGHER_FS
,24348
,22369
,12174
,11185 /* 192kS/s */
-#endif
};
-
-
/************************************************************************************/
/* */
/* Number of samples in 20ms */
@@ -109,12 +92,10 @@
640,
882,
960
-#ifdef HIGHER_FS
,1764
,1920
,3528
,3840 /* 192kS/s */
-#endif
};
/************************************************************************************/
/* */
@@ -134,15 +115,12 @@
21, /* 32000 S/s */
30, /* 44100 S/s */
32 /* 48000 S/s */
-#ifdef HIGHER_FS
,60 /* 88200 S/s */
,64 /* 96000 S/s */
,120 /* 176400 S/s */
,128 /*192000 S/s */
-#endif
};
-
/************************************************************************************/
/* */
/* Coefficient calculation tables */
@@ -161,15 +139,12 @@
6588,
4781,
4392
-#ifdef HIGHER_FS
,2390
,2196
,1195
,1098 /* 192kS/s */
-#endif
};
-#ifdef BUILD_FLOAT
const LVM_FLOAT LVPSA_Float_TwoPiOnFsTable[] = { 0.8042847f, /* 8kS/s */
0.5836054f,
0.5361796f,
@@ -179,15 +154,12 @@
0.2010559f,
0.1459089f,
0.1340372f
-#ifdef HIGHER_FS
,0.0729476f
,0.0670186f
,0.0364738f
,0.0335093f /* 192kS/s */
-#endif
};
-#endif
/*
* Gain table
*/
@@ -223,7 +195,6 @@
10264,
11576}; /* +15dB gain */
-#ifdef BUILD_FLOAT
const LVM_FLOAT LVPSA_Float_GainTable[]={ 0.177734375f, /* -15dB gain */
0.199218750f,
0.223632812f,
@@ -255,7 +226,6 @@
4.466796875f,
5.011718750f,
5.652343750f}; /* +15dB gain */
-#endif
/************************************************************************************/
/* */
/* Cosone polynomial coefficients */
@@ -278,7 +248,6 @@
-2671, /* a3 */
23730, /* a4 */
-9490}; /* a5 */
-#ifdef BUILD_FLOAT
const LVM_FLOAT LVPSA_Float_CosCoef[] = { 3, /* Shifts */
0.1250038f, /* a0 */
-0.0010986f, /* a1 */
@@ -286,7 +255,6 @@
-0.0815149f, /* a3 */
0.7242042f, /* a4 */
-0.2896206f}; /* a5 */
-#endif
/*
* Coefficients for calculating the cosine error with the equation:
*
@@ -306,13 +274,11 @@
-6, /* a1 */
16586, /* a2 */
-44}; /* a3 */
-#ifdef BUILD_FLOAT
const LVM_FLOAT LVPSA_Float_DPCosCoef[] = {1.0f, /* Shifts */
0.0f, /* a0 */
-0.00008311f, /* a1 */
0.50617999f, /* a2 */
-0.00134281f}; /* a3 */
-#endif
/************************************************************************************/
/* */
/* Quasi peak filter coefficients table */
@@ -352,7 +318,6 @@
{(LVM_INT32)0xA375B2C6,0x1E943BBC},
{(LVM_INT32)0xA2E1E950,0x1E2A532E}}; /* 48kS/s */
-#ifdef BUILD_FLOAT
const QPD_FLOAT_Coefs LVPSA_QPD_Float_Coefs[] = {
/* 8kS/s */ /* LVPSA_SPEED_LOW */
@@ -366,12 +331,10 @@
{-0.9931269618682563f,0.0067592649720609f},
/* 48kS/s */
{-0.9932638457976282f,0.0066249934025109f},
-#ifdef HIGHER_FS
{-0.9931269618682563f,0.0067592649720609f},
{-0.9932638457976282f,0.0066249934025109f},
{-0.9931269618682563f,0.0067592649720609f},
{-0.9932638457976282f,0.0066249934025109f},
-#endif
/* 8kS/s */ /* LVPSA_SPEED_MEDIUM */
{-0.9568079425953329f,0.0418742666952312f},
{-0.9561413046903908f,0.0425090822391212f},
@@ -384,12 +347,10 @@
{-0.9531011912040412f,0.0453995238058269f},
/* 48kS/s */
{-0.9540119562298059f,0.0445343819446862f},
-#ifdef HIGHER_FS
{-0.9531011912040412f,0.0453995238058269f},
{-0.9540119562298059f,0.0445343819446862f},
{-0.9531011912040412f,0.0453995238058269f},
{-0.9540119562298059f,0.0445343819446862f},
-#endif
/* 8kS/s */ /* LVPSA_SPEED_HIGH */
{-0.7415186790749431f,0.2254409026354551f},
{-0.7381451204419136f,0.2279209652915597f},
@@ -401,11 +362,8 @@
{-0.7229706319049001f,0.2388987224549055f},
/* 48kS/s */
{-0.7274807319045067f,0.2356666540727019f}
-#ifdef HIGHER_FS
,{-0.7229706319049001f,0.2388987224549055f}
,{-0.7274807319045067f,0.2356666540727019f}
,{-0.7229706319049001f,0.2388987224549055f}
,{-0.7274807319045067f,0.2356666540727019f}
-#endif
};
-#endif
diff --git a/media/libeffects/lvm/lib/SpectrumAnalyzer/src/LVPSA_Tables.h b/media/libeffects/lvm/lib/SpectrumAnalyzer/src/LVPSA_Tables.h
index caaf3ba..65872fe 100644
--- a/media/libeffects/lvm/lib/SpectrumAnalyzer/src/LVPSA_Tables.h
+++ b/media/libeffects/lvm/lib/SpectrumAnalyzer/src/LVPSA_Tables.h
@@ -27,11 +27,7 @@
* Sample rate table for converting between the enumerated type and the actual
* frequency
*/
-#ifndef HIGHER_FS
-extern const LVM_UINT16 LVPSA_SampleRateTab[];
-#else
extern const LVM_UINT32 LVPSA_SampleRateTab[];
-#endif
/************************************************************************************/
/* */
diff --git a/media/libeffects/lvm/lib/StereoWidening/lib/LVCS.h b/media/libeffects/lvm/lib/StereoWidening/lib/LVCS.h
index 174c86a..0adfd1b 100644
--- a/media/libeffects/lvm/lib/StereoWidening/lib/LVCS.h
+++ b/media/libeffects/lvm/lib/StereoWidening/lib/LVCS.h
@@ -56,8 +56,6 @@
#ifndef LVCS_H
#define LVCS_H
-
-
/****************************************************************************************/
/* */
/* Includes */
@@ -67,7 +65,6 @@
#include "LVM_Types.h"
#include "LVM_Common.h"
-
/****************************************************************************************/
/* */
/* Definitions */
@@ -90,7 +87,6 @@
#define LVCS_EVENT_NONE 0x0000 /* Not a valid event */
#define LVCS_EVENT_ALGOFF 0x0001 /* CS has completed switch off */
-
/****************************************************************************************/
/* */
/* Types */
@@ -100,7 +96,6 @@
/* Instance handle */
typedef void *LVCS_Handle_t;
-
/* Operating modes */
typedef enum
{
@@ -109,7 +104,6 @@
LVCS_MAX = LVM_MAXENUM
} LVCS_Modes_en;
-
/* Memory Types */
typedef enum
{
@@ -120,7 +114,6 @@
LVCS_MEMORYTYPE_MAX = LVM_MAXENUM
} LVCS_MemoryTypes_en;
-
/* Function return status */
typedef enum
{
@@ -132,7 +125,6 @@
LVCS_STATUSMAX = LVM_MAXENUM
} LVCS_ReturnStatus_en;
-
/*
* Source data formats
*/
@@ -143,7 +135,6 @@
LVCS_SOURCEMAX = LVM_MAXENUM
} LVCS_SourceFormat_en;
-
/*
* Supported output devices
*/
@@ -169,7 +160,6 @@
void *pTable8;
} LVCS_CSMS_Coef_Tables_t;
-
/****************************************************************************************/
/* */
/* Structures */
@@ -184,14 +174,12 @@
void *pBaseAddress; /* Pointer to the region base address */
} LVCS_MemoryRegion_t;
-
/* Memory table containing the region definitions */
typedef struct
{
LVCS_MemoryRegion_t Region[LVCS_NR_MEMORY_REGIONS]; /* One definition for each region */
} LVCS_MemTab_t;
-
/* Concert Sound parameter structure */
typedef struct
{
@@ -207,7 +195,6 @@
#endif
} LVCS_Params_t;
-
/* Concert Sound Capability structure */
typedef struct
{
@@ -220,7 +207,6 @@
} LVCS_Capabilities_t;
-
/****************************************************************************************/
/* */
/* Function Prototypes */
@@ -267,7 +253,6 @@
LVCS_MemTab_t *pMemoryTable,
LVCS_Capabilities_t *pCapabilities);
-
/****************************************************************************************/
/* */
/* FUNCTION: LVCS_Init */
@@ -305,7 +290,6 @@
LVCS_MemTab_t *pMemoryTable,
LVCS_Capabilities_t *pCapabilities);
-
/****************************************************************************************/
/* */
/* FUNCTION: LVCS_GetParameters */
@@ -329,7 +313,6 @@
LVCS_ReturnStatus_en LVCS_GetParameters(LVCS_Handle_t hInstance,
LVCS_Params_t *pParams);
-
/****************************************************************************************/
/* */
/* FUNCTION: LVCS_Control */
@@ -352,7 +335,6 @@
LVCS_ReturnStatus_en LVCS_Control(LVCS_Handle_t hInstance,
LVCS_Params_t *pParams);
-
/****************************************************************************************/
/* */
/* FUNCTION: LVCS_Process */
@@ -374,17 +356,9 @@
/* NOTES: */
/* */
/****************************************************************************************/
-#ifdef BUILD_FLOAT
LVCS_ReturnStatus_en LVCS_Process(LVCS_Handle_t hInstance,
const LVM_FLOAT *pInData,
LVM_FLOAT *pOutData,
LVM_UINT16 NumSamples);
-#else
-LVCS_ReturnStatus_en LVCS_Process(LVCS_Handle_t hInstance,
- const LVM_INT16 *pInData,
- LVM_INT16 *pOutData,
- LVM_UINT16 NumSamples);
-#endif
-
#endif /* LVCS_H */
diff --git a/media/libeffects/lvm/lib/StereoWidening/src/LVCS_BypassMix.cpp b/media/libeffects/lvm/lib/StereoWidening/src/LVCS_BypassMix.cpp
index 29e3c9e..ba152c0 100644
--- a/media/libeffects/lvm/lib/StereoWidening/src/LVCS_BypassMix.cpp
+++ b/media/libeffects/lvm/lib/StereoWidening/src/LVCS_BypassMix.cpp
@@ -70,19 +70,12 @@
{
LVM_UINT16 Offset;
-#ifndef BUILD_FLOAT
- LVM_UINT32 Gain;
- LVM_INT32 Current;
-#else
LVM_FLOAT Gain;
LVM_FLOAT Current;
-#endif
LVCS_Instance_t *pInstance = (LVCS_Instance_t *)hInstance;
LVCS_BypassMix_t *pConfig = (LVCS_BypassMix_t *)&pInstance->BypassMix;
const Gain_t *pOutputGainTable;
-
-
/*
* Set the transition gain
*/
@@ -91,11 +84,7 @@
&& (pInstance->MSTarget1 != 0x7FFF) /* this indicates an off->on transtion */
)
{
-#ifndef BUILD_FLOAT
- pInstance->TransitionGain = pParams->EffectLevel;
-#else
pInstance->TransitionGain = ((LVM_FLOAT)pParams->EffectLevel / 32767);
-#endif
}
else
{
@@ -112,38 +101,21 @@
/*
* Setup the mixer gain for the processed path
*/
-#ifndef BUILD_FLOAT
- Gain = (LVM_UINT32)(pOutputGainTable[Offset].Loss * pInstance->TransitionGain);
-#else
Gain = (LVM_FLOAT)(pOutputGainTable[Offset].Loss * pInstance->TransitionGain);
-#endif
pConfig->Mixer_Instance.MixerStream[0].CallbackParam = 0;
pConfig->Mixer_Instance.MixerStream[0].pCallbackHandle = LVM_NULL;
pConfig->Mixer_Instance.MixerStream[0].pCallBack = LVM_NULL;
pConfig->Mixer_Instance.MixerStream[0].CallbackSet=1;
-#ifndef BUILD_FLOAT
- Current = LVC_Mixer_GetCurrent(&pConfig->Mixer_Instance.MixerStream[0]);
- LVC_Mixer_Init(&pConfig->Mixer_Instance.MixerStream[0],(LVM_INT32)(Gain >> 15),Current);
- LVC_Mixer_VarSlope_SetTimeConstant(&pConfig->Mixer_Instance.MixerStream[0],LVCS_BYPASS_MIXER_TC,pParams->SampleRate,2);
-#else
Current = LVC_Mixer_GetCurrent(&pConfig->Mixer_Instance.MixerStream[0]);
LVC_Mixer_Init(&pConfig->Mixer_Instance.MixerStream[0], (LVM_FLOAT)(Gain), Current);
LVC_Mixer_VarSlope_SetTimeConstant(&pConfig->Mixer_Instance.MixerStream[0],
LVCS_BYPASS_MIXER_TC, pParams->SampleRate, 2);
-#endif
/*
* Setup the mixer gain for the unprocessed path
*/
-#ifndef BUILD_FLOAT
- Gain = (LVM_UINT32)(pOutputGainTable[Offset].Loss * (0x7FFF - pInstance->TransitionGain));
- Gain = (LVM_UINT32)pOutputGainTable[Offset].UnprocLoss * (Gain >> 15);
- Current = LVC_Mixer_GetCurrent(&pConfig->Mixer_Instance.MixerStream[1]);
- LVC_Mixer_Init(&pConfig->Mixer_Instance.MixerStream[1],(LVM_INT32)(Gain >> 15),Current);
- LVC_Mixer_VarSlope_SetTimeConstant(&pConfig->Mixer_Instance.MixerStream[1],LVCS_BYPASS_MIXER_TC,pParams->SampleRate,2);
-#else
Gain = (LVM_FLOAT)(pOutputGainTable[Offset].Loss * (1.0 - \
(LVM_FLOAT)pInstance->TransitionGain));
Gain = (LVM_FLOAT)pOutputGainTable[Offset].UnprocLoss * Gain;
@@ -151,7 +123,6 @@
LVC_Mixer_Init(&pConfig->Mixer_Instance.MixerStream[1], (LVM_FLOAT)(Gain), Current);
LVC_Mixer_VarSlope_SetTimeConstant(&pConfig->Mixer_Instance.MixerStream[1],
LVCS_BYPASS_MIXER_TC, pParams->SampleRate, 2);
-#endif
pConfig->Mixer_Instance.MixerStream[1].CallbackParam = 0;
pConfig->Mixer_Instance.MixerStream[1].pCallbackHandle = hInstance;
pConfig->Mixer_Instance.MixerStream[1].CallbackSet=1;
@@ -162,50 +133,10 @@
*/
pConfig->Output_Shift = pOutputGainTable[Offset].Shift;
-
/*
* Correct gain for the effect level
*/
{
-#ifndef BUILD_FLOAT
- LVM_INT16 GainCorrect;
- LVM_INT32 Gain1;
- LVM_INT32 Gain2;
-
- Gain1 = LVC_Mixer_GetTarget(&pConfig->Mixer_Instance.MixerStream[0]);
- Gain2 = LVC_Mixer_GetTarget(&pConfig->Mixer_Instance.MixerStream[1]);
- /*
- * Calculate the gain correction
- */
- if (pInstance->Params.CompressorMode == LVM_MODE_ON)
- {
- GainCorrect = (LVM_INT16)( pInstance->VolCorrect.GainMin
- - (((LVM_INT32)pInstance->VolCorrect.GainMin * (LVM_INT32)pInstance->TransitionGain) >> 15)
- + (((LVM_INT32)pInstance->VolCorrect.GainFull * (LVM_INT32)pInstance->TransitionGain) >> 15) );
-
- /*
- * Apply the gain correction and shift, note the result is in Q3.13 format
- */
- Gain1 = (Gain1 * GainCorrect) << 4;
- Gain2 = (Gain2 * GainCorrect) << 4;
- }
- else
- {
- Gain1 = Gain1 << 16;
- Gain2 = Gain2 << 16;
- }
-
-
-
- /*
- * Set the gain values
- */
- pConfig->Output_Shift = pConfig->Output_Shift;
- LVC_Mixer_SetTarget(&pConfig->Mixer_Instance.MixerStream[0],Gain1>>16);
- LVC_Mixer_VarSlope_SetTimeConstant(&pConfig->Mixer_Instance.MixerStream[0],LVCS_BYPASS_MIXER_TC,pParams->SampleRate,2);
- LVC_Mixer_SetTarget(&pConfig->Mixer_Instance.MixerStream[1],Gain2>>16);
- LVC_Mixer_VarSlope_SetTimeConstant(&pConfig->Mixer_Instance.MixerStream[1],LVCS_BYPASS_MIXER_TC,pParams->SampleRate,2);
-#else
LVM_FLOAT GainCorrect;
LVM_FLOAT Gain1;
LVM_FLOAT Gain2;
@@ -241,7 +172,6 @@
LVC_Mixer_SetTarget(&pConfig->Mixer_Instance.MixerStream[1],Gain2);
LVC_Mixer_VarSlope_SetTimeConstant(&pConfig->Mixer_Instance.MixerStream[1],
LVCS_BYPASS_MIXER_TC, pParams->SampleRate, 2);
-#endif
}
return(LVCS_SUCCESS);
@@ -276,15 +206,9 @@
/************************************************************************************/
LVCS_ReturnStatus_en LVCS_BypassMixer(LVCS_Handle_t hInstance,
-#ifndef BUILD_FLOAT
- const LVM_INT16 *pProcessed,
- const LVM_INT16 *pUnprocessed,
- LVM_INT16 *pOutData,
-#else
const LVM_FLOAT *pProcessed,
const LVM_FLOAT *pUnprocessed,
LVM_FLOAT *pOutData,
-#endif
LVM_UINT16 NumSamples)
{
@@ -299,21 +223,6 @@
/*
* Apply the bypass mix
*/
-#ifndef BUILD_FLOAT
- LVC_MixSoft_2St_D16C31_SAT(&pConfig->Mixer_Instance,
- pProcessed,
- (LVM_INT16 *) pUnprocessed,
- pOutData,
- (LVM_INT16)(2*NumSamples));
-
- /*
- * Apply output gain correction shift
- */
- Shift_Sat_v16xv16 ((LVM_INT16)pConfig->Output_Shift,
- (LVM_INT16*)pOutData,
- (LVM_INT16*)pOutData,
- (LVM_INT16)(2*NumSamples)); /* Left and right*/
-#else
LVC_MixSoft_2St_D16C31_SAT(&pConfig->Mixer_Instance,
pProcessed,
(LVM_FLOAT *) pUnprocessed,
@@ -326,13 +235,11 @@
(LVM_FLOAT*)pOutData,
(LVM_FLOAT*)pOutData,
(LVM_INT16)(2 * NumSamples)); /* Left and right*/
-#endif
}
return(LVCS_SUCCESS);
}
-
/************************************************************************************/
/* */
/* FUNCTION: LVCS_MixerCallback */
@@ -368,7 +275,6 @@
}
}
-
if ((pInstance->OutputDevice == LVCS_HEADPHONE) &&
(pInstance->MSTarget0 == 1) &&
(pInstance->bTimerDone == LVM_TRUE)){
@@ -380,5 +286,3 @@
return 1;
}
-
-
diff --git a/media/libeffects/lvm/lib/StereoWidening/src/LVCS_BypassMix.h b/media/libeffects/lvm/lib/StereoWidening/src/LVCS_BypassMix.h
index 6ec2ac5..fcd8ee3 100644
--- a/media/libeffects/lvm/lib/StereoWidening/src/LVCS_BypassMix.h
+++ b/media/libeffects/lvm/lib/StereoWidening/src/LVCS_BypassMix.h
@@ -18,8 +18,6 @@
#ifndef __LVCS_BYPASSMIX_H__
#define __LVCS_BYPASSMIX_H__
-
-
/************************************************************************************/
/* */
/* Includes */
@@ -28,7 +26,6 @@
#include "LVC_Mixer.h"
-
/************************************************************************************/
/* */
/* Structures */
@@ -39,25 +36,11 @@
typedef struct
{
/* Mixer settings */
-#ifdef BUILD_FLOAT
LVMixer3_2St_FLOAT_st Mixer_Instance; /* Mixer instance */
-#else
- LVMixer3_2St_st Mixer_Instance; /* Mixer instance */
-#endif
LVM_UINT16 Output_Shift; /* Correcting gain output shift */
} LVCS_BypassMix_t;
-#ifndef BUILD_FLOAT
-/* Output gain type */
-typedef struct
-{
- /* Output gain settings, Gain = (Loss/32768) * 2^Shift */
- LVM_UINT16 Shift; /* Left shifts required */
- LVM_UINT16 Loss; /* Loss required */
- LVM_UINT16 UnprocLoss; /* Unprocessed path loss */
-} Gain_t;
-#else
typedef struct
{
/* Output gain settings, Gain = (Loss/32768) * 2^Shift */
@@ -65,7 +48,6 @@
LVM_FLOAT Loss; /* Loss required */
LVM_FLOAT UnprocLoss; /* Unprocessed path loss */
} Gain_t;
-#endif
/************************************************************************************/
/* */
/* Function prototypes */
@@ -75,18 +57,10 @@
LVCS_ReturnStatus_en LVCS_BypassMixInit(LVCS_Handle_t hInstance,
LVCS_Params_t *pParams);
-#ifndef BUILD_FLOAT
-LVCS_ReturnStatus_en LVCS_BypassMixer(LVCS_Handle_t hInstance,
- const LVM_INT16 *pProcessed,
- const LVM_INT16 *unProcessed,
- LVM_INT16 *pOutData,
- LVM_UINT16 NumSamples);
-#else
LVCS_ReturnStatus_en LVCS_BypassMixer(LVCS_Handle_t hInstance,
const LVM_FLOAT *pProcessed,
const LVM_FLOAT *unProcessed,
LVM_FLOAT *pOutData,
LVM_UINT16 NumSamples);
-#endif
#endif /* BYPASSMIX_H */
diff --git a/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Control.cpp b/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Control.cpp
index 3bf6ec6..50db03d 100644
--- a/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Control.cpp
+++ b/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Control.cpp
@@ -56,7 +56,6 @@
return(LVCS_SUCCESS);
}
-
/************************************************************************************/
/* */
/* FUNCTION: LVCS_Control */
@@ -120,29 +119,8 @@
pInstance->VolCorrect = pLVCS_VolCorrectTable[Offset];
pInstance->CompressGain = pInstance->VolCorrect.CompMin;
-#ifdef BUILD_FLOAT
LVC_Mixer_Init(&pInstance->BypassMix.Mixer_Instance.MixerStream[0], 0, 0);
-#else
- LVC_Mixer_Init(&pInstance->BypassMix.Mixer_Instance.MixerStream[0],0,0);
-#endif
{
-#ifndef BUILD_FLOAT
- LVM_UINT32 Gain;
- const Gain_t *pOutputGainTable = (Gain_t*)&LVCS_OutputGainTable[0];
- Gain = (LVM_UINT32)(pOutputGainTable[Offset].Loss * LVM_MAXINT_16);
- Gain = (LVM_UINT32)pOutputGainTable[Offset].UnprocLoss * (Gain >> 15);
- Gain=Gain>>15;
- /*
- * Apply the gain correction and shift, note the result is in Q3.13 format
- */
- Gain = (Gain * pInstance->VolCorrect.GainMin) >>12;
-
- LVC_Mixer_Init(&pInstance->BypassMix.Mixer_Instance.MixerStream[1],0,Gain);
- LVC_Mixer_VarSlope_SetTimeConstant(&pInstance->BypassMix.Mixer_Instance.MixerStream[0],
- LVCS_BYPASS_MIXER_TC,pParams->SampleRate,2);
- LVC_Mixer_VarSlope_SetTimeConstant(&pInstance->BypassMix.Mixer_Instance.MixerStream[1],
- LVCS_BYPASS_MIXER_TC,pParams->SampleRate,2);
-#else
LVM_FLOAT Gain;
const Gain_t *pOutputGainTable = (Gain_t*)&LVCS_OutputGainTable[0];
Gain = (LVM_FLOAT)(pOutputGainTable[Offset].Loss);
@@ -158,10 +136,8 @@
LVCS_BYPASS_MIXER_TC, pParams->SampleRate, 2);
LVC_Mixer_VarSlope_SetTimeConstant(&pInstance->BypassMix.Mixer_Instance.MixerStream[1],
LVCS_BYPASS_MIXER_TC, pParams->SampleRate, 2);
-#endif
}
-
err=LVCS_SEnhancerInit(hInstance,
pParams);
@@ -176,7 +152,6 @@
}
-
/*
* Check if the effect level or source format has changed
*/
@@ -243,7 +218,6 @@
pInstance->MSTarget0=0;
}
-
/* Set transition flag */
pInstance->bInOperatingModeTransition = LVM_TRUE;
}
@@ -272,7 +246,6 @@
pInstance->bTimerDone = LVM_TRUE;
-
return;
}
diff --git a/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Equaliser.cpp b/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Equaliser.cpp
index cd53a11..431b7e3 100644
--- a/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Equaliser.cpp
+++ b/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Equaliser.cpp
@@ -53,7 +53,6 @@
/* NOTES: */
/* */
/************************************************************************************/
-#ifdef BUILD_FLOAT
LVCS_ReturnStatus_en LVCS_EqualiserInit(LVCS_Handle_t hInstance,
LVCS_Params_t *pParams)
{
@@ -92,8 +91,7 @@
Coeffs.B2 = (LVM_FLOAT)-pEqualiserCoefTable[Offset].B2;
LoadConst_Float((LVM_INT16)0, /* Value */
- (LVM_FLOAT *)&pData->EqualiserBiquadTaps, /* Destination Cast to void:\
- no dereferencing in function*/
+ (LVM_FLOAT *)&pData->EqualiserBiquadTaps, /* Destination */
/* Number of words */
(LVM_UINT16)(sizeof(pData->EqualiserBiquadTaps) / sizeof(LVM_FLOAT)));
@@ -118,66 +116,6 @@
return(LVCS_SUCCESS);
}
-#else
-LVCS_ReturnStatus_en LVCS_EqualiserInit(LVCS_Handle_t hInstance,
- LVCS_Params_t *pParams)
-{
-
- LVM_UINT16 Offset;
- LVCS_Instance_t *pInstance = (LVCS_Instance_t *)hInstance;
- LVCS_Equaliser_t *pConfig = (LVCS_Equaliser_t *)&pInstance->Equaliser;
- LVCS_Data_t *pData = (LVCS_Data_t *)pInstance->MemoryTable.Region[LVCS_MEMREGION_PERSISTENT_FAST_DATA].pBaseAddress;
- LVCS_Coefficient_t *pCoefficients = (LVCS_Coefficient_t *)pInstance->MemoryTable.Region[LVCS_MEMREGION_PERSISTENT_FAST_COEF].pBaseAddress;
- BQ_C16_Coefs_t Coeffs;
- const BiquadA012B12CoefsSP_t *pEqualiserCoefTable;
-
- /*
- * If the sample rate changes re-initialise the filters
- */
- if ((pInstance->Params.SampleRate != pParams->SampleRate) ||
- (pInstance->Params.SpeakerType != pParams->SpeakerType))
- {
- /*
- * Setup the filter coefficients and clear the history
- */
- Offset = (LVM_UINT16)(pParams->SampleRate + (pParams->SpeakerType * (1+LVM_FS_48000)));
- pEqualiserCoefTable = (BiquadA012B12CoefsSP_t*)&LVCS_EqualiserCoefTable[0];
-
- /* Left and right filters */
- /* Convert incoming coefficients to the required format/ordering */
- Coeffs.A0 = (LVM_INT16) pEqualiserCoefTable[Offset].A0;
- Coeffs.A1 = (LVM_INT16) pEqualiserCoefTable[Offset].A1;
- Coeffs.A2 = (LVM_INT16) pEqualiserCoefTable[Offset].A2;
- Coeffs.B1 = (LVM_INT16)-pEqualiserCoefTable[Offset].B1;
- Coeffs.B2 = (LVM_INT16)-pEqualiserCoefTable[Offset].B2;
-
- LoadConst_16((LVM_INT16)0, /* Value */
- (void *)&pData->EqualiserBiquadTaps, /* Destination Cast to void:\
- no dereferencing in function*/
- (LVM_UINT16)(sizeof(pData->EqualiserBiquadTaps)/sizeof(LVM_INT16))); /* Number of words */
-
- BQ_2I_D16F32Css_TRC_WRA_01_Init(&pCoefficients->EqualiserBiquadInstance,
- &pData->EqualiserBiquadTaps,
- &Coeffs);
-
- /* Callbacks */
- switch(pEqualiserCoefTable[Offset].Scale)
- {
- case 13:
- pConfig->pBiquadCallBack = BQ_2I_D16F32C13_TRC_WRA_01;
- break;
- case 14:
- pConfig->pBiquadCallBack = BQ_2I_D16F32C14_TRC_WRA_01;
- break;
- case 15:
- pConfig->pBiquadCallBack = BQ_2I_D16F32C15_TRC_WRA_01;
- break;
- }
- }
-
- return(LVCS_SUCCESS);
-}
-#endif
/************************************************************************************/
/* */
/* FUNCTION: LVCS_Equaliser */
@@ -197,7 +135,6 @@
/* 1. Always processes in place. */
/* */
/************************************************************************************/
-#ifdef BUILD_FLOAT
LVCS_ReturnStatus_en LVCS_Equaliser(LVCS_Handle_t hInstance,
LVM_FLOAT *pInputOutput,
LVM_UINT16 NumSamples)
@@ -207,11 +144,9 @@
LVCS_Equaliser_t *pConfig = (LVCS_Equaliser_t *)&pInstance->Equaliser;
LVCS_Coefficient_t *pCoefficients;
-
pCoefficients = (LVCS_Coefficient_t *) \
pInstance->MemoryTable.Region[LVCS_MEMREGION_PERSISTENT_FAST_COEF].pBaseAddress;
-
/*
* Check if the equaliser is required
*/
@@ -227,29 +162,3 @@
return(LVCS_SUCCESS);
}
-#else
-LVCS_ReturnStatus_en LVCS_Equaliser(LVCS_Handle_t hInstance,
- LVM_INT16 *pInputOutput,
- LVM_UINT16 NumSamples)
-{
-
- LVCS_Instance_t *pInstance = (LVCS_Instance_t *)hInstance;
- LVCS_Equaliser_t *pConfig = (LVCS_Equaliser_t *)&pInstance->Equaliser;
- LVCS_Coefficient_t *pCoefficients = (LVCS_Coefficient_t *)pInstance->MemoryTable.Region[LVCS_MEMREGION_PERSISTENT_FAST_COEF].pBaseAddress;
-
-
- /*
- * Check if the equaliser is required
- */
- if ((pInstance->Params.OperatingMode & LVCS_EQUALISERSWITCH) != 0)
- {
- /* Apply filter to the left and right channels */
- (pConfig->pBiquadCallBack)((Biquad_Instance_t*)&pCoefficients->EqualiserBiquadInstance,
- (LVM_INT16 *)pInputOutput,
- (LVM_INT16 *)pInputOutput,
- (LVM_INT16)NumSamples);
- }
-
- return(LVCS_SUCCESS);
-}
-#endif
diff --git a/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Equaliser.h b/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Equaliser.h
index 55c4815..918d931 100644
--- a/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Equaliser.h
+++ b/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Equaliser.h
@@ -18,8 +18,6 @@
#ifndef __LVCS_EQUALISER_H__
#define __LVCS_EQUALISER_H__
-
-
/************************************************************************************/
/* */
/* Structures */
@@ -29,14 +27,9 @@
/* Equaliser structure */
typedef struct
{
-#ifndef BUILD_FLOAT
- void (*pBiquadCallBack) (Biquad_Instance_t*, LVM_INT16*, LVM_INT16*, LVM_INT16);
-#else
void (*pBiquadCallBack) (Biquad_FLOAT_Instance_t*, LVM_FLOAT*, LVM_FLOAT*, LVM_INT16);
-#endif
} LVCS_Equaliser_t;
-
/************************************************************************************/
/* */
/* Function prototypes */
@@ -45,14 +38,8 @@
LVCS_ReturnStatus_en LVCS_EqualiserInit(LVCS_Handle_t hInstance,
LVCS_Params_t *pParams);
-#ifndef BUILD_FLOAT
-LVCS_ReturnStatus_en LVCS_Equaliser(LVCS_Handle_t hInstance,
- LVM_INT16 *pInputOutput,
- LVM_UINT16 NumSamples);
-#else
LVCS_ReturnStatus_en LVCS_Equaliser(LVCS_Handle_t hInstance,
LVM_FLOAT *pInputOutput,
LVM_UINT16 NumSamples);
-#endif
#endif /* EQUALISER_H */
diff --git a/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Headphone_Coeffs.h b/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Headphone_Coeffs.h
index ba05577..c7ee232 100644
--- a/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Headphone_Coeffs.h
+++ b/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Headphone_Coeffs.h
@@ -18,13 +18,11 @@
#ifndef __LVCS_HEADPHONE_COEFFS_H__
#define __LVCS_HEADPHONE_COEFFS_H__
-
/************************************************************************************/
/* */
/* The Stereo Enhancer */
/* */
/************************************************************************************/
-#ifdef BUILD_FLOAT
/* Stereo Enhancer coefficients for 8000 Hz sample rate, scaled with 0.161258 */
#define CS_MIDDLE_8000_A0 0.227720
#define CS_MIDDLE_8000_A1 (-0.215125)
@@ -151,7 +149,6 @@
#define CS_SIDE_48000_B2 0.630405
#define CS_SIDE_48000_SCALE 14
-#ifdef HIGHER_FS
/* Coefficients for 88200Hz sample rate.
* The filter coefficients are obtained by carrying out
* state-space analysis using the coefficients available
@@ -222,7 +219,6 @@
#define CS_SIDE_192000_B1 (-1.891380f)
#define CS_SIDE_192000_B2 0.8923460f
#define CS_SIDE_192000_SCALE 14
-#endif
/************************************************************************************/
/* */
@@ -286,7 +282,6 @@
#define CS_REVERB_22050_B2 (-0.290990)
#define CS_REVERB_22050_SCALE 15
-
/* Reverb coefficients for 24000Hz sample rate, scaled with 1.038030 */
#define CS_REVERB_24000_A0 0.479565
#define CS_REVERB_24000_A1 0.000000
@@ -319,7 +314,6 @@
#define CS_REVERB_48000_B2 0.303347
#define CS_REVERB_48000_SCALE 14
-#ifdef HIGHER_FS
/* Reverb coefficients for 88200Hz sample rate, scaled with 0.8 */
/* Band pass filter with fc1=500 and fc2=8000 */
#define CS_REVERB_88200_A0 0.171901f
@@ -354,9 +348,6 @@
#define CS_REVERB_192000_B2 0.7804076
#define CS_REVERB_192000_SCALE 14
-#endif
-
-
/* Reverb Gain Settings */
#define LVCS_HEADPHONE_DELAYGAIN 0.800000 /* Algorithm delay path gain */
#define LVCS_HEADPHONE_OUTPUTGAIN 1.000000 /* Algorithm output gain */
@@ -505,8 +496,6 @@
#define CSEX_EQUALISER_48000_B2 (-0.347332)
#define CSEX_EQUALISER_48000_SCALE 13
-
-#ifdef HIGHER_FS
/* Equaliser coefficients for 88200Hz sample rate.
* The filter coefficients are obtained by carrying out
* state-space analysis using the coefficients available
@@ -567,8 +556,6 @@
#define CSEX_EQUALISER_192000_B1 (-1.31074)
#define CSEX_EQUALISER_192000_B2 0.31312
#define CSEX_EQUALISER_192000_SCALE 13
-#endif
-
#define LVCS_HEADPHONE_SHIFT 2 /* Output Shift */
#define LVCS_HEADPHONE_SHIFTLOSS 0.8477735 /* Output Shift loss */
@@ -576,376 +563,5 @@
#define LVCS_EX_HEADPHONE_SHIFT 3 /* EX Output Shift */
#define LVCS_EX_HEADPHONE_SHIFTLOSS 0.569225 /* EX Output Shift loss */
#define LVCS_EX_HEADPHONE_GAIN 0.07794425 /* EX Unprocessed path gain */
-#else
-/* Stereo Enhancer coefficients for 8000 Hz sample rate, scaled with 0.161258 */
-#define CS_MIDDLE_8000_A0 7462 /* Floating point value 0.227720 */
-#define CS_MIDDLE_8000_A1 (-7049) /* Floating point value -0.215125 */
-#define CS_MIDDLE_8000_A2 0 /* Floating point value 0.000000 */
-#define CS_MIDDLE_8000_B1 (-30209) /* Floating point value -0.921899 */
-#define CS_MIDDLE_8000_B2 0 /* Floating point value 0.000000 */
-#define CS_MIDDLE_8000_SCALE 15
-#define CS_SIDE_8000_A0 20036 /* Floating point value 0.611441 */
-#define CS_SIDE_8000_A1 (-12463) /* Floating point value -0.380344 */
-#define CS_SIDE_8000_A2 (-7573) /* Floating point value -0.231097 */
-#define CS_SIDE_8000_B1 (-20397) /* Floating point value -0.622470 */
-#define CS_SIDE_8000_B2 (-4285) /* Floating point value -0.130759 */
-#define CS_SIDE_8000_SCALE 15
-
-/* Stereo Enhancer coefficients for 11025Hz sample rate, scaled with 0.162943 */
-#define CS_MIDDLE_11025_A0 7564 /* Floating point value 0.230838 */
-#define CS_MIDDLE_11025_A1 (-7260) /* Floating point value -0.221559 */
-#define CS_MIDDLE_11025_A2 0 /* Floating point value 0.000000 */
-#define CS_MIDDLE_11025_B1 (-30902) /* Floating point value -0.943056 */
-#define CS_MIDDLE_11025_B2 0 /* Floating point value 0.000000 */
-#define CS_MIDDLE_11025_SCALE 15
-#define CS_SIDE_11025_A0 18264 /* Floating point value 0.557372 */
-#define CS_SIDE_11025_A1 (-12828) /* Floating point value -0.391490 */
-#define CS_SIDE_11025_A2 (-5436) /* Floating point value -0.165881 */
-#define CS_SIDE_11025_B1 (-28856) /* Floating point value -0.880608 */
-#define CS_SIDE_11025_B2 1062 /* Floating point value 0.032397 */
-#define CS_SIDE_11025_SCALE 15
-
-/* Stereo Enhancer coefficients for 12000Hz sample rate, scaled with 0.162191 */
-#define CS_MIDDLE_12000_A0 7534 /* Floating point value 0.229932 */
-#define CS_MIDDLE_12000_A1 (-7256) /* Floating point value -0.221436 */
-#define CS_MIDDLE_12000_A2 0 /* Floating point value 0.000000 */
-#define CS_MIDDLE_12000_B1 (-31051) /* Floating point value -0.947616 */
-#define CS_MIDDLE_12000_B2 0 /* Floating point value 0.000000 */
-#define CS_MIDDLE_12000_SCALE 15
-#define CS_SIDE_12000_A0 18298 /* Floating point value 0.558398 */
-#define CS_SIDE_12000_A1 (-12852) /* Floating point value -0.392211 */
-#define CS_SIDE_12000_A2 (-5446) /* Floating point value -0.166187 */
-#define CS_SIDE_12000_B1 (-29247) /* Floating point value -0.892550 */
-#define CS_SIDE_12000_B2 1077 /* Floating point value 0.032856 */
-#define CS_SIDE_12000_SCALE 15
-
-/* Stereo Enhancer coefficients for 16000Hz sample rate, scaled with 0.162371 */
-#define CS_MIDDLE_16000_A0 7558 /* Floating point value 0.230638 */
-#define CS_MIDDLE_16000_A1 (-7348) /* Floating point value -0.224232 */
-#define CS_MIDDLE_16000_A2 0 /* Floating point value 0.000000 */
-#define CS_MIDDLE_16000_B1 (-31475) /* Floating point value -0.960550 */
-#define CS_MIDDLE_16000_B2 0 /* Floating point value 0.000000 */
-#define CS_MIDDLE_16000_SCALE 15
-#define CS_SIDE_16000_A0 8187 /* Floating point value 0.499695 */
-#define CS_SIDE_16000_A1 (-5825) /* Floating point value -0.355543 */
-#define CS_SIDE_16000_A2 (-2362) /* Floating point value -0.144152 */
-#define CS_SIDE_16000_B1 (-17216) /* Floating point value -1.050788 */
-#define CS_SIDE_16000_B2 2361 /* Floating point value 0.144104 */
-#define CS_SIDE_16000_SCALE 14
-
-/* Stereo Enhancer coefficients for 22050Hz sample rate, scaled with 0.160781 */
-#define CS_MIDDLE_22050_A0 7496 /* Floating point value 0.228749 */
-#define CS_MIDDLE_22050_A1 (-7344) /* Floating point value -0.224128 */
-#define CS_MIDDLE_22050_A2 0 /* Floating point value 0.000000 */
-#define CS_MIDDLE_22050_B1 (-31826) /* Floating point value -0.971262 */
-#define CS_MIDDLE_22050_B2 0 /* Floating point value 0.000000 */
-#define CS_MIDDLE_22050_SCALE 15
-#define CS_SIDE_22050_A0 7211 /* Floating point value 0.440112 */
-#define CS_SIDE_22050_A1 (-4278) /* Floating point value -0.261096 */
-#define CS_SIDE_22050_A2 (-2933) /* Floating point value -0.179016 */
-#define CS_SIDE_22050_B1 (-18297) /* Floating point value -1.116786 */
-#define CS_SIDE_22050_B2 2990 /* Floating point value 0.182507 */
-#define CS_SIDE_22050_SCALE 14
-
-/* Stereo Enhancer coefficients for 24000Hz sample rate, scaled with 0.161882 */
-#define CS_MIDDLE_24000_A0 7550 /* Floating point value 0.230395 */
-#define CS_MIDDLE_24000_A1 (-7409) /* Floating point value -0.226117 */
-#define CS_MIDDLE_24000_A2 0 /* Floating point value 0.000000 */
-#define CS_MIDDLE_24000_B1 (-31902) /* Floating point value -0.973573 */
-#define CS_MIDDLE_24000_B2 0 /* Floating point value 0.000000 */
-#define CS_MIDDLE_24000_SCALE 15
-#define CS_SIDE_24000_A0 6796 /* Floating point value 0.414770 */
-#define CS_SIDE_24000_A1 (-4705) /* Floating point value -0.287182 */
-#define CS_SIDE_24000_A2 (-2090) /* Floating point value -0.127588 */
-#define CS_SIDE_24000_B1 (-20147) /* Floating point value -1.229648 */
-#define CS_SIDE_24000_B2 4623 /* Floating point value 0.282177 */
-#define CS_SIDE_24000_SCALE 14
-
-/* Stereo Enhancer coefficients for 32000Hz sample rate, scaled with 0.160322 */
-#define CS_MIDDLE_32000_A0 7484 /* Floating point value 0.228400 */
-#define CS_MIDDLE_32000_A1 (-7380) /* Floating point value -0.225214 */
-#define CS_MIDDLE_32000_A2 0 /* Floating point value 0.000000 */
-#define CS_MIDDLE_32000_B1 (-32117) /* Floating point value -0.980126 */
-#define CS_MIDDLE_32000_B2 0 /* Floating point value 0.000000 */
-#define CS_MIDDLE_32000_SCALE 15
-#define CS_SIDE_32000_A0 5973 /* Floating point value 0.364579 */
-#define CS_SIDE_32000_A1 (-3397) /* Floating point value -0.207355 */
-#define CS_SIDE_32000_A2 (-2576) /* Floating point value -0.157224 */
-#define CS_SIDE_32000_B1 (-20877) /* Floating point value -1.274231 */
-#define CS_SIDE_32000_B2 5120 /* Floating point value 0.312495 */
-#define CS_SIDE_32000_SCALE 14
-
-/* Stereo Enhancer coefficients for 44100Hz sample rate, scaled with 0.163834 */
-#define CS_MIDDLE_44100_A0 7654 /* Floating point value 0.233593 */
-#define CS_MIDDLE_44100_A1 (-7577) /* Floating point value -0.231225 */
-#define CS_MIDDLE_44100_A2 0 /* Floating point value 0.000000 */
-#define CS_MIDDLE_44100_B1 (-32294) /* Floating point value -0.985545 */
-#define CS_MIDDLE_44100_B2 0 /* Floating point value 0.000000 */
-#define CS_MIDDLE_44100_SCALE 15
-#define CS_SIDE_44100_A0 4662 /* Floating point value 0.284573 */
-#define CS_SIDE_44100_A1 (-4242) /* Floating point value -0.258910 */
-#define CS_SIDE_44100_A2 (-420) /* Floating point value -0.025662 */
-#define CS_SIDE_44100_B1 (-25760) /* Floating point value -1.572248 */
-#define CS_SIDE_44100_B2 9640 /* Floating point value 0.588399 */
-#define CS_SIDE_44100_SCALE 14
-
-/* Stereo Enhancer coefficients for 48000Hz sample rate, scaled with 0.164402 */
-#define CS_MIDDLE_48000_A0 7682 /* Floating point value 0.234445 */
-#define CS_MIDDLE_48000_A1 (-7611) /* Floating point value -0.232261 */
-#define CS_MIDDLE_48000_A2 0 /* Floating point value 0.000000 */
-#define CS_MIDDLE_48000_B1 (-32333) /* Floating point value -0.986713 */
-#define CS_MIDDLE_48000_B2 0 /* Floating point value 0.000000 */
-#define CS_MIDDLE_48000_SCALE 15
-#define CS_SIDE_48000_A0 4466 /* Floating point value 0.272606 */
-#define CS_SIDE_48000_A1 (-4374) /* Floating point value -0.266952 */
-#define CS_SIDE_48000_A2 (-93) /* Floating point value -0.005654 */
-#define CS_SIDE_48000_B1 (-26495) /* Floating point value -1.617141 */
-#define CS_SIDE_48000_B2 10329 /* Floating point value 0.630405 */
-#define CS_SIDE_48000_SCALE 14
-
-
-/************************************************************************************/
-/* */
-/* The Reverb Unit */
-/* */
-/************************************************************************************/
-
-/* Reverb delay settings in samples */
-#define LVCS_STEREODELAY_CS_8KHZ 93 /* Sample rate 8kS/s */
-#define LVCS_STEREODELAY_CS_11KHZ 128 /* Sample rate 11kS/s */
-#define LVCS_STEREODELAY_CS_12KHZ 139 /* Sample rate 12kS/s */
-#define LVCS_STEREODELAY_CS_16KHZ 186 /* Sample rate 16kS/s */
-#define LVCS_STEREODELAY_CS_22KHZ 256 /* Sample rate 22kS/s */
-#define LVCS_STEREODELAY_CS_24KHZ 279 /* Sample rate 24kS/s */
-#define LVCS_STEREODELAY_CS_32KHZ 372 /* Sample rate 32kS/s */
-#define LVCS_STEREODELAY_CS_44KHZ 512 /* Sample rate 44kS/s */
-#define LVCS_STEREODELAY_CS_48KHZ 512 /* Sample rate 48kS/s */
-
-/* Reverb coefficients for 8000 Hz sample rate, scaled with 1.038030 */
-#define CS_REVERB_8000_A0 21865 /* Floating point value 0.667271 */
-#define CS_REVERB_8000_A1 (-21865) /* Floating point value -0.667271 */
-#define CS_REVERB_8000_A2 0 /* Floating point value 0.000000 */
-#define CS_REVERB_8000_B1 (-21895) /* Floating point value -0.668179 */
-#define CS_REVERB_8000_B2 0 /* Floating point value 0.000000 */
-#define CS_REVERB_8000_SCALE 15
-
-/* Reverb coefficients for 11025Hz sample rate, scaled with 1.038030 */
-#define CS_REVERB_11025_A0 22926 /* Floating point value 0.699638 */
-#define CS_REVERB_11025_A1 (-22926) /* Floating point value -0.699638 */
-#define CS_REVERB_11025_A2 0 /* Floating point value 0.000000 */
-#define CS_REVERB_11025_B1 (-24546) /* Floating point value -0.749096 */
-#define CS_REVERB_11025_B2 0 /* Floating point value 0.000000 */
-#define CS_REVERB_11025_SCALE 15
-
-/* Reverb coefficients for 12000Hz sample rate, scaled with 1.038030 */
-#define CS_REVERB_12000_A0 23165 /* Floating point value 0.706931 */
-#define CS_REVERB_12000_A1 (-23165) /* Floating point value -0.706931 */
-#define CS_REVERB_12000_A2 0 /* Floating point value 0.000000 */
-#define CS_REVERB_12000_B1 (-25144) /* Floating point value -0.767327 */
-#define CS_REVERB_12000_B2 0 /* Floating point value 0.000000 */
-#define CS_REVERB_12000_SCALE 15
-
-/* Reverb coefficients for 16000Hz sample rate, scaled with 1.038030 */
-#define CS_REVERB_16000_A0 23864 /* Floating point value 0.728272 */
-#define CS_REVERB_16000_A1 (-23864) /* Floating point value -0.728272 */
-#define CS_REVERB_16000_A2 0 /* Floating point value 0.000000 */
-#define CS_REVERB_16000_B1 (-26892) /* Floating point value -0.820679 */
-#define CS_REVERB_16000_B2 0 /* Floating point value 0.000000 */
-#define CS_REVERB_16000_SCALE 15
-
-/* Reverb coefficients for 22050Hz sample rate, scaled with 1.038030 */
-#define CS_REVERB_22050_A0 16921 /* Floating point value 0.516396 */
-#define CS_REVERB_22050_A1 0 /* Floating point value 0.000000 */
-#define CS_REVERB_22050_A2 (-16921) /* Floating point value -0.516396 */
-#define CS_REVERB_22050_B1 (-16991) /* Floating point value -0.518512 */
-#define CS_REVERB_22050_B2 (-9535) /* Floating point value -0.290990 */
-#define CS_REVERB_22050_SCALE 15
-
-/* Reverb coefficients for 24000Hz sample rate, scaled with 1.038030 */
-#define CS_REVERB_24000_A0 15714 /* Floating point value 0.479565 */
-#define CS_REVERB_24000_A1 0 /* Floating point value 0.000000 */
-#define CS_REVERB_24000_A2 (-15714) /* Floating point value -0.479565 */
-#define CS_REVERB_24000_B1 (-20898) /* Floating point value -0.637745 */
-#define CS_REVERB_24000_B2 (-6518) /* Floating point value -0.198912 */
-#define CS_REVERB_24000_SCALE 15
-
-/* Reverb coefficients for 32000Hz sample rate, scaled with 1.038030 */
-#define CS_REVERB_32000_A0 12463 /* Floating point value 0.380349 */
-#define CS_REVERB_32000_A1 0 /* Floating point value 0.000000 */
-#define CS_REVERB_32000_A2 (-12463) /* Floating point value -0.380349 */
-#define CS_REVERB_32000_B1 (-31158) /* Floating point value -0.950873 */
-#define CS_REVERB_32000_B2 1610 /* Floating point value 0.049127 */
-#define CS_REVERB_32000_SCALE 15
-
-/* Reverb coefficients for 44100Hz sample rate, scaled with 1.038030 */
-#define CS_REVERB_44100_A0 4872 /* Floating point value 0.297389 */
-#define CS_REVERB_44100_A1 0 /* Floating point value 0.000000 */
-#define CS_REVERB_44100_A2 (-4872) /* Floating point value -0.297389 */
-#define CS_REVERB_44100_B1 (-19668) /* Floating point value -1.200423 */
-#define CS_REVERB_44100_B2 4203 /* Floating point value 0.256529 */
-#define CS_REVERB_44100_SCALE 14
-
-/* Reverb coefficients for 48000Hz sample rate, scaled with 1.038030 */
-#define CS_REVERB_48000_A0 4566 /* Floating point value 0.278661 */
-#define CS_REVERB_48000_A1 0 /* Floating point value 0.000000 */
-#define CS_REVERB_48000_A2 (-4566) /* Floating point value -0.278661 */
-#define CS_REVERB_48000_B1 (-20562) /* Floating point value -1.254993 */
-#define CS_REVERB_48000_B2 4970 /* Floating point value 0.303347 */
-#define CS_REVERB_48000_SCALE 14
-
-/* Reverb Gain Settings */
-#define LVCS_HEADPHONE_DELAYGAIN 0.800000 /* Algorithm delay path gain */
-#define LVCS_HEADPHONE_OUTPUTGAIN 1.000000 /* Algorithm output gain */
-#define LVCS_HEADPHONE_PROCGAIN 18403 /* Processed path gain */
-#define LVCS_HEADPHONE_UNPROCGAIN 18403 /* Unprocessed path gain */
-#define LVCS_HEADPHONE_GAINCORRECT 1.009343 /* Delay mixer gain correction */
-
-
-/************************************************************************************/
-/* */
-/* The Equaliser */
-/* */
-/************************************************************************************/
-
-/* Equaliser coefficients for 8000 Hz sample rate, CS scaled with 1.038497 and CSEX scaled with 0.775480 */
-#define CS_EQUALISER_8000_A0 20698 /* Floating point value 1.263312 */
-#define CS_EQUALISER_8000_A1 (-9859) /* Floating point value -0.601748 */
-#define CS_EQUALISER_8000_A2 (-4599) /* Floating point value -0.280681 */
-#define CS_EQUALISER_8000_B1 (-7797) /* Floating point value -0.475865 */
-#define CS_EQUALISER_8000_B2 (-6687) /* Floating point value -0.408154 */
-#define CS_EQUALISER_8000_SCALE 14
-#define CSEX_EQUALISER_8000_A0 30912 /* Floating point value 0.943357 */
-#define CSEX_EQUALISER_8000_A1 (-14724) /* Floating point value -0.449345 */
-#define CSEX_EQUALISER_8000_A2 (-6868) /* Floating point value -0.209594 */
-#define CSEX_EQUALISER_8000_B1 (-15593) /* Floating point value -0.475865 */
-#define CSEX_EQUALISER_8000_B2 (-13374) /* Floating point value -0.408154 */
-#define CSEX_EQUALISER_8000_SCALE 15
-
-/* Equaliser coefficients for 11025Hz sample rate, CS scaled with 1.027761 and CSEX scaled with 0.767463 */
-#define CS_EQUALISER_11025_A0 18041 /* Floating point value 1.101145 */
-#define CS_EQUALISER_11025_A1 2278 /* Floating point value 0.139020 */
-#define CS_EQUALISER_11025_A2 (-14163) /* Floating point value -0.864423 */
-#define CS_EQUALISER_11025_B1 402 /* Floating point value 0.024541 */
-#define CS_EQUALISER_11025_B2 (-14892) /* Floating point value -0.908930 */
-#define CS_EQUALISER_11025_SCALE 14
-#define CSEX_EQUALISER_11025_A0 31983 /* Floating point value 0.976058 */
-#define CSEX_EQUALISER_11025_A1 (-22784) /* Floating point value -0.695326 */
-#define CSEX_EQUALISER_11025_A2 (-2976) /* Floating point value -0.090809 */
-#define CSEX_EQUALISER_11025_B1 (-20008) /* Floating point value -0.610594 */
-#define CSEX_EQUALISER_11025_B2 (-10196) /* Floating point value -0.311149 */
-#define CSEX_EQUALISER_11025_SCALE 15
-
-/* Equaliser coefficients for 12000Hz sample rate, CS scaled with 1.032521 and CSEX scaled with 0.771017 */
-#define CS_EQUALISER_12000_A0 20917 /* Floating point value 1.276661 */
-#define CS_EQUALISER_12000_A1 (-16671) /* Floating point value -1.017519 */
-#define CS_EQUALISER_12000_A2 (-723) /* Floating point value -0.044128 */
-#define CS_EQUALISER_12000_B1 (-11954) /* Floating point value -0.729616 */
-#define CS_EQUALISER_12000_B2 (-3351) /* Floating point value -0.204532 */
-#define CS_EQUALISER_12000_SCALE 14
-#define CSEX_EQUALISER_12000_A0 16500 /* Floating point value 1.007095 */
-#define CSEX_EQUALISER_12000_A1 (-14285) /* Floating point value -0.871912 */
-#define CSEX_EQUALISER_12000_A2 381 /* Floating point value 0.023232 */
-#define CSEX_EQUALISER_12000_B1 (-12220) /* Floating point value -0.745857 */
-#define CSEX_EQUALISER_12000_B2 (-3099) /* Floating point value -0.189171 */
-#define CSEX_EQUALISER_12000_SCALE 14
-
-/* Equaliser coefficients for 16000Hz sample rate, CS scaled with 1.031378 and CSEX scaled with 0.770164 */
-#define CS_EQUALISER_16000_A0 20998 /* Floating point value 1.281629 */
-#define CS_EQUALISER_16000_A1 (-17627) /* Floating point value -1.075872 */
-#define CS_EQUALISER_16000_A2 (-678) /* Floating point value -0.041365 */
-#define CS_EQUALISER_16000_B1 (-11882) /* Floating point value -0.725239 */
-#define CS_EQUALISER_16000_B2 (-3676) /* Floating point value -0.224358 */
-#define CS_EQUALISER_16000_SCALE 14
-#define CSEX_EQUALISER_16000_A0 17713 /* Floating point value 1.081091 */
-#define CSEX_EQUALISER_16000_A1 (-14208) /* Floating point value -0.867183 */
-#define CSEX_EQUALISER_16000_A2 (-1151) /* Floating point value -0.070247 */
-#define CSEX_EQUALISER_16000_B1 (-8440) /* Floating point value -0.515121 */
-#define CSEX_EQUALISER_16000_B2 (-6978) /* Floating point value -0.425893 */
-#define CSEX_EQUALISER_16000_SCALE 14
-
-/* Equaliser coefficients for 22050Hz sample rate, CS scaled with 1.041576 and CSEX scaled with 0.777779 */
-#define CS_EQUALISER_22050_A0 22751 /* Floating point value 1.388605 */
-#define CS_EQUALISER_22050_A1 (-21394) /* Floating point value -1.305799 */
-#define CS_EQUALISER_22050_A2 654 /* Floating point value 0.039922 */
-#define CS_EQUALISER_22050_B1 (-11788) /* Floating point value -0.719494 */
-#define CS_EQUALISER_22050_B2 (-3985) /* Floating point value -0.243245 */
-#define CS_EQUALISER_22050_SCALE 14
-#define CSEX_EQUALISER_22050_A0 20855 /* Floating point value 1.272910 */
-#define CSEX_EQUALISER_22050_A1 (-21971) /* Floating point value -1.341014 */
-#define CSEX_EQUALISER_22050_A2 2744 /* Floating point value 0.167462 */
-#define CSEX_EQUALISER_22050_B1 (-10063) /* Floating point value -0.614219 */
-#define CSEX_EQUALISER_22050_B2 (-5659) /* Floating point value -0.345384 */
-#define CSEX_EQUALISER_22050_SCALE 14
-
-/* Equaliser coefficients for 24000Hz sample rate, CS scaled with 1.034495 and CSEX scaled with 0.772491 */
-#define CS_EQUALISER_24000_A0 23099 /* Floating point value 1.409832 */
-#define CS_EQUALISER_24000_A1 (-23863) /* Floating point value -1.456506 */
-#define CS_EQUALISER_24000_A2 2481 /* Floating point value 0.151410 */
-#define CS_EQUALISER_24000_B1 (-13176) /* Floating point value -0.804201 */
-#define CS_EQUALISER_24000_B2 (-2683) /* Floating point value -0.163783 */
-#define CS_EQUALISER_24000_SCALE 14
-#define CSEX_EQUALISER_24000_A0 21286 /* Floating point value 1.299198 */
-#define CSEX_EQUALISER_24000_A1 (-23797) /* Floating point value -1.452447 */
-#define CSEX_EQUALISER_24000_A2 3940 /* Floating point value 0.240489 */
-#define CSEX_EQUALISER_24000_B1 (-10966) /* Floating point value -0.669303 */
-#define CSEX_EQUALISER_24000_B2 (-4833) /* Floating point value -0.294984 */
-#define CSEX_EQUALISER_24000_SCALE 14
-
-/* Equaliser coefficients for 32000Hz sample rate, CS scaled with 1.044559 and CSEX scaled with 0.780006 */
-#define CS_EQUALISER_32000_A0 25575 /* Floating point value 1.560988 */
-#define CS_EQUALISER_32000_A1 (-30765) /* Floating point value -1.877724 */
-#define CS_EQUALISER_32000_A2 6386 /* Floating point value 0.389741 */
-#define CS_EQUALISER_32000_B1 (-14867) /* Floating point value -0.907410 */
-#define CS_EQUALISER_32000_B2 (-1155) /* Floating point value -0.070489 */
-#define CS_EQUALISER_32000_SCALE 14
-#define CSEX_EQUALISER_32000_A0 14623 /* Floating point value 1.785049 */
-#define CSEX_EQUALISER_32000_A1 (-18297) /* Floating point value -2.233497 */
-#define CSEX_EQUALISER_32000_A2 4313 /* Floating point value 0.526431 */
-#define CSEX_EQUALISER_32000_B1 (-3653) /* Floating point value -0.445939 */
-#define CSEX_EQUALISER_32000_B2 (-4280) /* Floating point value -0.522446 */
-#define CSEX_EQUALISER_32000_SCALE 13
-
-/* Equaliser coefficients for 44100Hz sample rate, CS scaled with 1.022170 and CSEX scaled with 0.763288 */
-#define CS_EQUALISER_44100_A0 13304 /* Floating point value 1.623993 */
-#define CS_EQUALISER_44100_A1 (-18602) /* Floating point value -2.270743 */
-#define CS_EQUALISER_44100_A2 5643 /* Floating point value 0.688829 */
-#define CS_EQUALISER_44100_B1 (-9152) /* Floating point value -1.117190 */
-#define CS_EQUALISER_44100_B2 1067 /* Floating point value 0.130208 */
-#define CS_EQUALISER_44100_SCALE 13
-#define CSEX_EQUALISER_44100_A0 16616 /* Floating point value 2.028315 */
-#define CSEX_EQUALISER_44100_A1 (-23613) /* Floating point value -2.882459 */
-#define CSEX_EQUALISER_44100_A2 7410 /* Floating point value 0.904535 */
-#define CSEX_EQUALISER_44100_B1 (-4860) /* Floating point value -0.593308 */
-#define CSEX_EQUALISER_44100_B2 (-3161) /* Floating point value -0.385816 */
-#define CSEX_EQUALISER_44100_SCALE 13
-
-/* Equaliser coefficients for 48000Hz sample rate, CS scaled with 1.018635 and CSEX scaled with 0.760648 */
-#define CS_EQUALISER_48000_A0 13445 /* Floating point value 1.641177 */
-#define CS_EQUALISER_48000_A1 (-19372) /* Floating point value -2.364687 */
-#define CS_EQUALISER_48000_A2 6225 /* Floating point value 0.759910 */
-#define CS_EQUALISER_48000_B1 (-9558) /* Floating point value -1.166774 */
-#define CS_EQUALISER_48000_B2 1459 /* Floating point value 0.178074 */
-#define CS_EQUALISER_48000_SCALE 13
-#define CSEX_EQUALISER_48000_A0 17200 /* Floating point value 2.099655 */
-#define CSEX_EQUALISER_48000_A1 (-25110) /* Floating point value -3.065220 */
-#define CSEX_EQUALISER_48000_A2 8277 /* Floating point value 1.010417 */
-#define CSEX_EQUALISER_48000_B1 (-5194) /* Floating point value -0.634021 */
-#define CSEX_EQUALISER_48000_B2 (-2845) /* Floating point value -0.347332 */
-#define CSEX_EQUALISER_48000_SCALE 13
-
-
-/************************************************************************************/
-/* */
-/* The Output Gain Correction */
-/* */
-/************************************************************************************/
-
-#define LVCS_HEADPHONE_SHIFT 2 /* Output Shift */
-#define LVCS_HEADPHONE_SHIFTLOSS 27779 /* Output Shift loss */
-#define LVCS_HEADPHONE_GAIN 6840 /* Unprocessed path gain */
-#define LVCS_EX_HEADPHONE_SHIFT 3 /* EX Output Shift */
-#define LVCS_EX_HEADPHONE_SHIFTLOSS 18600 /* EX Output Shift loss */
-#define LVCS_EX_HEADPHONE_GAIN 5108 /* EX Unprocessed path gain */
-#endif
#endif
diff --git a/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Init.cpp b/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Init.cpp
index d4c7627..630ecf7 100644
--- a/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Init.cpp
+++ b/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Init.cpp
@@ -68,7 +68,6 @@
LVM_UINT32 ScratchSize;
LVCS_Instance_t *pInstance = (LVCS_Instance_t *)hInstance;
-
/*
* Fill in the memory table
*/
@@ -98,13 +97,9 @@
/*
* Scratch memory
*/
-#ifdef BUILD_FLOAT
/* Inplace processing */
ScratchSize = (LVM_UINT32) \
(LVCS_SCRATCHBUFFERS * sizeof(LVM_FLOAT) * pCapabilities->MaxBlockSize);
-#else
- ScratchSize = (LVM_UINT32)(LVCS_SCRATCHBUFFERS*sizeof(LVM_INT16)*pCapabilities->MaxBlockSize); /* Inplace processing */
-#endif
pMemoryTable->Region[LVCS_MEMREGION_TEMPORARY_FAST].Size = ScratchSize;
pMemoryTable->Region[LVCS_MEMREGION_TEMPORARY_FAST].Type = LVCS_SCRATCH;
pMemoryTable->Region[LVCS_MEMREGION_TEMPORARY_FAST].pBaseAddress = LVM_NULL;
@@ -118,7 +113,6 @@
return(LVCS_SUCCESS);
}
-
/************************************************************************************/
/* */
/* FUNCTION: LVCS_Init */
@@ -160,7 +154,6 @@
LVCS_Instance_t *pInstance;
LVCS_VolCorrect_t *pLVCS_VolCorrectTable;
-
/*
* Set the instance handle if not already initialised
*/
@@ -170,7 +163,6 @@
}
pInstance =(LVCS_Instance_t *)*phInstance;
-
/*
* Save the capabilities in the instance structure
*/
@@ -181,7 +173,6 @@
*/
pInstance->MemoryTable = *pMemoryTable;
-
/*
* Set all initial parameters to invalid to force a full initialisation
*/
diff --git a/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Private.h b/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Private.h
index 1419651..620b341 100644
--- a/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Private.h
+++ b/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Private.h
@@ -27,8 +27,6 @@
#ifndef __LVCS_PRIVATE_H__
#define __LVCS_PRIVATE_H__
-
-
/************************************************************************************/
/* */
/* Includes */
@@ -42,7 +40,6 @@
#include "LVCS_BypassMix.h" /* Bypass Mixer module definitions */
#include "LVM_Timer.h"
-
/************************************************************************************/
/* */
/* Defines */
@@ -76,7 +73,6 @@
#define LVCS_NR_OF_FS 9
#define LVCS_NR_OF_CHAN_CFG 2
-
/************************************************************************************/
/* */
/* Types */
@@ -91,7 +87,6 @@
LVCS_DEVICE_MAX = LVM_MAXENUM
} LVCS_OutputDevice_en;
-
/************************************************************************************/
/* */
/* Structures */
@@ -101,17 +96,10 @@
/* Volume correction structure */
typedef struct
{
-#ifdef BUILD_FLOAT
LVM_FLOAT CompFull; /* Post CS compression 100% effect */
LVM_FLOAT CompMin; /* Post CS compression 0% effect */
LVM_FLOAT GainFull; /* CS gain correct 100% effect */
LVM_FLOAT GainMin; /* CS gain correct 0% effect */
-#else
- LVM_INT16 CompFull; /* Post CS compression 100% effect */
- LVM_INT16 CompMin; /* Post CS compression 0% effect */
- LVM_INT16 GainFull; /* CS gain correct 100% effect */
- LVM_INT16 GainMin; /* CS gain correct 0% effect */
-#endif
} LVCS_VolCorrect_t;
/* Instance structure */
@@ -125,13 +113,8 @@
/* Private parameters */
LVCS_OutputDevice_en OutputDevice; /* Selected output device type */
LVCS_VolCorrect_t VolCorrect; /* Volume correction settings */
-#ifndef BUILD_FLOAT
- LVM_INT16 TransitionGain; /* Transition gain */
- LVM_INT16 CompressGain; /* Last used compressor gain*/
-#else
LVM_FLOAT TransitionGain; /* Transition gain */
LVM_FLOAT CompressGain; /* Last used compressor gain*/
-#endif
/* Sub-block configurations */
LVCS_StereoEnhancer_t StereoEnhancer; /* Stereo enhancer configuration */
@@ -152,41 +135,24 @@
/* Coefficient Structure */
typedef struct
{
-#ifdef BUILD_FLOAT
Biquad_FLOAT_Instance_t EqualiserBiquadInstance;
Biquad_FLOAT_Instance_t ReverbBiquadInstance;
Biquad_FLOAT_Instance_t SEBiquadInstanceMid;
Biquad_FLOAT_Instance_t SEBiquadInstanceSide;
-#else
- Biquad_Instance_t EqualiserBiquadInstance;
- Biquad_Instance_t ReverbBiquadInstance;
- Biquad_Instance_t SEBiquadInstanceMid;
- Biquad_Instance_t SEBiquadInstanceSide;
-#endif
} LVCS_Coefficient_t;
/* Data Structure */
typedef struct
{
-#ifdef BUILD_FLOAT
Biquad_2I_Order2_FLOAT_Taps_t EqualiserBiquadTaps;
Biquad_2I_Order2_FLOAT_Taps_t ReverbBiquadTaps;
Biquad_1I_Order1_FLOAT_Taps_t SEBiquadTapsMid;
Biquad_1I_Order2_FLOAT_Taps_t SEBiquadTapsSide;
-#else
- Biquad_2I_Order2_Taps_t EqualiserBiquadTaps;
- Biquad_2I_Order2_Taps_t ReverbBiquadTaps;
- Biquad_1I_Order1_Taps_t SEBiquadTapsMid;
- Biquad_1I_Order2_Taps_t SEBiquadTapsSide;
-#endif
} LVCS_Data_t;
void LVCS_TimerCallBack ( void* hInstance,
void* pCallBackParams,
LVM_INT32 CallbackParam);
-
-
#endif /* PRIVATE_H */
-
diff --git a/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Process.cpp b/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Process.cpp
index ef1d9eb..ded3bfa 100644
--- a/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Process.cpp
+++ b/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Process.cpp
@@ -15,7 +15,6 @@
* limitations under the License.
*/
-
/************************************************************************************/
/* */
/* Includes */
@@ -66,7 +65,6 @@
/* NOTES: */
/* */
/************************************************************************************/
-#ifdef BUILD_FLOAT
LVCS_ReturnStatus_en LVCS_Process_CS(LVCS_Handle_t hInstance,
const LVM_FLOAT *pInData,
LVM_FLOAT *pOutData,
@@ -178,74 +176,6 @@
return(LVCS_SUCCESS);
}
-#else
-LVCS_ReturnStatus_en LVCS_Process_CS(LVCS_Handle_t hInstance,
- const LVM_INT16 *pInData,
- LVM_INT16 *pOutData,
- LVM_UINT16 NumSamples)
-{
- const LVM_INT16 *pInput;
- LVCS_Instance_t *pInstance = (LVCS_Instance_t *)hInstance;
- LVM_INT16 *pScratch = (LVM_INT16 *)pInstance->MemoryTable.Region[LVCS_MEMREGION_TEMPORARY_FAST].pBaseAddress;
- LVCS_ReturnStatus_en err;
-
- /*
- * Check if the processing is inplace
- */
- if (pInData == pOutData)
- {
- /* Processing inplace */
- pInput = pScratch + (2*NumSamples);
- Copy_16((LVM_INT16 *)pInData, /* Source */
- (LVM_INT16 *)pInput, /* Destination */
- (LVM_INT16)(2*NumSamples)); /* Left and right */
- }
- else
- {
- /* Processing outplace */
- pInput = pInData;
- }
-
- /*
- * Call the stereo enhancer
- */
- err=LVCS_StereoEnhancer(hInstance, /* Instance handle */
- pInData, /* Pointer to the input data */
- pOutData, /* Pointer to the output data */
- NumSamples); /* Number of samples to process */
-
- /*
- * Call the reverb generator
- */
- err=LVCS_ReverbGenerator(hInstance, /* Instance handle */
- pOutData, /* Pointer to the input data */
- pOutData, /* Pointer to the output data */
- NumSamples); /* Number of samples to process */
-
- /*
- * Call the equaliser
- */
- err=LVCS_Equaliser(hInstance, /* Instance handle */
- pOutData, /* Pointer to the input data */
- NumSamples); /* Number of samples to process */
-
- /*
- * Call the bypass mixer
- */
- err=LVCS_BypassMixer(hInstance, /* Instance handle */
- pOutData, /* Pointer to the processed data */
- pInput, /* Pointer to the input (unprocessed) data */
- pOutData, /* Pointer to the output data */
- NumSamples); /* Number of samples to process */
-
- if(err !=LVCS_SUCCESS)
- {
- return err;
- }
-
- return(LVCS_SUCCESS);
-}
-#endif
/************************************************************************************/
/* */
/* FUNCTION: LVCS_Process */
@@ -272,7 +202,6 @@
/* NOTES: */
/* */
/************************************************************************************/
-#ifdef BUILD_FLOAT
LVCS_ReturnStatus_en LVCS_Process(LVCS_Handle_t hInstance,
const LVM_FLOAT *pInData,
LVM_FLOAT *pOutData,
@@ -311,7 +240,6 @@
pOutData,
NumSamples);
-
/*
* Compress to reduce expansion effect of Concert Sound and correct volume
* differences for difference settings. Not applied in test modes
@@ -403,7 +331,6 @@
pInstance->CompressGain = Gain;
}
-
if(pInstance->bInOperatingModeTransition == LVM_TRUE){
/*
@@ -455,168 +382,5 @@
}
}
-
return(LVCS_SUCCESS);
}
-#else
-LVCS_ReturnStatus_en LVCS_Process(LVCS_Handle_t hInstance,
- const LVM_INT16 *pInData,
- LVM_INT16 *pOutData,
- LVM_UINT16 NumSamples)
-{
-
- LVCS_Instance_t *pInstance =(LVCS_Instance_t *)hInstance;
- LVCS_ReturnStatus_en err;
-
- /*
- * Check the number of samples is not too large
- */
- if (NumSamples > pInstance->Capabilities.MaxBlockSize)
- {
- return(LVCS_TOOMANYSAMPLES);
- }
-
- /*
- * Check if the algorithm is enabled
- */
- if (pInstance->Params.OperatingMode != LVCS_OFF)
- {
- /*
- * Call CS process function
- */
- err=LVCS_Process_CS(hInstance,
- pInData,
- pOutData,
- NumSamples);
-
- /*
- * Compress to reduce expansion effect of Concert Sound and correct volume
- * differences for difference settings. Not applied in test modes
- */
- if ((pInstance->Params.OperatingMode == LVCS_ON)&&(pInstance->Params.CompressorMode == LVM_MODE_ON))
- {
- LVM_INT16 Gain = pInstance->VolCorrect.CompMin;
- LVM_INT32 Current1;
-
- Current1 = LVC_Mixer_GetCurrent(&pInstance->BypassMix.Mixer_Instance.MixerStream[0]);
- Gain = (LVM_INT16)( pInstance->VolCorrect.CompMin
- - (((LVM_INT32)pInstance->VolCorrect.CompMin * (Current1)) >> 15)
- + (((LVM_INT32)pInstance->VolCorrect.CompFull * (Current1)) >> 15) );
-
- if(NumSamples < LVCS_COMPGAINFRAME)
- {
- NonLinComp_D16(Gain, /* Compressor gain setting */
- pOutData,
- pOutData,
- (LVM_INT32)(2*NumSamples));
- }
- else
- {
- LVM_INT16 GainStep;
- LVM_INT16 FinalGain;
- LVM_INT16 SampleToProcess = NumSamples;
- LVM_INT16 *pOutPtr;
-
- /* Large changes in Gain can cause clicks in output
- Split data into small blocks and use interpolated gain values */
-
- GainStep = (LVM_INT16)(((Gain-pInstance->CompressGain) * LVCS_COMPGAINFRAME)/NumSamples);
-
- if((GainStep ==0)&&(pInstance->CompressGain < Gain))
- {
- GainStep=1;
- }
- else
- {
- if((GainStep ==0)&&(pInstance->CompressGain > Gain))
- {
- GainStep=-1;
- }
- }
-
- FinalGain = Gain;
- Gain = pInstance->CompressGain;
- pOutPtr = pOutData;
-
- while(SampleToProcess > 0)
- {
- Gain = (LVM_INT16)(Gain + GainStep);
- if((GainStep > 0)&& (FinalGain <= Gain))
- {
- Gain = FinalGain;
- GainStep =0;
- }
-
- if((GainStep < 0)&& (FinalGain > Gain))
- {
- Gain = FinalGain;
- GainStep =0;
- }
-
- if(SampleToProcess > LVCS_COMPGAINFRAME)
- {
- NonLinComp_D16(Gain, /* Compressor gain setting */
- pOutPtr,
- pOutPtr,
- (LVM_INT32)(2*LVCS_COMPGAINFRAME));
- pOutPtr +=(2*LVCS_COMPGAINFRAME);
- SampleToProcess = (LVM_INT16)(SampleToProcess-LVCS_COMPGAINFRAME);
- }
- else
- {
- NonLinComp_D16(Gain, /* Compressor gain setting */
- pOutPtr,
- pOutPtr,
- (LVM_INT32)(2*SampleToProcess));
-
- SampleToProcess = 0;
- }
-
- }
- }
-
- /* Store gain value*/
- pInstance->CompressGain = Gain;
- }
-
-
- if(pInstance->bInOperatingModeTransition == LVM_TRUE){
-
- /*
- * Re-init bypass mix when timer has completed
- */
- if ((pInstance->bTimerDone == LVM_TRUE) &&
- (pInstance->BypassMix.Mixer_Instance.MixerStream[1].CallbackSet == 0))
- {
- err=LVCS_BypassMixInit(hInstance,
- &pInstance->Params);
-
- if(err != LVCS_SUCCESS)
- {
- return err;
- }
-
- }
- else{
- LVM_Timer ( &pInstance->TimerInstance,
- (LVM_INT16)NumSamples);
- }
- }
- }
- else
- {
- if (pInData != pOutData)
- {
- /*
- * The algorithm is disabled so just copy the data
- */
- Copy_16((LVM_INT16 *)pInData, /* Source */
- (LVM_INT16 *)pOutData, /* Destination */
- (LVM_INT16)(2*NumSamples)); /* Left and right */
- }
- }
-
-
- return(LVCS_SUCCESS);
-}
-#endif
diff --git a/media/libeffects/lvm/lib/StereoWidening/src/LVCS_ReverbGenerator.cpp b/media/libeffects/lvm/lib/StereoWidening/src/LVCS_ReverbGenerator.cpp
index fbdf57b..d0e6e09 100644
--- a/media/libeffects/lvm/lib/StereoWidening/src/LVCS_ReverbGenerator.cpp
+++ b/media/libeffects/lvm/lib/StereoWidening/src/LVCS_ReverbGenerator.cpp
@@ -57,7 +57,6 @@
/* 2. The numerator coefficients of the filter are negated to cause an inversion. */
/* */
/************************************************************************************/
-#ifdef BUILD_FLOAT
LVCS_ReturnStatus_en LVCS_ReverbGeneratorInit(LVCS_Handle_t hInstance,
LVCS_Params_t *pParams)
{
@@ -71,7 +70,6 @@
BQ_FLOAT_Coefs_t Coeffs;
const BiquadA012B12CoefsSP_t *pReverbCoefTable;
-
pData = (LVCS_Data_t *) \
pInstance->MemoryTable.Region[LVCS_MEMREGION_PERSISTENT_FAST_DATA].pBaseAddress;
@@ -91,7 +89,6 @@
*/
Delay = (LVM_UINT16)LVCS_StereoDelayCS[(LVM_UINT16)pParams->SampleRate];
-
pConfig->DelaySize = (LVM_INT16)(2 * Delay);
pConfig->DelayOffset = 0;
LoadConst_Float(0, /* Value */
@@ -112,8 +109,7 @@
Coeffs.B2 = (LVM_FLOAT)-pReverbCoefTable[Offset].B2;
LoadConst_Float(0, /* Value */
- (LVM_FLOAT *)&pData->ReverbBiquadTaps, /* Destination Cast to void:
- no dereferencing in function*/
+ (LVM_FLOAT *)&pData->ReverbBiquadTaps, /* Destination */
/* Number of words */
(LVM_UINT16)(sizeof(pData->ReverbBiquadTaps) / sizeof(LVM_FLOAT)));
@@ -132,7 +128,6 @@
break;
}
-
/*
* Setup the mixer
*/
@@ -148,90 +143,6 @@
}
return(LVCS_SUCCESS);
}
-#else
-LVCS_ReturnStatus_en LVCS_ReverbGeneratorInit(LVCS_Handle_t hInstance,
- LVCS_Params_t *pParams)
-{
-
- LVM_UINT16 Delay;
- LVM_UINT16 Offset;
- LVCS_Instance_t *pInstance = (LVCS_Instance_t *)hInstance;
- LVCS_ReverbGenerator_t *pConfig = (LVCS_ReverbGenerator_t *)&pInstance->Reverberation;
- LVCS_Data_t *pData = (LVCS_Data_t *)pInstance->MemoryTable.Region[LVCS_MEMREGION_PERSISTENT_FAST_DATA].pBaseAddress;
- LVCS_Coefficient_t *pCoefficients = (LVCS_Coefficient_t *)pInstance->MemoryTable.Region[LVCS_MEMREGION_PERSISTENT_FAST_COEF].pBaseAddress;
- BQ_C16_Coefs_t Coeffs;
- const BiquadA012B12CoefsSP_t *pReverbCoefTable;
-
- /*
- * Initialise the delay and filters if:
- * - the sample rate has changed
- * - the speaker type has changed to or from the mobile speaker
- */
- if(pInstance->Params.SampleRate != pParams->SampleRate ) /* Sample rate change test */
-
- {
- /*
- * Setup the delay
- */
- Delay = (LVM_UINT16)LVCS_StereoDelayCS[(LVM_UINT16)pParams->SampleRate];
-
-
- pConfig->DelaySize = (LVM_INT16)(2 * Delay);
- pConfig->DelayOffset = 0;
- LoadConst_16(0, /* Value */
- (LVM_INT16 *)&pConfig->StereoSamples[0], /* Destination */
- (LVM_UINT16)(sizeof(pConfig->StereoSamples)/sizeof(LVM_INT16))); /* Number of words */
-
- /*
- * Setup the filters
- */
- Offset = (LVM_UINT16)pParams->SampleRate;
- pReverbCoefTable = (BiquadA012B12CoefsSP_t*)&LVCS_ReverbCoefTable[0];
-
- /* Convert incoming coefficients to the required format/ordering */
- Coeffs.A0 = (LVM_INT16)pReverbCoefTable[Offset].A0;
- Coeffs.A1 = (LVM_INT16)pReverbCoefTable[Offset].A1;
- Coeffs.A2 = (LVM_INT16)pReverbCoefTable[Offset].A2;
- Coeffs.B1 = (LVM_INT16)-pReverbCoefTable[Offset].B1;
- Coeffs.B2 = (LVM_INT16)-pReverbCoefTable[Offset].B2;
-
- LoadConst_16(0, /* Value */
- (void *)&pData->ReverbBiquadTaps, /* Destination Cast to void: no dereferencing in function*/
- (LVM_UINT16)(sizeof(pData->ReverbBiquadTaps)/sizeof(LVM_INT16))); /* Number of words */
-
- BQ_2I_D16F16Css_TRC_WRA_01_Init(&pCoefficients->ReverbBiquadInstance,
- &pData->ReverbBiquadTaps,
- &Coeffs);
-
- /* Callbacks */
- switch(pReverbCoefTable[Offset].Scale)
- {
- case 14:
- pConfig->pBiquadCallBack = BQ_2I_D16F16C14_TRC_WRA_01;
- break;
- case 15:
- pConfig->pBiquadCallBack = BQ_2I_D16F16C15_TRC_WRA_01;
- break;
- }
-
-
- /*
- * Setup the mixer
- */
- pConfig->ProcGain = (LVM_UINT16)(HEADPHONEGAINPROC);
- pConfig->UnprocGain = (LVM_UINT16)(HEADPHONEGAINUNPROC);
- }
-
- if(pInstance->Params.ReverbLevel != pParams->ReverbLevel)
- {
- LVM_INT32 ReverbPercentage=83886; // 1 Percent Reverb i.e 1/100 in Q 23 format
- ReverbPercentage*=pParams->ReverbLevel; // Actual Reverb Level in Q 23 format
- pConfig->ReverbLevel=(LVM_INT16)(ReverbPercentage>>8); // Reverb Level in Q 15 format
- }
-
- return(LVCS_SUCCESS);
-}
-#endif
/************************************************************************************/
/* */
/* FUNCTION: LVCS_Reverb */
@@ -270,7 +181,6 @@
/* 2. The Gain is combined with the LPF and incorporated in to the coefficients */
/* */
/************************************************************************************/
-#ifdef BUILD_FLOAT
LVCS_ReturnStatus_en LVCS_ReverbGenerator(LVCS_Handle_t hInstance,
const LVM_FLOAT *pInData,
LVM_FLOAT *pOutData,
@@ -301,7 +211,6 @@
(LVM_INT16)(2 * NumSamples)); /* Left and right */
}
-
/*
* Check if the reverb is required
*/
@@ -338,7 +247,6 @@
(LVM_FLOAT *)pScratch,
(LVM_INT16)(2 * NumSamples));
-
/*
* Apply the delay mix
*/
@@ -349,87 +257,7 @@
&pConfig->DelayOffset,
(LVM_INT16)NumSamples);
-
}
return(LVCS_SUCCESS);
}
-#else
-LVCS_ReturnStatus_en LVCS_ReverbGenerator(LVCS_Handle_t hInstance,
- const LVM_INT16 *pInData,
- LVM_INT16 *pOutData,
- LVM_UINT16 NumSamples)
-{
-
- LVCS_Instance_t *pInstance = (LVCS_Instance_t *)hInstance;
- LVCS_ReverbGenerator_t *pConfig = (LVCS_ReverbGenerator_t *)&pInstance->Reverberation;
- LVCS_Coefficient_t *pCoefficients = (LVCS_Coefficient_t *)pInstance->MemoryTable.Region[LVCS_MEMREGION_PERSISTENT_FAST_COEF].pBaseAddress;
- LVM_INT16 *pScratch = (LVM_INT16 *)pInstance->MemoryTable.Region[LVCS_MEMREGION_TEMPORARY_FAST].pBaseAddress;
-
-
- /*
- * Copy the data to the output in outplace processing
- */
- if (pInData != pOutData)
- {
- /*
- * Reverb not required so just copy the data
- */
- Copy_16((LVM_INT16 *)pInData, /* Source */
- (LVM_INT16 *)pOutData, /* Destination */
- (LVM_INT16)(2*NumSamples)); /* Left and right */
- }
-
-
- /*
- * Check if the reverb is required
- */
- if (((pInstance->Params.SpeakerType == LVCS_HEADPHONE) || /* Disable when CS4MS in stereo mode */
- (pInstance->Params.SpeakerType == LVCS_EX_HEADPHONES) ||
- (pInstance->Params.SourceFormat != LVCS_STEREO)) &&
- ((pInstance->Params.OperatingMode & LVCS_REVERBSWITCH) !=0)) /* For validation testing */
- {
- /********************************************************************************/
- /* */
- /* Copy the input data to scratch memory and filter it */
- /* */
- /********************************************************************************/
-
- /*
- * Copy the input data to the scratch memory
- */
- Copy_16((LVM_INT16 *)pInData, /* Source */
- (LVM_INT16 *)pScratch, /* Destination */
- (LVM_INT16)(2*NumSamples)); /* Left and right */
-
-
- /*
- * Filter the data
- */
- (pConfig->pBiquadCallBack)((Biquad_Instance_t*)&pCoefficients->ReverbBiquadInstance,
- (LVM_INT16 *)pScratch,
- (LVM_INT16 *)pScratch,
- (LVM_INT16)NumSamples);
-
- Mult3s_16x16( (LVM_INT16 *)pScratch,
- pConfig->ReverbLevel,
- (LVM_INT16 *)pScratch,
- (LVM_INT16)(2*NumSamples));
-
-
- /*
- * Apply the delay mix
- */
- DelayMix_16x16((LVM_INT16 *)pScratch,
- &pConfig->StereoSamples[0],
- pConfig->DelaySize,
- pOutData,
- &pConfig->DelayOffset,
- (LVM_INT16)NumSamples);
-
-
- }
-
- return(LVCS_SUCCESS);
-}
-#endif
diff --git a/media/libeffects/lvm/lib/StereoWidening/src/LVCS_ReverbGenerator.h b/media/libeffects/lvm/lib/StereoWidening/src/LVCS_ReverbGenerator.h
index c1c0207..1bc4338 100644
--- a/media/libeffects/lvm/lib/StereoWidening/src/LVCS_ReverbGenerator.h
+++ b/media/libeffects/lvm/lib/StereoWidening/src/LVCS_ReverbGenerator.h
@@ -18,8 +18,6 @@
#ifndef __LVCS_REVERBGENERATOR_H__
#define __LVCS_REVERBGENERATOR_H__
-
-
/************************************************************************************/
/* */
/* Includes */
@@ -28,7 +26,6 @@
#include "LVC_Mixer.h"
-
/************************************************************************************/
/* */
/* Defines */
@@ -38,14 +35,12 @@
#define HEADPHONEGAINPROC LVCS_HEADPHONE_PROCGAIN
#define HEADPHONEGAINUNPROC LVCS_HEADPHONE_UNPROCGAIN
-
/************************************************************************************/
/* */
/* Structures */
/* */
/************************************************************************************/
-
/* Reverberation module structure */
typedef struct
{
@@ -55,23 +50,14 @@
LVM_INT16 DelayOffset;
LVM_INT16 ProcGain;
LVM_INT16 UnprocGain;
-#ifndef BUILD_FLOAT
- LVM_INT16 StereoSamples[2*LVCS_STEREODELAY_CS_48KHZ];
- /* Reverb Level */
- LVM_INT16 ReverbLevel;
- /* Filter */
- void (*pBiquadCallBack) (Biquad_Instance_t*, LVM_INT16*, LVM_INT16*, LVM_INT16);
-#else
LVM_FLOAT StereoSamples[2 * LVCS_STEREODELAY_CS_MAX_VAL];
/* Reverb Level */
LVM_FLOAT ReverbLevel;
/* Filter */
void (*pBiquadCallBack) (Biquad_FLOAT_Instance_t*,
LVM_FLOAT*, LVM_FLOAT*, LVM_INT16);
-#endif
} LVCS_ReverbGenerator_t;
-
/************************************************************************************/
/* */
/* Function prototypes */
@@ -80,16 +66,9 @@
LVCS_ReturnStatus_en LVCS_ReverbGeneratorInit(LVCS_Handle_t hInstance,
LVCS_Params_t *pParams);
-#ifdef BUILD_FLOAT
LVCS_ReturnStatus_en LVCS_ReverbGenerator(LVCS_Handle_t hInstance,
const LVM_FLOAT *pInput,
LVM_FLOAT *pOutput,
LVM_UINT16 NumSamples);
-#else
-LVCS_ReturnStatus_en LVCS_ReverbGenerator(LVCS_Handle_t hInstance,
- const LVM_INT16 *pInput,
- LVM_INT16 *pOutput,
- LVM_UINT16 NumSamples);
-#endif
#endif /* REVERB_H */
diff --git a/media/libeffects/lvm/lib/StereoWidening/src/LVCS_StereoEnhancer.cpp b/media/libeffects/lvm/lib/StereoWidening/src/LVCS_StereoEnhancer.cpp
index f73fc28..7fd8444 100644
--- a/media/libeffects/lvm/lib/StereoWidening/src/LVCS_StereoEnhancer.cpp
+++ b/media/libeffects/lvm/lib/StereoWidening/src/LVCS_StereoEnhancer.cpp
@@ -49,7 +49,6 @@
/* NOTES: */
/* */
/************************************************************************************/
-#ifdef BUILD_FLOAT
LVCS_ReturnStatus_en LVCS_SEnhancerInit(LVCS_Handle_t hInstance,
LVCS_Params_t *pParams)
{
@@ -63,7 +62,6 @@
BQ_FLOAT_Coefs_t CoeffsSide;
const BiquadA012B12CoefsSP_t *pSESideCoefs;
-
pData = (LVCS_Data_t *) \
pInstance->MemoryTable.Region[LVCS_MEMREGION_PERSISTENT_FAST_DATA].pBaseAddress;
@@ -89,8 +87,7 @@
/* Clear the taps */
LoadConst_Float(0, /* Value */
- (LVM_FLOAT *)&pData->SEBiquadTapsMid, /* Destination Cast to void:\
- no dereferencing in function*/
+ (LVM_FLOAT *)&pData->SEBiquadTapsMid, /* Destination */
/* Number of words */
(LVM_UINT16)(sizeof(pData->SEBiquadTapsMid) / sizeof(LVM_FLOAT)));
@@ -117,8 +114,7 @@
/* Clear the taps */
LoadConst_Float(0, /* Value */
- (LVM_FLOAT *)&pData->SEBiquadTapsSide, /* Destination Cast to void:\
- no dereferencing in function*/
+ (LVM_FLOAT *)&pData->SEBiquadTapsSide, /* Destination */
/* Number of words */
(LVM_UINT16)(sizeof(pData->SEBiquadTapsSide) / sizeof(LVM_FLOAT)));
/* Callbacks */
@@ -142,99 +138,8 @@
}
-
return(LVCS_SUCCESS);
}
-#else
-LVCS_ReturnStatus_en LVCS_SEnhancerInit(LVCS_Handle_t hInstance,
- LVCS_Params_t *pParams)
-{
-
- LVM_UINT16 Offset;
- LVCS_Instance_t *pInstance = (LVCS_Instance_t *)hInstance;
- LVCS_StereoEnhancer_t *pConfig = (LVCS_StereoEnhancer_t *)&pInstance->StereoEnhancer;
- LVCS_Data_t *pData = (LVCS_Data_t *)pInstance->MemoryTable.Region[LVCS_MEMREGION_PERSISTENT_FAST_DATA].pBaseAddress;
- LVCS_Coefficient_t *pCoefficient = (LVCS_Coefficient_t *)pInstance->MemoryTable.Region[LVCS_MEMREGION_PERSISTENT_FAST_COEF].pBaseAddress;
- FO_C16_Coefs_t CoeffsMid;
- BQ_C16_Coefs_t CoeffsSide;
- const BiquadA012B12CoefsSP_t *pSESideCoefs;
-
- /*
- * If the sample rate or speaker type has changed update the filters
- */
- if ((pInstance->Params.SampleRate != pParams->SampleRate) ||
- (pInstance->Params.SpeakerType != pParams->SpeakerType))
- {
- /*
- * Set the filter coefficients based on the sample rate
- */
- /* Mid filter */
- Offset = (LVM_UINT16)pParams->SampleRate;
-
- /* Convert incoming coefficients to the required format/ordering */
- CoeffsMid.A0 = (LVM_INT16) LVCS_SEMidCoefTable[Offset].A0;
- CoeffsMid.A1 = (LVM_INT16) LVCS_SEMidCoefTable[Offset].A1;
- CoeffsMid.B1 = (LVM_INT16)-LVCS_SEMidCoefTable[Offset].B1;
-
- /* Clear the taps */
- LoadConst_16(0, /* Value */
- (void *)&pData->SEBiquadTapsMid, /* Destination Cast to void:\
- no dereferencing in function*/
- (LVM_UINT16)(sizeof(pData->SEBiquadTapsMid)/sizeof(LVM_UINT16))); /* Number of words */
-
- FO_1I_D16F16Css_TRC_WRA_01_Init(&pCoefficient->SEBiquadInstanceMid,
- &pData->SEBiquadTapsMid,
- &CoeffsMid);
-
- /* Callbacks */
- if(LVCS_SEMidCoefTable[Offset].Scale==15)
- {
- pConfig->pBiquadCallBack_Mid = FO_1I_D16F16C15_TRC_WRA_01;
- }
-
- Offset = (LVM_UINT16)(pParams->SampleRate);
- pSESideCoefs = (BiquadA012B12CoefsSP_t*)&LVCS_SESideCoefTable[0];
-
- /* Side filter */
- /* Convert incoming coefficients to the required format/ordering */
- CoeffsSide.A0 = (LVM_INT16) pSESideCoefs[Offset].A0;
- CoeffsSide.A1 = (LVM_INT16) pSESideCoefs[Offset].A1;
- CoeffsSide.A2 = (LVM_INT16) pSESideCoefs[Offset].A2;
- CoeffsSide.B1 = (LVM_INT16)-pSESideCoefs[Offset].B1;
- CoeffsSide.B2 = (LVM_INT16)-pSESideCoefs[Offset].B2;
-
- /* Clear the taps */
- LoadConst_16(0, /* Value */
- (void *)&pData->SEBiquadTapsSide, /* Destination Cast to void:\
- no dereferencing in function*/
- (LVM_UINT16)(sizeof(pData->SEBiquadTapsSide)/sizeof(LVM_UINT16))); /* Number of words */
-
-
- /* Callbacks */
- switch(pSESideCoefs[Offset].Scale)
- {
- case 14:
- BQ_1I_D16F32Css_TRC_WRA_01_Init(&pCoefficient->SEBiquadInstanceSide,
- &pData->SEBiquadTapsSide,
- &CoeffsSide);
-
- pConfig->pBiquadCallBack_Side = BQ_1I_D16F32C14_TRC_WRA_01;
- break;
- case 15:
- BQ_1I_D16F16Css_TRC_WRA_01_Init(&pCoefficient->SEBiquadInstanceSide,
- &pData->SEBiquadTapsSide,
- &CoeffsSide);
-
- pConfig->pBiquadCallBack_Side = BQ_1I_D16F16C15_TRC_WRA_01;
- break;
- }
-
- }
-
-
- return(LVCS_SUCCESS);
-}
-#endif
/************************************************************************************/
/* */
/* FUNCTION: LVCS_StereoEnhance */
@@ -273,7 +178,6 @@
/* 1. The side filter is not used in Mobile Speaker mode */
/* */
/************************************************************************************/
-#ifdef BUILD_FLOAT
LVCS_ReturnStatus_en LVCS_StereoEnhancer(LVCS_Handle_t hInstance,
const LVM_FLOAT *pInData,
LVM_FLOAT *pOutData,
@@ -356,81 +260,3 @@
return(LVCS_SUCCESS);
}
-#else
-LVCS_ReturnStatus_en LVCS_StereoEnhancer(LVCS_Handle_t hInstance,
- const LVM_INT16 *pInData,
- LVM_INT16 *pOutData,
- LVM_UINT16 NumSamples)
-{
-
- LVCS_Instance_t *pInstance = (LVCS_Instance_t *)hInstance;
- LVCS_StereoEnhancer_t *pConfig = (LVCS_StereoEnhancer_t *)&pInstance->StereoEnhancer;
- LVCS_Coefficient_t *pCoefficient = (LVCS_Coefficient_t *)pInstance->MemoryTable.Region[LVCS_MEMREGION_PERSISTENT_FAST_COEF].pBaseAddress;
- LVM_INT16 *pScratch = (LVM_INT16 *)pInstance->MemoryTable.Region[LVCS_MEMREGION_TEMPORARY_FAST].pBaseAddress;
-
- /*
- * Check if the Stereo Enhancer is enabled
- */
- if ((pInstance->Params.OperatingMode & LVCS_STEREOENHANCESWITCH) != 0)
- {
- /*
- * Convert from stereo to middle and side
- */
- From2iToMS_16x16(pInData,
- pScratch,
- pScratch+NumSamples,
- (LVM_INT16)NumSamples);
-
- /*
- * Apply filter to the middle signal
- */
- if (pInstance->OutputDevice == LVCS_HEADPHONE)
- {
- (pConfig->pBiquadCallBack_Mid)((Biquad_Instance_t*)&pCoefficient->SEBiquadInstanceMid,
- (LVM_INT16 *)pScratch,
- (LVM_INT16 *)pScratch,
- (LVM_INT16)NumSamples);
- }
- else
- {
- Mult3s_16x16(pScratch, /* Source */
- (LVM_INT16)pConfig->MidGain, /* Gain */
- pScratch, /* Destination */
- (LVM_INT16)NumSamples); /* Number of samples */
- }
-
- /*
- * Apply the filter the side signal only in stereo mode for headphones
- * and in all modes for mobile speakers
- */
- if (pInstance->Params.SourceFormat == LVCS_STEREO)
- {
- (pConfig->pBiquadCallBack_Side)((Biquad_Instance_t*)&pCoefficient->SEBiquadInstanceSide,
- (LVM_INT16 *)(pScratch + NumSamples),
- (LVM_INT16 *)(pScratch + NumSamples),
- (LVM_INT16)NumSamples);
- }
-
- /*
- * Convert from middle and side to stereo
- */
- MSTo2i_Sat_16x16(pScratch,
- pScratch+NumSamples,
- pOutData,
- (LVM_INT16)NumSamples);
-
- }
- else
- {
- /*
- * The stereo enhancer is disabled so just copy the data
- */
- Copy_16((LVM_INT16 *)pInData, /* Source */
- (LVM_INT16 *)pOutData, /* Destination */
- (LVM_INT16)(2*NumSamples)); /* Left and right */
-
- }
-
- return(LVCS_SUCCESS);
-}
-#endif
diff --git a/media/libeffects/lvm/lib/StereoWidening/src/LVCS_StereoEnhancer.h b/media/libeffects/lvm/lib/StereoWidening/src/LVCS_StereoEnhancer.h
index 79ebb67..12a5982 100644
--- a/media/libeffects/lvm/lib/StereoWidening/src/LVCS_StereoEnhancer.h
+++ b/media/libeffects/lvm/lib/StereoWidening/src/LVCS_StereoEnhancer.h
@@ -18,8 +18,6 @@
#ifndef __LVCS_STEREOENHANCER_H__
#define __LVCS_STEREOENHANCER_H__
-
-
/************************************************************************************/
/* */
/* Includes */
@@ -30,7 +28,6 @@
#include "LVCS_Headphone_Coeffs.h" /* Headphone coefficients */
#include "BIQUAD.h"
-
/************************************************************************************/
/* */
/* Structures */
@@ -41,17 +38,6 @@
typedef struct
{
-#ifndef BUILD_FLOAT
- /*
- * Middle filter
- */
- void (*pBiquadCallBack_Mid)(Biquad_Instance_t*, LVM_INT16*, LVM_INT16*, LVM_INT16);
- /*
- * Side filter
- */
- void (*pBiquadCallBack_Side)(Biquad_Instance_t*, LVM_INT16*, LVM_INT16*, LVM_INT16);
- LVM_UINT16 MidGain; /* Middle gain in mobile speaker mode */
-#else
/*
* Middle filter
*/
@@ -64,10 +50,8 @@
void (*pBiquadCallBack_Side)(Biquad_FLOAT_Instance_t*,
LVM_FLOAT*, LVM_FLOAT*, LVM_INT16);
LVM_FLOAT MidGain; /* Middle gain in mobile speaker mode */
-#endif
} LVCS_StereoEnhancer_t;
-
/************************************************************************************/
/* */
/* Function prototypes */
@@ -77,16 +61,9 @@
LVCS_ReturnStatus_en LVCS_SEnhancerInit(LVCS_Handle_t hInstance,
LVCS_Params_t *pParams);
-#ifndef BUILD_FLOAT
-LVCS_ReturnStatus_en LVCS_StereoEnhancer(LVCS_Handle_t hInstance,
- const LVM_INT16 *pInData,
- LVM_INT16 *pOutData,
- LVM_UINT16 NumSamples);
-#else
LVCS_ReturnStatus_en LVCS_StereoEnhancer(LVCS_Handle_t hInstance,
const LVM_FLOAT *pInData,
LVM_FLOAT *pOutData,
LVM_UINT16 NumSamples);
-#endif
#endif /* STEREOENHANCE_H */
diff --git a/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Tables.cpp b/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Tables.cpp
index 1964c8c..d79db61 100644
--- a/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Tables.cpp
+++ b/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Tables.cpp
@@ -15,7 +15,6 @@
* limitations under the License.
*/
-
/************************************************************************************/
/* */
/* Includes */
@@ -28,7 +27,6 @@
#include "BIQUAD.h" /* Biquad definitions */
#include "LVCS_Headphone_Coeffs.h" /* Headphone coefficients */
-
/************************************************************************************/
/* */
/* Stereo Enhancer coefficient constant tables */
@@ -73,7 +71,6 @@
CS_MIDDLE_48000_A1,
CS_MIDDLE_48000_B1,
(LVM_UINT16 )CS_MIDDLE_48000_SCALE}
-#ifdef HIGHER_FS
,
{CS_MIDDLE_88200_A0, /* 88kS/s coefficients */
CS_MIDDLE_88200_A1,
@@ -91,7 +88,6 @@
CS_MIDDLE_192000_A1,
CS_MIDDLE_192000_B1,
(LVM_UINT16 )CS_MIDDLE_192000_SCALE}
-#endif
};
/* Coefficient table for the side filter */
@@ -151,7 +147,6 @@
CS_SIDE_48000_B1,
CS_SIDE_48000_B2,
(LVM_UINT16 )CS_SIDE_48000_SCALE}
-#ifdef HIGHER_FS
,
{CS_SIDE_88200_A0, /* 88kS/s coefficients */
CS_SIDE_88200_A1,
@@ -177,10 +172,8 @@
CS_SIDE_192000_B1,
CS_SIDE_192000_B2,
(LVM_UINT16 )CS_SIDE_192000_SCALE}
-#endif
};
-
/************************************************************************************/
/* */
/* Equaliser coefficient constant tables */
@@ -243,7 +236,6 @@
CS_EQUALISER_48000_B1,
CS_EQUALISER_48000_B2,
(LVM_UINT16 )CS_EQUALISER_48000_SCALE},
-#ifdef HIGHER_FS
{CS_EQUALISER_88200_A0, /* 88kS/s coeffieients */
CS_EQUALISER_88200_A1,
CS_EQUALISER_88200_A2,
@@ -268,7 +260,6 @@
CS_EQUALISER_192000_B1,
CS_EQUALISER_192000_B2,
(LVM_UINT16 )CS_EQUALISER_192000_SCALE},
-#endif
/* Concert Sound EX Headphone coefficients */
{CSEX_EQUALISER_8000_A0, /* 8kS/s coefficients */
@@ -325,7 +316,6 @@
CSEX_EQUALISER_48000_B1,
CSEX_EQUALISER_48000_B2,
(LVM_UINT16 )CSEX_EQUALISER_48000_SCALE}
-#ifdef HIGHER_FS
,
{CSEX_EQUALISER_88200_A0, /* 88kS/s coefficients */
CSEX_EQUALISER_88200_A1,
@@ -351,10 +341,8 @@
CSEX_EQUALISER_192000_B1,
CSEX_EQUALISER_192000_B2,
(LVM_UINT16 )CSEX_EQUALISER_192000_SCALE}
-#endif
};
-
/************************************************************************************/
/* */
/* Reverb delay constant tables */
@@ -440,7 +428,6 @@
CS_REVERB_48000_B1,
CS_REVERB_48000_B2,
(LVM_UINT16 )CS_REVERB_48000_SCALE}
-#ifdef HIGHER_FS
,
{CS_REVERB_88200_A0, /* 88kS/s coefficients */
CS_REVERB_88200_A1,
@@ -466,10 +453,8 @@
CS_REVERB_192000_B1,
CS_REVERB_192000_B2,
(LVM_UINT16 )CS_REVERB_192000_SCALE}
-#endif
};
-
/************************************************************************************/
/* */
/* Bypass mixer constant tables */
@@ -491,7 +476,6 @@
LVCS_EX_HEADPHONE_GAIN}
};
-
/************************************************************************************/
/* */
/* Volume correction table */
@@ -518,7 +502,6 @@
/* */
/************************************************************************************/
const LVCS_VolCorrect_t LVCS_VolCorrectTable[] = {
-#ifdef BUILD_FLOAT
{0.433362f, /* Headphone, stereo mode */
0.000000f,
1.000024f,
@@ -535,24 +518,6 @@
0.000000f,
1.000024f,
1.412640f}
-#else
- {14200, /* Headphone, stereo mode */
- 0,
- 4096,
- 5786},
- {14200, /* EX Headphone, stereo mode */
- 0,
- 4096,
- 5786},
- {32767, /* Headphone, mono mode */
- 0,
- 4096,
- 5786},
- {32767, /* EX Headphone, mono mode */
- 0,
- 4096,
- 5786}
-#endif
};
/************************************************************************************/
@@ -570,14 +535,11 @@
#define LVCS_VOL_TC_Fs32000 32721 /* Floating point value 0.998565674 */
#define LVCS_VOL_TC_Fs44100 32734 /* Floating point value 0.998962402 */
#define LVCS_VOL_TC_Fs48000 32737 /* Floating point value 0.999053955 */
-#if defined(BUILD_FLOAT) && defined(HIGHER_FS)
#define LVCS_VOL_TC_Fs88200 32751 /* Floating point value 0.999481066 */
#define LVCS_VOL_TC_Fs96000 32751 /* Floating point value 0.999511703 */ /* Todo @ need to re check this value*/
#define LVCS_VOL_TC_Fs176400 32759 /* Floating point value 0.999740499 */
#define LVCS_VOL_TC_Fs192000 32763 /* Floating point value 0.999877925 */ /* Todo @ need to re check this value*/
-#endif
-#if defined(BUILD_FLOAT) && defined(HIGHER_FS)
const LVM_INT16 LVCS_VolumeTCTable[13] = {LVCS_VOL_TC_Fs8000,
LVCS_VOL_TC_Fs11025,
LVCS_VOL_TC_Fs12000,
@@ -592,25 +554,12 @@
LVCS_VOL_TC_Fs176400,
LVCS_VOL_TC_Fs192000
};
-#else
-const LVM_INT16 LVCS_VolumeTCTable[9] = {LVCS_VOL_TC_Fs8000,
- LVCS_VOL_TC_Fs11025,
- LVCS_VOL_TC_Fs12000,
- LVCS_VOL_TC_Fs16000,
- LVCS_VOL_TC_Fs22050,
- LVCS_VOL_TC_Fs24000,
- LVCS_VOL_TC_Fs32000,
- LVCS_VOL_TC_Fs44100,
- LVCS_VOL_TC_Fs48000
-};
-#endif
/************************************************************************************/
/* */
/* Sample rate table */
/* */
/************************************************************************************/
-#if defined(BUILD_FLOAT) && defined(HIGHER_FS)
const LVM_INT32 LVCS_SampleRateTable[13] = {8000,
11025,
12000,
@@ -625,15 +574,3 @@
176400,
192000
};
-#else
-const LVM_INT16 LVCS_SampleRateTable[9] = {8000,
- 11025,
- 12000,
- 16000,
- 22050,
- 24000,
- 32000,
- 44100,
- 48000
-};
-#endif
diff --git a/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Tables.h b/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Tables.h
index 8609ad6..5490699 100644
--- a/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Tables.h
+++ b/media/libeffects/lvm/lib/StereoWidening/src/LVCS_Tables.h
@@ -18,7 +18,6 @@
#ifndef __LVCS_TABLES_H__
#define __LVCS_TABLES_H__
-
/************************************************************************************/
/* */
/* Includes */
@@ -101,7 +100,6 @@
extern const LVCS_VolCorrect_t LVCS_VolCorrectTable[];
extern const LVM_INT16 LVCS_VolumeTCTable[];
-
/************************************************************************************/
/* */
/* Sample rates */
@@ -110,7 +108,6 @@
extern const LVM_INT32 LVCS_SampleRateTable[];
-
/*Speaker coeffient tables*/
extern LVM_UINT16 LVCS_MS_Small_SEMiddleGainTable[];
extern BiquadA012B12CoefsSP_t LVCS_MS_Small_SESideCoefTable[];
@@ -139,8 +136,5 @@
extern LVCS_VolCorrect_t LVCS_MS_Large_VolCorrectTable[];
extern LVM_UINT16 LVCS_MS_Large_ReverbGainTable[];
-
-
-
#endif /* __LVCS_TABLES_H__ */
diff --git a/media/libeffects/lvm/tests/Android.bp b/media/libeffects/lvm/tests/Android.bp
index 003ce9e..674c246 100644
--- a/media/libeffects/lvm/tests/Android.bp
+++ b/media/libeffects/lvm/tests/Android.bp
@@ -35,8 +35,6 @@
srcs: ["lvmtest.cpp"],
cflags: [
- "-DBUILD_FLOAT",
- "-DHIGHER_FS",
"-DSUPPORT_MC",
"-Wall",
diff --git a/media/libeffects/lvm/tests/lvmtest.cpp b/media/libeffects/lvm/tests/lvmtest.cpp
index 5b58dd1..a4ace6c 100644
--- a/media/libeffects/lvm/tests/lvmtest.cpp
+++ b/media/libeffects/lvm/tests/lvmtest.cpp
@@ -482,10 +482,6 @@
pContext->pBundledContext->SamplesToExitCountVirt = 0;
pContext->pBundledContext->SamplesToExitCountBb = 0;
pContext->pBundledContext->SamplesToExitCountEq = 0;
-#if defined(BUILD_FLOAT) && !defined(NATIVE_FLOAT_BUFFER)
- pContext->pBundledContext->pInputBuffer = NULL;
- pContext->pBundledContext->pOutputBuffer = NULL;
-#endif
for (int i = 0; i < FIVEBAND_NUMBANDS; i++) {
pContext->pBundledContext->bandGaindB[i] = EQNB_5BandSoftPresets[i];
}
diff --git a/media/libeffects/lvm/wrapper/Android.bp b/media/libeffects/lvm/wrapper/Android.bp
index 5fb6d12..afc4220 100644
--- a/media/libeffects/lvm/wrapper/Android.bp
+++ b/media/libeffects/lvm/wrapper/Android.bp
@@ -1,6 +1,3 @@
-// The wrapper -DBUILD_FLOAT needs to match
-// the lvm library -DBUILD_FLOAT.
-
// music bundle wrapper
cc_library_shared {
name: "libbundlewrapper",
@@ -16,8 +13,6 @@
cppflags: [
"-fvisibility=hidden",
- "-DBUILD_FLOAT",
- "-DHIGHER_FS",
"-DSUPPORT_MC",
"-Wall",
@@ -58,8 +53,6 @@
cppflags: [
"-fvisibility=hidden",
- "-DBUILD_FLOAT",
- "-DHIGHER_FS",
"-Wall",
"-Werror",
diff --git a/media/libeffects/lvm/wrapper/Bundle/EffectBundle.cpp b/media/libeffects/lvm/wrapper/Bundle/EffectBundle.cpp
index 10dda19..d569c6a 100644
--- a/media/libeffects/lvm/wrapper/Bundle/EffectBundle.cpp
+++ b/media/libeffects/lvm/wrapper/Bundle/EffectBundle.cpp
@@ -81,7 +81,6 @@
} \
}
-
// NXP SW BassBoost UUID
const effect_descriptor_t gBassBoostDescriptor = {
{0x0634f220, 0xddd4, 0x11db, 0xa0fc, { 0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b }},
@@ -258,26 +257,6 @@
pContext->pBundledContext->firstVolume = LVM_TRUE;
pContext->pBundledContext->volume = 0;
- #ifdef LVM_PCM
- char fileName[256];
- snprintf(fileName, 256, "/data/tmp/bundle_%p_pcm_in.pcm", pContext->pBundledContext);
- pContext->pBundledContext->PcmInPtr = fopen(fileName, "w");
- if (pContext->pBundledContext->PcmInPtr == NULL) {
- ALOGV("cannot open %s", fileName);
- ret = -EINVAL;
- goto exit;
- }
-
- snprintf(fileName, 256, "/data/tmp/bundle_%p_pcm_out.pcm", pContext->pBundledContext);
- pContext->pBundledContext->PcmOutPtr = fopen(fileName, "w");
- if (pContext->pBundledContext->PcmOutPtr == NULL) {
- ALOGV("cannot open %s", fileName);
- fclose(pContext->pBundledContext->PcmInPtr);
- pContext->pBundledContext->PcmInPtr = NULL;
- ret = -EINVAL;
- goto exit;
- }
- #endif
/* Saved strength is used to return the exact strength that was used in the set to the get
* because we map the original strength range of 0:1000 to 1:15, and this will avoid
@@ -295,10 +274,6 @@
pContext->pBundledContext->SamplesToExitCountVirt = 0;
pContext->pBundledContext->SamplesToExitCountBb = 0;
pContext->pBundledContext->SamplesToExitCountEq = 0;
-#if defined(BUILD_FLOAT) && !defined(NATIVE_FLOAT_BUFFER)
- pContext->pBundledContext->pInputBuffer = NULL;
- pContext->pBundledContext->pOutputBuffer = NULL;
-#endif
for (int i = 0; i < FIVEBAND_NUMBANDS; i++) {
pContext->pBundledContext->bandGaindB[i] = EQNB_5BandSoftPresets[i];
}
@@ -443,17 +418,6 @@
(pSessionContext->bEqualizerInstantiated ==LVM_FALSE) &&
(pSessionContext->bVirtualizerInstantiated==LVM_FALSE))
{
-#ifdef LVM_PCM
- if (pContext->pBundledContext->PcmInPtr != NULL) {
- fclose(pContext->pBundledContext->PcmInPtr);
- pContext->pBundledContext->PcmInPtr = NULL;
- }
- if (pContext->pBundledContext->PcmOutPtr != NULL) {
- fclose(pContext->pBundledContext->PcmOutPtr);
- pContext->pBundledContext->PcmOutPtr = NULL;
- }
-#endif
-
// Clear the SessionIndex
for(int i=0; i<LVM_MAX_SESSIONS; i++){
@@ -474,10 +438,6 @@
if (pContext->pBundledContext->workBuffer != NULL) {
free(pContext->pBundledContext->workBuffer);
}
-#if defined(BUILD_FLOAT) && !defined(NATIVE_FLOAT_BUFFER)
- free(pContext->pBundledContext->pInputBuffer);
- free(pContext->pBundledContext->pOutputBuffer);
-#endif
delete pContext->pBundledContext;
pContext->pBundledContext = LVM_NULL;
}
@@ -759,7 +719,6 @@
// pOut: pointer to updated stereo 16 bit output data
//
//----------------------------------------------------------------------------
-#ifdef BUILD_FLOAT
int LvmBundle_process(effect_buffer_t *pIn,
effect_buffer_t *pOut,
int frameCount,
@@ -769,30 +728,6 @@
effect_buffer_t *pOutTmp;
const LVM_INT32 NrChannels =
audio_channel_count_from_out_mask(pContext->config.inputCfg.channels);
-#ifndef NATIVE_FLOAT_BUFFER
- if (pContext->pBundledContext->pInputBuffer == nullptr ||
- pContext->pBundledContext->frameCount < frameCount) {
- free(pContext->pBundledContext->pInputBuffer);
- pContext->pBundledContext->pInputBuffer =
- (LVM_FLOAT *)calloc(frameCount, sizeof(LVM_FLOAT) * NrChannels);
- }
-
- if (pContext->pBundledContext->pOutputBuffer == nullptr ||
- pContext->pBundledContext->frameCount < frameCount) {
- free(pContext->pBundledContext->pOutputBuffer);
- pContext->pBundledContext->pOutputBuffer =
- (LVM_FLOAT *)calloc(frameCount, sizeof(LVM_FLOAT) * NrChannels);
- }
-
- if (pContext->pBundledContext->pInputBuffer == nullptr ||
- pContext->pBundledContext->pOutputBuffer == nullptr) {
- ALOGE("LVM_ERROR : LvmBundle_process memory allocation for float buffer's failed");
- return -EINVAL;
- }
-
- LVM_FLOAT * const pInputBuff = pContext->pBundledContext->pInputBuffer;
- LVM_FLOAT * const pOutputBuff = pContext->pBundledContext->pOutputBuffer;
-#endif
if (pContext->config.outputCfg.accessMode == EFFECT_BUFFER_ACCESS_WRITE){
pOutTmp = pOut;
@@ -814,123 +749,25 @@
return -EINVAL;
}
-#ifdef LVM_PCM
- fwrite(pIn,
- frameCount * sizeof(effect_buffer_t) * NrChannels,
- 1,
- pContext->pBundledContext->PcmInPtr);
- fflush(pContext->pBundledContext->PcmInPtr);
-#endif
-#ifndef NATIVE_FLOAT_BUFFER
- /* Converting input data from fixed point to float point */
- memcpy_to_float_from_i16(pInputBuff, pIn, frameCount * NrChannels);
-
- /* Process the samples */
- LvmStatus = LVM_Process(pContext->pBundledContext->hInstance, /* Instance handle */
- pInputBuff, /* Input buffer */
- pOutputBuff, /* Output buffer */
- (LVM_UINT16)frameCount, /* Number of samples to read */
- 0); /* Audio Time */
-
- /* Converting output data from float point to fixed point */
- memcpy_to_i16_from_float(pOutTmp, pOutputBuff, frameCount * NrChannels);
-
-#else
/* Process the samples */
LvmStatus = LVM_Process(pContext->pBundledContext->hInstance, /* Instance handle */
pIn, /* Input buffer */
pOutTmp, /* Output buffer */
(LVM_UINT16)frameCount, /* Number of samples to read */
0); /* Audio Time */
-#endif
LVM_ERROR_CHECK(LvmStatus, "LVM_Process", "LvmBundle_process")
if(LvmStatus != LVM_SUCCESS) return -EINVAL;
-#ifdef LVM_PCM
- fwrite(pOutTmp,
- frameCount * sizeof(effect_buffer_t) * NrChannels,
- 1,
- pContext->pBundledContext->PcmOutPtr);
- fflush(pContext->pBundledContext->PcmOutPtr);
-#endif
if (pContext->config.outputCfg.accessMode == EFFECT_BUFFER_ACCESS_ACCUMULATE){
for (int i = 0; i < frameCount * NrChannels; i++) {
-#ifndef NATIVE_FLOAT_BUFFER
- pOut[i] = clamp16((LVM_INT32)pOut[i] + (LVM_INT32)pOutTmp[i]);
-#else
pOut[i] = pOut[i] + pOutTmp[i];
-#endif
}
}
return 0;
} /* end LvmBundle_process */
-#else // BUILD_FLOAT
-
-int LvmBundle_process(LVM_INT16 *pIn,
- LVM_INT16 *pOut,
- int frameCount,
- EffectContext *pContext) {
-
- LVM_ReturnStatus_en LvmStatus = LVM_SUCCESS; /* Function call status */
- LVM_INT16 *pOutTmp;
-
- if (pContext->config.outputCfg.accessMode == EFFECT_BUFFER_ACCESS_WRITE){
- pOutTmp = pOut;
- } else if (pContext->config.outputCfg.accessMode == EFFECT_BUFFER_ACCESS_ACCUMULATE){
- if (pContext->pBundledContext->frameCount != frameCount) {
- if (pContext->pBundledContext->workBuffer != NULL) {
- free(pContext->pBundledContext->workBuffer);
- }
- pContext->pBundledContext->workBuffer =
- (effect_buffer_t *)calloc(frameCount, sizeof(effect_buffer_t) * FCC_2);
- if (pContext->pBundledContext->workBuffer == NULL) {
- return -ENOMEM;
- }
- pContext->pBundledContext->frameCount = frameCount;
- }
- pOutTmp = pContext->pBundledContext->workBuffer;
- } else {
- ALOGV("LVM_ERROR : LvmBundle_process invalid access mode");
- return -EINVAL;
- }
-
-#ifdef LVM_PCM
- fwrite(pIn, frameCount * sizeof(*pIn) * FCC_2,
- 1 /* nmemb */, pContext->pBundledContext->PcmInPtr);
- fflush(pContext->pBundledContext->PcmInPtr);
-#endif
-
- //ALOGV("Calling LVM_Process");
-
- /* Process the samples */
- LvmStatus = LVM_Process(pContext->pBundledContext->hInstance, /* Instance handle */
- pIn, /* Input buffer */
- pOutTmp, /* Output buffer */
- (LVM_UINT16)frameCount, /* Number of samples to read */
- 0); /* Audio Time */
-
- LVM_ERROR_CHECK(LvmStatus, "LVM_Process", "LvmBundle_process")
- if(LvmStatus != LVM_SUCCESS) return -EINVAL;
-
-#ifdef LVM_PCM
- fwrite(pOutTmp, frameCount * sizeof(*pOutTmp) * FCC_2,
- 1 /* nmemb */, pContext->pBundledContext->PcmOutPtr);
- fflush(pContext->pBundledContext->PcmOutPtr);
-#endif
-
- if (pContext->config.outputCfg.accessMode == EFFECT_BUFFER_ACCESS_ACCUMULATE){
- for (int i=0; i<frameCount*2; i++){
- pOut[i] = clamp16((LVM_INT32)pOut[i] + (LVM_INT32)pOutTmp[i]);
- }
- }
- return 0;
-} /* end LvmBundle_process */
-
-#endif // BUILD_FLOAT
-
//----------------------------------------------------------------------------
// EqualizerUpdateActiveParams()
//----------------------------------------------------------------------------
@@ -953,7 +790,6 @@
//ALOGV("\tEqualizerUpdateActiveParams just Got -> %d\n",
// ActiveParams.pEQNB_BandDefinition[band].Gain);
-
for (int i = 0; i < FIVEBAND_NUMBANDS; i++) {
ActiveParams.pEQNB_BandDefinition[i].Frequency = EQNB_5BandPresetsFrequencies[i];
ActiveParams.pEQNB_BandDefinition[i].QFactor = EQNB_5BandPresetsQFactors[i];
@@ -1290,7 +1126,6 @@
SampleRate = LVM_FS_48000;
pContext->pBundledContext->SamplesPerSecond = 48000 * NrChannels;
break;
-#if defined(BUILD_FLOAT) && defined(HIGHER_FS)
case 88200:
SampleRate = LVM_FS_88200;
pContext->pBundledContext->SamplesPerSecond = 88200 * NrChannels;
@@ -1307,7 +1142,6 @@
SampleRate = LVM_FS_192000;
pContext->pBundledContext->SamplesPerSecond = 192000 * NrChannels;
break;
-#endif
default:
ALOGV("\tEffect_setConfig invalid sampling rate %d", pConfig->inputCfg.samplingRate);
return -EINVAL;
@@ -2051,8 +1885,6 @@
LVM_ReturnStatus_en LvmStatus=LVM_SUCCESS; /* Function call status */
LVM_INT16 Balance = 0;
-
-
pContext->pBundledContext->positionSaved = position;
Balance = VolumeConvertStereoPosition(pContext->pBundledContext->positionSaved);
@@ -2097,7 +1929,6 @@
return 0;
} /* end VolumeSetStereoPosition */
-
//----------------------------------------------------------------------------
// VolumeGetStereoPosition()
//----------------------------------------------------------------------------
@@ -2970,7 +2801,6 @@
return status;
} /* end Volume_getParameter */
-
//----------------------------------------------------------------------------
// Volume_setParameter()
//----------------------------------------------------------------------------
@@ -3422,17 +3252,10 @@
pContext->pBundledContext->NumberEffectsCalled = 0;
/* Process all the available frames, block processing is
handled internalLY by the LVM bundle */
-#ifdef NATIVE_FLOAT_BUFFER
processStatus = android::LvmBundle_process(inBuffer->f32,
outBuffer->f32,
outBuffer->frameCount,
pContext);
-#else
- processStatus = android::LvmBundle_process(inBuffer->s16,
- outBuffer->s16,
- outBuffer->frameCount,
- pContext);
-#endif
if (processStatus != 0){
ALOGV("\tLVM_ERROR : LvmBundle_process returned error %d", processStatus);
if (status == 0) {
@@ -3447,11 +3270,7 @@
if (pContext->config.outputCfg.accessMode == EFFECT_BUFFER_ACCESS_ACCUMULATE) {
for (size_t i = 0; i < outBuffer->frameCount * NrChannels; ++i) {
-#ifdef NATIVE_FLOAT_BUFFER
outBuffer->f32[i] += inBuffer->f32[i];
-#else
- outBuffer->s16[i] = clamp16((LVM_INT32)outBuffer->s16[i] + inBuffer->s16[i]);
-#endif
}
} else if (outBuffer->raw != inBuffer->raw) {
memcpy(outBuffer->raw,
diff --git a/media/libeffects/lvm/wrapper/Bundle/EffectBundle.h b/media/libeffects/lvm/wrapper/Bundle/EffectBundle.h
index d8e2ec6..524e103 100644
--- a/media/libeffects/lvm/wrapper/Bundle/EffectBundle.h
+++ b/media/libeffects/lvm/wrapper/Bundle/EffectBundle.h
@@ -23,7 +23,6 @@
#include <LVM.h>
#include <limits.h>
-
#define FIVEBAND_NUMBANDS 5
#define MAX_NUM_BANDS 5
#define MAX_CALL_SIZE 256
@@ -34,7 +33,6 @@
#define EQUALIZER_CUP_LOAD_ARM9E 220 // Expressed in 0.1 MIPS
#define VOLUME_CUP_LOAD_ARM9E 0 // Expressed in 0.1 MIPS
#define BUNDLE_MEM_USAGE 25 // Expressed in kB
-//#define LVM_PCM
#ifndef OPENSL_ES_H_
static const effect_uuid_t SL_IID_VOLUME_ = { 0x09e8ede0, 0xddde, 0x11db, 0xb4f6,
@@ -96,14 +94,6 @@
int frameCount;
int32_t bandGaindB[FIVEBAND_NUMBANDS];
int volume;
- #ifdef LVM_PCM
- FILE *PcmInPtr;
- FILE *PcmOutPtr;
- #endif
-#if defined(BUILD_FLOAT) && !defined(NATIVE_FLOAT_BUFFER)
- LVM_FLOAT *pInputBuffer;
- LVM_FLOAT *pOutputBuffer;
-#endif
#ifdef SUPPORT_MC
LVM_INT32 ChMask;
#endif
@@ -134,7 +124,6 @@
BundledEffectContext *pBundledContext;
};
-
/* enumerated parameter settings for Volume effect */
typedef enum
{
@@ -225,6 +214,4 @@
static const float LimitLevel_virtualizerContribution = 1.9;
-
-
#endif /*ANDROID_EFFECTBUNDLE_H_*/
diff --git a/media/libeffects/lvm/wrapper/Reverb/EffectReverb.cpp b/media/libeffects/lvm/wrapper/Reverb/EffectReverb.cpp
index 602f607..1cb81a6 100644
--- a/media/libeffects/lvm/wrapper/Reverb/EffectReverb.cpp
+++ b/media/libeffects/lvm/wrapper/Reverb/EffectReverb.cpp
@@ -79,7 +79,6 @@
{-400, -200, 1300, 900, 0, 2, 0, 10, 1000, 750},
};
-
// NXP SW auxiliary environmental reverb
const effect_descriptor_t gAuxEnvReverbDescriptor = {
{ 0xc2e5d5f0, 0x94bd, 0x4763, 0x9cac, { 0x4e, 0x23, 0x4d, 0x06, 0x83, 0x9e } },
@@ -136,11 +135,7 @@
&gInsertPresetReverbDescriptor
};
-#ifdef BUILD_FLOAT
typedef float process_buffer_t; // process in float
-#else
-typedef int32_t process_buffer_t; // process in Q4_27
-#endif // BUILD_FLOAT
struct ReverbContext{
const struct effect_interface_s *itfe;
@@ -154,10 +149,6 @@
int16_t SavedDiffusion;
int16_t SavedDensity;
bool bEnabled;
- #ifdef LVM_PCM
- FILE *PcmInPtr;
- FILE *PcmOutPtr;
- #endif
LVM_Fs_en SampleRate;
process_buffer_t *InFrames;
process_buffer_t *OutFrames;
@@ -183,11 +174,7 @@
#define REVERB_DEFAULT_PRESET REVERB_PRESET_NONE
-#ifdef BUILD_FLOAT
#define REVERB_SEND_LEVEL 0.75f // 0.75 in 4.12 format
-#else
-#define REVERB_SEND_LEVEL (0x0C00) // 0.75 in 4.12 format
-#endif
#define REVERB_UNIT_VOLUME (0x1000) // 1.0 in 4.12 format
//--- local function prototypes
@@ -269,18 +256,6 @@
*pHandle = (effect_handle_t)pContext;
-#ifdef LVM_PCM
- pContext->PcmInPtr = NULL;
- pContext->PcmOutPtr = NULL;
-
- pContext->PcmInPtr = fopen("/data/tmp/reverb_pcm_in.pcm", "w");
- pContext->PcmOutPtr = fopen("/data/tmp/reverb_pcm_out.pcm", "w");
-
- if((pContext->PcmInPtr == NULL)||
- (pContext->PcmOutPtr == NULL)){
- return -EINVAL;
- }
-#endif
int channels = audio_channel_count_from_out_mask(pContext->config.inputCfg.channels);
@@ -304,10 +279,6 @@
return -EINVAL;
}
- #ifdef LVM_PCM
- fclose(pContext->PcmInPtr);
- fclose(pContext->PcmOutPtr);
- #endif
free(pContext->InFrames);
free(pContext->OutFrames);
pContext->bufferSizeIn = 0;
@@ -378,7 +349,6 @@
return -EINVAL;
}
-#ifdef BUILD_FLOAT
size_t inSize = frameCount * sizeof(process_buffer_t) * channels;
size_t outSize = frameCount * sizeof(process_buffer_t) * FCC_2;
if (pContext->InFrames == NULL ||
@@ -394,10 +364,6 @@
pContext->OutFrames = (process_buffer_t *)calloc(1, pContext->bufferSizeOut);
}
-#ifndef NATIVE_FLOAT_BUFFER
- effect_buffer_t * const OutFrames16 = (effect_buffer_t *)pContext->OutFrames;
-#endif
-#endif
// Check for NULL pointers
if ((pContext->InFrames == NULL) || (pContext->OutFrames == NULL)) {
@@ -405,47 +371,20 @@
return -EINVAL;
}
-#ifdef LVM_PCM
- fwrite(pIn, frameCount * sizeof(*pIn) * channels, 1 /* nmemb */, pContext->PcmInPtr);
- fflush(pContext->PcmInPtr);
-#endif
if (pContext->preset && pContext->nextPreset != pContext->curPreset) {
Reverb_LoadPreset(pContext);
}
if (pContext->auxiliary) {
-#ifdef BUILD_FLOAT
-#ifdef NATIVE_FLOAT_BUFFER
static_assert(std::is_same<decltype(*pIn), decltype(*pContext->InFrames)>::value,
"pIn and InFrames must be same type");
memcpy(pContext->InFrames, pIn, frameCount * channels * sizeof(*pIn));
-#else
- memcpy_to_float_from_i16(
- pContext->InFrames, pIn, frameCount * channels);
-#endif
-#else //no BUILD_FLOAT
- for (int i = 0; i < frameCount * channels; i++) {
- pContext->InFrames[i] = (process_buffer_t)pIn[i]<<8;
- }
-#endif
} else {
// insert reverb input is always stereo
for (int i = 0; i < frameCount; i++) {
-#ifdef BUILD_FLOAT
-#ifdef NATIVE_FLOAT_BUFFER
pContext->InFrames[2 * i] = (process_buffer_t)pIn[2 * i] * REVERB_SEND_LEVEL;
pContext->InFrames[2 * i + 1] = (process_buffer_t)pIn[2 * i + 1] * REVERB_SEND_LEVEL;
-#else
- pContext->InFrames[2 * i] =
- (process_buffer_t)pIn[2 * i] * REVERB_SEND_LEVEL / 32768.0f;
- pContext->InFrames[2 * i + 1] =
- (process_buffer_t)pIn[2 * i + 1] * REVERB_SEND_LEVEL / 32768.0f;
-#endif
-#else
- pContext->InFrames[2*i] = (pIn[2*i] * REVERB_SEND_LEVEL) >> 4; // <<8 + >>12
- pContext->InFrames[2*i+1] = (pIn[2*i+1] * REVERB_SEND_LEVEL) >> 4; // <<8 + >>12
-#endif
}
}
@@ -471,43 +410,16 @@
// Convert to 16 bits
if (pContext->auxiliary) {
-#ifdef BUILD_FLOAT
// nothing to do here
-#ifndef NATIVE_FLOAT_BUFFER
- // pContext->OutFrames and OutFrames16 point to the same buffer
- // make sure the float to int conversion happens in the right order.
- memcpy_to_i16_from_float(OutFrames16, pContext->OutFrames,
- (size_t)frameCount * FCC_2);
-#endif
-#else
- memcpy_to_i16_from_q4_27(OutFrames16, pContext->OutFrames, (size_t)frameCount * FCC_2);
-#endif
} else {
-#ifdef BUILD_FLOAT
-#ifdef NATIVE_FLOAT_BUFFER
for (int i = 0; i < frameCount * FCC_2; i++) { // always stereo here
// Mix with dry input
pContext->OutFrames[i] += pIn[i];
}
-#else
- for (int i = 0; i < frameCount * FCC_2; i++) { // always stereo here
- // pOutputBuff and OutFrames16 point to the same buffer
- // make sure the float to int conversion happens in the right order.
- pContext->OutFrames[i] += (process_buffer_t)pIn[i] / 32768.0f;
- }
- memcpy_to_i16_from_float(OutFrames16, pContext->OutFrames,
- (size_t)frameCount * FCC_2);
-#endif
-#else
- for (int i=0; i < frameCount * FCC_2; i++) { // always stereo here
- OutFrames16[i] = clamp16((pContext->OutFrames[i]>>8) + (process_buffer_t)pIn[i]);
- }
-#endif
// apply volume with ramp if needed
if ((pContext->leftVolume != pContext->prevLeftVolume ||
pContext->rightVolume != pContext->prevRightVolume) &&
pContext->volumeMode == REVERB_VOLUME_RAMP) {
-#if defined (BUILD_FLOAT) && defined (NATIVE_FLOAT_BUFFER)
// FIXME: still using int16 volumes.
// For reference: REVERB_UNIT_VOLUME (0x1000) // 1.0 in 4.12 format
float vl = (float)pContext->prevLeftVolume / 4096;
@@ -522,37 +434,14 @@
vl += incl;
vr += incr;
}
-#else
- LVM_INT32 vl = (LVM_INT32)pContext->prevLeftVolume << 16;
- LVM_INT32 incl = (((LVM_INT32)pContext->leftVolume << 16) - vl) / frameCount;
- LVM_INT32 vr = (LVM_INT32)pContext->prevRightVolume << 16;
- LVM_INT32 incr = (((LVM_INT32)pContext->rightVolume << 16) - vr) / frameCount;
-
- for (int i = 0; i < frameCount; i++) {
- OutFrames16[FCC_2 * i] =
- clamp16((LVM_INT32)((vl >> 16) * OutFrames16[2*i]) >> 12);
- OutFrames16[FCC_2 * i + 1] =
- clamp16((LVM_INT32)((vr >> 16) * OutFrames16[2*i+1]) >> 12);
-
- vl += incl;
- vr += incr;
- }
-#endif
pContext->prevLeftVolume = pContext->leftVolume;
pContext->prevRightVolume = pContext->rightVolume;
} else if (pContext->volumeMode != REVERB_VOLUME_OFF) {
if (pContext->leftVolume != REVERB_UNIT_VOLUME ||
pContext->rightVolume != REVERB_UNIT_VOLUME) {
for (int i = 0; i < frameCount; i++) {
-#if defined(BUILD_FLOAT) && defined(NATIVE_FLOAT_BUFFER)
pContext->OutFrames[FCC_2 * i] *= ((float)pContext->leftVolume / 4096);
pContext->OutFrames[FCC_2 * i + 1] *= ((float)pContext->rightVolume / 4096);
-#else
- OutFrames16[FCC_2 * i] =
- clamp16((LVM_INT32)(pContext->leftVolume * OutFrames16[2*i]) >> 12);
- OutFrames16[FCC_2 * i + 1] =
- clamp16((LVM_INT32)(pContext->rightVolume * OutFrames16[2*i+1]) >> 12);
-#endif
}
}
pContext->prevLeftVolume = pContext->leftVolume;
@@ -561,21 +450,12 @@
}
}
-#ifdef LVM_PCM
- fwrite(pContext->OutFrames, frameCount * sizeof(*pContext->OutFrames) * FCC_2,
- 1 /* nmemb */, pContext->PcmOutPtr);
- fflush(pContext->PcmOutPtr);
-#endif
// Accumulate if required
if (pContext->config.outputCfg.accessMode == EFFECT_BUFFER_ACCESS_ACCUMULATE){
//ALOGV("\tBuffer access is ACCUMULATE");
for (int i = 0; i < frameCount * FCC_2; i++) { // always stereo here
-#ifndef NATIVE_FLOAT_BUFFER
- pOut[i] = clamp16((int32_t)pOut[i] + (int32_t)OutFrames16[i]);
-#else
pOut[i] += pContext->OutFrames[i];
-#endif
}
}else{
//ALOGV("\tBuffer access is WRITE");
@@ -654,7 +534,6 @@
//ALOGV("\tReverb_setConfig calling memcpy");
pContext->config = *pConfig;
-
switch (pConfig->inputCfg.samplingRate) {
case 8000:
SampleRate = LVM_FS_8000;
@@ -674,7 +553,6 @@
case 48000:
SampleRate = LVM_FS_48000;
break;
-#if defined(BUILD_FLOAT) && defined(HIGHER_FS)
case 88200:
SampleRate = LVM_FS_88200;
break;
@@ -687,7 +565,6 @@
case 192000:
SampleRate = LVM_FS_192000;
break;
-#endif
default:
ALOGV("\rReverb_setConfig invalid sampling rate %d", pConfig->inputCfg.samplingRate);
return -EINVAL;
@@ -1509,7 +1386,6 @@
//ALOGV("\tReverbGetDensity Succesfully returned from LVM_GetControlParameters\n");
//ALOGV("\tReverbGetDensity() just Got -> %d\n", ActiveParams.RoomSize);
-
Temp = (LVM_INT16)(((pContext->SavedDensity * 99) / 1000) + 1);
if(Temp != ActiveParams.RoomSize){
@@ -1557,7 +1433,6 @@
return 0;
}
-
//----------------------------------------------------------------------------
// Reverb_getParameter()
//----------------------------------------------------------------------------
@@ -1903,7 +1778,6 @@
return status;
} /* end Reverb_setParameter */
-
/**
* returns the size in bytes of the value of each environmental reverb parameter
*/
@@ -1951,17 +1825,10 @@
}
//ALOGV("\tReverb_process() Calling process with %d frames", outBuffer->frameCount);
/* Process all the available frames, block processing is handled internalLY by the LVM bundle */
-#if defined (BUILD_FLOAT) && defined (NATIVE_FLOAT_BUFFER)
status = process( inBuffer->f32,
outBuffer->f32,
outBuffer->frameCount,
pContext);
-#else
- status = process( inBuffer->s16,
- outBuffer->s16,
- outBuffer->frameCount,
- pContext);
-#endif
if (pContext->bEnabled == LVM_FALSE) {
if (pContext->SamplesToExitCount > 0) {
@@ -1986,7 +1853,6 @@
LVREV_ControlParams_st ActiveParams; /* Current control Parameters */
LVREV_ReturnStatus_en LvmStatus=LVREV_SUCCESS; /* Function call status */
-
if (pContext == NULL){
ALOGV("\tLVM_ERROR : Reverb_command ERROR pContext == NULL");
return -EINVAL;
@@ -2161,7 +2027,6 @@
return -EINVAL;
}
-
if (pReplyData != NULL) { // we have volume control
pContext->leftVolume = (LVM_INT16)((*(uint32_t *)pCmdData + (1 << 11)) >> 12);
pContext->rightVolume = (LVM_INT16)((*((uint32_t *)pCmdData + 1) + (1 << 11)) >> 12);
diff --git a/media/libeffects/lvm/wrapper/Reverb/EffectReverb.h b/media/libeffects/lvm/wrapper/Reverb/EffectReverb.h
index b2d47af..96223a8 100644
--- a/media/libeffects/lvm/wrapper/Reverb/EffectReverb.h
+++ b/media/libeffects/lvm/wrapper/Reverb/EffectReverb.h
@@ -20,7 +20,6 @@
#include <audio_effects/effect_environmentalreverb.h>
#include <audio_effects/effect_presetreverb.h>
-
#define MAX_NUM_BANDS 5
#define MAX_CALL_SIZE 256
#define LVREV_MAX_T60 7000
@@ -28,7 +27,6 @@
#define LVREV_MAX_FRAME_SIZE 2560
#define LVREV_CUP_LOAD_ARM9E 470 // Expressed in 0.1 MIPS
#define LVREV_MEM_USAGE (71+(LVREV_MAX_FRAME_SIZE>>7)) // Expressed in kB
-//#define LVM_PCM
typedef struct _LPFPair_t
{
@@ -36,5 +34,4 @@
int16_t LPF;
} LPFPair_t;
-
#endif /*ANDROID_EFFECTREVERB_H_*/
diff --git a/media/libmedia/MidiIoWrapper.cpp b/media/libmedia/MidiIoWrapper.cpp
index 6d46363..e71ea2c 100644
--- a/media/libmedia/MidiIoWrapper.cpp
+++ b/media/libmedia/MidiIoWrapper.cpp
@@ -49,7 +49,7 @@
mDataSource = nullptr;
}
-class DataSourceUnwrapper {
+class MidiIoWrapper::DataSourceUnwrapper {
public:
explicit DataSourceUnwrapper(CDataSource *csource) {
diff --git a/media/libmedia/include/media/MidiIoWrapper.h b/media/libmedia/include/media/MidiIoWrapper.h
index b19d49e..d29949e 100644
--- a/media/libmedia/include/media/MidiIoWrapper.h
+++ b/media/libmedia/include/media/MidiIoWrapper.h
@@ -24,7 +24,6 @@
namespace android {
struct CDataSource;
-class DataSourceUnwrapper;
class MidiIoWrapper {
public:
@@ -43,6 +42,7 @@
int mFd;
off64_t mBase;
int64_t mLength;
+ class DataSourceUnwrapper;
DataSourceUnwrapper *mDataSource;
EAS_FILE mEasFile;
};
diff --git a/media/libstagefright/MPEG4Writer.cpp b/media/libstagefright/MPEG4Writer.cpp
index f130c9b..258bed8 100644
--- a/media/libstagefright/MPEG4Writer.cpp
+++ b/media/libstagefright/MPEG4Writer.cpp
@@ -613,8 +613,9 @@
CHECK(source.get() != NULL);
- const char *mime;
- source->getFormat()->findCString(kKeyMIMEType, &mime);
+ const char *mime = NULL;
+ sp<MetaData> meta = source->getFormat();
+ meta->findCString(kKeyMIMEType, &mime);
if (Track::getFourCCForMime(mime) == NULL) {
ALOGE("Unsupported mime '%s'", mime);
diff --git a/media/libstagefright/MediaExtractorFactory.cpp b/media/libstagefright/MediaExtractorFactory.cpp
index 120f354..7689691 100644
--- a/media/libstagefright/MediaExtractorFactory.cpp
+++ b/media/libstagefright/MediaExtractorFactory.cpp
@@ -276,7 +276,7 @@
std::shared_ptr<std::list<sp<ExtractorPlugin>>> newList(new std::list<sp<ExtractorPlugin>>());
- android_namespace_t *mediaNs = android_get_exported_namespace("media");
+ android_namespace_t *mediaNs = android_get_exported_namespace("com.android.media");
if (mediaNs != NULL) {
const android_dlextinfo dlextinfo = {
.flags = ANDROID_DLEXT_USE_NAMESPACE,
diff --git a/media/libstagefright/codecs/on2/enc/Android.bp b/media/libstagefright/codecs/on2/enc/Android.bp
index cd69e0d..705e554 100644
--- a/media/libstagefright/codecs/on2/enc/Android.bp
+++ b/media/libstagefright/codecs/on2/enc/Android.bp
@@ -21,4 +21,5 @@
},
shared_libs: ["libvpx"],
+ header_libs: ["libbase_headers"],
}
diff --git a/media/libstagefright/flac/dec/test/Android.bp b/media/libstagefright/flac/dec/test/Android.bp
new file mode 100644
index 0000000..70ca80a
--- /dev/null
+++ b/media/libstagefright/flac/dec/test/Android.bp
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2019 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.
+ */
+
+cc_test {
+ name: "FlacDecoderTest",
+ gtest: true,
+
+ srcs: [
+ "FlacDecoderTest.cpp",
+ ],
+
+ shared_libs: [
+ "liblog",
+ ],
+
+ static_libs: [
+ "libstagefright_flacdec",
+ "libFLAC",
+ ],
+
+ header_libs: [
+ "libstagefright_foundation_headers",
+ ],
+
+ cflags: [
+ "-Werror",
+ "-Wall",
+ ],
+
+ sanitize: {
+ misc_undefined: [
+ "unsigned-integer-overflow",
+ "signed-integer-overflow",
+ ],
+ cfi: true,
+ },
+}
diff --git a/media/libstagefright/flac/dec/test/AndroidTest.xml b/media/libstagefright/flac/dec/test/AndroidTest.xml
new file mode 100644
index 0000000..bebba8e
--- /dev/null
+++ b/media/libstagefright/flac/dec/test/AndroidTest.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2020 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.
+-->
+<configuration description="Test module config for flac decoder unit tests">
+ <option name="test-suite-tag" value="FlacDecoderTest" />
+ <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
+ <option name="cleanup" value="true" />
+ <option name="push" value="FlacDecoderTest->/data/local/tmp/FlacDecoderTest/" />
+ <option name="push-file"
+ key="https://storage.googleapis.com/android_media/frameworks/av/media/libstagefright/flac/dec/test/FlacDecoder.zip?unzip=true"
+ value="/data/local/tmp/FlacDecoderTestRes/" />
+ </target_preparer>
+
+ <test class="com.android.tradefed.testtype.GTest" >
+ <option name="native-test-device-path" value="/data/local/tmp" />
+ <option name="module-name" value="FlacDecoderTest" />
+ <option name="native-test-flag" value="-P /data/local/tmp/FlacDecoderTestRes/" />
+ </test>
+</configuration>
\ No newline at end of file
diff --git a/media/libstagefright/flac/dec/test/FlacDecoderTest.cpp b/media/libstagefright/flac/dec/test/FlacDecoderTest.cpp
new file mode 100644
index 0000000..34f12db
--- /dev/null
+++ b/media/libstagefright/flac/dec/test/FlacDecoderTest.cpp
@@ -0,0 +1,270 @@
+/*
+ * Copyright (C) 2019 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.
+ */
+
+//#define LOG_NDEBUG 0
+#define LOG_TAG "FlacDecoderTest"
+
+#include <utils/Log.h>
+#include <fstream>
+
+#include "FLACDecoder.h"
+
+#include "FlacDecoderTestEnvironment.h"
+
+#define OUTPUT_FILE_NAME "/data/local/tmp/FlacDecoderOutput.raw"
+#define CODEC_CONFIG_FLAG 32
+
+constexpr uint32_t kMaxCount = 10;
+constexpr int32_t kMaxBlockSize = 4096;
+
+using namespace android;
+
+struct FrameInfo {
+ int32_t bytesCount;
+ uint32_t flags;
+ int64_t timestamp;
+};
+
+static FlacDecoderTestEnvironment *gEnv = nullptr;
+
+class FLACDecoderTest : public ::testing::TestWithParam<tuple<string, string, bool>> {
+ public:
+ FLACDecoderTest() : mFLACDecoder(nullptr), mHasStreamInfo(false), mInputBufferCount(0) {}
+
+ ~FLACDecoderTest() {
+ if (mEleStream.is_open()) mEleStream.close();
+ if (mFLACDecoder) delete mFLACDecoder;
+ mFLACDecoder = nullptr;
+ }
+
+ virtual void SetUp() override {
+ mFLACDecoder = FLACDecoder::Create();
+ ASSERT_NE(mFLACDecoder, nullptr) << "initDecoder: failed to create FLACDecoder";
+ }
+
+ int32_t processFlacDecoder(vector<FrameInfo> Info, int32_t offset, int32_t range,
+ bool outputFloat, ofstream &ostrm);
+
+ FLACDecoder *mFLACDecoder;
+ FLAC__StreamMetadata_StreamInfo mStreamInfo;
+
+ bool mHasStreamInfo;
+ int32_t mInputBufferCount;
+ ifstream mEleStream;
+};
+
+void getInfo(string infoFileName, vector<FrameInfo> &Info) {
+ ifstream eleInfo;
+ eleInfo.open(infoFileName);
+ ASSERT_EQ(eleInfo.is_open(), true);
+ int32_t bytesCount = 0;
+ uint32_t flags = 0;
+ uint32_t timestamp = 0;
+ while (1) {
+ if (!(eleInfo >> bytesCount)) break;
+ eleInfo >> flags;
+ eleInfo >> timestamp;
+ Info.push_back({bytesCount, flags, timestamp});
+ }
+ if (eleInfo.is_open()) eleInfo.close();
+}
+
+int32_t FLACDecoderTest::processFlacDecoder(vector<FrameInfo> Info, int32_t offset, int32_t range,
+ bool outputFloat, ofstream &ostrm) {
+ memset(&mStreamInfo, 0, sizeof(mStreamInfo));
+
+ int32_t frameID = offset;
+ if (range + offset > Info.size() || range < 0 || offset > Info.size() - 1 || offset < 0) {
+ ALOGE("Invalid offset or range or both passed for decoding");
+ ALOGE("offset = %d \t range = %d \t Info.size() = %zu", offset, range, Info.size());
+ return -1;
+ }
+
+ while (1) {
+ if (frameID == Info.size() || frameID == (offset + range)) break;
+ int64_t flags = (Info)[frameID].flags;
+ int32_t size = (Info)[frameID].bytesCount;
+ if (size < 0) {
+ ALOGE("Size for the memory allocation is negative");
+ return -1;
+ }
+ char *data = (char *)malloc(size);
+ if (!data) {
+ ALOGE("Insufficient memory to read frame");
+ return -1;
+ }
+
+ mEleStream.read(data, size);
+ if (mEleStream.gcount() != size) {
+ if (data) {
+ free(data);
+ data = nullptr;
+ }
+ ALOGE("Invalid size read, requested: %d and read: %zu", size, mEleStream.gcount());
+ return -1;
+ }
+
+ if (flags == CODEC_CONFIG_FLAG && mInputBufferCount == 0) {
+ status_t decoderErr = mFLACDecoder->parseMetadata((uint8_t *)data, size);
+ if (decoderErr == WOULD_BLOCK) {
+ ALOGV("process: parseMetadata is Blocking, Continue %d", decoderErr);
+ } else if (decoderErr == OK) {
+ mStreamInfo = mFLACDecoder->getStreamInfo();
+ if (mStreamInfo.sample_rate && mStreamInfo.max_blocksize && mStreamInfo.channels) {
+ mHasStreamInfo = true;
+ }
+ ALOGV("decoder configuration : %d Hz, %d channels, %d samples,"
+ " %d block size",
+ mStreamInfo.sample_rate, mStreamInfo.channels,
+ (int32_t)mStreamInfo.total_samples, mStreamInfo.max_blocksize);
+ } else {
+ ALOGE("FLACDecoder parseMetaData returns error %d", decoderErr);
+ if (data) {
+ free(data);
+ data = nullptr;
+ }
+ return decoderErr;
+ }
+ } else {
+ const size_t sampleSize = outputFloat ? sizeof(float) : sizeof(int16_t);
+ size_t outSize = mHasStreamInfo
+ ? mStreamInfo.max_blocksize * mStreamInfo.channels * sampleSize
+ : kMaxBlockSize * FLACDecoder::kMaxChannels * sampleSize;
+
+ void *out_buf = malloc(outSize);
+ if (!out_buf) {
+ if (data) {
+ free(data);
+ data = nullptr;
+ }
+ ALOGE("Output buffer allocation failed");
+ return -1;
+ }
+ status_t decoderErr = mFLACDecoder->decodeOneFrame((uint8_t *)data, size, out_buf,
+ &outSize, outputFloat);
+ if (decoderErr != OK) {
+ ALOGE("decodeOneFrame returns error %d", decoderErr);
+ if (data) {
+ free(data);
+ data = nullptr;
+ }
+ if (out_buf) {
+ free(out_buf);
+ out_buf = nullptr;
+ }
+ return decoderErr;
+ }
+ ostrm.write(reinterpret_cast<char *>(out_buf), outSize);
+ free(out_buf);
+ out_buf = nullptr;
+ }
+ mInputBufferCount++;
+ frameID++;
+ free(data);
+ data = nullptr;
+ }
+ ALOGV("frameID=%d", frameID);
+ return 0;
+}
+
+TEST_F(FLACDecoderTest, CreateDeleteTest) {
+ if (mFLACDecoder) delete mFLACDecoder;
+ mFLACDecoder = nullptr;
+
+ for (int32_t i = 0; i < kMaxCount; i++) {
+ mFLACDecoder = FLACDecoder::Create();
+ ASSERT_NE(mFLACDecoder, nullptr) << "FLACDecoder Creation Failed";
+ if (mFLACDecoder) delete mFLACDecoder;
+ mFLACDecoder = nullptr;
+ }
+}
+
+TEST_P(FLACDecoderTest, FlushTest) {
+ tuple<string /* InputFileName */, string /* InfoFileName */, bool /* outputfloat */> params =
+ GetParam();
+
+ string inputFileName = gEnv->getRes() + get<0>(params);
+ string infoFileName = gEnv->getRes() + get<1>(params);
+ bool outputFloat = get<2>(params);
+
+ vector<FrameInfo> Info;
+ getInfo(infoFileName, Info);
+
+ mEleStream.open(inputFileName, ifstream::binary);
+ ASSERT_EQ(mEleStream.is_open(), true);
+
+ ofstream ostrm;
+ ostrm.open(OUTPUT_FILE_NAME, std::ofstream::binary);
+ ASSERT_EQ(ostrm.is_open(), true);
+
+ int32_t status = processFlacDecoder(Info, 0, Info.size() / 3, outputFloat, ostrm);
+ ASSERT_EQ(status, 0) << "Test Failed. Decode returned error = " << status << endl;
+ mFLACDecoder->flush();
+ mHasStreamInfo = false;
+ status = processFlacDecoder(Info, (Info.size() / 3), Info.size() - (Info.size() / 3),
+ outputFloat, ostrm);
+ ostrm.close();
+ Info.clear();
+ ASSERT_EQ(status, 0) << "Test Failed. Decode returned error = " << status << endl;
+}
+
+TEST_P(FLACDecoderTest, DecodeTest) {
+ tuple<string /* InputFileName */, string /* InfoFileName */, bool /* outputfloat */> params =
+ GetParam();
+
+ string inputFileName = gEnv->getRes() + get<0>(params);
+ string infoFileName = gEnv->getRes() + get<1>(params);
+ bool outputFloat = get<2>(params);
+
+ vector<FrameInfo> Info;
+ getInfo(infoFileName, Info);
+
+ mEleStream.open(inputFileName, ifstream::binary);
+ ASSERT_EQ(mEleStream.is_open(), true);
+
+ ofstream ostrm;
+ ostrm.open(OUTPUT_FILE_NAME, std::ofstream::binary);
+ ASSERT_EQ(ostrm.is_open(), true);
+
+ int32_t status = processFlacDecoder(Info, 0, Info.size(), outputFloat, ostrm);
+ ostrm.close();
+ Info.clear();
+ ASSERT_EQ(status, 0) << "Test Failed. Decode returned error = " << status << endl;
+}
+
+// TODO: Add remaining tests
+INSTANTIATE_TEST_SUITE_P(
+ FLACDecoderTestAll, FLACDecoderTest,
+ ::testing::Values(make_tuple("bbb_flac_stereo_680kbps_48000hz.flac",
+ "bbb_flac_stereo_680kbps_48000hz.info", true),
+ make_tuple("bbb_flac_stereo_680kbps_48000hz.flac",
+ "bbb_flac_stereo_680kbps_48000hz.info", false),
+ make_tuple("bbb_flac_stereo_600kbps_44100hz.flac",
+ "bbb_flac_stereo_600kbps_44100hz.info", true),
+ make_tuple("bbb_flac_stereo_600kbps_44100hz.flac",
+ "bbb_flac_stereo_600kbps_44100hz.info", false)));
+
+int main(int argc, char **argv) {
+ gEnv = new FlacDecoderTestEnvironment();
+ ::testing::AddGlobalTestEnvironment(gEnv);
+ ::testing::InitGoogleTest(&argc, argv);
+ int status = gEnv->initFromOptions(argc, argv);
+ if (status == 0) {
+ status = RUN_ALL_TESTS();
+ ALOGV("Flac Decoder Test Result = %d\n", status);
+ }
+ return status;
+}
diff --git a/media/libstagefright/flac/dec/test/FlacDecoderTestEnvironment.h b/media/libstagefright/flac/dec/test/FlacDecoderTestEnvironment.h
new file mode 100644
index 0000000..1334bba
--- /dev/null
+++ b/media/libstagefright/flac/dec/test/FlacDecoderTestEnvironment.h
@@ -0,0 +1,73 @@
+/*
+ * Copyright (C) 2019 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.
+ */
+
+#ifndef __FLAC_DECODER_TEST_ENVIRONMENT_H__
+#define __FLAC_DECODER_TEST_ENVIRONMENT_H__
+
+#include <gtest/gtest.h>
+
+#include <getopt.h>
+
+using namespace std;
+
+class FlacDecoderTestEnvironment : public ::testing::Environment {
+ public:
+ FlacDecoderTestEnvironment() : res("/data/local/tmp/") {}
+
+ // Parses the command line arguments
+ int initFromOptions(int argc, char **argv);
+
+ void setRes(const char *_res) { res = _res; }
+
+ const string getRes() const { return res; }
+
+ private:
+ string res;
+};
+
+int FlacDecoderTestEnvironment::initFromOptions(int argc, char **argv) {
+ static struct option options[] = {{"path", required_argument, 0, 'P'}, {0, 0, 0, 0}};
+
+ while (true) {
+ int index = 0;
+ int c = getopt_long(argc, argv, "P:", options, &index);
+ if (c == -1) {
+ break;
+ }
+
+ switch (c) {
+ case 'P': {
+ setRes(optarg);
+ break;
+ }
+ default:
+ break;
+ }
+ }
+
+ if (optind < argc) {
+ fprintf(stderr,
+ "unrecognized option: %s\n\n"
+ "usage: %s <gtest options> <test options>\n\n"
+ "test options are:\n\n"
+ "-P, --path: Resource files directory location\n",
+ argv[optind ?: 1], argv[0]);
+ return 2;
+ }
+ return 0;
+}
+
+#endif // __FLAC_DECODER_TEST_ENVIRONMENT_H__
diff --git a/media/libstagefright/flac/dec/test/README.md b/media/libstagefright/flac/dec/test/README.md
new file mode 100644
index 0000000..4d194cd
--- /dev/null
+++ b/media/libstagefright/flac/dec/test/README.md
@@ -0,0 +1,40 @@
+## Media Testing ##
+---
+#### FlacDecoder :
+The FlacDecoder Test Suite validates the FlacDecoder available in libstagefright.
+
+Run the following steps to build the test suite:
+```
+m FlacDecoderTest
+```
+
+The 32-bit binaries will be created in the following path : ${OUT}/data/nativetest/
+
+The 64-bit binaries will be created in the following path : ${OUT}/data/nativetest64/
+
+To test 64-bit binary push binaries from nativetest64.
+```
+adb push ${OUT}/data/nativetest64/FlacDecoderTest/FlacDecoderTest /data/local/tmp/
+```
+
+To test 32-bit binary push binaries from nativetest.
+```
+adb push ${OUT}/data/nativetest/FlacDecoderTest/FlacDecoderTest /data/local/tmp/
+```
+
+The resource file for the tests is taken from [here](https://storage.googleapis.com/android_media/frameworks/av/media/libstagefright/flac/dec/test/FlacDecoder.zip).
+Download, unzip and push these files into device for testing.
+
+```
+adb push FlacDecoder /data/local/tmp/
+```
+
+usage: FlacDecoderTest -P \<path_to_folder\>
+```
+adb shell /data/local/tmp/FlacDecoderTest -P /data/local/tmp/FlacDecoder/
+```
+Alternatively, the test can also be run using atest command.
+
+```
+atest FlacDecoderTest -- --enable-module-dynamic-download=true
+```
diff --git a/media/libstagefright/foundation/Android.bp b/media/libstagefright/foundation/Android.bp
index b95f054..effbb4e 100644
--- a/media/libstagefright/foundation/Android.bp
+++ b/media/libstagefright/foundation/Android.bp
@@ -34,10 +34,6 @@
"media_plugin_headers",
],
- export_shared_lib_headers: [
- "libbinder",
- ],
-
cflags: [
"-Wno-multichar",
"-Werror",
diff --git a/media/libstagefright/id3/ID3.cpp b/media/libstagefright/id3/ID3.cpp
index 792a68a..425468f 100644
--- a/media/libstagefright/id3/ID3.cpp
+++ b/media/libstagefright/id3/ID3.cpp
@@ -32,7 +32,7 @@
static const size_t kMaxMetadataSize = 3 * 1024 * 1024;
-struct MemorySource : public DataSourceBase {
+struct ID3::MemorySource : public DataSourceBase {
MemorySource(const uint8_t *data, size_t size)
: mData(data),
mSize(size) {
@@ -58,7 +58,7 @@
DISALLOW_EVIL_CONSTRUCTORS(MemorySource);
};
-class DataSourceUnwrapper : public DataSourceBase {
+class ID3::DataSourceUnwrapper : public DataSourceBase {
public:
explicit DataSourceUnwrapper(DataSourceHelper *sourcehelper) {
diff --git a/media/libstagefright/include/ID3.h b/media/libstagefright/include/ID3.h
index 5e433ea..2843a7a 100644
--- a/media/libstagefright/include/ID3.h
+++ b/media/libstagefright/include/ID3.h
@@ -77,6 +77,8 @@
size_t rawSize() const { return mRawSize; }
private:
+ class DataSourceUnwrapper;
+ struct MemorySource;
bool mIsValid;
uint8_t *mData;
size_t mSize;
diff --git a/media/libstagefright/tests/writer/AndroidTest.xml b/media/libstagefright/tests/writer/AndroidTest.xml
new file mode 100644
index 0000000..d831555
--- /dev/null
+++ b/media/libstagefright/tests/writer/AndroidTest.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2019 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.
+-->
+<configuration description="Test module config for writer tests">
+ <option name="test-suite-tag" value="writerTest" />
+ <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
+ <option name="cleanup" value="true" />
+ <option name="push" value="writerTest->/data/local/tmp/writerTest" />
+ <option name="push-file"
+ key="https://storage.googleapis.com/android_media/frameworks/av/media/libstagefright/tests/writer/Writer.zip?unzip=true"
+ value="/data/local/tmp/writerTestRes/" />
+ </target_preparer>
+ <test class="com.android.tradefed.testtype.GTest" >
+ <option name="native-test-device-path" value="/data/local/tmp" />
+ <option name="module-name" value="writerTest" />
+ <option name="native-test-flag" value="-P /data/local/tmp/writerTestRes/" />
+ </test>
+</configuration>
diff --git a/media/libstagefright/webm/tests/Android.bp b/media/libstagefright/webm/tests/Android.bp
new file mode 100644
index 0000000..5183a49
--- /dev/null
+++ b/media/libstagefright/webm/tests/Android.bp
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2020 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.
+ */
+
+cc_test {
+ name: "WebmFrameThreadUnitTest",
+ gtest: true,
+
+ srcs: [
+ "WebmFrameThreadUnitTest.cpp",
+ ],
+
+ include_dirs: [
+ "frameworks/av/media/libstagefright",
+ ],
+
+ static_libs: [
+ "libdatasource",
+ "libstagefright",
+ "libstagefright_webm",
+ "libstagefright_foundation",
+ ],
+
+ shared_libs: [
+ "libbinder",
+ "liblog",
+ "libutils",
+ ],
+
+ cflags: [
+ "-Werror",
+ "-Wall",
+ ],
+
+ sanitize: {
+ cfi: true,
+ misc_undefined: [
+ "unsigned-integer-overflow",
+ "signed-integer-overflow",
+ ],
+ },
+}
diff --git a/media/libstagefright/webm/tests/README.md b/media/libstagefright/webm/tests/README.md
new file mode 100644
index 0000000..2e74f34
--- /dev/null
+++ b/media/libstagefright/webm/tests/README.md
@@ -0,0 +1,26 @@
+## Media Testing ##
+---
+#### Webm Writer Utility Tests :
+The Webm Writer Utility Test Suite validates the APIs being used by the WebmWriter.
+
+Run the following steps to build the test suite:
+```
+mmm frameworks/av/media/libstagefright/webm/tests/
+```
+
+The 32-bit binaries will be created in the following path : ${OUT}/data/nativetest/
+
+The 64-bit binaries will be created in the following path : ${OUT}/data/nativetest64/
+
+#### WebmFrameThread
+To test 64-bit binary push binaries from nativetest64.
+
+adb push ${OUT}/data/nativetest64/WebmFrameThreadUnitTest/WebmFrameThreadUnitTest /data/local/tmp/
+
+To test 32-bit binary push binaries from nativetest.
+
+adb push ${OUT}/data/nativetest/WebmFrameThreadUnitTest/WebmFrameThreadUnitTest /data/local/tmp/
+
+```
+adb shell /data/local/tmp/WebmFrameThreadUnitTest
+```
diff --git a/media/libstagefright/webm/tests/WebmFrameThreadUnitTest.cpp b/media/libstagefright/webm/tests/WebmFrameThreadUnitTest.cpp
new file mode 100644
index 0000000..89cd2ca
--- /dev/null
+++ b/media/libstagefright/webm/tests/WebmFrameThreadUnitTest.cpp
@@ -0,0 +1,314 @@
+/*
+ * Copyright (C) 2020 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.
+ */
+
+//#define LOG_NDEBUG 0
+#define LOG_TAG "WebmFrameThreadUnitTest"
+#include <utils/Log.h>
+
+#include <gtest/gtest.h>
+
+#include <media/stagefright/MediaAdapter.h>
+#include <media/stagefright/MediaDefs.h>
+#include <media/stagefright/MetaData.h>
+#include <media/stagefright/Utils.h>
+
+#include <media/stagefright/foundation/ABuffer.h>
+#include <media/stagefright/foundation/ADebug.h>
+#include <media/stagefright/foundation/AMessage.h>
+#include <media/stagefright/foundation/OpusHeader.h>
+
+#include "webm/EbmlUtil.h"
+#include "webm/WebmConstants.h"
+#include "webm/WebmFrameThread.h"
+
+using namespace android;
+using namespace webm;
+
+static constexpr int32_t kVideoIdx = 0;
+static constexpr int32_t kAudioIdx = 1;
+static constexpr int32_t kMaxStreamCount = 2;
+
+static constexpr int32_t kCsdSize = 32;
+static constexpr int32_t kFrameSize = 128;
+
+static constexpr int32_t kMaxLoopCount = 20;
+static constexpr int32_t kNumFramesToWrite = 32;
+static constexpr int32_t kSyncFrameInterval = 10;
+static constexpr uint64_t kDefaultTimeCodeScaleUs = 1000000; /* 1sec */
+
+#define OUTPUT_FILE_NAME "/data/local/tmp/webmFrameThreadOutput.webm"
+
+// LookUpTable of clips and metadata for component testing
+static const struct InputData {
+ const char *mime;
+ int32_t firstParam;
+ int32_t secondParam;
+ bool isAudio;
+} kInputData[] = {
+ {MEDIA_MIMETYPE_AUDIO_OPUS, 48000, 6, true},
+ {MEDIA_MIMETYPE_AUDIO_VORBIS, 44100, 1, true},
+ {MEDIA_MIMETYPE_VIDEO_VP9, 176, 144, false},
+ {MEDIA_MIMETYPE_VIDEO_VP8, 1920, 1080, false},
+};
+
+class WebmFrameThreadUnitTest : public ::testing::TestWithParam<std::pair<int32_t, int32_t>> {
+ public:
+ WebmFrameThreadUnitTest()
+ : mSinkThread(nullptr), mAudioThread(nullptr), mVideoThread(nullptr), mSource{} {}
+
+ ~WebmFrameThreadUnitTest() {
+ if (mSinkThread) mSinkThread.clear();
+ if (mAudioThread) mAudioThread.clear();
+ if (mVideoThread) mVideoThread.clear();
+ }
+
+ virtual void SetUp() override {
+ mSegmentDataStart = 0;
+ mFd = open(OUTPUT_FILE_NAME, O_CREAT | O_LARGEFILE | O_TRUNC | O_RDWR, S_IRUSR | S_IWUSR);
+ ASSERT_GE(mFd, 0) << "Failed to open output file " << OUTPUT_FILE_NAME;
+ }
+
+ virtual void TearDown() override {
+ if (mFd >= 0) close(mFd);
+ for (int32_t idx = 0; idx < kMaxStreamCount; idx++) {
+ if (mSource[idx] != nullptr) {
+ mSource[idx].clear();
+ }
+ }
+ mVSink.clear();
+ mASink.clear();
+ mCuePoints.clear();
+ }
+
+ void addTrack(bool isAudio, int32_t index);
+ void writeFileData(int32_t inputFrameId, int32_t range);
+
+ void createWebmThreads(std::initializer_list<int32_t> indexList);
+ void startWebmFrameThreads();
+ void stopWebmFrameThreads();
+
+ int32_t mFd;
+ uint64_t mSegmentDataStart;
+
+ sp<WebmFrameSinkThread> mSinkThread;
+ sp<WebmFrameSourceThread> mAudioThread;
+ sp<WebmFrameSourceThread> mVideoThread;
+
+ List<sp<WebmElement>> mCuePoints;
+ sp<MediaAdapter> mSource[kMaxStreamCount];
+ LinkedBlockingQueue<const sp<WebmFrame>> mVSink;
+ LinkedBlockingQueue<const sp<WebmFrame>> mASink;
+};
+
+void writeAudioHeaderData(const sp<AMessage> &format, const char *mimeType) {
+ if (strncasecmp(mimeType, MEDIA_MIMETYPE_AUDIO_OPUS, strlen(MEDIA_MIMETYPE_AUDIO_OPUS) + 1) &&
+ strncasecmp(mimeType, MEDIA_MIMETYPE_AUDIO_VORBIS,
+ strlen(MEDIA_MIMETYPE_AUDIO_VORBIS) + 1)) {
+ ASSERT_TRUE(false) << "Unsupported mime type";
+ }
+
+ // Dummy CSD buffers for Opus and Vorbis
+ char csdBuffer[kCsdSize];
+ memset(csdBuffer, 0xFF, sizeof(csdBuffer));
+
+ sp<ABuffer> csdBuffer0 = ABuffer::CreateAsCopy((void *)csdBuffer, kCsdSize);
+ ASSERT_NE(csdBuffer0.get(), nullptr) << "Unable to allocate buffer for CSD0 data";
+ ASSERT_NE(csdBuffer0->base(), nullptr) << "ABuffer base is null for CSD0";
+
+ sp<ABuffer> csdBuffer1 = ABuffer::CreateAsCopy((void *)csdBuffer, kCsdSize);
+ ASSERT_NE(csdBuffer1.get(), nullptr) << "Unable to allocate buffer for CSD1 data";
+ ASSERT_NE(csdBuffer1->base(), nullptr) << "ABuffer base is null for CSD1";
+
+ sp<ABuffer> csdBuffer2 = ABuffer::CreateAsCopy((void *)csdBuffer, kCsdSize);
+ ASSERT_NE(csdBuffer2.get(), nullptr) << "Unable to allocate buffer for CSD2 data";
+ ASSERT_NE(csdBuffer2->base(), nullptr) << "ABuffer base is null for CSD2";
+
+ format->setBuffer("csd-0", csdBuffer0);
+ format->setBuffer("csd-1", csdBuffer1);
+ format->setBuffer("csd-2", csdBuffer2);
+}
+
+void WebmFrameThreadUnitTest::addTrack(bool isAudio, int32_t index) {
+ ASSERT_LT(index, sizeof(kInputData) / sizeof(kInputData[0]))
+ << "Invalid index for loopup table";
+
+ sp<AMessage> format = new AMessage;
+ format->setString("mime", kInputData[index].mime);
+ if (!isAudio) {
+ format->setInt32("width", kInputData[index].firstParam);
+ format->setInt32("height", kInputData[index].secondParam);
+ } else {
+ format->setInt32("sample-rate", kInputData[index].firstParam);
+ format->setInt32("channel-count", kInputData[index].secondParam);
+ ASSERT_NO_FATAL_FAILURE(writeAudioHeaderData(format, kInputData[index].mime));
+ }
+
+ sp<MetaData> trackMeta = new MetaData;
+ convertMessageToMetaData(format, trackMeta);
+
+ if (!isAudio) {
+ mSource[kVideoIdx] = new MediaAdapter(trackMeta);
+ ASSERT_NE(mSource[kVideoIdx], nullptr) << "Unable to create source";
+ } else {
+ mSource[kAudioIdx] = new MediaAdapter(trackMeta);
+ ASSERT_NE(mSource[kAudioIdx], nullptr) << "Unable to create source";
+ }
+}
+
+void WebmFrameThreadUnitTest::createWebmThreads(std::initializer_list<int32_t> indexList) {
+ mSinkThread = new WebmFrameSinkThread(mFd, mSegmentDataStart, mVSink, mASink, mCuePoints);
+ ASSERT_NE(mSinkThread, nullptr) << "Failed to create Sink Thread";
+
+ bool isAudio;
+ // MultiTrack input
+ for (int32_t index : indexList) {
+ isAudio = kInputData[index].isAudio;
+ ASSERT_NO_FATAL_FAILURE(addTrack(isAudio, index));
+ if (!isAudio) {
+ mVideoThread = new WebmFrameMediaSourceThread(mSource[kVideoIdx], kVideoType, mVSink,
+ kDefaultTimeCodeScaleUs, 0, 0, 1, 0);
+ } else {
+ mAudioThread = new WebmFrameMediaSourceThread(mSource[kAudioIdx], kAudioType, mASink,
+ kDefaultTimeCodeScaleUs, 0, 0, 1, 0);
+ }
+ }
+ // To handle single track file
+ if (!mVideoThread) {
+ mVideoThread = new WebmFrameEmptySourceThread(kVideoType, mVSink);
+ } else if (!mAudioThread) {
+ mAudioThread = new WebmFrameEmptySourceThread(kAudioType, mASink);
+ }
+ ASSERT_NE(mVideoThread, nullptr) << "Failed to create Video Thread";
+ ASSERT_NE(mAudioThread, nullptr) << "Failed to create Audio Thread";
+}
+
+void WebmFrameThreadUnitTest::startWebmFrameThreads() {
+ status_t status = mAudioThread->start();
+ ASSERT_EQ(status, AMEDIA_OK) << "Failed to start Audio Thread";
+ status = mVideoThread->start();
+ ASSERT_EQ(status, AMEDIA_OK) << "Failed to start Video Thread";
+ status = mSinkThread->start();
+ ASSERT_EQ(status, AMEDIA_OK) << "Failed to start Sink Thread";
+}
+
+void WebmFrameThreadUnitTest::stopWebmFrameThreads() {
+ status_t status = mAudioThread->stop();
+ ASSERT_EQ(status, AMEDIA_OK) << "Failed to stop Audio Thread";
+ status = mVideoThread->stop();
+ ASSERT_EQ(status, AMEDIA_OK) << "Failed to stop Video Thread";
+ status = mSinkThread->stop();
+ ASSERT_EQ(status, AMEDIA_OK) << "Failed to stop Sink Thread";
+}
+
+// Write dummy data to a file
+void WebmFrameThreadUnitTest::writeFileData(int32_t inputFrameId, int32_t range) {
+ char data[kFrameSize];
+ memset(data, 0xFF, sizeof(data));
+ int32_t status = OK;
+ do {
+ // Queue frames for both A/V tracks
+ for (int32_t idx = kVideoIdx; idx < kMaxStreamCount; idx++) {
+ sp<ABuffer> buffer = new ABuffer((void *)data, kFrameSize);
+ ASSERT_NE(buffer.get(), nullptr) << "ABuffer returned nullptr";
+
+ // Released in MediaAdapter::signalBufferReturned().
+ MediaBuffer *mediaBuffer = new MediaBuffer(buffer);
+ ASSERT_NE(mediaBuffer, nullptr) << "MediaBuffer returned nullptr";
+
+ mediaBuffer->add_ref();
+ mediaBuffer->set_range(buffer->offset(), buffer->size());
+
+ MetaDataBase &sampleMetaData = mediaBuffer->meta_data();
+ sampleMetaData.setInt64(kKeyTime, inputFrameId * kDefaultTimeCodeScaleUs);
+
+ // For audio codecs, treat all frame as sync frame
+ if ((idx == kAudioIdx) || (inputFrameId % kSyncFrameInterval == 0)) {
+ sampleMetaData.setInt32(kKeyIsSyncFrame, true);
+ }
+
+ // This pushBuffer will wait until the mediaBuffer is consumed.
+ if (mSource[idx] != nullptr) {
+ status = mSource[idx]->pushBuffer(mediaBuffer);
+ }
+ ASSERT_EQ(status, OK);
+ }
+ inputFrameId++;
+ } while (inputFrameId < range);
+}
+
+TEST_P(WebmFrameThreadUnitTest, WriteTest) {
+ int32_t index1 = GetParam().first;
+ int32_t index2 = GetParam().second;
+ ASSERT_NO_FATAL_FAILURE(createWebmThreads({index1, index2}));
+
+ ASSERT_NO_FATAL_FAILURE(startWebmFrameThreads());
+
+ ASSERT_NO_FATAL_FAILURE(writeFileData(0, kNumFramesToWrite));
+
+ if (mSource[kAudioIdx]) mSource[kAudioIdx]->stop();
+ if (mSource[kVideoIdx]) mSource[kVideoIdx]->stop();
+
+ ASSERT_NO_FATAL_FAILURE(stopWebmFrameThreads());
+}
+
+TEST_P(WebmFrameThreadUnitTest, PauseTest) {
+ int32_t index1 = GetParam().first;
+ int32_t index2 = GetParam().second;
+ ASSERT_NO_FATAL_FAILURE(createWebmThreads({index1, index2}));
+
+ ASSERT_NO_FATAL_FAILURE(startWebmFrameThreads());
+
+ int32_t offset = 0;
+ ASSERT_NO_FATAL_FAILURE(writeFileData(offset, kNumFramesToWrite));
+ offset += kNumFramesToWrite;
+
+ for (int idx = 0; idx < kMaxLoopCount; idx++) {
+ // pause the threads
+ status_t status = mAudioThread->pause();
+ ASSERT_EQ(status, AMEDIA_OK) << "Failed to pause Audio Thread";
+ status = mVideoThread->pause();
+ ASSERT_EQ(status, AMEDIA_OK) << "Failed to pause Video Thread";
+
+ // Under pause state, no write should happen
+ ASSERT_NO_FATAL_FAILURE(writeFileData(offset, kNumFramesToWrite));
+ offset += kNumFramesToWrite;
+
+ status = mAudioThread->resume();
+ ASSERT_EQ(status, AMEDIA_OK) << "Failed to resume Audio Thread";
+ status = mVideoThread->resume();
+ ASSERT_EQ(status, AMEDIA_OK) << "Failed to resume Video Thread";
+
+ ASSERT_NO_FATAL_FAILURE(writeFileData(offset, kNumFramesToWrite));
+ offset += kNumFramesToWrite;
+ }
+
+ if (mSource[kAudioIdx]) mSource[kAudioIdx]->stop();
+ if (mSource[kVideoIdx]) mSource[kVideoIdx]->stop();
+ ASSERT_NO_FATAL_FAILURE(stopWebmFrameThreads());
+}
+
+INSTANTIATE_TEST_SUITE_P(WebmFrameThreadUnitTestAll, WebmFrameThreadUnitTest,
+ ::testing::Values(std::make_pair(0, 1), std::make_pair(0, 2),
+ std::make_pair(0, 3), std::make_pair(1, 0),
+ std::make_pair(1, 2), std::make_pair(1, 3),
+ std::make_pair(2, 3)));
+
+int main(int argc, char **argv) {
+ ::testing::InitGoogleTest(&argc, argv);
+ int status = RUN_ALL_TESTS();
+ ALOGV("Test result = %d\n", status);
+ return status;
+}
diff --git a/media/tests/benchmark/MediaBenchmarkTest/AndroidTest.xml b/media/tests/benchmark/MediaBenchmarkTest/AndroidTest.xml
index 1179d6c..1890661 100644
--- a/media/tests/benchmark/MediaBenchmarkTest/AndroidTest.xml
+++ b/media/tests/benchmark/MediaBenchmarkTest/AndroidTest.xml
@@ -14,6 +14,12 @@
limitations under the License.
-->
<configuration description="Runs Media Benchmark Tests">
+ <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
+ <option name="cleanup" value="true" />
+ <option name="push-file"
+ key="https://storage.googleapis.com/android_media/frameworks/av/media/tests/benchmark/MediaBenchmark.zip?unzip=true"
+ value="/data/local/tmp/MediaBenchmark/res/" />
+ </target_preparer>
<target_preparer class="com.android.tradefed.targetprep.TestAppInstallSetup">
<option name="cleanup-apks" value="false" />
<option name="test-file-name" value="MediaBenchmarkTest.apk" />
diff --git a/media/tests/benchmark/MediaBenchmarkTest/src/androidTest/java/com/android/media/benchmark/tests/DecoderTest.java b/media/tests/benchmark/MediaBenchmarkTest/src/androidTest/java/com/android/media/benchmark/tests/DecoderTest.java
index c41f198..afd70a3 100644
--- a/media/tests/benchmark/MediaBenchmarkTest/src/androidTest/java/com/android/media/benchmark/tests/DecoderTest.java
+++ b/media/tests/benchmark/MediaBenchmarkTest/src/androidTest/java/com/android/media/benchmark/tests/DecoderTest.java
@@ -78,7 +78,7 @@
{"bbb_44100hz_2ch_128kbps_mp3_30sec.mp3", false},
{"bbb_8000hz_1ch_8kbps_amrnb_30sec.3gp", false},
{"bbb_16000hz_1ch_9kbps_amrwb_30sec.3gp", false},
- {"bbb_44100hz_2ch_80kbps_vorbis_30sec.mp4", false},
+ {"bbb_44100hz_2ch_80kbps_vorbis_30sec.webm", false},
{"bbb_44100hz_2ch_600kbps_flac_30sec.mp4", false},
{"bbb_48000hz_2ch_100kbps_opus_30sec.webm", false},
// Audio Async Test
@@ -86,7 +86,7 @@
{"bbb_44100hz_2ch_128kbps_mp3_30sec.mp3", true},
{"bbb_8000hz_1ch_8kbps_amrnb_30sec.3gp", true},
{"bbb_16000hz_1ch_9kbps_amrwb_30sec.3gp", true},
- {"bbb_44100hz_2ch_80kbps_vorbis_30sec.mp4", true},
+ {"bbb_44100hz_2ch_80kbps_vorbis_30sec.webm", true},
{"bbb_44100hz_2ch_600kbps_flac_30sec.mp4", true},
{"bbb_48000hz_2ch_100kbps_opus_30sec.webm", true},
// Video Sync Test
diff --git a/media/tests/benchmark/MediaBenchmarkTest/src/androidTest/java/com/android/media/benchmark/tests/EncoderTest.java b/media/tests/benchmark/MediaBenchmarkTest/src/androidTest/java/com/android/media/benchmark/tests/EncoderTest.java
index 831467a..48e1422 100644
--- a/media/tests/benchmark/MediaBenchmarkTest/src/androidTest/java/com/android/media/benchmark/tests/EncoderTest.java
+++ b/media/tests/benchmark/MediaBenchmarkTest/src/androidTest/java/com/android/media/benchmark/tests/EncoderTest.java
@@ -19,6 +19,9 @@
import android.content.Context;
import android.media.MediaCodec;
import android.media.MediaFormat;
+
+import static android.media.MediaCodecInfo.CodecCapabilities.COLOR_FormatYUV420Flexible;
+
import android.util.Log;
import androidx.test.platform.app.InstrumentationRegistry;
@@ -65,6 +68,7 @@
private static final int ENCODE_DEFAULT_FRAME_RATE = 25;
private static final int ENCODE_DEFAULT_BIT_RATE = 8000000 /* 8 Mbps */;
private static final int ENCODE_MIN_BIT_RATE = 600000 /* 600 Kbps */;
+ private static final int ENCODE_DEFAULT_AUDIO_BIT_RATE = 128000 /* 128 Kbps */;
private String mInputFile;
@Parameterized.Parameters
@@ -98,7 +102,7 @@
}
@Test(timeout = PER_TEST_TIMEOUT_MS)
- public void sampleEncoderTest() throws Exception {
+ public void testEncoder() throws Exception {
int status;
int frameSize;
//Parameters for video
@@ -107,6 +111,7 @@
int profile = 0;
int level = 0;
int frameRate = 0;
+
//Parameters for audio
int bitRate = 0;
int sampleRate = 0;
@@ -122,6 +127,7 @@
ArrayList<ByteBuffer> inputBuffer = new ArrayList<>();
ArrayList<MediaCodec.BufferInfo> frameInfo = new ArrayList<>();
for (int currentTrack = 0; currentTrack < trackCount; currentTrack++) {
+ int colorFormat = COLOR_FormatYUV420Flexible;
extractor.selectExtractorTrack(currentTrack);
MediaFormat format = extractor.getFormat(currentTrack);
// Get samples from extractor
@@ -148,6 +154,7 @@
status = decoder.decode(inputBuffer, frameInfo, false, format, "");
assertEquals("Decoder returned error " + status + " for file: " + mInputFile, 0,
status);
+ MediaFormat decoderFormat = decoder.getFormat();
decoder.deInitCodec();
extractor.unselectExtractorTrack(currentTrack);
inputBuffer.clear();
@@ -203,10 +210,17 @@
if (format.containsKey(MediaFormat.KEY_PROFILE)) {
level = format.getInteger(MediaFormat.KEY_LEVEL);
}
+ if (decoderFormat.containsKey(MediaFormat.KEY_COLOR_FORMAT)) {
+ colorFormat = decoderFormat.getInteger(MediaFormat.KEY_COLOR_FORMAT);
+ }
} else {
sampleRate = format.getInteger(MediaFormat.KEY_SAMPLE_RATE);
numChannels = format.getInteger(MediaFormat.KEY_CHANNEL_COUNT);
- bitRate = sampleRate * numChannels * 16;
+ if (decoderFormat.containsKey(MediaFormat.KEY_BIT_RATE)) {
+ bitRate = decoderFormat.getInteger(MediaFormat.KEY_BIT_RATE);
+ } else {
+ bitRate = ENCODE_DEFAULT_AUDIO_BIT_RATE;
+ }
}
/*Setup Encode Format*/
MediaFormat encodeFormat;
@@ -219,6 +233,7 @@
encodeFormat.setInteger(MediaFormat.KEY_LEVEL, level);
encodeFormat.setInteger(MediaFormat.KEY_I_FRAME_INTERVAL, 1);
encodeFormat.setInteger(MediaFormat.KEY_MAX_INPUT_SIZE, frameSize);
+ encodeFormat.setInteger(MediaFormat.KEY_COLOR_FORMAT, colorFormat);
} else {
encodeFormat = MediaFormat.createAudioFormat(mime, sampleRate, numChannels);
encodeFormat.setInteger(MediaFormat.KEY_BIT_RATE, bitRate);
@@ -255,7 +270,7 @@
fileInput.close();
}
- @Test
+ @Test(timeout = PER_TEST_TIMEOUT_MS)
public void testNativeEncoder() throws Exception {
File inputFile = new File(mInputFilePath + mInputFile);
assertTrue("Cannot find " + mInputFile + " in directory " + mInputFilePath,
@@ -275,8 +290,8 @@
// Encoding the decoder's output
for (String codecName : mediaCodecs) {
Native nativeEncoder = new Native();
- int status = nativeEncoder.Encode(
- mInputFilePath, mInputFile, mDecodedFile, mStatsFile, codecName);
+ int status = nativeEncoder
+ .Encode(mInputFilePath, mInputFile, mDecodedFile, mStatsFile, codecName);
assertEquals(
codecName + " encoder returned error " + status + " for " + "file:" + " " +
mInputFile, 0, status);
diff --git a/media/tests/benchmark/MediaBenchmarkTest/src/androidTest/java/com/android/media/benchmark/tests/ExtractorTest.java b/media/tests/benchmark/MediaBenchmarkTest/src/androidTest/java/com/android/media/benchmark/tests/ExtractorTest.java
index 6b7aad1..4d026c1 100644
--- a/media/tests/benchmark/MediaBenchmarkTest/src/androidTest/java/com/android/media/benchmark/tests/ExtractorTest.java
+++ b/media/tests/benchmark/MediaBenchmarkTest/src/androidTest/java/com/android/media/benchmark/tests/ExtractorTest.java
@@ -70,7 +70,7 @@
{"bbb_44100hz_2ch_600kbps_flac_5mins.flac", 0},
{"bbb_8000hz_1ch_8kbps_amrnb_5mins.3gp", 0},
{"bbb_16000hz_1ch_9kbps_amrwb_5mins.3gp", 0},
- {"bbb_44100hz_2ch_80kbps_vorbis_5mins.mp4", 0},
+ {"bbb_44100hz_2ch_80kbps_vorbis_5mins.webm", 0},
{"bbb_48000hz_2ch_100kbps_opus_5mins.webm", 0}});
}
@@ -88,7 +88,7 @@
}
@Test
- public void sampleExtractTest() throws IOException {
+ public void testExtractor() throws IOException {
File inputFile = new File(mInputFilePath + mInputFileName);
assertTrue("Cannot find " + mInputFileName + " in directory " + mInputFilePath,
inputFile.exists());
@@ -107,7 +107,7 @@
}
@Test
- public void sampleExtractNativeTest() throws IOException {
+ public void testNativeExtractor() throws IOException {
Native nativeExtractor = new Native();
File inputFile = new File(mInputFilePath + mInputFileName);
assertTrue("Cannot find " + mInputFileName + " in directory " + mInputFilePath,
diff --git a/media/tests/benchmark/MediaBenchmarkTest/src/androidTest/java/com/android/media/benchmark/tests/MuxerTest.java b/media/tests/benchmark/MediaBenchmarkTest/src/androidTest/java/com/android/media/benchmark/tests/MuxerTest.java
index 2efdba2..21ba957 100644
--- a/media/tests/benchmark/MediaBenchmarkTest/src/androidTest/java/com/android/media/benchmark/tests/MuxerTest.java
+++ b/media/tests/benchmark/MediaBenchmarkTest/src/androidTest/java/com/android/media/benchmark/tests/MuxerTest.java
@@ -86,7 +86,7 @@
{"crowd_1920x1080_25fps_6700kbps_h264.ts", "3gpp"},
{"crowd_1920x1080_25fps_4000kbps_h265.mkv", "3gpp"},
{"bbb_48000hz_2ch_100kbps_opus_5mins.webm", "ogg"},
- {"bbb_44100hz_2ch_80kbps_vorbis_5mins.mp4", "webm"},
+ {"bbb_44100hz_2ch_80kbps_vorbis_5mins.webm", "webm"},
{"bbb_48000hz_2ch_100kbps_opus_5mins.webm", "webm"},
{"bbb_44100hz_2ch_128kbps_aac_5mins.mp4", "mp4"},
{"bbb_8000hz_1ch_8kbps_amrnb_5mins.3gp", "mp4"},
@@ -110,7 +110,7 @@
}
@Test
- public void sampleMuxerTest() throws IOException {
+ public void testMuxer() throws IOException {
File inputFile = new File(mInputFilePath + mInputFileName);
assertTrue("Cannot find " + mInputFileName + " in directory " + mInputFilePath,
inputFile.exists());
@@ -159,7 +159,7 @@
}
@Test
- public void sampleMuxerNativeTest() {
+ public void testNativeMuxer() {
Native nativeMuxer = new Native();
File inputFile = new File(mInputFilePath + mInputFileName);
assertTrue("Cannot find " + mInputFileName + " in directory " + mInputFilePath,
diff --git a/media/tests/benchmark/MediaBenchmarkTest/src/main/cpp/NativeEncoder.cpp b/media/tests/benchmark/MediaBenchmarkTest/src/main/cpp/NativeEncoder.cpp
index 271b852..1277c8b 100644
--- a/media/tests/benchmark/MediaBenchmarkTest/src/main/cpp/NativeEncoder.cpp
+++ b/media/tests/benchmark/MediaBenchmarkTest/src/main/cpp/NativeEncoder.cpp
@@ -18,9 +18,9 @@
#define LOG_TAG "NativeEncoder"
#include <jni.h>
+#include <sys/stat.h>
#include <fstream>
#include <iostream>
-#include <sys/stat.h>
#include <android/log.h>
@@ -29,6 +29,11 @@
#include <stdio.h>
+constexpr int32_t ENCODE_DEFAULT_FRAME_RATE = 25;
+constexpr int32_t ENCODE_DEFAULT_AUDIO_BIT_RATE = 128000 /* 128 Kbps */;
+constexpr int32_t ENCODE_DEFAULT_BIT_RATE = 8000000 /* 8 Mbps */;
+constexpr int32_t ENCODE_MIN_BIT_RATE = 600000 /* 600 Kbps */;
+
extern "C" JNIEXPORT int JNICALL Java_com_android_media_benchmark_library_Native_Encode(
JNIEnv *env, jobject thiz, jstring jFilePath, jstring jFileName, jstring jOutFilePath,
jstring jStatsFile, jstring jCodecName) {
@@ -72,7 +77,7 @@
ALOGE("Track Format invalid");
return -1;
}
- uint8_t *inputBuffer = (uint8_t *) malloc(fileSize);
+ uint8_t *inputBuffer = (uint8_t *)malloc(fileSize);
if (!inputBuffer) {
ALOGE("Insufficient memory");
return -1;
@@ -110,6 +115,8 @@
free(inputBuffer);
return -1;
}
+
+ AMediaFormat *decoderFormat = decoder->getFormat();
AMediaFormat *format = extractor->getFormat();
if (inputBuffer) {
free(inputBuffer);
@@ -146,29 +153,34 @@
AMediaFormat_getInt32(format, AMEDIAFORMAT_KEY_FRAME_RATE, &encParams.frameRate);
AMediaFormat_getInt32(format, AMEDIAFORMAT_KEY_BIT_RATE, &encParams.bitrate);
if (encParams.bitrate <= 0 || encParams.frameRate <= 0) {
- encParams.frameRate = 25;
+ encParams.frameRate = ENCODE_DEFAULT_FRAME_RATE;
if (!strcmp(mime, "video/3gpp") || !strcmp(mime, "video/mp4v-es")) {
- encParams.bitrate = 600000 /* 600 Kbps */;
+ encParams.bitrate = ENCODE_MIN_BIT_RATE /* 600 Kbps */;
} else {
- encParams.bitrate = 8000000 /* 8 Mbps */;
+ encParams.bitrate = ENCODE_DEFAULT_BIT_RATE /* 8 Mbps */;
}
}
AMediaFormat_getInt32(format, AMEDIAFORMAT_KEY_PROFILE, &encParams.profile);
AMediaFormat_getInt32(format, AMEDIAFORMAT_KEY_LEVEL, &encParams.level);
+ AMediaFormat_getInt32(decoderFormat, AMEDIAFORMAT_KEY_COLOR_FORMAT,
+ &encParams.colorFormat);
} else {
AMediaFormat_getInt32(format, AMEDIAFORMAT_KEY_SAMPLE_RATE, &encParams.sampleRate);
AMediaFormat_getInt32(format, AMEDIAFORMAT_KEY_CHANNEL_COUNT,
&encParams.numChannels);
- encParams.bitrate =
- encParams.sampleRate * encParams.numChannels * 16 /* bitsPerSample */;
+ encParams.bitrate = ENCODE_DEFAULT_AUDIO_BIT_RATE;
}
Encoder *encoder = new Encoder();
encoder->setupEncoder();
status = encoder->encode(sCodecName, eleStream, eleSize, asyncMode[i], encParams,
- (char *) mime);
+ (char *)mime);
+ if (status != AMEDIA_OK) {
+ ALOGE("Encoder returned error");
+ return -1;
+ }
+ ALOGV("Encoding complete with codec %s for asyncMode = %d", sCodecName.c_str(),
+ asyncMode[i]);
encoder->deInitCodec();
- cout << "codec : " << codecName << endl;
- ALOGV(" asyncMode = %d \n", asyncMode[i]);
const char *statsFile = env->GetStringUTFChars(jStatsFile, nullptr);
encoder->dumpStatistics(sInputReference, extractor->getClipDuration(), sCodecName,
(asyncMode[i] ? "async" : "sync"), statsFile);
@@ -189,6 +201,10 @@
AMediaFormat_delete(format);
format = nullptr;
}
+ if (decoderFormat) {
+ AMediaFormat_delete(decoderFormat);
+ decoderFormat = nullptr;
+ }
decoder->deInitCodec();
decoder->resetDecoder();
}
diff --git a/media/tests/benchmark/MediaBenchmarkTest/src/main/java/com/android/media/benchmark/library/Decoder.java b/media/tests/benchmark/MediaBenchmarkTest/src/main/java/com/android/media/benchmark/library/Decoder.java
index 3b1eed4..66fee33 100644
--- a/media/tests/benchmark/MediaBenchmarkTest/src/main/java/com/android/media/benchmark/library/Decoder.java
+++ b/media/tests/benchmark/MediaBenchmarkTest/src/main/java/com/android/media/benchmark/library/Decoder.java
@@ -134,7 +134,6 @@
mStats.addOutputTime();
onOutputAvailable(mediaCodec, outputBufferId, bufferInfo);
if (mSawOutputEOS) {
- Log.i(TAG, "Saw output EOS");
synchronized (mLock) { mLock.notify(); }
}
}
@@ -211,9 +210,6 @@
}
onOutputAvailable(mCodec, outputBufferId, outputBufferInfo);
}
- if (outputBufferInfo.flags == MediaCodec.BUFFER_FLAG_END_OF_STREAM) {
- Log.i(TAG, "Saw output EOS");
- }
}
}
mInputBuffer.clear();
@@ -256,14 +252,21 @@
*/
public void resetDecoder() { mStats.reset(); }
+ /**
+ * Returns the format of the output buffers
+ */
+ public MediaFormat getFormat() {
+ return mCodec.getOutputFormat();
+ }
+
private void onInputAvailable(int inputBufferId, MediaCodec mediaCodec) {
if ((inputBufferId >= 0) && !mSawInputEOS) {
ByteBuffer inputCodecBuffer = mediaCodec.getInputBuffer(inputBufferId);
BufferInfo bufInfo = mInputBufferInfo.get(mIndex);
inputCodecBuffer.put(mInputBuffer.get(mIndex).array());
mIndex++;
- if (bufInfo.flags == MediaCodec.BUFFER_FLAG_END_OF_STREAM) {
- mSawInputEOS = true;
+ mSawInputEOS = (bufInfo.flags & MediaCodec.BUFFER_FLAG_END_OF_STREAM) != 0;
+ if (mSawInputEOS) {
Log.i(TAG, "Saw input EOS");
}
mStats.addFrameSize(bufInfo.size);
@@ -301,6 +304,9 @@
}
}
mediaCodec.releaseOutputBuffer(outputBufferId, false);
- mSawOutputEOS = (outputBufferInfo.flags == MediaCodec.BUFFER_FLAG_END_OF_STREAM);
+ mSawOutputEOS = (outputBufferInfo.flags & MediaCodec.BUFFER_FLAG_END_OF_STREAM) != 0;
+ if (mSawOutputEOS) {
+ Log.i(TAG, "Saw output EOS");
+ }
}
}
diff --git a/media/tests/benchmark/MediaBenchmarkTest/src/main/java/com/android/media/benchmark/library/Encoder.java b/media/tests/benchmark/MediaBenchmarkTest/src/main/java/com/android/media/benchmark/library/Encoder.java
index 40cf8bd..45e5574 100644
--- a/media/tests/benchmark/MediaBenchmarkTest/src/main/java/com/android/media/benchmark/library/Encoder.java
+++ b/media/tests/benchmark/MediaBenchmarkTest/src/main/java/com/android/media/benchmark/library/Encoder.java
@@ -29,7 +29,9 @@
import java.nio.ByteBuffer;
public class Encoder {
- private static final int ENCODE_DEFAULT_MAX_INPUT_SIZE = 3840;
+ // Change in AUDIO_ENCODE_DEFAULT_MAX_INPUT_SIZE should also be taken to
+ // kDefaultAudioEncodeFrameSize present in BenchmarkCommon.h
+ private static final int AUDIO_ENCODE_DEFAULT_MAX_INPUT_SIZE = 4096;
private static final String TAG = "Encoder";
private static final boolean DEBUG = false;
private static final int kQueueDequeueTimeoutUs = 1000;
@@ -134,7 +136,7 @@
if (mMime.startsWith("video/")) {
mFrameSize = frameSize;
} else {
- int maxInputSize = ENCODE_DEFAULT_MAX_INPUT_SIZE;
+ int maxInputSize = AUDIO_ENCODE_DEFAULT_MAX_INPUT_SIZE;
MediaFormat format = mCodec.getInputFormat();
if (format.containsKey(MediaFormat.KEY_MAX_INPUT_SIZE)) {
maxInputSize = format.getInteger(MediaFormat.KEY_MAX_INPUT_SIZE);
@@ -260,12 +262,12 @@
}
mStats.addFrameSize(outputBuffer.remaining());
mediaCodec.releaseOutputBuffer(outputBufferId, false);
- mSawOutputEOS = (outputBufferInfo.flags == MediaCodec.BUFFER_FLAG_END_OF_STREAM);
+ mSawOutputEOS = (outputBufferInfo.flags & MediaCodec.BUFFER_FLAG_END_OF_STREAM) != 0;
}
private void onInputAvailable(MediaCodec mediaCodec, int inputBufferId) throws IOException {
- if (mSawOutputEOS || inputBufferId < 0) {
- if (mSawOutputEOS) {
+ if (mSawInputEOS || inputBufferId < 0) {
+ if (mSawInputEOS) {
Log.i(TAG, "Saw input EOS");
}
return;
@@ -281,19 +283,27 @@
return;
}
int bufSize = inputBuffer.capacity();
- int bytesRead = mFrameSize;
+ int bytesToRead = mFrameSize;
if (mInputBufferSize - mOffset < mFrameSize) {
- bytesRead = (int) (mInputBufferSize - mOffset);
+ bytesToRead = (int) (mInputBufferSize - mOffset);
}
- if (bufSize < bytesRead) {
- mSignalledError = true;
- return;
+ //b/148655275 - Update Frame size, as Format value may not be valid
+ if (bufSize < bytesToRead) {
+ if(mNumInputFrame == 0) {
+ mFrameSize = bufSize;
+ bytesToRead = bufSize;
+ mNumFrames = (int) ((mInputBufferSize + mFrameSize - 1) / mFrameSize);
+ } else {
+ mSignalledError = true;
+ return;
+ }
}
- byte[] inputArray = new byte[bytesRead];
- mInputStream.read(inputArray, 0, bytesRead);
+
+ byte[] inputArray = new byte[bytesToRead];
+ mInputStream.read(inputArray, 0, bytesToRead);
inputBuffer.put(inputArray);
int flag = 0;
- if (mNumInputFrame >= mNumFrames - 1 || bytesRead == 0) {
+ if (mNumInputFrame >= mNumFrames - 1 || bytesToRead == 0) {
Log.i(TAG, "Sending EOS on input last frame");
mSawInputEOS = true;
flag = MediaCodec.BUFFER_FLAG_END_OF_STREAM;
@@ -304,9 +314,9 @@
} else {
presentationTimeUs = mNumInputFrame * mFrameSize * 1000000 / mSampleRate;
}
- mediaCodec.queueInputBuffer(inputBufferId, 0, bytesRead, presentationTimeUs, flag);
+ mediaCodec.queueInputBuffer(inputBufferId, 0, bytesToRead, presentationTimeUs, flag);
mNumInputFrame++;
- mOffset += bytesRead;
+ mOffset += bytesToRead;
}
/**
diff --git a/media/tests/benchmark/src/native/common/BenchmarkCommon.h b/media/tests/benchmark/src/native/common/BenchmarkCommon.h
index c11fe36..40a8c9e 100644
--- a/media/tests/benchmark/src/native/common/BenchmarkCommon.h
+++ b/media/tests/benchmark/src/native/common/BenchmarkCommon.h
@@ -35,6 +35,9 @@
constexpr uint32_t kQueueDequeueTimeoutUs = 1000;
constexpr uint32_t kMaxCSDStrlen = 16;
constexpr uint32_t kMaxBufferSize = 1024 * 1024 * 16;
+// Change in kDefaultAudioEncodeFrameSize should also be taken to
+// AUDIO_ENCODE_DEFAULT_MAX_INPUT_SIZE present in Encoder.java
+constexpr uint32_t kDefaultAudioEncodeFrameSize = 4096;
template <typename T>
class CallBackQueue {
diff --git a/media/tests/benchmark/src/native/decoder/Decoder.cpp b/media/tests/benchmark/src/native/decoder/Decoder.cpp
index 2171589..090f3e1 100644
--- a/media/tests/benchmark/src/native/decoder/Decoder.cpp
+++ b/media/tests/benchmark/src/native/decoder/Decoder.cpp
@@ -63,8 +63,8 @@
ssize_t bytesRead = 0;
uint32_t flag = 0;
int64_t presentationTimeUs = 0;
- tie(bytesRead, flag, presentationTimeUs) = readSampleData(
- mInputBuffer, mOffset, mFrameMetaData, buf, mNumInputFrame, bufSize);
+ tie(bytesRead, flag, presentationTimeUs) =
+ readSampleData(mInputBuffer, mOffset, mFrameMetaData, buf, mNumInputFrame, bufSize);
if (flag == AMEDIA_ERROR_MALFORMED) {
mErrorCode = (media_status_t)flag;
mSignalledError = true;
@@ -144,6 +144,11 @@
if (!mFormat) mFormat = mExtractor->getFormat();
}
+AMediaFormat *Decoder::getFormat() {
+ ALOGV("In %s", __func__);
+ return AMediaCodec_getOutputFormat(mCodec);
+}
+
int32_t Decoder::decode(uint8_t *inputBuffer, vector<AMediaCodecBufferInfo> &frameInfo,
string &codecName, bool asyncMode, FILE *outFp) {
ALOGV("In %s", __func__);
diff --git a/media/tests/benchmark/src/native/decoder/Decoder.h b/media/tests/benchmark/src/native/decoder/Decoder.h
index f3fa6a1..e619cb4 100644
--- a/media/tests/benchmark/src/native/decoder/Decoder.h
+++ b/media/tests/benchmark/src/native/decoder/Decoder.h
@@ -57,6 +57,8 @@
void resetDecoder();
+ AMediaFormat *getFormat();
+
// Async callback APIs
void onInputAvailable(AMediaCodec *codec, int32_t index) override;
diff --git a/media/tests/benchmark/src/native/encoder/Encoder.cpp b/media/tests/benchmark/src/native/encoder/Encoder.cpp
index 2db612c..26fb1b9 100644
--- a/media/tests/benchmark/src/native/encoder/Encoder.cpp
+++ b/media/tests/benchmark/src/native/encoder/Encoder.cpp
@@ -47,29 +47,36 @@
mEncoderDoneCondition.notify_one();
return;
}
- size_t bytesRead = mParams.frameSize;
+ size_t bytesToRead = mParams.frameSize;
if (mInputBufferSize - mOffset < mParams.frameSize) {
- bytesRead = mInputBufferSize - mOffset;
+ bytesToRead = mInputBufferSize - mOffset;
}
- if (bufSize < bytesRead) {
- ALOGE("bytes to read %zu bufSize %zu \n", bytesRead, bufSize);
+ //b/148655275 - Update Frame size, as Format value may not be valid
+ if (bufSize < bytesToRead) {
+ if(mNumInputFrame == 0) {
+ mParams.frameSize = bufSize;
+ bytesToRead = bufSize;
+ mParams.numFrames = (mInputBufferSize + mParams.frameSize - 1) / mParams.frameSize;
+ } else {
+ ALOGE("bytes to read %zu bufSize %zu \n", bytesToRead, bufSize);
+ mErrorCode = AMEDIA_ERROR_MALFORMED;
+ mSignalledError = true;
+ mEncoderDoneCondition.notify_one();
+ return;
+ }
+ }
+ if (bytesToRead < mParams.frameSize && mNumInputFrame < mParams.numFrames - 1) {
+ ALOGE("Partial frame at frameID %d bytesToRead %zu frameSize %d total numFrames %d\n",
+ mNumInputFrame, bytesToRead, mParams.frameSize, mParams.numFrames);
mErrorCode = AMEDIA_ERROR_MALFORMED;
mSignalledError = true;
mEncoderDoneCondition.notify_one();
return;
}
- if (bytesRead < mParams.frameSize && mNumInputFrame < mParams.numFrames - 1) {
- ALOGE("Partial frame at frameID %d bytesRead %zu frameSize %d total numFrames %d\n",
- mNumInputFrame, bytesRead, mParams.frameSize, mParams.numFrames);
- mErrorCode = AMEDIA_ERROR_MALFORMED;
- mSignalledError = true;
- mEncoderDoneCondition.notify_one();
- return;
- }
- mEleStream->read(buf, bytesRead);
+ mEleStream->read(buf, bytesToRead);
size_t bytesgcount = mEleStream->gcount();
- if (bytesgcount != bytesRead) {
- ALOGE("bytes to read %zu actual bytes read %zu \n", bytesRead, bytesgcount);
+ if (bytesgcount != bytesToRead) {
+ ALOGE("bytes to read %zu actual bytes read %zu \n", bytesToRead, bytesgcount);
mErrorCode = AMEDIA_ERROR_MALFORMED;
mSignalledError = true;
mEncoderDoneCondition.notify_one();
@@ -77,7 +84,7 @@
}
uint32_t flag = 0;
- if (mNumInputFrame == mParams.numFrames - 1 || bytesRead == 0) {
+ if (mNumInputFrame == mParams.numFrames - 1 || bytesToRead == 0) {
ALOGD("Sending EOS on input Last frame\n");
flag |= AMEDIACODEC_BUFFER_FLAG_END_OF_STREAM;
}
@@ -92,10 +99,10 @@
if (flag == AMEDIACODEC_BUFFER_FLAG_END_OF_STREAM) mSawInputEOS = true;
ALOGV("%s bytesRead : %zd presentationTimeUs : %" PRIu64 " mSawInputEOS : %s", __FUNCTION__,
- bytesRead, presentationTimeUs, mSawInputEOS ? "TRUE" : "FALSE");
+ bytesToRead, presentationTimeUs, mSawInputEOS ? "TRUE" : "FALSE");
media_status_t status = AMediaCodec_queueInputBuffer(mCodec, bufIdx, 0 /* offset */,
- bytesRead, presentationTimeUs, flag);
+ bytesToRead, presentationTimeUs, flag);
if (AMEDIA_OK != status) {
mErrorCode = status;
mSignalledError = true;
@@ -103,7 +110,7 @@
return;
}
mNumInputFrame++;
- mOffset += bytesRead;
+ mOffset += bytesToRead;
}
}
@@ -181,8 +188,8 @@
mStats->dumpStatistics(operation, inputReference, durationUs, componentName, mode, statsFile);
}
-int32_t Encoder::encode(string &codecName, ifstream &eleStream, size_t eleSize,
- bool asyncMode, encParameter encParams, char *mime) {
+int32_t Encoder::encode(string &codecName, ifstream &eleStream, size_t eleSize, bool asyncMode,
+ encParameter encParams, char *mime) {
ALOGV("In %s", __func__);
mEleStream = &eleStream;
mInputBufferSize = eleSize;
@@ -202,6 +209,7 @@
AMediaFormat_setInt32(mFormat, AMEDIAFORMAT_KEY_PROFILE, mParams.profile);
AMediaFormat_setInt32(mFormat, AMEDIAFORMAT_KEY_LEVEL, mParams.level);
}
+ AMediaFormat_setInt32(mFormat, AMEDIAFORMAT_KEY_COLOR_FORMAT, mParams.colorFormat);
} else {
AMediaFormat_setInt32(mFormat, AMEDIAFORMAT_KEY_SAMPLE_RATE, mParams.sampleRate);
AMediaFormat_setInt32(mFormat, AMEDIAFORMAT_KEY_CHANNEL_COUNT, mParams.numChannels);
@@ -219,13 +227,12 @@
if (!strncmp(mMime, "video/", 6)) {
mParams.frameSize = mParams.width * mParams.height * 3 / 2;
} else {
- mParams.frameSize = 4096;
+ mParams.frameSize = kDefaultAudioEncodeFrameSize;
// Get mInputMaxBufSize
AMediaFormat *inputFormat = AMediaCodec_getInputFormat(mCodec);
AMediaFormat_getInt32(inputFormat, AMEDIAFORMAT_KEY_MAX_INPUT_SIZE, &mParams.maxFrameSize);
if (mParams.maxFrameSize < 0) {
- ALOGE("Invalid mParams.maxFrameSize %d\n", mParams.maxFrameSize);
- return AMEDIA_ERROR_INVALID_PARAMETER;
+ mParams.maxFrameSize = kDefaultAudioEncodeFrameSize;
}
if (mParams.frameSize > mParams.maxFrameSize) {
mParams.frameSize = mParams.maxFrameSize;
diff --git a/media/tests/benchmark/src/native/encoder/Encoder.h b/media/tests/benchmark/src/native/encoder/Encoder.h
index 3d12600..5ad142b 100644
--- a/media/tests/benchmark/src/native/encoder/Encoder.h
+++ b/media/tests/benchmark/src/native/encoder/Encoder.h
@@ -23,9 +23,11 @@
#include <queue>
#include <thread>
+#include "media/NdkImage.h"
#include "BenchmarkCommon.h"
#include "Stats.h"
+
struct encParameter {
int32_t bitrate = -1;
int32_t numFrames = -1;
@@ -38,6 +40,7 @@
int32_t frameRate = -1;
int32_t profile = 0;
int32_t level = 0;
+ int32_t colorFormat = AIMAGE_FORMAT_YUV_420_888;
};
class Encoder : public CallBackHandle {
diff --git a/media/tests/benchmark/tests/C2DecoderTest.cpp b/media/tests/benchmark/tests/C2DecoderTest.cpp
index ecd9759..dedc743 100644
--- a/media/tests/benchmark/tests/C2DecoderTest.cpp
+++ b/media/tests/benchmark/tests/C2DecoderTest.cpp
@@ -157,7 +157,7 @@
make_pair("bbb_44100hz_2ch_128kbps_mp3_30sec.mp3", "mp3"),
make_pair("bbb_8000hz_1ch_8kbps_amrnb_30sec.3gp", "amrnb"),
make_pair("bbb_16000hz_1ch_9kbps_amrwb_30sec.3gp", "amrnb"),
- make_pair("bbb_44100hz_2ch_80kbps_vorbis_30sec.mp4", "vorbis"),
+ make_pair("bbb_44100hz_2ch_80kbps_vorbis_30sec.webm", "vorbis"),
make_pair("bbb_44100hz_2ch_600kbps_flac_30sec.mp4", "flac"),
make_pair("bbb_48000hz_2ch_100kbps_opus_30sec.webm", "opus")));
diff --git a/media/tests/benchmark/tests/DecoderTest.cpp b/media/tests/benchmark/tests/DecoderTest.cpp
index 5c6aa5b..9f96d3b 100644
--- a/media/tests/benchmark/tests/DecoderTest.cpp
+++ b/media/tests/benchmark/tests/DecoderTest.cpp
@@ -101,7 +101,7 @@
make_tuple("bbb_44100hz_2ch_128kbps_mp3_30sec.mp3", "", false),
make_tuple("bbb_8000hz_1ch_8kbps_amrnb_30sec.3gp", "", false),
make_tuple("bbb_16000hz_1ch_9kbps_amrwb_30sec.3gp", "", false),
- make_tuple("bbb_44100hz_2ch_80kbps_vorbis_30sec.mp4", "", false),
+ make_tuple("bbb_44100hz_2ch_80kbps_vorbis_30sec.webm", "", false),
make_tuple("bbb_44100hz_2ch_600kbps_flac_30sec.mp4", "", false),
make_tuple("bbb_48000hz_2ch_100kbps_opus_30sec.webm", "", false)));
@@ -111,7 +111,7 @@
make_tuple("bbb_44100hz_2ch_128kbps_mp3_30sec.mp3", "", true),
make_tuple("bbb_8000hz_1ch_8kbps_amrnb_30sec.3gp", "", true),
make_tuple("bbb_16000hz_1ch_9kbps_amrwb_30sec.3gp", "", true),
- make_tuple("bbb_44100hz_2ch_80kbps_vorbis_30sec.mp4", "", true),
+ make_tuple("bbb_44100hz_2ch_80kbps_vorbis_30sec.webm", "", true),
make_tuple("bbb_44100hz_2ch_600kbps_flac_30sec.mp4", "", true),
make_tuple("bbb_48000hz_2ch_100kbps_opus_30sec.webm", "", true)));
diff --git a/media/tests/benchmark/tests/ExtractorTest.cpp b/media/tests/benchmark/tests/ExtractorTest.cpp
index c2d72ff..ad8f1e6 100644
--- a/media/tests/benchmark/tests/ExtractorTest.cpp
+++ b/media/tests/benchmark/tests/ExtractorTest.cpp
@@ -69,7 +69,7 @@
make_pair("bbb_44100hz_2ch_600kbps_flac_5mins.flac", 0),
make_pair("bbb_8000hz_1ch_8kbps_amrnb_5mins.3gp", 0),
make_pair("bbb_16000hz_1ch_9kbps_amrwb_5mins.3gp", 0),
- make_pair("bbb_44100hz_2ch_80kbps_vorbis_5mins.mp4", 0),
+ make_pair("bbb_44100hz_2ch_80kbps_vorbis_5mins.webm", 0),
make_pair("bbb_48000hz_2ch_100kbps_opus_5mins.webm",
0)));
diff --git a/media/tests/benchmark/tests/MuxerTest.cpp b/media/tests/benchmark/tests/MuxerTest.cpp
index 7b01732..fa2635d 100644
--- a/media/tests/benchmark/tests/MuxerTest.cpp
+++ b/media/tests/benchmark/tests/MuxerTest.cpp
@@ -136,7 +136,7 @@
make_pair("crowd_1920x1080_25fps_6700kbps_h264.ts", "3gpp"),
make_pair("crowd_1920x1080_25fps_4000kbps_h265.mkv", "3gpp"),
make_pair("bbb_48000hz_2ch_100kbps_opus_5mins.webm", "ogg"),
- make_pair("bbb_44100hz_2ch_80kbps_vorbis_5mins.mp4", "webm"),
+ make_pair("bbb_44100hz_2ch_80kbps_vorbis_5mins.webm", "webm"),
make_pair("bbb_48000hz_2ch_100kbps_opus_5mins.webm", "webm"),
make_pair("bbb_44100hz_2ch_128kbps_aac_5mins.mp4", "mp4"),
make_pair("bbb_8000hz_1ch_8kbps_amrnb_5mins.3gp", "mp4"),
diff --git a/services/audioflinger/Android.bp b/services/audioflinger/Android.bp
index 46472c9..c58360d 100644
--- a/services/audioflinger/Android.bp
+++ b/services/audioflinger/Android.bp
@@ -3,8 +3,6 @@
cc_library_shared {
name: "libaudioflinger",
- tidy: false, // b/146435095, segmentation fault with Effects.cpp
-
srcs: [
"AudioFlinger.cpp",
"AudioHwDevice.cpp",
diff --git a/services/audiopolicy/engine/common/src/EngineBase.cpp b/services/audiopolicy/engine/common/src/EngineBase.cpp
index 525e965..b46a50a 100644
--- a/services/audiopolicy/engine/common/src/EngineBase.cpp
+++ b/services/audiopolicy/engine/common/src/EngineBase.cpp
@@ -107,6 +107,14 @@
engineConfig::ParsingResult EngineBase::loadAudioPolicyEngineConfig()
{
auto loadVolumeConfig = [](auto &volumeGroups, auto &volumeConfig) {
+ // Ensure name unicity to prevent duplicate
+ const auto &iter = std::find_if(std::begin(volumeGroups), std::end(volumeGroups),
+ [&volumeConfig](const auto &volumeGroup) {
+ return volumeConfig.name == volumeGroup.second->getName(); });
+ LOG_ALWAYS_FATAL_IF(iter != std::end(volumeGroups),
+ "group name %s defined twice, review the configuration",
+ volumeConfig.name.c_str());
+
sp<VolumeGroup> volumeGroup = new VolumeGroup(volumeConfig.name, volumeConfig.indexMin,
volumeConfig.indexMax);
volumeGroups[volumeGroup->getId()] = volumeGroup;
@@ -125,13 +133,21 @@
}
return volumeGroup;
};
- auto addSupportedStreamAttributes = [](auto &group, auto &volumeGroup, auto &strategy) {
- volumeGroup->addSupportedStream(group.stream);
+ auto addSupportedAttributesToGroup = [](auto &group, auto &volumeGroup, auto &strategy) {
for (const auto &attr : group.attributesVect) {
strategy->addAttributes({group.stream, volumeGroup->getId(), attr});
volumeGroup->addSupportedAttributes(attr);
}
};
+ auto checkStreamForGroups = [](auto streamType, const auto &volumeGroups) {
+ const auto &iter = std::find_if(std::begin(volumeGroups), std::end(volumeGroups),
+ [&streamType](const auto &volumeGroup) {
+ const auto& streams = volumeGroup.second->getStreamTypes();
+ return std::find(std::begin(streams), std::end(streams), streamType) !=
+ std::end(streams);
+ });
+ return iter != end(volumeGroups);
+ };
auto result = engineConfig::parse();
if (result.parsedConfig == nullptr) {
@@ -140,24 +156,30 @@
android::status_t ret = engineConfig::parseLegacyVolumes(config.volumeGroups);
result = {std::make_unique<engineConfig::Config>(config),
static_cast<size_t>(ret == NO_ERROR ? 0 : 1)};
+ } else {
+ // Append for internal use only volume groups (e.g. rerouting/patch)
+ result.parsedConfig->volumeGroups.insert(
+ std::end(result.parsedConfig->volumeGroups),
+ std::begin(gSystemVolumeGroups), std::end(gSystemVolumeGroups));
}
- // Append for internal use only strategies/volume groups (e.g. rerouting/patch)
+ // Append for internal use only strategies (e.g. rerouting/patch)
result.parsedConfig->productStrategies.insert(
std::end(result.parsedConfig->productStrategies),
std::begin(gOrderedSystemStrategies), std::end(gOrderedSystemStrategies));
- result.parsedConfig->volumeGroups.insert(
- std::end(result.parsedConfig->volumeGroups),
- std::begin(gSystemVolumeGroups), std::end(gSystemVolumeGroups));
ALOGE_IF(result.nbSkippedElement != 0, "skipped %zu elements", result.nbSkippedElement);
engineConfig::VolumeGroup defaultVolumeConfig;
+ engineConfig::VolumeGroup defaultSystemVolumeConfig;
for (auto &volumeConfig : result.parsedConfig->volumeGroups) {
// save default volume config for streams not defined in configuration
if (volumeConfig.name.compare("AUDIO_STREAM_MUSIC") == 0) {
defaultVolumeConfig = volumeConfig;
}
+ if (volumeConfig.name.compare("AUDIO_STREAM_PATCH") == 0) {
+ defaultSystemVolumeConfig = volumeConfig;
+ }
loadVolumeConfig(mVolumeGroups, volumeConfig);
}
for (auto& strategyConfig : result.parsedConfig->productStrategies) {
@@ -166,18 +188,31 @@
const auto &iter = std::find_if(begin(mVolumeGroups), end(mVolumeGroups),
[&group](const auto &volumeGroup) {
return group.volumeGroup == volumeGroup.second->getName(); });
- if (group.stream != AUDIO_STREAM_DEFAULT) {
- if (iter == end(mVolumeGroups)) {
- ALOGW("%s: No configuration of %s found, using default volume configuration"
- , __FUNCTION__, group.volumeGroup.c_str());
- defaultVolumeConfig.name = group.volumeGroup;
- sp<VolumeGroup> volumeGroup =
- loadVolumeConfig(mVolumeGroups, defaultVolumeConfig);
- addSupportedStreamAttributes(group, volumeGroup, strategy);
+ sp<VolumeGroup> volumeGroup = nullptr;
+ // If no volume group provided for this strategy, creates a new one using
+ // Music Volume Group configuration (considered as the default)
+ if (iter == end(mVolumeGroups)) {
+ engineConfig::VolumeGroup volumeConfig;
+ if (group.stream >= AUDIO_STREAM_PUBLIC_CNT) {
+ volumeConfig = defaultSystemVolumeConfig;
} else {
- addSupportedStreamAttributes(group, iter->second, strategy);
+ volumeConfig = defaultVolumeConfig;
}
+ ALOGW("%s: No configuration of %s found, using default volume configuration"
+ , __FUNCTION__, group.volumeGroup.c_str());
+ volumeConfig.name = group.volumeGroup;
+ volumeGroup = loadVolumeConfig(mVolumeGroups, volumeConfig);
+ } else {
+ volumeGroup = iter->second;
}
+ if (group.stream != AUDIO_STREAM_DEFAULT) {
+ // A legacy stream can be assigned once to a volume group
+ LOG_ALWAYS_FATAL_IF(checkStreamForGroups(group.stream, mVolumeGroups),
+ "stream %s already assigned to a volume group, "
+ "review the configuration", toString(group.stream).c_str());
+ volumeGroup->addSupportedStream(group.stream);
+ }
+ addSupportedAttributesToGroup(group, volumeGroup, strategy);
}
product_strategy_t strategyId = strategy->getId();
mProductStrategies[strategyId] = strategy;
diff --git a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
index 632c356..b747dd6 100644
--- a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
+++ b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
@@ -2512,15 +2512,29 @@
if (curDevices.erase(AUDIO_DEVICE_OUT_SPEAKER_SAFE)) {
curDevices.insert(AUDIO_DEVICE_OUT_SPEAKER);
}
-
+ if (!(desc->isActive(vs) || isInCall())) {
+ continue;
+ }
+ if (device != AUDIO_DEVICE_OUT_DEFAULT_FOR_VOLUME &&
+ curDevices.find(device) == curDevices.end()) {
+ continue;
+ }
+ bool applyVolume = false;
+ if (device != AUDIO_DEVICE_OUT_DEFAULT_FOR_VOLUME) {
+ curSrcDevices.insert(device);
+ applyVolume = (curSrcDevices.find(
+ Volume::getDeviceForVolume(curDevices)) != curSrcDevices.end());
+ } else {
+ applyVolume = !curves.hasVolumeIndexForDevice(curSrcDevice);
+ }
+ if (!applyVolume) {
+ continue; // next output
+ }
// Inter / intra volume group priority management: Loop on strategies arranged by priority
// If a higher priority strategy is active, and the output is routed to a device with a
// HW Gain management, do not change the volume
- bool applyVolume = false;
if (desc->useHwGain()) {
- if (!(desc->isActive(toVolumeSource(group)) || isInCall())) {
- continue;
- }
+ applyVolume = false;
for (const auto &productStrategy : mEngine->getOrderedProductStrategies()) {
auto activeClients = desc->clientsList(true /*activeOnly*/, productStrategy,
false /*preferredDevice*/);
@@ -2554,39 +2568,16 @@
if (!applyVolume) {
continue; // next output
}
- status_t volStatus = checkAndSetVolume(curves, vs, index, desc, curDevices,
- (vs == toVolumeSource(AUDIO_STREAM_SYSTEM)?
- TOUCH_SOUND_FIXED_DELAY_MS : 0));
- if (volStatus != NO_ERROR) {
- status = volStatus;
- }
- continue;
}
- if (!(desc->isActive(vs) || isInCall())) {
- continue;
- }
- if (device != AUDIO_DEVICE_OUT_DEFAULT_FOR_VOLUME &&
- curDevices.find(device) == curDevices.end()) {
- continue;
- }
- if (device != AUDIO_DEVICE_OUT_DEFAULT_FOR_VOLUME) {
- curSrcDevices.insert(device);
- applyVolume = (curSrcDevices.find(
- Volume::getDeviceForVolume(curDevices)) != curSrcDevices.end());
- } else {
- applyVolume = !curves.hasVolumeIndexForDevice(curSrcDevice);
- }
- if (applyVolume) {
- //FIXME: workaround for truncated touch sounds
- // delayed volume change for system stream to be removed when the problem is
- // handled by system UI
- status_t volStatus = checkAndSetVolume(
- curves, vs, index, desc, curDevices,
- ((vs == toVolumeSource(AUDIO_STREAM_SYSTEM))?
- TOUCH_SOUND_FIXED_DELAY_MS : 0));
- if (volStatus != NO_ERROR) {
- status = volStatus;
- }
+ //FIXME: workaround for truncated touch sounds
+ // delayed volume change for system stream to be removed when the problem is
+ // handled by system UI
+ status_t volStatus = checkAndSetVolume(
+ curves, vs, index, desc, curDevices,
+ ((vs == toVolumeSource(AUDIO_STREAM_SYSTEM))?
+ TOUCH_SOUND_FIXED_DELAY_MS : 0));
+ if (volStatus != NO_ERROR) {
+ status = volStatus;
}
}
mpClientInterface->onAudioVolumeGroupChanged(group, 0 /*flags*/);
diff --git a/services/camera/libcameraservice/Android.bp b/services/camera/libcameraservice/Android.bp
index c50a3c6..072afd2 100644
--- a/services/camera/libcameraservice/Android.bp
+++ b/services/camera/libcameraservice/Android.bp
@@ -112,6 +112,10 @@
"android.hardware.camera.device@3.5",
],
+ static_libs: [
+ "libbinderthreadstateutils",
+ ],
+
export_shared_lib_headers: [
"libbinder",
"libcamera_client",
diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp
index 6e5c979..c566485 100644
--- a/services/camera/libcameraservice/CameraService.cpp
+++ b/services/camera/libcameraservice/CameraService.cpp
@@ -43,6 +43,7 @@
#include <binder/PermissionController.h>
#include <binder/ProcessInfoService.h>
#include <binder/IResultReceiver.h>
+#include <binderthreadstate/CallerUtils.h>
#include <cutils/atomic.h>
#include <cutils/properties.h>
#include <cutils/misc.h>
@@ -1029,7 +1030,7 @@
// Only allow clients who are being used by the current foreground device user, unless calling
// from our own process OR the caller is using the cameraserver's HIDL interface.
- if (!hardware::IPCThreadState::self()->isServingCall() && callingPid != getpid() &&
+ if (getCurrentServingCall() != BinderCallType::HWBINDER && callingPid != getpid() &&
(mAllowedUsers.find(clientUserId) == mAllowedUsers.end())) {
ALOGE("CameraService::connect X (PID %d) rejected (cannot connect from "
"device user %d, currently allowed device users: %s)", callingPid, clientUserId,
@@ -1350,7 +1351,7 @@
// If the thread serving this call is not a hwbinder thread and the caller
// isn't the cameraserver itself, and the camera id being requested is to be
// publically hidden, we should reject the connection.
- if (!hardware::IPCThreadState::self()->isServingCall() &&
+ if (getCurrentServingCall() != BinderCallType::HWBINDER &&
CameraThreadState::getCallingPid() != getpid() &&
isPublicallyHiddenSecureCamera(cameraId)) {
return true;
@@ -1371,7 +1372,8 @@
String8 id = String8(cameraId);
sp<CameraDeviceClient> client = nullptr;
String16 clientPackageNameAdj = clientPackageName;
- if (hardware::IPCThreadState::self()->isServingCall()) {
+
+ if (getCurrentServingCall() == BinderCallType::HWBINDER) {
std::string vendorClient =
StringPrintf("vendor.client.pid<%d>", CameraThreadState::getCallingPid());
clientPackageNameAdj = String16(vendorClient.c_str());
@@ -2404,7 +2406,7 @@
}
mClientPackageName = packages[0];
}
- if (!hardware::IPCThreadState::self()->isServingCall()) {
+ if (getCurrentServingCall() != BinderCallType::HWBINDER) {
mAppOpsManager = std::make_unique<AppOpsManager>();
}
}
@@ -3027,7 +3029,7 @@
const std::set<String8>& conflictingKeys, int32_t score, int32_t ownerId,
int32_t state) {
- bool isVendorClient = hardware::IPCThreadState::self()->isServingCall();
+ bool isVendorClient = getCurrentServingCall() == BinderCallType::HWBINDER;
int32_t score_adj = isVendorClient ? kVendorClientScore : score;
int32_t state_adj = isVendorClient ? kVendorClientState: state;
diff --git a/services/camera/libcameraservice/utils/CameraThreadState.cpp b/services/camera/libcameraservice/utils/CameraThreadState.cpp
index b9e344b..2352b80 100644
--- a/services/camera/libcameraservice/utils/CameraThreadState.cpp
+++ b/services/camera/libcameraservice/utils/CameraThreadState.cpp
@@ -17,33 +17,34 @@
#include "CameraThreadState.h"
#include <binder/IPCThreadState.h>
#include <hwbinder/IPCThreadState.h>
+#include <binderthreadstate/CallerUtils.h>
#include <unistd.h>
namespace android {
int CameraThreadState::getCallingUid() {
- if (hardware::IPCThreadState::self()->isServingCall()) {
+ if (getCurrentServingCall() == BinderCallType::HWBINDER) {
return hardware::IPCThreadState::self()->getCallingUid();
}
return IPCThreadState::self()->getCallingUid();
}
int CameraThreadState::getCallingPid() {
- if (hardware::IPCThreadState::self()->isServingCall()) {
+ if (getCurrentServingCall() == BinderCallType::HWBINDER) {
return hardware::IPCThreadState::self()->getCallingPid();
}
return IPCThreadState::self()->getCallingPid();
}
int64_t CameraThreadState::clearCallingIdentity() {
- if (hardware::IPCThreadState::self()->isServingCall()) {
+ if (getCurrentServingCall() == BinderCallType::HWBINDER) {
return hardware::IPCThreadState::self()->clearCallingIdentity();
}
return IPCThreadState::self()->clearCallingIdentity();
}
void CameraThreadState::restoreCallingIdentity(int64_t token) {
- if (hardware::IPCThreadState::self()->isServingCall()) {
+ if (getCurrentServingCall() == BinderCallType::HWBINDER) {
hardware::IPCThreadState::self()->restoreCallingIdentity(token);
} else {
IPCThreadState::self()->restoreCallingIdentity(token);
diff --git a/services/camera/libcameraservice/utils/ClientManager.h b/services/camera/libcameraservice/utils/ClientManager.h
index ec6f01c..35d25bf 100644
--- a/services/camera/libcameraservice/utils/ClientManager.h
+++ b/services/camera/libcameraservice/utils/ClientManager.h
@@ -35,7 +35,7 @@
public:
/**
* Choosing to set mIsVendorClient through a parameter instead of calling
- * hardware::IPCThreadState::self()->isServingCall() to protect against the
+ * getCurrentServingCall() == BinderCallType::HWBINDER to protect against the
* case where the construction is offloaded to another thread which isn't a
* hwbinder thread.
*/
@@ -237,7 +237,7 @@
// We don't use the usual copy constructor here since we want to remember
// whether a client is a vendor client or not. This could have been wiped
// off in the incoming priority argument since an AIDL thread might have
- // called hardware::IPCThreadState::self()->isServingCall() after refreshing
+ // called getCurrentServingCall() == BinderCallType::HWBINDER after refreshing
// priorities for old clients through ProcessInfoService::getProcessStatesScoresFromPids().
mPriority.setScore(priority.getScore());
mPriority.setState(priority.getState());
diff --git a/services/mediacodec/registrant/Android.bp b/services/mediacodec/registrant/Android.bp
index fa5bc4a..765ac99 100644
--- a/services/mediacodec/registrant/Android.bp
+++ b/services/mediacodec/registrant/Android.bp
@@ -14,6 +14,7 @@
"libbase",
"libcodec2_hidl@1.0",
"libcodec2_vndk",
+ "libhidlbase",
"libutils",
],
diff --git a/services/mediacodec/registrant/CodecServiceRegistrant.cpp b/services/mediacodec/registrant/CodecServiceRegistrant.cpp
index 706ebee..7f7ceca 100644
--- a/services/mediacodec/registrant/CodecServiceRegistrant.cpp
+++ b/services/mediacodec/registrant/CodecServiceRegistrant.cpp
@@ -18,21 +18,411 @@
#define LOG_TAG "CodecServiceRegistrant"
#include <android-base/logging.h>
+#include <android-base/properties.h>
+#include <C2Component.h>
#include <C2PlatformSupport.h>
#include <codec2/hidl/1.0/ComponentStore.h>
+#include <codec2/hidl/1.0/Configurable.h>
+#include <codec2/hidl/1.0/types.h>
+#include <hidl/HidlSupport.h>
#include <media/CodecServiceRegistrant.h>
+namespace /* unnamed */ {
+
+using ::android::hardware::hidl_vec;
+using ::android::hardware::hidl_string;
+using ::android::hardware::Return;
+using ::android::hardware::Void;
+using ::android::sp;
+using namespace ::android::hardware::media::c2::V1_0;
+using namespace ::android::hardware::media::c2::V1_0::utils;
+
+constexpr c2_status_t C2_TRANSACTION_FAILED = C2_CORRUPTED;
+
+// Converter from IComponentStore to C2ComponentStore.
+class H2C2ComponentStore : public C2ComponentStore {
+protected:
+ sp<IComponentStore> mStore;
+ sp<IConfigurable> mConfigurable;
+public:
+ explicit H2C2ComponentStore(sp<IComponentStore> const& store)
+ : mStore{store},
+ mConfigurable{[store]() -> sp<IConfigurable>{
+ if (!store) {
+ return nullptr;
+ }
+ Return<sp<IConfigurable>> transResult =
+ store->getConfigurable();
+ return transResult.isOk() ?
+ static_cast<sp<IConfigurable>>(transResult) :
+ nullptr;
+ }()} {
+ if (!mConfigurable) {
+ LOG(ERROR) << "Preferred store is corrupted.";
+ }
+ }
+
+ virtual ~H2C2ComponentStore() override = default;
+
+ virtual c2_status_t config_sm(
+ std::vector<C2Param*> const ¶ms,
+ std::vector<std::unique_ptr<C2SettingResult>>* const failures
+ ) override {
+ Params hidlParams;
+ if (!createParamsBlob(&hidlParams, params)) {
+ LOG(ERROR) << "config -- bad input.";
+ return C2_TRANSACTION_FAILED;
+ }
+ c2_status_t status{};
+ Return<void> transResult = mConfigurable->config(
+ hidlParams,
+ true,
+ [&status, ¶ms, failures](
+ Status s,
+ const hidl_vec<SettingResult> f,
+ const Params& o) {
+ status = static_cast<c2_status_t>(s);
+ if (status != C2_OK && status != C2_BAD_INDEX) {
+ LOG(DEBUG) << "config -- call failed: "
+ << status << ".";
+ }
+ size_t i = failures->size();
+ failures->resize(i + f.size());
+ for (const SettingResult& sf : f) {
+ if (!objcpy(&(*failures)[i++], sf)) {
+ LOG(ERROR) << "config -- "
+ << "invalid SettingResult returned.";
+ return;
+ }
+ }
+ if (!updateParamsFromBlob(params, o)) {
+ LOG(ERROR) << "config -- "
+ << "failed to parse returned params.";
+ status = C2_CORRUPTED;
+ }
+ });
+ if (!transResult.isOk()) {
+ LOG(ERROR) << "config -- transaction failed.";
+ return C2_TRANSACTION_FAILED;
+ }
+ return status;
+ };
+
+ virtual c2_status_t copyBuffer(
+ std::shared_ptr<C2GraphicBuffer>,
+ std::shared_ptr<C2GraphicBuffer>) override {
+ LOG(ERROR) << "copyBuffer -- not supported.";
+ return C2_OMITTED;
+ }
+
+ virtual c2_status_t createComponent(
+ C2String, std::shared_ptr<C2Component> *const component) override {
+ component->reset();
+ LOG(ERROR) << "createComponent -- not supported.";
+ return C2_OMITTED;
+ }
+
+ virtual c2_status_t createInterface(
+ C2String, std::shared_ptr<C2ComponentInterface> *const interface) {
+ interface->reset();
+ LOG(ERROR) << "createInterface -- not supported.";
+ return C2_OMITTED;
+ }
+
+ virtual c2_status_t query_sm(
+ const std::vector<C2Param *> &stackParams,
+ const std::vector<C2Param::Index> &heapParamIndices,
+ std::vector<std::unique_ptr<C2Param>> *const heapParams) const
+ override {
+ hidl_vec<ParamIndex> indices(
+ stackParams.size() + heapParamIndices.size());
+ size_t numIndices = 0;
+ for (C2Param* const& stackParam : stackParams) {
+ if (!stackParam) {
+ LOG(WARNING) << "query -- null stack param encountered.";
+ continue;
+ }
+ indices[numIndices++] = static_cast<ParamIndex>(stackParam->index());
+ }
+ size_t numStackIndices = numIndices;
+ for (const C2Param::Index& index : heapParamIndices) {
+ indices[numIndices++] =
+ static_cast<ParamIndex>(static_cast<uint32_t>(index));
+ }
+ indices.resize(numIndices);
+ if (heapParams) {
+ heapParams->reserve(heapParams->size() + numIndices);
+ }
+ c2_status_t status;
+ Return<void> transResult = mConfigurable->query(
+ indices,
+ true,
+ [&status, &numStackIndices, &stackParams, heapParams](
+ Status s, const Params& p) {
+ status = static_cast<c2_status_t>(s);
+ if (status != C2_OK && status != C2_BAD_INDEX) {
+ LOG(DEBUG) << "query -- call failed: "
+ << status << ".";
+ return;
+ }
+ std::vector<C2Param*> paramPointers;
+ if (!parseParamsBlob(¶mPointers, p)) {
+ LOG(ERROR) << "query -- error while parsing params.";
+ status = C2_CORRUPTED;
+ return;
+ }
+ size_t i = 0;
+ for (auto it = paramPointers.begin();
+ it != paramPointers.end(); ) {
+ C2Param* paramPointer = *it;
+ if (numStackIndices > 0) {
+ --numStackIndices;
+ if (!paramPointer) {
+ LOG(WARNING) << "query -- null stack param.";
+ ++it;
+ continue;
+ }
+ for (; i < stackParams.size() && !stackParams[i]; ) {
+ ++i;
+ }
+ if (i >= stackParams.size()) {
+ LOG(ERROR) << "query -- unexpected error.";
+ status = C2_CORRUPTED;
+ return;
+ }
+ if (stackParams[i]->index() != paramPointer->index()) {
+ LOG(WARNING) << "query -- param skipped: "
+ "index = "
+ << stackParams[i]->index() << ".";
+ stackParams[i++]->invalidate();
+ continue;
+ }
+ if (!stackParams[i++]->updateFrom(*paramPointer)) {
+ LOG(WARNING) << "query -- param update failed: "
+ "index = "
+ << paramPointer->index() << ".";
+ }
+ } else {
+ if (!paramPointer) {
+ LOG(WARNING) << "query -- null heap param.";
+ ++it;
+ continue;
+ }
+ if (!heapParams) {
+ LOG(WARNING) << "query -- "
+ "unexpected extra stack param.";
+ } else {
+ heapParams->emplace_back(
+ C2Param::Copy(*paramPointer));
+ }
+ }
+ ++it;
+ }
+ });
+ if (!transResult.isOk()) {
+ LOG(ERROR) << "query -- transaction failed.";
+ return C2_TRANSACTION_FAILED;
+ }
+ return status;
+ }
+
+ virtual c2_status_t querySupportedParams_nb(
+ std::vector<std::shared_ptr<C2ParamDescriptor>> *const params) const {
+ c2_status_t status;
+ Return<void> transResult = mConfigurable->querySupportedParams(
+ std::numeric_limits<uint32_t>::min(),
+ std::numeric_limits<uint32_t>::max(),
+ [&status, params](
+ Status s,
+ const hidl_vec<ParamDescriptor>& p) {
+ status = static_cast<c2_status_t>(s);
+ if (status != C2_OK) {
+ LOG(DEBUG) << "querySupportedParams -- call failed: "
+ << status << ".";
+ return;
+ }
+ size_t i = params->size();
+ params->resize(i + p.size());
+ for (const ParamDescriptor& sp : p) {
+ if (!objcpy(&(*params)[i++], sp)) {
+ LOG(ERROR) << "querySupportedParams -- "
+ << "invalid returned ParamDescriptor.";
+ return;
+ }
+ }
+ });
+ if (!transResult.isOk()) {
+ LOG(ERROR) << "querySupportedParams -- transaction failed.";
+ return C2_TRANSACTION_FAILED;
+ }
+ return status;
+ }
+
+ virtual c2_status_t querySupportedValues_sm(
+ std::vector<C2FieldSupportedValuesQuery> &fields) const {
+ hidl_vec<FieldSupportedValuesQuery> inFields(fields.size());
+ for (size_t i = 0; i < fields.size(); ++i) {
+ if (!objcpy(&inFields[i], fields[i])) {
+ LOG(ERROR) << "querySupportedValues -- bad input";
+ return C2_TRANSACTION_FAILED;
+ }
+ }
+
+ c2_status_t status;
+ Return<void> transResult = mConfigurable->querySupportedValues(
+ inFields,
+ true,
+ [&status, &inFields, &fields](
+ Status s,
+ const hidl_vec<FieldSupportedValuesQueryResult>& r) {
+ status = static_cast<c2_status_t>(s);
+ if (status != C2_OK) {
+ LOG(DEBUG) << "querySupportedValues -- call failed: "
+ << status << ".";
+ return;
+ }
+ if (r.size() != fields.size()) {
+ LOG(ERROR) << "querySupportedValues -- "
+ "input and output lists "
+ "have different sizes.";
+ status = C2_CORRUPTED;
+ return;
+ }
+ for (size_t i = 0; i < fields.size(); ++i) {
+ if (!objcpy(&fields[i], inFields[i], r[i])) {
+ LOG(ERROR) << "querySupportedValues -- "
+ "invalid returned value.";
+ status = C2_CORRUPTED;
+ return;
+ }
+ }
+ });
+ if (!transResult.isOk()) {
+ LOG(ERROR) << "querySupportedValues -- transaction failed.";
+ return C2_TRANSACTION_FAILED;
+ }
+ return status;
+ }
+
+ virtual C2String getName() const {
+ C2String outName;
+ Return<void> transResult = mConfigurable->getName(
+ [&outName](const hidl_string& name) {
+ outName = name.c_str();
+ });
+ if (!transResult.isOk()) {
+ LOG(ERROR) << "getName -- transaction failed.";
+ }
+ return outName;
+ }
+
+ virtual std::shared_ptr<C2ParamReflector> getParamReflector() const
+ override {
+ struct SimpleParamReflector : public C2ParamReflector {
+ virtual std::unique_ptr<C2StructDescriptor> describe(
+ C2Param::CoreIndex coreIndex) const {
+ hidl_vec<ParamIndex> indices(1);
+ indices[0] = static_cast<ParamIndex>(coreIndex.coreIndex());
+ std::unique_ptr<C2StructDescriptor> descriptor;
+ Return<void> transResult = mBase->getStructDescriptors(
+ indices,
+ [&descriptor](
+ Status s,
+ const hidl_vec<StructDescriptor>& sd) {
+ c2_status_t status = static_cast<c2_status_t>(s);
+ if (status != C2_OK) {
+ LOG(DEBUG) << "SimpleParamReflector -- "
+ "getStructDescriptors() failed: "
+ << status << ".";
+ descriptor.reset();
+ return;
+ }
+ if (sd.size() != 1) {
+ LOG(DEBUG) << "SimpleParamReflector -- "
+ "getStructDescriptors() "
+ "returned vector of size "
+ << sd.size() << ". "
+ "It should be 1.";
+ descriptor.reset();
+ return;
+ }
+ if (!objcpy(&descriptor, sd[0])) {
+ LOG(DEBUG) << "SimpleParamReflector -- "
+ "getStructDescriptors() returned "
+ "corrupted data.";
+ descriptor.reset();
+ return;
+ }
+ });
+ return descriptor;
+ }
+
+ explicit SimpleParamReflector(sp<IComponentStore> base)
+ : mBase(base) { }
+
+ sp<IComponentStore> mBase;
+ };
+
+ return std::make_shared<SimpleParamReflector>(mStore);
+ }
+
+ virtual std::vector<std::shared_ptr<const C2Component::Traits>>
+ listComponents() override {
+ LOG(ERROR) << "listComponents -- not supported.";
+ return {};
+ }
+};
+
+bool ionPropertiesDefined() {
+ using namespace ::android::base;
+ std::string heapMask =
+ GetProperty("ro.com.android.media.swcodec.ion.heapmask", "undefined");
+ std::string flags =
+ GetProperty("ro.com.android.media.swcodec.ion.flags", "undefined");
+ std::string align =
+ GetProperty("ro.com.android.media.swcodec.ion.align", "undefined");
+ if (heapMask != "undefined" ||
+ flags != "undefined" ||
+ align != "undefined") {
+ LOG(INFO)
+ << "Some system properties for mediaswcodec ION usage are set: "
+ << "heapmask = " << heapMask << ", "
+ << "flags = " << flags << ", "
+ << "align = " << align << ". "
+ << "Preferred Codec2 store is defaulted to \"software\".";
+ return true;
+ }
+ return false;
+}
+
+} // unnamed namespace
+
extern "C" void RegisterCodecServices() {
- using namespace ::android::hardware::media::c2::V1_0;
+ using ComponentStore = ::android::hardware::media::c2::V1_0::utils::
+ ComponentStore;
LOG(INFO) << "Creating software Codec2 service...";
- android::sp<IComponentStore> store =
- new utils::ComponentStore(
- android::GetCodec2PlatformComponentStore());
+ sp<ComponentStore> store =
+ new ComponentStore(::android::GetCodec2PlatformComponentStore());
if (store == nullptr) {
LOG(ERROR) <<
"Cannot create software Codec2 service.";
} else {
+ if (!ionPropertiesDefined()) {
+ std::string preferredStoreName = "default";
+ sp<IComponentStore> preferredStore =
+ IComponentStore::getService(preferredStoreName.c_str());
+ if (preferredStore) {
+ ::android::SetPreferredCodec2ComponentStore(
+ std::make_shared<H2C2ComponentStore>(preferredStore));
+ LOG(INFO) <<
+ "Preferred Codec2 store is set to \"" <<
+ preferredStoreName << "\".";
+ } else {
+ LOG(INFO) <<
+ "Preferred Codec2 store is defaulted to \"software\".";
+ }
+ }
if (store->registerAsService("software") != android::OK) {
LOG(ERROR) <<
"Cannot register software Codec2 service.";
diff --git a/services/mediaextractor/Android.bp b/services/mediaextractor/Android.bp
index e906500..16b036f 100644
--- a/services/mediaextractor/Android.bp
+++ b/services/mediaextractor/Android.bp
@@ -29,6 +29,9 @@
"liblog",
"libavservices_minijail",
],
+ header_libs: [
+ "bionic_libc_platform_headers",
+ ],
target: {
android: {
product_variables: {
diff --git a/services/mediaextractor/main_extractorservice.cpp b/services/mediaextractor/main_extractorservice.cpp
index 3c4125b..afb7692 100644
--- a/services/mediaextractor/main_extractorservice.cpp
+++ b/services/mediaextractor/main_extractorservice.cpp
@@ -28,6 +28,8 @@
#include <android-base/properties.h>
#include <utils/misc.h>
+#include <bionic/reserved_signals.h>
+
// from LOCAL_C_INCLUDES
#include "MediaExtractorService.h"
#include "MediaUtils.h"
@@ -49,6 +51,10 @@
signal(SIGPIPE, SIG_IGN);
+ // Do not assist platform profilers (relevant only on debug builds).
+ // Otherwise, the signal handler can violate the seccomp policy.
+ signal(BIONIC_SIGNAL_PROFILER, SIG_IGN);
+
//b/62255959: this forces libutis.so to dlopen vendor version of libutils.so
//before minijail is on. This is dirty but required since some syscalls such
//as pread64 are used by linker but aren't allowed in the minijail. By