Skip to content

Commit 4b64590

Browse files
MagicalTuxclaude
andcommitted
update libopus to 1.5.2
- Update embedded libopus from 1.3.1 to 1.5.2 - Exclude AVX/AVX2 files (require per-file CFLAGS not supported by CGO) - Fix TestCodecFloat32 to properly slice encoded data before decoding - Add new extensions.c wrapper Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent c50054a commit 4b64590

File tree

656 files changed

+561805
-12332
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

656 files changed

+561805
-12332
lines changed

config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ package opus
66
#cgo windows LDFLAGS: -lssp
77
88
// add includes needed for opus, including building the actual opus lib
9-
#cgo CFLAGS: -Iopus-1.3.1 -Iopus-1.3.1/include -Iopus-1.3.1/celt -Iopus-1.3.1/silk -Iopus-1.3.1/silk/float
9+
#cgo CFLAGS: -Iopus-1.5.2 -Iopus-1.5.2/include -Iopus-1.5.2/celt -Iopus-1.5.2/silk -Iopus-1.5.2/silk/float
1010
#cgo LDFLAGS: -lm
1111
*/
1212
import "C"

config.h

Lines changed: 36 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@
1010
/* Custom modes */
1111
/* #undef CUSTOM_MODES */
1212

13+
/* Disable DNN debug float */
14+
/* #undef DISABLE_DEBUG_FLOAT */
15+
16+
/* Disable dot product instructions */
17+
/* #undef DISABLE_DOT_PROD */
18+
1319
/* Do not build the float API */
1420
/* #undef DISABLE_FLOAT_API */
1521

@@ -19,9 +25,24 @@
1925
/* Assertions */
2026
/* #undef ENABLE_ASSERTIONS */
2127

28+
/* Deep PLC */
29+
/* #undef ENABLE_DEEP_PLC */
30+
31+
/* DRED */
32+
/* #undef ENABLE_DRED */
33+
2234
/* Hardening */
2335
#define ENABLE_HARDENING 1
2436

37+
/* LOSSGEN */
38+
/* #undef ENABLE_LOSSGEN */
39+
40+
/* Enable Opus Speech Coding Enhancement */
41+
/* #undef ENABLE_OSCE */
42+
43+
/* Enable dumping of OSCE training data */
44+
/* #undef ENABLE_OSCE_TRAINING_DATA */
45+
2546
/* Debug fixed-point implementation */
2647
/* #undef FIXED_DEBUG */
2748

@@ -52,12 +73,12 @@
5273
/* Define to 1 if you have the `lrintf' function. */
5374
#define HAVE_LRINTF 1
5475

55-
/* Define to 1 if you have the <memory.h> header file. */
56-
#define HAVE_MEMORY_H 1
57-
5876
/* Define to 1 if you have the <stdint.h> header file. */
5977
#define HAVE_STDINT_H 1
6078

79+
/* Define to 1 if you have the <stdio.h> header file. */
80+
#define HAVE_STDIO_H 1
81+
6182
/* Define to 1 if you have the <stdlib.h> header file. */
6283
#define HAVE_STDLIB_H 1
6384

@@ -97,6 +118,9 @@
97118
/* Use ARM NEON inline asm optimizations */
98119
/* #undef OPUS_ARM_INLINE_NEON */
99120

121+
/* Compiler supports Aarch64 DOTPROD Intrinsics */
122+
/* #undef OPUS_ARM_MAY_HAVE_DOTPROD */
123+
100124
/* Define if assembler supports EDSP instructions */
101125
/* #undef OPUS_ARM_MAY_HAVE_EDSP */
102126

@@ -112,6 +136,9 @@
112136
/* Define if binary requires Aarch64 Neon Intrinsics */
113137
/* #undef OPUS_ARM_PRESUME_AARCH64_NEON_INTR */
114138

139+
/* Define if binary requires Aarch64 dotprod Intrinsics */
140+
/* #undef OPUS_ARM_PRESUME_DOTPROD */
141+
115142
/* Define if binary requires EDSP instruction support */
116143
/* #undef OPUS_ARM_PRESUME_EDSP */
117144

@@ -133,8 +160,8 @@
133160
/* Use run-time CPU capabilities detection */
134161
#define OPUS_HAVE_RTCD 1
135162

