Skip to content

Instantly share code, notes, and snippets.

@daurnimator
Created July 17, 2019 09:36
Show Gist options
  • Save daurnimator/4eef90427d49c31629a35ec4de450f96 to your computer and use it in GitHub Desktop.
Save daurnimator/4eef90427d49c31629a35ec4de450f96 to your computer and use it in GitHub Desktop.
zig failing when trying to compile libopus
# 1 "<built-in>"
# 1 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.c"
/* Copyright (c) 2007-2008 CSIRO
Copyright (c) 2007-2009 Xiph.Org Foundation
Copyright (c) 2008-2009 Gregory Maxwell
Written by Jean-Marc Valin and Gregory Maxwell */
/*
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifdef HAVE_CONFIG_H
#if 0 /* expanded by -frewrite-includes */
#include "config.h"
#endif /* expanded by -frewrite-includes */
# 31 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.c"
# 32 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.c"
#endif
# 33 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.c"
#if 0 /* expanded by -frewrite-includes */
#include <math.h>
#endif /* expanded by -frewrite-includes */
# 34 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.c"
# 1 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/math.h" 1 3
#ifndef _MATH_H
#define _MATH_H
#ifdef __cplusplus
extern "C" {
#endif
# 7 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/math.h" 3
#if 0 /* expanded by -frewrite-includes */
#include <features.h>
#endif /* expanded by -frewrite-includes */
# 8 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/math.h" 3
# 1 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/features.h" 1 3
#ifndef _FEATURES_H
#define _FEATURES_H
#if defined(_ALL_SOURCE) && !defined(_GNU_SOURCE)
#define _GNU_SOURCE 1
#endif
# 7 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/features.h" 3
#if defined(_DEFAULT_SOURCE) && !defined(_BSD_SOURCE)
#define _BSD_SOURCE 1
#endif
# 11 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/features.h" 3
#if !defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE) \
&& !defined(_XOPEN_SOURCE) && !defined(_GNU_SOURCE) \
&& !defined(_BSD_SOURCE) && !defined(__STRICT_ANSI__)
#define _BSD_SOURCE 1
#define _XOPEN_SOURCE 700
#endif
# 18 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/features.h" 3
#if __STDC_VERSION__ >= 199901L
#define __restrict restrict
#elif !defined(__GNUC__)
# 22 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/features.h" 3
#define __restrict
#endif
# 24 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/features.h" 3
#if __STDC_VERSION__ >= 199901L || defined(__cplusplus)
#define __inline inline
#elif !defined(__GNUC__)
# 28 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/features.h" 3
#define __inline
#endif
# 30 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/features.h" 3
#if __STDC_VERSION__ >= 201112L
#elif defined(__GNUC__)
# 33 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/features.h" 3
#define _Noreturn __attribute__((__noreturn__))
#else
# 35 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/features.h" 3
#define _Noreturn
#endif
# 37 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/features.h" 3
#endif
# 38 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/features.h" 3
# 9 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/math.h" 2 3
#define __NEED_float_t
#define __NEED_double_t
#if 0 /* expanded by -frewrite-includes */
#include <bits/alltypes.h>
#endif /* expanded by -frewrite-includes */
# 12 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/math.h" 3
# 1 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 1 3
#define _Addr long
#define _Int64 long long
#define _Reg long
#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
typedef __builtin_va_list va_list;
#define __DEFINED_va_list
#endif
# 9 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
typedef __builtin_va_list __isoc_va_list;
#define __DEFINED___isoc_va_list
#endif
# 14 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#ifndef __cplusplus
#if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t)
typedef int wchar_t;
#define __DEFINED_wchar_t
#endif
# 21 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#endif
# 23 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_float_t) && !defined(__DEFINED_float_t)
typedef float float_t;
#define __DEFINED_float_t
#endif
# 28 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_double_t) && !defined(__DEFINED_double_t)
typedef double double_t;
#define __DEFINED_double_t
#endif
# 33 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_max_align_t) && !defined(__DEFINED_max_align_t)
typedef struct { long long __ll; long double __ld; } max_align_t;
#define __DEFINED_max_align_t
#endif
# 39 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
typedef long time_t;
#define __DEFINED_time_t
#endif
# 45 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
typedef long suseconds_t;
#define __DEFINED_suseconds_t
#endif
# 50 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
typedef struct { union { int __i[9]; volatile int __vi[9]; unsigned __s[9]; } __u; } pthread_attr_t;
#define __DEFINED_pthread_attr_t
#endif
# 56 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
typedef struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } pthread_mutex_t;
#define __DEFINED_pthread_mutex_t
#endif
# 61 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
typedef struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } mtx_t;
#define __DEFINED_mtx_t
#endif
# 66 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } pthread_cond_t;
#define __DEFINED_pthread_cond_t
#endif
# 71 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } cnd_t;
#define __DEFINED_cnd_t
#endif
# 76 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
typedef struct { union { int __i[8]; volatile int __vi[8]; void *__p[8]; } __u; } pthread_rwlock_t;
#define __DEFINED_pthread_rwlock_t
#endif
# 81 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
typedef struct { union { int __i[5]; volatile int __vi[5]; void *__p[5]; } __u; } pthread_barrier_t;
#define __DEFINED_pthread_barrier_t
#endif
# 86 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_size_t) && !defined(__DEFINED_size_t)
typedef unsigned _Addr size_t;
#define __DEFINED_size_t
#endif
# 91 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_uintptr_t) && !defined(__DEFINED_uintptr_t)
typedef unsigned _Addr uintptr_t;
#define __DEFINED_uintptr_t
#endif
# 96 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_ptrdiff_t) && !defined(__DEFINED_ptrdiff_t)
typedef _Addr ptrdiff_t;
#define __DEFINED_ptrdiff_t
#endif
# 101 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_ssize_t) && !defined(__DEFINED_ssize_t)
typedef _Addr ssize_t;
#define __DEFINED_ssize_t
#endif
# 106 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_intptr_t) && !defined(__DEFINED_intptr_t)
typedef _Addr intptr_t;
#define __DEFINED_intptr_t
#endif
# 111 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_regoff_t) && !defined(__DEFINED_regoff_t)
typedef _Addr regoff_t;
#define __DEFINED_regoff_t
#endif
# 116 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_register_t) && !defined(__DEFINED_register_t)
typedef _Reg register_t;
#define __DEFINED_register_t
#endif
# 121 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_int8_t) && !defined(__DEFINED_int8_t)
typedef signed char int8_t;
#define __DEFINED_int8_t
#endif
# 127 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_int16_t) && !defined(__DEFINED_int16_t)
typedef signed short int16_t;
#define __DEFINED_int16_t
#endif
# 132 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_int32_t) && !defined(__DEFINED_int32_t)
typedef signed int int32_t;
#define __DEFINED_int32_t
#endif
# 137 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_int64_t) && !defined(__DEFINED_int64_t)
typedef signed _Int64 int64_t;
#define __DEFINED_int64_t
#endif
# 142 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_intmax_t) && !defined(__DEFINED_intmax_t)
typedef signed _Int64 intmax_t;
#define __DEFINED_intmax_t
#endif
# 147 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_uint8_t) && !defined(__DEFINED_uint8_t)
typedef unsigned char uint8_t;
#define __DEFINED_uint8_t
#endif
# 152 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_uint16_t) && !defined(__DEFINED_uint16_t)
typedef unsigned short uint16_t;
#define __DEFINED_uint16_t
#endif
# 157 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_uint32_t) && !defined(__DEFINED_uint32_t)
typedef unsigned int uint32_t;
#define __DEFINED_uint32_t
#endif
# 162 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_uint64_t) && !defined(__DEFINED_uint64_t)
typedef unsigned _Int64 uint64_t;
#define __DEFINED_uint64_t
#endif
# 167 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_u_int64_t) && !defined(__DEFINED_u_int64_t)
typedef unsigned _Int64 u_int64_t;
#define __DEFINED_u_int64_t
#endif
# 172 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_uintmax_t) && !defined(__DEFINED_uintmax_t)
typedef unsigned _Int64 uintmax_t;
#define __DEFINED_uintmax_t
#endif
# 177 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_mode_t) && !defined(__DEFINED_mode_t)
typedef unsigned mode_t;
#define __DEFINED_mode_t
#endif
# 183 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_nlink_t) && !defined(__DEFINED_nlink_t)
typedef unsigned _Reg nlink_t;
#define __DEFINED_nlink_t
#endif
# 188 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_off_t) && !defined(__DEFINED_off_t)
typedef _Int64 off_t;
#define __DEFINED_off_t
#endif
# 193 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_ino_t) && !defined(__DEFINED_ino_t)
typedef unsigned _Int64 ino_t;
#define __DEFINED_ino_t
#endif
# 198 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_dev_t) && !defined(__DEFINED_dev_t)
typedef unsigned _Int64 dev_t;
#define __DEFINED_dev_t
#endif
# 203 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_blksize_t) && !defined(__DEFINED_blksize_t)
typedef long blksize_t;
#define __DEFINED_blksize_t
#endif
# 208 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_blkcnt_t) && !defined(__DEFINED_blkcnt_t)
typedef _Int64 blkcnt_t;
#define __DEFINED_blkcnt_t
#endif
# 213 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_fsblkcnt_t) && !defined(__DEFINED_fsblkcnt_t)
typedef unsigned _Int64 fsblkcnt_t;
#define __DEFINED_fsblkcnt_t
#endif
# 218 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_fsfilcnt_t) && !defined(__DEFINED_fsfilcnt_t)
typedef unsigned _Int64 fsfilcnt_t;
#define __DEFINED_fsfilcnt_t
#endif
# 223 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_wint_t) && !defined(__DEFINED_wint_t)
typedef unsigned wint_t;
#define __DEFINED_wint_t
#endif
# 229 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_wctype_t) && !defined(__DEFINED_wctype_t)
typedef unsigned long wctype_t;
#define __DEFINED_wctype_t
#endif
# 234 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_timer_t) && !defined(__DEFINED_timer_t)
typedef void * timer_t;
#define __DEFINED_timer_t
#endif
# 240 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_clockid_t) && !defined(__DEFINED_clockid_t)
typedef int clockid_t;
#define __DEFINED_clockid_t
#endif
# 245 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_clock_t) && !defined(__DEFINED_clock_t)
typedef long clock_t;
#define __DEFINED_clock_t
#endif
# 250 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_struct_timeval) && !defined(__DEFINED_struct_timeval)
struct timeval { time_t tv_sec; suseconds_t tv_usec; };
#define __DEFINED_struct_timeval
#endif
# 255 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_struct_timespec) && !defined(__DEFINED_struct_timespec)
struct timespec { time_t tv_sec; long tv_nsec; };
#define __DEFINED_struct_timespec
#endif
# 260 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pid_t) && !defined(__DEFINED_pid_t)
typedef int pid_t;
#define __DEFINED_pid_t
#endif
# 266 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_id_t) && !defined(__DEFINED_id_t)
typedef unsigned id_t;
#define __DEFINED_id_t
#endif
# 271 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_uid_t) && !defined(__DEFINED_uid_t)
typedef unsigned uid_t;
#define __DEFINED_uid_t
#endif
# 276 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_gid_t) && !defined(__DEFINED_gid_t)
typedef unsigned gid_t;
#define __DEFINED_gid_t
#endif
# 281 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_key_t) && !defined(__DEFINED_key_t)
typedef int key_t;
#define __DEFINED_key_t
#endif
# 286 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_useconds_t) && !defined(__DEFINED_useconds_t)
typedef unsigned useconds_t;
#define __DEFINED_useconds_t
#endif
# 291 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#ifdef __cplusplus
#if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t)
typedef unsigned long pthread_t;
#define __DEFINED_pthread_t
#endif
# 298 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#else
# 300 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t)
typedef struct __pthread * pthread_t;
#define __DEFINED_pthread_t
#endif
# 304 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#endif
# 306 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_once_t) && !defined(__DEFINED_pthread_once_t)
typedef int pthread_once_t;
#define __DEFINED_pthread_once_t
#endif
# 310 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_key_t) && !defined(__DEFINED_pthread_key_t)
typedef unsigned pthread_key_t;
#define __DEFINED_pthread_key_t
#endif
# 315 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_spinlock_t) && !defined(__DEFINED_pthread_spinlock_t)
typedef int pthread_spinlock_t;
#define __DEFINED_pthread_spinlock_t
#endif
# 320 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_mutexattr_t) && !defined(__DEFINED_pthread_mutexattr_t)
typedef struct { unsigned __attr; } pthread_mutexattr_t;
#define __DEFINED_pthread_mutexattr_t
#endif
# 325 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_condattr_t) && !defined(__DEFINED_pthread_condattr_t)
typedef struct { unsigned __attr; } pthread_condattr_t;
#define __DEFINED_pthread_condattr_t
#endif
# 330 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_barrierattr_t) && !defined(__DEFINED_pthread_barrierattr_t)
typedef struct { unsigned __attr; } pthread_barrierattr_t;
#define __DEFINED_pthread_barrierattr_t
#endif
# 335 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_rwlockattr_t) && !defined(__DEFINED_pthread_rwlockattr_t)
typedef struct { unsigned __attr[2]; } pthread_rwlockattr_t;
#define __DEFINED_pthread_rwlockattr_t
#endif
# 340 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_FILE) && !defined(__DEFINED_FILE)
typedef struct _IO_FILE FILE;
#define __DEFINED_FILE
#endif
# 346 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_mbstate_t) && !defined(__DEFINED_mbstate_t)
typedef struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t;
#define __DEFINED_mbstate_t
#endif
# 352 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_locale_t) && !defined(__DEFINED_locale_t)
typedef struct __locale_struct * locale_t;
#define __DEFINED_locale_t
#endif
# 358 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_sigset_t) && !defined(__DEFINED_sigset_t)
typedef struct __sigset_t { unsigned long __bits[128/sizeof(long)]; } sigset_t;
#define __DEFINED_sigset_t
#endif
# 364 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_struct_iovec) && !defined(__DEFINED_struct_iovec)
struct iovec { void *iov_base; size_t iov_len; };
#define __DEFINED_struct_iovec
#endif
# 370 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_socklen_t) && !defined(__DEFINED_socklen_t)
typedef unsigned socklen_t;
#define __DEFINED_socklen_t
#endif
# 376 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_sa_family_t) && !defined(__DEFINED_sa_family_t)
typedef unsigned short sa_family_t;
#define __DEFINED_sa_family_t
#endif
# 381 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#undef _Addr
#undef _Int64
#undef _Reg
# 13 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/math.h" 2 3
#if 100*__GNUC__+__GNUC_MINOR__ >= 303
#define NAN __builtin_nanf("")
#define INFINITY __builtin_inff()
#else
# 18 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/math.h" 3
#define NAN (0.0f/0.0f)
#define INFINITY 1e5000f
#endif
# 21 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/math.h" 3
#define HUGE_VALF INFINITY
#define HUGE_VAL ((double)INFINITY)
#define HUGE_VALL ((long double)INFINITY)
#define MATH_ERRNO 1
#define MATH_ERREXCEPT 2
#define math_errhandling 2
#define FP_ILOGBNAN (-1-0x7fffffff)
#define FP_ILOGB0 FP_ILOGBNAN
#define FP_NAN 0
#define FP_INFINITE 1
#define FP_ZERO 2
#define FP_SUBNORMAL 3
#define FP_NORMAL 4
#ifdef __FP_FAST_FMA
#define FP_FAST_FMA 1
#endif
# 42 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/math.h" 3
#ifdef __FP_FAST_FMAF
#define FP_FAST_FMAF 1
#endif
# 46 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/math.h" 3
#ifdef __FP_FAST_FMAL
#define FP_FAST_FMAL 1
#endif
# 50 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/math.h" 3
int __fpclassify(double);
int __fpclassifyf(float);
int __fpclassifyl(long double);
static __inline unsigned __FLOAT_BITS(float __f)
{
union {float __f; unsigned __i;} __u;
__u.__f = __f;
return __u.__i;
}
static __inline unsigned long long __DOUBLE_BITS(double __f)
{
union {double __f; unsigned long long __i;} __u;
__u.__f = __f;
return __u.__i;
}
#define fpclassify(x) ( \
sizeof(x) == sizeof(float) ? __fpclassifyf(x) : \
sizeof(x) == sizeof(double) ? __fpclassify(x) : \
__fpclassifyl(x) )
#define isinf(x) ( \
sizeof(x) == sizeof(float) ? (__FLOAT_BITS(x) & 0x7fffffff) == 0x7f800000 : \
sizeof(x) == sizeof(double) ? (__DOUBLE_BITS(x) & -1ULL>>1) == 0x7ffULL<<52 : \
__fpclassifyl(x) == FP_INFINITE)
#define isnan(x) ( \
sizeof(x) == sizeof(float) ? (__FLOAT_BITS(x) & 0x7fffffff) > 0x7f800000 : \
sizeof(x) == sizeof(double) ? (__DOUBLE_BITS(x) & -1ULL>>1) > 0x7ffULL<<52 : \
__fpclassifyl(x) == FP_NAN)
#define isnormal(x) ( \
sizeof(x) == sizeof(float) ? ((__FLOAT_BITS(x)+0x00800000) & 0x7fffffff) >= 0x01000000 : \
sizeof(x) == sizeof(double) ? ((__DOUBLE_BITS(x)+(1ULL<<52)) & -1ULL>>1) >= 1ULL<<53 : \
__fpclassifyl(x) == FP_NORMAL)
#define isfinite(x) ( \
sizeof(x) == sizeof(float) ? (__FLOAT_BITS(x) & 0x7fffffff) < 0x7f800000 : \
sizeof(x) == sizeof(double) ? (__DOUBLE_BITS(x) & -1ULL>>1) < 0x7ffULL<<52 : \
__fpclassifyl(x) > FP_INFINITE)
int __signbit(double);
int __signbitf(float);
int __signbitl(long double);
#define signbit(x) ( \
sizeof(x) == sizeof(float) ? (int)(__FLOAT_BITS(x)>>31) : \
sizeof(x) == sizeof(double) ? (int)(__DOUBLE_BITS(x)>>63) : \
__signbitl(x) )
#define isunordered(x,y) (isnan((x)) ? ((void)(y),1) : isnan((y)))
#define __ISREL_DEF(rel, op, type) \
static __inline int __is##rel(type __x, type __y) \
{ return !isunordered(__x,__y) && __x op __y; }
__ISREL_DEF(lessf, <, float_t)
__ISREL_DEF(less, <, double_t)
__ISREL_DEF(lessl, <, long double)
__ISREL_DEF(lessequalf, <=, float_t)
__ISREL_DEF(lessequal, <=, double_t)
__ISREL_DEF(lessequall, <=, long double)
__ISREL_DEF(lessgreaterf, !=, float_t)
__ISREL_DEF(lessgreater, !=, double_t)
__ISREL_DEF(lessgreaterl, !=, long double)
__ISREL_DEF(greaterf, >, float_t)
__ISREL_DEF(greater, >, double_t)
__ISREL_DEF(greaterl, >, long double)
__ISREL_DEF(greaterequalf, >=, float_t)
__ISREL_DEF(greaterequal, >=, double_t)
__ISREL_DEF(greaterequall, >=, long double)
#define __tg_pred_2(x, y, p) ( \
sizeof((x)+(y)) == sizeof(float) ? p##f(x, y) : \
sizeof((x)+(y)) == sizeof(double) ? p(x, y) : \
p##l(x, y) )
#define isless(x, y) __tg_pred_2(x, y, __isless)
#define islessequal(x, y) __tg_pred_2(x, y, __islessequal)
#define islessgreater(x, y) __tg_pred_2(x, y, __islessgreater)
#define isgreater(x, y) __tg_pred_2(x, y, __isgreater)
#define isgreaterequal(x, y) __tg_pred_2(x, y, __isgreaterequal)
double acos(double);
float acosf(float);
long double acosl(long double);
double acosh(double);
float acoshf(float);
long double acoshl(long double);
double asin(double);
float asinf(float);
long double asinl(long double);
double asinh(double);
float asinhf(float);
long double asinhl(long double);
double atan(double);
float atanf(float);
long double atanl(long double);
double atan2(double, double);
float atan2f(float, float);
long double atan2l(long double, long double);
double atanh(double);
float atanhf(float);
long double atanhl(long double);
double cbrt(double);
float cbrtf(float);
long double cbrtl(long double);
double ceil(double);
float ceilf(float);
long double ceill(long double);
double copysign(double, double);
float copysignf(float, float);
long double copysignl(long double, long double);
double cos(double);
float cosf(float);
long double cosl(long double);
double cosh(double);
float coshf(float);
long double coshl(long double);
double erf(double);
float erff(float);
long double erfl(long double);
double erfc(double);
float erfcf(float);
long double erfcl(long double);
double exp(double);
float expf(float);
long double expl(long double);
double exp2(double);
float exp2f(float);
long double exp2l(long double);
double expm1(double);
float expm1f(float);
long double expm1l(long double);
double fabs(double);
float fabsf(float);
long double fabsl(long double);
double fdim(double, double);
float fdimf(float, float);
long double fdiml(long double, long double);
double floor(double);
float floorf(float);
long double floorl(long double);
double fma(double, double, double);
float fmaf(float, float, float);
long double fmal(long double, long double, long double);
double fmax(double, double);
float fmaxf(float, float);
long double fmaxl(long double, long double);
double fmin(double, double);
float fminf(float, float);
long double fminl(long double, long double);
double fmod(double, double);
float fmodf(float, float);
long double fmodl(long double, long double);
double frexp(double, int *);
float frexpf(float, int *);
long double frexpl(long double, int *);
double hypot(double, double);
float hypotf(float, float);
long double hypotl(long double, long double);
int ilogb(double);
int ilogbf(float);
int ilogbl(long double);
double ldexp(double, int);
float ldexpf(float, int);
long double ldexpl(long double, int);
double lgamma(double);
float lgammaf(float);
long double lgammal(long double);
long long llrint(double);
long long llrintf(float);
long long llrintl(long double);
long long llround(double);
long long llroundf(float);
long long llroundl(long double);
double log(double);
float logf(float);
long double logl(long double);
double log10(double);
float log10f(float);
long double log10l(long double);
double log1p(double);
float log1pf(float);
long double log1pl(long double);
double log2(double);
float log2f(float);
long double log2l(long double);
double logb(double);
float logbf(float);
long double logbl(long double);
long lrint(double);
long lrintf(float);
long lrintl(long double);
long lround(double);
long lroundf(float);
long lroundl(long double);
double modf(double, double *);
float modff(float, float *);
long double modfl(long double, long double *);
double nan(const char *);
float nanf(const char *);
long double nanl(const char *);
double nearbyint(double);
float nearbyintf(float);
long double nearbyintl(long double);
double nextafter(double, double);
float nextafterf(float, float);
long double nextafterl(long double, long double);
double nexttoward(double, long double);
float nexttowardf(float, long double);
long double nexttowardl(long double, long double);
double pow(double, double);
float powf(float, float);
long double powl(long double, long double);
double remainder(double, double);
float remainderf(float, float);
long double remainderl(long double, long double);
double remquo(double, double, int *);
float remquof(float, float, int *);
long double remquol(long double, long double, int *);
double rint(double);
float rintf(float);
long double rintl(long double);
double round(double);
float roundf(float);
long double roundl(long double);
double scalbln(double, long);
float scalblnf(float, long);
long double scalblnl(long double, long);
double scalbn(double, int);
float scalbnf(float, int);
long double scalbnl(long double, int);
double sin(double);
float sinf(float);
long double sinl(long double);
double sinh(double);
float sinhf(float);
long double sinhl(long double);
double sqrt(double);
float sqrtf(float);
long double sqrtl(long double);
double tan(double);
float tanf(float);
long double tanl(long double);
double tanh(double);
float tanhf(float);
long double tanhl(long double);
double tgamma(double);
float tgammaf(float);
long double tgammal(long double);
double trunc(double);
float truncf(float);
long double truncl(long double);
#if defined(_XOPEN_SOURCE) || defined(_BSD_SOURCE)
#undef MAXFLOAT
#define MAXFLOAT 3.40282346638528859812e+38F
#endif
# 368 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/math.h" 3
#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
#define M_E 2.7182818284590452354 /* e */
#define M_LOG2E 1.4426950408889634074 /* log_2 e */
#define M_LOG10E 0.43429448190325182765 /* log_10 e */
#define M_LN2 0.69314718055994530942 /* log_e 2 */
#define M_LN10 2.30258509299404568402 /* log_e 10 */
#define M_PI 3.14159265358979323846 /* pi */
#define M_PI_2 1.57079632679489661923 /* pi/2 */
#define M_PI_4 0.78539816339744830962 /* pi/4 */
#define M_1_PI 0.31830988618379067154 /* 1/pi */
#define M_2_PI 0.63661977236758134308 /* 2/pi */
#define M_2_SQRTPI 1.12837916709551257390 /* 2/sqrt(pi) */
#define M_SQRT2 1.41421356237309504880 /* sqrt(2) */
#define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */
extern int signgam;
double j0(double);
double j1(double);
double jn(int, double);
double y0(double);
double y1(double);
double yn(int, double);
#endif
# 394 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/math.h" 3
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
#define HUGE 3.40282346638528859812e+38F
double drem(double, double);
float dremf(float, float);
int finite(double);
int finitef(float);
double scalb(double, double);
float scalbf(float, float);
double significand(double);
float significandf(float);
double lgamma_r(double, int*);
float lgammaf_r(float, int*);
float j0f(float);
float j1f(float);
float jnf(int, float);
float y0f(float);
float y1f(float);
float ynf(int, float);
#endif
# 421 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/math.h" 3
#ifdef _GNU_SOURCE
long double lgammal_r(long double, int*);
void sincos(double, double*, double*);
void sincosf(float, float*, float*);
void sincosl(long double, long double*, long double*);
double exp10(double);
float exp10f(float);
long double exp10l(long double);
double pow10(double);
float pow10f(float);
long double pow10l(long double);
#endif
# 437 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/math.h" 3
#ifdef __cplusplus
}
#endif
# 441 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/math.h" 3
#endif
# 442 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/math.h" 3
# 35 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.c" 2
#if 0 /* expanded by -frewrite-includes */
#include "bands.h"
#endif /* expanded by -frewrite-includes */
# 35 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.c"
# 1 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.h" 1
/* Copyright (c) 2007-2008 CSIRO
Copyright (c) 2007-2009 Xiph.Org Foundation
Copyright (c) 2008-2009 Gregory Maxwell
Written by Jean-Marc Valin and Gregory Maxwell */
/*
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef BANDS_H
#define BANDS_H
#if 0 /* expanded by -frewrite-includes */
#include "arch.h"
#endif /* expanded by -frewrite-includes */
# 33 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.h"
# 1 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/arch.h" 1
/* Copyright (c) 2003-2008 Jean-Marc Valin
Copyright (c) 2007-2008 CSIRO
Copyright (c) 2007-2009 Xiph.Org Foundation
Written by Jean-Marc Valin */
/**
@file arch.h
@brief Various architecture definitions for CELT
*/
/*
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef ARCH_H
#define ARCH_H
#if 0 /* expanded by -frewrite-includes */
#include "opus_types.h"
#endif /* expanded by -frewrite-includes */
# 37 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/arch.h"
# 1 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_types.h" 1 3
/* (C) COPYRIGHT 1994-2002 Xiph.Org Foundation */
/* Modified by Jean-Marc Valin */
/*
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/* opus_types.h based on ogg_types.h from libogg */
/**
@file opus_types.h
@brief Opus reference implementation types
*/
#ifndef OPUS_TYPES_H
#define OPUS_TYPES_H
#define opus_int int /* used for counters etc; at least 16 bits */
#define opus_int64 long long
#define opus_int8 signed char
#define opus_uint unsigned int /* used for counters etc; at least 16 bits */
#define opus_uint64 unsigned long long
#define opus_uint8 unsigned char
/* Use the real stdint.h if it's there (taken from Paul Hsieh's pstdint.h) */
#if (defined(__STDC__) && __STDC__ && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || (defined(__GNUC__) && (defined(_STDINT_H) || defined(_STDINT_H_)) || defined (HAVE_STDINT_H))
#if 0 /* expanded by -frewrite-includes */
#include <stdint.h>
#endif /* expanded by -frewrite-includes */
# 46 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_types.h" 3
# 1 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/stdint.h" 1 3
#ifndef _STDINT_H
#define _STDINT_H
#define __NEED_int8_t
#define __NEED_int16_t
#define __NEED_int32_t
#define __NEED_int64_t
#define __NEED_uint8_t
#define __NEED_uint16_t
#define __NEED_uint32_t
#define __NEED_uint64_t
#define __NEED_intptr_t
#define __NEED_uintptr_t
#define __NEED_intmax_t
#define __NEED_uintmax_t
#if 0 /* expanded by -frewrite-includes */
#include <bits/alltypes.h>
#endif /* expanded by -frewrite-includes */
# 20 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/stdint.h" 3
# 1 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 1 3
#define _Addr long
#define _Int64 long long
#define _Reg long
#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
typedef __builtin_va_list va_list;
#define __DEFINED_va_list
#endif
# 9 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
typedef __builtin_va_list __isoc_va_list;
#define __DEFINED___isoc_va_list
#endif
# 14 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#ifndef __cplusplus
#if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t)
typedef int wchar_t;
#define __DEFINED_wchar_t
#endif
# 21 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#endif
# 23 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_float_t) && !defined(__DEFINED_float_t)
typedef float float_t;
#define __DEFINED_float_t
#endif
# 28 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_double_t) && !defined(__DEFINED_double_t)
typedef double double_t;
#define __DEFINED_double_t
#endif
# 33 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_max_align_t) && !defined(__DEFINED_max_align_t)
typedef struct { long long __ll; long double __ld; } max_align_t;
#define __DEFINED_max_align_t
#endif
# 39 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
typedef long time_t;
#define __DEFINED_time_t
#endif
# 45 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
typedef long suseconds_t;
#define __DEFINED_suseconds_t
#endif
# 50 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
typedef struct { union { int __i[9]; volatile int __vi[9]; unsigned __s[9]; } __u; } pthread_attr_t;
#define __DEFINED_pthread_attr_t
#endif
# 56 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
typedef struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } pthread_mutex_t;
#define __DEFINED_pthread_mutex_t
#endif
# 61 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
typedef struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } mtx_t;
#define __DEFINED_mtx_t
#endif
# 66 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } pthread_cond_t;
#define __DEFINED_pthread_cond_t
#endif
# 71 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } cnd_t;
#define __DEFINED_cnd_t
#endif
# 76 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
typedef struct { union { int __i[8]; volatile int __vi[8]; void *__p[8]; } __u; } pthread_rwlock_t;
#define __DEFINED_pthread_rwlock_t
#endif
# 81 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
typedef struct { union { int __i[5]; volatile int __vi[5]; void *__p[5]; } __u; } pthread_barrier_t;
#define __DEFINED_pthread_barrier_t
#endif
# 86 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_size_t) && !defined(__DEFINED_size_t)
typedef unsigned _Addr size_t;
#define __DEFINED_size_t
#endif
# 91 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_uintptr_t) && !defined(__DEFINED_uintptr_t)
typedef unsigned _Addr uintptr_t;
#define __DEFINED_uintptr_t
#endif
# 96 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_ptrdiff_t) && !defined(__DEFINED_ptrdiff_t)
typedef _Addr ptrdiff_t;
#define __DEFINED_ptrdiff_t
#endif
# 101 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_ssize_t) && !defined(__DEFINED_ssize_t)
typedef _Addr ssize_t;
#define __DEFINED_ssize_t
#endif
# 106 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_intptr_t) && !defined(__DEFINED_intptr_t)
typedef _Addr intptr_t;
#define __DEFINED_intptr_t
#endif
# 111 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_regoff_t) && !defined(__DEFINED_regoff_t)
typedef _Addr regoff_t;
#define __DEFINED_regoff_t
#endif
# 116 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_register_t) && !defined(__DEFINED_register_t)
typedef _Reg register_t;
#define __DEFINED_register_t
#endif
# 121 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_int8_t) && !defined(__DEFINED_int8_t)
typedef signed char int8_t;
#define __DEFINED_int8_t
#endif
# 127 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_int16_t) && !defined(__DEFINED_int16_t)
typedef signed short int16_t;
#define __DEFINED_int16_t
#endif
# 132 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_int32_t) && !defined(__DEFINED_int32_t)
typedef signed int int32_t;
#define __DEFINED_int32_t
#endif
# 137 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_int64_t) && !defined(__DEFINED_int64_t)
typedef signed _Int64 int64_t;
#define __DEFINED_int64_t
#endif
# 142 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_intmax_t) && !defined(__DEFINED_intmax_t)
typedef signed _Int64 intmax_t;
#define __DEFINED_intmax_t
#endif
# 147 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_uint8_t) && !defined(__DEFINED_uint8_t)
typedef unsigned char uint8_t;
#define __DEFINED_uint8_t
#endif
# 152 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_uint16_t) && !defined(__DEFINED_uint16_t)
typedef unsigned short uint16_t;
#define __DEFINED_uint16_t
#endif
# 157 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_uint32_t) && !defined(__DEFINED_uint32_t)
typedef unsigned int uint32_t;
#define __DEFINED_uint32_t
#endif
# 162 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_uint64_t) && !defined(__DEFINED_uint64_t)
typedef unsigned _Int64 uint64_t;
#define __DEFINED_uint64_t
#endif
# 167 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_u_int64_t) && !defined(__DEFINED_u_int64_t)
typedef unsigned _Int64 u_int64_t;
#define __DEFINED_u_int64_t
#endif
# 172 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_uintmax_t) && !defined(__DEFINED_uintmax_t)
typedef unsigned _Int64 uintmax_t;
#define __DEFINED_uintmax_t
#endif
# 177 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_mode_t) && !defined(__DEFINED_mode_t)
typedef unsigned mode_t;
#define __DEFINED_mode_t
#endif
# 183 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_nlink_t) && !defined(__DEFINED_nlink_t)
typedef unsigned _Reg nlink_t;
#define __DEFINED_nlink_t
#endif
# 188 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_off_t) && !defined(__DEFINED_off_t)
typedef _Int64 off_t;
#define __DEFINED_off_t
#endif
# 193 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_ino_t) && !defined(__DEFINED_ino_t)
typedef unsigned _Int64 ino_t;
#define __DEFINED_ino_t
#endif
# 198 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_dev_t) && !defined(__DEFINED_dev_t)
typedef unsigned _Int64 dev_t;
#define __DEFINED_dev_t
#endif
# 203 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_blksize_t) && !defined(__DEFINED_blksize_t)
typedef long blksize_t;
#define __DEFINED_blksize_t
#endif
# 208 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_blkcnt_t) && !defined(__DEFINED_blkcnt_t)
typedef _Int64 blkcnt_t;
#define __DEFINED_blkcnt_t
#endif
# 213 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_fsblkcnt_t) && !defined(__DEFINED_fsblkcnt_t)
typedef unsigned _Int64 fsblkcnt_t;
#define __DEFINED_fsblkcnt_t
#endif
# 218 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_fsfilcnt_t) && !defined(__DEFINED_fsfilcnt_t)
typedef unsigned _Int64 fsfilcnt_t;
#define __DEFINED_fsfilcnt_t
#endif
# 223 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_wint_t) && !defined(__DEFINED_wint_t)
typedef unsigned wint_t;
#define __DEFINED_wint_t
#endif
# 229 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_wctype_t) && !defined(__DEFINED_wctype_t)
typedef unsigned long wctype_t;
#define __DEFINED_wctype_t
#endif
# 234 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_timer_t) && !defined(__DEFINED_timer_t)
typedef void * timer_t;
#define __DEFINED_timer_t
#endif
# 240 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_clockid_t) && !defined(__DEFINED_clockid_t)
typedef int clockid_t;
#define __DEFINED_clockid_t
#endif
# 245 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_clock_t) && !defined(__DEFINED_clock_t)
typedef long clock_t;
#define __DEFINED_clock_t
#endif
# 250 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_struct_timeval) && !defined(__DEFINED_struct_timeval)
struct timeval { time_t tv_sec; suseconds_t tv_usec; };
#define __DEFINED_struct_timeval
#endif
# 255 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_struct_timespec) && !defined(__DEFINED_struct_timespec)
struct timespec { time_t tv_sec; long tv_nsec; };
#define __DEFINED_struct_timespec
#endif
# 260 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pid_t) && !defined(__DEFINED_pid_t)
typedef int pid_t;
#define __DEFINED_pid_t
#endif
# 266 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_id_t) && !defined(__DEFINED_id_t)
typedef unsigned id_t;
#define __DEFINED_id_t
#endif
# 271 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_uid_t) && !defined(__DEFINED_uid_t)
typedef unsigned uid_t;
#define __DEFINED_uid_t
#endif
# 276 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_gid_t) && !defined(__DEFINED_gid_t)
typedef unsigned gid_t;
#define __DEFINED_gid_t
#endif
# 281 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_key_t) && !defined(__DEFINED_key_t)
typedef int key_t;
#define __DEFINED_key_t
#endif
# 286 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_useconds_t) && !defined(__DEFINED_useconds_t)
typedef unsigned useconds_t;
#define __DEFINED_useconds_t
#endif
# 291 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#ifdef __cplusplus
#if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t)
typedef unsigned long pthread_t;
#define __DEFINED_pthread_t
#endif
# 298 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#else
# 300 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t)
typedef struct __pthread * pthread_t;
#define __DEFINED_pthread_t
#endif
# 304 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#endif
# 306 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_once_t) && !defined(__DEFINED_pthread_once_t)
typedef int pthread_once_t;
#define __DEFINED_pthread_once_t
#endif
# 310 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_key_t) && !defined(__DEFINED_pthread_key_t)
typedef unsigned pthread_key_t;
#define __DEFINED_pthread_key_t
#endif
# 315 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_spinlock_t) && !defined(__DEFINED_pthread_spinlock_t)
typedef int pthread_spinlock_t;
#define __DEFINED_pthread_spinlock_t
#endif
# 320 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_mutexattr_t) && !defined(__DEFINED_pthread_mutexattr_t)
typedef struct { unsigned __attr; } pthread_mutexattr_t;
#define __DEFINED_pthread_mutexattr_t
#endif
# 325 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_condattr_t) && !defined(__DEFINED_pthread_condattr_t)
typedef struct { unsigned __attr; } pthread_condattr_t;
#define __DEFINED_pthread_condattr_t
#endif
# 330 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_barrierattr_t) && !defined(__DEFINED_pthread_barrierattr_t)
typedef struct { unsigned __attr; } pthread_barrierattr_t;
#define __DEFINED_pthread_barrierattr_t
#endif
# 335 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_rwlockattr_t) && !defined(__DEFINED_pthread_rwlockattr_t)
typedef struct { unsigned __attr[2]; } pthread_rwlockattr_t;
#define __DEFINED_pthread_rwlockattr_t
#endif
# 340 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_FILE) && !defined(__DEFINED_FILE)
typedef struct _IO_FILE FILE;
#define __DEFINED_FILE
#endif
# 346 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_mbstate_t) && !defined(__DEFINED_mbstate_t)
typedef struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t;
#define __DEFINED_mbstate_t
#endif
# 352 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_locale_t) && !defined(__DEFINED_locale_t)
typedef struct __locale_struct * locale_t;
#define __DEFINED_locale_t
#endif
# 358 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_sigset_t) && !defined(__DEFINED_sigset_t)
typedef struct __sigset_t { unsigned long __bits[128/sizeof(long)]; } sigset_t;
#define __DEFINED_sigset_t
#endif
# 364 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_struct_iovec) && !defined(__DEFINED_struct_iovec)
struct iovec { void *iov_base; size_t iov_len; };
#define __DEFINED_struct_iovec
#endif
# 370 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_socklen_t) && !defined(__DEFINED_socklen_t)
typedef unsigned socklen_t;
#define __DEFINED_socklen_t
#endif
# 376 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_sa_family_t) && !defined(__DEFINED_sa_family_t)
typedef unsigned short sa_family_t;
#define __DEFINED_sa_family_t
#endif
# 381 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#undef _Addr
#undef _Int64
#undef _Reg
# 21 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/stdint.h" 2 3
typedef int8_t int_fast8_t;
typedef int64_t int_fast64_t;
typedef int8_t int_least8_t;
typedef int16_t int_least16_t;
typedef int32_t int_least32_t;
typedef int64_t int_least64_t;
typedef uint8_t uint_fast8_t;
typedef uint64_t uint_fast64_t;
typedef uint8_t uint_least8_t;
typedef uint16_t uint_least16_t;
typedef uint32_t uint_least32_t;
typedef uint64_t uint_least64_t;
#define INT8_MIN (-1-0x7f)
#define INT16_MIN (-1-0x7fff)
#define INT32_MIN (-1-0x7fffffff)
#define INT64_MIN (-1-0x7fffffffffffffff)
#define INT8_MAX (0x7f)
#define INT16_MAX (0x7fff)
#define INT32_MAX (0x7fffffff)
#define INT64_MAX (0x7fffffffffffffff)
#define UINT8_MAX (0xff)
#define UINT16_MAX (0xffff)
#define UINT32_MAX (0xffffffffu)
#define UINT64_MAX (0xffffffffffffffffu)
#define INT_FAST8_MIN INT8_MIN
#define INT_FAST64_MIN INT64_MIN
#define INT_LEAST8_MIN INT8_MIN
#define INT_LEAST16_MIN INT16_MIN
#define INT_LEAST32_MIN INT32_MIN
#define INT_LEAST64_MIN INT64_MIN
#define INT_FAST8_MAX INT8_MAX
#define INT_FAST64_MAX INT64_MAX
#define INT_LEAST8_MAX INT8_MAX
#define INT_LEAST16_MAX INT16_MAX
#define INT_LEAST32_MAX INT32_MAX
#define INT_LEAST64_MAX INT64_MAX
#define UINT_FAST8_MAX UINT8_MAX
#define UINT_FAST64_MAX UINT64_MAX
#define UINT_LEAST8_MAX UINT8_MAX
#define UINT_LEAST16_MAX UINT16_MAX
#define UINT_LEAST32_MAX UINT32_MAX
#define UINT_LEAST64_MAX UINT64_MAX
#define INTMAX_MIN INT64_MIN
#define INTMAX_MAX INT64_MAX
#define UINTMAX_MAX UINT64_MAX
#define WINT_MIN 0U
#define WINT_MAX UINT32_MAX
#if L'\0'-1 > 0
#define WCHAR_MAX (0xffffffffu+L'\0')
#define WCHAR_MIN (0+L'\0')
#else
# 88 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/stdint.h" 3
#define WCHAR_MAX (0x7fffffff+L'\0')
#define WCHAR_MIN (-1-0x7fffffff+L'\0')
#endif
# 91 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/stdint.h" 3
#define SIG_ATOMIC_MIN INT32_MIN
#define SIG_ATOMIC_MAX INT32_MAX
#if 0 /* expanded by -frewrite-includes */
#include <bits/stdint.h>
#endif /* expanded by -frewrite-includes */
# 95 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/stdint.h" 3
# 1 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/bits/stdint.h" 1 3
typedef int32_t int_fast16_t;
typedef int32_t int_fast32_t;
typedef uint32_t uint_fast16_t;
typedef uint32_t uint_fast32_t;
#define INT_FAST16_MIN INT32_MIN
#define INT_FAST32_MIN INT32_MIN
#define INT_FAST16_MAX INT32_MAX
#define INT_FAST32_MAX INT32_MAX
#define UINT_FAST16_MAX UINT32_MAX
#define UINT_FAST32_MAX UINT32_MAX
#define INTPTR_MIN INT64_MIN
#define INTPTR_MAX INT64_MAX
#define UINTPTR_MAX UINT64_MAX
#define PTRDIFF_MIN INT64_MIN
#define PTRDIFF_MAX INT64_MAX
#define SIZE_MAX UINT64_MAX
# 96 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/stdint.h" 2 3
#define INT8_C(c) c
#define INT16_C(c) c
#define INT32_C(c) c
#define UINT8_C(c) c
#define UINT16_C(c) c
#define UINT32_C(c) c ## U
#if UINTPTR_MAX == UINT64_MAX
#define INT64_C(c) c ## L
#define UINT64_C(c) c ## UL
#define INTMAX_C(c) c ## L
#define UINTMAX_C(c) c ## UL
#else
# 111 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/stdint.h" 3
#define INT64_C(c) c ## LL
#define UINT64_C(c) c ## ULL
#define INTMAX_C(c) c ## LL
#define UINTMAX_C(c) c ## ULL
#endif
# 116 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/stdint.h" 3
#endif
# 117 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/stdint.h" 3
# 47 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_types.h" 2 3
# undef opus_int64
# undef opus_int8
# undef opus_uint64
# undef opus_uint8
typedef int8_t opus_int8;
typedef uint8_t opus_uint8;
typedef int16_t opus_int16;
typedef uint16_t opus_uint16;
typedef int32_t opus_int32;
typedef uint32_t opus_uint32;
typedef int64_t opus_int64;
typedef uint64_t opus_uint64;
#elif defined(_WIN32)
# 60 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_types.h" 3
# if defined(__CYGWIN__)
#if 0 /* expanded by -frewrite-includes */
# include <_G_config.h>
#endif /* expanded by -frewrite-includes */
# 62 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_types.h" 3
# 63 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_types.h" 3
typedef _G_int32_t opus_int32;
typedef _G_uint32_t opus_uint32;
typedef _G_int16 opus_int16;
typedef _G_uint16 opus_uint16;
# elif defined(__MINGW32__)
# 68 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_types.h" 3
typedef short opus_int16;
typedef unsigned short opus_uint16;
typedef int opus_int32;
typedef unsigned int opus_uint32;
# elif defined(__MWERKS__)
# 73 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_types.h" 3
typedef int opus_int32;
typedef unsigned int opus_uint32;
typedef short opus_int16;
typedef unsigned short opus_uint16;
# else
# 78 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_types.h" 3
/* MSVC/Borland */
typedef __int32 opus_int32;
typedef unsigned __int32 opus_uint32;
typedef __int16 opus_int16;
typedef unsigned __int16 opus_uint16;
# endif
# 84 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_types.h" 3
#elif defined(__MACOS__)
# 86 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_types.h" 3
#if 0 /* expanded by -frewrite-includes */
# include <sys/types.h>
#endif /* expanded by -frewrite-includes */
# 87 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_types.h" 3
# 88 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_types.h" 3
typedef SInt16 opus_int16;
typedef UInt16 opus_uint16;
typedef SInt32 opus_int32;
typedef UInt32 opus_uint32;
#elif (defined(__APPLE__) && defined(__MACH__)) /* MacOS X Framework build */
# 94 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_types.h" 3
#if 0 /* expanded by -frewrite-includes */
# include <sys/types.h>
#endif /* expanded by -frewrite-includes */
# 95 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_types.h" 3
# 96 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_types.h" 3
typedef int16_t opus_int16;
typedef u_int16_t opus_uint16;
typedef int32_t opus_int32;
typedef u_int32_t opus_uint32;
#elif defined(__BEOS__)
# 102 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_types.h" 3
/* Be */
#if 0 /* expanded by -frewrite-includes */
# include <inttypes.h>
#endif /* expanded by -frewrite-includes */
# 104 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_types.h" 3
# 105 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_types.h" 3
typedef int16 opus_int16;
typedef u_int16 opus_uint16;
typedef int32_t opus_int32;
typedef u_int32_t opus_uint32;
#elif defined (__EMX__)
# 111 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_types.h" 3
/* OS/2 GCC */
typedef short opus_int16;
typedef unsigned short opus_uint16;
typedef int opus_int32;
typedef unsigned int opus_uint32;
#elif defined (DJGPP)
# 119 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_types.h" 3
/* DJGPP */
typedef short opus_int16;
typedef unsigned short opus_uint16;
typedef int opus_int32;
typedef unsigned int opus_uint32;
#elif defined(R5900)
# 127 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_types.h" 3
/* PS2 EE */
typedef int opus_int32;
typedef unsigned opus_uint32;
typedef short opus_int16;
typedef unsigned short opus_uint16;
#elif defined(__SYMBIAN32__)
# 135 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_types.h" 3
/* Symbian GCC */
typedef signed short opus_int16;
typedef unsigned short opus_uint16;
typedef signed int opus_int32;
typedef unsigned int opus_uint32;
#elif defined(CONFIG_TI_C54X) || defined (CONFIG_TI_C55X)
# 143 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_types.h" 3
typedef short opus_int16;
typedef unsigned short opus_uint16;
typedef long opus_int32;
typedef unsigned long opus_uint32;
#elif defined(CONFIG_TI_C6X)
# 150 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_types.h" 3
typedef short opus_int16;
typedef unsigned short opus_uint16;
typedef int opus_int32;
typedef unsigned int opus_uint32;
#else
# 157 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_types.h" 3
/* Give up, take a reasonable guess */
typedef short opus_int16;
typedef unsigned short opus_uint16;
typedef int opus_int32;
typedef unsigned int opus_uint32;
#endif
# 165 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_types.h" 3
#endif /* OPUS_TYPES_H */
# 167 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_types.h" 3
# 38 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/arch.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "opus_defines.h"
#endif /* expanded by -frewrite-includes */
# 38 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/arch.h"
# 1 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_defines.h" 1 3
/* Copyright (c) 2010-2011 Xiph.Org Foundation, Skype Limited
Written by Jean-Marc Valin and Koen Vos */
/*
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* @file opus_defines.h
* @brief Opus reference implementation constants
*/
#ifndef OPUS_DEFINES_H
#define OPUS_DEFINES_H
#if 0 /* expanded by -frewrite-includes */
#include "opus_types.h"
#endif /* expanded by -frewrite-includes */
# 36 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_defines.h" 3
# 37 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_defines.h" 3
#ifdef __cplusplus
extern "C" {
#endif
# 41 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_defines.h" 3
/** @defgroup opus_errorcodes Error codes
* @{
*/
/** No error @hideinitializer*/
#define OPUS_OK 0
/** One or more invalid/out of range arguments @hideinitializer*/
#define OPUS_BAD_ARG -1
/** Not enough bytes allocated in the buffer @hideinitializer*/
#define OPUS_BUFFER_TOO_SMALL -2
/** An internal error was detected @hideinitializer*/
#define OPUS_INTERNAL_ERROR -3
/** The compressed data passed is corrupted @hideinitializer*/
#define OPUS_INVALID_PACKET -4
/** Invalid/unsupported request number @hideinitializer*/
#define OPUS_UNIMPLEMENTED -5
/** An encoder or decoder structure is invalid or already freed @hideinitializer*/
#define OPUS_INVALID_STATE -6
/** Memory allocation has failed @hideinitializer*/
#define OPUS_ALLOC_FAIL -7
/**@}*/
/** @cond OPUS_INTERNAL_DOC */
/**Export control for opus functions */
#ifndef OPUS_EXPORT
# if defined(WIN32)
# if defined(OPUS_BUILD) && defined(DLL_EXPORT)
# define OPUS_EXPORT __declspec(dllexport)
# else
# 71 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_defines.h" 3
# define OPUS_EXPORT
# endif
# 73 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_defines.h" 3
# elif defined(__GNUC__) && defined(OPUS_BUILD)
# 74 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_defines.h" 3
# define OPUS_EXPORT __attribute__ ((visibility ("default")))
# else
# 76 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_defines.h" 3
# define OPUS_EXPORT
# endif
# 78 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_defines.h" 3
#endif
# 79 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_defines.h" 3
# if !defined(OPUS_GNUC_PREREQ)
# if defined(__GNUC__)&&defined(__GNUC_MINOR__)
# define OPUS_GNUC_PREREQ(_maj,_min) \
((__GNUC__<<16)+__GNUC_MINOR__>=((_maj)<<16)+(_min))
# else
# 85 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_defines.h" 3
# define OPUS_GNUC_PREREQ(_maj,_min) 0
# endif
# 87 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_defines.h" 3
# endif
# 88 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_defines.h" 3
#if (!defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L) )
# if OPUS_GNUC_PREREQ(3,0)
# define OPUS_RESTRICT __restrict__
# elif (defined(_MSC_VER) && _MSC_VER >= 1400)
# 93 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_defines.h" 3
# define OPUS_RESTRICT __restrict
# else
# 95 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_defines.h" 3
# define OPUS_RESTRICT
# endif
# 97 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_defines.h" 3
#else
# 98 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_defines.h" 3
# define OPUS_RESTRICT restrict
#endif
# 100 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_defines.h" 3
#if (!defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L) )
# if OPUS_GNUC_PREREQ(2,7)
# define OPUS_INLINE __inline__
# elif (defined(_MSC_VER))
# 105 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_defines.h" 3
# define OPUS_INLINE __inline
# else
# 107 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_defines.h" 3
# define OPUS_INLINE
# endif
# 109 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_defines.h" 3
#else
# 110 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_defines.h" 3
# define OPUS_INLINE inline
#endif
# 112 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_defines.h" 3
/**Warning attributes for opus functions
* NONNULL is not used in OPUS_BUILD to avoid the compiler optimizing out
* some paranoid null checks. */
#if defined(__GNUC__) && OPUS_GNUC_PREREQ(3, 4)
# define OPUS_WARN_UNUSED_RESULT __attribute__ ((__warn_unused_result__))
#else
# 119 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_defines.h" 3
# define OPUS_WARN_UNUSED_RESULT
#endif
# 121 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_defines.h" 3
#if !defined(OPUS_BUILD) && defined(__GNUC__) && OPUS_GNUC_PREREQ(3, 4)
# define OPUS_ARG_NONNULL(_x) __attribute__ ((__nonnull__(_x)))
#else
# 124 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_defines.h" 3
# define OPUS_ARG_NONNULL(_x)
#endif
# 126 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_defines.h" 3
/** These are the actual Encoder CTL ID numbers.
* They should not be used directly by applications.
* In general, SETs should be even and GETs should be odd.*/
#define OPUS_SET_APPLICATION_REQUEST 4000
#define OPUS_GET_APPLICATION_REQUEST 4001
#define OPUS_SET_BITRATE_REQUEST 4002
#define OPUS_GET_BITRATE_REQUEST 4003
#define OPUS_SET_MAX_BANDWIDTH_REQUEST 4004
#define OPUS_GET_MAX_BANDWIDTH_REQUEST 4005
#define OPUS_SET_VBR_REQUEST 4006
#define OPUS_GET_VBR_REQUEST 4007
#define OPUS_SET_BANDWIDTH_REQUEST 4008
#define OPUS_GET_BANDWIDTH_REQUEST 4009
#define OPUS_SET_COMPLEXITY_REQUEST 4010
#define OPUS_GET_COMPLEXITY_REQUEST 4011
#define OPUS_SET_INBAND_FEC_REQUEST 4012
#define OPUS_GET_INBAND_FEC_REQUEST 4013
#define OPUS_SET_PACKET_LOSS_PERC_REQUEST 4014
#define OPUS_GET_PACKET_LOSS_PERC_REQUEST 4015
#define OPUS_SET_DTX_REQUEST 4016
#define OPUS_GET_DTX_REQUEST 4017
#define OPUS_SET_VBR_CONSTRAINT_REQUEST 4020
#define OPUS_GET_VBR_CONSTRAINT_REQUEST 4021
#define OPUS_SET_FORCE_CHANNELS_REQUEST 4022
#define OPUS_GET_FORCE_CHANNELS_REQUEST 4023
#define OPUS_SET_SIGNAL_REQUEST 4024
#define OPUS_GET_SIGNAL_REQUEST 4025
#define OPUS_GET_LOOKAHEAD_REQUEST 4027
/* #define OPUS_RESET_STATE 4028 */
#define OPUS_GET_SAMPLE_RATE_REQUEST 4029
#define OPUS_GET_FINAL_RANGE_REQUEST 4031
#define OPUS_GET_PITCH_REQUEST 4033
#define OPUS_SET_GAIN_REQUEST 4034
#define OPUS_GET_GAIN_REQUEST 4045 /* Should have been 4035 */
#define OPUS_SET_LSB_DEPTH_REQUEST 4036
#define OPUS_GET_LSB_DEPTH_REQUEST 4037
#define OPUS_GET_LAST_PACKET_DURATION_REQUEST 4039
#define OPUS_SET_EXPERT_FRAME_DURATION_REQUEST 4040
#define OPUS_GET_EXPERT_FRAME_DURATION_REQUEST 4041
#define OPUS_SET_PREDICTION_DISABLED_REQUEST 4042
#define OPUS_GET_PREDICTION_DISABLED_REQUEST 4043
/* Don't use 4045, it's already taken by OPUS_GET_GAIN_REQUEST */
#define OPUS_SET_PHASE_INVERSION_DISABLED_REQUEST 4046
#define OPUS_GET_PHASE_INVERSION_DISABLED_REQUEST 4047
#define OPUS_GET_IN_DTX_REQUEST 4049
/** Defines for the presence of extended APIs. */
#define OPUS_HAVE_OPUS_PROJECTION_H
/* Macros to trigger compilation errors when the wrong types are provided to a CTL */
#define __opus_check_int(x) (((void)((x) == (opus_int32)0)), (opus_int32)(x))
#define __opus_check_int_ptr(ptr) ((ptr) + ((ptr) - (opus_int32*)(ptr)))
#define __opus_check_uint_ptr(ptr) ((ptr) + ((ptr) - (opus_uint32*)(ptr)))
#define __opus_check_val16_ptr(ptr) ((ptr) + ((ptr) - (opus_val16*)(ptr)))
/** @endcond */
/** @defgroup opus_ctlvalues Pre-defined values for CTL interface
* @see opus_genericctls, opus_encoderctls
* @{
*/
/* Values for the various encoder CTLs */
#define OPUS_AUTO -1000 /**<Auto/default setting @hideinitializer*/
#define OPUS_BITRATE_MAX -1 /**<Maximum bitrate @hideinitializer*/
/** Best for most VoIP/videoconference applications where listening quality and intelligibility matter most
* @hideinitializer */
#define OPUS_APPLICATION_VOIP 2048
/** Best for broadcast/high-fidelity application where the decoded audio should be as close as possible to the input
* @hideinitializer */
#define OPUS_APPLICATION_AUDIO 2049
/** Only use when lowest-achievable latency is what matters most. Voice-optimized modes cannot be used.
* @hideinitializer */
#define OPUS_APPLICATION_RESTRICTED_LOWDELAY 2051
#define OPUS_SIGNAL_VOICE 3001 /**< Signal being encoded is voice */
#define OPUS_SIGNAL_MUSIC 3002 /**< Signal being encoded is music */
#define OPUS_BANDWIDTH_NARROWBAND 1101 /**< 4 kHz bandpass @hideinitializer*/
#define OPUS_BANDWIDTH_MEDIUMBAND 1102 /**< 6 kHz bandpass @hideinitializer*/
#define OPUS_BANDWIDTH_WIDEBAND 1103 /**< 8 kHz bandpass @hideinitializer*/
#define OPUS_BANDWIDTH_SUPERWIDEBAND 1104 /**<12 kHz bandpass @hideinitializer*/
#define OPUS_BANDWIDTH_FULLBAND 1105 /**<20 kHz bandpass @hideinitializer*/
#define OPUS_FRAMESIZE_ARG 5000 /**< Select frame size from the argument (default) */
#define OPUS_FRAMESIZE_2_5_MS 5001 /**< Use 2.5 ms frames */
#define OPUS_FRAMESIZE_5_MS 5002 /**< Use 5 ms frames */
#define OPUS_FRAMESIZE_10_MS 5003 /**< Use 10 ms frames */
#define OPUS_FRAMESIZE_20_MS 5004 /**< Use 20 ms frames */
#define OPUS_FRAMESIZE_40_MS 5005 /**< Use 40 ms frames */
#define OPUS_FRAMESIZE_60_MS 5006 /**< Use 60 ms frames */
#define OPUS_FRAMESIZE_80_MS 5007 /**< Use 80 ms frames */
#define OPUS_FRAMESIZE_100_MS 5008 /**< Use 100 ms frames */
#define OPUS_FRAMESIZE_120_MS 5009 /**< Use 120 ms frames */
/**@}*/
/** @defgroup opus_encoderctls Encoder related CTLs
*
* These are convenience macros for use with the \c opus_encode_ctl
* interface. They are used to generate the appropriate series of
* arguments for that call, passing the correct type, size and so
* on as expected for each particular request.
*
* Some usage examples:
*
* @code
* int ret;
* ret = opus_encoder_ctl(enc_ctx, OPUS_SET_BANDWIDTH(OPUS_AUTO));
* if (ret != OPUS_OK) return ret;
*
* opus_int32 rate;
* opus_encoder_ctl(enc_ctx, OPUS_GET_BANDWIDTH(&rate));
*
* opus_encoder_ctl(enc_ctx, OPUS_RESET_STATE);
* @endcode
*
* @see opus_genericctls, opus_encoder
* @{
*/
/** Configures the encoder's computational complexity.
* The supported range is 0-10 inclusive with 10 representing the highest complexity.
* @see OPUS_GET_COMPLEXITY
* @param[in] x <tt>opus_int32</tt>: Allowed values: 0-10, inclusive.
*
* @hideinitializer */
#define OPUS_SET_COMPLEXITY(x) OPUS_SET_COMPLEXITY_REQUEST, __opus_check_int(x)
/** Gets the encoder's complexity configuration.
* @see OPUS_SET_COMPLEXITY
* @param[out] x <tt>opus_int32 *</tt>: Returns a value in the range 0-10,
* inclusive.
* @hideinitializer */
#define OPUS_GET_COMPLEXITY(x) OPUS_GET_COMPLEXITY_REQUEST, __opus_check_int_ptr(x)
/** Configures the bitrate in the encoder.
* Rates from 500 to 512000 bits per second are meaningful, as well as the
* special values #OPUS_AUTO and #OPUS_BITRATE_MAX.
* The value #OPUS_BITRATE_MAX can be used to cause the codec to use as much
* rate as it can, which is useful for controlling the rate by adjusting the
* output buffer size.
* @see OPUS_GET_BITRATE
* @param[in] x <tt>opus_int32</tt>: Bitrate in bits per second. The default
* is determined based on the number of
* channels and the input sampling rate.
* @hideinitializer */
#define OPUS_SET_BITRATE(x) OPUS_SET_BITRATE_REQUEST, __opus_check_int(x)
/** Gets the encoder's bitrate configuration.
* @see OPUS_SET_BITRATE
* @param[out] x <tt>opus_int32 *</tt>: Returns the bitrate in bits per second.
* The default is determined based on the
* number of channels and the input
* sampling rate.
* @hideinitializer */
#define OPUS_GET_BITRATE(x) OPUS_GET_BITRATE_REQUEST, __opus_check_int_ptr(x)
/** Enables or disables variable bitrate (VBR) in the encoder.
* The configured bitrate may not be met exactly because frames must
* be an integer number of bytes in length.
* @see OPUS_GET_VBR
* @see OPUS_SET_VBR_CONSTRAINT
* @param[in] x <tt>opus_int32</tt>: Allowed values:
* <dl>
* <dt>0</dt><dd>Hard CBR. For LPC/hybrid modes at very low bit-rate, this can
* cause noticeable quality degradation.</dd>
* <dt>1</dt><dd>VBR (default). The exact type of VBR is controlled by
* #OPUS_SET_VBR_CONSTRAINT.</dd>
* </dl>
* @hideinitializer */
#define OPUS_SET_VBR(x) OPUS_SET_VBR_REQUEST, __opus_check_int(x)
/** Determine if variable bitrate (VBR) is enabled in the encoder.
* @see OPUS_SET_VBR
* @see OPUS_GET_VBR_CONSTRAINT
* @param[out] x <tt>opus_int32 *</tt>: Returns one of the following values:
* <dl>
* <dt>0</dt><dd>Hard CBR.</dd>
* <dt>1</dt><dd>VBR (default). The exact type of VBR may be retrieved via
* #OPUS_GET_VBR_CONSTRAINT.</dd>
* </dl>
* @hideinitializer */
#define OPUS_GET_VBR(x) OPUS_GET_VBR_REQUEST, __opus_check_int_ptr(x)
/** Enables or disables constrained VBR in the encoder.
* This setting is ignored when the encoder is in CBR mode.
* @warning Only the MDCT mode of Opus currently heeds the constraint.
* Speech mode ignores it completely, hybrid mode may fail to obey it
* if the LPC layer uses more bitrate than the constraint would have
* permitted.
* @see OPUS_GET_VBR_CONSTRAINT
* @see OPUS_SET_VBR
* @param[in] x <tt>opus_int32</tt>: Allowed values:
* <dl>
* <dt>0</dt><dd>Unconstrained VBR.</dd>
* <dt>1</dt><dd>Constrained VBR (default). This creates a maximum of one
* frame of buffering delay assuming a transport with a
* serialization speed of the nominal bitrate.</dd>
* </dl>
* @hideinitializer */
#define OPUS_SET_VBR_CONSTRAINT(x) OPUS_SET_VBR_CONSTRAINT_REQUEST, __opus_check_int(x)
/** Determine if constrained VBR is enabled in the encoder.
* @see OPUS_SET_VBR_CONSTRAINT
* @see OPUS_GET_VBR
* @param[out] x <tt>opus_int32 *</tt>: Returns one of the following values:
* <dl>
* <dt>0</dt><dd>Unconstrained VBR.</dd>
* <dt>1</dt><dd>Constrained VBR (default).</dd>
* </dl>
* @hideinitializer */
#define OPUS_GET_VBR_CONSTRAINT(x) OPUS_GET_VBR_CONSTRAINT_REQUEST, __opus_check_int_ptr(x)
/** Configures mono/stereo forcing in the encoder.
* This can force the encoder to produce packets encoded as either mono or
* stereo, regardless of the format of the input audio. This is useful when
* the caller knows that the input signal is currently a mono source embedded
* in a stereo stream.
* @see OPUS_GET_FORCE_CHANNELS
* @param[in] x <tt>opus_int32</tt>: Allowed values:
* <dl>
* <dt>#OPUS_AUTO</dt><dd>Not forced (default)</dd>
* <dt>1</dt> <dd>Forced mono</dd>
* <dt>2</dt> <dd>Forced stereo</dd>
* </dl>
* @hideinitializer */
#define OPUS_SET_FORCE_CHANNELS(x) OPUS_SET_FORCE_CHANNELS_REQUEST, __opus_check_int(x)
/** Gets the encoder's forced channel configuration.
* @see OPUS_SET_FORCE_CHANNELS
* @param[out] x <tt>opus_int32 *</tt>:
* <dl>
* <dt>#OPUS_AUTO</dt><dd>Not forced (default)</dd>
* <dt>1</dt> <dd>Forced mono</dd>
* <dt>2</dt> <dd>Forced stereo</dd>
* </dl>
* @hideinitializer */
#define OPUS_GET_FORCE_CHANNELS(x) OPUS_GET_FORCE_CHANNELS_REQUEST, __opus_check_int_ptr(x)
/** Configures the maximum bandpass that the encoder will select automatically.
* Applications should normally use this instead of #OPUS_SET_BANDWIDTH
* (leaving that set to the default, #OPUS_AUTO). This allows the
* application to set an upper bound based on the type of input it is
* providing, but still gives the encoder the freedom to reduce the bandpass
* when the bitrate becomes too low, for better overall quality.
* @see OPUS_GET_MAX_BANDWIDTH
* @param[in] x <tt>opus_int32</tt>: Allowed values:
* <dl>
* <dt>OPUS_BANDWIDTH_NARROWBAND</dt> <dd>4 kHz passband</dd>
* <dt>OPUS_BANDWIDTH_MEDIUMBAND</dt> <dd>6 kHz passband</dd>
* <dt>OPUS_BANDWIDTH_WIDEBAND</dt> <dd>8 kHz passband</dd>
* <dt>OPUS_BANDWIDTH_SUPERWIDEBAND</dt><dd>12 kHz passband</dd>
* <dt>OPUS_BANDWIDTH_FULLBAND</dt> <dd>20 kHz passband (default)</dd>
* </dl>
* @hideinitializer */
#define OPUS_SET_MAX_BANDWIDTH(x) OPUS_SET_MAX_BANDWIDTH_REQUEST, __opus_check_int(x)
/** Gets the encoder's configured maximum allowed bandpass.
* @see OPUS_SET_MAX_BANDWIDTH
* @param[out] x <tt>opus_int32 *</tt>: Allowed values:
* <dl>
* <dt>#OPUS_BANDWIDTH_NARROWBAND</dt> <dd>4 kHz passband</dd>
* <dt>#OPUS_BANDWIDTH_MEDIUMBAND</dt> <dd>6 kHz passband</dd>
* <dt>#OPUS_BANDWIDTH_WIDEBAND</dt> <dd>8 kHz passband</dd>
* <dt>#OPUS_BANDWIDTH_SUPERWIDEBAND</dt><dd>12 kHz passband</dd>
* <dt>#OPUS_BANDWIDTH_FULLBAND</dt> <dd>20 kHz passband (default)</dd>
* </dl>
* @hideinitializer */
#define OPUS_GET_MAX_BANDWIDTH(x) OPUS_GET_MAX_BANDWIDTH_REQUEST, __opus_check_int_ptr(x)
/** Sets the encoder's bandpass to a specific value.
* This prevents the encoder from automatically selecting the bandpass based
* on the available bitrate. If an application knows the bandpass of the input
* audio it is providing, it should normally use #OPUS_SET_MAX_BANDWIDTH
* instead, which still gives the encoder the freedom to reduce the bandpass
* when the bitrate becomes too low, for better overall quality.
* @see OPUS_GET_BANDWIDTH
* @param[in] x <tt>opus_int32</tt>: Allowed values:
* <dl>
* <dt>#OPUS_AUTO</dt> <dd>(default)</dd>
* <dt>#OPUS_BANDWIDTH_NARROWBAND</dt> <dd>4 kHz passband</dd>
* <dt>#OPUS_BANDWIDTH_MEDIUMBAND</dt> <dd>6 kHz passband</dd>
* <dt>#OPUS_BANDWIDTH_WIDEBAND</dt> <dd>8 kHz passband</dd>
* <dt>#OPUS_BANDWIDTH_SUPERWIDEBAND</dt><dd>12 kHz passband</dd>
* <dt>#OPUS_BANDWIDTH_FULLBAND</dt> <dd>20 kHz passband</dd>
* </dl>
* @hideinitializer */
#define OPUS_SET_BANDWIDTH(x) OPUS_SET_BANDWIDTH_REQUEST, __opus_check_int(x)
/** Configures the type of signal being encoded.
* This is a hint which helps the encoder's mode selection.
* @see OPUS_GET_SIGNAL
* @param[in] x <tt>opus_int32</tt>: Allowed values:
* <dl>
* <dt>#OPUS_AUTO</dt> <dd>(default)</dd>
* <dt>#OPUS_SIGNAL_VOICE</dt><dd>Bias thresholds towards choosing LPC or Hybrid modes.</dd>
* <dt>#OPUS_SIGNAL_MUSIC</dt><dd>Bias thresholds towards choosing MDCT modes.</dd>
* </dl>
* @hideinitializer */
#define OPUS_SET_SIGNAL(x) OPUS_SET_SIGNAL_REQUEST, __opus_check_int(x)
/** Gets the encoder's configured signal type.
* @see OPUS_SET_SIGNAL
* @param[out] x <tt>opus_int32 *</tt>: Returns one of the following values:
* <dl>
* <dt>#OPUS_AUTO</dt> <dd>(default)</dd>
* <dt>#OPUS_SIGNAL_VOICE</dt><dd>Bias thresholds towards choosing LPC or Hybrid modes.</dd>
* <dt>#OPUS_SIGNAL_MUSIC</dt><dd>Bias thresholds towards choosing MDCT modes.</dd>
* </dl>
* @hideinitializer */
#define OPUS_GET_SIGNAL(x) OPUS_GET_SIGNAL_REQUEST, __opus_check_int_ptr(x)
/** Configures the encoder's intended application.
* The initial value is a mandatory argument to the encoder_create function.
* @see OPUS_GET_APPLICATION
* @param[in] x <tt>opus_int32</tt>: Returns one of the following values:
* <dl>
* <dt>#OPUS_APPLICATION_VOIP</dt>
* <dd>Process signal for improved speech intelligibility.</dd>
* <dt>#OPUS_APPLICATION_AUDIO</dt>
* <dd>Favor faithfulness to the original input.</dd>
* <dt>#OPUS_APPLICATION_RESTRICTED_LOWDELAY</dt>
* <dd>Configure the minimum possible coding delay by disabling certain modes
* of operation.</dd>
* </dl>
* @hideinitializer */
#define OPUS_SET_APPLICATION(x) OPUS_SET_APPLICATION_REQUEST, __opus_check_int(x)
/** Gets the encoder's configured application.
* @see OPUS_SET_APPLICATION
* @param[out] x <tt>opus_int32 *</tt>: Returns one of the following values:
* <dl>
* <dt>#OPUS_APPLICATION_VOIP</dt>
* <dd>Process signal for improved speech intelligibility.</dd>
* <dt>#OPUS_APPLICATION_AUDIO</dt>
* <dd>Favor faithfulness to the original input.</dd>
* <dt>#OPUS_APPLICATION_RESTRICTED_LOWDELAY</dt>
* <dd>Configure the minimum possible coding delay by disabling certain modes
* of operation.</dd>
* </dl>
* @hideinitializer */
#define OPUS_GET_APPLICATION(x) OPUS_GET_APPLICATION_REQUEST, __opus_check_int_ptr(x)
/** Gets the total samples of delay added by the entire codec.
* This can be queried by the encoder and then the provided number of samples can be
* skipped on from the start of the decoder's output to provide time aligned input
* and output. From the perspective of a decoding application the real data begins this many
* samples late.
*
* The decoder contribution to this delay is identical for all decoders, but the
* encoder portion of the delay may vary from implementation to implementation,
* version to version, or even depend on the encoder's initial configuration.
* Applications needing delay compensation should call this CTL rather than
* hard-coding a value.
* @param[out] x <tt>opus_int32 *</tt>: Number of lookahead samples
* @hideinitializer */
#define OPUS_GET_LOOKAHEAD(x) OPUS_GET_LOOKAHEAD_REQUEST, __opus_check_int_ptr(x)
/** Configures the encoder's use of inband forward error correction (FEC).
* @note This is only applicable to the LPC layer
* @see OPUS_GET_INBAND_FEC
* @param[in] x <tt>opus_int32</tt>: Allowed values:
* <dl>
* <dt>0</dt><dd>Disable inband FEC (default).</dd>
* <dt>1</dt><dd>Enable inband FEC.</dd>
* </dl>
* @hideinitializer */
#define OPUS_SET_INBAND_FEC(x) OPUS_SET_INBAND_FEC_REQUEST, __opus_check_int(x)
/** Gets encoder's configured use of inband forward error correction.
* @see OPUS_SET_INBAND_FEC
* @param[out] x <tt>opus_int32 *</tt>: Returns one of the following values:
* <dl>
* <dt>0</dt><dd>Inband FEC disabled (default).</dd>
* <dt>1</dt><dd>Inband FEC enabled.</dd>
* </dl>
* @hideinitializer */
#define OPUS_GET_INBAND_FEC(x) OPUS_GET_INBAND_FEC_REQUEST, __opus_check_int_ptr(x)
/** Configures the encoder's expected packet loss percentage.
* Higher values trigger progressively more loss resistant behavior in the encoder
* at the expense of quality at a given bitrate in the absence of packet loss, but
* greater quality under loss.
* @see OPUS_GET_PACKET_LOSS_PERC
* @param[in] x <tt>opus_int32</tt>: Loss percentage in the range 0-100, inclusive (default: 0).
* @hideinitializer */
#define OPUS_SET_PACKET_LOSS_PERC(x) OPUS_SET_PACKET_LOSS_PERC_REQUEST, __opus_check_int(x)
/** Gets the encoder's configured packet loss percentage.
* @see OPUS_SET_PACKET_LOSS_PERC
* @param[out] x <tt>opus_int32 *</tt>: Returns the configured loss percentage
* in the range 0-100, inclusive (default: 0).
* @hideinitializer */
#define OPUS_GET_PACKET_LOSS_PERC(x) OPUS_GET_PACKET_LOSS_PERC_REQUEST, __opus_check_int_ptr(x)
/** Configures the encoder's use of discontinuous transmission (DTX).
* @note This is only applicable to the LPC layer
* @see OPUS_GET_DTX
* @param[in] x <tt>opus_int32</tt>: Allowed values:
* <dl>
* <dt>0</dt><dd>Disable DTX (default).</dd>
* <dt>1</dt><dd>Enabled DTX.</dd>
* </dl>
* @hideinitializer */
#define OPUS_SET_DTX(x) OPUS_SET_DTX_REQUEST, __opus_check_int(x)
/** Gets encoder's configured use of discontinuous transmission.
* @see OPUS_SET_DTX
* @param[out] x <tt>opus_int32 *</tt>: Returns one of the following values:
* <dl>
* <dt>0</dt><dd>DTX disabled (default).</dd>
* <dt>1</dt><dd>DTX enabled.</dd>
* </dl>
* @hideinitializer */
#define OPUS_GET_DTX(x) OPUS_GET_DTX_REQUEST, __opus_check_int_ptr(x)
/** Configures the depth of signal being encoded.
*
* This is a hint which helps the encoder identify silence and near-silence.
* It represents the number of significant bits of linear intensity below
* which the signal contains ignorable quantization or other noise.
*
* For example, OPUS_SET_LSB_DEPTH(14) would be an appropriate setting
* for G.711 u-law input. OPUS_SET_LSB_DEPTH(16) would be appropriate
* for 16-bit linear pcm input with opus_encode_float().
*
* When using opus_encode() instead of opus_encode_float(), or when libopus
* is compiled for fixed-point, the encoder uses the minimum of the value
* set here and the value 16.
*
* @see OPUS_GET_LSB_DEPTH
* @param[in] x <tt>opus_int32</tt>: Input precision in bits, between 8 and 24
* (default: 24).
* @hideinitializer */
#define OPUS_SET_LSB_DEPTH(x) OPUS_SET_LSB_DEPTH_REQUEST, __opus_check_int(x)
/** Gets the encoder's configured signal depth.
* @see OPUS_SET_LSB_DEPTH
* @param[out] x <tt>opus_int32 *</tt>: Input precision in bits, between 8 and
* 24 (default: 24).
* @hideinitializer */
#define OPUS_GET_LSB_DEPTH(x) OPUS_GET_LSB_DEPTH_REQUEST, __opus_check_int_ptr(x)
/** Configures the encoder's use of variable duration frames.
* When variable duration is enabled, the encoder is free to use a shorter frame
* size than the one requested in the opus_encode*() call.
* It is then the user's responsibility
* to verify how much audio was encoded by checking the ToC byte of the encoded
* packet. The part of the audio that was not encoded needs to be resent to the
* encoder for the next call. Do not use this option unless you <b>really</b>
* know what you are doing.
* @see OPUS_GET_EXPERT_FRAME_DURATION
* @param[in] x <tt>opus_int32</tt>: Allowed values:
* <dl>
* <dt>OPUS_FRAMESIZE_ARG</dt><dd>Select frame size from the argument (default).</dd>
* <dt>OPUS_FRAMESIZE_2_5_MS</dt><dd>Use 2.5 ms frames.</dd>
* <dt>OPUS_FRAMESIZE_5_MS</dt><dd>Use 5 ms frames.</dd>
* <dt>OPUS_FRAMESIZE_10_MS</dt><dd>Use 10 ms frames.</dd>
* <dt>OPUS_FRAMESIZE_20_MS</dt><dd>Use 20 ms frames.</dd>
* <dt>OPUS_FRAMESIZE_40_MS</dt><dd>Use 40 ms frames.</dd>
* <dt>OPUS_FRAMESIZE_60_MS</dt><dd>Use 60 ms frames.</dd>
* <dt>OPUS_FRAMESIZE_80_MS</dt><dd>Use 80 ms frames.</dd>
* <dt>OPUS_FRAMESIZE_100_MS</dt><dd>Use 100 ms frames.</dd>
* <dt>OPUS_FRAMESIZE_120_MS</dt><dd>Use 120 ms frames.</dd>
* </dl>
* @hideinitializer */
#define OPUS_SET_EXPERT_FRAME_DURATION(x) OPUS_SET_EXPERT_FRAME_DURATION_REQUEST, __opus_check_int(x)
/** Gets the encoder's configured use of variable duration frames.
* @see OPUS_SET_EXPERT_FRAME_DURATION
* @param[out] x <tt>opus_int32 *</tt>: Returns one of the following values:
* <dl>
* <dt>OPUS_FRAMESIZE_ARG</dt><dd>Select frame size from the argument (default).</dd>
* <dt>OPUS_FRAMESIZE_2_5_MS</dt><dd>Use 2.5 ms frames.</dd>
* <dt>OPUS_FRAMESIZE_5_MS</dt><dd>Use 5 ms frames.</dd>
* <dt>OPUS_FRAMESIZE_10_MS</dt><dd>Use 10 ms frames.</dd>
* <dt>OPUS_FRAMESIZE_20_MS</dt><dd>Use 20 ms frames.</dd>
* <dt>OPUS_FRAMESIZE_40_MS</dt><dd>Use 40 ms frames.</dd>
* <dt>OPUS_FRAMESIZE_60_MS</dt><dd>Use 60 ms frames.</dd>
* <dt>OPUS_FRAMESIZE_80_MS</dt><dd>Use 80 ms frames.</dd>
* <dt>OPUS_FRAMESIZE_100_MS</dt><dd>Use 100 ms frames.</dd>
* <dt>OPUS_FRAMESIZE_120_MS</dt><dd>Use 120 ms frames.</dd>
* </dl>
* @hideinitializer */
#define OPUS_GET_EXPERT_FRAME_DURATION(x) OPUS_GET_EXPERT_FRAME_DURATION_REQUEST, __opus_check_int_ptr(x)
/** If set to 1, disables almost all use of prediction, making frames almost
* completely independent. This reduces quality.
* @see OPUS_GET_PREDICTION_DISABLED
* @param[in] x <tt>opus_int32</tt>: Allowed values:
* <dl>
* <dt>0</dt><dd>Enable prediction (default).</dd>
* <dt>1</dt><dd>Disable prediction.</dd>
* </dl>
* @hideinitializer */
#define OPUS_SET_PREDICTION_DISABLED(x) OPUS_SET_PREDICTION_DISABLED_REQUEST, __opus_check_int(x)
/** Gets the encoder's configured prediction status.
* @see OPUS_SET_PREDICTION_DISABLED
* @param[out] x <tt>opus_int32 *</tt>: Returns one of the following values:
* <dl>
* <dt>0</dt><dd>Prediction enabled (default).</dd>
* <dt>1</dt><dd>Prediction disabled.</dd>
* </dl>
* @hideinitializer */
#define OPUS_GET_PREDICTION_DISABLED(x) OPUS_GET_PREDICTION_DISABLED_REQUEST, __opus_check_int_ptr(x)
/**@}*/
/** @defgroup opus_genericctls Generic CTLs
*
* These macros are used with the \c opus_decoder_ctl and
* \c opus_encoder_ctl calls to generate a particular
* request.
*
* When called on an \c OpusDecoder they apply to that
* particular decoder instance. When called on an
* \c OpusEncoder they apply to the corresponding setting
* on that encoder instance, if present.
*
* Some usage examples:
*
* @code
* int ret;
* opus_int32 pitch;
* ret = opus_decoder_ctl(dec_ctx, OPUS_GET_PITCH(&pitch));
* if (ret == OPUS_OK) return ret;
*
* opus_encoder_ctl(enc_ctx, OPUS_RESET_STATE);
* opus_decoder_ctl(dec_ctx, OPUS_RESET_STATE);
*
* opus_int32 enc_bw, dec_bw;
* opus_encoder_ctl(enc_ctx, OPUS_GET_BANDWIDTH(&enc_bw));
* opus_decoder_ctl(dec_ctx, OPUS_GET_BANDWIDTH(&dec_bw));
* if (enc_bw != dec_bw) {
* printf("packet bandwidth mismatch!\n");
* }
* @endcode
*
* @see opus_encoder, opus_decoder_ctl, opus_encoder_ctl, opus_decoderctls, opus_encoderctls
* @{
*/
/** Resets the codec state to be equivalent to a freshly initialized state.
* This should be called when switching streams in order to prevent
* the back to back decoding from giving different results from
* one at a time decoding.
* @hideinitializer */
#define OPUS_RESET_STATE 4028
/** Gets the final state of the codec's entropy coder.
* This is used for testing purposes,
* The encoder and decoder state should be identical after coding a payload
* (assuming no data corruption or software bugs)
*
* @param[out] x <tt>opus_uint32 *</tt>: Entropy coder state
*
* @hideinitializer */
#define OPUS_GET_FINAL_RANGE(x) OPUS_GET_FINAL_RANGE_REQUEST, __opus_check_uint_ptr(x)
/** Gets the encoder's configured bandpass or the decoder's last bandpass.
* @see OPUS_SET_BANDWIDTH
* @param[out] x <tt>opus_int32 *</tt>: Returns one of the following values:
* <dl>
* <dt>#OPUS_AUTO</dt> <dd>(default)</dd>
* <dt>#OPUS_BANDWIDTH_NARROWBAND</dt> <dd>4 kHz passband</dd>
* <dt>#OPUS_BANDWIDTH_MEDIUMBAND</dt> <dd>6 kHz passband</dd>
* <dt>#OPUS_BANDWIDTH_WIDEBAND</dt> <dd>8 kHz passband</dd>
* <dt>#OPUS_BANDWIDTH_SUPERWIDEBAND</dt><dd>12 kHz passband</dd>
* <dt>#OPUS_BANDWIDTH_FULLBAND</dt> <dd>20 kHz passband</dd>
* </dl>
* @hideinitializer */
#define OPUS_GET_BANDWIDTH(x) OPUS_GET_BANDWIDTH_REQUEST, __opus_check_int_ptr(x)
/** Gets the sampling rate the encoder or decoder was initialized with.
* This simply returns the <code>Fs</code> value passed to opus_encoder_init()
* or opus_decoder_init().
* @param[out] x <tt>opus_int32 *</tt>: Sampling rate of encoder or decoder.
* @hideinitializer
*/
#define OPUS_GET_SAMPLE_RATE(x) OPUS_GET_SAMPLE_RATE_REQUEST, __opus_check_int_ptr(x)
/** If set to 1, disables the use of phase inversion for intensity stereo,
* improving the quality of mono downmixes, but slightly reducing normal
* stereo quality. Disabling phase inversion in the decoder does not comply
* with RFC 6716, although it does not cause any interoperability issue and
* is expected to become part of the Opus standard once RFC 6716 is updated
* by draft-ietf-codec-opus-update.
* @see OPUS_GET_PHASE_INVERSION_DISABLED
* @param[in] x <tt>opus_int32</tt>: Allowed values:
* <dl>
* <dt>0</dt><dd>Enable phase inversion (default).</dd>
* <dt>1</dt><dd>Disable phase inversion.</dd>
* </dl>
* @hideinitializer */
#define OPUS_SET_PHASE_INVERSION_DISABLED(x) OPUS_SET_PHASE_INVERSION_DISABLED_REQUEST, __opus_check_int(x)
/** Gets the encoder's configured phase inversion status.
* @see OPUS_SET_PHASE_INVERSION_DISABLED
* @param[out] x <tt>opus_int32 *</tt>: Returns one of the following values:
* <dl>
* <dt>0</dt><dd>Stereo phase inversion enabled (default).</dd>
* <dt>1</dt><dd>Stereo phase inversion disabled.</dd>
* </dl>
* @hideinitializer */
#define OPUS_GET_PHASE_INVERSION_DISABLED(x) OPUS_GET_PHASE_INVERSION_DISABLED_REQUEST, __opus_check_int_ptr(x)
/** Gets the DTX state of the encoder.
* Returns whether the last encoded frame was either a comfort noise update
* during DTX or not encoded because of DTX.
* @param[out] x <tt>opus_int32 *</tt>: Returns one of the following values:
* <dl>
* <dt>0</dt><dd>The encoder is not in DTX.</dd>
* <dt>1</dt><dd>The encoder is in DTX.</dd>
* </dl>
* @hideinitializer */
#define OPUS_GET_IN_DTX(x) OPUS_GET_IN_DTX_REQUEST, __opus_check_int_ptr(x)
/**@}*/
/** @defgroup opus_decoderctls Decoder related CTLs
* @see opus_genericctls, opus_encoderctls, opus_decoder
* @{
*/
/** Configures decoder gain adjustment.
* Scales the decoded output by a factor specified in Q8 dB units.
* This has a maximum range of -32768 to 32767 inclusive, and returns
* OPUS_BAD_ARG otherwise. The default is zero indicating no adjustment.
* This setting survives decoder reset.
*
* gain = pow(10, x/(20.0*256))
*
* @param[in] x <tt>opus_int32</tt>: Amount to scale PCM signal by in Q8 dB units.
* @hideinitializer */
#define OPUS_SET_GAIN(x) OPUS_SET_GAIN_REQUEST, __opus_check_int(x)
/** Gets the decoder's configured gain adjustment. @see OPUS_SET_GAIN
*
* @param[out] x <tt>opus_int32 *</tt>: Amount to scale PCM signal by in Q8 dB units.
* @hideinitializer */
#define OPUS_GET_GAIN(x) OPUS_GET_GAIN_REQUEST, __opus_check_int_ptr(x)
/** Gets the duration (in samples) of the last packet successfully decoded or concealed.
* @param[out] x <tt>opus_int32 *</tt>: Number of samples (at current sampling rate).
* @hideinitializer */
#define OPUS_GET_LAST_PACKET_DURATION(x) OPUS_GET_LAST_PACKET_DURATION_REQUEST, __opus_check_int_ptr(x)
/** Gets the pitch of the last decoded frame, if available.
* This can be used for any post-processing algorithm requiring the use of pitch,
* e.g. time stretching/shortening. If the last frame was not voiced, or if the
* pitch was not coded in the frame, then zero is returned.
*
* This CTL is only implemented for decoder instances.
*
* @param[out] x <tt>opus_int32 *</tt>: pitch period at 48 kHz (or 0 if not available)
*
* @hideinitializer */
#define OPUS_GET_PITCH(x) OPUS_GET_PITCH_REQUEST, __opus_check_int_ptr(x)
/**@}*/
/** @defgroup opus_libinfo Opus library information functions
* @{
*/
/** Converts an opus error code into a human readable string.
*
* @param[in] error <tt>int</tt>: Error number
* @returns Error string
*/
OPUS_EXPORT const char *opus_strerror(int error);
/** Gets the libopus version string.
*
* Applications may look for the substring "-fixed" in the version string to
* determine whether they have a fixed-point or floating-point build at
* runtime.
*
* @returns Version string
*/
OPUS_EXPORT const char *opus_get_version_string(void);
/**@}*/
#ifdef __cplusplus
}
#endif
# 798 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_defines.h" 3
#endif /* OPUS_DEFINES_H */
# 800 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_defines.h" 3
# 39 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/arch.h" 2
# if !defined(__GNUC_PREREQ)
# if defined(__GNUC__)&&defined(__GNUC_MINOR__)
# define __GNUC_PREREQ(_maj,_min) \
((__GNUC__<<16)+__GNUC_MINOR__>=((_maj)<<16)+(_min))
# else
# 45 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/arch.h"
# define __GNUC_PREREQ(_maj,_min) 0
# endif
# 47 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/arch.h"
# endif
# 48 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/arch.h"
#if OPUS_GNUC_PREREQ(3, 0)
#define opus_likely(x) (__builtin_expect(!!(x), 1))
#define opus_unlikely(x) (__builtin_expect(!!(x), 0))
#else
# 53 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/arch.h"
#define opus_likely(x) (!!(x))
#define opus_unlikely(x) (!!(x))
#endif
# 56 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/arch.h"
#define CELT_SIG_SCALE 32768.f
#define CELT_FATAL(str) celt_fatal(str, __FILE__, __LINE__);
#if defined(ENABLE_ASSERTIONS) || defined(ENABLE_HARDENING)
#ifdef __GNUC__
__attribute__((noreturn))
#endif
# 65 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/arch.h"
void celt_fatal(const char *str, const char *file, int line);
#if defined(CELT_C) && !defined(OVERRIDE_celt_fatal)
#if 0 /* expanded by -frewrite-includes */
#include <stdio.h>
#endif /* expanded by -frewrite-includes */
# 68 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/arch.h"
# 69 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/arch.h"
#if 0 /* expanded by -frewrite-includes */
#include <stdlib.h>
#endif /* expanded by -frewrite-includes */
# 69 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/arch.h"
# 70 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/arch.h"
#ifdef __GNUC__
__attribute__((noreturn))
#endif
# 73 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/arch.h"
void celt_fatal(const char *str, const char *file, int line)
{
fprintf (stderr, "Fatal (internal) error in %s, line %d: %s\n", file, line, str);
abort();
}
#endif
# 79 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/arch.h"
#define celt_assert(cond) {if (!(cond)) {CELT_FATAL("assertion failed: " #cond);}}
#define celt_assert2(cond, message) {if (!(cond)) {CELT_FATAL("assertion failed: " #cond "\n" message);}}
#define MUST_SUCCEED(call) celt_assert((call) == OPUS_OK)
#else
# 84 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/arch.h"
#define celt_assert(cond)
#define celt_assert2(cond, message)
#define MUST_SUCCEED(call) do {if((call) != OPUS_OK) {RESTORE_STACK; return OPUS_INTERNAL_ERROR;} } while (0)
#endif
# 88 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/arch.h"
#if defined(ENABLE_ASSERTIONS)
#define celt_sig_assert(cond) {if (!(cond)) {CELT_FATAL("signal assertion failed: " #cond);}}
#else
# 92 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/arch.h"
#define celt_sig_assert(cond)
#endif
# 94 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/arch.h"
#define IMUL32(a,b) ((a)*(b))
#define MIN16(a,b) ((a) < (b) ? (a) : (b)) /**< Minimum 16-bit value. */
#define MAX16(a,b) ((a) > (b) ? (a) : (b)) /**< Maximum 16-bit value. */
#define MIN32(a,b) ((a) < (b) ? (a) : (b)) /**< Minimum 32-bit value. */
#define MAX32(a,b) ((a) > (b) ? (a) : (b)) /**< Maximum 32-bit value. */
#define IMIN(a,b) ((a) < (b) ? (a) : (b)) /**< Minimum int value. */
#define IMAX(a,b) ((a) > (b) ? (a) : (b)) /**< Maximum int value. */
#define UADD32(a,b) ((a)+(b))
#define USUB32(a,b) ((a)-(b))
/* Set this if opus_int64 is a native type of the CPU. */
/* Assume that all LP64 architectures have fast 64-bit types; also x86_64
(which can be ILP32 for x32) and Win64 (which is LLP64). */
#if defined(__x86_64__) || defined(__LP64__) || defined(_WIN64)
#define OPUS_FAST_INT64 1
#else
# 112 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/arch.h"
#define OPUS_FAST_INT64 0
#endif
# 114 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/arch.h"
#define PRINT_MIPS(file)
#ifdef FIXED_POINT
typedef opus_int16 opus_val16;
typedef opus_int32 opus_val32;
typedef opus_int64 opus_val64;
typedef opus_val32 celt_sig;
typedef opus_val16 celt_norm;
typedef opus_val32 celt_ener;
#define celt_isnan(x) 0
#define Q15ONE 32767
#define SIG_SHIFT 12
/* Safe saturation value for 32-bit signals. Should be less than
2^31*(1-0.85) to avoid blowing up on DC at deemphasis.*/
#define SIG_SAT (300000000)
#define NORM_SCALING 16384
#define DB_SHIFT 10
#define EPSILON 1
#define VERY_SMALL 0
#define VERY_LARGE16 ((opus_val16)32767)
#define Q15_ONE ((opus_val16)32767)
#define SCALEIN(a) (a)
#define SCALEOUT(a) (a)
#define ABS16(x) ((x) < 0 ? (-(x)) : (x))
#define ABS32(x) ((x) < 0 ? (-(x)) : (x))
static OPUS_INLINE opus_int16 SAT16(opus_int32 x) {
return x > 32767 ? 32767 : x < -32768 ? -32768 : (opus_int16)x;
}
#ifdef FIXED_DEBUG
#if 0 /* expanded by -frewrite-includes */
#include "fixed_debug.h"
#endif /* expanded by -frewrite-includes */
# 156 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/arch.h"
# 157 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/arch.h"
#else
# 158 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/arch.h"
#if 0 /* expanded by -frewrite-includes */
#include "fixed_generic.h"
#endif /* expanded by -frewrite-includes */
# 159 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/arch.h"
# 160 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/arch.h"
#ifdef OPUS_ARM_PRESUME_AARCH64_NEON_INTR
#if 0 /* expanded by -frewrite-includes */
#include "arm/fixed_arm64.h"
#endif /* expanded by -frewrite-includes */
# 162 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/arch.h"
# 163 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/arch.h"
#elif defined (OPUS_ARM_INLINE_EDSP)
# 164 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/arch.h"
#if 0 /* expanded by -frewrite-includes */
#include "arm/fixed_armv5e.h"
#endif /* expanded by -frewrite-includes */
# 164 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/arch.h"
# 165 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/arch.h"
#elif defined (OPUS_ARM_INLINE_ASM)
# 166 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/arch.h"
#if 0 /* expanded by -frewrite-includes */
#include "arm/fixed_armv4.h"
#endif /* expanded by -frewrite-includes */
# 166 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/arch.h"
# 167 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/arch.h"
#elif defined (BFIN_ASM)
# 168 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/arch.h"
#if 0 /* expanded by -frewrite-includes */
#include "fixed_bfin.h"
#endif /* expanded by -frewrite-includes */
# 168 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/arch.h"
# 169 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/arch.h"
#elif defined (TI_C5X_ASM)
# 170 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/arch.h"
#if 0 /* expanded by -frewrite-includes */
#include "fixed_c5x.h"
#endif /* expanded by -frewrite-includes */
# 170 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/arch.h"
# 171 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/arch.h"
#elif defined (TI_C6X_ASM)
# 172 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/arch.h"
#if 0 /* expanded by -frewrite-includes */
#include "fixed_c6x.h"
#endif /* expanded by -frewrite-includes */
# 172 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/arch.h"
# 173 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/arch.h"
#endif
# 174 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/arch.h"
#endif
# 176 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/arch.h"
#else /* FIXED_POINT */
# 178 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/arch.h"
typedef float opus_val16;
typedef float opus_val32;
typedef float opus_val64;
typedef float celt_sig;
typedef float celt_norm;
typedef float celt_ener;
#ifdef FLOAT_APPROX
/* This code should reliably detect NaN/inf even when -ffast-math is used.
Assumes IEEE 754 format. */
static OPUS_INLINE int celt_isnan(float x)
{
union {float f; opus_uint32 i;} in;
in.f = x;
return ((in.i>>23)&0xFF)==0xFF && (in.i&0x007FFFFF)!=0;
}
#else
# 197 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/arch.h"
#ifdef __FAST_MATH__
#error Cannot build libopus with -ffast-math unless FLOAT_APPROX is defined. This could result in crashes on extreme (e.g. NaN) input
#endif
# 200 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/arch.h"
#define celt_isnan(x) ((x)!=(x))
#endif
# 202 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/arch.h"
#define Q15ONE 1.0f
#define NORM_SCALING 1.f
#define EPSILON 1e-15f
#define VERY_SMALL 1e-30f
#define VERY_LARGE16 1e15f
#define Q15_ONE ((opus_val16)1.f)
/* This appears to be the same speed as C99's fabsf() but it's more portable. */
#define ABS16(x) ((float)fabs(x))
#define ABS32(x) ((float)fabs(x))
#define QCONST16(x,bits) (x)
#define QCONST32(x,bits) (x)
#define NEG16(x) (-(x))
#define NEG32(x) (-(x))
#define NEG32_ovflw(x) (-(x))
#define EXTRACT16(x) (x)
#define EXTEND32(x) (x)
#define SHR16(a,shift) (a)
#define SHL16(a,shift) (a)
#define SHR32(a,shift) (a)
#define SHL32(a,shift) (a)
#define PSHR32(a,shift) (a)
#define VSHR32(a,shift) (a)
#define PSHR(a,shift) (a)
#define SHR(a,shift) (a)
#define SHL(a,shift) (a)
#define SATURATE(x,a) (x)
#define SATURATE16(x) (x)
#define ROUND16(a,shift) (a)
#define SROUND16(a,shift) (a)
#define HALF16(x) (.5f*(x))
#define HALF32(x) (.5f*(x))
#define ADD16(a,b) ((a)+(b))
#define SUB16(a,b) ((a)-(b))
#define ADD32(a,b) ((a)+(b))
#define SUB32(a,b) ((a)-(b))
#define ADD32_ovflw(a,b) ((a)+(b))
#define SUB32_ovflw(a,b) ((a)-(b))
#define MULT16_16_16(a,b) ((a)*(b))
#define MULT16_16(a,b) ((opus_val32)(a)*(opus_val32)(b))
#define MAC16_16(c,a,b) ((c)+(opus_val32)(a)*(opus_val32)(b))
#define MULT16_32_Q15(a,b) ((a)*(b))
#define MULT16_32_Q16(a,b) ((a)*(b))
#define MULT32_32_Q31(a,b) ((a)*(b))
#define MAC16_32_Q15(c,a,b) ((c)+(a)*(b))
#define MAC16_32_Q16(c,a,b) ((c)+(a)*(b))
#define MULT16_16_Q11_32(a,b) ((a)*(b))
#define MULT16_16_Q11(a,b) ((a)*(b))
#define MULT16_16_Q13(a,b) ((a)*(b))
#define MULT16_16_Q14(a,b) ((a)*(b))
#define MULT16_16_Q15(a,b) ((a)*(b))
#define MULT16_16_P15(a,b) ((a)*(b))
#define MULT16_16_P13(a,b) ((a)*(b))
#define MULT16_16_P14(a,b) ((a)*(b))
#define MULT16_32_P16(a,b) ((a)*(b))
#define DIV32_16(a,b) (((opus_val32)(a))/(opus_val16)(b))
#define DIV32(a,b) (((opus_val32)(a))/(opus_val32)(b))
#define SCALEIN(a) ((a)*CELT_SIG_SCALE)
#define SCALEOUT(a) ((a)*(1/CELT_SIG_SCALE))
#define SIG2WORD16(x) (x)
#endif /* !FIXED_POINT */
# 279 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/arch.h"
#ifndef GLOBAL_STACK_SIZE
#ifdef FIXED_POINT
#define GLOBAL_STACK_SIZE 120000
#else
# 284 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/arch.h"
#define GLOBAL_STACK_SIZE 120000
#endif
# 286 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/arch.h"
#endif
# 287 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/arch.h"
#endif /* ARCH_H */
# 289 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/arch.h"
# 34 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "modes.h"
#endif /* expanded by -frewrite-includes */
# 34 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.h"
# 1 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/modes.h" 1
/* Copyright (c) 2007-2008 CSIRO
Copyright (c) 2007-2009 Xiph.Org Foundation
Copyright (c) 2008 Gregory Maxwell
Written by Jean-Marc Valin and Gregory Maxwell */
/*
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef MODES_H
#define MODES_H
#if 0 /* expanded by -frewrite-includes */
#include "opus_types.h"
#endif /* expanded by -frewrite-includes */
# 33 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/modes.h"
# 34 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/modes.h"
#if 0 /* expanded by -frewrite-includes */
#include "celt.h"
#endif /* expanded by -frewrite-includes */
# 34 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/modes.h"
# 1 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/celt.h" 1
/* Copyright (c) 2007-2008 CSIRO
Copyright (c) 2007-2009 Xiph.Org Foundation
Copyright (c) 2008 Gregory Maxwell
Written by Jean-Marc Valin and Gregory Maxwell */
/**
@file celt.h
@brief Contains all the functions for encoding and decoding audio
*/
/*
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef CELT_H
#define CELT_H
#if 0 /* expanded by -frewrite-includes */
#include "opus_types.h"
#endif /* expanded by -frewrite-includes */
# 38 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/celt.h"
# 39 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/celt.h"
#if 0 /* expanded by -frewrite-includes */
#include "opus_defines.h"
#endif /* expanded by -frewrite-includes */
# 39 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/celt.h"
# 40 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/celt.h"
#if 0 /* expanded by -frewrite-includes */
#include "opus_custom.h"
#endif /* expanded by -frewrite-includes */
# 40 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/celt.h"
# 1 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_custom.h" 1 3
/* Copyright (c) 2007-2008 CSIRO
Copyright (c) 2007-2009 Xiph.Org Foundation
Copyright (c) 2008-2012 Gregory Maxwell
Written by Jean-Marc Valin and Gregory Maxwell */
/*
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
@file opus_custom.h
@brief Opus-Custom reference implementation API
*/
#ifndef OPUS_CUSTOM_H
#define OPUS_CUSTOM_H
#if 0 /* expanded by -frewrite-includes */
#include "opus_defines.h"
#endif /* expanded by -frewrite-includes */
# 38 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_custom.h" 3
# 39 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_custom.h" 3
#ifdef __cplusplus
extern "C" {
#endif
# 43 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_custom.h" 3
#ifdef CUSTOM_MODES
# define OPUS_CUSTOM_EXPORT OPUS_EXPORT
# define OPUS_CUSTOM_EXPORT_STATIC OPUS_EXPORT
#else
# 48 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_custom.h" 3
# define OPUS_CUSTOM_EXPORT
# ifdef OPUS_BUILD
# define OPUS_CUSTOM_EXPORT_STATIC static OPUS_INLINE
# else
# 52 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_custom.h" 3
# define OPUS_CUSTOM_EXPORT_STATIC
# endif
# 54 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_custom.h" 3
#endif
# 55 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_custom.h" 3
/** @defgroup opus_custom Opus Custom
* @{
* Opus Custom is an optional part of the Opus specification and
* reference implementation which uses a distinct API from the regular
* API and supports frame sizes that are not normally supported.\ Use
* of Opus Custom is discouraged for all but very special applications
* for which a frame size different from 2.5, 5, 10, or 20 ms is needed
* (for either complexity or latency reasons) and where interoperability
* is less important.
*
* In addition to the interoperability limitations the use of Opus custom
* disables a substantial chunk of the codec and generally lowers the
* quality available at a given bitrate. Normally when an application needs
* a different frame size from the codec it should buffer to match the
* sizes but this adds a small amount of delay which may be important
* in some very low latency applications. Some transports (especially
* constant rate RF transports) may also work best with frames of
* particular durations.
*
* Libopus only supports custom modes if they are enabled at compile time.
*
* The Opus Custom API is similar to the regular API but the
* @ref opus_encoder_create and @ref opus_decoder_create calls take
* an additional mode parameter which is a structure produced by
* a call to @ref opus_custom_mode_create. Both the encoder and decoder
* must create a mode using the same sample rate (fs) and frame size
* (frame size) so these parameters must either be signaled out of band
* or fixed in a particular implementation.
*
* Similar to regular Opus the custom modes support on the fly frame size
* switching, but the sizes available depend on the particular frame size in
* use. For some initial frame sizes on a single on the fly size is available.
*/
/** Contains the state of an encoder. One encoder state is needed
for each stream. It is initialized once at the beginning of the
stream. Do *not* re-initialize the state for every frame.
@brief Encoder state
*/
typedef struct OpusCustomEncoder OpusCustomEncoder;
/** State of the decoder. One decoder state is needed for each stream.
It is initialized once at the beginning of the stream. Do *not*
re-initialize the state for every frame.
@brief Decoder state
*/
typedef struct OpusCustomDecoder OpusCustomDecoder;
/** The mode contains all the information necessary to create an
encoder. Both the encoder and decoder need to be initialized
with exactly the same mode, otherwise the output will be
corrupted.
@brief Mode configuration
*/
typedef struct OpusCustomMode OpusCustomMode;
/** Creates a new mode struct. This will be passed to an encoder or
* decoder. The mode MUST NOT BE DESTROYED until the encoders and
* decoders that use it are destroyed as well.
* @param [in] Fs <tt>int</tt>: Sampling rate (8000 to 96000 Hz)
* @param [in] frame_size <tt>int</tt>: Number of samples (per channel) to encode in each
* packet (64 - 1024, prime factorization must contain zero or more 2s, 3s, or 5s and no other primes)
* @param [out] error <tt>int*</tt>: Returned error code (if NULL, no error will be returned)
* @return A newly created mode
*/
OPUS_CUSTOM_EXPORT OPUS_WARN_UNUSED_RESULT OpusCustomMode *opus_custom_mode_create(opus_int32 Fs, int frame_size, int *error);
/** Destroys a mode struct. Only call this after all encoders and
* decoders using this mode are destroyed as well.
* @param [in] mode <tt>OpusCustomMode*</tt>: Mode to be freed.
*/
OPUS_CUSTOM_EXPORT void opus_custom_mode_destroy(OpusCustomMode *mode);
#if !defined(OPUS_BUILD) || defined(CELT_ENCODER_C)
/* Encoder */
/** Gets the size of an OpusCustomEncoder structure.
* @param [in] mode <tt>OpusCustomMode *</tt>: Mode configuration
* @param [in] channels <tt>int</tt>: Number of channels
* @returns size
*/
OPUS_CUSTOM_EXPORT_STATIC OPUS_WARN_UNUSED_RESULT int opus_custom_encoder_get_size(
const OpusCustomMode *mode,
int channels
) OPUS_ARG_NONNULL(1);
# ifdef CUSTOM_MODES
/** Initializes a previously allocated encoder state
* The memory pointed to by st must be the size returned by opus_custom_encoder_get_size.
* This is intended for applications which use their own allocator instead of malloc.
* @see opus_custom_encoder_create(),opus_custom_encoder_get_size()
* To reset a previously initialized state use the OPUS_RESET_STATE CTL.
* @param [in] st <tt>OpusCustomEncoder*</tt>: Encoder state
* @param [in] mode <tt>OpusCustomMode *</tt>: Contains all the information about the characteristics of
* the stream (must be the same characteristics as used for the
* decoder)
* @param [in] channels <tt>int</tt>: Number of channels
* @return OPUS_OK Success or @ref opus_errorcodes
*/
OPUS_CUSTOM_EXPORT int opus_custom_encoder_init(
OpusCustomEncoder *st,
const OpusCustomMode *mode,
int channels
) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2);
# endif
# 162 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_custom.h" 3
#endif
# 163 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_custom.h" 3
/** Creates a new encoder state. Each stream needs its own encoder
* state (can't be shared across simultaneous streams).
* @param [in] mode <tt>OpusCustomMode*</tt>: Contains all the information about the characteristics of
* the stream (must be the same characteristics as used for the
* decoder)
* @param [in] channels <tt>int</tt>: Number of channels
* @param [out] error <tt>int*</tt>: Returns an error code
* @return Newly created encoder state.
*/
OPUS_CUSTOM_EXPORT OPUS_WARN_UNUSED_RESULT OpusCustomEncoder *opus_custom_encoder_create(
const OpusCustomMode *mode,
int channels,
int *error
) OPUS_ARG_NONNULL(1);
/** Destroys a an encoder state.
* @param[in] st <tt>OpusCustomEncoder*</tt>: State to be freed.
*/
OPUS_CUSTOM_EXPORT void opus_custom_encoder_destroy(OpusCustomEncoder *st);
/** Encodes a frame of audio.
* @param [in] st <tt>OpusCustomEncoder*</tt>: Encoder state
* @param [in] pcm <tt>float*</tt>: PCM audio in float format, with a normal range of +/-1.0.
* Samples with a range beyond +/-1.0 are supported but will
* be clipped by decoders using the integer API and should
* only be used if it is known that the far end supports
* extended dynamic range. There must be exactly
* frame_size samples per channel.
* @param [in] frame_size <tt>int</tt>: Number of samples per frame of input signal
* @param [out] compressed <tt>char *</tt>: The compressed data is written here. This may not alias pcm and must be at least maxCompressedBytes long.
* @param [in] maxCompressedBytes <tt>int</tt>: Maximum number of bytes to use for compressing the frame
* (can change from one frame to another)
* @return Number of bytes written to "compressed".
* If negative, an error has occurred (see error codes). It is IMPORTANT that
* the length returned be somehow transmitted to the decoder. Otherwise, no
* decoding is possible.
*/
OPUS_CUSTOM_EXPORT OPUS_WARN_UNUSED_RESULT int opus_custom_encode_float(
OpusCustomEncoder *st,
const float *pcm,
int frame_size,
unsigned char *compressed,
int maxCompressedBytes
) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4);
/** Encodes a frame of audio.
* @param [in] st <tt>OpusCustomEncoder*</tt>: Encoder state
* @param [in] pcm <tt>opus_int16*</tt>: PCM audio in signed 16-bit format (native endian).
* There must be exactly frame_size samples per channel.
* @param [in] frame_size <tt>int</tt>: Number of samples per frame of input signal
* @param [out] compressed <tt>char *</tt>: The compressed data is written here. This may not alias pcm and must be at least maxCompressedBytes long.
* @param [in] maxCompressedBytes <tt>int</tt>: Maximum number of bytes to use for compressing the frame
* (can change from one frame to another)
* @return Number of bytes written to "compressed".
* If negative, an error has occurred (see error codes). It is IMPORTANT that
* the length returned be somehow transmitted to the decoder. Otherwise, no
* decoding is possible.
*/
OPUS_CUSTOM_EXPORT OPUS_WARN_UNUSED_RESULT int opus_custom_encode(
OpusCustomEncoder *st,
const opus_int16 *pcm,
int frame_size,
unsigned char *compressed,
int maxCompressedBytes
) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4);
/** Perform a CTL function on an Opus custom encoder.
*
* Generally the request and subsequent arguments are generated
* by a convenience macro.
* @see opus_encoderctls
*/
OPUS_CUSTOM_EXPORT int opus_custom_encoder_ctl(OpusCustomEncoder * OPUS_RESTRICT st, int request, ...) OPUS_ARG_NONNULL(1);
#if !defined(OPUS_BUILD) || defined(CELT_DECODER_C)
/* Decoder */
/** Gets the size of an OpusCustomDecoder structure.
* @param [in] mode <tt>OpusCustomMode *</tt>: Mode configuration
* @param [in] channels <tt>int</tt>: Number of channels
* @returns size
*/
OPUS_CUSTOM_EXPORT_STATIC OPUS_WARN_UNUSED_RESULT int opus_custom_decoder_get_size(
const OpusCustomMode *mode,
int channels
) OPUS_ARG_NONNULL(1);
/** Initializes a previously allocated decoder state
* The memory pointed to by st must be the size returned by opus_custom_decoder_get_size.
* This is intended for applications which use their own allocator instead of malloc.
* @see opus_custom_decoder_create(),opus_custom_decoder_get_size()
* To reset a previously initialized state use the OPUS_RESET_STATE CTL.
* @param [in] st <tt>OpusCustomDecoder*</tt>: Decoder state
* @param [in] mode <tt>OpusCustomMode *</tt>: Contains all the information about the characteristics of
* the stream (must be the same characteristics as used for the
* encoder)
* @param [in] channels <tt>int</tt>: Number of channels
* @return OPUS_OK Success or @ref opus_errorcodes
*/
OPUS_CUSTOM_EXPORT_STATIC int opus_custom_decoder_init(
OpusCustomDecoder *st,
const OpusCustomMode *mode,
int channels
) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2);
#endif
# 273 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_custom.h" 3
/** Creates a new decoder state. Each stream needs its own decoder state (can't
* be shared across simultaneous streams).
* @param [in] mode <tt>OpusCustomMode</tt>: Contains all the information about the characteristics of the
* stream (must be the same characteristics as used for the encoder)
* @param [in] channels <tt>int</tt>: Number of channels
* @param [out] error <tt>int*</tt>: Returns an error code
* @return Newly created decoder state.
*/
OPUS_CUSTOM_EXPORT OPUS_WARN_UNUSED_RESULT OpusCustomDecoder *opus_custom_decoder_create(
const OpusCustomMode *mode,
int channels,
int *error
) OPUS_ARG_NONNULL(1);
/** Destroys a an decoder state.
* @param[in] st <tt>OpusCustomDecoder*</tt>: State to be freed.
*/
OPUS_CUSTOM_EXPORT void opus_custom_decoder_destroy(OpusCustomDecoder *st);
/** Decode an opus custom frame with floating point output
* @param [in] st <tt>OpusCustomDecoder*</tt>: Decoder state
* @param [in] data <tt>char*</tt>: Input payload. Use a NULL pointer to indicate packet loss
* @param [in] len <tt>int</tt>: Number of bytes in payload
* @param [out] pcm <tt>float*</tt>: Output signal (interleaved if 2 channels). length
* is frame_size*channels*sizeof(float)
* @param [in] frame_size Number of samples per channel of available space in *pcm.
* @returns Number of decoded samples or @ref opus_errorcodes
*/
OPUS_CUSTOM_EXPORT OPUS_WARN_UNUSED_RESULT int opus_custom_decode_float(
OpusCustomDecoder *st,
const unsigned char *data,
int len,
float *pcm,
int frame_size
) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4);
/** Decode an opus custom frame
* @param [in] st <tt>OpusCustomDecoder*</tt>: Decoder state
* @param [in] data <tt>char*</tt>: Input payload. Use a NULL pointer to indicate packet loss
* @param [in] len <tt>int</tt>: Number of bytes in payload
* @param [out] pcm <tt>opus_int16*</tt>: Output signal (interleaved if 2 channels). length
* is frame_size*channels*sizeof(opus_int16)
* @param [in] frame_size Number of samples per channel of available space in *pcm.
* @returns Number of decoded samples or @ref opus_errorcodes
*/
OPUS_CUSTOM_EXPORT OPUS_WARN_UNUSED_RESULT int opus_custom_decode(
OpusCustomDecoder *st,
const unsigned char *data,
int len,
opus_int16 *pcm,
int frame_size
) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4);
/** Perform a CTL function on an Opus custom decoder.
*
* Generally the request and subsequent arguments are generated
* by a convenience macro.
* @see opus_genericctls
*/
OPUS_CUSTOM_EXPORT int opus_custom_decoder_ctl(OpusCustomDecoder * OPUS_RESTRICT st, int request, ...) OPUS_ARG_NONNULL(1);
/**@}*/
#ifdef __cplusplus
}
#endif
# 341 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_custom.h" 3
#endif /* OPUS_CUSTOM_H */
# 343 "/home/daurnimator/src/zig-playground/opus-1.3.1/include/opus_custom.h" 3
# 41 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/celt.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "entenc.h"
#endif /* expanded by -frewrite-includes */
# 41 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/celt.h"
# 1 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/entenc.h" 1
/* Copyright (c) 2001-2011 Timothy B. Terriberry
Copyright (c) 2008-2009 Xiph.Org Foundation */
/*
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#if !defined(_entenc_H)
# define _entenc_H (1)
#if 0 /* expanded by -frewrite-includes */
# include <stddef.h>
#endif /* expanded by -frewrite-includes */
# 30 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/entenc.h"
# 1 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/stddef.h" 1 3
#ifndef _STDDEF_H
#define _STDDEF_H
#ifdef __cplusplus
#define NULL 0L
#else
# 7 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/stddef.h" 3
#define NULL ((void*)0)
#endif
# 9 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/stddef.h" 3
#define __NEED_ptrdiff_t
#define __NEED_size_t
#define __NEED_wchar_t
#if __STDC_VERSION__ >= 201112L || __cplusplus >= 201103L
#define __NEED_max_align_t
#endif
# 16 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/stddef.h" 3
#if 0 /* expanded by -frewrite-includes */
#include <bits/alltypes.h>
#endif /* expanded by -frewrite-includes */
# 17 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/stddef.h" 3
# 1 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 1 3
#define _Addr long
#define _Int64 long long
#define _Reg long
#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
typedef __builtin_va_list va_list;
#define __DEFINED_va_list
#endif
# 9 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
typedef __builtin_va_list __isoc_va_list;
#define __DEFINED___isoc_va_list
#endif
# 14 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#ifndef __cplusplus
#if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t)
typedef int wchar_t;
#define __DEFINED_wchar_t
#endif
# 21 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#endif
# 23 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_float_t) && !defined(__DEFINED_float_t)
typedef float float_t;
#define __DEFINED_float_t
#endif
# 28 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_double_t) && !defined(__DEFINED_double_t)
typedef double double_t;
#define __DEFINED_double_t
#endif
# 33 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_max_align_t) && !defined(__DEFINED_max_align_t)
typedef struct { long long __ll; long double __ld; } max_align_t;
#define __DEFINED_max_align_t
#endif
# 39 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
typedef long time_t;
#define __DEFINED_time_t
#endif
# 45 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
typedef long suseconds_t;
#define __DEFINED_suseconds_t
#endif
# 50 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
typedef struct { union { int __i[9]; volatile int __vi[9]; unsigned __s[9]; } __u; } pthread_attr_t;
#define __DEFINED_pthread_attr_t
#endif
# 56 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
typedef struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } pthread_mutex_t;
#define __DEFINED_pthread_mutex_t
#endif
# 61 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
typedef struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } mtx_t;
#define __DEFINED_mtx_t
#endif
# 66 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } pthread_cond_t;
#define __DEFINED_pthread_cond_t
#endif
# 71 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } cnd_t;
#define __DEFINED_cnd_t
#endif
# 76 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
typedef struct { union { int __i[8]; volatile int __vi[8]; void *__p[8]; } __u; } pthread_rwlock_t;
#define __DEFINED_pthread_rwlock_t
#endif
# 81 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
typedef struct { union { int __i[5]; volatile int __vi[5]; void *__p[5]; } __u; } pthread_barrier_t;
#define __DEFINED_pthread_barrier_t
#endif
# 86 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_size_t) && !defined(__DEFINED_size_t)
typedef unsigned _Addr size_t;
#define __DEFINED_size_t
#endif
# 91 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_uintptr_t) && !defined(__DEFINED_uintptr_t)
typedef unsigned _Addr uintptr_t;
#define __DEFINED_uintptr_t
#endif
# 96 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_ptrdiff_t) && !defined(__DEFINED_ptrdiff_t)
typedef _Addr ptrdiff_t;
#define __DEFINED_ptrdiff_t
#endif
# 101 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_ssize_t) && !defined(__DEFINED_ssize_t)
typedef _Addr ssize_t;
#define __DEFINED_ssize_t
#endif
# 106 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_intptr_t) && !defined(__DEFINED_intptr_t)
typedef _Addr intptr_t;
#define __DEFINED_intptr_t
#endif
# 111 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_regoff_t) && !defined(__DEFINED_regoff_t)
typedef _Addr regoff_t;
#define __DEFINED_regoff_t
#endif
# 116 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_register_t) && !defined(__DEFINED_register_t)
typedef _Reg register_t;
#define __DEFINED_register_t
#endif
# 121 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_int8_t) && !defined(__DEFINED_int8_t)
typedef signed char int8_t;
#define __DEFINED_int8_t
#endif
# 127 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_int16_t) && !defined(__DEFINED_int16_t)
typedef signed short int16_t;
#define __DEFINED_int16_t
#endif
# 132 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_int32_t) && !defined(__DEFINED_int32_t)
typedef signed int int32_t;
#define __DEFINED_int32_t
#endif
# 137 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_int64_t) && !defined(__DEFINED_int64_t)
typedef signed _Int64 int64_t;
#define __DEFINED_int64_t
#endif
# 142 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_intmax_t) && !defined(__DEFINED_intmax_t)
typedef signed _Int64 intmax_t;
#define __DEFINED_intmax_t
#endif
# 147 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_uint8_t) && !defined(__DEFINED_uint8_t)
typedef unsigned char uint8_t;
#define __DEFINED_uint8_t
#endif
# 152 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_uint16_t) && !defined(__DEFINED_uint16_t)
typedef unsigned short uint16_t;
#define __DEFINED_uint16_t
#endif
# 157 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_uint32_t) && !defined(__DEFINED_uint32_t)
typedef unsigned int uint32_t;
#define __DEFINED_uint32_t
#endif
# 162 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_uint64_t) && !defined(__DEFINED_uint64_t)
typedef unsigned _Int64 uint64_t;
#define __DEFINED_uint64_t
#endif
# 167 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_u_int64_t) && !defined(__DEFINED_u_int64_t)
typedef unsigned _Int64 u_int64_t;
#define __DEFINED_u_int64_t
#endif
# 172 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_uintmax_t) && !defined(__DEFINED_uintmax_t)
typedef unsigned _Int64 uintmax_t;
#define __DEFINED_uintmax_t
#endif
# 177 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_mode_t) && !defined(__DEFINED_mode_t)
typedef unsigned mode_t;
#define __DEFINED_mode_t
#endif
# 183 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_nlink_t) && !defined(__DEFINED_nlink_t)
typedef unsigned _Reg nlink_t;
#define __DEFINED_nlink_t
#endif
# 188 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_off_t) && !defined(__DEFINED_off_t)
typedef _Int64 off_t;
#define __DEFINED_off_t
#endif
# 193 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_ino_t) && !defined(__DEFINED_ino_t)
typedef unsigned _Int64 ino_t;
#define __DEFINED_ino_t
#endif
# 198 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_dev_t) && !defined(__DEFINED_dev_t)
typedef unsigned _Int64 dev_t;
#define __DEFINED_dev_t
#endif
# 203 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_blksize_t) && !defined(__DEFINED_blksize_t)
typedef long blksize_t;
#define __DEFINED_blksize_t
#endif
# 208 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_blkcnt_t) && !defined(__DEFINED_blkcnt_t)
typedef _Int64 blkcnt_t;
#define __DEFINED_blkcnt_t
#endif
# 213 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_fsblkcnt_t) && !defined(__DEFINED_fsblkcnt_t)
typedef unsigned _Int64 fsblkcnt_t;
#define __DEFINED_fsblkcnt_t
#endif
# 218 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_fsfilcnt_t) && !defined(__DEFINED_fsfilcnt_t)
typedef unsigned _Int64 fsfilcnt_t;
#define __DEFINED_fsfilcnt_t
#endif
# 223 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_wint_t) && !defined(__DEFINED_wint_t)
typedef unsigned wint_t;
#define __DEFINED_wint_t
#endif
# 229 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_wctype_t) && !defined(__DEFINED_wctype_t)
typedef unsigned long wctype_t;
#define __DEFINED_wctype_t
#endif
# 234 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_timer_t) && !defined(__DEFINED_timer_t)
typedef void * timer_t;
#define __DEFINED_timer_t
#endif
# 240 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_clockid_t) && !defined(__DEFINED_clockid_t)
typedef int clockid_t;
#define __DEFINED_clockid_t
#endif
# 245 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_clock_t) && !defined(__DEFINED_clock_t)
typedef long clock_t;
#define __DEFINED_clock_t
#endif
# 250 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_struct_timeval) && !defined(__DEFINED_struct_timeval)
struct timeval { time_t tv_sec; suseconds_t tv_usec; };
#define __DEFINED_struct_timeval
#endif
# 255 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_struct_timespec) && !defined(__DEFINED_struct_timespec)
struct timespec { time_t tv_sec; long tv_nsec; };
#define __DEFINED_struct_timespec
#endif
# 260 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pid_t) && !defined(__DEFINED_pid_t)
typedef int pid_t;
#define __DEFINED_pid_t
#endif
# 266 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_id_t) && !defined(__DEFINED_id_t)
typedef unsigned id_t;
#define __DEFINED_id_t
#endif
# 271 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_uid_t) && !defined(__DEFINED_uid_t)
typedef unsigned uid_t;
#define __DEFINED_uid_t
#endif
# 276 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_gid_t) && !defined(__DEFINED_gid_t)
typedef unsigned gid_t;
#define __DEFINED_gid_t
#endif
# 281 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_key_t) && !defined(__DEFINED_key_t)
typedef int key_t;
#define __DEFINED_key_t
#endif
# 286 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_useconds_t) && !defined(__DEFINED_useconds_t)
typedef unsigned useconds_t;
#define __DEFINED_useconds_t
#endif
# 291 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#ifdef __cplusplus
#if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t)
typedef unsigned long pthread_t;
#define __DEFINED_pthread_t
#endif
# 298 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#else
# 300 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t)
typedef struct __pthread * pthread_t;
#define __DEFINED_pthread_t
#endif
# 304 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#endif
# 306 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_once_t) && !defined(__DEFINED_pthread_once_t)
typedef int pthread_once_t;
#define __DEFINED_pthread_once_t
#endif
# 310 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_key_t) && !defined(__DEFINED_pthread_key_t)
typedef unsigned pthread_key_t;
#define __DEFINED_pthread_key_t
#endif
# 315 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_spinlock_t) && !defined(__DEFINED_pthread_spinlock_t)
typedef int pthread_spinlock_t;
#define __DEFINED_pthread_spinlock_t
#endif
# 320 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_mutexattr_t) && !defined(__DEFINED_pthread_mutexattr_t)
typedef struct { unsigned __attr; } pthread_mutexattr_t;
#define __DEFINED_pthread_mutexattr_t
#endif
# 325 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_condattr_t) && !defined(__DEFINED_pthread_condattr_t)
typedef struct { unsigned __attr; } pthread_condattr_t;
#define __DEFINED_pthread_condattr_t
#endif
# 330 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_barrierattr_t) && !defined(__DEFINED_pthread_barrierattr_t)
typedef struct { unsigned __attr; } pthread_barrierattr_t;
#define __DEFINED_pthread_barrierattr_t
#endif
# 335 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_rwlockattr_t) && !defined(__DEFINED_pthread_rwlockattr_t)
typedef struct { unsigned __attr[2]; } pthread_rwlockattr_t;
#define __DEFINED_pthread_rwlockattr_t
#endif
# 340 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_FILE) && !defined(__DEFINED_FILE)
typedef struct _IO_FILE FILE;
#define __DEFINED_FILE
#endif
# 346 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_mbstate_t) && !defined(__DEFINED_mbstate_t)
typedef struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t;
#define __DEFINED_mbstate_t
#endif
# 352 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_locale_t) && !defined(__DEFINED_locale_t)
typedef struct __locale_struct * locale_t;
#define __DEFINED_locale_t
#endif
# 358 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_sigset_t) && !defined(__DEFINED_sigset_t)
typedef struct __sigset_t { unsigned long __bits[128/sizeof(long)]; } sigset_t;
#define __DEFINED_sigset_t
#endif
# 364 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_struct_iovec) && !defined(__DEFINED_struct_iovec)
struct iovec { void *iov_base; size_t iov_len; };
#define __DEFINED_struct_iovec
#endif
# 370 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_socklen_t) && !defined(__DEFINED_socklen_t)
typedef unsigned socklen_t;
#define __DEFINED_socklen_t
#endif
# 376 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_sa_family_t) && !defined(__DEFINED_sa_family_t)
typedef unsigned short sa_family_t;
#define __DEFINED_sa_family_t
#endif
# 381 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#undef _Addr
#undef _Int64
#undef _Reg
# 18 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/stddef.h" 2 3
#if __GNUC__ > 3
#define offsetof(type, member) __builtin_offsetof(type, member)
#else
# 22 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/stddef.h" 3
#define offsetof(type, member) ((size_t)( (char *)&(((type *)0)->member) - (char *)0 ))
#endif
# 24 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/stddef.h" 3
#endif
# 25 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/stddef.h" 3
# 31 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/entenc.h" 2
#if 0 /* expanded by -frewrite-includes */
# include "entcode.h"
#endif /* expanded by -frewrite-includes */
# 31 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/entenc.h"
# 1 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/entcode.h" 1
/* Copyright (c) 2001-2011 Timothy B. Terriberry
Copyright (c) 2008-2009 Xiph.Org Foundation */
/*
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#if 0 /* expanded by -frewrite-includes */
#include "opus_types.h"
#endif /* expanded by -frewrite-includes */
# 28 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/entcode.h"
# 29 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/entcode.h"
#if 0 /* expanded by -frewrite-includes */
#include "opus_defines.h"
#endif /* expanded by -frewrite-includes */
# 29 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/entcode.h"
# 30 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/entcode.h"
#if !defined(_entcode_H)
# define _entcode_H (1)
#if 0 /* expanded by -frewrite-includes */
# include <limits.h>
#endif /* expanded by -frewrite-includes */
# 33 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/entcode.h"
# 1 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/limits.h" 1 3
#ifndef _LIMITS_H
#define _LIMITS_H
#if 0 /* expanded by -frewrite-includes */
#include <features.h>
#endif /* expanded by -frewrite-includes */
# 4 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/limits.h" 3
# 5 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/limits.h" 3
/* Most limits are system-specific */
#if 0 /* expanded by -frewrite-includes */
#include <bits/limits.h>
#endif /* expanded by -frewrite-includes */
# 8 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/limits.h" 3
# 1 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/bits/limits.h" 1 3
#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
|| defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
#define LONG_BIT 32
#endif
# 5 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/bits/limits.h" 3
#define LONG_MAX 0x7fffffffL
#define LLONG_MAX 0x7fffffffffffffffLL
# 9 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/limits.h" 2 3
/* Support signed or unsigned plain-char */
#if '\xff' > 0
#define CHAR_MIN 0
#define CHAR_MAX 255
#else
# 16 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/limits.h" 3
#define CHAR_MIN (-128)
#define CHAR_MAX 127
#endif
# 19 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/limits.h" 3
/* Some universal constants... */
#define CHAR_BIT 8
#define SCHAR_MIN (-128)
#define SCHAR_MAX 127
#define UCHAR_MAX 255
#define SHRT_MIN (-1-0x7fff)
#define SHRT_MAX 0x7fff
#define USHRT_MAX 0xffff
#define INT_MIN (-1-0x7fffffff)
#define INT_MAX 0x7fffffff
#define UINT_MAX 0xffffffffU
#define LONG_MIN (-LONG_MAX-1)
#define ULONG_MAX (2UL*LONG_MAX+1)
#define LLONG_MIN (-LLONG_MAX-1)
#define ULLONG_MAX (2ULL*LLONG_MAX+1)
#define MB_LEN_MAX 4
#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
|| defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
#define PIPE_BUF 4096
#define FILESIZEBITS 64
#define NAME_MAX 255
#define PATH_MAX 4096
#define NGROUPS_MAX 32
#define ARG_MAX 131072
#define IOV_MAX 1024
#define SYMLOOP_MAX 40
#define WORD_BIT 32
#define SSIZE_MAX LONG_MAX
#define TZNAME_MAX 6
#define TTY_NAME_MAX 32
#define HOST_NAME_MAX 255
/* Implementation choices... */
#define PTHREAD_KEYS_MAX 128
#define PTHREAD_STACK_MIN 2048
#define PTHREAD_DESTRUCTOR_ITERATIONS 4
#define SEM_VALUE_MAX 0x7fffffff
#define SEM_NSEMS_MAX 256
#define DELAYTIMER_MAX 0x7fffffff
#define MQ_PRIO_MAX 32768
#define LOGIN_NAME_MAX 256
/* Arbitrary numbers... */
#define BC_BASE_MAX 99
#define BC_DIM_MAX 2048
#define BC_SCALE_MAX 99
#define BC_STRING_MAX 1000
#define CHARCLASS_NAME_MAX 14
#define COLL_WEIGHTS_MAX 2
#define EXPR_NEST_MAX 32
#define LINE_MAX 4096
#define RE_DUP_MAX 255
#define NL_ARGMAX 9
#define NL_MSGMAX 32767
#define NL_SETMAX 255
#define NL_TEXTMAX 2048
#endif
# 85 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/limits.h" 3
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) || defined(_XOPEN_SOURCE)
#ifdef PAGESIZE
#define PAGE_SIZE PAGESIZE
#endif
# 91 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/limits.h" 3
#define NZERO 20
#define NL_LANGMAX 32
#endif
# 95 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/limits.h" 3
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) \
|| (defined(_XOPEN_SOURCE) && _XOPEN_SOURCE+0 < 700)
#define NL_NMAX 16
#endif
# 102 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/limits.h" 3
/* POSIX/SUS requirements follow. These numbers come directly
* from SUS and have nothing to do with the host system. */
#define _POSIX_AIO_LISTIO_MAX 2
#define _POSIX_AIO_MAX 1
#define _POSIX_ARG_MAX 4096
#define _POSIX_CHILD_MAX 25
#define _POSIX_CLOCKRES_MIN 20000000
#define _POSIX_DELAYTIMER_MAX 32
#define _POSIX_HOST_NAME_MAX 255
#define _POSIX_LINK_MAX 8
#define _POSIX_LOGIN_NAME_MAX 9
#define _POSIX_MAX_CANON 255
#define _POSIX_MAX_INPUT 255
#define _POSIX_MQ_OPEN_MAX 8
#define _POSIX_MQ_PRIO_MAX 32
#define _POSIX_NAME_MAX 14
#define _POSIX_NGROUPS_MAX 8
#define _POSIX_OPEN_MAX 20
#define _POSIX_PATH_MAX 256
#define _POSIX_PIPE_BUF 512
#define _POSIX_RE_DUP_MAX 255
#define _POSIX_RTSIG_MAX 8
#define _POSIX_SEM_NSEMS_MAX 256
#define _POSIX_SEM_VALUE_MAX 32767
#define _POSIX_SIGQUEUE_MAX 32
#define _POSIX_SSIZE_MAX 32767
#define _POSIX_STREAM_MAX 8
#define _POSIX_SS_REPL_MAX 4
#define _POSIX_SYMLINK_MAX 255
#define _POSIX_SYMLOOP_MAX 8
#define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4
#define _POSIX_THREAD_KEYS_MAX 128
#define _POSIX_THREAD_THREADS_MAX 64
#define _POSIX_TIMER_MAX 32
#define _POSIX_TRACE_EVENT_NAME_MAX 30
#define _POSIX_TRACE_NAME_MAX 8
#define _POSIX_TRACE_SYS_MAX 8
#define _POSIX_TRACE_USER_EVENT_MAX 32
#define _POSIX_TTY_NAME_MAX 9
#define _POSIX_TZNAME_MAX 6
#define _POSIX2_BC_BASE_MAX 99
#define _POSIX2_BC_DIM_MAX 2048
#define _POSIX2_BC_SCALE_MAX 99
#define _POSIX2_BC_STRING_MAX 1000
#define _POSIX2_CHARCLASS_NAME_MAX 14
#define _POSIX2_COLL_WEIGHTS_MAX 2
#define _POSIX2_EXPR_NEST_MAX 32
#define _POSIX2_LINE_MAX 2048
#define _POSIX2_RE_DUP_MAX 255
#define _XOPEN_IOV_MAX 16
#define _XOPEN_NAME_MAX 255
#define _XOPEN_PATH_MAX 1024
#endif
# 158 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/limits.h" 3
# 34 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/entcode.h" 2
#if 0 /* expanded by -frewrite-includes */
# include <stddef.h>
#endif /* expanded by -frewrite-includes */
# 34 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/entcode.h"
# 35 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/entcode.h"
#if 0 /* expanded by -frewrite-includes */
# include "ecintrin.h"
#endif /* expanded by -frewrite-includes */
# 35 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/entcode.h"
# 1 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/ecintrin.h" 1
/* Copyright (c) 2003-2008 Timothy B. Terriberry
Copyright (c) 2008 Xiph.Org Foundation */
/*
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*Some common macros for potential platform-specific optimization.*/
#if 0 /* expanded by -frewrite-includes */
#include "opus_types.h"
#endif /* expanded by -frewrite-includes */
# 29 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/ecintrin.h"
# 30 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/ecintrin.h"
#if 0 /* expanded by -frewrite-includes */
#include <math.h>
#endif /* expanded by -frewrite-includes */
# 30 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/ecintrin.h"
# 31 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/ecintrin.h"
#if 0 /* expanded by -frewrite-includes */
#include <limits.h>
#endif /* expanded by -frewrite-includes */
# 31 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/ecintrin.h"
# 32 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/ecintrin.h"
#if 0 /* expanded by -frewrite-includes */
#include "arch.h"
#endif /* expanded by -frewrite-includes */
# 32 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/ecintrin.h"
# 33 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/ecintrin.h"
#if !defined(_ecintrin_H)
# define _ecintrin_H (1)
/*Some specific platforms may have optimized intrinsic or OPUS_INLINE assembly
versions of these functions which can substantially improve performance.
We define macros for them to allow easy incorporation of these non-ANSI
features.*/
/*Modern gcc (4.x) can compile the naive versions of min and max with cmov if
given an appropriate architecture, but the branchless bit-twiddling versions
are just as fast, and do not require any special target architecture.
Earlier gcc versions (3.x) compiled both code to the same assembly
instructions, because of the way they represented ((_b)>(_a)) internally.*/
# define EC_MINI(_a,_b) ((_a)+(((_b)-(_a))&-((_b)<(_a))))
/*Count leading zeros.
This macro should only be used for implementing ec_ilog(), if it is defined.
All other code should use EC_ILOG() instead.*/
#if defined(_MSC_VER) && (_MSC_VER >= 1400)
#if 0 /* expanded by -frewrite-includes */
# include <intrin.h>
#endif /* expanded by -frewrite-includes */
# 52 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/ecintrin.h"
# 53 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/ecintrin.h"
/*In _DEBUG mode this is not an intrinsic by default.*/
# pragma intrinsic(_BitScanReverse)
static __inline int ec_bsr(unsigned long _x){
unsigned long ret;
_BitScanReverse(&ret,_x);
return (int)ret;
}
# define EC_CLZ0 (1)
# define EC_CLZ(_x) (-ec_bsr(_x))
#elif defined(ENABLE_TI_DSPLIB)
# 64 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/ecintrin.h"
#if 0 /* expanded by -frewrite-includes */
# include "dsplib.h"
#endif /* expanded by -frewrite-includes */
# 64 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/ecintrin.h"
# 65 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/ecintrin.h"
# define EC_CLZ0 (31)
# define EC_CLZ(_x) (_lnorm(_x))
#elif __GNUC_PREREQ(3,4)
# 68 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/ecintrin.h"
# if INT_MAX>=2147483647
# define EC_CLZ0 ((int)sizeof(unsigned)*CHAR_BIT)
# define EC_CLZ(_x) (__builtin_clz(_x))
# elif LONG_MAX>=2147483647L
# 72 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/ecintrin.h"
# define EC_CLZ0 ((int)sizeof(unsigned long)*CHAR_BIT)
# define EC_CLZ(_x) (__builtin_clzl(_x))
# endif
# 75 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/ecintrin.h"
#endif
# 76 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/ecintrin.h"
#if defined(EC_CLZ)
/*Note that __builtin_clz is not defined when _x==0, according to the gcc
documentation (and that of the BSR instruction that implements it on x86).
The majority of the time we can never pass it zero.
When we need to, it can be special cased.*/
# define EC_ILOG(_x) (EC_CLZ0-EC_CLZ(_x))
#else
# 84 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/ecintrin.h"
int ec_ilog(opus_uint32 _v);
# define EC_ILOG(_x) (ec_ilog(_x))
#endif
# 87 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/ecintrin.h"
#endif
# 88 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/ecintrin.h"
# 36 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/entcode.h" 2
extern const opus_uint32 SMALL_DIV_TABLE[129];
#ifdef OPUS_ARM_ASM
#define USE_SMALL_DIV_TABLE
#endif
# 42 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/entcode.h"
/*OPT: ec_window must be at least 32 bits, but if you have fast arithmetic on a
larger type, you can speed up the decoder by using it here.*/
typedef opus_uint32 ec_window;
typedef struct ec_ctx ec_ctx;
typedef struct ec_ctx ec_enc;
typedef struct ec_ctx ec_dec;
# define EC_WINDOW_SIZE ((int)sizeof(ec_window)*CHAR_BIT)
/*The number of bits to use for the range-coded part of unsigned integers.*/
# define EC_UINT_BITS (8)
/*The resolution of fractional-precision bit usage measurements, i.e.,
3 => 1/8th bits.*/
# define BITRES 3
/*The entropy encoder/decoder context.
We use the same structure for both, so that common functions like ec_tell()
can be used on either one.*/
struct ec_ctx{
/*Buffered input/output.*/
unsigned char *buf;
/*The size of the buffer.*/
opus_uint32 storage;
/*The offset at which the last byte containing raw bits was read/written.*/
opus_uint32 end_offs;
/*Bits that will be read from/written at the end.*/
ec_window end_window;
/*Number of valid bits in end_window.*/
int nend_bits;
/*The total number of whole bits read/written.
This does not include partial bits currently in the range coder.*/
int nbits_total;
/*The offset at which the next range coder byte will be read/written.*/
opus_uint32 offs;
/*The number of values in the current range.*/
opus_uint32 rng;
/*In the decoder: the difference between the top of the current range and
the input value, minus one.
In the encoder: the low end of the current range.*/
opus_uint32 val;
/*In the decoder: the saved normalization factor from ec_decode().
In the encoder: the number of oustanding carry propagating symbols.*/
opus_uint32 ext;
/*A buffered input/output symbol, awaiting carry propagation.*/
int rem;
/*Nonzero if an error occurred.*/
int error;
};
static OPUS_INLINE opus_uint32 ec_range_bytes(ec_ctx *_this){
return _this->offs;
}
static OPUS_INLINE unsigned char *ec_get_buffer(ec_ctx *_this){
return _this->buf;
}
static OPUS_INLINE int ec_get_error(ec_ctx *_this){
return _this->error;
}
/*Returns the number of bits "used" by the encoded or decoded symbols so far.
This same number can be computed in either the encoder or the decoder, and is
suitable for making coding decisions.
Return: The number of bits.
This will always be slightly larger than the exact value (e.g., all
rounding error is in the positive direction).*/
static OPUS_INLINE int ec_tell(ec_ctx *_this){
return _this->nbits_total-EC_ILOG(_this->rng);
}
/*Returns the number of bits "used" by the encoded or decoded symbols so far.
This same number can be computed in either the encoder or the decoder, and is
suitable for making coding decisions.
Return: The number of bits scaled by 2**BITRES.
This will always be slightly larger than the exact value (e.g., all
rounding error is in the positive direction).*/
opus_uint32 ec_tell_frac(ec_ctx *_this);
/* Tested exhaustively for all n and for 1<=d<=256 */
static OPUS_INLINE opus_uint32 celt_udiv(opus_uint32 n, opus_uint32 d) {
celt_sig_assert(d>0);
#ifdef USE_SMALL_DIV_TABLE
if (d>256)
return n/d;
else {
opus_uint32 t, q;
t = EC_ILOG(d&-d);
q = (opus_uint64)SMALL_DIV_TABLE[d>>t]*(n>>(t-1))>>32;
return q+(n-q*d >= d);
}
#else
# 136 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/entcode.h"
return n/d;
#endif
# 138 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/entcode.h"
}
static OPUS_INLINE opus_int32 celt_sudiv(opus_int32 n, opus_int32 d) {
celt_sig_assert(d>0);
#ifdef USE_SMALL_DIV_TABLE
if (n<0)
return -(opus_int32)celt_udiv(-n, d);
else
return celt_udiv(n, d);
#else
# 148 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/entcode.h"
return n/d;
#endif
# 150 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/entcode.h"
}
#endif
# 153 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/entcode.h"
# 32 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/entenc.h" 2
/*Initializes the encoder.
_buf: The buffer to store output bytes in.
_size: The size of the buffer, in chars.*/
void ec_enc_init(ec_enc *_this,unsigned char *_buf,opus_uint32 _size);
/*Encodes a symbol given its frequency information.
The frequency information must be discernable by the decoder, assuming it
has read only the previous symbols from the stream.
It is allowable to change the frequency information, or even the entire
source alphabet, so long as the decoder can tell from the context of the
previously encoded information that it is supposed to do so as well.
_fl: The cumulative frequency of all symbols that come before the one to be
encoded.
_fh: The cumulative frequency of all symbols up to and including the one to
be encoded.
Together with _fl, this defines the range [_fl,_fh) in which the
decoded value will fall.
_ft: The sum of the frequencies of all the symbols*/
void ec_encode(ec_enc *_this,unsigned _fl,unsigned _fh,unsigned _ft);
/*Equivalent to ec_encode() with _ft==1<<_bits.*/
void ec_encode_bin(ec_enc *_this,unsigned _fl,unsigned _fh,unsigned _bits);
/* Encode a bit that has a 1/(1<<_logp) probability of being a one */
void ec_enc_bit_logp(ec_enc *_this,int _val,unsigned _logp);
/*Encodes a symbol given an "inverse" CDF table.
_s: The index of the symbol to encode.
_icdf: The "inverse" CDF, such that symbol _s falls in the range
[_s>0?ft-_icdf[_s-1]:0,ft-_icdf[_s]), where ft=1<<_ftb.
The values must be monotonically non-increasing, and the last value
must be 0.
_ftb: The number of bits of precision in the cumulative distribution.*/
void ec_enc_icdf(ec_enc *_this,int _s,const unsigned char *_icdf,unsigned _ftb);
/*Encodes a raw unsigned integer in the stream.
_fl: The integer to encode.
_ft: The number of integers that can be encoded (one more than the max).
This must be at least 2, and no more than 2**32-1.*/
void ec_enc_uint(ec_enc *_this,opus_uint32 _fl,opus_uint32 _ft);
/*Encodes a sequence of raw bits in the stream.
_fl: The bits to encode.
_ftb: The number of bits to encode.
This must be between 1 and 25, inclusive.*/
void ec_enc_bits(ec_enc *_this,opus_uint32 _fl,unsigned _ftb);
/*Overwrites a few bits at the very start of an existing stream, after they
have already been encoded.
This makes it possible to have a few flags up front, where it is easy for
decoders to access them without parsing the whole stream, even if their
values are not determined until late in the encoding process, without having
to buffer all the intermediate symbols in the encoder.
In order for this to work, at least _nbits bits must have already been
encoded using probabilities that are an exact power of two.
The encoder can verify the number of encoded bits is sufficient, but cannot
check this latter condition.
_val: The bits to encode (in the least _nbits significant bits).
They will be decoded in order from most-significant to least.
_nbits: The number of bits to overwrite.
This must be no more than 8.*/
void ec_enc_patch_initial_bits(ec_enc *_this,unsigned _val,unsigned _nbits);
/*Compacts the data to fit in the target size.
This moves up the raw bits at the end of the current buffer so they are at
the end of the new buffer size.
The caller must ensure that the amount of data that's already been written
will fit in the new size.
_size: The number of bytes in the new buffer.
This must be large enough to contain the bits already written, and
must be no larger than the existing size.*/
void ec_enc_shrink(ec_enc *_this,opus_uint32 _size);
/*Indicates that there are no more symbols to encode.
All reamining output bytes are flushed to the output buffer.
ec_enc_init() must be called before the encoder can be used again.*/
void ec_enc_done(ec_enc *_this);
#endif
# 111 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/entenc.h"
# 42 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/celt.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "entdec.h"
#endif /* expanded by -frewrite-includes */
# 42 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/celt.h"
# 1 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/entdec.h" 1
/* Copyright (c) 2001-2011 Timothy B. Terriberry
Copyright (c) 2008-2009 Xiph.Org Foundation */
/*
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#if !defined(_entdec_H)
# define _entdec_H (1)
#if 0 /* expanded by -frewrite-includes */
# include <limits.h>
#endif /* expanded by -frewrite-includes */
# 30 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/entdec.h"
# 31 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/entdec.h"
#if 0 /* expanded by -frewrite-includes */
# include "entcode.h"
#endif /* expanded by -frewrite-includes */
# 31 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/entdec.h"
# 1 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/entcode.h" 1
/* Copyright (c) 2001-2011 Timothy B. Terriberry
Copyright (c) 2008-2009 Xiph.Org Foundation */
/*
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#if 0 /* expanded by -frewrite-includes */
#include "opus_types.h"
#endif /* expanded by -frewrite-includes */
# 28 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/entcode.h"
# 29 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/entcode.h"
#if 0 /* expanded by -frewrite-includes */
#include "opus_defines.h"
#endif /* expanded by -frewrite-includes */
# 29 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/entcode.h"
# 30 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/entcode.h"
#if !defined(_entcode_H)
# define _entcode_H (1)
#if 0 /* expanded by -frewrite-includes */
# include <limits.h>
#endif /* expanded by -frewrite-includes */
# 33 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/entcode.h"
# 34 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/entcode.h"
#if 0 /* expanded by -frewrite-includes */
# include <stddef.h>
#endif /* expanded by -frewrite-includes */
# 34 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/entcode.h"
# 35 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/entcode.h"
#if 0 /* expanded by -frewrite-includes */
# include "ecintrin.h"
#endif /* expanded by -frewrite-includes */
# 35 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/entcode.h"
# 36 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/entcode.h"
extern const opus_uint32 SMALL_DIV_TABLE[129];
#ifdef OPUS_ARM_ASM
#define USE_SMALL_DIV_TABLE
#endif
# 42 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/entcode.h"
/*OPT: ec_window must be at least 32 bits, but if you have fast arithmetic on a
larger type, you can speed up the decoder by using it here.*/
typedef opus_uint32 ec_window;
typedef struct ec_ctx ec_ctx;
typedef struct ec_ctx ec_enc;
typedef struct ec_ctx ec_dec;
# define EC_WINDOW_SIZE ((int)sizeof(ec_window)*CHAR_BIT)
/*The number of bits to use for the range-coded part of unsigned integers.*/
# define EC_UINT_BITS (8)
/*The resolution of fractional-precision bit usage measurements, i.e.,
3 => 1/8th bits.*/
# define BITRES 3
/*The entropy encoder/decoder context.
We use the same structure for both, so that common functions like ec_tell()
can be used on either one.*/
struct ec_ctx{
/*Buffered input/output.*/
unsigned char *buf;
/*The size of the buffer.*/
opus_uint32 storage;
/*The offset at which the last byte containing raw bits was read/written.*/
opus_uint32 end_offs;
/*Bits that will be read from/written at the end.*/
ec_window end_window;
/*Number of valid bits in end_window.*/
int nend_bits;
/*The total number of whole bits read/written.
This does not include partial bits currently in the range coder.*/
int nbits_total;
/*The offset at which the next range coder byte will be read/written.*/
opus_uint32 offs;
/*The number of values in the current range.*/
opus_uint32 rng;
/*In the decoder: the difference between the top of the current range and
the input value, minus one.
In the encoder: the low end of the current range.*/
opus_uint32 val;
/*In the decoder: the saved normalization factor from ec_decode().
In the encoder: the number of oustanding carry propagating symbols.*/
opus_uint32 ext;
/*A buffered input/output symbol, awaiting carry propagation.*/
int rem;
/*Nonzero if an error occurred.*/
int error;
};
static OPUS_INLINE opus_uint32 ec_range_bytes(ec_ctx *_this){
return _this->offs;
}
static OPUS_INLINE unsigned char *ec_get_buffer(ec_ctx *_this){
return _this->buf;
}
static OPUS_INLINE int ec_get_error(ec_ctx *_this){
return _this->error;
}
/*Returns the number of bits "used" by the encoded or decoded symbols so far.
This same number can be computed in either the encoder or the decoder, and is
suitable for making coding decisions.
Return: The number of bits.
This will always be slightly larger than the exact value (e.g., all
rounding error is in the positive direction).*/
static OPUS_INLINE int ec_tell(ec_ctx *_this){
return _this->nbits_total-EC_ILOG(_this->rng);
}
/*Returns the number of bits "used" by the encoded or decoded symbols so far.
This same number can be computed in either the encoder or the decoder, and is
suitable for making coding decisions.
Return: The number of bits scaled by 2**BITRES.
This will always be slightly larger than the exact value (e.g., all
rounding error is in the positive direction).*/
opus_uint32 ec_tell_frac(ec_ctx *_this);
/* Tested exhaustively for all n and for 1<=d<=256 */
static OPUS_INLINE opus_uint32 celt_udiv(opus_uint32 n, opus_uint32 d) {
celt_sig_assert(d>0);
#ifdef USE_SMALL_DIV_TABLE
if (d>256)
return n/d;
else {
opus_uint32 t, q;
t = EC_ILOG(d&-d);
q = (opus_uint64)SMALL_DIV_TABLE[d>>t]*(n>>(t-1))>>32;
return q+(n-q*d >= d);
}
#else
# 136 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/entcode.h"
return n/d;
#endif
# 138 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/entcode.h"
}
static OPUS_INLINE opus_int32 celt_sudiv(opus_int32 n, opus_int32 d) {
celt_sig_assert(d>0);
#ifdef USE_SMALL_DIV_TABLE
if (n<0)
return -(opus_int32)celt_udiv(-n, d);
else
return celt_udiv(n, d);
#else
# 148 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/entcode.h"
return n/d;
#endif
# 150 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/entcode.h"
}
#endif
# 153 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/entcode.h"
# 32 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/entdec.h" 2
/*Initializes the decoder.
_buf: The input buffer to use.
Return: 0 on success, or a negative value on error.*/
void ec_dec_init(ec_dec *_this,unsigned char *_buf,opus_uint32 _storage);
/*Calculates the cumulative frequency for the next symbol.
This can then be fed into the probability model to determine what that
symbol is, and the additional frequency information required to advance to
the next symbol.
This function cannot be called more than once without a corresponding call to
ec_dec_update(), or decoding will not proceed correctly.
_ft: The total frequency of the symbols in the alphabet the next symbol was
encoded with.
Return: A cumulative frequency representing the encoded symbol.
If the cumulative frequency of all the symbols before the one that
was encoded was fl, and the cumulative frequency of all the symbols
up to and including the one encoded is fh, then the returned value
will fall in the range [fl,fh).*/
unsigned ec_decode(ec_dec *_this,unsigned _ft);
/*Equivalent to ec_decode() with _ft==1<<_bits.*/
unsigned ec_decode_bin(ec_dec *_this,unsigned _bits);
/*Advance the decoder past the next symbol using the frequency information the
symbol was encoded with.
Exactly one call to ec_decode() must have been made so that all necessary
intermediate calculations are performed.
_fl: The cumulative frequency of all symbols that come before the symbol
decoded.
_fh: The cumulative frequency of all symbols up to and including the symbol
decoded.
Together with _fl, this defines the range [_fl,_fh) in which the value
returned above must fall.
_ft: The total frequency of the symbols in the alphabet the symbol decoded
was encoded in.
This must be the same as passed to the preceding call to ec_decode().*/
void ec_dec_update(ec_dec *_this,unsigned _fl,unsigned _fh,unsigned _ft);
/* Decode a bit that has a 1/(1<<_logp) probability of being a one */
int ec_dec_bit_logp(ec_dec *_this,unsigned _logp);
/*Decodes a symbol given an "inverse" CDF table.
No call to ec_dec_update() is necessary after this call.
_icdf: The "inverse" CDF, such that symbol s falls in the range
[s>0?ft-_icdf[s-1]:0,ft-_icdf[s]), where ft=1<<_ftb.
The values must be monotonically non-increasing, and the last value
must be 0.
_ftb: The number of bits of precision in the cumulative distribution.
Return: The decoded symbol s.*/
int ec_dec_icdf(ec_dec *_this,const unsigned char *_icdf,unsigned _ftb);
/*Extracts a raw unsigned integer with a non-power-of-2 range from the stream.
The bits must have been encoded with ec_enc_uint().
No call to ec_dec_update() is necessary after this call.
_ft: The number of integers that can be decoded (one more than the max).
This must be at least 2, and no more than 2**32-1.
Return: The decoded bits.*/
opus_uint32 ec_dec_uint(ec_dec *_this,opus_uint32 _ft);
/*Extracts a sequence of raw bits from the stream.
The bits must have been encoded with ec_enc_bits().
No call to ec_dec_update() is necessary after this call.
_ftb: The number of bits to extract.
This must be between 0 and 25, inclusive.
Return: The decoded bits.*/
opus_uint32 ec_dec_bits(ec_dec *_this,unsigned _ftb);
#endif
# 101 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/entdec.h"
# 43 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/celt.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "arch.h"
#endif /* expanded by -frewrite-includes */
# 43 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/celt.h"
# 44 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/celt.h"
#ifdef __cplusplus
extern "C" {
#endif
# 48 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/celt.h"
#define CELTEncoder OpusCustomEncoder
#define CELTDecoder OpusCustomDecoder
#define CELTMode OpusCustomMode
#define LEAK_BANDS 19
typedef struct {
int valid;
float tonality;
float tonality_slope;
float noisiness;
float activity;
float music_prob;
float music_prob_min;
float music_prob_max;
int bandwidth;
float activity_probability;
float max_pitch_ratio;
/* Store as Q6 char to save space. */
unsigned char leak_boost[LEAK_BANDS];
} AnalysisInfo;
typedef struct {
int signalType;
int offset;
} SILKInfo;
#define __celt_check_mode_ptr_ptr(ptr) ((ptr) + ((ptr) - (const CELTMode**)(ptr)))
#define __celt_check_analysis_ptr(ptr) ((ptr) + ((ptr) - (const AnalysisInfo*)(ptr)))
#define __celt_check_silkinfo_ptr(ptr) ((ptr) + ((ptr) - (const SILKInfo*)(ptr)))
/* Encoder/decoder Requests */
#define CELT_SET_PREDICTION_REQUEST 10002
/** Controls the use of interframe prediction.
0=Independent frames
1=Short term interframe prediction allowed
2=Long term prediction allowed
*/
#define CELT_SET_PREDICTION(x) CELT_SET_PREDICTION_REQUEST, __opus_check_int(x)
#define CELT_SET_INPUT_CLIPPING_REQUEST 10004
#define CELT_SET_INPUT_CLIPPING(x) CELT_SET_INPUT_CLIPPING_REQUEST, __opus_check_int(x)
#define CELT_GET_AND_CLEAR_ERROR_REQUEST 10007
#define CELT_GET_AND_CLEAR_ERROR(x) CELT_GET_AND_CLEAR_ERROR_REQUEST, __opus_check_int_ptr(x)
#define CELT_SET_CHANNELS_REQUEST 10008
#define CELT_SET_CHANNELS(x) CELT_SET_CHANNELS_REQUEST, __opus_check_int(x)
/* Internal */
#define CELT_SET_START_BAND_REQUEST 10010
#define CELT_SET_START_BAND(x) CELT_SET_START_BAND_REQUEST, __opus_check_int(x)
#define CELT_SET_END_BAND_REQUEST 10012
#define CELT_SET_END_BAND(x) CELT_SET_END_BAND_REQUEST, __opus_check_int(x)
#define CELT_GET_MODE_REQUEST 10015
/** Get the CELTMode used by an encoder or decoder */
#define CELT_GET_MODE(x) CELT_GET_MODE_REQUEST, __celt_check_mode_ptr_ptr(x)
#define CELT_SET_SIGNALLING_REQUEST 10016
#define CELT_SET_SIGNALLING(x) CELT_SET_SIGNALLING_REQUEST, __opus_check_int(x)
#define CELT_SET_TONALITY_REQUEST 10018
#define CELT_SET_TONALITY(x) CELT_SET_TONALITY_REQUEST, __opus_check_int(x)
#define CELT_SET_TONALITY_SLOPE_REQUEST 10020
#define CELT_SET_TONALITY_SLOPE(x) CELT_SET_TONALITY_SLOPE_REQUEST, __opus_check_int(x)
#define CELT_SET_ANALYSIS_REQUEST 10022
#define CELT_SET_ANALYSIS(x) CELT_SET_ANALYSIS_REQUEST, __celt_check_analysis_ptr(x)
#define OPUS_SET_LFE_REQUEST 10024
#define OPUS_SET_LFE(x) OPUS_SET_LFE_REQUEST, __opus_check_int(x)
#define OPUS_SET_ENERGY_MASK_REQUEST 10026
#define OPUS_SET_ENERGY_MASK(x) OPUS_SET_ENERGY_MASK_REQUEST, __opus_check_val16_ptr(x)
#define CELT_SET_SILK_INFO_REQUEST 10028
#define CELT_SET_SILK_INFO(x) CELT_SET_SILK_INFO_REQUEST, __celt_check_silkinfo_ptr(x)
/* Encoder stuff */
int celt_encoder_get_size(int channels);
int celt_encode_with_ec(OpusCustomEncoder * OPUS_RESTRICT st, const opus_val16 * pcm, int frame_size, unsigned char *compressed, int nbCompressedBytes, ec_enc *enc);
int celt_encoder_init(CELTEncoder *st, opus_int32 sampling_rate, int channels,
int arch);
/* Decoder stuff */
int celt_decoder_get_size(int channels);
int celt_decoder_init(CELTDecoder *st, opus_int32 sampling_rate, int channels);
int celt_decode_with_ec(OpusCustomDecoder * OPUS_RESTRICT st, const unsigned char *data,
int len, opus_val16 * OPUS_RESTRICT pcm, int frame_size, ec_dec *dec, int accum);
#define celt_encoder_ctl opus_custom_encoder_ctl
#define celt_decoder_ctl opus_custom_decoder_ctl
#ifdef CUSTOM_MODES
#define OPUS_CUSTOM_NOSTATIC
#else
# 162 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/celt.h"
#define OPUS_CUSTOM_NOSTATIC static OPUS_INLINE
#endif
# 164 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/celt.h"
static const unsigned char trim_icdf[11] = {126, 124, 119, 109, 87, 41, 19, 9, 4, 2, 0};
/* Probs: NONE: 21.875%, LIGHT: 6.25%, NORMAL: 65.625%, AGGRESSIVE: 6.25% */
static const unsigned char spread_icdf[4] = {25, 23, 2, 0};
static const unsigned char tapset_icdf[3]={2,1,0};
#ifdef CUSTOM_MODES
static const unsigned char toOpusTable[20] = {
0xE0, 0xE8, 0xF0, 0xF8,
0xC0, 0xC8, 0xD0, 0xD8,
0xA0, 0xA8, 0xB0, 0xB8,
0x00, 0x00, 0x00, 0x00,
0x80, 0x88, 0x90, 0x98,
};
static const unsigned char fromOpusTable[16] = {
0x80, 0x88, 0x90, 0x98,
0x40, 0x48, 0x50, 0x58,
0x20, 0x28, 0x30, 0x38,
0x00, 0x08, 0x10, 0x18
};
static OPUS_INLINE int toOpus(unsigned char c)
{
int ret=0;
if (c<0xA0)
ret = toOpusTable[c>>3];
if (ret == 0)
return -1;
else
return ret|(c&0x7);
}
static OPUS_INLINE int fromOpus(unsigned char c)
{
if (c<0x80)
return -1;
else
return fromOpusTable[(c>>3)-16] | (c&0x7);
}
#endif /* CUSTOM_MODES */
# 206 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/celt.h"
#define COMBFILTER_MAXPERIOD 1024
#define COMBFILTER_MINPERIOD 15
extern const signed char tf_select_table[4][8];
#if defined(ENABLE_HARDENING) || defined(ENABLE_ASSERTIONS)
void validate_celt_decoder(CELTDecoder *st);
#define VALIDATE_CELT_DECODER(st) validate_celt_decoder(st)
#else
# 216 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/celt.h"
#define VALIDATE_CELT_DECODER(st)
#endif
# 218 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/celt.h"
int resampling_factor(opus_int32 rate);
void celt_preemphasis(const opus_val16 * OPUS_RESTRICT pcmp, celt_sig * OPUS_RESTRICT inp,
int N, int CC, int upsample, const opus_val16 *coef, celt_sig *mem, int clip);
void comb_filter(opus_val32 *y, opus_val32 *x, int T0, int T1, int N,
opus_val16 g0, opus_val16 g1, int tapset0, int tapset1,
const opus_val16 *window, int overlap, int arch);
#ifdef NON_STATIC_COMB_FILTER_CONST_C
void comb_filter_const_c(opus_val32 *y, opus_val32 *x, int T, int N,
opus_val16 g10, opus_val16 g11, opus_val16 g12);
#endif
# 232 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/celt.h"
#ifndef OVERRIDE_COMB_FILTER_CONST
# define comb_filter_const(y, x, T, N, g10, g11, g12, arch) \
((void)(arch),comb_filter_const_c(y, x, T, N, g10, g11, g12))
#endif
# 237 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/celt.h"
void init_caps(const CELTMode *m,int *cap,int LM,int C);
#ifdef RESYNTH
void deemphasis(celt_sig *in[], opus_val16 *pcm, int N, int C, int downsample, const opus_val16 *coef, celt_sig *mem);
void celt_synthesis(const CELTMode *mode, celt_norm *X, celt_sig * out_syn[],
opus_val16 *oldBandE, int start, int effEnd, int C, int CC, int isTransient,
int LM, int downsample, int silence);
#endif
# 246 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/celt.h"
#ifdef __cplusplus
}
#endif
# 250 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/celt.h"
#endif /* CELT_H */
# 252 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/celt.h"
# 35 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/modes.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "arch.h"
#endif /* expanded by -frewrite-includes */
# 35 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/modes.h"
# 36 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/modes.h"
#if 0 /* expanded by -frewrite-includes */
#include "mdct.h"
#endif /* expanded by -frewrite-includes */
# 36 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/modes.h"
# 1 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/mdct.h" 1
/* Copyright (c) 2007-2008 CSIRO
Copyright (c) 2007-2008 Xiph.Org Foundation
Written by Jean-Marc Valin */
/*
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/* This is a simple MDCT implementation that uses a N/4 complex FFT
to do most of the work. It should be relatively straightforward to
plug in pretty much and FFT here.
This replaces the Vorbis FFT (and uses the exact same API), which
was a bit too messy and that was ending up duplicating code
(might as well use the same FFT everywhere).
The algorithm is similar to (and inspired from) Fabrice Bellard's
MDCT implementation in FFMPEG, but has differences in signs, ordering
and scaling in many places.
*/
#ifndef MDCT_H
#define MDCT_H
#if 0 /* expanded by -frewrite-includes */
#include "opus_defines.h"
#endif /* expanded by -frewrite-includes */
# 45 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/mdct.h"
# 46 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/mdct.h"
#if 0 /* expanded by -frewrite-includes */
#include "kiss_fft.h"
#endif /* expanded by -frewrite-includes */
# 46 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/mdct.h"
# 1 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/kiss_fft.h" 1
/*Copyright (c) 2003-2004, Mark Borgerding
Lots of modifications by Jean-Marc Valin
Copyright (c) 2005-2007, Xiph.Org Foundation
Copyright (c) 2008, Xiph.Org Foundation, CSIRO
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.*/
#ifndef KISS_FFT_H
#define KISS_FFT_H
#if 0 /* expanded by -frewrite-includes */
#include <stdlib.h>
#endif /* expanded by -frewrite-includes */
# 32 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/kiss_fft.h"
# 1 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/stdlib.h" 1 3
#ifndef _STDLIB_H
#define _STDLIB_H
#ifdef __cplusplus
extern "C" {
#endif
# 7 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/stdlib.h" 3
#if 0 /* expanded by -frewrite-includes */
#include <features.h>
#endif /* expanded by -frewrite-includes */
# 8 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/stdlib.h" 3
# 9 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/stdlib.h" 3
#ifdef __cplusplus
#define NULL 0L
#else
# 13 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/stdlib.h" 3
#define NULL ((void*)0)
#endif
# 15 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/stdlib.h" 3
#define __NEED_size_t
#define __NEED_wchar_t
#if 0 /* expanded by -frewrite-includes */
#include <bits/alltypes.h>
#endif /* expanded by -frewrite-includes */
# 19 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/stdlib.h" 3
# 1 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 1 3
#define _Addr long
#define _Int64 long long
#define _Reg long
#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
typedef __builtin_va_list va_list;
#define __DEFINED_va_list
#endif
# 9 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
typedef __builtin_va_list __isoc_va_list;
#define __DEFINED___isoc_va_list
#endif
# 14 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#ifndef __cplusplus
#if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t)
typedef int wchar_t;
#define __DEFINED_wchar_t
#endif
# 21 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#endif
# 23 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_float_t) && !defined(__DEFINED_float_t)
typedef float float_t;
#define __DEFINED_float_t
#endif
# 28 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_double_t) && !defined(__DEFINED_double_t)
typedef double double_t;
#define __DEFINED_double_t
#endif
# 33 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_max_align_t) && !defined(__DEFINED_max_align_t)
typedef struct { long long __ll; long double __ld; } max_align_t;
#define __DEFINED_max_align_t
#endif
# 39 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
typedef long time_t;
#define __DEFINED_time_t
#endif
# 45 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
typedef long suseconds_t;
#define __DEFINED_suseconds_t
#endif
# 50 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
typedef struct { union { int __i[9]; volatile int __vi[9]; unsigned __s[9]; } __u; } pthread_attr_t;
#define __DEFINED_pthread_attr_t
#endif
# 56 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
typedef struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } pthread_mutex_t;
#define __DEFINED_pthread_mutex_t
#endif
# 61 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
typedef struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } mtx_t;
#define __DEFINED_mtx_t
#endif
# 66 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } pthread_cond_t;
#define __DEFINED_pthread_cond_t
#endif
# 71 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } cnd_t;
#define __DEFINED_cnd_t
#endif
# 76 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
typedef struct { union { int __i[8]; volatile int __vi[8]; void *__p[8]; } __u; } pthread_rwlock_t;
#define __DEFINED_pthread_rwlock_t
#endif
# 81 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
typedef struct { union { int __i[5]; volatile int __vi[5]; void *__p[5]; } __u; } pthread_barrier_t;
#define __DEFINED_pthread_barrier_t
#endif
# 86 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_size_t) && !defined(__DEFINED_size_t)
typedef unsigned _Addr size_t;
#define __DEFINED_size_t
#endif
# 91 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_uintptr_t) && !defined(__DEFINED_uintptr_t)
typedef unsigned _Addr uintptr_t;
#define __DEFINED_uintptr_t
#endif
# 96 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_ptrdiff_t) && !defined(__DEFINED_ptrdiff_t)
typedef _Addr ptrdiff_t;
#define __DEFINED_ptrdiff_t
#endif
# 101 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_ssize_t) && !defined(__DEFINED_ssize_t)
typedef _Addr ssize_t;
#define __DEFINED_ssize_t
#endif
# 106 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_intptr_t) && !defined(__DEFINED_intptr_t)
typedef _Addr intptr_t;
#define __DEFINED_intptr_t
#endif
# 111 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_regoff_t) && !defined(__DEFINED_regoff_t)
typedef _Addr regoff_t;
#define __DEFINED_regoff_t
#endif
# 116 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_register_t) && !defined(__DEFINED_register_t)
typedef _Reg register_t;
#define __DEFINED_register_t
#endif
# 121 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_int8_t) && !defined(__DEFINED_int8_t)
typedef signed char int8_t;
#define __DEFINED_int8_t
#endif
# 127 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_int16_t) && !defined(__DEFINED_int16_t)
typedef signed short int16_t;
#define __DEFINED_int16_t
#endif
# 132 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_int32_t) && !defined(__DEFINED_int32_t)
typedef signed int int32_t;
#define __DEFINED_int32_t
#endif
# 137 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_int64_t) && !defined(__DEFINED_int64_t)
typedef signed _Int64 int64_t;
#define __DEFINED_int64_t
#endif
# 142 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_intmax_t) && !defined(__DEFINED_intmax_t)
typedef signed _Int64 intmax_t;
#define __DEFINED_intmax_t
#endif
# 147 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_uint8_t) && !defined(__DEFINED_uint8_t)
typedef unsigned char uint8_t;
#define __DEFINED_uint8_t
#endif
# 152 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_uint16_t) && !defined(__DEFINED_uint16_t)
typedef unsigned short uint16_t;
#define __DEFINED_uint16_t
#endif
# 157 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_uint32_t) && !defined(__DEFINED_uint32_t)
typedef unsigned int uint32_t;
#define __DEFINED_uint32_t
#endif
# 162 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_uint64_t) && !defined(__DEFINED_uint64_t)
typedef unsigned _Int64 uint64_t;
#define __DEFINED_uint64_t
#endif
# 167 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_u_int64_t) && !defined(__DEFINED_u_int64_t)
typedef unsigned _Int64 u_int64_t;
#define __DEFINED_u_int64_t
#endif
# 172 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_uintmax_t) && !defined(__DEFINED_uintmax_t)
typedef unsigned _Int64 uintmax_t;
#define __DEFINED_uintmax_t
#endif
# 177 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_mode_t) && !defined(__DEFINED_mode_t)
typedef unsigned mode_t;
#define __DEFINED_mode_t
#endif
# 183 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_nlink_t) && !defined(__DEFINED_nlink_t)
typedef unsigned _Reg nlink_t;
#define __DEFINED_nlink_t
#endif
# 188 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_off_t) && !defined(__DEFINED_off_t)
typedef _Int64 off_t;
#define __DEFINED_off_t
#endif
# 193 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_ino_t) && !defined(__DEFINED_ino_t)
typedef unsigned _Int64 ino_t;
#define __DEFINED_ino_t
#endif
# 198 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_dev_t) && !defined(__DEFINED_dev_t)
typedef unsigned _Int64 dev_t;
#define __DEFINED_dev_t
#endif
# 203 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_blksize_t) && !defined(__DEFINED_blksize_t)
typedef long blksize_t;
#define __DEFINED_blksize_t
#endif
# 208 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_blkcnt_t) && !defined(__DEFINED_blkcnt_t)
typedef _Int64 blkcnt_t;
#define __DEFINED_blkcnt_t
#endif
# 213 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_fsblkcnt_t) && !defined(__DEFINED_fsblkcnt_t)
typedef unsigned _Int64 fsblkcnt_t;
#define __DEFINED_fsblkcnt_t
#endif
# 218 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_fsfilcnt_t) && !defined(__DEFINED_fsfilcnt_t)
typedef unsigned _Int64 fsfilcnt_t;
#define __DEFINED_fsfilcnt_t
#endif
# 223 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_wint_t) && !defined(__DEFINED_wint_t)
typedef unsigned wint_t;
#define __DEFINED_wint_t
#endif
# 229 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_wctype_t) && !defined(__DEFINED_wctype_t)
typedef unsigned long wctype_t;
#define __DEFINED_wctype_t
#endif
# 234 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_timer_t) && !defined(__DEFINED_timer_t)
typedef void * timer_t;
#define __DEFINED_timer_t
#endif
# 240 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_clockid_t) && !defined(__DEFINED_clockid_t)
typedef int clockid_t;
#define __DEFINED_clockid_t
#endif
# 245 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_clock_t) && !defined(__DEFINED_clock_t)
typedef long clock_t;
#define __DEFINED_clock_t
#endif
# 250 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_struct_timeval) && !defined(__DEFINED_struct_timeval)
struct timeval { time_t tv_sec; suseconds_t tv_usec; };
#define __DEFINED_struct_timeval
#endif
# 255 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_struct_timespec) && !defined(__DEFINED_struct_timespec)
struct timespec { time_t tv_sec; long tv_nsec; };
#define __DEFINED_struct_timespec
#endif
# 260 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pid_t) && !defined(__DEFINED_pid_t)
typedef int pid_t;
#define __DEFINED_pid_t
#endif
# 266 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_id_t) && !defined(__DEFINED_id_t)
typedef unsigned id_t;
#define __DEFINED_id_t
#endif
# 271 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_uid_t) && !defined(__DEFINED_uid_t)
typedef unsigned uid_t;
#define __DEFINED_uid_t
#endif
# 276 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_gid_t) && !defined(__DEFINED_gid_t)
typedef unsigned gid_t;
#define __DEFINED_gid_t
#endif
# 281 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_key_t) && !defined(__DEFINED_key_t)
typedef int key_t;
#define __DEFINED_key_t
#endif
# 286 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_useconds_t) && !defined(__DEFINED_useconds_t)
typedef unsigned useconds_t;
#define __DEFINED_useconds_t
#endif
# 291 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#ifdef __cplusplus
#if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t)
typedef unsigned long pthread_t;
#define __DEFINED_pthread_t
#endif
# 298 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#else
# 300 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t)
typedef struct __pthread * pthread_t;
#define __DEFINED_pthread_t
#endif
# 304 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#endif
# 306 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_once_t) && !defined(__DEFINED_pthread_once_t)
typedef int pthread_once_t;
#define __DEFINED_pthread_once_t
#endif
# 310 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_key_t) && !defined(__DEFINED_pthread_key_t)
typedef unsigned pthread_key_t;
#define __DEFINED_pthread_key_t
#endif
# 315 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_spinlock_t) && !defined(__DEFINED_pthread_spinlock_t)
typedef int pthread_spinlock_t;
#define __DEFINED_pthread_spinlock_t
#endif
# 320 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_mutexattr_t) && !defined(__DEFINED_pthread_mutexattr_t)
typedef struct { unsigned __attr; } pthread_mutexattr_t;
#define __DEFINED_pthread_mutexattr_t
#endif
# 325 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_condattr_t) && !defined(__DEFINED_pthread_condattr_t)
typedef struct { unsigned __attr; } pthread_condattr_t;
#define __DEFINED_pthread_condattr_t
#endif
# 330 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_barrierattr_t) && !defined(__DEFINED_pthread_barrierattr_t)
typedef struct { unsigned __attr; } pthread_barrierattr_t;
#define __DEFINED_pthread_barrierattr_t
#endif
# 335 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_rwlockattr_t) && !defined(__DEFINED_pthread_rwlockattr_t)
typedef struct { unsigned __attr[2]; } pthread_rwlockattr_t;
#define __DEFINED_pthread_rwlockattr_t
#endif
# 340 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_FILE) && !defined(__DEFINED_FILE)
typedef struct _IO_FILE FILE;
#define __DEFINED_FILE
#endif
# 346 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_mbstate_t) && !defined(__DEFINED_mbstate_t)
typedef struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t;
#define __DEFINED_mbstate_t
#endif
# 352 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_locale_t) && !defined(__DEFINED_locale_t)
typedef struct __locale_struct * locale_t;
#define __DEFINED_locale_t
#endif
# 358 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_sigset_t) && !defined(__DEFINED_sigset_t)
typedef struct __sigset_t { unsigned long __bits[128/sizeof(long)]; } sigset_t;
#define __DEFINED_sigset_t
#endif
# 364 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_struct_iovec) && !defined(__DEFINED_struct_iovec)
struct iovec { void *iov_base; size_t iov_len; };
#define __DEFINED_struct_iovec
#endif
# 370 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_socklen_t) && !defined(__DEFINED_socklen_t)
typedef unsigned socklen_t;
#define __DEFINED_socklen_t
#endif
# 376 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_sa_family_t) && !defined(__DEFINED_sa_family_t)
typedef unsigned short sa_family_t;
#define __DEFINED_sa_family_t
#endif
# 381 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#undef _Addr
#undef _Int64
#undef _Reg
# 20 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/stdlib.h" 2 3
int atoi (const char *);
long atol (const char *);
long long atoll (const char *);
double atof (const char *);
float strtof (const char *__restrict, char **__restrict);
double strtod (const char *__restrict, char **__restrict);
long double strtold (const char *__restrict, char **__restrict);
long strtol (const char *__restrict, char **__restrict, int);
unsigned long strtoul (const char *__restrict, char **__restrict, int);
long long strtoll (const char *__restrict, char **__restrict, int);
unsigned long long strtoull (const char *__restrict, char **__restrict, int);
int rand (void);
void srand (unsigned);
void *malloc (size_t);
void *calloc (size_t, size_t);
void *realloc (void *, size_t);
void free (void *);
void *aligned_alloc(size_t, size_t);
_Noreturn void abort (void);
int atexit (void (*) (void));
_Noreturn void exit (int);
_Noreturn void _Exit (int);
int at_quick_exit (void (*) (void));
_Noreturn void quick_exit (int);
char *getenv (const char *);
int system (const char *);
void *bsearch (const void *, const void *, size_t, size_t, int (*)(const void *, const void *));
void qsort (void *, size_t, size_t, int (*)(const void *, const void *));
int abs (int);
long labs (long);
long long llabs (long long);
typedef struct { int quot, rem; } div_t;
typedef struct { long quot, rem; } ldiv_t;
typedef struct { long long quot, rem; } lldiv_t;
div_t div (int, int);
ldiv_t ldiv (long, long);
lldiv_t lldiv (long long, long long);
int mblen (const char *, size_t);
int mbtowc (wchar_t *__restrict, const char *__restrict, size_t);
int wctomb (char *, wchar_t);
size_t mbstowcs (wchar_t *__restrict, const char *__restrict, size_t);
size_t wcstombs (char *__restrict, const wchar_t *__restrict, size_t);
#define EXIT_FAILURE 1
#define EXIT_SUCCESS 0
size_t __ctype_get_mb_cur_max(void);
#define MB_CUR_MAX (__ctype_get_mb_cur_max())
#define RAND_MAX (0x7fffffff)
#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
|| defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
|| defined(_BSD_SOURCE)
#define WNOHANG 1
#define WUNTRACED 2
#define WEXITSTATUS(s) (((s) & 0xff00) >> 8)
#define WTERMSIG(s) ((s) & 0x7f)
#define WSTOPSIG(s) WEXITSTATUS(s)
#define WIFEXITED(s) (!WTERMSIG(s))
#define WIFSTOPPED(s) ((short)((((s)&0xffff)*0x10001)>>8) > 0x7f00)
#define WIFSIGNALED(s) (((s)&0xffff)-1U < 0xffu)
int posix_memalign (void **, size_t, size_t);
int setenv (const char *, const char *, int);
int unsetenv (const char *);
int mkstemp (char *);
int mkostemp (char *, int);
char *mkdtemp (char *);
int getsubopt (char **, char *const *, char **);
int rand_r (unsigned *);
#endif
# 109 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/stdlib.h" 3
#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
|| defined(_BSD_SOURCE)
char *realpath (const char *__restrict, char *__restrict);
long int random (void);
void srandom (unsigned int);
char *initstate (unsigned int, char *, size_t);
char *setstate (char *);
int putenv (char *);
int posix_openpt (int);
int grantpt (int);
int unlockpt (int);
char *ptsname (int);
char *l64a (long);
long a64l (const char *);
void setkey (const char *);
double drand48 (void);
double erand48 (unsigned short [3]);
long int lrand48 (void);
long int nrand48 (unsigned short [3]);
long mrand48 (void);
long jrand48 (unsigned short [3]);
void srand48 (long);
unsigned short *seed48 (unsigned short [3]);
void lcong48 (unsigned short [7]);
#endif
# 136 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/stdlib.h" 3
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
#if 0 /* expanded by -frewrite-includes */
#include <alloca.h>
#endif /* expanded by -frewrite-includes */
# 138 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/stdlib.h" 3
# 1 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/alloca.h" 1 3
#ifndef _ALLOCA_H
#define _ALLOCA_H
#ifdef __cplusplus
extern "C" {
#endif
# 7 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/alloca.h" 3
#define __NEED_size_t
#if 0 /* expanded by -frewrite-includes */
#include <bits/alltypes.h>
#endif /* expanded by -frewrite-includes */
# 9 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/alloca.h" 3
# 1 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 1 3
#define _Addr long
#define _Int64 long long
#define _Reg long
#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
typedef __builtin_va_list va_list;
#define __DEFINED_va_list
#endif
# 9 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
typedef __builtin_va_list __isoc_va_list;
#define __DEFINED___isoc_va_list
#endif
# 14 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#ifndef __cplusplus
#if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t)
typedef int wchar_t;
#define __DEFINED_wchar_t
#endif
# 21 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#endif
# 23 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_float_t) && !defined(__DEFINED_float_t)
typedef float float_t;
#define __DEFINED_float_t
#endif
# 28 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_double_t) && !defined(__DEFINED_double_t)
typedef double double_t;
#define __DEFINED_double_t
#endif
# 33 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_max_align_t) && !defined(__DEFINED_max_align_t)
typedef struct { long long __ll; long double __ld; } max_align_t;
#define __DEFINED_max_align_t
#endif
# 39 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
typedef long time_t;
#define __DEFINED_time_t
#endif
# 45 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
typedef long suseconds_t;
#define __DEFINED_suseconds_t
#endif
# 50 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
typedef struct { union { int __i[9]; volatile int __vi[9]; unsigned __s[9]; } __u; } pthread_attr_t;
#define __DEFINED_pthread_attr_t
#endif
# 56 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
typedef struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } pthread_mutex_t;
#define __DEFINED_pthread_mutex_t
#endif
# 61 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
typedef struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } mtx_t;
#define __DEFINED_mtx_t
#endif
# 66 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } pthread_cond_t;
#define __DEFINED_pthread_cond_t
#endif
# 71 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } cnd_t;
#define __DEFINED_cnd_t
#endif
# 76 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
typedef struct { union { int __i[8]; volatile int __vi[8]; void *__p[8]; } __u; } pthread_rwlock_t;
#define __DEFINED_pthread_rwlock_t
#endif
# 81 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
typedef struct { union { int __i[5]; volatile int __vi[5]; void *__p[5]; } __u; } pthread_barrier_t;
#define __DEFINED_pthread_barrier_t
#endif
# 86 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_size_t) && !defined(__DEFINED_size_t)
typedef unsigned _Addr size_t;
#define __DEFINED_size_t
#endif
# 91 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_uintptr_t) && !defined(__DEFINED_uintptr_t)
typedef unsigned _Addr uintptr_t;
#define __DEFINED_uintptr_t
#endif
# 96 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_ptrdiff_t) && !defined(__DEFINED_ptrdiff_t)
typedef _Addr ptrdiff_t;
#define __DEFINED_ptrdiff_t
#endif
# 101 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_ssize_t) && !defined(__DEFINED_ssize_t)
typedef _Addr ssize_t;
#define __DEFINED_ssize_t
#endif
# 106 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_intptr_t) && !defined(__DEFINED_intptr_t)
typedef _Addr intptr_t;
#define __DEFINED_intptr_t
#endif
# 111 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_regoff_t) && !defined(__DEFINED_regoff_t)
typedef _Addr regoff_t;
#define __DEFINED_regoff_t
#endif
# 116 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_register_t) && !defined(__DEFINED_register_t)
typedef _Reg register_t;
#define __DEFINED_register_t
#endif
# 121 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_int8_t) && !defined(__DEFINED_int8_t)
typedef signed char int8_t;
#define __DEFINED_int8_t
#endif
# 127 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_int16_t) && !defined(__DEFINED_int16_t)
typedef signed short int16_t;
#define __DEFINED_int16_t
#endif
# 132 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_int32_t) && !defined(__DEFINED_int32_t)
typedef signed int int32_t;
#define __DEFINED_int32_t
#endif
# 137 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_int64_t) && !defined(__DEFINED_int64_t)
typedef signed _Int64 int64_t;
#define __DEFINED_int64_t
#endif
# 142 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_intmax_t) && !defined(__DEFINED_intmax_t)
typedef signed _Int64 intmax_t;
#define __DEFINED_intmax_t
#endif
# 147 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_uint8_t) && !defined(__DEFINED_uint8_t)
typedef unsigned char uint8_t;
#define __DEFINED_uint8_t
#endif
# 152 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_uint16_t) && !defined(__DEFINED_uint16_t)
typedef unsigned short uint16_t;
#define __DEFINED_uint16_t
#endif
# 157 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_uint32_t) && !defined(__DEFINED_uint32_t)
typedef unsigned int uint32_t;
#define __DEFINED_uint32_t
#endif
# 162 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_uint64_t) && !defined(__DEFINED_uint64_t)
typedef unsigned _Int64 uint64_t;
#define __DEFINED_uint64_t
#endif
# 167 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_u_int64_t) && !defined(__DEFINED_u_int64_t)
typedef unsigned _Int64 u_int64_t;
#define __DEFINED_u_int64_t
#endif
# 172 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_uintmax_t) && !defined(__DEFINED_uintmax_t)
typedef unsigned _Int64 uintmax_t;
#define __DEFINED_uintmax_t
#endif
# 177 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_mode_t) && !defined(__DEFINED_mode_t)
typedef unsigned mode_t;
#define __DEFINED_mode_t
#endif
# 183 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_nlink_t) && !defined(__DEFINED_nlink_t)
typedef unsigned _Reg nlink_t;
#define __DEFINED_nlink_t
#endif
# 188 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_off_t) && !defined(__DEFINED_off_t)
typedef _Int64 off_t;
#define __DEFINED_off_t
#endif
# 193 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_ino_t) && !defined(__DEFINED_ino_t)
typedef unsigned _Int64 ino_t;
#define __DEFINED_ino_t
#endif
# 198 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_dev_t) && !defined(__DEFINED_dev_t)
typedef unsigned _Int64 dev_t;
#define __DEFINED_dev_t
#endif
# 203 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_blksize_t) && !defined(__DEFINED_blksize_t)
typedef long blksize_t;
#define __DEFINED_blksize_t
#endif
# 208 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_blkcnt_t) && !defined(__DEFINED_blkcnt_t)
typedef _Int64 blkcnt_t;
#define __DEFINED_blkcnt_t
#endif
# 213 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_fsblkcnt_t) && !defined(__DEFINED_fsblkcnt_t)
typedef unsigned _Int64 fsblkcnt_t;
#define __DEFINED_fsblkcnt_t
#endif
# 218 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_fsfilcnt_t) && !defined(__DEFINED_fsfilcnt_t)
typedef unsigned _Int64 fsfilcnt_t;
#define __DEFINED_fsfilcnt_t
#endif
# 223 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_wint_t) && !defined(__DEFINED_wint_t)
typedef unsigned wint_t;
#define __DEFINED_wint_t
#endif
# 229 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_wctype_t) && !defined(__DEFINED_wctype_t)
typedef unsigned long wctype_t;
#define __DEFINED_wctype_t
#endif
# 234 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_timer_t) && !defined(__DEFINED_timer_t)
typedef void * timer_t;
#define __DEFINED_timer_t
#endif
# 240 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_clockid_t) && !defined(__DEFINED_clockid_t)
typedef int clockid_t;
#define __DEFINED_clockid_t
#endif
# 245 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_clock_t) && !defined(__DEFINED_clock_t)
typedef long clock_t;
#define __DEFINED_clock_t
#endif
# 250 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_struct_timeval) && !defined(__DEFINED_struct_timeval)
struct timeval { time_t tv_sec; suseconds_t tv_usec; };
#define __DEFINED_struct_timeval
#endif
# 255 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_struct_timespec) && !defined(__DEFINED_struct_timespec)
struct timespec { time_t tv_sec; long tv_nsec; };
#define __DEFINED_struct_timespec
#endif
# 260 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pid_t) && !defined(__DEFINED_pid_t)
typedef int pid_t;
#define __DEFINED_pid_t
#endif
# 266 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_id_t) && !defined(__DEFINED_id_t)
typedef unsigned id_t;
#define __DEFINED_id_t
#endif
# 271 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_uid_t) && !defined(__DEFINED_uid_t)
typedef unsigned uid_t;
#define __DEFINED_uid_t
#endif
# 276 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_gid_t) && !defined(__DEFINED_gid_t)
typedef unsigned gid_t;
#define __DEFINED_gid_t
#endif
# 281 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_key_t) && !defined(__DEFINED_key_t)
typedef int key_t;
#define __DEFINED_key_t
#endif
# 286 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_useconds_t) && !defined(__DEFINED_useconds_t)
typedef unsigned useconds_t;
#define __DEFINED_useconds_t
#endif
# 291 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#ifdef __cplusplus
#if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t)
typedef unsigned long pthread_t;
#define __DEFINED_pthread_t
#endif
# 298 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#else
# 300 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t)
typedef struct __pthread * pthread_t;
#define __DEFINED_pthread_t
#endif
# 304 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#endif
# 306 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_once_t) && !defined(__DEFINED_pthread_once_t)
typedef int pthread_once_t;
#define __DEFINED_pthread_once_t
#endif
# 310 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_key_t) && !defined(__DEFINED_pthread_key_t)
typedef unsigned pthread_key_t;
#define __DEFINED_pthread_key_t
#endif
# 315 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_spinlock_t) && !defined(__DEFINED_pthread_spinlock_t)
typedef int pthread_spinlock_t;
#define __DEFINED_pthread_spinlock_t
#endif
# 320 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_mutexattr_t) && !defined(__DEFINED_pthread_mutexattr_t)
typedef struct { unsigned __attr; } pthread_mutexattr_t;
#define __DEFINED_pthread_mutexattr_t
#endif
# 325 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_condattr_t) && !defined(__DEFINED_pthread_condattr_t)
typedef struct { unsigned __attr; } pthread_condattr_t;
#define __DEFINED_pthread_condattr_t
#endif
# 330 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_barrierattr_t) && !defined(__DEFINED_pthread_barrierattr_t)
typedef struct { unsigned __attr; } pthread_barrierattr_t;
#define __DEFINED_pthread_barrierattr_t
#endif
# 335 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_rwlockattr_t) && !defined(__DEFINED_pthread_rwlockattr_t)
typedef struct { unsigned __attr[2]; } pthread_rwlockattr_t;
#define __DEFINED_pthread_rwlockattr_t
#endif
# 340 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_FILE) && !defined(__DEFINED_FILE)
typedef struct _IO_FILE FILE;
#define __DEFINED_FILE
#endif
# 346 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_mbstate_t) && !defined(__DEFINED_mbstate_t)
typedef struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t;
#define __DEFINED_mbstate_t
#endif
# 352 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_locale_t) && !defined(__DEFINED_locale_t)
typedef struct __locale_struct * locale_t;
#define __DEFINED_locale_t
#endif
# 358 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_sigset_t) && !defined(__DEFINED_sigset_t)
typedef struct __sigset_t { unsigned long __bits[128/sizeof(long)]; } sigset_t;
#define __DEFINED_sigset_t
#endif
# 364 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_struct_iovec) && !defined(__DEFINED_struct_iovec)
struct iovec { void *iov_base; size_t iov_len; };
#define __DEFINED_struct_iovec
#endif
# 370 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_socklen_t) && !defined(__DEFINED_socklen_t)
typedef unsigned socklen_t;
#define __DEFINED_socklen_t
#endif
# 376 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_sa_family_t) && !defined(__DEFINED_sa_family_t)
typedef unsigned short sa_family_t;
#define __DEFINED_sa_family_t
#endif
# 381 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#undef _Addr
#undef _Int64
#undef _Reg
# 10 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/alloca.h" 2 3
void *alloca(size_t);
#ifdef __GNUC__
#define alloca __builtin_alloca
#endif
# 16 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/alloca.h" 3
#ifdef __cplusplus
}
#endif
# 20 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/alloca.h" 3
#endif
# 21 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/alloca.h" 3
# 139 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/stdlib.h" 2 3
char *mktemp (char *);
int mkstemps (char *, int);
int mkostemps (char *, int, int);
void *valloc (size_t);
void *memalign(size_t, size_t);
int getloadavg(double *, int);
int clearenv(void);
#define WCOREDUMP(s) ((s) & 0x80)
#define WIFCONTINUED(s) ((s) == 0xffff)
#endif
# 149 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/stdlib.h" 3
#ifdef _GNU_SOURCE
int ptsname_r(int, char *, size_t);
char *ecvt(double, int, int *, int *);
char *fcvt(double, int, int *, int *);
char *gcvt(double, int, char *);
struct __locale_struct;
float strtof_l(const char *__restrict, char **__restrict, struct __locale_struct *);
double strtod_l(const char *__restrict, char **__restrict, struct __locale_struct *);
long double strtold_l(const char *__restrict, char **__restrict, struct __locale_struct *);
#endif
# 160 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/stdlib.h" 3
#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)
#define mkstemp64 mkstemp
#define mkostemp64 mkostemp
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
#define mkstemps64 mkstemps
#define mkostemps64 mkostemps
#endif
# 168 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/stdlib.h" 3
#endif
# 169 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/stdlib.h" 3
#ifdef __cplusplus
}
#endif
# 173 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/stdlib.h" 3
#endif
# 174 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/stdlib.h" 3
# 33 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/kiss_fft.h" 2
#if 0 /* expanded by -frewrite-includes */
#include <math.h>
#endif /* expanded by -frewrite-includes */
# 33 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/kiss_fft.h"
# 34 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/kiss_fft.h"
#if 0 /* expanded by -frewrite-includes */
#include "arch.h"
#endif /* expanded by -frewrite-includes */
# 34 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/kiss_fft.h"
# 35 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/kiss_fft.h"
#if 0 /* expanded by -frewrite-includes */
#include "cpu_support.h"
#endif /* expanded by -frewrite-includes */
# 35 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/kiss_fft.h"
# 1 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/cpu_support.h" 1
/* Copyright (c) 2010 Xiph.Org Foundation
* Copyright (c) 2013 Parrot */
/*
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef CPU_SUPPORT_H
#define CPU_SUPPORT_H
#if 0 /* expanded by -frewrite-includes */
#include "opus_types.h"
#endif /* expanded by -frewrite-includes */
# 31 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/cpu_support.h"
# 32 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/cpu_support.h"
#if 0 /* expanded by -frewrite-includes */
#include "opus_defines.h"
#endif /* expanded by -frewrite-includes */
# 32 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/cpu_support.h"
# 33 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/cpu_support.h"
#if defined(OPUS_HAVE_RTCD) && \
(defined(OPUS_ARM_ASM) || defined(OPUS_ARM_MAY_HAVE_NEON_INTR))
#if 0 /* expanded by -frewrite-includes */
#include "arm/armcpu.h"
#endif /* expanded by -frewrite-includes */
# 36 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/cpu_support.h"
# 37 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/cpu_support.h"
/* We currently support 4 ARM variants:
* arch[0] -> ARMv4
* arch[1] -> ARMv5E
* arch[2] -> ARMv6
* arch[3] -> NEON
*/
#define OPUS_ARCHMASK 3
#elif (defined(OPUS_X86_MAY_HAVE_SSE) && !defined(OPUS_X86_PRESUME_SSE)) || \
(defined(OPUS_X86_MAY_HAVE_SSE2) && !defined(OPUS_X86_PRESUME_SSE2)) || \
(defined(OPUS_X86_MAY_HAVE_SSE4_1) && !defined(OPUS_X86_PRESUME_SSE4_1)) || \
(defined(OPUS_X86_MAY_HAVE_AVX) && !defined(OPUS_X86_PRESUME_AVX))
# 50 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/cpu_support.h"
#if 0 /* expanded by -frewrite-includes */
#include "x86/x86cpu.h"
#endif /* expanded by -frewrite-includes */
# 51 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/cpu_support.h"
# 52 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/cpu_support.h"
/* We currently support 5 x86 variants:
* arch[0] -> non-sse
* arch[1] -> sse
* arch[2] -> sse2
* arch[3] -> sse4.1
* arch[4] -> avx
*/
#define OPUS_ARCHMASK 7
int opus_select_arch(void);
#else
# 63 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/cpu_support.h"
#define OPUS_ARCHMASK 0
static OPUS_INLINE int opus_select_arch(void)
{
return 0;
}
#endif
# 70 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/cpu_support.h"
#endif
# 71 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/cpu_support.h"
# 36 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/kiss_fft.h" 2
#ifdef __cplusplus
extern "C" {
#endif
# 40 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/kiss_fft.h"
#ifdef USE_SIMD
#if 0 /* expanded by -frewrite-includes */
# include <xmmintrin.h>
#endif /* expanded by -frewrite-includes */
# 42 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/kiss_fft.h"
# 43 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/kiss_fft.h"
# define kiss_fft_scalar __m128
#define KISS_FFT_MALLOC(nbytes) memalign(16,nbytes)
#else
# 46 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/kiss_fft.h"
#define KISS_FFT_MALLOC opus_alloc
#endif
# 48 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/kiss_fft.h"
#ifdef FIXED_POINT
#if 0 /* expanded by -frewrite-includes */
#include "arch.h"
#endif /* expanded by -frewrite-includes */
# 50 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/kiss_fft.h"
# 51 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/kiss_fft.h"
# define kiss_fft_scalar opus_int32
# define kiss_twiddle_scalar opus_int16
#else
# 57 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/kiss_fft.h"
# ifndef kiss_fft_scalar
/* default is float */
# define kiss_fft_scalar float
# define kiss_twiddle_scalar float
# define KF_SUFFIX _celt_single
# endif
# 63 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/kiss_fft.h"
#endif
# 64 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/kiss_fft.h"
typedef struct {
kiss_fft_scalar r;
kiss_fft_scalar i;
}kiss_fft_cpx;
typedef struct {
kiss_twiddle_scalar r;
kiss_twiddle_scalar i;
}kiss_twiddle_cpx;
#define MAXFACTORS 8
/* e.g. an fft of length 128 has 4 factors
as far as kissfft is concerned
4*4*4*2
*/
typedef struct arch_fft_state{
int is_supported;
void *priv;
} arch_fft_state;
typedef struct kiss_fft_state{
int nfft;
opus_val16 scale;
#ifdef FIXED_POINT
int scale_shift;
#endif
# 92 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/kiss_fft.h"
int shift;
opus_int16 factors[2*MAXFACTORS];
const opus_int16 *bitrev;
const kiss_twiddle_cpx *twiddles;
arch_fft_state *arch_fft;
} kiss_fft_state;
#if defined(HAVE_ARM_NE10)
#if 0 /* expanded by -frewrite-includes */
#include "arm/fft_arm.h"
#endif /* expanded by -frewrite-includes */
# 100 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/kiss_fft.h"
# 101 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/kiss_fft.h"
#endif
# 102 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/kiss_fft.h"
/*typedef struct kiss_fft_state* kiss_fft_cfg;*/
/**
* opus_fft_alloc
*
* Initialize a FFT (or IFFT) algorithm's cfg/state buffer.
*
* typical usage: kiss_fft_cfg mycfg=opus_fft_alloc(1024,0,NULL,NULL);
*
* The return value from fft_alloc is a cfg buffer used internally
* by the fft routine or NULL.
*
* If lenmem is NULL, then opus_fft_alloc will allocate a cfg buffer using malloc.
* The returned value should be free()d when done to avoid memory leaks.
*
* The state can be placed in a user supplied buffer 'mem':
* If lenmem is not NULL and mem is not NULL and *lenmem is large enough,
* then the function places the cfg in mem and the size used in *lenmem
* and returns mem.
*
* If lenmem is not NULL and ( mem is NULL or *lenmem is not large enough),
* then the function returns NULL and places the minimum cfg
* buffer size in *lenmem.
* */
kiss_fft_state *opus_fft_alloc_twiddles(int nfft,void * mem,size_t * lenmem, const kiss_fft_state *base, int arch);
kiss_fft_state *opus_fft_alloc(int nfft,void * mem,size_t * lenmem, int arch);
/**
* opus_fft(cfg,in_out_buf)
*
* Perform an FFT on a complex input buffer.
* for a forward FFT,
* fin should be f[0] , f[1] , ... ,f[nfft-1]
* fout will be F[0] , F[1] , ... ,F[nfft-1]
* Note that each element is complex and can be accessed like
f[k].r and f[k].i
* */
void opus_fft_c(const kiss_fft_state *cfg,const kiss_fft_cpx *fin,kiss_fft_cpx *fout);
void opus_ifft_c(const kiss_fft_state *cfg,const kiss_fft_cpx *fin,kiss_fft_cpx *fout);
void opus_fft_impl(const kiss_fft_state *st,kiss_fft_cpx *fout);
void opus_ifft_impl(const kiss_fft_state *st,kiss_fft_cpx *fout);
void opus_fft_free(const kiss_fft_state *cfg, int arch);
void opus_fft_free_arch_c(kiss_fft_state *st);
int opus_fft_alloc_arch_c(kiss_fft_state *st);
#if !defined(OVERRIDE_OPUS_FFT)
/* Is run-time CPU detection enabled on this platform? */
#if defined(OPUS_HAVE_RTCD) && (defined(HAVE_ARM_NE10))
extern int (*const OPUS_FFT_ALLOC_ARCH_IMPL[OPUS_ARCHMASK+1])(
kiss_fft_state *st);
#define opus_fft_alloc_arch(_st, arch) \
((*OPUS_FFT_ALLOC_ARCH_IMPL[(arch)&OPUS_ARCHMASK])(_st))
extern void (*const OPUS_FFT_FREE_ARCH_IMPL[OPUS_ARCHMASK+1])(
kiss_fft_state *st);
#define opus_fft_free_arch(_st, arch) \
((*OPUS_FFT_FREE_ARCH_IMPL[(arch)&OPUS_ARCHMASK])(_st))
extern void (*const OPUS_FFT[OPUS_ARCHMASK+1])(const kiss_fft_state *cfg,
const kiss_fft_cpx *fin, kiss_fft_cpx *fout);
#define opus_fft(_cfg, _fin, _fout, arch) \
((*OPUS_FFT[(arch)&OPUS_ARCHMASK])(_cfg, _fin, _fout))
extern void (*const OPUS_IFFT[OPUS_ARCHMASK+1])(const kiss_fft_state *cfg,
const kiss_fft_cpx *fin, kiss_fft_cpx *fout);
#define opus_ifft(_cfg, _fin, _fout, arch) \
((*OPUS_IFFT[(arch)&OPUS_ARCHMASK])(_cfg, _fin, _fout))
#else /* else for if defined(OPUS_HAVE_RTCD) && (defined(HAVE_ARM_NE10)) */
# 180 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/kiss_fft.h"
#define opus_fft_alloc_arch(_st, arch) \
((void)(arch), opus_fft_alloc_arch_c(_st))
#define opus_fft_free_arch(_st, arch) \
((void)(arch), opus_fft_free_arch_c(_st))
#define opus_fft(_cfg, _fin, _fout, arch) \
((void)(arch), opus_fft_c(_cfg, _fin, _fout))
#define opus_ifft(_cfg, _fin, _fout, arch) \
((void)(arch), opus_ifft_c(_cfg, _fin, _fout))
#endif /* end if defined(OPUS_HAVE_RTCD) && (defined(HAVE_ARM_NE10)) */
# 194 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/kiss_fft.h"
#endif /* end if !defined(OVERRIDE_OPUS_FFT) */
# 195 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/kiss_fft.h"
#ifdef __cplusplus
}
#endif
# 199 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/kiss_fft.h"
#endif
# 201 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/kiss_fft.h"
# 47 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/mdct.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "arch.h"
#endif /* expanded by -frewrite-includes */
# 47 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/mdct.h"
# 48 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/mdct.h"
typedef struct {
int n;
int maxshift;
const kiss_fft_state *kfft[4];
const kiss_twiddle_scalar * OPUS_RESTRICT trig;
} mdct_lookup;
#if defined(HAVE_ARM_NE10)
#if 0 /* expanded by -frewrite-includes */
#include "arm/mdct_arm.h"
#endif /* expanded by -frewrite-includes */
# 57 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/mdct.h"
# 58 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/mdct.h"
#endif
# 59 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/mdct.h"
int clt_mdct_init(mdct_lookup *l,int N, int maxshift, int arch);
void clt_mdct_clear(mdct_lookup *l, int arch);
/** Compute a forward MDCT and scale by 4/N, trashes the input array */
void clt_mdct_forward_c(const mdct_lookup *l, kiss_fft_scalar *in,
kiss_fft_scalar * OPUS_RESTRICT out,
const opus_val16 *window, int overlap,
int shift, int stride, int arch);
/** Compute a backward MDCT (no scaling) and performs weighted overlap-add
(scales implicitly by 1/2) */
void clt_mdct_backward_c(const mdct_lookup *l, kiss_fft_scalar *in,
kiss_fft_scalar * OPUS_RESTRICT out,
const opus_val16 * OPUS_RESTRICT window,
int overlap, int shift, int stride, int arch);
#if !defined(OVERRIDE_OPUS_MDCT)
/* Is run-time CPU detection enabled on this platform? */
#if defined(OPUS_HAVE_RTCD) && defined(HAVE_ARM_NE10)
extern void (*const CLT_MDCT_FORWARD_IMPL[OPUS_ARCHMASK+1])(
const mdct_lookup *l, kiss_fft_scalar *in,
kiss_fft_scalar * OPUS_RESTRICT out, const opus_val16 *window,
int overlap, int shift, int stride, int arch);
#define clt_mdct_forward(_l, _in, _out, _window, _overlap, _shift, _stride, _arch) \
((*CLT_MDCT_FORWARD_IMPL[(arch)&OPUS_ARCHMASK])(_l, _in, _out, \
_window, _overlap, _shift, \
_stride, _arch))
extern void (*const CLT_MDCT_BACKWARD_IMPL[OPUS_ARCHMASK+1])(
const mdct_lookup *l, kiss_fft_scalar *in,
kiss_fft_scalar * OPUS_RESTRICT out, const opus_val16 *window,
int overlap, int shift, int stride, int arch);
#define clt_mdct_backward(_l, _in, _out, _window, _overlap, _shift, _stride, _arch) \
(*CLT_MDCT_BACKWARD_IMPL[(arch)&OPUS_ARCHMASK])(_l, _in, _out, \
_window, _overlap, _shift, \
_stride, _arch)
#else /* if defined(OPUS_HAVE_RTCD) && defined(HAVE_ARM_NE10) */
# 102 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/mdct.h"
#define clt_mdct_forward(_l, _in, _out, _window, _overlap, _shift, _stride, _arch) \
clt_mdct_forward_c(_l, _in, _out, _window, _overlap, _shift, _stride, _arch)
#define clt_mdct_backward(_l, _in, _out, _window, _overlap, _shift, _stride, _arch) \
clt_mdct_backward_c(_l, _in, _out, _window, _overlap, _shift, _stride, _arch)
#endif /* end if defined(OPUS_HAVE_RTCD) && defined(HAVE_ARM_NE10) && !defined(FIXED_POINT) */
# 110 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/mdct.h"
#endif /* end if !defined(OVERRIDE_OPUS_MDCT) */
# 111 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/mdct.h"
#endif
# 113 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/mdct.h"
# 37 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/modes.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "entenc.h"
#endif /* expanded by -frewrite-includes */
# 37 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/modes.h"
# 38 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/modes.h"
#if 0 /* expanded by -frewrite-includes */
#include "entdec.h"
#endif /* expanded by -frewrite-includes */
# 38 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/modes.h"
# 39 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/modes.h"
#define MAX_PERIOD 1024
typedef struct {
int size;
const opus_int16 *index;
const unsigned char *bits;
const unsigned char *caps;
} PulseCache;
/** Mode definition (opaque)
@brief Mode definition
*/
struct OpusCustomMode {
opus_int32 Fs;
int overlap;
int nbEBands;
int effEBands;
opus_val16 preemph[4];
const opus_int16 *eBands; /**< Definition for each "pseudo-critical band" */
int maxLM;
int nbShortMdcts;
int shortMdctSize;
int nbAllocVectors; /**< Number of lines in the matrix below */
const unsigned char *allocVectors; /**< Number of bits in each band for several rates */
const opus_int16 *logN;
const opus_val16 *window;
mdct_lookup mdct;
PulseCache cache;
};
#endif
# 76 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/modes.h"
# 35 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "entenc.h"
#endif /* expanded by -frewrite-includes */
# 35 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.h"
# 36 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.h"
#if 0 /* expanded by -frewrite-includes */
#include "entdec.h"
#endif /* expanded by -frewrite-includes */
# 36 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.h"
# 37 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.h"
#if 0 /* expanded by -frewrite-includes */
#include "rate.h"
#endif /* expanded by -frewrite-includes */
# 37 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.h"
# 1 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/rate.h" 1
/* Copyright (c) 2007-2008 CSIRO
Copyright (c) 2007-2009 Xiph.Org Foundation
Written by Jean-Marc Valin */
/*
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef RATE_H
#define RATE_H
#define MAX_PSEUDO 40
#define LOG_MAX_PSEUDO 6
#define CELT_MAX_PULSES 128
#define MAX_FINE_BITS 8
#define FINE_OFFSET 21
#define QTHETA_OFFSET 4
#define QTHETA_OFFSET_TWOPHASE 16
#if 0 /* expanded by -frewrite-includes */
#include "cwrs.h"
#endif /* expanded by -frewrite-includes */
# 43 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/rate.h"
# 1 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/cwrs.h" 1
/* Copyright (c) 2007-2008 CSIRO
Copyright (c) 2007-2009 Xiph.Org Foundation
Copyright (c) 2007-2009 Timothy B. Terriberry
Written by Timothy B. Terriberry and Jean-Marc Valin */
/*
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef CWRS_H
#define CWRS_H
#if 0 /* expanded by -frewrite-includes */
#include "arch.h"
#endif /* expanded by -frewrite-includes */
# 33 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/cwrs.h"
# 34 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/cwrs.h"
#if 0 /* expanded by -frewrite-includes */
#include "stack_alloc.h"
#endif /* expanded by -frewrite-includes */
# 34 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/cwrs.h"
# 1 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/stack_alloc.h" 1
/* Copyright (C) 2002-2003 Jean-Marc Valin
Copyright (C) 2007-2009 Xiph.Org Foundation */
/**
@file stack_alloc.h
@brief Temporary memory allocation on stack
*/
/*
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef STACK_ALLOC_H
#define STACK_ALLOC_H
#if 0 /* expanded by -frewrite-includes */
#include "opus_types.h"
#endif /* expanded by -frewrite-includes */
# 35 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/stack_alloc.h"
# 36 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/stack_alloc.h"
#if 0 /* expanded by -frewrite-includes */
#include "opus_defines.h"
#endif /* expanded by -frewrite-includes */
# 36 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/stack_alloc.h"
# 37 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/stack_alloc.h"
#if (!defined (VAR_ARRAYS) && !defined (USE_ALLOCA) && !defined (NONTHREADSAFE_PSEUDOSTACK))
#error "Opus requires one of VAR_ARRAYS, USE_ALLOCA, or NONTHREADSAFE_PSEUDOSTACK be defined to select the temporary allocation mode."
#endif
# 41 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/stack_alloc.h"
#ifdef USE_ALLOCA
# ifdef WIN32
#if 0 /* expanded by -frewrite-includes */
# include <malloc.h>
#endif /* expanded by -frewrite-includes */
# 44 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/stack_alloc.h"
# 45 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/stack_alloc.h"
# else
# 46 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/stack_alloc.h"
# ifdef HAVE_ALLOCA_H
#if 0 /* expanded by -frewrite-includes */
# include <alloca.h>
#endif /* expanded by -frewrite-includes */
# 47 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/stack_alloc.h"
# 48 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/stack_alloc.h"
# else
# 49 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/stack_alloc.h"
#if 0 /* expanded by -frewrite-includes */
# include <stdlib.h>
#endif /* expanded by -frewrite-includes */
# 49 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/stack_alloc.h"
# 50 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/stack_alloc.h"
# endif
# 51 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/stack_alloc.h"
# endif
# 52 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/stack_alloc.h"
#endif
# 53 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/stack_alloc.h"
/**
* @def ALIGN(stack, size)
*
* Aligns the stack to a 'size' boundary
*
* @param stack Stack
* @param size New size boundary
*/
/**
* @def PUSH(stack, size, type)
*
* Allocates 'size' elements of type 'type' on the stack
*
* @param stack Stack
* @param size Number of elements
* @param type Type of element
*/
/**
* @def VARDECL(var)
*
* Declare variable on stack
*
* @param var Variable to declare
*/
/**
* @def ALLOC(var, size, type)
*
* Allocate 'size' elements of 'type' on stack
*
* @param var Name of variable to allocate
* @param size Number of elements
* @param type Type of element
*/
#if defined(VAR_ARRAYS)
#define VARDECL(type, var)
#define ALLOC(var, size, type) type var[size]
#define SAVE_STACK
#define RESTORE_STACK
#define ALLOC_STACK
/* C99 does not allow VLAs of size zero */
#define ALLOC_NONE 1
#elif defined(USE_ALLOCA)
# 102 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/stack_alloc.h"
#define VARDECL(type, var) type *var
# ifdef WIN32
# define ALLOC(var, size, type) var = ((type*)_alloca(sizeof(type)*(size)))
# else
# 108 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/stack_alloc.h"
# define ALLOC(var, size, type) var = ((type*)alloca(sizeof(type)*(size)))
# endif
# 110 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/stack_alloc.h"
#define SAVE_STACK
#define RESTORE_STACK
#define ALLOC_STACK
#define ALLOC_NONE 0
#else
# 117 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/stack_alloc.h"
#ifdef CELT_C
char *scratch_ptr=0;
char *global_stack=0;
#else
# 122 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/stack_alloc.h"
extern char *global_stack;
extern char *scratch_ptr;
#endif /* CELT_C */
# 125 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/stack_alloc.h"
#ifdef ENABLE_VALGRIND
#if 0 /* expanded by -frewrite-includes */
#include <valgrind/memcheck.h>
#endif /* expanded by -frewrite-includes */
# 128 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/stack_alloc.h"
# 129 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/stack_alloc.h"
#ifdef CELT_C
char *global_stack_top=0;
#else
# 133 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/stack_alloc.h"
extern char *global_stack_top;
#endif /* CELT_C */
# 135 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/stack_alloc.h"
#define ALIGN(stack, size) ((stack) += ((size) - (long)(stack)) & ((size) - 1))
#define PUSH(stack, size, type) (VALGRIND_MAKE_MEM_NOACCESS(stack, global_stack_top-stack),ALIGN((stack),sizeof(type)/sizeof(char)),VALGRIND_MAKE_MEM_UNDEFINED(stack, ((size)*sizeof(type)/sizeof(char))),(stack)+=(2*(size)*sizeof(type)/sizeof(char)),(type*)((stack)-(2*(size)*sizeof(type)/sizeof(char))))
#define RESTORE_STACK ((global_stack = _saved_stack),VALGRIND_MAKE_MEM_NOACCESS(global_stack, global_stack_top-global_stack))
#define ALLOC_STACK char *_saved_stack; ((global_stack = (global_stack==0) ? ((global_stack_top=opus_alloc_scratch(GLOBAL_STACK_SIZE*2)+(GLOBAL_STACK_SIZE*2))-(GLOBAL_STACK_SIZE*2)) : global_stack),VALGRIND_MAKE_MEM_NOACCESS(global_stack, global_stack_top-global_stack)); _saved_stack = global_stack;
#else
# 142 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/stack_alloc.h"
#define ALIGN(stack, size) ((stack) += ((size) - (long)(stack)) & ((size) - 1))
#define PUSH(stack, size, type) (ALIGN((stack),sizeof(type)/sizeof(char)),(stack)+=(size)*(sizeof(type)/sizeof(char)),(type*)((stack)-(size)*(sizeof(type)/sizeof(char))))
#if 0 /* Set this to 1 to instrument pseudostack usage */
#define RESTORE_STACK (printf("%ld %s:%d\n", global_stack-scratch_ptr, __FILE__, __LINE__),global_stack = _saved_stack)
#else
# 148 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/stack_alloc.h"
#define RESTORE_STACK (global_stack = _saved_stack)
#endif
# 150 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/stack_alloc.h"
#define ALLOC_STACK char *_saved_stack; (global_stack = (global_stack==0) ? (scratch_ptr=opus_alloc_scratch(GLOBAL_STACK_SIZE)) : global_stack); _saved_stack = global_stack;
#endif /* ENABLE_VALGRIND */
# 153 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/stack_alloc.h"
#if 0 /* expanded by -frewrite-includes */
#include "os_support.h"
#endif /* expanded by -frewrite-includes */
# 154 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/stack_alloc.h"
# 155 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/stack_alloc.h"
#define VARDECL(type, var) type *var
#define ALLOC(var, size, type) var = PUSH(global_stack, size, type)
#define SAVE_STACK char *_saved_stack = global_stack;
#define ALLOC_NONE 0
#endif /* VAR_ARRAYS */
# 161 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/stack_alloc.h"
#ifdef ENABLE_VALGRIND
#if 0 /* expanded by -frewrite-includes */
#include <valgrind/memcheck.h>
#endif /* expanded by -frewrite-includes */
# 165 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/stack_alloc.h"
# 166 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/stack_alloc.h"
#define OPUS_CHECK_ARRAY(ptr, len) VALGRIND_CHECK_MEM_IS_DEFINED(ptr, len*sizeof(*ptr))
#define OPUS_CHECK_VALUE(value) VALGRIND_CHECK_VALUE_IS_DEFINED(value)
#define OPUS_CHECK_ARRAY_COND(ptr, len) VALGRIND_CHECK_MEM_IS_DEFINED(ptr, len*sizeof(*ptr))
#define OPUS_CHECK_VALUE_COND(value) VALGRIND_CHECK_VALUE_IS_DEFINED(value)
#define OPUS_PRINT_INT(value) do {fprintf(stderr, #value " = %d at %s:%d\n", value, __FILE__, __LINE__);}while(0)
#define OPUS_FPRINTF fprintf
#else
# 174 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/stack_alloc.h"
static OPUS_INLINE int _opus_false(void) {return 0;}
#define OPUS_CHECK_ARRAY(ptr, len) _opus_false()
#define OPUS_CHECK_VALUE(value) _opus_false()
#define OPUS_PRINT_INT(value) do{}while(0)
#define OPUS_FPRINTF (void)
#endif
# 182 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/stack_alloc.h"
#endif /* STACK_ALLOC_H */
# 185 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/stack_alloc.h"
# 35 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/cwrs.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "entenc.h"
#endif /* expanded by -frewrite-includes */
# 35 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/cwrs.h"
# 36 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/cwrs.h"
#if 0 /* expanded by -frewrite-includes */
#include "entdec.h"
#endif /* expanded by -frewrite-includes */
# 36 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/cwrs.h"
# 37 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/cwrs.h"
#ifdef CUSTOM_MODES
int log2_frac(opus_uint32 val, int frac);
#endif
# 41 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/cwrs.h"
void get_required_bits(opus_int16 *bits, int N, int K, int frac);
void encode_pulses(const int *_y, int N, int K, ec_enc *enc);
opus_val32 decode_pulses(int *_y, int N, int K, ec_dec *dec);
#endif /* CWRS_H */
# 49 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/cwrs.h"
# 44 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/rate.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "modes.h"
#endif /* expanded by -frewrite-includes */
# 44 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/rate.h"
# 45 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/rate.h"
void compute_pulse_cache(CELTMode *m, int LM);
static OPUS_INLINE int get_pulses(int i)
{
return i<8 ? i : (8 + (i&7)) << ((i>>3)-1);
}
static OPUS_INLINE int bits2pulses(const CELTMode *m, int band, int LM, int bits)
{
int i;
int lo, hi;
const unsigned char *cache;
LM++;
cache = m->cache.bits + m->cache.index[LM*m->nbEBands+band];
lo = 0;
hi = cache[0];
bits--;
for (i=0;i<LOG_MAX_PSEUDO;i++)
{
int mid = (lo+hi+1)>>1;
/* OPT: Make sure this is implemented with a conditional move */
if ((int)cache[mid] >= bits)
hi = mid;
else
lo = mid;
}
if (bits- (lo == 0 ? -1 : (int)cache[lo]) <= (int)cache[hi]-bits)
return lo;
else
return hi;
}
static OPUS_INLINE int pulses2bits(const CELTMode *m, int band, int LM, int pulses)
{
const unsigned char *cache;
LM++;
cache = m->cache.bits + m->cache.index[LM*m->nbEBands+band];
return pulses == 0 ? 0 : cache[pulses]+1;
}
/** Compute the pulse allocation, i.e. how many pulses will go in each
* band.
@param m mode
@param offsets Requested increase or decrease in the number of bits for
each band
@param total Number of bands
@param pulses Number of pulses per band (returned)
@return Total number of bits allocated
*/
int clt_compute_allocation(const CELTMode *m, int start, int end, const int *offsets, const int *cap, int alloc_trim, int *intensity, int *dual_stereo,
opus_int32 total, opus_int32 *balance, int *pulses, int *ebits, int *fine_priority, int C, int LM, ec_ctx *ec, int encode, int prev, int signalBandwidth);
#endif
# 102 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/rate.h"
# 38 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.h" 2
opus_int16 bitexact_cos(opus_int16 x);
int bitexact_log2tan(int isin,int icos);
/** Compute the amplitude (sqrt energy) in each of the bands
* @param m Mode data
* @param X Spectrum
* @param bandE Square root of the energy for each band (returned)
*/
void compute_band_energies(const CELTMode *m, const celt_sig *X, celt_ener *bandE, int end, int C, int LM, int arch);
/*void compute_noise_energies(const CELTMode *m, const celt_sig *X, const opus_val16 *tonality, celt_ener *bandE);*/
/** Normalise each band of X such that the energy in each band is
equal to 1
* @param m Mode data
* @param X Spectrum (returned normalised)
* @param bandE Square root of the energy for each band
*/
void normalise_bands(const CELTMode *m, const celt_sig * OPUS_RESTRICT freq, celt_norm * OPUS_RESTRICT X, const celt_ener *bandE, int end, int C, int M);
/** Denormalise each band of X to restore full amplitude
* @param m Mode data
* @param X Spectrum (returned de-normalised)
* @param bandE Square root of the energy for each band
*/
void denormalise_bands(const CELTMode *m, const celt_norm * OPUS_RESTRICT X,
celt_sig * OPUS_RESTRICT freq, const opus_val16 *bandE, int start,
int end, int M, int downsample, int silence);
#define SPREAD_NONE (0)
#define SPREAD_LIGHT (1)
#define SPREAD_NORMAL (2)
#define SPREAD_AGGRESSIVE (3)
int spreading_decision(const CELTMode *m, const celt_norm *X, int *average,
int last_decision, int *hf_average, int *tapset_decision, int update_hf,
int end, int C, int M, const int *spread_weight);
#ifdef MEASURE_NORM_MSE
void measure_norm_mse(const CELTMode *m, float *X, float *X0, float *bandE, float *bandE0, int M, int N, int C);
#endif
# 80 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.h"
void haar1(celt_norm *X, int N0, int stride);
/** Quantisation/encoding of the residual spectrum
* @param encode flag that indicates whether we're encoding (1) or decoding (0)
* @param m Mode data
* @param start First band to process
* @param end Last band to process + 1
* @param X Residual (normalised)
* @param Y Residual (normalised) for second channel (or NULL for mono)
* @param collapse_masks Anti-collapse tracking mask
* @param bandE Square root of the energy for each band
* @param pulses Bit allocation (per band) for PVQ
* @param shortBlocks Zero for long blocks, non-zero for short blocks
* @param spread Amount of spreading to use
* @param dual_stereo Zero for MS stereo, non-zero for dual stereo
* @param intensity First band to use intensity stereo
* @param tf_res Time-frequency resolution change
* @param total_bits Total number of bits that can be used for the frame (including the ones already spent)
* @param balance Number of unallocated bits
* @param en Entropy coder state
* @param LM log2() of the number of 2.5 subframes in the frame
* @param codedBands Last band to receive bits + 1
* @param seed Random generator seed
* @param arch Run-time architecture (see opus_select_arch())
*/
void quant_all_bands(int encode, const CELTMode *m, int start, int end,
celt_norm * X, celt_norm * Y, unsigned char *collapse_masks,
const celt_ener *bandE, int *pulses, int shortBlocks, int spread,
int dual_stereo, int intensity, int *tf_res, opus_int32 total_bits,
opus_int32 balance, ec_ctx *ec, int M, int codedBands, opus_uint32 *seed,
int complexity, int arch, int disable_inv);
void anti_collapse(const CELTMode *m, celt_norm *X_,
unsigned char *collapse_masks, int LM, int C, int size, int start,
int end, const opus_val16 *logE, const opus_val16 *prev1logE,
const opus_val16 *prev2logE, const int *pulses, opus_uint32 seed,
int arch);
opus_uint32 celt_lcg_rand(opus_uint32 seed);
int hysteresis_decision(opus_val16 val, const opus_val16 *thresholds, const opus_val16 *hysteresis, int N, int prev);
#endif /* BANDS_H */
# 124 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.h"
# 36 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.c" 2
#if 0 /* expanded by -frewrite-includes */
#include "modes.h"
#endif /* expanded by -frewrite-includes */
# 36 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.c"
# 37 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.c"
#if 0 /* expanded by -frewrite-includes */
#include "vq.h"
#endif /* expanded by -frewrite-includes */
# 37 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.c"
# 1 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/vq.h" 1
/* Copyright (c) 2007-2008 CSIRO
Copyright (c) 2007-2009 Xiph.Org Foundation
Written by Jean-Marc Valin */
/**
@file vq.h
@brief Vector quantisation of the residual
*/
/*
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef VQ_H
#define VQ_H
#if 0 /* expanded by -frewrite-includes */
#include "entenc.h"
#endif /* expanded by -frewrite-includes */
# 36 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/vq.h"
# 37 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/vq.h"
#if 0 /* expanded by -frewrite-includes */
#include "entdec.h"
#endif /* expanded by -frewrite-includes */
# 37 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/vq.h"
# 38 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/vq.h"
#if 0 /* expanded by -frewrite-includes */
#include "modes.h"
#endif /* expanded by -frewrite-includes */
# 38 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/vq.h"
# 39 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/vq.h"
#if (defined(OPUS_X86_MAY_HAVE_SSE2) && !defined(FIXED_POINT))
#if 0 /* expanded by -frewrite-includes */
#include "x86/vq_sse.h"
#endif /* expanded by -frewrite-includes */
# 41 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/vq.h"
# 42 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/vq.h"
#endif
# 43 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/vq.h"
void exp_rotation(celt_norm *X, int len, int dir, int stride, int K, int spread);
opus_val16 op_pvq_search_c(celt_norm *X, int *iy, int K, int N, int arch);
#if !defined(OVERRIDE_OP_PVQ_SEARCH)
#define op_pvq_search(x, iy, K, N, arch) \
(op_pvq_search_c(x, iy, K, N, arch))
#endif
# 52 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/vq.h"
/** Algebraic pulse-vector quantiser. The signal x is replaced by the sum of
* the pitch and a combination of pulses such that its norm is still equal
* to 1. This is the function that will typically require the most CPU.
* @param X Residual signal to quantise/encode (returns quantised version)
* @param N Number of samples to encode
* @param K Number of pulses to use
* @param enc Entropy encoder state
* @ret A mask indicating which blocks in the band received pulses
*/
unsigned alg_quant(celt_norm *X, int N, int K, int spread, int B, ec_enc *enc,
opus_val16 gain, int resynth, int arch);
/** Algebraic pulse decoder
* @param X Decoded normalised spectrum (returned)
* @param N Number of samples to decode
* @param K Number of pulses to use
* @param dec Entropy decoder state
* @ret A mask indicating which blocks in the band received pulses
*/
unsigned alg_unquant(celt_norm *X, int N, int K, int spread, int B,
ec_dec *dec, opus_val16 gain);
void renormalise_vector(celt_norm *X, int N, opus_val16 gain, int arch);
int stereo_itheta(const celt_norm *X, const celt_norm *Y, int stereo, int N, int arch);
#endif /* VQ_H */
# 80 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/vq.h"
# 38 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.c" 2
#if 0 /* expanded by -frewrite-includes */
#include "cwrs.h"
#endif /* expanded by -frewrite-includes */
# 38 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.c"
# 39 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.c"
#if 0 /* expanded by -frewrite-includes */
#include "stack_alloc.h"
#endif /* expanded by -frewrite-includes */
# 39 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.c"
# 40 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.c"
#if 0 /* expanded by -frewrite-includes */
#include "os_support.h"
#endif /* expanded by -frewrite-includes */
# 40 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.c"
# 1 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/os_support.h" 1
/* Copyright (C) 2007 Jean-Marc Valin
File: os_support.h
This is the (tiny) OS abstraction layer. Aside from math.h, this is the
only place where system headers are allowed.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef OS_SUPPORT_H
#define OS_SUPPORT_H
#ifdef CUSTOM_SUPPORT
#if 0 /* expanded by -frewrite-includes */
# include "custom_support.h"
#endif /* expanded by -frewrite-includes */
# 35 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/os_support.h"
# 36 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/os_support.h"
#endif
# 37 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/os_support.h"
#if 0 /* expanded by -frewrite-includes */
#include "opus_types.h"
#endif /* expanded by -frewrite-includes */
# 38 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/os_support.h"
# 39 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/os_support.h"
#if 0 /* expanded by -frewrite-includes */
#include "opus_defines.h"
#endif /* expanded by -frewrite-includes */
# 39 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/os_support.h"
# 40 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/os_support.h"
#if 0 /* expanded by -frewrite-includes */
#include <string.h>
#endif /* expanded by -frewrite-includes */
# 41 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/os_support.h"
# 1 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/string.h" 1 3
#ifndef _STRING_H
#define _STRING_H
#ifdef __cplusplus
extern "C" {
#endif
# 7 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/string.h" 3
#if 0 /* expanded by -frewrite-includes */
#include <features.h>
#endif /* expanded by -frewrite-includes */
# 8 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/string.h" 3
# 9 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/string.h" 3
#ifdef __cplusplus
#define NULL 0L
#else
# 13 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/string.h" 3
#define NULL ((void*)0)
#endif
# 15 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/string.h" 3
#define __NEED_size_t
#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
|| defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
|| defined(_BSD_SOURCE)
#define __NEED_locale_t
#endif
# 22 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/string.h" 3
#if 0 /* expanded by -frewrite-includes */
#include <bits/alltypes.h>
#endif /* expanded by -frewrite-includes */
# 23 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/string.h" 3
# 1 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 1 3
#define _Addr long
#define _Int64 long long
#define _Reg long
#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
typedef __builtin_va_list va_list;
#define __DEFINED_va_list
#endif
# 9 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
typedef __builtin_va_list __isoc_va_list;
#define __DEFINED___isoc_va_list
#endif
# 14 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#ifndef __cplusplus
#if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t)
typedef int wchar_t;
#define __DEFINED_wchar_t
#endif
# 21 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#endif
# 23 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_float_t) && !defined(__DEFINED_float_t)
typedef float float_t;
#define __DEFINED_float_t
#endif
# 28 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_double_t) && !defined(__DEFINED_double_t)
typedef double double_t;
#define __DEFINED_double_t
#endif
# 33 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_max_align_t) && !defined(__DEFINED_max_align_t)
typedef struct { long long __ll; long double __ld; } max_align_t;
#define __DEFINED_max_align_t
#endif
# 39 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
typedef long time_t;
#define __DEFINED_time_t
#endif
# 45 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
typedef long suseconds_t;
#define __DEFINED_suseconds_t
#endif
# 50 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
typedef struct { union { int __i[9]; volatile int __vi[9]; unsigned __s[9]; } __u; } pthread_attr_t;
#define __DEFINED_pthread_attr_t
#endif
# 56 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
typedef struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } pthread_mutex_t;
#define __DEFINED_pthread_mutex_t
#endif
# 61 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
typedef struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } mtx_t;
#define __DEFINED_mtx_t
#endif
# 66 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } pthread_cond_t;
#define __DEFINED_pthread_cond_t
#endif
# 71 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } cnd_t;
#define __DEFINED_cnd_t
#endif
# 76 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
typedef struct { union { int __i[8]; volatile int __vi[8]; void *__p[8]; } __u; } pthread_rwlock_t;
#define __DEFINED_pthread_rwlock_t
#endif
# 81 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
typedef struct { union { int __i[5]; volatile int __vi[5]; void *__p[5]; } __u; } pthread_barrier_t;
#define __DEFINED_pthread_barrier_t
#endif
# 86 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_size_t) && !defined(__DEFINED_size_t)
typedef unsigned _Addr size_t;
#define __DEFINED_size_t
#endif
# 91 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_uintptr_t) && !defined(__DEFINED_uintptr_t)
typedef unsigned _Addr uintptr_t;
#define __DEFINED_uintptr_t
#endif
# 96 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_ptrdiff_t) && !defined(__DEFINED_ptrdiff_t)
typedef _Addr ptrdiff_t;
#define __DEFINED_ptrdiff_t
#endif
# 101 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_ssize_t) && !defined(__DEFINED_ssize_t)
typedef _Addr ssize_t;
#define __DEFINED_ssize_t
#endif
# 106 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_intptr_t) && !defined(__DEFINED_intptr_t)
typedef _Addr intptr_t;
#define __DEFINED_intptr_t
#endif
# 111 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_regoff_t) && !defined(__DEFINED_regoff_t)
typedef _Addr regoff_t;
#define __DEFINED_regoff_t
#endif
# 116 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_register_t) && !defined(__DEFINED_register_t)
typedef _Reg register_t;
#define __DEFINED_register_t
#endif
# 121 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_int8_t) && !defined(__DEFINED_int8_t)
typedef signed char int8_t;
#define __DEFINED_int8_t
#endif
# 127 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_int16_t) && !defined(__DEFINED_int16_t)
typedef signed short int16_t;
#define __DEFINED_int16_t
#endif
# 132 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_int32_t) && !defined(__DEFINED_int32_t)
typedef signed int int32_t;
#define __DEFINED_int32_t
#endif
# 137 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_int64_t) && !defined(__DEFINED_int64_t)
typedef signed _Int64 int64_t;
#define __DEFINED_int64_t
#endif
# 142 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_intmax_t) && !defined(__DEFINED_intmax_t)
typedef signed _Int64 intmax_t;
#define __DEFINED_intmax_t
#endif
# 147 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_uint8_t) && !defined(__DEFINED_uint8_t)
typedef unsigned char uint8_t;
#define __DEFINED_uint8_t
#endif
# 152 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_uint16_t) && !defined(__DEFINED_uint16_t)
typedef unsigned short uint16_t;
#define __DEFINED_uint16_t
#endif
# 157 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_uint32_t) && !defined(__DEFINED_uint32_t)
typedef unsigned int uint32_t;
#define __DEFINED_uint32_t
#endif
# 162 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_uint64_t) && !defined(__DEFINED_uint64_t)
typedef unsigned _Int64 uint64_t;
#define __DEFINED_uint64_t
#endif
# 167 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_u_int64_t) && !defined(__DEFINED_u_int64_t)
typedef unsigned _Int64 u_int64_t;
#define __DEFINED_u_int64_t
#endif
# 172 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_uintmax_t) && !defined(__DEFINED_uintmax_t)
typedef unsigned _Int64 uintmax_t;
#define __DEFINED_uintmax_t
#endif
# 177 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_mode_t) && !defined(__DEFINED_mode_t)
typedef unsigned mode_t;
#define __DEFINED_mode_t
#endif
# 183 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_nlink_t) && !defined(__DEFINED_nlink_t)
typedef unsigned _Reg nlink_t;
#define __DEFINED_nlink_t
#endif
# 188 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_off_t) && !defined(__DEFINED_off_t)
typedef _Int64 off_t;
#define __DEFINED_off_t
#endif
# 193 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_ino_t) && !defined(__DEFINED_ino_t)
typedef unsigned _Int64 ino_t;
#define __DEFINED_ino_t
#endif
# 198 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_dev_t) && !defined(__DEFINED_dev_t)
typedef unsigned _Int64 dev_t;
#define __DEFINED_dev_t
#endif
# 203 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_blksize_t) && !defined(__DEFINED_blksize_t)
typedef long blksize_t;
#define __DEFINED_blksize_t
#endif
# 208 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_blkcnt_t) && !defined(__DEFINED_blkcnt_t)
typedef _Int64 blkcnt_t;
#define __DEFINED_blkcnt_t
#endif
# 213 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_fsblkcnt_t) && !defined(__DEFINED_fsblkcnt_t)
typedef unsigned _Int64 fsblkcnt_t;
#define __DEFINED_fsblkcnt_t
#endif
# 218 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_fsfilcnt_t) && !defined(__DEFINED_fsfilcnt_t)
typedef unsigned _Int64 fsfilcnt_t;
#define __DEFINED_fsfilcnt_t
#endif
# 223 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_wint_t) && !defined(__DEFINED_wint_t)
typedef unsigned wint_t;
#define __DEFINED_wint_t
#endif
# 229 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_wctype_t) && !defined(__DEFINED_wctype_t)
typedef unsigned long wctype_t;
#define __DEFINED_wctype_t
#endif
# 234 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_timer_t) && !defined(__DEFINED_timer_t)
typedef void * timer_t;
#define __DEFINED_timer_t
#endif
# 240 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_clockid_t) && !defined(__DEFINED_clockid_t)
typedef int clockid_t;
#define __DEFINED_clockid_t
#endif
# 245 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_clock_t) && !defined(__DEFINED_clock_t)
typedef long clock_t;
#define __DEFINED_clock_t
#endif
# 250 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_struct_timeval) && !defined(__DEFINED_struct_timeval)
struct timeval { time_t tv_sec; suseconds_t tv_usec; };
#define __DEFINED_struct_timeval
#endif
# 255 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_struct_timespec) && !defined(__DEFINED_struct_timespec)
struct timespec { time_t tv_sec; long tv_nsec; };
#define __DEFINED_struct_timespec
#endif
# 260 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pid_t) && !defined(__DEFINED_pid_t)
typedef int pid_t;
#define __DEFINED_pid_t
#endif
# 266 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_id_t) && !defined(__DEFINED_id_t)
typedef unsigned id_t;
#define __DEFINED_id_t
#endif
# 271 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_uid_t) && !defined(__DEFINED_uid_t)
typedef unsigned uid_t;
#define __DEFINED_uid_t
#endif
# 276 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_gid_t) && !defined(__DEFINED_gid_t)
typedef unsigned gid_t;
#define __DEFINED_gid_t
#endif
# 281 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_key_t) && !defined(__DEFINED_key_t)
typedef int key_t;
#define __DEFINED_key_t
#endif
# 286 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_useconds_t) && !defined(__DEFINED_useconds_t)
typedef unsigned useconds_t;
#define __DEFINED_useconds_t
#endif
# 291 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#ifdef __cplusplus
#if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t)
typedef unsigned long pthread_t;
#define __DEFINED_pthread_t
#endif
# 298 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#else
# 300 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t)
typedef struct __pthread * pthread_t;
#define __DEFINED_pthread_t
#endif
# 304 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#endif
# 306 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_once_t) && !defined(__DEFINED_pthread_once_t)
typedef int pthread_once_t;
#define __DEFINED_pthread_once_t
#endif
# 310 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_key_t) && !defined(__DEFINED_pthread_key_t)
typedef unsigned pthread_key_t;
#define __DEFINED_pthread_key_t
#endif
# 315 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_spinlock_t) && !defined(__DEFINED_pthread_spinlock_t)
typedef int pthread_spinlock_t;
#define __DEFINED_pthread_spinlock_t
#endif
# 320 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_mutexattr_t) && !defined(__DEFINED_pthread_mutexattr_t)
typedef struct { unsigned __attr; } pthread_mutexattr_t;
#define __DEFINED_pthread_mutexattr_t
#endif
# 325 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_condattr_t) && !defined(__DEFINED_pthread_condattr_t)
typedef struct { unsigned __attr; } pthread_condattr_t;
#define __DEFINED_pthread_condattr_t
#endif
# 330 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_barrierattr_t) && !defined(__DEFINED_pthread_barrierattr_t)
typedef struct { unsigned __attr; } pthread_barrierattr_t;
#define __DEFINED_pthread_barrierattr_t
#endif
# 335 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_rwlockattr_t) && !defined(__DEFINED_pthread_rwlockattr_t)
typedef struct { unsigned __attr[2]; } pthread_rwlockattr_t;
#define __DEFINED_pthread_rwlockattr_t
#endif
# 340 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_FILE) && !defined(__DEFINED_FILE)
typedef struct _IO_FILE FILE;
#define __DEFINED_FILE
#endif
# 346 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_mbstate_t) && !defined(__DEFINED_mbstate_t)
typedef struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t;
#define __DEFINED_mbstate_t
#endif
# 352 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_locale_t) && !defined(__DEFINED_locale_t)
typedef struct __locale_struct * locale_t;
#define __DEFINED_locale_t
#endif
# 358 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_sigset_t) && !defined(__DEFINED_sigset_t)
typedef struct __sigset_t { unsigned long __bits[128/sizeof(long)]; } sigset_t;
#define __DEFINED_sigset_t
#endif
# 364 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_struct_iovec) && !defined(__DEFINED_struct_iovec)
struct iovec { void *iov_base; size_t iov_len; };
#define __DEFINED_struct_iovec
#endif
# 370 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_socklen_t) && !defined(__DEFINED_socklen_t)
typedef unsigned socklen_t;
#define __DEFINED_socklen_t
#endif
# 376 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_sa_family_t) && !defined(__DEFINED_sa_family_t)
typedef unsigned short sa_family_t;
#define __DEFINED_sa_family_t
#endif
# 381 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#undef _Addr
#undef _Int64
#undef _Reg
# 24 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/string.h" 2 3
void *memcpy (void *__restrict, const void *__restrict, size_t);
void *memmove (void *, const void *, size_t);
void *memset (void *, int, size_t);
int memcmp (const void *, const void *, size_t);
void *memchr (const void *, int, size_t);
char *strcpy (char *__restrict, const char *__restrict);
char *strncpy (char *__restrict, const char *__restrict, size_t);
char *strcat (char *__restrict, const char *__restrict);
char *strncat (char *__restrict, const char *__restrict, size_t);
int strcmp (const char *, const char *);
int strncmp (const char *, const char *, size_t);
int strcoll (const char *, const char *);
size_t strxfrm (char *__restrict, const char *__restrict, size_t);
char *strchr (const char *, int);
char *strrchr (const char *, int);
size_t strcspn (const char *, const char *);
size_t strspn (const char *, const char *);
char *strpbrk (const char *, const char *);
char *strstr (const char *, const char *);
char *strtok (char *__restrict, const char *__restrict);
size_t strlen (const char *);
char *strerror (int);
#if defined(_BSD_SOURCE) || defined(_GNU_SOURCE)
#if 0 /* expanded by -frewrite-includes */
#include <strings.h>
#endif /* expanded by -frewrite-includes */
# 57 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/string.h" 3
# 1 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/strings.h" 1 3
#ifndef _STRINGS_H
#define _STRINGS_H
#ifdef __cplusplus
extern "C" {
#endif
# 7 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/strings.h" 3
#define __NEED_size_t
#define __NEED_locale_t
#if 0 /* expanded by -frewrite-includes */
#include <bits/alltypes.h>
#endif /* expanded by -frewrite-includes */
# 11 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/strings.h" 3
# 1 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 1 3
#define _Addr long
#define _Int64 long long
#define _Reg long
#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
typedef __builtin_va_list va_list;
#define __DEFINED_va_list
#endif
# 9 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
typedef __builtin_va_list __isoc_va_list;
#define __DEFINED___isoc_va_list
#endif
# 14 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#ifndef __cplusplus
#if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t)
typedef int wchar_t;
#define __DEFINED_wchar_t
#endif
# 21 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#endif
# 23 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_float_t) && !defined(__DEFINED_float_t)
typedef float float_t;
#define __DEFINED_float_t
#endif
# 28 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_double_t) && !defined(__DEFINED_double_t)
typedef double double_t;
#define __DEFINED_double_t
#endif
# 33 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_max_align_t) && !defined(__DEFINED_max_align_t)
typedef struct { long long __ll; long double __ld; } max_align_t;
#define __DEFINED_max_align_t
#endif
# 39 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
typedef long time_t;
#define __DEFINED_time_t
#endif
# 45 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
typedef long suseconds_t;
#define __DEFINED_suseconds_t
#endif
# 50 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
typedef struct { union { int __i[9]; volatile int __vi[9]; unsigned __s[9]; } __u; } pthread_attr_t;
#define __DEFINED_pthread_attr_t
#endif
# 56 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
typedef struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } pthread_mutex_t;
#define __DEFINED_pthread_mutex_t
#endif
# 61 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
typedef struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } mtx_t;
#define __DEFINED_mtx_t
#endif
# 66 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } pthread_cond_t;
#define __DEFINED_pthread_cond_t
#endif
# 71 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } cnd_t;
#define __DEFINED_cnd_t
#endif
# 76 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
typedef struct { union { int __i[8]; volatile int __vi[8]; void *__p[8]; } __u; } pthread_rwlock_t;
#define __DEFINED_pthread_rwlock_t
#endif
# 81 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
typedef struct { union { int __i[5]; volatile int __vi[5]; void *__p[5]; } __u; } pthread_barrier_t;
#define __DEFINED_pthread_barrier_t
#endif
# 86 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_size_t) && !defined(__DEFINED_size_t)
typedef unsigned _Addr size_t;
#define __DEFINED_size_t
#endif
# 91 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_uintptr_t) && !defined(__DEFINED_uintptr_t)
typedef unsigned _Addr uintptr_t;
#define __DEFINED_uintptr_t
#endif
# 96 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_ptrdiff_t) && !defined(__DEFINED_ptrdiff_t)
typedef _Addr ptrdiff_t;
#define __DEFINED_ptrdiff_t
#endif
# 101 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_ssize_t) && !defined(__DEFINED_ssize_t)
typedef _Addr ssize_t;
#define __DEFINED_ssize_t
#endif
# 106 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_intptr_t) && !defined(__DEFINED_intptr_t)
typedef _Addr intptr_t;
#define __DEFINED_intptr_t
#endif
# 111 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_regoff_t) && !defined(__DEFINED_regoff_t)
typedef _Addr regoff_t;
#define __DEFINED_regoff_t
#endif
# 116 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_register_t) && !defined(__DEFINED_register_t)
typedef _Reg register_t;
#define __DEFINED_register_t
#endif
# 121 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_int8_t) && !defined(__DEFINED_int8_t)
typedef signed char int8_t;
#define __DEFINED_int8_t
#endif
# 127 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_int16_t) && !defined(__DEFINED_int16_t)
typedef signed short int16_t;
#define __DEFINED_int16_t
#endif
# 132 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_int32_t) && !defined(__DEFINED_int32_t)
typedef signed int int32_t;
#define __DEFINED_int32_t
#endif
# 137 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_int64_t) && !defined(__DEFINED_int64_t)
typedef signed _Int64 int64_t;
#define __DEFINED_int64_t
#endif
# 142 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_intmax_t) && !defined(__DEFINED_intmax_t)
typedef signed _Int64 intmax_t;
#define __DEFINED_intmax_t
#endif
# 147 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_uint8_t) && !defined(__DEFINED_uint8_t)
typedef unsigned char uint8_t;
#define __DEFINED_uint8_t
#endif
# 152 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_uint16_t) && !defined(__DEFINED_uint16_t)
typedef unsigned short uint16_t;
#define __DEFINED_uint16_t
#endif
# 157 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_uint32_t) && !defined(__DEFINED_uint32_t)
typedef unsigned int uint32_t;
#define __DEFINED_uint32_t
#endif
# 162 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_uint64_t) && !defined(__DEFINED_uint64_t)
typedef unsigned _Int64 uint64_t;
#define __DEFINED_uint64_t
#endif
# 167 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_u_int64_t) && !defined(__DEFINED_u_int64_t)
typedef unsigned _Int64 u_int64_t;
#define __DEFINED_u_int64_t
#endif
# 172 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_uintmax_t) && !defined(__DEFINED_uintmax_t)
typedef unsigned _Int64 uintmax_t;
#define __DEFINED_uintmax_t
#endif
# 177 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_mode_t) && !defined(__DEFINED_mode_t)
typedef unsigned mode_t;
#define __DEFINED_mode_t
#endif
# 183 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_nlink_t) && !defined(__DEFINED_nlink_t)
typedef unsigned _Reg nlink_t;
#define __DEFINED_nlink_t
#endif
# 188 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_off_t) && !defined(__DEFINED_off_t)
typedef _Int64 off_t;
#define __DEFINED_off_t
#endif
# 193 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_ino_t) && !defined(__DEFINED_ino_t)
typedef unsigned _Int64 ino_t;
#define __DEFINED_ino_t
#endif
# 198 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_dev_t) && !defined(__DEFINED_dev_t)
typedef unsigned _Int64 dev_t;
#define __DEFINED_dev_t
#endif
# 203 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_blksize_t) && !defined(__DEFINED_blksize_t)
typedef long blksize_t;
#define __DEFINED_blksize_t
#endif
# 208 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_blkcnt_t) && !defined(__DEFINED_blkcnt_t)
typedef _Int64 blkcnt_t;
#define __DEFINED_blkcnt_t
#endif
# 213 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_fsblkcnt_t) && !defined(__DEFINED_fsblkcnt_t)
typedef unsigned _Int64 fsblkcnt_t;
#define __DEFINED_fsblkcnt_t
#endif
# 218 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_fsfilcnt_t) && !defined(__DEFINED_fsfilcnt_t)
typedef unsigned _Int64 fsfilcnt_t;
#define __DEFINED_fsfilcnt_t
#endif
# 223 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_wint_t) && !defined(__DEFINED_wint_t)
typedef unsigned wint_t;
#define __DEFINED_wint_t
#endif
# 229 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_wctype_t) && !defined(__DEFINED_wctype_t)
typedef unsigned long wctype_t;
#define __DEFINED_wctype_t
#endif
# 234 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_timer_t) && !defined(__DEFINED_timer_t)
typedef void * timer_t;
#define __DEFINED_timer_t
#endif
# 240 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_clockid_t) && !defined(__DEFINED_clockid_t)
typedef int clockid_t;
#define __DEFINED_clockid_t
#endif
# 245 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_clock_t) && !defined(__DEFINED_clock_t)
typedef long clock_t;
#define __DEFINED_clock_t
#endif
# 250 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_struct_timeval) && !defined(__DEFINED_struct_timeval)
struct timeval { time_t tv_sec; suseconds_t tv_usec; };
#define __DEFINED_struct_timeval
#endif
# 255 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_struct_timespec) && !defined(__DEFINED_struct_timespec)
struct timespec { time_t tv_sec; long tv_nsec; };
#define __DEFINED_struct_timespec
#endif
# 260 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pid_t) && !defined(__DEFINED_pid_t)
typedef int pid_t;
#define __DEFINED_pid_t
#endif
# 266 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_id_t) && !defined(__DEFINED_id_t)
typedef unsigned id_t;
#define __DEFINED_id_t
#endif
# 271 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_uid_t) && !defined(__DEFINED_uid_t)
typedef unsigned uid_t;
#define __DEFINED_uid_t
#endif
# 276 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_gid_t) && !defined(__DEFINED_gid_t)
typedef unsigned gid_t;
#define __DEFINED_gid_t
#endif
# 281 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_key_t) && !defined(__DEFINED_key_t)
typedef int key_t;
#define __DEFINED_key_t
#endif
# 286 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_useconds_t) && !defined(__DEFINED_useconds_t)
typedef unsigned useconds_t;
#define __DEFINED_useconds_t
#endif
# 291 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#ifdef __cplusplus
#if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t)
typedef unsigned long pthread_t;
#define __DEFINED_pthread_t
#endif
# 298 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#else
# 300 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t)
typedef struct __pthread * pthread_t;
#define __DEFINED_pthread_t
#endif
# 304 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#endif
# 306 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_once_t) && !defined(__DEFINED_pthread_once_t)
typedef int pthread_once_t;
#define __DEFINED_pthread_once_t
#endif
# 310 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_key_t) && !defined(__DEFINED_pthread_key_t)
typedef unsigned pthread_key_t;
#define __DEFINED_pthread_key_t
#endif
# 315 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_spinlock_t) && !defined(__DEFINED_pthread_spinlock_t)
typedef int pthread_spinlock_t;
#define __DEFINED_pthread_spinlock_t
#endif
# 320 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_mutexattr_t) && !defined(__DEFINED_pthread_mutexattr_t)
typedef struct { unsigned __attr; } pthread_mutexattr_t;
#define __DEFINED_pthread_mutexattr_t
#endif
# 325 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_condattr_t) && !defined(__DEFINED_pthread_condattr_t)
typedef struct { unsigned __attr; } pthread_condattr_t;
#define __DEFINED_pthread_condattr_t
#endif
# 330 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_barrierattr_t) && !defined(__DEFINED_pthread_barrierattr_t)
typedef struct { unsigned __attr; } pthread_barrierattr_t;
#define __DEFINED_pthread_barrierattr_t
#endif
# 335 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_rwlockattr_t) && !defined(__DEFINED_pthread_rwlockattr_t)
typedef struct { unsigned __attr[2]; } pthread_rwlockattr_t;
#define __DEFINED_pthread_rwlockattr_t
#endif
# 340 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_FILE) && !defined(__DEFINED_FILE)
typedef struct _IO_FILE FILE;
#define __DEFINED_FILE
#endif
# 346 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_mbstate_t) && !defined(__DEFINED_mbstate_t)
typedef struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t;
#define __DEFINED_mbstate_t
#endif
# 352 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_locale_t) && !defined(__DEFINED_locale_t)
typedef struct __locale_struct * locale_t;
#define __DEFINED_locale_t
#endif
# 358 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_sigset_t) && !defined(__DEFINED_sigset_t)
typedef struct __sigset_t { unsigned long __bits[128/sizeof(long)]; } sigset_t;
#define __DEFINED_sigset_t
#endif
# 364 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_struct_iovec) && !defined(__DEFINED_struct_iovec)
struct iovec { void *iov_base; size_t iov_len; };
#define __DEFINED_struct_iovec
#endif
# 370 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_socklen_t) && !defined(__DEFINED_socklen_t)
typedef unsigned socklen_t;
#define __DEFINED_socklen_t
#endif
# 376 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_sa_family_t) && !defined(__DEFINED_sa_family_t)
typedef unsigned short sa_family_t;
#define __DEFINED_sa_family_t
#endif
# 381 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#undef _Addr
#undef _Int64
#undef _Reg
# 12 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/strings.h" 2 3
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) || defined(_POSIX_SOURCE) \
|| (defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE+0 < 200809L) \
|| (defined(_XOPEN_SOURCE) && _XOPEN_SOURCE+0 < 700)
int bcmp (const void *, const void *, size_t);
void bcopy (const void *, void *, size_t);
void bzero (void *, size_t);
char *index (const char *, int);
char *rindex (const char *, int);
#endif
# 22 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/strings.h" 3
#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
int ffs (int);
int ffsl (long);
int ffsll (long long);
#endif
# 28 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/strings.h" 3
int strcasecmp (const char *, const char *);
int strncasecmp (const char *, const char *, size_t);
int strcasecmp_l (const char *, const char *, locale_t);
int strncasecmp_l (const char *, const char *, size_t, locale_t);
#ifdef __cplusplus
}
#endif
# 38 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/strings.h" 3
#endif
# 39 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/strings.h" 3
# 58 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/string.h" 2 3
#endif
# 59 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/string.h" 3
#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
|| defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
|| defined(_BSD_SOURCE)
char *strtok_r (char *__restrict, const char *__restrict, char **__restrict);
int strerror_r (int, char *, size_t);
char *stpcpy(char *__restrict, const char *__restrict);
char *stpncpy(char *__restrict, const char *__restrict, size_t);
size_t strnlen (const char *, size_t);
char *strdup (const char *);
char *strndup (const char *, size_t);
char *strsignal(int);
char *strerror_l (int, locale_t);
int strcoll_l (const char *, const char *, locale_t);
size_t strxfrm_l (char *__restrict, const char *__restrict, size_t, locale_t);
#endif
# 75 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/string.h" 3
#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
|| defined(_BSD_SOURCE)
void *memccpy (void *__restrict, const void *__restrict, int, size_t);
#endif
# 80 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/string.h" 3
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
char *strsep(char **, const char *);
size_t strlcat (char *, const char *, size_t);
size_t strlcpy (char *, const char *, size_t);
void explicit_bzero (void *, size_t);
#endif
# 87 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/string.h" 3
#ifdef _GNU_SOURCE
#define strdupa(x) strcpy(alloca(strlen(x)+1),x)
int strverscmp (const char *, const char *);
char *strchrnul(const char *, int);
char *strcasestr(const char *, const char *);
void *memmem(const void *, size_t, const void *, size_t);
void *memrchr(const void *, int, size_t);
void *mempcpy(void *, const void *, size_t);
#ifndef __cplusplus
char *basename();
#endif
# 99 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/string.h" 3
#endif
# 100 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/string.h" 3
#ifdef __cplusplus
}
#endif
# 104 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/string.h" 3
#endif
# 105 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/string.h" 3
# 42 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/os_support.h" 2
#if 0 /* expanded by -frewrite-includes */
#include <stdio.h>
#endif /* expanded by -frewrite-includes */
# 42 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/os_support.h"
# 1 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/stdio.h" 1 3
#ifndef _STDIO_H
#define _STDIO_H
#ifdef __cplusplus
extern "C" {
#endif
# 7 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/stdio.h" 3
#if 0 /* expanded by -frewrite-includes */
#include <features.h>
#endif /* expanded by -frewrite-includes */
# 8 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/stdio.h" 3
# 9 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/stdio.h" 3
#define __NEED_FILE
#define __NEED___isoc_va_list
#define __NEED_size_t
#if __STDC_VERSION__ < 201112L
#define __NEED_struct__IO_FILE
#endif
# 17 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/stdio.h" 3
#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
|| defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
|| defined(_BSD_SOURCE)
#define __NEED_ssize_t
#define __NEED_off_t
#define __NEED_va_list
#endif
# 25 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/stdio.h" 3
#if 0 /* expanded by -frewrite-includes */
#include <bits/alltypes.h>
#endif /* expanded by -frewrite-includes */
# 26 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/stdio.h" 3
# 1 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 1 3
#define _Addr long
#define _Int64 long long
#define _Reg long
#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
typedef __builtin_va_list va_list;
#define __DEFINED_va_list
#endif
# 9 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED___isoc_va_list) && !defined(__DEFINED___isoc_va_list)
typedef __builtin_va_list __isoc_va_list;
#define __DEFINED___isoc_va_list
#endif
# 14 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#ifndef __cplusplus
#if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t)
typedef int wchar_t;
#define __DEFINED_wchar_t
#endif
# 21 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#endif
# 23 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_float_t) && !defined(__DEFINED_float_t)
typedef float float_t;
#define __DEFINED_float_t
#endif
# 28 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_double_t) && !defined(__DEFINED_double_t)
typedef double double_t;
#define __DEFINED_double_t
#endif
# 33 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_max_align_t) && !defined(__DEFINED_max_align_t)
typedef struct { long long __ll; long double __ld; } max_align_t;
#define __DEFINED_max_align_t
#endif
# 39 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_time_t) && !defined(__DEFINED_time_t)
typedef long time_t;
#define __DEFINED_time_t
#endif
# 45 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_suseconds_t) && !defined(__DEFINED_suseconds_t)
typedef long suseconds_t;
#define __DEFINED_suseconds_t
#endif
# 50 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_attr_t) && !defined(__DEFINED_pthread_attr_t)
typedef struct { union { int __i[9]; volatile int __vi[9]; unsigned __s[9]; } __u; } pthread_attr_t;
#define __DEFINED_pthread_attr_t
#endif
# 56 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
typedef struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } pthread_mutex_t;
#define __DEFINED_pthread_mutex_t
#endif
# 61 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
typedef struct { union { int __i[6]; volatile int __vi[6]; volatile void *volatile __p[6]; } __u; } mtx_t;
#define __DEFINED_mtx_t
#endif
# 66 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_cond_t) && !defined(__DEFINED_pthread_cond_t)
typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } pthread_cond_t;
#define __DEFINED_pthread_cond_t
#endif
# 71 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_cnd_t) && !defined(__DEFINED_cnd_t)
typedef struct { union { int __i[12]; volatile int __vi[12]; void *__p[12]; } __u; } cnd_t;
#define __DEFINED_cnd_t
#endif
# 76 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_rwlock_t) && !defined(__DEFINED_pthread_rwlock_t)
typedef struct { union { int __i[8]; volatile int __vi[8]; void *__p[8]; } __u; } pthread_rwlock_t;
#define __DEFINED_pthread_rwlock_t
#endif
# 81 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_barrier_t) && !defined(__DEFINED_pthread_barrier_t)
typedef struct { union { int __i[5]; volatile int __vi[5]; void *__p[5]; } __u; } pthread_barrier_t;
#define __DEFINED_pthread_barrier_t
#endif
# 86 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_size_t) && !defined(__DEFINED_size_t)
typedef unsigned _Addr size_t;
#define __DEFINED_size_t
#endif
# 91 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_uintptr_t) && !defined(__DEFINED_uintptr_t)
typedef unsigned _Addr uintptr_t;
#define __DEFINED_uintptr_t
#endif
# 96 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_ptrdiff_t) && !defined(__DEFINED_ptrdiff_t)
typedef _Addr ptrdiff_t;
#define __DEFINED_ptrdiff_t
#endif
# 101 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_ssize_t) && !defined(__DEFINED_ssize_t)
typedef _Addr ssize_t;
#define __DEFINED_ssize_t
#endif
# 106 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_intptr_t) && !defined(__DEFINED_intptr_t)
typedef _Addr intptr_t;
#define __DEFINED_intptr_t
#endif
# 111 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_regoff_t) && !defined(__DEFINED_regoff_t)
typedef _Addr regoff_t;
#define __DEFINED_regoff_t
#endif
# 116 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_register_t) && !defined(__DEFINED_register_t)
typedef _Reg register_t;
#define __DEFINED_register_t
#endif
# 121 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_int8_t) && !defined(__DEFINED_int8_t)
typedef signed char int8_t;
#define __DEFINED_int8_t
#endif
# 127 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_int16_t) && !defined(__DEFINED_int16_t)
typedef signed short int16_t;
#define __DEFINED_int16_t
#endif
# 132 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_int32_t) && !defined(__DEFINED_int32_t)
typedef signed int int32_t;
#define __DEFINED_int32_t
#endif
# 137 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_int64_t) && !defined(__DEFINED_int64_t)
typedef signed _Int64 int64_t;
#define __DEFINED_int64_t
#endif
# 142 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_intmax_t) && !defined(__DEFINED_intmax_t)
typedef signed _Int64 intmax_t;
#define __DEFINED_intmax_t
#endif
# 147 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_uint8_t) && !defined(__DEFINED_uint8_t)
typedef unsigned char uint8_t;
#define __DEFINED_uint8_t
#endif
# 152 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_uint16_t) && !defined(__DEFINED_uint16_t)
typedef unsigned short uint16_t;
#define __DEFINED_uint16_t
#endif
# 157 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_uint32_t) && !defined(__DEFINED_uint32_t)
typedef unsigned int uint32_t;
#define __DEFINED_uint32_t
#endif
# 162 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_uint64_t) && !defined(__DEFINED_uint64_t)
typedef unsigned _Int64 uint64_t;
#define __DEFINED_uint64_t
#endif
# 167 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_u_int64_t) && !defined(__DEFINED_u_int64_t)
typedef unsigned _Int64 u_int64_t;
#define __DEFINED_u_int64_t
#endif
# 172 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_uintmax_t) && !defined(__DEFINED_uintmax_t)
typedef unsigned _Int64 uintmax_t;
#define __DEFINED_uintmax_t
#endif
# 177 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_mode_t) && !defined(__DEFINED_mode_t)
typedef unsigned mode_t;
#define __DEFINED_mode_t
#endif
# 183 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_nlink_t) && !defined(__DEFINED_nlink_t)
typedef unsigned _Reg nlink_t;
#define __DEFINED_nlink_t
#endif
# 188 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_off_t) && !defined(__DEFINED_off_t)
typedef _Int64 off_t;
#define __DEFINED_off_t
#endif
# 193 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_ino_t) && !defined(__DEFINED_ino_t)
typedef unsigned _Int64 ino_t;
#define __DEFINED_ino_t
#endif
# 198 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_dev_t) && !defined(__DEFINED_dev_t)
typedef unsigned _Int64 dev_t;
#define __DEFINED_dev_t
#endif
# 203 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_blksize_t) && !defined(__DEFINED_blksize_t)
typedef long blksize_t;
#define __DEFINED_blksize_t
#endif
# 208 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_blkcnt_t) && !defined(__DEFINED_blkcnt_t)
typedef _Int64 blkcnt_t;
#define __DEFINED_blkcnt_t
#endif
# 213 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_fsblkcnt_t) && !defined(__DEFINED_fsblkcnt_t)
typedef unsigned _Int64 fsblkcnt_t;
#define __DEFINED_fsblkcnt_t
#endif
# 218 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_fsfilcnt_t) && !defined(__DEFINED_fsfilcnt_t)
typedef unsigned _Int64 fsfilcnt_t;
#define __DEFINED_fsfilcnt_t
#endif
# 223 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_wint_t) && !defined(__DEFINED_wint_t)
typedef unsigned wint_t;
#define __DEFINED_wint_t
#endif
# 229 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_wctype_t) && !defined(__DEFINED_wctype_t)
typedef unsigned long wctype_t;
#define __DEFINED_wctype_t
#endif
# 234 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_timer_t) && !defined(__DEFINED_timer_t)
typedef void * timer_t;
#define __DEFINED_timer_t
#endif
# 240 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_clockid_t) && !defined(__DEFINED_clockid_t)
typedef int clockid_t;
#define __DEFINED_clockid_t
#endif
# 245 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_clock_t) && !defined(__DEFINED_clock_t)
typedef long clock_t;
#define __DEFINED_clock_t
#endif
# 250 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_struct_timeval) && !defined(__DEFINED_struct_timeval)
struct timeval { time_t tv_sec; suseconds_t tv_usec; };
#define __DEFINED_struct_timeval
#endif
# 255 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_struct_timespec) && !defined(__DEFINED_struct_timespec)
struct timespec { time_t tv_sec; long tv_nsec; };
#define __DEFINED_struct_timespec
#endif
# 260 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pid_t) && !defined(__DEFINED_pid_t)
typedef int pid_t;
#define __DEFINED_pid_t
#endif
# 266 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_id_t) && !defined(__DEFINED_id_t)
typedef unsigned id_t;
#define __DEFINED_id_t
#endif
# 271 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_uid_t) && !defined(__DEFINED_uid_t)
typedef unsigned uid_t;
#define __DEFINED_uid_t
#endif
# 276 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_gid_t) && !defined(__DEFINED_gid_t)
typedef unsigned gid_t;
#define __DEFINED_gid_t
#endif
# 281 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_key_t) && !defined(__DEFINED_key_t)
typedef int key_t;
#define __DEFINED_key_t
#endif
# 286 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_useconds_t) && !defined(__DEFINED_useconds_t)
typedef unsigned useconds_t;
#define __DEFINED_useconds_t
#endif
# 291 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#ifdef __cplusplus
#if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t)
typedef unsigned long pthread_t;
#define __DEFINED_pthread_t
#endif
# 298 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#else
# 300 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_t) && !defined(__DEFINED_pthread_t)
typedef struct __pthread * pthread_t;
#define __DEFINED_pthread_t
#endif
# 304 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#endif
# 306 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_once_t) && !defined(__DEFINED_pthread_once_t)
typedef int pthread_once_t;
#define __DEFINED_pthread_once_t
#endif
# 310 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_key_t) && !defined(__DEFINED_pthread_key_t)
typedef unsigned pthread_key_t;
#define __DEFINED_pthread_key_t
#endif
# 315 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_spinlock_t) && !defined(__DEFINED_pthread_spinlock_t)
typedef int pthread_spinlock_t;
#define __DEFINED_pthread_spinlock_t
#endif
# 320 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_mutexattr_t) && !defined(__DEFINED_pthread_mutexattr_t)
typedef struct { unsigned __attr; } pthread_mutexattr_t;
#define __DEFINED_pthread_mutexattr_t
#endif
# 325 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_condattr_t) && !defined(__DEFINED_pthread_condattr_t)
typedef struct { unsigned __attr; } pthread_condattr_t;
#define __DEFINED_pthread_condattr_t
#endif
# 330 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_barrierattr_t) && !defined(__DEFINED_pthread_barrierattr_t)
typedef struct { unsigned __attr; } pthread_barrierattr_t;
#define __DEFINED_pthread_barrierattr_t
#endif
# 335 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_pthread_rwlockattr_t) && !defined(__DEFINED_pthread_rwlockattr_t)
typedef struct { unsigned __attr[2]; } pthread_rwlockattr_t;
#define __DEFINED_pthread_rwlockattr_t
#endif
# 340 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_FILE) && !defined(__DEFINED_FILE)
typedef struct _IO_FILE FILE;
#define __DEFINED_FILE
#endif
# 346 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_mbstate_t) && !defined(__DEFINED_mbstate_t)
typedef struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t;
#define __DEFINED_mbstate_t
#endif
# 352 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_locale_t) && !defined(__DEFINED_locale_t)
typedef struct __locale_struct * locale_t;
#define __DEFINED_locale_t
#endif
# 358 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_sigset_t) && !defined(__DEFINED_sigset_t)
typedef struct __sigset_t { unsigned long __bits[128/sizeof(long)]; } sigset_t;
#define __DEFINED_sigset_t
#endif
# 364 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_struct_iovec) && !defined(__DEFINED_struct_iovec)
struct iovec { void *iov_base; size_t iov_len; };
#define __DEFINED_struct_iovec
#endif
# 370 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_socklen_t) && !defined(__DEFINED_socklen_t)
typedef unsigned socklen_t;
#define __DEFINED_socklen_t
#endif
# 376 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#if defined(__NEED_sa_family_t) && !defined(__DEFINED_sa_family_t)
typedef unsigned short sa_family_t;
#define __DEFINED_sa_family_t
#endif
# 381 "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl/bits/alltypes.h" 3
#undef _Addr
#undef _Int64
#undef _Reg
# 27 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/stdio.h" 2 3
#ifdef __cplusplus
#define NULL 0L
#else
# 31 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/stdio.h" 3
#define NULL ((void*)0)
#endif
# 33 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/stdio.h" 3
#undef EOF
#define EOF (-1)
#undef SEEK_SET
#undef SEEK_CUR
#undef SEEK_END
#define SEEK_SET 0
#define SEEK_CUR 1
#define SEEK_END 2
#define _IOFBF 0
#define _IOLBF 1
#define _IONBF 2
#define BUFSIZ 1024
#define FILENAME_MAX 4096
#define FOPEN_MAX 1000
#define TMP_MAX 10000
#define L_tmpnam 20
typedef union _G_fpos64_t {
char __opaque[16];
long long __lldata;
double __align;
} fpos_t;
extern FILE *const stdin;
extern FILE *const stdout;
extern FILE *const stderr;
#define stdin (stdin)
#define stdout (stdout)
#define stderr (stderr)
FILE *fopen(const char *__restrict, const char *__restrict);
FILE *freopen(const char *__restrict, const char *__restrict, FILE *__restrict);
int fclose(FILE *);
int remove(const char *);
int rename(const char *, const char *);
int feof(FILE *);
int ferror(FILE *);
int fflush(FILE *);
void clearerr(FILE *);
int fseek(FILE *, long, int);
long ftell(FILE *);
void rewind(FILE *);
int fgetpos(FILE *__restrict, fpos_t *__restrict);
int fsetpos(FILE *, const fpos_t *);
size_t fread(void *__restrict, size_t, size_t, FILE *__restrict);
size_t fwrite(const void *__restrict, size_t, size_t, FILE *__restrict);
int fgetc(FILE *);
int getc(FILE *);
int getchar(void);
int ungetc(int, FILE *);
int fputc(int, FILE *);
int putc(int, FILE *);
int putchar(int);
char *fgets(char *__restrict, int, FILE *__restrict);
#if __STDC_VERSION__ < 201112L
char *gets(char *);
#endif
# 103 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/stdio.h" 3
int fputs(const char *__restrict, FILE *__restrict);
int puts(const char *);
int printf(const char *__restrict, ...);
int fprintf(FILE *__restrict, const char *__restrict, ...);
int sprintf(char *__restrict, const char *__restrict, ...);
int snprintf(char *__restrict, size_t, const char *__restrict, ...);
int vprintf(const char *__restrict, __isoc_va_list);
int vfprintf(FILE *__restrict, const char *__restrict, __isoc_va_list);
int vsprintf(char *__restrict, const char *__restrict, __isoc_va_list);
int vsnprintf(char *__restrict, size_t, const char *__restrict, __isoc_va_list);
int scanf(const char *__restrict, ...);
int fscanf(FILE *__restrict, const char *__restrict, ...);
int sscanf(const char *__restrict, const char *__restrict, ...);
int vscanf(const char *__restrict, __isoc_va_list);
int vfscanf(FILE *__restrict, const char *__restrict, __isoc_va_list);
int vsscanf(const char *__restrict, const char *__restrict, __isoc_va_list);
void perror(const char *);
int setvbuf(FILE *__restrict, char *__restrict, int, size_t);
void setbuf(FILE *__restrict, char *__restrict);
char *tmpnam(char *);
FILE *tmpfile(void);
#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
|| defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
|| defined(_BSD_SOURCE)
FILE *fmemopen(void *__restrict, size_t, const char *__restrict);
FILE *open_memstream(char **, size_t *);
FILE *fdopen(int, const char *);
FILE *popen(const char *, const char *);
int pclose(FILE *);
int fileno(FILE *);
int fseeko(FILE *, off_t, int);
off_t ftello(FILE *);
int dprintf(int, const char *__restrict, ...);
int vdprintf(int, const char *__restrict, __isoc_va_list);
void flockfile(FILE *);
int ftrylockfile(FILE *);
void funlockfile(FILE *);
int getc_unlocked(FILE *);
int getchar_unlocked(void);
int putc_unlocked(int, FILE *);
int putchar_unlocked(int);
ssize_t getdelim(char **__restrict, size_t *__restrict, int, FILE *__restrict);
ssize_t getline(char **__restrict, size_t *__restrict, FILE *__restrict);
int renameat(int, const char *, int, const char *);
char *ctermid(char *);
#define L_ctermid 20
#endif
# 158 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/stdio.h" 3
#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
|| defined(_BSD_SOURCE)
#define P_tmpdir "/tmp"
char *tempnam(const char *, const char *);
#endif
# 165 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/stdio.h" 3
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
#define L_cuserid 20
char *cuserid(char *);
void setlinebuf(FILE *);
void setbuffer(FILE *, char *, size_t);
int fgetc_unlocked(FILE *);
int fputc_unlocked(int, FILE *);
int fflush_unlocked(FILE *);
size_t fread_unlocked(void *, size_t, size_t, FILE *);
size_t fwrite_unlocked(const void *, size_t, size_t, FILE *);
void clearerr_unlocked(FILE *);
int feof_unlocked(FILE *);
int ferror_unlocked(FILE *);
int fileno_unlocked(FILE *);
int getw(FILE *);
int putw(int, FILE *);
char *fgetln(FILE *, size_t *);
int asprintf(char **, const char *, ...);
int vasprintf(char **, const char *, __isoc_va_list);
#endif
# 186 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/stdio.h" 3
#ifdef _GNU_SOURCE
char *fgets_unlocked(char *, int, FILE *);
int fputs_unlocked(const char *, FILE *);
typedef ssize_t (cookie_read_function_t)(void *, char *, size_t);
typedef ssize_t (cookie_write_function_t)(void *, const char *, size_t);
typedef int (cookie_seek_function_t)(void *, off_t *, int);
typedef int (cookie_close_function_t)(void *);
typedef struct _IO_cookie_io_functions_t {
cookie_read_function_t *read;
cookie_write_function_t *write;
cookie_seek_function_t *seek;
cookie_close_function_t *close;
} cookie_io_functions_t;
FILE *fopencookie(void *, const char *, cookie_io_functions_t);
#endif
# 205 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/stdio.h" 3
#if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)
#define tmpfile64 tmpfile
#define fopen64 fopen
#define freopen64 freopen
#define fseeko64 fseeko
#define ftello64 ftello
#define fgetpos64 fgetpos
#define fsetpos64 fsetpos
#define fpos64_t fpos_t
#define off64_t off_t
#endif
# 217 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/stdio.h" 3
#ifdef __cplusplus
}
#endif
# 221 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/stdio.h" 3
#endif
# 222 "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl/stdio.h" 3
# 43 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/os_support.h" 2
#if 0 /* expanded by -frewrite-includes */
#include <stdlib.h>
#endif /* expanded by -frewrite-includes */
# 43 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/os_support.h"
# 44 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/os_support.h"
/** Opus wrapper for malloc(). To do your own dynamic allocation, all you need to do is replace this function and opus_free */
#ifndef OVERRIDE_OPUS_ALLOC
static OPUS_INLINE void *opus_alloc (size_t size)
{
return malloc(size);
}
#endif
# 52 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/os_support.h"
/** Same as celt_alloc(), except that the area is only needed inside a CELT call (might cause problem with wideband though) */
#ifndef OVERRIDE_OPUS_ALLOC_SCRATCH
static OPUS_INLINE void *opus_alloc_scratch (size_t size)
{
/* Scratch space doesn't need to be cleared */
return opus_alloc(size);
}
#endif
# 61 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/os_support.h"
/** Opus wrapper for free(). To do your own dynamic allocation, all you need to do is replace this function and opus_alloc */
#ifndef OVERRIDE_OPUS_FREE
static OPUS_INLINE void opus_free (void *ptr)
{
free(ptr);
}
#endif
# 69 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/os_support.h"
/** Copy n elements from src to dst. The 0* term provides compile-time type checking */
#ifndef OVERRIDE_OPUS_COPY
#define OPUS_COPY(dst, src, n) (memcpy((dst), (src), (n)*sizeof(*(dst)) + 0*((dst)-(src)) ))
#endif
# 74 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/os_support.h"
/** Copy n elements from src to dst, allowing overlapping regions. The 0* term
provides compile-time type checking */
#ifndef OVERRIDE_OPUS_MOVE
#define OPUS_MOVE(dst, src, n) (memmove((dst), (src), (n)*sizeof(*(dst)) + 0*((dst)-(src)) ))
#endif
# 80 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/os_support.h"
/** Set n elements of dst to zero */
#ifndef OVERRIDE_OPUS_CLEAR
#define OPUS_CLEAR(dst, n) (memset((dst), 0, (n)*sizeof(*(dst))))
#endif
# 85 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/os_support.h"
/*#ifdef __GNUC__
#pragma GCC poison printf sprintf
#pragma GCC poison malloc free realloc calloc
#endif*/
#endif /* OS_SUPPORT_H */
# 92 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/os_support.h"
# 41 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.c" 2
#if 0 /* expanded by -frewrite-includes */
#include "mathops.h"
#endif /* expanded by -frewrite-includes */
# 41 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.c"
# 1 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/mathops.h" 1
/* Copyright (c) 2002-2008 Jean-Marc Valin
Copyright (c) 2007-2008 CSIRO
Copyright (c) 2007-2009 Xiph.Org Foundation
Written by Jean-Marc Valin */
/**
@file mathops.h
@brief Various math functions
*/
/*
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef MATHOPS_H
#define MATHOPS_H
#if 0 /* expanded by -frewrite-includes */
#include "arch.h"
#endif /* expanded by -frewrite-includes */
# 37 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/mathops.h"
# 38 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/mathops.h"
#if 0 /* expanded by -frewrite-includes */
#include "entcode.h"
#endif /* expanded by -frewrite-includes */
# 38 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/mathops.h"
# 1 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/entcode.h" 1
/* Copyright (c) 2001-2011 Timothy B. Terriberry
Copyright (c) 2008-2009 Xiph.Org Foundation */
/*
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#if 0 /* expanded by -frewrite-includes */
#include "opus_types.h"
#endif /* expanded by -frewrite-includes */
# 28 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/entcode.h"
# 29 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/entcode.h"
#if 0 /* expanded by -frewrite-includes */
#include "opus_defines.h"
#endif /* expanded by -frewrite-includes */
# 29 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/entcode.h"
# 30 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/entcode.h"
#if !defined(_entcode_H)
# define _entcode_H (1)
#if 0 /* expanded by -frewrite-includes */
# include <limits.h>
#endif /* expanded by -frewrite-includes */
# 33 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/entcode.h"
# 34 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/entcode.h"
#if 0 /* expanded by -frewrite-includes */
# include <stddef.h>
#endif /* expanded by -frewrite-includes */
# 34 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/entcode.h"
# 35 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/entcode.h"
#if 0 /* expanded by -frewrite-includes */
# include "ecintrin.h"
#endif /* expanded by -frewrite-includes */
# 35 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/entcode.h"
# 36 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/entcode.h"
extern const opus_uint32 SMALL_DIV_TABLE[129];
#ifdef OPUS_ARM_ASM
#define USE_SMALL_DIV_TABLE
#endif
# 42 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/entcode.h"
/*OPT: ec_window must be at least 32 bits, but if you have fast arithmetic on a
larger type, you can speed up the decoder by using it here.*/
typedef opus_uint32 ec_window;
typedef struct ec_ctx ec_ctx;
typedef struct ec_ctx ec_enc;
typedef struct ec_ctx ec_dec;
# define EC_WINDOW_SIZE ((int)sizeof(ec_window)*CHAR_BIT)
/*The number of bits to use for the range-coded part of unsigned integers.*/
# define EC_UINT_BITS (8)
/*The resolution of fractional-precision bit usage measurements, i.e.,
3 => 1/8th bits.*/
# define BITRES 3
/*The entropy encoder/decoder context.
We use the same structure for both, so that common functions like ec_tell()
can be used on either one.*/
struct ec_ctx{
/*Buffered input/output.*/
unsigned char *buf;
/*The size of the buffer.*/
opus_uint32 storage;
/*The offset at which the last byte containing raw bits was read/written.*/
opus_uint32 end_offs;
/*Bits that will be read from/written at the end.*/
ec_window end_window;
/*Number of valid bits in end_window.*/
int nend_bits;
/*The total number of whole bits read/written.
This does not include partial bits currently in the range coder.*/
int nbits_total;
/*The offset at which the next range coder byte will be read/written.*/
opus_uint32 offs;
/*The number of values in the current range.*/
opus_uint32 rng;
/*In the decoder: the difference between the top of the current range and
the input value, minus one.
In the encoder: the low end of the current range.*/
opus_uint32 val;
/*In the decoder: the saved normalization factor from ec_decode().
In the encoder: the number of oustanding carry propagating symbols.*/
opus_uint32 ext;
/*A buffered input/output symbol, awaiting carry propagation.*/
int rem;
/*Nonzero if an error occurred.*/
int error;
};
static OPUS_INLINE opus_uint32 ec_range_bytes(ec_ctx *_this){
return _this->offs;
}
static OPUS_INLINE unsigned char *ec_get_buffer(ec_ctx *_this){
return _this->buf;
}
static OPUS_INLINE int ec_get_error(ec_ctx *_this){
return _this->error;
}
/*Returns the number of bits "used" by the encoded or decoded symbols so far.
This same number can be computed in either the encoder or the decoder, and is
suitable for making coding decisions.
Return: The number of bits.
This will always be slightly larger than the exact value (e.g., all
rounding error is in the positive direction).*/
static OPUS_INLINE int ec_tell(ec_ctx *_this){
return _this->nbits_total-EC_ILOG(_this->rng);
}
/*Returns the number of bits "used" by the encoded or decoded symbols so far.
This same number can be computed in either the encoder or the decoder, and is
suitable for making coding decisions.
Return: The number of bits scaled by 2**BITRES.
This will always be slightly larger than the exact value (e.g., all
rounding error is in the positive direction).*/
opus_uint32 ec_tell_frac(ec_ctx *_this);
/* Tested exhaustively for all n and for 1<=d<=256 */
static OPUS_INLINE opus_uint32 celt_udiv(opus_uint32 n, opus_uint32 d) {
celt_sig_assert(d>0);
#ifdef USE_SMALL_DIV_TABLE
if (d>256)
return n/d;
else {
opus_uint32 t, q;
t = EC_ILOG(d&-d);
q = (opus_uint64)SMALL_DIV_TABLE[d>>t]*(n>>(t-1))>>32;
return q+(n-q*d >= d);
}
#else
# 136 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/entcode.h"
return n/d;
#endif
# 138 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/entcode.h"
}
static OPUS_INLINE opus_int32 celt_sudiv(opus_int32 n, opus_int32 d) {
celt_sig_assert(d>0);
#ifdef USE_SMALL_DIV_TABLE
if (n<0)
return -(opus_int32)celt_udiv(-n, d);
else
return celt_udiv(n, d);
#else
# 148 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/entcode.h"
return n/d;
#endif
# 150 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/entcode.h"
}
#endif
# 153 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/entcode.h"
# 39 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/mathops.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "os_support.h"
#endif /* expanded by -frewrite-includes */
# 39 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/mathops.h"
# 40 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/mathops.h"
#define PI 3.141592653f
/* Multiplies two 16-bit fractional values. Bit-exactness of this macro is important */
#define FRAC_MUL16(a,b) ((16384+((opus_int32)(opus_int16)(a)*(opus_int16)(b)))>>15)
unsigned isqrt32(opus_uint32 _val);
/* CELT doesn't need it for fixed-point, by analysis.c does. */
#if !defined(FIXED_POINT) || defined(ANALYSIS_C)
#define cA 0.43157974f
#define cB 0.67848403f
#define cC 0.08595542f
#define cE ((float)PI/2)
static OPUS_INLINE float fast_atan2f(float y, float x) {
float x2, y2;
x2 = x*x;
y2 = y*y;
/* For very small values, we don't care about the answer, so
we can just return 0. */
if (x2 + y2 < 1e-18f)
{
return 0;
}
if(x2<y2){
float den = (y2 + cB*x2) * (y2 + cC*x2);
return -x*y*(y2 + cA*x2) / den + (y<0 ? -cE : cE);
}else{
float den = (x2 + cB*y2) * (x2 + cC*y2);
return x*y*(x2 + cA*y2) / den + (y<0 ? -cE : cE) - (x*y<0 ? -cE : cE);
}
}
#undef cA
#undef cB
#undef cC
#undef cE
#endif
# 77 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/mathops.h"
#ifndef OVERRIDE_CELT_MAXABS16
static OPUS_INLINE opus_val32 celt_maxabs16(const opus_val16 *x, int len)
{
int i;
opus_val16 maxval = 0;
opus_val16 minval = 0;
for (i=0;i<len;i++)
{
maxval = MAX16(maxval, x[i]);
minval = MIN16(minval, x[i]);
}
return MAX32(EXTEND32(maxval),-EXTEND32(minval));
}
#endif
# 93 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/mathops.h"
#ifndef OVERRIDE_CELT_MAXABS32
#ifdef FIXED_POINT
static OPUS_INLINE opus_val32 celt_maxabs32(const opus_val32 *x, int len)
{
int i;
opus_val32 maxval = 0;
opus_val32 minval = 0;
for (i=0;i<len;i++)
{
maxval = MAX32(maxval, x[i]);
minval = MIN32(minval, x[i]);
}
return MAX32(maxval, -minval);
}
#else
# 109 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/mathops.h"
#define celt_maxabs32(x,len) celt_maxabs16(x,len)
#endif
# 111 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/mathops.h"
#endif
# 112 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/mathops.h"
#ifndef FIXED_POINT
#define celt_sqrt(x) ((float)sqrt(x))
#define celt_rsqrt(x) (1.f/celt_sqrt(x))
#define celt_rsqrt_norm(x) (celt_rsqrt(x))
#define celt_cos_norm(x) ((float)cos((.5f*PI)*(x)))
#define celt_rcp(x) (1.f/(x))
#define celt_div(a,b) ((a)/(b))
#define frac_div32(a,b) ((float)(a)/(b))
#ifdef FLOAT_APPROX
/* Note: This assumes radix-2 floating point with the exponent at bits 23..30 and an offset of 127
denorm, +/- inf and NaN are *not* handled */
/** Base-2 log approximation (log2(x)). */
static OPUS_INLINE float celt_log2(float x)
{
int integer;
float frac;
union {
float f;
opus_uint32 i;
} in;
in.f = x;
integer = (in.i>>23)-127;
in.i -= integer<<23;
frac = in.f - 1.5f;
frac = -0.41445418f + frac*(0.95909232f
+ frac*(-0.33951290f + frac*0.16541097f));
return 1+integer+frac;
}
/** Base-2 exponential approximation (2^x). */
static OPUS_INLINE float celt_exp2(float x)
{
int integer;
float frac;
union {
float f;
opus_uint32 i;
} res;
integer = floor(x);
if (integer < -50)
return 0;
frac = x-integer;
/* K0 = 1, K1 = log(2), K2 = 3-4*log(2), K3 = 3*log(2) - 2 */
res.f = 0.99992522f + frac * (0.69583354f
+ frac * (0.22606716f + 0.078024523f*frac));
res.i = (res.i + (integer<<23)) & 0x7fffffff;
return res.f;
}
#else
# 168 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/mathops.h"
#define celt_log2(x) ((float)(1.442695040888963387*log(x)))
#define celt_exp2(x) ((float)exp(0.6931471805599453094*(x)))
#endif
# 171 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/mathops.h"
#endif
# 173 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/mathops.h"
#ifdef FIXED_POINT
#if 0 /* expanded by -frewrite-includes */
#include "os_support.h"
#endif /* expanded by -frewrite-includes */
# 176 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/mathops.h"
# 177 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/mathops.h"
#ifndef OVERRIDE_CELT_ILOG2
/** Integer log in base2. Undefined for zero and negative numbers */
static OPUS_INLINE opus_int16 celt_ilog2(opus_int32 x)
{
celt_sig_assert(x>0);
return EC_ILOG(x)-1;
}
#endif
# 186 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/mathops.h"
/** Integer log in base2. Defined for zero, but not for negative numbers */
static OPUS_INLINE opus_int16 celt_zlog2(opus_val32 x)
{
return x <= 0 ? 0 : celt_ilog2(x);
}
opus_val16 celt_rsqrt_norm(opus_val32 x);
opus_val32 celt_sqrt(opus_val32 x);
opus_val16 celt_cos_norm(opus_val32 x);
/** Base-2 logarithm approximation (log2(x)). (Q14 input, Q10 output) */
static OPUS_INLINE opus_val16 celt_log2(opus_val32 x)
{
int i;
opus_val16 n, frac;
/* -0.41509302963303146, 0.9609890551383969, -0.31836011537636605,
0.15530808010959576, -0.08556153059057618 */
static const opus_val16 C[5] = {-6801+(1<<(13-DB_SHIFT)), 15746, -5217, 2545, -1401};
if (x==0)
return -32767;
i = celt_ilog2(x);
n = VSHR32(x,i-15)-32768-16384;
frac = ADD16(C[0], MULT16_16_Q15(n, ADD16(C[1], MULT16_16_Q15(n, ADD16(C[2], MULT16_16_Q15(n, ADD16(C[3], MULT16_16_Q15(n, C[4]))))))));
return SHL16(i-13,DB_SHIFT)+SHR16(frac,14-DB_SHIFT);
}
/*
K0 = 1
K1 = log(2)
K2 = 3-4*log(2)
K3 = 3*log(2) - 2
*/
#define D0 16383
#define D1 22804
#define D2 14819
#define D3 10204
static OPUS_INLINE opus_val32 celt_exp2_frac(opus_val16 x)
{
opus_val16 frac;
frac = SHL16(x, 4);
return ADD16(D0, MULT16_16_Q15(frac, ADD16(D1, MULT16_16_Q15(frac, ADD16(D2 , MULT16_16_Q15(D3,frac))))));
}
/** Base-2 exponential approximation (2^x). (Q10 input, Q16 output) */
static OPUS_INLINE opus_val32 celt_exp2(opus_val16 x)
{
int integer;
opus_val16 frac;
integer = SHR16(x,10);
if (integer>14)
return 0x7f000000;
else if (integer < -15)
return 0;
frac = celt_exp2_frac(x-SHL16(integer,10));
return VSHR32(EXTEND32(frac), -integer-2);
}
opus_val32 celt_rcp(opus_val32 x);
#define celt_div(a,b) MULT32_32_Q31((opus_val32)(a),celt_rcp(b))
opus_val32 frac_div32(opus_val32 a, opus_val32 b);
#define M1 32767
#define M2 -21
#define M3 -11943
#define M4 4936
/* Atan approximation using a 4th order polynomial. Input is in Q15 format
and normalized by pi/4. Output is in Q15 format */
static OPUS_INLINE opus_val16 celt_atan01(opus_val16 x)
{
return MULT16_16_P15(x, ADD32(M1, MULT16_16_P15(x, ADD32(M2, MULT16_16_P15(x, ADD32(M3, MULT16_16_P15(M4, x)))))));
}
#undef M1
#undef M2
#undef M3
#undef M4
/* atan2() approximation valid for positive input values */
static OPUS_INLINE opus_val16 celt_atan2p(opus_val16 y, opus_val16 x)
{
if (y < x)
{
opus_val32 arg;
arg = celt_div(SHL32(EXTEND32(y),15),x);
if (arg >= 32767)
arg = 32767;
return SHR16(celt_atan01(EXTRACT16(arg)),1);
} else {
opus_val32 arg;
arg = celt_div(SHL32(EXTEND32(x),15),y);
if (arg >= 32767)
arg = 32767;
return 25736-SHR16(celt_atan01(EXTRACT16(arg)),1);
}
}
#endif /* FIXED_POINT */
# 290 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/mathops.h"
#endif /* MATHOPS_H */
# 291 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/mathops.h"
# 42 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.c" 2
#if 0 /* expanded by -frewrite-includes */
#include "rate.h"
#endif /* expanded by -frewrite-includes */
# 42 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.c"
# 43 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.c"
#if 0 /* expanded by -frewrite-includes */
#include "quant_bands.h"
#endif /* expanded by -frewrite-includes */
# 43 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.c"
# 1 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/quant_bands.h" 1
/* Copyright (c) 2007-2008 CSIRO
Copyright (c) 2007-2009 Xiph.Org Foundation
Written by Jean-Marc Valin */
/*
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef QUANT_BANDS
#define QUANT_BANDS
#if 0 /* expanded by -frewrite-includes */
#include "arch.h"
#endif /* expanded by -frewrite-includes */
# 32 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/quant_bands.h"
# 33 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/quant_bands.h"
#if 0 /* expanded by -frewrite-includes */
#include "modes.h"
#endif /* expanded by -frewrite-includes */
# 33 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/quant_bands.h"
# 34 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/quant_bands.h"
#if 0 /* expanded by -frewrite-includes */
#include "entenc.h"
#endif /* expanded by -frewrite-includes */
# 34 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/quant_bands.h"
# 35 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/quant_bands.h"
#if 0 /* expanded by -frewrite-includes */
#include "entdec.h"
#endif /* expanded by -frewrite-includes */
# 35 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/quant_bands.h"
# 36 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/quant_bands.h"
#if 0 /* expanded by -frewrite-includes */
#include "mathops.h"
#endif /* expanded by -frewrite-includes */
# 36 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/quant_bands.h"
# 37 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/quant_bands.h"
#ifdef FIXED_POINT
extern const signed char eMeans[25];
#else
# 41 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/quant_bands.h"
extern const opus_val16 eMeans[25];
#endif
# 43 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/quant_bands.h"
void amp2Log2(const CELTMode *m, int effEnd, int end,
celt_ener *bandE, opus_val16 *bandLogE, int C);
void log2Amp(const CELTMode *m, int start, int end,
celt_ener *eBands, const opus_val16 *oldEBands, int C);
void quant_coarse_energy(const CELTMode *m, int start, int end, int effEnd,
const opus_val16 *eBands, opus_val16 *oldEBands, opus_uint32 budget,
opus_val16 *error, ec_enc *enc, int C, int LM,
int nbAvailableBytes, int force_intra, opus_val32 *delayedIntra,
int two_pass, int loss_rate, int lfe);
void quant_fine_energy(const CELTMode *m, int start, int end, opus_val16 *oldEBands, opus_val16 *error, int *fine_quant, ec_enc *enc, int C);
void quant_energy_finalise(const CELTMode *m, int start, int end, opus_val16 *oldEBands, opus_val16 *error, int *fine_quant, int *fine_priority, int bits_left, ec_enc *enc, int C);
void unquant_coarse_energy(const CELTMode *m, int start, int end, opus_val16 *oldEBands, int intra, ec_dec *dec, int C, int LM);
void unquant_fine_energy(const CELTMode *m, int start, int end, opus_val16 *oldEBands, int *fine_quant, ec_dec *dec, int C);
void unquant_energy_finalise(const CELTMode *m, int start, int end, opus_val16 *oldEBands, int *fine_quant, int *fine_priority, int bits_left, ec_dec *dec, int C);
#endif /* QUANT_BANDS */
# 67 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/quant_bands.h"
# 44 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.c" 2
#if 0 /* expanded by -frewrite-includes */
#include "pitch.h"
#endif /* expanded by -frewrite-includes */
# 44 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.c"
# 1 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/pitch.h" 1
/* Copyright (c) 2007-2008 CSIRO
Copyright (c) 2007-2009 Xiph.Org Foundation
Written by Jean-Marc Valin */
/**
@file pitch.h
@brief Pitch analysis
*/
/*
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef PITCH_H
#define PITCH_H
#if 0 /* expanded by -frewrite-includes */
#include "modes.h"
#endif /* expanded by -frewrite-includes */
# 37 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/pitch.h"
# 38 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/pitch.h"
#if 0 /* expanded by -frewrite-includes */
#include "cpu_support.h"
#endif /* expanded by -frewrite-includes */
# 38 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/pitch.h"
# 39 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/pitch.h"
#if (defined(OPUS_X86_MAY_HAVE_SSE) && !defined(FIXED_POINT)) \
|| ((defined(OPUS_X86_MAY_HAVE_SSE4_1) || defined(OPUS_X86_MAY_HAVE_SSE2)) && defined(FIXED_POINT))
#if 0 /* expanded by -frewrite-includes */
#include "x86/pitch_sse.h"
#endif /* expanded by -frewrite-includes */
# 42 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/pitch.h"
# 43 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/pitch.h"
#endif
# 44 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/pitch.h"
#if defined(MIPSr1_ASM)
#if 0 /* expanded by -frewrite-includes */
#include "mips/pitch_mipsr1.h"
#endif /* expanded by -frewrite-includes */
# 46 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/pitch.h"
# 47 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/pitch.h"
#endif
# 48 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/pitch.h"
#if (defined(OPUS_ARM_ASM) || defined(OPUS_ARM_MAY_HAVE_NEON_INTR))
#if 0 /* expanded by -frewrite-includes */
# include "arm/pitch_arm.h"
#endif /* expanded by -frewrite-includes */
# 50 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/pitch.h"
# 51 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/pitch.h"
#endif
# 52 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/pitch.h"
void pitch_downsample(celt_sig * OPUS_RESTRICT x[], opus_val16 * OPUS_RESTRICT x_lp,
int len, int C, int arch);
void pitch_search(const opus_val16 * OPUS_RESTRICT x_lp, opus_val16 * OPUS_RESTRICT y,
int len, int max_pitch, int *pitch, int arch);
opus_val16 remove_doubling(opus_val16 *x, int maxperiod, int minperiod,
int N, int *T0, int prev_period, opus_val16 prev_gain, int arch);
/* OPT: This is the kernel you really want to optimize. It gets used a lot
by the prefilter and by the PLC. */
static OPUS_INLINE void xcorr_kernel_c(const opus_val16 * x, const opus_val16 * y, opus_val32 sum[4], int len)
{
int j;
opus_val16 y_0, y_1, y_2, y_3;
celt_assert(len>=3);
y_3=0; /* gcc doesn't realize that y_3 can't be used uninitialized */
y_0=*y++;
y_1=*y++;
y_2=*y++;
for (j=0;j<len-3;j+=4)
{
opus_val16 tmp;
tmp = *x++;
y_3=*y++;
sum[0] = MAC16_16(sum[0],tmp,y_0);
sum[1] = MAC16_16(sum[1],tmp,y_1);
sum[2] = MAC16_16(sum[2],tmp,y_2);
sum[3] = MAC16_16(sum[3],tmp,y_3);
tmp=*x++;
y_0=*y++;
sum[0] = MAC16_16(sum[0],tmp,y_1);
sum[1] = MAC16_16(sum[1],tmp,y_2);
sum[2] = MAC16_16(sum[2],tmp,y_3);
sum[3] = MAC16_16(sum[3],tmp,y_0);
tmp=*x++;
y_1=*y++;
sum[0] = MAC16_16(sum[0],tmp,y_2);
sum[1] = MAC16_16(sum[1],tmp,y_3);
sum[2] = MAC16_16(sum[2],tmp,y_0);
sum[3] = MAC16_16(sum[3],tmp,y_1);
tmp=*x++;
y_2=*y++;
sum[0] = MAC16_16(sum[0],tmp,y_3);
sum[1] = MAC16_16(sum[1],tmp,y_0);
sum[2] = MAC16_16(sum[2],tmp,y_1);
sum[3] = MAC16_16(sum[3],tmp,y_2);
}
if (j++<len)
{
opus_val16 tmp = *x++;
y_3=*y++;
sum[0] = MAC16_16(sum[0],tmp,y_0);
sum[1] = MAC16_16(sum[1],tmp,y_1);
sum[2] = MAC16_16(sum[2],tmp,y_2);
sum[3] = MAC16_16(sum[3],tmp,y_3);
}
if (j++<len)
{
opus_val16 tmp=*x++;
y_0=*y++;
sum[0] = MAC16_16(sum[0],tmp,y_1);
sum[1] = MAC16_16(sum[1],tmp,y_2);
sum[2] = MAC16_16(sum[2],tmp,y_3);
sum[3] = MAC16_16(sum[3],tmp,y_0);
}
if (j<len)
{
opus_val16 tmp=*x++;
y_1=*y++;
sum[0] = MAC16_16(sum[0],tmp,y_2);
sum[1] = MAC16_16(sum[1],tmp,y_3);
sum[2] = MAC16_16(sum[2],tmp,y_0);
sum[3] = MAC16_16(sum[3],tmp,y_1);
}
}
#ifndef OVERRIDE_XCORR_KERNEL
#define xcorr_kernel(x, y, sum, len, arch) \
((void)(arch),xcorr_kernel_c(x, y, sum, len))
#endif /* OVERRIDE_XCORR_KERNEL */
# 135 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/pitch.h"
static OPUS_INLINE void dual_inner_prod_c(const opus_val16 *x, const opus_val16 *y01, const opus_val16 *y02,
int N, opus_val32 *xy1, opus_val32 *xy2)
{
int i;
opus_val32 xy01=0;
opus_val32 xy02=0;
for (i=0;i<N;i++)
{
xy01 = MAC16_16(xy01, x[i], y01[i]);
xy02 = MAC16_16(xy02, x[i], y02[i]);
}
*xy1 = xy01;
*xy2 = xy02;
}
#ifndef OVERRIDE_DUAL_INNER_PROD
# define dual_inner_prod(x, y01, y02, N, xy1, xy2, arch) \
((void)(arch),dual_inner_prod_c(x, y01, y02, N, xy1, xy2))
#endif
# 156 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/pitch.h"
/*We make sure a C version is always available for cases where the overhead of
vectorization and passing around an arch flag aren't worth it.*/
static OPUS_INLINE opus_val32 celt_inner_prod_c(const opus_val16 *x,
const opus_val16 *y, int N)
{
int i;
opus_val32 xy=0;
for (i=0;i<N;i++)
xy = MAC16_16(xy, x[i], y[i]);
return xy;
}
#if !defined(OVERRIDE_CELT_INNER_PROD)
# define celt_inner_prod(x, y, N, arch) \
((void)(arch),celt_inner_prod_c(x, y, N))
#endif
# 173 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/pitch.h"
#ifdef NON_STATIC_COMB_FILTER_CONST_C
void comb_filter_const_c(opus_val32 *y, opus_val32 *x, int T, int N,
opus_val16 g10, opus_val16 g11, opus_val16 g12);
#endif
# 178 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/pitch.h"
#ifdef FIXED_POINT
opus_val32
#else
# 183 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/pitch.h"
void
#endif
# 185 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/pitch.h"
celt_pitch_xcorr_c(const opus_val16 *_x, const opus_val16 *_y,
opus_val32 *xcorr, int len, int max_pitch, int arch);
#ifndef OVERRIDE_PITCH_XCORR
# define celt_pitch_xcorr celt_pitch_xcorr_c
#endif
# 191 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/pitch.h"
#endif
# 193 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/pitch.h"
# 45 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.c" 2
int hysteresis_decision(opus_val16 val, const opus_val16 *thresholds, const opus_val16 *hysteresis, int N, int prev)
{
int i;
for (i=0;i<N;i++)
{
if (val < thresholds[i])
break;
}
if (i>prev && val < thresholds[prev]+hysteresis[prev])
i=prev;
if (i<prev && val > thresholds[prev-1]-hysteresis[prev-1])
i=prev;
return i;
}
opus_uint32 celt_lcg_rand(opus_uint32 seed)
{
return 1664525 * seed + 1013904223;
}
/* This is a cos() approximation designed to be bit-exact on any platform. Bit exactness
with this approximation is important because it has an impact on the bit allocation */
opus_int16 bitexact_cos(opus_int16 x)
{
opus_int32 tmp;
opus_int16 x2;
tmp = (4096+((opus_int32)(x)*(x)))>>13;
celt_sig_assert(tmp<=32767);
x2 = tmp;
x2 = (32767-x2) + FRAC_MUL16(x2, (-7651 + FRAC_MUL16(x2, (8277 + FRAC_MUL16(-626, x2)))));
celt_sig_assert(x2<=32766);
return 1+x2;
}
int bitexact_log2tan(int isin,int icos)
{
int lc;
int ls;
lc=EC_ILOG(icos);
ls=EC_ILOG(isin);
icos<<=15-lc;
isin<<=15-ls;
return (ls-lc)*(1<<11)
+FRAC_MUL16(isin, FRAC_MUL16(isin, -2597) + 7932)
-FRAC_MUL16(icos, FRAC_MUL16(icos, -2597) + 7932);
}
#ifdef FIXED_POINT
/* Compute the amplitude (sqrt energy) in each of the bands */
void compute_band_energies(const CELTMode *m, const celt_sig *X, celt_ener *bandE, int end, int C, int LM, int arch)
{
int i, c, N;
const opus_int16 *eBands = m->eBands;
(void)arch;
N = m->shortMdctSize<<LM;
c=0; do {
for (i=0;i<end;i++)
{
int j;
opus_val32 maxval=0;
opus_val32 sum = 0;
maxval = celt_maxabs32(&X[c*N+(eBands[i]<<LM)], (eBands[i+1]-eBands[i])<<LM);
if (maxval > 0)
{
int shift = celt_ilog2(maxval) - 14 + (((m->logN[i]>>BITRES)+LM+1)>>1);
j=eBands[i]<<LM;
if (shift>0)
{
do {
sum = MAC16_16(sum, EXTRACT16(SHR32(X[j+c*N],shift)),
EXTRACT16(SHR32(X[j+c*N],shift)));
} while (++j<eBands[i+1]<<LM);
} else {
do {
sum = MAC16_16(sum, EXTRACT16(SHL32(X[j+c*N],-shift)),
EXTRACT16(SHL32(X[j+c*N],-shift)));
} while (++j<eBands[i+1]<<LM);
}
/* We're adding one here to ensure the normalized band isn't larger than unity norm */
bandE[i+c*m->nbEBands] = EPSILON+VSHR32(EXTEND32(celt_sqrt(sum)),-shift);
} else {
bandE[i+c*m->nbEBands] = EPSILON;
}
/*printf ("%f ", bandE[i+c*m->nbEBands]);*/
}
} while (++c<C);
/*printf ("\n");*/
}
/* Normalise each band such that the energy is one. */
void normalise_bands(const CELTMode *m, const celt_sig * OPUS_RESTRICT freq, celt_norm * OPUS_RESTRICT X, const celt_ener *bandE, int end, int C, int M)
{
int i, c, N;
const opus_int16 *eBands = m->eBands;
N = M*m->shortMdctSize;
c=0; do {
i=0; do {
opus_val16 g;
int j,shift;
opus_val16 E;
shift = celt_zlog2(bandE[i+c*m->nbEBands])-13;
E = VSHR32(bandE[i+c*m->nbEBands], shift);
g = EXTRACT16(celt_rcp(SHL32(E,3)));
j=M*eBands[i]; do {
X[j+c*N] = MULT16_16_Q15(VSHR32(freq[j+c*N],shift-1),g);
} while (++j<M*eBands[i+1]);
} while (++i<end);
} while (++c<C);
}
#else /* FIXED_POINT */
# 158 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.c"
/* Compute the amplitude (sqrt energy) in each of the bands */
void compute_band_energies(const CELTMode *m, const celt_sig *X, celt_ener *bandE, int end, int C, int LM, int arch)
{
int i, c, N;
const opus_int16 *eBands = m->eBands;
N = m->shortMdctSize<<LM;
c=0; do {
for (i=0;i<end;i++)
{
opus_val32 sum;
sum = 1e-27f + celt_inner_prod(&X[c*N+(eBands[i]<<LM)], &X[c*N+(eBands[i]<<LM)], (eBands[i+1]-eBands[i])<<LM, arch);
bandE[i+c*m->nbEBands] = celt_sqrt(sum);
/*printf ("%f ", bandE[i+c*m->nbEBands]);*/
}
} while (++c<C);
/*printf ("\n");*/
}
/* Normalise each band such that the energy is one. */
void normalise_bands(const CELTMode *m, const celt_sig * OPUS_RESTRICT freq, celt_norm * OPUS_RESTRICT X, const celt_ener *bandE, int end, int C, int M)
{
int i, c, N;
const opus_int16 *eBands = m->eBands;
N = M*m->shortMdctSize;
c=0; do {
for (i=0;i<end;i++)
{
int j;
opus_val16 g = 1.f/(1e-27f+bandE[i+c*m->nbEBands]);
for (j=M*eBands[i];j<M*eBands[i+1];j++)
X[j+c*N] = freq[j+c*N]*g;
}
} while (++c<C);
}
#endif /* FIXED_POINT */
# 194 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.c"
/* De-normalise the energy to produce the synthesis from the unit-energy bands */
void denormalise_bands(const CELTMode *m, const celt_norm * OPUS_RESTRICT X,
celt_sig * OPUS_RESTRICT freq, const opus_val16 *bandLogE, int start,
int end, int M, int downsample, int silence)
{
int i, N;
int bound;
celt_sig * OPUS_RESTRICT f;
const celt_norm * OPUS_RESTRICT x;
const opus_int16 *eBands = m->eBands;
N = M*m->shortMdctSize;
bound = M*eBands[end];
if (downsample!=1)
bound = IMIN(bound, N/downsample);
if (silence)
{
bound = 0;
start = end = 0;
}
f = freq;
x = X+M*eBands[start];
for (i=0;i<M*eBands[start];i++)
*f++ = 0;
for (i=start;i<end;i++)
{
int j, band_end;
opus_val16 g;
opus_val16 lg;
#ifdef FIXED_POINT
int shift;
#endif
# 226 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.c"
j=M*eBands[i];
band_end = M*eBands[i+1];
lg = SATURATE16(ADD32(bandLogE[i], SHL32((opus_val32)eMeans[i],6)));
#ifndef FIXED_POINT
g = celt_exp2(MIN32(32.f, lg));
#else
# 232 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.c"
/* Handle the integer part of the log energy */
shift = 16-(lg>>DB_SHIFT);
if (shift>31)
{
shift=0;
g=0;
} else {
/* Handle the fractional part. */
g = celt_exp2_frac(lg&((1<<DB_SHIFT)-1));
}
/* Handle extreme gains with negative shift. */
if (shift<0)
{
/* For shift <= -2 and g > 16384 we'd be likely to overflow, so we're
capping the gain here, which is equivalent to a cap of 18 on lg.
This shouldn't trigger unless the bitstream is already corrupted. */
if (shift <= -2)
{
g = 16384;
shift = -2;
}
do {
*f++ = SHL32(MULT16_16(*x++, g), -shift);
} while (++j<band_end);
} else
#endif
# 258 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.c"
/* Be careful of the fixed-point "else" just above when changing this code */
do {
*f++ = SHR32(MULT16_16(*x++, g), shift);
} while (++j<band_end);
}
celt_assert(start <= end);
OPUS_CLEAR(&freq[bound], N-bound);
}
/* This prevents energy collapse for transients with multiple short MDCTs */
void anti_collapse(const CELTMode *m, celt_norm *X_, unsigned char *collapse_masks, int LM, int C, int size,
int start, int end, const opus_val16 *logE, const opus_val16 *prev1logE,
const opus_val16 *prev2logE, const int *pulses, opus_uint32 seed, int arch)
{
int c, i, j, k;
for (i=start;i<end;i++)
{
int N0;
opus_val16 thresh, sqrt_1;
int depth;
#ifdef FIXED_POINT
int shift;
opus_val32 thresh32;
#endif
# 282 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.c"
N0 = m->eBands[i+1]-m->eBands[i];
/* depth in 1/8 bits */
celt_sig_assert(pulses[i]>=0);
depth = celt_udiv(1+pulses[i], (m->eBands[i+1]-m->eBands[i]))>>LM;
#ifdef FIXED_POINT
thresh32 = SHR32(celt_exp2(-SHL16(depth, 10-BITRES)),1);
thresh = MULT16_32_Q15(QCONST16(0.5f, 15), MIN32(32767,thresh32));
{
opus_val32 t;
t = N0<<LM;
shift = celt_ilog2(t)>>1;
t = SHL32(t, (7-shift)<<1);
sqrt_1 = celt_rsqrt_norm(t);
}
#else
# 299 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.c"
thresh = .5f*celt_exp2(-.125f*depth);
sqrt_1 = celt_rsqrt(N0<<LM);
#endif
# 302 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.c"
c=0; do
{
celt_norm *X;
opus_val16 prev1;
opus_val16 prev2;
opus_val32 Ediff;
opus_val16 r;
int renormalize=0;
prev1 = prev1logE[c*m->nbEBands+i];
prev2 = prev2logE[c*m->nbEBands+i];
if (C==1)
{
prev1 = MAX16(prev1,prev1logE[m->nbEBands+i]);
prev2 = MAX16(prev2,prev2logE[m->nbEBands+i]);
}
Ediff = EXTEND32(logE[c*m->nbEBands+i])-EXTEND32(MIN16(prev1,prev2));
Ediff = MAX32(0, Ediff);
#ifdef FIXED_POINT
if (Ediff < 16384)
{
opus_val32 r32 = SHR32(celt_exp2(-EXTRACT16(Ediff)),1);
r = 2*MIN16(16383,r32);
} else {
r = 0;
}
if (LM==3)
r = MULT16_16_Q14(23170, MIN32(23169, r));
r = SHR16(MIN16(thresh, r),1);
r = SHR32(MULT16_16_Q15(sqrt_1, r),shift);
#else
# 334 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.c"
/* r needs to be multiplied by 2 or 2*sqrt(2) depending on LM because
short blocks don't have the same energy as long */
r = 2.f*celt_exp2(-Ediff);
if (LM==3)
r *= 1.41421356f;
r = MIN16(thresh, r);
r = r*sqrt_1;
#endif
# 342 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.c"
X = X_+c*size+(m->eBands[i]<<LM);
for (k=0;k<1<<LM;k++)
{
/* Detect collapse */
if (!(collapse_masks[i*C+c]&1<<k))
{
/* Fill with noise */
for (j=0;j<N0;j++)
{
seed = celt_lcg_rand(seed);
X[(j<<LM)+k] = (seed&0x8000 ? r : -r);
}
renormalize = 1;
}
}
/* We just added some energy, so we need to renormalise */
if (renormalize)
renormalise_vector(X, N0<<LM, Q15ONE, arch);
} while (++c<C);
}
}
/* Compute the weights to use for optimizing normalized distortion across
channels. We use the amplitude to weight square distortion, which means
that we use the square root of the value we would have been using if we
wanted to minimize the MSE in the non-normalized domain. This roughly
corresponds to some quick-and-dirty perceptual experiments I ran to
measure inter-aural masking (there doesn't seem to be any published data
on the topic). */
static void compute_channel_weights(celt_ener Ex, celt_ener Ey, opus_val16 w[2])
{
celt_ener minE;
#ifdef FIXED_POINT
int shift;
#endif
# 377 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.c"
minE = MIN32(Ex, Ey);
/* Adjustment to make the weights a bit more conservative. */
Ex = ADD32(Ex, minE/3);
Ey = ADD32(Ey, minE/3);
#ifdef FIXED_POINT
shift = celt_ilog2(EPSILON+MAX32(Ex, Ey))-14;
#endif
# 384 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.c"
w[0] = VSHR32(Ex, shift);
w[1] = VSHR32(Ey, shift);
}
static void intensity_stereo(const CELTMode *m, celt_norm * OPUS_RESTRICT X, const celt_norm * OPUS_RESTRICT Y, const celt_ener *bandE, int bandID, int N)
{
int i = bandID;
int j;
opus_val16 a1, a2;
opus_val16 left, right;
opus_val16 norm;
#ifdef FIXED_POINT
int shift = celt_zlog2(MAX32(bandE[i], bandE[i+m->nbEBands]))-13;
#endif
# 398 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.c"
left = VSHR32(bandE[i],shift);
right = VSHR32(bandE[i+m->nbEBands],shift);
norm = EPSILON + celt_sqrt(EPSILON+MULT16_16(left,left)+MULT16_16(right,right));
a1 = DIV32_16(SHL32(EXTEND32(left),14),norm);
a2 = DIV32_16(SHL32(EXTEND32(right),14),norm);
for (j=0;j<N;j++)
{
celt_norm r, l;
l = X[j];
r = Y[j];
X[j] = EXTRACT16(SHR32(MAC16_16(MULT16_16(a1, l), a2, r), 14));
/* Side is not encoded, no need to calculate */
}
}
static void stereo_split(celt_norm * OPUS_RESTRICT X, celt_norm * OPUS_RESTRICT Y, int N)
{
int j;
for (j=0;j<N;j++)
{
opus_val32 r, l;
l = MULT16_16(QCONST16(.70710678f, 15), X[j]);
r = MULT16_16(QCONST16(.70710678f, 15), Y[j]);
X[j] = EXTRACT16(SHR32(ADD32(l, r), 15));
Y[j] = EXTRACT16(SHR32(SUB32(r, l), 15));
}
}
static void stereo_merge(celt_norm * OPUS_RESTRICT X, celt_norm * OPUS_RESTRICT Y, opus_val16 mid, int N, int arch)
{
int j;
opus_val32 xp=0, side=0;
opus_val32 El, Er;
opus_val16 mid2;
#ifdef FIXED_POINT
int kl, kr;
#endif
# 435 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.c"
opus_val32 t, lgain, rgain;
/* Compute the norm of X+Y and X-Y as |X|^2 + |Y|^2 +/- sum(xy) */
dual_inner_prod(Y, X, Y, N, &xp, &side, arch);
/* Compensating for the mid normalization */
xp = MULT16_32_Q15(mid, xp);
/* mid and side are in Q15, not Q14 like X and Y */
mid2 = SHR16(mid, 1);
El = MULT16_16(mid2, mid2) + side - 2*xp;
Er = MULT16_16(mid2, mid2) + side + 2*xp;
if (Er < QCONST32(6e-4f, 28) || El < QCONST32(6e-4f, 28))
{
OPUS_COPY(Y, X, N);
return;
}
#ifdef FIXED_POINT
kl = celt_ilog2(El)>>1;
kr = celt_ilog2(Er)>>1;
#endif
# 455 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.c"
t = VSHR32(El, (kl-7)<<1);
lgain = celt_rsqrt_norm(t);
t = VSHR32(Er, (kr-7)<<1);
rgain = celt_rsqrt_norm(t);
#ifdef FIXED_POINT
if (kl < 7)
kl = 7;
if (kr < 7)
kr = 7;
#endif
# 466 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.c"
for (j=0;j<N;j++)
{
celt_norm r, l;
/* Apply mid scaling (side is already scaled) */
l = MULT16_16_P15(mid, X[j]);
r = Y[j];
X[j] = EXTRACT16(PSHR32(MULT16_16(lgain, SUB16(l,r)), kl+1));
Y[j] = EXTRACT16(PSHR32(MULT16_16(rgain, ADD16(l,r)), kr+1));
}
}
/* Decide whether we should spread the pulses in the current frame */
int spreading_decision(const CELTMode *m, const celt_norm *X, int *average,
int last_decision, int *hf_average, int *tapset_decision, int update_hf,
int end, int C, int M, const int *spread_weight)
{
int i, c, N0;
int sum = 0, nbBands=0;
const opus_int16 * OPUS_RESTRICT eBands = m->eBands;
int decision;
int hf_sum=0;
celt_assert(end>0);
N0 = M*m->shortMdctSize;
if (M*(eBands[end]-eBands[end-1]) <= 8)
return SPREAD_NONE;
c=0; do {
for (i=0;i<end;i++)
{
int j, N, tmp=0;
int tcount[3] = {0,0,0};
const celt_norm * OPUS_RESTRICT x = X+M*eBands[i]+c*N0;
N = M*(eBands[i+1]-eBands[i]);
if (N<=8)
continue;
/* Compute rough CDF of |x[j]| */
for (j=0;j<N;j++)
{
opus_val32 x2N; /* Q13 */
x2N = MULT16_16(MULT16_16_Q15(x[j], x[j]), N);
if (x2N < QCONST16(0.25f,13))
tcount[0]++;
if (x2N < QCONST16(0.0625f,13))
tcount[1]++;
if (x2N < QCONST16(0.015625f,13))
tcount[2]++;
}
/* Only include four last bands (8 kHz and up) */
if (i>m->nbEBands-4)
hf_sum += celt_udiv(32*(tcount[1]+tcount[0]), N);
tmp = (2*tcount[2] >= N) + (2*tcount[1] >= N) + (2*tcount[0] >= N);
sum += tmp*spread_weight[i];
nbBands+=spread_weight[i];
}
} while (++c<C);
if (update_hf)
{
if (hf_sum)
hf_sum = celt_udiv(hf_sum, C*(4-m->nbEBands+end));
*hf_average = (*hf_average+hf_sum)>>1;
hf_sum = *hf_average;
if (*tapset_decision==2)
hf_sum += 4;
else if (*tapset_decision==0)
hf_sum -= 4;
if (hf_sum > 22)
*tapset_decision=2;
else if (hf_sum > 18)
*tapset_decision=1;
else
*tapset_decision=0;
}
/*printf("%d %d %d\n", hf_sum, *hf_average, *tapset_decision);*/
celt_assert(nbBands>0); /* end has to be non-zero */
celt_assert(sum>=0);
sum = celt_udiv((opus_int32)sum<<8, nbBands);
/* Recursive averaging */
sum = (sum+*average)>>1;
*average = sum;
/* Hysteresis */
sum = (3*sum + (((3-last_decision)<<7) + 64) + 2)>>2;
if (sum < 80)
{
decision = SPREAD_AGGRESSIVE;
} else if (sum < 256)
{
decision = SPREAD_NORMAL;
} else if (sum < 384)
{
decision = SPREAD_LIGHT;
} else {
decision = SPREAD_NONE;
}
#ifdef FUZZING
decision = rand()&0x3;
*tapset_decision=rand()%3;
#endif
# 569 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.c"
return decision;
}
/* Indexing table for converting from natural Hadamard to ordery Hadamard
This is essentially a bit-reversed Gray, on top of which we've added
an inversion of the order because we want the DC at the end rather than
the beginning. The lines are for N=2, 4, 8, 16 */
static const int ordery_table[] = {
1, 0,
3, 0, 2, 1,
7, 0, 4, 3, 6, 1, 5, 2,
15, 0, 8, 7, 12, 3, 11, 4, 14, 1, 9, 6, 13, 2, 10, 5,
};
static void deinterleave_hadamard(celt_norm *X, int N0, int stride, int hadamard)
{
int i,j;
VARDECL(celt_norm, tmp);
int N;
SAVE_STACK;
N = N0*stride;
ALLOC(tmp, N, celt_norm);
celt_assert(stride>0);
if (hadamard)
{
const int *ordery = ordery_table+stride-2;
for (i=0;i<stride;i++)
{
for (j=0;j<N0;j++)
tmp[ordery[i]*N0+j] = X[j*stride+i];
}
} else {
for (i=0;i<stride;i++)
for (j=0;j<N0;j++)
tmp[i*N0+j] = X[j*stride+i];
}
OPUS_COPY(X, tmp, N);
RESTORE_STACK;
}
static void interleave_hadamard(celt_norm *X, int N0, int stride, int hadamard)
{
int i,j;
VARDECL(celt_norm, tmp);
int N;
SAVE_STACK;
N = N0*stride;
ALLOC(tmp, N, celt_norm);
if (hadamard)
{
const int *ordery = ordery_table+stride-2;
for (i=0;i<stride;i++)
for (j=0;j<N0;j++)
tmp[j*stride+i] = X[ordery[i]*N0+j];
} else {
for (i=0;i<stride;i++)
for (j=0;j<N0;j++)
tmp[j*stride+i] = X[i*N0+j];
}
OPUS_COPY(X, tmp, N);
RESTORE_STACK;
}
void haar1(celt_norm *X, int N0, int stride)
{
int i, j;
N0 >>= 1;
for (i=0;i<stride;i++)
for (j=0;j<N0;j++)
{
opus_val32 tmp1, tmp2;
tmp1 = MULT16_16(QCONST16(.70710678f,15), X[stride*2*j+i]);
tmp2 = MULT16_16(QCONST16(.70710678f,15), X[stride*(2*j+1)+i]);
X[stride*2*j+i] = EXTRACT16(PSHR32(ADD32(tmp1, tmp2), 15));
X[stride*(2*j+1)+i] = EXTRACT16(PSHR32(SUB32(tmp1, tmp2), 15));
}
}
static int compute_qn(int N, int b, int offset, int pulse_cap, int stereo)
{
static const opus_int16 exp2_table8[8] =
{16384, 17866, 19483, 21247, 23170, 25267, 27554, 30048};
int qn, qb;
int N2 = 2*N-1;
if (stereo && N==2)
N2--;
/* The upper limit ensures that in a stereo split with itheta==16384, we'll
always have enough bits left over to code at least one pulse in the
side; otherwise it would collapse, since it doesn't get folded. */
qb = celt_sudiv(b+N2*offset, N2);
qb = IMIN(b-pulse_cap-(4<<BITRES), qb);
qb = IMIN(8<<BITRES, qb);
if (qb<(1<<BITRES>>1)) {
qn = 1;
} else {
qn = exp2_table8[qb&0x7]>>(14-(qb>>BITRES));
qn = (qn+1)>>1<<1;
}
celt_assert(qn <= 256);
return qn;
}
struct band_ctx {
int encode;
int resynth;
const CELTMode *m;
int i;
int intensity;
int spread;
int tf_change;
ec_ctx *ec;
opus_int32 remaining_bits;
const celt_ener *bandE;
opus_uint32 seed;
int arch;
int theta_round;
int disable_inv;
int avoid_split_noise;
};
struct split_ctx {
int inv;
int imid;
int iside;
int delta;
int itheta;
int qalloc;
};
static void compute_theta(struct band_ctx *ctx, struct split_ctx *sctx,
celt_norm *X, celt_norm *Y, int N, int *b, int B, int B0,
int LM,
int stereo, int *fill)
{
int qn;
int itheta=0;
int delta;
int imid, iside;
int qalloc;
int pulse_cap;
int offset;
opus_int32 tell;
int inv=0;
int encode;
const CELTMode *m;
int i;
int intensity;
ec_ctx *ec;
const celt_ener *bandE;
encode = ctx->encode;
m = ctx->m;
i = ctx->i;
intensity = ctx->intensity;
ec = ctx->ec;
bandE = ctx->bandE;
/* Decide on the resolution to give to the split parameter theta */
pulse_cap = m->logN[i]+LM*(1<<BITRES);
offset = (pulse_cap>>1) - (stereo&&N==2 ? QTHETA_OFFSET_TWOPHASE : QTHETA_OFFSET);
qn = compute_qn(N, *b, offset, pulse_cap, stereo);
if (stereo && i>=intensity)
qn = 1;
if (encode)
{
/* theta is the atan() of the ratio between the (normalized)
side and mid. With just that parameter, we can re-scale both
mid and side because we know that 1) they have unit norm and
2) they are orthogonal. */
itheta = stereo_itheta(X, Y, stereo, N, ctx->arch);
}
tell = ec_tell_frac(ec);
if (qn!=1)
{
if (encode)
{
if (!stereo || ctx->theta_round == 0)
{
itheta = (itheta*(opus_int32)qn+8192)>>14;
if (!stereo && ctx->avoid_split_noise && itheta > 0 && itheta < qn)
{
/* Check if the selected value of theta will cause the bit allocation
to inject noise on one side. If so, make sure the energy of that side
is zero. */
int unquantized = celt_udiv((opus_int32)itheta*16384, qn);
imid = bitexact_cos((opus_int16)unquantized);
iside = bitexact_cos((opus_int16)(16384-unquantized));
delta = FRAC_MUL16((N-1)<<7,bitexact_log2tan(iside,imid));
if (delta > *b)
itheta = qn;
else if (delta < -*b)
itheta = 0;
}
} else {
int down;
/* Bias quantization towards itheta=0 and itheta=16384. */
int bias = itheta > 8192 ? 32767/qn : -32767/qn;
down = IMIN(qn-1, IMAX(0, (itheta*(opus_int32)qn + bias)>>14));
if (ctx->theta_round < 0)
itheta = down;
else
itheta = down+1;
}
}
/* Entropy coding of the angle. We use a uniform pdf for the
time split, a step for stereo, and a triangular one for the rest. */
if (stereo && N>2)
{
int p0 = 3;
int x = itheta;
int x0 = qn/2;
int ft = p0*(x0+1) + x0;
/* Use a probability of p0 up to itheta=8192 and then use 1 after */
if (encode)
{
ec_encode(ec,x<=x0?p0*x:(x-1-x0)+(x0+1)*p0,x<=x0?p0*(x+1):(x-x0)+(x0+1)*p0,ft);
} else {
int fs;
fs=ec_decode(ec,ft);
if (fs<(x0+1)*p0)
x=fs/p0;
else
x=x0+1+(fs-(x0+1)*p0);
ec_dec_update(ec,x<=x0?p0*x:(x-1-x0)+(x0+1)*p0,x<=x0?p0*(x+1):(x-x0)+(x0+1)*p0,ft);
itheta = x;
}
} else if (B0>1 || stereo) {
/* Uniform pdf */
if (encode)
ec_enc_uint(ec, itheta, qn+1);
else
itheta = ec_dec_uint(ec, qn+1);
} else {
int fs=1, ft;
ft = ((qn>>1)+1)*((qn>>1)+1);
if (encode)
{
int fl;
fs = itheta <= (qn>>1) ? itheta + 1 : qn + 1 - itheta;
fl = itheta <= (qn>>1) ? itheta*(itheta + 1)>>1 :
ft - ((qn + 1 - itheta)*(qn + 2 - itheta)>>1);
ec_encode(ec, fl, fl+fs, ft);
} else {
/* Triangular pdf */
int fl=0;
int fm;
fm = ec_decode(ec, ft);
if (fm < ((qn>>1)*((qn>>1) + 1)>>1))
{
itheta = (isqrt32(8*(opus_uint32)fm + 1) - 1)>>1;
fs = itheta + 1;
fl = itheta*(itheta + 1)>>1;
}
else
{
itheta = (2*(qn + 1)
- isqrt32(8*(opus_uint32)(ft - fm - 1) + 1))>>1;
fs = qn + 1 - itheta;
fl = ft - ((qn + 1 - itheta)*(qn + 2 - itheta)>>1);
}
ec_dec_update(ec, fl, fl+fs, ft);
}
}
celt_assert(itheta>=0);
itheta = celt_udiv((opus_int32)itheta*16384, qn);
if (encode && stereo)
{
if (itheta==0)
intensity_stereo(m, X, Y, bandE, i, N);
else
stereo_split(X, Y, N);
}
/* NOTE: Renormalising X and Y *may* help fixed-point a bit at very high rate.
Let's do that at higher complexity */
} else if (stereo) {
if (encode)
{
inv = itheta > 8192 && !ctx->disable_inv;
if (inv)
{
int j;
for (j=0;j<N;j++)
Y[j] = -Y[j];
}
intensity_stereo(m, X, Y, bandE, i, N);
}
if (*b>2<<BITRES && ctx->remaining_bits > 2<<BITRES)
{
if (encode)
ec_enc_bit_logp(ec, inv, 2);
else
inv = ec_dec_bit_logp(ec, 2);
} else
inv = 0;
/* inv flag override to avoid problems with downmixing. */
if (ctx->disable_inv)
inv = 0;
itheta = 0;
}
qalloc = ec_tell_frac(ec) - tell;
*b -= qalloc;
if (itheta == 0)
{
imid = 32767;
iside = 0;
*fill &= (1<<B)-1;
delta = -16384;
} else if (itheta == 16384)
{
imid = 0;
iside = 32767;
*fill &= ((1<<B)-1)<<B;
delta = 16384;
} else {
imid = bitexact_cos((opus_int16)itheta);
iside = bitexact_cos((opus_int16)(16384-itheta));
/* This is the mid vs side allocation that minimizes squared error
in that band. */
delta = FRAC_MUL16((N-1)<<7,bitexact_log2tan(iside,imid));
}
sctx->inv = inv;
sctx->imid = imid;
sctx->iside = iside;
sctx->delta = delta;
sctx->itheta = itheta;
sctx->qalloc = qalloc;
}
static unsigned quant_band_n1(struct band_ctx *ctx, celt_norm *X, celt_norm *Y, int b,
celt_norm *lowband_out)
{
int c;
int stereo;
celt_norm *x = X;
int encode;
ec_ctx *ec;
encode = ctx->encode;
ec = ctx->ec;
stereo = Y != NULL;
c=0; do {
int sign=0;
if (ctx->remaining_bits>=1<<BITRES)
{
if (encode)
{
sign = x[0]<0;
ec_enc_bits(ec, sign, 1);
} else {
sign = ec_dec_bits(ec, 1);
}
ctx->remaining_bits -= 1<<BITRES;
b-=1<<BITRES;
}
if (ctx->resynth)
x[0] = sign ? -NORM_SCALING : NORM_SCALING;
x = Y;
} while (++c<1+stereo);
if (lowband_out)
lowband_out[0] = SHR16(X[0],4);
return 1;
}
/* This function is responsible for encoding and decoding a mono partition.
It can split the band in two and transmit the energy difference with
the two half-bands. It can be called recursively so bands can end up being
split in 8 parts. */
static unsigned quant_partition(struct band_ctx *ctx, celt_norm *X,
int N, int b, int B, celt_norm *lowband,
int LM,
opus_val16 gain, int fill)
{
const unsigned char *cache;
int q;
int curr_bits;
int imid=0, iside=0;
int B0=B;
opus_val16 mid=0, side=0;
unsigned cm=0;
celt_norm *Y=NULL;
int encode;
const CELTMode *m;
int i;
int spread;
ec_ctx *ec;
encode = ctx->encode;
m = ctx->m;
i = ctx->i;
spread = ctx->spread;
ec = ctx->ec;
/* If we need 1.5 more bit than we can produce, split the band in two. */
cache = m->cache.bits + m->cache.index[(LM+1)*m->nbEBands+i];
if (LM != -1 && b > cache[cache[0]]+12 && N>2)
{
int mbits, sbits, delta;
int itheta;
int qalloc;
struct split_ctx sctx;
celt_norm *next_lowband2=NULL;
opus_int32 rebalance;
N >>= 1;
Y = X+N;
LM -= 1;
if (B==1)
fill = (fill&1)|(fill<<1);
B = (B+1)>>1;
compute_theta(ctx, &sctx, X, Y, N, &b, B, B0, LM, 0, &fill);
imid = sctx.imid;
iside = sctx.iside;
delta = sctx.delta;
itheta = sctx.itheta;
qalloc = sctx.qalloc;
#ifdef FIXED_POINT
mid = imid;
side = iside;
#else
# 997 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.c"
mid = (1.f/32768)*imid;
side = (1.f/32768)*iside;
#endif
# 1000 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.c"
/* Give more bits to low-energy MDCTs than they would otherwise deserve */
if (B0>1 && (itheta&0x3fff))
{
if (itheta > 8192)
/* Rough approximation for pre-echo masking */
delta -= delta>>(4-LM);
else
/* Corresponds to a forward-masking slope of 1.5 dB per 10 ms */
delta = IMIN(0, delta + (N<<BITRES>>(5-LM)));
}
mbits = IMAX(0, IMIN(b, (b-delta)/2));
sbits = b-mbits;
ctx->remaining_bits -= qalloc;
if (lowband)
next_lowband2 = lowband+N; /* >32-bit split case */
rebalance = ctx->remaining_bits;
if (mbits >= sbits)
{
cm = quant_partition(ctx, X, N, mbits, B, lowband, LM,
MULT16_16_P15(gain,mid), fill);
rebalance = mbits - (rebalance-ctx->remaining_bits);
if (rebalance > 3<<BITRES && itheta!=0)
sbits += rebalance - (3<<BITRES);
cm |= quant_partition(ctx, Y, N, sbits, B, next_lowband2, LM,
MULT16_16_P15(gain,side), fill>>B)<<(B0>>1);
} else {
cm = quant_partition(ctx, Y, N, sbits, B, next_lowband2, LM,
MULT16_16_P15(gain,side), fill>>B)<<(B0>>1);
rebalance = sbits - (rebalance-ctx->remaining_bits);
if (rebalance > 3<<BITRES && itheta!=16384)
mbits += rebalance - (3<<BITRES);
cm |= quant_partition(ctx, X, N, mbits, B, lowband, LM,
MULT16_16_P15(gain,mid), fill);
}
} else {
/* This is the basic no-split case */
q = bits2pulses(m, i, LM, b);
curr_bits = pulses2bits(m, i, LM, q);
ctx->remaining_bits -= curr_bits;
/* Ensures we can never bust the budget */
while (ctx->remaining_bits < 0 && q > 0)
{
ctx->remaining_bits += curr_bits;
q--;
curr_bits = pulses2bits(m, i, LM, q);
ctx->remaining_bits -= curr_bits;
}
if (q!=0)
{
int K = get_pulses(q);
/* Finally do the actual quantization */
if (encode)
{
cm = alg_quant(X, N, K, spread, B, ec, gain, ctx->resynth, ctx->arch);
} else {
cm = alg_unquant(X, N, K, spread, B, ec, gain);
}
} else {
/* If there's no pulse, fill the band anyway */
int j;
if (ctx->resynth)
{
unsigned cm_mask;
/* B can be as large as 16, so this shift might overflow an int on a
16-bit platform; use a long to get defined behavior.*/
cm_mask = (unsigned)(1UL<<B)-1;
fill &= cm_mask;
if (!fill)
{
OPUS_CLEAR(X, N);
} else {
if (lowband == NULL)
{
/* Noise */
for (j=0;j<N;j++)
{
ctx->seed = celt_lcg_rand(ctx->seed);
X[j] = (celt_norm)((opus_int32)ctx->seed>>20);
}
cm = cm_mask;
} else {
/* Folded spectrum */
for (j=0;j<N;j++)
{
opus_val16 tmp;
ctx->seed = celt_lcg_rand(ctx->seed);
/* About 48 dB below the "normal" folding level */
tmp = QCONST16(1.0f/256, 10);
tmp = (ctx->seed)&0x8000 ? tmp : -tmp;
X[j] = lowband[j]+tmp;
}
cm = fill;
}
renormalise_vector(X, N, gain, ctx->arch);
}
}
}
}
return cm;
}
/* This function is responsible for encoding and decoding a band for the mono case. */
static unsigned quant_band(struct band_ctx *ctx, celt_norm *X,
int N, int b, int B, celt_norm *lowband,
int LM, celt_norm *lowband_out,
opus_val16 gain, celt_norm *lowband_scratch, int fill)
{
int N0=N;
int N_B=N;
int N_B0;
int B0=B;
int time_divide=0;
int recombine=0;
int longBlocks;
unsigned cm=0;
int k;
int encode;
int tf_change;
encode = ctx->encode;
tf_change = ctx->tf_change;
longBlocks = B0==1;
N_B = celt_udiv(N_B, B);
/* Special case for one sample */
if (N==1)
{
return quant_band_n1(ctx, X, NULL, b, lowband_out);
}
if (tf_change>0)
recombine = tf_change;
/* Band recombining to increase frequency resolution */
if (lowband_scratch && lowband && (recombine || ((N_B&1) == 0 && tf_change<0) || B0>1))
{
OPUS_COPY(lowband_scratch, lowband, N);
lowband = lowband_scratch;
}
for (k=0;k<recombine;k++)
{
static const unsigned char bit_interleave_table[16]={
0,1,1,1,2,3,3,3,2,3,3,3,2,3,3,3
};
if (encode)
haar1(X, N>>k, 1<<k);
if (lowband)
haar1(lowband, N>>k, 1<<k);
fill = bit_interleave_table[fill&0xF]|bit_interleave_table[fill>>4]<<2;
}
B>>=recombine;
N_B<<=recombine;
/* Increasing the time resolution */
while ((N_B&1) == 0 && tf_change<0)
{
if (encode)
haar1(X, N_B, B);
if (lowband)
haar1(lowband, N_B, B);
fill |= fill<<B;
B <<= 1;
N_B >>= 1;
time_divide++;
tf_change++;
}
B0=B;
N_B0 = N_B;
/* Reorganize the samples in time order instead of frequency order */
if (B0>1)
{
if (encode)
deinterleave_hadamard(X, N_B>>recombine, B0<<recombine, longBlocks);
if (lowband)
deinterleave_hadamard(lowband, N_B>>recombine, B0<<recombine, longBlocks);
}
cm = quant_partition(ctx, X, N, b, B, lowband, LM, gain, fill);
/* This code is used by the decoder and by the resynthesis-enabled encoder */
if (ctx->resynth)
{
/* Undo the sample reorganization going from time order to frequency order */
if (B0>1)
interleave_hadamard(X, N_B>>recombine, B0<<recombine, longBlocks);
/* Undo time-freq changes that we did earlier */
N_B = N_B0;
B = B0;
for (k=0;k<time_divide;k++)
{
B >>= 1;
N_B <<= 1;
cm |= cm>>B;
haar1(X, N_B, B);
}
for (k=0;k<recombine;k++)
{
static const unsigned char bit_deinterleave_table[16]={
0x00,0x03,0x0C,0x0F,0x30,0x33,0x3C,0x3F,
0xC0,0xC3,0xCC,0xCF,0xF0,0xF3,0xFC,0xFF
};
cm = bit_deinterleave_table[cm];
haar1(X, N0>>k, 1<<k);
}
B<<=recombine;
/* Scale output for later folding */
if (lowband_out)
{
int j;
opus_val16 n;
n = celt_sqrt(SHL32(EXTEND32(N0),22));
for (j=0;j<N0;j++)
lowband_out[j] = MULT16_16_Q15(n,X[j]);
}
cm &= (1<<B)-1;
}
return cm;
}
/* This function is responsible for encoding and decoding a band for the stereo case. */
static unsigned quant_band_stereo(struct band_ctx *ctx, celt_norm *X, celt_norm *Y,
int N, int b, int B, celt_norm *lowband,
int LM, celt_norm *lowband_out,
celt_norm *lowband_scratch, int fill)
{
int imid=0, iside=0;
int inv = 0;
opus_val16 mid=0, side=0;
unsigned cm=0;
int mbits, sbits, delta;
int itheta;
int qalloc;
struct split_ctx sctx;
int orig_fill;
int encode;
ec_ctx *ec;
encode = ctx->encode;
ec = ctx->ec;
/* Special case for one sample */
if (N==1)
{
return quant_band_n1(ctx, X, Y, b, lowband_out);
}
orig_fill = fill;
compute_theta(ctx, &sctx, X, Y, N, &b, B, B, LM, 1, &fill);
inv = sctx.inv;
imid = sctx.imid;
iside = sctx.iside;
delta = sctx.delta;
itheta = sctx.itheta;
qalloc = sctx.qalloc;
#ifdef FIXED_POINT
mid = imid;
side = iside;
#else
# 1275 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.c"
mid = (1.f/32768)*imid;
side = (1.f/32768)*iside;
#endif
# 1278 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.c"
/* This is a special case for N=2 that only works for stereo and takes
advantage of the fact that mid and side are orthogonal to encode
the side with just one bit. */
if (N==2)
{
int c;
int sign=0;
celt_norm *x2, *y2;
mbits = b;
sbits = 0;
/* Only need one bit for the side. */
if (itheta != 0 && itheta != 16384)
sbits = 1<<BITRES;
mbits -= sbits;
c = itheta > 8192;
ctx->remaining_bits -= qalloc+sbits;
x2 = c ? Y : X;
y2 = c ? X : Y;
if (sbits)
{
if (encode)
{
/* Here we only need to encode a sign for the side. */
sign = x2[0]*y2[1] - x2[1]*y2[0] < 0;
ec_enc_bits(ec, sign, 1);
} else {
sign = ec_dec_bits(ec, 1);
}
}
sign = 1-2*sign;
/* We use orig_fill here because we want to fold the side, but if
itheta==16384, we'll have cleared the low bits of fill. */
cm = quant_band(ctx, x2, N, mbits, B, lowband, LM, lowband_out, Q15ONE,
lowband_scratch, orig_fill);
/* We don't split N=2 bands, so cm is either 1 or 0 (for a fold-collapse),
and there's no need to worry about mixing with the other channel. */
y2[0] = -sign*x2[1];
y2[1] = sign*x2[0];
if (ctx->resynth)
{
celt_norm tmp;
X[0] = MULT16_16_Q15(mid, X[0]);
X[1] = MULT16_16_Q15(mid, X[1]);
Y[0] = MULT16_16_Q15(side, Y[0]);
Y[1] = MULT16_16_Q15(side, Y[1]);
tmp = X[0];
X[0] = SUB16(tmp,Y[0]);
Y[0] = ADD16(tmp,Y[0]);
tmp = X[1];
X[1] = SUB16(tmp,Y[1]);
Y[1] = ADD16(tmp,Y[1]);
}
} else {
/* "Normal" split code */
opus_int32 rebalance;
mbits = IMAX(0, IMIN(b, (b-delta)/2));
sbits = b-mbits;
ctx->remaining_bits -= qalloc;
rebalance = ctx->remaining_bits;
if (mbits >= sbits)
{
/* In stereo mode, we do not apply a scaling to the mid because we need the normalized
mid for folding later. */
cm = quant_band(ctx, X, N, mbits, B, lowband, LM, lowband_out, Q15ONE,
lowband_scratch, fill);
rebalance = mbits - (rebalance-ctx->remaining_bits);
if (rebalance > 3<<BITRES && itheta!=0)
sbits += rebalance - (3<<BITRES);
/* For a stereo split, the high bits of fill are always zero, so no
folding will be done to the side. */
cm |= quant_band(ctx, Y, N, sbits, B, NULL, LM, NULL, side, NULL, fill>>B);
} else {
/* For a stereo split, the high bits of fill are always zero, so no
folding will be done to the side. */
cm = quant_band(ctx, Y, N, sbits, B, NULL, LM, NULL, side, NULL, fill>>B);
rebalance = sbits - (rebalance-ctx->remaining_bits);
if (rebalance > 3<<BITRES && itheta!=16384)
mbits += rebalance - (3<<BITRES);
/* In stereo mode, we do not apply a scaling to the mid because we need the normalized
mid for folding later. */
cm |= quant_band(ctx, X, N, mbits, B, lowband, LM, lowband_out, Q15ONE,
lowband_scratch, fill);
}
}
/* This code is used by the decoder and by the resynthesis-enabled encoder */
if (ctx->resynth)
{
if (N!=2)
stereo_merge(X, Y, mid, N, ctx->arch);
if (inv)
{
int j;
for (j=0;j<N;j++)
Y[j] = -Y[j];
}
}
return cm;
}
static void special_hybrid_folding(const CELTMode *m, celt_norm *norm, celt_norm *norm2, int start, int M, int dual_stereo)
{
int n1, n2;
const opus_int16 * OPUS_RESTRICT eBands = m->eBands;
n1 = M*(eBands[start+1]-eBands[start]);
n2 = M*(eBands[start+2]-eBands[start+1]);
/* Duplicate enough of the first band folding data to be able to fold the second band.
Copies no data for CELT-only mode. */
OPUS_COPY(&norm[n1], &norm[2*n1 - n2], n2-n1);
if (dual_stereo)
OPUS_COPY(&norm2[n1], &norm2[2*n1 - n2], n2-n1);
}
void quant_all_bands(int encode, const CELTMode *m, int start, int end,
celt_norm *X_, celt_norm *Y_, unsigned char *collapse_masks,
const celt_ener *bandE, int *pulses, int shortBlocks, int spread,
int dual_stereo, int intensity, int *tf_res, opus_int32 total_bits,
opus_int32 balance, ec_ctx *ec, int LM, int codedBands,
opus_uint32 *seed, int complexity, int arch, int disable_inv)
{
int i;
opus_int32 remaining_bits;
const opus_int16 * OPUS_RESTRICT eBands = m->eBands;
celt_norm * OPUS_RESTRICT norm, * OPUS_RESTRICT norm2;
VARDECL(celt_norm, _norm);
VARDECL(celt_norm, _lowband_scratch);
VARDECL(celt_norm, X_save);
VARDECL(celt_norm, Y_save);
VARDECL(celt_norm, X_save2);
VARDECL(celt_norm, Y_save2);
VARDECL(celt_norm, norm_save2);
int resynth_alloc;
celt_norm *lowband_scratch;
int B;
int M;
int lowband_offset;
int update_lowband = 1;
int C = Y_ != NULL ? 2 : 1;
int norm_offset;
int theta_rdo = encode && Y_!=NULL && !dual_stereo && complexity>=8;
#ifdef RESYNTH
int resynth = 1;
#else
# 1427 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.c"
int resynth = !encode || theta_rdo;
#endif
# 1429 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.c"
struct band_ctx ctx;
SAVE_STACK;
M = 1<<LM;
B = shortBlocks ? M : 1;
norm_offset = M*eBands[start];
/* No need to allocate norm for the last band because we don't need an
output in that band. */
ALLOC(_norm, C*(M*eBands[m->nbEBands-1]-norm_offset), celt_norm);
norm = _norm;
norm2 = norm + M*eBands[m->nbEBands-1]-norm_offset;
/* For decoding, we can use the last band as scratch space because we don't need that
scratch space for the last band and we don't care about the data there until we're
decoding the last band. */
if (encode && resynth)
resynth_alloc = M*(eBands[m->nbEBands]-eBands[m->nbEBands-1]);
else
resynth_alloc = ALLOC_NONE;
ALLOC(_lowband_scratch, resynth_alloc, celt_norm);
if (encode && resynth)
lowband_scratch = _lowband_scratch;
else
lowband_scratch = X_+M*eBands[m->nbEBands-1];
ALLOC(X_save, resynth_alloc, celt_norm);
ALLOC(Y_save, resynth_alloc, celt_norm);
ALLOC(X_save2, resynth_alloc, celt_norm);
ALLOC(Y_save2, resynth_alloc, celt_norm);
ALLOC(norm_save2, resynth_alloc, celt_norm);
lowband_offset = 0;
ctx.bandE = bandE;
ctx.ec = ec;
ctx.encode = encode;
ctx.intensity = intensity;
ctx.m = m;
ctx.seed = *seed;
ctx.spread = spread;
ctx.arch = arch;
ctx.disable_inv = disable_inv;
ctx.resynth = resynth;
ctx.theta_round = 0;
/* Avoid injecting noise in the first band on transients. */
ctx.avoid_split_noise = B > 1;
for (i=start;i<end;i++)
{
opus_int32 tell;
int b;
int N;
opus_int32 curr_balance;
int effective_lowband=-1;
celt_norm * OPUS_RESTRICT X, * OPUS_RESTRICT Y;
int tf_change=0;
unsigned x_cm;
unsigned y_cm;
int last;
ctx.i = i;
last = (i==end-1);
X = X_+M*eBands[i];
if (Y_!=NULL)
Y = Y_+M*eBands[i];
else
Y = NULL;
N = M*eBands[i+1]-M*eBands[i];
celt_assert(N > 0);
tell = ec_tell_frac(ec);
/* Compute how many bits we want to allocate to this band */
if (i != start)
balance -= tell;
remaining_bits = total_bits-tell-1;
ctx.remaining_bits = remaining_bits;
if (i <= codedBands-1)
{
curr_balance = celt_sudiv(balance, IMIN(3, codedBands-i));
b = IMAX(0, IMIN(16383, IMIN(remaining_bits+1,pulses[i]+curr_balance)));
} else {
b = 0;
}
#ifndef DISABLE_UPDATE_DRAFT
if (resynth && (M*eBands[i]-N >= M*eBands[start] || i==start+1) && (update_lowband || lowband_offset==0))
lowband_offset = i;
if (i == start+1)
special_hybrid_folding(m, norm, norm2, start, M, dual_stereo);
#else
# 1517 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.c"
if (resynth && M*eBands[i]-N >= M*eBands[start] && (update_lowband || lowband_offset==0))
lowband_offset = i;
#endif
# 1520 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.c"
tf_change = tf_res[i];
ctx.tf_change = tf_change;
if (i>=m->effEBands)
{
X=norm;
if (Y_!=NULL)
Y = norm;
lowband_scratch = NULL;
}
if (last && !theta_rdo)
lowband_scratch = NULL;
/* Get a conservative estimate of the collapse_mask's for the bands we're
going to be folding from. */
if (lowband_offset != 0 && (spread!=SPREAD_AGGRESSIVE || B>1 || tf_change<0))
{
int fold_start;
int fold_end;
int fold_i;
/* This ensures we never repeat spectral content within one band */
effective_lowband = IMAX(0, M*eBands[lowband_offset]-norm_offset-N);
fold_start = lowband_offset;
while(M*eBands[--fold_start] > effective_lowband+norm_offset);
fold_end = lowband_offset-1;
#ifndef DISABLE_UPDATE_DRAFT
while(++fold_end < i && M*eBands[fold_end] < effective_lowband+norm_offset+N);
#else
# 1548 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.c"
while(M*eBands[++fold_end] < effective_lowband+norm_offset+N);
#endif
# 1550 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.c"
x_cm = y_cm = 0;
fold_i = fold_start; do {
x_cm |= collapse_masks[fold_i*C+0];
y_cm |= collapse_masks[fold_i*C+C-1];
} while (++fold_i<fold_end);
}
/* Otherwise, we'll be using the LCG to fold, so all blocks will (almost
always) be non-zero. */
else
x_cm = y_cm = (1<<B)-1;
if (dual_stereo && i==intensity)
{
int j;
/* Switch off dual stereo to do intensity. */
dual_stereo = 0;
if (resynth)
for (j=0;j<M*eBands[i]-norm_offset;j++)
norm[j] = HALF32(norm[j]+norm2[j]);
}
if (dual_stereo)
{
x_cm = quant_band(&ctx, X, N, b/2, B,
effective_lowband != -1 ? norm+effective_lowband : NULL, LM,
last?NULL:norm+M*eBands[i]-norm_offset, Q15ONE, lowband_scratch, x_cm);
y_cm = quant_band(&ctx, Y, N, b/2, B,
effective_lowband != -1 ? norm2+effective_lowband : NULL, LM,
last?NULL:norm2+M*eBands[i]-norm_offset, Q15ONE, lowband_scratch, y_cm);
} else {
if (Y!=NULL)
{
if (theta_rdo && i < intensity)
{
ec_ctx ec_save, ec_save2;
struct band_ctx ctx_save, ctx_save2;
opus_val32 dist0, dist1;
unsigned cm, cm2;
int nstart_bytes, nend_bytes, save_bytes;
unsigned char *bytes_buf;
unsigned char bytes_save[1275];
opus_val16 w[2];
compute_channel_weights(bandE[i], bandE[i+m->nbEBands], w);
/* Make a copy. */
cm = x_cm|y_cm;
ec_save = *ec;
ctx_save = ctx;
OPUS_COPY(X_save, X, N);
OPUS_COPY(Y_save, Y, N);
/* Encode and round down. */
ctx.theta_round = -1;
x_cm = quant_band_stereo(&ctx, X, Y, N, b, B,
effective_lowband != -1 ? norm+effective_lowband : NULL, LM,
last?NULL:norm+M*eBands[i]-norm_offset, lowband_scratch, cm);
dist0 = MULT16_32_Q15(w[0], celt_inner_prod(X_save, X, N, arch)) + MULT16_32_Q15(w[1], celt_inner_prod(Y_save, Y, N, arch));
/* Save first result. */
cm2 = x_cm;
ec_save2 = *ec;
ctx_save2 = ctx;
OPUS_COPY(X_save2, X, N);
OPUS_COPY(Y_save2, Y, N);
if (!last)
OPUS_COPY(norm_save2, norm+M*eBands[i]-norm_offset, N);
nstart_bytes = ec_save.offs;
nend_bytes = ec_save.storage;
bytes_buf = ec_save.buf+nstart_bytes;
save_bytes = nend_bytes-nstart_bytes;
OPUS_COPY(bytes_save, bytes_buf, save_bytes);
/* Restore */
*ec = ec_save;
ctx = ctx_save;
OPUS_COPY(X, X_save, N);
OPUS_COPY(Y, Y_save, N);
#ifndef DISABLE_UPDATE_DRAFT
if (i == start+1)
special_hybrid_folding(m, norm, norm2, start, M, dual_stereo);
#endif
# 1629 "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.c"
/* Encode and round up. */
ctx.theta_round = 1;
x_cm = quant_band_stereo(&ctx, X, Y, N, b, B,
effective_lowband != -1 ? norm+effective_lowband : NULL, LM,
last?NULL:norm+M*eBands[i]-norm_offset, lowband_scratch, cm);
dist1 = MULT16_32_Q15(w[0], celt_inner_prod(X_save, X, N, arch)) + MULT16_32_Q15(w[1], celt_inner_prod(Y_save, Y, N, arch));
if (dist0 >= dist1) {
x_cm = cm2;
*ec = ec_save2;
ctx = ctx_save2;
OPUS_COPY(X, X_save2, N);
OPUS_COPY(Y, Y_save2, N);
if (!last)
OPUS_COPY(norm+M*eBands[i]-norm_offset, norm_save2, N);
OPUS_COPY(bytes_buf, bytes_save, save_bytes);
}
} else {
ctx.theta_round = 0;
x_cm = quant_band_stereo(&ctx, X, Y, N, b, B,
effective_lowband != -1 ? norm+effective_lowband : NULL, LM,
last?NULL:norm+M*eBands[i]-norm_offset, lowband_scratch, x_cm|y_cm);
}
} else {
x_cm = quant_band(&ctx, X, N, b, B,
effective_lowband != -1 ? norm+effective_lowband : NULL, LM,
last?NULL:norm+M*eBands[i]-norm_offset, Q15ONE, lowband_scratch, x_cm|y_cm);
}
y_cm = x_cm;
}
collapse_masks[i*C+0] = (unsigned char)x_cm;
collapse_masks[i*C+C-1] = (unsigned char)y_cm;
balance += pulses[i] + tell;
/* Update the folding position only as long as we have 1 bit/sample depth. */
update_lowband = b>(N<<BITRES);
/* We only need to avoid noise on a split for the first band. After that, we
have folding. */
ctx.avoid_split_noise = 0;
}
*seed = ctx.seed;
RESTORE_STACK;
}
# Crash reproducer for clang version 8.0.0 (tags/RELEASE_800/final)
# Driver args: "-MD" "-MV" "-MF" "/home/daurnimator/src/zig-playground/opus-1.3.1/zig-cache/tmp/r7DQKrzKxw_p-bands.o.d" "-nostdinc" "-fno-spell-checking" "-isystem" "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl" "-isystem" "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl" "-isystem" "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-any" "-isystem" "/home/daurnimator/src/zig/build/lib/zig/libc/include/any-freestanding-any" "-isystem" "/home/daurnimator/src/zig/build/lib/zig/include" "--target=wasm32-unknown-unknown-musl" "-ffreestanding" "-D" "_DEBUG" "-fstack-protector-strong" "--param" "ssp-buffer-size=4" "-fno-omit-frame-pointer" "-isystem" "/home/daurnimator/src/zig-playground/opus-1.3.1/include" "-isystem" "/home/daurnimator/src/zig-playground/opus-1.3.1/celt" "-isystem" "/home/daurnimator/src/zig-playground/opus-1.3.1/silk" "-isystem" "/home/daurnimator/src/zig-playground/opus-1.3.1/silk/float" "-o" "/home/daurnimator/src/zig-playground/opus-1.3.1/zig-cache/tmp/r7DQKrzKxw_p-bands.o" "-c" "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.c" "-O2" "-D" "VAR_ARRAYS" "-D" "HAVE_LRINTF" "-D" "OPUS_BUILD"
# Original command: "/home/daurnimator/src/zig/build/zig" "-cc1" "-triple" "wasm32-unknown-unknown-musl" "-emit-obj" "-disable-free" "-disable-llvm-verifier" "-discard-value-names" "-main-file-name" "bands.c" "-mrelocation-model" "static" "-mthread-model" "single" "-mdisable-fp-elim" "-masm-verbose" "-mconstructor-aliases" "-ffreestanding" "-fuse-init-array" "-target-cpu" "generic" "-fvisibility" "hidden" "-dwarf-column-info" "-debugger-tuning=gdb" "-momit-leaf-frame-pointer" "-coverage-notes-file" "/home/daurnimator/src/zig-playground/opus-1.3.1/zig-cache/tmp/r7DQKrzKxw_p-bands.gcno" "-nostdsysteminc" "-nobuiltininc" "-resource-dir" "/home/daurnimator/src/zig/lib/clang/8.0.0" "-dependency-file" "/home/daurnimator/src/zig-playground/opus-1.3.1/zig-cache/tmp/r7DQKrzKxw_p-bands.o.d" "-MT" "/home/daurnimator/src/zig-playground/opus-1.3.1/zig-cache/tmp/r7DQKrzKxw_p-bands.o" "-sys-header-deps" "-MV" "-isystem" "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl" "-isystem" "/home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl" "-isystem" "/home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-any" "-isystem" "/home/daurnimator/src/zig/build/lib/zig/libc/include/any-freestanding-any" "-isystem" "/home/daurnimator/src/zig/build/lib/zig/include" "-isystem" "/home/daurnimator/src/zig-playground/opus-1.3.1/include" "-isystem" "/home/daurnimator/src/zig-playground/opus-1.3.1/celt" "-isystem" "/home/daurnimator/src/zig-playground/opus-1.3.1/silk" "-isystem" "/home/daurnimator/src/zig-playground/opus-1.3.1/silk/float" "-D" "_DEBUG" "-D" "VAR_ARRAYS" "-D" "HAVE_LRINTF" "-D" "OPUS_BUILD" "-O2" "-fdebug-compilation-dir" "/home/daurnimator/src/zig-playground/opus-1.3.1" "-ferror-limit" "19" "-fmessage-length" "312" "-stack-protector" "2" "-stack-protector-buffer-size" "4" "-fobjc-runtime=gnustep" "-fno-common" "-fdiagnostics-show-option" "-fcolor-diagnostics" "-fno-spell-checking" "-vectorize-loops" "-vectorize-slp" "-o" "/home/daurnimator/src/zig-playground/opus-1.3.1/zig-cache/tmp/r7DQKrzKxw_p-bands.o" "-x" "c" "/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.c"
"/home/daurnimator/src/zig/build/zig" "-cc1" "-triple" "wasm32-unknown-unknown-musl" "-emit-obj" "-disable-free" "-disable-llvm-verifier" "-discard-value-names" "-main-file-name" "bands.c" "-mrelocation-model" "static" "-mthread-model" "single" "-mdisable-fp-elim" "-masm-verbose" "-mconstructor-aliases" "-ffreestanding" "-fuse-init-array" "-target-cpu" "generic" "-fvisibility" "hidden" "-dwarf-column-info" "-debugger-tuning=gdb" "-momit-leaf-frame-pointer" "-coverage-notes-file" "/home/daurnimator/src/zig-playground/opus-1.3.1/zig-cache/tmp/r7DQKrzKxw_p-bands.gcno" "-nostdsysteminc" "-nobuiltininc" "-sys-header-deps" "-MV" "-D" "_DEBUG" "-D" "VAR_ARRAYS" "-D" "HAVE_LRINTF" "-D" "OPUS_BUILD" "-O2" "-ferror-limit" "19" "-fmessage-length" "312" "-stack-protector" "2" "-stack-protector-buffer-size" "4" "-fobjc-runtime=gnustep" "-fno-common" "-fdiagnostics-show-option" "-fcolor-diagnostics" "-fno-spell-checking" "-vectorize-loops" "-vectorize-slp" "-x" "c" "bands-5f95cb.c"
$ ~/src/zig/build/zig build -Dtarget=wasm32-freestanding
Stack dump:
0. Program arguments: /home/daurnimator/src/zig/build/zig -cc1 -triple wasm32-unknown-unknown-musl -emit-obj -disable-free -disable-llvm-verifier -discard-value-names -main-file-name bands.c -mrelocation-model static -mthread-model single -mdisable-fp-elim -masm-verbose -mconstructor-aliases -ffreestanding -fuse-init-array -target-cpu generic -fvisibility hidden -dwarf-column-info -debugger-tuning=gdb -momit-leaf-frame-pointer -coverage-notes-file /home/daurnimator/src/zig-playground/opus-1.3.1/zig-cache/tmp/r7DQKrzKxw_p-bands.gcno -nostdsysteminc -nobuiltininc -resource-dir /home/daurnimator/src/zig/lib/clang/8.0.0 -dependency-file /home/daurnimator/src/zig-playground/opus-1.3.1/zig-cache/tmp/r7DQKrzKxw_p-bands.o.d -MT /home/daurnimator/src/zig-playground/opus-1.3.1/zig-cache/tmp/r7DQKrzKxw_p-bands.o -sys-header-deps -MV -isystem /home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl -isystem /home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl -isystem /home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-any -isystem /home/daurnimator/src/zig/build/lib/zig/libc/include/any-freestanding-any -isystem /home/daurnimator/src/zig/build/lib/zig/include -isystem /home/daurnimator/src/zig-playground/opus-1.3.1/include -isystem /home/daurnimator/src/zig-playground/opus-1.3.1/celt -isystem /home/daurnimator/src/zig-playground/opus-1.3.1/silk -isystem /home/daurnimator/src/zig-playground/opus-1.3.1/silk/float -D _DEBUG -D VAR_ARRAYS -D HAVE_LRINTF -D OPUS_BUILD -O2 -fdebug-compilation-dir /home/daurnimator/src/zig-playground/opus-1.3.1 -ferror-limit 19 -fmessage-length 312 -stack-protector 2 -stack-protector-buffer-size 4 -fobjc-runtime=gnustep -fno-common -fdiagnostics-show-option -fcolor-diagnostics -fno-spell-checking -vectorize-loops -vectorize-slp -o /home/daurnimator/src/zig-playground/opus-1.3.1/zig-cache/tmp/r7DQKrzKxw_p-bands.o -x c /home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.c
1. <eof> parser at end of file
2. Code generation
3. Running pass 'Function Pass Manager' on module '/home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.c'.
4. Running pass 'WebAssembly Assembly Printer' on function '@quant_all_bands'
#0 0x00007f6a10f50fdb llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/usr/lib/libLLVM-8.so+0x9f5fdb)
#1 0x00007f6a10f4ee84 llvm::sys::RunSignalHandlers() (/usr/lib/libLLVM-8.so+0x9f3e84)
#2 0x00007f6a10f4f00e (/usr/lib/libLLVM-8.so+0x9f400e)
#3 0x00007f6a1054dd00 __restore_rt (/usr/lib/libpthread.so.0+0x13d00)
#4 0x00007f6a12ffb5a9 llvm::GetLibcallSignature(llvm::WebAssemblySubtarget const&, char const*, llvm::SmallVectorImpl<llvm::wasm::ValType>&, llvm::SmallVectorImpl<llvm::wasm::ValType>&) (/usr/lib/libLLVM-8.so+0x2aa05a9)
#5 0x00007f6a12fed309 (/usr/lib/libLLVM-8.so+0x2a92309)
#6 0x00007f6a12fed4f0 (/usr/lib/libLLVM-8.so+0x2a924f0)
#7 0x00007f6a12fa45fa (/usr/lib/libLLVM-8.so+0x2a495fa)
#8 0x00007f6a1167ed28 llvm::AsmPrinter::EmitFunctionBody() (/usr/lib/libLLVM-8.so+0x1123d28)
#9 0x00007f6a12fa47eb (/usr/lib/libLLVM-8.so+0x2a497eb)
#10 0x00007f6a112595b5 (/usr/lib/libLLVM-8.so+0xcfe5b5)
#11 0x00007f6a1104f4f9 llvm::FPPassManager::runOnFunction(llvm::Function&) (/usr/lib/libLLVM-8.so+0xaf44f9)
#12 0x00007f6a1104f552 llvm::FPPassManager::runOnModule(llvm::Module&) (/usr/lib/libLLVM-8.so+0xaf4552)
#13 0x00007f6a1104e830 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/usr/lib/libLLVM-8.so+0xaf3830)
#14 0x00007f6a16c9424a (/usr/lib/libclangCodeGen.so.8+0x9724a)
#15 0x00007f6a16c95e69 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::DataLayout const&, llvm::Module*, clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream> >) (/usr/lib/libclangCodeGen.so.8+0x98e69)
#16 0x00007f6a16eeae58 (/usr/lib/libclangCodeGen.so.8+0x2ede58)
#17 0x00007f6a1525fa11 clang::ParseAST(clang::Sema&, bool, bool) (/usr/lib/libclangParse.so.8+0x2ba11)
#18 0x00007f6a16ee9cf8 clang::CodeGenAction::ExecuteAction() (/usr/lib/libclangCodeGen.so.8+0x2eccf8)
#19 0x00007f6a16b684f6 clang::FrontendAction::Execute() (/usr/lib/libclangFrontend.so.8+0xd94f6)
#20 0x00007f6a16b22551 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/usr/lib/libclangFrontend.so.8+0x93551)
#21 0x00007f6a17099b15 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/usr/lib/libclangFrontendTool.so.8+0x4b15)
#22 0x000055b9b88013a5 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) /home/daurnimator/src/zig/src/zig_clang_cc1_main.cpp:208:38
#23 0x000055b9b87f73bd ExecuteCC1Tool(llvm::ArrayRef<char const*>, llvm::StringRef) /home/daurnimator/src/zig/src/zig_clang_driver.cpp:308:64
#24 0x000055b9b87f7fae ZigClang_main /home/daurnimator/src/zig/src/zig_clang_driver.cpp:380:26
#25 0x000055b9b85d1f18 main /home/daurnimator/src/zig/src/main.cpp:321:40
#26 0x00007f6a10053ee3 __libc_start_main (/usr/lib/libc.so.6+0x26ee3)
#27 0x000055b9b85d0f7e _start (/home/daurnimator/src/zig/build/zig+0x477f7e)
Segmentation fault at address 0xa
???:?:?: 0x7f6a12ffb5a9 in ??? (???)
???:?:?: 0x55b9badb772f in ??? (???)
???:?:?: 0x7f6a12ffe36f in ??? (???)
???:?:?: 0x58b4808ec8348fa in ??? (???)
zig: error: unable to execute command: Segmentation fault (core dumped)
zig: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 8.0.0 (tags/RELEASE_800/final)
Target: wasm32-unknown-unknown-musl
Thread model: single
InstalledDir: /usr/bin
zig: note: diagnostic msg: PLEASE submit a bug report to and include the crash backtrace, preprocessed source, and associated run script.
zig: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
zig: note: diagnostic msg: /tmp/bands-5f95cb.c
zig: note: diagnostic msg: /tmp/bands-5f95cb.sh
zig: note: diagnostic msg:
********************
The following command failed:
/home/daurnimator/src/zig/build/zig cc -MD -MV -MF /home/daurnimator/src/zig-playground/opus-1.3.1/zig-cache/tmp/r7DQKrzKxw_p-bands.o.d -nostdinc -fno-spell-checking -isystem /home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-musl -isystem /home/daurnimator/src/zig/build/lib/zig/libc/include/generic-musl -isystem /home/daurnimator/src/zig/build/lib/zig/libc/include/wasm32-freestanding-any -isystem /home/daurnimator/src/zig/build/lib/zig/libc/include/any-freestanding-any -isystem /home/daurnimator/src/zig/build/lib/zig/include -target wasm32-unknown-unknown-musl -ffreestanding -D_DEBUG -fstack-protector-strong --param ssp-buffer-size=4 -fno-omit-frame-pointer -isystem /home/daurnimator/src/zig-playground/opus-1.3.1/include -isystem /home/daurnimator/src/zig-playground/opus-1.3.1/celt -isystem /home/daurnimator/src/zig-playground/opus-1.3.1/silk -isystem /home/daurnimator/src/zig-playground/opus-1.3.1/silk/float -o /home/daurnimator/src/zig-playground/opus-1.3.1/zig-cache/tmp/r7DQKrzKxw_p-bands.o -c /home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.c -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD
The following command exited with error code 1:
/home/daurnimator/src/zig/build/zig build-lib --library c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/celt/bands.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/celt/celt.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/celt/celt_encoder.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/celt/celt_decoder.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/celt/cwrs.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/celt/entcode.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/celt/entdec.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/celt/entenc.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/celt/kiss_fft.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/celt/laplace.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/celt/mathops.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/celt/mdct.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/celt/modes.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/celt/pitch.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/celt/celt_lpc.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/celt/quant_bands.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/celt/rate.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/celt/vq.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/CNG.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/code_signs.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/init_decoder.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/decode_core.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/decode_frame.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/decode_parameters.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/decode_indices.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/decode_pulses.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/decoder_set_fs.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/dec_API.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/enc_API.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/encode_indices.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/encode_pulses.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/gain_quant.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/interpolate.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/LP_variable_cutoff.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/NLSF_decode.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/NSQ.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/NSQ_del_dec.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/PLC.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/shell_coder.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/tables_gain.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/tables_LTP.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/tables_NLSF_CB_NB_MB.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/tables_NLSF_CB_WB.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/tables_other.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/tables_pitch_lag.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/tables_pulses_per_block.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/VAD.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/control_audio_bandwidth.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/quant_LTP_gains.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/VQ_WMat_EC.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/HP_variable_cutoff.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/NLSF_encode.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/NLSF_VQ.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/NLSF_unpack.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/NLSF_del_dec_quant.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/process_NLSFs.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/stereo_LR_to_MS.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/stereo_MS_to_LR.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/check_control_input.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/control_SNR.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/init_encoder.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/control_codec.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/A2NLSF.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/ana_filt_bank_1.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/biquad_alt.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/bwexpander_32.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/bwexpander.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/debug.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/decode_pitch.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/inner_prod_aligned.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/lin2log.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/log2lin.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/LPC_analysis_filter.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/LPC_inv_pred_gain.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/table_LSF_cos.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/NLSF2A.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/NLSF_stabilize.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/NLSF_VQ_weights_laroia.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/pitch_est_tables.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/resampler.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/resampler_down2_3.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/resampler_down2.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/resampler_private_AR2.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/resampler_private_down_FIR.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/resampler_private_IIR_FIR.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/resampler_private_up2_HQ.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/resampler_rom.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/sigm_Q15.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/sort.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/sum_sqr_shift.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/stereo_decode_pred.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/stereo_encode_pred.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/stereo_find_predictor.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/stereo_quant_pred.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/LPC_fit.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/src/opus.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/src/opus_decoder.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/src/opus_encoder.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/src/opus_multistream.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/src/opus_multistream_encoder.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/src/opus_multistream_decoder.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/src/repacketizer.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/src/opus_projection_encoder.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/src/opus_projection_decoder.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/src/mapping_matrix.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/float/apply_sine_window_FLP.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/float/corrMatrix_FLP.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/float/encode_frame_FLP.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/float/find_LPC_FLP.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/float/find_LTP_FLP.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/float/find_pitch_lags_FLP.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/float/find_pred_coefs_FLP.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/float/LPC_analysis_filter_FLP.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/float/LTP_analysis_filter_FLP.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/float/LTP_scale_ctrl_FLP.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/float/noise_shape_analysis_FLP.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/float/process_gains_FLP.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/float/regularize_correlations_FLP.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/float/residual_energy_FLP.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/float/warped_autocorrelation_FLP.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/float/wrappers_FLP.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/float/autocorrelation_FLP.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/float/burg_modified_FLP.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/float/bwexpander_FLP.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/float/energy_FLP.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/float/inner_product_FLP.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/float/k2a_FLP.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/float/LPC_inv_pred_gain_FLP.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/float/pitch_analysis_core_FLP.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/float/scale_copy_vector_FLP.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/float/scale_vector_FLP.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/float/schur_FLP.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/silk/float/sort_FLP.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/src/analysis.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/src/mlp.c --c-source -O2 -DVAR_ARRAYS -DHAVE_LRINTF -DOPUS_BUILD /home/daurnimator/src/zig-playground/opus-1.3.1/src/mlp_data.c --cache-dir /home/daurnimator/src/zig-playground/opus-1.3.1/zig-cache --name opus -target wasm32-freestanding-musl -isystem /home/daurnimator/src/zig-playground/opus-1.3.1/include -isystem /home/daurnimator/src/zig-playground/opus-1.3.1/celt -isystem /home/daurnimator/src/zig-playground/opus-1.3.1/silk -isystem /home/daurnimator/src/zig-playground/opus-1.3.1/silk/float --cache on
Build failed. The following command failed:
/home/daurnimator/src/zig-playground/opus-1.3.1/zig-cache/o/MMLZgXDR_w4tWyxZiNgZ0yWefjwdoweycD30oMbbLQd7WInm7xzK0v-RFPghi_Ox/build /home/daurnimator/src/zig/build/zig /home/daurnimator/src/zig-playground/opus-1.3.1 /home/daurnimator/src/zig-playground/opus-1.3.1/zig-cache -Dtarget=wasm32-freestanding
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment