@mentra/bluetooth-sdk 0.1.0

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.
Files changed (278) hide show
  1. package/README.md +278 -0
  2. package/android/build.gradle +167 -0
  3. package/android/lc3Lib/CMakeLists.txt +6 -0
  4. package/android/lc3Lib/build.gradle +109 -0
  5. package/android/lc3Lib/proguard-rules.pro +33 -0
  6. package/android/lc3Lib/src/main/AndroidManifest.xml +2 -0
  7. package/android/lc3Lib/src/main/cpp/CMakeLists.txt +8 -0
  8. package/android/lc3Lib/src/main/cpp/google_opus_stuff/CMakeLists.txt +30 -0
  9. package/android/lc3Lib/src/main/cpp/google_opus_stuff/jni/CMakeLists.txt +7 -0
  10. package/android/lc3Lib/src/main/cpp/google_opus_stuff/jni/ogg_opus_encoder.cc +96 -0
  11. package/android/lc3Lib/src/main/cpp/google_opus_stuff/jni/ogg_opus_encoder.h +53 -0
  12. package/android/lc3Lib/src/main/cpp/google_opus_stuff/libogg/Makefile.am +6 -0
  13. package/android/lc3Lib/src/main/cpp/google_opus_stuff/libogg/config_types.h +26 -0
  14. package/android/lc3Lib/src/main/cpp/google_opus_stuff/libogg/config_types.h.in +26 -0
  15. package/android/lc3Lib/src/main/cpp/google_opus_stuff/libogg/ogg.h +209 -0
  16. package/android/lc3Lib/src/main/cpp/google_opus_stuff/libogg/os_types.h +158 -0
  17. package/android/lc3Lib/src/main/cpp/google_opus_stuff/libopus/opus.h +981 -0
  18. package/android/lc3Lib/src/main/cpp/google_opus_stuff/libopus/opus_custom.h +342 -0
  19. package/android/lc3Lib/src/main/cpp/google_opus_stuff/libopus/opus_defines.h +799 -0
  20. package/android/lc3Lib/src/main/cpp/google_opus_stuff/libopus/opus_multistream.h +660 -0
  21. package/android/lc3Lib/src/main/cpp/google_opus_stuff/libopus/opus_projection.h +568 -0
  22. package/android/lc3Lib/src/main/cpp/google_opus_stuff/libopus/opus_types.h +166 -0
  23. package/android/lc3Lib/src/main/cpp/google_opus_stuff/ogg_opus_encoder.cc +268 -0
  24. package/android/lc3Lib/src/main/cpp/google_opus_stuff/ogg_opus_encoder.h +115 -0
  25. package/android/lc3Lib/src/main/cpp/google_opus_stuff/opus_tools/opus_header.h +59 -0
  26. package/android/lc3Lib/src/main/cpp/liblc3/CMakeLists.txt +38 -0
  27. package/android/lc3Lib/src/main/cpp/liblc3/include/lc3.h +309 -0
  28. package/android/lc3Lib/src/main/cpp/liblc3/include/lc3_private.h +162 -0
  29. package/android/lc3Lib/src/main/cpp/liblc3/include/rnnoise.h +114 -0
  30. package/android/lc3Lib/src/main/cpp/liblc3/liblc3/CMakeLists.txt +19 -0
  31. package/android/lc3Lib/src/main/cpp/liblc3/liblc3/attdet.c +92 -0
  32. package/android/lc3Lib/src/main/cpp/liblc3/liblc3/attdet.h +44 -0
  33. package/android/lc3Lib/src/main/cpp/liblc3/liblc3/bits.c +375 -0
  34. package/android/lc3Lib/src/main/cpp/liblc3/liblc3/bits.h +315 -0
  35. package/android/lc3Lib/src/main/cpp/liblc3/liblc3/bwdet.c +129 -0
  36. package/android/lc3Lib/src/main/cpp/liblc3/liblc3/bwdet.h +69 -0
  37. package/android/lc3Lib/src/main/cpp/liblc3/liblc3/common.h +148 -0
  38. package/android/lc3Lib/src/main/cpp/liblc3/liblc3/energy.c +70 -0
  39. package/android/lc3Lib/src/main/cpp/liblc3/liblc3/energy.h +43 -0
  40. package/android/lc3Lib/src/main/cpp/liblc3/liblc3/fastmath.h +158 -0
  41. package/android/lc3Lib/src/main/cpp/liblc3/liblc3/lc3.c +702 -0
  42. package/android/lc3Lib/src/main/cpp/liblc3/liblc3/ltpf.c +893 -0
  43. package/android/lc3Lib/src/main/cpp/liblc3/liblc3/ltpf.h +111 -0
  44. package/android/lc3Lib/src/main/cpp/liblc3/liblc3/ltpf_arm.h +506 -0
  45. package/android/lc3Lib/src/main/cpp/liblc3/liblc3/ltpf_neon.h +281 -0
  46. package/android/lc3Lib/src/main/cpp/liblc3/liblc3/makefile.mk +35 -0
  47. package/android/lc3Lib/src/main/cpp/liblc3/liblc3/mdct.c +452 -0
  48. package/android/lc3Lib/src/main/cpp/liblc3/liblc3/mdct.h +57 -0
  49. package/android/lc3Lib/src/main/cpp/liblc3/liblc3/mdct_neon.h +296 -0
  50. package/android/lc3Lib/src/main/cpp/liblc3/liblc3/meson.build +46 -0
  51. package/android/lc3Lib/src/main/cpp/liblc3/liblc3/plc.c +61 -0
  52. package/android/lc3Lib/src/main/cpp/liblc3/liblc3/plc.h +57 -0
  53. package/android/lc3Lib/src/main/cpp/liblc3/liblc3/sns.c +880 -0
  54. package/android/lc3Lib/src/main/cpp/liblc3/liblc3/sns.h +103 -0
  55. package/android/lc3Lib/src/main/cpp/liblc3/liblc3/spec.c +904 -0
  56. package/android/lc3Lib/src/main/cpp/liblc3/liblc3/spec.h +119 -0
  57. package/android/lc3Lib/src/main/cpp/liblc3/liblc3/tables.c +3457 -0
  58. package/android/lc3Lib/src/main/cpp/liblc3/liblc3/tables.h +94 -0
  59. package/android/lc3Lib/src/main/cpp/liblc3/liblc3/tns.c +457 -0
  60. package/android/lc3Lib/src/main/cpp/liblc3/liblc3/tns.h +99 -0
  61. package/android/lc3Lib/src/main/cpp/liblc3/liblc3.cpp +159 -0
  62. package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/_kiss_fft_guts.h +182 -0
  63. package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/arch.h +261 -0
  64. package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/celt_lpc.c +279 -0
  65. package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/celt_lpc.h +59 -0
  66. package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/common.h +48 -0
  67. package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/compile.sh +3 -0
  68. package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/denoise.c +646 -0
  69. package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/kiss_fft.c +601 -0
  70. package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/kiss_fft.h +203 -0
  71. package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/opus_types.h +159 -0
  72. package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/pitch.c +526 -0
  73. package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/pitch.h +149 -0
  74. package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/rnn.c +178 -0
  75. package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/rnn.h +69 -0
  76. package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/rnn_data.c +11051 -0
  77. package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/rnn_data.h +34 -0
  78. package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/rnn_reader.c +168 -0
  79. package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/rnn_train.py +66 -0
  80. package/android/lc3Lib/src/main/cpp/liblc3/rnnoise/tansig_table.h +45 -0
  81. package/android/lc3Lib/src/main/java/com/mentra/lc3Lib/Lc3Cpp.java +38 -0
  82. package/android/lc3Lib/third_party/CMakeLists.txt +23 -0
  83. package/android/lc3Lib/third_party/CMakeLists_libogg.txt +18 -0
  84. package/android/lc3Lib/third_party/CMakeLists_libopus.txt +18 -0
  85. package/android/lc3Lib/third_party/CMakeLists_opus-tools.txt +23 -0
  86. package/android/lc3Lib/third_party/opus_tools/src/AUTHORS +5 -0
  87. package/android/lc3Lib/third_party/opus_tools/src/CMakeLists.txt +4 -0
  88. package/android/lc3Lib/third_party/opus_tools/src/COPYING +371 -0
  89. package/android/lc3Lib/third_party/opus_tools/src/ChangeLog +3 -0
  90. package/android/lc3Lib/third_party/opus_tools/src/Makefile.am +42 -0
  91. package/android/lc3Lib/third_party/opus_tools/src/Makefile.unix +23 -0
  92. package/android/lc3Lib/third_party/opus_tools/src/NEWS +0 -0
  93. package/android/lc3Lib/third_party/opus_tools/src/README +0 -0
  94. package/android/lc3Lib/third_party/opus_tools/src/autogen.sh +115 -0
  95. package/android/lc3Lib/third_party/opus_tools/src/configure.ac +293 -0
  96. package/android/lc3Lib/third_party/opus_tools/src/src/arch.h +239 -0
  97. package/android/lc3Lib/third_party/opus_tools/src/src/audio-in.c +1046 -0
  98. package/android/lc3Lib/third_party/opus_tools/src/src/diag_range.c +245 -0
  99. package/android/lc3Lib/third_party/opus_tools/src/src/diag_range.h +28 -0
  100. package/android/lc3Lib/third_party/opus_tools/src/src/info_opus.c +320 -0
  101. package/android/lc3Lib/third_party/opus_tools/src/src/info_opus.h +51 -0
  102. package/android/lc3Lib/third_party/opus_tools/src/src/lpc.c +157 -0
  103. package/android/lc3Lib/third_party/opus_tools/src/src/lpc.h +27 -0
  104. package/android/lc3Lib/third_party/opus_tools/src/src/opus_header.c +286 -0
  105. package/android/lc3Lib/third_party/opus_tools/src/src/opus_header.h +59 -0
  106. package/android/lc3Lib/third_party/opus_tools/src/src/opusdec.c +884 -0
  107. package/android/lc3Lib/third_party/opus_tools/src/src/opusenc.c +1021 -0
  108. package/android/lc3Lib/third_party/opus_tools/src/src/opusenc.h +101 -0
  109. package/android/lc3Lib/third_party/opus_tools/src/src/opusinfo.c +639 -0
  110. package/android/lc3Lib/third_party/opus_tools/src/src/opusinfo.h +51 -0
  111. package/android/lc3Lib/third_party/opus_tools/src/src/os_support.h +167 -0
  112. package/android/lc3Lib/third_party/opus_tools/src/src/resample.c +1137 -0
  113. package/android/lc3Lib/third_party/opus_tools/src/src/speex_resampler.h +344 -0
  114. package/android/lc3Lib/third_party/opus_tools/src/src/stack_alloc.h +115 -0
  115. package/android/lc3Lib/third_party/opus_tools/src/src/wav_io.c +125 -0
  116. package/android/lc3Lib/third_party/opus_tools/src/src/wav_io.h +62 -0
  117. package/android/lc3Lib/third_party/opus_tools/src/src/wave_out.c +223 -0
  118. package/android/lc3Lib/third_party/opus_tools/src/src/wave_out.h +60 -0
  119. package/android/settings.gradle +1 -0
  120. package/android/src/main/AndroidManifest.xml +40 -0
  121. package/android/src/main/java/com/mentra/bluetoothsdk/BluetoothSdkModule.kt +528 -0
  122. package/android/src/main/java/com/mentra/bluetoothsdk/Bridge.kt +610 -0
  123. package/android/src/main/java/com/mentra/bluetoothsdk/DeviceManager.kt +1616 -0
  124. package/android/src/main/java/com/mentra/bluetoothsdk/DeviceStore.kt +314 -0
  125. package/android/src/main/java/com/mentra/bluetoothsdk/MentraBluetoothModels.kt +1710 -0
  126. package/android/src/main/java/com/mentra/bluetoothsdk/MentraBluetoothSdk.kt +554 -0
  127. package/android/src/main/java/com/mentra/bluetoothsdk/ObservableStore.kt +68 -0
  128. package/android/src/main/java/com/mentra/bluetoothsdk/controllers/ControllerManager.kt +158 -0
  129. package/android/src/main/java/com/mentra/bluetoothsdk/controllers/R1.kt +934 -0
  130. package/android/src/main/java/com/mentra/bluetoothsdk/services/Foreground.kt +175 -0
  131. package/android/src/main/java/com/mentra/bluetoothsdk/services/PhoneMic.kt +1109 -0
  132. package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/G1.java +3974 -0
  133. package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/G2.kt +3551 -0
  134. package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/Mach1.java +1327 -0
  135. package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/MentraLive.java +6959 -0
  136. package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/MentraNex.kt +1655 -0
  137. package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/MentraosBle.java +53675 -0
  138. package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/SGCManager.kt +202 -0
  139. package/android/src/main/java/com/mentra/bluetoothsdk/sgcs/Simulated.kt +224 -0
  140. package/android/src/main/java/com/mentra/bluetoothsdk/stt/STTTools.kt +340 -0
  141. package/android/src/main/java/com/mentra/bluetoothsdk/stt/SherpaOnnxTranscriber.kt +465 -0
  142. package/android/src/main/java/com/mentra/bluetoothsdk/stt/VadGateSpeechPolicy.kt +221 -0
  143. package/android/src/main/java/com/mentra/bluetoothsdk/utils/AES.java +106 -0
  144. package/android/src/main/java/com/mentra/bluetoothsdk/utils/AudioSessionMonitor.kt +189 -0
  145. package/android/src/main/java/com/mentra/bluetoothsdk/utils/BitmapJavaUtils.java +169 -0
  146. package/android/src/main/java/com/mentra/bluetoothsdk/utils/BlePhotoUploadService.java +179 -0
  147. package/android/src/main/java/com/mentra/bluetoothsdk/utils/Constants.kt +44 -0
  148. package/android/src/main/java/com/mentra/bluetoothsdk/utils/G1Text.kt +436 -0
  149. package/android/src/main/java/com/mentra/bluetoothsdk/utils/IncidentLogBleRelayNaming.java +29 -0
  150. package/android/src/main/java/com/mentra/bluetoothsdk/utils/IncidentLogBleUploadService.java +76 -0
  151. package/android/src/main/java/com/mentra/bluetoothsdk/utils/K900ProtocolUtils.java +791 -0
  152. package/android/src/main/java/com/mentra/bluetoothsdk/utils/MessageChunker.java +186 -0
  153. package/android/src/main/java/com/mentra/bluetoothsdk/utils/NexSGCUtils.kt +589 -0
  154. package/android/src/main/java/com/mentra/bluetoothsdk/utils/PhoneAudioMonitor.kt +303 -0
  155. package/android/src/main/java/com/mentra/bluetoothsdk/utils/SmartGlassesConnectionState.java +9 -0
  156. package/android/src/main/java/com/mentra/bluetoothsdk/utils/audio/ByteUtilAudioPlayer.java +655 -0
  157. package/android/src/main/java/com/mentra/bluetoothsdk/utils/audio/Lc3Player.java +441 -0
  158. package/android/src/main/java/com/mentra/bluetoothsdk/utils/audio/PCMAudioPlayer.java +431 -0
  159. package/android/src/main/res/values/strings.xml +4 -0
  160. package/app.plugin.js +1 -0
  161. package/build/BluetoothSdk.types.d.ts +498 -0
  162. package/build/BluetoothSdk.types.d.ts.map +1 -0
  163. package/build/BluetoothSdk.types.js +23 -0
  164. package/build/BluetoothSdk.types.js.map +1 -0
  165. package/build/BluetoothSdkModule.d.ts +71 -0
  166. package/build/BluetoothSdkModule.d.ts.map +1 -0
  167. package/build/BluetoothSdkModule.js +106 -0
  168. package/build/BluetoothSdkModule.js.map +1 -0
  169. package/build/index.d.ts +3 -0
  170. package/build/index.d.ts.map +1 -0
  171. package/build/index.js +5 -0
  172. package/build/index.js.map +1 -0
  173. package/expo-module.config.json +9 -0
  174. package/ios/BluetoothSdkModule.swift +665 -0
  175. package/ios/MentraBluetoothSDK.podspec +77 -0
  176. package/ios/Packages/CoreObjC/CoreObjC.xcodeproj/project.pbxproj +213 -0
  177. package/ios/Packages/CoreObjC/PcmConverter.h +22 -0
  178. package/ios/Packages/CoreObjC/PcmConverter.m +266 -0
  179. package/ios/Packages/CoreObjC/attdet.c +92 -0
  180. package/ios/Packages/CoreObjC/attdet.h +44 -0
  181. package/ios/Packages/CoreObjC/bits.c +375 -0
  182. package/ios/Packages/CoreObjC/bits.h +315 -0
  183. package/ios/Packages/CoreObjC/bwdet.c +129 -0
  184. package/ios/Packages/CoreObjC/bwdet.h +69 -0
  185. package/ios/Packages/CoreObjC/common.h +151 -0
  186. package/ios/Packages/CoreObjC/energy.c +70 -0
  187. package/ios/Packages/CoreObjC/energy.h +43 -0
  188. package/ios/Packages/CoreObjC/fastmath.h +158 -0
  189. package/ios/Packages/CoreObjC/lc3.c +704 -0
  190. package/ios/Packages/CoreObjC/lc3.h +313 -0
  191. package/ios/Packages/CoreObjC/lc3_cpp.h +283 -0
  192. package/ios/Packages/CoreObjC/lc3_private.h +163 -0
  193. package/ios/Packages/CoreObjC/ltpf.c +905 -0
  194. package/ios/Packages/CoreObjC/ltpf.h +111 -0
  195. package/ios/Packages/CoreObjC/ltpf_arm.h +506 -0
  196. package/ios/Packages/CoreObjC/ltpf_neon.h +281 -0
  197. package/ios/Packages/CoreObjC/makefile.mk +35 -0
  198. package/ios/Packages/CoreObjC/mdct.c +469 -0
  199. package/ios/Packages/CoreObjC/mdct.h +57 -0
  200. package/ios/Packages/CoreObjC/mdct_neon.h +296 -0
  201. package/ios/Packages/CoreObjC/meson.build +61 -0
  202. package/ios/Packages/CoreObjC/plc.c +61 -0
  203. package/ios/Packages/CoreObjC/plc.h +57 -0
  204. package/ios/Packages/CoreObjC/rnnoise.h +114 -0
  205. package/ios/Packages/CoreObjC/sns.c +880 -0
  206. package/ios/Packages/CoreObjC/sns.h +103 -0
  207. package/ios/Packages/CoreObjC/spec.c +907 -0
  208. package/ios/Packages/CoreObjC/spec.h +119 -0
  209. package/ios/Packages/CoreObjC/tables.c +3457 -0
  210. package/ios/Packages/CoreObjC/tables.h +94 -0
  211. package/ios/Packages/CoreObjC/tns.c +457 -0
  212. package/ios/Packages/CoreObjC/tns.h +99 -0
  213. package/ios/Packages/SherpaOnnx/Model/joiner.onnx +0 -0
  214. package/ios/Packages/SherpaOnnx/Model/tokens.txt +502 -0
  215. package/ios/Packages/SherpaOnnx/SherpaOnnx.swift +1659 -0
  216. package/ios/Packages/SherpaOnnx/sherpa-onnx.xcframework/Headers/cargs.h +162 -0
  217. package/ios/Packages/SherpaOnnx/sherpa-onnx.xcframework/Headers/sherpa-onnx/c-api/c-api.h +1852 -0
  218. package/ios/Packages/SherpaOnnx/sherpa-onnx.xcframework/Headers/sherpa-onnx/c-api/cxx-api.h +674 -0
  219. package/ios/Packages/SherpaOnnx/sherpa-onnx.xcframework/Info.plist +44 -0
  220. package/ios/Packages/SherpaOnnx/sherpa-onnx.xcframework/ios-arm64/libsherpa-onnx.a +0 -0
  221. package/ios/Packages/SherpaOnnx/sherpa-onnx.xcframework/ios-arm64/sherpa-onnx.a +0 -0
  222. package/ios/Packages/SherpaOnnx/sherpa-onnx.xcframework/ios-arm64_x86_64-simulator/libsherpa-onnx.a +0 -0
  223. package/ios/Packages/SherpaOnnx/sherpa-onnx.xcframework/ios-arm64_x86_64-simulator/sherpa-onnx.a +0 -0
  224. package/ios/Packages/VAD/Common/VAD/VADQuality.swift +41 -0
  225. package/ios/Packages/VAD/Common/VAD/VADState.swift +26 -0
  226. package/ios/Packages/VAD/Common/VAD/VADStrategy.swift +29 -0
  227. package/ios/Packages/VAD/Common/VAD/VADType.swift +14 -0
  228. package/ios/Packages/VAD/Data/Configuration.swift +68 -0
  229. package/ios/Packages/VAD/Data/FrameSize.swift +39 -0
  230. package/ios/Packages/VAD/Data/Record.swift +13 -0
  231. package/ios/Packages/VAD/Data/Result.swift +22 -0
  232. package/ios/Packages/VAD/Data/SampleRate.swift +48 -0
  233. package/ios/Packages/VAD/Silero/Model/silero_vad.onnx +0 -0
  234. package/ios/Packages/VAD/Silero/SileroVAD.swift +284 -0
  235. package/ios/Packages/VAD/Silero/SileroVADStrategy.swift +64 -0
  236. package/ios/Packages/libbz2/module.modulemap +5 -0
  237. package/ios/Packages/libbz2/shim.h +1 -0
  238. package/ios/Source/Bridge.swift +353 -0
  239. package/ios/Source/Bridging-Header.h +16 -0
  240. package/ios/Source/DeviceManager.swift +1478 -0
  241. package/ios/Source/DeviceStore.swift +295 -0
  242. package/ios/Source/MentraBluetoothSDK.swift +2439 -0
  243. package/ios/Source/ObservableStore.swift +88 -0
  244. package/ios/Source/PrivacyInfo.xcprivacy +23 -0
  245. package/ios/Source/controllers/ControllerManager.swift +187 -0
  246. package/ios/Source/controllers/R1.swift +827 -0
  247. package/ios/Source/services/PhoneMic.swift +662 -0
  248. package/ios/Source/sgcs/Frame.swift +651 -0
  249. package/ios/Source/sgcs/G1.swift +2505 -0
  250. package/ios/Source/sgcs/G2.swift +3730 -0
  251. package/ios/Source/sgcs/Mach1.swift +543 -0
  252. package/ios/Source/sgcs/MentraLive.swift +4708 -0
  253. package/ios/Source/sgcs/MentraNex.swift +2479 -0
  254. package/ios/Source/sgcs/SGCManager.swift +243 -0
  255. package/ios/Source/sgcs/Simulated.swift +270 -0
  256. package/ios/Source/sgcs/mentraos_ble.pb.swift +3811 -0
  257. package/ios/Source/stt/STTTools.swift +154 -0
  258. package/ios/Source/stt/SherpaOnnxTranscriber.swift +401 -0
  259. package/ios/Source/utils/AudioSessionMonitor.swift +283 -0
  260. package/ios/Source/utils/Constants.swift +74 -0
  261. package/ios/Source/utils/Enums.swift +95 -0
  262. package/ios/Source/utils/G1Text.swift +2067 -0
  263. package/ios/Source/utils/JSCExperiment.swift +241 -0
  264. package/ios/Source/utils/MemoryMonitor.swift +44 -0
  265. package/ios/Source/utils/MessageChunker.swift +164 -0
  266. package/ios/Source/utils/Models.swift +135 -0
  267. package/ios/Source/utils/PhoneAudioMonitor.swift +226 -0
  268. package/ios/Source/utils/TarBz2Extractor.swift +206 -0
  269. package/package.json +78 -0
  270. package/plugin/build/index.d.ts +6 -0
  271. package/plugin/build/index.js +12 -0
  272. package/plugin/build/withAndroid.d.ts +4 -0
  273. package/plugin/build/withAndroid.js +80 -0
  274. package/plugin/build/withIos.d.ts +4 -0
  275. package/plugin/build/withIos.js +64 -0
  276. package/src/BluetoothSdk.types.ts +581 -0
  277. package/src/BluetoothSdkModule.ts +259 -0
  278. package/src/index.ts +4 -0
@@ -0,0 +1,293 @@
1
+ dnl Process this file with autoconf to produce a configure script. -*-m4-*-
2
+
3
+ AC_INIT(src/opusenc.c)
4
+
5
+ AM_CONFIG_HEADER([config.h])
6
+
7
+ dnl enable silent rules on automake 1.11 and later
8
+ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
9
+
10
+ OPUSTOOLS_MAJOR_VERSION=0
11
+ OPUSTOOLS_MINOR_VERSION=1
12
+ OPUSTOOLS_MICRO_VERSION=2
13
+ OPUSTOOLS_EXTRA_VERSION=git
14
+
15
+ OPUSTOOLS_VERSION="$OPUSTOOLS_MAJOR_VERSION.$OPUSTOOLS_MINOR_VERSION.$OPUSTOOLS_MICRO_VERSION$OPUSTOOLS_EXTRA_VERSION"
16
+ AC_MSG_CHECKING([git revision])
17
+ GIT_VERSION=$(git describe --tags --match 'v*' 2>/dev/null | sed 's/^v//')
18
+ if test -z "$GIT_VERSION"; then
19
+ AC_MSG_RESULT([no])
20
+ else
21
+ AC_MSG_RESULT([$GIT_VERSION])
22
+ OPUSTOOLS_VERSION="$GIT_VERSION"
23
+ fi
24
+
25
+ # For automake.
26
+ VERSION=$OPUSTOOLS_VERSION
27
+ PACKAGE=opus-tools
28
+
29
+ AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
30
+ AM_MAINTAINER_MODE
31
+
32
+ AC_CANONICAL_HOST
33
+ AM_PROG_CC_C_O
34
+
35
+ AC_PROG_CC_C99
36
+ AC_C_BIGENDIAN
37
+ AC_C_CONST
38
+ AC_C_INLINE
39
+
40
+ #Use a hacked up version of autoconf's AC_C_RESTRICT because it's not
41
+ #strong enough a test to detect old buggy versions of GCC (e.g. 2.95.3)
42
+ AC_CACHE_CHECK([for C/C++ restrict keyword], ac_cv_c_restrict,
43
+ [ac_cv_c_restrict=no
44
+ # The order here caters to the fact that C++ does not require restrict.
45
+ for ac_kw in __restrict __restrict__ _Restrict restrict; do
46
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
47
+ [[typedef int * int_ptr;
48
+ int foo (int_ptr $ac_kw ip, int * $ac_kw baz[]) {
49
+ return ip[0];
50
+ }]],
51
+ [[int s[1];
52
+ int * $ac_kw t = s;
53
+ t[0] = 0;
54
+ return foo(t, (void *)0)]])],
55
+ [ac_cv_c_restrict=$ac_kw])
56
+ test "$ac_cv_c_restrict" != no && break
57
+ done
58
+ ])
59
+ AH_VERBATIM([restrict],
60
+ [/* Define to the equivalent of the C99 'restrict' keyword, or to
61
+ nothing if this is not supported. Do not define if restrict is
62
+ supported directly. */
63
+ #undef restrict
64
+ /* Work around a bug in Sun C++: it does not support _Restrict or
65
+ __restrict__, even though the corresponding Sun C compiler ends up with
66
+ "#define restrict _Restrict" or "#define restrict __restrict__" in the
67
+ previous line. Perhaps some future version of Sun C++ will work with
68
+ restrict; if so, hopefully it defines __RESTRICT like Sun C does. */
69
+ #if defined __SUNPRO_CC && !defined __RESTRICT
70
+ # define _Restrict
71
+ # define __restrict__
72
+ #endif])
73
+ case $ac_cv_c_restrict in
74
+ restrict) ;;
75
+ no) AC_DEFINE([restrict], []) ;;
76
+ *) AC_DEFINE_UNQUOTED([restrict], [$ac_cv_c_restrict]) ;;
77
+ esac
78
+
79
+ AC_MSG_CHECKING(for C99 variable-size arrays)
80
+ AC_TRY_COMPILE( [], [static int x; char a[++x]; a[sizeof a - 1] = 0; int N; return a[0];],
81
+ [has_var_arrays=yes;AC_DEFINE([VAR_ARRAYS], [], [Use C99 variable-size arrays])
82
+ ],
83
+ has_var_arrays=no
84
+ )
85
+ AC_MSG_RESULT($has_var_arrays)
86
+
87
+ AC_CHECK_FUNC(exp,[fp_libm_not_needed=yes;LIBM=],[fp_libm_not_needed=dunno])
88
+ if test x"$fp_libm_not_needed" = xdunno; then
89
+ AC_CHECK_LIB([m], [exp], [LIBS="-lm $LIBS"; LIBM="-lm"],[LIBM=])
90
+ fi
91
+ AC_SUBST([LIBM])
92
+
93
+ AC_CHECK_LIB(winmm, main)
94
+
95
+ AC_DEFINE_UNQUOTED(OPUSTOOLS_MAJOR_VERSION, ${OPUSTOOLS_MAJOR_VERSION}, [Version major])
96
+ AC_DEFINE_UNQUOTED(OPUSTOOLS_MINOR_VERSION, ${OPUSTOOLS_MINOR_VERSION}, [Version minor])
97
+ AC_DEFINE_UNQUOTED(OPUSTOOLS_MICRO_VERSION, ${OPUSTOOLS_MICRO_VERSION}, [Version micro])
98
+ AC_DEFINE_UNQUOTED(OPUSTOOLS_EXTRA_VERSION, "${OPUSTOOLS_EXTRA_VERSION}", [Version extra])
99
+
100
+ ac_enable_assertions="no"
101
+ AC_ARG_ENABLE(assertions, [ --enable-assertions enable additional software error checking],
102
+ [if test "$enableval" = yes; then
103
+ ac_enable_assertions="yes"
104
+ AC_DEFINE([ENABLE_ASSERTIONS], , [Assertions])
105
+ fi])
106
+
107
+ dnl check for Ogg
108
+ HAVE_OGG=no
109
+
110
+ dnl first check through pkg-config since it's more flexible
111
+
112
+ dnl check for pkg-config itself so we don't try the m4 macro without pkg-config
113
+ AC_CHECK_PROG(HAVE_PKG_CONFIG, pkg-config, yes)
114
+ if test "x$HAVE_PKG_CONFIG" = "xyes"
115
+ then
116
+ PKG_CHECK_MODULES(OGG, ogg >= 1.3, HAVE_OGG=yes, HAVE_OGG=no)
117
+ fi
118
+ if test "x$HAVE_OGG" = "xno"
119
+ then
120
+ dnl fall back to the old school test
121
+ XIPH_PATH_OGG(, AC_MSG_ERROR([
122
+ libogg is required to build this package!
123
+ please see http://www.xiph.org/ for how to
124
+ obtain a copy.
125
+ ]))
126
+ cflags_save=$CFLAGS
127
+ libs_save=$LIBS
128
+ CFLAGS="$CFLAGS $OGG_CFLAGS"
129
+ LIBS="$LIBS $OGG_LIBS"
130
+ AC_CHECK_FUNC(ogg_stream_flush_fill, , [
131
+ AC_MSG_ERROR([newer libogg version (1.3 or later) required])
132
+ ])
133
+ CFLAGS=$cflags_save
134
+ LIBS=$libs_save
135
+ fi
136
+
137
+ dnl check for Opus
138
+ HAVE_OPUS=no
139
+
140
+ dnl first check through pkg-config since it's more flexible
141
+
142
+ dnl check for pkg-config itself so we don't try the m4 macro without pkg-config
143
+ AC_CHECK_PROG(HAVE_PKG_CONFIG, pkg-config, yes)
144
+ if test "x$HAVE_PKG_CONFIG" = "xyes"
145
+ then
146
+ PKG_CHECK_MODULES(Opus, opus >= 0.9.10, HAVE_OPUS=yes, HAVE_OPUS=no)
147
+ fi
148
+ if test "x$HAVE_OPUS" = "xno"
149
+ then
150
+ AC_MSG_ERROR([
151
+ Opus is required to build this package!
152
+ please see http://opus-codec.org/ for how to
153
+ obtain a copy.])
154
+ fi
155
+
156
+ dnl check for OSS
157
+ HAVE_OSS=no
158
+ AC_CHECK_HEADERS([sys/soundcard.h soundcard.h machine/soundcard.h],[
159
+ HAVE_OSS=yes
160
+ break
161
+ ])
162
+ if test x$HAVE_OSS != xyes; then
163
+ AC_MSG_WARN([OSS audio support not found -- no direct audio output in opusdec])
164
+ fi
165
+
166
+ dnl OpenBSD needs -lossaudio to use the oss interface
167
+ OSS_LIBS=
168
+ case "$host_os" in
169
+ openbsd*)
170
+ OSS_LIBS='-lossaudio'
171
+ ;;
172
+ esac
173
+ AC_SUBST(OSS_LIBS)
174
+
175
+
176
+ dnl Enable stack-protector-all only on x86 where it's well supported.
177
+ dnl on some platforms it causes crashes. Hopefully the OS's default's
178
+ dnl include this on platforms that work but have been missed here.
179
+
180
+ on_x86=no
181
+ case "$host_cpu" in
182
+ i[[3456]]86 | x86_64)
183
+ on_x86=yes
184
+ ;;
185
+ esac
186
+
187
+ use_stack_protector=no
188
+
189
+ if test $ac_cv_c_compiler_gnu = yes && test $on_x86 = yes; then
190
+ saved_CFLAGS="$CFLAGS"
191
+ CFLAGS="$CFLAGS -fstack-protector-all"
192
+ AC_MSG_CHECKING([if ${CC} supports -fstack-protector-all])
193
+ AC_LINK_IFELSE([AC_LANG_SOURCE([void main(void){char foo;}])],
194
+ [ AC_MSG_RESULT([yes])
195
+ STACK_PROTECTOR="-fstack-protector-all"; use_stack_protector=yes ],
196
+ AC_MSG_RESULT([no]))
197
+ CFLAGS="$saved_CFLAGS $STACK_PROTECTOR"
198
+ fi
199
+
200
+ save_CFLAGS="$CFLAGS"
201
+ save_LDFLAGS="$LDFLAGS"
202
+ save_LIBS="$LIBS"
203
+ CFLAGS="$CFLAGS -fPIE $Opus_CFLAGS"
204
+ LDFLAGS="$LDFLAGS -pie -Wl,-z,relro -Wl,-z,now"
205
+ LIBS="$LIBS $Opus_LIBS"
206
+ AC_MSG_CHECKING([for PIE support])
207
+ AC_LINK_IFELSE([AC_LANG_SOURCE([
208
+ #include <opus.h>
209
+ void main () {
210
+ OpusDecoder *dec = opus_decoder_create(48000, 2, 0L);
211
+ }])],
212
+ [have_pie=yes],
213
+ [have_pie=no])
214
+ AC_MSG_RESULT([$have_pie])
215
+ if test "x$have_pie" = "xyes"; then
216
+ PIE_CFLAGS="-fPIE"
217
+ PIE_LDFLAGS="-pie -Wl,-z,relro -Wl,-z,now"
218
+ fi
219
+ CFLAGS="$save_CFLAGS $PIE_CFLAGS"
220
+ LDFLAGS="$save_LDFLAGS $PIE_LDFLAGS"
221
+ LIBS="$save_LIBS"
222
+
223
+ CFLAGS="$CFLAGS -W"
224
+
225
+ saved_CFLAGS="$CFLAGS"
226
+ CFLAGS="$CFLAGS -Wall -Wextra -Wcast-align -Wnested-externs -Wshadow -Wstrict-prototypes"
227
+ AC_MSG_CHECKING([if ${CC} supports -Wall -Wextra -Wcast-align -Wnested-externs -Wshadow -Wstrict-prototypes])
228
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([char foo;])],
229
+ [ AC_MSG_RESULT([yes])
230
+ EXTRA_WARNS="-Wall -Wextra -Wcast-align -Wnested-externs -Wshadow -Wstrict-prototypes" ],
231
+ AC_MSG_RESULT([no]))
232
+ CFLAGS="$saved_CFLAGS $EXTRA_WARNS"
233
+
234
+ AC_CHECK_FUNCS([lrintf])
235
+ AC_CHECK_FUNCS([lrint])
236
+ AC_CHECK_FUNCS([__malloc_hook])
237
+
238
+ AC_CHECK_SIZEOF(short)
239
+ AC_CHECK_SIZEOF(int)
240
+ AC_CHECK_SIZEOF(long)
241
+ AC_CHECK_SIZEOF(long long)
242
+
243
+ if test x$has_char16 = "xyes" ; then
244
+ case 1 in
245
+ $ac_cv_sizeof_short) SIZE16="short";;
246
+ $ac_cv_sizeof_int) SIZE16="int";;
247
+ esac
248
+ else
249
+ case 2 in
250
+ $ac_cv_sizeof_short) SIZE16="short";;
251
+ $ac_cv_sizeof_int) SIZE16="int";;
252
+ esac
253
+ fi
254
+
255
+ if test x$has_char16 = "xyes" ; then
256
+ case 2 in
257
+ $ac_cv_sizeof_int) SIZE32="int";;
258
+ $ac_cv_sizeof_long) SIZE32="long";;
259
+ $ac_cv_sizeof_short) SIZE32="short";;
260
+ esac
261
+ else
262
+ case 4 in
263
+ $ac_cv_sizeof_int) SIZE32="int";;
264
+ $ac_cv_sizeof_long) SIZE32="long";;
265
+ $ac_cv_sizeof_short) SIZE32="short";;
266
+ esac
267
+ fi
268
+
269
+ AC_SUBST(SIZE16)
270
+ AC_SUBST(SIZE32)
271
+
272
+ AC_OUTPUT([Makefile])
273
+
274
+ AC_MSG_RESULT([
275
+ ------------------------------------------------------------------------
276
+ $PACKAGE $VERSION: Automatic configuration OK.
277
+
278
+ Compiler support:
279
+
280
+ C99 var arrays: ................ ${has_var_arrays}
281
+ C99 lrintf: .................... ${ac_cv_func_lrintf}
282
+ Stack protector: ............... ${use_stack_protector}
283
+ PIE: ........................... ${have_pie}
284
+
285
+ General configuration:
286
+
287
+ Assertion checking: ............ ${ac_enable_assertions}
288
+
289
+ ------------------------------------------------------------------------
290
+ ])
291
+
292
+ echo "Type \"make; make install\" to compile and install";
293
+ echo "Type \"make check\" to run the test suite";
@@ -0,0 +1,239 @@
1
+ /* Copyright (C) 2003 Jean-Marc Valin */
2
+ /**
3
+ @file arch.h
4
+ @brief Various architecture definitions Speex
5
+ */
6
+ /*
7
+ Redistribution and use in source and binary forms, with or without
8
+ modification, are permitted provided that the following conditions
9
+ are met:
10
+
11
+ - Redistributions of source code must retain the above copyright
12
+ notice, this list of conditions and the following disclaimer.
13
+
14
+ - Redistributions in binary form must reproduce the above copyright
15
+ notice, this list of conditions and the following disclaimer in the
16
+ documentation and/or other materials provided with the distribution.
17
+
18
+ - Neither the name of the Xiph.org Foundation nor the names of its
19
+ contributors may be used to endorse or promote products derived from
20
+ this software without specific prior written permission.
21
+
22
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23
+ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
26
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
27
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
28
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
29
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
30
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
31
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33
+ */
34
+
35
+ #ifndef ARCH_H
36
+ #define ARCH_H
37
+
38
+ #ifndef SPEEX_VERSION
39
+ #define SPEEX_MAJOR_VERSION 1 /**< Major Speex version. */
40
+ #define SPEEX_MINOR_VERSION 1 /**< Minor Speex version. */
41
+ #define SPEEX_MICRO_VERSION 15 /**< Micro Speex version. */
42
+ #define SPEEX_EXTRA_VERSION "" /**< Extra Speex version. */
43
+ #define SPEEX_VERSION "speex-1.2beta3" /**< Speex version string. */
44
+ #endif
45
+
46
+ /* A couple test to catch stupid option combinations */
47
+ #ifdef FIXED_POINT
48
+
49
+ #ifdef FLOATING_POINT
50
+ #error You cannot compile as floating point and fixed point at the same time
51
+ #endif
52
+ #ifdef _USE_SSE
53
+ #error SSE is only for floating-point
54
+ #endif
55
+ #if ((defined (ARM4_ASM)||defined (ARM4_ASM)) && defined(BFIN_ASM)) || (defined (ARM4_ASM)&&defined(ARM5E_ASM))
56
+ #error Make up your mind. What CPU do you have?
57
+ #endif
58
+ #ifdef VORBIS_PSYCHO
59
+ #error Vorbis-psy model currently not implemented in fixed-point
60
+ #endif
61
+
62
+ #else
63
+
64
+ #ifndef FLOATING_POINT
65
+ #error You now need to define either FIXED_POINT or FLOATING_POINT
66
+ #endif
67
+ #if defined (ARM4_ASM) || defined(ARM5E_ASM) || defined(BFIN_ASM)
68
+ #error I suppose you can have a [ARM4/ARM5E/Blackfin] that has float instructions?
69
+ #endif
70
+ #ifdef FIXED_POINT_DEBUG
71
+ #error "Don't you think enabling fixed-point is a good thing to do if you want to debug that?"
72
+ #endif
73
+
74
+
75
+ #endif
76
+
77
+ #ifndef OUTSIDE_SPEEX
78
+ #include "../include/speex/speex_types.h"
79
+ #endif
80
+
81
+ #define ABS(x) ((x) < 0 ? (-(x)) : (x)) /**< Absolute integer value. */
82
+ #define ABS16(x) ((x) < 0 ? (-(x)) : (x)) /**< Absolute 16-bit value. */
83
+ #define MIN16(a,b) ((a) < (b) ? (a) : (b)) /**< Maximum 16-bit value. */
84
+ #define MAX16(a,b) ((a) > (b) ? (a) : (b)) /**< Maximum 16-bit value. */
85
+ #define ABS32(x) ((x) < 0 ? (-(x)) : (x)) /**< Absolute 32-bit value. */
86
+ #define MIN32(a,b) ((a) < (b) ? (a) : (b)) /**< Maximum 32-bit value. */
87
+ #define MAX32(a,b) ((a) > (b) ? (a) : (b)) /**< Maximum 32-bit value. */
88
+
89
+ #ifdef FIXED_POINT
90
+
91
+ typedef spx_int16_t spx_word16_t;
92
+ typedef spx_int32_t spx_word32_t;
93
+ typedef spx_word32_t spx_mem_t;
94
+ typedef spx_word16_t spx_coef_t;
95
+ typedef spx_word16_t spx_lsp_t;
96
+ typedef spx_word32_t spx_sig_t;
97
+
98
+ #define Q15ONE 32767
99
+
100
+ #define LPC_SCALING 8192
101
+ #define SIG_SCALING 16384
102
+ #define LSP_SCALING 8192.
103
+ #define GAMMA_SCALING 32768.
104
+ #define GAIN_SCALING 64
105
+ #define GAIN_SCALING_1 0.015625
106
+
107
+ #define LPC_SHIFT 13
108
+ #define LSP_SHIFT 13
109
+ #define SIG_SHIFT 14
110
+ #define GAIN_SHIFT 6
111
+
112
+ #define VERY_SMALL 0
113
+ #define VERY_LARGE32 ((spx_word32_t)2147483647)
114
+ #define VERY_LARGE16 ((spx_word16_t)32767)
115
+ #define Q15_ONE ((spx_word16_t)32767)
116
+
117
+
118
+ #ifdef FIXED_DEBUG
119
+ #include "fixed_debug.h"
120
+ #else
121
+
122
+ #include "fixed_generic.h"
123
+
124
+ #ifdef ARM5E_ASM
125
+ #include "fixed_arm5e.h"
126
+ #elif defined (ARM4_ASM)
127
+ #include "fixed_arm4.h"
128
+ #elif defined (BFIN_ASM)
129
+ #include "fixed_bfin.h"
130
+ #endif
131
+
132
+ #endif
133
+
134
+
135
+ #else
136
+
137
+ typedef float spx_mem_t;
138
+ typedef float spx_coef_t;
139
+ typedef float spx_lsp_t;
140
+ typedef float spx_sig_t;
141
+ typedef float spx_word16_t;
142
+ typedef float spx_word32_t;
143
+
144
+ #define Q15ONE 1.0f
145
+ #define LPC_SCALING 1.f
146
+ #define SIG_SCALING 1.f
147
+ #define LSP_SCALING 1.f
148
+ #define GAMMA_SCALING 1.f
149
+ #define GAIN_SCALING 1.f
150
+ #define GAIN_SCALING_1 1.f
151
+
152
+
153
+ #define VERY_SMALL 1e-15f
154
+ #define VERY_LARGE32 1e15f
155
+ #define VERY_LARGE16 1e15f
156
+ #define Q15_ONE ((spx_word16_t)1.f)
157
+
158
+ #define QCONST16(x,bits) (x)
159
+ #define QCONST32(x,bits) (x)
160
+
161
+ #define NEG16(x) (-(x))
162
+ #define NEG32(x) (-(x))
163
+ #define EXTRACT16(x) (x)
164
+ #define EXTEND32(x) (x)
165
+ #define SHR16(a,shift) (a)
166
+ #define SHL16(a,shift) (a)
167
+ #define SHR32(a,shift) (a)
168
+ #define SHL32(a,shift) (a)
169
+ #define PSHR16(a,shift) (a)
170
+ #define PSHR32(a,shift) (a)
171
+ #define VSHR32(a,shift) (a)
172
+ #define SATURATE16(x,a) (x)
173
+ #define SATURATE32(x,a) (x)
174
+
175
+ #define PSHR(a,shift) (a)
176
+ #define SHR(a,shift) (a)
177
+ #define SHL(a,shift) (a)
178
+ #define SATURATE(x,a) (x)
179
+
180
+ #define ADD16(a,b) ((a)+(b))
181
+ #define SUB16(a,b) ((a)-(b))
182
+ #define ADD32(a,b) ((a)+(b))
183
+ #define SUB32(a,b) ((a)-(b))
184
+ #define MULT16_16_16(a,b) ((a)*(b))
185
+ #define MULT16_16(a,b) ((spx_word32_t)(a)*(spx_word32_t)(b))
186
+ #define MAC16_16(c,a,b) ((c)+(spx_word32_t)(a)*(spx_word32_t)(b))
187
+
188
+ #define MULT16_32_Q11(a,b) ((a)*(b))
189
+ #define MULT16_32_Q13(a,b) ((a)*(b))
190
+ #define MULT16_32_Q14(a,b) ((a)*(b))
191
+ #define MULT16_32_Q15(a,b) ((a)*(b))
192
+ #define MULT16_32_P15(a,b) ((a)*(b))
193
+
194
+ #define MAC16_32_Q11(c,a,b) ((c)+(a)*(b))
195
+ #define MAC16_32_Q15(c,a,b) ((c)+(a)*(b))
196
+
197
+ #define MAC16_16_Q11(c,a,b) ((c)+(a)*(b))
198
+ #define MAC16_16_Q13(c,a,b) ((c)+(a)*(b))
199
+ #define MAC16_16_P13(c,a,b) ((c)+(a)*(b))
200
+ #define MULT16_16_Q11_32(a,b) ((a)*(b))
201
+ #define MULT16_16_Q13(a,b) ((a)*(b))
202
+ #define MULT16_16_Q14(a,b) ((a)*(b))
203
+ #define MULT16_16_Q15(a,b) ((a)*(b))
204
+ #define MULT16_16_P15(a,b) ((a)*(b))
205
+ #define MULT16_16_P13(a,b) ((a)*(b))
206
+ #define MULT16_16_P14(a,b) ((a)*(b))
207
+
208
+ #define DIV32_16(a,b) (((spx_word32_t)(a))/(spx_word16_t)(b))
209
+ #define PDIV32_16(a,b) (((spx_word32_t)(a))/(spx_word16_t)(b))
210
+ #define DIV32(a,b) (((spx_word32_t)(a))/(spx_word32_t)(b))
211
+ #define PDIV32(a,b) (((spx_word32_t)(a))/(spx_word32_t)(b))
212
+
213
+
214
+ #endif
215
+
216
+
217
+ #if defined (CONFIG_TI_C54X) || defined (CONFIG_TI_C55X)
218
+
219
+ /* 2 on TI C5x DSP */
220
+ #define BYTES_PER_CHAR 2
221
+ #define BITS_PER_CHAR 16
222
+ #define LOG2_BITS_PER_CHAR 4
223
+
224
+ #else
225
+
226
+ #define BYTES_PER_CHAR 1
227
+ #define BITS_PER_CHAR 8
228
+ #define LOG2_BITS_PER_CHAR 3
229
+
230
+ #endif
231
+
232
+
233
+
234
+ #ifdef FIXED_DEBUG
235
+ extern long long spx_mips;
236
+ #endif
237
+
238
+
239
+ #endif