libopustooling

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 5, 2026 License: BSD-3-Clause Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// DefaultVersion is the pinned libopus reference used by fixture tooling.
	DefaultVersion = "1.6.1"

	// ScalarDNNBuildCFLAGS keeps x86 libopus helper builds on the generic DNN
	// path. --disable-intrinsics disables libopus RTCD feature selection, but
	// x86 compilers still predefine __SSE2__, which makes dnn/vec.h include
	// vec_avx.h unless the helper build explicitly undefines those macros.
	ScalarDNNBuildCFLAGS = "" /* 127-byte string literal not displayed */

	// OSCEScalarDNNBuildCFLAGS keeps OSCE BWE/LACE reference helpers on the
	// generic DNN path even on ARM, where dnn/vec.h checks compiler NEON macros
	// directly.
	OSCEScalarDNNBuildCFLAGS = "" /* 170-byte string literal not displayed */

)

Variables

This section is empty.

Functions

func DefaultSearchRoots

func DefaultSearchRoots() []string

DefaultSearchRoots covers common invocation locations: repository root, package subdirs (e.g. testvectors), and deeper test runs.

func EnsureLibopus

func EnsureLibopus(version string, roots []string) bool

EnsureLibopus invokes tools/ensure_libopus.sh from the first matching root.

func EnsureLibopusCustom

func EnsureLibopusCustom(version string, roots []string) bool

EnsureLibopusCustom invokes tools/ensure_libopus.sh with ENABLE_CUSTOM enabled (libopus configured with --enable-custom-modes, defining CUSTOM_MODES and the Opus Custom API) from the first matching root.

func EnsureLibopusCustomScalar

func EnsureLibopusCustomScalar(version string, roots []string) bool

EnsureLibopusCustomScalar invokes tools/ensure_libopus.sh with ENABLE_CUSTOM_SCALAR enabled (--enable-custom-modes on the scalar generic-C kernels) from the first matching root. This is the bit-reproducible Opus Custom oracle for the pure-Go celt/custom parity gate.

func EnsureLibopusFixed

func EnsureLibopusFixed(version string, roots []string) bool

EnsureLibopusFixed invokes tools/ensure_libopus.sh with ENABLE_FIXED enabled (libopus configured with --enable-fixed-point) from the first matching root.

func EnsureLibopusQEXT

func EnsureLibopusQEXT(version string, roots []string) bool

EnsureLibopusQEXT invokes tools/ensure_libopus.sh with ENABLE_QEXT enabled from the first matching root.

func EnsureLibopusSIMD

func EnsureLibopusSIMD(version string, roots []string) bool

EnsureLibopusSIMD invokes tools/ensure_libopus.sh with ENABLE_SIMD enabled (libopus configured with its native --enable-rtcd --enable-intrinsics, so config.h DEFINES the platform SIMD macros) from the first matching root. This is the PERFORMANCE reference only — it is not bit-reproducible and must not be used as a parity oracle.

func EnsureLibopusScalar

func EnsureLibopusScalar(version string, roots []string) bool

EnsureLibopusScalar invokes tools/ensure_libopus.sh with ENABLE_SCALAR enabled (libopus configured with --disable-asm --disable-rtcd --disable-intrinsics, so config.h leaves the platform SIMD macros undefined) from the first matching root. This is the bit-reproducible parity reference for the pure-Go gopus build.

func FindCCompiler

func FindCCompiler() (string, error)

FindCCompiler returns a GCC/Clang-style C compiler suitable for helper builds.

func FindOpusCompare

func FindOpusCompare(version string, roots []string) (string, bool)

FindOpusCompare returns the first executable opus_compare found under tmp_check.

func FindOpusDemo

func FindOpusDemo(version string, roots []string) (string, bool)

FindOpusDemo returns the first executable opus_demo found under tmp_check.

func FindOrEnsureOpusCompare

func FindOrEnsureOpusCompare(version string, roots []string) (string, bool)

FindOrEnsureOpusCompare validates the pinned libopus build, then locates opus_compare.

func FindOrEnsureOpusDemo

func FindOrEnsureOpusDemo(version string, roots []string) (string, bool)

FindOrEnsureOpusDemo validates the pinned libopus build, then locates opus_demo. The validation step matters for fixture generation: an existing executable can be from a stale host/compiler build even when it is runnable.