136-
/* Compiler supports X86 AVX Intrinsics */
137-
#define OPUS_X86_MAY_HAVE_AVX 1
163+
/* Compiler supports X86 AVX2 Intrinsics */
164+
/* #undef OPUS_X86_MAY_HAVE_AVX2 */
138165

139166
/* Compiler supports X86 SSE Intrinsics */
140167
#define OPUS_X86_MAY_HAVE_SSE 1
@@ -145,8 +172,8 @@
145172
/* Compiler supports X86 SSE4.1 Intrinsics */
146173
//#define OPUS_X86_MAY_HAVE_SSE4_1 1
147174

148-
/* Define if binary requires AVX intrinsics support */
149-
/* #undef OPUS_X86_PRESUME_AVX */
175+
/* Define if binary requires AVX2 intrinsics support */
176+
/* #undef OPUS_X86_PRESUME_AVX2 */
150177

151178
/* Define if binary requires SSE intrinsics support */
152179
#define OPUS_X86_PRESUME_SSE 1
@@ -164,7 +191,7 @@
164191
#define PACKAGE_NAME "opus"
165192

166193
/* Define to the full name and version of this package. */
167-
#define PACKAGE_STRING "opus 1.3.1"
194+
#define PACKAGE_STRING "opus 1.5.2"
168195

169196
/* Define to the one symbol short name of this package. */
170197
#define PACKAGE_TARNAME "opus"
@@ -173,7 +200,7 @@
173200
#define PACKAGE_URL ""
174201

175202
/* Define to the version of this package. */
176-
#define PACKAGE_VERSION "1.3.1"
203+
#define PACKAGE_VERSION "1.5.2"
177204

178205
/* Define to 1 if you have the ANSI C header files. */
179206
#define STDC_HEADERS 1

generate.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
OPUS_VERSION="1.3.1"
3+
OPUS_VERSION="1.5.2"
44

55
# OK so ideally I'd like to have something like:
66
# #cgo SOURCES opus/a.c opus/b.c etc...
@@ -62,6 +62,9 @@ for dir in src celt silk celt/arm celt/x86 silk/float silk/arm silk/x86; do
6262
*sse4_1*)
6363
# go won't let us compile for sse4-1
6464
;;
65+
*avx*)
66+
# go won't let us compile for avx/avx2 without per-file CFLAGS
67+
;;
6568
src/opus_compare.c)
6669
;;
6770
*)

inc-celt-arm-arm-celt-map.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
package opus
44

55
/*
6-
#include <opus-1.3.1/celt/arm/arm_celt_map.c>
6+
#include <opus-1.5.2/celt/arm/arm_celt_map.c>
77
*/
88
import "C"

inc-celt-arm-armcpu.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
package opus
44

55
/*
6-
#include <opus-1.3.1/celt/arm/armcpu.c>
6+
#include <opus-1.5.2/celt/arm/armcpu.c>
77
*/
88
import "C"

inc-celt-arm-celt-fft-ne10.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
package opus
44

55
/*
6-
#include <opus-1.3.1/celt/arm/celt_fft_ne10.c>
6+
#include <opus-1.5.2/celt/arm/celt_fft_ne10.c>
77
*/
88
import "C"

inc-celt-arm-celt-mdct-ne10.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
package opus
44

55
/*
6-
#include <opus-1.3.1/celt/arm/celt_mdct_ne10.c>
6+
#include <opus-1.5.2/celt/arm/celt_mdct_ne10.c>
77
*/
88
import "C"

inc-celt-arm-celt-neon-intr.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
package opus
44

55
/*
6-
#include <opus-1.3.1/celt/arm/celt_neon_intr.c>
6+
#include <opus-1.5.2/celt/arm/celt_neon_intr.c>
77
*/
88
import "C"

inc-celt-arm-pitch-neon-intr.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
package opus
44

55
/*
6-
#include <opus-1.3.1/celt/arm/pitch_neon_intr.c>
6+
#include <opus-1.5.2/celt/arm/pitch_neon_intr.c>
77
*/
88
import "C"

inc-celt-bands.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package opus
22

33
/*
4-
#include <opus-1.3.1/celt/bands.c>
4+
#include <opus-1.5.2/celt/bands.c>
55
*/
66
import "C"

0 commit comments

Comments
 (0)