|
| 1 | +-- compat.opus — libopus, the Opus audio codec (RFC 6716; Xiph.Org, Skype, |
| 2 | +-- Mozilla, Amazon and others), BSD-3-Clause. |
| 3 | +-- |
| 4 | +-- The reference encoder and decoder of Opus: SILK for speech, CELT for music, |
| 5 | +-- and the hybrid of both, at 8–48 kHz, mono to 255 channels (multistream and |
| 6 | +-- ambisonic projection), with the repacketizer and the packet parsers. The |
| 7 | +-- codec half of compat.opusfile, which reads Ogg Opus files over it. |
| 8 | +-- |
| 9 | +-- ───────────────────────────────────────────────────────────────────────── |
| 10 | +-- THE RELEASE TARBALL, NOT THE TAG ARCHIVE |
| 11 | +-- |
| 12 | +-- 1.6.1 is published on downloads.xiph.org (its SHA256SUMS.txt gives this |
| 13 | +-- sha256); the GitHub repository has the v1.6.1 tag but no release. The |
| 14 | +-- tarball is what a build without autotools needs: `package_version`, and |
| 15 | +-- the DNN model data (dnn/*_data.c) that the tag archive leaves to |
| 16 | +-- `autogen.sh` to download. This build compiles none of dnn/, but a future |
| 17 | +-- deep-PLC / DRED / OSCE feature could, from the same bytes. |
| 18 | +-- |
| 19 | +-- ───────────────────────────────────────────────────────────────────────── |
| 20 | +-- WHAT IS BUILT: UPSTREAM'S DEFAULT FLOATING-POINT LIBRARY, IN PLAIN C |
| 21 | +-- |
| 22 | +-- The sources are the lists of upstream's own makefiles for a float build |
| 23 | +-- (CMake and meson read the same .mk files): |
| 24 | +-- |
| 25 | +-- celt_sources.mk CELT_SOURCES (18 files; mini_kfft.c is QEXT-only) |
| 26 | +-- silk_sources.mk SILK_SOURCES (every silk/*.c) + SILK_SOURCES_FLOAT |
| 27 | +-- (every silk/float/*.c) |
| 28 | +-- opus_sources.mk OPUS_SOURCES + OPUS_SOURCES_FLOAT (14 files; the |
| 29 | +-- demos and comparison tools in src/ are not library code) |
| 30 | +-- |
| 31 | +-- The features are upstream's defaults in configure, CMake and meson alike: |
| 32 | +-- floating point (not FIXED_POINT), the float API, hardening on, assertions, |
| 33 | +-- custom modes, fuzzing and FLOAT_APPROX off, and the four optional |
| 34 | +-- extensions OFF — deep PLC, DRED and OSCE (the DNN features, `dnn/`) and |
| 35 | +-- QEXT (the 96 kHz quality extension). Stack arrays are C99 VLAs |
| 36 | +-- (VAR_ARRAYS, which CMake picks on every compiler that has them, as clang |
| 37 | +-- and gcc do on all three platforms here). |
| 38 | +-- |
| 39 | +-- No SIMD and no run-time CPU detection. Upstream's x86 intrinsics are per |
| 40 | +-- file: pitch_sse4_1.c needs -msse4.1, NSQ_del_dec_avx2.c -mavx2, and so on, |
| 41 | +-- each behind OPUS_X86_MAY_HAVE_* and the RTCD tables. A descriptor's flags |
| 42 | +-- are per package and its platform blocks per OS, not per architecture, so |
| 43 | +-- neither those files nor the aarch64-only NEON files can be selected |
| 44 | +-- correctly here; the C paths they replace are the reference implementation |
| 45 | +-- and are what upstream's own --disable-intrinsics builds run. The one |
| 46 | +-- architecture-specific line left is upstream's: celt/float_cast.h converts |
| 47 | +-- float to int with cvtss2si under __SSE__ and with vcvtns on __aarch64__, |
| 48 | +-- from the compiler's own predefined macros. |
| 49 | +-- |
| 50 | +-- ───────────────────────────────────────────────────────────────────────── |
| 51 | +-- A GENERATED config.h, AND ONLY PUBLIC HEADERS FOR CONSUMERS |
| 52 | +-- |
| 53 | +-- Every source includes "config.h" under HAVE_CONFIG_H. The one here |
| 54 | +-- (mcpp_generated/config.h) defines what configure would: OPUS_BUILD, |
| 55 | +-- PACKAGE_VERSION "1.6.1" (so opus_get_version_string() reads |
| 56 | +-- "libopus 1.6.1"), VAR_ARRAYS, HAVE_LRINT/HAVE_LRINTF and ENABLE_HARDENING. |
| 57 | +-- It and the internal header directories (the tarball root, celt, silk, |
| 58 | +-- silk/float — "arch.h", "debug.h", "config.h"…) are PRIVATE include |
| 59 | +-- directories of each platform block, the shape compat.sheenbidi uses: the |
| 60 | +-- -I reaches this package's translation units and not its consumers', whose |
| 61 | +-- include path gets only `*/include` — <opus.h>, <opus_multistream.h>, |
| 62 | +-- <opus_projection.h>, <opus_defines.h>, <opus_types.h>, the spelling |
| 63 | +-- upstream's pkg-config gives (-I${includedir}/opus) and opusfile.h uses. |
| 64 | +-- |
| 65 | +-- On Linux and macOS the library is compiled with -fvisibility=hidden, as |
| 66 | +-- upstream's configure does: OPUS_EXPORT marks the public functions visible |
| 67 | +-- when OPUS_BUILD is defined, so a shared object linking this archive exports |
| 68 | +-- opus_* and not the codec's internal celt_* / silk_* symbols. |
| 69 | +-- |
| 70 | +-- kind = "lib": a static library. OPUS_EXPORT is dllexport only under |
| 71 | +-- DLL_EXPORT, which is not defined, so Windows consumers need no define. |
| 72 | +package = { |
| 73 | + spec = "1", |
| 74 | + namespace = "compat", |
| 75 | + name = "opus", |
| 76 | + description = "libopus 1.6.1 — the Opus audio codec (RFC 6716), encoder and decoder, floating point, BSD-3-Clause", |
| 77 | + licenses = {"BSD-3-Clause"}, |
| 78 | + repo = "https://github.com/xiph/opus", |
| 79 | + type = "package", |
| 80 | + |
| 81 | + extensions = { |
| 82 | + autoupdate = { |
| 83 | + tag = "v${version}", |
| 84 | + url = "https://downloads.xiph.org/releases/opus/opus-${version}.tar.gz", |
| 85 | + }, |
| 86 | + }, |
| 87 | + |
| 88 | + xpm = { |
| 89 | + linux = { |
| 90 | + ["1.6.1"] = { |
| 91 | + url = { |
| 92 | + GLOBAL = "https://downloads.xiph.org/releases/opus/opus-1.6.1.tar.gz", |
| 93 | + CN = "https://gitcode.com/mcpp-res/opus/releases/download/1.6.1/opus-1.6.1.tar.gz", |
| 94 | + }, |
| 95 | + sha256 = "6ffcb593207be92584df15b32466ed64bbec99109f007c82205f0194572411a1", |
| 96 | + }, |
| 97 | + }, |
| 98 | + macosx = { |
| 99 | + ["1.6.1"] = { |
| 100 | + url = { |
| 101 | + GLOBAL = "https://downloads.xiph.org/releases/opus/opus-1.6.1.tar.gz", |
| 102 | + CN = "https://gitcode.com/mcpp-res/opus/releases/download/1.6.1/opus-1.6.1.tar.gz", |
| 103 | + }, |
| 104 | + sha256 = "6ffcb593207be92584df15b32466ed64bbec99109f007c82205f0194572411a1", |
| 105 | + }, |
| 106 | + }, |
| 107 | + windows = { |
| 108 | + ["1.6.1"] = { |
| 109 | + url = { |
| 110 | + GLOBAL = "https://downloads.xiph.org/releases/opus/opus-1.6.1.tar.gz", |
| 111 | + CN = "https://gitcode.com/mcpp-res/opus/releases/download/1.6.1/opus-1.6.1.tar.gz", |
| 112 | + }, |
| 113 | + sha256 = "6ffcb593207be92584df15b32466ed64bbec99109f007c82205f0194572411a1", |
| 114 | + }, |
| 115 | + }, |
| 116 | + }, |
| 117 | + |
| 118 | + mcpp = { |
| 119 | + language = "c++23", |
| 120 | + import_std = false, |
| 121 | + c_standard = "c99", |
| 122 | + |
| 123 | + -- The public headers: <opus.h>, <opus_multistream.h>, <opus_projection.h>. |
| 124 | + include_dirs = { "*/include" }, |
| 125 | + |
| 126 | + sources = { |
| 127 | + "*/celt/bands.c", |
| 128 | + "*/celt/celt.c", |
| 129 | + "*/celt/celt_encoder.c", |
| 130 | + "*/celt/celt_decoder.c", |
| 131 | + "*/celt/cwrs.c", |
| 132 | + "*/celt/entcode.c", |
| 133 | + "*/celt/entdec.c", |
| 134 | + "*/celt/entenc.c", |
| 135 | + "*/celt/kiss_fft.c", |
| 136 | + "*/celt/laplace.c", |
| 137 | + "*/celt/mathops.c", |
| 138 | + "*/celt/mdct.c", |
| 139 | + "*/celt/modes.c", |
| 140 | + "*/celt/pitch.c", |
| 141 | + "*/celt/celt_lpc.c", |
| 142 | + "*/celt/quant_bands.c", |
| 143 | + "*/celt/rate.c", |
| 144 | + "*/celt/vq.c", |
| 145 | + "*/silk/*.c", |
| 146 | + "*/silk/float/*.c", |
| 147 | + "*/src/opus.c", |
| 148 | + "*/src/opus_decoder.c", |
| 149 | + "*/src/opus_encoder.c", |
| 150 | + "*/src/extensions.c", |
| 151 | + "*/src/opus_multistream.c", |
| 152 | + "*/src/opus_multistream_encoder.c", |
| 153 | + "*/src/opus_multistream_decoder.c", |
| 154 | + "*/src/repacketizer.c", |
| 155 | + "*/src/opus_projection_encoder.c", |
| 156 | + "*/src/opus_projection_decoder.c", |
| 157 | + "*/src/mapping_matrix.c", |
| 158 | + "*/src/analysis.c", |
| 159 | + "*/src/mlp.c", |
| 160 | + "*/src/mlp_data.c", |
| 161 | + }, |
| 162 | + cflags = { "-DHAVE_CONFIG_H" }, |
| 163 | + |
| 164 | + generated_files = { |
| 165 | + ["mcpp_generated/config.h"] = [==[ |
| 166 | +/* config.h for libopus 1.6.1 — what upstream's configure defines for its |
| 167 | + default floating-point build without intrinsics. */ |
| 168 | +#ifndef MCPP_COMPAT_OPUS_CONFIG_H |
| 169 | +#define MCPP_COMPAT_OPUS_CONFIG_H |
| 170 | +
|
| 171 | +#define OPUS_BUILD 1 |
| 172 | +#define PACKAGE_VERSION "1.6.1" |
| 173 | +
|
| 174 | +/* C99 variable-length arrays for the codec's stack buffers. */ |
| 175 | +#define VAR_ARRAYS 1 |
| 176 | +
|
| 177 | +#define HAVE_LRINT 1 |
| 178 | +#define HAVE_LRINTF 1 |
| 179 | +
|
| 180 | +/* Run-time checks that are cheap and safe for use in production (default on). */ |
| 181 | +#define ENABLE_HARDENING 1 |
| 182 | +
|
| 183 | +#endif |
| 184 | +]==], |
| 185 | + }, |
| 186 | + |
| 187 | + linux = { |
| 188 | + include_dirs = { "*", "*/celt", "*/silk", "*/silk/float", "mcpp_generated" }, |
| 189 | + private_include_dirs = { "*", "*/celt", "*/silk", "*/silk/float", "mcpp_generated" }, |
| 190 | + -- Linked into shared objects by its consumers: position independent; |
| 191 | + -- only the OPUS_EXPORT functions visible, as upstream's configure does. |
| 192 | + cflags = { "-fPIC", "-fvisibility=hidden" }, |
| 193 | + ldflags = { "-lm" }, |
| 194 | + }, |
| 195 | + macosx = { |
| 196 | + include_dirs = { "*", "*/celt", "*/silk", "*/silk/float", "mcpp_generated" }, |
| 197 | + private_include_dirs = { "*", "*/celt", "*/silk", "*/silk/float", "mcpp_generated" }, |
| 198 | + cflags = { "-fPIC", "-fvisibility=hidden" }, |
| 199 | + }, |
| 200 | + -- No -fPIC: PE/COFF has no such distinction, and clang rejects it for |
| 201 | + -- the MSVC target. |
| 202 | + windows = { |
| 203 | + include_dirs = { "*", "*/celt", "*/silk", "*/silk/float", "mcpp_generated" }, |
| 204 | + private_include_dirs = { "*", "*/celt", "*/silk", "*/silk/float", "mcpp_generated" }, |
| 205 | + }, |
| 206 | + |
| 207 | + targets = { opus = { kind = "lib" } }, |
| 208 | + deps = {}, |
| 209 | + }, |
| 210 | +} |
0 commit comments