func FindOrEnsureQEXTOpusDemo

func FindOrEnsureQEXTOpusDemo(version string, roots []string) (string, bool)

FindOrEnsureQEXTOpusDemo tries to locate a QEXT-enabled opus_demo and validates the separate QEXT build first.

func FindQEXTOpusDemo

func FindQEXTOpusDemo(version string, roots []string) (string, bool)

FindQEXTOpusDemo returns the first executable QEXT-enabled opus_demo build found under tmp_check.

func OSCEScalarDNNBuildEnv

func OSCEScalarDNNBuildEnv() ([]string, error)

OSCEScalarDNNBuildEnv returns a controlled environment for OSCE reference helper builds.

func OSCEScalarDNNBuildIsCurrent

func OSCEScalarDNNBuildIsCurrent(buildDir string) bool

OSCEScalarDNNBuildIsCurrent reports whether buildDir was produced with the current OSCE-enabled scalar-DNN helper contract.

func OpusToolScalarRequested

func OpusToolScalarRequested() bool

OpusToolScalarRequested reports whether the libopus reference tools (opus_demo / opus_compare) must be the scalar (generic-C, no SIMD/RTCD/intrinsics) build. The pure-Go (-tags purego) gopus build and the celt/custom parity gate set GOPUS_LIBOPUS_REF_SCALAR=1 so opus_demo-driven byte/quality comparisons use the bit-reproducible scalar tree instead of the default tree (which autotools-enables SIMD on amd64 and Linux arm64).

func ResetOSCEScalarDNNBuildIfStale

func ResetOSCEScalarDNNBuildIfStale(buildDir string) error

ResetOSCEScalarDNNBuildIfStale removes buildDir when it was produced before the current OSCE-enabled scalar-DNN helper contract.

func ResetScalarDNNBuildIfStale

func ResetScalarDNNBuildIfStale(buildDir string) error

ResetScalarDNNBuildIfStale removes buildDir when it was produced before the current scalar-DNN helper contract. This avoids silently reusing x86-vector DNN reference oracles from older local or CI caches.

func ScalarDNNBuildEnv

func ScalarDNNBuildEnv() ([]string, error)

ScalarDNNBuildEnv returns a controlled environment for libopus helper builds.

func ScalarDNNBuildIsCurrent

func ScalarDNNBuildIsCurrent(buildDir string) bool

ScalarDNNBuildIsCurrent reports whether buildDir was produced with the current scalar-DNN helper contract.

func WriteOSCEScalarDNNBuildStamp

func WriteOSCEScalarDNNBuildStamp(buildDir string) error

WriteOSCEScalarDNNBuildStamp records that buildDir satisfies the current OSCE-enabled scalar-DNN helper contract.

func WriteScalarDNNBuildStamp

func WriteScalarDNNBuildStamp(buildDir string) error

WriteScalarDNNBuildStamp records that buildDir satisfies the current scalar-DNN helper contract.

Types

type LibopusBuildProvenance

type LibopusBuildProvenance struct {
	GOOS                    string `json:"goos"`
	GOARCH                  string `json:"goarch"`
	LibopusVersion          string `json:"libopus_version"`
	QEXT                    string `json:"qext"`
	HostOS                  string `json:"host_os"`
	HostArch                string `json:"host_arch"`
	HostBits                string `json:"host_bits"`
	CC                      string `json:"cc"`
	CCPath                  string `json:"cc_path"`
	CCTarget                string `json:"cc_target"`
	CCVersion               string `json:"cc_version"`
	Configure               string `json:"configure"`
	CFLAGS                  string `json:"cflags"`
	CPPFLAGS                string `json:"cppflags"`
	LDFLAGS                 string `json:"ldflags"`
	LibopusBuildStampSHA256 string `json:"libopus_build_stamp_sha256"`
}

LibopusBuildProvenance captures the native helper build that produced a generated libopus fixture.

func LibopusBuildProvenanceForTool

func LibopusBuildProvenanceForTool(toolPath string) (LibopusBuildProvenance, bool)

LibopusBuildProvenanceForTool returns provenance for a tool produced by tools/ensure_libopus.sh. The returned digest is over the exact stamp file bytes so fixture metadata changes whenever the validated native helper build changes.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL