@glassly/bluetooth-sdk 0.1.0-dev.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +563 -0
- package/android/build.gradle +450 -0
- package/android/gradle.properties.example +9 -0
- package/android/lc3Lib/CMakeLists.txt +6 -0
- package/android/lc3Lib/build.gradle +212 -0
- package/android/lc3Lib/proguard-rules.pro +33 -0
- package/android/lc3Lib/src/main/AndroidManifest.xml +2 -0
- package/android/lc3Lib/src/main/cpp/CMakeLists.txt +8 -0
- package/android/lc3Lib/src/main/cpp/google_opus_stuff/CMakeLists.txt +30 -0
- package/android/lc3Lib/src/main/cpp/google_opus_stuff/jni/CMakeLists.txt +7 -0
- package/android/lc3Lib/src/main/cpp/google_opus_stuff/jni/ogg_opus_encoder.cc +96 -0
- package/android/lc3Lib/src/main/cpp/google_opus_stuff/jni/ogg_opus_encoder.h +53 -0
- package/android/lc3Lib/src/main/cpp/google_opus_stuff/libogg/Makefile.am +6 -0
- package/android/lc3Lib/src/main/cpp/google_opus_stuff/libogg/config_types.h +26 -0
- package/android/lc3Lib/src/main/cpp/google_opus_stuff/libogg/config_types.h.in +26 -0
- package/android/lc3Lib/src/main/cpp/google_opus_stuff/libogg/ogg.h +209 -0
- package/android/lc3Lib/src/main/cpp/google_opus_stuff/libogg/os_types.h +158 -0
- package/android/lc3Lib/src/main/cpp/google_opus_stuff/libopus/opus.h +981 -0
- package/android/lc3Lib/src/main/cpp/google_opus_stuff/libopus/opus_custom.h +342 -0
- package/android/lc3Lib/src/main/cpp/google_opus_stuff/libopus/opus_defines.h +799 -0
- package/android/lc3Lib/src/main/cpp/google_opus_stuff/libopus/opus_multistream.h +660 -0
- package/android/lc3Lib/src/main/cpp/google_opus_stuff/libopus/opus_projection.h +568 -0
- package/android/lc3Lib/src/main/cpp/google_opus_stuff/libopus/opus_types.h +166 -0
- package/android/lc3Lib/src/main/cpp/google_opus_stuff/ogg_opus_encoder.cc +268 -0
- package/android/lc3Lib/src/main/cpp/google_opus_stuff/ogg_opus_encoder.h +115 -0
- package/android/lc3Lib/src/main/cpp/google_opus_stuff/opus_tools/opus_header.h +59 -0
- package/android/lc3Lib/src/main/cpp/liblc3/CMakeLists.txt +38 -0
- package/android/lc3Lib/src/main/cpp/liblc3/include/lc3.h +309 -0
- package/android/lc3Lib/src/main/cpp/liblc3/include/lc3_private.h +162 -0
- package/android/lc3Lib/src/main/cpp/liblc3/include/rnnoise.h +114 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/CMakeLists.txt +19 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/attdet.c +92 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/attdet.h +44 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/bits.c +375 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/bits.h +315 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/bwdet.c +129 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/bwdet.h +69 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/common.h +148 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/energy.c +70 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/energy.h +43 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/fastmath.h +158 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/lc3.c +702 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/ltpf.c +893 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/ltpf.h +111 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/ltpf_arm.h +506 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/ltpf_neon.h +281 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/makefile.mk +35 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/mdct.c +452 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/mdct.h +57 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/mdct_neon.h +296 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/meson.build +46 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/plc.c +61 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/plc.h +57 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/sns.c +880 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/sns.h +103 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/spec.c +904 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/spec.h +119 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/tables.c +3457 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/tables.h +94 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/tns.c +457 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3/tns.h +99 -0
- package/android/lc3Lib/src/main/cpp/liblc3/liblc3.cpp +159 -0
- package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/_kiss_fft_guts.h +182 -0
- package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/arch.h +261 -0
- package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/celt_lpc.c +279 -0
- package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/celt_lpc.h +59 -0
- package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/common.h +48 -0
- package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/compile.sh +3 -0
- package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/denoise.c +646 -0
- package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/kiss_fft.c +601 -0
- package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/kiss_fft.h +203 -0
- package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/opus_types.h +159 -0
- package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/pitch.c +526 -0
- package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/pitch.h +149 -0
- package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/rnn.c +178 -0
- package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/rnn.h +69 -0
- package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/rnn_data.c +11051 -0
- package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/rnn_data.h +34 -0
- package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/rnn_reader.c +168 -0
- package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/rnn_train.py +66 -0
- package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/tansig_table.h +45 -0
- package/android/lc3Lib/src/main/java/com/glassly/lc3Lib/Lc3Cpp.java +38 -0
- package/android/lc3Lib/third_party/CMakeLists.txt +23 -0
- package/android/lc3Lib/third_party/CMakeLists_libogg.txt +18 -0
- package/android/lc3Lib/third_party/CMakeLists_libopus.txt +18 -0
- package/android/lc3Lib/third_party/CMakeLists_opus-tools.txt +23 -0
- package/android/lc3Lib/third_party/opus_tools/src/AUTHORS +5 -0
- package/android/lc3Lib/third_party/opus_tools/src/CMakeLists.txt +4 -0
- package/android/lc3Lib/third_party/opus_tools/src/COPYING +371 -0
- package/android/lc3Lib/third_party/opus_tools/src/ChangeLog +3 -0
- package/android/lc3Lib/third_party/opus_tools/src/Makefile.am +42 -0
- package/android/lc3Lib/third_party/opus_tools/src/Makefile.unix +23 -0
- package/android/lc3Lib/third_party/opus_tools/src/NEWS +0 -0
- package/android/lc3Lib/third_party/opus_tools/src/README +0 -0
- package/android/lc3Lib/third_party/opus_tools/src/autogen.sh +115 -0
- package/android/lc3Lib/third_party/opus_tools/src/configure.ac +293 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/arch.h +239 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/audio-in.c +1046 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/diag_range.c +245 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/diag_range.h +28 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/info_opus.c +320 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/info_opus.h +51 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/lpc.c +157 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/lpc.h +27 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/opus_header.c +286 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/opus_header.h +59 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/opusdec.c +884 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/opusenc.c +1021 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/opusenc.h +101 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/opusinfo.c +639 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/opusinfo.h +51 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/os_support.h +167 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/resample.c +1137 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/speex_resampler.h +344 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/stack_alloc.h +115 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/wav_io.c +125 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/wav_io.h +62 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/wave_out.c +223 -0
- package/android/lc3Lib/third_party/opus_tools/src/src/wave_out.h +60 -0
- package/android/settings.gradle +4 -0
- package/android/silero/LICENSE.md +17 -0
- package/android/silero/build.gradle +50 -0
- package/android/silero/proguard-rules.pro +24 -0
- package/android/silero/src/androidTest/assets/hello.wav +0 -0
- package/android/silero/src/androidTest/java/com/konovalov/vad/silero/VadSileroTest.kt +79 -0
- package/android/silero/src/main/assets/LICENSE +21 -0
- package/android/silero/src/main/assets/silero_vad.onnx +0 -0
- package/android/silero/src/main/java/com/konovalov/vad/silero/Vad.kt +160 -0
- package/android/silero/src/main/java/com/konovalov/vad/silero/VadSilero.kt +449 -0
- package/android/silero/src/main/java/com/konovalov/vad/silero/config/FrameSize.kt +15 -0
- package/android/silero/src/main/java/com/konovalov/vad/silero/config/Mode.kt +14 -0
- package/android/silero/src/main/java/com/konovalov/vad/silero/config/SampleRate.kt +12 -0
- package/android/silero/src/main/java/com/konovalov/vad/silero/utils/AudioUtils.kt +47 -0
- package/android/silero/src/main/java/com/konovalov/vad/silero/utils/TensorMap.kt +41 -0
- package/android/silero/src/test/java/com/konovalov/vad/silero/utils/AudioUtilsTest.kt +44 -0
- package/android/src/main/AndroidManifest.xml +42 -0
- package/android/src/main/assets/G2Firmware/README.md +11 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/BluetoothSdk.kt +2325 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/BluetoothSdkAnalytics.kt +216 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/BluetoothSdkDebug.kt +14 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/BluetoothSdkDefaults.kt +7 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/BluetoothSdkModule.kt +1088 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/Bridge.kt +953 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/DeviceManager.kt +2528 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/DeviceStore.kt +360 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/GeneratedChangelogCatalog.kt +8 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/GeneratedReleaseMetadata.kt +11 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/LocalNetworkModule.kt +414 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/ObservableStore.kt +88 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/OtaManifest.kt +191 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/ReleaseChangelog.kt +61 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/ScopedNetworkReadiness.kt +17 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/audio/AudioModels.kt +144 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/camera/CameraModels.kt +486 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/connection/ConnectionModels.kt +78 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/controllers/ControllerManager.kt +158 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/controllers/R1.kt +937 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/debug/BleTraceLogger.kt +165 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/events/BluetoothEvents.kt +178 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/internal/MapParsing.kt +140 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/net/LocalIpv4.kt +57 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/otaserver/LocalOtaServer.kt +304 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/otaserver/OtaServerModule.kt +120 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/photoreceiver/LocalPhotoReceiverRegistry.java +108 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/photoreceiver/LocalPhotoUploadServer.kt +622 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/photoreceiver/PhotoReceiverModule.kt +156 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/requests/DisplayRequests.kt +56 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/services/Foreground.kt +272 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/services/PhoneMic.kt +1195 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/Ar99.java +2653 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/BesOtaHeartbeatGuard.kt +49 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/BesOtaProgressMapper.kt +27 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/G1.kt +3878 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/G1TextSanitizer.kt +38 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/G2.kt +6428 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/G2CfwClassification.kt +49 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/G2CfwRenderer.kt +1241 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/G2CfwTextureCache.kt +270 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/G2FlashProtocol.kt +291 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/G2Flasher.kt +411 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/GlasslyBle.java +43189 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/Mach1.kt +1280 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/MentraLive.kt +10817 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/MentraLiveL2capChannel.kt +274 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/MentraLivePairingAdvertisement.kt +54 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/MentraNex.kt +2011 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/Nimo.kt +2532 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/SGCManager.kt +470 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/Simulated.kt +228 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/ar99/ota/Ar99OtaManager.java +566 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/ar99/ota/OtaByteUtils.java +18 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/ar99/ota/OtaCommandConstants.java +35 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/ar99/ota/OtaCrc32Util.java +13 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/ar99/ota/OtaGattTransport.java +11 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/ar99/ota/OtaProtocol.java +92 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/speakerid/SpeakerIdEngine.kt +525 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/status/DeviceStatus.kt +669 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/status/RuntimeState.kt +201 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/status/WifiHotspotStatus.kt +189 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/streaming/StreamModels.kt +518 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/stt/STTTools.kt +391 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/stt/SherpaOnnxTranscriber.kt +518 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/stt/VadGateSpeechPolicy.kt +229 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/tts/TTSTools.kt +248 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/types/DeviceModels.kt +96 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/utils/AES.java +106 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/utils/AudioSessionMonitor.kt +189 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/utils/AvifExifStripper.java +573 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/utils/BitmapJavaUtils.java +169 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/utils/BleJsonCompact.java +496 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/utils/BlePhotoUploadService.java +677 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/utils/BleWireProtocol.java +108 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/utils/Constants.kt +46 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/utils/G1Text.kt +436 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/utils/HeifExifTagReader.java +199 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/utils/IncidentLogBleRelayNaming.java +29 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/utils/IncidentLogBleUploadService.java +77 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/utils/K900LengthCodec.java +115 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/utils/K900ProtocolUtils.java +827 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/utils/MessageChunkReassembler.java +228 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/utils/MessageChunker.java +325 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/utils/NexSGCUtils.kt +698 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/utils/PhoneAudioMonitor.kt +348 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/utils/SmartGlassesConnectionState.java +9 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/utils/audio/Ar99OpusPcmDecoder.java +398 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/utils/audio/ByteUtilAudioPlayer.java +655 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/utils/audio/Lc3Player.java +441 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/utils/audio/PCMAudioPlayer.java +431 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/utils/audio/PcmStreamPlayer.kt +328 -0
- package/android/src/main/res/values/strings.xml +4 -0
- package/android/src/test/java/com/glassly/bluetoothsdk/BluetoothSdkExceptionTest.kt +18 -0
- package/android/src/test/java/com/glassly/bluetoothsdk/OtaManifestDowngradeTest.kt +86 -0
- package/android/src/test/java/com/glassly/bluetoothsdk/OtaStartResponsePolicyTest.kt +30 -0
- package/android/src/test/java/com/glassly/bluetoothsdk/ReleaseChangelogTest.kt +13 -0
- package/android/src/test/java/com/glassly/bluetoothsdk/ScopedNetworkReadinessTest.kt +39 -0
- package/android/src/test/java/com/glassly/bluetoothsdk/StreamStatusEventTest.kt +29 -0
- package/android/src/test/java/com/glassly/bluetoothsdk/camera/PhotoRequestTest.kt +141 -0
- package/android/src/test/java/com/glassly/bluetoothsdk/otaserver/LocalOtaServerTest.kt +82 -0
- package/android/src/test/java/com/glassly/bluetoothsdk/photoreceiver/LocalPhotoReceiverRegistryTest.java +75 -0
- package/android/src/test/java/com/glassly/bluetoothsdk/services/ForegroundServiceTypeTest.kt +69 -0
- package/android/src/test/java/com/glassly/bluetoothsdk/sgcs/Ar99AdvertisementMatcherTest.java +22 -0
- package/android/src/test/java/com/glassly/bluetoothsdk/sgcs/BesOtaHeartbeatGuardTest.kt +73 -0
- package/android/src/test/java/com/glassly/bluetoothsdk/sgcs/BesOtaProgressMapperTest.kt +67 -0
- package/android/src/test/java/com/glassly/bluetoothsdk/sgcs/EvenRleTest.kt +63 -0
- package/android/src/test/java/com/glassly/bluetoothsdk/sgcs/G1TextSanitizerTest.kt +31 -0
- package/android/src/test/java/com/glassly/bluetoothsdk/sgcs/G2CfwClassificationTest.kt +89 -0
- package/android/src/test/java/com/glassly/bluetoothsdk/sgcs/G2CfwRendererTest.kt +344 -0
- package/android/src/test/java/com/glassly/bluetoothsdk/sgcs/G2CfwTextureCacheTest.kt +200 -0
- package/android/src/test/java/com/glassly/bluetoothsdk/sgcs/G2FlashProtocolTest.kt +131 -0
- package/android/src/test/java/com/glassly/bluetoothsdk/sgcs/MentraLiveGattCharacteristicsTest.kt +39 -0
- package/android/src/test/java/com/glassly/bluetoothsdk/sgcs/MentraLivePairingAdvertisementParserTest.kt +133 -0
- package/android/src/test/java/com/glassly/bluetoothsdk/sgcs/NimoProtocolTest.kt +333 -0
- package/android/src/test/java/com/glassly/bluetoothsdk/utils/AvifExifStripperTest.java +46 -0
- package/android/src/test/java/com/glassly/bluetoothsdk/utils/BinaryMessageChunkerTest.java +84 -0
- package/android/src/test/java/com/glassly/bluetoothsdk/utils/BleJsonCompactTest.java +319 -0
- package/android/src/test/java/com/glassly/bluetoothsdk/utils/BlePhotoUploadServiceTest.java +107 -0
- package/android/src/test/java/com/glassly/bluetoothsdk/utils/K900ProtocolUtilsEndiannessTest.java +172 -0
- package/android/src/test/java/com/glassly/bluetoothsdk/utils/K900ProtocolUtilsTest.java +24 -0
- package/android/src/test/java/com/glassly/bluetoothsdk/utils/PhoneAudioMonitorTest.kt +45 -0
- package/android/src/test/resources/avif_with_exif.avif +0 -0
- package/app.plugin.js +3 -0
- package/build/BluetoothSdk.types.d.ts +1354 -0
- package/build/BluetoothSdk.types.d.ts.map +1 -0
- package/build/BluetoothSdk.types.js +41 -0
- package/build/BluetoothSdk.types.js.map +1 -0
- package/build/_internal.d.ts +17 -0
- package/build/_internal.d.ts.map +1 -0
- package/build/_internal.js +16 -0
- package/build/_internal.js.map +1 -0
- package/build/_private/BluetoothSdkModule.d.ts +172 -0
- package/build/_private/BluetoothSdkModule.d.ts.map +1 -0
- package/build/_private/BluetoothSdkModule.js +300 -0
- package/build/_private/BluetoothSdkModule.js.map +1 -0
- package/build/_private/LocalNetworkModule.d.ts +38 -0
- package/build/_private/LocalNetworkModule.d.ts.map +1 -0
- package/build/_private/LocalNetworkModule.js +3 -0
- package/build/_private/LocalNetworkModule.js.map +1 -0
- package/build/_private/cameraRequestPayload.d.ts +4 -0
- package/build/_private/cameraRequestPayload.d.ts.map +1 -0
- package/build/_private/cameraRequestPayload.js +32 -0
- package/build/_private/cameraRequestPayload.js.map +1 -0
- package/build/_private/photoRequestPayload.d.ts +6 -0
- package/build/_private/photoRequestPayload.d.ts.map +1 -0
- package/build/_private/photoRequestPayload.js +86 -0
- package/build/_private/photoRequestPayload.js.map +1 -0
- package/build/_private/sdkOtaManifest.d.ts +11 -0
- package/build/_private/sdkOtaManifest.d.ts.map +1 -0
- package/build/_private/sdkOtaManifest.js +15 -0
- package/build/_private/sdkOtaManifest.js.map +1 -0
- package/build/changelogs.d.ts +7 -0
- package/build/changelogs.d.ts.map +1 -0
- package/build/changelogs.js +46 -0
- package/build/changelogs.js.map +1 -0
- package/build/debug.d.ts +3 -0
- package/build/debug.d.ts.map +1 -0
- package/build/debug.js +8 -0
- package/build/debug.js.map +1 -0
- package/build/generated/changelogCatalog.d.ts +9 -0
- package/build/generated/changelogCatalog.d.ts.map +1 -0
- package/build/generated/changelogCatalog.js +12 -0
- package/build/generated/changelogCatalog.js.map +1 -0
- package/build/generated/releaseMetadata.d.ts +12 -0
- package/build/generated/releaseMetadata.d.ts.map +1 -0
- package/build/generated/releaseMetadata.js +10 -0
- package/build/generated/releaseMetadata.js.map +1 -0
- package/build/index.d.ts +6 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +171 -0
- package/build/index.js.map +1 -0
- package/build/ota-server/OtaServer.types.d.ts +14 -0
- package/build/ota-server/OtaServer.types.d.ts.map +1 -0
- package/build/ota-server/OtaServer.types.js +2 -0
- package/build/ota-server/OtaServer.types.js.map +1 -0
- package/build/ota-server/OtaServerModule.d.ts +21 -0
- package/build/ota-server/OtaServerModule.d.ts.map +1 -0
- package/build/ota-server/OtaServerModule.js +3 -0
- package/build/ota-server/OtaServerModule.js.map +1 -0
- package/build/ota-server/OtaServerModule.web.d.ts +10 -0
- package/build/ota-server/OtaServerModule.web.d.ts.map +1 -0
- package/build/ota-server/OtaServerModule.web.js +12 -0
- package/build/ota-server/OtaServerModule.web.js.map +1 -0
- package/build/ota-server/index.d.ts +3 -0
- package/build/ota-server/index.d.ts.map +1 -0
- package/build/ota-server/index.js +3 -0
- package/build/ota-server/index.js.map +1 -0
- package/build/ota-transport/index.d.ts +67 -0
- package/build/ota-transport/index.d.ts.map +1 -0
- package/build/ota-transport/index.js +58 -0
- package/build/ota-transport/index.js.map +1 -0
- package/build/photo-receiver/PhotoReceiver.types.d.ts +18 -0
- package/build/photo-receiver/PhotoReceiver.types.d.ts.map +1 -0
- package/build/photo-receiver/PhotoReceiver.types.js +2 -0
- package/build/photo-receiver/PhotoReceiver.types.js.map +1 -0
- package/build/photo-receiver/PhotoReceiverModule.d.ts +10 -0
- package/build/photo-receiver/PhotoReceiverModule.d.ts.map +1 -0
- package/build/photo-receiver/PhotoReceiverModule.js +3 -0
- package/build/photo-receiver/PhotoReceiverModule.js.map +1 -0
- package/build/photo-receiver/PhotoReceiverModule.web.d.ts +10 -0
- package/build/photo-receiver/PhotoReceiverModule.web.d.ts.map +1 -0
- package/build/photo-receiver/PhotoReceiverModule.web.js +12 -0
- package/build/photo-receiver/PhotoReceiverModule.web.js.map +1 -0
- package/build/photo-receiver/index.d.ts +3 -0
- package/build/photo-receiver/index.d.ts.map +1 -0
- package/build/photo-receiver/index.js +3 -0
- package/build/photo-receiver/index.js.map +1 -0
- package/build/react/index.d.ts +5 -0
- package/build/react/index.d.ts.map +1 -0
- package/build/react/index.js +4 -0
- package/build/react/index.js.map +1 -0
- package/build/react/useBluetooth.d.ts +100 -0
- package/build/react/useBluetooth.d.ts.map +1 -0
- package/build/react/useBluetooth.js +167 -0
- package/build/react/useBluetooth.js.map +1 -0
- package/build/react/useBluetoothEvent.d.ts +6 -0
- package/build/react/useBluetoothEvent.d.ts.map +1 -0
- package/build/react/useBluetoothEvent.js +21 -0
- package/build/react/useBluetoothEvent.js.map +1 -0
- package/build/react/useBluetoothScan.d.ts +22 -0
- package/build/react/useBluetoothScan.d.ts.map +1 -0
- package/build/react/useBluetoothScan.js +135 -0
- package/build/react/useBluetoothScan.js.map +1 -0
- package/build/react/useBluetoothStatus.d.ts +16 -0
- package/build/react/useBluetoothStatus.d.ts.map +1 -0
- package/build/react/useBluetoothStatus.js +137 -0
- package/build/react/useBluetoothStatus.js.map +1 -0
- package/build/react/useGlassesConnection.d.ts +29 -0
- package/build/react/useGlassesConnection.d.ts.map +1 -0
- package/build/react/useGlassesConnection.js +153 -0
- package/build/react/useGlassesConnection.js.map +1 -0
- package/build/types/index.d.ts +3 -0
- package/build/types/index.d.ts.map +1 -0
- package/build/types/index.js +2 -0
- package/build/types/index.js.map +1 -0
- package/expo-module.config.json +14 -0
- package/ios/BackgroundOtaArtifactDownloader.swift +125 -0
- package/ios/BluetoothSdkModule.swift +1034 -0
- package/ios/GlasslyBluetoothSDK.podspec +106 -0
- package/ios/LocalIPv4.swift +150 -0
- package/ios/LocalOtaServer.swift +309 -0
- package/ios/LocalPhotoUploadServer.swift +754 -0
- package/ios/OtaServerModule.swift +147 -0
- package/ios/Packages/CoreObjC/CoreObjC.xcodeproj/project.pbxproj +213 -0
- package/ios/Packages/CoreObjC/PcmConverter.h +22 -0
- package/ios/Packages/CoreObjC/PcmConverter.m +266 -0
- package/ios/Packages/CoreObjC/attdet.c +92 -0
- package/ios/Packages/CoreObjC/attdet.h +44 -0
- package/ios/Packages/CoreObjC/bits.c +375 -0
- package/ios/Packages/CoreObjC/bits.h +315 -0
- package/ios/Packages/CoreObjC/bwdet.c +129 -0
- package/ios/Packages/CoreObjC/bwdet.h +69 -0
- package/ios/Packages/CoreObjC/common.h +151 -0
- package/ios/Packages/CoreObjC/energy.c +70 -0
- package/ios/Packages/CoreObjC/energy.h +43 -0
- package/ios/Packages/CoreObjC/fastmath.h +158 -0
- package/ios/Packages/CoreObjC/include/PcmConverter.h +22 -0
- package/ios/Packages/CoreObjC/lc3.c +704 -0
- package/ios/Packages/CoreObjC/lc3.h +313 -0
- package/ios/Packages/CoreObjC/lc3_cpp.h +283 -0
- package/ios/Packages/CoreObjC/lc3_private.h +163 -0
- package/ios/Packages/CoreObjC/ltpf.c +905 -0
- package/ios/Packages/CoreObjC/ltpf.h +111 -0
- package/ios/Packages/CoreObjC/ltpf_arm.h +506 -0
- package/ios/Packages/CoreObjC/ltpf_neon.h +281 -0
- package/ios/Packages/CoreObjC/makefile.mk +35 -0
- package/ios/Packages/CoreObjC/mdct.c +469 -0
- package/ios/Packages/CoreObjC/mdct.h +57 -0
- package/ios/Packages/CoreObjC/mdct_neon.h +296 -0
- package/ios/Packages/CoreObjC/meson.build +61 -0
- package/ios/Packages/CoreObjC/plc.c +61 -0
- package/ios/Packages/CoreObjC/plc.h +57 -0
- package/ios/Packages/CoreObjC/rnnoise.h +114 -0
- package/ios/Packages/CoreObjC/sns.c +880 -0
- package/ios/Packages/CoreObjC/sns.h +103 -0
- package/ios/Packages/CoreObjC/spec.c +907 -0
- package/ios/Packages/CoreObjC/spec.h +119 -0
- package/ios/Packages/CoreObjC/tables.c +3457 -0
- package/ios/Packages/CoreObjC/tables.h +94 -0
- package/ios/Packages/CoreObjC/tns.c +457 -0
- package/ios/Packages/CoreObjC/tns.h +99 -0
- package/ios/Packages/SherpaOnnx/Model/joiner.onnx +0 -0
- package/ios/Packages/SherpaOnnx/Model/tokens.txt +502 -0
- package/ios/Packages/SherpaOnnx/SherpaOnnx.swift +2383 -0
- package/ios/Packages/SherpaOnnx/sherpa-onnx.xcframework/Info.plist +48 -0
- package/ios/Packages/SherpaOnnx/sherpa-onnx.xcframework/ios-arm64/Headers/sherpa-onnx/c-api/c-api.h +4689 -0
- package/ios/Packages/SherpaOnnx/sherpa-onnx.xcframework/ios-arm64/Headers/sherpa-onnx/c-api/cxx-api.h +2036 -0
- package/ios/Packages/SherpaOnnx/sherpa-onnx.xcframework/ios-arm64/libsherpa-onnx.a +0 -0
- package/ios/Packages/SherpaOnnx/sherpa-onnx.xcframework/ios-arm64_x86_64-simulator/Headers/sherpa-onnx/c-api/c-api.h +4689 -0
- package/ios/Packages/SherpaOnnx/sherpa-onnx.xcframework/ios-arm64_x86_64-simulator/Headers/sherpa-onnx/c-api/cxx-api.h +2036 -0
- package/ios/Packages/SherpaOnnx/sherpa-onnx.xcframework/ios-arm64_x86_64-simulator/libsherpa-onnx.a +0 -0
- package/ios/Packages/libbz2/module.modulemap +5 -0
- package/ios/Packages/libbz2/shim.h +1 -0
- package/ios/PhotoReceiverModule.swift +129 -0
- package/ios/Source/BluetoothSDK.swift +2303 -0
- package/ios/Source/BluetoothSDKDebug.swift +12 -0
- package/ios/Source/BluetoothSdkDefaults.swift +29 -0
- package/ios/Source/Bridge.swift +708 -0
- package/ios/Source/Bridging-Header.h +16 -0
- package/ios/Source/DeviceManager.swift +2109 -0
- package/ios/Source/DeviceStore.swift +336 -0
- package/ios/Source/GeneratedChangelogCatalog.swift +7 -0
- package/ios/Source/GeneratedReleaseMetadata.swift +11 -0
- package/ios/Source/ObservableStore.swift +118 -0
- package/ios/Source/OtaManifest.swift +211 -0
- package/ios/Source/PrivacyInfo.xcprivacy +23 -0
- package/ios/Source/ReleaseChangelog.swift +65 -0
- package/ios/Source/Resources/G2Firmware/README.md +10 -0
- package/ios/Source/audio/AudioModels.swift +178 -0
- package/ios/Source/audio/PcmStreamPlayer.swift +410 -0
- package/ios/Source/camera/CameraModels.swift +866 -0
- package/ios/Source/connection/ScanSession.swift +27 -0
- package/ios/Source/controllers/ControllerManager.swift +184 -0
- package/ios/Source/controllers/R1.swift +829 -0
- package/ios/Source/errors/BluetoothSdkError.swift +19 -0
- package/ios/Source/events/BluetoothEvents.swift +342 -0
- package/ios/Source/internal/BleTraceLogger.swift +192 -0
- package/ios/Source/internal/BluetoothAvailability.swift +78 -0
- package/ios/Source/internal/BluetoothSdkAnalytics.swift +199 -0
- package/ios/Source/internal/ValueParsing.swift +99 -0
- package/ios/Source/requests/DisplayRequests.swift +82 -0
- package/ios/Source/services/PhoneMic.swift +662 -0
- package/ios/Source/sgcs/Ar99.swift +2451 -0
- package/ios/Source/sgcs/Frame.swift +649 -0
- package/ios/Source/sgcs/G1.swift +2554 -0
- package/ios/Source/sgcs/G2.swift +6887 -0
- package/ios/Source/sgcs/G2CfwClassification.swift +43 -0
- package/ios/Source/sgcs/G2CfwRenderer.swift +1279 -0
- package/ios/Source/sgcs/G2CfwTextureCache.swift +233 -0
- package/ios/Source/sgcs/G2FlashProtocol.swift +312 -0
- package/ios/Source/sgcs/G2Flasher.swift +773 -0
- package/ios/Source/sgcs/Mach1.swift +541 -0
- package/ios/Source/sgcs/MentraLive.swift +7011 -0
- package/ios/Source/sgcs/MentraLiveL2capChannel.swift +183 -0
- package/ios/Source/sgcs/MentraLivePairingAdvertisement.swift +64 -0
- package/ios/Source/sgcs/MentraNex.swift +3221 -0
- package/ios/Source/sgcs/Nimo.swift +1886 -0
- package/ios/Source/sgcs/SGCManager.swift +608 -0
- package/ios/Source/sgcs/Simulated.swift +274 -0
- package/ios/Source/sgcs/ar99/ota/Ar99OtaManager.swift +637 -0
- package/ios/Source/sgcs/glassly_ble.pb.swift +4354 -0
- package/ios/Source/speakerid/SpeakerIdEngine.swift +573 -0
- package/ios/Source/status/DeviceStatus.swift +981 -0
- package/ios/Source/status/RuntimeState.swift +359 -0
- package/ios/Source/status/WifiHotspotStatus.swift +345 -0
- package/ios/Source/streaming/StreamModels.swift +693 -0
- package/ios/Source/stt/STTTools.swift +191 -0
- package/ios/Source/stt/SherpaOnnxTranscriber.swift +466 -0
- package/ios/Source/tts/TTSTools.swift +171 -0
- package/ios/Source/types/DeviceModels.swift +177 -0
- package/ios/Source/utils/AudioSessionMonitor.swift +283 -0
- package/ios/Source/utils/BinaryCodec.swift +61 -0
- package/ios/Source/utils/BleJsonCompact.swift +405 -0
- package/ios/Source/utils/BleWireProtocol.swift +92 -0
- package/ios/Source/utils/Constants.swift +78 -0
- package/ios/Source/utils/Enums.swift +95 -0
- package/ios/Source/utils/G1Text.swift +2096 -0
- package/ios/Source/utils/JSCExperiment.swift +241 -0
- package/ios/Source/utils/MemoryMonitor.swift +44 -0
- package/ios/Source/utils/MessageChunkReassembler.swift +190 -0
- package/ios/Source/utils/MessageChunker.swift +294 -0
- package/ios/Source/utils/Models.swift +135 -0
- package/ios/Source/utils/PhoneAudioMonitor.swift +230 -0
- package/ios/Source/utils/TarBz2Extractor.swift +257 -0
- package/ios/Tests/BluetoothSDKTests/G2CfwClassificationTests.swift +78 -0
- package/ios/Tests/BluetoothSDKTests/G2CfwRendererTests.swift +372 -0
- package/ios/Tests/BluetoothSDKTests/G2CfwTextureCacheTests.swift +162 -0
- package/ios/Tests/BluetoothSDKTests/G2FlashProtocolTests.swift +182 -0
- package/ios/Tests/MentraLivePairingAdvertisementTests.swift +160 -0
- package/ios/Tests/ReleaseChangelogTests.swift +13 -0
- package/package.json +129 -0
- package/plugin/build/index.d.ts +10 -0
- package/plugin/build/index.js +12 -0
- package/plugin/build/withAndroid.d.ts +3 -0
- package/plugin/build/withAndroid.js +190 -0
- package/plugin/build/withIos.d.ts +5 -0
- package/plugin/build/withIos.js +108 -0
- package/scripts/inject-ios-sdk-version.mjs +65 -0
- package/scripts/public-ota-api.test.mjs +37 -0
- package/scripts/verify-release-package.mjs +45 -0
- package/scripts/write-release-metadata.mjs +152 -0
- package/scripts/write-release-metadata.test.mjs +37 -0
- package/src/BluetoothSdk.types.ts +1623 -0
- package/src/_internal.ts +16 -0
- package/src/_private/BluetoothSdkModule.ts +684 -0
- package/src/_private/LocalNetworkModule.ts +50 -0
- package/src/_private/cameraRequestPayload.ts +34 -0
- package/src/_private/photoRequestPayload.ts +90 -0
- package/src/_private/sdkOtaManifest.ts +18 -0
- package/src/changelogs.ts +46 -0
- package/src/debug.ts +9 -0
- package/src/generated/changelogCatalog.ts +13 -0
- package/src/generated/releaseMetadata.ts +20 -0
- package/src/index.ts +321 -0
- package/src/ota-server/OtaServer.types.ts +10 -0
- package/src/ota-server/OtaServerModule.ts +23 -0
- package/src/ota-server/OtaServerModule.web.ts +17 -0
- package/src/ota-server/index.ts +2 -0
- package/src/ota-transport/index.ts +116 -0
- package/src/photo-receiver/PhotoReceiver.types.ts +20 -0
- package/src/photo-receiver/PhotoReceiverModule.ts +11 -0
- package/src/photo-receiver/PhotoReceiverModule.web.ts +17 -0
- package/src/photo-receiver/index.ts +2 -0
- package/src/react/index.ts +21 -0
- package/src/react/useBluetooth.ts +309 -0
- package/src/react/useBluetoothEvent.ts +35 -0
- package/src/react/useBluetoothScan.ts +173 -0
- package/src/react/useBluetoothStatus.ts +180 -0
- package/src/react/useGlassesConnection.ts +202 -0
- package/src/types/index.ts +12 -0
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/******************************************************************************
|
|
2
|
+
*
|
|
3
|
+
* Copyright 2022 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at:
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*
|
|
17
|
+
******************************************************************************/
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* LC3 - Long Term Postfilter
|
|
21
|
+
*
|
|
22
|
+
* Reference : Low Complexity Communication Codec (LC3)
|
|
23
|
+
* Bluetooth Specification v1.0
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
#ifndef __LC3_LTPF_H
|
|
27
|
+
#define __LC3_LTPF_H
|
|
28
|
+
|
|
29
|
+
#include "common.h"
|
|
30
|
+
#include "bits.h"
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* LTPF data
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
typedef struct lc3_ltpf_data {
|
|
38
|
+
bool active;
|
|
39
|
+
int pitch_index;
|
|
40
|
+
} lc3_ltpf_data_t;
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
/* ----------------------------------------------------------------------------
|
|
44
|
+
* Encoding
|
|
45
|
+
* -------------------------------------------------------------------------- */
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* LTPF analysis
|
|
49
|
+
* dt, sr Duration and samplerate of the frame
|
|
50
|
+
* ltpf Context of analysis
|
|
51
|
+
* allowed True when activation of LTPF is allowed
|
|
52
|
+
* x [-d..-1] Previous, [0..ns-1] Current samples
|
|
53
|
+
* data Return bitstream data
|
|
54
|
+
* return True when pitch present, False otherwise
|
|
55
|
+
*
|
|
56
|
+
* The `x` vector is aligned on 32 bits
|
|
57
|
+
* The number of previous samples `d` accessed on `x` is :
|
|
58
|
+
* d: { 10, 20, 30, 40, 60 } - 1 for samplerates from 8KHz to 48KHz
|
|
59
|
+
*/
|
|
60
|
+
bool lc3_ltpf_analyse(enum lc3_dt dt, enum lc3_srate sr,
|
|
61
|
+
lc3_ltpf_analysis_t *ltpf, const int16_t *x, lc3_ltpf_data_t *data);
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* LTPF disable
|
|
65
|
+
* data LTPF data, disabled activation on return
|
|
66
|
+
*/
|
|
67
|
+
void lc3_ltpf_disable(lc3_ltpf_data_t *data);
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Return number of bits coding the bitstream data
|
|
71
|
+
* pitch True when pitch present, False otherwise
|
|
72
|
+
* return Bit consumption, including the pitch present flag
|
|
73
|
+
*/
|
|
74
|
+
int lc3_ltpf_get_nbits(bool pitch);
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Put bitstream data
|
|
78
|
+
* bits Bitstream context
|
|
79
|
+
* data LTPF data
|
|
80
|
+
*/
|
|
81
|
+
void lc3_ltpf_put_data(lc3_bits_t *bits, const lc3_ltpf_data_t *data);
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
/* ----------------------------------------------------------------------------
|
|
85
|
+
* Decoding
|
|
86
|
+
* -------------------------------------------------------------------------- */
|
|
87
|
+
/**
|
|
88
|
+
* Get bitstream data
|
|
89
|
+
* bits Bitstream context
|
|
90
|
+
* data Return bitstream data
|
|
91
|
+
*/
|
|
92
|
+
void lc3_ltpf_get_data(lc3_bits_t *bits, lc3_ltpf_data_t *data);
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* LTPF synthesis
|
|
96
|
+
* dt, sr Duration and samplerate of the frame
|
|
97
|
+
* nbytes Size in bytes of the frame
|
|
98
|
+
* ltpf Context of synthesis
|
|
99
|
+
* data Bitstream data, NULL when pitch not present
|
|
100
|
+
* xr Base address of ring buffer of decoded samples
|
|
101
|
+
* x Samples to proceed in the ring buffer, filtered as output
|
|
102
|
+
*
|
|
103
|
+
* The size of the ring buffer is `nh + ns`.
|
|
104
|
+
* The filtering needs an history of at least 18 ms.
|
|
105
|
+
*/
|
|
106
|
+
void lc3_ltpf_synthesize(enum lc3_dt dt, enum lc3_srate sr, int nbytes,
|
|
107
|
+
lc3_ltpf_synthesis_t *ltpf, const lc3_ltpf_data_t *data,
|
|
108
|
+
const float *xr, float *x);
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
#endif /* __LC3_LTPF_H */
|
|
@@ -0,0 +1,506 @@
|
|
|
1
|
+
/******************************************************************************
|
|
2
|
+
*
|
|
3
|
+
* Copyright 2022 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at:
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*
|
|
17
|
+
******************************************************************************/
|
|
18
|
+
|
|
19
|
+
#if __ARM_FEATURE_SIMD32 || defined(TEST_ARM)
|
|
20
|
+
|
|
21
|
+
#ifndef TEST_ARM
|
|
22
|
+
|
|
23
|
+
#include <arm_acle.h>
|
|
24
|
+
|
|
25
|
+
static inline int16x2_t __pkhbt(int16x2_t a, int16x2_t b)
|
|
26
|
+
{
|
|
27
|
+
int16x2_t r;
|
|
28
|
+
__asm("pkhbt %0, %1, %2" : "=r" (r) : "r" (a), "r" (b));
|
|
29
|
+
return r;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
#endif /* TEST_ARM */
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Import
|
|
37
|
+
*/
|
|
38
|
+
|
|
39
|
+
static inline int32_t filter_hp50(struct lc3_ltpf_hp50_state *, int32_t);
|
|
40
|
+
static inline float dot(const int16_t *, const int16_t *, int);
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Resample from 8 / 16 / 32 KHz to 12.8 KHz Template
|
|
45
|
+
*/
|
|
46
|
+
#if !defined(resample_8k_12k8) || !defined(resample_16k_12k8) \
|
|
47
|
+
|| !defined(resample_32k_12k8)
|
|
48
|
+
static inline void arm_resample_x64k_12k8(const int p, const int16x2_t *h,
|
|
49
|
+
struct lc3_ltpf_hp50_state *hp50, const int16x2_t *x, int16_t *y, int n)
|
|
50
|
+
{
|
|
51
|
+
const int w = 40 / p;
|
|
52
|
+
|
|
53
|
+
x -= w;
|
|
54
|
+
|
|
55
|
+
for (int i = 0; i < 5*n; i += 5) {
|
|
56
|
+
const int16x2_t *hn = h + (i % (2*p)) * (48 / p);
|
|
57
|
+
const int16x2_t *xn = x + (i / (2*p));
|
|
58
|
+
|
|
59
|
+
int32_t un = __smlad(*(xn++), *(hn++), 0);
|
|
60
|
+
|
|
61
|
+
for (int k = 0; k < w; k += 5) {
|
|
62
|
+
un = __smlad(*(xn++), *(hn++), un);
|
|
63
|
+
un = __smlad(*(xn++), *(hn++), un);
|
|
64
|
+
un = __smlad(*(xn++), *(hn++), un);
|
|
65
|
+
un = __smlad(*(xn++), *(hn++), un);
|
|
66
|
+
un = __smlad(*(xn++), *(hn++), un);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
int32_t yn = filter_hp50(hp50, un);
|
|
70
|
+
*(y++) = (yn + (1 << 15)) >> 16;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
#endif
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Resample from 24 / 48 KHz to 12.8 KHz Template
|
|
77
|
+
*/
|
|
78
|
+
#if !defined(resample_24k_12k8) || !defined(resample_48k_12k8)
|
|
79
|
+
static inline void arm_resample_x192k_12k8(const int p, const int16x2_t *h,
|
|
80
|
+
struct lc3_ltpf_hp50_state *hp50, const int16x2_t *x, int16_t *y, int n)
|
|
81
|
+
{
|
|
82
|
+
const int w = 120 / p;
|
|
83
|
+
|
|
84
|
+
x -= w;
|
|
85
|
+
|
|
86
|
+
for (int i = 0; i < 15*n; i += 15) {
|
|
87
|
+
const int16x2_t *hn = h + (i % (2*p)) * (128 / p);
|
|
88
|
+
const int16x2_t *xn = x + (i / (2*p));
|
|
89
|
+
|
|
90
|
+
int32_t un = __smlad(*(xn++), *(hn++), 0);
|
|
91
|
+
|
|
92
|
+
for (int k = 0; k < w; k += 15) {
|
|
93
|
+
un = __smlad(*(xn++), *(hn++), un);
|
|
94
|
+
un = __smlad(*(xn++), *(hn++), un);
|
|
95
|
+
un = __smlad(*(xn++), *(hn++), un);
|
|
96
|
+
un = __smlad(*(xn++), *(hn++), un);
|
|
97
|
+
un = __smlad(*(xn++), *(hn++), un);
|
|
98
|
+
un = __smlad(*(xn++), *(hn++), un);
|
|
99
|
+
un = __smlad(*(xn++), *(hn++), un);
|
|
100
|
+
un = __smlad(*(xn++), *(hn++), un);
|
|
101
|
+
un = __smlad(*(xn++), *(hn++), un);
|
|
102
|
+
un = __smlad(*(xn++), *(hn++), un);
|
|
103
|
+
un = __smlad(*(xn++), *(hn++), un);
|
|
104
|
+
un = __smlad(*(xn++), *(hn++), un);
|
|
105
|
+
un = __smlad(*(xn++), *(hn++), un);
|
|
106
|
+
un = __smlad(*(xn++), *(hn++), un);
|
|
107
|
+
un = __smlad(*(xn++), *(hn++), un);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
int32_t yn = filter_hp50(hp50, un);
|
|
111
|
+
*(y++) = (yn + (1 << 15)) >> 16;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
#endif
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Resample from 8 Khz to 12.8 KHz
|
|
118
|
+
*/
|
|
119
|
+
#ifndef resample_8k_12k8
|
|
120
|
+
|
|
121
|
+
static void arm_resample_8k_12k8(
|
|
122
|
+
struct lc3_ltpf_hp50_state *hp50, const int16_t *x, int16_t *y, int n)
|
|
123
|
+
{
|
|
124
|
+
static const int16_t alignas(int32_t) h[2*8*12] = {
|
|
125
|
+
0, 214, 417, -1052, -4529, 26233, -4529, -1052, 417, 214, 0, 0,
|
|
126
|
+
0, 180, 0, -1522, -2427, 24506, -5289, 0, 763, 156, -28, 0,
|
|
127
|
+
0, 92, -323, -1361, 0, 19741, -3885, 1317, 861, 0, -61, 0,
|
|
128
|
+
0, 0, -457, -752, 1873, 13068, 0, 2389, 598, -213, -79, 0,
|
|
129
|
+
0, -61, -398, 0, 2686, 5997, 5997, 2686, 0, -398, -61, 0,
|
|
130
|
+
0, -79, -213, 598, 2389, 0, 13068, 1873, -752, -457, 0, 0,
|
|
131
|
+
0, -61, 0, 861, 1317, -3885, 19741, 0, -1361, -323, 92, 0,
|
|
132
|
+
0, -28, 156, 763, 0, -5289, 24506, -2427, -1522, 0, 180, 0,
|
|
133
|
+
0, 0, 214, 417, -1052, -4529, 26233, -4529, -1052, 417, 214, 0,
|
|
134
|
+
0, 0, 180, 0, -1522, -2427, 24506, -5289, 0, 763, 156, -28,
|
|
135
|
+
0, 0, 92, -323, -1361, 0, 19741, -3885, 1317, 861, 0, -61,
|
|
136
|
+
0, 0, 0, -457, -752, 1873, 13068, 0, 2389, 598, -213, -79,
|
|
137
|
+
0, 0, -61, -398, 0, 2686, 5997, 5997, 2686, 0, -398, -61,
|
|
138
|
+
0, 0, -79, -213, 598, 2389, 0, 13068, 1873, -752, -457, 0,
|
|
139
|
+
0, 0, -61, 0, 861, 1317, -3885, 19741, 0, -1361, -323, 92,
|
|
140
|
+
0, 0, -28, 156, 763, 0, -5289, 24506, -2427, -1522, 0, 180,
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
arm_resample_x64k_12k8(
|
|
144
|
+
8, (const int16x2_t *)h, hp50, (int16x2_t *)x, y, n);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
#ifndef TEST_ARM
|
|
148
|
+
#define resample_8k_12k8 arm_resample_8k_12k8
|
|
149
|
+
#endif
|
|
150
|
+
|
|
151
|
+
#endif /* resample_8k_12k8 */
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Resample from 16 Khz to 12.8 KHz
|
|
155
|
+
*/
|
|
156
|
+
#ifndef resample_16k_12k8
|
|
157
|
+
|
|
158
|
+
static void arm_resample_16k_12k8(
|
|
159
|
+
struct lc3_ltpf_hp50_state *hp50, const int16_t *x, int16_t *y, int n)
|
|
160
|
+
{
|
|
161
|
+
static const int16_t alignas(int32_t) h[2*4*24] = {
|
|
162
|
+
|
|
163
|
+
0, -61, 214, -398, 417, 0, -1052, 2686,
|
|
164
|
+
-4529, 5997, 26233, 5997, -4529, 2686, -1052, 0,
|
|
165
|
+
417, -398, 214, -61, 0, 0, 0, 0,
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
0, -79, 180, -213, 0, 598, -1522, 2389,
|
|
169
|
+
-2427, 0, 24506, 13068, -5289, 1873, 0, -752,
|
|
170
|
+
763, -457, 156, 0, -28, 0, 0, 0,
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
0, -61, 92, 0, -323, 861, -1361, 1317,
|
|
174
|
+
0, -3885, 19741, 19741, -3885, 0, 1317, -1361,
|
|
175
|
+
861, -323, 0, 92, -61, 0, 0, 0,
|
|
176
|
+
|
|
177
|
+
0, -28, 0, 156, -457, 763, -752, 0,
|
|
178
|
+
1873, -5289, 13068, 24506, 0, -2427, 2389, -1522,
|
|
179
|
+
598, 0, -213, 180, -79, 0, 0, 0,
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
0, 0, -61, 214, -398, 417, 0, -1052,
|
|
183
|
+
2686, -4529, 5997, 26233, 5997, -4529, 2686, -1052,
|
|
184
|
+
0, 417, -398, 214, -61, 0, 0, 0,
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
0, 0, -79, 180, -213, 0, 598, -1522,
|
|
188
|
+
2389, -2427, 0, 24506, 13068, -5289, 1873, 0,
|
|
189
|
+
-752, 763, -457, 156, 0, -28, 0, 0,
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
0, 0, -61, 92, 0, -323, 861, -1361,
|
|
193
|
+
1317, 0, -3885, 19741, 19741, -3885, 0, 1317,
|
|
194
|
+
-1361, 861, -323, 0, 92, -61, 0, 0,
|
|
195
|
+
|
|
196
|
+
0, 0, -28, 0, 156, -457, 763, -752,
|
|
197
|
+
0, 1873, -5289, 13068, 24506, 0, -2427, 2389,
|
|
198
|
+
-1522, 598, 0, -213, 180, -79, 0, 0,
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
arm_resample_x64k_12k8(
|
|
202
|
+
4, (const int16x2_t *)h, hp50, (int16x2_t *)x, y, n);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
#ifndef TEST_ARM
|
|
206
|
+
#define resample_16k_12k8 arm_resample_16k_12k8
|
|
207
|
+
#endif
|
|
208
|
+
|
|
209
|
+
#endif /* resample_16k_12k8 */
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Resample from 32 Khz to 12.8 KHz
|
|
213
|
+
*/
|
|
214
|
+
#ifndef resample_32k_12k8
|
|
215
|
+
|
|
216
|
+
static void arm_resample_32k_12k8(
|
|
217
|
+
struct lc3_ltpf_hp50_state *hp50, const int16_t *x, int16_t *y, int n)
|
|
218
|
+
{
|
|
219
|
+
static const int16_t alignas(int32_t) h[2*2*48] = {
|
|
220
|
+
|
|
221
|
+
0, -30, -31, 46, 107, 0, -199, -162,
|
|
222
|
+
209, 430, 0, -681, -526, 658, 1343, 0,
|
|
223
|
+
-2264, -1943, 2999, 9871, 13116, 9871, 2999, -1943,
|
|
224
|
+
-2264, 0, 1343, 658, -526, -681, 0, 430,
|
|
225
|
+
209, -162, -199, 0, 107, 46, -31, -30,
|
|
226
|
+
0, 0, 0, 0, 0, 0, 0, 0,
|
|
227
|
+
|
|
228
|
+
0, -14, -39, 0, 90, 78, -106, -229,
|
|
229
|
+
0, 382, 299, -376, -761, 0, 1194, 937,
|
|
230
|
+
-1214, -2644, 0, 6534, 12253, 12253, 6534, 0,
|
|
231
|
+
-2644, -1214, 937, 1194, 0, -761, -376, 299,
|
|
232
|
+
382, 0, -229, -106, 78, 90, 0, -39,
|
|
233
|
+
-14, 0, 0, 0, 0, 0, 0, 0,
|
|
234
|
+
|
|
235
|
+
0, 0, -30, -31, 46, 107, 0, -199,
|
|
236
|
+
-162, 209, 430, 0, -681, -526, 658, 1343,
|
|
237
|
+
0, -2264, -1943, 2999, 9871, 13116, 9871, 2999,
|
|
238
|
+
-1943, -2264, 0, 1343, 658, -526, -681, 0,
|
|
239
|
+
430, 209, -162, -199, 0, 107, 46, -31,
|
|
240
|
+
-30, 0, 0, 0, 0, 0, 0, 0,
|
|
241
|
+
|
|
242
|
+
0, 0, -14, -39, 0, 90, 78, -106,
|
|
243
|
+
-229, 0, 382, 299, -376, -761, 0, 1194,
|
|
244
|
+
937, -1214, -2644, 0, 6534, 12253, 12253, 6534,
|
|
245
|
+
0, -2644, -1214, 937, 1194, 0, -761, -376,
|
|
246
|
+
299, 382, 0, -229, -106, 78, 90, 0,
|
|
247
|
+
-39, -14, 0, 0, 0, 0, 0, 0,
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
arm_resample_x64k_12k8(
|
|
251
|
+
2, (const int16x2_t *)h, hp50, (int16x2_t *)x, y, n);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
#ifndef TEST_ARM
|
|
255
|
+
#define resample_32k_12k8 arm_resample_32k_12k8
|
|
256
|
+
#endif
|
|
257
|
+
|
|
258
|
+
#endif /* resample_32k_12k8 */
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* Resample from 24 Khz to 12.8 KHz
|
|
262
|
+
*/
|
|
263
|
+
#ifndef resample_24k_12k8
|
|
264
|
+
|
|
265
|
+
static void arm_resample_24k_12k8(
|
|
266
|
+
struct lc3_ltpf_hp50_state *hp50, const int16_t *x, int16_t *y, int n)
|
|
267
|
+
{
|
|
268
|
+
static const int16_t alignas(int32_t) h[2*8*32] = {
|
|
269
|
+
|
|
270
|
+
0, -50, 19, 143, -93, -290, 278, 485,
|
|
271
|
+
-658, -701, 1396, 901, -3019, -1042, 10276, 17488,
|
|
272
|
+
10276, -1042, -3019, 901, 1396, -701, -658, 485,
|
|
273
|
+
278, -290, -93, 143, 19, -50, 0, 0,
|
|
274
|
+
|
|
275
|
+
0, -46, 0, 141, -45, -305, 185, 543,
|
|
276
|
+
-501, -854, 1153, 1249, -2619, -1908, 8712, 17358,
|
|
277
|
+
11772, 0, -3319, 480, 1593, -504, -796, 399,
|
|
278
|
+
367, -261, -142, 138, 40, -52, -5, 0,
|
|
279
|
+
|
|
280
|
+
0, -41, -17, 133, 0, -304, 91, 574,
|
|
281
|
+
-334, -959, 878, 1516, -2143, -2590, 7118, 16971,
|
|
282
|
+
13161, 1202, -3495, 0, 1731, -267, -908, 287,
|
|
283
|
+
445, -215, -188, 125, 62, -52, -12, 0,
|
|
284
|
+
|
|
285
|
+
0, -34, -30, 120, 41, -291, 0, 577,
|
|
286
|
+
-164, -1015, 585, 1697, -1618, -3084, 5534, 16337,
|
|
287
|
+
14406, 2544, -3526, -523, 1800, 0, -985, 152,
|
|
288
|
+
509, -156, -230, 104, 83, -48, -19, 0,
|
|
289
|
+
|
|
290
|
+
0, -26, -41, 103, 76, -265, -83, 554,
|
|
291
|
+
0, -1023, 288, 1791, -1070, -3393, 3998, 15474,
|
|
292
|
+
15474, 3998, -3393, -1070, 1791, 288, -1023, 0,
|
|
293
|
+
554, -83, -265, 76, 103, -41, -26, 0,
|
|
294
|
+
|
|
295
|
+
0, -19, -48, 83, 104, -230, -156, 509,
|
|
296
|
+
152, -985, 0, 1800, -523, -3526, 2544, 14406,
|
|
297
|
+
16337, 5534, -3084, -1618, 1697, 585, -1015, -164,
|
|
298
|
+
577, 0, -291, 41, 120, -30, -34, 0,
|
|
299
|
+
|
|
300
|
+
0, -12, -52, 62, 125, -188, -215, 445,
|
|
301
|
+
287, -908, -267, 1731, 0, -3495, 1202, 13161,
|
|
302
|
+
16971, 7118, -2590, -2143, 1516, 878, -959, -334,
|
|
303
|
+
574, 91, -304, 0, 133, -17, -41, 0,
|
|
304
|
+
|
|
305
|
+
0, -5, -52, 40, 138, -142, -261, 367,
|
|
306
|
+
399, -796, -504, 1593, 480, -3319, 0, 11772,
|
|
307
|
+
17358, 8712, -1908, -2619, 1249, 1153, -854, -501,
|
|
308
|
+
543, 185, -305, -45, 141, 0, -46, 0,
|
|
309
|
+
|
|
310
|
+
0, 0, -50, 19, 143, -93, -290, 278,
|
|
311
|
+
485, -658, -701, 1396, 901, -3019, -1042, 10276,
|
|
312
|
+
17488, 10276, -1042, -3019, 901, 1396, -701, -658,
|
|
313
|
+
485, 278, -290, -93, 143, 19, -50, 0,
|
|
314
|
+
|
|
315
|
+
0, 0, -46, 0, 141, -45, -305, 185,
|
|
316
|
+
543, -501, -854, 1153, 1249, -2619, -1908, 8712,
|
|
317
|
+
17358, 11772, 0, -3319, 480, 1593, -504, -796,
|
|
318
|
+
399, 367, -261, -142, 138, 40, -52, -5,
|
|
319
|
+
|
|
320
|
+
0, 0, -41, -17, 133, 0, -304, 91,
|
|
321
|
+
574, -334, -959, 878, 1516, -2143, -2590, 7118,
|
|
322
|
+
16971, 13161, 1202, -3495, 0, 1731, -267, -908,
|
|
323
|
+
287, 445, -215, -188, 125, 62, -52, -12,
|
|
324
|
+
|
|
325
|
+
0, 0, -34, -30, 120, 41, -291, 0,
|
|
326
|
+
577, -164, -1015, 585, 1697, -1618, -3084, 5534,
|
|
327
|
+
16337, 14406, 2544, -3526, -523, 1800, 0, -985,
|
|
328
|
+
152, 509, -156, -230, 104, 83, -48, -19,
|
|
329
|
+
|
|
330
|
+
0, 0, -26, -41, 103, 76, -265, -83,
|
|
331
|
+
554, 0, -1023, 288, 1791, -1070, -3393, 3998,
|
|
332
|
+
15474, 15474, 3998, -3393, -1070, 1791, 288, -1023,
|
|
333
|
+
0, 554, -83, -265, 76, 103, -41, -26,
|
|
334
|
+
|
|
335
|
+
0, 0, -19, -48, 83, 104, -230, -156,
|
|
336
|
+
509, 152, -985, 0, 1800, -523, -3526, 2544,
|
|
337
|
+
14406, 16337, 5534, -3084, -1618, 1697, 585, -1015,
|
|
338
|
+
-164, 577, 0, -291, 41, 120, -30, -34,
|
|
339
|
+
|
|
340
|
+
0, 0, -12, -52, 62, 125, -188, -215,
|
|
341
|
+
445, 287, -908, -267, 1731, 0, -3495, 1202,
|
|
342
|
+
13161, 16971, 7118, -2590, -2143, 1516, 878, -959,
|
|
343
|
+
-334, 574, 91, -304, 0, 133, -17, -41,
|
|
344
|
+
|
|
345
|
+
0, 0, -5, -52, 40, 138, -142, -261,
|
|
346
|
+
367, 399, -796, -504, 1593, 480, -3319, 0,
|
|
347
|
+
11772, 17358, 8712, -1908, -2619, 1249, 1153, -854,
|
|
348
|
+
-501, 543, 185, -305, -45, 141, 0, -46,
|
|
349
|
+
};
|
|
350
|
+
|
|
351
|
+
arm_resample_x192k_12k8(
|
|
352
|
+
8, (const int16x2_t *)h, hp50, (int16x2_t *)x, y, n);
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
#ifndef TEST_ARM
|
|
356
|
+
#define resample_24k_12k8 arm_resample_24k_12k8
|
|
357
|
+
#endif
|
|
358
|
+
|
|
359
|
+
#endif /* resample_24k_12k8 */
|
|
360
|
+
|
|
361
|
+
/**
|
|
362
|
+
* Resample from 48 Khz to 12.8 KHz
|
|
363
|
+
*/
|
|
364
|
+
#ifndef resample_48k_12k8
|
|
365
|
+
|
|
366
|
+
static void arm_resample_48k_12k8(
|
|
367
|
+
struct lc3_ltpf_hp50_state *hp50, const int16_t *x, int16_t *y, int n)
|
|
368
|
+
{
|
|
369
|
+
static const int16_t alignas(int32_t) h[2*4*64] = {
|
|
370
|
+
|
|
371
|
+
0, -13, -25, -20, 10, 51, 71, 38,
|
|
372
|
+
-47, -133, -145, -42, 139, 277, 242, 0,
|
|
373
|
+
-329, -511, -351, 144, 698, 895, 450, -535,
|
|
374
|
+
-1510, -1697, -521, 1999, 5138, 7737, 8744, 7737,
|
|
375
|
+
5138, 1999, -521, -1697, -1510, -535, 450, 895,
|
|
376
|
+
698, 144, -351, -511, -329, 0, 242, 277,
|
|
377
|
+
139, -42, -145, -133, -47, 38, 71, 51,
|
|
378
|
+
10, -20, -25, -13, 0, 0, 0, 0,
|
|
379
|
+
|
|
380
|
+
0, -9, -23, -24, 0, 41, 71, 52,
|
|
381
|
+
-23, -115, -152, -78, 92, 254, 272, 76,
|
|
382
|
+
-251, -493, -427, 0, 576, 900, 624, -262,
|
|
383
|
+
-1309, -1763, -954, 1272, 4356, 7203, 8679, 8169,
|
|
384
|
+
5886, 2767, 0, -1542, -1660, -809, 240, 848,
|
|
385
|
+
796, 292, -252, -507, -398, -82, 199, 288,
|
|
386
|
+
183, 0, -130, -145, -71, 20, 69, 60,
|
|
387
|
+
20, -15, -26, -17, -3, 0, 0, 0,
|
|
388
|
+
|
|
389
|
+
0, -6, -20, -26, -8, 31, 67, 62,
|
|
390
|
+
0, -94, -152, -108, 45, 223, 287, 143,
|
|
391
|
+
-167, -454, -480, -134, 439, 866, 758, 0,
|
|
392
|
+
-1071, -1748, -1295, 601, 3559, 6580, 8485, 8485,
|
|
393
|
+
6580, 3559, 601, -1295, -1748, -1071, 0, 758,
|
|
394
|
+
866, 439, -134, -480, -454, -167, 143, 287,
|
|
395
|
+
223, 45, -108, -152, -94, 0, 62, 67,
|
|
396
|
+
31, -8, -26, -20, -6, 0, 0, 0,
|
|
397
|
+
|
|
398
|
+
0, -3, -17, -26, -15, 20, 60, 69,
|
|
399
|
+
20, -71, -145, -130, 0, 183, 288, 199,
|
|
400
|
+
-82, -398, -507, -252, 292, 796, 848, 240,
|
|
401
|
+
-809, -1660, -1542, 0, 2767, 5886, 8169, 8679,
|
|
402
|
+
7203, 4356, 1272, -954, -1763, -1309, -262, 624,
|
|
403
|
+
900, 576, 0, -427, -493, -251, 76, 272,
|
|
404
|
+
254, 92, -78, -152, -115, -23, 52, 71,
|
|
405
|
+
41, 0, -24, -23, -9, 0, 0, 0,
|
|
406
|
+
|
|
407
|
+
0, 0, -13, -25, -20, 10, 51, 71,
|
|
408
|
+
38, -47, -133, -145, -42, 139, 277, 242,
|
|
409
|
+
0, -329, -511, -351, 144, 698, 895, 450,
|
|
410
|
+
-535, -1510, -1697, -521, 1999, 5138, 7737, 8744,
|
|
411
|
+
7737, 5138, 1999, -521, -1697, -1510, -535, 450,
|
|
412
|
+
895, 698, 144, -351, -511, -329, 0, 242,
|
|
413
|
+
277, 139, -42, -145, -133, -47, 38, 71,
|
|
414
|
+
51, 10, -20, -25, -13, 0, 0, 0,
|
|
415
|
+
|
|
416
|
+
0, 0, -9, -23, -24, 0, 41, 71,
|
|
417
|
+
52, -23, -115, -152, -78, 92, 254, 272,
|
|
418
|
+
76, -251, -493, -427, 0, 576, 900, 624,
|
|
419
|
+
-262, -1309, -1763, -954, 1272, 4356, 7203, 8679,
|
|
420
|
+
8169, 5886, 2767, 0, -1542, -1660, -809, 240,
|
|
421
|
+
848, 796, 292, -252, -507, -398, -82, 199,
|
|
422
|
+
288, 183, 0, -130, -145, -71, 20, 69,
|
|
423
|
+
60, 20, -15, -26, -17, -3, 0, 0,
|
|
424
|
+
|
|
425
|
+
0, 0, -6, -20, -26, -8, 31, 67,
|
|
426
|
+
62, 0, -94, -152, -108, 45, 223, 287,
|
|
427
|
+
143, -167, -454, -480, -134, 439, 866, 758,
|
|
428
|
+
0, -1071, -1748, -1295, 601, 3559, 6580, 8485,
|
|
429
|
+
8485, 6580, 3559, 601, -1295, -1748, -1071, 0,
|
|
430
|
+
758, 866, 439, -134, -480, -454, -167, 143,
|
|
431
|
+
287, 223, 45, -108, -152, -94, 0, 62,
|
|
432
|
+
67, 31, -8, -26, -20, -6, 0, 0,
|
|
433
|
+
|
|
434
|
+
0, 0, -3, -17, -26, -15, 20, 60,
|
|
435
|
+
69, 20, -71, -145, -130, 0, 183, 288,
|
|
436
|
+
199, -82, -398, -507, -252, 292, 796, 848,
|
|
437
|
+
240, -809, -1660, -1542, 0, 2767, 5886, 8169,
|
|
438
|
+
8679, 7203, 4356, 1272, -954, -1763, -1309, -262,
|
|
439
|
+
624, 900, 576, 0, -427, -493, -251, 76,
|
|
440
|
+
272, 254, 92, -78, -152, -115, -23, 52,
|
|
441
|
+
71, 41, 0, -24, -23, -9, 0, 0,
|
|
442
|
+
};
|
|
443
|
+
|
|
444
|
+
arm_resample_x192k_12k8(
|
|
445
|
+
4, (const int16x2_t *)h, hp50, (int16x2_t *)x, y, n);
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
#ifndef TEST_ARM
|
|
449
|
+
#define resample_48k_12k8 arm_resample_48k_12k8
|
|
450
|
+
#endif
|
|
451
|
+
|
|
452
|
+
#endif /* resample_48k_12k8 */
|
|
453
|
+
|
|
454
|
+
/**
|
|
455
|
+
* Return vector of correlations
|
|
456
|
+
*/
|
|
457
|
+
#ifndef correlate
|
|
458
|
+
|
|
459
|
+
static void arm_correlate(
|
|
460
|
+
const int16_t *a, const int16_t *b, int n, float *y, int nc)
|
|
461
|
+
{
|
|
462
|
+
/* --- Check alignment of `b` --- */
|
|
463
|
+
|
|
464
|
+
if ((uintptr_t)b & 3)
|
|
465
|
+
*(y++) = dot(a, b--, n), nc--;
|
|
466
|
+
|
|
467
|
+
/* --- Processing by pair --- */
|
|
468
|
+
|
|
469
|
+
for ( ; nc >= 2; nc -= 2) {
|
|
470
|
+
const int16x2_t *an = (const int16x2_t *)(a );
|
|
471
|
+
const int16x2_t *bn = (const int16x2_t *)(b--);
|
|
472
|
+
|
|
473
|
+
int16x2_t ax, b0, b1;
|
|
474
|
+
int64_t v0 = 0, v1 = 0;
|
|
475
|
+
|
|
476
|
+
b1 = (int16x2_t)*(b--) << 16;
|
|
477
|
+
|
|
478
|
+
for (int i = 0; i < (n >> 4); i++ )
|
|
479
|
+
for (int j = 0; j < 4; j++) {
|
|
480
|
+
|
|
481
|
+
ax = *(an++), b0 = *(bn++);
|
|
482
|
+
v0 = __smlald (ax, b0, v0);
|
|
483
|
+
v1 = __smlaldx(ax, __pkhbt(b0, b1), v1);
|
|
484
|
+
|
|
485
|
+
ax = *(an++), b1 = *(bn++);
|
|
486
|
+
v0 = __smlald (ax, b1, v0);
|
|
487
|
+
v1 = __smlaldx(ax, __pkhbt(b1, b0), v1);
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
*(y++) = (float)((int32_t)((v0 + (1 << 5)) >> 6));
|
|
491
|
+
*(y++) = (float)((int32_t)((v1 + (1 << 5)) >> 6));
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
/* --- Odd element count --- */
|
|
495
|
+
|
|
496
|
+
if (nc > 0)
|
|
497
|
+
*(y++) = dot(a, b, n);
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
#ifndef TEST_ARM
|
|
501
|
+
#define correlate arm_correlate
|
|
502
|
+
#endif
|
|
503
|
+
|
|
504
|
+
#endif /* correlate */
|
|
505
|
+
|
|
506
|
+
#endif /* __ARM_FEATURE_SIMD32 */
|