@drutech/react-native-audio-analyzer 1.1.1-alpha.1

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 (223) hide show
  1. package/LICENSE +20 -0
  2. package/README.md +124 -0
  3. package/android/CMakeCache.txt +372 -0
  4. package/android/CMakeLists.txt +44 -0
  5. package/android/Makefile +211 -0
  6. package/android/build.gradle +110 -0
  7. package/android/cmake_install.cmake +49 -0
  8. package/android/cpp-adapter.cpp +40 -0
  9. package/android/ffmpeg_16kb/include/config.h +749 -0
  10. package/android/ffmpeg_16kb/include/libavcodec/ac3_parser.h +36 -0
  11. package/android/ffmpeg_16kb/include/libavcodec/adts_parser.h +37 -0
  12. package/android/ffmpeg_16kb/include/libavcodec/arm/mathops.h +108 -0
  13. package/android/ffmpeg_16kb/include/libavcodec/avcodec.h +3192 -0
  14. package/android/ffmpeg_16kb/include/libavcodec/avdct.h +88 -0
  15. package/android/ffmpeg_16kb/include/libavcodec/avfft.h +118 -0
  16. package/android/ffmpeg_16kb/include/libavcodec/bsf.h +332 -0
  17. package/android/ffmpeg_16kb/include/libavcodec/codec.h +375 -0
  18. package/android/ffmpeg_16kb/include/libavcodec/codec_desc.h +128 -0
  19. package/android/ffmpeg_16kb/include/libavcodec/codec_id.h +661 -0
  20. package/android/ffmpeg_16kb/include/libavcodec/codec_par.h +247 -0
  21. package/android/ffmpeg_16kb/include/libavcodec/d3d11va.h +112 -0
  22. package/android/ffmpeg_16kb/include/libavcodec/defs.h +192 -0
  23. package/android/ffmpeg_16kb/include/libavcodec/dirac.h +131 -0
  24. package/android/ffmpeg_16kb/include/libavcodec/dv_profile.h +82 -0
  25. package/android/ffmpeg_16kb/include/libavcodec/dxva2.h +93 -0
  26. package/android/ffmpeg_16kb/include/libavcodec/jni.h +46 -0
  27. package/android/ffmpeg_16kb/include/libavcodec/mathops.h +255 -0
  28. package/android/ffmpeg_16kb/include/libavcodec/mediacodec.h +103 -0
  29. package/android/ffmpeg_16kb/include/libavcodec/packet.h +731 -0
  30. package/android/ffmpeg_16kb/include/libavcodec/qsv.h +109 -0
  31. package/android/ffmpeg_16kb/include/libavcodec/vdpau.h +157 -0
  32. package/android/ffmpeg_16kb/include/libavcodec/version.h +45 -0
  33. package/android/ffmpeg_16kb/include/libavcodec/version_major.h +52 -0
  34. package/android/ffmpeg_16kb/include/libavcodec/videotoolbox.h +150 -0
  35. package/android/ffmpeg_16kb/include/libavcodec/vorbis_parser.h +74 -0
  36. package/android/ffmpeg_16kb/include/libavcodec/x86/mathops.h +133 -0
  37. package/android/ffmpeg_16kb/include/libavcodec/xvmc.h +171 -0
  38. package/android/ffmpeg_16kb/include/libavdevice/avdevice.h +397 -0
  39. package/android/ffmpeg_16kb/include/libavdevice/version.h +45 -0
  40. package/android/ffmpeg_16kb/include/libavdevice/version_major.h +36 -0
  41. package/android/ffmpeg_16kb/include/libavfilter/avfilter.h +1491 -0
  42. package/android/ffmpeg_16kb/include/libavfilter/buffersink.h +173 -0
  43. package/android/ffmpeg_16kb/include/libavfilter/buffersrc.h +218 -0
  44. package/android/ffmpeg_16kb/include/libavfilter/version.h +48 -0
  45. package/android/ffmpeg_16kb/include/libavfilter/version_major.h +38 -0
  46. package/android/ffmpeg_16kb/include/libavformat/avformat.h +2826 -0
  47. package/android/ffmpeg_16kb/include/libavformat/avio.h +837 -0
  48. package/android/ffmpeg_16kb/include/libavformat/network.h +341 -0
  49. package/android/ffmpeg_16kb/include/libavformat/os_support.h +317 -0
  50. package/android/ffmpeg_16kb/include/libavformat/url.h +409 -0
  51. package/android/ffmpeg_16kb/include/libavformat/version.h +47 -0
  52. package/android/ffmpeg_16kb/include/libavformat/version_major.h +52 -0
  53. package/android/ffmpeg_16kb/include/libavutil/aarch64/timer.h +50 -0
  54. package/android/ffmpeg_16kb/include/libavutil/adler32.h +63 -0
  55. package/android/ffmpeg_16kb/include/libavutil/aes.h +69 -0
  56. package/android/ffmpeg_16kb/include/libavutil/aes_ctr.h +99 -0
  57. package/android/ffmpeg_16kb/include/libavutil/ambient_viewing_environment.h +72 -0
  58. package/android/ffmpeg_16kb/include/libavutil/arm/timer.h +46 -0
  59. package/android/ffmpeg_16kb/include/libavutil/attributes.h +173 -0
  60. package/android/ffmpeg_16kb/include/libavutil/attributes_internal.h +34 -0
  61. package/android/ffmpeg_16kb/include/libavutil/audio_fifo.h +186 -0
  62. package/android/ffmpeg_16kb/include/libavutil/avassert.h +75 -0
  63. package/android/ffmpeg_16kb/include/libavutil/avconfig.h +6 -0
  64. package/android/ffmpeg_16kb/include/libavutil/avstring.h +429 -0
  65. package/android/ffmpeg_16kb/include/libavutil/avutil.h +371 -0
  66. package/android/ffmpeg_16kb/include/libavutil/base64.h +72 -0
  67. package/android/ffmpeg_16kb/include/libavutil/blowfish.h +82 -0
  68. package/android/ffmpeg_16kb/include/libavutil/bprint.h +251 -0
  69. package/android/ffmpeg_16kb/include/libavutil/bswap.h +111 -0
  70. package/android/ffmpeg_16kb/include/libavutil/buffer.h +322 -0
  71. package/android/ffmpeg_16kb/include/libavutil/camellia.h +70 -0
  72. package/android/ffmpeg_16kb/include/libavutil/cast5.h +80 -0
  73. package/android/ffmpeg_16kb/include/libavutil/channel_layout.h +783 -0
  74. package/android/ffmpeg_16kb/include/libavutil/common.h +578 -0
  75. package/android/ffmpeg_16kb/include/libavutil/cpu.h +134 -0
  76. package/android/ffmpeg_16kb/include/libavutil/crc.h +102 -0
  77. package/android/ffmpeg_16kb/include/libavutil/csp.h +150 -0
  78. package/android/ffmpeg_16kb/include/libavutil/des.h +81 -0
  79. package/android/ffmpeg_16kb/include/libavutil/detection_bbox.h +108 -0
  80. package/android/ffmpeg_16kb/include/libavutil/dict.h +241 -0
  81. package/android/ffmpeg_16kb/include/libavutil/display.h +109 -0
  82. package/android/ffmpeg_16kb/include/libavutil/dovi_meta.h +236 -0
  83. package/android/ffmpeg_16kb/include/libavutil/downmix_info.h +115 -0
  84. package/android/ffmpeg_16kb/include/libavutil/encryption_info.h +205 -0
  85. package/android/ffmpeg_16kb/include/libavutil/error.h +128 -0
  86. package/android/ffmpeg_16kb/include/libavutil/eval.h +140 -0
  87. package/android/ffmpeg_16kb/include/libavutil/ffversion.h +5 -0
  88. package/android/ffmpeg_16kb/include/libavutil/fifo.h +448 -0
  89. package/android/ffmpeg_16kb/include/libavutil/file.h +115 -0
  90. package/android/ffmpeg_16kb/include/libavutil/film_grain_params.h +260 -0
  91. package/android/ffmpeg_16kb/include/libavutil/frame.h +964 -0
  92. package/android/ffmpeg_16kb/include/libavutil/getenv_utf8.h +86 -0
  93. package/android/ffmpeg_16kb/include/libavutil/hash.h +264 -0
  94. package/android/ffmpeg_16kb/include/libavutil/hdr_dynamic_metadata.h +343 -0
  95. package/android/ffmpeg_16kb/include/libavutil/hdr_dynamic_vivid_metadata.h +285 -0
  96. package/android/ffmpeg_16kb/include/libavutil/hmac.h +99 -0
  97. package/android/ffmpeg_16kb/include/libavutil/hwcontext.h +610 -0
  98. package/android/ffmpeg_16kb/include/libavutil/hwcontext_cuda.h +69 -0
  99. package/android/ffmpeg_16kb/include/libavutil/hwcontext_d3d11va.h +178 -0
  100. package/android/ffmpeg_16kb/include/libavutil/hwcontext_drm.h +169 -0
  101. package/android/ffmpeg_16kb/include/libavutil/hwcontext_dxva2.h +75 -0
  102. package/android/ffmpeg_16kb/include/libavutil/hwcontext_mediacodec.h +61 -0
  103. package/android/ffmpeg_16kb/include/libavutil/hwcontext_opencl.h +100 -0
  104. package/android/ffmpeg_16kb/include/libavutil/hwcontext_qsv.h +64 -0
  105. package/android/ffmpeg_16kb/include/libavutil/hwcontext_vaapi.h +117 -0
  106. package/android/ffmpeg_16kb/include/libavutil/hwcontext_vdpau.h +44 -0
  107. package/android/ffmpeg_16kb/include/libavutil/hwcontext_videotoolbox.h +96 -0
  108. package/android/ffmpeg_16kb/include/libavutil/hwcontext_vulkan.h +281 -0
  109. package/android/ffmpeg_16kb/include/libavutil/imgutils.h +331 -0
  110. package/android/ffmpeg_16kb/include/libavutil/internal.h +190 -0
  111. package/android/ffmpeg_16kb/include/libavutil/intfloat.h +77 -0
  112. package/android/ffmpeg_16kb/include/libavutil/intreadwrite.h +644 -0
  113. package/android/ffmpeg_16kb/include/libavutil/lfg.h +81 -0
  114. package/android/ffmpeg_16kb/include/libavutil/libm.h +471 -0
  115. package/android/ffmpeg_16kb/include/libavutil/log.h +387 -0
  116. package/android/ffmpeg_16kb/include/libavutil/lzo.h +66 -0
  117. package/android/ffmpeg_16kb/include/libavutil/macros.h +80 -0
  118. package/android/ffmpeg_16kb/include/libavutil/mastering_display_metadata.h +128 -0
  119. package/android/ffmpeg_16kb/include/libavutil/mathematics.h +245 -0
  120. package/android/ffmpeg_16kb/include/libavutil/md5.h +89 -0
  121. package/android/ffmpeg_16kb/include/libavutil/mem.h +609 -0
  122. package/android/ffmpeg_16kb/include/libavutil/motion_vector.h +57 -0
  123. package/android/ffmpeg_16kb/include/libavutil/murmur3.h +115 -0
  124. package/android/ffmpeg_16kb/include/libavutil/opt.h +891 -0
  125. package/android/ffmpeg_16kb/include/libavutil/parseutils.h +197 -0
  126. package/android/ffmpeg_16kb/include/libavutil/pixdesc.h +435 -0
  127. package/android/ffmpeg_16kb/include/libavutil/pixelutils.h +51 -0
  128. package/android/ffmpeg_16kb/include/libavutil/pixfmt.h +691 -0
  129. package/android/ffmpeg_16kb/include/libavutil/random_seed.h +43 -0
  130. package/android/ffmpeg_16kb/include/libavutil/rational.h +221 -0
  131. package/android/ffmpeg_16kb/include/libavutil/rc4.h +69 -0
  132. package/android/ffmpeg_16kb/include/libavutil/replaygain.h +50 -0
  133. package/android/ffmpeg_16kb/include/libavutil/reverse.h +28 -0
  134. package/android/ffmpeg_16kb/include/libavutil/ripemd.h +83 -0
  135. package/android/ffmpeg_16kb/include/libavutil/samplefmt.h +269 -0
  136. package/android/ffmpeg_16kb/include/libavutil/sha.h +90 -0
  137. package/android/ffmpeg_16kb/include/libavutil/sha512.h +92 -0
  138. package/android/ffmpeg_16kb/include/libavutil/spherical.h +227 -0
  139. package/android/ffmpeg_16kb/include/libavutil/stereo3d.h +229 -0
  140. package/android/ffmpeg_16kb/include/libavutil/tea.h +71 -0
  141. package/android/ffmpeg_16kb/include/libavutil/thread.h +204 -0
  142. package/android/ffmpeg_16kb/include/libavutil/threadmessage.h +115 -0
  143. package/android/ffmpeg_16kb/include/libavutil/time.h +56 -0
  144. package/android/ffmpeg_16kb/include/libavutil/timecode.h +199 -0
  145. package/android/ffmpeg_16kb/include/libavutil/timer.h +156 -0
  146. package/android/ffmpeg_16kb/include/libavutil/timestamp.h +78 -0
  147. package/android/ffmpeg_16kb/include/libavutil/tree.h +137 -0
  148. package/android/ffmpeg_16kb/include/libavutil/twofish.h +70 -0
  149. package/android/ffmpeg_16kb/include/libavutil/tx.h +176 -0
  150. package/android/ffmpeg_16kb/include/libavutil/uuid.h +146 -0
  151. package/android/ffmpeg_16kb/include/libavutil/version.h +122 -0
  152. package/android/ffmpeg_16kb/include/libavutil/video_enc_params.h +171 -0
  153. package/android/ffmpeg_16kb/include/libavutil/x86/asm.h +154 -0
  154. package/android/ffmpeg_16kb/include/libavutil/x86/emms.h +58 -0
  155. package/android/ffmpeg_16kb/include/libavutil/x86/timer.h +50 -0
  156. package/android/ffmpeg_16kb/include/libavutil/xtea.h +94 -0
  157. package/android/ffmpeg_16kb/include/libswresample/swresample.h +650 -0
  158. package/android/ffmpeg_16kb/include/libswresample/version.h +46 -0
  159. package/android/ffmpeg_16kb/include/libswresample/version_major.h +31 -0
  160. package/android/ffmpeg_16kb/include/libswscale/swscale.h +436 -0
  161. package/android/ffmpeg_16kb/include/libswscale/version.h +44 -0
  162. package/android/ffmpeg_16kb/include/libswscale/version_major.h +35 -0
  163. package/android/ffmpeg_16kb/lib/arm64-v8a/libavcodec.so +0 -0
  164. package/android/ffmpeg_16kb/lib/arm64-v8a/libavdevice.so +0 -0
  165. package/android/ffmpeg_16kb/lib/arm64-v8a/libavfilter.so +0 -0
  166. package/android/ffmpeg_16kb/lib/arm64-v8a/libavformat.so +0 -0
  167. package/android/ffmpeg_16kb/lib/arm64-v8a/libavutil.so +0 -0
  168. package/android/ffmpeg_16kb/lib/arm64-v8a/libswresample.so +0 -0
  169. package/android/ffmpeg_16kb/lib/arm64-v8a/libswscale.so +0 -0
  170. package/android/ffmpeg_16kb/lib/armeabi-v7a/libavcodec_neon.so +0 -0
  171. package/android/ffmpeg_16kb/lib/armeabi-v7a/libavdevice_neon.so +0 -0
  172. package/android/ffmpeg_16kb/lib/armeabi-v7a/libavfilter_neon.so +0 -0
  173. package/android/ffmpeg_16kb/lib/armeabi-v7a/libavformat_neon.so +0 -0
  174. package/android/ffmpeg_16kb/lib/armeabi-v7a/libavutil_neon.so +0 -0
  175. package/android/ffmpeg_16kb/lib/armeabi-v7a/libswresample_neon.so +0 -0
  176. package/android/ffmpeg_16kb/lib/armeabi-v7a/libswscale_neon.so +0 -0
  177. package/android/ffmpeg_16kb/lib/x86/libavcodec.so +0 -0
  178. package/android/ffmpeg_16kb/lib/x86/libavdevice.so +0 -0
  179. package/android/ffmpeg_16kb/lib/x86/libavfilter.so +0 -0
  180. package/android/ffmpeg_16kb/lib/x86/libavformat.so +0 -0
  181. package/android/ffmpeg_16kb/lib/x86/libavutil.so +0 -0
  182. package/android/ffmpeg_16kb/lib/x86/libswresample.so +0 -0
  183. package/android/ffmpeg_16kb/lib/x86/libswscale.so +0 -0
  184. package/android/ffmpeg_16kb/lib/x86_64/libavcodec.so +0 -0
  185. package/android/ffmpeg_16kb/lib/x86_64/libavdevice.so +0 -0
  186. package/android/ffmpeg_16kb/lib/x86_64/libavfilter.so +0 -0
  187. package/android/ffmpeg_16kb/lib/x86_64/libavformat.so +0 -0
  188. package/android/ffmpeg_16kb/lib/x86_64/libavutil.so +0 -0
  189. package/android/ffmpeg_16kb/lib/x86_64/libswresample.so +0 -0
  190. package/android/ffmpeg_16kb/lib/x86_64/libswscale.so +0 -0
  191. package/android/gradle.properties +5 -0
  192. package/android/src/main/AndroidManifest.xml +3 -0
  193. package/android/src/main/AndroidManifestNew.xml +2 -0
  194. package/android/src/main/java/com/audioanalyzer/AmplitudeData.java +20 -0
  195. package/android/src/main/java/com/audioanalyzer/AudioAnalyzerModule.java +52 -0
  196. package/android/src/main/java/com/audioanalyzer/AudioAnalyzerPackage.java +28 -0
  197. package/cpp/react-native-audio-analyzer.cpp +143 -0
  198. package/cpp/react-native-audio-analyzer.h +27 -0
  199. package/ios/AudioAnalyzer.h +19 -0
  200. package/ios/AudioAnalyzer.mm +43 -0
  201. package/lib/commonjs/helpers.js +34 -0
  202. package/lib/commonjs/helpers.js.map +1 -0
  203. package/lib/commonjs/helpers.test.js +49 -0
  204. package/lib/commonjs/helpers.test.js.map +1 -0
  205. package/lib/commonjs/index.js +35 -0
  206. package/lib/commonjs/index.js.map +1 -0
  207. package/lib/module/helpers.js +27 -0
  208. package/lib/module/helpers.js.map +1 -0
  209. package/lib/module/helpers.test.js +47 -0
  210. package/lib/module/helpers.test.js.map +1 -0
  211. package/lib/module/index.js +15 -0
  212. package/lib/module/index.js.map +1 -0
  213. package/lib/typescript/src/helpers.d.ts +3 -0
  214. package/lib/typescript/src/helpers.d.ts.map +1 -0
  215. package/lib/typescript/src/helpers.test.d.ts +2 -0
  216. package/lib/typescript/src/helpers.test.d.ts.map +1 -0
  217. package/lib/typescript/src/index.d.ts +7 -0
  218. package/lib/typescript/src/index.d.ts.map +1 -0
  219. package/package.json +163 -0
  220. package/react-native-audio-analyzer.podspec +44 -0
  221. package/src/helpers.test.ts +59 -0
  222. package/src/helpers.ts +34 -0
  223. package/src/index.tsx +30 -0
@@ -0,0 +1,644 @@
1
+ /*
2
+ * This file is part of FFmpeg.
3
+ *
4
+ * FFmpeg is free software; you can redistribute it and/or
5
+ * modify it under the terms of the GNU Lesser General Public
6
+ * License as published by the Free Software Foundation; either
7
+ * version 2.1 of the License, or (at your option) any later version.
8
+ *
9
+ * FFmpeg is distributed in the hope that it will be useful,
10
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
+ * Lesser General Public License for more details.
13
+ *
14
+ * You should have received a copy of the GNU Lesser General Public
15
+ * License along with FFmpeg; if not, write to the Free Software
16
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17
+ */
18
+
19
+ #ifndef AVUTIL_INTREADWRITE_H
20
+ #define AVUTIL_INTREADWRITE_H
21
+
22
+ #include <stdint.h>
23
+ #include "libavutil/avconfig.h"
24
+ #include "attributes.h"
25
+ #include "bswap.h"
26
+
27
+ typedef union {
28
+ uint64_t u64;
29
+ uint32_t u32[2];
30
+ uint16_t u16[4];
31
+ uint8_t u8 [8];
32
+ double f64;
33
+ float f32[2];
34
+ } av_alias av_alias64;
35
+
36
+ typedef union {
37
+ uint32_t u32;
38
+ uint16_t u16[2];
39
+ uint8_t u8 [4];
40
+ float f32;
41
+ } av_alias av_alias32;
42
+
43
+ typedef union {
44
+ uint16_t u16;
45
+ uint8_t u8 [2];
46
+ } av_alias av_alias16;
47
+
48
+ /*
49
+ * Arch-specific headers can provide any combination of
50
+ * AV_[RW][BLN](16|24|32|48|64) and AV_(COPY|SWAP|ZERO)(64|128) macros.
51
+ * Preprocessor symbols must be defined, even if these are implemented
52
+ * as inline functions.
53
+ *
54
+ * R/W means read/write, B/L/N means big/little/native endianness.
55
+ * The following macros require aligned access, compared to their
56
+ * unaligned variants: AV_(COPY|SWAP|ZERO)(64|128), AV_[RW]N[8-64]A.
57
+ * Incorrect usage may range from abysmal performance to crash
58
+ * depending on the platform.
59
+ *
60
+ * The unaligned variants are AV_[RW][BLN][8-64] and AV_COPY*U.
61
+ */
62
+
63
+ #ifdef HAVE_AV_CONFIG_H
64
+
65
+ #include "config.h"
66
+
67
+ #if ARCH_ARM
68
+ # include "arm/intreadwrite.h"
69
+ #elif ARCH_AVR32
70
+ # include "avr32/intreadwrite.h"
71
+ #elif ARCH_MIPS
72
+ # include "mips/intreadwrite.h"
73
+ #elif ARCH_PPC
74
+ # include "ppc/intreadwrite.h"
75
+ #elif ARCH_TOMI
76
+ # include "tomi/intreadwrite.h"
77
+ #elif ARCH_X86
78
+ # include "x86/intreadwrite.h"
79
+ #endif
80
+
81
+ #endif /* HAVE_AV_CONFIG_H */
82
+
83
+ /*
84
+ * Map AV_RNXX <-> AV_R[BL]XX for all variants provided by per-arch headers.
85
+ */
86
+
87
+ #if AV_HAVE_BIGENDIAN
88
+
89
+ # if defined(AV_RN16) && !defined(AV_RB16)
90
+ # define AV_RB16(p) AV_RN16(p)
91
+ # elif !defined(AV_RN16) && defined(AV_RB16)
92
+ # define AV_RN16(p) AV_RB16(p)
93
+ # endif
94
+
95
+ # if defined(AV_WN16) && !defined(AV_WB16)
96
+ # define AV_WB16(p, v) AV_WN16(p, v)
97
+ # elif !defined(AV_WN16) && defined(AV_WB16)
98
+ # define AV_WN16(p, v) AV_WB16(p, v)
99
+ # endif
100
+
101
+ # if defined(AV_RN24) && !defined(AV_RB24)
102
+ # define AV_RB24(p) AV_RN24(p)
103
+ # elif !defined(AV_RN24) && defined(AV_RB24)
104
+ # define AV_RN24(p) AV_RB24(p)
105
+ # endif
106
+
107
+ # if defined(AV_WN24) && !defined(AV_WB24)
108
+ # define AV_WB24(p, v) AV_WN24(p, v)
109
+ # elif !defined(AV_WN24) && defined(AV_WB24)
110
+ # define AV_WN24(p, v) AV_WB24(p, v)
111
+ # endif
112
+
113
+ # if defined(AV_RN32) && !defined(AV_RB32)
114
+ # define AV_RB32(p) AV_RN32(p)
115
+ # elif !defined(AV_RN32) && defined(AV_RB32)
116
+ # define AV_RN32(p) AV_RB32(p)
117
+ # endif
118
+
119
+ # if defined(AV_WN32) && !defined(AV_WB32)
120
+ # define AV_WB32(p, v) AV_WN32(p, v)
121
+ # elif !defined(AV_WN32) && defined(AV_WB32)
122
+ # define AV_WN32(p, v) AV_WB32(p, v)
123
+ # endif
124
+
125
+ # if defined(AV_RN48) && !defined(AV_RB48)
126
+ # define AV_RB48(p) AV_RN48(p)
127
+ # elif !defined(AV_RN48) && defined(AV_RB48)
128
+ # define AV_RN48(p) AV_RB48(p)
129
+ # endif
130
+
131
+ # if defined(AV_WN48) && !defined(AV_WB48)
132
+ # define AV_WB48(p, v) AV_WN48(p, v)
133
+ # elif !defined(AV_WN48) && defined(AV_WB48)
134
+ # define AV_WN48(p, v) AV_WB48(p, v)
135
+ # endif
136
+
137
+ # if defined(AV_RN64) && !defined(AV_RB64)
138
+ # define AV_RB64(p) AV_RN64(p)
139
+ # elif !defined(AV_RN64) && defined(AV_RB64)
140
+ # define AV_RN64(p) AV_RB64(p)
141
+ # endif
142
+
143
+ # if defined(AV_WN64) && !defined(AV_WB64)
144
+ # define AV_WB64(p, v) AV_WN64(p, v)
145
+ # elif !defined(AV_WN64) && defined(AV_WB64)
146
+ # define AV_WN64(p, v) AV_WB64(p, v)
147
+ # endif
148
+
149
+ #else /* AV_HAVE_BIGENDIAN */
150
+
151
+ # if defined(AV_RN16) && !defined(AV_RL16)
152
+ # define AV_RL16(p) AV_RN16(p)
153
+ # elif !defined(AV_RN16) && defined(AV_RL16)
154
+ # define AV_RN16(p) AV_RL16(p)
155
+ # endif
156
+
157
+ # if defined(AV_WN16) && !defined(AV_WL16)
158
+ # define AV_WL16(p, v) AV_WN16(p, v)
159
+ # elif !defined(AV_WN16) && defined(AV_WL16)
160
+ # define AV_WN16(p, v) AV_WL16(p, v)
161
+ # endif
162
+
163
+ # if defined(AV_RN24) && !defined(AV_RL24)
164
+ # define AV_RL24(p) AV_RN24(p)
165
+ # elif !defined(AV_RN24) && defined(AV_RL24)
166
+ # define AV_RN24(p) AV_RL24(p)
167
+ # endif
168
+
169
+ # if defined(AV_WN24) && !defined(AV_WL24)
170
+ # define AV_WL24(p, v) AV_WN24(p, v)
171
+ # elif !defined(AV_WN24) && defined(AV_WL24)
172
+ # define AV_WN24(p, v) AV_WL24(p, v)
173
+ # endif
174
+
175
+ # if defined(AV_RN32) && !defined(AV_RL32)
176
+ # define AV_RL32(p) AV_RN32(p)
177
+ # elif !defined(AV_RN32) && defined(AV_RL32)
178
+ # define AV_RN32(p) AV_RL32(p)
179
+ # endif
180
+
181
+ # if defined(AV_WN32) && !defined(AV_WL32)
182
+ # define AV_WL32(p, v) AV_WN32(p, v)
183
+ # elif !defined(AV_WN32) && defined(AV_WL32)
184
+ # define AV_WN32(p, v) AV_WL32(p, v)
185
+ # endif
186
+
187
+ # if defined(AV_RN48) && !defined(AV_RL48)
188
+ # define AV_RL48(p) AV_RN48(p)
189
+ # elif !defined(AV_RN48) && defined(AV_RL48)
190
+ # define AV_RN48(p) AV_RL48(p)
191
+ # endif
192
+
193
+ # if defined(AV_WN48) && !defined(AV_WL48)
194
+ # define AV_WL48(p, v) AV_WN48(p, v)
195
+ # elif !defined(AV_WN48) && defined(AV_WL48)
196
+ # define AV_WN48(p, v) AV_WL48(p, v)
197
+ # endif
198
+
199
+ # if defined(AV_RN64) && !defined(AV_RL64)
200
+ # define AV_RL64(p) AV_RN64(p)
201
+ # elif !defined(AV_RN64) && defined(AV_RL64)
202
+ # define AV_RN64(p) AV_RL64(p)
203
+ # endif
204
+
205
+ # if defined(AV_WN64) && !defined(AV_WL64)
206
+ # define AV_WL64(p, v) AV_WN64(p, v)
207
+ # elif !defined(AV_WN64) && defined(AV_WL64)
208
+ # define AV_WN64(p, v) AV_WL64(p, v)
209
+ # endif
210
+
211
+ #endif /* !AV_HAVE_BIGENDIAN */
212
+
213
+ /*
214
+ * Define AV_[RW]N helper macros to simplify definitions not provided
215
+ * by per-arch headers.
216
+ */
217
+
218
+ #if defined(__GNUC__)
219
+
220
+ union unaligned_64 { uint64_t l; } __attribute__((packed)) av_alias;
221
+ union unaligned_32 { uint32_t l; } __attribute__((packed)) av_alias;
222
+ union unaligned_16 { uint16_t l; } __attribute__((packed)) av_alias;
223
+
224
+ # define AV_RN(s, p) (((const union unaligned_##s *) (p))->l)
225
+ # define AV_WN(s, p, v) ((((union unaligned_##s *) (p))->l) = (v))
226
+
227
+ #elif defined(_MSC_VER) && (defined(_M_ARM) || defined(_M_X64) || defined(_M_ARM64)) && AV_HAVE_FAST_UNALIGNED
228
+
229
+ # define AV_RN(s, p) (*((const __unaligned uint##s##_t*)(p)))
230
+ # define AV_WN(s, p, v) (*((__unaligned uint##s##_t*)(p)) = (v))
231
+
232
+ #elif AV_HAVE_FAST_UNALIGNED
233
+
234
+ # define AV_RN(s, p) (((const av_alias##s*)(p))->u##s)
235
+ # define AV_WN(s, p, v) (((av_alias##s*)(p))->u##s = (v))
236
+
237
+ #else
238
+
239
+ #ifndef AV_RB16
240
+ # define AV_RB16(x) \
241
+ ((((const uint8_t*)(x))[0] << 8) | \
242
+ ((const uint8_t*)(x))[1])
243
+ #endif
244
+ #ifndef AV_WB16
245
+ # define AV_WB16(p, val) do { \
246
+ uint16_t d = (val); \
247
+ ((uint8_t*)(p))[1] = (d); \
248
+ ((uint8_t*)(p))[0] = (d)>>8; \
249
+ } while(0)
250
+ #endif
251
+
252
+ #ifndef AV_RL16
253
+ # define AV_RL16(x) \
254
+ ((((const uint8_t*)(x))[1] << 8) | \
255
+ ((const uint8_t*)(x))[0])
256
+ #endif
257
+ #ifndef AV_WL16
258
+ # define AV_WL16(p, val) do { \
259
+ uint16_t d = (val); \
260
+ ((uint8_t*)(p))[0] = (d); \
261
+ ((uint8_t*)(p))[1] = (d)>>8; \
262
+ } while(0)
263
+ #endif
264
+
265
+ #ifndef AV_RB32
266
+ # define AV_RB32(x) \
267
+ (((uint32_t)((const uint8_t*)(x))[0] << 24) | \
268
+ (((const uint8_t*)(x))[1] << 16) | \
269
+ (((const uint8_t*)(x))[2] << 8) | \
270
+ ((const uint8_t*)(x))[3])
271
+ #endif
272
+ #ifndef AV_WB32
273
+ # define AV_WB32(p, val) do { \
274
+ uint32_t d = (val); \
275
+ ((uint8_t*)(p))[3] = (d); \
276
+ ((uint8_t*)(p))[2] = (d)>>8; \
277
+ ((uint8_t*)(p))[1] = (d)>>16; \
278
+ ((uint8_t*)(p))[0] = (d)>>24; \
279
+ } while(0)
280
+ #endif
281
+
282
+ #ifndef AV_RL32
283
+ # define AV_RL32(x) \
284
+ (((uint32_t)((const uint8_t*)(x))[3] << 24) | \
285
+ (((const uint8_t*)(x))[2] << 16) | \
286
+ (((const uint8_t*)(x))[1] << 8) | \
287
+ ((const uint8_t*)(x))[0])
288
+ #endif
289
+ #ifndef AV_WL32
290
+ # define AV_WL32(p, val) do { \
291
+ uint32_t d = (val); \
292
+ ((uint8_t*)(p))[0] = (d); \
293
+ ((uint8_t*)(p))[1] = (d)>>8; \
294
+ ((uint8_t*)(p))[2] = (d)>>16; \
295
+ ((uint8_t*)(p))[3] = (d)>>24; \
296
+ } while(0)
297
+ #endif
298
+
299
+ #ifndef AV_RB64
300
+ # define AV_RB64(x) \
301
+ (((uint64_t)((const uint8_t*)(x))[0] << 56) | \
302
+ ((uint64_t)((const uint8_t*)(x))[1] << 48) | \
303
+ ((uint64_t)((const uint8_t*)(x))[2] << 40) | \
304
+ ((uint64_t)((const uint8_t*)(x))[3] << 32) | \
305
+ ((uint64_t)((const uint8_t*)(x))[4] << 24) | \
306
+ ((uint64_t)((const uint8_t*)(x))[5] << 16) | \
307
+ ((uint64_t)((const uint8_t*)(x))[6] << 8) | \
308
+ (uint64_t)((const uint8_t*)(x))[7])
309
+ #endif
310
+ #ifndef AV_WB64
311
+ # define AV_WB64(p, val) do { \
312
+ uint64_t d = (val); \
313
+ ((uint8_t*)(p))[7] = (d); \
314
+ ((uint8_t*)(p))[6] = (d)>>8; \
315
+ ((uint8_t*)(p))[5] = (d)>>16; \
316
+ ((uint8_t*)(p))[4] = (d)>>24; \
317
+ ((uint8_t*)(p))[3] = (d)>>32; \
318
+ ((uint8_t*)(p))[2] = (d)>>40; \
319
+ ((uint8_t*)(p))[1] = (d)>>48; \
320
+ ((uint8_t*)(p))[0] = (d)>>56; \
321
+ } while(0)
322
+ #endif
323
+
324
+ #ifndef AV_RL64
325
+ # define AV_RL64(x) \
326
+ (((uint64_t)((const uint8_t*)(x))[7] << 56) | \
327
+ ((uint64_t)((const uint8_t*)(x))[6] << 48) | \
328
+ ((uint64_t)((const uint8_t*)(x))[5] << 40) | \
329
+ ((uint64_t)((const uint8_t*)(x))[4] << 32) | \
330
+ ((uint64_t)((const uint8_t*)(x))[3] << 24) | \
331
+ ((uint64_t)((const uint8_t*)(x))[2] << 16) | \
332
+ ((uint64_t)((const uint8_t*)(x))[1] << 8) | \
333
+ (uint64_t)((const uint8_t*)(x))[0])
334
+ #endif
335
+ #ifndef AV_WL64
336
+ # define AV_WL64(p, val) do { \
337
+ uint64_t d = (val); \
338
+ ((uint8_t*)(p))[0] = (d); \
339
+ ((uint8_t*)(p))[1] = (d)>>8; \
340
+ ((uint8_t*)(p))[2] = (d)>>16; \
341
+ ((uint8_t*)(p))[3] = (d)>>24; \
342
+ ((uint8_t*)(p))[4] = (d)>>32; \
343
+ ((uint8_t*)(p))[5] = (d)>>40; \
344
+ ((uint8_t*)(p))[6] = (d)>>48; \
345
+ ((uint8_t*)(p))[7] = (d)>>56; \
346
+ } while(0)
347
+ #endif
348
+
349
+ #if AV_HAVE_BIGENDIAN
350
+ # define AV_RN(s, p) AV_RB##s(p)
351
+ # define AV_WN(s, p, v) AV_WB##s(p, v)
352
+ #else
353
+ # define AV_RN(s, p) AV_RL##s(p)
354
+ # define AV_WN(s, p, v) AV_WL##s(p, v)
355
+ #endif
356
+
357
+ #endif /* HAVE_FAST_UNALIGNED */
358
+
359
+ #ifndef AV_RN16
360
+ # define AV_RN16(p) AV_RN(16, p)
361
+ #endif
362
+
363
+ #ifndef AV_RN32
364
+ # define AV_RN32(p) AV_RN(32, p)
365
+ #endif
366
+
367
+ #ifndef AV_RN64
368
+ # define AV_RN64(p) AV_RN(64, p)
369
+ #endif
370
+
371
+ #ifndef AV_WN16
372
+ # define AV_WN16(p, v) AV_WN(16, p, v)
373
+ #endif
374
+
375
+ #ifndef AV_WN32
376
+ # define AV_WN32(p, v) AV_WN(32, p, v)
377
+ #endif
378
+
379
+ #ifndef AV_WN64
380
+ # define AV_WN64(p, v) AV_WN(64, p, v)
381
+ #endif
382
+
383
+ #if AV_HAVE_BIGENDIAN
384
+ # define AV_RB(s, p) AV_RN##s(p)
385
+ # define AV_WB(s, p, v) AV_WN##s(p, v)
386
+ # define AV_RL(s, p) av_bswap##s(AV_RN##s(p))
387
+ # define AV_WL(s, p, v) AV_WN##s(p, av_bswap##s(v))
388
+ #else
389
+ # define AV_RB(s, p) av_bswap##s(AV_RN##s(p))
390
+ # define AV_WB(s, p, v) AV_WN##s(p, av_bswap##s(v))
391
+ # define AV_RL(s, p) AV_RN##s(p)
392
+ # define AV_WL(s, p, v) AV_WN##s(p, v)
393
+ #endif
394
+
395
+ #define AV_RB8(x) (((const uint8_t*)(x))[0])
396
+ #define AV_WB8(p, d) do { ((uint8_t*)(p))[0] = (d); } while(0)
397
+
398
+ #define AV_RL8(x) AV_RB8(x)
399
+ #define AV_WL8(p, d) AV_WB8(p, d)
400
+
401
+ #ifndef AV_RB16
402
+ # define AV_RB16(p) AV_RB(16, p)
403
+ #endif
404
+ #ifndef AV_WB16
405
+ # define AV_WB16(p, v) AV_WB(16, p, v)
406
+ #endif
407
+
408
+ #ifndef AV_RL16
409
+ # define AV_RL16(p) AV_RL(16, p)
410
+ #endif
411
+ #ifndef AV_WL16
412
+ # define AV_WL16(p, v) AV_WL(16, p, v)
413
+ #endif
414
+
415
+ #ifndef AV_RB32
416
+ # define AV_RB32(p) AV_RB(32, p)
417
+ #endif
418
+ #ifndef AV_WB32
419
+ # define AV_WB32(p, v) AV_WB(32, p, v)
420
+ #endif
421
+
422
+ #ifndef AV_RL32
423
+ # define AV_RL32(p) AV_RL(32, p)
424
+ #endif
425
+ #ifndef AV_WL32
426
+ # define AV_WL32(p, v) AV_WL(32, p, v)
427
+ #endif
428
+
429
+ #ifndef AV_RB64
430
+ # define AV_RB64(p) AV_RB(64, p)
431
+ #endif
432
+ #ifndef AV_WB64
433
+ # define AV_WB64(p, v) AV_WB(64, p, v)
434
+ #endif
435
+
436
+ #ifndef AV_RL64
437
+ # define AV_RL64(p) AV_RL(64, p)
438
+ #endif
439
+ #ifndef AV_WL64
440
+ # define AV_WL64(p, v) AV_WL(64, p, v)
441
+ #endif
442
+
443
+ #ifndef AV_RB24
444
+ # define AV_RB24(x) \
445
+ ((((const uint8_t*)(x))[0] << 16) | \
446
+ (((const uint8_t*)(x))[1] << 8) | \
447
+ ((const uint8_t*)(x))[2])
448
+ #endif
449
+ #ifndef AV_WB24
450
+ # define AV_WB24(p, d) do { \
451
+ ((uint8_t*)(p))[2] = (d); \
452
+ ((uint8_t*)(p))[1] = (d)>>8; \
453
+ ((uint8_t*)(p))[0] = (d)>>16; \
454
+ } while(0)
455
+ #endif
456
+
457
+ #ifndef AV_RL24
458
+ # define AV_RL24(x) \
459
+ ((((const uint8_t*)(x))[2] << 16) | \
460
+ (((const uint8_t*)(x))[1] << 8) | \
461
+ ((const uint8_t*)(x))[0])
462
+ #endif
463
+ #ifndef AV_WL24
464
+ # define AV_WL24(p, d) do { \
465
+ ((uint8_t*)(p))[0] = (d); \
466
+ ((uint8_t*)(p))[1] = (d)>>8; \
467
+ ((uint8_t*)(p))[2] = (d)>>16; \
468
+ } while(0)
469
+ #endif
470
+
471
+ #ifndef AV_RB48
472
+ # define AV_RB48(x) \
473
+ (((uint64_t)((const uint8_t*)(x))[0] << 40) | \
474
+ ((uint64_t)((const uint8_t*)(x))[1] << 32) | \
475
+ ((uint64_t)((const uint8_t*)(x))[2] << 24) | \
476
+ ((uint64_t)((const uint8_t*)(x))[3] << 16) | \
477
+ ((uint64_t)((const uint8_t*)(x))[4] << 8) | \
478
+ (uint64_t)((const uint8_t*)(x))[5])
479
+ #endif
480
+ #ifndef AV_WB48
481
+ # define AV_WB48(p, darg) do { \
482
+ uint64_t d = (darg); \
483
+ ((uint8_t*)(p))[5] = (d); \
484
+ ((uint8_t*)(p))[4] = (d)>>8; \
485
+ ((uint8_t*)(p))[3] = (d)>>16; \
486
+ ((uint8_t*)(p))[2] = (d)>>24; \
487
+ ((uint8_t*)(p))[1] = (d)>>32; \
488
+ ((uint8_t*)(p))[0] = (d)>>40; \
489
+ } while(0)
490
+ #endif
491
+
492
+ #ifndef AV_RL48
493
+ # define AV_RL48(x) \
494
+ (((uint64_t)((const uint8_t*)(x))[5] << 40) | \
495
+ ((uint64_t)((const uint8_t*)(x))[4] << 32) | \
496
+ ((uint64_t)((const uint8_t*)(x))[3] << 24) | \
497
+ ((uint64_t)((const uint8_t*)(x))[2] << 16) | \
498
+ ((uint64_t)((const uint8_t*)(x))[1] << 8) | \
499
+ (uint64_t)((const uint8_t*)(x))[0])
500
+ #endif
501
+ #ifndef AV_WL48
502
+ # define AV_WL48(p, darg) do { \
503
+ uint64_t d = (darg); \
504
+ ((uint8_t*)(p))[0] = (d); \
505
+ ((uint8_t*)(p))[1] = (d)>>8; \
506
+ ((uint8_t*)(p))[2] = (d)>>16; \
507
+ ((uint8_t*)(p))[3] = (d)>>24; \
508
+ ((uint8_t*)(p))[4] = (d)>>32; \
509
+ ((uint8_t*)(p))[5] = (d)>>40; \
510
+ } while(0)
511
+ #endif
512
+
513
+ /*
514
+ * The AV_[RW]NA macros access naturally aligned data
515
+ * in a type-safe way.
516
+ */
517
+
518
+ #define AV_RNA(s, p) (((const av_alias##s*)(p))->u##s)
519
+ #define AV_WNA(s, p, v) (((av_alias##s*)(p))->u##s = (v))
520
+
521
+ #ifndef AV_RN16A
522
+ # define AV_RN16A(p) AV_RNA(16, p)
523
+ #endif
524
+
525
+ #ifndef AV_RN32A
526
+ # define AV_RN32A(p) AV_RNA(32, p)
527
+ #endif
528
+
529
+ #ifndef AV_RN64A
530
+ # define AV_RN64A(p) AV_RNA(64, p)
531
+ #endif
532
+
533
+ #ifndef AV_WN16A
534
+ # define AV_WN16A(p, v) AV_WNA(16, p, v)
535
+ #endif
536
+
537
+ #ifndef AV_WN32A
538
+ # define AV_WN32A(p, v) AV_WNA(32, p, v)
539
+ #endif
540
+
541
+ #ifndef AV_WN64A
542
+ # define AV_WN64A(p, v) AV_WNA(64, p, v)
543
+ #endif
544
+
545
+ #if AV_HAVE_BIGENDIAN
546
+ # define AV_RLA(s, p) av_bswap##s(AV_RN##s##A(p))
547
+ # define AV_WLA(s, p, v) AV_WN##s##A(p, av_bswap##s(v))
548
+ #else
549
+ # define AV_RLA(s, p) AV_RN##s##A(p)
550
+ # define AV_WLA(s, p, v) AV_WN##s##A(p, v)
551
+ #endif
552
+
553
+ #ifndef AV_RL64A
554
+ # define AV_RL64A(p) AV_RLA(64, p)
555
+ #endif
556
+ #ifndef AV_WL64A
557
+ # define AV_WL64A(p, v) AV_WLA(64, p, v)
558
+ #endif
559
+
560
+ /*
561
+ * The AV_COPYxxU macros are suitable for copying data to/from unaligned
562
+ * memory locations.
563
+ */
564
+
565
+ #define AV_COPYU(n, d, s) AV_WN##n(d, AV_RN##n(s));
566
+
567
+ #ifndef AV_COPY16U
568
+ # define AV_COPY16U(d, s) AV_COPYU(16, d, s)
569
+ #endif
570
+
571
+ #ifndef AV_COPY32U
572
+ # define AV_COPY32U(d, s) AV_COPYU(32, d, s)
573
+ #endif
574
+
575
+ #ifndef AV_COPY64U
576
+ # define AV_COPY64U(d, s) AV_COPYU(64, d, s)
577
+ #endif
578
+
579
+ #ifndef AV_COPY128U
580
+ # define AV_COPY128U(d, s) \
581
+ do { \
582
+ AV_COPY64U(d, s); \
583
+ AV_COPY64U((char *)(d) + 8, (const char *)(s) + 8); \
584
+ } while(0)
585
+ #endif
586
+
587
+ /* Parameters for AV_COPY*, AV_SWAP*, AV_ZERO* must be
588
+ * naturally aligned. They may be implemented using MMX,
589
+ * so emms_c() must be called before using any float code
590
+ * afterwards.
591
+ */
592
+
593
+ #define AV_COPY(n, d, s) \
594
+ (((av_alias##n*)(d))->u##n = ((const av_alias##n*)(s))->u##n)
595
+
596
+ #ifndef AV_COPY16
597
+ # define AV_COPY16(d, s) AV_COPY(16, d, s)
598
+ #endif
599
+
600
+ #ifndef AV_COPY32
601
+ # define AV_COPY32(d, s) AV_COPY(32, d, s)
602
+ #endif
603
+
604
+ #ifndef AV_COPY64
605
+ # define AV_COPY64(d, s) AV_COPY(64, d, s)
606
+ #endif
607
+
608
+ #ifndef AV_COPY128
609
+ # define AV_COPY128(d, s) \
610
+ do { \
611
+ AV_COPY64(d, s); \
612
+ AV_COPY64((char*)(d)+8, (char*)(s)+8); \
613
+ } while(0)
614
+ #endif
615
+
616
+ #define AV_SWAP(n, a, b) FFSWAP(av_alias##n, *(av_alias##n*)(a), *(av_alias##n*)(b))
617
+
618
+ #ifndef AV_SWAP64
619
+ # define AV_SWAP64(a, b) AV_SWAP(64, a, b)
620
+ #endif
621
+
622
+ #define AV_ZERO(n, d) (((av_alias##n*)(d))->u##n = 0)
623
+
624
+ #ifndef AV_ZERO16
625
+ # define AV_ZERO16(d) AV_ZERO(16, d)
626
+ #endif
627
+
628
+ #ifndef AV_ZERO32
629
+ # define AV_ZERO32(d) AV_ZERO(32, d)
630
+ #endif
631
+
632
+ #ifndef AV_ZERO64
633
+ # define AV_ZERO64(d) AV_ZERO(64, d)
634
+ #endif
635
+
636
+ #ifndef AV_ZERO128
637
+ # define AV_ZERO128(d) \
638
+ do { \
639
+ AV_ZERO64(d); \
640
+ AV_ZERO64((char*)(d)+8); \
641
+ } while(0)
642
+ #endif
643
+
644
+ #endif /* AVUTIL_INTREADWRITE_H */