Vendor libogg 1.3.6 + libvorbis 1.3.7 (v0.10.0)
OGG Vorbis encoding now ships in-tree under vendor/ogg/ and vendor/vorbis/. sigil-audio no longer requires system libogg / libvorbis / libvorbisenc to build — Linux/macOS users skip the package install, and Windows cross-compile (zig + x86_64-windows-gnu) becomes possible from zero configuration.
Sources are byte-identical to the upstream tarballs (SHA256 + upgrade procedure recorded in vendor/ogg/README.md and vendor/vorbis/README.md). Two non-source vendor additions:
- vendor/ogg/include/ogg/config_types.h: substitute for the
autotools-generated header. Uses stdint.h types.
- vendor/vorbis/sigil_alloca_shim.h: force-included via -include,
defines HAVE_ALLOCA_H only off-Windows (MinGW lacks <alloca.h>;
libvorbis's _WIN32 branch handles alloca via <malloc.h>).package.sgl changes: - Library link-flags drop -lvorbis/-lvorbisenc/-logg from every branch. - New (windows) link-flags branch with -lole32 -lwinmm -lksuser for sokolaudio's WASAPI backend. - New windows-amd64 config (zig toolchain, x8664-windows-gnu target) so sigil build --config windows-amd64 actually cross-compiles. - Vendored sources compiled in two relaxed-warning compile-c-sources steps (one per library) so sigil-audio's strict-flag set isn't polluted by upstream style.
Verified: - Native build: libsigil-audio.a, 117 ogg/vorbis text symbols. - Smoke test (test/test-ogg-encode.sgl): mono + stereo files encode and identify as "Ogg data, Vorbis audio, ... created by: Xiph.Org libVorbis I" via file. - Windows cross-build: libsigil-audio.a contains COFF objects; test-linked two PE32+ Windows binaries against it (one through vorbisencodeinitvbr, one through saudiosetup) with the new WASAPI flags — both link clean.
Binary size grows by ~1 MB (libvorbis codebook tables dominate).
CHANGELOG.md | 27 +
README.md | 19 +-
manifest.scm | 12 +-
package.sgl | 106 +-
vendor/ogg/COPYING | 28 +
vendor/ogg/README.md | 35 +
vendor/ogg/include/ogg/config_types.h | 28 +
vendor/ogg/include/ogg/ogg.h | 209 ++
vendor/ogg/include/ogg/os_types.h | 158 ++
vendor/ogg/src/bitwise.c | 1089 ++++++++++
vendor/ogg/src/crctable.h | 278 +++
vendor/ogg/src/framing.c | 2138 +++++++++++++++++++
vendor/vorbis/COPYING | 28 +
vendor/vorbis/README.md | 42 +
vendor/vorbis/include/vorbis/codec.h | 242 +++
vendor/vorbis/include/vorbis/vorbisenc.h | 435 ++++
vendor/vorbis/include/vorbis/vorbisfile.h | 205 ++
vendor/vorbis/lib/analysis.c | 119 ++
vendor/vorbis/lib/backends.h | 143 ++
vendor/vorbis/lib/bitrate.c | 252 +++
vendor/vorbis/lib/bitrate.h | 58 +
vendor/vorbis/lib/block.c | 1046 +++++++++
vendor/vorbis/lib/books/coupled/res_books_51.h | 12273 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
vendor/vorbis/lib/books/coupled/res_books_stereo.h | 15782 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
vendor/vorbis/lib/books/floor/floor_books.h | 1546 ++++++++++++++
vendor/vorbis/lib/books/uncoupled/res_books_uncoupled.h | 7757 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
vendor/vorbis/lib/codebook.c | 461 ++++
vendor/vorbis/lib/codebook.h | 117 +
vendor/vorbis/lib/codec_internal.h | 166 ++
vendor/vorbis/lib/envelope.c | 374 ++++
vendor/vorbis/lib/envelope.h | 79 +
vendor/vorbis/lib/floor0.c | 223 ++
vendor/vorbis/lib/floor1.c | 1086 ++++++++++
vendor/vorbis/lib/highlevel.h | 57 +
vendor/vorbis/lib/info.c | 687 ++++++
vendor/vorbis/lib/lookup.c | 93 +
vendor/vorbis/lib/lookup.h | 31 +
vendor/vorbis/lib/lookup_data.h | 191 ++
vendor/vorbis/lib/lpc.c | 159 ++
vendor/vorbis/lib/lpc.h | 28 +
vendor/vorbis/lib/lsp.c | 454 ++++
vendor/vorbis/lib/lsp.h | 27 +
vendor/vorbis/lib/mapping0.c | 808 +++++++
vendor/vorbis/lib/masking.h | 784 +++++++
vendor/vorbis/lib/mdct.c | 562 +++++
vendor/vorbis/lib/mdct.h | 70 +
vendor/vorbis/lib/misc.h | 57 +
vendor/vorbis/lib/modes/floor_all.h | 259 +++
vendor/vorbis/lib/modes/psych_11.h | 50 +
vendor/vorbis/lib/modes/psych_16.h | 132 ++
vendor/vorbis/lib/modes/psych_44.h | 641 ++++++
vendor/vorbis/lib/modes/psych_8.h | 100 +
vendor/vorbis/lib/modes/residue_16.h | 162 ++
vendor/vorbis/lib/modes/residue_44.h | 291 +++
vendor/vorbis/lib/modes/residue_44p51.h | 450 ++++
vendor/vorbis/lib/modes/residue_44u.h | 317 +++
vendor/vorbis/lib/modes/residue_8.h | 108 +
vendor/vorbis/lib/modes/setup_11.h | 142 ++
vendor/vorbis/lib/modes/setup_16.h | 152 ++
vendor/vorbis/lib/modes/setup_22.h | 127 ++
vendor/vorbis/lib/modes/setup_32.h | 131 ++
vendor/vorbis/lib/modes/setup_44.h | 116 +
vendor/vorbis/lib/modes/setup_44p51.h | 73 +
vendor/vorbis/lib/modes/setup_44u.h | 73 +
vendor/vorbis/lib/modes/setup_8.h | 148 ++
vendor/vorbis/lib/modes/setup_X.h | 224 ++
vendor/vorbis/lib/os.h | 189 ++
vendor/vorbis/lib/psy.c | 1209 +++++++++++
vendor/vorbis/lib/psy.h | 153 ++
vendor/vorbis/lib/registry.c | 44 +
vendor/vorbis/lib/registry.h | 31 +
vendor/vorbis/lib/res0.c | 886 ++++++++
vendor/vorbis/lib/scales.h | 89 +
vendor/vorbis/lib/sharedbook.c | 604 ++++++
vendor/vorbis/lib/smallft.c | 1254 +++++++++++
vendor/vorbis/lib/smallft.h | 33 +
vendor/vorbis/lib/synthesis.c | 179 ++
vendor/vorbis/lib/vorbisenc.c | 1224 +++++++++++
vendor/vorbis/lib/vorbisfile.c | 2427 +++++++++++++++++++++
vendor/vorbis/lib/window.c | 2135 ++++++++++++++++++
vendor/vorbis/lib/window.h | 25 +
vendor/vorbis/sigil_alloca_shim.h | 26 +
82 files changed, 64757 insertions(+), 16 deletions(-)CHANGELOG.mdmodified
The format is based on [Keep a Changelog](https://keepachangelog.com/),and this project adheres to [Semantic Versioning](https://semver.org/).## [0.10.0] - 2026-04-24### Added- Vendored libogg 1.3.6 + libvorbis 1.3.7 under `vendor/ogg/` and `vendor/vorbis/`. OGG Vorbis encoding/decoding is now self-contained: no external `-lvorbis` / `-lvorbisenc` / `-logg` link dependency, no system `libogg-dev` / `libvorbis-dev` packages needed on Linux or macOS.- Windows cross-compile target (`sigil build --config windows-amd64`) — uses zig with `x86_64-windows-gnu`. WASAPI backend links against `-lole32 -lwinmm -lksuser`. Verified by building libsigil-audio.a + test-linking a PE32+ Windows .exe.- Per-tree `vendor/ogg/README.md` and `vendor/vorbis/README.md` recording upstream version + tarball SHA256 + upgrade procedure.### Changed- `package.sgl` library `link-flags`: dropped `-lvorbis -lvorbisenc -logg` from every host branch; added a `(windows)` branch with WASAPI link flags.- `manifest.scm`: removed `libvorbis` / `libogg` system deps — vendored sources cover them.- Binary size grows by ~1 MB (libvorbis codebook tables dominate). Acceptable trade-off for the install-time ergonomics + cross- compile capability.## [0.9.0] - 2026-04-18### AddedREADME.mdmodified
- ALSA development headers on Linux (`libasound2-dev` / `alsa-lib-devel`)- AudioToolbox framework on macOS (included with Xcode)- Windows: nothing extra — sokol_audio drives WASAPI through `ole32` / `winmm` / `ksuser`, all bundled with the OS.OGG Vorbis encoding/decoding is **vendored** (libogg 1.3.6 +libvorbis 1.3.7, see `vendor/ogg/README.md` and`vendor/vorbis/README.md`). No system `libogg` / `libvorbis` /`libvorbisenc` packages need to be installed — sigil-audio linksthem statically into `libsigil-audio.a`. This adds ~1 MB to thefinal binary and unblocks Windows cross-compile.## Dependencies```shsigil deps installsigil buildsigil build # native (host platform)sigil build --config windows-amd64 # cross-compile for Windows (zig)```## Streaming audio sink## LicenseBSD-3-ClauseBSD-3-Clause.Vendored libogg (1.3.6) and libvorbis (1.3.7) are also distributedunder BSD-3-Clause (see `vendor/ogg/COPYING` and`vendor/vorbis/COPYING`). Both licenses are compatible with thispackage's BSD-3-Clause terms.manifest.scmmodified
;; sigil-audio Development Environment;; Use with: guix shell -m manifest.scm;; libogg / libvorbis used to live here but are now vendored under;; vendor/ogg + vendor/vorbis (see package.sgl), so the system;; packages are no longer required to build sigil-audio.(specifications->manifest '("gcc-toolchain" "pkg-config" "binutils" ;; Audio playback (Sokol backend) "alsa-lib" ;; OGG Vorbis encoding "libvorbis" "libogg")) No newline at end of file ;; Audio playback (Sokol backend) — still a system dep on Linux. "alsa-lib")) No newline at end of filepackage.sglmodified
;;;;;; Provides audio playback capabilities via sokol_audio.;;; Sound effects are loaded into memory, music is streamed via stb_vorbis.;;; OGG Vorbis encoding ships in-tree via vendored libogg + libvorbis.(package name: "sigil-audio" version: "0.9.1" version: "0.10.0" description: "Audio playback and streaming for Sigil" url: "https://codeberg.org/sigil/sigil-audio" license: "BSD-3-Clause" name: 'release output-dir: "build/release" debug?: #f optimize: 2)) optimize: 2) ;; Windows x86_64 (MinGW via zig) — built so downstream consumers ;; like cinder-cantata can produce Windows binaries from Linux. ;; Mirrors the windows-amd64 config in the main sigil package. (config name: 'windows-amd64 output-dir: "build/windows-amd64" toolchain: 'zig target: "x86_64-windows-gnu" backend: 'native static?: #t debug?: #f optimize: 2 features: '(release cross windows))) dependencies: (list (from-git url: "codeberg:sigil/sigil" package: "sigil-stdlib" version: "^0.13.0")) (library name: 'sigil-audio c-sources: '("src/c/sokol-audio.c" "src/c/audio.c" "src/c/audio-stream.c" "src/c/ogg-encode.c") c-include-dirs: '("vendor/sokol" "vendor/stb") ;; vendor/ogg/include + vendor/vorbis/include expose the public ;; ogg/vorbis headers consumed by ogg-encode.c. vendor/vorbis/lib ;; is needed because libvorbis internal .c files include their ;; siblings by bare filename (e.g. #include "codebook.h"). c-include-dirs: '("vendor/sokol" "vendor/stb" "vendor/ogg/include" "vendor/vorbis/include" "vendor/vorbis/lib") native-init: "sigil__init_sigil_audio_module" ;; Platform-specific linker flags for audio + OGG Vorbis encoding ;; Platform-specific linker flags for sokol_audio's audio backend. ;; OGG Vorbis is now vendored — no more -lvorbis/-lvorbisenc/-logg. link-flags: (case (host-os) ((linux) '("-lasound" "-lvorbis" "-lvorbisenc" "-logg")) ((darwin) '("-framework" "AudioToolbox" "-lvorbis" "-lvorbisenc" "-logg")) (else '("-lvorbis" "-lvorbisenc" "-logg"))))) ((linux) '("-lasound")) ((darwin) '("-framework" "AudioToolbox")) ;; sokol_audio's WASAPI backend uses CoCreateInstance ;; / CoInitializeEx (ole32). winmm + ksuser are ;; carried for completeness against future sokol ;; revisions that touch waveOut / kernel-streaming. ((windows) '("-lole32" "-lwinmm" "-lksuser")) (else '())))) tasks: (list (task name: 'build description: "Build sigil-audio" steps: (list ;; Compile vendored libogg with relaxed warning flags. Upstream ;; sources are byte-identical to the 1.3.6 tarball (see ;; vendor/ogg/README.md); keeping warnings off avoids polluting ;; sigil-audio's own strict-flag set when upstream's style ;; trips -Wparentheses / -Wunused-* / -Wsign-compare. (compile-c-sources sources: '("vendor/ogg/src/bitwise.c" "vendor/ogg/src/framing.c") include-dirs: '("vendor/ogg/include") flags: '("-std=c99" "-Wno-parentheses" "-Wno-unused-function" "-Wno-unused-but-set-variable" "-Wno-sign-compare" "-Wno-strict-aliasing")) ;; Compile vendored libvorbis (full library + encoder + file ;; I/O). Upstream sources are byte-identical to the 1.3.7 ;; tarball (see vendor/vorbis/README.md). Same relaxed-warning ;; rationale as libogg above. (compile-c-sources sources: '("vendor/vorbis/lib/analysis.c" "vendor/vorbis/lib/bitrate.c" "vendor/vorbis/lib/block.c" "vendor/vorbis/lib/codebook.c" "vendor/vorbis/lib/envelope.c" "vendor/vorbis/lib/floor0.c" "vendor/vorbis/lib/floor1.c" "vendor/vorbis/lib/info.c" "vendor/vorbis/lib/lookup.c" "vendor/vorbis/lib/lpc.c" "vendor/vorbis/lib/lsp.c" "vendor/vorbis/lib/mapping0.c" "vendor/vorbis/lib/mdct.c" "vendor/vorbis/lib/psy.c" "vendor/vorbis/lib/registry.c" "vendor/vorbis/lib/res0.c" "vendor/vorbis/lib/sharedbook.c" "vendor/vorbis/lib/smallft.c" "vendor/vorbis/lib/synthesis.c" "vendor/vorbis/lib/vorbisenc.c" "vendor/vorbis/lib/vorbisfile.c" "vendor/vorbis/lib/window.c") include-dirs: '("vendor/ogg/include" "vendor/vorbis/include" "vendor/vorbis/lib") ;; vendor/vorbis/sigil_alloca_shim.h is force-included so ;; HAVE_ALLOCA_H gets defined on Linux/macOS (where vorbis ;; needs it for the alloca prototype under -std=c99) but ;; NOT on Windows/MinGW (where <alloca.h> is missing and ;; vorbis's _WIN32 branch handles alloca via <malloc.h>). flags: '("-std=c99" "-include" "vendor/vorbis/sigil_alloca_shim.h" "-Wno-parentheses" "-Wno-unused-function" "-Wno-unused-but-set-variable" "-Wno-sign-compare" "-Wno-strict-aliasing")) ;; sigil-audio's own C sources. (compile-c-sources sources: '("src/c/sokol-audio.c" "src/c/audio.c" "src/c/audio-stream.c" "src/c/ogg-encode.c") include-dirs: '("vendor/sokol" "vendor/stb") include-dirs: '("vendor/sokol" "vendor/stb" "vendor/ogg/include" "vendor/vorbis/include") flags: (with-sigil-c-flags '("-std=c11" "-D_GNU_SOURCE" "-Wno-unused-parameter" "-Wno-unused-function" "-Wno-sign-compare"))) (create-static-library name: "sigil-audio")vendor/ogg/COPYINGadded
Copyright (c) 2002, Xiph.org FoundationRedistribution and use in source and binary forms, with or withoutmodification, are permitted provided that the following conditionsare met:- Redistributions of source code must retain the above copyrightnotice, this list of conditions and the following disclaimer.- Redistributions in binary form must reproduce the above copyrightnotice, this list of conditions and the following disclaimer in thedocumentation and/or other materials provided with the distribution.- Neither the name of the Xiph.org Foundation nor the names of itscontributors may be used to endorse or promote products derived fromthis software without specific prior written permission.THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOTLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FORA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATIONOR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOTLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANYTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USEOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.vendor/ogg/README.mdadded
# libogg (vendored)Upstream: https://xiph.org/ogg/- **Version**: 1.3.6- **Source**: https://downloads.xiph.org/releases/ogg/libogg-1.3.6.tar.xz- **SHA256**: `5c8253428e181840cd20d41f3ca16557a9cc04bad4a3d04cce84808677fa1061`- **License**: BSD-3-Clause (see `COPYING`)## What's includedSources required to build `libogg.a`:- `src/bitwise.c`, `src/framing.c`, `src/crctable.h`- `include/ogg/ogg.h`, `include/ogg/os_types.h`- `include/ogg/config_types.h` — locally maintained substitute for upstream's `config_types.h.in` template. See the header comment in that file for rationale.Everything else from the tarball (`docs/`, `cmake/`, `m4/`,`win32/`, `Makefile.in`/`Makefile.am`, `configure`, doxygen,autotools machinery) is intentionally omitted — sigil-audio drivesthe build through `package.sgl`, not autotools.## Upgrading1. Download the new upstream tarball, verify SHA256 against xiph.org's release announcement.2. Replace `src/bitwise.c`, `src/framing.c`, `src/crctable.h`, `include/ogg/ogg.h`, `include/ogg/os_types.h`, `COPYING` with the upstream files (byte-identical drop-in).3. Update version + SHA256 in this README.4. Re-check whether upstream changed `config_types.h.in`. If a new typedef appeared, mirror it in `include/ogg/config_types.h`.5. Rebuild + run `test/test-ogg-encode.sgl`.vendor/ogg/include/ogg/config_types.hadded
/* config_types.h * * Vendored substitute for libogg's autotools/cmake-generated * config_types.h. Upstream ships only `config_types.h.in`, which is * normally expanded at configure time by detecting native int sizes. * * This vendored sigil-audio build skips the configure step entirely * and assumes a C99 host with stdint.h — which is true for every * platform sigil targets (Linux/glibc, macOS, MinGW-w64 via zig). * * If a target ever surfaces where stdint.h is unavailable, this file * is the right place to add the alternate typedef branch — do not * patch upstream sources. */#ifndef __CONFIG_TYPES_H__#define __CONFIG_TYPES_H__#include <stdint.h>#include <sys/types.h>typedef int16_t ogg_int16_t;typedef uint16_t ogg_uint16_t;typedef int32_t ogg_int32_t;typedef uint32_t ogg_uint32_t;typedef int64_t ogg_int64_t;typedef uint64_t ogg_uint64_t;#endifvendor/ogg/include/ogg/ogg.hadded
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 * * by the Xiph.Org Foundation http://www.xiph.org/ * * * ******************************************************************** function: toplevel libogg include ********************************************************************/#ifndef _OGG_H#define _OGG_H#ifdef __cplusplusextern "C" {#endif#include <stddef.h>#include <ogg/os_types.h>typedef struct { void *iov_base; size_t iov_len;} ogg_iovec_t;typedef struct { long endbyte; int endbit; unsigned char *buffer; unsigned char *ptr; long storage;} oggpack_buffer;/* ogg_page is used to encapsulate the data in one Ogg bitstream page *****/typedef struct { unsigned char *header; long header_len; unsigned char *body; long body_len;} ogg_page;/* ogg_stream_state contains the current encode/decode state of a logical Ogg bitstream **********************************************************/typedef struct { unsigned char *body_data; /* bytes from packet bodies */ long body_storage; /* storage elements allocated */ long body_fill; /* elements stored; fill mark */ long body_returned; /* elements of fill returned */ int *lacing_vals; /* The values that will go to the segment table */ ogg_int64_t *granule_vals; /* granulepos values for headers. Not compact this way, but it is simple coupled to the lacing fifo */ long lacing_storage; long lacing_fill; long lacing_packet; long lacing_returned; unsigned char header[282]; /* working space for header encode */ int header_fill; int e_o_s; /* set when we have buffered the last packet in the logical bitstream */ int b_o_s; /* set after we've written the initial page of a logical bitstream */ long serialno; long pageno; ogg_int64_t packetno; /* sequence number for decode; the framing knows where there's a hole in the data, but we need coupling so that the codec (which is in a separate abstraction layer) also knows about the gap */ ogg_int64_t granulepos;} ogg_stream_state;/* ogg_packet is used to encapsulate the data and metadata belonging to a single raw Ogg/Vorbis packet *************************************/typedef struct { unsigned char *packet; long bytes; long b_o_s; long e_o_s; ogg_int64_t granulepos; ogg_int64_t packetno; /* sequence number for decode; the framing knows where there's a hole in the data, but we need coupling so that the codec (which is in a separate abstraction layer) also knows about the gap */} ogg_packet;typedef struct { unsigned char *data; int storage; int fill; int returned; int unsynced; int headerbytes; int bodybytes;} ogg_sync_state;/* Ogg BITSTREAM PRIMITIVES: bitstream ************************/extern void oggpack_writeinit(oggpack_buffer *b);extern int oggpack_writecheck(oggpack_buffer *b);extern void oggpack_writetrunc(oggpack_buffer *b,long bits);extern void oggpack_writealign(oggpack_buffer *b);extern void oggpack_writecopy(oggpack_buffer *b,void *source,long bits);extern void oggpack_reset(oggpack_buffer *b);extern void oggpack_writeclear(oggpack_buffer *b);extern void oggpack_readinit(oggpack_buffer *b,unsigned char *buf,int bytes);extern void oggpack_write(oggpack_buffer *b,unsigned long value,int bits);extern long oggpack_look(oggpack_buffer *b,int bits);extern long oggpack_look1(oggpack_buffer *b);extern void oggpack_adv(oggpack_buffer *b,int bits);extern void oggpack_adv1(oggpack_buffer *b);extern long oggpack_read(oggpack_buffer *b,int bits);extern long oggpack_read1(oggpack_buffer *b);extern long oggpack_bytes(oggpack_buffer *b);extern long oggpack_bits(oggpack_buffer *b);extern unsigned char *oggpack_get_buffer(oggpack_buffer *b);extern void oggpackB_writeinit(oggpack_buffer *b);extern int oggpackB_writecheck(oggpack_buffer *b);extern void oggpackB_writetrunc(oggpack_buffer *b,long bits);extern void oggpackB_writealign(oggpack_buffer *b);extern void oggpackB_writecopy(oggpack_buffer *b,void *source,long bits);extern void oggpackB_reset(oggpack_buffer *b);extern void oggpackB_writeclear(oggpack_buffer *b);extern void oggpackB_readinit(oggpack_buffer *b,unsigned char *buf,int bytes);extern void oggpackB_write(oggpack_buffer *b,unsigned long value,int bits);extern long oggpackB_look(oggpack_buffer *b,int bits);extern long oggpackB_look1(oggpack_buffer *b);extern void oggpackB_adv(oggpack_buffer *b,int bits);extern void oggpackB_adv1(oggpack_buffer *b);extern long oggpackB_read(oggpack_buffer *b,int bits);extern long oggpackB_read1(oggpack_buffer *b);extern long oggpackB_bytes(oggpack_buffer *b);extern long oggpackB_bits(oggpack_buffer *b);extern unsigned char *oggpackB_get_buffer(oggpack_buffer *b);/* Ogg BITSTREAM PRIMITIVES: encoding **************************/extern int ogg_stream_packetin(ogg_stream_state *os, ogg_packet *op);extern int ogg_stream_iovecin(ogg_stream_state *os, ogg_iovec_t *iov, int count, long e_o_s, ogg_int64_t granulepos);extern int ogg_stream_pageout(ogg_stream_state *os, ogg_page *og);extern int ogg_stream_pageout_fill(ogg_stream_state *os, ogg_page *og, int nfill);extern int ogg_stream_flush(ogg_stream_state *os, ogg_page *og);extern int ogg_stream_flush_fill(ogg_stream_state *os, ogg_page *og, int nfill);/* Ogg BITSTREAM PRIMITIVES: decoding **************************/extern int ogg_sync_init(ogg_sync_state *oy);extern int ogg_sync_clear(ogg_sync_state *oy);extern int ogg_sync_reset(ogg_sync_state *oy);extern int ogg_sync_destroy(ogg_sync_state *oy);extern int ogg_sync_check(ogg_sync_state *oy);extern char *ogg_sync_buffer(ogg_sync_state *oy, long size);extern int ogg_sync_wrote(ogg_sync_state *oy, long bytes);extern long ogg_sync_pageseek(ogg_sync_state *oy,ogg_page *og);extern int ogg_sync_pageout(ogg_sync_state *oy, ogg_page *og);extern int ogg_stream_pagein(ogg_stream_state *os, ogg_page *og);extern int ogg_stream_packetout(ogg_stream_state *os,ogg_packet *op);extern int ogg_stream_packetpeek(ogg_stream_state *os,ogg_packet *op);/* Ogg BITSTREAM PRIMITIVES: general ***************************/extern int ogg_stream_init(ogg_stream_state *os,int serialno);extern int ogg_stream_clear(ogg_stream_state *os);extern int ogg_stream_reset(ogg_stream_state *os);extern int ogg_stream_reset_serialno(ogg_stream_state *os,int serialno);extern int ogg_stream_destroy(ogg_stream_state *os);extern int ogg_stream_check(ogg_stream_state *os);extern int ogg_stream_eos(ogg_stream_state *os);extern void ogg_page_checksum_set(ogg_page *og);extern int ogg_page_version(const ogg_page *og);extern int ogg_page_continued(const ogg_page *og);extern int ogg_page_bos(const ogg_page *og);extern int ogg_page_eos(const ogg_page *og);extern ogg_int64_t ogg_page_granulepos(const ogg_page *og);extern int ogg_page_serialno(const ogg_page *og);extern long ogg_page_pageno(const ogg_page *og);extern int ogg_page_packets(const ogg_page *og);extern void ogg_packet_clear(ogg_packet *op);#ifdef __cplusplus}#endif#endif /* _OGG_H */vendor/ogg/include/ogg/os_types.hadded
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2002 * * by the Xiph.Org Foundation http://www.xiph.org/ * * * ******************************************************************** function: Define a consistent set of types on each platform. ********************************************************************/#ifndef _OS_TYPES_H#define _OS_TYPES_H/* make it easy on the folks that want to compile the libs with a different malloc than stdlib */#define _ogg_malloc malloc#define _ogg_calloc calloc#define _ogg_realloc realloc#define _ogg_free free#if defined(_WIN32)# if defined(__CYGWIN__)# include <stdint.h> typedef int16_t ogg_int16_t; typedef uint16_t ogg_uint16_t; typedef int32_t ogg_int32_t; typedef uint32_t ogg_uint32_t; typedef int64_t ogg_int64_t; typedef uint64_t ogg_uint64_t;# elif defined(__MINGW32__)# include <sys/types.h> typedef short ogg_int16_t; typedef unsigned short ogg_uint16_t; typedef int ogg_int32_t; typedef unsigned int ogg_uint32_t; typedef long long ogg_int64_t; typedef unsigned long long ogg_uint64_t;# elif defined(__MWERKS__) typedef long long ogg_int64_t; typedef unsigned long long ogg_uint64_t; typedef int ogg_int32_t; typedef unsigned int ogg_uint32_t; typedef short ogg_int16_t; typedef unsigned short ogg_uint16_t;# else# if defined(_MSC_VER) && (_MSC_VER >= 1800) /* MSVC 2013 and newer */# include <stdint.h> typedef int16_t ogg_int16_t; typedef uint16_t ogg_uint16_t; typedef int32_t ogg_int32_t; typedef uint32_t ogg_uint32_t; typedef int64_t ogg_int64_t; typedef uint64_t ogg_uint64_t;# else /* MSVC/Borland */ typedef __int64 ogg_int64_t; typedef __int32 ogg_int32_t; typedef unsigned __int32 ogg_uint32_t; typedef unsigned __int64 ogg_uint64_t; typedef __int16 ogg_int16_t; typedef unsigned __int16 ogg_uint16_t;# endif# endif#elif (defined(__APPLE__) && defined(__MACH__)) /* MacOS X Framework build */# include <sys/types.h> typedef int16_t ogg_int16_t; typedef u_int16_t ogg_uint16_t; typedef int32_t ogg_int32_t; typedef u_int32_t ogg_uint32_t; typedef int64_t ogg_int64_t; typedef u_int64_t ogg_uint64_t;#elif defined(__HAIKU__) /* Haiku */# include <sys/types.h> typedef short ogg_int16_t; typedef unsigned short ogg_uint16_t; typedef int ogg_int32_t; typedef unsigned int ogg_uint32_t; typedef long long ogg_int64_t; typedef unsigned long long ogg_uint64_t;#elif defined(__BEOS__) /* Be */# include <inttypes.h> typedef int16_t ogg_int16_t; typedef uint16_t ogg_uint16_t; typedef int32_t ogg_int32_t; typedef uint32_t ogg_uint32_t; typedef int64_t ogg_int64_t; typedef uint64_t ogg_uint64_t;#elif defined (__EMX__) /* OS/2 GCC */ typedef short ogg_int16_t; typedef unsigned short ogg_uint16_t; typedef int ogg_int32_t; typedef unsigned int ogg_uint32_t; typedef long long ogg_int64_t; typedef unsigned long long ogg_uint64_t;#elif defined (DJGPP) /* DJGPP */ typedef short ogg_int16_t; typedef int ogg_int32_t; typedef unsigned int ogg_uint32_t; typedef long long ogg_int64_t; typedef unsigned long long ogg_uint64_t;#elif defined(R5900) /* PS2 EE */ typedef long ogg_int64_t; typedef unsigned long ogg_uint64_t; typedef int ogg_int32_t; typedef unsigned ogg_uint32_t; typedef short ogg_int16_t;#elif defined(__SYMBIAN32__) /* Symbian GCC */ typedef signed short ogg_int16_t; typedef unsigned short ogg_uint16_t; typedef signed int ogg_int32_t; typedef unsigned int ogg_uint32_t; typedef long long int ogg_int64_t; typedef unsigned long long int ogg_uint64_t;#elif defined(__TMS320C6X__) /* TI C64x compiler */ typedef signed short ogg_int16_t; typedef unsigned short ogg_uint16_t; typedef signed int ogg_int32_t; typedef unsigned int ogg_uint32_t; typedef long long int ogg_int64_t; typedef unsigned long long int ogg_uint64_t;#else# include <ogg/config_types.h>#endif#endif /* _OS_TYPES_H */vendor/ogg/src/bitwise.cadded
/******************************************************************** * * * THIS FILE IS PART OF THE Ogg CONTAINER SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2014 * * by the Xiph.Org Foundation http://www.xiph.org/ * * * ******************************************************************** function: packing variable sized words into an octet stream ********************************************************************//* We're 'LSb' endian; if we write a word but read individual bits, then we'll read the lsb first */#include <string.h>#include <stdlib.h>#include <limits.h>#include <ogg/ogg.h>#define BUFFER_INCREMENT 256static const unsigned long mask[]={0x00000000,0x00000001,0x00000003,0x00000007,0x0000000f, 0x0000001f,0x0000003f,0x0000007f,0x000000ff,0x000001ff, 0x000003ff,0x000007ff,0x00000fff,0x00001fff,0x00003fff, 0x00007fff,0x0000ffff,0x0001ffff,0x0003ffff,0x0007ffff, 0x000fffff,0x001fffff,0x003fffff,0x007fffff,0x00ffffff, 0x01ffffff,0x03ffffff,0x07ffffff,0x0fffffff,0x1fffffff, 0x3fffffff,0x7fffffff,0xffffffff };static const unsigned int mask8B[]={0x00,0x80,0xc0,0xe0,0xf0,0xf8,0xfc,0xfe,0xff};void oggpack_writeinit(oggpack_buffer *b){ memset(b,0,sizeof(*b)); b->ptr=b->buffer=_ogg_malloc(BUFFER_INCREMENT); if (!b->buffer) return; b->buffer[0]='\0'; b->storage=BUFFER_INCREMENT;}void oggpackB_writeinit(oggpack_buffer *b){ oggpack_writeinit(b);}int oggpack_writecheck(oggpack_buffer *b){ if(!b->ptr || !b->storage)return -1; return 0;}int oggpackB_writecheck(oggpack_buffer *b){ return oggpack_writecheck(b);}void oggpack_writetrunc(oggpack_buffer *b,long bits){ long bytes=bits>>3; if(b->ptr){ bits-=bytes*8; b->ptr=b->buffer+bytes; b->endbit=bits; b->endbyte=bytes; *b->ptr&=mask[bits]; }}void oggpackB_writetrunc(oggpack_buffer *b,long bits){ long bytes=bits>>3; if(b->ptr){ bits-=bytes*8; b->ptr=b->buffer+bytes; b->endbit=bits; b->endbyte=bytes; *b->ptr&=mask8B[bits]; }}/* Takes only up to 32 bits. */void oggpack_write(oggpack_buffer *b,unsigned long value,int bits){ if(bits<0 || bits>32) goto err; if(b->endbyte>=b->storage-4){ void *ret; if(!b->ptr)return; if(b->storage>LONG_MAX-BUFFER_INCREMENT) goto err; ret=_ogg_realloc(b->buffer,b->storage+BUFFER_INCREMENT); if(!ret) goto err; b->buffer=ret; b->storage+=BUFFER_INCREMENT; b->ptr=b->buffer+b->endbyte; } value&=mask[bits]; bits+=b->endbit; b->ptr[0]|=value<<b->endbit; if(bits>=8){ b->ptr[1]=(unsigned char)(value>>(8-b->endbit)); if(bits>=16){ b->ptr[2]=(unsigned char)(value>>(16-b->endbit)); if(bits>=24){ b->ptr[3]=(unsigned char)(value>>(24-b->endbit)); if(bits>=32){ if(b->endbit) b->ptr[4]=(unsigned char)(value>>(32-b->endbit)); else b->ptr[4]=0; } } } } b->endbyte+=bits/8; b->ptr+=bits/8; b->endbit=bits&7; return; err: oggpack_writeclear(b);}/* Takes only up to 32 bits. */void oggpackB_write(oggpack_buffer *b,unsigned long value,int bits){ if(bits<0 || bits>32) goto err; if(b->endbyte>=b->storage-4){ void *ret; if(!b->ptr)return; if(b->storage>LONG_MAX-BUFFER_INCREMENT) goto err; ret=_ogg_realloc(b->buffer,b->storage+BUFFER_INCREMENT); if(!ret) goto err; b->buffer=ret; b->storage+=BUFFER_INCREMENT; b->ptr=b->buffer+b->endbyte; } value=(value&mask[bits])<<(32-bits); bits+=b->endbit; b->ptr[0]|=value>>(24+b->endbit); if(bits>=8){ b->ptr[1]=(unsigned char)(value>>(16+b->endbit)); if(bits>=16){ b->ptr[2]=(unsigned char)(value>>(8+b->endbit)); if(bits>=24){ b->ptr[3]=(unsigned char)(value>>(b->endbit)); if(bits>=32){ if(b->endbit) b->ptr[4]=(unsigned char)(value<<(8-b->endbit)); else b->ptr[4]=0; } } } } b->endbyte+=bits/8; b->ptr+=bits/8; b->endbit=bits&7; return; err: oggpack_writeclear(b);}void oggpack_writealign(oggpack_buffer *b){ int bits=8-b->endbit; if(bits<8) oggpack_write(b,0,bits);}void oggpackB_writealign(oggpack_buffer *b){ int bits=8-b->endbit; if(bits<8) oggpackB_write(b,0,bits);}static void oggpack_writecopy_helper(oggpack_buffer *b, void *source, long bits, void (*w)(oggpack_buffer *, unsigned long, int), int msb){ unsigned char *ptr=(unsigned char *)source; long bytes=bits/8; long pbytes=(b->endbit+bits)/8; bits-=bytes*8; /* expand storage up-front */ if(b->endbyte+pbytes>=b->storage){ void *ret; if(!b->ptr) goto err; if(b->storage>b->endbyte+pbytes+BUFFER_INCREMENT) goto err; b->storage=b->endbyte+pbytes+BUFFER_INCREMENT; ret=_ogg_realloc(b->buffer,b->storage); if(!ret) goto err; b->buffer=ret; b->ptr=b->buffer+b->endbyte; } /* copy whole octets */ if(b->endbit){ int i; /* unaligned copy. Do it the hard way. */ for(i=0;i<bytes;i++) w(b,(unsigned long)(ptr[i]),8); }else{ /* aligned block copy */ memmove(b->ptr,source,bytes); b->ptr+=bytes; b->endbyte+=bytes; *b->ptr=0; } /* copy trailing bits */ if(bits){ if(msb) w(b,(unsigned long)(ptr[bytes]>>(8-bits)),bits); else w(b,(unsigned long)(ptr[bytes]),bits); } return; err: oggpack_writeclear(b);}void oggpack_writecopy(oggpack_buffer *b,void *source,long bits){ oggpack_writecopy_helper(b,source,bits,oggpack_write,0);}void oggpackB_writecopy(oggpack_buffer *b,void *source,long bits){ oggpack_writecopy_helper(b,source,bits,oggpackB_write,1);}void oggpack_reset(oggpack_buffer *b){ if(!b->ptr)return; b->ptr=b->buffer; b->buffer[0]=0; b->endbit=b->endbyte=0;}void oggpackB_reset(oggpack_buffer *b){ oggpack_reset(b);}void oggpack_writeclear(oggpack_buffer *b){ if(b->buffer)_ogg_free(b->buffer); memset(b,0,sizeof(*b));}void oggpackB_writeclear(oggpack_buffer *b){ oggpack_writeclear(b);}void oggpack_readinit(oggpack_buffer *b,unsigned char *buf,int bytes){ memset(b,0,sizeof(*b)); b->buffer=b->ptr=buf; b->storage=bytes;}void oggpackB_readinit(oggpack_buffer *b,unsigned char *buf,int bytes){ oggpack_readinit(b,buf,bytes);}/* Read in bits without advancing the bitptr; bits <= 32 */long oggpack_look(oggpack_buffer *b,int bits){ unsigned long ret; unsigned long m; if(bits<0 || bits>32) return -1; m=mask[bits]; bits+=b->endbit; if(b->endbyte >= b->storage-4){ /* not the main path */ if(b->endbyte > b->storage-((bits+7)>>3)) return -1; /* special case to avoid reading b->ptr[0], which might be past the end of the buffer; also skips some useless accounting */ else if(!bits)return(0L); } ret=b->ptr[0]>>b->endbit; if(bits>8){ ret|=(unsigned long)b->ptr[1]<<(8-b->endbit); if(bits>16){ ret|=(unsigned long)b->ptr[2]<<(16-b->endbit); if(bits>24){ ret|=(unsigned long)b->ptr[3]<<(24-b->endbit); if(bits>32 && b->endbit) ret|=(unsigned long)b->ptr[4]<<(32-b->endbit); } } } return(m&ret);}/* Read in bits without advancing the bitptr; bits <= 32 */long oggpackB_look(oggpack_buffer *b,int bits){ unsigned long ret; int m=32-bits; if(m<0 || m>32) return -1; bits+=b->endbit; if(b->endbyte >= b->storage-4){ /* not the main path */ if(b->endbyte > b->storage-((bits+7)>>3)) return -1; /* special case to avoid reading b->ptr[0], which might be past the end of the buffer; also skips some useless accounting */ else if(!bits)return(0L); } ret=(unsigned long)b->ptr[0]<<(24+b->endbit); if(bits>8){ ret|=(unsigned long)b->ptr[1]<<(16+b->endbit); if(bits>16){ ret|=(unsigned long)b->ptr[2]<<(8+b->endbit); if(bits>24){ ret|=(unsigned long)b->ptr[3]<<(b->endbit); if(bits>32 && b->endbit) ret|=b->ptr[4]>>(8-b->endbit); } } } return ((ret&0xffffffff)>>(m>>1))>>((m+1)>>1);}long oggpack_look1(oggpack_buffer *b){ if(b->endbyte>=b->storage)return(-1); return((b->ptr[0]>>b->endbit)&1);}long oggpackB_look1(oggpack_buffer *b){ if(b->endbyte>=b->storage)return(-1); return((b->ptr[0]>>(7-b->endbit))&1);}void oggpack_adv(oggpack_buffer *b,int bits){ bits+=b->endbit; if(b->endbyte > b->storage-((bits+7)>>3)) goto overflow; b->ptr+=bits/8; b->endbyte+=bits/8; b->endbit=bits&7; return; overflow: b->ptr=NULL; b->endbyte=b->storage; b->endbit=1;}void oggpackB_adv(oggpack_buffer *b,int bits){ oggpack_adv(b,bits);}void oggpack_adv1(oggpack_buffer *b){ if(++(b->endbit)>7){ b->endbit=0; b->ptr++; b->endbyte++; }}void oggpackB_adv1(oggpack_buffer *b){ oggpack_adv1(b);}/* bits <= 32 */long oggpack_read(oggpack_buffer *b,int bits){ long ret; unsigned long m; if(bits<0 || bits>32) goto err; m=mask[bits]; bits+=b->endbit; if(b->endbyte >= b->storage-4){ /* not the main path */ if(b->endbyte > b->storage-((bits+7)>>3)) goto overflow; /* special case to avoid reading b->ptr[0], which might be past the end of the buffer; also skips some useless accounting */ else if(!bits)return(0L); } ret=b->ptr[0]>>b->endbit; if(bits>8){ ret|=(unsigned long)b->ptr[1]<<(8-b->endbit); if(bits>16){ ret|=(unsigned long)b->ptr[2]<<(16-b->endbit); if(bits>24){ ret|=(unsigned long)b->ptr[3]<<(24-b->endbit); if(bits>32 && b->endbit){ ret|=(unsigned long)b->ptr[4]<<(32-b->endbit); } } } } ret&=m; b->ptr+=bits/8; b->endbyte+=bits/8; b->endbit=bits&7; return ret; overflow: err: b->ptr=NULL; b->endbyte=b->storage; b->endbit=1; return -1L;}/* bits <= 32 */long oggpackB_read(oggpack_buffer *b,int bits){ long ret; long m=32-bits; if(m<0 || m>32) goto err; bits+=b->endbit; if(b->endbyte+4>=b->storage){ /* not the main path */ if(b->endbyte > b->storage-((bits+7)>>3)) goto overflow; /* special case to avoid reading b->ptr[0], which might be past the end of the buffer; also skips some useless accounting */ else if(!bits)return(0L); } ret=(unsigned long)b->ptr[0]<<(24+b->endbit); if(bits>8){ ret|=(unsigned long)b->ptr[1]<<(16+b->endbit); if(bits>16){ ret|=(unsigned long)b->ptr[2]<<(8+b->endbit); if(bits>24){ ret|=(unsigned long)b->ptr[3]<<(b->endbit); if(bits>32 && b->endbit) ret|=b->ptr[4]>>(8-b->endbit); } } } ret=((ret&0xffffffffUL)>>(m>>1))>>((m+1)>>1); b->ptr+=bits/8; b->endbyte+=bits/8; b->endbit=bits&7; return ret; overflow: err: b->ptr=NULL; b->endbyte=b->storage; b->endbit=1; return -1L;}long oggpack_read1(oggpack_buffer *b){ long ret; if(b->endbyte >= b->storage) goto overflow; ret=(b->ptr[0]>>b->endbit)&1; b->endbit++; if(b->endbit>7){ b->endbit=0; b->ptr++; b->endbyte++; } return ret; overflow: b->ptr=NULL; b->endbyte=b->storage; b->endbit=1; return -1L;}long oggpackB_read1(oggpack_buffer *b){ long ret; if(b->endbyte >= b->storage) goto overflow; ret=(b->ptr[0]>>(7-b->endbit))&1; b->endbit++; if(b->endbit>7){ b->endbit=0; b->ptr++; b->endbyte++; } return ret; overflow: b->ptr=NULL; b->endbyte=b->storage;Showing the first 500 of 1090 diff lines for this file. This diff is INCOMPLETE; read the file or clone the repository for the rest.
vendor/ogg/src/crctable.hadded
/******************************************************************** * * * THIS FILE IS PART OF THE Ogg CONTAINER SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2018 * * by the Xiph.Org Foundation http://www.xiph.org/ * * * ********************************************************************/#include <ogg/os_types.h>static const ogg_uint32_t crc_lookup[8][256]={{0x00000000,0x04c11db7,0x09823b6e,0x0d4326d9,0x130476dc,0x17c56b6b,0x1a864db2,0x1e475005, 0x2608edb8,0x22c9f00f,0x2f8ad6d6,0x2b4bcb61,0x350c9b64,0x31cd86d3,0x3c8ea00a,0x384fbdbd, 0x4c11db70,0x48d0c6c7,0x4593e01e,0x4152fda9,0x5f15adac,0x5bd4b01b,0x569796c2,0x52568b75, 0x6a1936c8,0x6ed82b7f,0x639b0da6,0x675a1011,0x791d4014,0x7ddc5da3,0x709f7b7a,0x745e66cd, 0x9823b6e0,0x9ce2ab57,0x91a18d8e,0x95609039,0x8b27c03c,0x8fe6dd8b,0x82a5fb52,0x8664e6e5, 0xbe2b5b58,0xbaea46ef,0xb7a96036,0xb3687d81,0xad2f2d84,0xa9ee3033,0xa4ad16ea,0xa06c0b5d, 0xd4326d90,0xd0f37027,0xddb056fe,0xd9714b49,0xc7361b4c,0xc3f706fb,0xceb42022,0xca753d95, 0xf23a8028,0xf6fb9d9f,0xfbb8bb46,0xff79a6f1,0xe13ef6f4,0xe5ffeb43,0xe8bccd9a,0xec7dd02d, 0x34867077,0x30476dc0,0x3d044b19,0x39c556ae,0x278206ab,0x23431b1c,0x2e003dc5,0x2ac12072, 0x128e9dcf,0x164f8078,0x1b0ca6a1,0x1fcdbb16,0x018aeb13,0x054bf6a4,0x0808d07d,0x0cc9cdca, 0x7897ab07,0x7c56b6b0,0x71159069,0x75d48dde,0x6b93dddb,0x6f52c06c,0x6211e6b5,0x66d0fb02, 0x5e9f46bf,0x5a5e5b08,0x571d7dd1,0x53dc6066,0x4d9b3063,0x495a2dd4,0x44190b0d,0x40d816ba, 0xaca5c697,0xa864db20,0xa527fdf9,0xa1e6e04e,0xbfa1b04b,0xbb60adfc,0xb6238b25,0xb2e29692, 0x8aad2b2f,0x8e6c3698,0x832f1041,0x87ee0df6,0x99a95df3,0x9d684044,0x902b669d,0x94ea7b2a, 0xe0b41de7,0xe4750050,0xe9362689,0xedf73b3e,0xf3b06b3b,0xf771768c,0xfa325055,0xfef34de2, 0xc6bcf05f,0xc27dede8,0xcf3ecb31,0xcbffd686,0xd5b88683,0xd1799b34,0xdc3abded,0xd8fba05a, 0x690ce0ee,0x6dcdfd59,0x608edb80,0x644fc637,0x7a089632,0x7ec98b85,0x738aad5c,0x774bb0eb, 0x4f040d56,0x4bc510e1,0x46863638,0x42472b8f,0x5c007b8a,0x58c1663d,0x558240e4,0x51435d53, 0x251d3b9e,0x21dc2629,0x2c9f00f0,0x285e1d47,0x36194d42,0x32d850f5,0x3f9b762c,0x3b5a6b9b, 0x0315d626,0x07d4cb91,0x0a97ed48,0x0e56f0ff,0x1011a0fa,0x14d0bd4d,0x19939b94,0x1d528623, 0xf12f560e,0xf5ee4bb9,0xf8ad6d60,0xfc6c70d7,0xe22b20d2,0xe6ea3d65,0xeba91bbc,0xef68060b, 0xd727bbb6,0xd3e6a601,0xdea580d8,0xda649d6f,0xc423cd6a,0xc0e2d0dd,0xcda1f604,0xc960ebb3, 0xbd3e8d7e,0xb9ff90c9,0xb4bcb610,0xb07daba7,0xae3afba2,0xaafbe615,0xa7b8c0cc,0xa379dd7b, 0x9b3660c6,0x9ff77d71,0x92b45ba8,0x9675461f,0x8832161a,0x8cf30bad,0x81b02d74,0x857130c3, 0x5d8a9099,0x594b8d2e,0x5408abf7,0x50c9b640,0x4e8ee645,0x4a4ffbf2,0x470cdd2b,0x43cdc09c, 0x7b827d21,0x7f436096,0x7200464f,0x76c15bf8,0x68860bfd,0x6c47164a,0x61043093,0x65c52d24, 0x119b4be9,0x155a565e,0x18197087,0x1cd86d30,0x029f3d35,0x065e2082,0x0b1d065b,0x0fdc1bec, 0x3793a651,0x3352bbe6,0x3e119d3f,0x3ad08088,0x2497d08d,0x2056cd3a,0x2d15ebe3,0x29d4f654, 0xc5a92679,0xc1683bce,0xcc2b1d17,0xc8ea00a0,0xd6ad50a5,0xd26c4d12,0xdf2f6bcb,0xdbee767c, 0xe3a1cbc1,0xe760d676,0xea23f0af,0xeee2ed18,0xf0a5bd1d,0xf464a0aa,0xf9278673,0xfde69bc4, 0x89b8fd09,0x8d79e0be,0x803ac667,0x84fbdbd0,0x9abc8bd5,0x9e7d9662,0x933eb0bb,0x97ffad0c, 0xafb010b1,0xab710d06,0xa6322bdf,0xa2f33668,0xbcb4666d,0xb8757bda,0xb5365d03,0xb1f740b4},{0x00000000,0xd219c1dc,0xa0f29e0f,0x72eb5fd3,0x452421a9,0x973de075,0xe5d6bfa6,0x37cf7e7a, 0x8a484352,0x5851828e,0x2abadd5d,0xf8a31c81,0xcf6c62fb,0x1d75a327,0x6f9efcf4,0xbd873d28, 0x10519b13,0xc2485acf,0xb0a3051c,0x62bac4c0,0x5575baba,0x876c7b66,0xf58724b5,0x279ee569, 0x9a19d841,0x4800199d,0x3aeb464e,0xe8f28792,0xdf3df9e8,0x0d243834,0x7fcf67e7,0xadd6a63b, 0x20a33626,0xf2baf7fa,0x8051a829,0x524869f5,0x6587178f,0xb79ed653,0xc5758980,0x176c485c, 0xaaeb7574,0x78f2b4a8,0x0a19eb7b,0xd8002aa7,0xefcf54dd,0x3dd69501,0x4f3dcad2,0x9d240b0e, 0x30f2ad35,0xe2eb6ce9,0x9000333a,0x4219f2e6,0x75d68c9c,0xa7cf4d40,0xd5241293,0x073dd34f, 0xbabaee67,0x68a32fbb,0x1a487068,0xc851b1b4,0xff9ecfce,0x2d870e12,0x5f6c51c1,0x8d75901d, 0x41466c4c,0x935fad90,0xe1b4f243,0x33ad339f,0x04624de5,0xd67b8c39,0xa490d3ea,0x76891236, 0xcb0e2f1e,0x1917eec2,0x6bfcb111,0xb9e570cd,0x8e2a0eb7,0x5c33cf6b,0x2ed890b8,0xfcc15164, 0x5117f75f,0x830e3683,0xf1e56950,0x23fca88c,0x1433d6f6,0xc62a172a,0xb4c148f9,0x66d88925, 0xdb5fb40d,0x094675d1,0x7bad2a02,0xa9b4ebde,0x9e7b95a4,0x4c625478,0x3e890bab,0xec90ca77, 0x61e55a6a,0xb3fc9bb6,0xc117c465,0x130e05b9,0x24c17bc3,0xf6d8ba1f,0x8433e5cc,0x562a2410, 0xebad1938,0x39b4d8e4,0x4b5f8737,0x994646eb,0xae893891,0x7c90f94d,0x0e7ba69e,0xdc626742, 0x71b4c179,0xa3ad00a5,0xd1465f76,0x035f9eaa,0x3490e0d0,0xe689210c,0x94627edf,0x467bbf03, 0xfbfc822b,0x29e543f7,0x5b0e1c24,0x8917ddf8,0xbed8a382,0x6cc1625e,0x1e2a3d8d,0xcc33fc51, 0x828cd898,0x50951944,0x227e4697,0xf067874b,0xc7a8f931,0x15b138ed,0x675a673e,0xb543a6e2, 0x08c49bca,0xdadd5a16,0xa83605c5,0x7a2fc419,0x4de0ba63,0x9ff97bbf,0xed12246c,0x3f0be5b0, 0x92dd438b,0x40c48257,0x322fdd84,0xe0361c58,0xd7f96222,0x05e0a3fe,0x770bfc2d,0xa5123df1, 0x189500d9,0xca8cc105,0xb8679ed6,0x6a7e5f0a,0x5db12170,0x8fa8e0ac,0xfd43bf7f,0x2f5a7ea3, 0xa22feebe,0x70362f62,0x02dd70b1,0xd0c4b16d,0xe70bcf17,0x35120ecb,0x47f95118,0x95e090c4, 0x2867adec,0xfa7e6c30,0x889533e3,0x5a8cf23f,0x6d438c45,0xbf5a4d99,0xcdb1124a,0x1fa8d396, 0xb27e75ad,0x6067b471,0x128ceba2,0xc0952a7e,0xf75a5404,0x254395d8,0x57a8ca0b,0x85b10bd7, 0x383636ff,0xea2ff723,0x98c4a8f0,0x4add692c,0x7d121756,0xaf0bd68a,0xdde08959,0x0ff94885, 0xc3cab4d4,0x11d37508,0x63382adb,0xb121eb07,0x86ee957d,0x54f754a1,0x261c0b72,0xf405caae, 0x4982f786,0x9b9b365a,0xe9706989,0x3b69a855,0x0ca6d62f,0xdebf17f3,0xac544820,0x7e4d89fc, 0xd39b2fc7,0x0182ee1b,0x7369b1c8,0xa1707014,0x96bf0e6e,0x44a6cfb2,0x364d9061,0xe45451bd, 0x59d36c95,0x8bcaad49,0xf921f29a,0x2b383346,0x1cf74d3c,0xceee8ce0,0xbc05d333,0x6e1c12ef, 0xe36982f2,0x3170432e,0x439b1cfd,0x9182dd21,0xa64da35b,0x74546287,0x06bf3d54,0xd4a6fc88, 0x6921c1a0,0xbb38007c,0xc9d35faf,0x1bca9e73,0x2c05e009,0xfe1c21d5,0x8cf77e06,0x5eeebfda, 0xf33819e1,0x2121d83d,0x53ca87ee,0x81d34632,0xb61c3848,0x6405f994,0x16eea647,0xc4f7679b, 0x79705ab3,0xab699b6f,0xd982c4bc,0x0b9b0560,0x3c547b1a,0xee4dbac6,0x9ca6e515,0x4ebf24c9},{0x00000000,0x01d8ac87,0x03b1590e,0x0269f589,0x0762b21c,0x06ba1e9b,0x04d3eb12,0x050b4795, 0x0ec56438,0x0f1dc8bf,0x0d743d36,0x0cac91b1,0x09a7d624,0x087f7aa3,0x0a168f2a,0x0bce23ad, 0x1d8ac870,0x1c5264f7,0x1e3b917e,0x1fe33df9,0x1ae87a6c,0x1b30d6eb,0x19592362,0x18818fe5, 0x134fac48,0x129700cf,0x10fef546,0x112659c1,0x142d1e54,0x15f5b2d3,0x179c475a,0x1644ebdd, 0x3b1590e0,0x3acd3c67,0x38a4c9ee,0x397c6569,0x3c7722fc,0x3daf8e7b,0x3fc67bf2,0x3e1ed775, 0x35d0f4d8,0x3408585f,0x3661add6,0x37b90151,0x32b246c4,0x336aea43,0x31031fca,0x30dbb34d, 0x269f5890,0x2747f417,0x252e019e,0x24f6ad19,0x21fdea8c,0x2025460b,0x224cb382,0x23941f05, 0x285a3ca8,0x2982902f,0x2beb65a6,0x2a33c921,0x2f388eb4,0x2ee02233,0x2c89d7ba,0x2d517b3d, 0x762b21c0,0x77f38d47,0x759a78ce,0x7442d449,0x714993dc,0x70913f5b,0x72f8cad2,0x73206655, 0x78ee45f8,0x7936e97f,0x7b5f1cf6,0x7a87b071,0x7f8cf7e4,0x7e545b63,0x7c3daeea,0x7de5026d, 0x6ba1e9b0,0x6a794537,0x6810b0be,0x69c81c39,0x6cc35bac,0x6d1bf72b,0x6f7202a2,0x6eaaae25, 0x65648d88,0x64bc210f,0x66d5d486,0x670d7801,0x62063f94,0x63de9313,0x61b7669a,0x606fca1d, 0x4d3eb120,0x4ce61da7,0x4e8fe82e,0x4f5744a9,0x4a5c033c,0x4b84afbb,0x49ed5a32,0x4835f6b5, 0x43fbd518,0x4223799f,0x404a8c16,0x41922091,0x44996704,0x4541cb83,0x47283e0a,0x46f0928d, 0x50b47950,0x516cd5d7,0x5305205e,0x52dd8cd9,0x57d6cb4c,0x560e67cb,0x54679242,0x55bf3ec5, 0x5e711d68,0x5fa9b1ef,0x5dc04466,0x5c18e8e1,0x5913af74,0x58cb03f3,0x5aa2f67a,0x5b7a5afd, 0xec564380,0xed8eef07,0xefe71a8e,0xee3fb609,0xeb34f19c,0xeaec5d1b,0xe885a892,0xe95d0415, 0xe29327b8,0xe34b8b3f,0xe1227eb6,0xe0fad231,0xe5f195a4,0xe4293923,0xe640ccaa,0xe798602d, 0xf1dc8bf0,0xf0042777,0xf26dd2fe,0xf3b57e79,0xf6be39ec,0xf766956b,0xf50f60e2,0xf4d7cc65, 0xff19efc8,0xfec1434f,0xfca8b6c6,0xfd701a41,0xf87b5dd4,0xf9a3f153,0xfbca04da,0xfa12a85d, 0xd743d360,0xd69b7fe7,0xd4f28a6e,0xd52a26e9,0xd021617c,0xd1f9cdfb,0xd3903872,0xd24894f5, 0xd986b758,0xd85e1bdf,0xda37ee56,0xdbef42d1,0xdee40544,0xdf3ca9c3,0xdd555c4a,0xdc8df0cd, 0xcac91b10,0xcb11b797,0xc978421e,0xc8a0ee99,0xcdaba90c,0xcc73058b,0xce1af002,0xcfc25c85, 0xc40c7f28,0xc5d4d3af,0xc7bd2626,0xc6658aa1,0xc36ecd34,0xc2b661b3,0xc0df943a,0xc10738bd, 0x9a7d6240,0x9ba5cec7,0x99cc3b4e,0x981497c9,0x9d1fd05c,0x9cc77cdb,0x9eae8952,0x9f7625d5, 0x94b80678,0x9560aaff,0x97095f76,0x96d1f3f1,0x93dab464,0x920218e3,0x906bed6a,0x91b341ed, 0x87f7aa30,0x862f06b7,0x8446f33e,0x859e5fb9,0x8095182c,0x814db4ab,0x83244122,0x82fceda5, 0x8932ce08,0x88ea628f,0x8a839706,0x8b5b3b81,0x8e507c14,0x8f88d093,0x8de1251a,0x8c39899d, 0xa168f2a0,0xa0b05e27,0xa2d9abae,0xa3010729,0xa60a40bc,0xa7d2ec3b,0xa5bb19b2,0xa463b535, 0xafad9698,0xae753a1f,0xac1ccf96,0xadc46311,0xa8cf2484,0xa9178803,0xab7e7d8a,0xaaa6d10d, 0xbce23ad0,0xbd3a9657,0xbf5363de,0xbe8bcf59,0xbb8088cc,0xba58244b,0xb831d1c2,0xb9e97d45, 0xb2275ee8,0xb3fff26f,0xb19607e6,0xb04eab61,0xb545ecf4,0xb49d4073,0xb6f4b5fa,0xb72c197d},{0x00000000,0xdc6d9ab7,0xbc1a28d9,0x6077b26e,0x7cf54c05,0xa098d6b2,0xc0ef64dc,0x1c82fe6b, 0xf9ea980a,0x258702bd,0x45f0b0d3,0x999d2a64,0x851fd40f,0x59724eb8,0x3905fcd6,0xe5686661, 0xf7142da3,0x2b79b714,0x4b0e057a,0x97639fcd,0x8be161a6,0x578cfb11,0x37fb497f,0xeb96d3c8, 0x0efeb5a9,0xd2932f1e,0xb2e49d70,0x6e8907c7,0x720bf9ac,0xae66631b,0xce11d175,0x127c4bc2, 0xeae946f1,0x3684dc46,0x56f36e28,0x8a9ef49f,0x961c0af4,0x4a719043,0x2a06222d,0xf66bb89a, 0x1303defb,0xcf6e444c,0xaf19f622,0x73746c95,0x6ff692fe,0xb39b0849,0xd3ecba27,0x0f812090, 0x1dfd6b52,0xc190f1e5,0xa1e7438b,0x7d8ad93c,0x61082757,0xbd65bde0,0xdd120f8e,0x017f9539, 0xe417f358,0x387a69ef,0x580ddb81,0x84604136,0x98e2bf5d,0x448f25ea,0x24f89784,0xf8950d33, 0xd1139055,0x0d7e0ae2,0x6d09b88c,0xb164223b,0xade6dc50,0x718b46e7,0x11fcf489,0xcd916e3e, 0x28f9085f,0xf49492e8,0x94e32086,0x488eba31,0x540c445a,0x8861deed,0xe8166c83,0x347bf634, 0x2607bdf6,0xfa6a2741,0x9a1d952f,0x46700f98,0x5af2f1f3,0x869f6b44,0xe6e8d92a,0x3a85439d, 0xdfed25fc,0x0380bf4b,0x63f70d25,0xbf9a9792,0xa31869f9,0x7f75f34e,0x1f024120,0xc36fdb97, 0x3bfad6a4,0xe7974c13,0x87e0fe7d,0x5b8d64ca,0x470f9aa1,0x9b620016,0xfb15b278,0x277828cf, 0xc2104eae,0x1e7dd419,0x7e0a6677,0xa267fcc0,0xbee502ab,0x6288981c,0x02ff2a72,0xde92b0c5, 0xcceefb07,0x108361b0,0x70f4d3de,0xac994969,0xb01bb702,0x6c762db5,0x0c019fdb,0xd06c056c, 0x3504630d,0xe969f9ba,0x891e4bd4,0x5573d163,0x49f12f08,0x959cb5bf,0xf5eb07d1,0x29869d66, 0xa6e63d1d,0x7a8ba7aa,0x1afc15c4,0xc6918f73,0xda137118,0x067eebaf,0x660959c1,0xba64c376, 0x5f0ca517,0x83613fa0,0xe3168dce,0x3f7b1779,0x23f9e912,0xff9473a5,0x9fe3c1cb,0x438e5b7c, 0x51f210be,0x8d9f8a09,0xede83867,0x3185a2d0,0x2d075cbb,0xf16ac60c,0x911d7462,0x4d70eed5, 0xa81888b4,0x74751203,0x1402a06d,0xc86f3ada,0xd4edc4b1,0x08805e06,0x68f7ec68,0xb49a76df, 0x4c0f7bec,0x9062e15b,0xf0155335,0x2c78c982,0x30fa37e9,0xec97ad5e,0x8ce01f30,0x508d8587, 0xb5e5e3e6,0x69887951,0x09ffcb3f,0xd5925188,0xc910afe3,0x157d3554,0x750a873a,0xa9671d8d, 0xbb1b564f,0x6776ccf8,0x07017e96,0xdb6ce421,0xc7ee1a4a,0x1b8380fd,0x7bf43293,0xa799a824, 0x42f1ce45,0x9e9c54f2,0xfeebe69c,0x22867c2b,0x3e048240,0xe26918f7,0x821eaa99,0x5e73302e, 0x77f5ad48,0xab9837ff,0xcbef8591,0x17821f26,0x0b00e14d,0xd76d7bfa,0xb71ac994,0x6b775323, 0x8e1f3542,0x5272aff5,0x32051d9b,0xee68872c,0xf2ea7947,0x2e87e3f0,0x4ef0519e,0x929dcb29, 0x80e180eb,0x5c8c1a5c,0x3cfba832,0xe0963285,0xfc14ccee,0x20795659,0x400ee437,0x9c637e80, 0x790b18e1,0xa5668256,0xc5113038,0x197caa8f,0x05fe54e4,0xd993ce53,0xb9e47c3d,0x6589e68a, 0x9d1cebb9,0x4171710e,0x2106c360,0xfd6b59d7,0xe1e9a7bc,0x3d843d0b,0x5df38f65,0x819e15d2, 0x64f673b3,0xb89be904,0xd8ec5b6a,0x0481c1dd,0x18033fb6,0xc46ea501,0xa419176f,0x78748dd8, 0x6a08c61a,0xb6655cad,0xd612eec3,0x0a7f7474,0x16fd8a1f,0xca9010a8,0xaae7a2c6,0x768a3871, 0x93e25e10,0x4f8fc4a7,0x2ff876c9,0xf395ec7e,0xef171215,0x337a88a2,0x530d3acc,0x8f60a07b},{0x00000000,0x490d678d,0x921acf1a,0xdb17a897,0x20f48383,0x69f9e40e,0xb2ee4c99,0xfbe32b14, 0x41e90706,0x08e4608b,0xd3f3c81c,0x9afeaf91,0x611d8485,0x2810e308,0xf3074b9f,0xba0a2c12, 0x83d20e0c,0xcadf6981,0x11c8c116,0x58c5a69b,0xa3268d8f,0xea2bea02,0x313c4295,0x78312518, 0xc23b090a,0x8b366e87,0x5021c610,0x192ca19d,0xe2cf8a89,0xabc2ed04,0x70d54593,0x39d8221e, 0x036501af,0x4a686622,0x917fceb5,0xd872a938,0x2391822c,0x6a9ce5a1,0xb18b4d36,0xf8862abb, 0x428c06a9,0x0b816124,0xd096c9b3,0x999bae3e,0x6278852a,0x2b75e2a7,0xf0624a30,0xb96f2dbd, 0x80b70fa3,0xc9ba682e,0x12adc0b9,0x5ba0a734,0xa0438c20,0xe94eebad,0x3259433a,0x7b5424b7, 0xc15e08a5,0x88536f28,0x5344c7bf,0x1a49a032,0xe1aa8b26,0xa8a7ecab,0x73b0443c,0x3abd23b1, 0x06ca035e,0x4fc764d3,0x94d0cc44,0xddddabc9,0x263e80dd,0x6f33e750,0xb4244fc7,0xfd29284a, 0x47230458,0x0e2e63d5,0xd539cb42,0x9c34accf,0x67d787db,0x2edae056,0xf5cd48c1,0xbcc02f4c, 0x85180d52,0xcc156adf,0x1702c248,0x5e0fa5c5,0xa5ec8ed1,0xece1e95c,0x37f641cb,0x7efb2646, 0xc4f10a54,0x8dfc6dd9,0x56ebc54e,0x1fe6a2c3,0xe40589d7,0xad08ee5a,0x761f46cd,0x3f122140, 0x05af02f1,0x4ca2657c,0x97b5cdeb,0xdeb8aa66,0x255b8172,0x6c56e6ff,0xb7414e68,0xfe4c29e5, 0x444605f7,0x0d4b627a,0xd65ccaed,0x9f51ad60,0x64b28674,0x2dbfe1f9,0xf6a8496e,0xbfa52ee3, 0x867d0cfd,0xcf706b70,0x1467c3e7,0x5d6aa46a,0xa6898f7e,0xef84e8f3,0x34934064,0x7d9e27e9, 0xc7940bfb,0x8e996c76,0x558ec4e1,0x1c83a36c,0xe7608878,0xae6deff5,0x757a4762,0x3c7720ef, 0x0d9406bc,0x44996131,0x9f8ec9a6,0xd683ae2b,0x2d60853f,0x646de2b2,0xbf7a4a25,0xf6772da8, 0x4c7d01ba,0x05706637,0xde67cea0,0x976aa92d,0x6c898239,0x2584e5b4,0xfe934d23,0xb79e2aae, 0x8e4608b0,0xc74b6f3d,0x1c5cc7aa,0x5551a027,0xaeb28b33,0xe7bfecbe,0x3ca84429,0x75a523a4, 0xcfaf0fb6,0x86a2683b,0x5db5c0ac,0x14b8a721,0xef5b8c35,0xa656ebb8,0x7d41432f,0x344c24a2, 0x0ef10713,0x47fc609e,0x9cebc809,0xd5e6af84,0x2e058490,0x6708e31d,0xbc1f4b8a,0xf5122c07, 0x4f180015,0x06156798,0xdd02cf0f,0x940fa882,0x6fec8396,0x26e1e41b,0xfdf64c8c,0xb4fb2b01, 0x8d23091f,0xc42e6e92,0x1f39c605,0x5634a188,0xadd78a9c,0xe4daed11,0x3fcd4586,0x76c0220b, 0xccca0e19,0x85c76994,0x5ed0c103,0x17dda68e,0xec3e8d9a,0xa533ea17,0x7e244280,0x3729250d, 0x0b5e05e2,0x4253626f,0x9944caf8,0xd049ad75,0x2baa8661,0x62a7e1ec,0xb9b0497b,0xf0bd2ef6, 0x4ab702e4,0x03ba6569,0xd8adcdfe,0x91a0aa73,0x6a438167,0x234ee6ea,0xf8594e7d,0xb15429f0, 0x888c0bee,0xc1816c63,0x1a96c4f4,0x539ba379,0xa878886d,0xe175efe0,0x3a624777,0x736f20fa, 0xc9650ce8,0x80686b65,0x5b7fc3f2,0x1272a47f,0xe9918f6b,0xa09ce8e6,0x7b8b4071,0x328627fc, 0x083b044d,0x413663c0,0x9a21cb57,0xd32cacda,0x28cf87ce,0x61c2e043,0xbad548d4,0xf3d82f59, 0x49d2034b,0x00df64c6,0xdbc8cc51,0x92c5abdc,0x692680c8,0x202be745,0xfb3c4fd2,0xb231285f, 0x8be90a41,0xc2e46dcc,0x19f3c55b,0x50fea2d6,0xab1d89c2,0xe210ee4f,0x390746d8,0x700a2155, 0xca000d47,0x830d6aca,0x581ac25d,0x1117a5d0,0xeaf48ec4,0xa3f9e949,0x78ee41de,0x31e32653},{0x00000000,0x1b280d78,0x36501af0,0x2d781788,0x6ca035e0,0x77883898,0x5af02f10,0x41d82268, 0xd9406bc0,0xc26866b8,0xef107130,0xf4387c48,0xb5e05e20,0xaec85358,0x83b044d0,0x989849a8, 0xb641ca37,0xad69c74f,0x8011d0c7,0x9b39ddbf,0xdae1ffd7,0xc1c9f2af,0xecb1e527,0xf799e85f, 0x6f01a1f7,0x7429ac8f,0x5951bb07,0x4279b67f,0x03a19417,0x1889996f,0x35f18ee7,0x2ed9839f, 0x684289d9,0x736a84a1,0x5e129329,0x453a9e51,0x04e2bc39,0x1fcab141,0x32b2a6c9,0x299aabb1, 0xb102e219,0xaa2aef61,0x8752f8e9,0x9c7af591,0xdda2d7f9,0xc68ada81,0xebf2cd09,0xf0dac071, 0xde0343ee,0xc52b4e96,0xe853591e,0xf37b5466,0xb2a3760e,0xa98b7b76,0x84f36cfe,0x9fdb6186, 0x0743282e,0x1c6b2556,0x311332de,0x2a3b3fa6,0x6be31dce,0x70cb10b6,0x5db3073e,0x469b0a46, 0xd08513b2,0xcbad1eca,0xe6d50942,0xfdfd043a,0xbc252652,0xa70d2b2a,0x8a753ca2,0x915d31da, 0x09c57872,0x12ed750a,0x3f956282,0x24bd6ffa,0x65654d92,0x7e4d40ea,0x53355762,0x481d5a1a, 0x66c4d985,0x7decd4fd,0x5094c375,0x4bbcce0d,0x0a64ec65,0x114ce11d,0x3c34f695,0x271cfbed, 0xbf84b245,0xa4acbf3d,0x89d4a8b5,0x92fca5cd,0xd32487a5,0xc80c8add,0xe5749d55,0xfe5c902d, 0xb8c79a6b,0xa3ef9713,0x8e97809b,0x95bf8de3,0xd467af8b,0xcf4fa2f3,0xe237b57b,0xf91fb803, 0x6187f1ab,0x7aaffcd3,0x57d7eb5b,0x4cffe623,0x0d27c44b,0x160fc933,0x3b77debb,0x205fd3c3, 0x0e86505c,0x15ae5d24,0x38d64aac,0x23fe47d4,0x622665bc,0x790e68c4,0x54767f4c,0x4f5e7234, 0xd7c63b9c,0xccee36e4,0xe196216c,0xfabe2c14,0xbb660e7c,0xa04e0304,0x8d36148c,0x961e19f4, 0xa5cb3ad3,0xbee337ab,0x939b2023,0x88b32d5b,0xc96b0f33,0xd243024b,0xff3b15c3,0xe41318bb, 0x7c8b5113,0x67a35c6b,0x4adb4be3,0x51f3469b,0x102b64f3,0x0b03698b,0x267b7e03,0x3d53737b, 0x138af0e4,0x08a2fd9c,0x25daea14,0x3ef2e76c,0x7f2ac504,0x6402c87c,0x497adff4,0x5252d28c, 0xcaca9b24,0xd1e2965c,0xfc9a81d4,0xe7b28cac,0xa66aaec4,0xbd42a3bc,0x903ab434,0x8b12b94c, 0xcd89b30a,0xd6a1be72,0xfbd9a9fa,0xe0f1a482,0xa12986ea,0xba018b92,0x97799c1a,0x8c519162, 0x14c9d8ca,0x0fe1d5b2,0x2299c23a,0x39b1cf42,0x7869ed2a,0x6341e052,0x4e39f7da,0x5511faa2, 0x7bc8793d,0x60e07445,0x4d9863cd,0x56b06eb5,0x17684cdd,0x0c4041a5,0x2138562d,0x3a105b55, 0xa28812fd,0xb9a01f85,0x94d8080d,0x8ff00575,0xce28271d,0xd5002a65,0xf8783ded,0xe3503095, 0x754e2961,0x6e662419,0x431e3391,0x58363ee9,0x19ee1c81,0x02c611f9,0x2fbe0671,0x34960b09, 0xac0e42a1,0xb7264fd9,0x9a5e5851,0x81765529,0xc0ae7741,0xdb867a39,0xf6fe6db1,0xedd660c9, 0xc30fe356,0xd827ee2e,0xf55ff9a6,0xee77f4de,0xafafd6b6,0xb487dbce,0x99ffcc46,0x82d7c13e, 0x1a4f8896,0x016785ee,0x2c1f9266,0x37379f1e,0x76efbd76,0x6dc7b00e,0x40bfa786,0x5b97aafe, 0x1d0ca0b8,0x0624adc0,0x2b5cba48,0x3074b730,0x71ac9558,0x6a849820,0x47fc8fa8,0x5cd482d0, 0xc44ccb78,0xdf64c600,0xf21cd188,0xe934dcf0,0xa8ecfe98,0xb3c4f3e0,0x9ebce468,0x8594e910, 0xab4d6a8f,0xb06567f7,0x9d1d707f,0x86357d07,0xc7ed5f6f,0xdcc55217,0xf1bd459f,0xea9548e7, 0x720d014f,0x69250c37,0x445d1bbf,0x5f7516c7,0x1ead34af,0x058539d7,0x28fd2e5f,0x33d52327},{0x00000000,0x4f576811,0x9eaed022,0xd1f9b833,0x399cbdf3,0x76cbd5e2,0xa7326dd1,0xe86505c0, 0x73397be6,0x3c6e13f7,0xed97abc4,0xa2c0c3d5,0x4aa5c615,0x05f2ae04,0xd40b1637,0x9b5c7e26, 0xe672f7cc,0xa9259fdd,0x78dc27ee,0x378b4fff,0xdfee4a3f,0x90b9222e,0x41409a1d,0x0e17f20c, 0x954b8c2a,0xda1ce43b,0x0be55c08,0x44b23419,0xacd731d9,0xe38059c8,0x3279e1fb,0x7d2e89ea, 0xc824f22f,0x87739a3e,0x568a220d,0x19dd4a1c,0xf1b84fdc,0xbeef27cd,0x6f169ffe,0x2041f7ef, 0xbb1d89c9,0xf44ae1d8,0x25b359eb,0x6ae431fa,0x8281343a,0xcdd65c2b,0x1c2fe418,0x53788c09, 0x2e5605e3,0x61016df2,0xb0f8d5c1,0xffafbdd0,0x17cab810,0x589dd001,0x89646832,0xc6330023, 0x5d6f7e05,0x12381614,0xc3c1ae27,0x8c96c636,0x64f3c3f6,0x2ba4abe7,0xfa5d13d4,0xb50a7bc5, 0x9488f9e9,0xdbdf91f8,0x0a2629cb,0x457141da,0xad14441a,0xe2432c0b,0x33ba9438,0x7cedfc29, 0xe7b1820f,0xa8e6ea1e,0x791f522d,0x36483a3c,0xde2d3ffc,0x917a57ed,0x4083efde,0x0fd487cf, 0x72fa0e25,0x3dad6634,0xec54de07,0xa303b616,0x4b66b3d6,0x0431dbc7,0xd5c863f4,0x9a9f0be5, 0x01c375c3,0x4e941dd2,0x9f6da5e1,0xd03acdf0,0x385fc830,0x7708a021,0xa6f11812,0xe9a67003, 0x5cac0bc6,0x13fb63d7,0xc202dbe4,0x8d55b3f5,0x6530b635,0x2a67de24,0xfb9e6617,0xb4c90e06, 0x2f957020,0x60c21831,0xb13ba002,0xfe6cc813,0x1609cdd3,0x595ea5c2,0x88a71df1,0xc7f075e0, 0xbadefc0a,0xf589941b,0x24702c28,0x6b274439,0x834241f9,0xcc1529e8,0x1dec91db,0x52bbf9ca, 0xc9e787ec,0x86b0effd,0x574957ce,0x181e3fdf,0xf07b3a1f,0xbf2c520e,0x6ed5ea3d,0x2182822c, 0x2dd0ee65,0x62878674,0xb37e3e47,0xfc295656,0x144c5396,0x5b1b3b87,0x8ae283b4,0xc5b5eba5, 0x5ee99583,0x11befd92,0xc04745a1,0x8f102db0,0x67752870,0x28224061,0xf9dbf852,0xb68c9043, 0xcba219a9,0x84f571b8,0x550cc98b,0x1a5ba19a,0xf23ea45a,0xbd69cc4b,0x6c907478,0x23c71c69, 0xb89b624f,0xf7cc0a5e,0x2635b26d,0x6962da7c,0x8107dfbc,0xce50b7ad,0x1fa90f9e,0x50fe678f, 0xe5f41c4a,0xaaa3745b,0x7b5acc68,0x340da479,0xdc68a1b9,0x933fc9a8,0x42c6719b,0x0d91198a, 0x96cd67ac,0xd99a0fbd,0x0863b78e,0x4734df9f,0xaf51da5f,0xe006b24e,0x31ff0a7d,0x7ea8626c, 0x0386eb86,0x4cd18397,0x9d283ba4,0xd27f53b5,0x3a1a5675,0x754d3e64,0xa4b48657,0xebe3ee46, 0x70bf9060,0x3fe8f871,0xee114042,0xa1462853,0x49232d93,0x06744582,0xd78dfdb1,0x98da95a0, 0xb958178c,0xf60f7f9d,0x27f6c7ae,0x68a1afbf,0x80c4aa7f,0xcf93c26e,0x1e6a7a5d,0x513d124c, 0xca616c6a,0x8536047b,0x54cfbc48,0x1b98d459,0xf3fdd199,0xbcaab988,0x6d5301bb,0x220469aa, 0x5f2ae040,0x107d8851,0xc1843062,0x8ed35873,0x66b65db3,0x29e135a2,0xf8188d91,0xb74fe580, 0x2c139ba6,0x6344f3b7,0xb2bd4b84,0xfdea2395,0x158f2655,0x5ad84e44,0x8b21f677,0xc4769e66, 0x717ce5a3,0x3e2b8db2,0xefd23581,0xa0855d90,0x48e05850,0x07b73041,0xd64e8872,0x9919e063, 0x02459e45,0x4d12f654,0x9ceb4e67,0xd3bc2676,0x3bd923b6,0x748e4ba7,0xa577f394,0xea209b85, 0x970e126f,0xd8597a7e,0x09a0c24d,0x46f7aa5c,0xae92af9c,0xe1c5c78d,0x303c7fbe,0x7f6b17af, 0xe4376989,0xab600198,0x7a99b9ab,0x35ced1ba,0xddabd47a,0x92fcbc6b,0x43050458,0x0c526c49},{0x00000000,0x5ba1dcca,0xb743b994,0xece2655e,0x6a466e9f,0x31e7b255,0xdd05d70b,0x86a40bc1, 0xd48cdd3e,0x8f2d01f4,0x63cf64aa,0x386eb860,0xbecab3a1,0xe56b6f6b,0x09890a35,0x5228d6ff, 0xadd8a7cb,0xf6797b01,0x1a9b1e5f,0x413ac295,0xc79ec954,0x9c3f159e,0x70dd70c0,0x2b7cac0a, 0x79547af5,0x22f5a63f,0xce17c361,0x95b61fab,0x1312146a,0x48b3c8a0,0xa451adfe,0xfff07134, 0x5f705221,0x04d18eeb,0xe833ebb5,0xb392377f,0x35363cbe,0x6e97e074,0x8275852a,0xd9d459e0, 0x8bfc8f1f,0xd05d53d5,0x3cbf368b,0x671eea41,0xe1bae180,0xba1b3d4a,0x56f95814,0x0d5884de, 0xf2a8f5ea,0xa9092920,0x45eb4c7e,0x1e4a90b4,0x98ee9b75,0xc34f47bf,0x2fad22e1,0x740cfe2b, 0x262428d4,0x7d85f41e,0x91679140,0xcac64d8a,0x4c62464b,0x17c39a81,0xfb21ffdf,0xa0802315, 0xbee0a442,0xe5417888,0x09a31dd6,0x5202c11c,0xd4a6cadd,0x8f071617,0x63e57349,0x3844af83, 0x6a6c797c,0x31cda5b6,0xdd2fc0e8,0x868e1c22,0x002a17e3,0x5b8bcb29,0xb769ae77,0xecc872bd, 0x13380389,0x4899df43,0xa47bba1d,0xffda66d7,0x797e6d16,0x22dfb1dc,0xce3dd482,0x959c0848, 0xc7b4deb7,0x9c15027d,0x70f76723,0x2b56bbe9,0xadf2b028,0xf6536ce2,0x1ab109bc,0x4110d576, 0xe190f663,0xba312aa9,0x56d34ff7,0x0d72933d,0x8bd698fc,0xd0774436,0x3c952168,0x6734fda2, 0x351c2b5d,0x6ebdf797,0x825f92c9,0xd9fe4e03,0x5f5a45c2,0x04fb9908,0xe819fc56,0xb3b8209c, 0x4c4851a8,0x17e98d62,0xfb0be83c,0xa0aa34f6,0x260e3f37,0x7dafe3fd,0x914d86a3,0xcaec5a69, 0x98c48c96,0xc365505c,0x2f873502,0x7426e9c8,0xf282e209,0xa9233ec3,0x45c15b9d,0x1e608757, 0x79005533,0x22a189f9,0xce43eca7,0x95e2306d,0x13463bac,0x48e7e766,0xa4058238,0xffa45ef2, 0xad8c880d,0xf62d54c7,0x1acf3199,0x416eed53,0xc7cae692,0x9c6b3a58,0x70895f06,0x2b2883cc, 0xd4d8f2f8,0x8f792e32,0x639b4b6c,0x383a97a6,0xbe9e9c67,0xe53f40ad,0x09dd25f3,0x527cf939, 0x00542fc6,0x5bf5f30c,0xb7179652,0xecb64a98,0x6a124159,0x31b39d93,0xdd51f8cd,0x86f02407, 0x26700712,0x7dd1dbd8,0x9133be86,0xca92624c,0x4c36698d,0x1797b547,0xfb75d019,0xa0d40cd3, 0xf2fcda2c,0xa95d06e6,0x45bf63b8,0x1e1ebf72,0x98bab4b3,0xc31b6879,0x2ff90d27,0x7458d1ed, 0x8ba8a0d9,0xd0097c13,0x3ceb194d,0x674ac587,0xe1eece46,0xba4f128c,0x56ad77d2,0x0d0cab18, 0x5f247de7,0x0485a12d,0xe867c473,0xb3c618b9,0x35621378,0x6ec3cfb2,0x8221aaec,0xd9807626, 0xc7e0f171,0x9c412dbb,0x70a348e5,0x2b02942f,0xada69fee,0xf6074324,0x1ae5267a,0x4144fab0, 0x136c2c4f,0x48cdf085,0xa42f95db,0xff8e4911,0x792a42d0,0x228b9e1a,0xce69fb44,0x95c8278e, 0x6a3856ba,0x31998a70,0xdd7bef2e,0x86da33e4,0x007e3825,0x5bdfe4ef,0xb73d81b1,0xec9c5d7b, 0xbeb48b84,0xe515574e,0x09f73210,0x5256eeda,0xd4f2e51b,0x8f5339d1,0x63b15c8f,0x38108045, 0x9890a350,0xc3317f9a,0x2fd31ac4,0x7472c60e,0xf2d6cdcf,0xa9771105,0x4595745b,0x1e34a891, 0x4c1c7e6e,0x17bda2a4,0xfb5fc7fa,0xa0fe1b30,0x265a10f1,0x7dfbcc3b,0x9119a965,0xcab875af, 0x3548049b,0x6ee9d851,0x820bbd0f,0xd9aa61c5,0x5f0e6a04,0x04afb6ce,0xe84dd390,0xb3ec0f5a, 0xe1c4d9a5,0xba65056f,0x56876031,0x0d26bcfb,0x8b82b73a,0xd0236bf0,0x3cc10eae,0x6760d264}};vendor/ogg/src/framing.cadded
/******************************************************************** * * * THIS FILE IS PART OF THE Ogg CONTAINER SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2018 * * by the Xiph.Org Foundation http://www.xiph.org/ * * * ******************************************************************** function: code raw packets into framed OggSquish stream and decode Ogg streams back into raw packets note: The CRC code is directly derived from public domain code by Ross Williams ([email protected]). See docs/framing.html for details. ********************************************************************/#ifdef HAVE_CONFIG_H#include "config.h"#endif#include <stdlib.h>#include <limits.h>#include <string.h>#include <ogg/ogg.h>/* A complete description of Ogg framing exists in docs/framing.html */int ogg_page_version(const ogg_page *og){ return((int)(og->header[4]));}int ogg_page_continued(const ogg_page *og){ return((int)(og->header[5]&0x01));}int ogg_page_bos(const ogg_page *og){ return((int)(og->header[5]&0x02));}int ogg_page_eos(const ogg_page *og){ return((int)(og->header[5]&0x04));}ogg_int64_t ogg_page_granulepos(const ogg_page *og){ unsigned char *page=og->header; ogg_uint64_t granulepos=page[13]&(0xff); granulepos= (granulepos<<8)|(page[12]&0xff); granulepos= (granulepos<<8)|(page[11]&0xff); granulepos= (granulepos<<8)|(page[10]&0xff); granulepos= (granulepos<<8)|(page[9]&0xff); granulepos= (granulepos<<8)|(page[8]&0xff); granulepos= (granulepos<<8)|(page[7]&0xff); granulepos= (granulepos<<8)|(page[6]&0xff); return((ogg_int64_t)granulepos);}int ogg_page_serialno(const ogg_page *og){ return((int)((ogg_uint32_t)og->header[14]) | ((ogg_uint32_t)og->header[15]<<8) | ((ogg_uint32_t)og->header[16]<<16) | ((ogg_uint32_t)og->header[17]<<24));}long ogg_page_pageno(const ogg_page *og){ return((long)((ogg_uint32_t)og->header[18]) | ((ogg_uint32_t)og->header[19]<<8) | ((ogg_uint32_t)og->header[20]<<16) | ((ogg_uint32_t)og->header[21]<<24));}/* returns the number of packets that are completed on this page (if the leading packet is begun on a previous page, but ends on this page, it's counted *//* NOTE: If a page consists of a packet begun on a previous page, and a new packet begun (but not completed) on this page, the return will be: ogg_page_packets(page) ==1, ogg_page_continued(page) !=0 If a page happens to be a single packet that was begun on a previous page, and spans to the next page (in the case of a three or more page packet), the return will be: ogg_page_packets(page) ==0, ogg_page_continued(page) !=0*/int ogg_page_packets(const ogg_page *og){ int i,n=og->header[26],count=0; for(i=0;i<n;i++) if(og->header[27+i]<255)count++; return(count);}#if 0/* helper to initialize lookup for direct-table CRC (illustrative; we use the static init in crctable.h) */static void _ogg_crc_init(){ int i, j; ogg_uint32_t polynomial, crc; polynomial = 0x04c11db7; /* The same as the ethernet generator polynomial, although we use an unreflected alg and an init/final of 0, not 0xffffffff */ for (i = 0; i <= 0xFF; i++){ crc = i << 24; for (j = 0; j < 8; j++) crc = (crc << 1) ^ (crc & (1 << 31) ? polynomial : 0); crc_lookup[0][i] = crc; } for (i = 0; i <= 0xFF; i++) for (j = 1; j < 8; j++) crc_lookup[j][i] = crc_lookup[0][(crc_lookup[j - 1][i] >> 24) & 0xFF] ^ (crc_lookup[j - 1][i] << 8);}#endif#include "crctable.h"/* init the encode/decode logical stream state */int ogg_stream_init(ogg_stream_state *os,int serialno){ if(os){ memset(os,0,sizeof(*os)); os->body_storage=16*1024; os->lacing_storage=1024; os->body_data=_ogg_malloc(os->body_storage*sizeof(*os->body_data)); os->lacing_vals=_ogg_malloc(os->lacing_storage*sizeof(*os->lacing_vals)); os->granule_vals=_ogg_malloc(os->lacing_storage*sizeof(*os->granule_vals)); if(!os->body_data || !os->lacing_vals || !os->granule_vals){ ogg_stream_clear(os); return -1; } os->serialno=serialno; return(0); } return(-1);}/* async/delayed error detection for the ogg_stream_state */int ogg_stream_check(ogg_stream_state *os){ if(!os || !os->body_data) return -1; return 0;}/* _clear does not free os, only the non-flat storage within */int ogg_stream_clear(ogg_stream_state *os){ if(os){ if(os->body_data)_ogg_free(os->body_data); if(os->lacing_vals)_ogg_free(os->lacing_vals); if(os->granule_vals)_ogg_free(os->granule_vals); memset(os,0,sizeof(*os)); } return(0);}int ogg_stream_destroy(ogg_stream_state *os){ if(os){ ogg_stream_clear(os); _ogg_free(os); } return(0);}/* Helpers for ogg_stream_encode; this keeps the structure and what's happening fairly clear */static int _os_body_expand(ogg_stream_state *os,long needed){ if(os->body_storage-needed<=os->body_fill){ long body_storage; void *ret; if(os->body_storage>LONG_MAX-needed){ ogg_stream_clear(os); return -1; } body_storage=os->body_storage+needed; if(body_storage<LONG_MAX-1024)body_storage+=1024; ret=_ogg_realloc(os->body_data,body_storage*sizeof(*os->body_data)); if(!ret){ ogg_stream_clear(os); return -1; } os->body_storage=body_storage; os->body_data=ret; } return 0;}static int _os_lacing_expand(ogg_stream_state *os,long needed){ if(os->lacing_storage-needed<=os->lacing_fill){ long lacing_storage; void *ret; if(os->lacing_storage>LONG_MAX-needed){ ogg_stream_clear(os); return -1; } lacing_storage=os->lacing_storage+needed; if(lacing_storage<LONG_MAX-32)lacing_storage+=32; ret=_ogg_realloc(os->lacing_vals,lacing_storage*sizeof(*os->lacing_vals)); if(!ret){ ogg_stream_clear(os); return -1; } os->lacing_vals=ret; ret=_ogg_realloc(os->granule_vals,lacing_storage* sizeof(*os->granule_vals)); if(!ret){ ogg_stream_clear(os); return -1; } os->granule_vals=ret; os->lacing_storage=lacing_storage; } return 0;}/* checksum the page *//* Direct table CRC; note that this will be faster in the future if we perform the checksum simultaneously with other copies */static ogg_uint32_t _os_update_crc(ogg_uint32_t crc, unsigned char *buffer, int size){ while (size>=8){ crc^=((ogg_uint32_t)buffer[0]<<24)|((ogg_uint32_t)buffer[1]<<16)|((ogg_uint32_t)buffer[2]<<8)|((ogg_uint32_t)buffer[3]); crc=crc_lookup[7][ crc>>24 ]^crc_lookup[6][(crc>>16)&0xFF]^ crc_lookup[5][(crc>> 8)&0xFF]^crc_lookup[4][ crc &0xFF]^ crc_lookup[3][buffer[4] ]^crc_lookup[2][buffer[5] ]^ crc_lookup[1][buffer[6] ]^crc_lookup[0][buffer[7] ]; buffer+=8; size-=8; } while (size--) crc=(crc<<8)^crc_lookup[0][((crc >> 24)&0xff)^*buffer++]; return crc;}void ogg_page_checksum_set(ogg_page *og){ if(og){ ogg_uint32_t crc_reg=0; /* safety; needed for API behavior, but not framing code */ og->header[22]=0; og->header[23]=0; og->header[24]=0; og->header[25]=0; crc_reg=_os_update_crc(crc_reg,og->header,og->header_len); crc_reg=_os_update_crc(crc_reg,og->body,og->body_len); og->header[22]=(unsigned char)(crc_reg&0xff); og->header[23]=(unsigned char)((crc_reg>>8)&0xff); og->header[24]=(unsigned char)((crc_reg>>16)&0xff); og->header[25]=(unsigned char)((crc_reg>>24)&0xff); }}/* submit data to the internal buffer of the framing engine */int ogg_stream_iovecin(ogg_stream_state *os, ogg_iovec_t *iov, int count, long e_o_s, ogg_int64_t granulepos){ long bytes = 0, lacing_vals; int i; if(ogg_stream_check(os)) return -1; if(!iov) return 0; for (i = 0; i < count; ++i){ if(iov[i].iov_len>LONG_MAX) return -1; if(bytes>LONG_MAX-(long)iov[i].iov_len) return -1; bytes += (long)iov[i].iov_len; } lacing_vals=bytes/255+1; if(os->body_returned){ /* advance packet data according to the body_returned pointer. We had to keep it around to return a pointer into the buffer last call */ os->body_fill-=os->body_returned; if(os->body_fill) memmove(os->body_data,os->body_data+os->body_returned, os->body_fill); os->body_returned=0; } /* make sure we have the buffer storage */ if(_os_body_expand(os,bytes) || _os_lacing_expand(os,lacing_vals)) return -1; /* Copy in the submitted packet. Yes, the copy is a waste; this is the liability of overly clean abstraction for the time being. It will actually be fairly easy to eliminate the extra copy in the future */ for (i = 0; i < count; ++i) { memcpy(os->body_data+os->body_fill, iov[i].iov_base, iov[i].iov_len); os->body_fill += (int)iov[i].iov_len; } /* Store lacing vals for this packet */ for(i=0;i<lacing_vals-1;i++){ os->lacing_vals[os->lacing_fill+i]=255; os->granule_vals[os->lacing_fill+i]=os->granulepos; } os->lacing_vals[os->lacing_fill+i]=bytes%255; os->granulepos=os->granule_vals[os->lacing_fill+i]=granulepos; /* flag the first segment as the beginning of the packet */ os->lacing_vals[os->lacing_fill]|= 0x100; os->lacing_fill+=lacing_vals; /* for the sake of completeness */ os->packetno++; if(e_o_s)os->e_o_s=1; return(0);}int ogg_stream_packetin(ogg_stream_state *os,ogg_packet *op){ ogg_iovec_t iov; iov.iov_base = op->packet; iov.iov_len = op->bytes; return ogg_stream_iovecin(os, &iov, 1, op->e_o_s, op->granulepos);}/* Conditionally flush a page; force==0 will only flush nominal-size pages, force==1 forces us to flush a page regardless of page size so long as there's any data available at all. */static int ogg_stream_flush_i(ogg_stream_state *os,ogg_page *og, int force, int nfill){ int i; int vals=0; int maxvals; int bytes=0; long acc=0; ogg_int64_t granule_pos=-1; if(ogg_stream_check(os)) return(0); maxvals=(os->lacing_fill>255?255:os->lacing_fill); if(maxvals==0) return(0); /* construct a page */ /* decide how many segments to include */ /* If this is the initial header case, the first page must only include the initial header packet */ if(os->b_o_s==0){ /* 'initial header page' case */ granule_pos=0; for(vals=0;vals<maxvals;vals++){ if((os->lacing_vals[vals]&0x0ff)<255){ vals++; break; } } }else{ /* The extra packets_done, packet_just_done logic here attempts to do two things: 1) Don't unnecessarily span pages. 2) Unless necessary, don't flush pages if there are less than four packets on them; this expands page size to reduce unnecessary overhead if incoming packets are large. These are not necessary behaviors, just 'always better than naive flushing' without requiring an application to explicitly request a specific optimized behavior. We'll want an explicit behavior setup pathway eventually as well. */ int packets_done=0; int packet_just_done=0; for(vals=0;vals<maxvals;vals++){ if(acc>nfill && packet_just_done>=4){ force=1; break; } acc+=os->lacing_vals[vals]&0x0ff; if((os->lacing_vals[vals]&0xff)<255){ granule_pos=os->granule_vals[vals]; packet_just_done=++packets_done; }else packet_just_done=0; } if(vals==255)force=1; } if(!force) return(0); /* construct the header in temp storage */ memcpy(os->header,"OggS",4); /* stream structure version */ os->header[4]=0x00; /* continued packet flag? */ os->header[5]=0x00; if((os->lacing_vals[0]&0x100)==0)os->header[5]|=0x01; /* first page flag? */ if(os->b_o_s==0)os->header[5]|=0x02; /* last page flag? */ if(os->e_o_s && os->lacing_fill==vals)os->header[5]|=0x04; os->b_o_s=1; /* 64 bits of PCM position */ for(i=6;i<14;i++){ os->header[i]=(unsigned char)(granule_pos&0xff); granule_pos>>=8; } /* 32 bits of stream serial number */ { long serialno=os->serialno; for(i=14;i<18;i++){ os->header[i]=(unsigned char)(serialno&0xff); serialno>>=8; } } /* 32 bits of page counter (we have both counter and page header because this val can roll over) */ if(os->pageno==-1)os->pageno=0; /* because someone called stream_reset; this would be a strange thing to do in an encode stream, but it has plausible uses */ { long pageno=os->pageno++; for(i=18;i<22;i++){ os->header[i]=(unsigned char)(pageno&0xff); pageno>>=8; } } /* zero for computation; filled in later */ os->header[22]=0; os->header[23]=0; os->header[24]=0; os->header[25]=0; /* segment table */ os->header[26]=(unsigned char)(vals&0xff); for(i=0;i<vals;i++) bytes+=os->header[i+27]=(unsigned char)(os->lacing_vals[i]&0xff); /* set pointers in the ogg_page struct */ og->header=os->header; og->header_len=os->header_fill=vals+27; og->body=os->body_data+os->body_returned; og->body_len=bytes; /* advance the lacing data and set the body_returned pointer */ os->lacing_fill-=vals; memmove(os->lacing_vals,os->lacing_vals+vals,os->lacing_fill*sizeof(*os->lacing_vals)); memmove(os->granule_vals,os->granule_vals+vals,os->lacing_fill*sizeof(*os->granule_vals)); os->body_returned+=bytes; /* calculate the checksum */ ogg_page_checksum_set(og); /* done */ return(1);}/* This will flush remaining packets into a page (returning nonzero), even if there is not enough data to trigger a flush normally (undersized page). If there are no packets or partial packets to flush, ogg_stream_flush returns 0. Note that ogg_stream_flush will try to flush a normal sized page like ogg_stream_pageout; a call to ogg_stream_flush does not guarantee that all packets have flushed. Only a return value of 0 from ogg_stream_flush indicates all packet data is flushed into pages. since ogg_stream_flush will flush the last page in a stream even if it's undersized, you almost certainly want to use ogg_stream_pageout (and *not* ogg_stream_flush) unless you specifically need to flush a page regardless of size in the middle of a stream. */int ogg_stream_flush(ogg_stream_state *os,ogg_page *og){ return ogg_stream_flush_i(os,og,1,4096);}/* Like the above, but an argument is provided to adjust the nominalShowing the first 500 of 2139 diff lines for this file. This diff is INCOMPLETE; read the file or clone the repository for the rest.
vendor/vorbis/COPYINGadded
Copyright (c) 2002-2020 Xiph.org FoundationRedistribution and use in source and binary forms, with or withoutmodification, are permitted provided that the following conditionsare met:- Redistributions of source code must retain the above copyrightnotice, this list of conditions and the following disclaimer.- Redistributions in binary form must reproduce the above copyrightnotice, this list of conditions and the following disclaimer in thedocumentation and/or other materials provided with the distribution.- Neither the name of the Xiph.org Foundation nor the names of itscontributors may be used to endorse or promote products derived fromthis software without specific prior written permission.THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOTLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FORA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATIONOR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOTLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANYTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USEOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.vendor/vorbis/README.mdadded
# libvorbis (vendored)Upstream: https://xiph.org/vorbis/- **Version**: 1.3.7- **Source**: https://downloads.xiph.org/releases/vorbis/libvorbis-1.3.7.tar.xz- **SHA256**: `b33cc4934322bcbf6efcbacf49e3ca01aadbea4114ec9589d1b1e9d20f72954b`- **License**: BSD-3-Clause (see `COPYING`)## What's includedSources required to build the full `libvorbis.a` (encoder, decoder,file I/O):- `lib/*.c` — every C source from upstream's `lib/` *except* the `barkmel.c` / `tone.c` / `psytune.c` standalone test programs, which are unrelated to the library itself.- `lib/*.h` — every internal header.- `lib/books/{coupled,floor,uncoupled}/*.h` — codebook data tables (about 42K lines of static const data).- `lib/modes/*.h` — psychoacoustic + residue setup tables.- `include/vorbis/{codec,vorbisenc,vorbisfile}.h` — public headers.Build pulls in libogg via `vendor/ogg/include`. Internal `.c` filesinclude their siblings by bare filename (e.g.`#include "codebook.h"`), so `vendor/vorbis/lib` itself must beon the include path — see `package.sgl`.Everything else from the tarball (`docs/`, `examples/`, `test/`,`vq/`, `cmake/`, `macosx/`, `symbian/`, `win32/`, `m4/`,autotools machinery) is intentionally omitted.## Upgrading1. Download the new upstream tarball, verify SHA256 against xiph.org's release announcement.2. Replace `lib/*.c`, `lib/*.h`, `lib/books/**/*.h`, `lib/modes/*.h`, `include/vorbis/*.h`, `COPYING` with the upstream files (byte-identical drop-in). Skip `barkmel.c`, `tone.c`, `psytune.c`.3. Update version + SHA256 in this README.4. Rebuild + run `test/test-ogg-encode.sgl`.vendor/vorbis/include/vorbis/codec.hadded
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001 * * by the Xiph.Org Foundation https://xiph.org/ * ******************************************************************** function: libvorbis codec headers ********************************************************************/#ifndef _vorbis_codec_h_#define _vorbis_codec_h_#ifdef __cplusplusextern "C"{#endif /* __cplusplus */#include <ogg/ogg.h>typedef struct vorbis_info{ int version; int channels; long rate; /* The below bitrate declarations are *hints*. Combinations of the three values carry the following implications: all three set to the same value: implies a fixed rate bitstream only nominal set: implies a VBR stream that averages the nominal bitrate. No hard upper/lower limit upper and or lower set: implies a VBR bitstream that obeys the bitrate limits. nominal may also be set to give a nominal rate. none set: the coder does not care to speculate. */ long bitrate_upper; long bitrate_nominal; long bitrate_lower; long bitrate_window; void *codec_setup;} vorbis_info;/* vorbis_dsp_state buffers the current vorbis audio analysis/synthesis state. The DSP state belongs to a specific logical bitstream ****************************************************/typedef struct vorbis_dsp_state{ int analysisp; vorbis_info *vi; float **pcm; float **pcmret; int pcm_storage; int pcm_current; int pcm_returned; int preextrapolate; int eofflag; long lW; long W; long nW; long centerW; ogg_int64_t granulepos; ogg_int64_t sequence; ogg_int64_t glue_bits; ogg_int64_t time_bits; ogg_int64_t floor_bits; ogg_int64_t res_bits; void *backend_state;} vorbis_dsp_state;typedef struct vorbis_block{ /* necessary stream state for linking to the framing abstraction */ float **pcm; /* this is a pointer into local storage */ oggpack_buffer opb; long lW; long W; long nW; int pcmend; int mode; int eofflag; ogg_int64_t granulepos; ogg_int64_t sequence; vorbis_dsp_state *vd; /* For read-only access of configuration */ /* local storage to avoid remallocing; it's up to the mapping to structure it */ void *localstore; long localtop; long localalloc; long totaluse; struct alloc_chain *reap; /* bitmetrics for the frame */ long glue_bits; long time_bits; long floor_bits; long res_bits; void *internal;} vorbis_block;/* vorbis_block is a single block of data to be processed as part ofthe analysis/synthesis stream; it belongs to a specific logicalbitstream, but is independent from other vorbis_blocks belonging tothat logical bitstream. *************************************************/struct alloc_chain{ void *ptr; struct alloc_chain *next;};/* vorbis_info contains all the setup information specific to the specific compression/decompression mode in progress (eg, psychoacoustic settings, channel setup, options, codebook etc). vorbis_info and substructures are in backends.h.*********************************************************************//* the comments are not part of vorbis_info so that vorbis_info can be static storage */typedef struct vorbis_comment{ /* unlimited user comment fields. libvorbis writes 'libvorbis' whatever vendor is set to in encode */ char **user_comments; int *comment_lengths; int comments; char *vendor;} vorbis_comment;/* libvorbis encodes in two abstraction layers; first we perform DSP and produce a packet (see docs/analysis.txt). The packet is then coded into a framed OggSquish bitstream by the second layer (see docs/framing.txt). Decode is the reverse process; we sync/frame the bitstream and extract individual packets, then decode the packet back into PCM audio. The extra framing/packetizing is used in streaming formats, such as files. Over the net (such as with UDP), the framing and packetization aren't necessary as they're provided by the transport and the streaming layer is not used *//* Vorbis PRIMITIVES: general ***************************************/extern void vorbis_info_init(vorbis_info *vi);extern void vorbis_info_clear(vorbis_info *vi);extern int vorbis_info_blocksize(vorbis_info *vi,int zo);extern void vorbis_comment_init(vorbis_comment *vc);extern void vorbis_comment_add(vorbis_comment *vc, const char *comment);extern void vorbis_comment_add_tag(vorbis_comment *vc, const char *tag, const char *contents);extern char *vorbis_comment_query(vorbis_comment *vc, const char *tag, int count);extern int vorbis_comment_query_count(vorbis_comment *vc, const char *tag);extern void vorbis_comment_clear(vorbis_comment *vc);extern int vorbis_block_init(vorbis_dsp_state *v, vorbis_block *vb);extern int vorbis_block_clear(vorbis_block *vb);extern void vorbis_dsp_clear(vorbis_dsp_state *v);extern double vorbis_granule_time(vorbis_dsp_state *v, ogg_int64_t granulepos);extern const char *vorbis_version_string(void);/* Vorbis PRIMITIVES: analysis/DSP layer ****************************/extern int vorbis_analysis_init(vorbis_dsp_state *v,vorbis_info *vi);extern int vorbis_commentheader_out(vorbis_comment *vc, ogg_packet *op);extern int vorbis_analysis_headerout(vorbis_dsp_state *v, vorbis_comment *vc, ogg_packet *op, ogg_packet *op_comm, ogg_packet *op_code);extern float **vorbis_analysis_buffer(vorbis_dsp_state *v,int vals);extern int vorbis_analysis_wrote(vorbis_dsp_state *v,int vals);extern int vorbis_analysis_blockout(vorbis_dsp_state *v,vorbis_block *vb);extern int vorbis_analysis(vorbis_block *vb,ogg_packet *op);extern int vorbis_bitrate_addblock(vorbis_block *vb);extern int vorbis_bitrate_flushpacket(vorbis_dsp_state *vd, ogg_packet *op);/* Vorbis PRIMITIVES: synthesis layer *******************************/extern int vorbis_synthesis_idheader(ogg_packet *op);extern int vorbis_synthesis_headerin(vorbis_info *vi,vorbis_comment *vc, ogg_packet *op);extern int vorbis_synthesis_init(vorbis_dsp_state *v,vorbis_info *vi);extern int vorbis_synthesis_restart(vorbis_dsp_state *v);extern int vorbis_synthesis(vorbis_block *vb,ogg_packet *op);extern int vorbis_synthesis_trackonly(vorbis_block *vb,ogg_packet *op);extern int vorbis_synthesis_blockin(vorbis_dsp_state *v,vorbis_block *vb);extern int vorbis_synthesis_pcmout(vorbis_dsp_state *v,float ***pcm);extern int vorbis_synthesis_lapout(vorbis_dsp_state *v,float ***pcm);extern int vorbis_synthesis_read(vorbis_dsp_state *v,int samples);extern long vorbis_packet_blocksize(vorbis_info *vi,ogg_packet *op);extern int vorbis_synthesis_halfrate(vorbis_info *v,int flag);extern int vorbis_synthesis_halfrate_p(vorbis_info *v);/* Vorbis ERRORS and return codes ***********************************/#define OV_FALSE -1#define OV_EOF -2#define OV_HOLE -3#define OV_EREAD -128#define OV_EFAULT -129#define OV_EIMPL -130#define OV_EINVAL -131#define OV_ENOTVORBIS -132#define OV_EBADHEADER -133#define OV_EVERSION -134#define OV_ENOTAUDIO -135#define OV_EBADPACKET -136#define OV_EBADLINK -137#define OV_ENOSEEK -138#ifdef __cplusplus}#endif /* __cplusplus */#endifvendor/vorbis/include/vorbis/vorbisenc.hadded
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001 * * by the Xiph.Org Foundation https://xiph.org/ * * * ******************************************************************** function: vorbis encode-engine setup ********************************************************************//** \file * Libvorbisenc is a convenient API for setting up an encoding * environment using libvorbis. Libvorbisenc encapsulates the * actions needed to set up the encoder properly. */#ifndef _OV_ENC_H_#define _OV_ENC_H_#ifdef __cplusplusextern "C"{#endif /* __cplusplus */#include "codec.h"/** * This is the primary function within libvorbisenc for setting up managed * bitrate modes. * * Before this function is called, the \ref vorbis_info * struct should be initialized by using vorbis_info_init() from the libvorbis * API. After encoding, vorbis_info_clear() should be called. * * The max_bitrate, nominal_bitrate, and min_bitrate settings are used to set * constraints for the encoded file. This function uses these settings to * select the appropriate encoding mode and set it up. * * \param vi Pointer to an initialized \ref vorbis_info struct. * \param channels The number of channels to be encoded. * \param rate The sampling rate of the source audio. * \param max_bitrate Desired maximum bitrate (limit). -1 indicates unset. * \param nominal_bitrate Desired average, or central, bitrate. -1 indicates unset. * \param min_bitrate Desired minimum bitrate. -1 indicates unset. * * \return Zero for success, and negative values for failure. * * \retval 0 Success. * \retval OV_EFAULT Internal logic fault; indicates a bug or heap/stack corruption. * \retval OV_EINVAL Invalid setup request, eg, out of range argument. * \retval OV_EIMPL Unimplemented mode; unable to comply with bitrate request. */extern int vorbis_encode_init(vorbis_info *vi, long channels, long rate, long max_bitrate, long nominal_bitrate, long min_bitrate);/** * This function performs step-one of a three-step bitrate-managed encode * setup. It functions similarly to the one-step setup performed by \ref * vorbis_encode_init but allows an application to make further encode setup * tweaks using \ref vorbis_encode_ctl before finally calling \ref * vorbis_encode_setup_init to complete the setup process. * * Before this function is called, the \ref vorbis_info struct should be * initialized by using vorbis_info_init() from the libvorbis API. After * encoding, vorbis_info_clear() should be called. * * The max_bitrate, nominal_bitrate, and min_bitrate settings are used to set * constraints for the encoded file. This function uses these settings to * select the appropriate encoding mode and set it up. * * \param vi Pointer to an initialized vorbis_info struct. * \param channels The number of channels to be encoded. * \param rate The sampling rate of the source audio. * \param max_bitrate Desired maximum bitrate (limit). -1 indicates unset. * \param nominal_bitrate Desired average, or central, bitrate. -1 indicates unset. * \param min_bitrate Desired minimum bitrate. -1 indicates unset. * * \return Zero for success, and negative for failure. * * \retval 0 Success * \retval OV_EFAULT Internal logic fault; indicates a bug or heap/stack corruption. * \retval OV_EINVAL Invalid setup request, eg, out of range argument. * \retval OV_EIMPL Unimplemented mode; unable to comply with bitrate request. */extern int vorbis_encode_setup_managed(vorbis_info *vi, long channels, long rate, long max_bitrate, long nominal_bitrate, long min_bitrate);/** * This function performs step-one of a three-step variable bitrate * (quality-based) encode setup. It functions similarly to the one-step setup * performed by \ref vorbis_encode_init_vbr() but allows an application to * make further encode setup tweaks using \ref vorbis_encode_ctl() before * finally calling \ref vorbis_encode_setup_init to complete the setup * process. * * Before this function is called, the \ref vorbis_info struct should be * initialized by using \ref vorbis_info_init() from the libvorbis API. After * encoding, vorbis_info_clear() should be called. * * \param vi Pointer to an initialized vorbis_info struct. * \param channels The number of channels to be encoded. * \param rate The sampling rate of the source audio. * \param quality Desired quality level, currently from -0.1 to 1.0 (lo to hi). * * \return Zero for success, and negative values for failure. * * \retval 0 Success * \retval OV_EFAULT Internal logic fault; indicates a bug or heap/stack corruption. * \retval OV_EINVAL Invalid setup request, eg, out of range argument. * \retval OV_EIMPL Unimplemented mode; unable to comply with quality level request. */extern int vorbis_encode_setup_vbr(vorbis_info *vi, long channels, long rate, float quality );/** * This is the primary function within libvorbisenc for setting up variable * bitrate ("quality" based) modes. * * * Before this function is called, the vorbis_info struct should be * initialized by using vorbis_info_init() from the libvorbis API. After * encoding, vorbis_info_clear() should be called. * * \param vi Pointer to an initialized vorbis_info struct. * \param channels The number of channels to be encoded. * \param rate The sampling rate of the source audio. * \param base_quality Desired quality level, currently from -0.1 to 1.0 (lo to hi). * * * \return Zero for success, or a negative number for failure. * * \retval 0 Success * \retval OV_EFAULT Internal logic fault; indicates a bug or heap/stack corruption. * \retval OV_EINVAL Invalid setup request, eg, out of range argument. * \retval OV_EIMPL Unimplemented mode; unable to comply with quality level request. */extern int vorbis_encode_init_vbr(vorbis_info *vi, long channels, long rate, float base_quality );/** * This function performs the last stage of three-step encoding setup, as * described in the API overview under managed bitrate modes. * * Before this function is called, the \ref vorbis_info struct should be * initialized by using vorbis_info_init() from the libvorbis API, one of * \ref vorbis_encode_setup_managed() or \ref vorbis_encode_setup_vbr() called to * initialize the high-level encoding setup, and \ref vorbis_encode_ctl() * called if necessary to make encoding setup changes. * vorbis_encode_setup_init() finalizes the highlevel encoding structure into * a complete encoding setup after which the application may make no further * setup changes. * * After encoding, vorbis_info_clear() should be called. * * \param vi Pointer to an initialized \ref vorbis_info struct. * * \return Zero for success, and negative values for failure. * * \retval 0 Success. * \retval OV_EFAULT Internal logic fault; indicates a bug or heap/stack corruption. * * \retval OV_EINVAL Attempt to use vorbis_encode_setup_init() without first * calling one of vorbis_encode_setup_managed() or vorbis_encode_setup_vbr() to * initialize the high-level encoding setup * */extern int vorbis_encode_setup_init(vorbis_info *vi);/** * This function implements a generic interface to miscellaneous encoder * settings similar to the classic UNIX 'ioctl()' system call. Applications * may use vorbis_encode_ctl() to query or set bitrate management or quality * mode details by using one of several \e request arguments detailed below. * vorbis_encode_ctl() must be called after one of * vorbis_encode_setup_managed() or vorbis_encode_setup_vbr(). When used * to modify settings, \ref vorbis_encode_ctl() must be called before \ref * vorbis_encode_setup_init(). * * \param vi Pointer to an initialized vorbis_info struct. * * \param number Specifies the desired action; See \ref encctlcodes "the list * of available requests". * * \param arg void * pointing to a data structure matching the request * argument. * * \retval 0 Success. Any further return information (such as the result of a * query) is placed into the storage pointed to by *arg. * * \retval OV_EINVAL Invalid argument, or an attempt to modify a setting after * calling vorbis_encode_setup_init(). * * \retval OV_EIMPL Unimplemented or unknown request */extern int vorbis_encode_ctl(vorbis_info *vi,int number,void *arg);/** * \deprecated This is a deprecated interface. Please use vorbis_encode_ctl() * with the \ref ovectl_ratemanage2_arg struct and \ref * OV_ECTL_RATEMANAGE2_GET and \ref OV_ECTL_RATEMANAGE2_SET calls in new code. * * The \ref ovectl_ratemanage_arg structure is used with vorbis_encode_ctl() * and the \ref OV_ECTL_RATEMANAGE_GET, \ref OV_ECTL_RATEMANAGE_SET, \ref * OV_ECTL_RATEMANAGE_AVG, \ref OV_ECTL_RATEMANAGE_HARD calls in order to * query and modify specifics of the encoder's bitrate management * configuration.*/struct ovectl_ratemanage_arg { int management_active; /**< nonzero if bitrate management is active*//** hard lower limit (in kilobits per second) below which the stream bitrate will never be allowed for any given bitrate_hard_window seconds of time.*/ long bitrate_hard_min;/** hard upper limit (in kilobits per second) above which the stream bitrate will never be allowed for any given bitrate_hard_window seconds of time.*/ long bitrate_hard_max;/** the window period (in seconds) used to regulate the hard bitrate minimum and maximum*/ double bitrate_hard_window;/** soft lower limit (in kilobits per second) below which the average bitrate tracker will start nudging the bitrate higher.*/ long bitrate_av_lo;/** soft upper limit (in kilobits per second) above which the average bitrate tracker will start nudging the bitrate lower.*/ long bitrate_av_hi;/** the window period (in seconds) used to regulate the average bitrate minimum and maximum.*/ double bitrate_av_window;/** Regulates the relative centering of the average and hard windows; in libvorbis 1.0 and 1.0.1, the hard window regulation overlapped but followed the average window regulation. In libvorbis 1.1 a bit-reservoir interface replaces the old windowing interface; the older windowing interface is simulated and this field has no effect.*/ double bitrate_av_window_center;};/** * \name struct ovectl_ratemanage2_arg * * The ovectl_ratemanage2_arg structure is used with vorbis_encode_ctl() and * the OV_ECTL_RATEMANAGE2_GET and OV_ECTL_RATEMANAGE2_SET calls in order to * query and modify specifics of the encoder's bitrate management * configuration. **/struct ovectl_ratemanage2_arg { int management_active; /**< nonzero if bitrate management is active *//** Lower allowed bitrate limit in kilobits per second */ long bitrate_limit_min_kbps;/** Upper allowed bitrate limit in kilobits per second */ long bitrate_limit_max_kbps; long bitrate_limit_reservoir_bits; /**<Size of the bitrate reservoir in bits *//** Regulates the bitrate reservoir's preferred fill level in a range from 0.0 * to 1.0; 0.0 tries to bank bits to buffer against future bitrate spikes, 1.0 * buffers against future sudden drops in instantaneous bitrate. Default is * 0.1 */ double bitrate_limit_reservoir_bias;/** Average bitrate setting in kilobits per second */ long bitrate_average_kbps;/** Slew rate limit setting for average bitrate adjustment; sets the minimum * time in seconds the bitrate tracker may swing from one extreme to the * other when boosting or damping average bitrate. */ double bitrate_average_damping;};/** * \name vorbis_encode_ctl() codes * * \anchor encctlcodes * * These values are passed as the \c number parameter of vorbis_encode_ctl(). * The type of the referent of that function's \c arg pointer depends on these * codes. *//*@{*//** * Query the current encoder bitrate management setting. * *Argument: <tt>struct ovectl_ratemanage2_arg *</tt> * * Used to query the current encoder bitrate management setting. Also used to * initialize fields of an ovectl_ratemanage2_arg structure for use with * \ref OV_ECTL_RATEMANAGE2_SET. */#define OV_ECTL_RATEMANAGE2_GET 0x14/** * Set the current encoder bitrate management settings. * * Argument: <tt>struct ovectl_ratemanage2_arg *</tt> * * Used to set the current encoder bitrate management settings to the values * listed in the ovectl_ratemanage2_arg. Passing a NULL pointer will disable * bitrate management.*/#define OV_ECTL_RATEMANAGE2_SET 0x15/** * Returns the current encoder hard-lowpass setting (kHz) in the double * pointed to by arg. * * Argument: <tt>double *</tt>*/#define OV_ECTL_LOWPASS_GET 0x20/** * Sets the encoder hard-lowpass to the value (kHz) pointed to by arg. Valid * lowpass settings range from 2 to 99. * * Argument: <tt>double *</tt>*/#define OV_ECTL_LOWPASS_SET 0x21/** * Returns the current encoder impulse block setting in the double pointed * to by arg. * * Argument: <tt>double *</tt>*/#define OV_ECTL_IBLOCK_GET 0x30/** * Sets the impulse block bias to the the value pointed to by arg. * * Argument: <tt>double *</tt> * * Valid range is -15.0 to 0.0 [default]. A negative impulse block bias will * direct to encoder to use more bits when incoding short blocks that contain * strong impulses, thus improving the accuracy of impulse encoding. */#define OV_ECTL_IBLOCK_SET 0x31/** * Returns the current encoder coupling setting in the int pointed * to by arg. * * Argument: <tt>int *</tt>*/#define OV_ECTL_COUPLING_GET 0x40/** * Enables/disables channel coupling in multichannel encoding according to arg. * * Argument: <tt>int *</tt> * * Zero disables channel coupling for multichannel inputs, nonzer enables * channel coupling. Setting has no effect on monophonic encoding or * multichannel counts that do not offer coupling. At present, coupling is * available for stereo and 5.1 encoding. */#define OV_ECTL_COUPLING_SET 0x41 /* deprecated rate management supported only for compatibility *//** * Old interface to querying bitrate management settings. * * Deprecated after move to bit-reservoir style management in 1.1 rendered * this interface partially obsolete. * \deprecated Please use \ref OV_ECTL_RATEMANAGE2_GET instead. * * Argument: <tt>struct ovectl_ratemanage_arg *</tt> */#define OV_ECTL_RATEMANAGE_GET 0x10/** * Old interface to modifying bitrate management settings. * * deprecated after move to bit-reservoir style management in 1.1 rendered * this interface partially obsolete. * * \deprecated Please use \ref OV_ECTL_RATEMANAGE2_SET instead. * * Argument: <tt>struct ovectl_ratemanage_arg *</tt> */#define OV_ECTL_RATEMANAGE_SET 0x11/** * Old interface to setting average-bitrate encoding mode. * * Deprecated after move to bit-reservoir style management in 1.1 rendered * this interface partially obsolete. * * \deprecated Please use \ref OV_ECTL_RATEMANAGE2_SET instead. * * Argument: <tt>struct ovectl_ratemanage_arg *</tt> */#define OV_ECTL_RATEMANAGE_AVG 0x12/** * Old interface to setting bounded-bitrate encoding modes. * * deprecated after move to bit-reservoir style management in 1.1 rendered * this interface partially obsolete. * * \deprecated Please use \ref OV_ECTL_RATEMANAGE2_SET instead. * * Argument: <tt>struct ovectl_ratemanage_arg *</tt> */#define OV_ECTL_RATEMANAGE_HARD 0x13/*@}*/#ifdef __cplusplus}#endif /* __cplusplus */#endifvendor/vorbis/include/vorbis/vorbisfile.hadded
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 * * by the Xiph.Org Foundation https://xiph.org/ * * * ******************************************************************** function: stdio-based convenience library for opening/seeking/decoding ********************************************************************/#ifndef _OV_FILE_H_#define _OV_FILE_H_#ifdef __cplusplusextern "C"{#endif /* __cplusplus */#include <stdio.h>#include "codec.h"/* The function prototypes for the callbacks are basically the same as for * the stdio functions fread, fseek, fclose, ftell. * The one difference is that the FILE * arguments have been replaced with * a void * - this is to be used as a pointer to whatever internal data these * functions might need. In the stdio case, it's just a FILE * cast to a void * * * If you use other functions, check the docs for these functions and return * the right values. For seek_func(), you *MUST* return -1 if the stream is * unseekable */typedef struct { size_t (*read_func) (void *ptr, size_t size, size_t nmemb, void *datasource); int (*seek_func) (void *datasource, ogg_int64_t offset, int whence); int (*close_func) (void *datasource); long (*tell_func) (void *datasource);} ov_callbacks;#ifndef OV_EXCLUDE_STATIC_CALLBACKS/* a few sets of convenient callbacks, especially for use under * Windows where ov_open_callbacks() should always be used instead of * ov_open() to avoid problems with incompatible crt.o version linking * issues. */static int _ov_header_fseek_wrap(FILE *f,ogg_int64_t off,int whence){ if(f==NULL)return(-1);#ifdef __MINGW32__ return fseeko64(f,off,whence);#elif defined (_WIN32) return _fseeki64(f,off,whence);#else return fseek(f,off,whence);#endif}/* These structs below (OV_CALLBACKS_DEFAULT etc) are defined here as * static data. That means that every file which includes this header * will get its own copy of these structs whether it uses them or * not unless it #defines OV_EXCLUDE_STATIC_CALLBACKS. * These static symbols are essential on platforms such as Windows on * which several different versions of stdio support may be linked to * by different DLLs, and we need to be certain we know which one * we're using (the same one as the main application). */static ov_callbacks OV_CALLBACKS_DEFAULT = { (size_t (*)(void *, size_t, size_t, void *)) fread, (int (*)(void *, ogg_int64_t, int)) _ov_header_fseek_wrap, (int (*)(void *)) fclose, (long (*)(void *)) ftell};static ov_callbacks OV_CALLBACKS_NOCLOSE = { (size_t (*)(void *, size_t, size_t, void *)) fread, (int (*)(void *, ogg_int64_t, int)) _ov_header_fseek_wrap, (int (*)(void *)) NULL, (long (*)(void *)) ftell};static ov_callbacks OV_CALLBACKS_STREAMONLY = { (size_t (*)(void *, size_t, size_t, void *)) fread, (int (*)(void *, ogg_int64_t, int)) NULL, (int (*)(void *)) fclose, (long (*)(void *)) NULL};static ov_callbacks OV_CALLBACKS_STREAMONLY_NOCLOSE = { (size_t (*)(void *, size_t, size_t, void *)) fread, (int (*)(void *, ogg_int64_t, int)) NULL, (int (*)(void *)) NULL, (long (*)(void *)) NULL};#endif#define NOTOPEN 0#define PARTOPEN 1#define OPENED 2#define STREAMSET 3#define INITSET 4typedef struct OggVorbis_File { void *datasource; /* Pointer to a FILE *, etc. */ int seekable; ogg_int64_t offset; ogg_int64_t end; ogg_sync_state oy; /* If the FILE handle isn't seekable (eg, a pipe), only the current stream appears */ int links; ogg_int64_t *offsets; ogg_int64_t *dataoffsets; long *serialnos; ogg_int64_t *pcmlengths; /* overloaded to maintain binary compatibility; x2 size, stores both beginning and end values */ vorbis_info *vi; vorbis_comment *vc; /* Decoding working state local storage */ ogg_int64_t pcm_offset; int ready_state; long current_serialno; int current_link; double bittrack; double samptrack; ogg_stream_state os; /* take physical pages, weld into a logical stream of packets */ vorbis_dsp_state vd; /* central working state for the packet->PCM decoder */ vorbis_block vb; /* local working space for packet->PCM decode */ ov_callbacks callbacks;} OggVorbis_File;extern int ov_clear(OggVorbis_File *vf);extern int ov_fopen(const char *path,OggVorbis_File *vf);extern int ov_open(FILE *f,OggVorbis_File *vf,const char *initial,long ibytes);extern int ov_open_callbacks(void *datasource, OggVorbis_File *vf, const char *initial, long ibytes, ov_callbacks callbacks);extern int ov_test(FILE *f,OggVorbis_File *vf,const char *initial,long ibytes);extern int ov_test_callbacks(void *datasource, OggVorbis_File *vf, const char *initial, long ibytes, ov_callbacks callbacks);extern int ov_test_open(OggVorbis_File *vf);extern long ov_bitrate(OggVorbis_File *vf,int i);extern long ov_bitrate_instant(OggVorbis_File *vf);extern long ov_streams(OggVorbis_File *vf);extern long ov_seekable(OggVorbis_File *vf);extern long ov_serialnumber(OggVorbis_File *vf,int i);extern ogg_int64_t ov_raw_total(OggVorbis_File *vf,int i);extern ogg_int64_t ov_pcm_total(OggVorbis_File *vf,int i);extern double ov_time_total(OggVorbis_File *vf,int i);extern int ov_raw_seek(OggVorbis_File *vf,ogg_int64_t pos);extern int ov_pcm_seek(OggVorbis_File *vf,ogg_int64_t pos);extern int ov_pcm_seek_page(OggVorbis_File *vf,ogg_int64_t pos);extern int ov_time_seek(OggVorbis_File *vf,double pos);extern int ov_time_seek_page(OggVorbis_File *vf,double pos);extern int ov_raw_seek_lap(OggVorbis_File *vf,ogg_int64_t pos);extern int ov_pcm_seek_lap(OggVorbis_File *vf,ogg_int64_t pos);extern int ov_pcm_seek_page_lap(OggVorbis_File *vf,ogg_int64_t pos);extern int ov_time_seek_lap(OggVorbis_File *vf,double pos);extern int ov_time_seek_page_lap(OggVorbis_File *vf,double pos);extern ogg_int64_t ov_raw_tell(OggVorbis_File *vf);extern ogg_int64_t ov_pcm_tell(OggVorbis_File *vf);extern double ov_time_tell(OggVorbis_File *vf);extern vorbis_info *ov_info(OggVorbis_File *vf,int link);extern vorbis_comment *ov_comment(OggVorbis_File *vf,int link);extern long ov_read_float(OggVorbis_File *vf,float ***pcm_channels,int samples, int *bitstream);extern long ov_read_filter(OggVorbis_File *vf,char *buffer,int length, int bigendianp,int word,int sgned,int *bitstream, void (*filter)(float **pcm,long channels,long samples,void *filter_param),void *filter_param);extern long ov_read(OggVorbis_File *vf,char *buffer,int length, int bigendianp,int word,int sgned,int *bitstream);extern int ov_crosslap(OggVorbis_File *vf1,OggVorbis_File *vf2);extern int ov_halfrate(OggVorbis_File *vf,int flag);extern int ov_halfrate_p(OggVorbis_File *vf);#ifdef __cplusplus}#endif /* __cplusplus */#endifvendor/vorbis/lib/analysis.cadded
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 * * by the Xiph.Org Foundation https://xiph.org/ * * * ******************************************************************** function: single-block PCM analysis mode dispatch ********************************************************************/#include <stdio.h>#include <string.h>#include <math.h>#include <ogg/ogg.h>#include "vorbis/codec.h"#include "codec_internal.h"#include "registry.h"#include "scales.h"#include "os.h"#include "misc.h"/* decides between modes, dispatches to the appropriate mapping. */int vorbis_analysis(vorbis_block *vb, ogg_packet *op){ int ret,i; vorbis_block_internal *vbi=vb->internal; vb->glue_bits=0; vb->time_bits=0; vb->floor_bits=0; vb->res_bits=0; /* first things first. Make sure encode is ready */ for(i=0;i<PACKETBLOBS;i++) oggpack_reset(vbi->packetblob[i]); /* we only have one mapping type (0), and we let the mapping code itself figure out what soft mode to use. This allows easier bitrate management */ if((ret=_mapping_P[0]->forward(vb))) return(ret); if(op){ if(vorbis_bitrate_managed(vb)) /* The app is using a bitmanaged mode... but not using the bitrate management interface. */ return(OV_EINVAL); op->packet=oggpack_get_buffer(&vb->opb); op->bytes=oggpack_bytes(&vb->opb); op->b_o_s=0; op->e_o_s=vb->eofflag; op->granulepos=vb->granulepos; op->packetno=vb->sequence; /* for sake of completeness */ } return(0);}#ifdef ANALYSISint analysis_noisy=1;/* there was no great place to put this.... */void _analysis_output_always(char *base,int i,float *v,int n,int bark,int dB,ogg_int64_t off){ int j; FILE *of; char buffer[80]; sprintf(buffer,"%s_%d.m",base,i); of=fopen(buffer,"w"); if(!of)perror("failed to open data dump file"); for(j=0;j<n;j++){ if(bark){ float b=toBARK((4000.f*j/n)+.25); fprintf(of,"%f ",b); }else if(off!=0) fprintf(of,"%f ",(double)(j+off)/8000.); else fprintf(of,"%f ",(double)j); if(dB){ float val; if(v[j]==0.) val=-140.; else val=todB(v+j); fprintf(of,"%f\n",val); }else{ fprintf(of,"%f\n",v[j]); } } fclose(of);}void _analysis_output(char *base,int i,float *v,int n,int bark,int dB, ogg_int64_t off){ if(analysis_noisy)_analysis_output_always(base,i,v,n,bark,dB,off);}#endifvendor/vorbis/lib/backends.hadded
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 * * by the Xiph.Org Foundation https://xiph.org/ * * * ******************************************************************** function: libvorbis backend and mapping structures; needed for static mode headers ********************************************************************//* this is exposed up here because we need it for static modes. Lookups for each backend aren't exposed because there's no reason to do so */#ifndef _vorbis_backend_h_#define _vorbis_backend_h_#include "codec_internal.h"/* this would all be simpler/shorter with templates, but.... *//* Floor backend generic *****************************************/typedef struct{ void (*pack) (vorbis_info_floor *,oggpack_buffer *); vorbis_info_floor *(*unpack)(vorbis_info *,oggpack_buffer *); vorbis_look_floor *(*look) (vorbis_dsp_state *,vorbis_info_floor *); void (*free_info) (vorbis_info_floor *); void (*free_look) (vorbis_look_floor *); void *(*inverse1) (struct vorbis_block *,vorbis_look_floor *); int (*inverse2) (struct vorbis_block *,vorbis_look_floor *, void *buffer,float *);} vorbis_func_floor;typedef struct{ int order; long rate; long barkmap; int ampbits; int ampdB; int numbooks; /* <= 16 */ int books[16]; float lessthan; /* encode-only config setting hacks for libvorbis */ float greaterthan; /* encode-only config setting hacks for libvorbis */} vorbis_info_floor0;#define VIF_POSIT 63#define VIF_CLASS 16#define VIF_PARTS 31typedef struct{ int partitions; /* 0 to 31 */ int partitionclass[VIF_PARTS]; /* 0 to 15 */ int class_dim[VIF_CLASS]; /* 1 to 8 */ int class_subs[VIF_CLASS]; /* 0,1,2,3 (bits: 1<<n poss) */ int class_book[VIF_CLASS]; /* subs ^ dim entries */ int class_subbook[VIF_CLASS][8]; /* [VIF_CLASS][subs] */ int mult; /* 1 2 3 or 4 */ int postlist[VIF_POSIT+2]; /* first two implicit */ /* encode side analysis parameters */ float maxover; float maxunder; float maxerr; float twofitweight; float twofitatten; int n;} vorbis_info_floor1;/* Residue backend generic *****************************************/typedef struct{ void (*pack) (vorbis_info_residue *,oggpack_buffer *); vorbis_info_residue *(*unpack)(vorbis_info *,oggpack_buffer *); vorbis_look_residue *(*look) (vorbis_dsp_state *, vorbis_info_residue *); void (*free_info) (vorbis_info_residue *); void (*free_look) (vorbis_look_residue *); long **(*class) (struct vorbis_block *,vorbis_look_residue *, int **,int *,int); int (*forward) (oggpack_buffer *,struct vorbis_block *, vorbis_look_residue *, int **,int *,int,long **,int); int (*inverse) (struct vorbis_block *,vorbis_look_residue *, float **,int *,int);} vorbis_func_residue;typedef struct vorbis_info_residue0{/* block-partitioned VQ coded straight residue */ long begin; long end; /* first stage (lossless partitioning) */ int grouping; /* group n vectors per partition */ int partitions; /* possible codebooks for a partition */ int partvals; /* partitions ^ groupbook dim */ int groupbook; /* huffbook for partitioning */ int secondstages[64]; /* expanded out to pointers in lookup */ int booklist[512]; /* list of second stage books */ const int classmetric1[64]; const int classmetric2[64];} vorbis_info_residue0;/* Mapping backend generic *****************************************/typedef struct{ void (*pack) (vorbis_info *,vorbis_info_mapping *, oggpack_buffer *); vorbis_info_mapping *(*unpack)(vorbis_info *,oggpack_buffer *); void (*free_info) (vorbis_info_mapping *); int (*forward) (struct vorbis_block *vb); int (*inverse) (struct vorbis_block *vb,vorbis_info_mapping *);} vorbis_func_mapping;typedef struct vorbis_info_mapping0{ int submaps; /* <= 16 */ int chmuxlist[256]; /* up to 256 channels in a Vorbis stream */ int floorsubmap[16]; /* [mux] submap to floors */ int residuesubmap[16]; /* [mux] submap to residue */ int coupling_steps; int coupling_mag[256]; int coupling_ang[256];} vorbis_info_mapping0;#endifvendor/vorbis/lib/bitrate.cadded
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 * * by the Xiph.Org Foundation https://xiph.org/ * * * ******************************************************************** function: bitrate tracking and management ********************************************************************/#include <stdlib.h>#include <string.h>#include <math.h>#include <ogg/ogg.h>#include "vorbis/codec.h"#include "codec_internal.h"#include "os.h"#include "misc.h"#include "bitrate.h"/* compute bitrate tracking setup */void vorbis_bitrate_init(vorbis_info *vi,bitrate_manager_state *bm){ codec_setup_info *ci=vi->codec_setup; bitrate_manager_info *bi=&ci->bi; memset(bm,0,sizeof(*bm)); if(bi && (bi->reservoir_bits>0)){ long ratesamples=vi->rate; int halfsamples=ci->blocksizes[0]>>1; bm->short_per_long=ci->blocksizes[1]/ci->blocksizes[0]; bm->managed=1; bm->avg_bitsper= rint(1.*bi->avg_rate*halfsamples/ratesamples); bm->min_bitsper= rint(1.*bi->min_rate*halfsamples/ratesamples); bm->max_bitsper= rint(1.*bi->max_rate*halfsamples/ratesamples); bm->avgfloat=PACKETBLOBS/2; /* not a necessary fix, but one that leads to a more balanced typical initialization */ { long desired_fill=bi->reservoir_bits*bi->reservoir_bias; bm->minmax_reservoir=desired_fill; bm->avg_reservoir=desired_fill; } }}void vorbis_bitrate_clear(bitrate_manager_state *bm){ memset(bm,0,sizeof(*bm)); return;}int vorbis_bitrate_managed(vorbis_block *vb){ vorbis_dsp_state *vd=vb->vd; private_state *b=vd->backend_state; bitrate_manager_state *bm=&b->bms; if(bm && bm->managed)return(1); return(0);}/* finish taking in the block we just processed */int vorbis_bitrate_addblock(vorbis_block *vb){ vorbis_block_internal *vbi=vb->internal; vorbis_dsp_state *vd=vb->vd; private_state *b=vd->backend_state; bitrate_manager_state *bm=&b->bms; vorbis_info *vi=vd->vi; codec_setup_info *ci=vi->codec_setup; bitrate_manager_info *bi=&ci->bi; int choice=rint(bm->avgfloat); long this_bits=oggpack_bytes(vbi->packetblob[choice])*8; long min_target_bits=(vb->W?bm->min_bitsper*bm->short_per_long:bm->min_bitsper); long max_target_bits=(vb->W?bm->max_bitsper*bm->short_per_long:bm->max_bitsper); int samples=ci->blocksizes[vb->W]>>1; long desired_fill=bi->reservoir_bits*bi->reservoir_bias; if(!bm->managed){ /* not a bitrate managed stream, but for API simplicity, we'll buffer the packet to keep the code path clean */ if(bm->vb)return(-1); /* one has been submitted without being claimed */ bm->vb=vb; return(0); } bm->vb=vb; /* look ahead for avg floater */ if(bm->avg_bitsper>0){ double slew=0.; long avg_target_bits=(vb->W?bm->avg_bitsper*bm->short_per_long:bm->avg_bitsper); double slewlimit= 15./bi->slew_damp; /* choosing a new floater: if we're over target, we slew down if we're under target, we slew up choose slew as follows: look through packetblobs of this frame and set slew as the first in the appropriate direction that gives us the slew we want. This may mean no slew if delta is already favorable. Then limit slew to slew max */ if(bm->avg_reservoir+(this_bits-avg_target_bits)>desired_fill){ while(choice>0 && this_bits>avg_target_bits && bm->avg_reservoir+(this_bits-avg_target_bits)>desired_fill){ choice--; this_bits=oggpack_bytes(vbi->packetblob[choice])*8; } }else if(bm->avg_reservoir+(this_bits-avg_target_bits)<desired_fill){ while(choice+1<PACKETBLOBS && this_bits<avg_target_bits && bm->avg_reservoir+(this_bits-avg_target_bits)<desired_fill){ choice++; this_bits=oggpack_bytes(vbi->packetblob[choice])*8; } } slew=rint(choice-bm->avgfloat)/samples*vi->rate; if(slew<-slewlimit)slew=-slewlimit; if(slew>slewlimit)slew=slewlimit; choice=rint(bm->avgfloat+= slew/vi->rate*samples); this_bits=oggpack_bytes(vbi->packetblob[choice])*8; } /* enforce min(if used) on the current floater (if used) */ if(bm->min_bitsper>0){ /* do we need to force the bitrate up? */ if(this_bits<min_target_bits){ while(bm->minmax_reservoir-(min_target_bits-this_bits)<0){ choice++; if(choice>=PACKETBLOBS)break; this_bits=oggpack_bytes(vbi->packetblob[choice])*8; } } } /* enforce max (if used) on the current floater (if used) */ if(bm->max_bitsper>0){ /* do we need to force the bitrate down? */ if(this_bits>max_target_bits){ while(bm->minmax_reservoir+(this_bits-max_target_bits)>bi->reservoir_bits){ choice--; if(choice<0)break; this_bits=oggpack_bytes(vbi->packetblob[choice])*8; } } } /* Choice of packetblobs now made based on floater, and min/max requirements. Now boundary check extreme choices */ if(choice<0){ /* choosing a smaller packetblob is insufficient to trim bitrate. frame will need to be truncated */ long maxsize=(max_target_bits+(bi->reservoir_bits-bm->minmax_reservoir))/8; bm->choice=choice=0; if(oggpack_bytes(vbi->packetblob[choice])>maxsize){ oggpack_writetrunc(vbi->packetblob[choice],maxsize*8); this_bits=oggpack_bytes(vbi->packetblob[choice])*8; } }else{ long minsize=(min_target_bits-bm->minmax_reservoir+7)/8; if(choice>=PACKETBLOBS) choice=PACKETBLOBS-1; bm->choice=choice; /* prop up bitrate according to demand. pad this frame out with zeroes */ minsize-=oggpack_bytes(vbi->packetblob[choice]); while(minsize-->0)oggpack_write(vbi->packetblob[choice],0,8); this_bits=oggpack_bytes(vbi->packetblob[choice])*8; } /* now we have the final packet and the final packet size. Update statistics */ /* min and max reservoir */ if(bm->min_bitsper>0 || bm->max_bitsper>0){ if(max_target_bits>0 && this_bits>max_target_bits){ bm->minmax_reservoir+=(this_bits-max_target_bits); }else if(min_target_bits>0 && this_bits<min_target_bits){ bm->minmax_reservoir+=(this_bits-min_target_bits); }else{ /* inbetween; we want to take reservoir toward but not past desired_fill */ if(bm->minmax_reservoir>desired_fill){ if(max_target_bits>0){ /* logical bulletproofing against initialization state */ bm->minmax_reservoir+=(this_bits-max_target_bits); if(bm->minmax_reservoir<desired_fill)bm->minmax_reservoir=desired_fill; }else{ bm->minmax_reservoir=desired_fill; } }else{ if(min_target_bits>0){ /* logical bulletproofing against initialization state */ bm->minmax_reservoir+=(this_bits-min_target_bits); if(bm->minmax_reservoir>desired_fill)bm->minmax_reservoir=desired_fill; }else{ bm->minmax_reservoir=desired_fill; } } } } /* avg reservoir */ if(bm->avg_bitsper>0){ long avg_target_bits=(vb->W?bm->avg_bitsper*bm->short_per_long:bm->avg_bitsper); bm->avg_reservoir+=this_bits-avg_target_bits; } return(0);}int vorbis_bitrate_flushpacket(vorbis_dsp_state *vd,ogg_packet *op){ private_state *b=vd->backend_state; bitrate_manager_state *bm=&b->bms; vorbis_block *vb=bm->vb; int choice=PACKETBLOBS/2; if(!vb)return 0; if(op){ vorbis_block_internal *vbi=vb->internal; if(vorbis_bitrate_managed(vb)) choice=bm->choice; op->packet=oggpack_get_buffer(vbi->packetblob[choice]); op->bytes=oggpack_bytes(vbi->packetblob[choice]); op->b_o_s=0; op->e_o_s=vb->eofflag; op->granulepos=vb->granulepos; op->packetno=vb->sequence; /* for sake of completeness */ } bm->vb=0; return(1);}vendor/vorbis/lib/bitrate.hadded
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 * * by the Xiph.Org Foundation https://xiph.org/ * * * ******************************************************************** function: bitrate tracking and management ********************************************************************/#ifndef _V_BITRATE_H_#define _V_BITRATE_H_#include "vorbis/codec.h"#include "codec_internal.h"#include "os.h"/* encode side bitrate tracking */typedef struct bitrate_manager_state { int managed; long avg_reservoir; long minmax_reservoir; long avg_bitsper; long min_bitsper; long max_bitsper; long short_per_long; double avgfloat; vorbis_block *vb; int choice;} bitrate_manager_state;typedef struct bitrate_manager_info{ long avg_rate; long min_rate; long max_rate; long reservoir_bits; double reservoir_bias; double slew_damp;} bitrate_manager_info;extern void vorbis_bitrate_init(vorbis_info *vi,bitrate_manager_state *bs);extern void vorbis_bitrate_clear(bitrate_manager_state *bs);extern int vorbis_bitrate_managed(vorbis_block *vb);extern int vorbis_bitrate_addblock(vorbis_block *vb);extern int vorbis_bitrate_flushpacket(vorbis_dsp_state *vd, ogg_packet *op);#endifvendor/vorbis/lib/block.cadded
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2015 * * by the Xiph.Org Foundation https://xiph.org/ * * * ******************************************************************** function: PCM data vector blocking, windowing and dis/reassembly Handle windowing, overlap-add, etc of the PCM vectors. This is made more amusing by Vorbis' current two allowed block sizes. ********************************************************************/#include <stdio.h>#include <stdlib.h>#include <string.h>#include <ogg/ogg.h>#include "vorbis/codec.h"#include "codec_internal.h"#include "window.h"#include "mdct.h"#include "lpc.h"#include "registry.h"#include "misc.h"/* pcm accumulator examples (not exhaustive): <-------------- lW ----------------> <--------------- W ---------------->: .....|..... _______________ |: .''' | '''_--- | |\ |:.....''' |_____--- '''......| | \_______|:.................|__________________|_______|__|______| |<------ Sl ------>| > Sr < |endW |beginSl |endSl | |endSr |beginW |endlW |beginSr |< lW >| <--------------- W ----------------> | | .. ______________ | | | ' `/ | ---_ | |___.'___/`. | ---_____| |_______|__|_______|_________________| | >|Sl|< |<------ Sr ----->|endW | | |endSl |beginSr |endSr |beginW | |endlW mult[0] |beginSl mult[n] <-------------- lW -----------------> |<--W-->|: .............. ___ | |: .''' |`/ \ | |:.....''' |/`....\|...|:.........................|___|___|___| |Sl |Sr |endW | | |endSr | |beginSr | |endSl |beginSl |beginW*//* block abstraction setup *********************************************/#ifndef WORD_ALIGN#define WORD_ALIGN 8#endifint vorbis_block_init(vorbis_dsp_state *v, vorbis_block *vb){ int i; memset(vb,0,sizeof(*vb)); vb->vd=v; vb->localalloc=0; vb->localstore=NULL; if(v->analysisp){ vorbis_block_internal *vbi= vb->internal=_ogg_calloc(1,sizeof(vorbis_block_internal)); vbi->ampmax=-9999; for(i=0;i<PACKETBLOBS;i++){ if(i==PACKETBLOBS/2){ vbi->packetblob[i]=&vb->opb; }else{ vbi->packetblob[i]= _ogg_calloc(1,sizeof(oggpack_buffer)); } oggpack_writeinit(vbi->packetblob[i]); } } return(0);}void *_vorbis_block_alloc(vorbis_block *vb,long bytes){ bytes=(bytes+(WORD_ALIGN-1)) & ~(WORD_ALIGN-1); if(bytes+vb->localtop>vb->localalloc){ /* can't just _ogg_realloc... there are outstanding pointers */ if(vb->localstore){ struct alloc_chain *link=_ogg_malloc(sizeof(*link)); vb->totaluse+=vb->localtop; link->next=vb->reap; link->ptr=vb->localstore; vb->reap=link; } /* highly conservative */ vb->localalloc=bytes; vb->localstore=_ogg_malloc(vb->localalloc); vb->localtop=0; } { void *ret=(void *)(((char *)vb->localstore)+vb->localtop); vb->localtop+=bytes; return ret; }}/* reap the chain, pull the ripcord */void _vorbis_block_ripcord(vorbis_block *vb){ /* reap the chain */ struct alloc_chain *reap=vb->reap; while(reap){ struct alloc_chain *next=reap->next; _ogg_free(reap->ptr); memset(reap,0,sizeof(*reap)); _ogg_free(reap); reap=next; } /* consolidate storage */ if(vb->totaluse){ vb->localstore=_ogg_realloc(vb->localstore,vb->totaluse+vb->localalloc); vb->localalloc+=vb->totaluse; vb->totaluse=0; } /* pull the ripcord */ vb->localtop=0; vb->reap=NULL;}int vorbis_block_clear(vorbis_block *vb){ int i; vorbis_block_internal *vbi=vb->internal; _vorbis_block_ripcord(vb); if(vb->localstore)_ogg_free(vb->localstore); if(vbi){ for(i=0;i<PACKETBLOBS;i++){ oggpack_writeclear(vbi->packetblob[i]); if(i!=PACKETBLOBS/2)_ogg_free(vbi->packetblob[i]); } _ogg_free(vbi); } memset(vb,0,sizeof(*vb)); return(0);}/* Analysis side code, but directly related to blocking. Thus it's here and not in analysis.c (which is for analysis transforms only). The init is here because some of it is shared */static int _vds_shared_init(vorbis_dsp_state *v,vorbis_info *vi,int encp){ int i; codec_setup_info *ci=vi->codec_setup; private_state *b=NULL; int hs; if(ci==NULL|| ci->modes<=0|| ci->blocksizes[0]<64|| ci->blocksizes[1]<ci->blocksizes[0]){ return 1; } hs=ci->halfrate_flag; memset(v,0,sizeof(*v)); b=v->backend_state=_ogg_calloc(1,sizeof(*b)); v->vi=vi; b->modebits=ov_ilog(ci->modes-1); b->transform[0]=_ogg_calloc(VI_TRANSFORMB,sizeof(*b->transform[0])); b->transform[1]=_ogg_calloc(VI_TRANSFORMB,sizeof(*b->transform[1])); /* MDCT is tranform 0 */ b->transform[0][0]=_ogg_calloc(1,sizeof(mdct_lookup)); b->transform[1][0]=_ogg_calloc(1,sizeof(mdct_lookup)); mdct_init(b->transform[0][0],ci->blocksizes[0]>>hs); mdct_init(b->transform[1][0],ci->blocksizes[1]>>hs); /* Vorbis I uses only window type 0 */ /* note that the correct computation below is technically: b->window[0]=ov_ilog(ci->blocksizes[0]-1)-6; b->window[1]=ov_ilog(ci->blocksizes[1]-1)-6; but since blocksizes are always powers of two, the below is equivalent. */ b->window[0]=ov_ilog(ci->blocksizes[0])-7; b->window[1]=ov_ilog(ci->blocksizes[1])-7; if(encp){ /* encode/decode differ here */ /* analysis always needs an fft */ drft_init(&b->fft_look[0],ci->blocksizes[0]); drft_init(&b->fft_look[1],ci->blocksizes[1]); /* finish the codebooks */ if(!ci->fullbooks){ ci->fullbooks=_ogg_calloc(ci->books,sizeof(*ci->fullbooks)); for(i=0;i<ci->books;i++) vorbis_book_init_encode(ci->fullbooks+i,ci->book_param[i]); } b->psy=_ogg_calloc(ci->psys,sizeof(*b->psy)); for(i=0;i<ci->psys;i++){ _vp_psy_init(b->psy+i, ci->psy_param[i], &ci->psy_g_param, ci->blocksizes[ci->psy_param[i]->blockflag]/2, vi->rate); } v->analysisp=1; }else{ /* finish the codebooks */ if(!ci->fullbooks){ ci->fullbooks=_ogg_calloc(ci->books,sizeof(*ci->fullbooks)); for(i=0;i<ci->books;i++){ if(ci->book_param[i]==NULL) goto abort_books; if(vorbis_book_init_decode(ci->fullbooks+i,ci->book_param[i])) goto abort_books; /* decode codebooks are now standalone after init */ vorbis_staticbook_destroy(ci->book_param[i]); ci->book_param[i]=NULL; } } } /* initialize the storage vectors. blocksize[1] is small for encode, but the correct size for decode */ v->pcm_storage=ci->blocksizes[1]; v->pcm=_ogg_malloc(vi->channels*sizeof(*v->pcm)); v->pcmret=_ogg_malloc(vi->channels*sizeof(*v->pcmret)); { int i; for(i=0;i<vi->channels;i++) v->pcm[i]=_ogg_calloc(v->pcm_storage,sizeof(*v->pcm[i])); } /* all 1 (large block) or 0 (small block) */ /* explicitly set for the sake of clarity */ v->lW=0; /* previous window size */ v->W=0; /* current window size */ /* all vector indexes */ v->centerW=ci->blocksizes[1]/2; v->pcm_current=v->centerW; /* initialize all the backend lookups */ b->flr=_ogg_calloc(ci->floors,sizeof(*b->flr)); b->residue=_ogg_calloc(ci->residues,sizeof(*b->residue)); for(i=0;i<ci->floors;i++) b->flr[i]=_floor_P[ci->floor_type[i]]-> look(v,ci->floor_param[i]); for(i=0;i<ci->residues;i++) b->residue[i]=_residue_P[ci->residue_type[i]]-> look(v,ci->residue_param[i]); return 0; abort_books: for(i=0;i<ci->books;i++){ if(ci->book_param[i]!=NULL){ vorbis_staticbook_destroy(ci->book_param[i]); ci->book_param[i]=NULL; } } vorbis_dsp_clear(v); return -1;}/* arbitrary settings and spec-mandated numbers get filled in here */int vorbis_analysis_init(vorbis_dsp_state *v,vorbis_info *vi){ private_state *b=NULL; if(_vds_shared_init(v,vi,1))return 1; b=v->backend_state; b->psy_g_look=_vp_global_look(vi); /* Initialize the envelope state storage */ b->ve=_ogg_calloc(1,sizeof(*b->ve)); _ve_envelope_init(b->ve,vi); vorbis_bitrate_init(vi,&b->bms); /* compressed audio packets start after the headers with sequence number 3 */ v->sequence=3; return(0);}void vorbis_dsp_clear(vorbis_dsp_state *v){ int i; if(v){ vorbis_info *vi=v->vi; codec_setup_info *ci=(vi?vi->codec_setup:NULL); private_state *b=v->backend_state; if(b){ if(b->ve){ _ve_envelope_clear(b->ve); _ogg_free(b->ve); } if(b->transform[0]){ mdct_clear(b->transform[0][0]); _ogg_free(b->transform[0][0]); _ogg_free(b->transform[0]); } if(b->transform[1]){ mdct_clear(b->transform[1][0]); _ogg_free(b->transform[1][0]); _ogg_free(b->transform[1]); } if(b->flr){ if(ci) for(i=0;i<ci->floors;i++) _floor_P[ci->floor_type[i]]-> free_look(b->flr[i]); _ogg_free(b->flr); } if(b->residue){ if(ci) for(i=0;i<ci->residues;i++) _residue_P[ci->residue_type[i]]-> free_look(b->residue[i]); _ogg_free(b->residue); } if(b->psy){ if(ci) for(i=0;i<ci->psys;i++) _vp_psy_clear(b->psy+i); _ogg_free(b->psy); } if(b->psy_g_look)_vp_global_free(b->psy_g_look); vorbis_bitrate_clear(&b->bms); drft_clear(&b->fft_look[0]); drft_clear(&b->fft_look[1]); } if(v->pcm){ if(vi) for(i=0;i<vi->channels;i++) if(v->pcm[i])_ogg_free(v->pcm[i]); _ogg_free(v->pcm); if(v->pcmret)_ogg_free(v->pcmret); } if(b){ /* free header, header1, header2 */ if(b->header)_ogg_free(b->header); if(b->header1)_ogg_free(b->header1); if(b->header2)_ogg_free(b->header2); _ogg_free(b); } memset(v,0,sizeof(*v)); }}float **vorbis_analysis_buffer(vorbis_dsp_state *v, int vals){ int i; vorbis_info *vi=v->vi; private_state *b=v->backend_state; /* free header, header1, header2 */ if(b->header)_ogg_free(b->header);b->header=NULL; if(b->header1)_ogg_free(b->header1);b->header1=NULL; if(b->header2)_ogg_free(b->header2);b->header2=NULL; /* Do we have enough storage space for the requested buffer? If not, expand the PCM (and envelope) storage */ if(v->pcm_current+vals>=v->pcm_storage){ v->pcm_storage=v->pcm_current+vals*2; for(i=0;i<vi->channels;i++){ v->pcm[i]=_ogg_realloc(v->pcm[i],v->pcm_storage*sizeof(*v->pcm[i])); } } for(i=0;i<vi->channels;i++) v->pcmret[i]=v->pcm[i]+v->pcm_current; return(v->pcmret);}static void _preextrapolate_helper(vorbis_dsp_state *v){ int i; int order=16; float *lpc=alloca(order*sizeof(*lpc)); float *work=alloca(v->pcm_current*sizeof(*work)); long j; v->preextrapolate=1; if(v->pcm_current-v->centerW>order*2){ /* safety */ for(i=0;i<v->vi->channels;i++){ /* need to run the extrapolation in reverse! */ for(j=0;j<v->pcm_current;j++) work[j]=v->pcm[i][v->pcm_current-j-1]; /* prime as above */ vorbis_lpc_from_data(work,lpc,v->pcm_current-v->centerW,order);#if 0 if(v->vi->channels==2){ if(i==0) _analysis_output("predataL",0,work,v->pcm_current-v->centerW,0,0,0); else _analysis_output("predataR",0,work,v->pcm_current-v->centerW,0,0,0); }else{ _analysis_output("predata",0,work,v->pcm_current-v->centerW,0,0,0); }#endif /* run the predictor filter */ vorbis_lpc_predict(lpc,work+v->pcm_current-v->centerW-order, order, work+v->pcm_current-v->centerW, v->centerW); for(j=0;j<v->pcm_current;j++) v->pcm[i][v->pcm_current-j-1]=work[j]; } }}/* call with val<=0 to set eof */int vorbis_analysis_wrote(vorbis_dsp_state *v, int vals){ vorbis_info *vi=v->vi; codec_setup_info *ci=vi->codec_setup; if(vals<=0){ int order=32; int i; float *lpc=alloca(order*sizeof(*lpc)); /* if it wasn't done earlier (very short sample) */ if(!v->preextrapolate) _preextrapolate_helper(v); /* We're encoding the end of the stream. Just make sure we have [at least] a few full blocks of zeroes at the end. */ /* actually, we don't want zeroes; that could drop a large amplitude off a cliff, creating spread spectrum noise that will suck to encode. Extrapolate for the sake of cleanliness. */ vorbis_analysis_buffer(v,ci->blocksizes[1]*3); v->eofflag=v->pcm_current; v->pcm_current+=ci->blocksizes[1]*3; for(i=0;i<vi->channels;i++){ if(v->eofflag>order*2){ /* extrapolate with LPC to fill in */ long n; /* make a predictor filter */ n=v->eofflag; if(n>ci->blocksizes[1])n=ci->blocksizes[1]; vorbis_lpc_from_data(v->pcm[i]+v->eofflag-n,lpc,n,order); /* run the predictor filter */ vorbis_lpc_predict(lpc,v->pcm[i]+v->eofflag-order,order, v->pcm[i]+v->eofflag,v->pcm_current-v->eofflag); }else{ /* not enough data to extrapolate (unlikely to happen due to guarding the overlap, but bulletproof in case that assumtion goes away). zeroes will do. */Showing the first 500 of 1047 diff lines for this file. This diff is INCOMPLETE; read the file or clone the repository for the rest.
vendor/vorbis/lib/books/coupled/res_books_51.hadded
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2010 * * by the Xiph.Org Foundation https://xiph.org/ * * * ******************************************************************** * * function: static codebooks for 5.1 surround * ********************************************************************/static const long _vq_quantlist__44p0_l0_0[] = { 6, 5, 7, 4, 8, 3, 9, 2, 10, 1, 11, 0, 12,};static const char _vq_lengthlist__44p0_l0_0[] = { 1, 3, 4, 7, 7, 8, 8, 9, 9, 9,10,10,10, 5, 6, 5, 8, 7, 9, 8, 9, 9,10, 9,11,10, 5, 5, 7, 7, 8, 8, 9, 9, 9, 9,10,10,11, 8, 9, 8,10, 9,10, 9,10, 9, 11,10,11,10, 8, 8, 9, 9,10, 9,10, 9,11,10,11,10, 11,10,11,11,11,11,11,11,11,11,11,11,11,11,10,11, 11,11,12,11,11,11,11,11,11,10,12,12,12,12,12,12, 12,11,12,12,12,11,11,11,12,12,12,12,12,12,12,11, 12,11,12,11,11,13,12,12,12,13,12,12,12,12,11,12, 11,11,13,13,13,12,12,12,12,12,12,11,11,11,10,13, 13,13,12,13,12,13,11,13,10,12,11,11,13,13,12,13, 12,12,12,12,11,12,11,11,11,};static const static_codebook _44p0_l0_0 = { 2, 169, (char *)_vq_lengthlist__44p0_l0_0, 1, -526516224, 1616117760, 4, 0, (long *)_vq_quantlist__44p0_l0_0, 0};static const long _vq_quantlist__44p0_l0_1[] = { 2, 1, 3, 0, 4,};static const char _vq_lengthlist__44p0_l0_1[] = { 1, 4, 4, 6, 6, 5, 5, 5, 7, 5, 5, 5, 5, 6, 7, 7, 6, 7, 7, 7, 6, 7, 7, 7, 7,};static const static_codebook _44p0_l0_1 = { 2, 25, (char *)_vq_lengthlist__44p0_l0_1, 1, -533725184, 1611661312, 3, 0, (long *)_vq_quantlist__44p0_l0_1, 0};static const long _vq_quantlist__44p0_l1_0[] = { 1, 0, 2,};static const char _vq_lengthlist__44p0_l1_0[] = { 1, 4, 4, 4, 4, 4, 4, 4, 4,};static const static_codebook _44p0_l1_0 = { 2, 9, (char *)_vq_lengthlist__44p0_l1_0, 1, -516716544, 1630767104, 2, 0, (long *)_vq_quantlist__44p0_l1_0, 0};static const char _huff_lengthlist__44p0_lfe[] = { 1, 3, 2, 3,};static const static_codebook _huff_book__44p0_lfe = { 2, 4, (char *)_huff_lengthlist__44p0_lfe, 0, 0, 0, 0, 0, NULL, 0};static const char _huff_lengthlist__44p0_long[] = { 2, 3, 6, 7,10,14,16, 3, 2, 5, 7,11,14,17, 6, 5, 5, 7,10,12,14, 7, 7, 6, 6, 7, 9,13,10,11, 9, 6, 6, 9,11,15,15,13,10, 9,10,12,18,18,16,14,12,13, 16,};static const static_codebook _huff_book__44p0_long = { 2, 49, (char *)_huff_lengthlist__44p0_long, 0, 0, 0, 0, 0, NULL, 0};static const long _vq_quantlist__44p0_p1_0[] = { 1, 0, 2,};static const char _vq_lengthlist__44p0_p1_0[] = { 1, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,};static const static_codebook _44p0_p1_0 = { 5, 243, (char *)_vq_lengthlist__44p0_p1_0, 1, -535822336, 1611661312, 2, 0, (long *)_vq_quantlist__44p0_p1_0, 0};static const long _vq_quantlist__44p0_p2_0[] = { 1, 0, 2,};static const char _vq_lengthlist__44p0_p2_0[] = { 1, 5, 5, 0, 7, 7, 0, 8, 8, 0, 9, 9, 0,12,12, 0, 8, 8, 0, 9, 9, 0,12,12, 0, 8, 8, 0, 6, 6, 0,11, 11, 0,12,12, 0,12,12, 0,15,15, 0,11,11, 0,12,12, 0,15,15, 0,12,12, 0, 5, 5, 0, 5, 5, 0, 6, 6, 0, 7, 7, 0,11,11, 0, 6, 6, 0, 7, 7, 0,10,11, 0, 6, 6, 0, 7, 7, 0,11,11, 0,12,12, 0,11,11, 0,15,15, 0,10,10, 0,12,12, 0,15,15, 0,12,12, 0, 6, 6, 0, 12,12, 0,12,12, 0,12,12, 0,15,15, 0,11,11, 0,12, 12, 0,15,15, 0,12,12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 8, 0,12,12, 0,12,12, 0,12,12, 0,15, 15, 0,12,12, 0,11,12, 0,15,16, 0,11,11, 0, 6, 6, 0,11,12, 0,12,12, 0,12,12, 0,16,15, 0,12,12, 0, 13,12, 0,15,14, 0,12,12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,};static const static_codebook _44p0_p2_0 = { 5, 243, (char *)_vq_lengthlist__44p0_p2_0, 1, -533200896, 1614282752, 2, 0, (long *)_vq_quantlist__44p0_p2_0, 0};static const long _vq_quantlist__44p0_p2_1[] = { 1, 0, 2,};static const char _vq_lengthlist__44p0_p2_1[] = { 1, 3, 3, 0, 9, 9, 0, 9, 9, 0,10,10, 0, 9, 9, 0, 10,10, 0,10,10, 0, 9, 9, 0,10,10, 0, 7, 7, 0, 7, 7, 0, 6, 6, 0, 8, 8, 0, 7, 7, 0, 8, 8, 0, 8, 9, 0, 8, 8, 0, 8, 8, 0, 7, 7, 0, 9, 9, 0, 8, 8, 0, 10,10, 0, 9, 9, 0,10,10, 0,10,10, 0, 9, 9, 0,10, 10, 0, 9, 9, 0,11,11, 0,11,11, 0,12,12, 0,11,11, 0,12,12, 0,13,13, 0,12,12, 0,13,12, 0, 8, 8, 0, 12,12, 0,12,12, 0,13,13, 0,12,12, 0,13,13, 0,13, 13, 0,13,13, 0,13,13, 0, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 0,11,11, 0,12,12, 0,13,13, 0,12, 12, 0,13,13, 0,13,13, 0,12,12, 0,12,12, 0, 8, 8, 0,12,12, 0,12,12, 0,13,13, 0,13,13, 0,13,14, 0, 14,13, 0,13,13, 0,13,13, 0, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,};static const static_codebook _44p0_p2_1 = { 5, 243, (char *)_vq_lengthlist__44p0_p2_1, 1, -535822336, 1611661312, 2, 0, (long *)_vq_quantlist__44p0_p2_1, 0};static const long _vq_quantlist__44p0_p3_0[] = { 1, 0, 2,};static const char _vq_lengthlist__44p0_p3_0[] = { 1, 6, 6, 7, 8, 8, 7, 8, 8, 7, 9, 9,10,12,11, 9, 8, 8, 7, 9, 9,11,12,12, 9, 9, 9, 6, 7, 7,10,11, 11,10,11,11,10,11,11,13,13,14,12,12,12,11,11,11, 14,14,14,12,12,12, 6, 5, 5, 9, 6, 5, 9, 6, 6, 9, 7, 7,12,10,10,11, 6, 6,10, 7, 7,13,10,10,12, 7, 7, 7, 8, 8,12,10,10,12,10,10,11,10,10,15,13,13, 13, 9, 9,12,11,11,16,13,13,15,11,11, 8, 7, 7,12, 12,12,12,11,11,12,11,11,14,14,14,14,12,12,12,12, 12,16,15,15,14,12,12, 0,10,10, 0,12,12, 0,12,12, 0,11,11, 0,14,14, 0,11,11, 0,12,12, 0,15,15, 0, 11,11, 8, 8, 8,13,11,11,13,10,10,13,11,11,15,13, 13,14,11,11,12,10,10,16,14,14,14,10,10, 9, 7, 7, 13,11,11,13,11,11,12,11,11,16,14,14,14,12,12,13, 12,12,15,14,14,15,13,12, 0,11,11, 0,12,12, 0,12, 12, 0,12,12, 0,15,15, 0,12,12, 0,13,12, 0,14,15, 0,12,12,};static const static_codebook _44p0_p3_0 = { 5, 243, (char *)_vq_lengthlist__44p0_p3_0, 1, -531365888, 1616117760, 2, 0, (long *)_vq_quantlist__44p0_p3_0, 0};static const long _vq_quantlist__44p0_p3_1[] = { 2, 1, 3, 0, 4,};static const char _vq_lengthlist__44p0_p3_1[] = { 2, 4, 4, 8, 8,10,12,12,11,11, 9,11,11,12,13,11, 12,12,11,11,11,12,12,12,12,10,13,12,13,13,11,12, 12,13,13,11,12,12,13,13,11,12,13,13,13,11,13,13, 13,13,10,13,13,12,13,11,12,12,14,14,11,13,12,12, 12,11,12,12,13,13,11,13,13,12,12,11,13,13,13,13, 11,12,12,13,13,11,13,13,12,12,11,12,12,13,13,11, 13,13,12,12,11,13,13,13,13,11,12,12,14,14,11,13, 13,12,12,11,12,12,13,13,11,13,13,12,12,11,10,10, 10,10,12,10,10,11,11,11, 8, 8,11,11,13,10,10,10, 10,12,10,10,10,10,13,11,11,11,11,13,10,10,11,11, 13,11,11,12,12,13,11,11,11,11,13,11,11,12,12,13, 11,11,12,12,13,10,10,11,11,13,11,11,11,11,13,11, 10,11,11,13,11,11,11,11,13,11,11,11,11,13,10,10, 11,11,13,11,11,11,11,12,10,11,11,11,13,11,11,11, 11,13,11,11,11,11,13,10,10,11,11,13,11,11,11,11, 13,11,11,11,11,13,11,11,11,11,11,10,10,10,10,12, 10,10, 9, 9,12,12,12,11,11,13,12,12, 9, 9,13,12, 12,10,10,12,12,12,12,12,13,13,13,14,14,13,12,12, 11,11,13,13,13,12,12,13,12,12,11,11,13,12,13,11, 11,13,13,13,14,14,13,12,12,10,10,13,13,13,11,11, 13,12,12,10,10,13,13,13,11,11,13,13,13,14,14,13, 12,12,10,10,13,13,13,11,11,13,12,13,10,10,13,13, 13,11,11,13,13,13,14,14,13,12,12,10,10,13,13,13, 11,11,13,13,12,10,10,14,12,12, 8, 8,14,12,12, 9, 9,14,11,11, 9, 9,14,12,12, 8, 8,14,11,11, 7, 7, 14,13,13,10,10,15,12,12,10,10,15,13,13,10,10,15, 12,12, 9, 9,15,13,13,10,10,15,13,13,10,10,15,12, 12,10,10,15,13,13,10,10,14,12,12, 9, 9,14,13,13, 9, 9,14,13,13, 9, 9,15,12,12, 9, 9,15,13,13, 9, 9,14,12,12, 9, 9,14,13,13, 9, 9,14,13,13, 9, 9, 15,12,12, 9, 9,14,13,13, 9, 9,14,12,12, 9, 9,14, 13,13, 9, 9,13,12,12, 8, 8,13,13,13, 8, 8,14,13, 13, 9, 9,13,13,13, 7, 7,14,13,13, 8, 8,14,14,14, 10,10,14,14,14,11,11,14,14,14, 9, 9,14,14,14,10, 10,14,14,14, 9, 9,14,14,14,10, 9,15,14,14,11,11, 14,14,14, 9, 9,14,14,14,10,10,14,14,14, 9, 9,14, 14,14, 9, 9,15,14,14,11,11,14,14,14, 8, 8,14,14, 14, 9, 9,14,14,14, 8, 8,14,14,14, 9, 9,15,14,14, 11,11,14,14,14, 8, 8,14,14,14, 9, 9,14,14,14, 8, 8,12,12,12,13,13,16,15,15,11,11,16,15,16,12,12, 17,16,16,11,11,17,15,15,12,11,16,16,16,12,13,16, 15,15,13,13,16,16,16,12,12,16,16,15,13,13,16,16, 16,12,12,16,16,16,13,13,17,16,16,14,14,17,17,16, 12,12,17,16,16,13,13,17,17,16,12,13,16,16,17,13, 12,17,16,16,14,13,17,16,16,12,12,17,16,16,12,12, 17,16,17,12,12,17,17,17,13,13,16,16,16,13,14,17, 17,16,12,12,16,16,16,13,13,17,17,17,12,12,13,14, 14,10,10,16,14,14,12,12,16,15,15,14,14,16,14,14, 12,12,15,14,14,13,13,17,15,15,14,13,16,16,15,15, 15,16,15,15,14,14,16,15,15,14,14,17,15,15,14,14, 16,15,15,14,14,16,16,15,15,15,17,15,15,13,13,16, 15,15,14,14,17,15,15,13,13,17,15,15,14,14,16,15, 15,15,15,16,14,14,13,13,16,15,15,14,14,16,14,14, 13,13,17,15,15,14,14,16,16,15,15,15,17,14,14,13, 13,16,15,15,14,14,17,14,14,13,13,13,11,11,10,10, 16,14,14,13,13,15,14,14,13,13,16,14,14,12,12,16, 14,14,12,12,15,15,15,14,14,16,14,14,14,14,16,15, 14,14,14,16,14,14,14,14,16,15,15,14,13,16,15,15, 14,14,16,14,14,14,14,17,15,15,14,14,16,14,14,14, 14,16,15,15,13,14,16,15,15,14,14,16,14,14,14,14, 16,15,15,13,13,16,14,14,13,13,16,15,15,13,13,16, 15,15,14,14,16,14,14,14,14,17,15,15,13,13,16,15, 14,13,13,17,15,15,13,13,14,14,14, 9, 9,14,14,14, 17,17,14,15,15,18,18,14,14,14,18,19,14,14,14,18, 18,15,15,15,19,18,15,16,15,18,20,15,15,15,18,19, 15,15,15,19,19,15,15,15,18,20,15,15,15,18,19,15, 15,16,20,18,15,15,15,18,18,15,15,15,19,19,15,15, 15,18,19,15,15,15,18,19,15,15,15,19,19,14,15,14, 19,19,15,15,15,20,19,15,14,14,19,18,14,15,15,18, 19,15,15,16,20,20,14,14,14,18,19,15,15,15,19,18, 14,14,14,18,18,14,12,12, 9, 9,13,14,14,18,18,14, 13,13,18,19,14,14,14,18,18,14,14,14,18,18,15,15, 15,19,19,15,14,14,19,18,14,15,15,19,18,15,14,14, 18,18,15,15,15,19,18,14,15,15,19,19,15,14,14,19, 18,14,15,15,19,18,15,14,14,19,18,14,15,15,19,18, 15,15,15,21,18,15,14,14,19,18,14,15,15,18,19,14, 15,14,20,19,14,15,15,18,19,14,15,15,19,19,15,14, 14,19,20,14,15,15,18,18,14,14,14,19,19,14,15,15, 19,18,12,12,12,13,13,16,15,15,11,11,16,15,15,12, 12,16,16,16,11,11,16,15,15,11,11,16,16,16,13,13, 17,16,16,13,13,17,17,17,12,12,16,16,16,13,13,17, 16,17,13,12,15,16,16,12,12,16,15,15,13,13,17,16, 16,12,12,16,16,15,12,12,16,16,16,12,12,17,17,16, 13,12,16,16,16,13,13,17,16,16,12,12,17,16,16,12, 12,17,17,16,12,12,16,17,16,12,12,17,15,15,13,13, 17,16,16,12,12,16,16,16,12,12,16,16,16,12,12,13, 13,13, 9, 9,15,14,14,13,13,16,15,14,14,14,16,14, 14,13,13,15,14,14,13,13,17,15,15,14,14,16,15,15, 15,15,16,15,15,14,14,16,15,15,15,15,17,15,15,14, 14,16,15,15,14,14,16,15,15,15,15,17,14,15,14,14, 16,15,15,14,14,17,15,15,13,14,17,15,15,14,14,16, 15,15,15,15,17,14,14,13,13,16,15,15,14,14,17,14, 14,13,13,17,15,15,14,14,16,15,16,15,15,17,14,14, 13,13,16,15,15,14,14,18,14,14,13,13,13,11,11,11, 11,15,14,14,12,12,15,14,14,13,13,16,14,14,12,12, 16,13,14,12,12,16,15,15,13,13,16,14,14,14,14,16, 15,15,13,13,16,14,14,13,13,16,14,15,13,13,15,15, 15,13,13,16,14,14,14,13,16,14,14,13,13,16,14,14, 13,13,16,15,15,13,13,16,15,15,13,13,16,14,14,14, 14,16,15,15,12,12,16,14,14,13,13,16,15,15,12,12, 16,15,15,13,13,16,14,14,14,14,17,15,14,12,12,16, 14,14,13,13,16,15,15,12,12,14,14,14, 8, 8,14,14, 14,17,18,14,15,15,17,18,14,14,14,17,18,14,14,14, 18,18,14,15,15,18,18,14,16,15,19,19,15,15,15,18, 19,15,16,15,20,19,15,15,15,18,18,14,15,15,18,19, 15,16,16,20,19,15,15,15,19,17,14,15,15,20,18,14, 15,15,18,18,14,15,15,18,19,14,15,15,19,20,14,14, 14,18,18,14,15,15,18,19,14,14,14,18,19,14,15,15, 19,18,15,16,16,20,21,14,14,15,19,19,14,15,15,19, 19,14,14,14,19,18,13,12,12, 9, 9,13,14,14,18,19, 14,14,14,18,19,14,14,14,18,18,14,14,14,18,18,14, 15,15,19,19,15,14,14,19,18,15,15,15,19,19,15,14, 14,19,20,14,15,15,18,19,14,15,15,20,18,15,14,14, 18,18,14,15,15,18,18,14,14,14,19,19,14,15,15,18, 18,14,15,15,19,18,15,14,14,19,19,14,15,15,19,18, 15,14,14,19,18,14,14,15,18,19,14,15,15,19,18,15, 14,14,18,19,14,15,14,19,20,14,14,14,19,19,14,15, 15,19,19,12,12,12,13,13,16,16,16,11,11,16,16,16, 12,12,17,16,16,11,11,17,15,15,11,11,16,16,16,13, 13,17,15,16,13,13,16,16,16,12,12,17,16,16,13,13, 17,17,16,12,12,17,17,16,13,13,17,16,16,13,13,17, 17,17,12,12,17,16,16,13,13,17,17,17,12,12,16,16, 16,12,12,17,15,15,13,13,17,16,16,11,11,17,16,16, 12,12,16,16,16,11,11,16,17,16,12,12,17,16,16,13, 13,17,17,16,12,12,17,17,16,12,12,17,16,16,11,11, 13,14,14, 9, 9,16,14,14,13,13,16,14,15,14,14,16, 14,14,12,12,16,14,14,13,13,17,15,15,14,14,16,15, 15,15,15,17,15,15,14,14,16,15,15,14,14,17,15,15, 14,14,16,15,15,14,14,16,15,15,15,16,17,14,15,14, 14,16,15,15,14,14,17,15,15,14,14,16,15,15,14,14, 16,15,15,15,15,17,14,14,13,13,16,15,15,14,14,16, 14,14,13,13,17,15,15,14,14,16,16,15,15,15,17,14, 14,13,13,16,15,15,14,14,17,14,14,13,13,13,11,11, 10,10,16,14,14,12,12,15,13,13,13,12,16,14,14,11, 11,16,14,14,11,11,16,14,15,13,14,16,14,14,13,13, 16,15,15,13,13,16,14,14,13,13,16,15,15,13,13,16, 15,15,13,13,17,14,14,14,14,17,15,15,13,13,16,14, 15,13,13,16,15,15,13,13,16,15,15,13,13,16,14,14, 13,13,17,15,15,12,12,16,14,14,12,12,16,15,15,12, 12,16,15,15,13,13,16,14,14,13,13,17,15,15,12,12, 17,14,14,12,12,16,15,15,12,12,13,14,14, 8, 8,13, 14,14,18,18,13,15,15,17,18,14,14,14,18,19,14,14, 14,19,18,14,15,15,19,18,15,15,16,21,18,15,15,15, 19,19,14,16,16,19,19,14,15,15,18,19,14,15,15,19, 20,14,16,16,19,18,15,15,15,18,19,14,15,15,19,18, 15,15,15,18,18,15,15,15,20,18,15,16,16,20,19,14, 15,14,18,19,14,15,16,19,20,14,15,15,19,18,15,15, 15,19,18,15,16,16,20,19,15,14,14,18,18,14,15,15, 19,19,14,15,15,18,18,13,12,12, 8, 8,13,14,14,19, 18,14,13,13,20,18,14,14,14,19,18,14,13,13,18,19, 14,15,15,20,19,15,14,14,19,19,14,15,15,19,18,15, 14,14,20,20,15,15,15,19,18,14,15,15,19,18,15,14, 14,19,18,14,15,15,20,19,14,14,14,20,19,14,15,15, 19,18,15,15,15,18,18,15,14,14,18,18,14,15,15,19, 19,14,14,14,19,19,14,15,15,19,19,15,15,15,19,18, 15,14,14,20,19,15,15,15,19,19,14,14,14,20,19,14, 15,15,20,20,12,12,12,13,13,17,16,16,11,11,16,16, 15,12,12,17,16,16,11,11,17,15,15,11,11,17,17,17, 13,13,17,16,16,13,13,17,17,17,12,12,17,16,16,13, 13,17,17,16,12,13,16,17,16,13,13,17,16,15,13,13, 17,16,16,12,12,17,16,16,12,13,17,16,17,12,12,17, 17,17,12,12,17,16,15,13,13,17,16,16,12,12,17,16, 16,12,12,17,16,16,11,11,16,16,16,12,12,17,15,15, 13,13,17,16,15,11,11,16,16,16,12,12,17,16,16,11, 11,13,14,14, 9, 9,16,14,14,13,13,16,14,15,14,14, 16,14,14,12,12,16,14,14,13,13,17,15,15,14,15,16, 15,15,15,15,17,15,15,14,14,16,15,15,15,14,16,15, 15,14,14,16,15,15,14,14,16,15,16,15,15,17,15,14, 14,14,16,15,15,14,14,17,15,15,13,13,16,15,15,14, 14,16,16,16,15,15,17,14,14,13,13,16,15,15,14,14, 18,14,15,13,13,16,15,15,14,14,16,16,15,15,15,16, 14,14,13,13,16,15,15,14,14,17,14,15,13,13,13,11, 11,10,10,15,14,14,12,12,15,14,14,13,13,16,14,14, 12,12,16,13,14,12,12,16,14,15,14,13,16,14,14,14, 14,16,15,15,13,13,16,14,14,13,13,16,15,15,13,13, 15,15,15,13,13,16,14,14,14,14,17,15,15,13,13,16, 14,14,13,13,16,15,15,13,13,16,15,15,13,13,16,14, 14,13,13,17,15,15,12,12,16,14,14,12,12,16,14,15, 12,12,16,15,15,13,13,16,14,14,13,13,17,15,15,12, 12,16,14,14,12,12,16,15,15,12,12,14,14,14, 8, 8, 14,14,14,17,17,14,15,15,18,18,14,14,14,18,17,14, 14,14,18,18,14,15,15,18,20,15,16,15,19,18,15,15, 15,19,18,15,15,16,19,18,15,15,15,18,18,14,15,15, 18,18,15,16,16,18,19,15,15,15,18,18,15,15,15,19, 20,15,15,15,18,18,15,15,15,18,18,15,16,16,19,19, 15,14,15,19,19,15,15,15,19,20,14,14,15,18,18,15, 15,15,19,19,15,16,16,19,19,15,15,14,18,19,15,15, 15,20,20,15,15,14,18,18,13,12,12, 8, 8,13,14,14, 18,18,14,14,14,18,18,14,14,14,18,20,14,14,14,18, 18,14,15,15,19,18,15,14,14,18,19,15,15,15,18,19, 15,14,14,18,19,15,15,15,18,18,14,15,14,18,19,15, 14,14,21,19,15,15,15,19,18,14,14,14,19,18,14,15, 15,19,18,15,15,15,20,19,15,14,14,20,18,14,15,15, 18,19,14,14,14,19,18,14,15,15,18,19,15,15,15,18, 19,15,14,14,19,19,15,15,15,19,19,14,14,14,19,20, 14,15,15,18,19,};static const static_codebook _44p0_p3_1 = { 5, 3125, (char *)_vq_lengthlist__44p0_p3_1, 1, -533725184, 1611661312, 3, 0, (long *)_vq_quantlist__44p0_p3_1, 0};static const long _vq_quantlist__44p0_p4_0[] = { 2, 1, 3, 0, 4,};static const char _vq_lengthlist__44p0_p4_0[] = { 2, 6, 6,14,14, 6, 8, 8,14,14, 7, 7, 7,14,14, 0, 13,13,15,16, 0,13,13,15,15, 7, 8, 8,15,15, 9,10, 10,16,16, 9, 8, 8,14,15, 0,13,13,17,17, 0,13,13, 16,16, 8, 8, 8,15,15,12,11,11,16,16, 9, 8, 8,14, 14, 0,13,13,17,17, 0,13,13,15,15, 0,14,14,16,16, 0, 0, 0,18,19, 0,12,12,16,15, 0,16,16, 0,20, 0, 14,14,16,16, 0,14,14,17,17, 0, 0, 0,19,19, 0,12, 12,15,15, 0,18,17,21,21, 0,14,14,16,16, 5, 7, 7, 12,13, 9,10, 9,14,14,11,10,10,14,14, 0, 0, 0,18, 17, 0,20,21,18,18, 9,10,10,14,14,12,12,12,17,16, 12,10,10,14,14, 0,20,20,18,17, 0,21,21,17,17,11, 10,10,14,14,15,13,13,18,18,13,11,11,14,14, 0,20, 0,18,18, 0,20,21,18,17, 0,21, 0,18,19, 0, 0, 0, 0,21, 0,21,20,16,17, 0, 0, 0,21,21, 0, 0, 0,20, 18, 0,20, 0,17,18, 0, 0, 0, 0, 0, 0, 0,20,16,17, 0, 0, 0,20, 0, 0, 0, 0,18,18, 6, 6, 6,13,13, 8, 5, 5,11,11, 9, 6, 6,13,13, 0, 9, 9,12,12, 0,10, 10,14,14, 9, 7, 7,13,13,12, 9, 9,13,13,10, 6, 6, 13,13, 0,10,10,14,14, 0,10,10,13,13, 9, 7, 7,13, 13,13,10,10,13,13,11, 6, 6,13,13, 0,10,10,15,15, 0,10,10,13,13, 0,12,11,15,15, 0,20,19,17,16, 0, 9, 9,13,13, 0,13,13,20,19, 0,11,11,13,13, 0,11, 11,15,15, 0,20,19,17,17, 0,10,10,13,13, 0,14,15,Showing the first 500 of 12274 diff lines for this file. This diff is INCOMPLETE; read the file or clone the repository for the rest.
vendor/vorbis/lib/books/coupled/res_books_stereo.hadded
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 * * by the Xiph.Org Foundation https://xiph.org/ * * * ******************************************************************** function: static codebooks autogenerated by huff/huffbuld ********************************************************************/#include "codebook.h"static const long _vq_quantlist__16c0_s_p1_0[] = { 1, 0, 2,};static const char _vq_lengthlist__16c0_s_p1_0[] = { 1, 4, 4, 0, 0, 0, 0, 0, 0, 5, 7, 7, 0, 0, 0, 0, 0, 0, 5, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 8, 8, 0, 0, 0, 0, 0, 0, 8, 9,10, 0, 0, 0, 0, 0, 0, 7, 9,10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 8, 8, 0, 0, 0, 0, 0, 0, 7, 9, 9, 0, 0, 0, 0, 0, 0, 7, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 8, 8, 0, 0, 0, 0, 0, 0, 8,10,10, 0, 0, 0, 0, 0, 0, 8,10,10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7,10,10, 0, 0, 0, 0, 0, 0, 9, 9,12, 0, 0, 0, 0, 0, 0,10,12,11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7,10,10, 0, 0, 0, 0, 0, 0, 9,12,10, 0, 0, 0, 0, 0, 0,10,11,12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 8, 8, 0, 0, 0, 0, 0, 0, 8,10,10, 0, 0, 0, 0, 0, 0, 8,10,10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7,10,10, 0, 0, 0, 0, 0, 0,10,12,11, 0, 0, 0, 0, 0, 0, 9,10,12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7,10,10, 0, 0, 0, 0, 0, 0,10,11,12, 0, 0, 0, 0, 0, 0, 9,12, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,};static const static_codebook _16c0_s_p1_0 = { 8, 6561, (char *)_vq_lengthlist__16c0_s_p1_0, 1, -535822336, 1611661312, 2, 0, (long *)_vq_quantlist__16c0_s_p1_0, 0};static const long _vq_quantlist__16c0_s_p3_0[] = { 2, 1, 3, 0, 4,};static const char _vq_lengthlist__16c0_s_p3_0[] = { 1, 4, 4, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 6, 6, 7, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 6, 6, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 6, 6, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 6, 6, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,};static const static_codebook _16c0_s_p3_0 = { 4, 625,Showing the first 500 of 15783 diff lines for this file. This diff is INCOMPLETE; read the file or clone the repository for the rest.
vendor/vorbis/lib/books/floor/floor_books.hadded
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 * * by the Xiph.Org Foundation https://xiph.org/ * * * ******************************************************************** function: static codebooks autogenerated by huff/huffbuld ********************************************************************/#include "codebook.h"static const char _huff_lengthlist_line_256x7_0sub1[] = { 0, 2, 3, 3, 3, 3, 4, 3, 4,};static const static_codebook _huff_book_line_256x7_0sub1 = { 1, 9, (char *)_huff_lengthlist_line_256x7_0sub1, 0, 0, 0, 0, 0, NULL, 0};static const char _huff_lengthlist_line_256x7_0sub2[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 3, 4, 3, 5, 3, 6, 3, 6, 4, 6, 4, 7, 5, 7,};static const static_codebook _huff_book_line_256x7_0sub2 = { 1, 25, (char *)_huff_lengthlist_line_256x7_0sub2, 0, 0, 0, 0, 0, NULL, 0};static const char _huff_lengthlist_line_256x7_0sub3[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 5, 2, 5, 3, 5, 3, 6, 3, 6, 4, 7, 6, 7, 8, 7, 9, 8, 9, 9, 9,10, 9, 11,13,11,13,10,10,13,13,13,13,13,13,12,12,12,12,};static const static_codebook _huff_book_line_256x7_0sub3 = { 1, 64, (char *)_huff_lengthlist_line_256x7_0sub3, 0, 0, 0, 0, 0, NULL, 0};static const char _huff_lengthlist_line_256x7_1sub1[] = { 0, 3, 3, 3, 3, 2, 4, 3, 4,};static const static_codebook _huff_book_line_256x7_1sub1 = { 1, 9, (char *)_huff_lengthlist_line_256x7_1sub1, 0, 0, 0, 0, 0, NULL, 0};static const char _huff_lengthlist_line_256x7_1sub2[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 3, 4, 3, 4, 4, 5, 4, 6, 5, 6, 7, 6, 8, 8,};static const static_codebook _huff_book_line_256x7_1sub2 = { 1, 25, (char *)_huff_lengthlist_line_256x7_1sub2, 0, 0, 0, 0, 0, NULL, 0};static const char _huff_lengthlist_line_256x7_1sub3[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 2, 4, 3, 6, 3, 7, 3, 8, 5, 8, 6, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7,};static const static_codebook _huff_book_line_256x7_1sub3 = { 1, 64, (char *)_huff_lengthlist_line_256x7_1sub3, 0, 0, 0, 0, 0, NULL, 0};static const char _huff_lengthlist_line_256x7_class0[] = { 7, 5, 5, 9, 9, 6, 6, 9,12, 8, 7, 8,11, 8, 9,15, 6, 3, 3, 7, 7, 4, 3, 6, 9, 6, 5, 6, 8, 6, 8,15, 8, 5, 5, 9, 8, 5, 4, 6,10, 7, 5, 5,11, 8, 7,15, 14,15,13,13,13,13, 8,11,15,10, 7, 6,11, 9,10,15,};static const static_codebook _huff_book_line_256x7_class0 = { 1, 64, (char *)_huff_lengthlist_line_256x7_class0, 0, 0, 0, 0, 0, NULL, 0};static const char _huff_lengthlist_line_256x7_class1[] = { 5, 6, 8,15, 6, 9,10,15,10,11,12,15,15,15,15,15, 4, 6, 7,15, 6, 7, 8,15, 9, 8, 9,15,15,15,15,15, 6, 8, 9,15, 7, 7, 8,15,10, 9,10,15,15,15,15,15, 15,13,15,15,15,10,11,15,15,13,13,15,15,15,15,15, 4, 6, 7,15, 6, 8, 9,15,10,10,12,15,15,15,15,15, 2, 5, 6,15, 5, 6, 7,15, 8, 6, 7,15,15,15,15,15, 5, 6, 8,15, 5, 6, 7,15, 9, 6, 7,15,15,15,15,15, 14,12,13,15,12,10,11,15,15,15,15,15,15,15,15,15, 7, 8, 9,15, 9,10,10,15,15,14,14,15,15,15,15,15, 5, 6, 7,15, 7, 8, 9,15,12, 9,10,15,15,15,15,15, 7, 7, 9,15, 7, 7, 8,15,12, 8, 9,15,15,15,15,15, 13,13,14,15,12,11,12,15,15,15,15,15,15,15,15,15, 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, 13,13,13,15,15,15,15,15,15,15,15,15,15,15,15,15, 15,12,13,15,15,12,13,15,15,14,15,15,15,15,15,15, 15,15,15,15,15,15,13,15,15,15,15,15,15,15,15,15,};static const static_codebook _huff_book_line_256x7_class1 = { 1, 256, (char *)_huff_lengthlist_line_256x7_class1, 0, 0, 0, 0, 0, NULL, 0};static const char _huff_lengthlist_line_512x17_0sub0[] = { 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 5, 6, 6, 6, 6, 5, 6, 6, 7, 6, 7, 6, 7, 6, 7, 6, 8, 7, 8, 7, 8, 7, 8, 7, 8, 7, 9, 7, 9, 7, 9, 7, 9, 8, 9, 8,10, 8,10, 8,10, 7,10, 6,10, 8, 10, 8,11, 7,10, 7,11, 8,11,11,12,12,11,11,12,11, 13,11,13,11,13,12,15,12,13,13,14,14,14,14,14,15, 15,15,16,14,17,19,19,18,18,18,18,18,18,18,18,18, 18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,};static const static_codebook _huff_book_line_512x17_0sub0 = { 1, 128, (char *)_huff_lengthlist_line_512x17_0sub0, 0, 0, 0, 0, 0, NULL, 0};static const char _huff_lengthlist_line_512x17_1sub0[] = { 2, 4, 5, 4, 5, 4, 5, 4, 5, 5, 5, 5, 5, 5, 6, 5, 6, 5, 6, 6, 7, 6, 7, 6, 8, 7, 8, 7, 8, 7, 8, 7,};static const static_codebook _huff_book_line_512x17_1sub0 = { 1, 32, (char *)_huff_lengthlist_line_512x17_1sub0, 0, 0, 0, 0, 0, NULL, 0};static const char _huff_lengthlist_line_512x17_1sub1[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 3, 5, 3, 5, 4, 5, 4, 5, 4, 5, 5, 5, 5, 6, 5, 6, 5, 7, 5, 8, 6, 8, 6, 8, 6, 8, 6, 8, 7, 9, 7, 9, 7,11, 9,11,11,12,11,14,12,14,16,14,16,13,16, 14,16,12,15,13,16,14,16,13,14,12,15,13,15,13,13, 13,15,12,14,14,15,13,15,12,15,15,15,15,15,15,15, 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,};static const static_codebook _huff_book_line_512x17_1sub1 = { 1, 128, (char *)_huff_lengthlist_line_512x17_1sub1, 0, 0, 0, 0, 0, NULL, 0};static const char _huff_lengthlist_line_512x17_2sub1[] = { 0, 4, 5, 4, 4, 4, 5, 4, 4, 4, 5, 4, 5, 4, 5, 3, 5, 3,};static const static_codebook _huff_book_line_512x17_2sub1 = { 1, 18, (char *)_huff_lengthlist_line_512x17_2sub1, 0, 0, 0, 0, 0, NULL, 0};static const char _huff_lengthlist_line_512x17_2sub2[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 3, 4, 3, 4, 4, 5, 4, 5, 4, 6, 4, 6, 5, 6, 5, 7, 5, 7, 6, 8, 6, 8, 6, 8, 7, 8, 7, 9, 7, 9, 8,};static const static_codebook _huff_book_line_512x17_2sub2 = { 1, 50, (char *)_huff_lengthlist_line_512x17_2sub2, 0, 0, 0, 0, 0, NULL, 0};static const char _huff_lengthlist_line_512x17_2sub3[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 4, 3, 4, 4, 5, 5, 6, 6, 7, 7, 7, 8, 8,11, 8, 9, 9, 9,10,11,11,11, 9,10,10,11, 11,11,11,10,10,10,10,10,10,10,10,10,10,10,10,10, 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,};static const static_codebook _huff_book_line_512x17_2sub3 = { 1, 128, (char *)_huff_lengthlist_line_512x17_2sub3, 0, 0, 0, 0, 0, NULL, 0};static const char _huff_lengthlist_line_512x17_3sub1[] = { 0, 4, 4, 4, 4, 4, 4, 3, 4, 4, 4, 4, 4, 5, 4, 5, 5, 5,};static const static_codebook _huff_book_line_512x17_3sub1 = { 1, 18, (char *)_huff_lengthlist_line_512x17_3sub1, 0, 0, 0, 0, 0, NULL, 0};static const char _huff_lengthlist_line_512x17_3sub2[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 3, 4, 3, 5, 4, 6, 4, 6, 5, 7, 6, 7, 6, 8, 6, 8, 7, 9, 8,10, 8,12, 9,13,10,15,10,15, 11,14,};static const static_codebook _huff_book_line_512x17_3sub2 = { 1, 50, (char *)_huff_lengthlist_line_512x17_3sub2, 0, 0, 0, 0, 0, NULL, 0};static const char _huff_lengthlist_line_512x17_3sub3[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 8, 4, 8, 4, 8, 4, 8, 5, 8, 5, 8, 6, 8, 4, 8, 4, 8, 5, 8, 5, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,};static const static_codebook _huff_book_line_512x17_3sub3 = { 1, 128, (char *)_huff_lengthlist_line_512x17_3sub3, 0, 0, 0, 0, 0, NULL, 0};static const char _huff_lengthlist_line_512x17_class1[] = { 1, 2, 3, 6, 5, 4, 7, 7,};static const static_codebook _huff_book_line_512x17_class1 = { 1, 8, (char *)_huff_lengthlist_line_512x17_class1, 0, 0, 0, 0, 0, NULL, 0};static const char _huff_lengthlist_line_512x17_class2[] = { 3, 3, 3,14, 5, 4, 4,11, 8, 6, 6,10,17,12,11,17, 6, 5, 5,15, 5, 3, 4,11, 8, 5, 5, 8,16, 9,10,14, 10, 8, 9,17, 8, 6, 6,13,10, 7, 7,10,16,11,13,14, 17,17,17,17,17,16,16,16,16,15,16,16,16,16,16,16,};static const static_codebook _huff_book_line_512x17_class2 = { 1, 64, (char *)_huff_lengthlist_line_512x17_class2, 0, 0, 0, 0, 0, NULL, 0};static const char _huff_lengthlist_line_512x17_class3[] = { 2, 4, 6,17, 4, 5, 7,17, 8, 7,10,17,17,17,17,17, 3, 4, 6,15, 3, 3, 6,15, 7, 6, 9,17,17,17,17,17, 6, 8,10,17, 6, 6, 8,16, 9, 8,10,17,17,15,16,17, 17,17,17,17,12,15,15,16,12,15,15,16,16,16,16,16,};static const static_codebook _huff_book_line_512x17_class3 = { 1, 64, (char *)_huff_lengthlist_line_512x17_class3, 0, 0, 0, 0, 0, NULL, 0};static const char _huff_lengthlist_line_128x4_class0[] = { 7, 7, 7,11, 6, 6, 7,11, 7, 6, 6,10,12,10,10,13, 7, 7, 8,11, 7, 7, 7,11, 7, 6, 7,10,11,10,10,13, 10,10, 9,12, 9, 9, 9,11, 8, 8, 8,11,13,11,10,14, 15,15,14,15,15,14,13,14,15,12,12,17,17,17,17,17, 7, 7, 6, 9, 6, 6, 6, 9, 7, 6, 6, 8,11,11,10,12, 7, 7, 7, 9, 7, 6, 6, 9, 7, 6, 6, 9,13,10,10,11, 10, 9, 8,10, 9, 8, 8,10, 8, 8, 7, 9,13,12,10,11, 17,14,14,13,15,14,12,13,17,13,12,15,17,17,14,17, 7, 6, 6, 7, 6, 6, 5, 7, 6, 6, 6, 6,11, 9, 9, 9, 7, 7, 6, 7, 7, 6, 6, 7, 6, 6, 6, 6,10, 9, 8, 9, 10, 9, 8, 8, 9, 8, 7, 8, 8, 7, 6, 8,11,10, 9,10, 17,17,12,15,15,15,12,14,14,14,10,12,15,13,12,13, 11,10, 8,10,11,10, 8, 8,10, 9, 7, 7,10, 9, 9,11, 11,11, 9,10,11,10, 8, 9,10, 8, 6, 8,10, 9, 9,11, 14,13,10,12,12,11,10,10, 8, 7, 8,10,10,11,11,12, 17,17,15,17,17,17,17,17,17,13,12,17,17,17,14,17,};static const static_codebook _huff_book_line_128x4_class0 = { 1, 256, (char *)_huff_lengthlist_line_128x4_class0, 0, 0, 0, 0, 0, NULL, 0};static const char _huff_lengthlist_line_128x4_0sub0[] = { 2, 2, 2, 2,};static const static_codebook _huff_book_line_128x4_0sub0 = { 1, 4, (char *)_huff_lengthlist_line_128x4_0sub0, 0, 0, 0, 0, 0, NULL, 0};static const char _huff_lengthlist_line_128x4_0sub1[] = { 0, 0, 0, 0, 3, 2, 3, 2, 3, 3,};static const static_codebook _huff_book_line_128x4_0sub1 = { 1, 10, (char *)_huff_lengthlist_line_128x4_0sub1, 0, 0, 0, 0, 0, NULL, 0};static const char _huff_lengthlist_line_128x4_0sub2[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 4, 3, 4, 3, 4, 4, 5, 4, 5, 4, 6, 5, 6,};static const static_codebook _huff_book_line_128x4_0sub2 = { 1, 25, (char *)_huff_lengthlist_line_128x4_0sub2, 0, 0, 0, 0, 0, NULL, 0};static const char _huff_lengthlist_line_128x4_0sub3[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 3, 5, 3, 5, 3, 5, 4, 6, 5, 6, 5, 7, 6, 6, 7, 7, 9, 9,11,11,16, 11,14,10,11,11,13,16,15,15,15,15,15,15,15,15,15,};static const static_codebook _huff_book_line_128x4_0sub3 = { 1, 64, (char *)_huff_lengthlist_line_128x4_0sub3, 0, 0, 0, 0, 0, NULL, 0};static const char _huff_lengthlist_line_256x4_class0[] = { 6, 7, 7,12, 6, 6, 7,12, 7, 6, 6,10,15,12,11,13, 7, 7, 8,13, 7, 7, 8,12, 7, 7, 7,11,12,12,11,13, 10, 9, 9,11, 9, 9, 9,10,10, 8, 8,12,14,12,12,14, 11,11,12,14,11,12,11,15,15,12,13,15,15,15,15,15, 6, 6, 7,10, 6, 6, 6,11, 7, 6, 6, 9,14,12,11,13, 7, 7, 7,10, 6, 6, 7, 9, 7, 7, 6,10,13,12,10,12, 9, 9, 9,11, 9, 9, 8, 9, 9, 8, 8,10,13,12,10,12, 12,12,11,13,12,12,11,12,15,13,12,15,15,15,14,14, 6, 6, 6, 8, 6, 6, 5, 6, 7, 7, 6, 5,11,10, 9, 8, 7, 6, 6, 7, 6, 6, 5, 6, 7, 7, 6, 6,11,10, 9, 8, 8, 8, 8, 9, 8, 8, 7, 8, 8, 8, 6, 7,11,10, 9, 9, 14,11,10,14,14,11,10,15,13,11, 9,11,15,12,12,11, 11, 9, 8, 8,10, 9, 8, 9,11,10, 9, 8,12,11,12,11, 13,10, 8, 9,11,10, 8, 9,10, 9, 8, 9,10, 8,12,12, 15,11,10,10,13,11,10,10, 8, 8, 7,12,10, 9,11,12, 15,12,11,15,13,11,11,15,12,14,11,13,15,15,13,13,};static const static_codebook _huff_book_line_256x4_class0 = { 1, 256, (char *)_huff_lengthlist_line_256x4_class0, 0, 0, 0, 0, 0, NULL, 0};static const char _huff_lengthlist_line_256x4_0sub0[] = { 2, 2, 2, 2,};static const static_codebook _huff_book_line_256x4_0sub0 = { 1, 4, (char *)_huff_lengthlist_line_256x4_0sub0, 0, 0, 0, 0, 0, NULL, 0};static const char _huff_lengthlist_line_256x4_0sub1[] = { 0, 0, 0, 0, 2, 2, 3, 3, 3, 3,};static const static_codebook _huff_book_line_256x4_0sub1 = { 1, 10, (char *)_huff_lengthlist_line_256x4_0sub1, 0, 0, 0, 0, 0, NULL, 0};static const char _huff_lengthlist_line_256x4_0sub2[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 3, 4, 3, 4, 3, 5, 3, 5, 4, 5, 4, 6, 4, 6,};static const static_codebook _huff_book_line_256x4_0sub2 = { 1, 25, (char *)_huff_lengthlist_line_256x4_0sub2, 0, 0, 0, 0, 0, NULL, 0};static const char _huff_lengthlist_line_256x4_0sub3[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 3, 5, 3, 5, 3, 6, 4, 7, 4, 7, 5, 7, 6, 7, 6, 7, 8,10,13,13,13, 13,13,13,13,13,13,13,13,13,13,13,12,12,12,12,12,};static const static_codebook _huff_book_line_256x4_0sub3 = { 1, 64, (char *)_huff_lengthlist_line_256x4_0sub3, 0, 0, 0, 0, 0, NULL, 0};static const char _huff_lengthlist_line_128x7_class0[] = { 10, 7, 8,13, 9, 6, 7,11,10, 8, 8,12,17,17,17,17, 7, 5, 5, 9, 6, 4, 4, 8, 8, 5, 5, 8,16,14,13,16, 7, 5, 5, 7, 6, 3, 3, 5, 8, 5, 4, 7,14,12,12,15, 10, 7, 8, 9, 7, 5, 5, 6, 9, 6, 5, 5,15,12, 9,10,};static const static_codebook _huff_book_line_128x7_class0 = { 1, 64, (char *)_huff_lengthlist_line_128x7_class0, 0, 0, 0, 0, 0, NULL, 0};Showing the first 500 of 1547 diff lines for this file. This diff is INCOMPLETE; read the file or clone the repository for the rest.
vendor/vorbis/lib/books/uncoupled/res_books_uncoupled.hadded
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 * * by the Xiph.Org Foundation https://xiph.org/ * * * ******************************************************************** function: static codebooks autogenerated by huff/huffbuld ********************************************************************/#include "codebook.h"static const long _vq_quantlist__16u0__p1_0[] = { 1, 0, 2,};static const char _vq_lengthlist__16u0__p1_0[] = { 1, 4, 4, 5, 7, 7, 5, 7, 8, 5, 8, 8, 8,10,10, 8, 10,11, 5, 8, 8, 8,10,10, 8,10,10, 4, 9, 9, 9,12, 11, 8,11,11, 8,12,11,10,12,14,10,13,13, 7,11,11, 10,14,12,11,14,14, 4, 9, 9, 8,11,11, 9,11,12, 7, 11,11,10,13,14,10,12,14, 8,11,12,10,14,14,10,13, 12,};static const static_codebook _16u0__p1_0 = { 4, 81, (char *)_vq_lengthlist__16u0__p1_0, 1, -535822336, 1611661312, 2, 0, (long *)_vq_quantlist__16u0__p1_0, 0};static const long _vq_quantlist__16u0__p2_0[] = { 1, 0, 2,};static const char _vq_lengthlist__16u0__p2_0[] = { 2, 4, 4, 5, 6, 6, 5, 6, 6, 5, 7, 7, 7, 8, 9, 7, 8, 9, 5, 7, 7, 7, 9, 8, 7, 9, 7, 4, 7, 7, 7, 9, 9, 7, 8, 8, 6, 9, 8, 7, 8,11, 9,11,10, 6, 8, 9, 8,11, 8, 9,10,11, 4, 7, 7, 7, 8, 8, 7, 9, 9, 6, 9, 8, 9,11,10, 8, 8,11, 6, 8, 9, 9,10,11, 8,11, 8,};static const static_codebook _16u0__p2_0 = { 4, 81, (char *)_vq_lengthlist__16u0__p2_0, 1, -535822336, 1611661312, 2, 0, (long *)_vq_quantlist__16u0__p2_0, 0};static const long _vq_quantlist__16u0__p3_0[] = { 2, 1, 3, 0, 4,};static const char _vq_lengthlist__16u0__p3_0[] = { 1, 5, 5, 7, 7, 6, 7, 7, 8, 8, 6, 7, 8, 8, 8, 8, 9, 9,11,11, 8, 9, 9,11,11, 6, 9, 8,10,10, 8,10, 10,11,11, 8,10,10,11,11,10,11,10,13,12, 9,11,10, 13,13, 6, 8, 9,10,10, 8,10,10,11,11, 8,10,10,11, 11, 9,10,11,13,12,10,10,11,12,12, 8,11,11,14,13, 10,12,11,15,13, 9,12,11,15,14,12,14,13,16,14,12, 13,13,17,14, 8,11,11,13,14, 9,11,12,14,15,10,11, 12,13,15,11,13,13,14,16,12,13,14,14,16, 5, 9, 9, 11,11, 9,11,11,12,12, 8,11,11,12,12,11,12,12,15, 14,10,12,12,15,15, 8,11,11,13,12,10,12,12,13,13, 10,12,12,14,13,12,12,13,14,15,11,13,13,17,16, 7, 11,11,13,13,10,12,12,14,13,10,12,12,13,14,12,13, 12,15,14,11,13,13,15,14, 9,12,12,16,15,11,13,13, 17,16,10,13,13,16,16,13,14,15,15,16,13,15,14,19, 17, 9,12,12,14,16,11,13,13,15,16,10,13,13,17,16, 13,14,13,17,15,12,15,15,16,17, 5, 9, 9,11,11, 8, 11,11,13,12, 9,11,11,12,12,10,12,12,14,15,11,12, 12,14,14, 7,11,10,13,12,10,12,12,14,13,10,11,12, 13,13,11,13,13,15,16,12,12,13,15,15, 7,11,11,13, 13,10,13,13,14,14,10,12,12,13,13,11,13,13,16,15, 12,13,13,15,14, 9,12,12,15,15,10,13,13,17,16,11, 12,13,15,15,12,15,14,18,18,13,14,14,16,17, 9,12, 12,15,16,10,13,13,15,16,11,13,13,15,16,13,15,15, 17,17,13,15,14,16,15, 7,11,11,15,16,10,13,12,16, 17,10,12,13,15,17,15,16,16,18,17,13,15,15,17,18, 8,12,12,16,16,11,13,14,17,18,11,13,13,18,16,15, 17,16,17,19,14,15,15,17,16, 8,12,12,16,15,11,14, 13,18,17,11,13,14,18,17,15,16,16,18,17,13,16,16, 18,18,11,15,14,18,17,13,14,15,18, 0,12,15,15, 0, 17,17,16,17,17,18,14,16,18,18, 0,11,14,14,17, 0, 12,15,14,17,19,12,15,14,18, 0,15,18,16, 0,17,14, 18,16,18, 0, 7,11,11,16,15,10,12,12,18,16,10,13, 13,16,15,13,15,14,17,17,14,16,16,19,18, 8,12,12, 16,16,11,13,13,18,16,11,13,14,17,16,14,15,15,19, 18,15,16,16, 0,19, 8,12,12,16,17,11,13,13,17,17, 11,14,13,17,17,13,15,15,17,19,15,17,17,19, 0,11, 14,15,19,17,12,15,16,18,18,12,14,15,19,17,14,16, 17, 0,18,16,16,19,17, 0,11,14,14,18,19,12,15,14, 17,17,13,16,14,17,16,14,17,16,18,18,15,18,15, 0, 18,};static const static_codebook _16u0__p3_0 = { 4, 625, (char *)_vq_lengthlist__16u0__p3_0, 1, -533725184, 1611661312, 3, 0, (long *)_vq_quantlist__16u0__p3_0, 0};static const long _vq_quantlist__16u0__p4_0[] = { 2, 1, 3, 0, 4,};static const char _vq_lengthlist__16u0__p4_0[] = { 3, 5, 5, 8, 8, 6, 6, 6, 9, 9, 6, 6, 6, 9, 9, 9, 10, 9,11,11, 9, 9, 9,11,11, 6, 7, 7,10,10, 7, 7, 8,10,10, 7, 7, 8,10,10,10,10,10,11,12, 9,10,10, 11,12, 6, 7, 7,10,10, 7, 8, 7,10,10, 7, 8, 7,10, 10,10,11,10,12,11,10,10,10,13,10, 9,10,10,12,12, 10,11,10,14,12, 9,11,11,13,13,11,12,13,13,13,11, 12,12,15,13, 9,10,10,12,13, 9,11,10,12,13,10,10, 11,12,13,11,12,12,12,13,11,12,12,13,13, 5, 7, 7, 10,10, 7, 8, 8,10,10, 7, 8, 8,10,10,10,11,10,12, 13,10,10,11,12,12, 6, 8, 8,11,10, 7, 8, 9,10,12, 8, 9, 9,11,11,11,10,11,11,12,10,11,11,13,12, 7, 8, 8,10,11, 8, 9, 8,11,10, 8, 9, 9,11,11,10,12, 10,13,11,10,11,11,13,13,10,11,10,14,13,10,10,11, 13,13,10,12,11,14,13,12,11,13,12,13,13,12,13,14, 14,10,11,11,13,13,10,11,10,12,13,10,12,12,12,14, 12,12,12,14,12,12,13,12,17,15, 5, 7, 7,10,10, 7, 8, 8,10,10, 7, 8, 8,11,10,10,10,11,12,12,10,11, 11,12,13, 6, 8, 8,11,10, 8, 9, 9,11,11, 7, 8, 9, 10,11,11,11,11,12,12,10,10,11,12,13, 6, 8, 8,10, 11, 8, 9, 9,11,11, 7, 9, 7,11,10,10,12,12,13,13, 11,11,10,13,11, 9,11,10,14,13,11,11,11,15,13,10, 10,11,13,13,12,13,13,14,14,12,11,12,12,13,10,11, 11,12,13,10,11,12,13,13,10,11,10,13,12,12,12,13, 14, 0,12,13,11,13,11, 8,10,10,13,13,10,11,11,14, 13,10,11,11,13,12,13,14,14,14,15,12,12,12,15,14, 9,11,10,13,12,10,10,11,13,14,11,11,11,15,12,13, 12,14,15,16,13,13,13,14,13, 9,11,11,12,12,10,12, 11,13,13,10,11,11,13,14,13,13,13,15,15,13,13,14, 17,15,11,12,12,14,14,10,11,12,13,15,12,13,13, 0, 15,13,11,14,12,16,14,16,14, 0,15,11,12,12,14,16, 11,13,12,16,15,12,13,13,14,15,12,14,12,15,13,15, 14,14,16,16, 8,10,10,13,13,10,11,10,13,14,10,11, 11,13,13,13,13,12,14,14,14,13,13,16,17, 9,10,10, 12,14,10,12,11,14,13,10,11,12,13,14,12,12,12,15, 15,13,13,13,14,14, 9,10,10,13,13,10,11,12,12,14, 10,11,10,13,13,13,13,13,14,16,13,13,13,14,14,11, 12,13,15,13,12,14,13,14,16,12,12,13,13,14,13,14, 14,17,15,13,12,17,13,16,11,12,13,14,15,12,13,14, 14,17,11,12,11,14,14,13,16,14,16, 0,14,15,11,15, 11,};static const static_codebook _16u0__p4_0 = { 4, 625, (char *)_vq_lengthlist__16u0__p4_0, 1, -533725184, 1611661312, 3, 0, (long *)_vq_quantlist__16u0__p4_0, 0};static const long _vq_quantlist__16u0__p5_0[] = { 4, 3, 5, 2, 6, 1, 7, 0, 8,};static const char _vq_lengthlist__16u0__p5_0[] = { 1, 4, 4, 7, 7, 7, 7, 9, 9, 4, 6, 6, 8, 8, 8, 8, 9, 9, 4, 6, 6, 8, 8, 8, 8, 9, 9, 7, 8, 8, 9, 9, 9, 9,11,10, 7, 8, 8, 9, 9, 9, 9,10,11, 7, 8, 8, 9, 9,10,10,11,11, 7, 8, 8, 9, 9,10,10,11,11, 9, 9, 9,10,10,11,11,12,12, 9, 9, 9,10,10,11,11,12, 12,};static const static_codebook _16u0__p5_0 = { 2, 81, (char *)_vq_lengthlist__16u0__p5_0, 1, -531628032, 1611661312, 4, 0, (long *)_vq_quantlist__16u0__p5_0, 0};static const long _vq_quantlist__16u0__p6_0[] = { 6, 5, 7, 4, 8, 3, 9, 2, 10, 1, 11, 0, 12,};static const char _vq_lengthlist__16u0__p6_0[] = { 1, 4, 4, 7, 7,10,10,12,12,13,13,18,17, 3, 6, 6, 9, 9,11,11,13,13,14,14,18,17, 3, 6, 6, 9, 9,11, 11,13,13,14,14,17,18, 7, 9, 9,11,11,13,13,14,14, 15,15, 0, 0, 7, 9, 9,11,11,13,13,14,14,15,16,19, 18,10,11,11,13,13,14,14,16,15,17,18, 0, 0,10,11, 11,13,13,14,14,15,15,16,18, 0, 0,11,13,13,14,14, 15,15,17,17, 0,19, 0, 0,11,13,13,14,14,14,15,16, 18, 0,19, 0, 0,13,14,14,15,15,18,17,18,18, 0,19, 0, 0,13,14,14,15,16,16,16,18,18,19, 0, 0, 0,16, 17,17, 0,17,19,19, 0,19, 0, 0, 0, 0,16,19,16,17, 18, 0,19, 0, 0, 0, 0, 0, 0,};static const static_codebook _16u0__p6_0 = { 2, 169, (char *)_vq_lengthlist__16u0__p6_0, 1, -526516224, 1616117760, 4, 0, (long *)_vq_quantlist__16u0__p6_0, 0};static const long _vq_quantlist__16u0__p6_1[] = { 2, 1, 3, 0, 4,};static const char _vq_lengthlist__16u0__p6_1[] = { 1, 4, 5, 6, 6, 4, 6, 6, 6, 6, 4, 6, 6, 6, 6, 6, 6, 6, 7, 7, 6, 6, 6, 7, 7,};static const static_codebook _16u0__p6_1 = { 2, 25, (char *)_vq_lengthlist__16u0__p6_1, 1, -533725184, 1611661312, 3, 0, (long *)_vq_quantlist__16u0__p6_1, 0};static const long _vq_quantlist__16u0__p7_0[] = { 1, 0, 2,};static const char _vq_lengthlist__16u0__p7_0[] = { 1, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,};static const static_codebook _16u0__p7_0 = { 4, 81, (char *)_vq_lengthlist__16u0__p7_0, 1, -518803456, 1628680192, 2, 0, (long *)_vq_quantlist__16u0__p7_0, 0};static const long _vq_quantlist__16u0__p7_1[] = { 7, 6, 8, 5, 9, 4, 10, 3, 11, 2, 12, 1, 13, 0, 14,};static const char _vq_lengthlist__16u0__p7_1[] = { 1, 5, 5, 6, 5, 9,10,11,11,10,10,10,10,10,10, 5, 8, 8, 8,10,10,10,10,10,10,10,10,10,10,10, 5, 8, 9, 9, 9,10,10,10,10,10,10,10,10,10,10, 5,10, 8, 10,10,10,10,10,10,10,10,10,10,10,10, 4, 8, 9,10, 10,10,10,10,10,10,10,10,10,10,10, 9,10,10,10,10, 10,10,10,10,10,10,10,10,10,10, 9,10,10,10,10,10, 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, 10,};static const static_codebook _16u0__p7_1 = { 2, 225, (char *)_vq_lengthlist__16u0__p7_1, 1, -520986624, 1620377600, 4, 0, (long *)_vq_quantlist__16u0__p7_1, 0};static const long _vq_quantlist__16u0__p7_2[] = { 10, 9, 11, 8, 12, 7, 13, 6, 14, 5, 15, 4, 16, 3, 17, 2, 18, 1, 19, 0, 20,};static const char _vq_lengthlist__16u0__p7_2[] = { 1, 6, 6, 7, 8, 7, 7,10, 9,10, 9,11,10, 9,11,10, 9, 9, 9, 9,10, 6, 8, 7, 9, 9, 8, 8,10,10, 9,11, 11,12,12,10, 9,11, 9,12,10, 9, 6, 9, 8, 9,12, 8, 8,11, 9,11,11,12,11,12,12,10,11,11,10,10,11, 7, 10, 9, 9, 9, 9, 9,10, 9,10, 9,10,10,12,10,10,10, 11,12,10,10, 7, 9, 9, 9,10, 9, 9,10,10, 9, 9, 9, 11,11,10,10,10,10, 9, 9,12, 7, 9,10, 9,11, 9,10, 9,10,11,11,11,10,11,12, 9,12,11,10,10,10, 7, 9, 9, 9, 9,10,12,10, 9,11,12,10,11,12,12,11, 9,10, 11,10,11, 7, 9,10,10,11,10, 9,10,11,11,11,10,12, 12,12,11,11,10,11,11,12, 8, 9,10,12,11,10,10,12, 12,12,12,12,10,11,11, 9,11,10,12,11,11, 8, 9,10, 10,11,12,11,11,10,10,10,12,12,12, 9,10,12,12,12, 12,12, 8,10,11,10,10,12, 9,11,12,12,11,12,12,12, 12,10,12,10,10,10,10, 8,12,11,11,11,10,10,11,12, 12,12,12,11,12,12,12,11,11,11,12,10, 9,10,10,12, 10,12,10,12,12,10,10,10,11,12,12,12,11,12,12,12, 11,10,11,12,12,12,11,12,12,11,12,12,11,12,12,12, 12,11,12,12,10,10,10,10,11,11,12,11,12,12,12,12, 12,12,12,11,12,11,10,11,11,12,11,11, 9,10,10,10, 12,10,10,11, 9,11,12,11,12,11,12,12,10,11,10,12, 9, 9, 9,12,11,10,11,10,12,10,12,10,12,12,12,11, 11,11,11,11,10, 9,10,10,11,10,11,11,12,11,10,11, 12,12,12,11,11, 9,12,10,12, 9,10,12,10,10,11,10, 11,11,12,11,10,11,10,11,11,11,11,12,11,11,10, 9, 10,10,10, 9,11,11,10, 9,12,10,11,12,11,12,12,11, 12,11,12,11,10,11,10,12,11,12,11,12,11,12,10,11, 10,10,12,11,10,11,11,11,10,};static const static_codebook _16u0__p7_2 = { 2, 441, (char *)_vq_lengthlist__16u0__p7_2, 1, -529268736, 1611661312, 5, 0, (long *)_vq_quantlist__16u0__p7_2, 0};static const char _huff_lengthlist__16u0__single[] = { 3, 5, 8, 7,14, 8, 9,19, 5, 2, 5, 5, 9, 6, 9,19, 8, 4, 5, 7, 8, 9,13,19, 7, 4, 6, 5, 9, 6, 9,19, 12, 8, 7, 9,10,11,13,19, 8, 5, 8, 6, 9, 6, 7,19, 8, 8,10, 7, 7, 4, 5,19,12,17,19,15,18,13,11,18,};static const static_codebook _huff_book__16u0__single = { 2, 64, (char *)_huff_lengthlist__16u0__single, 0, 0, 0, 0, 0, NULL, 0};static const char _huff_lengthlist__16u1__long[] = { 3, 6,10, 8,12, 8,14, 8,14,19, 5, 3, 5, 5, 7, 6, 11, 7,16,19, 7, 5, 6, 7, 7, 9,11,12,19,19, 6, 4, 7, 5, 7, 6,10, 7,18,18, 8, 6, 7, 7, 7, 7, 8, 9, 18,18, 7, 5, 8, 5, 7, 5, 8, 6,18,18,12, 9,10, 9, 9, 9, 8, 9,18,18, 8, 7,10, 6, 8, 5, 6, 4,11,18, 11,15,16,12,11, 8, 8, 6, 9,18,14,18,18,18,16,16, 16,13,16,18,};static const static_codebook _huff_book__16u1__long = { 2, 100, (char *)_huff_lengthlist__16u1__long, 0, 0, 0, 0, 0, NULL, 0};static const long _vq_quantlist__16u1__p1_0[] = { 1, 0, 2,};static const char _vq_lengthlist__16u1__p1_0[] = { 1, 4, 4, 5, 7, 7, 5, 7, 7, 5, 8, 7, 7,10,10, 7, 9,10, 5, 7, 8, 7,10, 9, 7,10,10, 5, 8, 8, 8,10, 10, 8,10,10, 7,10,10,10,11,12,10,12,13, 7,10,10, 9,13,11,10,12,13, 5, 8, 8, 8,10,10, 8,10,10, 7, 10,10,10,12,12, 9,11,12, 7,10,11,10,12,12,10,13, 11,};static const static_codebook _16u1__p1_0 = { 4, 81, (char *)_vq_lengthlist__16u1__p1_0, 1, -535822336, 1611661312, 2, 0, (long *)_vq_quantlist__16u1__p1_0, 0};static const long _vq_quantlist__16u1__p2_0[] = { 1, 0, 2,};static const char _vq_lengthlist__16u1__p2_0[] = { 3, 4, 4, 5, 6, 6, 5, 6, 6, 5, 6, 6, 6, 7, 8, 6, 7, 8, 5, 6, 6, 6, 8, 7, 6, 8, 7, 5, 6, 6, 6, 8, 8, 6, 8, 8, 6, 8, 8, 7, 7,10, 8, 9, 9, 6, 8, 8, 7, 9, 8, 8, 9,10, 5, 6, 6, 6, 8, 8, 7, 8, 8, 6, 8, 8, 8,10, 9, 7, 8, 9, 6, 8, 8, 8, 9, 9, 7,10, 8,};static const static_codebook _16u1__p2_0 = { 4, 81, (char *)_vq_lengthlist__16u1__p2_0, 1, -535822336, 1611661312, 2, 0, (long *)_vq_quantlist__16u1__p2_0, 0};static const long _vq_quantlist__16u1__p3_0[] = { 2, 1, 3, 0, 4,};static const char _vq_lengthlist__16u1__p3_0[] = { 1, 5, 5, 8, 8, 6, 7, 7, 9, 9, 5, 7, 7, 9, 9, 9, 10, 9,11,11, 9, 9,10,11,11, 6, 8, 8,10,10, 8, 9, 10,11,11, 8, 9,10,11,11,10,11,11,12,13,10,11,11, 13,13, 6, 8, 8,10,10, 8,10, 9,11,11, 8,10, 9,11, 11,10,11,11,13,13,10,11,11,13,12, 9,11,11,14,13, 10,12,12,15,14,10,12,11,14,13,12,13,13,15,15,12, 13,13,16,14, 9,11,11,13,14,10,11,12,14,14,10,12, 12,14,15,12,13,13,14,15,12,13,14,15,16, 5, 8, 8, 11,11, 8,10,10,12,12, 8,10,10,12,12,11,12,12,14, 14,11,12,12,14,14, 8,10,10,12,12, 9,11,12,12,13, 10,12,12,13,13,12,12,13,14,15,11,13,13,15,15, 7,Showing the first 500 of 7758 diff lines for this file. This diff is INCOMPLETE; read the file or clone the repository for the rest.
vendor/vorbis/lib/codebook.cadded
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2015 * * by the Xiph.Org Foundation https://xiph.org/ * * * ******************************************************************** function: basic codebook pack/unpack/code/decode operations ********************************************************************/#include <stdlib.h>#include <string.h>#include <math.h>#include <ogg/ogg.h>#include "vorbis/codec.h"#include "codebook.h"#include "scales.h"#include "misc.h"#include "os.h"/* packs the given codebook into the bitstream **************************/int vorbis_staticbook_pack(const static_codebook *c,oggpack_buffer *opb){ long i,j; int ordered=0; /* first the basic parameters */ oggpack_write(opb,0x564342,24); oggpack_write(opb,c->dim,16); oggpack_write(opb,c->entries,24); /* pack the codewords. There are two packings; length ordered and length random. Decide between the two now. */ for(i=1;i<c->entries;i++) if(c->lengthlist[i-1]==0 || c->lengthlist[i]<c->lengthlist[i-1])break; if(i==c->entries)ordered=1; if(ordered){ /* length ordered. We only need to say how many codewords of each length. The actual codewords are generated deterministically */ long count=0; oggpack_write(opb,1,1); /* ordered */ oggpack_write(opb,c->lengthlist[0]-1,5); /* 1 to 32 */ for(i=1;i<c->entries;i++){ char this=c->lengthlist[i]; char last=c->lengthlist[i-1]; if(this>last){ for(j=last;j<this;j++){ oggpack_write(opb,i-count,ov_ilog(c->entries-count)); count=i; } } } oggpack_write(opb,i-count,ov_ilog(c->entries-count)); }else{ /* length random. Again, we don't code the codeword itself, just the length. This time, though, we have to encode each length */ oggpack_write(opb,0,1); /* unordered */ /* algortihmic mapping has use for 'unused entries', which we tag here. The algorithmic mapping happens as usual, but the unused entry has no codeword. */ for(i=0;i<c->entries;i++) if(c->lengthlist[i]==0)break; if(i==c->entries){ oggpack_write(opb,0,1); /* no unused entries */ for(i=0;i<c->entries;i++) oggpack_write(opb,c->lengthlist[i]-1,5); }else{ oggpack_write(opb,1,1); /* we have unused entries; thus we tag */ for(i=0;i<c->entries;i++){ if(c->lengthlist[i]==0){ oggpack_write(opb,0,1); }else{ oggpack_write(opb,1,1); oggpack_write(opb,c->lengthlist[i]-1,5); } } } } /* is the entry number the desired return value, or do we have a mapping? If we have a mapping, what type? */ oggpack_write(opb,c->maptype,4); switch(c->maptype){ case 0: /* no mapping */ break; case 1:case 2: /* implicitly populated value mapping */ /* explicitly populated value mapping */ if(!c->quantlist){ /* no quantlist? error */ return(-1); } /* values that define the dequantization */ oggpack_write(opb,c->q_min,32); oggpack_write(opb,c->q_delta,32); oggpack_write(opb,c->q_quant-1,4); oggpack_write(opb,c->q_sequencep,1); { int quantvals; switch(c->maptype){ case 1: /* a single column of (c->entries/c->dim) quantized values for building a full value list algorithmically (square lattice) */ quantvals=_book_maptype1_quantvals(c); break; case 2: /* every value (c->entries*c->dim total) specified explicitly */ quantvals=c->entries*c->dim; break; default: /* NOT_REACHABLE */ quantvals=-1; } /* quantized values */ for(i=0;i<quantvals;i++) oggpack_write(opb,labs(c->quantlist[i]),c->q_quant); } break; default: /* error case; we don't have any other map types now */ return(-1); } return(0);}/* unpacks a codebook from the packet buffer into the codebook struct, readies the codebook auxiliary structures for decode *************/static_codebook *vorbis_staticbook_unpack(oggpack_buffer *opb){ long i,j; static_codebook *s=_ogg_calloc(1,sizeof(*s)); s->allocedp=1; /* make sure alignment is correct */ if(oggpack_read(opb,24)!=0x564342)goto _eofout; /* first the basic parameters */ s->dim=oggpack_read(opb,16); s->entries=oggpack_read(opb,24); if(s->entries==-1)goto _eofout; if(ov_ilog(s->dim)+ov_ilog(s->entries)>24)goto _eofout; /* codeword ordering.... length ordered or unordered? */ switch((int)oggpack_read(opb,1)){ case 0:{ long unused; /* allocated but unused entries? */ unused=oggpack_read(opb,1); if((s->entries*(unused?1:5)+7)>>3>opb->storage-oggpack_bytes(opb)) goto _eofout; /* unordered */ s->lengthlist=_ogg_malloc(sizeof(*s->lengthlist)*s->entries); /* allocated but unused entries? */ if(unused){ /* yes, unused entries */ for(i=0;i<s->entries;i++){ if(oggpack_read(opb,1)){ long num=oggpack_read(opb,5); if(num==-1)goto _eofout; s->lengthlist[i]=num+1; }else s->lengthlist[i]=0; } }else{ /* all entries used; no tagging */ for(i=0;i<s->entries;i++){ long num=oggpack_read(opb,5); if(num==-1)goto _eofout; s->lengthlist[i]=num+1; } } break; } case 1: /* ordered */ { long length=oggpack_read(opb,5)+1; if(length==0)goto _eofout; s->lengthlist=_ogg_malloc(sizeof(*s->lengthlist)*s->entries); for(i=0;i<s->entries;){ long num=oggpack_read(opb,ov_ilog(s->entries-i)); if(num==-1)goto _eofout; if(length>32 || num>s->entries-i || (num>0 && (num-1)>>(length-1)>1)){ goto _errout; } if(length>32)goto _errout; for(j=0;j<num;j++,i++) s->lengthlist[i]=length; length++; } } break; default: /* EOF */ goto _eofout; } /* Do we have a mapping to unpack? */ switch((s->maptype=oggpack_read(opb,4))){ case 0: /* no mapping */ break; case 1: case 2: /* implicitly populated value mapping */ /* explicitly populated value mapping */ s->q_min=oggpack_read(opb,32); s->q_delta=oggpack_read(opb,32); s->q_quant=oggpack_read(opb,4)+1; s->q_sequencep=oggpack_read(opb,1); if(s->q_sequencep==-1)goto _eofout; { int quantvals=0; switch(s->maptype){ case 1: quantvals=(s->dim==0?0:_book_maptype1_quantvals(s)); break; case 2: quantvals=s->entries*s->dim; break; } /* quantized values */ if(((quantvals*s->q_quant+7)>>3)>opb->storage-oggpack_bytes(opb)) goto _eofout; s->quantlist=_ogg_malloc(sizeof(*s->quantlist)*quantvals); for(i=0;i<quantvals;i++) s->quantlist[i]=oggpack_read(opb,s->q_quant); if(quantvals&&s->quantlist[quantvals-1]==-1)goto _eofout; } break; default: goto _errout; } /* all set */ return(s); _errout: _eofout: vorbis_staticbook_destroy(s); return(NULL);}/* returns the number of bits ************************************************/int vorbis_book_encode(codebook *book, int a, oggpack_buffer *b){ if(a<0 || a>=book->c->entries)return(0); oggpack_write(b,book->codelist[a],book->c->lengthlist[a]); return(book->c->lengthlist[a]);}/* the 'eliminate the decode tree' optimization actually requires the codewords to be MSb first, not LSb. This is an annoying inelegancy (and one of the first places where carefully thought out design turned out to be wrong; Vorbis II and future Ogg codecs should go to an MSb bitpacker), but not actually the huge hit it appears to be. The first-stage decode table catches most words so that bitreverse is not in the main execution path. */static ogg_uint32_t bitreverse(ogg_uint32_t x){ x= ((x>>16)&0x0000ffff) | ((x<<16)&0xffff0000); x= ((x>> 8)&0x00ff00ff) | ((x<< 8)&0xff00ff00); x= ((x>> 4)&0x0f0f0f0f) | ((x<< 4)&0xf0f0f0f0); x= ((x>> 2)&0x33333333) | ((x<< 2)&0xcccccccc); return((x>> 1)&0x55555555) | ((x<< 1)&0xaaaaaaaa);}STIN long decode_packed_entry_number(codebook *book, oggpack_buffer *b){ int read=book->dec_maxlength; long lo,hi; long lok = oggpack_look(b,book->dec_firsttablen); if (lok >= 0) { long entry = book->dec_firsttable[lok]; if(entry&0x80000000UL){ lo=(entry>>15)&0x7fff; hi=book->used_entries-(entry&0x7fff); }else{ oggpack_adv(b, book->dec_codelengths[entry-1]); return(entry-1); } }else{ lo=0; hi=book->used_entries; } /* Single entry codebooks use a firsttablen of 1 and a dec_maxlength of 1. If a single-entry codebook gets here (due to failure to read one bit above), the next look attempt will also fail and we'll correctly kick out instead of trying to walk the underformed tree */ lok = oggpack_look(b, read); while(lok<0 && read>1) lok = oggpack_look(b, --read); if(lok<0)return -1; /* bisect search for the codeword in the ordered list */ { ogg_uint32_t testword=bitreverse((ogg_uint32_t)lok); while(hi-lo>1){ long p=(hi-lo)>>1; long test=book->codelist[lo+p]>testword; lo+=p&(test-1); hi-=p&(-test); } if(book->dec_codelengths[lo]<=read){ oggpack_adv(b, book->dec_codelengths[lo]); return(lo); } } oggpack_adv(b, read); return(-1);}/* Decode side is specced and easier, because we don't need to find matches using different criteria; we simply read and map. There are two things we need to do 'depending': We may need to support interleave. We don't really, but it's convenient to do it here rather than rebuild the vector later. Cascades may be additive or multiplicitive; this is not inherent in the codebook, but set in the code using the codebook. Like interleaving, it's easiest to do it here. addmul==0 -> declarative (set the value) addmul==1 -> additive addmul==2 -> multiplicitive *//* returns the [original, not compacted] entry number or -1 on eof *********/long vorbis_book_decode(codebook *book, oggpack_buffer *b){ if(book->used_entries>0){ long packed_entry=decode_packed_entry_number(book,b); if(packed_entry>=0) return(book->dec_index[packed_entry]); } /* if there's no dec_index, the codebook unpacking isn't collapsed */ return(-1);}/* returns 0 on OK or -1 on eof *************************************//* decode vector / dim granularity gaurding is done in the upper layer */long vorbis_book_decodevs_add(codebook *book,float *a,oggpack_buffer *b,int n){ if(book->used_entries>0){ int step=n/book->dim; long *entry = alloca(sizeof(*entry)*step); float **t = alloca(sizeof(*t)*step); int i,j,o; for (i = 0; i < step; i++) { entry[i]=decode_packed_entry_number(book,b); if(entry[i]==-1)return(-1); t[i] = book->valuelist+entry[i]*book->dim; } for(i=0,o=0;i<book->dim;i++,o+=step) for (j=0;o+j<n && j<step;j++) a[o+j]+=t[j][i]; } return(0);}/* decode vector / dim granularity gaurding is done in the upper layer */long vorbis_book_decodev_add(codebook *book,float *a,oggpack_buffer *b,int n){ if(book->used_entries>0){ int i,j,entry; float *t; for(i=0;i<n;){ entry = decode_packed_entry_number(book,b); if(entry==-1)return(-1); t = book->valuelist+entry*book->dim; for(j=0;i<n && j<book->dim;) a[i++]+=t[j++]; } } return(0);}/* unlike the others, we guard against n not being an integer number of <dim> internally rather than in the upper layer (called only by floor0) */long vorbis_book_decodev_set(codebook *book,float *a,oggpack_buffer *b,int n){ if(book->used_entries>0){ int i,j,entry; float *t; for(i=0;i<n;){ entry = decode_packed_entry_number(book,b); if(entry==-1)return(-1); t = book->valuelist+entry*book->dim; for (j=0;i<n && j<book->dim;){ a[i++]=t[j++]; } } }else{ int i; for(i=0;i<n;){ a[i++]=0.f; } } return(0);}long vorbis_book_decodevv_add(codebook *book,float **a,long offset,int ch, oggpack_buffer *b,int n){ long i,j,entry; int chptr=0; if(book->used_entries>0){ int m=(offset+n)/ch; for(i=offset/ch;i<m;){ entry = decode_packed_entry_number(book,b); if(entry==-1)return(-1); { const float *t = book->valuelist+entry*book->dim; for (j=0;i<m && j<book->dim;j++){ a[chptr++][i]+=t[j]; if(chptr==ch){ chptr=0; i++; } } } } } return(0);}vendor/vorbis/lib/codebook.hadded
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2015 * * by the Xiph.Org Foundation https://xiph.org/ * * * ******************************************************************** function: basic shared codebook operations ********************************************************************/#ifndef _V_CODEBOOK_H_#define _V_CODEBOOK_H_#include <ogg/ogg.h>/* This structure encapsulates huffman and VQ style encoding books; it doesn't do anything specific to either. valuelist/quantlist are nonNULL (and q_* significant) only if there's entry->value mapping to be done. If encode-side mapping must be done (and thus the entry needs to be hunted), the auxiliary encode pointer will point to a decision tree. This is true of both VQ and huffman, but is mostly useful with VQ.*/typedef struct static_codebook{ long dim; /* codebook dimensions (elements per vector) */ long entries; /* codebook entries */ char *lengthlist; /* codeword lengths in bits */ /* mapping ***************************************************************/ int maptype; /* 0=none 1=implicitly populated values from map column 2=listed arbitrary values */ /* The below does a linear, single monotonic sequence mapping. */ long q_min; /* packed 32 bit float; quant value 0 maps to minval */ long q_delta; /* packed 32 bit float; val 1 - val 0 == delta */ int q_quant; /* bits: 0 < quant <= 16 */ int q_sequencep; /* bitflag */ long *quantlist; /* map == 1: (int)(entries^(1/dim)) element column map map == 2: list of dim*entries quantized entry vals */ int allocedp;} static_codebook;typedef struct codebook{ long dim; /* codebook dimensions (elements per vector) */ long entries; /* codebook entries */ long used_entries; /* populated codebook entries */ const static_codebook *c; /* for encode, the below are entry-ordered, fully populated */ /* for decode, the below are ordered by bitreversed codeword and only used entries are populated */ float *valuelist; /* list of dim*entries actual entry values */ ogg_uint32_t *codelist; /* list of bitstream codewords for each entry */ int *dec_index; /* only used if sparseness collapsed */ char *dec_codelengths; ogg_uint32_t *dec_firsttable; int dec_firsttablen; int dec_maxlength; /* The current encoder uses only centered, integer-only lattice books. */ int quantvals; int minval; int delta;} codebook;extern void vorbis_staticbook_destroy(static_codebook *b);extern int vorbis_book_init_encode(codebook *dest,const static_codebook *source);extern int vorbis_book_init_decode(codebook *dest,const static_codebook *source);extern void vorbis_book_clear(codebook *b);extern float *_book_unquantize(const static_codebook *b,int n,int *map);extern float *_book_logdist(const static_codebook *b,float *vals);extern float _float32_unpack(long val);extern long _float32_pack(float val);extern int _best(codebook *book, float *a, int step);extern long _book_maptype1_quantvals(const static_codebook *b);extern int vorbis_book_besterror(codebook *book,float *a,int step,int addmul);extern long vorbis_book_codeword(codebook *book,int entry);extern long vorbis_book_codelen(codebook *book,int entry);extern int vorbis_staticbook_pack(const static_codebook *c,oggpack_buffer *b);extern static_codebook *vorbis_staticbook_unpack(oggpack_buffer *b);extern int vorbis_book_encode(codebook *book, int a, oggpack_buffer *b);extern long vorbis_book_decode(codebook *book, oggpack_buffer *b);extern long vorbis_book_decodevs_add(codebook *book, float *a, oggpack_buffer *b,int n);extern long vorbis_book_decodev_set(codebook *book, float *a, oggpack_buffer *b,int n);extern long vorbis_book_decodev_add(codebook *book, float *a, oggpack_buffer *b,int n);extern long vorbis_book_decodevv_add(codebook *book, float **a, long off,int ch, oggpack_buffer *b,int n);#endifvendor/vorbis/lib/codec_internal.hadded
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 * * by the Xiph.Org Foundation https://xiph.org/ * * * ******************************************************************** function: libvorbis codec headers ********************************************************************/#ifndef _V_CODECI_H_#define _V_CODECI_H_#include "envelope.h"#include "codebook.h"#define BLOCKTYPE_IMPULSE 0#define BLOCKTYPE_PADDING 1#define BLOCKTYPE_TRANSITION 0#define BLOCKTYPE_LONG 1#define PACKETBLOBS 15typedef struct vorbis_block_internal{ float **pcmdelay; /* this is a pointer into local storage */ float ampmax; int blocktype; oggpack_buffer *packetblob[PACKETBLOBS]; /* initialized, must be freed; blob [PACKETBLOBS/2] points to the oggpack_buffer in the main vorbis_block */} vorbis_block_internal;typedef void vorbis_look_floor;typedef void vorbis_look_residue;typedef void vorbis_look_transform;/* mode ************************************************************/typedef struct { int blockflag; int windowtype; int transformtype; int mapping;} vorbis_info_mode;typedef void vorbis_info_floor;typedef void vorbis_info_residue;typedef void vorbis_info_mapping;#include "psy.h"#include "bitrate.h"typedef struct private_state { /* local lookup storage */ envelope_lookup *ve; /* envelope lookup */ int window[2]; vorbis_look_transform **transform[2]; /* block, type */ drft_lookup fft_look[2]; int modebits; vorbis_look_floor **flr; vorbis_look_residue **residue; vorbis_look_psy *psy; vorbis_look_psy_global *psy_g_look; /* local storage, only used on the encoding side. This way the application does not need to worry about freeing some packets' memory and not others'; packet storage is always tracked. Cleared next call to a _dsp_ function */ unsigned char *header; unsigned char *header1; unsigned char *header2; bitrate_manager_state bms; ogg_int64_t sample_count;} private_state;/* codec_setup_info contains all the setup information specific to the specific compression/decompression mode in progress (eg, psychoacoustic settings, channel setup, options, codebook etc).*********************************************************************/#include "highlevel.h"typedef struct codec_setup_info { /* Vorbis supports only short and long blocks, but allows the encoder to choose the sizes */ long blocksizes[2]; /* modes are the primary means of supporting on-the-fly different blocksizes, different channel mappings (LR or M/A), different residue backends, etc. Each mode consists of a blocksize flag and a mapping (along with the mapping setup */ int modes; int maps; int floors; int residues; int books; int psys; /* encode only */ vorbis_info_mode *mode_param[64]; int map_type[64]; vorbis_info_mapping *map_param[64]; int floor_type[64]; vorbis_info_floor *floor_param[64]; int residue_type[64]; vorbis_info_residue *residue_param[64]; static_codebook *book_param[256]; codebook *fullbooks; vorbis_info_psy *psy_param[4]; /* encode only */ vorbis_info_psy_global psy_g_param; bitrate_manager_info bi; highlevel_encode_setup hi; /* used only by vorbisenc.c. It's a highly redundant structure, but improves clarity of program flow. */ int halfrate_flag; /* painless downsample for decode */} codec_setup_info;extern vorbis_look_psy_global *_vp_global_look(vorbis_info *vi);extern void _vp_global_free(vorbis_look_psy_global *look);typedef struct { int sorted_index[VIF_POSIT+2]; int forward_index[VIF_POSIT+2]; int reverse_index[VIF_POSIT+2]; int hineighbor[VIF_POSIT]; int loneighbor[VIF_POSIT]; int posts; int n; int quant_q; vorbis_info_floor1 *vi; long phrasebits; long postbits; long frames;} vorbis_look_floor1;extern int *floor1_fit(vorbis_block *vb,vorbis_look_floor1 *look, const float *logmdct, /* in */ const float *logmask);extern int *floor1_interpolate_fit(vorbis_block *vb,vorbis_look_floor1 *look, int *A,int *B, int del);extern int floor1_encode(oggpack_buffer *opb,vorbis_block *vb, vorbis_look_floor1 *look, int *post,int *ilogmask);#endifvendor/vorbis/lib/envelope.cadded
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 * * by the Xiph.Org Foundation https://xiph.org/ * * * ******************************************************************** function: PCM data envelope analysis ********************************************************************/#include <stdlib.h>#include <string.h>#include <stdio.h>#include <math.h>#include <ogg/ogg.h>#include "vorbis/codec.h"#include "codec_internal.h"#include "os.h"#include "scales.h"#include "envelope.h"#include "mdct.h"#include "misc.h"void _ve_envelope_init(envelope_lookup *e,vorbis_info *vi){ codec_setup_info *ci=vi->codec_setup; vorbis_info_psy_global *gi=&ci->psy_g_param; int ch=vi->channels; int i,j; int n=e->winlength=128; e->searchstep=64; /* not random */ e->minenergy=gi->preecho_minenergy; e->ch=ch; e->storage=128; e->cursor=ci->blocksizes[1]/2; e->mdct_win=_ogg_calloc(n,sizeof(*e->mdct_win)); mdct_init(&e->mdct,n); for(i=0;i<n;i++){ e->mdct_win[i]=sin(i/(n-1.)*M_PI); e->mdct_win[i]*=e->mdct_win[i]; } /* magic follows */ e->band[0].begin=2; e->band[0].end=4; e->band[1].begin=4; e->band[1].end=5; e->band[2].begin=6; e->band[2].end=6; e->band[3].begin=9; e->band[3].end=8; e->band[4].begin=13; e->band[4].end=8; e->band[5].begin=17; e->band[5].end=8; e->band[6].begin=22; e->band[6].end=8; for(j=0;j<VE_BANDS;j++){ n=e->band[j].end; e->band[j].window=_ogg_malloc(n*sizeof(*e->band[0].window)); for(i=0;i<n;i++){ e->band[j].window[i]=sin((i+.5)/n*M_PI); e->band[j].total+=e->band[j].window[i]; } e->band[j].total=1./e->band[j].total; } e->filter=_ogg_calloc(VE_BANDS*ch,sizeof(*e->filter)); e->mark=_ogg_calloc(e->storage,sizeof(*e->mark));}void _ve_envelope_clear(envelope_lookup *e){ int i; mdct_clear(&e->mdct); for(i=0;i<VE_BANDS;i++) _ogg_free(e->band[i].window); _ogg_free(e->mdct_win); _ogg_free(e->filter); _ogg_free(e->mark); memset(e,0,sizeof(*e));}/* fairly straight threshhold-by-band based until we find something that works better and isn't patented. */static int _ve_amp(envelope_lookup *ve, vorbis_info_psy_global *gi, float *data, envelope_band *bands, envelope_filter_state *filters){ long n=ve->winlength; int ret=0; long i,j; float decay; /* we want to have a 'minimum bar' for energy, else we're just basing blocks on quantization noise that outweighs the signal itself (for low power signals) */ float minV=ve->minenergy; float *vec=alloca(n*sizeof(*vec)); /* stretch is used to gradually lengthen the number of windows considered prevoius-to-potential-trigger */ int stretch=max(VE_MINSTRETCH,ve->stretch/2); float penalty=gi->stretch_penalty-(ve->stretch/2-VE_MINSTRETCH); if(penalty<0.f)penalty=0.f; if(penalty>gi->stretch_penalty)penalty=gi->stretch_penalty; /*_analysis_output_always("lpcm",seq2,data,n,0,0, totalshift+pos*ve->searchstep);*/ /* window and transform */ for(i=0;i<n;i++) vec[i]=data[i]*ve->mdct_win[i]; mdct_forward(&ve->mdct,vec,vec); /*_analysis_output_always("mdct",seq2,vec,n/2,0,1,0); */ /* near-DC spreading function; this has nothing to do with psychoacoustics, just sidelobe leakage and window size */ { float temp=vec[0]*vec[0]+.7*vec[1]*vec[1]+.2*vec[2]*vec[2]; int ptr=filters->nearptr; /* the accumulation is regularly refreshed from scratch to avoid floating point creep */ if(ptr==0){ decay=filters->nearDC_acc=filters->nearDC_partialacc+temp; filters->nearDC_partialacc=temp; }else{ decay=filters->nearDC_acc+=temp; filters->nearDC_partialacc+=temp; } filters->nearDC_acc-=filters->nearDC[ptr]; filters->nearDC[ptr]=temp; decay*=(1./(VE_NEARDC+1)); filters->nearptr++; if(filters->nearptr>=VE_NEARDC)filters->nearptr=0; decay=todB(&decay)*.5-15.f; } /* perform spreading and limiting, also smooth the spectrum. yes, the MDCT results in all real coefficients, but it still *behaves* like real/imaginary pairs */ for(i=0;i<n/2;i+=2){ float val=vec[i]*vec[i]+vec[i+1]*vec[i+1]; val=todB(&val)*.5f; if(val<decay)val=decay; if(val<minV)val=minV; vec[i>>1]=val; decay-=8.; } /*_analysis_output_always("spread",seq2++,vec,n/4,0,0,0);*/ /* perform preecho/postecho triggering by band */ for(j=0;j<VE_BANDS;j++){ float acc=0.; float valmax,valmin; /* accumulate amplitude */ for(i=0;i<bands[j].end;i++) acc+=vec[i+bands[j].begin]*bands[j].window[i]; acc*=bands[j].total; /* convert amplitude to delta */ { int p,this=filters[j].ampptr; float postmax,postmin,premax=-99999.f,premin=99999.f; p=this; p--; if(p<0)p+=VE_AMP; postmax=max(acc,filters[j].ampbuf[p]); postmin=min(acc,filters[j].ampbuf[p]); for(i=0;i<stretch;i++){ p--; if(p<0)p+=VE_AMP; premax=max(premax,filters[j].ampbuf[p]); premin=min(premin,filters[j].ampbuf[p]); } valmin=postmin-premin; valmax=postmax-premax; /*filters[j].markers[pos]=valmax;*/ filters[j].ampbuf[this]=acc; filters[j].ampptr++; if(filters[j].ampptr>=VE_AMP)filters[j].ampptr=0; } /* look at min/max, decide trigger */ if(valmax>gi->preecho_thresh[j]+penalty){ ret|=1; ret|=4; } if(valmin<gi->postecho_thresh[j]-penalty)ret|=2; } return(ret);}#if 0static int seq=0;static ogg_int64_t totalshift=-1024;#endiflong _ve_envelope_search(vorbis_dsp_state *v){ vorbis_info *vi=v->vi; codec_setup_info *ci=vi->codec_setup; vorbis_info_psy_global *gi=&ci->psy_g_param; envelope_lookup *ve=((private_state *)(v->backend_state))->ve; long i,j; int first=ve->current/ve->searchstep; int last=v->pcm_current/ve->searchstep-VE_WIN; if(first<0)first=0; /* make sure we have enough storage to match the PCM */ if(last+VE_WIN+VE_POST>ve->storage){ ve->storage=last+VE_WIN+VE_POST; /* be sure */ ve->mark=_ogg_realloc(ve->mark,ve->storage*sizeof(*ve->mark)); } for(j=first;j<last;j++){ int ret=0; ve->stretch++; if(ve->stretch>VE_MAXSTRETCH*2) ve->stretch=VE_MAXSTRETCH*2; for(i=0;i<ve->ch;i++){ float *pcm=v->pcm[i]+ve->searchstep*(j); ret|=_ve_amp(ve,gi,pcm,ve->band,ve->filter+i*VE_BANDS); } ve->mark[j+VE_POST]=0; if(ret&1){ ve->mark[j]=1; ve->mark[j+1]=1; } if(ret&2){ ve->mark[j]=1; if(j>0)ve->mark[j-1]=1; } if(ret&4)ve->stretch=-1; } ve->current=last*ve->searchstep; { long centerW=v->centerW; long testW= centerW+ ci->blocksizes[v->W]/4+ ci->blocksizes[1]/2+ ci->blocksizes[0]/4; j=ve->cursor; while(j<ve->current-(ve->searchstep)){/* account for postecho working back one window */ if(j>=testW)return(1); ve->cursor=j; if(ve->mark[j/ve->searchstep]){ if(j>centerW){#if 0 if(j>ve->curmark){ float *marker=alloca(v->pcm_current*sizeof(*marker)); int l,m; memset(marker,0,sizeof(*marker)*v->pcm_current); fprintf(stderr,"mark! seq=%d, cursor:%fs time:%fs\n", seq, (totalshift+ve->cursor)/44100., (totalshift+j)/44100.); _analysis_output_always("pcmL",seq,v->pcm[0],v->pcm_current,0,0,totalshift); _analysis_output_always("pcmR",seq,v->pcm[1],v->pcm_current,0,0,totalshift); _analysis_output_always("markL",seq,v->pcm[0],j,0,0,totalshift); _analysis_output_always("markR",seq,v->pcm[1],j,0,0,totalshift); for(m=0;m<VE_BANDS;m++){ char buf[80]; sprintf(buf,"delL%d",m); for(l=0;l<last;l++)marker[l*ve->searchstep]=ve->filter[m].markers[l]*.1; _analysis_output_always(buf,seq,marker,v->pcm_current,0,0,totalshift); } for(m=0;m<VE_BANDS;m++){ char buf[80]; sprintf(buf,"delR%d",m); for(l=0;l<last;l++)marker[l*ve->searchstep]=ve->filter[m+VE_BANDS].markers[l]*.1; _analysis_output_always(buf,seq,marker,v->pcm_current,0,0,totalshift); } for(l=0;l<last;l++)marker[l*ve->searchstep]=ve->mark[l]*.4; _analysis_output_always("mark",seq,marker,v->pcm_current,0,0,totalshift); seq++; }#endif ve->curmark=j; if(j>=testW)return(1); return(0); } } j+=ve->searchstep; } } return(-1);}int _ve_envelope_mark(vorbis_dsp_state *v){ envelope_lookup *ve=((private_state *)(v->backend_state))->ve; vorbis_info *vi=v->vi; codec_setup_info *ci=vi->codec_setup; long centerW=v->centerW; long beginW=centerW-ci->blocksizes[v->W]/4; long endW=centerW+ci->blocksizes[v->W]/4; if(v->W){ beginW-=ci->blocksizes[v->lW]/4; endW+=ci->blocksizes[v->nW]/4; }else{ beginW-=ci->blocksizes[0]/4; endW+=ci->blocksizes[0]/4; } if(ve->curmark>=beginW && ve->curmark<endW)return(1); { long first=beginW/ve->searchstep; long last=endW/ve->searchstep; long i; for(i=first;i<last;i++) if(ve->mark[i])return(1); } return(0);}void _ve_envelope_shift(envelope_lookup *e,long shift){ int smallsize=e->current/e->searchstep+VE_POST; /* adjust for placing marks ahead of ve->current */ int smallshift=shift/e->searchstep; memmove(e->mark,e->mark+smallshift,(smallsize-smallshift)*sizeof(*e->mark));#if 0 for(i=0;i<VE_BANDS*e->ch;i++) memmove(e->filter[i].markers, e->filter[i].markers+smallshift, (1024-smallshift)*sizeof(*(*e->filter).markers)); totalshift+=shift;#endif e->current-=shift; if(e->curmark>=0) e->curmark-=shift; e->cursor-=shift;}vendor/vorbis/lib/envelope.hadded
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 * * by the Xiph.Org Foundation https://xiph.org/ * * * ******************************************************************** function: PCM data envelope analysis and manipulation ********************************************************************/#ifndef _V_ENVELOPE_#define _V_ENVELOPE_#include "mdct.h"#define VE_PRE 16#define VE_WIN 4#define VE_POST 2#define VE_AMP (VE_PRE+VE_POST-1)#define VE_BANDS 7#define VE_NEARDC 15#define VE_MINSTRETCH 2 /* a bit less than short block */#define VE_MAXSTRETCH 12 /* one-third full block */typedef struct { float ampbuf[VE_AMP]; int ampptr; float nearDC[VE_NEARDC]; float nearDC_acc; float nearDC_partialacc; int nearptr;} envelope_filter_state;typedef struct { int begin; int end; float *window; float total;} envelope_band;typedef struct { int ch; int winlength; int searchstep; float minenergy; mdct_lookup mdct; float *mdct_win; envelope_band band[VE_BANDS]; envelope_filter_state *filter; int stretch; int *mark; long storage; long current; long curmark; long cursor;} envelope_lookup;extern void _ve_envelope_init(envelope_lookup *e,vorbis_info *vi);extern void _ve_envelope_clear(envelope_lookup *e);extern long _ve_envelope_search(vorbis_dsp_state *v);extern void _ve_envelope_shift(envelope_lookup *e,long shift);extern int _ve_envelope_mark(vorbis_dsp_state *v);#endifvendor/vorbis/lib/floor0.cadded
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2015 * * by the Xiph.Org Foundation https://xiph.org/ * * * ******************************************************************** function: floor backend 0 implementation ********************************************************************/#include <stdlib.h>#include <string.h>#include <math.h>#include <ogg/ogg.h>#include "vorbis/codec.h"#include "codec_internal.h"#include "registry.h"#include "lpc.h"#include "lsp.h"#include "codebook.h"#include "scales.h"#include "misc.h"#include "os.h"#include "misc.h"#include <stdio.h>typedef struct { int ln; int m; int **linearmap; int n[2]; vorbis_info_floor0 *vi; long bits; long frames;} vorbis_look_floor0;/***********************************************/static void floor0_free_info(vorbis_info_floor *i){ vorbis_info_floor0 *info=(vorbis_info_floor0 *)i; if(info){ memset(info,0,sizeof(*info)); _ogg_free(info); }}static void floor0_free_look(vorbis_look_floor *i){ vorbis_look_floor0 *look=(vorbis_look_floor0 *)i; if(look){ if(look->linearmap){ if(look->linearmap[0])_ogg_free(look->linearmap[0]); if(look->linearmap[1])_ogg_free(look->linearmap[1]); _ogg_free(look->linearmap); } memset(look,0,sizeof(*look)); _ogg_free(look); }}static vorbis_info_floor *floor0_unpack (vorbis_info *vi,oggpack_buffer *opb){ codec_setup_info *ci=vi->codec_setup; int j; vorbis_info_floor0 *info=_ogg_malloc(sizeof(*info)); info->order=oggpack_read(opb,8); info->rate=oggpack_read(opb,16); info->barkmap=oggpack_read(opb,16); info->ampbits=oggpack_read(opb,6); info->ampdB=oggpack_read(opb,8); info->numbooks=oggpack_read(opb,4)+1; if(info->order<1)goto err_out; if(info->rate<1)goto err_out; if(info->barkmap<1)goto err_out; if(info->numbooks<1)goto err_out; for(j=0;j<info->numbooks;j++){ info->books[j]=oggpack_read(opb,8); if(info->books[j]<0 || info->books[j]>=ci->books)goto err_out; if(ci->book_param[info->books[j]]->maptype==0)goto err_out; if(ci->book_param[info->books[j]]->dim<1)goto err_out; } return(info); err_out: floor0_free_info(info); return(NULL);}/* initialize Bark scale and normalization lookups. We could do this with static tables, but Vorbis allows a number of possible combinations, so it's best to do it computationally. The below is authoritative in terms of defining scale mapping. Note that the scale depends on the sampling rate as well as the linear block and mapping sizes */static void floor0_map_lazy_init(vorbis_block *vb, vorbis_info_floor *infoX, vorbis_look_floor0 *look){ if(!look->linearmap[vb->W]){ vorbis_dsp_state *vd=vb->vd; vorbis_info *vi=vd->vi; codec_setup_info *ci=vi->codec_setup; vorbis_info_floor0 *info=(vorbis_info_floor0 *)infoX; int W=vb->W; int n=ci->blocksizes[W]/2,j; /* we choose a scaling constant so that: floor(bark(rate/2-1)*C)=mapped-1 floor(bark(rate/2)*C)=mapped */ float scale=look->ln/toBARK(info->rate/2.f); /* the mapping from a linear scale to a smaller bark scale is straightforward. We do *not* make sure that the linear mapping does not skip bark-scale bins; the decoder simply skips them and the encoder may do what it wishes in filling them. They're necessary in some mapping combinations to keep the scale spacing accurate */ look->linearmap[W]=_ogg_malloc((n+1)*sizeof(**look->linearmap)); for(j=0;j<n;j++){ int val=floor( toBARK((info->rate/2.f)/n*j) *scale); /* bark numbers represent band edges */ if(val>=look->ln)val=look->ln-1; /* guard against the approximation */ look->linearmap[W][j]=val; } look->linearmap[W][j]=-1; look->n[W]=n; }}static vorbis_look_floor *floor0_look(vorbis_dsp_state *vd, vorbis_info_floor *i){ vorbis_info_floor0 *info=(vorbis_info_floor0 *)i; vorbis_look_floor0 *look=_ogg_calloc(1,sizeof(*look)); (void)vd; look->m=info->order; look->ln=info->barkmap; look->vi=info; look->linearmap=_ogg_calloc(2,sizeof(*look->linearmap)); return look;}static void *floor0_inverse1(vorbis_block *vb,vorbis_look_floor *i){ vorbis_look_floor0 *look=(vorbis_look_floor0 *)i; vorbis_info_floor0 *info=look->vi; int j,k; int ampraw=oggpack_read(&vb->opb,info->ampbits); if(ampraw>0){ /* also handles the -1 out of data case */ long maxval=(1<<info->ampbits)-1; float amp=(float)ampraw/maxval*info->ampdB; int booknum=oggpack_read(&vb->opb,ov_ilog(info->numbooks)); if(booknum!=-1 && booknum<info->numbooks){ /* be paranoid */ codec_setup_info *ci=vb->vd->vi->codec_setup; codebook *b=ci->fullbooks+info->books[booknum]; float last=0.f; /* the additional b->dim is a guard against any possible stack smash; b->dim is provably more than we can overflow the vector */ float *lsp=_vorbis_block_alloc(vb,sizeof(*lsp)*(look->m+b->dim+1)); if(vorbis_book_decodev_set(b,lsp,&vb->opb,look->m)==-1)goto eop; for(j=0;j<look->m;){ for(k=0;j<look->m && k<b->dim;k++,j++)lsp[j]+=last; last=lsp[j-1]; } lsp[look->m]=amp; return(lsp); } } eop: return(NULL);}static int floor0_inverse2(vorbis_block *vb,vorbis_look_floor *i, void *memo,float *out){ vorbis_look_floor0 *look=(vorbis_look_floor0 *)i; vorbis_info_floor0 *info=look->vi; floor0_map_lazy_init(vb,info,look); if(memo){ float *lsp=(float *)memo; float amp=lsp[look->m]; /* take the coefficients back to a spectral envelope curve */ vorbis_lsp_to_curve(out, look->linearmap[vb->W], look->n[vb->W], look->ln, lsp,look->m,amp,(float)info->ampdB); return(1); } memset(out,0,sizeof(*out)*look->n[vb->W]); return(0);}/* export hooks */const vorbis_func_floor floor0_exportbundle={ NULL,&floor0_unpack,&floor0_look,&floor0_free_info, &floor0_free_look,&floor0_inverse1,&floor0_inverse2};vendor/vorbis/lib/floor1.cadded
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2015 * * by the Xiph.Org Foundation https://xiph.org/ * * * ******************************************************************** function: floor backend 1 implementation ********************************************************************/#include <stdlib.h>#include <string.h>#include <math.h>#include <ogg/ogg.h>#include "vorbis/codec.h"#include "codec_internal.h"#include "registry.h"#include "codebook.h"#include "misc.h"#include "scales.h"#include <stdio.h>#define floor1_rangedB 140 /* floor 1 fixed at -140dB to 0dB range */typedef struct lsfit_acc{ int x0; int x1; int xa; int ya; int x2a; int y2a; int xya; int an; int xb; int yb; int x2b; int y2b; int xyb; int bn;} lsfit_acc;/***********************************************/static void floor1_free_info(vorbis_info_floor *i){ vorbis_info_floor1 *info=(vorbis_info_floor1 *)i; if(info){ memset(info,0,sizeof(*info)); _ogg_free(info); }}static void floor1_free_look(vorbis_look_floor *i){ vorbis_look_floor1 *look=(vorbis_look_floor1 *)i; if(look){ /*fprintf(stderr,"floor 1 bit usage %f:%f (%f total)\n", (float)look->phrasebits/look->frames, (float)look->postbits/look->frames, (float)(look->postbits+look->phrasebits)/look->frames);*/ memset(look,0,sizeof(*look)); _ogg_free(look); }}static void floor1_pack (vorbis_info_floor *i,oggpack_buffer *opb){ vorbis_info_floor1 *info=(vorbis_info_floor1 *)i; int j,k; int count=0; int rangebits; int maxposit=info->postlist[1]; int maxclass=-1; /* save out partitions */ oggpack_write(opb,info->partitions,5); /* only 0 to 31 legal */ for(j=0;j<info->partitions;j++){ oggpack_write(opb,info->partitionclass[j],4); /* only 0 to 15 legal */ if(maxclass<info->partitionclass[j])maxclass=info->partitionclass[j]; } /* save out partition classes */ for(j=0;j<maxclass+1;j++){ oggpack_write(opb,info->class_dim[j]-1,3); /* 1 to 8 */ oggpack_write(opb,info->class_subs[j],2); /* 0 to 3 */ if(info->class_subs[j])oggpack_write(opb,info->class_book[j],8); for(k=0;k<(1<<info->class_subs[j]);k++) oggpack_write(opb,info->class_subbook[j][k]+1,8); } /* save out the post list */ oggpack_write(opb,info->mult-1,2); /* only 1,2,3,4 legal now */ /* maxposit cannot legally be less than 1; this is encode-side, we can assume our setup is OK */ oggpack_write(opb,ov_ilog(maxposit-1),4); rangebits=ov_ilog(maxposit-1); for(j=0,k=0;j<info->partitions;j++){ count+=info->class_dim[info->partitionclass[j]]; for(;k<count;k++) oggpack_write(opb,info->postlist[k+2],rangebits); }}static int icomp(const void *a,const void *b){ return(**(int **)a-**(int **)b);}static vorbis_info_floor *floor1_unpack (vorbis_info *vi,oggpack_buffer *opb){ codec_setup_info *ci=vi->codec_setup; int j,k,count=0,maxclass=-1,rangebits; vorbis_info_floor1 *info=_ogg_calloc(1,sizeof(*info)); /* read partitions */ info->partitions=oggpack_read(opb,5); /* only 0 to 31 legal */ for(j=0;j<info->partitions;j++){ info->partitionclass[j]=oggpack_read(opb,4); /* only 0 to 15 legal */ if(info->partitionclass[j]<0)goto err_out; if(maxclass<info->partitionclass[j])maxclass=info->partitionclass[j]; } /* read partition classes */ for(j=0;j<maxclass+1;j++){ info->class_dim[j]=oggpack_read(opb,3)+1; /* 1 to 8 */ info->class_subs[j]=oggpack_read(opb,2); /* 0,1,2,3 bits */ if(info->class_subs[j]<0) goto err_out; if(info->class_subs[j])info->class_book[j]=oggpack_read(opb,8); if(info->class_book[j]<0 || info->class_book[j]>=ci->books) goto err_out; for(k=0;k<(1<<info->class_subs[j]);k++){ info->class_subbook[j][k]=oggpack_read(opb,8)-1; if(info->class_subbook[j][k]<-1 || info->class_subbook[j][k]>=ci->books) goto err_out; } } /* read the post list */ info->mult=oggpack_read(opb,2)+1; /* only 1,2,3,4 legal now */ rangebits=oggpack_read(opb,4); if(rangebits<0)goto err_out; for(j=0,k=0;j<info->partitions;j++){ count+=info->class_dim[info->partitionclass[j]]; if(count>VIF_POSIT) goto err_out; for(;k<count;k++){ int t=info->postlist[k+2]=oggpack_read(opb,rangebits); if(t<0 || t>=(1<<rangebits)) goto err_out; } } info->postlist[0]=0; info->postlist[1]=1<<rangebits; /* don't allow repeated values in post list as they'd result in zero-length segments */ { int *sortpointer[VIF_POSIT+2]; for(j=0;j<count+2;j++)sortpointer[j]=info->postlist+j; qsort(sortpointer,count+2,sizeof(*sortpointer),icomp); for(j=1;j<count+2;j++) if(*sortpointer[j-1]==*sortpointer[j])goto err_out; } return(info); err_out: floor1_free_info(info); return(NULL);}static vorbis_look_floor *floor1_look(vorbis_dsp_state *vd, vorbis_info_floor *in){ int *sortpointer[VIF_POSIT+2]; vorbis_info_floor1 *info=(vorbis_info_floor1 *)in; vorbis_look_floor1 *look=_ogg_calloc(1,sizeof(*look)); int i,j,n=0; (void)vd; look->vi=info; look->n=info->postlist[1]; /* we drop each position value in-between already decoded values, and use linear interpolation to predict each new value past the edges. The positions are read in the order of the position list... we precompute the bounding positions in the lookup. Of course, the neighbors can change (if a position is declined), but this is an initial mapping */ for(i=0;i<info->partitions;i++)n+=info->class_dim[info->partitionclass[i]]; n+=2; look->posts=n; /* also store a sorted position index */ for(i=0;i<n;i++)sortpointer[i]=info->postlist+i; qsort(sortpointer,n,sizeof(*sortpointer),icomp); /* points from sort order back to range number */ for(i=0;i<n;i++)look->forward_index[i]=sortpointer[i]-info->postlist; /* points from range order to sorted position */ for(i=0;i<n;i++)look->reverse_index[look->forward_index[i]]=i; /* we actually need the post values too */ for(i=0;i<n;i++)look->sorted_index[i]=info->postlist[look->forward_index[i]]; /* quantize values to multiplier spec */ switch(info->mult){ case 1: /* 1024 -> 256 */ look->quant_q=256; break; case 2: /* 1024 -> 128 */ look->quant_q=128; break; case 3: /* 1024 -> 86 */ look->quant_q=86; break; case 4: /* 1024 -> 64 */ look->quant_q=64; break; } /* discover our neighbors for decode where we don't use fit flags (that would push the neighbors outward) */ for(i=0;i<n-2;i++){ int lo=0; int hi=1; int lx=0; int hx=look->n; int currentx=info->postlist[i+2]; for(j=0;j<i+2;j++){ int x=info->postlist[j]; if(x>lx && x<currentx){ lo=j; lx=x; } if(x<hx && x>currentx){ hi=j; hx=x; } } look->loneighbor[i]=lo; look->hineighbor[i]=hi; } return(look);}static int render_point(int x0,int x1,int y0,int y1,int x){ y0&=0x7fff; /* mask off flag */ y1&=0x7fff; { int dy=y1-y0; int adx=x1-x0; int ady=abs(dy); int err=ady*(x-x0); int off=err/adx; if(dy<0)return(y0-off); return(y0+off); }}static int vorbis_dBquant(const float *x){ int i= *x*7.3142857f+1023.5f; if(i>1023)return(1023); if(i<0)return(0); return i;}static const float FLOOR1_fromdB_LOOKUP[256]={ 1.0649863e-07F, 1.1341951e-07F, 1.2079015e-07F, 1.2863978e-07F, 1.3699951e-07F, 1.4590251e-07F, 1.5538408e-07F, 1.6548181e-07F, 1.7623575e-07F, 1.8768855e-07F, 1.9988561e-07F, 2.128753e-07F, 2.2670913e-07F, 2.4144197e-07F, 2.5713223e-07F, 2.7384213e-07F, 2.9163793e-07F, 3.1059021e-07F, 3.3077411e-07F, 3.5226968e-07F, 3.7516214e-07F, 3.9954229e-07F, 4.2550680e-07F, 4.5315863e-07F, 4.8260743e-07F, 5.1396998e-07F, 5.4737065e-07F, 5.8294187e-07F, 6.2082472e-07F, 6.6116941e-07F, 7.0413592e-07F, 7.4989464e-07F, 7.9862701e-07F, 8.5052630e-07F, 9.0579828e-07F, 9.6466216e-07F, 1.0273513e-06F, 1.0941144e-06F, 1.1652161e-06F, 1.2409384e-06F, 1.3215816e-06F, 1.4074654e-06F, 1.4989305e-06F, 1.5963394e-06F, 1.7000785e-06F, 1.8105592e-06F, 1.9282195e-06F, 2.0535261e-06F, 2.1869758e-06F, 2.3290978e-06F, 2.4804557e-06F, 2.6416497e-06F, 2.8133190e-06F, 2.9961443e-06F, 3.1908506e-06F, 3.3982101e-06F, 3.6190449e-06F, 3.8542308e-06F, 4.1047004e-06F, 4.3714470e-06F, 4.6555282e-06F, 4.9580707e-06F, 5.2802740e-06F, 5.6234160e-06F, 5.9888572e-06F, 6.3780469e-06F, 6.7925283e-06F, 7.2339451e-06F, 7.7040476e-06F, 8.2047000e-06F, 8.7378876e-06F, 9.3057248e-06F, 9.9104632e-06F, 1.0554501e-05F, 1.1240392e-05F, 1.1970856e-05F, 1.2748789e-05F, 1.3577278e-05F, 1.4459606e-05F, 1.5399272e-05F, 1.6400004e-05F, 1.7465768e-05F, 1.8600792e-05F, 1.9809576e-05F, 2.1096914e-05F, 2.2467911e-05F, 2.3928002e-05F, 2.5482978e-05F, 2.7139006e-05F, 2.8902651e-05F, 3.0780908e-05F, 3.2781225e-05F, 3.4911534e-05F, 3.7180282e-05F, 3.9596466e-05F, 4.2169667e-05F, 4.4910090e-05F, 4.7828601e-05F, 5.0936773e-05F, 5.4246931e-05F, 5.7772202e-05F, 6.1526565e-05F, 6.5524908e-05F, 6.9783085e-05F, 7.4317983e-05F, 7.9147585e-05F, 8.4291040e-05F, 8.9768747e-05F, 9.5602426e-05F, 0.00010181521F, 0.00010843174F, 0.00011547824F, 0.00012298267F, 0.00013097477F, 0.00013948625F, 0.00014855085F, 0.00015820453F, 0.00016848555F, 0.00017943469F, 0.00019109536F, 0.00020351382F, 0.00021673929F, 0.00023082423F, 0.00024582449F, 0.00026179955F, 0.00027881276F, 0.00029693158F, 0.00031622787F, 0.00033677814F, 0.00035866388F, 0.00038197188F, 0.00040679456F, 0.00043323036F, 0.00046138411F, 0.00049136745F, 0.00052329927F, 0.00055730621F, 0.00059352311F, 0.00063209358F, 0.00067317058F, 0.00071691700F, 0.00076350630F, 0.00081312324F, 0.00086596457F, 0.00092223983F, 0.00098217216F, 0.0010459992F, 0.0011139742F, 0.0011863665F, 0.0012634633F, 0.0013455702F, 0.0014330129F, 0.0015261382F, 0.0016253153F, 0.0017309374F, 0.0018434235F, 0.0019632195F, 0.0020908006F, 0.0022266726F, 0.0023713743F, 0.0025254795F, 0.0026895994F, 0.0028643847F, 0.0030505286F, 0.0032487691F, 0.0034598925F, 0.0036847358F, 0.0039241906F, 0.0041792066F, 0.0044507950F, 0.0047400328F, 0.0050480668F, 0.0053761186F, 0.0057254891F, 0.0060975636F, 0.0064938176F, 0.0069158225F, 0.0073652516F, 0.0078438871F, 0.0083536271F, 0.0088964928F, 0.009474637F, 0.010090352F, 0.010746080F, 0.011444421F, 0.012188144F, 0.012980198F, 0.013823725F, 0.014722068F, 0.015678791F, 0.016697687F, 0.017782797F, 0.018938423F, 0.020169149F, 0.021479854F, 0.022875735F, 0.024362330F, 0.025945531F, 0.027631618F, 0.029427276F, 0.031339626F, 0.033376252F, 0.035545228F, 0.037855157F, 0.040315199F, 0.042935108F, 0.045725273F, 0.048696758F, 0.051861348F, 0.055231591F, 0.058820850F, 0.062643361F, 0.066714279F, 0.071049749F, 0.075666962F, 0.080584227F, 0.085821044F, 0.091398179F, 0.097337747F, 0.10366330F, 0.11039993F, 0.11757434F, 0.12521498F, 0.13335215F, 0.14201813F, 0.15124727F, 0.16107617F, 0.17154380F, 0.18269168F, 0.19456402F, 0.20720788F, 0.22067342F, 0.23501402F, 0.25028656F, 0.26655159F, 0.28387361F, 0.30232132F, 0.32196786F, 0.34289114F, 0.36517414F, 0.38890521F, 0.41417847F, 0.44109412F, 0.46975890F, 0.50028648F, 0.53279791F, 0.56742212F, 0.60429640F, 0.64356699F, 0.68538959F, 0.72993007F, 0.77736504F, 0.82788260F, 0.88168307F, 0.9389798F, 1.F,};static void render_line(int n, int x0,int x1,int y0,int y1,float *d){ int dy=y1-y0; int adx=x1-x0; int ady=abs(dy); int base=dy/adx; int sy=(dy<0?base-1:base+1); int x=x0; int y=y0; int err=0; ady-=abs(base*adx); if(n>x1)n=x1; if(x<n) d[x]*=FLOOR1_fromdB_LOOKUP[y]; while(++x<n){ err=err+ady; if(err>=adx){ err-=adx; y+=sy; }else{ y+=base; } d[x]*=FLOOR1_fromdB_LOOKUP[y]; }}static void render_line0(int n, int x0,int x1,int y0,int y1,int *d){ int dy=y1-y0; int adx=x1-x0; int ady=abs(dy); int base=dy/adx; int sy=(dy<0?base-1:base+1); int x=x0; int y=y0; int err=0; ady-=abs(base*adx); if(n>x1)n=x1; if(x<n) d[x]=y; while(++x<n){ err=err+ady; if(err>=adx){ err-=adx; y+=sy; }else{ y+=base; } d[x]=y; }}/* the floor has already been filtered to only include relevant sections */static int accumulate_fit(const float *flr,const float *mdct, int x0, int x1,lsfit_acc *a, int n,vorbis_info_floor1 *info){ long i; int xa=0,ya=0,x2a=0,y2a=0,xya=0,na=0, xb=0,yb=0,x2b=0,y2b=0,xyb=0,nb=0; memset(a,0,sizeof(*a)); a->x0=x0; a->x1=x1; if(x1>=n)x1=n-1; for(i=x0;i<=x1;i++){ int quantized=vorbis_dBquant(flr+i); if(quantized){ if(mdct[i]+info->twofitatten>=flr[i]){ xa += i; ya += quantized; x2a += i*i; y2a += quantized*quantized; xya += i*quantized; na++; }else{ xb += i; yb += quantized; x2b += i*i; y2b += quantized*quantized; xyb += i*quantized; nb++; } } } a->xa=xa; a->ya=ya; a->x2a=x2a; a->y2a=y2a; a->xya=xya; a->an=na; a->xb=xb; a->yb=yb; a->x2b=x2b; a->y2b=y2b; a->xyb=xyb; a->bn=nb; return(na);}static int fit_line(lsfit_acc *a,int fits,int *y0,int *y1, vorbis_info_floor1 *info){ double xb=0,yb=0,x2b=0,y2b=0,xyb=0,bn=0; int i; int x0=a[0].x0; int x1=a[fits-1].x1; for(i=0;i<fits;i++){ double weight = (a[i].bn+a[i].an)*info->twofitweight/(a[i].an+1)+1.; xb+=a[i].xb + a[i].xa * weight; yb+=a[i].yb + a[i].ya * weight; x2b+=a[i].x2b + a[i].x2a * weight; y2b+=a[i].y2b + a[i].y2a * weight; xyb+=a[i].xyb + a[i].xya * weight; bn+=a[i].bn + a[i].an * weight; } if(*y0>=0){ xb+= x0; yb+= *y0; x2b+= x0 * x0; y2b+= *y0 * *y0; xyb+= *y0 * x0; bn++; } if(*y1>=0){ xb+= x1; yb+= *y1; x2b+= x1 * x1; y2b+= *y1 * *y1; xyb+= *y1 * x1; bn++; } { double denom=(bn*x2b-xb*xb); if(denom>0.){ double a=(yb*x2b-xyb*xb)/denom; double b=(bn*xyb-xb*yb)/denom; *y0=rint(a+b*x0); *y1=rint(a+b*x1);Showing the first 500 of 1087 diff lines for this file. This diff is INCOMPLETE; read the file or clone the repository for the rest.
vendor/vorbis/lib/highlevel.hadded
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 * * by the Xiph.Org Foundation https://xiph.org/ * * * ******************************************************************** function: highlevel encoder setup struct separated out for vorbisenc clarity ********************************************************************/typedef struct highlevel_byblocktype { double tone_mask_setting; double tone_peaklimit_setting; double noise_bias_setting; double noise_compand_setting;} highlevel_byblocktype;typedef struct highlevel_encode_setup { int set_in_stone; const void *setup; double base_setting; double impulse_noisetune; /* bitrate management below all settable */ float req; int managed; long bitrate_min; long bitrate_av; double bitrate_av_damp; long bitrate_max; long bitrate_reservoir; double bitrate_reservoir_bias; int impulse_block_p; int noise_normalize_p; int coupling_p; double stereo_point_setting; double lowpass_kHz; int lowpass_altered; double ath_floating_dB; double ath_absolute_dB; double amplitude_track_dBpersec; double trigger_setting; highlevel_byblocktype block[4]; /* padding, impulse, transition, long */} highlevel_encode_setup;vendor/vorbis/lib/info.cadded
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2015 * * by the Xiph.Org Foundation https://xiph.org/ * * * ******************************************************************** function: maintain the info structure, info <-> header packets ********************************************************************//* general handling of the header and the vorbis_info structure (and substructures) */#include <stdlib.h>#include <string.h>#include <ogg/ogg.h>#include "vorbis/codec.h"#include "codec_internal.h"#include "codebook.h"#include "registry.h"#include "window.h"#include "psy.h"#include "misc.h"#include "os.h"#define GENERAL_VENDOR_STRING "Xiph.Org libVorbis 1.3.7"#define ENCODE_VENDOR_STRING "Xiph.Org libVorbis I 20200704 (Reducing Environment)"/* helpers */static void _v_writestring(oggpack_buffer *o,const char *s, int bytes){ while(bytes--){ oggpack_write(o,*s++,8); }}static void _v_readstring(oggpack_buffer *o,char *buf,int bytes){ while(bytes--){ *buf++=oggpack_read(o,8); }}static int _v_toupper(int c) { return (c >= 'a' && c <= 'z') ? (c & ~('a' - 'A')) : c;}void vorbis_comment_init(vorbis_comment *vc){ memset(vc,0,sizeof(*vc));}void vorbis_comment_add(vorbis_comment *vc,const char *comment){ vc->user_comments=_ogg_realloc(vc->user_comments, (vc->comments+2)*sizeof(*vc->user_comments)); vc->comment_lengths=_ogg_realloc(vc->comment_lengths, (vc->comments+2)*sizeof(*vc->comment_lengths)); vc->comment_lengths[vc->comments]=strlen(comment); vc->user_comments[vc->comments]=_ogg_malloc(vc->comment_lengths[vc->comments]+1); strcpy(vc->user_comments[vc->comments], comment); vc->comments++; vc->user_comments[vc->comments]=NULL;}void vorbis_comment_add_tag(vorbis_comment *vc, const char *tag, const char *contents){ /* Length for key and value +2 for = and \0 */ char *comment=_ogg_malloc(strlen(tag)+strlen(contents)+2); strcpy(comment, tag); strcat(comment, "="); strcat(comment, contents); vorbis_comment_add(vc, comment); _ogg_free(comment);}/* This is more or less the same as strncasecmp - but that doesn't exist * everywhere, and this is a fairly trivial function, so we include it */static int tagcompare(const char *s1, const char *s2, int n){ int c=0; while(c < n){ if(_v_toupper(s1[c]) != _v_toupper(s2[c])) return !0; c++; } return 0;}char *vorbis_comment_query(vorbis_comment *vc, const char *tag, int count){ long i; int found = 0; int taglen = strlen(tag)+1; /* +1 for the = we append */ char *fulltag = _ogg_malloc(taglen+1); strcpy(fulltag, tag); strcat(fulltag, "="); for(i=0;i<vc->comments;i++){ if(!tagcompare(vc->user_comments[i], fulltag, taglen)){ if(count == found) { /* We return a pointer to the data, not a copy */ _ogg_free(fulltag); return vc->user_comments[i] + taglen; } else { found++; } } } _ogg_free(fulltag); return NULL; /* didn't find anything */}int vorbis_comment_query_count(vorbis_comment *vc, const char *tag){ int i,count=0; int taglen = strlen(tag)+1; /* +1 for the = we append */ char *fulltag = _ogg_malloc(taglen+1); strcpy(fulltag,tag); strcat(fulltag, "="); for(i=0;i<vc->comments;i++){ if(!tagcompare(vc->user_comments[i], fulltag, taglen)) count++; } _ogg_free(fulltag); return count;}void vorbis_comment_clear(vorbis_comment *vc){ if(vc){ long i; if(vc->user_comments){ for(i=0;i<vc->comments;i++) if(vc->user_comments[i])_ogg_free(vc->user_comments[i]); _ogg_free(vc->user_comments); } if(vc->comment_lengths)_ogg_free(vc->comment_lengths); if(vc->vendor)_ogg_free(vc->vendor); memset(vc,0,sizeof(*vc)); }}/* blocksize 0 is guaranteed to be short, 1 is guaranteed to be long. They may be equal, but short will never ge greater than long */int vorbis_info_blocksize(vorbis_info *vi,int zo){ codec_setup_info *ci = vi->codec_setup; return ci ? ci->blocksizes[zo] : -1;}/* used by synthesis, which has a full, alloced vi */void vorbis_info_init(vorbis_info *vi){ memset(vi,0,sizeof(*vi)); vi->codec_setup=_ogg_calloc(1,sizeof(codec_setup_info));}void vorbis_info_clear(vorbis_info *vi){ codec_setup_info *ci=vi->codec_setup; int i; if(ci){ for(i=0;i<ci->modes;i++) if(ci->mode_param[i])_ogg_free(ci->mode_param[i]); for(i=0;i<ci->maps;i++) /* unpack does the range checking */ if(ci->map_param[i]) /* this may be cleaning up an aborted unpack, in which case the below type cannot be trusted */ _mapping_P[ci->map_type[i]]->free_info(ci->map_param[i]); for(i=0;i<ci->floors;i++) /* unpack does the range checking */ if(ci->floor_param[i]) /* this may be cleaning up an aborted unpack, in which case the below type cannot be trusted */ _floor_P[ci->floor_type[i]]->free_info(ci->floor_param[i]); for(i=0;i<ci->residues;i++) /* unpack does the range checking */ if(ci->residue_param[i]) /* this may be cleaning up an aborted unpack, in which case the below type cannot be trusted */ _residue_P[ci->residue_type[i]]->free_info(ci->residue_param[i]); for(i=0;i<ci->books;i++){ if(ci->book_param[i]){ /* knows if the book was not alloced */ vorbis_staticbook_destroy(ci->book_param[i]); } if(ci->fullbooks) vorbis_book_clear(ci->fullbooks+i); } if(ci->fullbooks) _ogg_free(ci->fullbooks); for(i=0;i<ci->psys;i++) _vi_psy_free(ci->psy_param[i]); _ogg_free(ci); } memset(vi,0,sizeof(*vi));}/* Header packing/unpacking ********************************************/static int _vorbis_unpack_info(vorbis_info *vi,oggpack_buffer *opb){ codec_setup_info *ci=vi->codec_setup; int bs; if(!ci)return(OV_EFAULT); vi->version=oggpack_read(opb,32); if(vi->version!=0)return(OV_EVERSION); vi->channels=oggpack_read(opb,8); vi->rate=oggpack_read(opb,32); vi->bitrate_upper=(ogg_int32_t)oggpack_read(opb,32); vi->bitrate_nominal=(ogg_int32_t)oggpack_read(opb,32); vi->bitrate_lower=(ogg_int32_t)oggpack_read(opb,32); bs = oggpack_read(opb,4); if(bs<0)goto err_out; ci->blocksizes[0]=1<<bs; bs = oggpack_read(opb,4); if(bs<0)goto err_out; ci->blocksizes[1]=1<<bs; if(vi->rate<1)goto err_out; if(vi->channels<1)goto err_out; if(ci->blocksizes[0]<64)goto err_out; if(ci->blocksizes[1]<ci->blocksizes[0])goto err_out; if(ci->blocksizes[1]>8192)goto err_out; if(oggpack_read(opb,1)!=1)goto err_out; /* EOP check */ return(0); err_out: vorbis_info_clear(vi); return(OV_EBADHEADER);}static int _vorbis_unpack_comment(vorbis_comment *vc,oggpack_buffer *opb){ int i; int vendorlen=oggpack_read(opb,32); if(vendorlen<0)goto err_out; if(vendorlen>opb->storage-8)goto err_out; vc->vendor=_ogg_calloc(vendorlen+1,1); _v_readstring(opb,vc->vendor,vendorlen); i=oggpack_read(opb,32); if(i<0)goto err_out; if(i>((opb->storage-oggpack_bytes(opb))>>2))goto err_out; vc->comments=i; vc->user_comments=_ogg_calloc(vc->comments+1,sizeof(*vc->user_comments)); vc->comment_lengths=_ogg_calloc(vc->comments+1, sizeof(*vc->comment_lengths)); for(i=0;i<vc->comments;i++){ int len=oggpack_read(opb,32); if(len<0)goto err_out; if(len>opb->storage-oggpack_bytes(opb))goto err_out; vc->comment_lengths[i]=len; vc->user_comments[i]=_ogg_calloc(len+1,1); _v_readstring(opb,vc->user_comments[i],len); } if(oggpack_read(opb,1)!=1)goto err_out; /* EOP check */ return(0); err_out: vorbis_comment_clear(vc); return(OV_EBADHEADER);}/* all of the real encoding details are here. The modes, books, everything */static int _vorbis_unpack_books(vorbis_info *vi,oggpack_buffer *opb){ codec_setup_info *ci=vi->codec_setup; int i; /* codebooks */ ci->books=oggpack_read(opb,8)+1; if(ci->books<=0)goto err_out; for(i=0;i<ci->books;i++){ ci->book_param[i]=vorbis_staticbook_unpack(opb); if(!ci->book_param[i])goto err_out; } /* time backend settings; hooks are unused */ { int times=oggpack_read(opb,6)+1; if(times<=0)goto err_out; for(i=0;i<times;i++){ int test=oggpack_read(opb,16); if(test<0 || test>=VI_TIMEB)goto err_out; } } /* floor backend settings */ ci->floors=oggpack_read(opb,6)+1; if(ci->floors<=0)goto err_out; for(i=0;i<ci->floors;i++){ ci->floor_type[i]=oggpack_read(opb,16); if(ci->floor_type[i]<0 || ci->floor_type[i]>=VI_FLOORB)goto err_out; ci->floor_param[i]=_floor_P[ci->floor_type[i]]->unpack(vi,opb); if(!ci->floor_param[i])goto err_out; } /* residue backend settings */ ci->residues=oggpack_read(opb,6)+1; if(ci->residues<=0)goto err_out; for(i=0;i<ci->residues;i++){ ci->residue_type[i]=oggpack_read(opb,16); if(ci->residue_type[i]<0 || ci->residue_type[i]>=VI_RESB)goto err_out; ci->residue_param[i]=_residue_P[ci->residue_type[i]]->unpack(vi,opb); if(!ci->residue_param[i])goto err_out; } /* map backend settings */ ci->maps=oggpack_read(opb,6)+1; if(ci->maps<=0)goto err_out; for(i=0;i<ci->maps;i++){ ci->map_type[i]=oggpack_read(opb,16); if(ci->map_type[i]<0 || ci->map_type[i]>=VI_MAPB)goto err_out; ci->map_param[i]=_mapping_P[ci->map_type[i]]->unpack(vi,opb); if(!ci->map_param[i])goto err_out; } /* mode settings */ ci->modes=oggpack_read(opb,6)+1; if(ci->modes<=0)goto err_out; for(i=0;i<ci->modes;i++){ ci->mode_param[i]=_ogg_calloc(1,sizeof(*ci->mode_param[i])); ci->mode_param[i]->blockflag=oggpack_read(opb,1); ci->mode_param[i]->windowtype=oggpack_read(opb,16); ci->mode_param[i]->transformtype=oggpack_read(opb,16); ci->mode_param[i]->mapping=oggpack_read(opb,8); if(ci->mode_param[i]->windowtype>=VI_WINDOWB)goto err_out; if(ci->mode_param[i]->transformtype>=VI_WINDOWB)goto err_out; if(ci->mode_param[i]->mapping>=ci->maps)goto err_out; if(ci->mode_param[i]->mapping<0)goto err_out; } if(oggpack_read(opb,1)!=1)goto err_out; /* top level EOP check */ return(0); err_out: vorbis_info_clear(vi); return(OV_EBADHEADER);}/* Is this packet a vorbis ID header? */int vorbis_synthesis_idheader(ogg_packet *op){ oggpack_buffer opb; char buffer[6]; if(op){ oggpack_readinit(&opb,op->packet,op->bytes); if(!op->b_o_s) return(0); /* Not the initial packet */ if(oggpack_read(&opb,8) != 1) return 0; /* not an ID header */ memset(buffer,0,6); _v_readstring(&opb,buffer,6); if(memcmp(buffer,"vorbis",6)) return 0; /* not vorbis */ return 1; } return 0;}/* The Vorbis header is in three packets; the initial small packet in the first page that identifies basic parameters, a second packet with bitstream comments and a third packet that holds the codebook. */int vorbis_synthesis_headerin(vorbis_info *vi,vorbis_comment *vc,ogg_packet *op){ oggpack_buffer opb; if(op){ oggpack_readinit(&opb,op->packet,op->bytes); /* Which of the three types of header is this? */ /* Also verify header-ness, vorbis */ { char buffer[6]; int packtype=oggpack_read(&opb,8); memset(buffer,0,6); _v_readstring(&opb,buffer,6); if(memcmp(buffer,"vorbis",6)){ /* not a vorbis header */ return(OV_ENOTVORBIS); } switch(packtype){ case 0x01: /* least significant *bit* is read first */ if(!op->b_o_s){ /* Not the initial packet */ return(OV_EBADHEADER); } if(vi->rate!=0){ /* previously initialized info header */ return(OV_EBADHEADER); } return(_vorbis_unpack_info(vi,&opb)); case 0x03: /* least significant *bit* is read first */ if(vi->rate==0){ /* um... we didn't get the initial header */ return(OV_EBADHEADER); } if(vc->vendor!=NULL){ /* previously initialized comment header */ return(OV_EBADHEADER); } return(_vorbis_unpack_comment(vc,&opb)); case 0x05: /* least significant *bit* is read first */ if(vi->rate==0 || vc->vendor==NULL){ /* um... we didn;t get the initial header or comments yet */ return(OV_EBADHEADER); } if(vi->codec_setup==NULL){ /* improperly initialized vorbis_info */ return(OV_EFAULT); } if(((codec_setup_info *)vi->codec_setup)->books>0){ /* previously initialized setup header */ return(OV_EBADHEADER); } return(_vorbis_unpack_books(vi,&opb)); default: /* Not a valid vorbis header type */ return(OV_EBADHEADER); break; } } } return(OV_EBADHEADER);}/* pack side **********************************************************/static int _vorbis_pack_info(oggpack_buffer *opb,vorbis_info *vi){ codec_setup_info *ci=vi->codec_setup; if(!ci|| ci->blocksizes[0]<64|| ci->blocksizes[1]<ci->blocksizes[0]){ return(OV_EFAULT); } /* preamble */ oggpack_write(opb,0x01,8); _v_writestring(opb,"vorbis", 6); /* basic information about the stream */ oggpack_write(opb,0x00,32); oggpack_write(opb,vi->channels,8); oggpack_write(opb,vi->rate,32); oggpack_write(opb,vi->bitrate_upper,32); oggpack_write(opb,vi->bitrate_nominal,32); oggpack_write(opb,vi->bitrate_lower,32); oggpack_write(opb,ov_ilog(ci->blocksizes[0]-1),4); oggpack_write(opb,ov_ilog(ci->blocksizes[1]-1),4); oggpack_write(opb,1,1); return(0);}static int _vorbis_pack_comment(oggpack_buffer *opb,vorbis_comment *vc){ int bytes = strlen(ENCODE_VENDOR_STRING); /* preamble */ oggpack_write(opb,0x03,8); _v_writestring(opb,"vorbis", 6); /* vendor */ oggpack_write(opb,bytes,32); _v_writestring(opb,ENCODE_VENDOR_STRING, bytes); /* comments */ oggpack_write(opb,vc->comments,32); if(vc->comments){ int i; for(i=0;i<vc->comments;i++){ if(vc->user_comments[i]){ oggpack_write(opb,vc->comment_lengths[i],32); _v_writestring(opb,vc->user_comments[i], vc->comment_lengths[i]); }else{Showing the first 500 of 688 diff lines for this file. This diff is INCOMPLETE; read the file or clone the repository for the rest.
vendor/vorbis/lib/lookup.cadded
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 * * by the Xiph.Org Foundation https://xiph.org/ * * * ******************************************************************** function: lookup based functions ********************************************************************/#include <math.h>#include "lookup.h"#include "lookup_data.h"#include "os.h"#include "misc.h"#ifdef FLOAT_LOOKUP/* interpolated lookup based cos function, domain 0 to PI only */float vorbis_coslook(float a){ double d=a*(.31830989*(float)COS_LOOKUP_SZ); int i=vorbis_ftoi(d-.5); return COS_LOOKUP[i]+ (d-i)*(COS_LOOKUP[i+1]-COS_LOOKUP[i]);}/* interpolated 1./sqrt(p) where .5 <= p < 1. */float vorbis_invsqlook(float a){ double d=a*(2.f*(float)INVSQ_LOOKUP_SZ)-(float)INVSQ_LOOKUP_SZ; int i=vorbis_ftoi(d-.5f); return INVSQ_LOOKUP[i]+ (d-i)*(INVSQ_LOOKUP[i+1]-INVSQ_LOOKUP[i]);}/* interpolated 1./sqrt(p) where .5 <= p < 1. */float vorbis_invsq2explook(int a){ return INVSQ2EXP_LOOKUP[a-INVSQ2EXP_LOOKUP_MIN];}#include <stdio.h>/* interpolated lookup based fromdB function, domain -140dB to 0dB only */float vorbis_fromdBlook(float a){ int i=vorbis_ftoi(a*((float)(-(1<<FROMdB2_SHIFT)))-.5f); return (i<0)?1.f: ((i>=(FROMdB_LOOKUP_SZ<<FROMdB_SHIFT))?0.f: FROMdB_LOOKUP[i>>FROMdB_SHIFT]*FROMdB2_LOOKUP[i&FROMdB2_MASK]);}#endif#ifdef INT_LOOKUP/* interpolated 1./sqrt(p) where .5 <= a < 1. (.100000... to .111111...) in 16.16 format returns in m.8 format */long vorbis_invsqlook_i(long a,long e){ long i=(a&0x7fff)>>(INVSQ_LOOKUP_I_SHIFT-1); long d=(a&INVSQ_LOOKUP_I_MASK)<<(16-INVSQ_LOOKUP_I_SHIFT); /* 0.16 */ long val=INVSQ_LOOKUP_I[i]- /* 1.16 */ (((INVSQ_LOOKUP_I[i]-INVSQ_LOOKUP_I[i+1])* /* 0.16 */ d)>>16); /* result 1.16 */ e+=32; if(e&1)val=(val*5792)>>13; /* multiply val by 1/sqrt(2) */ e=(e>>1)-8; return(val>>e);}/* interpolated lookup based fromdB function, domain -140dB to 0dB only *//* a is in n.12 format */float vorbis_fromdBlook_i(long a){ int i=(-a)>>(12-FROMdB2_SHIFT); return (i<0)?1.f: ((i>=(FROMdB_LOOKUP_SZ<<FROMdB_SHIFT))?0.f: FROMdB_LOOKUP[i>>FROMdB_SHIFT]*FROMdB2_LOOKUP[i&FROMdB2_MASK]);}/* interpolated lookup based cos function, domain 0 to PI only *//* a is in 0.16 format, where 0==0, 2^^16-1==PI, return 0.14 */long vorbis_coslook_i(long a){ int i=a>>COS_LOOKUP_I_SHIFT; int d=a&COS_LOOKUP_I_MASK; return COS_LOOKUP_I[i]- ((d*(COS_LOOKUP_I[i]-COS_LOOKUP_I[i+1]))>> COS_LOOKUP_I_SHIFT);}#endifvendor/vorbis/lib/lookup.hadded
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 * * by the Xiph.Org Foundation https://xiph.org/ * * * ******************************************************************** function: lookup based functions ********************************************************************/#ifndef _V_LOOKUP_H_#ifdef FLOAT_LOOKUPextern float vorbis_coslook(float a);extern float vorbis_invsqlook(float a);extern float vorbis_invsq2explook(int a);extern float vorbis_fromdBlook(float a);#endif#ifdef INT_LOOKUPextern long vorbis_invsqlook_i(long a,long e);extern long vorbis_coslook_i(long a);extern float vorbis_fromdBlook_i(long a);#endif#endifvendor/vorbis/lib/lookup_data.hadded
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 * * by the Xiph.Org Foundation https://xiph.org/ * * * ******************************************************************** function: lookup data; generated by lookups.pl; edit there ********************************************************************/#ifndef _V_LOOKUP_DATA_H_#ifdef FLOAT_LOOKUP#define COS_LOOKUP_SZ 128static const float COS_LOOKUP[COS_LOOKUP_SZ+1]={ +1.0000000000000f,+0.9996988186962f,+0.9987954562052f,+0.9972904566787f, +0.9951847266722f,+0.9924795345987f,+0.9891765099648f,+0.9852776423889f, +0.9807852804032f,+0.9757021300385f,+0.9700312531945f,+0.9637760657954f, +0.9569403357322f,+0.9495281805930f,+0.9415440651830f,+0.9329927988347f, +0.9238795325113f,+0.9142097557035f,+0.9039892931234f,+0.8932243011955f, +0.8819212643484f,+0.8700869911087f,+0.8577286100003f,+0.8448535652497f, +0.8314696123025f,+0.8175848131516f,+0.8032075314806f,+0.7883464276266f, +0.7730104533627f,+0.7572088465065f,+0.7409511253550f,+0.7242470829515f, +0.7071067811865f,+0.6895405447371f,+0.6715589548470f,+0.6531728429538f, +0.6343932841636f,+0.6152315905806f,+0.5956993044924f,+0.5758081914178f, +0.5555702330196f,+0.5349976198871f,+0.5141027441932f,+0.4928981922298f, +0.4713967368260f,+0.4496113296546f,+0.4275550934303f,+0.4052413140050f, +0.3826834323651f,+0.3598950365350f,+0.3368898533922f,+0.3136817403989f, +0.2902846772545f,+0.2667127574749f,+0.2429801799033f,+0.2191012401569f, +0.1950903220161f,+0.1709618887603f,+0.1467304744554f,+0.1224106751992f, +0.0980171403296f,+0.0735645635997f,+0.0490676743274f,+0.0245412285229f, +0.0000000000000f,-0.0245412285229f,-0.0490676743274f,-0.0735645635997f, -0.0980171403296f,-0.1224106751992f,-0.1467304744554f,-0.1709618887603f, -0.1950903220161f,-0.2191012401569f,-0.2429801799033f,-0.2667127574749f, -0.2902846772545f,-0.3136817403989f,-0.3368898533922f,-0.3598950365350f, -0.3826834323651f,-0.4052413140050f,-0.4275550934303f,-0.4496113296546f, -0.4713967368260f,-0.4928981922298f,-0.5141027441932f,-0.5349976198871f, -0.5555702330196f,-0.5758081914178f,-0.5956993044924f,-0.6152315905806f, -0.6343932841636f,-0.6531728429538f,-0.6715589548470f,-0.6895405447371f, -0.7071067811865f,-0.7242470829515f,-0.7409511253550f,-0.7572088465065f, -0.7730104533627f,-0.7883464276266f,-0.8032075314806f,-0.8175848131516f, -0.8314696123025f,-0.8448535652497f,-0.8577286100003f,-0.8700869911087f, -0.8819212643484f,-0.8932243011955f,-0.9039892931234f,-0.9142097557035f, -0.9238795325113f,-0.9329927988347f,-0.9415440651830f,-0.9495281805930f, -0.9569403357322f,-0.9637760657954f,-0.9700312531945f,-0.9757021300385f, -0.9807852804032f,-0.9852776423889f,-0.9891765099648f,-0.9924795345987f, -0.9951847266722f,-0.9972904566787f,-0.9987954562052f,-0.9996988186962f, -1.0000000000000f,};#define INVSQ_LOOKUP_SZ 32static const float INVSQ_LOOKUP[INVSQ_LOOKUP_SZ+1]={ 1.414213562373f,1.392621247646f,1.371988681140f,1.352246807566f, 1.333333333333f,1.315191898443f,1.297771369046f,1.281025230441f, 1.264911064067f,1.249390095109f,1.234426799697f,1.219988562661f, 1.206045378311f,1.192569588000f,1.179535649239f,1.166919931983f, 1.154700538379f,1.142857142857f,1.131370849898f,1.120224067222f, 1.109400392450f,1.098884511590f,1.088662107904f,1.078719779941f, 1.069044967650f,1.059625885652f,1.050451462878f,1.041511287847f, 1.032795558989f,1.024295039463f,1.016001016002f,1.007905261358f, 1.000000000000f,};#define INVSQ2EXP_LOOKUP_MIN (-32)#define INVSQ2EXP_LOOKUP_MAX 32static const float INVSQ2EXP_LOOKUP[INVSQ2EXP_LOOKUP_MAX-\ INVSQ2EXP_LOOKUP_MIN+1]={ 65536.f, 46340.95001f, 32768.f, 23170.47501f, 16384.f, 11585.2375f, 8192.f, 5792.618751f, 4096.f, 2896.309376f, 2048.f, 1448.154688f, 1024.f, 724.0773439f, 512.f, 362.038672f, 256.f, 181.019336f, 128.f, 90.50966799f, 64.f, 45.254834f, 32.f, 22.627417f, 16.f, 11.3137085f, 8.f, 5.656854249f, 4.f, 2.828427125f, 2.f, 1.414213562f, 1.f, 0.7071067812f, 0.5f, 0.3535533906f, 0.25f, 0.1767766953f, 0.125f, 0.08838834765f, 0.0625f, 0.04419417382f, 0.03125f, 0.02209708691f, 0.015625f, 0.01104854346f, 0.0078125f, 0.005524271728f, 0.00390625f, 0.002762135864f, 0.001953125f, 0.001381067932f, 0.0009765625f, 0.000690533966f, 0.00048828125f, 0.000345266983f, 0.000244140625f,0.0001726334915f,0.0001220703125f,8.631674575e-05f, 6.103515625e-05f,4.315837288e-05f,3.051757812e-05f,2.157918644e-05f, 1.525878906e-05f,};#endif#define FROMdB_LOOKUP_SZ 35#define FROMdB2_LOOKUP_SZ 32#define FROMdB_SHIFT 5#define FROMdB2_SHIFT 3#define FROMdB2_MASK 31#ifdef FLOAT_LOOKUPstatic const float FROMdB_LOOKUP[FROMdB_LOOKUP_SZ]={ 1.f, 0.6309573445f, 0.3981071706f, 0.2511886432f, 0.1584893192f, 0.1f, 0.06309573445f, 0.03981071706f, 0.02511886432f, 0.01584893192f, 0.01f, 0.006309573445f, 0.003981071706f, 0.002511886432f, 0.001584893192f, 0.001f, 0.0006309573445f,0.0003981071706f,0.0002511886432f,0.0001584893192f, 0.0001f,6.309573445e-05f,3.981071706e-05f,2.511886432e-05f, 1.584893192e-05f, 1e-05f,6.309573445e-06f,3.981071706e-06f, 2.511886432e-06f,1.584893192e-06f, 1e-06f,6.309573445e-07f, 3.981071706e-07f,2.511886432e-07f,1.584893192e-07f,};static const float FROMdB2_LOOKUP[FROMdB2_LOOKUP_SZ]={ 0.9928302478f, 0.9786445908f, 0.9646616199f, 0.9508784391f, 0.9372921937f, 0.92390007f, 0.9106992942f, 0.8976871324f, 0.8848608897f, 0.8722179097f, 0.8597555737f, 0.8474713009f, 0.835362547f, 0.8234268041f, 0.8116616003f, 0.8000644989f, 0.7886330981f, 0.7773650302f, 0.7662579617f, 0.755309592f, 0.7445176537f, 0.7338799116f, 0.7233941627f, 0.7130582353f, 0.7028699885f, 0.6928273125f, 0.6829281272f, 0.6731703824f, 0.6635520573f, 0.6540711597f, 0.6447257262f, 0.6355138211f,};#endif#ifdef INT_LOOKUP#define INVSQ_LOOKUP_I_SHIFT 10#define INVSQ_LOOKUP_I_MASK 1023static const long INVSQ_LOOKUP_I[64+1]={ 92682l, 91966l, 91267l, 90583l, 89915l, 89261l, 88621l, 87995l, 87381l, 86781l, 86192l, 85616l, 85051l, 84497l, 83953l, 83420l, 82897l, 82384l, 81880l, 81385l, 80899l, 80422l, 79953l, 79492l, 79039l, 78594l, 78156l, 77726l, 77302l, 76885l, 76475l, 76072l, 75674l, 75283l, 74898l, 74519l, 74146l, 73778l, 73415l, 73058l, 72706l, 72359l, 72016l, 71679l, 71347l, 71019l, 70695l, 70376l, 70061l, 69750l, 69444l, 69141l, 68842l, 68548l, 68256l, 67969l, 67685l, 67405l, 67128l, 66855l, 66585l, 66318l, 66054l, 65794l, 65536l,};#define COS_LOOKUP_I_SHIFT 9#define COS_LOOKUP_I_MASK 511#define COS_LOOKUP_I_SZ 128static const long COS_LOOKUP_I[COS_LOOKUP_I_SZ+1]={ 16384l, 16379l, 16364l, 16340l, 16305l, 16261l, 16207l, 16143l, 16069l, 15986l, 15893l, 15791l, 15679l, 15557l, 15426l, 15286l, 15137l, 14978l, 14811l, 14635l, 14449l, 14256l, 14053l, 13842l, 13623l, 13395l, 13160l, 12916l, 12665l, 12406l, 12140l, 11866l, 11585l, 11297l, 11003l, 10702l, 10394l, 10080l, 9760l, 9434l, 9102l, 8765l, 8423l, 8076l, 7723l, 7366l, 7005l, 6639l, 6270l, 5897l, 5520l, 5139l, 4756l, 4370l, 3981l, 3590l, 3196l, 2801l, 2404l, 2006l, 1606l, 1205l, 804l, 402l, 0l, -401l, -803l, -1204l, -1605l, -2005l, -2403l, -2800l, -3195l, -3589l, -3980l, -4369l, -4755l, -5138l, -5519l, -5896l, -6269l, -6638l, -7004l, -7365l, -7722l, -8075l, -8422l, -8764l, -9101l, -9433l, -9759l, -10079l, -10393l, -10701l, -11002l, -11296l, -11584l, -11865l, -12139l, -12405l, -12664l, -12915l, -13159l, -13394l, -13622l, -13841l, -14052l, -14255l, -14448l, -14634l, -14810l, -14977l, -15136l, -15285l, -15425l, -15556l, -15678l, -15790l, -15892l, -15985l, -16068l, -16142l, -16206l, -16260l, -16304l, -16339l, -16363l, -16378l, -16383l,};#endif#endifvendor/vorbis/lib/lpc.cadded
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 * * by the Xiph.Org Foundation https://xiph.org/ * * * ******************************************************************** function: LPC low level routines ********************************************************************//* Some of these routines (autocorrelator, LPC coefficient estimator) are derived from code written by Jutta Degener and Carsten Bormann; thus we include their copyright below. The entirety of this file is freely redistributable on the condition that both of these copyright notices are preserved without modification. *//* Preserved Copyright: *********************************************//* Copyright 1992, 1993, 1994 by Jutta Degener and Carsten Bormann,Technische Universita"t BerlinAny use of this software is permitted provided that this notice is notremoved and that neither the authors nor the Technische Universita"tBerlin are deemed to have made any representations as to thesuitability of this software for any purpose nor are held responsiblefor any defects of this software. THERE IS ABSOLUTELY NO WARRANTY FORTHIS SOFTWARE.As a matter of courtesy, the authors request to be informed about usesthis software has found, about bugs in this software, and about anyimprovements that may be of general interest.Berlin, 28.11.1994Jutta DegenerCarsten Bormann*********************************************************************/#include <stdlib.h>#include <string.h>#include <math.h>#include "os.h"#include "smallft.h"#include "lpc.h"#include "scales.h"#include "misc.h"/* Autocorrelation LPC coeff generation algorithm invented by N. Levinson in 1947, modified by J. Durbin in 1959. *//* Input : n elements of time doamin data Output: m lpc coefficients, excitation energy */float vorbis_lpc_from_data(float *data,float *lpci,int n,int m){ double *aut=alloca(sizeof(*aut)*(m+1)); double *lpc=alloca(sizeof(*lpc)*(m)); double error; double epsilon; int i,j; /* autocorrelation, p+1 lag coefficients */ j=m+1; while(j--){ double d=0; /* double needed for accumulator depth */ for(i=j;i<n;i++)d+=(double)data[i]*data[i-j]; aut[j]=d; } /* Generate lpc coefficients from autocorr values */ /* set our noise floor to about -100dB */ error=aut[0] * (1. + 1e-10); epsilon=1e-9*aut[0]+1e-10; for(i=0;i<m;i++){ double r= -aut[i+1]; if(error<epsilon){ memset(lpc+i,0,(m-i)*sizeof(*lpc)); goto done; } /* Sum up this iteration's reflection coefficient; note that in Vorbis we don't save it. If anyone wants to recycle this code and needs reflection coefficients, save the results of 'r' from each iteration. */ for(j=0;j<i;j++)r-=lpc[j]*aut[i-j]; r/=error; /* Update LPC coefficients and total error */ lpc[i]=r; for(j=0;j<i/2;j++){ double tmp=lpc[j]; lpc[j]+=r*lpc[i-1-j]; lpc[i-1-j]+=r*tmp; } if(i&1)lpc[j]+=lpc[j]*r; error*=1.-r*r; } done: /* slightly damp the filter */ { double g = .99; double damp = g; for(j=0;j<m;j++){ lpc[j]*=damp; damp*=g; } } for(j=0;j<m;j++)lpci[j]=(float)lpc[j]; /* we need the error value to know how big an impulse to hit the filter with later */ return error;}void vorbis_lpc_predict(float *coeff,float *prime,int m, float *data,long n){ /* in: coeff[0...m-1] LPC coefficients prime[0...m-1] initial values (allocated size of n+m-1) out: data[0...n-1] data samples */ long i,j,o,p; float y; float *work=alloca(sizeof(*work)*(m+n)); if(!prime) for(i=0;i<m;i++) work[i]=0.f; else for(i=0;i<m;i++) work[i]=prime[i]; for(i=0;i<n;i++){ y=0; o=i; p=m; for(j=0;j<m;j++) y-=work[o++]*coeff[--p]; data[i]=work[o]=y; }}vendor/vorbis/lib/lpc.hadded
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 * * by the Xiph.Org Foundation https://xiph.org/ * * * ******************************************************************** function: LPC low level routines ********************************************************************/#ifndef _V_LPC_H_#define _V_LPC_H_#include "vorbis/codec.h"/* simple linear scale LPC code */extern float vorbis_lpc_from_data(float *data,float *lpc,int n,int m);extern void vorbis_lpc_predict(float *coeff,float *prime,int m, float *data,long n);#endifvendor/vorbis/lib/lsp.cadded
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 * * by the Xiph.Org Foundation https://xiph.org/ * * * ******************************************************************** function: LSP (also called LSF) conversion routines The LSP generation code is taken (with minimal modification and a few bugfixes) from "On the Computation of the LSP Frequencies" by Joseph Rothweiler (see http://www.rothweiler.us for contact info). The paper is available at: https://web.archive.org/web/20110810174000/http://home.myfairpoint.net/vzenxj75/myown1/joe/lsf/index.html ********************************************************************//* Note that the lpc-lsp conversion finds the roots of polynomial with an iterative root polisher (CACM algorithm 283). It *is* possible to confuse this algorithm into not converging; that should only happen with absurdly closely spaced roots (very sharp peaks in the LPC f response) which in turn should be impossible in our use of the code. If this *does* happen anyway, it's a bug in the floor finder; find the cause of the confusion (probably a single bin spike or accidental near-float-limit resolution problems) and correct it. */#include <math.h>#include <string.h>#include <stdlib.h>#include "lsp.h"#include "os.h"#include "misc.h"#include "lookup.h"#include "scales.h"/* three possible LSP to f curve functions; the exact computation (float), a lookup based float implementation, and an integer implementation. The float lookup is likely the optimal choice on any machine with an FPU. The integer implementation is *not* fixed point (due to the need for a large dynamic range and thus a separately tracked exponent) and thus much more complex than the relatively simple float implementations. It's mostly for future work on a fully fixed point implementation for processors like the ARM family. *//* define either of these (preferably FLOAT_LOOKUP) to have faster but less precise implementation. */#undef FLOAT_LOOKUP#undef INT_LOOKUP#ifdef FLOAT_LOOKUP#include "lookup.c" /* catch this in the build system; we #include for compilers (like gcc) that can't inline across modules *//* side effect: changes *lsp to cosines of lsp */void vorbis_lsp_to_curve(float *curve,int *map,int n,int ln,float *lsp,int m, float amp,float ampoffset){ int i; float wdel=M_PI/ln; vorbis_fpu_control fpu; vorbis_fpu_setround(&fpu); for(i=0;i<m;i++)lsp[i]=vorbis_coslook(lsp[i]); i=0; while(i<n){ int k=map[i]; int qexp; float p=.7071067812f; float q=.7071067812f; float w=vorbis_coslook(wdel*k); float *ftmp=lsp; int c=m>>1; while(c--){ q*=ftmp[0]-w; p*=ftmp[1]-w; ftmp+=2; } if(m&1){ /* odd order filter; slightly assymetric */ /* the last coefficient */ q*=ftmp[0]-w; q*=q; p*=p*(1.f-w*w); }else{ /* even order filter; still symmetric */ q*=q*(1.f+w); p*=p*(1.f-w); } q=frexp(p+q,&qexp); q=vorbis_fromdBlook(amp* vorbis_invsqlook(q)* vorbis_invsq2explook(qexp+m)- ampoffset); do{ curve[i++]*=q; }while(map[i]==k); } vorbis_fpu_restore(fpu);}#else#ifdef INT_LOOKUP#include "lookup.c" /* catch this in the build system; we #include for compilers (like gcc) that can't inline across modules */static const int MLOOP_1[64]={ 0,10,11,11, 12,12,12,12, 13,13,13,13, 13,13,13,13, 14,14,14,14, 14,14,14,14, 14,14,14,14, 14,14,14,14, 15,15,15,15, 15,15,15,15, 15,15,15,15, 15,15,15,15, 15,15,15,15, 15,15,15,15, 15,15,15,15, 15,15,15,15,};static const int MLOOP_2[64]={ 0,4,5,5, 6,6,6,6, 7,7,7,7, 7,7,7,7, 8,8,8,8, 8,8,8,8, 8,8,8,8, 8,8,8,8, 9,9,9,9, 9,9,9,9, 9,9,9,9, 9,9,9,9, 9,9,9,9, 9,9,9,9, 9,9,9,9, 9,9,9,9,};static const int MLOOP_3[8]={0,1,2,2,3,3,3,3};/* side effect: changes *lsp to cosines of lsp */void vorbis_lsp_to_curve(float *curve,int *map,int n,int ln,float *lsp,int m, float amp,float ampoffset){ /* 0 <= m < 256 */ /* set up for using all int later */ int i; int ampoffseti=rint(ampoffset*4096.f); int ampi=rint(amp*16.f); long *ilsp=alloca(m*sizeof(*ilsp)); for(i=0;i<m;i++)ilsp[i]=vorbis_coslook_i(lsp[i]/M_PI*65536.f+.5f); i=0; while(i<n){ int j,k=map[i]; unsigned long pi=46341; /* 2**-.5 in 0.16 */ unsigned long qi=46341; int qexp=0,shift; long wi=vorbis_coslook_i(k*65536/ln); qi*=labs(ilsp[0]-wi); pi*=labs(ilsp[1]-wi); for(j=3;j<m;j+=2){ if(!(shift=MLOOP_1[(pi|qi)>>25])) if(!(shift=MLOOP_2[(pi|qi)>>19])) shift=MLOOP_3[(pi|qi)>>16]; qi=(qi>>shift)*labs(ilsp[j-1]-wi); pi=(pi>>shift)*labs(ilsp[j]-wi); qexp+=shift; } if(!(shift=MLOOP_1[(pi|qi)>>25])) if(!(shift=MLOOP_2[(pi|qi)>>19])) shift=MLOOP_3[(pi|qi)>>16]; /* pi,qi normalized collectively, both tracked using qexp */ if(m&1){ /* odd order filter; slightly assymetric */ /* the last coefficient */ qi=(qi>>shift)*labs(ilsp[j-1]-wi); pi=(pi>>shift)<<14; qexp+=shift; if(!(shift=MLOOP_1[(pi|qi)>>25])) if(!(shift=MLOOP_2[(pi|qi)>>19])) shift=MLOOP_3[(pi|qi)>>16]; pi>>=shift; qi>>=shift; qexp+=shift-14*((m+1)>>1); pi=((pi*pi)>>16); qi=((qi*qi)>>16); qexp=qexp*2+m; pi*=(1<<14)-((wi*wi)>>14); qi+=pi>>14; }else{ /* even order filter; still symmetric */ /* p*=p(1-w), q*=q(1+w), let normalization drift because it isn't worth tracking step by step */ pi>>=shift; qi>>=shift; qexp+=shift-7*m; pi=((pi*pi)>>16); qi=((qi*qi)>>16); qexp=qexp*2+m; pi*=(1<<14)-wi; qi*=(1<<14)+wi; qi=(qi+pi)>>14; } /* we've let the normalization drift because it wasn't important; however, for the lookup, things must be normalized again. We need at most one right shift or a number of left shifts */ if(qi&0xffff0000){ /* checks for 1.xxxxxxxxxxxxxxxx */ qi>>=1; qexp++; }else while(qi && !(qi&0x8000)){ /* checks for 0.0xxxxxxxxxxxxxxx or less*/ qi<<=1; qexp--; } amp=vorbis_fromdBlook_i(ampi* /* n.4 */ vorbis_invsqlook_i(qi,qexp)- /* m.8, m+n<=8 */ ampoffseti); /* 8.12[0] */ curve[i]*=amp; while(map[++i]==k)curve[i]*=amp; }}#else/* old, nonoptimized but simple version for any poor sap who needs to figure out what the hell this code does, or wants the other fraction of a dB precision *//* side effect: changes *lsp to cosines of lsp */void vorbis_lsp_to_curve(float *curve,int *map,int n,int ln,float *lsp,int m, float amp,float ampoffset){ int i; float wdel=M_PI/ln; for(i=0;i<m;i++)lsp[i]=2.f*cos(lsp[i]); i=0; while(i<n){ int j,k=map[i]; float p=.5f; float q=.5f; float w=2.f*cos(wdel*k); for(j=1;j<m;j+=2){ q *= w-lsp[j-1]; p *= w-lsp[j]; } if(j==m){ /* odd order filter; slightly assymetric */ /* the last coefficient */ q*=w-lsp[j-1]; p*=p*(4.f-w*w); q*=q; }else{ /* even order filter; still symmetric */ p*=p*(2.f-w); q*=q*(2.f+w); } q=fromdB(amp/sqrt(p+q)-ampoffset); curve[i]*=q; while(map[++i]==k)curve[i]*=q; }}#endif#endifstatic void cheby(float *g, int ord) { int i, j; g[0] *= .5f; for(i=2; i<= ord; i++) { for(j=ord; j >= i; j--) { g[j-2] -= g[j]; g[j] += g[j]; } }}static int comp(const void *a,const void *b){ return (*(float *)a<*(float *)b)-(*(float *)a>*(float *)b);}/* Newton-Raphson-Maehly actually functioned as a decent root finder, but there are root sets for which it gets into limit cycles (exacerbated by zero suppression) and fails. We can't afford to fail, even if the failure is 1 in 100,000,000, so we now use Laguerre and later polish with Newton-Raphson (which can then afford to fail) */#define EPSILON 10e-7static int Laguerre_With_Deflation(float *a,int ord,float *r){ int i,m; double *defl=alloca(sizeof(*defl)*(ord+1)); for(i=0;i<=ord;i++)defl[i]=a[i]; for(m=ord;m>0;m--){ double new=0.f,delta; /* iterate a root */ while(1){ double p=defl[m],pp=0.f,ppp=0.f,denom; /* eval the polynomial and its first two derivatives */ for(i=m;i>0;i--){ ppp = new*ppp + pp; pp = new*pp + p; p = new*p + defl[i-1]; } /* Laguerre's method */ denom=(m-1) * ((m-1)*pp*pp - m*p*ppp); if(denom<0) return(-1); /* complex root! The LPC generator handed us a bad filter */ if(pp>0){ denom = pp + sqrt(denom); if(denom<EPSILON)denom=EPSILON; }else{ denom = pp - sqrt(denom); if(denom>-(EPSILON))denom=-(EPSILON); } delta = m*p/denom; new -= delta; if(delta<0.f)delta*=-1; if(fabs(delta/new)<10e-12)break; } r[m-1]=new; /* forward deflation */ for(i=m;i>0;i--) defl[i-1]+=new*defl[i]; defl++; } return(0);}/* for spit-and-polish only */static int Newton_Raphson(float *a,int ord,float *r){ int i, k, count=0; double error=1.f; double *root=alloca(ord*sizeof(*root)); for(i=0; i<ord;i++) root[i] = r[i]; while(error>1e-20){ error=0; for(i=0; i<ord; i++) { /* Update each point. */ double pp=0.,delta; double rooti=root[i]; double p=a[ord]; for(k=ord-1; k>= 0; k--) { pp= pp* rooti + p; p = p * rooti + a[k]; } delta = p/pp; root[i] -= delta; error+= delta*delta; } if(count>40)return(-1); count++; } /* Replaced the original bubble sort with a real sort. With your help, we can eliminate the bubble sort in our lifetime. --Monty */ for(i=0; i<ord;i++) r[i] = root[i]; return(0);}/* Convert lpc coefficients to lsp coefficients */int vorbis_lpc_to_lsp(float *lpc,float *lsp,int m){ int order2=(m+1)>>1; int g1_order,g2_order; float *g1=alloca(sizeof(*g1)*(order2+1)); float *g2=alloca(sizeof(*g2)*(order2+1)); float *g1r=alloca(sizeof(*g1r)*(order2+1)); float *g2r=alloca(sizeof(*g2r)*(order2+1)); int i; /* even and odd are slightly different base cases */ g1_order=(m+1)>>1; g2_order=(m) >>1; /* Compute the lengths of the x polynomials. */ /* Compute the first half of K & R F1 & F2 polynomials. */ /* Compute half of the symmetric and antisymmetric polynomials. */ /* Remove the roots at +1 and -1. */ g1[g1_order] = 1.f; for(i=1;i<=g1_order;i++) g1[g1_order-i] = lpc[i-1]+lpc[m-i]; g2[g2_order] = 1.f; for(i=1;i<=g2_order;i++) g2[g2_order-i] = lpc[i-1]-lpc[m-i]; if(g1_order>g2_order){ for(i=2; i<=g2_order;i++) g2[g2_order-i] += g2[g2_order-i+2]; }else{ for(i=1; i<=g1_order;i++) g1[g1_order-i] -= g1[g1_order-i+1]; for(i=1; i<=g2_order;i++) g2[g2_order-i] += g2[g2_order-i+1]; } /* Convert into polynomials in cos(alpha) */ cheby(g1,g1_order); cheby(g2,g2_order); /* Find the roots of the 2 even polynomials.*/ if(Laguerre_With_Deflation(g1,g1_order,g1r) || Laguerre_With_Deflation(g2,g2_order,g2r)) return(-1); Newton_Raphson(g1,g1_order,g1r); /* if it fails, it leaves g1r alone */ Newton_Raphson(g2,g2_order,g2r); /* if it fails, it leaves g2r alone */ qsort(g1r,g1_order,sizeof(*g1r),comp); qsort(g2r,g2_order,sizeof(*g2r),comp); for(i=0;i<g1_order;i++) lsp[i*2] = acos(g1r[i]); for(i=0;i<g2_order;i++) lsp[i*2+1] = acos(g2r[i]); return(0);}vendor/vorbis/lib/lsp.hadded
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 * * by the Xiph.Org Foundation https://xiph.org/ * * * ******************************************************************** function: LSP (also called LSF) conversion routines ********************************************************************/#ifndef _V_LSP_H_#define _V_LSP_H_extern int vorbis_lpc_to_lsp(float *lpc,float *lsp,int m);extern void vorbis_lsp_to_curve(float *curve,int *map,int n,int ln, float *lsp,int m, float amp,float ampoffset);#endifvendor/vorbis/lib/mapping0.cadded
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2010 * * by the Xiph.Org Foundation https://xiph.org/ * * * ******************************************************************** function: channel mapping 0 implementation ********************************************************************/#include <stdlib.h>#include <stdio.h>#include <string.h>#include <math.h>#include <ogg/ogg.h>#include "vorbis/codec.h"#include "codec_internal.h"#include "codebook.h"#include "window.h"#include "registry.h"#include "psy.h"#include "misc.h"/* simplistic, wasteful way of doing this (unique lookup for each mode/submapping); there should be a central repository for identical lookups. That will require minor work, so I'm putting it off as low priority. Why a lookup for each backend in a given mode? Because the blocksize is set by the mode, and low backend lookups may require parameters from other areas of the mode/mapping */static void mapping0_free_info(vorbis_info_mapping *i){ vorbis_info_mapping0 *info=(vorbis_info_mapping0 *)i; if(info){ memset(info,0,sizeof(*info)); _ogg_free(info); }}static void mapping0_pack(vorbis_info *vi,vorbis_info_mapping *vm, oggpack_buffer *opb){ int i; vorbis_info_mapping0 *info=(vorbis_info_mapping0 *)vm; /* another 'we meant to do it this way' hack... up to beta 4, we packed 4 binary zeros here to signify one submapping in use. We now redefine that to mean four bitflags that indicate use of deeper features; bit0:submappings, bit1:coupling, bit2,3:reserved. This is backward compatable with all actual uses of the beta code. */ if(info->submaps>1){ oggpack_write(opb,1,1); oggpack_write(opb,info->submaps-1,4); }else oggpack_write(opb,0,1); if(info->coupling_steps>0){ oggpack_write(opb,1,1); oggpack_write(opb,info->coupling_steps-1,8); for(i=0;i<info->coupling_steps;i++){ oggpack_write(opb,info->coupling_mag[i],ov_ilog(vi->channels-1)); oggpack_write(opb,info->coupling_ang[i],ov_ilog(vi->channels-1)); } }else oggpack_write(opb,0,1); oggpack_write(opb,0,2); /* 2,3:reserved */ /* we don't write the channel submappings if we only have one... */ if(info->submaps>1){ for(i=0;i<vi->channels;i++) oggpack_write(opb,info->chmuxlist[i],4); } for(i=0;i<info->submaps;i++){ oggpack_write(opb,0,8); /* time submap unused */ oggpack_write(opb,info->floorsubmap[i],8); oggpack_write(opb,info->residuesubmap[i],8); }}/* also responsible for range checking */static vorbis_info_mapping *mapping0_unpack(vorbis_info *vi,oggpack_buffer *opb){ int i,b; vorbis_info_mapping0 *info=_ogg_calloc(1,sizeof(*info)); codec_setup_info *ci=vi->codec_setup; if(vi->channels<=0)goto err_out; b=oggpack_read(opb,1); if(b<0)goto err_out; if(b){ info->submaps=oggpack_read(opb,4)+1; if(info->submaps<=0)goto err_out; }else info->submaps=1; b=oggpack_read(opb,1); if(b<0)goto err_out; if(b){ info->coupling_steps=oggpack_read(opb,8)+1; if(info->coupling_steps<=0)goto err_out; for(i=0;i<info->coupling_steps;i++){ /* vi->channels > 0 is enforced in the caller */ int testM=info->coupling_mag[i]= oggpack_read(opb,ov_ilog(vi->channels-1)); int testA=info->coupling_ang[i]= oggpack_read(opb,ov_ilog(vi->channels-1)); if(testM<0 || testA<0 || testM==testA || testM>=vi->channels || testA>=vi->channels) goto err_out; } } if(oggpack_read(opb,2)!=0)goto err_out; /* 2,3:reserved */ if(info->submaps>1){ for(i=0;i<vi->channels;i++){ info->chmuxlist[i]=oggpack_read(opb,4); if(info->chmuxlist[i]>=info->submaps || info->chmuxlist[i]<0)goto err_out; } } for(i=0;i<info->submaps;i++){ oggpack_read(opb,8); /* time submap unused */ info->floorsubmap[i]=oggpack_read(opb,8); if(info->floorsubmap[i]>=ci->floors || info->floorsubmap[i]<0)goto err_out; info->residuesubmap[i]=oggpack_read(opb,8); if(info->residuesubmap[i]>=ci->residues || info->residuesubmap[i]<0)goto err_out; } return info; err_out: mapping0_free_info(info); return(NULL);}#include "os.h"#include "lpc.h"#include "lsp.h"#include "envelope.h"#include "mdct.h"#include "psy.h"#include "scales.h"#if 0static long seq=0;static ogg_int64_t total=0;static float FLOOR1_fromdB_LOOKUP[256]={ 1.0649863e-07F, 1.1341951e-07F, 1.2079015e-07F, 1.2863978e-07F, 1.3699951e-07F, 1.4590251e-07F, 1.5538408e-07F, 1.6548181e-07F, 1.7623575e-07F, 1.8768855e-07F, 1.9988561e-07F, 2.128753e-07F, 2.2670913e-07F, 2.4144197e-07F, 2.5713223e-07F, 2.7384213e-07F, 2.9163793e-07F, 3.1059021e-07F, 3.3077411e-07F, 3.5226968e-07F, 3.7516214e-07F, 3.9954229e-07F, 4.2550680e-07F, 4.5315863e-07F, 4.8260743e-07F, 5.1396998e-07F, 5.4737065e-07F, 5.8294187e-07F, 6.2082472e-07F, 6.6116941e-07F, 7.0413592e-07F, 7.4989464e-07F, 7.9862701e-07F, 8.5052630e-07F, 9.0579828e-07F, 9.6466216e-07F, 1.0273513e-06F, 1.0941144e-06F, 1.1652161e-06F, 1.2409384e-06F, 1.3215816e-06F, 1.4074654e-06F, 1.4989305e-06F, 1.5963394e-06F, 1.7000785e-06F, 1.8105592e-06F, 1.9282195e-06F, 2.0535261e-06F, 2.1869758e-06F, 2.3290978e-06F, 2.4804557e-06F, 2.6416497e-06F, 2.8133190e-06F, 2.9961443e-06F, 3.1908506e-06F, 3.3982101e-06F, 3.6190449e-06F, 3.8542308e-06F, 4.1047004e-06F, 4.3714470e-06F, 4.6555282e-06F, 4.9580707e-06F, 5.2802740e-06F, 5.6234160e-06F, 5.9888572e-06F, 6.3780469e-06F, 6.7925283e-06F, 7.2339451e-06F, 7.7040476e-06F, 8.2047000e-06F, 8.7378876e-06F, 9.3057248e-06F, 9.9104632e-06F, 1.0554501e-05F, 1.1240392e-05F, 1.1970856e-05F, 1.2748789e-05F, 1.3577278e-05F, 1.4459606e-05F, 1.5399272e-05F, 1.6400004e-05F, 1.7465768e-05F, 1.8600792e-05F, 1.9809576e-05F, 2.1096914e-05F, 2.2467911e-05F, 2.3928002e-05F, 2.5482978e-05F, 2.7139006e-05F, 2.8902651e-05F, 3.0780908e-05F, 3.2781225e-05F, 3.4911534e-05F, 3.7180282e-05F, 3.9596466e-05F, 4.2169667e-05F, 4.4910090e-05F, 4.7828601e-05F, 5.0936773e-05F, 5.4246931e-05F, 5.7772202e-05F, 6.1526565e-05F, 6.5524908e-05F, 6.9783085e-05F, 7.4317983e-05F, 7.9147585e-05F, 8.4291040e-05F, 8.9768747e-05F, 9.5602426e-05F, 0.00010181521F, 0.00010843174F, 0.00011547824F, 0.00012298267F, 0.00013097477F, 0.00013948625F, 0.00014855085F, 0.00015820453F, 0.00016848555F, 0.00017943469F, 0.00019109536F, 0.00020351382F, 0.00021673929F, 0.00023082423F, 0.00024582449F, 0.00026179955F, 0.00027881276F, 0.00029693158F, 0.00031622787F, 0.00033677814F, 0.00035866388F, 0.00038197188F, 0.00040679456F, 0.00043323036F, 0.00046138411F, 0.00049136745F, 0.00052329927F, 0.00055730621F, 0.00059352311F, 0.00063209358F, 0.00067317058F, 0.00071691700F, 0.00076350630F, 0.00081312324F, 0.00086596457F, 0.00092223983F, 0.00098217216F, 0.0010459992F, 0.0011139742F, 0.0011863665F, 0.0012634633F, 0.0013455702F, 0.0014330129F, 0.0015261382F, 0.0016253153F, 0.0017309374F, 0.0018434235F, 0.0019632195F, 0.0020908006F, 0.0022266726F, 0.0023713743F, 0.0025254795F, 0.0026895994F, 0.0028643847F, 0.0030505286F, 0.0032487691F, 0.0034598925F, 0.0036847358F, 0.0039241906F, 0.0041792066F, 0.0044507950F, 0.0047400328F, 0.0050480668F, 0.0053761186F, 0.0057254891F, 0.0060975636F, 0.0064938176F, 0.0069158225F, 0.0073652516F, 0.0078438871F, 0.0083536271F, 0.0088964928F, 0.009474637F, 0.010090352F, 0.010746080F, 0.011444421F, 0.012188144F, 0.012980198F, 0.013823725F, 0.014722068F, 0.015678791F, 0.016697687F, 0.017782797F, 0.018938423F, 0.020169149F, 0.021479854F, 0.022875735F, 0.024362330F, 0.025945531F, 0.027631618F, 0.029427276F, 0.031339626F, 0.033376252F, 0.035545228F, 0.037855157F, 0.040315199F, 0.042935108F, 0.045725273F, 0.048696758F, 0.051861348F, 0.055231591F, 0.058820850F, 0.062643361F, 0.066714279F, 0.071049749F, 0.075666962F, 0.080584227F, 0.085821044F, 0.091398179F, 0.097337747F, 0.10366330F, 0.11039993F, 0.11757434F, 0.12521498F, 0.13335215F, 0.14201813F, 0.15124727F, 0.16107617F, 0.17154380F, 0.18269168F, 0.19456402F, 0.20720788F, 0.22067342F, 0.23501402F, 0.25028656F, 0.26655159F, 0.28387361F, 0.30232132F, 0.32196786F, 0.34289114F, 0.36517414F, 0.38890521F, 0.41417847F, 0.44109412F, 0.46975890F, 0.50028648F, 0.53279791F, 0.56742212F, 0.60429640F, 0.64356699F, 0.68538959F, 0.72993007F, 0.77736504F, 0.82788260F, 0.88168307F, 0.9389798F, 1.F,};#endifstatic int mapping0_forward(vorbis_block *vb){ vorbis_dsp_state *vd=vb->vd; vorbis_info *vi=vd->vi; codec_setup_info *ci=vi->codec_setup; private_state *b=vb->vd->backend_state; vorbis_block_internal *vbi=(vorbis_block_internal *)vb->internal; int n=vb->pcmend; int i,j,k; int *nonzero = alloca(sizeof(*nonzero)*vi->channels); float **gmdct = _vorbis_block_alloc(vb,vi->channels*sizeof(*gmdct)); int **iwork = _vorbis_block_alloc(vb,vi->channels*sizeof(*iwork)); int ***floor_posts = _vorbis_block_alloc(vb,vi->channels*sizeof(*floor_posts)); float global_ampmax=vbi->ampmax; float *local_ampmax=alloca(sizeof(*local_ampmax)*vi->channels); int blocktype=vbi->blocktype; int modenumber=vb->W; vorbis_info_mapping0 *info=ci->map_param[modenumber]; vorbis_look_psy *psy_look=b->psy+blocktype+(vb->W?2:0); vb->mode=modenumber; for(i=0;i<vi->channels;i++){ float scale=4.f/n; float scale_dB; float *pcm =vb->pcm[i]; float *logfft =pcm; iwork[i]=_vorbis_block_alloc(vb,n/2*sizeof(**iwork)); gmdct[i]=_vorbis_block_alloc(vb,n/2*sizeof(**gmdct)); scale_dB=todB(&scale) + .345; /* + .345 is a hack; the original todB estimation used on IEEE 754 compliant machines had a bug that returned dB values about a third of a decibel too high. The bug was harmless because tunings implicitly took that into account. However, fixing the bug in the estimator requires changing all the tunings as well. For now, it's easier to sync things back up here, and recalibrate the tunings in the next major model upgrade. */#if 0 if(vi->channels==2){ if(i==0) _analysis_output("pcmL",seq,pcm,n,0,0,total-n/2); else _analysis_output("pcmR",seq,pcm,n,0,0,total-n/2); }else{ _analysis_output("pcm",seq,pcm,n,0,0,total-n/2); }#endif /* window the PCM data */ _vorbis_apply_window(pcm,b->window,ci->blocksizes,vb->lW,vb->W,vb->nW);#if 0 if(vi->channels==2){ if(i==0) _analysis_output("windowedL",seq,pcm,n,0,0,total-n/2); else _analysis_output("windowedR",seq,pcm,n,0,0,total-n/2); }else{ _analysis_output("windowed",seq,pcm,n,0,0,total-n/2); }#endif /* transform the PCM data */ /* only MDCT right now.... */ mdct_forward(b->transform[vb->W][0],pcm,gmdct[i]); /* FFT yields more accurate tonal estimation (not phase sensitive) */ drft_forward(&b->fft_look[vb->W],pcm); logfft[0]=scale_dB+todB(pcm) + .345; /* + .345 is a hack; the original todB estimation used on IEEE 754 compliant machines had a bug that returned dB values about a third of a decibel too high. The bug was harmless because tunings implicitly took that into account. However, fixing the bug in the estimator requires changing all the tunings as well. For now, it's easier to sync things back up here, and recalibrate the tunings in the next major model upgrade. */ local_ampmax[i]=logfft[0]; for(j=1;j<n-1;j+=2){ float temp=pcm[j]*pcm[j]+pcm[j+1]*pcm[j+1]; temp=logfft[(j+1)>>1]=scale_dB+.5f*todB(&temp) + .345; /* + .345 is a hack; the original todB estimation used on IEEE 754 compliant machines had a bug that returned dB values about a third of a decibel too high. The bug was harmless because tunings implicitly took that into account. However, fixing the bug in the estimator requires changing all the tunings as well. For now, it's easier to sync things back up here, and recalibrate the tunings in the next major model upgrade. */ if(temp>local_ampmax[i])local_ampmax[i]=temp; } if(local_ampmax[i]>0.f)local_ampmax[i]=0.f; if(local_ampmax[i]>global_ampmax)global_ampmax=local_ampmax[i];#if 0 if(vi->channels==2){ if(i==0){ _analysis_output("fftL",seq,logfft,n/2,1,0,0); }else{ _analysis_output("fftR",seq,logfft,n/2,1,0,0); } }else{ _analysis_output("fft",seq,logfft,n/2,1,0,0); }#endif } { float *noise = _vorbis_block_alloc(vb,n/2*sizeof(*noise)); float *tone = _vorbis_block_alloc(vb,n/2*sizeof(*tone)); for(i=0;i<vi->channels;i++){ /* the encoder setup assumes that all the modes used by any specific bitrate tweaking use the same floor */ int submap=info->chmuxlist[i]; /* the following makes things clearer to *me* anyway */ float *mdct =gmdct[i]; float *logfft =vb->pcm[i]; float *logmdct =logfft+n/2; float *logmask =logfft; vb->mode=modenumber; floor_posts[i]=_vorbis_block_alloc(vb,PACKETBLOBS*sizeof(**floor_posts)); memset(floor_posts[i],0,sizeof(**floor_posts)*PACKETBLOBS); for(j=0;j<n/2;j++) logmdct[j]=todB(mdct+j) + .345; /* + .345 is a hack; the original todB estimation used on IEEE 754 compliant machines had a bug that returned dB values about a third of a decibel too high. The bug was harmless because tunings implicitly took that into account. However, fixing the bug in the estimator requires changing all the tunings as well. For now, it's easier to sync things back up here, and recalibrate the tunings in the next major model upgrade. */#if 0 if(vi->channels==2){ if(i==0) _analysis_output("mdctL",seq,logmdct,n/2,1,0,0); else _analysis_output("mdctR",seq,logmdct,n/2,1,0,0); }else{ _analysis_output("mdct",seq,logmdct,n/2,1,0,0); }#endif /* first step; noise masking. Not only does 'noise masking' give us curves from which we can decide how much resolution to give noise parts of the spectrum, it also implicitly hands us a tonality estimate (the larger the value in the 'noise_depth' vector, the more tonal that area is) */ _vp_noisemask(psy_look, logmdct, noise); /* noise does not have by-frequency offset bias applied yet */#if 0 if(vi->channels==2){ if(i==0) _analysis_output("noiseL",seq,noise,n/2,1,0,0); else _analysis_output("noiseR",seq,noise,n/2,1,0,0); }else{ _analysis_output("noise",seq,noise,n/2,1,0,0); }#endif /* second step: 'all the other crap'; all the stuff that isn't computed/fit for bitrate management goes in the second psy vector. This includes tone masking, peak limiting and ATH */ _vp_tonemask(psy_look, logfft, tone, global_ampmax, local_ampmax[i]);#if 0 if(vi->channels==2){ if(i==0) _analysis_output("toneL",seq,tone,n/2,1,0,0); else _analysis_output("toneR",seq,tone,n/2,1,0,0); }else{ _analysis_output("tone",seq,tone,n/2,1,0,0); }#endif /* third step; we offset the noise vectors, overlay tone masking. We then do a floor1-specific line fit. If we're performing bitrate management, the line fit is performed multiple times for up/down tweakage on demand. */#if 0 { float aotuv[psy_look->n];#endif _vp_offset_and_mix(psy_look, noise, tone, 1, logmask, mdct, logmdct);#if 0 if(vi->channels==2){ if(i==0) _analysis_output("aotuvM1_L",seq,aotuv,psy_look->n,1,1,0); else _analysis_output("aotuvM1_R",seq,aotuv,psy_look->n,1,1,0); }else{ _analysis_output("aotuvM1",seq,aotuv,psy_look->n,1,1,0); } }#endif#if 0 if(vi->channels==2){ if(i==0) _analysis_output("mask1L",seq,logmask,n/2,1,0,0); else _analysis_output("mask1R",seq,logmask,n/2,1,0,0); }else{ _analysis_output("mask1",seq,logmask,n/2,1,0,0); }#endif /* this algorithm is hardwired to floor 1 for now; abort out if we're *not* floor1. This won't happen unless someone has broken the encode setup lib. Guard it anyway. */ if(ci->floor_type[info->floorsubmap[submap]]!=1)return(-1);Showing the first 500 of 809 diff lines for this file. This diff is INCOMPLETE; read the file or clone the repository for the rest.
vendor/vorbis/lib/masking.hadded
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 * * by the Xiph.Org Foundation https://xiph.org/ * * * ******************************************************************** function: masking curve data for psychoacoustics ********************************************************************/#ifndef _V_MASKING_H_#define _V_MASKING_H_/* more detailed ATH; the bass if flat to save stressing the floor overly for only a bin or two of savings. */#define MAX_ATH 88static const float ATH[]={ /*15*/ -51, -52, -53, -54, -55, -56, -57, -58, /*31*/ -59, -60, -61, -62, -63, -64, -65, -66, /*63*/ -67, -68, -69, -70, -71, -72, -73, -74, /*125*/ -75, -76, -77, -78, -80, -81, -82, -83, /*250*/ -84, -85, -86, -87, -88, -88, -89, -89, /*500*/ -90, -91, -91, -92, -93, -94, -95, -96, /*1k*/ -96, -97, -98, -98, -99, -99,-100,-100, /*2k*/ -101,-102,-103,-104,-106,-107,-107,-107, /*4k*/ -107,-105,-103,-102,-101, -99, -98, -96, /*8k*/ -95, -95, -96, -97, -96, -95, -93, -90, /*16k*/ -80, -70, -50, -40, -30, -30, -30, -30};/* The tone masking curves from Ehmer's and Fielder's papers have been replaced by an empirically collected data set. The previously published values were, far too often, simply on crack. */#define EHMER_OFFSET 16#define EHMER_MAX 56/* masking tones from -50 to 0dB, 62.5 through 16kHz at half octaves test tones from -2 octaves to +5 octaves sampled at eighth octaves *//* (Vorbis 0dB, the loudest possible tone, is assumed to be ~100dB SPL for collection of these curves) */static const float tonemasks[P_BANDS][6][EHMER_MAX]={ /* 62.5 Hz */ {{ -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, -60, -62, -62, -65, -73, -69, -68, -68, -67, -70, -70, -72, -74, -75, -79, -79, -80, -83, -88, -93, -100, -110, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999}, { -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -48, -53, -61, -66, -66, -68, -67, -70, -76, -76, -72, -73, -75, -76, -78, -79, -83, -88, -93, -100, -110, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999}, { -37, -37, -37, -37, -37, -37, -37, -37, -38, -40, -42, -46, -48, -53, -55, -62, -65, -58, -56, -56, -61, -60, -65, -67, -69, -71, -77, -77, -78, -80, -82, -84, -88, -93, -98, -106, -112, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999}, { -25, -25, -25, -25, -25, -25, -25, -25, -25, -26, -27, -29, -32, -38, -48, -52, -52, -50, -48, -48, -51, -52, -54, -60, -67, -67, -66, -68, -69, -73, -73, -76, -80, -81, -81, -85, -85, -86, -88, -93, -100, -110, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999}, { -16, -16, -16, -16, -16, -16, -16, -16, -17, -19, -20, -22, -26, -28, -31, -40, -47, -39, -39, -40, -42, -43, -47, -51, -57, -52, -55, -55, -60, -58, -62, -63, -70, -67, -69, -72, -73, -77, -80, -82, -83, -87, -90, -94, -98, -104, -115, -999, -999, -999, -999, -999, -999, -999, -999, -999}, { -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -10, -11, -15, -19, -25, -30, -34, -31, -30, -31, -29, -32, -35, -42, -48, -42, -44, -46, -50, -50, -51, -52, -59, -54, -55, -55, -58, -62, -63, -66, -72, -73, -76, -75, -78, -80, -80, -81, -84, -88, -90, -94, -98, -101, -106, -110}}, /* 88Hz */ {{ -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, -66, -67, -67, -67, -76, -72, -71, -74, -76, -76, -75, -78, -79, -79, -81, -83, -86, -89, -93, -97, -100, -105, -110, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999}, { -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, -48, -51, -55, -59, -66, -66, -66, -67, -66, -68, -69, -70, -74, -79, -77, -77, -78, -80, -81, -82, -84, -86, -88, -91, -95, -100, -108, -116, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999}, { -36, -36, -36, -36, -36, -36, -36, -36, -36, -37, -37, -41, -44, -48, -51, -58, -62, -60, -57, -59, -59, -60, -63, -65, -72, -71, -70, -72, -74, -77, -76, -78, -81, -81, -80, -83, -86, -91, -96, -100, -105, -110, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999}, { -28, -28, -28, -28, -28, -28, -28, -28, -28, -30, -32, -32, -33, -35, -41, -49, -50, -49, -47, -48, -48, -52, -51, -57, -65, -61, -59, -61, -64, -69, -70, -74, -77, -77, -78, -81, -84, -85, -87, -90, -92, -96, -100, -107, -112, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999}, { -19, -19, -19, -19, -19, -19, -19, -19, -20, -21, -23, -27, -30, -35, -36, -41, -46, -44, -42, -40, -41, -41, -43, -48, -55, -53, -52, -53, -56, -59, -58, -60, -67, -66, -69, -71, -72, -75, -79, -81, -84, -87, -90, -93, -97, -101, -107, -114, -999, -999, -999, -999, -999, -999, -999, -999}, { -9, -9, -9, -9, -9, -9, -9, -9, -11, -12, -12, -15, -16, -20, -23, -30, -37, -34, -33, -34, -31, -32, -32, -38, -47, -44, -41, -40, -47, -49, -46, -46, -58, -50, -50, -54, -58, -62, -64, -67, -67, -70, -72, -76, -79, -83, -87, -91, -96, -100, -104, -110, -999, -999, -999, -999}}, /* 125 Hz */ {{ -62, -62, -62, -62, -62, -62, -62, -62, -62, -62, -63, -64, -66, -67, -66, -68, -75, -72, -76, -75, -76, -78, -79, -82, -84, -85, -90, -94, -101, -110, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999}, { -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -59, -60, -60, -61, -63, -66, -71, -68, -70, -70, -71, -72, -72, -75, -81, -78, -79, -82, -83, -86, -90, -97, -103, -113, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999}, { -53, -53, -53, -53, -53, -53, -53, -53, -53, -54, -55, -57, -56, -57, -55, -61, -65, -60, -60, -62, -63, -63, -66, -68, -74, -73, -75, -75, -78, -80, -80, -82, -85, -90, -96, -101, -108, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999}, { -46, -46, -46, -46, -46, -46, -46, -46, -46, -46, -47, -47, -47, -47, -48, -51, -57, -51, -49, -50, -51, -53, -54, -59, -66, -60, -62, -67, -67, -70, -72, -75, -76, -78, -81, -85, -88, -94, -97, -104, -112, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999}, { -36, -36, -36, -36, -36, -36, -36, -36, -39, -41, -42, -42, -39, -38, -41, -43, -52, -44, -40, -39, -37, -37, -40, -47, -54, -50, -48, -50, -55, -61, -59, -62, -66, -66, -66, -69, -69, -73, -74, -74, -75, -77, -79, -82, -87, -91, -95, -100, -108, -115, -999, -999, -999, -999, -999, -999}, { -28, -26, -24, -22, -20, -20, -23, -29, -30, -31, -28, -27, -28, -28, -28, -35, -40, -33, -32, -29, -30, -30, -30, -37, -45, -41, -37, -38, -45, -47, -47, -48, -53, -49, -48, -50, -49, -49, -51, -52, -58, -56, -57, -56, -60, -61, -62, -70, -72, -74, -78, -83, -88, -93, -100, -106}}, /* 177 Hz */ {{-999, -999, -999, -999, -999, -999, -999, -999, -999, -110, -105, -100, -95, -91, -87, -83, -80, -78, -76, -78, -78, -81, -83, -85, -86, -85, -86, -87, -90, -97, -107, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999}, {-999, -999, -999, -110, -105, -100, -95, -90, -85, -81, -77, -73, -70, -67, -67, -68, -75, -73, -70, -69, -70, -72, -75, -79, -84, -83, -84, -86, -88, -89, -89, -93, -98, -105, -112, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999}, {-105, -100, -95, -90, -85, -80, -76, -71, -68, -68, -65, -63, -63, -62, -62, -64, -65, -64, -61, -62, -63, -64, -66, -68, -73, -73, -74, -75, -76, -81, -83, -85, -88, -89, -92, -95, -100, -108, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999}, { -80, -75, -71, -68, -65, -63, -62, -61, -61, -61, -61, -59, -56, -57, -53, -50, -58, -52, -50, -50, -52, -53, -54, -58, -67, -63, -67, -68, -72, -75, -78, -80, -81, -81, -82, -85, -89, -90, -93, -97, -101, -107, -114, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999}, { -65, -61, -59, -57, -56, -55, -55, -56, -56, -57, -55, -53, -52, -47, -44, -44, -50, -44, -41, -39, -39, -42, -40, -46, -51, -49, -50, -53, -54, -63, -60, -61, -62, -66, -66, -66, -70, -73, -74, -75, -76, -75, -79, -85, -89, -91, -96, -102, -110, -999, -999, -999, -999, -999, -999, -999}, { -52, -50, -49, -49, -48, -48, -48, -49, -50, -50, -49, -46, -43, -39, -35, -33, -38, -36, -32, -29, -32, -32, -32, -35, -44, -39, -38, -38, -46, -50, -45, -46, -53, -50, -50, -50, -54, -54, -53, -53, -56, -57, -59, -66, -70, -72, -74, -79, -83, -85, -90, -97, -114, -999, -999, -999}}, /* 250 Hz */ {{-999, -999, -999, -999, -999, -999, -110, -105, -100, -95, -90, -86, -80, -75, -75, -79, -80, -79, -80, -81, -82, -88, -95, -103, -110, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999}, {-999, -999, -999, -999, -108, -103, -98, -93, -88, -83, -79, -78, -75, -71, -67, -68, -73, -73, -72, -73, -75, -77, -80, -82, -88, -93, -100, -107, -114, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999}, {-999, -999, -999, -110, -105, -101, -96, -90, -86, -81, -77, -73, -69, -66, -61, -62, -66, -64, -62, -65, -66, -70, -72, -76, -81, -80, -84, -90, -95, -102, -110, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999}, {-999, -999, -999, -107, -103, -97, -92, -88, -83, -79, -74, -70, -66, -59, -53, -58, -62, -55, -54, -54, -54, -58, -61, -62, -72, -70, -72, -75, -78, -80, -81, -80, -83, -83, -88, -93, -100, -107, -115, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999}, {-999, -999, -999, -105, -100, -95, -90, -85, -80, -75, -70, -66, -62, -56, -48, -44, -48, -46, -46, -43, -46, -48, -48, -51, -58, -58, -59, -60, -62, -62, -61, -61, -65, -64, -65, -68, -70, -74, -75, -78, -81, -86, -95, -110, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999}, {-999, -999, -105, -100, -95, -90, -85, -80, -75, -70, -65, -61, -55, -49, -39, -33, -40, -35, -32, -38, -40, -33, -35, -37, -46, -41, -45, -44, -46, -42, -45, -46, -52, -50, -50, -50, -54, -54, -55, -57, -62, -64, -66, -68, -70, -76, -81, -90, -100, -110, -999, -999, -999, -999, -999, -999}}, /* 354 hz */ {{-999, -999, -999, -999, -999, -999, -999, -999, -105, -98, -90, -85, -82, -83, -80, -78, -84, -79, -80, -83, -87, -89, -91, -93, -99, -106, -117, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999}, {-999, -999, -999, -999, -999, -999, -999, -999, -105, -98, -90, -85, -80, -75, -70, -68, -74, -72, -74, -77, -80, -82, -85, -87, -92, -89, -91, -95, -100, -106, -112, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999}, {-999, -999, -999, -999, -999, -999, -999, -999, -105, -98, -90, -83, -75, -71, -63, -64, -67, -62, -64, -67, -70, -73, -77, -81, -84, -83, -85, -89, -90, -93, -98, -104, -109, -114, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999}, {-999, -999, -999, -999, -999, -999, -999, -999, -103, -96, -88, -81, -75, -68, -58, -54, -56, -54, -56, -56, -58, -60, -63, -66, -74, -69, -72, -72, -75, -74, -77, -81, -81, -82, -84, -87, -93, -96, -99, -104, -110, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999}, {-999, -999, -999, -999, -999, -108, -102, -96, -91, -85, -80, -74, -68, -60, -51, -46, -48, -46, -43, -45, -47, -47, -49, -48, -56, -53, -55, -58, -57, -63, -58, -60, -66, -64, -67, -70, -70, -74, -77, -84, -86, -89, -91, -93, -94, -101, -109, -118, -999, -999, -999, -999, -999, -999, -999, -999}, {-999, -999, -999, -108, -103, -98, -93, -88, -83, -78, -73, -68, -60, -53, -44, -35, -38, -38, -34, -34, -36, -40, -41, -44, -51, -45, -46, -47, -46, -54, -50, -49, -50, -50, -50, -51, -54, -57, -58, -60, -66, -66, -66, -64, -65, -68, -77, -82, -87, -95, -110, -999, -999, -999, -999, -999}}, /* 500 Hz */ {{-999, -999, -999, -999, -999, -999, -999, -999, -107, -102, -97, -92, -87, -83, -78, -75, -82, -79, -83, -85, -89, -92, -95, -98, -101, -105, -109, -113, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999}, {-999, -999, -999, -999, -999, -999, -999, -106, -100, -95, -90, -86, -81, -78, -74, -69, -74, -74, -76, -79, -83, -84, -86, -89, -92, -97, -93, -100, -103, -107, -110, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999}, {-999, -999, -999, -999, -999, -999, -106, -100, -95, -90, -87, -83, -80, -75, -69, -60, -66, -66, -68, -70, -74, -78, -79, -81, -81, -83, -84, -87, -93, -96, -99, -103, -107, -110, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999}, {-999, -999, -999, -999, -999, -108, -103, -98, -93, -89, -85, -82, -78, -71, -62, -55, -58, -58, -54, -54, -55, -59, -61, -62, -70, -66, -66, -67, -70, -72, -75, -78, -84, -84, -84, -88, -91, -90, -95, -98, -102, -103, -106, -110, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999}, {-999, -999, -999, -999, -108, -103, -98, -94, -90, -87, -82, -79, -73, -67, -58, -47, -50, -45, -41, -45, -48, -44, -44, -49, -54, -51, -48, -47, -49, -50, -51, -57, -58, -60, -63, -69, -70, -69, -71, -74, -78, -82, -90, -95, -101, -105, -110, -999, -999, -999, -999, -999, -999, -999, -999, -999}, {-999, -999, -999, -105, -101, -97, -93, -90, -85, -80, -77, -72, -65, -56, -48, -37, -40, -36, -34, -40, -50, -47, -38, -41, -47, -38, -35, -39, -38, -43, -40, -45, -50, -45, -44, -47, -50, -55, -48, -48, -52, -66, -70, -76, -82, -90, -97, -105, -110, -999, -999, -999, -999, -999, -999, -999}}, /* 707 Hz */ {{-999, -999, -999, -999, -999, -999, -999, -999, -999, -108, -103, -98, -93, -86, -79, -76, -83, -81, -85, -87, -89, -93, -98, -102, -107, -112, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999}, {-999, -999, -999, -999, -999, -999, -999, -999, -999, -108, -103, -98, -93, -86, -79, -71, -77, -74, -77, -79, -81, -84, -85, -90, -92, -93, -92, -98, -101, -108, -112, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999}, {-999, -999, -999, -999, -999, -999, -999, -999, -108, -103, -98, -93, -87, -78, -68, -65, -66, -62, -65, -67, -70, -73, -75, -78, -82, -82, -83, -84, -91, -93, -98, -102, -106, -110, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999}, {-999, -999, -999, -999, -999, -999, -999, -999, -105, -100, -95, -90, -82, -74, -62, -57, -58, -56, -51, -52, -52, -54, -54, -58, -66, -59, -60, -63, -66, -69, -73, -79, -83, -84, -80, -81, -81, -82, -88, -92, -98, -105, -113, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999}, {-999, -999, -999, -999, -999, -999, -999, -107, -102, -97, -92, -84, -79, -69, -57, -47, -52, -47, -44, -45, -50, -52, -42, -42, -53, -43, -43, -48, -51, -56, -55, -52, -57, -59, -61, -62, -67, -71, -78, -83, -86, -94, -98, -103, -110, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999}, {-999, -999, -999, -999, -999, -999, -105, -100, -95, -90, -84, -78, -70, -61, -51, -41, -40, -38, -40, -46, -52, -51, -41, -40, -46, -40, -38, -38, -41, -46, -41, -46, -47, -43, -43, -45, -41, -45, -56, -67, -68, -83, -87, -90, -95, -102, -107, -113, -999, -999, -999, -999, -999, -999, -999, -999}}, /* 1000 Hz */ {{-999, -999, -999, -999, -999, -999, -999, -999, -999, -109, -105, -101, -96, -91, -84, -77, -82, -82, -85, -89, -94, -100, -106, -110, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999}, {-999, -999, -999, -999, -999, -999, -999, -999, -999, -106, -103, -98, -92, -85, -80, -71, -75, -72, -76, -80, -84, -86, -89, -93, -100, -107, -113, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999}, {-999, -999, -999, -999, -999, -999, -999, -107, -104, -101, -97, -92, -88, -84, -80, -64, -66, -63, -64, -66, -69, -73, -77, -83, -83, -86, -91, -98, -104, -111, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999}, {-999, -999, -999, -999, -999, -999, -999, -107, -104, -101, -97, -92, -90, -84, -74, -57, -58, -52, -55, -54, -50, -52, -50, -52, -63, -62, -69, -76, -77, -78, -78, -79, -82, -88, -94, -100, -106, -111, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999}, {-999, -999, -999, -999, -999, -999, -106, -102, -98, -95, -90, -85, -83, -78, -70, -50, -50, -41, -44, -49, -47, -50, -50, -44, -55, -46, -47, -48, -48, -54, -49, -49, -58, -62, -71, -81, -87, -92, -97, -102, -108, -114, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999}, {-999, -999, -999, -999, -999, -999, -106, -102, -98, -95, -90, -85, -83, -78, -70, -45, -43, -41, -47, -50, -51, -50, -49, -45, -47, -41, -44, -41, -39, -43, -38, -37, -40, -41, -44, -50, -58, -65, -73, -79, -85, -92, -97, -101, -105, -109, -113, -999, -999, -999, -999, -999, -999, -999, -999, -999}}, /* 1414 Hz */ {{-999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -107, -100, -95, -87, -81, -85, -83, -88, -93, -100, -107, -114, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999}, {-999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -107, -101, -95, -88, -83, -76, -73, -72, -79, -84, -90, -95, -100, -105, -110, -115, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999}, {-999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -104, -98, -92, -87, -81, -70, -65, -62, -67, -71, -74, -80, -85, -91, -95, -99, -103, -108, -111, -114, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999}, {-999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -103, -97, -90, -85, -76, -60, -56, -54, -60, -62, -61, -56, -63, -65, -73, -74, -77, -75, -78, -81, -86, -87, -88, -91, -94, -98, -103, -110, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999}, {-999, -999, -999, -999, -999, -999, -999, -105, -100, -97, -92, -86, -81, -79, -70, -57, -51, -47, -51, -58, -60, -56, -53, -50, -58, -52, -50, -50, -53, -55, -64, -69, -71, -85, -82, -78, -81, -85, -95, -102, -112, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999}, {-999, -999, -999, -999, -999, -999, -999, -105, -100, -97, -92, -85, -83, -79, -72, -49, -40, -43, -43, -54, -56, -51, -50, -40, -43, -38, -36, -35, -37, -38, -37, -44, -54, -60, -57, -60, -70, -75, -84, -92, -103, -112, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999}}, /* 2000 Hz */ {{-999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -110, -102, -95, -89, -82, -83, -84, -90, -92, -99, -107, -113, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999}, {-999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -107, -101, -95, -89, -83, -72, -74, -78, -85, -88, -88, -90, -92, -98, -105, -111, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999, -999}, {-999, -999, -999, -999, -999, -999, -999, -999, -999, -109, -103, -97, -93, -87, -81, -70, -70, -67, -75, -73, -76, -79, -81, -83, -88, -89, -97, -103, -110, -999, -999, -999,Showing the first 500 of 785 diff lines for this file. This diff is INCOMPLETE; read the file or clone the repository for the rest.
vendor/vorbis/lib/mdct.cadded
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 * * by the Xiph.Org Foundation https://xiph.org/ * * * ******************************************************************** function: normalized modified discrete cosine transform power of two length transform only [64 <= n ] Original algorithm adapted long ago from _The use of multirate filter banks for coding of high quality digital audio_, by T. Sporer, K. Brandenburg and B. Edler, collection of the European Signal Processing Conference (EUSIPCO), Amsterdam, June 1992, Vol.1, pp 211-214 The below code implements an algorithm that no longer looks much like that presented in the paper, but the basic structure remains if you dig deep enough to see it. This module DOES NOT INCLUDE code to generate/apply the window function. Everybody has their own weird favorite including me... I happen to like the properties of y=sin(.5PI*sin^2(x)), but others may vehemently disagree. ********************************************************************//* this can also be run as an integer transform by uncommenting a define in mdct.h; the integerization is a first pass and although it's likely stable for Vorbis, the dynamic range is constrained and roundoff isn't done (so it's noisy). Consider it functional, but only a starting point. There's no point on a machine with an FPU */#include <stdio.h>#include <stdlib.h>#include <string.h>#include <math.h>#include "vorbis/codec.h"#include "mdct.h"#include "os.h"#include "misc.h"/* build lookups for trig functions; also pre-figure scaling and some window function algebra. */void mdct_init(mdct_lookup *lookup,int n){ int *bitrev=_ogg_malloc(sizeof(*bitrev)*(n/4)); DATA_TYPE *T=_ogg_malloc(sizeof(*T)*(n+n/4)); int i; int n2=n>>1; int log2n=lookup->log2n=rint(log((float)n)/log(2.f)); lookup->n=n; lookup->trig=T; lookup->bitrev=bitrev;/* trig lookups... */ for(i=0;i<n/4;i++){ T[i*2]=FLOAT_CONV(cos((M_PI/n)*(4*i))); T[i*2+1]=FLOAT_CONV(-sin((M_PI/n)*(4*i))); T[n2+i*2]=FLOAT_CONV(cos((M_PI/(2*n))*(2*i+1))); T[n2+i*2+1]=FLOAT_CONV(sin((M_PI/(2*n))*(2*i+1))); } for(i=0;i<n/8;i++){ T[n+i*2]=FLOAT_CONV(cos((M_PI/n)*(4*i+2))*.5); T[n+i*2+1]=FLOAT_CONV(-sin((M_PI/n)*(4*i+2))*.5); } /* bitreverse lookup... */ { int mask=(1<<(log2n-1))-1,i,j; int msb=1<<(log2n-2); for(i=0;i<n/8;i++){ int acc=0; for(j=0;msb>>j;j++) if((msb>>j)&i)acc|=1<<j; bitrev[i*2]=((~acc)&mask)-1; bitrev[i*2+1]=acc; } } lookup->scale=FLOAT_CONV(4.f/n);}/* 8 point butterfly (in place, 4 register) */STIN void mdct_butterfly_8(DATA_TYPE *x){ REG_TYPE r0 = x[6] + x[2]; REG_TYPE r1 = x[6] - x[2]; REG_TYPE r2 = x[4] + x[0]; REG_TYPE r3 = x[4] - x[0]; x[6] = r0 + r2; x[4] = r0 - r2; r0 = x[5] - x[1]; r2 = x[7] - x[3]; x[0] = r1 + r0; x[2] = r1 - r0; r0 = x[5] + x[1]; r1 = x[7] + x[3]; x[3] = r2 + r3; x[1] = r2 - r3; x[7] = r1 + r0; x[5] = r1 - r0;}/* 16 point butterfly (in place, 4 register) */STIN void mdct_butterfly_16(DATA_TYPE *x){ REG_TYPE r0 = x[1] - x[9]; REG_TYPE r1 = x[0] - x[8]; x[8] += x[0]; x[9] += x[1]; x[0] = MULT_NORM((r0 + r1) * cPI2_8); x[1] = MULT_NORM((r0 - r1) * cPI2_8); r0 = x[3] - x[11]; r1 = x[10] - x[2]; x[10] += x[2]; x[11] += x[3]; x[2] = r0; x[3] = r1; r0 = x[12] - x[4]; r1 = x[13] - x[5]; x[12] += x[4]; x[13] += x[5]; x[4] = MULT_NORM((r0 - r1) * cPI2_8); x[5] = MULT_NORM((r0 + r1) * cPI2_8); r0 = x[14] - x[6]; r1 = x[15] - x[7]; x[14] += x[6]; x[15] += x[7]; x[6] = r0; x[7] = r1; mdct_butterfly_8(x); mdct_butterfly_8(x+8);}/* 32 point butterfly (in place, 4 register) */STIN void mdct_butterfly_32(DATA_TYPE *x){ REG_TYPE r0 = x[30] - x[14]; REG_TYPE r1 = x[31] - x[15]; x[30] += x[14]; x[31] += x[15]; x[14] = r0; x[15] = r1; r0 = x[28] - x[12]; r1 = x[29] - x[13]; x[28] += x[12]; x[29] += x[13]; x[12] = MULT_NORM( r0 * cPI1_8 - r1 * cPI3_8 ); x[13] = MULT_NORM( r0 * cPI3_8 + r1 * cPI1_8 ); r0 = x[26] - x[10]; r1 = x[27] - x[11]; x[26] += x[10]; x[27] += x[11]; x[10] = MULT_NORM(( r0 - r1 ) * cPI2_8); x[11] = MULT_NORM(( r0 + r1 ) * cPI2_8); r0 = x[24] - x[8]; r1 = x[25] - x[9]; x[24] += x[8]; x[25] += x[9]; x[8] = MULT_NORM( r0 * cPI3_8 - r1 * cPI1_8 ); x[9] = MULT_NORM( r1 * cPI3_8 + r0 * cPI1_8 ); r0 = x[22] - x[6]; r1 = x[7] - x[23]; x[22] += x[6]; x[23] += x[7]; x[6] = r1; x[7] = r0; r0 = x[4] - x[20]; r1 = x[5] - x[21]; x[20] += x[4]; x[21] += x[5]; x[4] = MULT_NORM( r1 * cPI1_8 + r0 * cPI3_8 ); x[5] = MULT_NORM( r1 * cPI3_8 - r0 * cPI1_8 ); r0 = x[2] - x[18]; r1 = x[3] - x[19]; x[18] += x[2]; x[19] += x[3]; x[2] = MULT_NORM(( r1 + r0 ) * cPI2_8); x[3] = MULT_NORM(( r1 - r0 ) * cPI2_8); r0 = x[0] - x[16]; r1 = x[1] - x[17]; x[16] += x[0]; x[17] += x[1]; x[0] = MULT_NORM( r1 * cPI3_8 + r0 * cPI1_8 ); x[1] = MULT_NORM( r1 * cPI1_8 - r0 * cPI3_8 ); mdct_butterfly_16(x); mdct_butterfly_16(x+16);}/* N point first stage butterfly (in place, 2 register) */STIN void mdct_butterfly_first(DATA_TYPE *T, DATA_TYPE *x, int points){ DATA_TYPE *x1 = x + points - 8; DATA_TYPE *x2 = x + (points>>1) - 8; REG_TYPE r0; REG_TYPE r1; do{ r0 = x1[6] - x2[6]; r1 = x1[7] - x2[7]; x1[6] += x2[6]; x1[7] += x2[7]; x2[6] = MULT_NORM(r1 * T[1] + r0 * T[0]); x2[7] = MULT_NORM(r1 * T[0] - r0 * T[1]); r0 = x1[4] - x2[4]; r1 = x1[5] - x2[5]; x1[4] += x2[4]; x1[5] += x2[5]; x2[4] = MULT_NORM(r1 * T[5] + r0 * T[4]); x2[5] = MULT_NORM(r1 * T[4] - r0 * T[5]); r0 = x1[2] - x2[2]; r1 = x1[3] - x2[3]; x1[2] += x2[2]; x1[3] += x2[3]; x2[2] = MULT_NORM(r1 * T[9] + r0 * T[8]); x2[3] = MULT_NORM(r1 * T[8] - r0 * T[9]); r0 = x1[0] - x2[0]; r1 = x1[1] - x2[1]; x1[0] += x2[0]; x1[1] += x2[1]; x2[0] = MULT_NORM(r1 * T[13] + r0 * T[12]); x2[1] = MULT_NORM(r1 * T[12] - r0 * T[13]); x1-=8; x2-=8; T+=16; }while(x2>=x);}/* N/stage point generic N stage butterfly (in place, 2 register) */STIN void mdct_butterfly_generic(DATA_TYPE *T, DATA_TYPE *x, int points, int trigint){ DATA_TYPE *x1 = x + points - 8; DATA_TYPE *x2 = x + (points>>1) - 8; REG_TYPE r0; REG_TYPE r1; do{ r0 = x1[6] - x2[6]; r1 = x1[7] - x2[7]; x1[6] += x2[6]; x1[7] += x2[7]; x2[6] = MULT_NORM(r1 * T[1] + r0 * T[0]); x2[7] = MULT_NORM(r1 * T[0] - r0 * T[1]); T+=trigint; r0 = x1[4] - x2[4]; r1 = x1[5] - x2[5]; x1[4] += x2[4]; x1[5] += x2[5]; x2[4] = MULT_NORM(r1 * T[1] + r0 * T[0]); x2[5] = MULT_NORM(r1 * T[0] - r0 * T[1]); T+=trigint; r0 = x1[2] - x2[2]; r1 = x1[3] - x2[3]; x1[2] += x2[2]; x1[3] += x2[3]; x2[2] = MULT_NORM(r1 * T[1] + r0 * T[0]); x2[3] = MULT_NORM(r1 * T[0] - r0 * T[1]); T+=trigint; r0 = x1[0] - x2[0]; r1 = x1[1] - x2[1]; x1[0] += x2[0]; x1[1] += x2[1]; x2[0] = MULT_NORM(r1 * T[1] + r0 * T[0]); x2[1] = MULT_NORM(r1 * T[0] - r0 * T[1]); T+=trigint; x1-=8; x2-=8; }while(x2>=x);}STIN void mdct_butterflies(mdct_lookup *init, DATA_TYPE *x, int points){ DATA_TYPE *T=init->trig; int stages=init->log2n-5; int i,j; if(--stages>0){ mdct_butterfly_first(T,x,points); } for(i=1;--stages>0;i++){ for(j=0;j<(1<<i);j++) mdct_butterfly_generic(T,x+(points>>i)*j,points>>i,4<<i); } for(j=0;j<points;j+=32) mdct_butterfly_32(x+j);}void mdct_clear(mdct_lookup *l){ if(l){ if(l->trig)_ogg_free(l->trig); if(l->bitrev)_ogg_free(l->bitrev); memset(l,0,sizeof(*l)); }}STIN void mdct_bitreverse(mdct_lookup *init, DATA_TYPE *x){ int n = init->n; int *bit = init->bitrev; DATA_TYPE *w0 = x; DATA_TYPE *w1 = x = w0+(n>>1); DATA_TYPE *T = init->trig+n; do{ DATA_TYPE *x0 = x+bit[0]; DATA_TYPE *x1 = x+bit[1]; REG_TYPE r0 = x0[1] - x1[1]; REG_TYPE r1 = x0[0] + x1[0]; REG_TYPE r2 = MULT_NORM(r1 * T[0] + r0 * T[1]); REG_TYPE r3 = MULT_NORM(r1 * T[1] - r0 * T[0]); w1 -= 4; r0 = HALVE(x0[1] + x1[1]); r1 = HALVE(x0[0] - x1[0]); w0[0] = r0 + r2; w1[2] = r0 - r2; w0[1] = r1 + r3; w1[3] = r3 - r1; x0 = x+bit[2]; x1 = x+bit[3]; r0 = x0[1] - x1[1]; r1 = x0[0] + x1[0]; r2 = MULT_NORM(r1 * T[2] + r0 * T[3]); r3 = MULT_NORM(r1 * T[3] - r0 * T[2]); r0 = HALVE(x0[1] + x1[1]); r1 = HALVE(x0[0] - x1[0]); w0[2] = r0 + r2; w1[0] = r0 - r2; w0[3] = r1 + r3; w1[1] = r3 - r1; T += 4; bit += 4; w0 += 4; }while(w0<w1);}void mdct_backward(mdct_lookup *init, DATA_TYPE *in, DATA_TYPE *out){ int n=init->n; int n2=n>>1; int n4=n>>2; /* rotate */ DATA_TYPE *iX = in+n2-7; DATA_TYPE *oX = out+n2+n4; DATA_TYPE *T = init->trig+n4; do{ oX -= 4; oX[0] = MULT_NORM(-iX[2] * T[3] - iX[0] * T[2]); oX[1] = MULT_NORM (iX[0] * T[3] - iX[2] * T[2]); oX[2] = MULT_NORM(-iX[6] * T[1] - iX[4] * T[0]); oX[3] = MULT_NORM (iX[4] * T[1] - iX[6] * T[0]); iX -= 8; T += 4; }while(iX>=in); iX = in+n2-8; oX = out+n2+n4; T = init->trig+n4; do{ T -= 4; oX[0] = MULT_NORM (iX[4] * T[3] + iX[6] * T[2]); oX[1] = MULT_NORM (iX[4] * T[2] - iX[6] * T[3]); oX[2] = MULT_NORM (iX[0] * T[1] + iX[2] * T[0]); oX[3] = MULT_NORM (iX[0] * T[0] - iX[2] * T[1]); iX -= 8; oX += 4; }while(iX>=in); mdct_butterflies(init,out+n2,n2); mdct_bitreverse(init,out); /* roatate + window */ { DATA_TYPE *oX1=out+n2+n4; DATA_TYPE *oX2=out+n2+n4; DATA_TYPE *iX =out; T =init->trig+n2; do{ oX1-=4; oX1[3] = MULT_NORM (iX[0] * T[1] - iX[1] * T[0]); oX2[0] = -MULT_NORM (iX[0] * T[0] + iX[1] * T[1]); oX1[2] = MULT_NORM (iX[2] * T[3] - iX[3] * T[2]); oX2[1] = -MULT_NORM (iX[2] * T[2] + iX[3] * T[3]); oX1[1] = MULT_NORM (iX[4] * T[5] - iX[5] * T[4]); oX2[2] = -MULT_NORM (iX[4] * T[4] + iX[5] * T[5]); oX1[0] = MULT_NORM (iX[6] * T[7] - iX[7] * T[6]); oX2[3] = -MULT_NORM (iX[6] * T[6] + iX[7] * T[7]); oX2+=4; iX += 8; T += 8; }while(iX<oX1); iX=out+n2+n4; oX1=out+n4; oX2=oX1; do{ oX1-=4; iX-=4; oX2[0] = -(oX1[3] = iX[3]); oX2[1] = -(oX1[2] = iX[2]); oX2[2] = -(oX1[1] = iX[1]); oX2[3] = -(oX1[0] = iX[0]); oX2+=4; }while(oX2<iX); iX=out+n2+n4; oX1=out+n2+n4; oX2=out+n2; do{ oX1-=4; oX1[0]= iX[3]; oX1[1]= iX[2]; oX1[2]= iX[1]; oX1[3]= iX[0]; iX+=4; }while(oX1>oX2); }}void mdct_forward(mdct_lookup *init, DATA_TYPE *in, DATA_TYPE *out){ int n=init->n; int n2=n>>1; int n4=n>>2; int n8=n>>3; DATA_TYPE *w=alloca(n*sizeof(*w)); /* forward needs working space */ DATA_TYPE *w2=w+n2;Showing the first 500 of 563 diff lines for this file. This diff is INCOMPLETE; read the file or clone the repository for the rest.
vendor/vorbis/lib/mdct.hadded
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 * * by the Xiph.Org Foundation https://xiph.org/ * * * ******************************************************************** function: modified discrete cosine transform prototypes ********************************************************************/#ifndef _OGG_mdct_H_#define _OGG_mdct_H_#include "vorbis/codec.h"/*#define MDCT_INTEGERIZED <- be warned there could be some hurt left here*/#ifdef MDCT_INTEGERIZED#define DATA_TYPE int#define REG_TYPE register int#define TRIGBITS 14#define cPI3_8 6270#define cPI2_8 11585#define cPI1_8 15137#define FLOAT_CONV(x) ((int)((x)*(1<<TRIGBITS)+.5))#define MULT_NORM(x) ((x)>>TRIGBITS)#define HALVE(x) ((x)>>1)#else#define DATA_TYPE float#define REG_TYPE float#define cPI3_8 .38268343236508977175F#define cPI2_8 .70710678118654752441F#define cPI1_8 .92387953251128675613F#define FLOAT_CONV(x) (x)#define MULT_NORM(x) (x)#define HALVE(x) ((x)*.5f)#endiftypedef struct { int n; int log2n; DATA_TYPE *trig; int *bitrev; DATA_TYPE scale;} mdct_lookup;extern void mdct_init(mdct_lookup *lookup,int n);extern void mdct_clear(mdct_lookup *l);extern void mdct_forward(mdct_lookup *init, DATA_TYPE *in, DATA_TYPE *out);extern void mdct_backward(mdct_lookup *init, DATA_TYPE *in, DATA_TYPE *out);#endifvendor/vorbis/lib/misc.hadded
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2015 * * by the Xiph.Org Foundation https://xiph.org/ * * * ******************************************************************** function: miscellaneous prototypes ********************************************************************/#ifndef _V_RANDOM_H_#define _V_RANDOM_H_#include "vorbis/codec.h"extern void *_vorbis_block_alloc(vorbis_block *vb,long bytes);extern void _vorbis_block_ripcord(vorbis_block *vb);extern int ov_ilog(ogg_uint32_t v);#ifdef ANALYSISextern int analysis_noisy;extern void _analysis_output(char *base,int i,float *v,int n,int bark,int dB, ogg_int64_t off);extern void _analysis_output_always(char *base,int i,float *v,int n,int bark,int dB, ogg_int64_t off);#endif#ifdef DEBUG_MALLOC#define _VDBG_GRAPHFILE "malloc.m"#undef _VDBG_GRAPHFILEextern void *_VDBG_malloc(void *ptr,long bytes,char *file,long line);extern void _VDBG_free(void *ptr,char *file,long line);#ifndef MISC_C#undef _ogg_malloc#undef _ogg_calloc#undef _ogg_realloc#undef _ogg_free#define _ogg_malloc(x) _VDBG_malloc(NULL,(x),__FILE__,__LINE__)#define _ogg_calloc(x,y) _VDBG_malloc(NULL,(x)*(y),__FILE__,__LINE__)#define _ogg_realloc(x,y) _VDBG_malloc((x),(y),__FILE__,__LINE__)#define _ogg_free(x) _VDBG_free((x),__FILE__,__LINE__)#endif#endif#endifvendor/vorbis/lib/modes/floor_all.hadded
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 * * by the Xiph.Org Foundation https://xiph.org/ * * * ******************************************************************** function: key floor settings ********************************************************************/#include "vorbis/codec.h"#include "backends.h"#include "books/floor/floor_books.h"static const static_codebook*const _floor_128x4_books[]={ &_huff_book_line_128x4_class0, &_huff_book_line_128x4_0sub0, &_huff_book_line_128x4_0sub1, &_huff_book_line_128x4_0sub2, &_huff_book_line_128x4_0sub3,};static const static_codebook*const _floor_256x4_books[]={ &_huff_book_line_256x4_class0, &_huff_book_line_256x4_0sub0, &_huff_book_line_256x4_0sub1, &_huff_book_line_256x4_0sub2, &_huff_book_line_256x4_0sub3,};static const static_codebook*const _floor_128x7_books[]={ &_huff_book_line_128x7_class0, &_huff_book_line_128x7_class1, &_huff_book_line_128x7_0sub1, &_huff_book_line_128x7_0sub2, &_huff_book_line_128x7_0sub3, &_huff_book_line_128x7_1sub1, &_huff_book_line_128x7_1sub2, &_huff_book_line_128x7_1sub3,};static const static_codebook*const _floor_256x7_books[]={ &_huff_book_line_256x7_class0, &_huff_book_line_256x7_class1, &_huff_book_line_256x7_0sub1, &_huff_book_line_256x7_0sub2, &_huff_book_line_256x7_0sub3, &_huff_book_line_256x7_1sub1, &_huff_book_line_256x7_1sub2, &_huff_book_line_256x7_1sub3,};static const static_codebook*const _floor_128x11_books[]={ &_huff_book_line_128x11_class1, &_huff_book_line_128x11_class2, &_huff_book_line_128x11_class3, &_huff_book_line_128x11_0sub0, &_huff_book_line_128x11_1sub0, &_huff_book_line_128x11_1sub1, &_huff_book_line_128x11_2sub1, &_huff_book_line_128x11_2sub2, &_huff_book_line_128x11_2sub3, &_huff_book_line_128x11_3sub1, &_huff_book_line_128x11_3sub2, &_huff_book_line_128x11_3sub3,};static const static_codebook*const _floor_128x17_books[]={ &_huff_book_line_128x17_class1, &_huff_book_line_128x17_class2, &_huff_book_line_128x17_class3, &_huff_book_line_128x17_0sub0, &_huff_book_line_128x17_1sub0, &_huff_book_line_128x17_1sub1, &_huff_book_line_128x17_2sub1, &_huff_book_line_128x17_2sub2, &_huff_book_line_128x17_2sub3, &_huff_book_line_128x17_3sub1, &_huff_book_line_128x17_3sub2, &_huff_book_line_128x17_3sub3,};static const static_codebook*const _floor_256x4low_books[]={ &_huff_book_line_256x4low_class0, &_huff_book_line_256x4low_0sub0, &_huff_book_line_256x4low_0sub1, &_huff_book_line_256x4low_0sub2, &_huff_book_line_256x4low_0sub3,};static const static_codebook*const _floor_1024x27_books[]={ &_huff_book_line_1024x27_class1, &_huff_book_line_1024x27_class2, &_huff_book_line_1024x27_class3, &_huff_book_line_1024x27_class4, &_huff_book_line_1024x27_0sub0, &_huff_book_line_1024x27_1sub0, &_huff_book_line_1024x27_1sub1, &_huff_book_line_1024x27_2sub0, &_huff_book_line_1024x27_2sub1, &_huff_book_line_1024x27_3sub1, &_huff_book_line_1024x27_3sub2, &_huff_book_line_1024x27_3sub3, &_huff_book_line_1024x27_4sub1, &_huff_book_line_1024x27_4sub2, &_huff_book_line_1024x27_4sub3,};static const static_codebook*const _floor_2048x27_books[]={ &_huff_book_line_2048x27_class1, &_huff_book_line_2048x27_class2, &_huff_book_line_2048x27_class3, &_huff_book_line_2048x27_class4, &_huff_book_line_2048x27_0sub0, &_huff_book_line_2048x27_1sub0, &_huff_book_line_2048x27_1sub1, &_huff_book_line_2048x27_2sub0, &_huff_book_line_2048x27_2sub1, &_huff_book_line_2048x27_3sub1, &_huff_book_line_2048x27_3sub2, &_huff_book_line_2048x27_3sub3, &_huff_book_line_2048x27_4sub1, &_huff_book_line_2048x27_4sub2, &_huff_book_line_2048x27_4sub3,};static const static_codebook*const _floor_512x17_books[]={ &_huff_book_line_512x17_class1, &_huff_book_line_512x17_class2, &_huff_book_line_512x17_class3, &_huff_book_line_512x17_0sub0, &_huff_book_line_512x17_1sub0, &_huff_book_line_512x17_1sub1, &_huff_book_line_512x17_2sub1, &_huff_book_line_512x17_2sub2, &_huff_book_line_512x17_2sub3, &_huff_book_line_512x17_3sub1, &_huff_book_line_512x17_3sub2, &_huff_book_line_512x17_3sub3,};static const static_codebook*const _floor_Xx0_books[]={ 0};static const static_codebook*const *const _floor_books[11]={ _floor_128x4_books, _floor_256x4_books, _floor_128x7_books, _floor_256x7_books, _floor_128x11_books, _floor_128x17_books, _floor_256x4low_books, _floor_1024x27_books, _floor_2048x27_books, _floor_512x17_books, _floor_Xx0_books,};static const vorbis_info_floor1 _floor[11]={ /* 0: 128 x 4 */ { 1,{0},{4},{2},{0}, {{1,2,3,4}}, 4,{0,128, 33,8,16,70}, 60,30,500, 1.,18., 128 }, /* 1: 256 x 4 */ { 1,{0},{4},{2},{0}, {{1,2,3,4}}, 4,{0,256, 66,16,32,140}, 60,30,500, 1.,18., 256 }, /* 2: 128 x 7 */ { 2,{0,1},{3,4},{2,2},{0,1}, {{-1,2,3,4},{-1,5,6,7}}, 4,{0,128, 14,4,58, 2,8,28,90}, 60,30,500, 1.,18., 128 }, /* 3: 256 x 7 */ { 2,{0,1},{3,4},{2,2},{0,1}, {{-1,2,3,4},{-1,5,6,7}}, 4,{0,256, 28,8,116, 4,16,56,180}, 60,30,500, 1.,18., 256 }, /* 4: 128 x 11 */ { 4,{0,1,2,3},{2,3,3,3},{0,1,2,2},{-1,0,1,2}, {{3},{4,5},{-1,6,7,8},{-1,9,10,11}}, 2,{0,128, 8,33, 4,16,70, 2,6,12, 23,46,90}, 60,30,500, 1,18., 128 }, /* 5: 128 x 17 */ { 6,{0,1,1,2,3,3},{2,3,3,3},{0,1,2,2},{-1,0,1,2}, {{3},{4,5},{-1,6,7,8},{-1,9,10,11}}, 2,{0,128, 12,46, 4,8,16, 23,33,70, 2,6,10, 14,19,28, 39,58,90}, 60,30,500, 1,18., 128 }, /* 6: 256 x 4 (low bitrate version) */ { 1,{0},{4},{2},{0}, {{1,2,3,4}}, 4,{0,256, 66,16,32,140}, 60,30,500, 1.,18., 256 }, /* 7: 1024 x 27 */ { 8,{0,1,2,2,3,3,4,4},{3,4,3,4,3},{0,1,1,2,2},{-1,0,1,2,3}, {{4},{5,6},{7,8},{-1,9,10,11},{-1,12,13,14}}, 2,{0,1024, 93,23,372, 6,46,186,750, 14,33,65, 130,260,556, 3,10,18,28, 39,55,79,111, 158,220,312, 464,650,850}, 60,30,500, 3,18., 1024 }, /* 8: 2048 x 27 */ { 8,{0,1,2,2,3,3,4,4},{3,4,3,4,3},{0,1,1,2,2},{-1,0,1,2,3}, {{4},{5,6},{7,8},{-1,9,10,11},{-1,12,13,14}}, 2,{0,2048, 186,46,744, 12,92,372,1500, 28,66,130, 260,520,1112, 6,20,36,56, 78,110,158,222, 316,440,624, 928,1300,1700}, 60,30,500, 3,18., 2048 }, /* 9: 512 x 17 */ { 6,{0,1,1,2,3,3},{2,3,3,3},{0,1,2,2},{-1,0,1,2}, {{3},{4,5},{-1,6,7,8},{-1,9,10,11}}, 2,{0,512, 46,186, 16,33,65, 93,130,278, 7,23,39, 55,79,110, 156,232,360}, 60,30,500, 1,18., 512 }, /* 10: X x 0 (LFE floor; edge posts only) */ { 0,{0}, {0},{0},{-1}, {{-1}}, 2,{0,12}, 60,30,500, 1.,18., 10 },};vendor/vorbis/lib/modes/psych_11.hadded
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 * * by the Xiph.Org Foundation https://xiph.org/ * * * ******************************************************************** function: 11kHz settings ********************************************************************/static const double _psy_lowpass_11[3]={4.5,5.5,30.,};static const att3 _psy_tone_masteratt_11[3]={ {{ 30, 25, 12}, 0, 0}, /* 0 */ {{ 30, 25, 12}, 0, 0}, /* 0 */ {{ 20, 0, -14}, 0, 0}, /* 0 */};static const vp_adjblock _vp_tonemask_adj_11[3]={ /* adjust for mode zero */ /* 63 125 250 500 1 2 4 8 16 */ {{-20,-20,-20,-20,-20,-16,-10, 0, 0, 0, 0,10, 2, 0,99,99,99}}, /* 0 */ {{-20,-20,-20,-20,-20,-16,-10, 0, 0, 0, 0, 5, 0, 0,99,99,99}}, /* 1 */ {{-20,-20,-20,-20,-20,-16,-10, 0, 0, 0, 0, 0, 0, 0,99,99,99}}, /* 2 */};static const noise3 _psy_noisebias_11[3]={ /* 63 125 250 500 1k 2k 4k 8k 16k*/ {{{-10,-10,-10,-10, -5, -5, -5, 0, 4, 10, 10, 12, 12, 12, 99, 99, 99}, {-15,-15,-15,-15,-10,-10, -5, 0, 0, 4, 4, 5, 5, 10, 99, 99, 99}, {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, 99, 99, 99}}}, {{{-10,-10,-10,-10, -5, -5, -5, 0, 4, 10, 10, 12, 12, 12, 99, 99, 99}, {-15,-15,-15,-15,-10,-10, -5, -5, -5, 0, 0, 0, 0, 0, 99, 99, 99}, {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, 99, 99, 99}}}, {{{-15,-15,-15,-15,-15,-12,-10, -8, 0, 2, 4, 4, 5, 5, 99, 99, 99}, {-30,-30,-30,-30,-26,-22,-20,-14,-12,-12,-10,-10,-10,-10, 99, 99, 99}, {-30,-30,-30,-30,-26,-26,-26,-26,-26,-26,-26,-26,-26,-24, 99, 99, 99}}},};static const double _noise_thresh_11[3]={ .3,.5,.5 };vendor/vorbis/lib/modes/psych_16.hadded
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 * * by the Xiph.Org Foundation https://xiph.org/ * * * ******************************************************************** function: 16kHz settings ********************************************************************//* stereo mode by base quality level */static const adj_stereo _psy_stereo_modes_16[4]={ /* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 */ {{ 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3}, { 6, 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4}, { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 4, 4}, { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}}, {{ 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3}, { 6, 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4}, { 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 4, 4, 4, 4, 4}, { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}}, {{ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3}, { 5, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3}, { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4}, { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}}, {{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, { 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8}, { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},};static const double _psy_lowpass_16[4]={6.5,8,30.,99.};static const att3 _psy_tone_masteratt_16[4]={ {{ 30, 25, 12}, 0, 0}, /* 0 */ {{ 25, 22, 12}, 0, 0}, /* 0 */ {{ 20, 12, 0}, 0, 0}, /* 0 */ {{ 15, 0, -14}, 0, 0}, /* 0 */};static const vp_adjblock _vp_tonemask_adj_16[4]={ /* adjust for mode zero */ /* 63 125 250 500 1 2 4 8 16 */ {{-20,-20,-20,-20,-20,-16,-10, 0, 0, 0, 0,10, 0, 0, 0, 0, 0}}, /* 0 */ {{-20,-20,-20,-20,-20,-16,-10, 0, 0, 0, 0,10, 0, 0, 0, 0, 0}}, /* 1 */ {{-20,-20,-20,-20,-20,-16,-10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, /* 2 */ {{-30,-30,-30,-30,-30,-26,-20,-10, -5, 0, 0, 0, 0, 0, 0, 0, 0}}, /* 2 */};static const noise3 _psy_noisebias_16_short[4]={ /* 63 125 250 500 1k 2k 4k 8k 16k*/ {{{-15,-15,-15,-15,-15,-10,-10,-5, 4, 10, 10, 10, 10, 12, 12, 14, 20}, {-15,-15,-15,-15,-15,-10,-10, -5, 0, 0, 4, 5, 5, 6, 8, 8, 15}, {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -6, -6}}}, {{{-15,-15,-15,-15,-15,-10,-10,-5, 4, 6, 6, 6, 6, 8, 10, 12, 20}, {-15,-15,-15,-15,-15,-15,-15,-10, -5, -5, -5, 4, 5, 6, 8, 8, 15}, {-30,-30,-30,-30,-30,-24,-20,-14,-10,-10,-10,-10,-10,-10,-10,-10,-10}}}, {{{-15,-15,-15,-15,-15,-12,-10, -8, 0, 2, 4, 4, 5, 5, 5, 8, 12}, {-20,-20,-20,-20,-16,-12,-20,-14,-10,-10, -8, 0, 0, 0, 0, 2, 5}, {-30,-30,-30,-30,-26,-26,-26,-26,-26,-26,-26,-26,-26,-24,-20,-20,-20}}}, {{{-15,-15,-15,-15,-15,-12,-10, -8, -5, -5, -5, -5, -5, 0, 0, 0, 6}, {-30,-30,-30,-30,-26,-22,-20,-14,-12,-12,-10,-10,-10,-10,-10,-10, -6}, {-30,-30,-30,-30,-26,-26,-26,-26,-26,-26,-26,-26,-26,-24,-20,-20,-20}}},};static const noise3 _psy_noisebias_16_impulse[4]={ /* 63 125 250 500 1k 2k 4k 8k 16k*/ {{{-15,-15,-15,-15,-15,-10,-10,-5, 4, 10, 10, 10, 10, 12, 12, 14, 20}, {-15,-15,-15,-15,-15,-10,-10, -5, 0, 0, 4, 5, 5, 6, 8, 8, 15}, {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -6, -6}}}, {{{-15,-15,-15,-15,-15,-10,-10,-5, 4, 4, 4, 4, 5, 5, 6, 8, 15}, {-15,-15,-15,-15,-15,-15,-15,-10, -5, -5, -5, 0, 0, 0, 0, 4, 10}, {-30,-30,-30,-30,-30,-24,-20,-14,-10,-10,-10,-10,-10,-10,-10,-10,-10}}}, {{{-15,-15,-15,-15,-15,-12,-10, -8, 0, 0, 0, 0, 0, 0, 0, 4, 10}, {-20,-20,-20,-20,-16,-12,-20,-14,-10,-10,-10,-10,-10,-10,-10, -7, -5}, {-30,-30,-30,-30,-26,-26,-26,-26,-26,-26,-26,-26,-26,-24,-20,-20,-20}}}, {{{-15,-15,-15,-15,-15,-12,-10, -8, -5, -5, -5, -5, -5, 0, 0, 0, 6}, {-30,-30,-30,-30,-26,-22,-20,-18,-18,-18,-20,-20,-20,-20,-20,-20,-16}, {-30,-30,-30,-30,-26,-26,-26,-26,-26,-26,-26,-26,-26,-24,-20,-20,-20}}},};static const noise3 _psy_noisebias_16[4]={ /* 63 125 250 500 1k 2k 4k 8k 16k*/ {{{-10,-10,-10,-10, -5, -5, -5, 0, 4, 6, 8, 8, 10, 10, 10, 14, 20}, {-10,-10,-10,-10,-10, -5, -2, -2, 0, 0, 0, 4, 5, 6, 8, 8, 15}, {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -6, -6}}}, {{{-10,-10,-10,-10, -5, -5, -5, 0, 4, 6, 6, 6, 6, 8, 10, 12, 20}, {-15,-15,-15,-15,-15,-10, -5, -5, 0, 0, 0, 4, 5, 6, 8, 8, 15}, {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -6, -6}}}, {{{-15,-15,-15,-15,-15,-12,-10, -8, 0, 2, 4, 4, 5, 5, 5, 8, 12}, {-20,-20,-20,-20,-16,-12,-20,-10, -5, -5, 0, 0, 0, 0, 0, 2, 5}, {-30,-30,-30,-30,-26,-26,-26,-26,-26,-26,-26,-26,-26,-24,-20,-20,-20}}}, {{{-15,-15,-15,-15,-15,-12,-10, -8, -5, -5, -5, -5, -5, 0, 0, 0, 6}, {-30,-30,-30,-30,-26,-22,-20,-14,-12,-12,-10,-10,-10,-10,-10,-10, -6}, {-30,-30,-30,-30,-26,-26,-26,-26,-26,-26,-26,-26,-26,-24,-20,-20,-20}}},};static const noiseguard _psy_noiseguards_16[4]={ {10,10,-1}, {10,10,-1}, {20,20,-1}, {20,20,-1},};static const double _noise_thresh_16[4]={ .3,.5,.5,.5 };static const int _noise_start_16[3]={ 256,256,9999 };static const int _noise_part_16[4]={ 8,8,8,8 };static const int _psy_ath_floater_16[4]={ -100,-100,-100,-105,};static const int _psy_ath_abs_16[4]={ -130,-130,-130,-140,};vendor/vorbis/lib/modes/psych_44.hadded
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 * * by the Xiph.Org Foundation https://xiph.org/ * * * ******************************************************************** function: key psychoacoustic settings for 44.1/48kHz ********************************************************************//* preecho trigger settings *****************************************/static const vorbis_info_psy_global _psy_global_44[5]={ {8, /* lines per eighth octave */ {20.f,14.f,12.f,12.f,12.f,12.f,12.f}, {-60.f,-30.f,-40.f,-40.f,-40.f,-40.f,-40.f}, 2,-75.f, -6.f, {99.},{{99.},{99.}},{0},{0},{{0.},{0.}} }, {8, /* lines per eighth octave */ {14.f,10.f,10.f,10.f,10.f,10.f,10.f}, {-40.f,-30.f,-25.f,-25.f,-25.f,-25.f,-25.f}, 2,-80.f, -6.f, {99.},{{99.},{99.}},{0},{0},{{0.},{0.}} }, {8, /* lines per eighth octave */ {12.f,10.f,10.f,10.f,10.f,10.f,10.f}, {-20.f,-20.f,-15.f,-15.f,-15.f,-15.f,-15.f}, 0,-80.f, -6.f, {99.},{{99.},{99.}},{0},{0},{{0.},{0.}} }, {8, /* lines per eighth octave */ {10.f,8.f,8.f,8.f,8.f,8.f,8.f}, {-20.f,-15.f,-12.f,-12.f,-12.f,-12.f,-12.f}, 0,-80.f, -6.f, {99.},{{99.},{99.}},{0},{0},{{0.},{0.}} }, {8, /* lines per eighth octave */ {10.f,6.f,6.f,6.f,6.f,6.f,6.f}, {-15.f,-15.f,-12.f,-12.f,-12.f,-12.f,-12.f}, 0,-85.f, -6.f, {99.},{{99.},{99.}},{0},{0},{{0.},{0.}} },};/* noise compander lookups * low, mid, high quality ****************/static const compandblock _psy_compand_44[6]={ /* sub-mode Z short */ {{ 0, 1, 2, 3, 4, 5, 6, 7, /* 7dB */ 8, 9,10,11,12,13,14, 15, /* 15dB */ 16,17,18,19,20,21,22, 23, /* 23dB */ 24,25,26,27,28,29,30, 31, /* 31dB */ 32,33,34,35,36,37,38, 39, /* 39dB */ }}, /* mode_Z nominal short */ {{ 0, 1, 2, 3, 4, 5, 6, 6, /* 7dB */ 7, 7, 7, 7, 6, 6, 6, 7, /* 15dB */ 7, 8, 9,10,11,12,13, 14, /* 23dB */ 15,16,17,17,17,18,18, 19, /* 31dB */ 19,19,20,21,22,23,24, 25, /* 39dB */ }}, /* mode A short */ {{ 0, 1, 2, 3, 4, 5, 5, 5, /* 7dB */ 6, 6, 6, 5, 4, 4, 4, 4, /* 15dB */ 4, 4, 5, 5, 5, 6, 6, 6, /* 23dB */ 7, 7, 7, 8, 8, 8, 9, 10, /* 31dB */ 11,12,13,14,15,16,17, 18, /* 39dB */ }}, /* sub-mode Z long */ {{ 0, 1, 2, 3, 4, 5, 6, 7, /* 7dB */ 8, 9,10,11,12,13,14, 15, /* 15dB */ 16,17,18,19,20,21,22, 23, /* 23dB */ 24,25,26,27,28,29,30, 31, /* 31dB */ 32,33,34,35,36,37,38, 39, /* 39dB */ }}, /* mode_Z nominal long */ {{ 0, 1, 2, 3, 4, 5, 6, 7, /* 7dB */ 8, 9,10,11,12,12,13, 13, /* 15dB */ 13,14,14,14,15,15,15, 15, /* 23dB */ 16,16,17,17,17,18,18, 19, /* 31dB */ 19,19,20,21,22,23,24, 25, /* 39dB */ }}, /* mode A long */ {{ 0, 1, 2, 3, 4, 5, 6, 7, /* 7dB */ 8, 8, 7, 6, 5, 4, 4, 4, /* 15dB */ 4, 4, 5, 5, 5, 6, 6, 6, /* 23dB */ 7, 7, 7, 8, 8, 8, 9, 10, /* 31dB */ 11,12,13,14,15,16,17, 18, /* 39dB */ }}};/* tonal masking curve level adjustments *************************/static const vp_adjblock _vp_tonemask_adj_longblock[12]={ /* 63 125 250 500 1 2 4 8 16 */ {{ -3, -8,-13,-15,-10,-10,-10,-10,-10,-10,-10, 0, 0, 0, 0, 0, 0}}, /* -1 *//* {{-15,-15,-15,-15,-10, -8, -4, -2, 0, 0, 0, 10, 0, 0, 0, 0, 0}}, 0 */ {{ -4,-10,-14,-16,-15,-14,-13,-12,-12,-12,-11, -1, -1, -1, -1, -1, 0}}, /* 0 *//* {{-15,-15,-15,-15,-15,-12,-10, -8, 0, 0, 0, 5, 0, 0, 0, 0, 0}}, 1 */ {{ -6,-12,-14,-16,-15,-15,-14,-13,-13,-12,-12, -2, -2, -1, -1, -1, 0}}, /* 1 *//* {{-15,-15,-15,-15,-15,-12,-10, -8, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, 2 */ {{-12,-13,-14,-16,-16,-16,-15,-14,-13,-12,-12, -6, -3, -1, -1, -1, 0}}, /* 2 *//* {{-15,-15,-15,-15,-15,-12,-10, -8, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, 3 */ {{-15,-15,-15,-16,-16,-16,-16,-14,-13,-13,-13,-10, -4, -2, -1, -1, 0}}, /* 3 *//* {{-15,-15,-15,-15,-15,-12,-10, -8, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, *//* 4 */ {{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-13,-11, -7 -3, -1, -1 , 0}}, /* 4 *//* {{-15,-15,-15,-15,-15,-12,-10, -8, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, 5 */ {{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-13,-11, -7 -3, -1, -1 , 0}}, /* 5 *//* {{-15,-15,-15,-15,-15,-12,-10, -8, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, 6 */ {{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-14,-12, -8, -4, -2, -2, 0}}, /* 6 *//* {{-15,-15,-15,-15,-15,-12,-10, -8, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, 7 */ {{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-14,-12, -9, -4, -2, -2, 0}}, /* 7 *//* {{-15,-15,-15,-15,-15,-12,-10, -8, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, 8 */ {{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-14,-12, -9, -4, -2, -2, 0}}, /* 8 *//* {{-15,-15,-15,-15,-15,-12,-10, -8, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, 9 */ {{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-14,-12, -9, -4, -2, -2, 0}}, /* 9 *//* {{-15,-15,-15,-15,-15,-12,-10, -8, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, 10 */ {{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-14,-12, -9, -4, -2, -2, 0}}, /* 10 */};static const vp_adjblock _vp_tonemask_adj_otherblock[12]={ /* 63 125 250 500 1 2 4 8 16 */ {{ -3, -8,-13,-15,-10,-10, -9, -9, -9, -9, -9, 1, 1, 1, 1, 1, 1}}, /* -1 *//* {{-20,-20,-20,-20,-14,-12,-10, -8, -4, 0, 0, 10, 0, 0, 0, 0, 0}}, 0 */ {{ -4,-10,-14,-16,-14,-13,-12,-12,-11,-11,-10, 0, 0, 0, 0, 0, 0}}, /* 0 *//* {{-20,-20,-20,-20,-20,-18,-16,-14,-10, 0, 0, 5, 0, 0, 0, 0, 0}}, 1 */ {{ -6,-12,-14,-16,-15,-15,-14,-13,-13,-12,-12, -2, -2, -1, 0, 0, 0}}, /* 1 *//* {{-20,-20,-20,-20,-20,-18,-16,-14,-10, 0, 0, 0, 0, 0, 0, 0, 0}}, 2 */ {{-12,-13,-14,-16,-16,-16,-15,-14,-13,-12,-12, -5, -2, -1, 0, 0, 0}}, /* 2 *//* {{-20,-20,-20,-20,-20,-18,-16,-14,-10, 0, 0, 0, 0, 0, 0, 0, 0}}, 3 */ {{-15,-15,-15,-16,-16,-16,-16,-14,-13,-13,-13,-10, -4, -2, 0, 0, 0}}, /* 3 *//* {{-20,-20,-20,-20,-20,-18,-16,-14,-10, 0, 0, 0, 0, 0, 0, 0, 0}}, 4 */ {{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-13,-11, -7 -3, -1, -1 , 0}}, /* 4 *//* {{-20,-20,-20,-20,-20,-18,-16,-14,-10, 0, 0, 0, 0, 0, 0, 0, 0}}, 5 */ {{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-13,-11, -7 -3, -1, -1 , 0}}, /* 5 *//* {{-20,-20,-20,-20,-20,-18,-16,-14,-10, 0, 0, 0, 0, 0, 0, 0, 0}}, 6 */ {{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-14,-12, -8, -4, -2, -2, 0}}, /* 6 *//* {{-20,-20,-20,-20,-20,-18,-16,-14,-10, 0, 0, 0, 0, 0, 0, 0, 0}}, 7 */ {{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-14,-12, -9, -4, -2, -2, 0}}, /* 7 *//* {{-20,-20,-20,-20,-20,-18,-16,-14,-10, 0, 0, 0, 0, 0, 0, 0, 0}}, 8 */ {{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-14,-12, -9, -4, -2, -2, 0}}, /* 8 *//* {{-20,-20,-20,-20,-20,-18,-16,-14,-10, 0, 0, 0, 0, 0, 0, 0, 0}}, 9 */ {{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-14,-12, -9, -4, -2, -2, 0}}, /* 9 *//* {{-20,-20,-20,-20,-20,-18,-16,-14,-10, 0, 0, 0, 0, 0, 0, 0, 0}}, 10 */ {{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-14,-12, -9, -4, -2, -2, 0}}, /* 10 */};/* noise bias (transition block) */static const noise3 _psy_noisebias_trans[12]={ /* 63 125 250 500 1k 2k 4k 8k 16k*/ /* -1 */ {{{-10,-10,-10,-10,-10, -4, 0, 0, 4, 8, 8, 8, 8, 10, 12, 14, 20}, {-30,-30,-30,-30,-26,-20,-16, -8, -6, -6, -2, 2, 2, 3, 6, 6, 15}, {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -4, -2}}}, /* 0 {{{-15,-15,-15,-15,-15,-12,-10, -8, 0, 2, 4, 4, 5, 5, 5, 8, 10}, {-30,-30,-30,-30,-26,-22,-20,-14, -8, -4, 0, 0, 0, 0, 2, 4, 10}, {-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -6, -6, -6, -4, -4, -4, -2}}},*/ {{{-15,-15,-15,-15,-15,-12, -6, -4, 0, 2, 4, 4, 5, 5, 5, 8, 10}, {-30,-30,-30,-30,-26,-22,-20,-14, -8, -4, 0, 0, 0, 0, 2, 3, 6}, {-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -6, -6, -6, -4, -4, -4, -2}}}, /* 1 {{{-15,-15,-15,-15,-15,-12,-10, -8, 0, 2, 4, 4, 5, 5, 5, 8, 10}, {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -2, -2, -2, -2, 0, 2, 8}, {-30,-30,-30,-30,-26,-22,-20,-14,-10, -8, -8, -8, -8, -6, -6, -6, -4}}},*/ {{{-15,-15,-15,-15,-15,-12,-10, -8, 0, 2, 4, 4, 5, 5, 5, 8, 10}, {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -2, -2, -2, -2, 0, 1, 4}, {-30,-30,-30,-30,-26,-22,-20,-14,-10, -8, -8, -8, -8, -6, -6, -6, -4}}}, /* 2 {{{-15,-15,-15,-15,-15,-12,-10, -8, 0, 2, 2, 2, 4, 4, 5, 6, 10}, {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -2, -2, -2, -2, 0, 2, 6}, {-30,-30,-30,-30,-26,-22,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -4}}}, */ {{{-15,-15,-15,-15,-15,-12,-10, -8, 0, 2, 2, 2, 4, 4, 5, 6, 10}, {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -3, -3, -3, -2, -1, 0, 3}, {-30,-30,-30,-30,-26,-22,-20,-14,-10,-10,-10,-10,-10, -8, -8, -7, -4}}}, /* 3 {{{-15,-15,-15,-15,-15,-12,-10, -8, 0, 2, 2, 2, 4, 4, 4, 5, 8}, {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -3, -3, -3, -3, -1, 1, 6}, {-30,-30,-30,-30,-26,-22,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -4}}},*/ {{{-15,-15,-15,-15,-15,-12,-10, -8, 0, 2, 2, 2, 4, 4, 4, 5, 8}, {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -3, -3, -3, -3, -2, 0, 2}, {-30,-30,-30,-30,-26,-22,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -4}}}, /* 4 {{{-20,-20,-20,-20,-20,-18,-14, -8, -1, 1, 1, 1, 2, 3, 3, 4, 7}, {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -3, -3, -3, -3, -1, 1, 5}, {-30,-30,-30,-30,-26,-22,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -4}}},*/ {{{-20,-20,-20,-20,-20,-18,-14, -8, -1, 1, 1, 1, 2, 3, 3, 4, 7}, {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -3, -3, -3, -3, -2, -1, 1}, {-30,-30,-30,-30,-26,-22,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -4}}}, /* 5 {{{-24,-24,-24,-24,-20,-18,-14, -8, -1, 1, 1, 1, 2, 3, 3, 4, 7}, {-32,-32,-32,-32,-28,-24,-22,-16,-12, -6, -4, -4, -4, -4, -2, -1, 2}, {-34,-34,-34,-34,-30,-24,-24,-18,-14,-12,-12,-12,-12,-10,-10, -9, -5}}}, */ {{{-24,-24,-24,-24,-20,-18,-14, -8, -1, 1, 1, 1, 2, 3, 3, 4, 7}, {-32,-32,-32,-32,-28,-24,-22,-16,-12, -6, -4, -4, -4, -4, -3, -1, 0}, {-34,-34,-34,-34,-30,-24,-24,-18,-14,-12,-12,-12,-12,-10,-10, -9, -5}}}, /* 6 {{{-24,-24,-24,-24,-20,-18,-14, -8, -1, 1, 1, 1, 2, 3, 3, 4, 7}, {-32,-32,-32,-32,-28,-24,-24,-18,-14, -8, -6, -6, -6, -6, -4, -2, 1}, {-34,-34,-34,-34,-30,-26,-24,-18,-17,-15,-15,-15,-15,-13,-13,-12, -8}}},*/ {{{-24,-24,-24,-24,-20,-18,-14, -8, -1, 1, 1, 1, 2, 3, 3, 4, 7}, {-32,-32,-32,-32,-28,-24,-24,-18,-14, -8, -6, -6, -6, -6, -5, -2, 0}, {-34,-34,-34,-34,-30,-26,-26,-24,-22,-19,-19,-19,-19,-18,-17,-16,-12}}}, /* 7 {{{-24,-24,-24,-24,-20,-18,-14, -8, -1, 1, 1, 1, 2, 3, 3, 4, 7}, {-32,-32,-32,-32,-28,-24,-24,-18,-14,-12,-10, -8, -8, -8, -6, -4, 0}, {-34,-34,-34,-34,-30,-26,-26,-24,-22,-19,-19,-19,-19,-18,-17,-16,-12}}},*/ {{{-24,-24,-24,-24,-20,-18,-14, -8, -1, 1, 1, 1, 2, 3, 3, 4, 7}, {-32,-32,-32,-32,-28,-24,-24,-24,-18,-14,-12,-10,-10,-10, -8, -6, -2}, {-34,-34,-34,-34,-30,-26,-26,-26,-24,-24,-24,-24,-24,-24,-24,-20,-16}}}, /* 8 {{{-24,-24,-24,-24,-22,-20,-15,-10, -8, -2, 0, 0, 0, 1, 2, 3, 7}, {-36,-36,-36,-36,-30,-30,-30,-24,-18,-14,-12,-10,-10,-10, -8, -6, -2}, {-36,-36,-36,-36,-34,-30,-28,-26,-24,-24,-24,-24,-24,-24,-24,-20,-16}}},*/ {{{-24,-24,-24,-24,-22,-20,-15,-10, -8, -2, 0, 0, 0, 1, 2, 3, 7}, {-36,-36,-36,-36,-30,-30,-30,-24,-20,-16,-16,-16,-16,-14,-12,-10, -7}, {-36,-36,-36,-36,-34,-30,-28,-26,-24,-30,-30,-30,-30,-30,-30,-24,-20}}}, /* 9 {{{-28,-28,-28,-28,-28,-28,-28,-20,-14, -8, -4, -4, -4, -4, -4, -2, 2}, {-36,-36,-36,-36,-34,-32,-32,-28,-20,-16,-16,-16,-16,-14,-12,-10, -7}, {-40,-40,-40,-40,-40,-40,-40,-32,-30,-30,-30,-30,-30,-30,-30,-24,-20}}},*/ {{{-28,-28,-28,-28,-28,-28,-28,-20,-14, -8, -4, -4, -4, -4, -4, -2, 2}, {-38,-38,-38,-38,-36,-34,-34,-30,-24,-20,-20,-20,-20,-18,-16,-12,-10}, {-40,-40,-40,-40,-40,-40,-40,-38,-35,-35,-35,-35,-35,-35,-35,-35,-30}}}, /* 10 */ {{{-30,-30,-30,-30,-30,-30,-30,-28,-20,-14,-14,-14,-14,-14,-14,-12,-10}, {-40,-40,-40,-40,-40,-40,-40,-40,-35,-30,-30,-30,-30,-30,-30,-30,-20}, {-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40}}},};/* noise bias (long block) */static const noise3 _psy_noisebias_long[12]={ /*63 125 250 500 1k 2k 4k 8k 16k*/ /* -1 */ {{{-10,-10,-10,-10,-10, -4, 0, 0, 0, 6, 6, 6, 6, 10, 10, 12, 20}, {-20,-20,-20,-20,-20,-20,-10, -2, 0, 0, 0, 0, 0, 2, 4, 6, 15}, {-20,-20,-20,-20,-20,-20,-20,-10, -6, -6, -6, -6, -6, -4, -4, -4, -2}}}, /* 0 */ /* {{{-10,-10,-10,-10,-10,-10, -8, 2, 2, 2, 4, 4, 5, 5, 5, 8, 10}, {-20,-20,-20,-20,-20,-20,-20,-14, -6, 0, 0, 0, 0, 0, 2, 4, 10}, {-20,-20,-20,-20,-20,-20,-20,-14, -8, -6, -6, -6, -6, -4, -4, -4, -2}}},*/ {{{-10,-10,-10,-10,-10,-10, -8, 2, 2, 2, 4, 4, 5, 5, 5, 8, 10}, {-20,-20,-20,-20,-20,-20,-20,-14, -6, 0, 0, 0, 0, 0, 2, 3, 6}, {-20,-20,-20,-20,-20,-20,-20,-14, -8, -6, -6, -6, -6, -4, -4, -4, -2}}}, /* 1 */ /* {{{-10,-10,-10,-10,-10,-10, -8, -4, 0, 2, 4, 4, 5, 5, 5, 8, 10}, {-20,-20,-20,-20,-20,-20,-20,-14,-10, -4, -2, -2, -2, -2, 0, 2, 8}, {-20,-20,-20,-20,-20,-20,-20,-14,-10, -8, -8, -8, -8, -6, -6, -6, -4}}},*/ {{{-10,-10,-10,-10,-10,-10, -8, -4, 0, 2, 4, 4, 5, 5, 5, 8, 10}, {-20,-20,-20,-20,-20,-20,-20,-14,-10, -4, -2, -2, -2, -2, 0, 1, 4}, {-20,-20,-20,-20,-20,-20,-20,-14,-10, -8, -8, -8, -8, -6, -6, -6, -4}}}, /* 2 */ /* {{{-10,-10,-10,-10,-10,-10,-10, -8, 0, 2, 2, 2, 4, 4, 5, 6, 10}, {-20,-20,-20,-20,-20,-20,-20,-14,-10, -4, -2, -2, -2, -2, 0, 2, 6}, {-20,-20,-20,-20,-20,-20,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -4}}},*/ {{{-10,-10,-10,-10,-10,-10,-10, -8, 0, 2, 2, 2, 4, 4, 5, 6, 10}, {-20,-20,-20,-20,-20,-20,-20,-14,-10, -4, -3, -3, -3, -2, -1, 0, 3}, {-20,-20,-20,-20,-20,-20,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -4}}}, /* 3 */ /* {{{-10,-10,-10,-10,-10,-10,-10, -8, 0, 2, 2, 2, 4, 4, 4, 5, 8}, {-20,-20,-20,-20,-20,-20,-20,-14,-10, -4, -3, -3, -3, -3, -1, 1, 6}, {-20,-20,-20,-20,-20,-20,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -4}}},*/ {{{-10,-10,-10,-10,-10,-10,-10, -8, 0, 2, 2, 2, 4, 4, 4, 5, 8}, {-20,-20,-20,-20,-20,-20,-20,-14,-10, -4, -3, -3, -3, -3, -2, 0, 2}, {-20,-20,-20,-20,-20,-20,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -5}}}, /* 4 */ /* {{{-15,-15,-15,-15,-15,-15,-15,-10, -4, 1, 1, 1, 2, 3, 3, 4, 7}, {-20,-20,-20,-20,-20,-20,-20,-14,-10, -4, -3, -3, -3, -3, -1, 1, 5}, {-20,-20,-20,-20,-20,-20,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -4}}},*/ {{{-15,-15,-15,-15,-15,-15,-15,-10, -4, 1, 1, 1, 2, 3, 3, 4, 7}, {-20,-20,-20,-20,-20,-20,-20,-14,-10, -4, -3, -3, -3, -3, -2, -1, 1}, {-20,-20,-20,-20,-20,-20,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -7}}}, /* 5 */ /* {{{-15,-15,-15,-15,-15,-15,-15,-10, -4, 1, 1, 1, 2, 3, 3, 4, 7}, {-22,-22,-22,-22,-22,-22,-22,-16,-12, -6, -4, -4, -4, -4, -2, -1, 2}, {-24,-24,-24,-24,-24,-24,-24,-18,-14,-12,-12,-12,-12,-10,-10, -9, -5}}},*/ {{{-15,-15,-15,-15,-15,-15,-15,-10, -4, 1, 1, 1, 2, 3, 3, 4, 7}, {-22,-22,-22,-22,-22,-22,-22,-16,-12, -6, -4, -4, -4, -4, -3, -1, 0}, {-24,-24,-24,-24,-24,-24,-24,-18,-14,-12,-12,-12,-12,-10,-10, -9, -8}}}, /* 6 */ /* {{{-15,-15,-15,-15,-15,-15,-15,-10, -4, 1, 1, 1, 2, 3, 3, 4, 7}, {-24,-24,-24,-24,-24,-24,-24,-18,-14, -8, -6, -6, -6, -6, -4, -2, 1}, {-26,-26,-26,-26,-26,-26,-26,-18,-16,-15,-15,-15,-15,-13,-13,-12, -8}}},*/ {{{-15,-15,-15,-15,-15,-15,-15,-10, -4, 1, 1, 1, 2, 3, 3, 4, 7}, {-24,-24,-24,-24,-24,-24,-24,-18,-14, -8, -6, -6, -6, -6, -5, -2, 0}, {-26,-26,-26,-26,-26,-26,-26,-18,-16,-15,-15,-15,-15,-13,-13,-12,-10}}}, /* 7 */ {{{-15,-15,-15,-15,-15,-15,-15,-10, -4, 1, 1, 1, 2, 3, 3, 4, 7}, {-24,-24,-24,-24,-24,-24,-24,-18,-14,-10, -8, -8, -8, -8, -6, -4, 0}, {-26,-26,-26,-26,-26,-26,-26,-22,-20,-19,-19,-19,-19,-18,-17,-16,-12}}}, /* 8 */ {{{-15,-15,-15,-15,-15,-15,-15,-10, -4, 0, 0, 0, 0, 1, 2, 3, 7}, {-26,-26,-26,-26,-26,-26,-26,-20,-16,-12,-10,-10,-10,-10, -8, -6, -2}, {-28,-28,-28,-28,-28,-28,-28,-26,-24,-24,-24,-24,-24,-24,-24,-20,-16}}}, /* 9 */ {{{-22,-22,-22,-22,-22,-22,-22,-18,-14, -8, -4, -4, -4, -4, -4, -2, 2}, {-26,-26,-26,-26,-26,-26,-26,-22,-18,-16,-16,-16,-16,-14,-12,-10, -7}, {-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-24,-20}}}, /* 10 */ {{{-24,-24,-24,-24,-24,-24,-24,-24,-24,-18,-14,-14,-14,-14,-14,-12,-10}, {-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-20}, {-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40}}},};/* noise bias (impulse block) */static const noise3 _psy_noisebias_impulse[12]={ /* 63 125 250 500 1k 2k 4k 8k 16k*/ /* -1 */ {{{-10,-10,-10,-10,-10, -4, 0, 0, 4, 8, 8, 8, 8, 10, 12, 14, 20}, {-30,-30,-30,-30,-26,-20,-16, -8, -6, -6, -2, 2, 2, 3, 6, 6, 15}, {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -4, -2}}}, /* 0 */ /* {{{-10,-10,-10,-10,-10, -4, 0, 0, 4, 4, 8, 8, 8, 10, 12, 14, 20}, {-30,-30,-30,-30,-26,-22,-20,-14, -6, -2, 0, 0, 0, 0, 2, 4, 10}, {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -4, -2}}},*/ {{{-10,-10,-10,-10,-10, -4, 0, 0, 4, 4, 8, 8, 8, 10, 12, 14, 20}, {-30,-30,-30,-30,-26,-22,-20,-14, -6, -2, 0, 0, 0, 0, 2, 3, 6}, {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -4, -2}}}, /* 1 */ {{{-12,-12,-12,-12,-12, -8, -6, -4, 0, 4, 4, 4, 4, 10, 12, 14, 20}, {-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -4, -4, -2, -2, -2, -2, 2}, {-30,-30,-30,-30,-26,-22,-20,-14,-10, -8,-10,-10, -8, -8, -8, -6, -4}}}, /* 2 */ {{{-14,-14,-14,-14,-14,-10, -8, -6, -2, 2, 2, 2, 2, 8, 10, 10, 16}, {-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -6, -6, -4, -4, -4, -2, 0}, {-30,-30,-30,-30,-26,-22,-20,-14,-10,-10,-10,-10,-10,-10,-10, -8, -4}}}, /* 3 */ {{{-14,-14,-14,-14,-14,-10, -8, -6, -2, 2, 2, 2, 2, 6, 8, 8, 14}, {-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -6, -6, -4, -4, -4, -2, 0}, {-30,-30,-30,-30,-26,-22,-20,-14,-10,-10,-10,-10,-10,-10,-10, -8, -4}}}, /* 4 */ {{{-16,-16,-16,-16,-16,-12,-10, -6, -2, 0, 0, 0, 0, 4, 6, 6, 12}, {-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -6, -6, -4, -4, -4, -2, 0}, {-30,-30,-30,-30,-26,-22,-20,-14,-10,-10,-10,-10,-10,-10,-10, -8, -4}}}, /* 5 */ {{{-20,-20,-20,-20,-20,-18,-14,-10, -4, 0, 0, 0, 0, 4, 4, 6, 11}, {-32,-32,-32,-32,-28,-24,-22,-16,-10, -6, -8, -8, -6, -6, -6, -4, -2}, {-34,-34,-34,-34,-30,-26,-24,-18,-14,-12,-12,-12,-12,-12,-10, -9, -5}}}, /* 6 {{{-20,-20,-20,-20,-20,-18,-14,-10, -4, 0, 0, 0, 0, 4, 4, 6, 11}, {-34,-34,-34,-34,-30,-30,-24,-20,-12,-12,-14,-14,-10, -9, -8, -6, -4}, {-34,-34,-34,-34,-34,-30,-26,-20,-16,-15,-15,-15,-15,-15,-13,-12, -8}}},*/ {{{-20,-20,-20,-20,-20,-18,-14,-10, -4, 0, 0, 0, 0, 4, 4, 6, 11}, {-34,-34,-34,-34,-30,-30,-30,-24,-16,-16,-16,-16,-16,-16,-14,-14,-12}, {-36,-36,-36,-36,-36,-34,-28,-24,-20,-20,-20,-20,-20,-20,-20,-18,-16}}}, /* 7 */ /* {{{-22,-22,-22,-22,-22,-20,-14,-10, -6, 0, 0, 0, 0, 4, 4, 6, 11}, {-34,-34,-34,-34,-30,-30,-24,-20,-14,-14,-16,-16,-14,-12,-10,-10,-10}, {-34,-34,-34,-34,-32,-32,-30,-24,-20,-19,-19,-19,-19,-19,-17,-16,-12}}},*/ {{{-22,-22,-22,-22,-22,-20,-14,-10, -6, 0, 0, 0, 0, 4, 4, 6, 11}, {-34,-34,-34,-34,-30,-30,-30,-30,-26,-26,-26,-26,-26,-26,-26,-24,-22}, {-40,-40,-40,-40,-40,-40,-40,-32,-30,-30,-30,-30,-30,-30,-30,-30,-24}}}, /* 8 */ /* {{{-24,-24,-24,-24,-24,-22,-14,-10, -6, -1, -1, -1, -1, 3, 3, 5, 10}, {-34,-34,-34,-34,-30,-30,-30,-24,-20,-20,-20,-20,-20,-18,-16,-16,-14}, {-36,-36,-36,-36,-36,-34,-28,-24,-24,-24,-24,-24,-24,-24,-24,-20,-16}}},*/ {{{-24,-24,-24,-24,-24,-22,-14,-10, -6, -1, -1, -1, -1, 3, 3, 5, 10}, {-34,-34,-34,-34,-34,-32,-32,-30,-26,-26,-26,-26,-26,-26,-26,-26,-24}, {-40,-40,-40,-40,-40,-40,-40,-32,-30,-30,-30,-30,-30,-30,-30,-30,-24}}}, /* 9 */ /* {{{-28,-28,-28,-28,-28,-28,-28,-20,-14, -8, -4, -4, -4, -4, -4, -2, 2}, {-36,-36,-36,-36,-34,-32,-32,-30,-26,-26,-26,-26,-26,-22,-20,-20,-18}, {-40,-40,-40,-40,-40,-40,-40,-32,-30,-30,-30,-30,-30,-30,-30,-24,-20}}},*/ {{{-28,-28,-28,-28,-28,-28,-28,-20,-14, -8, -4, -4, -4, -4, -4, -2, 2}, {-36,-36,-36,-36,-34,-32,-32,-30,-26,-26,-26,-26,-26,-26,-26,-26,-26}, {-40,-40,-40,-40,-40,-40,-40,-32,-30,-30,-30,-30,-30,-30,-30,-24,-20}}}, /* 10 */ {{{-30,-30,-30,-30,-30,-26,-24,-24,-24,-20,-16,-16,-16,-16,-16,-14,-12}, {-40,-40,-40,-40,-40,-40,-40,-40,-35,-30,-30,-30,-30,-30,-30,-30,-26}, {-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40}}},};/* noise bias (padding block) */static const noise3 _psy_noisebias_padding[12]={ /* 63 125 250 500 1k 2k 4k 8k 16k*/ /* -1 */ {{{-10,-10,-10,-10,-10, -4, 0, 0, 4, 8, 8, 8, 8, 10, 12, 14, 20}, {-30,-30,-30,-30,-26,-20,-16, -8, -6, -6, -2, 2, 2, 3, 6, 6, 15}, {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -4, -2}}}, /* 0 */ {{{-10,-10,-10,-10,-10, -4, 0, 0, 4, 8, 8, 8, 8, 10, 12, 14, 20}, {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -2, 2, 3, 6, 6, 8, 10}, {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -4, -4, -4, -4, -2, 0, 2}}}, /* 1 */ {{{-12,-12,-12,-12,-12, -8, -6, -4, 0, 4, 4, 4, 4, 10, 12, 14, 20}, {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, 0, 0, 0, 2, 2, 4, 8}, {-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -6, -6, -6, -6, -4, -2, 0}}}, /* 2 */ /* {{{-14,-14,-14,-14,-14,-10, -8, -6, -2, 2, 2, 2, 2, 8, 10, 10, 16}, {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, 0, 0, 0, 2, 2, 4, 8}, {-30,-30,-30,-30,-26,-22,-20,-14,-10, -8, -8, -8, -8, -8, -6, -4, -2}}},*/ {{{-14,-14,-14,-14,-14,-10, -8, -6, -2, 2, 2, 2, 2, 8, 10, 10, 16}, {-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -1, -1, -1, 0, 0, 2, 6}, {-30,-30,-30,-30,-26,-22,-20,-14,-10, -8, -8, -8, -8, -8, -6, -4, -2}}}, /* 3 */ {{{-14,-14,-14,-14,-14,-10, -8, -6, -2, 2, 2, 2, 2, 6, 8, 8, 14}, {-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -1, -1, -1, 0, 0, 2, 6}, {-30,-30,-30,-30,-26,-22,-20,-14,-10, -8, -8, -8, -8, -8, -6, -4, -2}}}, /* 4 */ {{{-16,-16,-16,-16,-16,-12,-10, -6, -2, 0, 0, 0, 0, 4, 6, 6, 12}, {-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -1, -1, -1, -1, 0, 2, 6}, {-30,-30,-30,-30,-26,-22,-20,-14,-10, -8, -8, -8, -8, -8, -6, -4, -2}}}, /* 5 */ {{{-20,-20,-20,-20,-20,-18,-14,-10, -4, 0, 0, 0, 0, 4, 6, 6, 12}, {-32,-32,-32,-32,-28,-24,-22,-16,-12, -6, -3, -3, -3, -3, -2, 0, 4}, {-34,-34,-34,-34,-30,-26,-24,-18,-14,-10,-10,-10,-10,-10, -8, -5, -3}}}, /* 6 */ {{{-20,-20,-20,-20,-20,-18,-14,-10, -4, 0, 0, 0, 0, 4, 6, 6, 12}, {-34,-34,-34,-34,-30,-30,-24,-20,-14, -8, -4, -4, -4, -4, -3, -1, 4}, {-34,-34,-34,-34,-34,-30,-26,-20,-16,-13,-13,-13,-13,-13,-11, -8, -6}}}, /* 7 */ {{{-20,-20,-20,-20,-20,-18,-14,-10, -4, 0, 0, 0, 0, 4, 6, 6, 12}, {-34,-34,-34,-34,-30,-30,-30,-24,-16,-10, -8, -6, -6, -6, -5, -3, 1}, {-34,-34,-34,-34,-32,-32,-28,-22,-18,-16,-16,-16,-16,-16,-14,-12,-10}}}, /* 8 */ {{{-22,-22,-22,-22,-22,-20,-14,-10, -4, 0, 0, 0, 0, 3, 5, 5, 11}, {-34,-34,-34,-34,-30,-30,-30,-24,-16,-12,-10, -8, -8, -8, -7, -5, -2}, {-36,-36,-36,-36,-36,-34,-28,-22,-20,-20,-20,-20,-20,-20,-20,-16,-14}}}, /* 9 */ {{{-28,-28,-28,-28,-28,-28,-28,-20,-14, -8, -2, -2, -2, -2, 0, 2, 6}, {-36,-36,-36,-36,-34,-32,-32,-24,-16,-12,-12,-12,-12,-12,-10, -8, -5}, {-40,-40,-40,-40,-40,-40,-40,-32,-26,-24,-24,-24,-24,-24,-24,-20,-18}}}, /* 10 */ {{{-30,-30,-30,-30,-30,-26,-24,-24,-24,-20,-12,-12,-12,-12,-12,-10, -8}, {-40,-40,-40,-40,-40,-40,-40,-40,-35,-30,-25,-25,-25,-25,-25,-25,-15}, {-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40}}},};static const noiseguard _psy_noiseguards_44[4]={ {3,3,15}, {3,3,15}, {10,10,100}, {10,10,100},};static const int _psy_tone_suppress[12]={ -20,-20,-20,-20,-20,-24,-30,-40,-40,-45,-45,-45,};static const int _psy_tone_0dB[12]={ 90,90,95,95,95,95,105,105,105,105,105,105,};static const int _psy_noise_suppress[12]={ -20,-20,-24,-24,-24,-24,-30,-40,-40,-45,-45,-45,};static const vorbis_info_psy _psy_info_template={ /* blockflag */ -1, /* ath_adjatt, ath_maxatt */ -140.,-140., /* tonemask att boost/decay,suppr,curves */ {0.f,0.f,0.f}, 0.,0., -40.f, {0.}, /*noisemaskp,supp, low/high window, low/hi guard, minimum */ 1, -0.f, .5f, .5f, 0,0,0,Showing the first 500 of 642 diff lines for this file. This diff is INCOMPLETE; read the file or clone the repository for the rest.
vendor/vorbis/lib/modes/psych_8.hadded
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 * * by the Xiph.Org Foundation https://xiph.org/ * * * ******************************************************************** function: 8kHz psychoacoustic settings ********************************************************************/static const att3 _psy_tone_masteratt_8[3]={ {{ 32, 25, 12}, 0, 0}, /* 0 */ {{ 30, 25, 12}, 0, 0}, /* 0 */ {{ 20, 0, -14}, 0, 0}, /* 0 */};static const vp_adjblock _vp_tonemask_adj_8[3]={ /* adjust for mode zero */ /* 63 125 250 500 1 2 4 8 16 */ {{-15,-15,-15,-15,-10,-10, -6, 0, 0, 0, 0,10, 0, 0,99,99,99}}, /* 1 */ {{-15,-15,-15,-15,-10,-10, -6, 0, 0, 0, 0,10, 0, 0,99,99,99}}, /* 1 */ {{-15,-15,-15,-15,-10,-10, -6, 0, 0, 0, 0, 0, 0, 0,99,99,99}}, /* 1 */};static const noise3 _psy_noisebias_8[3]={ /* 63 125 250 500 1k 2k 4k 8k 16k*/ {{{-10,-10,-10,-10, -5, -5, -5, 0, 4, 8, 8, 8, 10, 10, 99, 99, 99}, {-10,-10,-10,-10, -5, -5, -5, 0, 0, 4, 4, 4, 4, 4, 99, 99, 99}, {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, 99, 99, 99}}}, {{{-10,-10,-10,-10, -5, -5, -5, 0, 4, 8, 8, 8, 10, 10, 99, 99, 99}, {-10,-10,-10,-10,-10,-10, -5, -5, -5, 0, 0, 0, 0, 0, 99, 99, 99}, {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, 99, 99, 99}}}, {{{-15,-15,-15,-15,-15,-12,-10, -8, 0, 2, 4, 4, 5, 5, 99, 99, 99}, {-30,-30,-30,-30,-26,-22,-20,-14,-12,-12,-10,-10,-10,-10, 99, 99, 99}, {-30,-30,-30,-30,-26,-26,-26,-26,-26,-26,-26,-26,-26,-24, 99, 99, 99}}},};/* stereo mode by base quality level */static const adj_stereo _psy_stereo_modes_8[3]={ /* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 */ {{ 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3}, { 6, 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4}, { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}}, {{ 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3}, { 6, 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4}, { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}}, {{ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3}, { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4}, { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},};static const noiseguard _psy_noiseguards_8[2]={ {10,10,-1}, {10,10,-1},};static const compandblock _psy_compand_8[2]={ {{ 0, 1, 2, 3, 4, 5, 6, 7, /* 7dB */ 8, 8, 9, 9,10,10,11, 11, /* 15dB */ 12,12,13,13,14,14,15, 15, /* 23dB */ 16,16,17,17,17,18,18, 19, /* 31dB */ 19,19,20,21,22,23,24, 25, /* 39dB */ }}, {{ 0, 1, 2, 3, 4, 5, 6, 6, /* 7dB */ 7, 7, 6, 6, 5, 5, 4, 4, /* 15dB */ 3, 3, 3, 4, 5, 6, 7, 8, /* 23dB */ 9,10,11,12,13,14,15, 16, /* 31dB */ 17,18,19,20,21,22,23, 24, /* 39dB */ }},};static const double _psy_lowpass_8[3]={3.,4.,4.};static const int _noise_start_8[2]={ 64,64,};static const int _noise_part_8[2]={ 8,8,};static const int _psy_ath_floater_8[3]={ -100,-100,-105,};static const int _psy_ath_abs_8[3]={ -130,-130,-140,};vendor/vorbis/lib/modes/residue_16.hadded
/******************************************************************** * * * This FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 * * by the Xiph.Org Foundation https://xiph.org/ * * * ******************************************************************** function: toplevel residue templates 16/22kHz ********************************************************************//***** residue backends *********************************************/static const static_bookblock _resbook_16s_0={ { {0}, {0,0,&_16c0_s_p1_0}, {0}, {0,0,&_16c0_s_p3_0}, {0,0,&_16c0_s_p4_0}, {0,0,&_16c0_s_p5_0}, {0,0,&_16c0_s_p6_0}, {&_16c0_s_p7_0,&_16c0_s_p7_1}, {&_16c0_s_p8_0,&_16c0_s_p8_1}, {&_16c0_s_p9_0,&_16c0_s_p9_1,&_16c0_s_p9_2} }};static const static_bookblock _resbook_16s_1={ { {0}, {0,0,&_16c1_s_p1_0}, {0}, {0,0,&_16c1_s_p3_0}, {0,0,&_16c1_s_p4_0}, {0,0,&_16c1_s_p5_0}, {0,0,&_16c1_s_p6_0}, {&_16c1_s_p7_0,&_16c1_s_p7_1}, {&_16c1_s_p8_0,&_16c1_s_p8_1}, {&_16c1_s_p9_0,&_16c1_s_p9_1,&_16c1_s_p9_2} }};static const static_bookblock _resbook_16s_2={ { {0}, {0,0,&_16c2_s_p1_0}, {0,0,&_16c2_s_p2_0}, {0,0,&_16c2_s_p3_0}, {0,0,&_16c2_s_p4_0}, {&_16c2_s_p5_0,&_16c2_s_p5_1}, {&_16c2_s_p6_0,&_16c2_s_p6_1}, {&_16c2_s_p7_0,&_16c2_s_p7_1}, {&_16c2_s_p8_0,&_16c2_s_p8_1}, {&_16c2_s_p9_0,&_16c2_s_p9_1,&_16c2_s_p9_2} }};static const vorbis_residue_template _res_16s_0[]={ {2,0,32, &_residue_44_mid, &_huff_book__16c0_s_single,&_huff_book__16c0_s_single, &_resbook_16s_0,&_resbook_16s_0},};static const vorbis_residue_template _res_16s_1[]={ {2,0,32, &_residue_44_mid, &_huff_book__16c1_s_short,&_huff_book__16c1_s_short, &_resbook_16s_1,&_resbook_16s_1}, {2,0,32, &_residue_44_mid, &_huff_book__16c1_s_long,&_huff_book__16c1_s_long, &_resbook_16s_1,&_resbook_16s_1}};static const vorbis_residue_template _res_16s_2[]={ {2,0,32, &_residue_44_high, &_huff_book__16c2_s_short,&_huff_book__16c2_s_short, &_resbook_16s_2,&_resbook_16s_2}, {2,0,32, &_residue_44_high, &_huff_book__16c2_s_long,&_huff_book__16c2_s_long, &_resbook_16s_2,&_resbook_16s_2}};static const vorbis_mapping_template _mapres_template_16_stereo[3]={ { _map_nominal, _res_16s_0 }, /* 0 */ { _map_nominal, _res_16s_1 }, /* 1 */ { _map_nominal, _res_16s_2 }, /* 2 */};static const static_bookblock _resbook_16u_0={ { {0}, {0,0,&_16u0__p1_0}, {0,0,&_16u0__p2_0}, {0,0,&_16u0__p3_0}, {0,0,&_16u0__p4_0}, {0,0,&_16u0__p5_0}, {&_16u0__p6_0,&_16u0__p6_1}, {&_16u0__p7_0,&_16u0__p7_1,&_16u0__p7_2} }};static const static_bookblock _resbook_16u_1={ { {0}, {0,0,&_16u1__p1_0}, {0,0,&_16u1__p2_0}, {0,0,&_16u1__p3_0}, {0,0,&_16u1__p4_0}, {0,0,&_16u1__p5_0}, {0,0,&_16u1__p6_0}, {&_16u1__p7_0,&_16u1__p7_1}, {&_16u1__p8_0,&_16u1__p8_1}, {&_16u1__p9_0,&_16u1__p9_1,&_16u1__p9_2} }};static const static_bookblock _resbook_16u_2={ { {0}, {0,0,&_16u2_p1_0}, {0,0,&_16u2_p2_0}, {0,0,&_16u2_p3_0}, {0,0,&_16u2_p4_0}, {&_16u2_p5_0,&_16u2_p5_1}, {&_16u2_p6_0,&_16u2_p6_1}, {&_16u2_p7_0,&_16u2_p7_1}, {&_16u2_p8_0,&_16u2_p8_1}, {&_16u2_p9_0,&_16u2_p9_1,&_16u2_p9_2} }};static const vorbis_residue_template _res_16u_0[]={ {1,0,32, &_residue_44_low_un, &_huff_book__16u0__single,&_huff_book__16u0__single, &_resbook_16u_0,&_resbook_16u_0},};static const vorbis_residue_template _res_16u_1[]={ {1,0,32, &_residue_44_mid_un, &_huff_book__16u1__short,&_huff_book__16u1__short, &_resbook_16u_1,&_resbook_16u_1}, {1,0,32, &_residue_44_mid_un, &_huff_book__16u1__long,&_huff_book__16u1__long, &_resbook_16u_1,&_resbook_16u_1}};static const vorbis_residue_template _res_16u_2[]={ {1,0,32, &_residue_44_hi_un, &_huff_book__16u2__short,&_huff_book__16u2__short, &_resbook_16u_2,&_resbook_16u_2}, {1,0,32, &_residue_44_hi_un, &_huff_book__16u2__long,&_huff_book__16u2__long, &_resbook_16u_2,&_resbook_16u_2}};static const vorbis_mapping_template _mapres_template_16_uncoupled[3]={ { _map_nominal_u, _res_16u_0 }, /* 0 */ { _map_nominal_u, _res_16u_1 }, /* 1 */ { _map_nominal_u, _res_16u_2 }, /* 2 */};vendor/vorbis/lib/modes/residue_44.hadded
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 * * by the Xiph.Org Foundation https://xiph.org/ * * * ******************************************************************** function: toplevel residue templates for 32/44.1/48kHz ********************************************************************/#include "vorbis/codec.h"#include "backends.h"#include "books/coupled/res_books_stereo.h"/***** residue backends *********************************************/static const vorbis_info_residue0 _residue_44_low={ 0,-1, -1, 9,-1,-1, /* 0 1 2 3 4 5 6 7 */ {0}, {-1}, { 0, 1, 2, 2, 4, 8, 16, 32}, { 0, 0, 0,999, 4, 8, 16, 32},};static const vorbis_info_residue0 _residue_44_mid={ 0,-1, -1, 10,-1,-1, /* 0 1 2 3 4 5 6 7 8 */ {0}, {-1}, { 0, 1, 1, 2, 2, 4, 8, 16, 32}, { 0, 0,999, 0,999, 4, 8, 16, 32},};static const vorbis_info_residue0 _residue_44_high={ 0,-1, -1, 10,-1,-1, /* 0 1 2 3 4 5 6 7 8 */ {0}, {-1}, { 0, 1, 2, 4, 8, 16, 32, 71,157}, { 0, 1, 2, 3, 4, 8, 16, 71,157},};static const static_bookblock _resbook_44s_n1={ { {0},{0,0,&_44cn1_s_p1_0},{0,0,&_44cn1_s_p2_0}, {0,0,&_44cn1_s_p3_0},{0,0,&_44cn1_s_p4_0},{0,0,&_44cn1_s_p5_0}, {&_44cn1_s_p6_0,&_44cn1_s_p6_1},{&_44cn1_s_p7_0,&_44cn1_s_p7_1}, {&_44cn1_s_p8_0,&_44cn1_s_p8_1,&_44cn1_s_p8_2} }};static const static_bookblock _resbook_44sm_n1={ { {0},{0,0,&_44cn1_sm_p1_0},{0,0,&_44cn1_sm_p2_0}, {0,0,&_44cn1_sm_p3_0},{0,0,&_44cn1_sm_p4_0},{0,0,&_44cn1_sm_p5_0}, {&_44cn1_sm_p6_0,&_44cn1_sm_p6_1},{&_44cn1_sm_p7_0,&_44cn1_sm_p7_1}, {&_44cn1_sm_p8_0,&_44cn1_sm_p8_1,&_44cn1_sm_p8_2} }};static const static_bookblock _resbook_44s_0={ { {0},{0,0,&_44c0_s_p1_0},{0,0,&_44c0_s_p2_0}, {0,0,&_44c0_s_p3_0},{0,0,&_44c0_s_p4_0},{0,0,&_44c0_s_p5_0}, {&_44c0_s_p6_0,&_44c0_s_p6_1},{&_44c0_s_p7_0,&_44c0_s_p7_1}, {&_44c0_s_p8_0,&_44c0_s_p8_1,&_44c0_s_p8_2} }};static const static_bookblock _resbook_44sm_0={ { {0},{0,0,&_44c0_sm_p1_0},{0,0,&_44c0_sm_p2_0}, {0,0,&_44c0_sm_p3_0},{0,0,&_44c0_sm_p4_0},{0,0,&_44c0_sm_p5_0}, {&_44c0_sm_p6_0,&_44c0_sm_p6_1},{&_44c0_sm_p7_0,&_44c0_sm_p7_1}, {&_44c0_sm_p8_0,&_44c0_sm_p8_1,&_44c0_sm_p8_2} }};static const static_bookblock _resbook_44s_1={ { {0},{0,0,&_44c1_s_p1_0},{0,0,&_44c1_s_p2_0}, {0,0,&_44c1_s_p3_0},{0,0,&_44c1_s_p4_0},{0,0,&_44c1_s_p5_0}, {&_44c1_s_p6_0,&_44c1_s_p6_1},{&_44c1_s_p7_0,&_44c1_s_p7_1}, {&_44c1_s_p8_0,&_44c1_s_p8_1,&_44c1_s_p8_2} }};static const static_bookblock _resbook_44sm_1={ { {0},{0,0,&_44c1_sm_p1_0},{0,0,&_44c1_sm_p2_0}, {0,0,&_44c1_sm_p3_0},{0,0,&_44c1_sm_p4_0},{0,0,&_44c1_sm_p5_0}, {&_44c1_sm_p6_0,&_44c1_sm_p6_1},{&_44c1_sm_p7_0,&_44c1_sm_p7_1}, {&_44c1_sm_p8_0,&_44c1_sm_p8_1,&_44c1_sm_p8_2} }};static const static_bookblock _resbook_44s_2={ { {0},{0,0,&_44c2_s_p1_0},{0,0,&_44c2_s_p2_0},{0,0,&_44c2_s_p3_0}, {0,0,&_44c2_s_p4_0},{0,0,&_44c2_s_p5_0},{0,0,&_44c2_s_p6_0}, {&_44c2_s_p7_0,&_44c2_s_p7_1},{&_44c2_s_p8_0,&_44c2_s_p8_1}, {&_44c2_s_p9_0,&_44c2_s_p9_1,&_44c2_s_p9_2} }};static const static_bookblock _resbook_44s_3={ { {0},{0,0,&_44c3_s_p1_0},{0,0,&_44c3_s_p2_0},{0,0,&_44c3_s_p3_0}, {0,0,&_44c3_s_p4_0},{0,0,&_44c3_s_p5_0},{0,0,&_44c3_s_p6_0}, {&_44c3_s_p7_0,&_44c3_s_p7_1},{&_44c3_s_p8_0,&_44c3_s_p8_1}, {&_44c3_s_p9_0,&_44c3_s_p9_1,&_44c3_s_p9_2} }};static const static_bookblock _resbook_44s_4={ { {0},{0,0,&_44c4_s_p1_0},{0,0,&_44c4_s_p2_0},{0,0,&_44c4_s_p3_0}, {0,0,&_44c4_s_p4_0},{0,0,&_44c4_s_p5_0},{0,0,&_44c4_s_p6_0}, {&_44c4_s_p7_0,&_44c4_s_p7_1},{&_44c4_s_p8_0,&_44c4_s_p8_1}, {&_44c4_s_p9_0,&_44c4_s_p9_1,&_44c4_s_p9_2} }};static const static_bookblock _resbook_44s_5={ { {0},{0,0,&_44c5_s_p1_0},{0,0,&_44c5_s_p2_0},{0,0,&_44c5_s_p3_0}, {0,0,&_44c5_s_p4_0},{0,0,&_44c5_s_p5_0},{0,0,&_44c5_s_p6_0}, {&_44c5_s_p7_0,&_44c5_s_p7_1},{&_44c5_s_p8_0,&_44c5_s_p8_1}, {&_44c5_s_p9_0,&_44c5_s_p9_1,&_44c5_s_p9_2} }};static const static_bookblock _resbook_44s_6={ { {0},{0,0,&_44c6_s_p1_0},{0,0,&_44c6_s_p2_0},{0,0,&_44c6_s_p3_0}, {0,0,&_44c6_s_p4_0}, {&_44c6_s_p5_0,&_44c6_s_p5_1}, {&_44c6_s_p6_0,&_44c6_s_p6_1}, {&_44c6_s_p7_0,&_44c6_s_p7_1}, {&_44c6_s_p8_0,&_44c6_s_p8_1}, {&_44c6_s_p9_0,&_44c6_s_p9_1,&_44c6_s_p9_2} }};static const static_bookblock _resbook_44s_7={ { {0},{0,0,&_44c7_s_p1_0},{0,0,&_44c7_s_p2_0},{0,0,&_44c7_s_p3_0}, {0,0,&_44c7_s_p4_0}, {&_44c7_s_p5_0,&_44c7_s_p5_1}, {&_44c7_s_p6_0,&_44c7_s_p6_1}, {&_44c7_s_p7_0,&_44c7_s_p7_1}, {&_44c7_s_p8_0,&_44c7_s_p8_1}, {&_44c7_s_p9_0,&_44c7_s_p9_1,&_44c7_s_p9_2} }};static const static_bookblock _resbook_44s_8={ { {0},{0,0,&_44c8_s_p1_0},{0,0,&_44c8_s_p2_0},{0,0,&_44c8_s_p3_0}, {0,0,&_44c8_s_p4_0}, {&_44c8_s_p5_0,&_44c8_s_p5_1}, {&_44c8_s_p6_0,&_44c8_s_p6_1}, {&_44c8_s_p7_0,&_44c8_s_p7_1}, {&_44c8_s_p8_0,&_44c8_s_p8_1}, {&_44c8_s_p9_0,&_44c8_s_p9_1,&_44c8_s_p9_2} }};static const static_bookblock _resbook_44s_9={ { {0},{0,0,&_44c9_s_p1_0},{0,0,&_44c9_s_p2_0},{0,0,&_44c9_s_p3_0}, {0,0,&_44c9_s_p4_0}, {&_44c9_s_p5_0,&_44c9_s_p5_1}, {&_44c9_s_p6_0,&_44c9_s_p6_1}, {&_44c9_s_p7_0,&_44c9_s_p7_1}, {&_44c9_s_p8_0,&_44c9_s_p8_1}, {&_44c9_s_p9_0,&_44c9_s_p9_1,&_44c9_s_p9_2} }};static const vorbis_residue_template _res_44s_n1[]={ {2,0,32, &_residue_44_low, &_huff_book__44cn1_s_short,&_huff_book__44cn1_sm_short, &_resbook_44s_n1,&_resbook_44sm_n1}, {2,0,32, &_residue_44_low, &_huff_book__44cn1_s_long,&_huff_book__44cn1_sm_long, &_resbook_44s_n1,&_resbook_44sm_n1}};static const vorbis_residue_template _res_44s_0[]={ {2,0,16, &_residue_44_low, &_huff_book__44c0_s_short,&_huff_book__44c0_sm_short, &_resbook_44s_0,&_resbook_44sm_0}, {2,0,32, &_residue_44_low, &_huff_book__44c0_s_long,&_huff_book__44c0_sm_long, &_resbook_44s_0,&_resbook_44sm_0}};static const vorbis_residue_template _res_44s_1[]={ {2,0,16, &_residue_44_low, &_huff_book__44c1_s_short,&_huff_book__44c1_sm_short, &_resbook_44s_1,&_resbook_44sm_1}, {2,0,32, &_residue_44_low, &_huff_book__44c1_s_long,&_huff_book__44c1_sm_long, &_resbook_44s_1,&_resbook_44sm_1}};static const vorbis_residue_template _res_44s_2[]={ {2,0,16, &_residue_44_mid, &_huff_book__44c2_s_short,&_huff_book__44c2_s_short, &_resbook_44s_2,&_resbook_44s_2}, {2,0,32, &_residue_44_mid, &_huff_book__44c2_s_long,&_huff_book__44c2_s_long, &_resbook_44s_2,&_resbook_44s_2}};static const vorbis_residue_template _res_44s_3[]={ {2,0,16, &_residue_44_mid, &_huff_book__44c3_s_short,&_huff_book__44c3_s_short, &_resbook_44s_3,&_resbook_44s_3}, {2,0,32, &_residue_44_mid, &_huff_book__44c3_s_long,&_huff_book__44c3_s_long, &_resbook_44s_3,&_resbook_44s_3}};static const vorbis_residue_template _res_44s_4[]={ {2,0,16, &_residue_44_mid, &_huff_book__44c4_s_short,&_huff_book__44c4_s_short, &_resbook_44s_4,&_resbook_44s_4}, {2,0,32, &_residue_44_mid, &_huff_book__44c4_s_long,&_huff_book__44c4_s_long, &_resbook_44s_4,&_resbook_44s_4}};static const vorbis_residue_template _res_44s_5[]={ {2,0,16, &_residue_44_mid, &_huff_book__44c5_s_short,&_huff_book__44c5_s_short, &_resbook_44s_5,&_resbook_44s_5}, {2,0,32, &_residue_44_mid, &_huff_book__44c5_s_long,&_huff_book__44c5_s_long, &_resbook_44s_5,&_resbook_44s_5}};static const vorbis_residue_template _res_44s_6[]={ {2,0,16, &_residue_44_high, &_huff_book__44c6_s_short,&_huff_book__44c6_s_short, &_resbook_44s_6,&_resbook_44s_6}, {2,0,32, &_residue_44_high, &_huff_book__44c6_s_long,&_huff_book__44c6_s_long, &_resbook_44s_6,&_resbook_44s_6}};static const vorbis_residue_template _res_44s_7[]={ {2,0,16, &_residue_44_high, &_huff_book__44c7_s_short,&_huff_book__44c7_s_short, &_resbook_44s_7,&_resbook_44s_7}, {2,0,32, &_residue_44_high, &_huff_book__44c7_s_long,&_huff_book__44c7_s_long, &_resbook_44s_7,&_resbook_44s_7}};static const vorbis_residue_template _res_44s_8[]={ {2,0,16, &_residue_44_high, &_huff_book__44c8_s_short,&_huff_book__44c8_s_short, &_resbook_44s_8,&_resbook_44s_8}, {2,0,32, &_residue_44_high, &_huff_book__44c8_s_long,&_huff_book__44c8_s_long, &_resbook_44s_8,&_resbook_44s_8}};static const vorbis_residue_template _res_44s_9[]={ {2,0,16, &_residue_44_high, &_huff_book__44c9_s_short,&_huff_book__44c9_s_short, &_resbook_44s_9,&_resbook_44s_9}, {2,0,32, &_residue_44_high, &_huff_book__44c9_s_long,&_huff_book__44c9_s_long, &_resbook_44s_9,&_resbook_44s_9}};static const vorbis_mapping_template _mapres_template_44_stereo[]={ { _map_nominal, _res_44s_n1 }, /* -1 */ { _map_nominal, _res_44s_0 }, /* 0 */ { _map_nominal, _res_44s_1 }, /* 1 */ { _map_nominal, _res_44s_2 }, /* 2 */ { _map_nominal, _res_44s_3 }, /* 3 */ { _map_nominal, _res_44s_4 }, /* 4 */ { _map_nominal, _res_44s_5 }, /* 5 */ { _map_nominal, _res_44s_6 }, /* 6 */ { _map_nominal, _res_44s_7 }, /* 7 */ { _map_nominal, _res_44s_8 }, /* 8 */ { _map_nominal, _res_44s_9 }, /* 9 */};vendor/vorbis/lib/modes/residue_44p51.hadded
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2010 * * by the Xiph.Org Foundation https://xiph.org/ * * * ******************************************************************** function: toplevel residue templates for 32/44.1/48kHz uncoupled ********************************************************************/#include "vorbis/codec.h"#include "backends.h"#include "books/coupled/res_books_51.h"/***** residue backends *********************************************/static const vorbis_info_residue0 _residue_44p_lo={ 0,-1, -1, 7,-1,-1, /* 0 1 2 3 4 5 6 7 8 */ {0}, {-1}, { 0, 1, 2, 7, 17, 31}, { 0, 0, 99, 7, 17, 31},};static const vorbis_info_residue0 _residue_44p={ 0,-1, -1, 8,-1,-1, /* 0 1 2 3 4 5 6 7 8 */ {0}, {-1}, { 0, 1, 1, 2, 7, 17, 31}, { 0, 0, 99, 99, 7, 17, 31},};static const vorbis_info_residue0 _residue_44p_hi={ 0,-1, -1, 8,-1,-1, /* 0 1 2 3 4 5 6 7 8 */ {0}, {-1}, { 0, 1, 2, 4, 7, 17, 31}, { 0, 1, 2, 4, 7, 17, 31},};static const vorbis_info_residue0 _residue_44p_lfe={ 0,-1, -1, 2,-1,-1, /* 0 1 2 3 4 5 6 7 8 */ {0}, {-1}, { 32}, { -1}};static const static_bookblock _resbook_44p_n1={ { {0}, {0,&_44pn1_p1_0}, {&_44pn1_p2_0,&_44pn1_p2_1,0}, {&_44pn1_p3_0,&_44pn1_p3_1,0}, {&_44pn1_p4_0,&_44pn1_p4_1,0}, {&_44pn1_p5_0,&_44pn1_p5_1,&_44pn1_p4_1}, {&_44pn1_p6_0,&_44pn1_p6_1,&_44pn1_p6_2}, }};static const static_bookblock _resbook_44p_0={ { {0}, {0,&_44p0_p1_0}, {&_44p0_p2_0,&_44p0_p2_1,0}, {&_44p0_p3_0,&_44p0_p3_1,0}, {&_44p0_p4_0,&_44p0_p4_1,0}, {&_44p0_p5_0,&_44p0_p5_1,&_44p0_p4_1}, {&_44p0_p6_0,&_44p0_p6_1,&_44p0_p6_2}, }};static const static_bookblock _resbook_44p_1={ { {0}, {0,&_44p1_p1_0}, {&_44p1_p2_0,&_44p1_p2_1,0}, {&_44p1_p3_0,&_44p1_p3_1,0}, {&_44p1_p4_0,&_44p1_p4_1,0}, {&_44p1_p5_0,&_44p1_p5_1,&_44p1_p4_1}, {&_44p1_p6_0,&_44p1_p6_1,&_44p1_p6_2}, }};static const static_bookblock _resbook_44p_2={ { {0}, {0,0,&_44p2_p1_0}, {0,&_44p2_p2_0,0}, {&_44p2_p3_0,&_44p2_p3_1,0}, {&_44p2_p4_0,&_44p2_p4_1,0}, {&_44p2_p5_0,&_44p2_p5_1,0}, {&_44p2_p6_0,&_44p2_p6_1,&_44p2_p5_1}, {&_44p2_p7_0,&_44p2_p7_1,&_44p2_p7_2,&_44p2_p7_3} }};static const static_bookblock _resbook_44p_3={ { {0}, {0,0,&_44p3_p1_0}, {0,&_44p3_p2_0,0}, {&_44p3_p3_0,&_44p3_p3_1,0}, {&_44p3_p4_0,&_44p3_p4_1,0}, {&_44p3_p5_0,&_44p3_p5_1,0}, {&_44p3_p6_0,&_44p3_p6_1,&_44p3_p5_1}, {&_44p3_p7_0,&_44p3_p7_1,&_44p3_p7_2,&_44p3_p7_3} }};static const static_bookblock _resbook_44p_4={ { {0}, {0,0,&_44p4_p1_0}, {0,&_44p4_p2_0,0}, {&_44p4_p3_0,&_44p4_p3_1,0}, {&_44p4_p4_0,&_44p4_p4_1,0}, {&_44p4_p5_0,&_44p4_p5_1,0}, {&_44p4_p6_0,&_44p4_p6_1,&_44p4_p5_1}, {&_44p4_p7_0,&_44p4_p7_1,&_44p4_p7_2,&_44p4_p7_3} }};static const static_bookblock _resbook_44p_5={ { {0}, {0,0,&_44p5_p1_0}, {0,&_44p5_p2_0,0}, {&_44p5_p3_0,&_44p5_p3_1,0}, {&_44p5_p4_0,&_44p5_p4_1,0}, {&_44p5_p5_0,&_44p5_p5_1,0}, {&_44p5_p6_0,&_44p5_p6_1,&_44p5_p5_1}, {&_44p5_p7_0,&_44p5_p7_1,&_44p5_p7_2,&_44p5_p7_3} }};static const static_bookblock _resbook_44p_6={ { {0}, {0,0,&_44p6_p1_0}, {0,&_44p6_p2_0,0}, {&_44p6_p3_0,&_44p6_p3_1,0}, {&_44p6_p4_0,&_44p6_p4_1,0}, {&_44p6_p5_0,&_44p6_p5_1,0}, {&_44p6_p6_0,&_44p6_p6_1,&_44p6_p5_1}, {&_44p6_p7_0,&_44p6_p7_1,&_44p6_p7_2,&_44p6_p7_3} }};static const static_bookblock _resbook_44p_7={ { {0}, {0,0,&_44p7_p1_0}, {0,&_44p7_p2_0,0}, {&_44p7_p3_0,&_44p7_p3_1,0}, {&_44p7_p4_0,&_44p7_p4_1,0}, {&_44p7_p5_0,&_44p7_p5_1,0}, {&_44p7_p6_0,&_44p7_p6_1,&_44p7_p5_1}, {&_44p7_p7_0,&_44p7_p7_1,&_44p7_p7_2,&_44p7_p7_3} }};static const static_bookblock _resbook_44p_8={ { {0}, {0,0,&_44p8_p1_0}, {0,&_44p8_p2_0,0}, {&_44p8_p3_0,&_44p8_p3_1,0}, {&_44p8_p4_0,&_44p8_p4_1,0}, {&_44p8_p5_0,&_44p8_p5_1,0}, {&_44p8_p6_0,&_44p8_p6_1,&_44p8_p5_1}, {&_44p8_p7_0,&_44p8_p7_1,&_44p8_p7_2,&_44p8_p7_3} }};static const static_bookblock _resbook_44p_9={ { {0}, {0,0,&_44p9_p1_0}, {0,&_44p9_p2_0,0}, {&_44p9_p3_0,&_44p9_p3_1,0}, {&_44p9_p4_0,&_44p9_p4_1,0}, {&_44p9_p5_0,&_44p9_p5_1,0}, {&_44p9_p6_0,&_44p9_p6_1,&_44p9_p5_1}, {&_44p9_p7_0,&_44p9_p7_1,&_44p9_p7_2,&_44p9_p7_3} }};static const static_bookblock _resbook_44p_ln1={ { {&_44pn1_l0_0,&_44pn1_l0_1,0}, {&_44pn1_l1_0,&_44pn1_p6_1,&_44pn1_p6_2}, }};static const static_bookblock _resbook_44p_l0={ { {&_44p0_l0_0,&_44p0_l0_1,0}, {&_44p0_l1_0,&_44p0_p6_1,&_44p0_p6_2}, }};static const static_bookblock _resbook_44p_l1={ { {&_44p1_l0_0,&_44p1_l0_1,0}, {&_44p1_l1_0,&_44p1_p6_1,&_44p1_p6_2}, }};static const static_bookblock _resbook_44p_l2={ { {&_44p2_l0_0,&_44p2_l0_1,0}, {&_44p2_l1_0,&_44p2_p7_2,&_44p2_p7_3}, }};static const static_bookblock _resbook_44p_l3={ { {&_44p3_l0_0,&_44p3_l0_1,0}, {&_44p3_l1_0,&_44p3_p7_2,&_44p3_p7_3}, }};static const static_bookblock _resbook_44p_l4={ { {&_44p4_l0_0,&_44p4_l0_1,0}, {&_44p4_l1_0,&_44p4_p7_2,&_44p4_p7_3}, }};static const static_bookblock _resbook_44p_l5={ { {&_44p5_l0_0,&_44p5_l0_1,0}, {&_44p5_l1_0,&_44p5_p7_2,&_44p5_p7_3}, }};static const static_bookblock _resbook_44p_l6={ { {&_44p6_l0_0,&_44p6_l0_1,0}, {&_44p6_l1_0,&_44p6_p7_2,&_44p6_p7_3}, }};static const static_bookblock _resbook_44p_l7={ { {&_44p7_l0_0,&_44p7_l0_1,0}, {&_44p7_l1_0,&_44p7_p7_2,&_44p7_p7_3}, }};static const static_bookblock _resbook_44p_l8={ { {&_44p8_l0_0,&_44p8_l0_1,0}, {&_44p8_l1_0,&_44p8_p7_2,&_44p8_p7_3}, }};static const static_bookblock _resbook_44p_l9={ { {&_44p9_l0_0,&_44p9_l0_1,0}, {&_44p9_l1_0,&_44p9_p7_2,&_44p9_p7_3}, }};static const vorbis_info_mapping0 _map_nominal_51[2]={ {2, {0,0,0,0,0,1}, {0,2}, {0,2}, 4,{0,3,0,0},{2,4,1,3}}, {2, {0,0,0,0,0,1}, {1,2}, {1,2}, 4,{0,3,0,0},{2,4,1,3}}};static const vorbis_info_mapping0 _map_nominal_51u[2]={ {2, {0,0,0,0,0,1}, {0,2}, {0,2}, 0,{0},{0}}, {2, {0,0,0,0,0,1}, {1,2}, {1,2}, 0,{0},{0}}};static const vorbis_residue_template _res_44p51_n1[]={ {2,0,30, &_residue_44p_lo, &_huff_book__44pn1_short,&_huff_book__44pn1_short, &_resbook_44p_n1,&_resbook_44p_n1}, {2,0,30, &_residue_44p_lo, &_huff_book__44pn1_long,&_huff_book__44pn1_long, &_resbook_44p_n1,&_resbook_44p_n1}, {1,2,6, &_residue_44p_lfe, &_huff_book__44pn1_lfe,&_huff_book__44pn1_lfe, &_resbook_44p_ln1,&_resbook_44p_ln1}};static const vorbis_residue_template _res_44p51_0[]={ {2,0,15, &_residue_44p_lo, &_huff_book__44p0_short,&_huff_book__44p0_short, &_resbook_44p_0,&_resbook_44p_0}, {2,0,30, &_residue_44p_lo, &_huff_book__44p0_long,&_huff_book__44p0_long, &_resbook_44p_0,&_resbook_44p_0}, {1,2,6, &_residue_44p_lfe, &_huff_book__44p0_lfe,&_huff_book__44p0_lfe, &_resbook_44p_l0,&_resbook_44p_l0}};static const vorbis_residue_template _res_44p51_1[]={ {2,0,15, &_residue_44p_lo, &_huff_book__44p1_short,&_huff_book__44p1_short, &_resbook_44p_1,&_resbook_44p_1}, {2,0,30, &_residue_44p_lo, &_huff_book__44p1_long,&_huff_book__44p1_long, &_resbook_44p_1,&_resbook_44p_1}, {1,2,6, &_residue_44p_lfe, &_huff_book__44p1_lfe,&_huff_book__44p1_lfe, &_resbook_44p_l1,&_resbook_44p_l1}};static const vorbis_residue_template _res_44p51_2[]={ {2,0,15, &_residue_44p, &_huff_book__44p2_short,&_huff_book__44p2_short, &_resbook_44p_2,&_resbook_44p_2}, {2,0,30, &_residue_44p, &_huff_book__44p2_long,&_huff_book__44p2_long, &_resbook_44p_2,&_resbook_44p_2}, {1,2,6, &_residue_44p_lfe, &_huff_book__44p2_lfe,&_huff_book__44p2_lfe, &_resbook_44p_l2,&_resbook_44p_l2}};static const vorbis_residue_template _res_44p51_3[]={ {2,0,15, &_residue_44p, &_huff_book__44p3_short,&_huff_book__44p3_short, &_resbook_44p_3,&_resbook_44p_3}, {2,0,30, &_residue_44p, &_huff_book__44p3_long,&_huff_book__44p3_long, &_resbook_44p_3,&_resbook_44p_3}, {1,2,6, &_residue_44p_lfe, &_huff_book__44p3_lfe,&_huff_book__44p3_lfe, &_resbook_44p_l3,&_resbook_44p_l3}};static const vorbis_residue_template _res_44p51_4[]={ {2,0,15, &_residue_44p, &_huff_book__44p4_short,&_huff_book__44p4_short, &_resbook_44p_4,&_resbook_44p_4}, {2,0,30, &_residue_44p, &_huff_book__44p4_long,&_huff_book__44p4_long, &_resbook_44p_4,&_resbook_44p_4}, {1,2,6, &_residue_44p_lfe, &_huff_book__44p4_lfe,&_huff_book__44p4_lfe, &_resbook_44p_l4,&_resbook_44p_l4}};static const vorbis_residue_template _res_44p51_5[]={ {2,0,15, &_residue_44p_hi, &_huff_book__44p5_short,&_huff_book__44p5_short, &_resbook_44p_5,&_resbook_44p_5}, {2,0,30, &_residue_44p_hi, &_huff_book__44p5_long,&_huff_book__44p5_long, &_resbook_44p_5,&_resbook_44p_5}, {1,2,6, &_residue_44p_lfe, &_huff_book__44p5_lfe,&_huff_book__44p5_lfe, &_resbook_44p_l5,&_resbook_44p_l5}};static const vorbis_residue_template _res_44p51_6[]={ {2,0,15, &_residue_44p_hi, &_huff_book__44p6_short,&_huff_book__44p6_short, &_resbook_44p_6,&_resbook_44p_6}, {2,0,30, &_residue_44p_hi, &_huff_book__44p6_long,&_huff_book__44p6_long, &_resbook_44p_6,&_resbook_44p_6}, {1,2,6, &_residue_44p_lfe, &_huff_book__44p6_lfe,&_huff_book__44p6_lfe, &_resbook_44p_l6,&_resbook_44p_l6}};static const vorbis_residue_template _res_44p51_7[]={ {2,0,15, &_residue_44p_hi, &_huff_book__44p7_short,&_huff_book__44p7_short, &_resbook_44p_7,&_resbook_44p_7}, {2,0,30, &_residue_44p_hi, &_huff_book__44p7_long,&_huff_book__44p7_long, &_resbook_44p_7,&_resbook_44p_7}, {1,2,6, &_residue_44p_lfe, &_huff_book__44p6_lfe,&_huff_book__44p6_lfe, &_resbook_44p_l6,&_resbook_44p_l6}};static const vorbis_residue_template _res_44p51_8[]={ {2,0,15, &_residue_44p_hi, &_huff_book__44p8_short,&_huff_book__44p8_short, &_resbook_44p_8,&_resbook_44p_8}, {2,0,30, &_residue_44p_hi, &_huff_book__44p8_long,&_huff_book__44p8_long, &_resbook_44p_8,&_resbook_44p_8}, {1,2,6, &_residue_44p_lfe, &_huff_book__44p6_lfe,&_huff_book__44p6_lfe, &_resbook_44p_l6,&_resbook_44p_l6}};static const vorbis_residue_template _res_44p51_9[]={ {2,0,15, &_residue_44p_hi, &_huff_book__44p9_short,&_huff_book__44p9_short, &_resbook_44p_9,&_resbook_44p_9}, {2,0,30, &_residue_44p_hi, &_huff_book__44p9_long,&_huff_book__44p9_long, &_resbook_44p_9,&_resbook_44p_9}, {1,2,6, &_residue_44p_lfe, &_huff_book__44p6_lfe,&_huff_book__44p6_lfe, &_resbook_44p_l6,&_resbook_44p_l6}};static const vorbis_mapping_template _mapres_template_44_51[]={ { _map_nominal_51, _res_44p51_n1 }, /* -1 */ { _map_nominal_51, _res_44p51_0 }, /* 0 */ { _map_nominal_51, _res_44p51_1 }, /* 1 */ { _map_nominal_51, _res_44p51_2 }, /* 2 */ { _map_nominal_51, _res_44p51_3 }, /* 3 */ { _map_nominal_51, _res_44p51_4 }, /* 4 */ { _map_nominal_51u, _res_44p51_5 }, /* 5 */ { _map_nominal_51u, _res_44p51_6 }, /* 6 */ { _map_nominal_51u, _res_44p51_7 }, /* 7 */ { _map_nominal_51u, _res_44p51_8 }, /* 8 */ { _map_nominal_51u, _res_44p51_9 }, /* 9 */};vendor/vorbis/lib/modes/residue_44u.hadded
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 * * by the Xiph.Org Foundation https://xiph.org/ * * * ******************************************************************** function: toplevel residue templates for 32/44.1/48kHz uncoupled ********************************************************************/#include "vorbis/codec.h"#include "backends.h"#include "books/uncoupled/res_books_uncoupled.h"/***** residue backends *********************************************/static const vorbis_info_residue0 _residue_44_low_un={ 0,-1, -1, 8,-1,-1, {0}, {-1}, { 0, 1, 1, 2, 2, 4, 28}, { -1, 25, -1, 45, -1, -1, -1}};static const vorbis_info_residue0 _residue_44_mid_un={ 0,-1, -1, 10,-1,-1, /* 0 1 2 3 4 5 6 7 8 9 */ {0}, {-1}, { 0, 1, 1, 2, 2, 4, 4, 16, 60}, { -1, 30, -1, 50, -1, 80, -1, -1, -1}};static const vorbis_info_residue0 _residue_44_hi_un={ 0,-1, -1, 10,-1,-1, /* 0 1 2 3 4 5 6 7 8 9 */ {0}, {-1}, { 0, 1, 2, 4, 8, 16, 32, 71,157}, { -1, -1, -1, -1, -1, -1, -1, -1, -1}};/* mapping conventions: only one submap (this would change for efficient 5.1 support for example)*//* Four psychoacoustic profiles are used, one for each blocktype */static const vorbis_info_mapping0 _map_nominal_u[2]={ {1, {0,0,0,0,0,0}, {0}, {0}, 0,{0},{0}}, {1, {0,0,0,0,0,0}, {1}, {1}, 0,{0},{0}}};static const static_bookblock _resbook_44u_n1={ { {0}, {0,0,&_44un1__p1_0}, {0,0,&_44un1__p2_0}, {0,0,&_44un1__p3_0}, {0,0,&_44un1__p4_0}, {0,0,&_44un1__p5_0}, {&_44un1__p6_0,&_44un1__p6_1}, {&_44un1__p7_0,&_44un1__p7_1,&_44un1__p7_2} }};static const static_bookblock _resbook_44u_0={ { {0}, {0,0,&_44u0__p1_0}, {0,0,&_44u0__p2_0}, {0,0,&_44u0__p3_0}, {0,0,&_44u0__p4_0}, {0,0,&_44u0__p5_0}, {&_44u0__p6_0,&_44u0__p6_1}, {&_44u0__p7_0,&_44u0__p7_1,&_44u0__p7_2} }};static const static_bookblock _resbook_44u_1={ { {0}, {0,0,&_44u1__p1_0}, {0,0,&_44u1__p2_0}, {0,0,&_44u1__p3_0}, {0,0,&_44u1__p4_0}, {0,0,&_44u1__p5_0}, {&_44u1__p6_0,&_44u1__p6_1}, {&_44u1__p7_0,&_44u1__p7_1,&_44u1__p7_2} }};static const static_bookblock _resbook_44u_2={ { {0}, {0,0,&_44u2__p1_0}, {0,0,&_44u2__p2_0}, {0,0,&_44u2__p3_0}, {0,0,&_44u2__p4_0}, {0,0,&_44u2__p5_0}, {&_44u2__p6_0,&_44u2__p6_1}, {&_44u2__p7_0,&_44u2__p7_1,&_44u2__p7_2} }};static const static_bookblock _resbook_44u_3={ { {0}, {0,0,&_44u3__p1_0}, {0,0,&_44u3__p2_0}, {0,0,&_44u3__p3_0}, {0,0,&_44u3__p4_0}, {0,0,&_44u3__p5_0}, {&_44u3__p6_0,&_44u3__p6_1}, {&_44u3__p7_0,&_44u3__p7_1,&_44u3__p7_2} }};static const static_bookblock _resbook_44u_4={ { {0}, {0,0,&_44u4__p1_0}, {0,0,&_44u4__p2_0}, {0,0,&_44u4__p3_0}, {0,0,&_44u4__p4_0}, {0,0,&_44u4__p5_0}, {&_44u4__p6_0,&_44u4__p6_1}, {&_44u4__p7_0,&_44u4__p7_1,&_44u4__p7_2} }};static const static_bookblock _resbook_44u_5={ { {0}, {0,0,&_44u5__p1_0}, {0,0,&_44u5__p2_0}, {0,0,&_44u5__p3_0}, {0,0,&_44u5__p4_0}, {0,0,&_44u5__p5_0}, {0,0,&_44u5__p6_0}, {&_44u5__p7_0,&_44u5__p7_1}, {&_44u5__p8_0,&_44u5__p8_1}, {&_44u5__p9_0,&_44u5__p9_1,&_44u5__p9_2} }};static const static_bookblock _resbook_44u_6={ { {0}, {0,0,&_44u6__p1_0}, {0,0,&_44u6__p2_0}, {0,0,&_44u6__p3_0}, {0,0,&_44u6__p4_0}, {0,0,&_44u6__p5_0}, {0,0,&_44u6__p6_0}, {&_44u6__p7_0,&_44u6__p7_1}, {&_44u6__p8_0,&_44u6__p8_1}, {&_44u6__p9_0,&_44u6__p9_1,&_44u6__p9_2} }};static const static_bookblock _resbook_44u_7={ { {0}, {0,0,&_44u7__p1_0}, {0,0,&_44u7__p2_0}, {0,0,&_44u7__p3_0}, {0,0,&_44u7__p4_0}, {0,0,&_44u7__p5_0}, {0,0,&_44u7__p6_0}, {&_44u7__p7_0,&_44u7__p7_1}, {&_44u7__p8_0,&_44u7__p8_1}, {&_44u7__p9_0,&_44u7__p9_1,&_44u7__p9_2} }};static const static_bookblock _resbook_44u_8={ { {0}, {0,0,&_44u8_p1_0}, {0,0,&_44u8_p2_0}, {0,0,&_44u8_p3_0}, {0,0,&_44u8_p4_0}, {&_44u8_p5_0,&_44u8_p5_1}, {&_44u8_p6_0,&_44u8_p6_1}, {&_44u8_p7_0,&_44u8_p7_1}, {&_44u8_p8_0,&_44u8_p8_1}, {&_44u8_p9_0,&_44u8_p9_1,&_44u8_p9_2} }};static const static_bookblock _resbook_44u_9={ { {0}, {0,0,&_44u9_p1_0}, {0,0,&_44u9_p2_0}, {0,0,&_44u9_p3_0}, {0,0,&_44u9_p4_0}, {&_44u9_p5_0,&_44u9_p5_1}, {&_44u9_p6_0,&_44u9_p6_1}, {&_44u9_p7_0,&_44u9_p7_1}, {&_44u9_p8_0,&_44u9_p8_1}, {&_44u9_p9_0,&_44u9_p9_1,&_44u9_p9_2} }};static const vorbis_residue_template _res_44u_n1[]={ {1,0,32, &_residue_44_low_un, &_huff_book__44un1__short,&_huff_book__44un1__short, &_resbook_44u_n1,&_resbook_44u_n1}, {1,0,32, &_residue_44_low_un, &_huff_book__44un1__long,&_huff_book__44un1__long, &_resbook_44u_n1,&_resbook_44u_n1}};static const vorbis_residue_template _res_44u_0[]={ {1,0,16, &_residue_44_low_un, &_huff_book__44u0__short,&_huff_book__44u0__short, &_resbook_44u_0,&_resbook_44u_0}, {1,0,32, &_residue_44_low_un, &_huff_book__44u0__long,&_huff_book__44u0__long, &_resbook_44u_0,&_resbook_44u_0}};static const vorbis_residue_template _res_44u_1[]={ {1,0,16, &_residue_44_low_un, &_huff_book__44u1__short,&_huff_book__44u1__short, &_resbook_44u_1,&_resbook_44u_1}, {1,0,32, &_residue_44_low_un, &_huff_book__44u1__long,&_huff_book__44u1__long, &_resbook_44u_1,&_resbook_44u_1}};static const vorbis_residue_template _res_44u_2[]={ {1,0,16, &_residue_44_low_un, &_huff_book__44u2__short,&_huff_book__44u2__short, &_resbook_44u_2,&_resbook_44u_2}, {1,0,32, &_residue_44_low_un, &_huff_book__44u2__long,&_huff_book__44u2__long, &_resbook_44u_2,&_resbook_44u_2}};static const vorbis_residue_template _res_44u_3[]={ {1,0,16, &_residue_44_low_un, &_huff_book__44u3__short,&_huff_book__44u3__short, &_resbook_44u_3,&_resbook_44u_3}, {1,0,32, &_residue_44_low_un, &_huff_book__44u3__long,&_huff_book__44u3__long, &_resbook_44u_3,&_resbook_44u_3}};static const vorbis_residue_template _res_44u_4[]={ {1,0,16, &_residue_44_low_un, &_huff_book__44u4__short,&_huff_book__44u4__short, &_resbook_44u_4,&_resbook_44u_4}, {1,0,32, &_residue_44_low_un, &_huff_book__44u4__long,&_huff_book__44u4__long, &_resbook_44u_4,&_resbook_44u_4}};static const vorbis_residue_template _res_44u_5[]={ {1,0,16, &_residue_44_mid_un, &_huff_book__44u5__short,&_huff_book__44u5__short, &_resbook_44u_5,&_resbook_44u_5}, {1,0,32, &_residue_44_mid_un, &_huff_book__44u5__long,&_huff_book__44u5__long, &_resbook_44u_5,&_resbook_44u_5}};static const vorbis_residue_template _res_44u_6[]={ {1,0,16, &_residue_44_mid_un, &_huff_book__44u6__short,&_huff_book__44u6__short, &_resbook_44u_6,&_resbook_44u_6}, {1,0,32, &_residue_44_mid_un, &_huff_book__44u6__long,&_huff_book__44u6__long, &_resbook_44u_6,&_resbook_44u_6}};static const vorbis_residue_template _res_44u_7[]={ {1,0,16, &_residue_44_mid_un, &_huff_book__44u7__short,&_huff_book__44u7__short, &_resbook_44u_7,&_resbook_44u_7}, {1,0,32, &_residue_44_mid_un, &_huff_book__44u7__long,&_huff_book__44u7__long, &_resbook_44u_7,&_resbook_44u_7}};static const vorbis_residue_template _res_44u_8[]={ {1,0,16, &_residue_44_hi_un, &_huff_book__44u8__short,&_huff_book__44u8__short, &_resbook_44u_8,&_resbook_44u_8}, {1,0,32, &_residue_44_hi_un, &_huff_book__44u8__long,&_huff_book__44u8__long, &_resbook_44u_8,&_resbook_44u_8}};static const vorbis_residue_template _res_44u_9[]={ {1,0,16, &_residue_44_hi_un, &_huff_book__44u9__short,&_huff_book__44u9__short, &_resbook_44u_9,&_resbook_44u_9}, {1,0,32, &_residue_44_hi_un, &_huff_book__44u9__long,&_huff_book__44u9__long, &_resbook_44u_9,&_resbook_44u_9}};static const vorbis_mapping_template _mapres_template_44_uncoupled[]={ { _map_nominal_u, _res_44u_n1 }, /* -1 */ { _map_nominal_u, _res_44u_0 }, /* 0 */ { _map_nominal_u, _res_44u_1 }, /* 1 */ { _map_nominal_u, _res_44u_2 }, /* 2 */ { _map_nominal_u, _res_44u_3 }, /* 3 */ { _map_nominal_u, _res_44u_4 }, /* 4 */ { _map_nominal_u, _res_44u_5 }, /* 5 */ { _map_nominal_u, _res_44u_6 }, /* 6 */ { _map_nominal_u, _res_44u_7 }, /* 7 */ { _map_nominal_u, _res_44u_8 }, /* 8 */ { _map_nominal_u, _res_44u_9 }, /* 9 */};vendor/vorbis/lib/modes/residue_8.hadded
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 * * by the Xiph.Org Foundation https://xiph.org/ * * * ******************************************************************** function: toplevel residue templates 8/11kHz ********************************************************************/#include "vorbis/codec.h"#include "backends.h"/***** residue backends *********************************************/static const static_bookblock _resbook_8s_0={ { {0}, {0,0,&_8c0_s_p1_0}, {0}, {0,0,&_8c0_s_p3_0}, {0,0,&_8c0_s_p4_0}, {0,0,&_8c0_s_p5_0}, {0,0,&_8c0_s_p6_0}, {&_8c0_s_p7_0,&_8c0_s_p7_1}, {&_8c0_s_p8_0,&_8c0_s_p8_1}, {&_8c0_s_p9_0,&_8c0_s_p9_1,&_8c0_s_p9_2} }};static const static_bookblock _resbook_8s_1={ { {0}, {0,0,&_8c1_s_p1_0}, {0}, {0,0,&_8c1_s_p3_0}, {0,0,&_8c1_s_p4_0}, {0,0,&_8c1_s_p5_0}, {0,0,&_8c1_s_p6_0}, {&_8c1_s_p7_0,&_8c1_s_p7_1}, {&_8c1_s_p8_0,&_8c1_s_p8_1}, {&_8c1_s_p9_0,&_8c1_s_p9_1,&_8c1_s_p9_2} }};static const vorbis_residue_template _res_8s_0[]={ {2,0,32, &_residue_44_mid, &_huff_book__8c0_s_single,&_huff_book__8c0_s_single, &_resbook_8s_0,&_resbook_8s_0},};static const vorbis_residue_template _res_8s_1[]={ {2,0,32, &_residue_44_mid, &_huff_book__8c1_s_single,&_huff_book__8c1_s_single, &_resbook_8s_1,&_resbook_8s_1},};static const vorbis_mapping_template _mapres_template_8_stereo[2]={ { _map_nominal, _res_8s_0 }, /* 0 */ { _map_nominal, _res_8s_1 }, /* 1 */};static const static_bookblock _resbook_8u_0={ { {0}, {0,0,&_8u0__p1_0}, {0,0,&_8u0__p2_0}, {0,0,&_8u0__p3_0}, {0,0,&_8u0__p4_0}, {0,0,&_8u0__p5_0}, {&_8u0__p6_0,&_8u0__p6_1}, {&_8u0__p7_0,&_8u0__p7_1,&_8u0__p7_2} }};static const static_bookblock _resbook_8u_1={ { {0}, {0,0,&_8u1__p1_0}, {0,0,&_8u1__p2_0}, {0,0,&_8u1__p3_0}, {0,0,&_8u1__p4_0}, {0,0,&_8u1__p5_0}, {0,0,&_8u1__p6_0}, {&_8u1__p7_0,&_8u1__p7_1}, {&_8u1__p8_0,&_8u1__p8_1}, {&_8u1__p9_0,&_8u1__p9_1,&_8u1__p9_2} }};static const vorbis_residue_template _res_8u_0[]={ {1,0,32, &_residue_44_low_un, &_huff_book__8u0__single,&_huff_book__8u0__single, &_resbook_8u_0,&_resbook_8u_0},};static const vorbis_residue_template _res_8u_1[]={ {1,0,32, &_residue_44_mid_un, &_huff_book__8u1__single,&_huff_book__8u1__single, &_resbook_8u_1,&_resbook_8u_1},};static const vorbis_mapping_template _mapres_template_8_uncoupled[2]={ { _map_nominal_u, _res_8u_0 }, /* 0 */ { _map_nominal_u, _res_8u_1 }, /* 1 */};vendor/vorbis/lib/modes/setup_11.hadded
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 * * by the Xiph.Org Foundation https://xiph.org/ * * * ******************************************************************** function: 11kHz settings ********************************************************************/#include "psych_11.h"static const int blocksize_11[2]={ 512,512};static const int _floor_mapping_11a[]={ 6,6};static const int *_floor_mapping_11[]={ _floor_mapping_11a};static const double rate_mapping_11[3]={ 8000.,13000.,44000.,};static const double rate_mapping_11_uncoupled[3]={ 12000.,20000.,50000.,};static const double quality_mapping_11[3]={ -.1,.0,1.};static const ve_setup_data_template ve_setup_11_stereo={ 2, rate_mapping_11, quality_mapping_11, 2, 9000, 15000, blocksize_11, blocksize_11, _psy_tone_masteratt_11, _psy_tone_0dB, _psy_tone_suppress, _vp_tonemask_adj_11, NULL, _vp_tonemask_adj_11, _psy_noiseguards_8, _psy_noisebias_11, _psy_noisebias_11, NULL, NULL, _psy_noise_suppress, _psy_compand_8, _psy_compand_8_mapping, NULL, {_noise_start_8,_noise_start_8}, {_noise_part_8,_noise_part_8}, _noise_thresh_11, _psy_ath_floater_8, _psy_ath_abs_8, _psy_lowpass_11, _psy_global_44, _global_mapping_8, _psy_stereo_modes_8, _floor_books, _floor, 1, _floor_mapping_11, _mapres_template_8_stereo};static const ve_setup_data_template ve_setup_11_uncoupled={ 2, rate_mapping_11_uncoupled, quality_mapping_11, -1, 9000, 15000, blocksize_11, blocksize_11, _psy_tone_masteratt_11, _psy_tone_0dB, _psy_tone_suppress, _vp_tonemask_adj_11, NULL, _vp_tonemask_adj_11, _psy_noiseguards_8, _psy_noisebias_11, _psy_noisebias_11, NULL, NULL, _psy_noise_suppress, _psy_compand_8, _psy_compand_8_mapping, NULL, {_noise_start_8,_noise_start_8}, {_noise_part_8,_noise_part_8}, _noise_thresh_11, _psy_ath_floater_8, _psy_ath_abs_8, _psy_lowpass_11, _psy_global_44, _global_mapping_8, _psy_stereo_modes_8, _floor_books, _floor, 1, _floor_mapping_11, _mapres_template_8_uncoupled};vendor/vorbis/lib/modes/setup_16.hadded
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 * * by the Xiph.Org Foundation https://xiph.org/ * * * ******************************************************************** function: 16kHz settings ********************************************************************/#include "psych_16.h"#include "residue_16.h"static const int blocksize_16_short[3]={ 1024,512,512};static const int blocksize_16_long[3]={ 1024,1024,1024};static const int _floor_mapping_16a[]={ 9,3,3};static const int _floor_mapping_16b[]={ 9,9,9};static const int *_floor_mapping_16[]={ _floor_mapping_16a, _floor_mapping_16b};static const double rate_mapping_16[4]={ 12000.,20000.,44000.,86000.};static const double rate_mapping_16_uncoupled[4]={ 16000.,28000.,64000.,100000.};static const double _global_mapping_16[4]={ 1., 2., 3., 4. };static const double quality_mapping_16[4]={ -.1,.05,.5,1. };static const double _psy_compand_16_mapping[4]={ 0., .8, 1., 1.};static const ve_setup_data_template ve_setup_16_stereo={ 3, rate_mapping_16, quality_mapping_16, 2, 15000, 19000, blocksize_16_short, blocksize_16_long, _psy_tone_masteratt_16, _psy_tone_0dB, _psy_tone_suppress, _vp_tonemask_adj_16, _vp_tonemask_adj_16, _vp_tonemask_adj_16, _psy_noiseguards_16, _psy_noisebias_16_impulse, _psy_noisebias_16_short, _psy_noisebias_16_short, _psy_noisebias_16, _psy_noise_suppress, _psy_compand_8, _psy_compand_16_mapping, _psy_compand_16_mapping, {_noise_start_16,_noise_start_16}, { _noise_part_16, _noise_part_16}, _noise_thresh_16, _psy_ath_floater_16, _psy_ath_abs_16, _psy_lowpass_16, _psy_global_44, _global_mapping_16, _psy_stereo_modes_16, _floor_books, _floor, 2, _floor_mapping_16, _mapres_template_16_stereo};static const ve_setup_data_template ve_setup_16_uncoupled={ 3, rate_mapping_16_uncoupled, quality_mapping_16, -1, 15000, 19000, blocksize_16_short, blocksize_16_long, _psy_tone_masteratt_16, _psy_tone_0dB, _psy_tone_suppress, _vp_tonemask_adj_16, _vp_tonemask_adj_16, _vp_tonemask_adj_16, _psy_noiseguards_16, _psy_noisebias_16_impulse, _psy_noisebias_16_short, _psy_noisebias_16_short, _psy_noisebias_16, _psy_noise_suppress, _psy_compand_8, _psy_compand_16_mapping, _psy_compand_16_mapping, {_noise_start_16,_noise_start_16}, { _noise_part_16, _noise_part_16}, _noise_thresh_16, _psy_ath_floater_16, _psy_ath_abs_16, _psy_lowpass_16, _psy_global_44, _global_mapping_16, _psy_stereo_modes_16, _floor_books, _floor, 2, _floor_mapping_16, _mapres_template_16_uncoupled};vendor/vorbis/lib/modes/setup_22.hadded
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 * * by the Xiph.Org Foundation https://xiph.org/ * * * ******************************************************************** function: 22kHz settings ********************************************************************/static const double rate_mapping_22[4]={ 15000.,20000.,44000.,86000.};static const double rate_mapping_22_uncoupled[4]={ 16000.,28000.,50000.,90000.};static const double _psy_lowpass_22[4]={9.5,11.,30.,99.};static const ve_setup_data_template ve_setup_22_stereo={ 3, rate_mapping_22, quality_mapping_16, 2, 19000, 26000, blocksize_16_short, blocksize_16_long, _psy_tone_masteratt_16, _psy_tone_0dB, _psy_tone_suppress, _vp_tonemask_adj_16, _vp_tonemask_adj_16, _vp_tonemask_adj_16, _psy_noiseguards_16, _psy_noisebias_16_impulse, _psy_noisebias_16_short, _psy_noisebias_16_short, _psy_noisebias_16, _psy_noise_suppress, _psy_compand_8, _psy_compand_16_mapping, _psy_compand_16_mapping, {_noise_start_16,_noise_start_16}, { _noise_part_16, _noise_part_16}, _noise_thresh_16, _psy_ath_floater_16, _psy_ath_abs_16, _psy_lowpass_22, _psy_global_44, _global_mapping_16, _psy_stereo_modes_16, _floor_books, _floor, 2, _floor_mapping_16, _mapres_template_16_stereo};static const ve_setup_data_template ve_setup_22_uncoupled={ 3, rate_mapping_22_uncoupled, quality_mapping_16, -1, 19000, 26000, blocksize_16_short, blocksize_16_long, _psy_tone_masteratt_16, _psy_tone_0dB, _psy_tone_suppress, _vp_tonemask_adj_16, _vp_tonemask_adj_16, _vp_tonemask_adj_16, _psy_noiseguards_16, _psy_noisebias_16_impulse, _psy_noisebias_16_short, _psy_noisebias_16_short, _psy_noisebias_16, _psy_noise_suppress, _psy_compand_8, _psy_compand_16_mapping, _psy_compand_16_mapping, {_noise_start_16,_noise_start_16}, { _noise_part_16, _noise_part_16}, _noise_thresh_16, _psy_ath_floater_16, _psy_ath_abs_16, _psy_lowpass_22, _psy_global_44, _global_mapping_16, _psy_stereo_modes_16, _floor_books, _floor, 2, _floor_mapping_16, _mapres_template_16_uncoupled};vendor/vorbis/lib/modes/setup_32.hadded
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 * * by the Xiph.Org Foundation https://xiph.org/ * * * ******************************************************************** function: toplevel settings for 32kHz ********************************************************************/static const double rate_mapping_32[12]={ 18000.,28000.,35000.,45000.,56000.,60000., 75000.,90000.,100000.,115000.,150000.,190000.,};static const double rate_mapping_32_un[12]={ 30000.,42000.,52000.,64000.,72000.,78000., 86000.,92000.,110000.,120000.,140000.,190000.,};static const double _psy_lowpass_32[12]={ 12.3,13.,13.,14.,15.,99.,99.,99.,99.,99.,99.,99.};static const ve_setup_data_template ve_setup_32_stereo={ 11, rate_mapping_32, quality_mapping_44, 2, 26000, 40000, blocksize_short_44, blocksize_long_44, _psy_tone_masteratt_44, _psy_tone_0dB, _psy_tone_suppress, _vp_tonemask_adj_otherblock, _vp_tonemask_adj_longblock, _vp_tonemask_adj_otherblock, _psy_noiseguards_44, _psy_noisebias_impulse, _psy_noisebias_padding, _psy_noisebias_trans, _psy_noisebias_long, _psy_noise_suppress, _psy_compand_44, _psy_compand_short_mapping, _psy_compand_long_mapping, {_noise_start_short_44,_noise_start_long_44}, {_noise_part_short_44,_noise_part_long_44}, _noise_thresh_44, _psy_ath_floater, _psy_ath_abs, _psy_lowpass_32, _psy_global_44, _global_mapping_44, _psy_stereo_modes_44, _floor_books, _floor, 2, _floor_mapping_44, _mapres_template_44_stereo};static const ve_setup_data_template ve_setup_32_uncoupled={ 11, rate_mapping_32_un, quality_mapping_44, -1, 26000, 40000, blocksize_short_44, blocksize_long_44, _psy_tone_masteratt_44, _psy_tone_0dB, _psy_tone_suppress, _vp_tonemask_adj_otherblock, _vp_tonemask_adj_longblock, _vp_tonemask_adj_otherblock, _psy_noiseguards_44, _psy_noisebias_impulse, _psy_noisebias_padding, _psy_noisebias_trans, _psy_noisebias_long, _psy_noise_suppress, _psy_compand_44, _psy_compand_short_mapping, _psy_compand_long_mapping, {_noise_start_short_44,_noise_start_long_44}, {_noise_part_short_44,_noise_part_long_44}, _noise_thresh_44, _psy_ath_floater, _psy_ath_abs, _psy_lowpass_32, _psy_global_44, _global_mapping_44, NULL, _floor_books, _floor, 2, _floor_mapping_44, _mapres_template_44_uncoupled};vendor/vorbis/lib/modes/setup_44.hadded
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 * * by the Xiph.Org Foundation https://xiph.org/ * * * ******************************************************************** function: toplevel settings for 44.1/48kHz ********************************************************************/#include "modes/floor_all.h"#include "modes/residue_44.h"#include "modes/psych_44.h"static const double rate_mapping_44_stereo[12]={ 22500.,32000.,40000.,48000.,56000.,64000., 80000.,96000.,112000.,128000.,160000.,250001.};static const double quality_mapping_44[12]={ -.1,.0,.1,.2,.3,.4,.5,.6,.7,.8,.9,1.0};static const int blocksize_short_44[11]={ 512,256,256,256,256,256,256,256,256,256,256};static const int blocksize_long_44[11]={ 4096,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048};static const double _psy_compand_short_mapping[12]={ 0.5, 1., 1., 1.3, 1.6, 2., 2., 2., 2., 2., 2., 2.};static const double _psy_compand_long_mapping[12]={ 3.5, 4., 4., 4.3, 4.6, 5., 5., 5., 5., 5., 5., 5.};static const double _global_mapping_44[12]={ /* 1., 1., 1.5, 2., 2., 2.5, 2.7, 3.0, 3.5, 4., 4. */ 0., 1., 1., 1.5, 2., 2., 2.5, 2.7, 3.0, 3.7, 4., 4.};static const int _floor_mapping_44a[11]={ 1,0,0,2,2,4,5,5,5,5,5};static const int _floor_mapping_44b[11]={ 8,7,7,7,7,7,7,7,7,7,7};static const int _floor_mapping_44c[11]={ 10,10,10,10,10,10,10,10,10,10,10};static const int *_floor_mapping_44[]={ _floor_mapping_44a, _floor_mapping_44b, _floor_mapping_44c,};static const ve_setup_data_template ve_setup_44_stereo={ 11, rate_mapping_44_stereo, quality_mapping_44, 2, 40000, 50000, blocksize_short_44, blocksize_long_44, _psy_tone_masteratt_44, _psy_tone_0dB, _psy_tone_suppress, _vp_tonemask_adj_otherblock, _vp_tonemask_adj_longblock, _vp_tonemask_adj_otherblock, _psy_noiseguards_44, _psy_noisebias_impulse, _psy_noisebias_padding, _psy_noisebias_trans, _psy_noisebias_long, _psy_noise_suppress, _psy_compand_44, _psy_compand_short_mapping, _psy_compand_long_mapping, {_noise_start_short_44,_noise_start_long_44}, {_noise_part_short_44,_noise_part_long_44}, _noise_thresh_44, _psy_ath_floater, _psy_ath_abs, _psy_lowpass_44, _psy_global_44, _global_mapping_44, _psy_stereo_modes_44, _floor_books, _floor, 2, _floor_mapping_44, _mapres_template_44_stereo};vendor/vorbis/lib/modes/setup_44p51.hadded
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2010 * * by the Xiph.Org Foundation https://xiph.org/ * * * ******************************************************************** function: toplevel settings for 44.1/48kHz 5.1 surround modes ********************************************************************/#include "modes/residue_44p51.h"static const double rate_mapping_44p51[12]={ 14000.,20000.,28000.,38000.,46000.,54000., 75000.,96000.,120000.,140000.,180000.,240001.};static const ve_setup_data_template ve_setup_44_51={ 11, rate_mapping_44p51, quality_mapping_44, 6, 40000, 70000, blocksize_short_44, blocksize_long_44, _psy_tone_masteratt_44, _psy_tone_0dB, _psy_tone_suppress, _vp_tonemask_adj_otherblock, _vp_tonemask_adj_longblock, _vp_tonemask_adj_otherblock, _psy_noiseguards_44, _psy_noisebias_impulse, _psy_noisebias_padding, _psy_noisebias_trans, _psy_noisebias_long, _psy_noise_suppress, _psy_compand_44, _psy_compand_short_mapping, _psy_compand_long_mapping, {_noise_start_short_44,_noise_start_long_44}, {_noise_part_short_44,_noise_part_long_44}, _noise_thresh_44, _psy_ath_floater, _psy_ath_abs, _psy_lowpass_44, _psy_global_44, _global_mapping_44, _psy_stereo_modes_44, _floor_books, _floor, 3, _floor_mapping_44, _mapres_template_44_51};vendor/vorbis/lib/modes/setup_44u.hadded
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 * * by the Xiph.Org Foundation https://xiph.org/ * * * ******************************************************************** function: toplevel settings for 44.1/48kHz uncoupled modes ********************************************************************/#include "modes/residue_44u.h"static const double rate_mapping_44_un[12]={ 32000.,48000.,60000.,70000.,80000.,86000., 96000.,110000.,120000.,140000.,160000.,240001.};static const ve_setup_data_template ve_setup_44_uncoupled={ 11, rate_mapping_44_un, quality_mapping_44, -1, 40000, 50000, blocksize_short_44, blocksize_long_44, _psy_tone_masteratt_44, _psy_tone_0dB, _psy_tone_suppress, _vp_tonemask_adj_otherblock, _vp_tonemask_adj_longblock, _vp_tonemask_adj_otherblock, _psy_noiseguards_44, _psy_noisebias_impulse, _psy_noisebias_padding, _psy_noisebias_trans, _psy_noisebias_long, _psy_noise_suppress, _psy_compand_44, _psy_compand_short_mapping, _psy_compand_long_mapping, {_noise_start_short_44,_noise_start_long_44}, {_noise_part_short_44,_noise_part_long_44}, _noise_thresh_44, _psy_ath_floater, _psy_ath_abs, _psy_lowpass_44, _psy_global_44, _global_mapping_44, _psy_stereo_modes_44, _floor_books, _floor, 2, _floor_mapping_44, _mapres_template_44_uncoupled};vendor/vorbis/lib/modes/setup_8.hadded
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 * * by the Xiph.Org Foundation https://xiph.org/ * * * ******************************************************************** function: 8kHz settings ********************************************************************/#include "psych_8.h"#include "residue_8.h"static const int blocksize_8[2]={ 512,512};static const int _floor_mapping_8a[]={ 6,6};static const int *_floor_mapping_8[]={ _floor_mapping_8a};static const double rate_mapping_8[3]={ 6000.,9000.,32000.,};static const double rate_mapping_8_uncoupled[3]={ 8000.,14000.,42000.,};static const double quality_mapping_8[3]={ -.1,.0,1.};static const double _psy_compand_8_mapping[3]={ 0., 1., 1.};static const double _global_mapping_8[3]={ 1., 2., 3. };static const ve_setup_data_template ve_setup_8_stereo={ 2, rate_mapping_8, quality_mapping_8, 2, 8000, 9000, blocksize_8, blocksize_8, _psy_tone_masteratt_8, _psy_tone_0dB, _psy_tone_suppress, _vp_tonemask_adj_8, NULL, _vp_tonemask_adj_8, _psy_noiseguards_8, _psy_noisebias_8, _psy_noisebias_8, NULL, NULL, _psy_noise_suppress, _psy_compand_8, _psy_compand_8_mapping, NULL, {_noise_start_8,_noise_start_8}, {_noise_part_8,_noise_part_8}, _noise_thresh_5only, _psy_ath_floater_8, _psy_ath_abs_8, _psy_lowpass_8, _psy_global_44, _global_mapping_8, _psy_stereo_modes_8, _floor_books, _floor, 1, _floor_mapping_8, _mapres_template_8_stereo};static const ve_setup_data_template ve_setup_8_uncoupled={ 2, rate_mapping_8_uncoupled, quality_mapping_8, -1, 8000, 9000, blocksize_8, blocksize_8, _psy_tone_masteratt_8, _psy_tone_0dB, _psy_tone_suppress, _vp_tonemask_adj_8, NULL, _vp_tonemask_adj_8, _psy_noiseguards_8, _psy_noisebias_8, _psy_noisebias_8, NULL, NULL, _psy_noise_suppress, _psy_compand_8, _psy_compand_8_mapping, NULL, {_noise_start_8,_noise_start_8}, {_noise_part_8,_noise_part_8}, _noise_thresh_5only, _psy_ath_floater_8, _psy_ath_abs_8, _psy_lowpass_8, _psy_global_44, _global_mapping_8, _psy_stereo_modes_8, _floor_books, _floor, 1, _floor_mapping_8, _mapres_template_8_uncoupled};vendor/vorbis/lib/modes/setup_X.hadded
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 * * by the Xiph.Org Foundation https://xiph.org/ * * * ******************************************************************** function: catch-all toplevel settings for q modes only ********************************************************************/static const double rate_mapping_X[12]={ -1.,-1.,-1.,-1.,-1.,-1., -1.,-1.,-1.,-1.,-1.,-1.};static const ve_setup_data_template ve_setup_X_stereo={ 11, rate_mapping_X, quality_mapping_44, 2, 50000, 200000, blocksize_short_44, blocksize_long_44, _psy_tone_masteratt_44, _psy_tone_0dB, _psy_tone_suppress, _vp_tonemask_adj_otherblock, _vp_tonemask_adj_longblock, _vp_tonemask_adj_otherblock, _psy_noiseguards_44, _psy_noisebias_impulse, _psy_noisebias_padding, _psy_noisebias_trans, _psy_noisebias_long, _psy_noise_suppress, _psy_compand_44, _psy_compand_short_mapping, _psy_compand_long_mapping, {_noise_start_short_44,_noise_start_long_44}, {_noise_part_short_44,_noise_part_long_44}, _noise_thresh_44, _psy_ath_floater, _psy_ath_abs, _psy_lowpass_44, _psy_global_44, _global_mapping_44, _psy_stereo_modes_44, _floor_books, _floor, 2, _floor_mapping_44, _mapres_template_44_stereo};static const ve_setup_data_template ve_setup_X_uncoupled={ 11, rate_mapping_X, quality_mapping_44, -1, 50000, 200000, blocksize_short_44, blocksize_long_44, _psy_tone_masteratt_44, _psy_tone_0dB, _psy_tone_suppress, _vp_tonemask_adj_otherblock, _vp_tonemask_adj_longblock, _vp_tonemask_adj_otherblock, _psy_noiseguards_44, _psy_noisebias_impulse, _psy_noisebias_padding, _psy_noisebias_trans, _psy_noisebias_long, _psy_noise_suppress, _psy_compand_44, _psy_compand_short_mapping, _psy_compand_long_mapping, {_noise_start_short_44,_noise_start_long_44}, {_noise_part_short_44,_noise_part_long_44}, _noise_thresh_44, _psy_ath_floater, _psy_ath_abs, _psy_lowpass_44, _psy_global_44, _global_mapping_44, NULL, _floor_books, _floor, 2, _floor_mapping_44, _mapres_template_44_uncoupled};static const ve_setup_data_template ve_setup_XX_stereo={ 2, rate_mapping_X, quality_mapping_8, 2, 0, 8000, blocksize_8, blocksize_8, _psy_tone_masteratt_8, _psy_tone_0dB, _psy_tone_suppress, _vp_tonemask_adj_8, NULL, _vp_tonemask_adj_8, _psy_noiseguards_8, _psy_noisebias_8, _psy_noisebias_8, NULL, NULL, _psy_noise_suppress, _psy_compand_8, _psy_compand_8_mapping, NULL, {_noise_start_8,_noise_start_8}, {_noise_part_8,_noise_part_8}, _noise_thresh_5only, _psy_ath_floater_8, _psy_ath_abs_8, _psy_lowpass_8, _psy_global_44, _global_mapping_8, _psy_stereo_modes_8, _floor_books, _floor, 1, _floor_mapping_8, _mapres_template_8_stereo};static const ve_setup_data_template ve_setup_XX_uncoupled={ 2, rate_mapping_X, quality_mapping_8, -1, 0, 8000, blocksize_8, blocksize_8, _psy_tone_masteratt_8, _psy_tone_0dB, _psy_tone_suppress, _vp_tonemask_adj_8, NULL, _vp_tonemask_adj_8, _psy_noiseguards_8, _psy_noisebias_8, _psy_noisebias_8, NULL, NULL, _psy_noise_suppress, _psy_compand_8, _psy_compand_8_mapping, NULL, {_noise_start_8,_noise_start_8}, {_noise_part_8,_noise_part_8}, _noise_thresh_5only, _psy_ath_floater_8, _psy_ath_abs_8, _psy_lowpass_8, _psy_global_44, _global_mapping_8, _psy_stereo_modes_8, _floor_books, _floor, 1, _floor_mapping_8, _mapres_template_8_uncoupled};vendor/vorbis/lib/os.hadded
#ifndef _OS_H#define _OS_H/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2015 * * by the Xiph.Org Foundation https://xiph.org/ * * * ******************************************************************** function: #ifdef jail to whip a few platforms into the UNIX ideal. ********************************************************************/#ifdef HAVE_CONFIG_H#include "config.h"#endif#include <math.h>#include <ogg/os_types.h>#include "misc.h"#ifndef _V_IFDEFJAIL_H_# define _V_IFDEFJAIL_H_# ifdef __GNUC__# define STIN static __inline__# elif defined(_WIN32)# define STIN static __inline# else# define STIN static# endif#ifdef DJGPP# define rint(x) (floor((x)+0.5f))#endif#ifndef M_PI# define M_PI (3.1415926536f)#endif#if defined(_WIN32) && !defined(__SYMBIAN32__)# include <malloc.h># define rint(x) (floor((x)+0.5f))# define NO_FLOAT_MATH_LIB# define FAST_HYPOT(a, b) sqrt((a)*(a) + (b)*(b))#endif#if defined(__SYMBIAN32__) && defined(__WINS__)void *_alloca(size_t size);# define alloca _alloca#endif#ifndef FAST_HYPOT# define FAST_HYPOT hypot#endif#endif /* _V_IFDEFJAIL_H_ */#ifdef HAVE_ALLOCA_H# include <alloca.h>#endif#ifdef USE_MEMORY_H# include <memory.h>#endif#ifndef min# define min(x,y) ((x)>(y)?(y):(x))#endif#ifndef max# define max(x,y) ((x)<(y)?(y):(x))#endif/* Special i386 GCC implementation */#if defined(__i386__) && defined(__GNUC__) && !defined(__BEOS__) && !defined(__SSE2_MATH__)# define VORBIS_FPU_CONTROL/* both GCC and MSVC are kinda stupid about rounding/casting to int. Because of encapsulation constraints (GCC can't see inside the asm block and so we end up doing stupid things like a store/load that is collectively a noop), we do it this way *//* we must set up the fpu before this works!! */typedef ogg_int16_t vorbis_fpu_control;static inline void vorbis_fpu_setround(vorbis_fpu_control *fpu){ ogg_int16_t ret; ogg_int16_t temp; __asm__ __volatile__("fnstcw %0\n\t" "movw %0,%%dx\n\t" "andw $62463,%%dx\n\t" "movw %%dx,%1\n\t" "fldcw %1\n\t":"=m"(ret):"m"(temp): "dx"); *fpu=ret;}static inline void vorbis_fpu_restore(vorbis_fpu_control fpu){ __asm__ __volatile__("fldcw %0":: "m"(fpu));}/* assumes the FPU is in round mode! */static inline int vorbis_ftoi(double f){ /* yes, double! Otherwise, we get extra fst/fld to truncate precision */ int i; __asm__("fistl %0": "=m"(i) : "t"(f)); return(i);}#endif /* Special i386 GCC implementation *//* MSVC inline assembly. 32 bit only; inline ASM isn't implemented in the * 64 bit compiler and doesn't work on arm. */#if defined(_MSC_VER) && defined(_M_IX86) && !defined(_WIN32_WCE)# define VORBIS_FPU_CONTROLtypedef ogg_int16_t vorbis_fpu_control;static __inline int vorbis_ftoi(double f){ int i; __asm{ fld f fistp i } return i;}static __inline void vorbis_fpu_setround(vorbis_fpu_control *fpu){ (void)fpu;}static __inline void vorbis_fpu_restore(vorbis_fpu_control fpu){ (void)fpu;}#endif /* Special MSVC 32 bit implementation *//* Optimized code path for x86_64 builds. Uses SSE2 intrinsics. This can be done safely because all x86_64 CPUs supports SSE2. */#if (defined(_MSC_VER) && defined(_M_X64)) || (defined(__GNUC__) && defined (__SSE2_MATH__))# define VORBIS_FPU_CONTROLtypedef ogg_int16_t vorbis_fpu_control;#include <emmintrin.h>static __inline int vorbis_ftoi(double f){ return _mm_cvtsd_si32(_mm_load_sd(&f));}static __inline void vorbis_fpu_setround(vorbis_fpu_control *fpu){ (void)fpu;}static __inline void vorbis_fpu_restore(vorbis_fpu_control fpu){ (void)fpu;}#endif /* Special MSVC x64 implementation *//* If no special implementation was found for the current compiler / platform, use the default implementation here: */#ifndef VORBIS_FPU_CONTROLtypedef int vorbis_fpu_control;STIN int vorbis_ftoi(double f){ /* Note: MSVC and GCC (at least on some systems) round towards zero, thus, the floor() call is required to ensure correct roudning of negative numbers */ return (int)floor(f+.5);}/* We don't have special code for this compiler/arch, so do it the slow way */# define vorbis_fpu_setround(vorbis_fpu_control) {}# define vorbis_fpu_restore(vorbis_fpu_control) {}#endif /* default implementation */#endif /* _OS_H */vendor/vorbis/lib/psy.cadded
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2010 * * by the Xiph.Org Foundation https://xiph.org/ * * * ******************************************************************** function: psychoacoustics not including preecho ********************************************************************/#include <stdlib.h>#include <math.h>#include <string.h>#include "vorbis/codec.h"#include "codec_internal.h"#include "masking.h"#include "psy.h"#include "os.h"#include "lpc.h"#include "smallft.h"#include "scales.h"#include "misc.h"#define NEGINF -9999.fstatic const double stereo_threshholds[]={0.0, .5, 1.0, 1.5, 2.5, 4.5, 8.5, 16.5, 9e10};static const double stereo_threshholds_limited[]={0.0, .5, 1.0, 1.5, 2.0, 2.5, 4.5, 8.5, 9e10};vorbis_look_psy_global *_vp_global_look(vorbis_info *vi){ codec_setup_info *ci=vi->codec_setup; vorbis_info_psy_global *gi=&ci->psy_g_param; vorbis_look_psy_global *look=_ogg_calloc(1,sizeof(*look)); look->channels=vi->channels; look->ampmax=-9999.; look->gi=gi; return(look);}void _vp_global_free(vorbis_look_psy_global *look){ if(look){ memset(look,0,sizeof(*look)); _ogg_free(look); }}void _vi_gpsy_free(vorbis_info_psy_global *i){ if(i){ memset(i,0,sizeof(*i)); _ogg_free(i); }}void _vi_psy_free(vorbis_info_psy *i){ if(i){ memset(i,0,sizeof(*i)); _ogg_free(i); }}static void min_curve(float *c, float *c2){ int i; for(i=0;i<EHMER_MAX;i++)if(c2[i]<c[i])c[i]=c2[i];}static void max_curve(float *c, float *c2){ int i; for(i=0;i<EHMER_MAX;i++)if(c2[i]>c[i])c[i]=c2[i];}static void attenuate_curve(float *c,float att){ int i; for(i=0;i<EHMER_MAX;i++) c[i]+=att;}static float ***setup_tone_curves(float curveatt_dB[P_BANDS],float binHz,int n, float center_boost, float center_decay_rate){ int i,j,k,m; float ath[EHMER_MAX]; float workc[P_BANDS][P_LEVELS][EHMER_MAX]; float athc[P_LEVELS][EHMER_MAX]; float *brute_buffer=alloca(n*sizeof(*brute_buffer)); float ***ret=_ogg_malloc(sizeof(*ret)*P_BANDS); memset(workc,0,sizeof(workc)); for(i=0;i<P_BANDS;i++){ /* we add back in the ATH to avoid low level curves falling off to -infinity and unnecessarily cutting off high level curves in the curve limiting (last step). */ /* A half-band's settings must be valid over the whole band, and it's better to mask too little than too much */ int ath_offset=i*4; for(j=0;j<EHMER_MAX;j++){ float min=999.; for(k=0;k<4;k++) if(j+k+ath_offset<MAX_ATH){ if(min>ATH[j+k+ath_offset])min=ATH[j+k+ath_offset]; }else{ if(min>ATH[MAX_ATH-1])min=ATH[MAX_ATH-1]; } ath[j]=min; } /* copy curves into working space, replicate the 50dB curve to 30 and 40, replicate the 100dB curve to 110 */ for(j=0;j<6;j++) memcpy(workc[i][j+2],tonemasks[i][j],EHMER_MAX*sizeof(*tonemasks[i][j])); memcpy(workc[i][0],tonemasks[i][0],EHMER_MAX*sizeof(*tonemasks[i][0])); memcpy(workc[i][1],tonemasks[i][0],EHMER_MAX*sizeof(*tonemasks[i][0])); /* apply centered curve boost/decay */ for(j=0;j<P_LEVELS;j++){ for(k=0;k<EHMER_MAX;k++){ float adj=center_boost+abs(EHMER_OFFSET-k)*center_decay_rate; if(adj<0. && center_boost>0)adj=0.; if(adj>0. && center_boost<0)adj=0.; workc[i][j][k]+=adj; } } /* normalize curves so the driving amplitude is 0dB */ /* make temp curves with the ATH overlayed */ for(j=0;j<P_LEVELS;j++){ attenuate_curve(workc[i][j],curveatt_dB[i]+100.-(j<2?2:j)*10.-P_LEVEL_0); memcpy(athc[j],ath,EHMER_MAX*sizeof(**athc)); attenuate_curve(athc[j],+100.-j*10.f-P_LEVEL_0); max_curve(athc[j],workc[i][j]); } /* Now limit the louder curves. the idea is this: We don't know what the playback attenuation will be; 0dB SL moves every time the user twiddles the volume knob. So that means we have to use a single 'most pessimal' curve for all masking amplitudes, right? Wrong. The *loudest* sound can be in (we assume) a range of ...+100dB] SL. However, sounds 20dB down will be in a range ...+80], 40dB down is from ...+60], etc... */ for(j=1;j<P_LEVELS;j++){ min_curve(athc[j],athc[j-1]); min_curve(workc[i][j],athc[j]); } } for(i=0;i<P_BANDS;i++){ int hi_curve,lo_curve,bin; ret[i]=_ogg_malloc(sizeof(**ret)*P_LEVELS); /* low frequency curves are measured with greater resolution than the MDCT/FFT will actually give us; we want the curve applied to the tone data to be pessimistic and thus apply the minimum masking possible for a given bin. That means that a single bin could span more than one octave and that the curve will be a composite of multiple octaves. It also may mean that a single bin may span > an eighth of an octave and that the eighth octave values may also be composited. */ /* which octave curves will we be compositing? */ bin=floor(fromOC(i*.5)/binHz); lo_curve= ceil(toOC(bin*binHz+1)*2); hi_curve= floor(toOC((bin+1)*binHz)*2); if(lo_curve>i)lo_curve=i; if(lo_curve<0)lo_curve=0; if(hi_curve>=P_BANDS)hi_curve=P_BANDS-1; for(m=0;m<P_LEVELS;m++){ ret[i][m]=_ogg_malloc(sizeof(***ret)*(EHMER_MAX+2)); for(j=0;j<n;j++)brute_buffer[j]=999.; /* render the curve into bins, then pull values back into curve. The point is that any inherent subsampling aliasing results in a safe minimum */ for(k=lo_curve;k<=hi_curve;k++){ int l=0; for(j=0;j<EHMER_MAX;j++){ int lo_bin= fromOC(j*.125+k*.5-2.0625)/binHz; int hi_bin= fromOC(j*.125+k*.5-1.9375)/binHz+1; if(lo_bin<0)lo_bin=0; if(lo_bin>n)lo_bin=n; if(lo_bin<l)l=lo_bin; if(hi_bin<0)hi_bin=0; if(hi_bin>n)hi_bin=n; for(;l<hi_bin && l<n;l++) if(brute_buffer[l]>workc[k][m][j]) brute_buffer[l]=workc[k][m][j]; } for(;l<n;l++) if(brute_buffer[l]>workc[k][m][EHMER_MAX-1]) brute_buffer[l]=workc[k][m][EHMER_MAX-1]; } /* be equally paranoid about being valid up to next half ocatve */ if(i+1<P_BANDS){ int l=0; k=i+1; for(j=0;j<EHMER_MAX;j++){ int lo_bin= fromOC(j*.125+i*.5-2.0625)/binHz; int hi_bin= fromOC(j*.125+i*.5-1.9375)/binHz+1; if(lo_bin<0)lo_bin=0; if(lo_bin>n)lo_bin=n; if(lo_bin<l)l=lo_bin; if(hi_bin<0)hi_bin=0; if(hi_bin>n)hi_bin=n; for(;l<hi_bin && l<n;l++) if(brute_buffer[l]>workc[k][m][j]) brute_buffer[l]=workc[k][m][j]; } for(;l<n;l++) if(brute_buffer[l]>workc[k][m][EHMER_MAX-1]) brute_buffer[l]=workc[k][m][EHMER_MAX-1]; } for(j=0;j<EHMER_MAX;j++){ int bin=fromOC(j*.125+i*.5-2.)/binHz; if(bin<0){ ret[i][m][j+2]=-999.; }else{ if(bin>=n){ ret[i][m][j+2]=-999.; }else{ ret[i][m][j+2]=brute_buffer[bin]; } } } /* add fenceposts */ for(j=0;j<EHMER_OFFSET;j++) if(ret[i][m][j+2]>-200.f)break; ret[i][m][0]=j; for(j=EHMER_MAX-1;j>EHMER_OFFSET+1;j--) if(ret[i][m][j+2]>-200.f) break; ret[i][m][1]=j; } } return(ret);}void _vp_psy_init(vorbis_look_psy *p,vorbis_info_psy *vi, vorbis_info_psy_global *gi,int n,long rate){ long i,j,lo=-99,hi=1; long maxoc; memset(p,0,sizeof(*p)); p->eighth_octave_lines=gi->eighth_octave_lines; p->shiftoc=rint(log(gi->eighth_octave_lines*8.f)/log(2.f))-1; p->firstoc=toOC(.25f*rate*.5/n)*(1<<(p->shiftoc+1))-gi->eighth_octave_lines; maxoc=toOC((n+.25f)*rate*.5/n)*(1<<(p->shiftoc+1))+.5f; p->total_octave_lines=maxoc-p->firstoc+1; p->ath=_ogg_malloc(n*sizeof(*p->ath)); p->octave=_ogg_malloc(n*sizeof(*p->octave)); p->bark=_ogg_malloc(n*sizeof(*p->bark)); p->vi=vi; p->n=n; p->rate=rate; /* AoTuV HF weighting */ p->m_val = 1.; if(rate < 26000) p->m_val = 0; else if(rate < 38000) p->m_val = .94; /* 32kHz */ else if(rate > 46000) p->m_val = 1.275; /* 48kHz */ /* set up the lookups for a given blocksize and sample rate */ for(i=0,j=0;i<MAX_ATH-1;i++){ int endpos=rint(fromOC((i+1)*.125-2.)*2*n/rate); float base=ATH[i]; if(j<endpos){ float delta=(ATH[i+1]-base)/(endpos-j); for(;j<endpos && j<n;j++){ p->ath[j]=base+100.; base+=delta; } } } for(;j<n;j++){ p->ath[j]=p->ath[j-1]; } for(i=0;i<n;i++){ float bark=toBARK(rate/(2*n)*i); for(;lo+vi->noisewindowlomin<i && toBARK(rate/(2*n)*lo)<(bark-vi->noisewindowlo);lo++); for(;hi<=n && (hi<i+vi->noisewindowhimin || toBARK(rate/(2*n)*hi)<(bark+vi->noisewindowhi));hi++); p->bark[i]=((lo-1)<<16)+(hi-1); } for(i=0;i<n;i++) p->octave[i]=toOC((i+.25f)*.5*rate/n)*(1<<(p->shiftoc+1))+.5f; p->tonecurves=setup_tone_curves(vi->toneatt,rate*.5/n,n, vi->tone_centerboost,vi->tone_decay); /* set up rolling noise median */ p->noiseoffset=_ogg_malloc(P_NOISECURVES*sizeof(*p->noiseoffset)); for(i=0;i<P_NOISECURVES;i++) p->noiseoffset[i]=_ogg_malloc(n*sizeof(**p->noiseoffset)); for(i=0;i<n;i++){ float halfoc=toOC((i+.5)*rate/(2.*n))*2.; int inthalfoc; float del; if(halfoc<0)halfoc=0; if(halfoc>=P_BANDS-1)halfoc=P_BANDS-1; inthalfoc=(int)halfoc; del=halfoc-inthalfoc; for(j=0;j<P_NOISECURVES;j++) p->noiseoffset[j][i]= p->vi->noiseoff[j][inthalfoc]*(1.-del) + p->vi->noiseoff[j][inthalfoc+1]*del; }#if 0 { static int ls=0; _analysis_output_always("noiseoff0",ls,p->noiseoffset[0],n,1,0,0); _analysis_output_always("noiseoff1",ls,p->noiseoffset[1],n,1,0,0); _analysis_output_always("noiseoff2",ls++,p->noiseoffset[2],n,1,0,0); }#endif}void _vp_psy_clear(vorbis_look_psy *p){ int i,j; if(p){ if(p->ath)_ogg_free(p->ath); if(p->octave)_ogg_free(p->octave); if(p->bark)_ogg_free(p->bark); if(p->tonecurves){ for(i=0;i<P_BANDS;i++){ for(j=0;j<P_LEVELS;j++){ _ogg_free(p->tonecurves[i][j]); } _ogg_free(p->tonecurves[i]); } _ogg_free(p->tonecurves); } if(p->noiseoffset){ for(i=0;i<P_NOISECURVES;i++){ _ogg_free(p->noiseoffset[i]); } _ogg_free(p->noiseoffset); } memset(p,0,sizeof(*p)); }}/* octave/(8*eighth_octave_lines) x scale and dB y scale */static void seed_curve(float *seed, const float **curves, float amp, int oc, int n, int linesper,float dBoffset){ int i,post1; int seedptr; const float *posts,*curve; int choice=(int)((amp+dBoffset-P_LEVEL_0)*.1f); choice=max(choice,0); choice=min(choice,P_LEVELS-1); posts=curves[choice]; curve=posts+2; post1=(int)posts[1]; seedptr=oc+(posts[0]-EHMER_OFFSET)*linesper-(linesper>>1); for(i=posts[0];i<post1;i++){ if(seedptr>0){ float lin=amp+curve[i]; if(seed[seedptr]<lin)seed[seedptr]=lin; } seedptr+=linesper; if(seedptr>=n)break; }}static void seed_loop(vorbis_look_psy *p, const float ***curves, const float *f, const float *flr, float *seed, float specmax){ vorbis_info_psy *vi=p->vi; long n=p->n,i; float dBoffset=vi->max_curve_dB-specmax; /* prime the working vector with peak values */ for(i=0;i<n;i++){ float max=f[i]; long oc=p->octave[i]; while(i+1<n && p->octave[i+1]==oc){ i++; if(f[i]>max)max=f[i]; } if(max+6.f>flr[i]){ oc=oc>>p->shiftoc; if(oc>=P_BANDS)oc=P_BANDS-1; if(oc<0)oc=0; seed_curve(seed, curves[oc], max, p->octave[i]-p->firstoc, p->total_octave_lines, p->eighth_octave_lines, dBoffset); } }}static void seed_chase(float *seeds, int linesper, long n){ long *posstack=alloca(n*sizeof(*posstack)); float *ampstack=alloca(n*sizeof(*ampstack)); long stack=0; long pos=0; long i; for(i=0;i<n;i++){ if(stack<2){ posstack[stack]=i; ampstack[stack++]=seeds[i]; }else{ while(1){ if(seeds[i]<ampstack[stack-1]){ posstack[stack]=i; ampstack[stack++]=seeds[i]; break; }else{ if(i<posstack[stack-1]+linesper){ if(stack>1 && ampstack[stack-1]<=ampstack[stack-2] && i<posstack[stack-2]+linesper){ /* we completely overlap, making stack-1 irrelevant. pop it */ stack--; continue; } } posstack[stack]=i; ampstack[stack++]=seeds[i]; break; } } } } /* the stack now contains only the positions that are relevant. Scan 'em straight through */ for(i=0;i<stack;i++){ long endpos; if(i<stack-1 && ampstack[i+1]>ampstack[i]){ endpos=posstack[i+1]; }else{ endpos=posstack[i]+linesper+1; /* +1 is important, else bin 0 is discarded in short frames */ } if(endpos>n)endpos=n; for(;pos<endpos;pos++) seeds[pos]=ampstack[i]; }Showing the first 500 of 1210 diff lines for this file. This diff is INCOMPLETE; read the file or clone the repository for the rest.
vendor/vorbis/lib/psy.hadded
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 * * by the Xiph.Org Foundation https://xiph.org/ * * * ******************************************************************** function: random psychoacoustics (not including preecho) ********************************************************************/#ifndef _V_PSY_H_#define _V_PSY_H_#include "smallft.h"#include "backends.h"#include "envelope.h"#ifndef EHMER_MAX#define EHMER_MAX 56#endif/* psychoacoustic setup ********************************************/#define P_BANDS 17 /* 62Hz to 16kHz */#define P_LEVELS 8 /* 30dB to 100dB */#define P_LEVEL_0 30. /* 30 dB */#define P_NOISECURVES 3#define NOISE_COMPAND_LEVELS 40typedef struct vorbis_info_psy{ int blockflag; float ath_adjatt; float ath_maxatt; float tone_masteratt[P_NOISECURVES]; float tone_centerboost; float tone_decay; float tone_abs_limit; float toneatt[P_BANDS]; int noisemaskp; float noisemaxsupp; float noisewindowlo; float noisewindowhi; int noisewindowlomin; int noisewindowhimin; int noisewindowfixed; float noiseoff[P_NOISECURVES][P_BANDS]; float noisecompand[NOISE_COMPAND_LEVELS]; float max_curve_dB; int normal_p; int normal_start; int normal_partition; double normal_thresh;} vorbis_info_psy;typedef struct{ int eighth_octave_lines; /* for block long/short tuning; encode only */ float preecho_thresh[VE_BANDS]; float postecho_thresh[VE_BANDS]; float stretch_penalty; float preecho_minenergy; float ampmax_att_per_sec; /* channel coupling config */ int coupling_pkHz[PACKETBLOBS]; int coupling_pointlimit[2][PACKETBLOBS]; int coupling_prepointamp[PACKETBLOBS]; int coupling_postpointamp[PACKETBLOBS]; int sliding_lowpass[2][PACKETBLOBS];} vorbis_info_psy_global;typedef struct { float ampmax; int channels; vorbis_info_psy_global *gi; int coupling_pointlimit[2][P_NOISECURVES];} vorbis_look_psy_global;typedef struct { int n; struct vorbis_info_psy *vi; float ***tonecurves; float **noiseoffset; float *ath; long *octave; /* in n.ocshift format */ long *bark; long firstoc; long shiftoc; int eighth_octave_lines; /* power of two, please */ int total_octave_lines; long rate; /* cache it */ float m_val; /* Masking compensation value */} vorbis_look_psy;extern void _vp_psy_init(vorbis_look_psy *p,vorbis_info_psy *vi, vorbis_info_psy_global *gi,int n,long rate);extern void _vp_psy_clear(vorbis_look_psy *p);extern void *_vi_psy_dup(void *source);extern void _vi_psy_free(vorbis_info_psy *i);extern vorbis_info_psy *_vi_psy_copy(vorbis_info_psy *i);extern void _vp_noisemask(vorbis_look_psy *p, float *logmdct, float *logmask);extern void _vp_tonemask(vorbis_look_psy *p, float *logfft, float *logmask, float global_specmax, float local_specmax);extern void _vp_offset_and_mix(vorbis_look_psy *p, float *noise, float *tone, int offset_select, float *logmask, float *mdct, float *logmdct);extern float _vp_ampmax_decay(float amp,vorbis_dsp_state *vd);extern void _vp_couple_quantize_normalize(int blobno, vorbis_info_psy_global *g, vorbis_look_psy *p, vorbis_info_mapping0 *vi, float **mdct, int **iwork, int *nonzero, int sliding_lowpass, int ch);#endifvendor/vorbis/lib/registry.cadded
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 * * by the Xiph.Org Foundation https://xiph.org/ * * * ******************************************************************** function: registry for time, floor, res backends and channel mappings ********************************************************************/#include "vorbis/codec.h"#include "codec_internal.h"#include "registry.h"#include "misc.h"/* seems like major overkill now; the backend numbers will grow into the infrastructure soon enough */extern const vorbis_func_floor floor0_exportbundle;extern const vorbis_func_floor floor1_exportbundle;extern const vorbis_func_residue residue0_exportbundle;extern const vorbis_func_residue residue1_exportbundle;extern const vorbis_func_residue residue2_exportbundle;extern const vorbis_func_mapping mapping0_exportbundle;const vorbis_func_floor *const _floor_P[]={ &floor0_exportbundle, &floor1_exportbundle,};const vorbis_func_residue *const _residue_P[]={ &residue0_exportbundle, &residue1_exportbundle, &residue2_exportbundle,};const vorbis_func_mapping *const _mapping_P[]={ &mapping0_exportbundle,};vendor/vorbis/lib/registry.hadded
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 * * by the Xiph.Org Foundation https://xiph.org/ * * * ******************************************************************** function: registry for time, floor, res backends and channel mappings ********************************************************************/#ifndef _V_REG_H_#define _V_REG_H_#define VI_TRANSFORMB 1#define VI_WINDOWB 1#define VI_TIMEB 1#define VI_FLOORB 2#define VI_RESB 3#define VI_MAPB 1extern const vorbis_func_floor *const _floor_P[];extern const vorbis_func_residue *const _residue_P[];extern const vorbis_func_mapping *const _mapping_P[];#endifvendor/vorbis/lib/res0.cadded
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2010 * * by the Xiph.Org Foundation https://xiph.org/ * * * ******************************************************************** function: residue backend 0, 1 and 2 implementation ********************************************************************//* Slow, slow, slow, simpleminded and did I mention it was slow? The encode/decode loops are coded for clarity and performance is not yet even a nagging little idea lurking in the shadows. Oh and BTW, it's slow. */#include <stdlib.h>#include <string.h>#include <math.h>#include <ogg/ogg.h>#include "vorbis/codec.h"#include "codec_internal.h"#include "registry.h"#include "codebook.h"#include "misc.h"#include "os.h"#if defined(TRAIN_RES) || defined (TRAIN_RESAUX)#include <stdio.h>#endiftypedef struct { vorbis_info_residue0 *info; int parts; int stages; codebook *fullbooks; codebook *phrasebook; codebook ***partbooks; int partvals; int **decodemap; long postbits; long phrasebits; long frames;#if defined(TRAIN_RES) || defined(TRAIN_RESAUX) int train_seq; long *training_data[8][64]; float training_max[8][64]; float training_min[8][64]; float tmin; float tmax; int submap;#endif} vorbis_look_residue0;void res0_free_info(vorbis_info_residue *i){ vorbis_info_residue0 *info=(vorbis_info_residue0 *)i; if(info){ memset(info,0,sizeof(*info)); _ogg_free(info); }}void res0_free_look(vorbis_look_residue *i){ int j; if(i){ vorbis_look_residue0 *look=(vorbis_look_residue0 *)i;#ifdef TRAIN_RES { int j,k,l; for(j=0;j<look->parts;j++){ /*fprintf(stderr,"partition %d: ",j);*/ for(k=0;k<8;k++) if(look->training_data[k][j]){ char buffer[80]; FILE *of; codebook *statebook=look->partbooks[j][k]; /* long and short into the same bucket by current convention */ sprintf(buffer,"res_sub%d_part%d_pass%d.vqd",look->submap,j,k); of=fopen(buffer,"a"); for(l=0;l<statebook->entries;l++) fprintf(of,"%d:%ld\n",l,look->training_data[k][j][l]); fclose(of); /*fprintf(stderr,"%d(%.2f|%.2f) ",k, look->training_min[k][j],look->training_max[k][j]);*/ _ogg_free(look->training_data[k][j]); look->training_data[k][j]=NULL; } /*fprintf(stderr,"\n");*/ } } fprintf(stderr,"min/max residue: %g::%g\n",look->tmin,look->tmax); /*fprintf(stderr,"residue bit usage %f:%f (%f total)\n", (float)look->phrasebits/look->frames, (float)look->postbits/look->frames, (float)(look->postbits+look->phrasebits)/look->frames);*/#endif /*vorbis_info_residue0 *info=look->info; fprintf(stderr, "%ld frames encoded in %ld phrasebits and %ld residue bits " "(%g/frame) \n",look->frames,look->phrasebits, look->resbitsflat, (look->phrasebits+look->resbitsflat)/(float)look->frames); for(j=0;j<look->parts;j++){ long acc=0; fprintf(stderr,"\t[%d] == ",j); for(k=0;k<look->stages;k++) if((info->secondstages[j]>>k)&1){ fprintf(stderr,"%ld,",look->resbits[j][k]); acc+=look->resbits[j][k]; } fprintf(stderr,":: (%ld vals) %1.2fbits/sample\n",look->resvals[j], acc?(float)acc/(look->resvals[j]*info->grouping):0); } fprintf(stderr,"\n");*/ for(j=0;j<look->parts;j++) if(look->partbooks[j])_ogg_free(look->partbooks[j]); _ogg_free(look->partbooks); for(j=0;j<look->partvals;j++) _ogg_free(look->decodemap[j]); _ogg_free(look->decodemap); memset(look,0,sizeof(*look)); _ogg_free(look); }}static int icount(unsigned int v){ int ret=0; while(v){ ret+=v&1; v>>=1; } return(ret);}void res0_pack(vorbis_info_residue *vr,oggpack_buffer *opb){ vorbis_info_residue0 *info=(vorbis_info_residue0 *)vr; int j,acc=0; oggpack_write(opb,info->begin,24); oggpack_write(opb,info->end,24); oggpack_write(opb,info->grouping-1,24); /* residue vectors to group and code with a partitioned book */ oggpack_write(opb,info->partitions-1,6); /* possible partition choices */ oggpack_write(opb,info->groupbook,8); /* group huffman book */ /* secondstages is a bitmask; as encoding progresses pass by pass, a bitmask of one indicates this partition class has bits to write this pass */ for(j=0;j<info->partitions;j++){ if(ov_ilog(info->secondstages[j])>3){ /* yes, this is a minor hack due to not thinking ahead */ oggpack_write(opb,info->secondstages[j],3); oggpack_write(opb,1,1); oggpack_write(opb,info->secondstages[j]>>3,5); }else oggpack_write(opb,info->secondstages[j],4); /* trailing zero */ acc+=icount(info->secondstages[j]); } for(j=0;j<acc;j++) oggpack_write(opb,info->booklist[j],8);}/* vorbis_info is for range checking */vorbis_info_residue *res0_unpack(vorbis_info *vi,oggpack_buffer *opb){ int j,acc=0; vorbis_info_residue0 *info=_ogg_calloc(1,sizeof(*info)); codec_setup_info *ci=vi->codec_setup; info->begin=oggpack_read(opb,24); info->end=oggpack_read(opb,24); info->grouping=oggpack_read(opb,24)+1; info->partitions=oggpack_read(opb,6)+1; info->groupbook=oggpack_read(opb,8); /* check for premature EOP */ if(info->groupbook<0)goto errout; for(j=0;j<info->partitions;j++){ int cascade=oggpack_read(opb,3); int cflag=oggpack_read(opb,1); if(cflag<0) goto errout; if(cflag){ int c=oggpack_read(opb,5); if(c<0) goto errout; cascade|=(c<<3); } info->secondstages[j]=cascade; acc+=icount(cascade); } for(j=0;j<acc;j++){ int book=oggpack_read(opb,8); if(book<0) goto errout; info->booklist[j]=book; } if(info->groupbook>=ci->books)goto errout; for(j=0;j<acc;j++){ if(info->booklist[j]>=ci->books)goto errout; if(ci->book_param[info->booklist[j]]->maptype==0)goto errout; } /* verify the phrasebook is not specifying an impossible or inconsistent partitioning scheme. */ /* modify the phrasebook ranging check from r16327; an early beta encoder had a bug where it used an oversized phrasebook by accident. These files should continue to be playable, but don't allow an exploit */ { int entries = ci->book_param[info->groupbook]->entries; int dim = ci->book_param[info->groupbook]->dim; int partvals = 1; if (dim<1) goto errout; while(dim>0){ partvals *= info->partitions; if(partvals > entries) goto errout; dim--; } info->partvals = partvals; } return(info); errout: res0_free_info(info); return(NULL);}vorbis_look_residue *res0_look(vorbis_dsp_state *vd, vorbis_info_residue *vr){ vorbis_info_residue0 *info=(vorbis_info_residue0 *)vr; vorbis_look_residue0 *look=_ogg_calloc(1,sizeof(*look)); codec_setup_info *ci=vd->vi->codec_setup; int j,k,acc=0; int dim; int maxstage=0; look->info=info; look->parts=info->partitions; look->fullbooks=ci->fullbooks; look->phrasebook=ci->fullbooks+info->groupbook; dim=look->phrasebook->dim; look->partbooks=_ogg_calloc(look->parts,sizeof(*look->partbooks)); for(j=0;j<look->parts;j++){ int stages=ov_ilog(info->secondstages[j]); if(stages){ if(stages>maxstage)maxstage=stages; look->partbooks[j]=_ogg_calloc(stages,sizeof(*look->partbooks[j])); for(k=0;k<stages;k++) if(info->secondstages[j]&(1<<k)){ look->partbooks[j][k]=ci->fullbooks+info->booklist[acc++];#ifdef TRAIN_RES look->training_data[k][j]=_ogg_calloc(look->partbooks[j][k]->entries, sizeof(***look->training_data));#endif } } } look->partvals=1; for(j=0;j<dim;j++) look->partvals*=look->parts; look->stages=maxstage; look->decodemap=_ogg_malloc(look->partvals*sizeof(*look->decodemap)); for(j=0;j<look->partvals;j++){ long val=j; long mult=look->partvals/look->parts; look->decodemap[j]=_ogg_malloc(dim*sizeof(*look->decodemap[j])); for(k=0;k<dim;k++){ long deco=val/mult; val-=deco*mult; mult/=look->parts; look->decodemap[j][k]=deco; } }#if defined(TRAIN_RES) || defined (TRAIN_RESAUX) { static int train_seq=0; look->train_seq=train_seq++; }#endif return(look);}/* break an abstraction and copy some code for performance purposes */static int local_book_besterror(codebook *book,int *a){ int dim=book->dim; int i,j,o; int minval=book->minval; int del=book->delta; int qv=book->quantvals; int ze=(qv>>1); int index=0; /* assumes integer/centered encoder codebook maptype 1 no more than dim 8 */ int p[8]={0,0,0,0,0,0,0,0}; if(del!=1){ for(i=0,o=dim;i<dim;i++){ int v = (a[--o]-minval+(del>>1))/del; int m = (v<ze ? ((ze-v)<<1)-1 : ((v-ze)<<1)); index = index*qv+ (m<0?0:(m>=qv?qv-1:m)); p[o]=v*del+minval; } }else{ for(i=0,o=dim;i<dim;i++){ int v = a[--o]-minval; int m = (v<ze ? ((ze-v)<<1)-1 : ((v-ze)<<1)); index = index*qv+ (m<0?0:(m>=qv?qv-1:m)); p[o]=v*del+minval; } } if(book->c->lengthlist[index]<=0){ const static_codebook *c=book->c; int best=-1; /* assumes integer/centered encoder codebook maptype 1 no more than dim 8 */ int e[8]={0,0,0,0,0,0,0,0}; int maxval = book->minval + book->delta*(book->quantvals-1); for(i=0;i<book->entries;i++){ if(c->lengthlist[i]>0){ int this=0; for(j=0;j<dim;j++){ int val=(e[j]-a[j]); this+=val*val; } if(best==-1 || this<best){ memcpy(p,e,sizeof(p)); best=this; index=i; } } /* assumes the value patterning created by the tools in vq/ */ j=0; while(e[j]>=maxval) e[j++]=0; if(e[j]>=0) e[j]+=book->delta; e[j]= -e[j]; } } if(index>-1){ for(i=0;i<dim;i++) *a++ -= p[i]; } return(index);}#ifdef TRAIN_RESstatic int _encodepart(oggpack_buffer *opb,int *vec, int n, codebook *book,long *acc){#elsestatic int _encodepart(oggpack_buffer *opb,int *vec, int n, codebook *book){#endif int i,bits=0; int dim=book->dim; int step=n/dim; for(i=0;i<step;i++){ int entry=local_book_besterror(book,vec+i*dim);#ifdef TRAIN_RES if(entry>=0) acc[entry]++;#endif bits+=vorbis_book_encode(book,entry,opb); } return(bits);}static long **_01class(vorbis_block *vb,vorbis_look_residue *vl, int **in,int ch){ long i,j,k; vorbis_look_residue0 *look=(vorbis_look_residue0 *)vl; vorbis_info_residue0 *info=look->info; /* move all this setup out later */ int samples_per_partition=info->grouping; int possible_partitions=info->partitions; int n=info->end-info->begin; int partvals=n/samples_per_partition; long **partword=_vorbis_block_alloc(vb,ch*sizeof(*partword)); float scale=100./samples_per_partition; /* we find the partition type for each partition of each channel. We'll go back and do the interleaved encoding in a bit. For now, clarity */ for(i=0;i<ch;i++){ partword[i]=_vorbis_block_alloc(vb,n/samples_per_partition*sizeof(*partword[i])); memset(partword[i],0,n/samples_per_partition*sizeof(*partword[i])); } for(i=0;i<partvals;i++){ int offset=i*samples_per_partition+info->begin; for(j=0;j<ch;j++){ int max=0; int ent=0; for(k=0;k<samples_per_partition;k++){ if(abs(in[j][offset+k])>max)max=abs(in[j][offset+k]); ent+=abs(in[j][offset+k]); } ent*=scale; for(k=0;k<possible_partitions-1;k++) if(max<=info->classmetric1[k] && (info->classmetric2[k]<0 || ent<info->classmetric2[k])) break; partword[j][i]=k; } }#ifdef TRAIN_RESAUX { FILE *of; char buffer[80]; for(i=0;i<ch;i++){ sprintf(buffer,"resaux_%d.vqd",look->train_seq); of=fopen(buffer,"a"); for(j=0;j<partvals;j++) fprintf(of,"%ld, ",partword[i][j]); fprintf(of,"\n"); fclose(of); } }#endif look->frames++; return(partword);}/* designed for stereo or other modes where the partition size is an integer multiple of the number of channels encoded in the current submap */static long **_2class(vorbis_block *vb,vorbis_look_residue *vl,int **in, int ch){ long i,j,k,l; vorbis_look_residue0 *look=(vorbis_look_residue0 *)vl; vorbis_info_residue0 *info=look->info; /* move all this setup out later */ int samples_per_partition=info->grouping; int possible_partitions=info->partitions; int n=info->end-info->begin; int partvals=n/samples_per_partition; long **partword=_vorbis_block_alloc(vb,sizeof(*partword));#if defined(TRAIN_RES) || defined (TRAIN_RESAUX) FILE *of; char buffer[80];#endif partword[0]=_vorbis_block_alloc(vb,partvals*sizeof(*partword[0])); memset(partword[0],0,partvals*sizeof(*partword[0])); for(i=0,l=info->begin/ch;i<partvals;i++){ int magmax=0; int angmax=0; for(j=0;j<samples_per_partition;j+=ch){ if(abs(in[0][l])>magmax)magmax=abs(in[0][l]);Showing the first 500 of 887 diff lines for this file. This diff is INCOMPLETE; read the file or clone the repository for the rest.
vendor/vorbis/lib/scales.hadded
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 * * by the Xiph.Org Foundation https://xiph.org/ * * * ******************************************************************** function: linear scale -> dB, Bark and Mel scales ********************************************************************/#ifndef _V_SCALES_H_#define _V_SCALES_H_#include <math.h>#include "os.h"#ifdef _MSC_VER/* MS Visual Studio doesn't have C99 inline keyword. */#define inline __inline#endif/* 20log10(x) */#define VORBIS_IEEE_FLOAT32 1#ifdef VORBIS_IEEE_FLOAT32static inline float unitnorm(float x){ union { ogg_uint32_t i; float f; } ix; ix.f = x; ix.i = (ix.i & 0x80000000U) | (0x3f800000U); return ix.f;}/* Segher was off (too high) by ~ .3 decibel. Center the conversion correctly. */static inline float todB(const float *x){ union { ogg_uint32_t i; float f; } ix; ix.f = *x; ix.i = ix.i&0x7fffffff; return (float)(ix.i * 7.17711438e-7f -764.6161886f);}#define todB_nn(x) todB(x)#elsestatic float unitnorm(float x){ if(x<0)return(-1.f); return(1.f);}#define todB(x) (*(x)==0?-400.f:log(*(x)**(x))*4.34294480f)#define todB_nn(x) (*(x)==0.f?-400.f:log(*(x))*8.6858896f)#endif#define fromdB(x) (exp((x)*.11512925f))/* The bark scale equations are approximations, since the original table was somewhat hand rolled. The below are chosen to have the best possible fit to the rolled tables, thus their somewhat odd appearance (these are more accurate and over a longer range than the oft-quoted bark equations found in the texts I have). The approximations are valid from 0 - 30kHz (nyquist) or so. all f in Hz, z in Bark */#define toBARK(n) (13.1f*atan(.00074f*(n))+2.24f*atan((n)*(n)*1.85e-8f)+1e-4f*(n))#define fromBARK(z) (102.f*(z)-2.f*pow(z,2.f)+.4f*pow(z,3.f)+pow(1.46f,z)-1.f)#define toMEL(n) (log(1.f+(n)*.001f)*1442.695f)#define fromMEL(m) (1000.f*exp((m)/1442.695f)-1000.f)/* Frequency to octave. We arbitrarily declare 63.5 Hz to be octave 0.0 */#define toOC(n) (log(n)*1.442695f-5.965784f)#define fromOC(o) (exp(((o)+5.965784f)*.693147f))#endifvendor/vorbis/lib/sharedbook.cadded
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2015 * * by the Xiph.Org Foundation https://xiph.org/ * * * ******************************************************************** function: basic shared codebook operations ********************************************************************/#include <stdlib.h>#include <limits.h>#include <math.h>#include <string.h>#include <ogg/ogg.h>#include "os.h"#include "misc.h"#include "vorbis/codec.h"#include "codebook.h"#include "scales.h"/**** pack/unpack helpers ******************************************/int ov_ilog(ogg_uint32_t v){ int ret; for(ret=0;v;ret++)v>>=1; return ret;}/* 32 bit float (not IEEE; nonnormalized mantissa + biased exponent) : neeeeeee eeemmmmm mmmmmmmm mmmmmmmm Why not IEEE? It's just not that important here. */#define VQ_FEXP 10#define VQ_FMAN 21#define VQ_FEXP_BIAS 768 /* bias toward values smaller than 1. *//* doesn't currently guard under/overflow */long _float32_pack(float val){ int sign=0; long exp; long mant; if(val<0){ sign=0x80000000; val= -val; } exp= floor(log(val)/log(2.f)+.001); /* +epsilon */ mant=rint(ldexp(val,(VQ_FMAN-1)-exp)); exp=(exp+VQ_FEXP_BIAS)<<VQ_FMAN; return(sign|exp|mant);}float _float32_unpack(long val){ double mant=val&0x1fffff; int sign=val&0x80000000; long exp =(val&0x7fe00000L)>>VQ_FMAN; if(sign)mant= -mant; exp=exp-(VQ_FMAN-1)-VQ_FEXP_BIAS; /* clamp excessive exponent values */ if (exp>63){ exp=63; } if (exp<-63){ exp=-63; } return(ldexp(mant,exp));}/* given a list of word lengths, generate a list of codewords. Works for length ordered or unordered, always assigns the lowest valued codewords first. Extended to handle unused entries (length 0) */ogg_uint32_t *_make_words(char *l,long n,long sparsecount){ long i,j,count=0; ogg_uint32_t marker[33]; ogg_uint32_t *r=_ogg_malloc((sparsecount?sparsecount:n)*sizeof(*r)); memset(marker,0,sizeof(marker)); for(i=0;i<n;i++){ long length=l[i]; if(length>0){ ogg_uint32_t entry=marker[length]; /* when we claim a node for an entry, we also claim the nodes below it (pruning off the imagined tree that may have dangled from it) as well as blocking the use of any nodes directly above for leaves */ /* update ourself */ if(length<32 && (entry>>length)){ /* error condition; the lengths must specify an overpopulated tree */ _ogg_free(r); return(NULL); } r[count++]=entry; /* Look to see if the next shorter marker points to the node above. if so, update it and repeat. */ { for(j=length;j>0;j--){ if(marker[j]&1){ /* have to jump branches */ if(j==1) marker[1]++; else marker[j]=marker[j-1]<<1; break; /* invariant says next upper marker would already have been moved if it was on the same path */ } marker[j]++; } } /* prune the tree; the implicit invariant says all the longer markers were dangling from our just-taken node. Dangle them from our *new* node. */ for(j=length+1;j<33;j++) if((marker[j]>>1) == entry){ entry=marker[j]; marker[j]=marker[j-1]<<1; }else break; }else if(sparsecount==0)count++; } /* any underpopulated tree must be rejected. */ /* Single-entry codebooks are a retconned extension to the spec. They have a single codeword '0' of length 1 that results in an underpopulated tree. Shield that case from the underformed tree check. */ if(!(count==1 && marker[2]==2)){ for(i=1;i<33;i++) if(marker[i] & (0xffffffffUL>>(32-i))){ _ogg_free(r); return(NULL); } } /* bitreverse the words because our bitwise packer/unpacker is LSb endian */ for(i=0,count=0;i<n;i++){ ogg_uint32_t temp=0; for(j=0;j<l[i];j++){ temp<<=1; temp|=(r[count]>>j)&1; } if(sparsecount){ if(l[i]) r[count++]=temp; }else r[count++]=temp; } return(r);}/* there might be a straightforward one-line way to do the below that's portable and totally safe against roundoff, but I haven't thought of it. Therefore, we opt on the side of caution */long _book_maptype1_quantvals(const static_codebook *b){ long vals; if(b->entries<1){ return(0); } vals=floor(pow((float)b->entries,1.f/b->dim)); /* the above *should* be reliable, but we'll not assume that FP is ever reliable when bitstream sync is at stake; verify via integer means that vals really is the greatest value of dim for which vals^b->bim <= b->entries */ /* treat the above as an initial guess */ if(vals<1){ vals=1; } while(1){ long acc=1; long acc1=1; int i; for(i=0;i<b->dim;i++){ if(b->entries/vals<acc)break; acc*=vals; if(LONG_MAX/(vals+1)<acc1)acc1=LONG_MAX; else acc1*=vals+1; } if(i>=b->dim && acc<=b->entries && acc1>b->entries){ return(vals); }else{ if(i<b->dim || acc>b->entries){ vals--; }else{ vals++; } } }}/* unpack the quantized list of values for encode/decode ***********//* we need to deal with two map types: in map type 1, the values are generated algorithmically (each column of the vector counts through the values in the quant vector). in map type 2, all the values came in in an explicit list. Both value lists must be unpacked */float *_book_unquantize(const static_codebook *b,int n,int *sparsemap){ long j,k,count=0; if(b->maptype==1 || b->maptype==2){ int quantvals; float mindel=_float32_unpack(b->q_min); float delta=_float32_unpack(b->q_delta); float *r=_ogg_calloc(n*b->dim,sizeof(*r)); /* maptype 1 and 2 both use a quantized value vector, but different sizes */ switch(b->maptype){ case 1: /* most of the time, entries%dimensions == 0, but we need to be well defined. We define that the possible vales at each scalar is values == entries/dim. If entries%dim != 0, we'll have 'too few' values (values*dim<entries), which means that we'll have 'left over' entries; left over entries use zeroed values (and are wasted). So don't generate codebooks like that */ quantvals=_book_maptype1_quantvals(b); for(j=0;j<b->entries;j++){ if((sparsemap && b->lengthlist[j]) || !sparsemap){ float last=0.f; int indexdiv=1; for(k=0;k<b->dim;k++){ int index= (j/indexdiv)%quantvals; float val=b->quantlist[index]; val=fabs(val)*delta+mindel+last; if(b->q_sequencep)last=val; if(sparsemap) r[sparsemap[count]*b->dim+k]=val; else r[count*b->dim+k]=val; indexdiv*=quantvals; } count++; } } break; case 2: for(j=0;j<b->entries;j++){ if((sparsemap && b->lengthlist[j]) || !sparsemap){ float last=0.f; for(k=0;k<b->dim;k++){ float val=b->quantlist[j*b->dim+k]; val=fabs(val)*delta+mindel+last; if(b->q_sequencep)last=val; if(sparsemap) r[sparsemap[count]*b->dim+k]=val; else r[count*b->dim+k]=val; } count++; } } break; } return(r); } return(NULL);}void vorbis_staticbook_destroy(static_codebook *b){ if(b->allocedp){ if(b->quantlist)_ogg_free(b->quantlist); if(b->lengthlist)_ogg_free(b->lengthlist); memset(b,0,sizeof(*b)); _ogg_free(b); } /* otherwise, it is in static memory */}void vorbis_book_clear(codebook *b){ /* static book is not cleared; we're likely called on the lookup and the static codebook belongs to the info struct */ if(b->valuelist)_ogg_free(b->valuelist); if(b->codelist)_ogg_free(b->codelist); if(b->dec_index)_ogg_free(b->dec_index); if(b->dec_codelengths)_ogg_free(b->dec_codelengths); if(b->dec_firsttable)_ogg_free(b->dec_firsttable); memset(b,0,sizeof(*b));}int vorbis_book_init_encode(codebook *c,const static_codebook *s){ memset(c,0,sizeof(*c)); c->c=s; c->entries=s->entries; c->used_entries=s->entries; c->dim=s->dim; c->codelist=_make_words(s->lengthlist,s->entries,0); /* c->valuelist=_book_unquantize(s,s->entries,NULL); */ c->quantvals=_book_maptype1_quantvals(s); c->minval=(int)rint(_float32_unpack(s->q_min)); c->delta=(int)rint(_float32_unpack(s->q_delta)); return(0);}static ogg_uint32_t bitreverse(ogg_uint32_t x){ x= ((x>>16)&0x0000ffffUL) | ((x<<16)&0xffff0000UL); x= ((x>> 8)&0x00ff00ffUL) | ((x<< 8)&0xff00ff00UL); x= ((x>> 4)&0x0f0f0f0fUL) | ((x<< 4)&0xf0f0f0f0UL); x= ((x>> 2)&0x33333333UL) | ((x<< 2)&0xccccccccUL); return((x>> 1)&0x55555555UL) | ((x<< 1)&0xaaaaaaaaUL);}static int sort32a(const void *a,const void *b){ return ( **(ogg_uint32_t **)a>**(ogg_uint32_t **)b)- ( **(ogg_uint32_t **)a<**(ogg_uint32_t **)b);}/* decode codebook arrangement is more heavily optimized than encode */int vorbis_book_init_decode(codebook *c,const static_codebook *s){ int i,j,n=0,tabn; int *sortindex; memset(c,0,sizeof(*c)); /* count actually used entries and find max length */ for(i=0;i<s->entries;i++) if(s->lengthlist[i]>0) n++; c->entries=s->entries; c->used_entries=n; c->dim=s->dim; if(n>0){ /* two different remappings go on here. First, we collapse the likely sparse codebook down only to actually represented values/words. This collapsing needs to be indexed as map-valueless books are used to encode original entry positions as integers. Second, we reorder all vectors, including the entry index above, by sorted bitreversed codeword to allow treeless decode. */ /* perform sort */ ogg_uint32_t *codes=_make_words(s->lengthlist,s->entries,c->used_entries); ogg_uint32_t **codep=alloca(sizeof(*codep)*n); if(codes==NULL)goto err_out; for(i=0;i<n;i++){ codes[i]=bitreverse(codes[i]); codep[i]=codes+i; } qsort(codep,n,sizeof(*codep),sort32a); sortindex=alloca(n*sizeof(*sortindex)); c->codelist=_ogg_malloc(n*sizeof(*c->codelist)); /* the index is a reverse index */ for(i=0;i<n;i++){ int position=codep[i]-codes; sortindex[position]=i; } for(i=0;i<n;i++) c->codelist[sortindex[i]]=codes[i]; _ogg_free(codes); c->valuelist=_book_unquantize(s,n,sortindex); c->dec_index=_ogg_malloc(n*sizeof(*c->dec_index)); for(n=0,i=0;i<s->entries;i++) if(s->lengthlist[i]>0) c->dec_index[sortindex[n++]]=i; c->dec_codelengths=_ogg_malloc(n*sizeof(*c->dec_codelengths)); c->dec_maxlength=0; for(n=0,i=0;i<s->entries;i++) if(s->lengthlist[i]>0){ c->dec_codelengths[sortindex[n++]]=s->lengthlist[i]; if(s->lengthlist[i]>c->dec_maxlength) c->dec_maxlength=s->lengthlist[i]; } if(n==1 && c->dec_maxlength==1){ /* special case the 'single entry codebook' with a single bit fastpath table (that always returns entry 0 )in order to use unmodified decode paths. */ c->dec_firsttablen=1; c->dec_firsttable=_ogg_calloc(2,sizeof(*c->dec_firsttable)); c->dec_firsttable[0]=c->dec_firsttable[1]=1; }else{ c->dec_firsttablen=ov_ilog(c->used_entries)-4; /* this is magic */ if(c->dec_firsttablen<5)c->dec_firsttablen=5; if(c->dec_firsttablen>8)c->dec_firsttablen=8; tabn=1<<c->dec_firsttablen; c->dec_firsttable=_ogg_calloc(tabn,sizeof(*c->dec_firsttable)); for(i=0;i<n;i++){ if(c->dec_codelengths[i]<=c->dec_firsttablen){ ogg_uint32_t orig=bitreverse(c->codelist[i]); for(j=0;j<(1<<(c->dec_firsttablen-c->dec_codelengths[i]));j++) c->dec_firsttable[orig|(j<<c->dec_codelengths[i])]=i+1; } } /* now fill in 'unused' entries in the firsttable with hi/lo search hints for the non-direct-hits */ { ogg_uint32_t mask=0xfffffffeUL<<(31-c->dec_firsttablen); long lo=0,hi=0; for(i=0;i<tabn;i++){ ogg_uint32_t word=i<<(32-c->dec_firsttablen); if(c->dec_firsttable[bitreverse(word)]==0){ while((lo+1)<n && c->codelist[lo+1]<=word)lo++; while( hi<n && word>=(c->codelist[hi]&mask))hi++; /* we only actually have 15 bits per hint to play with here. In order to overflow gracefully (nothing breaks, efficiency just drops), encode as the difference from the extremes. */ { unsigned long loval=lo; unsigned long hival=n-hi; if(loval>0x7fff)loval=0x7fff; if(hival>0x7fff)hival=0x7fff; c->dec_firsttable[bitreverse(word)]= 0x80000000UL | (loval<<15) | hival; } } } } } } return(0); err_out: vorbis_book_clear(c); return(-1);}long vorbis_book_codeword(codebook *book,int entry){ if(book->c) /* only use with encode; decode optimizations are allowed to break this */ return book->codelist[entry]; return -1;}long vorbis_book_codelen(codebook *book,int entry){ if(book->c) /* only use with encode; decode optimizations are allowed to break this */ return book->c->lengthlist[entry]; return -1;}#ifdef _V_SELFTEST/* Unit tests of the dequantizer; this stuff will be OK cross-platform, I simply want to be sure that special mapping cases actually work properly; a bug could go unnoticed for a while */#include <stdio.h>/* cases: no mapping full, explicit mapping algorithmic mapping nonsequential sequential*/static long full_quantlist1[]={0,1,2,3, 4,5,6,7, 8,3,6,1};static long partial_quantlist1[]={0,7,2};/* no mapping */static_codebook test1={ 4,16, NULL, 0, 0,0,0,0, NULL, 0};static float *test1_result=NULL;Showing the first 500 of 605 diff lines for this file. This diff is INCOMPLETE; read the file or clone the repository for the rest.
vendor/vorbis/lib/smallft.cadded
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 * * by the Xiph.Org Foundation https://xiph.org/ * * * ******************************************************************** function: *unnormalized* fft transform ********************************************************************//* FFT implementation from OggSquish, minus cosine transforms, * minus all but radix 2/4 case. In Vorbis we only need this * cut-down version. * * To do more than just power-of-two sized vectors, see the full * version I wrote for NetLib. * * Note that the packing is a little strange; rather than the FFT r/i * packing following R_0, I_n, R_1, I_1, R_2, I_2 ... R_n-1, I_n-1, * it follows R_0, R_1, I_1, R_2, I_2 ... R_n-1, I_n-1, I_n like the * FORTRAN version */#include <stdlib.h>#include <string.h>#include <math.h>#include "smallft.h"#include "os.h"#include "misc.h"static void drfti1(int n, float *wa, int *ifac){ static int ntryh[4] = { 4,2,3,5 }; static float tpi = 6.28318530717958648f; float arg,argh,argld,fi; int ntry=0,i,j=-1; int k1, l1, l2, ib; int ld, ii, ip, is, nq, nr; int ido, ipm, nfm1; int nl=n; int nf=0; L101: j++; if (j < 4) ntry=ntryh[j]; else ntry+=2; L104: nq=nl/ntry; nr=nl-ntry*nq; if (nr!=0) goto L101; nf++; ifac[nf+1]=ntry; nl=nq; if(ntry!=2)goto L107; if(nf==1)goto L107; for (i=1;i<nf;i++){ ib=nf-i+1; ifac[ib+1]=ifac[ib]; } ifac[2] = 2; L107: if(nl!=1)goto L104; ifac[0]=n; ifac[1]=nf; argh=tpi/n; is=0; nfm1=nf-1; l1=1; if(nfm1==0)return; for (k1=0;k1<nfm1;k1++){ ip=ifac[k1+2]; ld=0; l2=l1*ip; ido=n/l2; ipm=ip-1; for (j=0;j<ipm;j++){ ld+=l1; i=is; argld=(float)ld*argh; fi=0.f; for (ii=2;ii<ido;ii+=2){ fi+=1.f; arg=fi*argld; wa[i++]=cos(arg); wa[i++]=sin(arg); } is+=ido; } l1=l2; }}static void fdrffti(int n, float *wsave, int *ifac){ if (n == 1) return; drfti1(n, wsave+n, ifac);}static void dradf2(int ido,int l1,float *cc,float *ch,float *wa1){ int i,k; float ti2,tr2; int t0,t1,t2,t3,t4,t5,t6; t1=0; t0=(t2=l1*ido); t3=ido<<1; for(k=0;k<l1;k++){ ch[t1<<1]=cc[t1]+cc[t2]; ch[(t1<<1)+t3-1]=cc[t1]-cc[t2]; t1+=ido; t2+=ido; } if(ido<2)return; if(ido==2)goto L105; t1=0; t2=t0; for(k=0;k<l1;k++){ t3=t2; t4=(t1<<1)+(ido<<1); t5=t1; t6=t1+t1; for(i=2;i<ido;i+=2){ t3+=2; t4-=2; t5+=2; t6+=2; tr2=wa1[i-2]*cc[t3-1]+wa1[i-1]*cc[t3]; ti2=wa1[i-2]*cc[t3]-wa1[i-1]*cc[t3-1]; ch[t6]=cc[t5]+ti2; ch[t4]=ti2-cc[t5]; ch[t6-1]=cc[t5-1]+tr2; ch[t4-1]=cc[t5-1]-tr2; } t1+=ido; t2+=ido; } if(ido%2==1)return; L105: t3=(t2=(t1=ido)-1); t2+=t0; for(k=0;k<l1;k++){ ch[t1]=-cc[t2]; ch[t1-1]=cc[t3]; t1+=ido<<1; t2+=ido; t3+=ido; }}static void dradf4(int ido,int l1,float *cc,float *ch,float *wa1, float *wa2,float *wa3){ static float hsqt2 = .70710678118654752f; int i,k,t0,t1,t2,t3,t4,t5,t6; float ci2,ci3,ci4,cr2,cr3,cr4,ti1,ti2,ti3,ti4,tr1,tr2,tr3,tr4; t0=l1*ido; t1=t0; t4=t1<<1; t2=t1+(t1<<1); t3=0; for(k=0;k<l1;k++){ tr1=cc[t1]+cc[t2]; tr2=cc[t3]+cc[t4]; ch[t5=t3<<2]=tr1+tr2; ch[(ido<<2)+t5-1]=tr2-tr1; ch[(t5+=(ido<<1))-1]=cc[t3]-cc[t4]; ch[t5]=cc[t2]-cc[t1]; t1+=ido; t2+=ido; t3+=ido; t4+=ido; } if(ido<2)return; if(ido==2)goto L105; t1=0; for(k=0;k<l1;k++){ t2=t1; t4=t1<<2; t5=(t6=ido<<1)+t4; for(i=2;i<ido;i+=2){ t3=(t2+=2); t4+=2; t5-=2; t3+=t0; cr2=wa1[i-2]*cc[t3-1]+wa1[i-1]*cc[t3]; ci2=wa1[i-2]*cc[t3]-wa1[i-1]*cc[t3-1]; t3+=t0; cr3=wa2[i-2]*cc[t3-1]+wa2[i-1]*cc[t3]; ci3=wa2[i-2]*cc[t3]-wa2[i-1]*cc[t3-1]; t3+=t0; cr4=wa3[i-2]*cc[t3-1]+wa3[i-1]*cc[t3]; ci4=wa3[i-2]*cc[t3]-wa3[i-1]*cc[t3-1]; tr1=cr2+cr4; tr4=cr4-cr2; ti1=ci2+ci4; ti4=ci2-ci4; ti2=cc[t2]+ci3; ti3=cc[t2]-ci3; tr2=cc[t2-1]+cr3; tr3=cc[t2-1]-cr3; ch[t4-1]=tr1+tr2; ch[t4]=ti1+ti2; ch[t5-1]=tr3-ti4; ch[t5]=tr4-ti3; ch[t4+t6-1]=ti4+tr3; ch[t4+t6]=tr4+ti3; ch[t5+t6-1]=tr2-tr1; ch[t5+t6]=ti1-ti2; } t1+=ido; } if(ido&1)return; L105: t2=(t1=t0+ido-1)+(t0<<1); t3=ido<<2; t4=ido; t5=ido<<1; t6=ido; for(k=0;k<l1;k++){ ti1=-hsqt2*(cc[t1]+cc[t2]); tr1=hsqt2*(cc[t1]-cc[t2]); ch[t4-1]=tr1+cc[t6-1]; ch[t4+t5-1]=cc[t6-1]-tr1; ch[t4]=ti1-cc[t1+t0]; ch[t4+t5]=ti1+cc[t1+t0]; t1+=ido; t2+=ido; t4+=t3; t6+=ido; }}static void dradfg(int ido,int ip,int l1,int idl1,float *cc,float *c1, float *c2,float *ch,float *ch2,float *wa){ static float tpi=6.283185307179586f; int idij,ipph,i,j,k,l,ic,ik,is; int t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10; float dc2,ai1,ai2,ar1,ar2,ds2; int nbd; float dcp,arg,dsp,ar1h,ar2h; int idp2,ipp2; arg=tpi/(float)ip; dcp=cos(arg); dsp=sin(arg); ipph=(ip+1)>>1; ipp2=ip; idp2=ido; nbd=(ido-1)>>1; t0=l1*ido; t10=ip*ido; if(ido==1)goto L119; for(ik=0;ik<idl1;ik++)ch2[ik]=c2[ik]; t1=0; for(j=1;j<ip;j++){ t1+=t0; t2=t1; for(k=0;k<l1;k++){ ch[t2]=c1[t2]; t2+=ido; } } is=-ido; t1=0; if(nbd>l1){ for(j=1;j<ip;j++){ t1+=t0; is+=ido; t2= -ido+t1; for(k=0;k<l1;k++){ idij=is-1; t2+=ido; t3=t2; for(i=2;i<ido;i+=2){ idij+=2; t3+=2; ch[t3-1]=wa[idij-1]*c1[t3-1]+wa[idij]*c1[t3]; ch[t3]=wa[idij-1]*c1[t3]-wa[idij]*c1[t3-1]; } } } }else{ for(j=1;j<ip;j++){ is+=ido; idij=is-1; t1+=t0; t2=t1; for(i=2;i<ido;i+=2){ idij+=2; t2+=2; t3=t2; for(k=0;k<l1;k++){ ch[t3-1]=wa[idij-1]*c1[t3-1]+wa[idij]*c1[t3]; ch[t3]=wa[idij-1]*c1[t3]-wa[idij]*c1[t3-1]; t3+=ido; } } } } t1=0; t2=ipp2*t0; if(nbd<l1){ for(j=1;j<ipph;j++){ t1+=t0; t2-=t0; t3=t1; t4=t2; for(i=2;i<ido;i+=2){ t3+=2; t4+=2; t5=t3-ido; t6=t4-ido; for(k=0;k<l1;k++){ t5+=ido; t6+=ido; c1[t5-1]=ch[t5-1]+ch[t6-1]; c1[t6-1]=ch[t5]-ch[t6]; c1[t5]=ch[t5]+ch[t6]; c1[t6]=ch[t6-1]-ch[t5-1]; } } } }else{ for(j=1;j<ipph;j++){ t1+=t0; t2-=t0; t3=t1; t4=t2; for(k=0;k<l1;k++){ t5=t3; t6=t4; for(i=2;i<ido;i+=2){ t5+=2; t6+=2; c1[t5-1]=ch[t5-1]+ch[t6-1]; c1[t6-1]=ch[t5]-ch[t6]; c1[t5]=ch[t5]+ch[t6]; c1[t6]=ch[t6-1]-ch[t5-1]; } t3+=ido; t4+=ido; } } }L119: for(ik=0;ik<idl1;ik++)c2[ik]=ch2[ik]; t1=0; t2=ipp2*idl1; for(j=1;j<ipph;j++){ t1+=t0; t2-=t0; t3=t1-ido; t4=t2-ido; for(k=0;k<l1;k++){ t3+=ido; t4+=ido; c1[t3]=ch[t3]+ch[t4]; c1[t4]=ch[t4]-ch[t3]; } } ar1=1.f; ai1=0.f; t1=0; t2=ipp2*idl1; t3=(ip-1)*idl1; for(l=1;l<ipph;l++){ t1+=idl1; t2-=idl1; ar1h=dcp*ar1-dsp*ai1; ai1=dcp*ai1+dsp*ar1; ar1=ar1h; t4=t1; t5=t2; t6=t3; t7=idl1; for(ik=0;ik<idl1;ik++){ ch2[t4++]=c2[ik]+ar1*c2[t7++]; ch2[t5++]=ai1*c2[t6++]; } dc2=ar1; ds2=ai1; ar2=ar1; ai2=ai1; t4=idl1; t5=(ipp2-1)*idl1; for(j=2;j<ipph;j++){ t4+=idl1; t5-=idl1; ar2h=dc2*ar2-ds2*ai2; ai2=dc2*ai2+ds2*ar2; ar2=ar2h; t6=t1; t7=t2; t8=t4; t9=t5; for(ik=0;ik<idl1;ik++){ ch2[t6++]+=ar2*c2[t8++]; ch2[t7++]+=ai2*c2[t9++]; } } } t1=0; for(j=1;j<ipph;j++){ t1+=idl1; t2=t1; for(ik=0;ik<idl1;ik++)ch2[ik]+=c2[t2++]; } if(ido<l1)goto L132; t1=0; t2=0; for(k=0;k<l1;k++){ t3=t1; t4=t2; for(i=0;i<ido;i++)cc[t4++]=ch[t3++]; t1+=ido; t2+=t10; } goto L135; L132: for(i=0;i<ido;i++){ t1=i; t2=i; for(k=0;k<l1;k++){ cc[t2]=ch[t1]; t1+=ido; t2+=t10; } } L135: t1=0; t2=ido<<1; t3=0; t4=ipp2*t0; for(j=1;j<ipph;j++){ t1+=t2; t3+=t0; t4-=t0; t5=t1; t6=t3; t7=t4;Showing the first 500 of 1255 diff lines for this file. This diff is INCOMPLETE; read the file or clone the repository for the rest.
vendor/vorbis/lib/smallft.hadded
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 * * by the Xiph.Org Foundation https://xiph.org/ * * * ******************************************************************** function: fft transform ********************************************************************/#ifndef _V_SMFT_H_#define _V_SMFT_H_#include "vorbis/codec.h"typedef struct { int n; float *trigcache; int *splitcache;} drft_lookup;extern void drft_forward(drft_lookup *l,float *data);extern void drft_backward(drft_lookup *l,float *data);extern void drft_init(drft_lookup *l,int n);extern void drft_clear(drft_lookup *l);#endifvendor/vorbis/lib/synthesis.cadded
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2015 * * by the Xiph.Org Foundation https://xiph.org/ * * * ******************************************************************** function: single-block PCM synthesis ********************************************************************/#include <stdio.h>#include <ogg/ogg.h>#include "vorbis/codec.h"#include "codec_internal.h"#include "registry.h"#include "misc.h"#include "os.h"int vorbis_synthesis(vorbis_block *vb,ogg_packet *op){ vorbis_dsp_state *vd= vb ? vb->vd : 0; private_state *b= vd ? vd->backend_state : 0; vorbis_info *vi= vd ? vd->vi : 0; codec_setup_info *ci= vi ? vi->codec_setup : 0; oggpack_buffer *opb=vb ? &vb->opb : 0; int type,mode,i; if (!vd || !b || !vi || !ci || !opb) { return OV_EBADPACKET; } /* first things first. Make sure decode is ready */ _vorbis_block_ripcord(vb); oggpack_readinit(opb,op->packet,op->bytes); /* Check the packet type */ if(oggpack_read(opb,1)!=0){ /* Oops. This is not an audio data packet */ return(OV_ENOTAUDIO); } /* read our mode and pre/post windowsize */ mode=oggpack_read(opb,b->modebits); if(mode==-1){ return(OV_EBADPACKET); } vb->mode=mode; if(!ci->mode_param[mode]){ return(OV_EBADPACKET); } vb->W=ci->mode_param[mode]->blockflag; if(vb->W){ /* this doesn;t get mapped through mode selection as it's used only for window selection */ vb->lW=oggpack_read(opb,1); vb->nW=oggpack_read(opb,1); if(vb->nW==-1){ return(OV_EBADPACKET); } }else{ vb->lW=0; vb->nW=0; } /* more setup */ vb->granulepos=op->granulepos; vb->sequence=op->packetno; vb->eofflag=op->e_o_s; /* alloc pcm passback storage */ vb->pcmend=ci->blocksizes[vb->W]; vb->pcm=_vorbis_block_alloc(vb,sizeof(*vb->pcm)*vi->channels); for(i=0;i<vi->channels;i++) vb->pcm[i]=_vorbis_block_alloc(vb,vb->pcmend*sizeof(*vb->pcm[i])); /* unpack_header enforces range checking */ type=ci->map_type[ci->mode_param[mode]->mapping]; return(_mapping_P[type]->inverse(vb,ci->map_param[ci->mode_param[mode]-> mapping]));}/* used to track pcm position without actually performing decode. Useful for sequential 'fast forward' */int vorbis_synthesis_trackonly(vorbis_block *vb,ogg_packet *op){ vorbis_dsp_state *vd=vb->vd; private_state *b=vd->backend_state; vorbis_info *vi=vd->vi; codec_setup_info *ci=vi->codec_setup; oggpack_buffer *opb=&vb->opb; int mode; /* first things first. Make sure decode is ready */ _vorbis_block_ripcord(vb); oggpack_readinit(opb,op->packet,op->bytes); /* Check the packet type */ if(oggpack_read(opb,1)!=0){ /* Oops. This is not an audio data packet */ return(OV_ENOTAUDIO); } /* read our mode and pre/post windowsize */ mode=oggpack_read(opb,b->modebits); if(mode==-1)return(OV_EBADPACKET); vb->mode=mode; if(!ci->mode_param[mode]){ return(OV_EBADPACKET); } vb->W=ci->mode_param[mode]->blockflag; if(vb->W){ vb->lW=oggpack_read(opb,1); vb->nW=oggpack_read(opb,1); if(vb->nW==-1) return(OV_EBADPACKET); }else{ vb->lW=0; vb->nW=0; } /* more setup */ vb->granulepos=op->granulepos; vb->sequence=op->packetno; vb->eofflag=op->e_o_s; /* no pcm */ vb->pcmend=0; vb->pcm=NULL; return(0);}long vorbis_packet_blocksize(vorbis_info *vi,ogg_packet *op){ codec_setup_info *ci=vi->codec_setup; oggpack_buffer opb; int mode; if(ci==NULL || ci->modes<=0){ /* codec setup not properly intialized */ return(OV_EFAULT); } oggpack_readinit(&opb,op->packet,op->bytes); /* Check the packet type */ if(oggpack_read(&opb,1)!=0){ /* Oops. This is not an audio data packet */ return(OV_ENOTAUDIO); } /* read our mode and pre/post windowsize */ mode=oggpack_read(&opb,ov_ilog(ci->modes-1)); if(mode==-1 || !ci->mode_param[mode])return(OV_EBADPACKET); return(ci->blocksizes[ci->mode_param[mode]->blockflag]);}int vorbis_synthesis_halfrate(vorbis_info *vi,int flag){ /* set / clear half-sample-rate mode */ codec_setup_info *ci=vi->codec_setup; /* right now, our MDCT can't handle < 64 sample windows. */ if(ci->blocksizes[0]<=64 && flag)return -1; ci->halfrate_flag=(flag?1:0); return 0;}int vorbis_synthesis_halfrate_p(vorbis_info *vi){ codec_setup_info *ci=vi->codec_setup; return ci->halfrate_flag;}vendor/vorbis/lib/vorbisenc.cadded
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2015 * * by the Xiph.Org Foundation https://xiph.org/ * * * ******************************************************************** function: simple programmatic interface for encoder mode setup ********************************************************************/#include <stdlib.h>#include <string.h>#include <math.h>#include "vorbis/codec.h"#include "vorbis/vorbisenc.h"#include "codec_internal.h"#include "os.h"#include "misc.h"/* careful with this; it's using static array sizing to make managing all the modes a little less annoying. If we use a residue backend with > 12 partition types, or a different division of iteration, this needs to be updated. */typedef struct { const static_codebook *books[12][4];} static_bookblock;typedef struct { int res_type; int limit_type; /* 0 lowpass limited, 1 point stereo limited */ int grouping; const vorbis_info_residue0 *res; const static_codebook *book_aux; const static_codebook *book_aux_managed; const static_bookblock *books_base; const static_bookblock *books_base_managed;} vorbis_residue_template;typedef struct { const vorbis_info_mapping0 *map; const vorbis_residue_template *res;} vorbis_mapping_template;typedef struct vp_adjblock{ int block[P_BANDS];} vp_adjblock;typedef struct { int data[NOISE_COMPAND_LEVELS];} compandblock;/* high level configuration information for setting things up step-by-step with the detailed vorbis_encode_ctl interface. There's a fair amount of redundancy such that interactive setup does not directly deal with any vorbis_info or codec_setup_info initialization; it's all stored (until full init) in this highlevel setup, then flushed out to the real codec setup structs later. */typedef struct { int att[P_NOISECURVES]; float boost; float decay;} att3;typedef struct { int data[P_NOISECURVES]; } adj3;typedef struct { int pre[PACKETBLOBS]; int post[PACKETBLOBS]; float kHz[PACKETBLOBS]; float lowpasskHz[PACKETBLOBS];} adj_stereo;typedef struct { int lo; int hi; int fixed;} noiseguard;typedef struct { int data[P_NOISECURVES][17];} noise3;typedef struct { int mappings; const double *rate_mapping; const double *quality_mapping; int coupling_restriction; long samplerate_min_restriction; long samplerate_max_restriction; const int *blocksize_short; const int *blocksize_long; const att3 *psy_tone_masteratt; const int *psy_tone_0dB; const int *psy_tone_dBsuppress; const vp_adjblock *psy_tone_adj_impulse; const vp_adjblock *psy_tone_adj_long; const vp_adjblock *psy_tone_adj_other; const noiseguard *psy_noiseguards; const noise3 *psy_noise_bias_impulse; const noise3 *psy_noise_bias_padding; const noise3 *psy_noise_bias_trans; const noise3 *psy_noise_bias_long; const int *psy_noise_dBsuppress; const compandblock *psy_noise_compand; const double *psy_noise_compand_short_mapping; const double *psy_noise_compand_long_mapping; const int *psy_noise_normal_start[2]; const int *psy_noise_normal_partition[2]; const double *psy_noise_normal_thresh; const int *psy_ath_float; const int *psy_ath_abs; const double *psy_lowpass; const vorbis_info_psy_global *global_params; const double *global_mapping; const adj_stereo *stereo_modes; const static_codebook *const *const *const floor_books; const vorbis_info_floor1 *floor_params; const int floor_mappings; const int **floor_mapping_list; const vorbis_mapping_template *maps;} ve_setup_data_template;/* a few static coder conventions */static const vorbis_info_mode _mode_template[2]={ {0,0,0,0}, {1,0,0,1}};static const vorbis_info_mapping0 _map_nominal[2]={ {1, {0,0}, {0}, {0}, 1,{0},{1}}, {1, {0,0}, {1}, {1}, 1,{0},{1}}};#include "modes/setup_44.h"#include "modes/setup_44u.h"#include "modes/setup_44p51.h"#include "modes/setup_32.h"#include "modes/setup_8.h"#include "modes/setup_11.h"#include "modes/setup_16.h"#include "modes/setup_22.h"#include "modes/setup_X.h"static const ve_setup_data_template *const setup_list[]={ &ve_setup_44_stereo, &ve_setup_44_51, &ve_setup_44_uncoupled, &ve_setup_32_stereo, &ve_setup_32_uncoupled, &ve_setup_22_stereo, &ve_setup_22_uncoupled, &ve_setup_16_stereo, &ve_setup_16_uncoupled, &ve_setup_11_stereo, &ve_setup_11_uncoupled, &ve_setup_8_stereo, &ve_setup_8_uncoupled, &ve_setup_X_stereo, &ve_setup_X_uncoupled, &ve_setup_XX_stereo, &ve_setup_XX_uncoupled, 0};static void vorbis_encode_floor_setup(vorbis_info *vi,int s, const static_codebook *const *const *const books, const vorbis_info_floor1 *in, const int *x){ int i,k,is=s; vorbis_info_floor1 *f=_ogg_calloc(1,sizeof(*f)); codec_setup_info *ci=vi->codec_setup; memcpy(f,in+x[is],sizeof(*f)); /* books */ { int partitions=f->partitions; int maxclass=-1; int maxbook=-1; for(i=0;i<partitions;i++) if(f->partitionclass[i]>maxclass)maxclass=f->partitionclass[i]; for(i=0;i<=maxclass;i++){ if(f->class_book[i]>maxbook)maxbook=f->class_book[i]; f->class_book[i]+=ci->books; for(k=0;k<(1<<f->class_subs[i]);k++){ if(f->class_subbook[i][k]>maxbook)maxbook=f->class_subbook[i][k]; if(f->class_subbook[i][k]>=0)f->class_subbook[i][k]+=ci->books; } } for(i=0;i<=maxbook;i++) ci->book_param[ci->books++]=(static_codebook *)books[x[is]][i]; } /* for now, we're only using floor 1 */ ci->floor_type[ci->floors]=1; ci->floor_param[ci->floors]=f; ci->floors++; return;}static void vorbis_encode_global_psych_setup(vorbis_info *vi,double s, const vorbis_info_psy_global *in, const double *x){ int i,is=s; double ds=s-is; codec_setup_info *ci=vi->codec_setup; vorbis_info_psy_global *g=&ci->psy_g_param; memcpy(g,in+(int)x[is],sizeof(*g)); ds=x[is]*(1.-ds)+x[is+1]*ds; is=(int)ds; ds-=is; if(ds==0 && is>0){ is--; ds=1.; } /* interpolate the trigger threshholds */ for(i=0;i<4;i++){ g->preecho_thresh[i]=in[is].preecho_thresh[i]*(1.-ds)+in[is+1].preecho_thresh[i]*ds; g->postecho_thresh[i]=in[is].postecho_thresh[i]*(1.-ds)+in[is+1].postecho_thresh[i]*ds; } g->ampmax_att_per_sec=ci->hi.amplitude_track_dBpersec; return;}static void vorbis_encode_global_stereo(vorbis_info *vi, const highlevel_encode_setup *const hi, const adj_stereo *p){ float s=hi->stereo_point_setting; int i,is=s; double ds=s-is; codec_setup_info *ci=vi->codec_setup; vorbis_info_psy_global *g=&ci->psy_g_param; if(p){ memcpy(g->coupling_prepointamp,p[is].pre,sizeof(*p[is].pre)*PACKETBLOBS); memcpy(g->coupling_postpointamp,p[is].post,sizeof(*p[is].post)*PACKETBLOBS); if(hi->managed){ /* interpolate the kHz threshholds */ for(i=0;i<PACKETBLOBS;i++){ float kHz=p[is].kHz[i]*(1.-ds)+p[is+1].kHz[i]*ds; g->coupling_pointlimit[0][i]=kHz*1000./vi->rate*ci->blocksizes[0]; g->coupling_pointlimit[1][i]=kHz*1000./vi->rate*ci->blocksizes[1]; g->coupling_pkHz[i]=kHz; kHz=p[is].lowpasskHz[i]*(1.-ds)+p[is+1].lowpasskHz[i]*ds; g->sliding_lowpass[0][i]=kHz*1000./vi->rate*ci->blocksizes[0]; g->sliding_lowpass[1][i]=kHz*1000./vi->rate*ci->blocksizes[1]; } }else{ float kHz=p[is].kHz[PACKETBLOBS/2]*(1.-ds)+p[is+1].kHz[PACKETBLOBS/2]*ds; for(i=0;i<PACKETBLOBS;i++){ g->coupling_pointlimit[0][i]=kHz*1000./vi->rate*ci->blocksizes[0]; g->coupling_pointlimit[1][i]=kHz*1000./vi->rate*ci->blocksizes[1]; g->coupling_pkHz[i]=kHz; } kHz=p[is].lowpasskHz[PACKETBLOBS/2]*(1.-ds)+p[is+1].lowpasskHz[PACKETBLOBS/2]*ds; for(i=0;i<PACKETBLOBS;i++){ g->sliding_lowpass[0][i]=kHz*1000./vi->rate*ci->blocksizes[0]; g->sliding_lowpass[1][i]=kHz*1000./vi->rate*ci->blocksizes[1]; } } }else{ for(i=0;i<PACKETBLOBS;i++){ g->sliding_lowpass[0][i]=ci->blocksizes[0]; g->sliding_lowpass[1][i]=ci->blocksizes[1]; } } return;}static void vorbis_encode_psyset_setup(vorbis_info *vi,double s, const int *nn_start, const int *nn_partition, const double *nn_thresh, int block){ codec_setup_info *ci=vi->codec_setup; vorbis_info_psy *p=ci->psy_param[block]; highlevel_encode_setup *hi=&ci->hi; int is=s; if(block>=ci->psys) ci->psys=block+1; if(!p){ p=_ogg_calloc(1,sizeof(*p)); ci->psy_param[block]=p; } memcpy(p,&_psy_info_template,sizeof(*p)); p->blockflag=block>>1; if(hi->noise_normalize_p){ p->normal_p=1; p->normal_start=nn_start[is]; p->normal_partition=nn_partition[is]; p->normal_thresh=nn_thresh[is]; } return;}static void vorbis_encode_tonemask_setup(vorbis_info *vi,double s,int block, const att3 *att, const int *max, const vp_adjblock *in){ int i,is=s; double ds=s-is; codec_setup_info *ci=vi->codec_setup; vorbis_info_psy *p=ci->psy_param[block]; /* 0 and 2 are only used by bitmanagement, but there's no harm to always filling the values in here */ p->tone_masteratt[0]=att[is].att[0]*(1.-ds)+att[is+1].att[0]*ds; p->tone_masteratt[1]=att[is].att[1]*(1.-ds)+att[is+1].att[1]*ds; p->tone_masteratt[2]=att[is].att[2]*(1.-ds)+att[is+1].att[2]*ds; p->tone_centerboost=att[is].boost*(1.-ds)+att[is+1].boost*ds; p->tone_decay=att[is].decay*(1.-ds)+att[is+1].decay*ds; p->max_curve_dB=max[is]*(1.-ds)+max[is+1]*ds; for(i=0;i<P_BANDS;i++) p->toneatt[i]=in[is].block[i]*(1.-ds)+in[is+1].block[i]*ds; return;}static void vorbis_encode_compand_setup(vorbis_info *vi,double s,int block, const compandblock *in, const double *x){ int i,is=s; double ds=s-is; codec_setup_info *ci=vi->codec_setup; vorbis_info_psy *p=ci->psy_param[block]; ds=x[is]*(1.-ds)+x[is+1]*ds; is=(int)ds; ds-=is; if(ds==0 && is>0){ is--; ds=1.; } /* interpolate the compander settings */ for(i=0;i<NOISE_COMPAND_LEVELS;i++) p->noisecompand[i]=in[is].data[i]*(1.-ds)+in[is+1].data[i]*ds; return;}static void vorbis_encode_peak_setup(vorbis_info *vi,double s,int block, const int *suppress){ int is=s; double ds=s-is; codec_setup_info *ci=vi->codec_setup; vorbis_info_psy *p=ci->psy_param[block]; p->tone_abs_limit=suppress[is]*(1.-ds)+suppress[is+1]*ds; return;}static void vorbis_encode_noisebias_setup(vorbis_info *vi,double s,int block, const int *suppress, const noise3 *in, const noiseguard *guard, double userbias){ int i,is=s,j; double ds=s-is; codec_setup_info *ci=vi->codec_setup; vorbis_info_psy *p=ci->psy_param[block]; p->noisemaxsupp=suppress[is]*(1.-ds)+suppress[is+1]*ds; p->noisewindowlomin=guard[block].lo; p->noisewindowhimin=guard[block].hi; p->noisewindowfixed=guard[block].fixed; for(j=0;j<P_NOISECURVES;j++) for(i=0;i<P_BANDS;i++) p->noiseoff[j][i]=in[is].data[j][i]*(1.-ds)+in[is+1].data[j][i]*ds; /* impulse blocks may take a user specified bias to boost the nominal/high noise encoding depth */ for(j=0;j<P_NOISECURVES;j++){ float min=p->noiseoff[j][0]+6; /* the lowest it can go */ for(i=0;i<P_BANDS;i++){ p->noiseoff[j][i]+=userbias; if(p->noiseoff[j][i]<min)p->noiseoff[j][i]=min; } } return;}static void vorbis_encode_ath_setup(vorbis_info *vi,int block){ codec_setup_info *ci=vi->codec_setup; vorbis_info_psy *p=ci->psy_param[block]; p->ath_adjatt=ci->hi.ath_floating_dB; p->ath_maxatt=ci->hi.ath_absolute_dB; return;}static int book_dup_or_new(codec_setup_info *ci,const static_codebook *book){ int i; for(i=0;i<ci->books;i++) if(ci->book_param[i]==book)return(i); return(ci->books++);}static void vorbis_encode_blocksize_setup(vorbis_info *vi,double s, const int *shortb,const int *longb){ codec_setup_info *ci=vi->codec_setup; int is=s; int blockshort=shortb[is]; int blocklong=longb[is]; ci->blocksizes[0]=blockshort; ci->blocksizes[1]=blocklong;}static void vorbis_encode_residue_setup(vorbis_info *vi, int number, int block, const vorbis_residue_template *res){ codec_setup_info *ci=vi->codec_setup; int i; vorbis_info_residue0 *r=ci->residue_param[number]= _ogg_malloc(sizeof(*r)); memcpy(r,res->res,sizeof(*r)); if(ci->residues<=number)ci->residues=number+1; r->grouping=res->grouping; ci->residue_type[number]=res->res_type; /* fill in all the books */ { int booklist=0,k; if(ci->hi.managed){ for(i=0;i<r->partitions;i++) for(k=0;k<4;k++) if(res->books_base_managed->books[i][k]) r->secondstages[i]|=(1<<k); r->groupbook=book_dup_or_new(ci,res->book_aux_managed); ci->book_param[r->groupbook]=(static_codebook *)res->book_aux_managed; for(i=0;i<r->partitions;i++){ for(k=0;k<4;k++){ if(res->books_base_managed->books[i][k]){ int bookid=book_dup_or_new(ci,res->books_base_managed->books[i][k]); r->booklist[booklist++]=bookid; ci->book_param[bookid]=(static_codebook *)res->books_base_managed->books[i][k]; } } } }else{ for(i=0;i<r->partitions;i++) for(k=0;k<4;k++) if(res->books_base->books[i][k]) r->secondstages[i]|=(1<<k);Showing the first 500 of 1225 diff lines for this file. This diff is INCOMPLETE; read the file or clone the repository for the rest.
vendor/vorbis/lib/vorbisfile.cadded
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2015 * * by the Xiph.Org Foundation https://xiph.org/ * * * ******************************************************************** function: stdio-based convenience library for opening/seeking/decoding ********************************************************************/#include <stdlib.h>#include <stdio.h>#include <errno.h>#include <string.h>#include <math.h>#include "vorbis/codec.h"/* we don't need or want the static callback symbols here */#define OV_EXCLUDE_STATIC_CALLBACKS#include "vorbis/vorbisfile.h"#include "os.h"#include "misc.h"/* A 'chained bitstream' is a Vorbis bitstream that contains more than one logical bitstream arranged end to end (the only form of Ogg multiplexing allowed in a Vorbis bitstream; grouping [parallel multiplexing] is not allowed in Vorbis) *//* A Vorbis file can be played beginning to end (streamed) without worrying ahead of time about chaining (see decoder_example.c). If we have the whole file, however, and want random access (seeking/scrubbing) or desire to know the total length/time of a file, we need to account for the possibility of chaining. *//* We can handle things a number of ways; we can determine the entire bitstream structure right off the bat, or find pieces on demand. This example determines and caches structure for the entire bitstream, but builds a virtual decoder on the fly when moving between links in the chain. *//* There are also different ways to implement seeking. Enough information exists in an Ogg bitstream to seek to sample-granularity positions in the output. Or, one can seek by picking some portion of the stream roughly in the desired area if we only want coarse navigation through the stream. *//************************************************************************* * Many, many internal helpers. The intention is not to be confusing; * rampant duplication and monolithic function implementation would be * harder to understand anyway. The high level functions are last. Begin * grokking near the end of the file *//* read a little more data from the file/pipe into the ogg_sync framer*/#define CHUNKSIZE 65536 /* greater-than-page-size granularity seeking */#define READSIZE 2048 /* a smaller read size is needed for low-rate streaming. */static long _get_data(OggVorbis_File *vf){ errno=0; if(!(vf->callbacks.read_func))return(-1); if(vf->datasource){ char *buffer=ogg_sync_buffer(&vf->oy,READSIZE); long bytes=(vf->callbacks.read_func)(buffer,1,READSIZE,vf->datasource); if(bytes>0)ogg_sync_wrote(&vf->oy,bytes); if(bytes==0 && errno)return(-1); return(bytes); }else return(0);}/* save a tiny smidge of verbosity to make the code more readable */static int _seek_helper(OggVorbis_File *vf,ogg_int64_t offset){ if(vf->datasource){ /* only seek if the file position isn't already there */ if(vf->offset != offset){ if(!(vf->callbacks.seek_func)|| (vf->callbacks.seek_func)(vf->datasource, offset, SEEK_SET) == -1) return OV_EREAD; vf->offset=offset; ogg_sync_reset(&vf->oy); } }else{ /* shouldn't happen unless someone writes a broken callback */ return OV_EFAULT; } return 0;}/* The read/seek functions track absolute position within the stream *//* from the head of the stream, get the next page. boundary specifies if the function is allowed to fetch more data from the stream (and how much) or only use internally buffered data. boundary: -1) unbounded search 0) read no additional data; use cached only n) search for a new page beginning for n bytes return: <0) did not find a page (OV_FALSE, OV_EOF, OV_EREAD) n) found a page at absolute offset n */static ogg_int64_t _get_next_page(OggVorbis_File *vf,ogg_page *og, ogg_int64_t boundary){ if(boundary>0)boundary+=vf->offset; while(1){ long more; if(boundary>0 && vf->offset>=boundary)return(OV_FALSE); more=ogg_sync_pageseek(&vf->oy,og); if(more<0){ /* skipped n bytes */ vf->offset-=more; }else{ if(more==0){ /* send more paramedics */ if(!boundary)return(OV_FALSE); { long ret=_get_data(vf); if(ret==0)return(OV_EOF); if(ret<0)return(OV_EREAD); } }else{ /* got a page. Return the offset at the page beginning, advance the internal offset past the page end */ ogg_int64_t ret=vf->offset; vf->offset+=more; return(ret); } } }}/* find the latest page beginning before the passed in position. Much dirtier than the above as Ogg doesn't have any backward search linkage. no 'readp' as it will certainly have to read. *//* returns offset or OV_EREAD, OV_FAULT */static ogg_int64_t _get_prev_page(OggVorbis_File *vf,ogg_int64_t begin,ogg_page *og){ ogg_int64_t end = begin; ogg_int64_t ret; ogg_int64_t offset=-1; while(offset==-1){ begin-=CHUNKSIZE; if(begin<0) begin=0; ret=_seek_helper(vf,begin); if(ret)return(ret); while(vf->offset<end){ memset(og,0,sizeof(*og)); ret=_get_next_page(vf,og,end-vf->offset); if(ret==OV_EREAD)return(OV_EREAD); if(ret<0){ break; }else{ offset=ret; } } } /* In a fully compliant, non-multiplexed stream, we'll still be holding the last page. In multiplexed (or noncompliant streams), we will probably have to re-read the last page we saw */ if(og->header_len==0){ ret=_seek_helper(vf,offset); if(ret)return(ret); ret=_get_next_page(vf,og,CHUNKSIZE); if(ret<0) /* this shouldn't be possible */ return(OV_EFAULT); } return(offset);}static void _add_serialno(ogg_page *og,long **serialno_list, int *n){ long s = ogg_page_serialno(og); (*n)++; if(*serialno_list){ *serialno_list = _ogg_realloc(*serialno_list, sizeof(**serialno_list)*(*n)); }else{ *serialno_list = _ogg_malloc(sizeof(**serialno_list)); } (*serialno_list)[(*n)-1] = s;}/* returns nonzero if found */static int _lookup_serialno(long s, long *serialno_list, int n){ if(serialno_list){ while(n--){ if(*serialno_list == s) return 1; serialno_list++; } } return 0;}static int _lookup_page_serialno(ogg_page *og, long *serialno_list, int n){ long s = ogg_page_serialno(og); return _lookup_serialno(s,serialno_list,n);}/* performs the same search as _get_prev_page, but prefers pages of the specified serial number. If a page of the specified serialno is spotted during the seek-back-and-read-forward, it will return the info of last page of the matching serial number instead of the very last page. If no page of the specified serialno is seen, it will return the info of last page and alter *serialno. */static ogg_int64_t _get_prev_page_serial(OggVorbis_File *vf, ogg_int64_t begin, long *serial_list, int serial_n, int *serialno, ogg_int64_t *granpos){ ogg_page og; ogg_int64_t end=begin; ogg_int64_t ret; ogg_int64_t prefoffset=-1; ogg_int64_t offset=-1; ogg_int64_t ret_serialno=-1; ogg_int64_t ret_gran=-1; while(offset==-1){ begin-=CHUNKSIZE; if(begin<0) begin=0; ret=_seek_helper(vf,begin); if(ret)return(ret); while(vf->offset<end){ ret=_get_next_page(vf,&og,end-vf->offset); if(ret==OV_EREAD)return(OV_EREAD); if(ret<0){ break; }else{ ret_serialno=ogg_page_serialno(&og); ret_gran=ogg_page_granulepos(&og); offset=ret; if(ret_serialno == *serialno){ prefoffset=ret; *granpos=ret_gran; } if(!_lookup_serialno(ret_serialno,serial_list,serial_n)){ /* we fell off the end of the link, which means we seeked back too far and shouldn't have been looking in that link to begin with. If we found the preferred serial number, forget that we saw it. */ prefoffset=-1; } } } /*We started from the beginning of the stream and found nothing. This should be impossible unless the contents of the stream changed out from under us after we read from it.*/ if(!begin&&vf->offset<0)return OV_EBADLINK; } /* we're not interested in the page... just the serialno and granpos. */ if(prefoffset>=0)return(prefoffset); *serialno = ret_serialno; *granpos = ret_gran; return(offset);}/* uses the local ogg_stream storage in vf; this is important for non-streaming input sources */static int _fetch_headers(OggVorbis_File *vf,vorbis_info *vi,vorbis_comment *vc, long **serialno_list, int *serialno_n, ogg_page *og_ptr){ ogg_page og; ogg_packet op; int i,ret; int allbos=0; if(!og_ptr){ ogg_int64_t llret=_get_next_page(vf,&og,CHUNKSIZE); if(llret==OV_EREAD)return(OV_EREAD); if(llret<0)return(OV_ENOTVORBIS); og_ptr=&og; } vorbis_info_init(vi); vorbis_comment_init(vc); vf->ready_state=OPENED; /* extract the serialnos of all BOS pages + the first set of vorbis headers we see in the link */ while(ogg_page_bos(og_ptr)){ if(serialno_list){ if(_lookup_page_serialno(og_ptr,*serialno_list,*serialno_n)){ /* a dupe serialnumber in an initial header packet set == invalid stream */ if(*serialno_list)_ogg_free(*serialno_list); *serialno_list=0; *serialno_n=0; ret=OV_EBADHEADER; goto bail_header; } _add_serialno(og_ptr,serialno_list,serialno_n); } if(vf->ready_state<STREAMSET){ /* we don't have a vorbis stream in this link yet, so begin prospective stream setup. We need a stream to get packets */ ogg_stream_reset_serialno(&vf->os,ogg_page_serialno(og_ptr)); ogg_stream_pagein(&vf->os,og_ptr); if(ogg_stream_packetout(&vf->os,&op) > 0 && vorbis_synthesis_idheader(&op)){ /* vorbis header; continue setup */ vf->ready_state=STREAMSET; if((ret=vorbis_synthesis_headerin(vi,vc,&op))){ ret=OV_EBADHEADER; goto bail_header; } } } /* get next page */ { ogg_int64_t llret=_get_next_page(vf,og_ptr,CHUNKSIZE); if(llret==OV_EREAD){ ret=OV_EREAD; goto bail_header; } if(llret<0){ ret=OV_ENOTVORBIS; goto bail_header; } /* if this page also belongs to our vorbis stream, submit it and break */ if(vf->ready_state==STREAMSET && vf->os.serialno == ogg_page_serialno(og_ptr)){ ogg_stream_pagein(&vf->os,og_ptr); break; } } } if(vf->ready_state!=STREAMSET){ ret = OV_ENOTVORBIS; goto bail_header; } while(1){ i=0; while(i<2){ /* get a page loop */ while(i<2){ /* get a packet loop */ int result=ogg_stream_packetout(&vf->os,&op); if(result==0)break; if(result==-1){ ret=OV_EBADHEADER; goto bail_header; } if((ret=vorbis_synthesis_headerin(vi,vc,&op))) goto bail_header; i++; } while(i<2){ if(_get_next_page(vf,og_ptr,CHUNKSIZE)<0){ ret=OV_EBADHEADER; goto bail_header; } /* if this page belongs to the correct stream, go parse it */ if(vf->os.serialno == ogg_page_serialno(og_ptr)){ ogg_stream_pagein(&vf->os,og_ptr); break; } /* if we never see the final vorbis headers before the link ends, abort */ if(ogg_page_bos(og_ptr)){ if(allbos){ ret = OV_EBADHEADER; goto bail_header; }else allbos=1; } /* otherwise, keep looking */ } } return 0; } bail_header: vorbis_info_clear(vi); vorbis_comment_clear(vc); vf->ready_state=OPENED; return ret;}/* Starting from current cursor position, get initial PCM offset of next page. Consumes the page in the process without decoding audio, however this is only called during stream parsing upon seekable open. */static ogg_int64_t _initial_pcmoffset(OggVorbis_File *vf, vorbis_info *vi){ ogg_page og; ogg_int64_t accumulated=0; long lastblock=-1; int result; int serialno = vf->os.serialno; while(1){ ogg_packet op; if(_get_next_page(vf,&og,-1)<0) break; /* should not be possible unless the file is truncated/mangled */ if(ogg_page_bos(&og)) break; if(ogg_page_serialno(&og)!=serialno) continue; /* count blocksizes of all frames in the page */ ogg_stream_pagein(&vf->os,&og); while((result=ogg_stream_packetout(&vf->os,&op))){ if(result>0){ /* ignore holes */ long thisblock=vorbis_packet_blocksize(vi,&op); if(thisblock>=0){ if(lastblock!=-1) accumulated+=(lastblock+thisblock)>>2; lastblock=thisblock; } } } if(ogg_page_granulepos(&og)!=-1){ /* pcm offset of last packet on the first audio page */ accumulated= ogg_page_granulepos(&og)-accumulated; break; } } /* less than zero? Either a corrupt file or a stream with samples trimmed off the beginning, a normal occurrence; in both cases set the offset to zero */ if(accumulated<0)accumulated=0; return accumulated;}/* finds each bitstream link one at a time using a bisection search (has to begin by knowing the offset of the lb's initial page). Recurses for each link so it can alloc the link storage after finding them all, then unroll and fill the cache at the same time */static int _bisect_forward_serialno(OggVorbis_File *vf, ogg_int64_t begin, ogg_int64_t searched, ogg_int64_t end, ogg_int64_t endgran, int endserial, long *currentno_list, int currentnos, long m){ ogg_int64_t pcmoffset; ogg_int64_t dataoffset=searched; ogg_int64_t endsearched=end; ogg_int64_t next=end; ogg_int64_t searchgran=-1; ogg_page og; ogg_int64_t ret,last; int serialno = vf->os.serialno; /* invariants: we have the headers and serialnos for the link beginning at 'begin' we have the offset and granpos of the last page in the file (potentially not a page we care about) */ /* Is the last page in our list of current serialnumbers? */ if(_lookup_serialno(endserial,currentno_list,currentnos)){ /* last page is in the starting serialno list, so we've bisected down to (or just started with) a single link. Now we need toShowing the first 500 of 2428 diff lines for this file. This diff is INCOMPLETE; read the file or clone the repository for the rest.
vendor/vorbis/lib/window.cadded
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 * * by the Xiph.Org Foundation https://xiph.org/ * * * ******************************************************************** function: window functions ********************************************************************/#include <stdlib.h>#include <math.h>#include "os.h"#include "misc.h"#include "window.h"static const float vwin64[32] = { 0.0009460463F, 0.0085006468F, 0.0235352254F, 0.0458950567F, 0.0753351908F, 0.1115073077F, 0.1539457973F, 0.2020557475F, 0.2551056759F, 0.3122276645F, 0.3724270287F, 0.4346027792F, 0.4975789974F, 0.5601459521F, 0.6211085051F, 0.6793382689F, 0.7338252629F, 0.7837245849F, 0.8283939355F, 0.8674186656F, 0.9006222429F, 0.9280614787F, 0.9500073081F, 0.9669131782F, 0.9793740220F, 0.9880792941F, 0.9937636139F, 0.9971582668F, 0.9989462667F, 0.9997230082F, 0.9999638688F, 0.9999995525F,};static const float vwin128[64] = { 0.0002365472F, 0.0021280687F, 0.0059065254F, 0.0115626550F, 0.0190823442F, 0.0284463735F, 0.0396300935F, 0.0526030430F, 0.0673285281F, 0.0837631763F, 0.1018564887F, 0.1215504095F, 0.1427789367F, 0.1654677960F, 0.1895342001F, 0.2148867160F, 0.2414252576F, 0.2690412240F, 0.2976177952F, 0.3270303960F, 0.3571473350F, 0.3878306189F, 0.4189369387F, 0.4503188188F, 0.4818259135F, 0.5133064334F, 0.5446086751F, 0.5755826278F, 0.6060816248F, 0.6359640047F, 0.6650947483F, 0.6933470543F, 0.7206038179F, 0.7467589810F, 0.7717187213F, 0.7954024542F, 0.8177436264F, 0.8386902831F, 0.8582053981F, 0.8762669622F, 0.8928678298F, 0.9080153310F, 0.9217306608F, 0.9340480615F, 0.9450138200F, 0.9546851041F, 0.9631286621F, 0.9704194171F, 0.9766389810F, 0.9818741197F, 0.9862151938F, 0.9897546035F, 0.9925852598F, 0.9947991032F, 0.9964856900F, 0.9977308602F, 0.9986155015F, 0.9992144193F, 0.9995953200F, 0.9998179155F, 0.9999331503F, 0.9999825563F, 0.9999977357F, 0.9999999720F,};static const float vwin256[128] = { 0.0000591390F, 0.0005321979F, 0.0014780301F, 0.0028960636F, 0.0047854363F, 0.0071449926F, 0.0099732775F, 0.0132685298F, 0.0170286741F, 0.0212513119F, 0.0259337111F, 0.0310727950F, 0.0366651302F, 0.0427069140F, 0.0491939614F, 0.0561216907F, 0.0634851102F, 0.0712788035F, 0.0794969160F, 0.0881331402F, 0.0971807028F, 0.1066323515F, 0.1164803426F, 0.1267164297F, 0.1373318534F, 0.1483173323F, 0.1596630553F, 0.1713586755F, 0.1833933062F, 0.1957555184F, 0.2084333404F, 0.2214142599F, 0.2346852280F, 0.2482326664F, 0.2620424757F, 0.2761000481F, 0.2903902813F, 0.3048975959F, 0.3196059553F, 0.3344988887F, 0.3495595160F, 0.3647705766F, 0.3801144597F, 0.3955732382F, 0.4111287047F, 0.4267624093F, 0.4424557009F, 0.4581897696F, 0.4739456913F, 0.4897044744F, 0.5054471075F, 0.5211546088F, 0.5368080763F, 0.5523887395F, 0.5678780103F, 0.5832575361F, 0.5985092508F, 0.6136154277F, 0.6285587300F, 0.6433222619F, 0.6578896175F, 0.6722449294F, 0.6863729144F, 0.7002589187F, 0.7138889597F, 0.7272497662F, 0.7403288154F, 0.7531143679F, 0.7655954985F, 0.7777621249F, 0.7896050322F, 0.8011158947F, 0.8122872932F, 0.8231127294F, 0.8335866365F, 0.8437043850F, 0.8534622861F, 0.8628575905F, 0.8718884835F, 0.8805540765F, 0.8888543947F, 0.8967903616F, 0.9043637797F, 0.9115773078F, 0.9184344360F, 0.9249394562F, 0.9310974312F, 0.9369141608F, 0.9423961446F, 0.9475505439F, 0.9523851406F, 0.9569082947F, 0.9611289005F, 0.9650563408F, 0.9687004405F, 0.9720714191F, 0.9751798427F, 0.9780365753F, 0.9806527301F, 0.9830396204F, 0.9852087111F, 0.9871715701F, 0.9889398207F, 0.9905250941F, 0.9919389832F, 0.9931929973F, 0.9942985174F, 0.9952667537F, 0.9961087037F, 0.9968351119F, 0.9974564312F, 0.9979827858F, 0.9984239359F, 0.9987892441F, 0.9990876435F, 0.9993276081F, 0.9995171241F, 0.9996636648F, 0.9997741654F, 0.9998550016F, 0.9999119692F, 0.9999502656F, 0.9999744742F, 0.9999885497F, 0.9999958064F, 0.9999989077F, 0.9999998584F, 0.9999999983F,};static const float vwin512[256] = { 0.0000147849F, 0.0001330607F, 0.0003695946F, 0.0007243509F, 0.0011972759F, 0.0017882983F, 0.0024973285F, 0.0033242588F, 0.0042689632F, 0.0053312973F, 0.0065110982F, 0.0078081841F, 0.0092223540F, 0.0107533880F, 0.0124010466F, 0.0141650703F, 0.0160451800F, 0.0180410758F, 0.0201524373F, 0.0223789233F, 0.0247201710F, 0.0271757958F, 0.0297453914F, 0.0324285286F, 0.0352247556F, 0.0381335972F, 0.0411545545F, 0.0442871045F, 0.0475306997F, 0.0508847676F, 0.0543487103F, 0.0579219038F, 0.0616036982F, 0.0653934164F, 0.0692903546F, 0.0732937809F, 0.0774029356F, 0.0816170305F, 0.0859352485F, 0.0903567428F, 0.0948806375F, 0.0995060259F, 0.1042319712F, 0.1090575056F, 0.1139816300F, 0.1190033137F, 0.1241214941F, 0.1293350764F, 0.1346429333F, 0.1400439046F, 0.1455367974F, 0.1511203852F, 0.1567934083F, 0.1625545735F, 0.1684025537F, 0.1743359881F, 0.1803534820F, 0.1864536069F, 0.1926349000F, 0.1988958650F, 0.2052349715F, 0.2116506555F, 0.2181413191F, 0.2247053313F, 0.2313410275F, 0.2380467105F, 0.2448206500F, 0.2516610835F, 0.2585662164F, 0.2655342226F, 0.2725632448F, 0.2796513950F, 0.2867967551F, 0.2939973773F, 0.3012512852F, 0.3085564739F, 0.3159109111F, 0.3233125375F, 0.3307592680F, 0.3382489922F, 0.3457795756F, 0.3533488602F, 0.3609546657F, 0.3685947904F, 0.3762670121F, 0.3839690896F, 0.3916987634F, 0.3994537572F, 0.4072317788F, 0.4150305215F, 0.4228476653F, 0.4306808783F, 0.4385278181F, 0.4463861329F, 0.4542534630F, 0.4621274424F, 0.4700057001F, 0.4778858615F, 0.4857655502F, 0.4936423891F, 0.5015140023F, 0.5093780165F, 0.5172320626F, 0.5250737772F, 0.5329008043F, 0.5407107971F, 0.5485014192F, 0.5562703465F, 0.5640152688F, 0.5717338914F, 0.5794239366F, 0.5870831457F, 0.5947092801F, 0.6023001235F, 0.6098534829F, 0.6173671907F, 0.6248391059F, 0.6322671161F, 0.6396491384F, 0.6469831217F, 0.6542670475F, 0.6614989319F, 0.6686768267F, 0.6757988210F, 0.6828630426F, 0.6898676592F, 0.6968108799F, 0.7036909564F, 0.7105061843F, 0.7172549043F, 0.7239355032F, 0.7305464154F, 0.7370861235F, 0.7435531598F, 0.7499461068F, 0.7562635986F, 0.7625043214F, 0.7686670148F, 0.7747504721F, 0.7807535410F, 0.7866751247F, 0.7925141825F, 0.7982697296F, 0.8039408387F, 0.8095266395F, 0.8150263196F, 0.8204391248F, 0.8257643590F, 0.8310013848F, 0.8361496236F, 0.8412085555F, 0.8461777194F, 0.8510567129F, 0.8558451924F, 0.8605428730F, 0.8651495278F, 0.8696649882F, 0.8740891432F, 0.8784219392F, 0.8826633797F, 0.8868135244F, 0.8908724888F, 0.8948404441F, 0.8987176157F, 0.9025042831F, 0.9062007791F, 0.9098074886F, 0.9133248482F, 0.9167533451F, 0.9200935163F, 0.9233459472F, 0.9265112712F, 0.9295901680F, 0.9325833632F, 0.9354916263F, 0.9383157705F, 0.9410566504F, 0.9437151618F, 0.9462922398F, 0.9487888576F, 0.9512060252F, 0.9535447882F, 0.9558062262F, 0.9579914516F, 0.9601016078F, 0.9621378683F, 0.9641014348F, 0.9659935361F, 0.9678154261F, 0.9695683830F, 0.9712537071F, 0.9728727198F, 0.9744267618F, 0.9759171916F, 0.9773453842F, 0.9787127293F, 0.9800206298F, 0.9812705006F, 0.9824637665F, 0.9836018613F, 0.9846862258F, 0.9857183066F, 0.9866995544F, 0.9876314227F, 0.9885153662F, 0.9893528393F, 0.9901452948F, 0.9908941823F, 0.9916009470F, 0.9922670279F, 0.9928938570F, 0.9934828574F, 0.9940354423F, 0.9945530133F, 0.9950369595F, 0.9954886562F, 0.9959094633F, 0.9963007242F, 0.9966637649F, 0.9969998925F, 0.9973103939F, 0.9975965351F, 0.9978595598F, 0.9981006885F, 0.9983211172F, 0.9985220166F, 0.9987045311F, 0.9988697776F, 0.9990188449F, 0.9991527924F, 0.9992726499F, 0.9993794157F, 0.9994740570F, 0.9995575079F, 0.9996306699F, 0.9996944099F, 0.9997495605F, 0.9997969190F, 0.9998372465F, 0.9998712678F, 0.9998996704F, 0.9999231041F, 0.9999421807F, 0.9999574732F, 0.9999695157F, 0.9999788026F, 0.9999857885F, 0.9999908879F, 0.9999944746F, 0.9999968817F, 0.9999984010F, 0.9999992833F, 0.9999997377F, 0.9999999317F, 0.9999999911F, 0.9999999999F,};static const float vwin1024[512] = { 0.0000036962F, 0.0000332659F, 0.0000924041F, 0.0001811086F, 0.0002993761F, 0.0004472021F, 0.0006245811F, 0.0008315063F, 0.0010679699F, 0.0013339631F, 0.0016294757F, 0.0019544965F, 0.0023090133F, 0.0026930125F, 0.0031064797F, 0.0035493989F, 0.0040217533F, 0.0045235250F, 0.0050546946F, 0.0056152418F, 0.0062051451F, 0.0068243817F, 0.0074729278F, 0.0081507582F, 0.0088578466F, 0.0095941655F, 0.0103596863F, 0.0111543789F, 0.0119782122F, 0.0128311538F, 0.0137131701F, 0.0146242260F, 0.0155642855F, 0.0165333111F, 0.0175312640F, 0.0185581042F, 0.0196137903F, 0.0206982797F, 0.0218115284F, 0.0229534910F, 0.0241241208F, 0.0253233698F, 0.0265511886F, 0.0278075263F, 0.0290923308F, 0.0304055484F, 0.0317471241F, 0.0331170013F, 0.0345151222F, 0.0359414274F, 0.0373958560F, 0.0388783456F, 0.0403888325F, 0.0419272511F, 0.0434935347F, 0.0450876148F, 0.0467094213F, 0.0483588828F, 0.0500359261F, 0.0517404765F, 0.0534724575F, 0.0552317913F, 0.0570183983F, 0.0588321971F, 0.0606731048F, 0.0625410369F, 0.0644359070F, 0.0663576272F, 0.0683061077F, 0.0702812571F, 0.0722829821F, 0.0743111878F, 0.0763657775F, 0.0784466526F, 0.0805537129F, 0.0826868561F, 0.0848459782F, 0.0870309736F, 0.0892417345F, 0.0914781514F, 0.0937401128F, 0.0960275056F, 0.0983402145F, 0.1006781223F, 0.1030411101F, 0.1054290568F, 0.1078418397F, 0.1102793336F, 0.1127414119F, 0.1152279457F, 0.1177388042F, 0.1202738544F, 0.1228329618F, 0.1254159892F, 0.1280227980F, 0.1306532471F, 0.1333071937F, 0.1359844927F, 0.1386849970F, 0.1414085575F, 0.1441550230F, 0.1469242403F, 0.1497160539F, 0.1525303063F, 0.1553668381F, 0.1582254875F, 0.1611060909F, 0.1640084822F, 0.1669324936F, 0.1698779549F, 0.1728446939F, 0.1758325362F, 0.1788413055F, 0.1818708232F, 0.1849209084F, 0.1879913785F, 0.1910820485F, 0.1941927312F, 0.1973232376F, 0.2004733764F, 0.2036429541F, 0.2068317752F, 0.2100396421F, 0.2132663552F, 0.2165117125F, 0.2197755102F, 0.2230575422F, 0.2263576007F, 0.2296754753F, 0.2330109540F, 0.2363638225F, 0.2397338646F, 0.2431208619F, 0.2465245941F, 0.2499448389F, 0.2533813719F, 0.2568339669F, 0.2603023956F, 0.2637864277F, 0.2672858312F, 0.2708003718F, 0.2743298135F, 0.2778739186F, 0.2814324472F, 0.2850051576F, 0.2885918065F, 0.2921921485F, 0.2958059366F, 0.2994329219F, 0.3030728538F, 0.3067254799F, 0.3103905462F, 0.3140677969F, 0.3177569747F, 0.3214578205F, 0.3251700736F, 0.3288934718F, 0.3326277513F, 0.3363726468F, 0.3401278914F, 0.3438932168F, 0.3476683533F, 0.3514530297F, 0.3552469734F, 0.3590499106F, 0.3628615659F, 0.3666816630F, 0.3705099239F, 0.3743460698F, 0.3781898204F, 0.3820408945F, 0.3858990095F, 0.3897638820F, 0.3936352274F, 0.3975127601F, 0.4013961936F, 0.4052852405F, 0.4091796123F, 0.4130790198F, 0.4169831732F, 0.4208917815F, 0.4248045534F, 0.4287211965F, 0.4326414181F, 0.4365649248F, 0.4404914225F, 0.4444206167F, 0.4483522125F, 0.4522859146F, 0.4562214270F, 0.4601584538F, 0.4640966984F, 0.4680358644F, 0.4719756548F, 0.4759157726F, 0.4798559209F, 0.4837958024F, 0.4877351199F, 0.4916735765F, 0.4956108751F, 0.4995467188F, 0.5034808109F, 0.5074128550F, 0.5113425550F, 0.5152696149F, 0.5191937395F, 0.5231146336F, 0.5270320028F, 0.5309455530F, 0.5348549910F, 0.5387600239F, 0.5426603597F, 0.5465557070F, 0.5504457754F, 0.5543302752F, 0.5582089175F, 0.5620814145F, 0.5659474793F, 0.5698068262F, 0.5736591704F, 0.5775042283F, 0.5813417176F, 0.5851713571F, 0.5889928670F, 0.5928059689F, 0.5966103856F, 0.6004058415F, 0.6041920626F, 0.6079687761F, 0.6117357113F, 0.6154925986F, 0.6192391705F, 0.6229751612F, 0.6267003064F, 0.6304143441F, 0.6341170137F, 0.6378080569F, 0.6414872173F, 0.6451542405F, 0.6488088741F, 0.6524508681F, 0.6560799742F, 0.6596959469F, 0.6632985424F, 0.6668875197F, 0.6704626398F, 0.6740236662F, 0.6775703649F, 0.6811025043F, 0.6846198554F, 0.6881221916F, 0.6916092892F, 0.6950809269F, 0.6985368861F, 0.7019769510F, 0.7054009085F, 0.7088085484F, 0.7121996632F, 0.7155740484F, 0.7189315023F, 0.7222718263F, 0.7255948245F, 0.7289003043F, 0.7321880760F, 0.7354579530F, 0.7387097518F, 0.7419432921F, 0.7451583966F, 0.7483548915F, 0.7515326059F, 0.7546913723F, 0.7578310265F, 0.7609514077F, 0.7640523581F, 0.7671337237F, 0.7701953535F, 0.7732371001F, 0.7762588195F, 0.7792603711F, 0.7822416178F, 0.7852024259F, 0.7881426654F, 0.7910622097F, 0.7939609356F, 0.7968387237F, 0.7996954579F, 0.8025310261F, 0.8053453193F, 0.8081382324F, 0.8109096638F, 0.8136595156F, 0.8163876936F, 0.8190941071F, 0.8217786690F, 0.8244412960F, 0.8270819086F, 0.8297004305F, 0.8322967896F, 0.8348709171F, 0.8374227481F, 0.8399522213F, 0.8424592789F, 0.8449438672F, 0.8474059356F, 0.8498454378F, 0.8522623306F, 0.8546565748F, 0.8570281348F, 0.8593769787F, 0.8617030779F, 0.8640064080F, 0.8662869477F, 0.8685446796F, 0.8707795899F, 0.8729916682F, 0.8751809079F, 0.8773473059F, 0.8794908626F, 0.8816115819F, 0.8837094713F, 0.8857845418F, 0.8878368079F, 0.8898662874F, 0.8918730019F, 0.8938569760F, 0.8958182380F, 0.8977568194F, 0.8996727552F, 0.9015660837F, 0.9034368465F, 0.9052850885F, 0.9071108577F, 0.9089142057F, 0.9106951869F, 0.9124538591F, 0.9141902832F, 0.9159045233F, 0.9175966464F, 0.9192667228F, 0.9209148257F, 0.9225410313F, 0.9241454187F, 0.9257280701F, 0.9272890704F, 0.9288285075F, 0.9303464720F, 0.9318430576F, 0.9333183603F, 0.9347724792F, 0.9362055158F, 0.9376175745F, 0.9390087622F, 0.9403791881F, 0.9417289644F, 0.9430582055F, 0.9443670283F, 0.9456555521F, 0.9469238986F, 0.9481721917F, 0.9494005577F, 0.9506091252F, 0.9517980248F, 0.9529673894F, 0.9541173540F, 0.9552480557F, 0.9563596334F, 0.9574522282F, 0.9585259830F, 0.9595810428F, 0.9606175542F, 0.9616356656F, 0.9626355274F, 0.9636172915F, 0.9645811114F, 0.9655271425F, 0.9664555414F, 0.9673664664F, 0.9682600774F, 0.9691365355F, 0.9699960034F, 0.9708386448F, 0.9716646250F, 0.9724741103F, 0.9732672685F, 0.9740442683F, 0.9748052795F, 0.9755504729F, 0.9762800205F, 0.9769940950F, 0.9776928703F, 0.9783765210F, 0.9790452223F, 0.9796991504F, 0.9803384823F, 0.9809633954F, 0.9815740679F, 0.9821706784F, 0.9827534063F, 0.9833224312F, 0.9838779332F, 0.9844200928F, 0.9849490910F, 0.9854651087F, 0.9859683274F, 0.9864589286F, 0.9869370940F, 0.9874030054F, 0.9878568447F, 0.9882987937F, 0.9887290343F, 0.9891477481F, 0.9895551169F, 0.9899513220F, 0.9903365446F, 0.9907109658F, 0.9910747662F, 0.9914281260F, 0.9917712252F, 0.9921042433F, 0.9924273593F, 0.9927407516F, 0.9930445982F, 0.9933390763F, 0.9936243626F, 0.9939006331F, 0.9941680631F, 0.9944268269F, 0.9946770982F, 0.9949190498F, 0.9951528537F, 0.9953786808F, 0.9955967011F, 0.9958070836F, 0.9960099963F, 0.9962056061F, 0.9963940787F, 0.9965755786F, 0.9967502693F, 0.9969183129F, 0.9970798704F, 0.9972351013F, 0.9973841640F, 0.9975272151F, 0.9976644103F, 0.9977959036F, 0.9979218476F, 0.9980423932F, 0.9981576901F, 0.9982678862F, 0.9983731278F, 0.9984735596F, 0.9985693247F, 0.9986605645F, 0.9987474186F, 0.9988300248F, 0.9989085193F, 0.9989830364F, 0.9990537085F, 0.9991206662F, 0.9991840382F, 0.9992439513F, 0.9993005303F, 0.9993538982F, 0.9994041757F, 0.9994514817F, 0.9994959330F, 0.9995376444F, 0.9995767286F, 0.9996132960F, 0.9996474550F, 0.9996793121F, 0.9997089710F, 0.9997365339F, 0.9997621003F, 0.9997857677F, 0.9998076311F, 0.9998277836F, 0.9998463156F, 0.9998633155F, 0.9998788692F, 0.9998930603F, 0.9999059701F, 0.9999176774F, 0.9999282586F, 0.9999377880F, 0.9999463370F, 0.9999539749F, 0.9999607685F, 0.9999667820F, 0.9999720773F, 0.9999767136F, 0.9999807479F, 0.9999842344F, 0.9999872249F, 0.9999897688F, 0.9999919127F, 0.9999937009F, 0.9999951749F, 0.9999963738F, 0.9999973342F, 0.9999980900F, 0.9999986724F, 0.9999991103F, 0.9999994297F, 0.9999996543F, 0.9999998049F, 0.9999999000F, 0.9999999552F, 0.9999999836F, 0.9999999957F, 0.9999999994F, 1.0000000000F,};static const float vwin2048[1024] = { 0.0000009241F, 0.0000083165F, 0.0000231014F, 0.0000452785F, 0.0000748476F, 0.0001118085F, 0.0001561608F, 0.0002079041F, 0.0002670379F, 0.0003335617F, 0.0004074748F, 0.0004887765F, 0.0005774661F, 0.0006735427F, 0.0007770054F, 0.0008878533F, 0.0010060853F, 0.0011317002F, 0.0012646969F, 0.0014050742F, 0.0015528307F, 0.0017079650F, 0.0018704756F, 0.0020403610F, 0.0022176196F, 0.0024022497F, 0.0025942495F, 0.0027936173F, 0.0030003511F, 0.0032144490F, 0.0034359088F, 0.0036647286F, 0.0039009061F, 0.0041444391F, 0.0043953253F, 0.0046535621F, 0.0049191472F, 0.0051920781F, 0.0054723520F, 0.0057599664F, 0.0060549184F, 0.0063572052F, 0.0066668239F, 0.0069837715F, 0.0073080449F, 0.0076396410F, 0.0079785566F, 0.0083247884F, 0.0086783330F, 0.0090391871F, 0.0094073470F, 0.0097828092F, 0.0101655700F, 0.0105556258F, 0.0109529726F, 0.0113576065F, 0.0117695237F, 0.0121887200F, 0.0126151913F, 0.0130489335F, 0.0134899422F, 0.0139382130F, 0.0143937415F, 0.0148565233F, 0.0153265536F, 0.0158038279F, 0.0162883413F, 0.0167800889F, 0.0172790660F, 0.0177852675F, 0.0182986882F, 0.0188193231F, 0.0193471668F, 0.0198822141F, 0.0204244594F, 0.0209738974F, 0.0215305225F, 0.0220943289F, 0.0226653109F, 0.0232434627F, 0.0238287784F, 0.0244212519F, 0.0250208772F, 0.0256276481F, 0.0262415582F, 0.0268626014F, 0.0274907711F, 0.0281260608F, 0.0287684638F, 0.0294179736F, 0.0300745833F, 0.0307382859F, 0.0314090747F, 0.0320869424F, 0.0327718819F, 0.0334638860F, 0.0341629474F, 0.0348690586F, 0.0355822122F, 0.0363024004F, 0.0370296157F, 0.0377638502F, 0.0385050960F, 0.0392533451F, 0.0400085896F, 0.0407708211F, 0.0415400315F, 0.0423162123F, 0.0430993552F, 0.0438894515F, 0.0446864926F, 0.0454904698F, 0.0463013742F, 0.0471191969F, 0.0479439288F, 0.0487755607F, 0.0496140836F, 0.0504594879F, 0.0513117642F, 0.0521709031F, 0.0530368949F, 0.0539097297F, 0.0547893979F, 0.0556758894F, 0.0565691941F, 0.0574693019F, 0.0583762026F, 0.0592898858F, 0.0602103410F, 0.0611375576F, 0.0620715250F, 0.0630122324F, 0.0639596688F, 0.0649138234F, 0.0658746848F, 0.0668422421F, 0.0678164838F, 0.0687973985F, 0.0697849746F, 0.0707792005F, 0.0717800645F, 0.0727875547F, 0.0738016591F, 0.0748223656F, 0.0758496620F, 0.0768835359F, 0.0779239751F, 0.0789709668F, 0.0800244985F, 0.0810845574F, 0.0821511306F, 0.0832242052F, 0.0843037679F, 0.0853898056F, 0.0864823050F, 0.0875812525F, 0.0886866347F, 0.0897984378F, 0.0909166480F, 0.0920412513F, 0.0931722338F, 0.0943095813F, 0.0954532795F, 0.0966033140F, 0.0977596702F, 0.0989223336F, 0.1000912894F, 0.1012665227F, 0.1024480185F, 0.1036357616F, 0.1048297369F, 0.1060299290F, 0.1072363224F, 0.1084489014F, 0.1096676504F, 0.1108925534F, 0.1121235946F, 0.1133607577F, 0.1146040267F, 0.1158533850F, 0.1171088163F, 0.1183703040F, 0.1196378312F, 0.1209113812F, 0.1221909370F, 0.1234764815F, 0.1247679974F, 0.1260654674F, 0.1273688740F, 0.1286781995F, 0.1299934263F, 0.1313145365F, 0.1326415121F, 0.1339743349F, 0.1353129866F, 0.1366574490F, 0.1380077035F, 0.1393637315F, 0.1407255141F, 0.1420930325F, 0.1434662677F, 0.1448452004F, 0.1462298115F, 0.1476200814F, 0.1490159906F, 0.1504175195F, 0.1518246482F, 0.1532373569F, 0.1546556253F, 0.1560794333F, 0.1575087606F, 0.1589435866F, 0.1603838909F, 0.1618296526F, 0.1632808509F, 0.1647374648F, 0.1661994731F, 0.1676668546F, 0.1691395880F, 0.1706176516F, 0.1721010238F, 0.1735896829F, 0.1750836068F, 0.1765827736F, 0.1780871610F, 0.1795967468F, 0.1811115084F, 0.1826314234F, 0.1841564689F, 0.1856866221F, 0.1872218600F, 0.1887621595F, 0.1903074974F, 0.1918578503F, 0.1934131947F, 0.1949735068F, 0.1965387630F, 0.1981089393F, 0.1996840117F, 0.2012639560F, 0.2028487479F, 0.2044383630F, 0.2060327766F, 0.2076319642F, 0.2092359007F, 0.2108445614F, 0.2124579211F, 0.2140759545F, 0.2156986364F, 0.2173259411F, 0.2189578432F, 0.2205943168F, 0.2222353361F, 0.2238808751F, 0.2255309076F, 0.2271854073F, 0.2288443480F, 0.2305077030F, 0.2321754457F, 0.2338475493F, 0.2355239869F, 0.2372047315F, 0.2388897560F, 0.2405790329F, 0.2422725350F, 0.2439702347F, 0.2456721043F, 0.2473781159F, 0.2490882418F, 0.2508024539F, 0.2525207240F, 0.2542430237F, 0.2559693248F, 0.2576995986F, 0.2594338166F, 0.2611719498F, 0.2629139695F, 0.2646598466F, 0.2664095520F, 0.2681630564F, 0.2699203304F, 0.2716813445F, 0.2734460691F, 0.2752144744F, 0.2769865307F, 0.2787622079F, 0.2805414760F, 0.2823243047F, 0.2841106637F, 0.2859005227F, 0.2876938509F, 0.2894906179F, 0.2912907928F, 0.2930943447F, 0.2949012426F, 0.2967114554F, 0.2985249520F, 0.3003417009F, 0.3021616708F, 0.3039848301F, 0.3058111471F, 0.3076405901F, 0.3094731273F, 0.3113087266F, 0.3131473560F, 0.3149889833F, 0.3168335762F, 0.3186811024F, 0.3205315294F, 0.3223848245F, 0.3242409552F, 0.3260998886F, 0.3279615918F, 0.3298260319F, 0.3316931758F, 0.3335629903F, 0.3354354423F, 0.3373104982F, 0.3391881247F, 0.3410682882F, 0.3429509551F, 0.3448360917F, 0.3467236642F, 0.3486136387F, 0.3505059811F, 0.3524006575F, 0.3542976336F, 0.3561968753F, 0.3580983482F, 0.3600020179F, 0.3619078499F, 0.3638158096F, 0.3657258625F, 0.3676379737F, 0.3695521086F, 0.3714682321F, 0.3733863094F, 0.3753063055F, 0.3772281852F, 0.3791519134F, 0.3810774548F, 0.3830047742F, 0.3849338362F, 0.3868646053F, 0.3887970459F, 0.3907311227F, 0.3926667998F, 0.3946040417F, 0.3965428125F, 0.3984830765F, 0.4004247978F, 0.4023679403F, 0.4043124683F, 0.4062583455F, 0.4082055359F, 0.4101540034F, 0.4121037117F, 0.4140546246F, 0.4160067058F, 0.4179599190F, 0.4199142277F, 0.4218695956F, 0.4238259861F, 0.4257833627F, 0.4277416888F, 0.4297009279F, 0.4316610433F, 0.4336219983F, 0.4355837562F, 0.4375462803F, 0.4395095337F, 0.4414734797F, 0.4434380815F, 0.4454033021F, 0.4473691046F, 0.4493354521F, 0.4513023078F, 0.4532696345F, 0.4552373954F, 0.4572055533F, 0.4591740713F, 0.4611429123F, 0.4631120393F, 0.4650814151F, 0.4670510028F, 0.4690207650F, 0.4709906649F, 0.4729606651F, 0.4749307287F, 0.4769008185F, 0.4788708972F, 0.4808409279F, 0.4828108732F, 0.4847806962F, 0.4867503597F, 0.4887198264F, 0.4906890593F, 0.4926580213F, 0.4946266753F, 0.4965949840F, 0.4985629105F, 0.5005304176F, 0.5024974683F, 0.5044640255F, 0.5064300522F, 0.5083955114F, 0.5103603659F, 0.5123245790F, 0.5142881136F, 0.5162509328F, 0.5182129997F, 0.5201742774F, 0.5221347290F, 0.5240943178F, 0.5260530070F, 0.5280107598F, 0.5299675395F, 0.5319233095F, 0.5338780330F, 0.5358316736F, 0.5377841946F, 0.5397355596F, 0.5416857320F, 0.5436346755F, 0.5455823538F, 0.5475287304F, 0.5494737691F, 0.5514174337F, 0.5533596881F, 0.5553004962F, 0.5572398218F, 0.5591776291F, 0.5611138821F, 0.5630485449F, 0.5649815818F, 0.5669129570F, 0.5688426349F, 0.5707705799F, 0.5726967564F, 0.5746211290F, 0.5765436624F, 0.5784643212F, 0.5803830702F, 0.5822998743F, 0.5842146984F, 0.5861275076F, 0.5880382669F, 0.5899469416F, 0.5918534968F, 0.5937578981F, 0.5956601107F, 0.5975601004F, 0.5994578326F, 0.6013532732F, 0.6032463880F, 0.6051371429F, 0.6070255039F, 0.6089114372F, 0.6107949090F, 0.6126758856F, 0.6145543334F, 0.6164302191F, 0.6183035092F, 0.6201741706F, 0.6220421700F, 0.6239074745F, 0.6257700513F, 0.6276298674F, 0.6294868903F, 0.6313410873F, 0.6331924262F, 0.6350408745F, 0.6368864001F, 0.6387289710F, 0.6405685552F, 0.6424051209F, 0.6442386364F, 0.6460690702F, 0.6478963910F, 0.6497205673F, 0.6515415682F, 0.6533593625F, 0.6551739194F, 0.6569852082F, 0.6587931984F, 0.6605978593F, 0.6623991609F, 0.6641970728F, 0.6659915652F, 0.6677826081F, 0.6695701718F, 0.6713542268F, 0.6731347437F, 0.6749116932F, 0.6766850461F, 0.6784547736F, 0.6802208469F, 0.6819832374F, 0.6837419164F, 0.6854968559F, 0.6872480275F, 0.6889954034F, 0.6907389556F, 0.6924786566F, 0.6942144788F, 0.6959463950F, 0.6976743780F, 0.6993984008F, 0.7011184365F, 0.7028344587F, 0.7045464407F, 0.7062543564F, 0.7079581796F, 0.7096578844F, 0.7113534450F, 0.7130448359F, 0.7147320316F, 0.7164150070F, 0.7180937371F, 0.7197681970F, 0.7214383620F, 0.7231042077F, 0.7247657098F, 0.7264228443F, 0.7280755871F, 0.7297239147F, 0.7313678035F, 0.7330072301F, 0.7346421715F, 0.7362726046F, 0.7378985069F, 0.7395198556F, 0.7411366285F, 0.7427488034F, 0.7443563584F, 0.7459592717F, 0.7475575218F, 0.7491510873F, 0.7507399471F, 0.7523240803F, 0.7539034661F, 0.7554780839F, 0.7570479136F, 0.7586129349F, 0.7601731279F, 0.7617284730F, 0.7632789506F, 0.7648245416F, 0.7663652267F, 0.7679009872F, 0.7694318044F, 0.7709576599F, 0.7724785354F, 0.7739944130F, 0.7755052749F, 0.7770111035F, 0.7785118815F, 0.7800075916F, 0.7814982170F, 0.7829837410F, 0.7844641472F, 0.7859394191F, 0.7874095408F, 0.7888744965F, 0.7903342706F, 0.7917888476F, 0.7932382124F, 0.7946823501F, 0.7961212460F, 0.7975548855F, 0.7989832544F, 0.8004063386F, 0.8018241244F, 0.8032365981F, 0.8046437463F, 0.8060455560F, 0.8074420141F, 0.8088331080F, 0.8102188253F, 0.8115991536F, 0.8129740810F, 0.8143435957F, 0.8157076861F, 0.8170663409F, 0.8184195489F, 0.8197672994F, 0.8211095817F, 0.8224463853F, 0.8237777001F, 0.8251035161F, 0.8264238235F, 0.8277386129F, 0.8290478750F, 0.8303516008F, 0.8316497814F, 0.8329424083F, 0.8342294731F, 0.8355109677F, 0.8367868841F, 0.8380572148F, 0.8393219523F, 0.8405810893F, 0.8418346190F, 0.8430825345F, 0.8443248294F, 0.8455614974F, 0.8467925323F, 0.8480179285F, 0.8492376802F, 0.8504517822F, 0.8516602292F, 0.8528630164F, 0.8540601391F, 0.8552515928F, 0.8564373733F, 0.8576174766F, 0.8587918990F, 0.8599606368F, 0.8611236868F, 0.8622810460F, 0.8634327113F, 0.8645786802F, 0.8657189504F, 0.8668535195F, 0.8679823857F, 0.8691055472F, 0.8702230025F, 0.8713347503F, 0.8724407896F, 0.8735411194F, 0.8746357394F, 0.8757246489F, 0.8768078479F, 0.8778853364F, 0.8789571146F, 0.8800231832F, 0.8810835427F, 0.8821381942F, 0.8831871387F, 0.8842303777F, 0.8852679127F, 0.8862997456F, 0.8873258784F, 0.8883463132F, 0.8893610527F, 0.8903700994F, 0.8913734562F, 0.8923711263F, 0.8933631129F, 0.8943494196F, 0.8953300500F, 0.8963050083F, 0.8972742985F, 0.8982379249F, 0.8991958922F, 0.9001482052F, 0.9010948688F, 0.9020358883F, 0.9029712690F, 0.9039010165F, 0.9048251367F, 0.9057436357F, 0.9066565195F, 0.9075637946F, 0.9084654678F, 0.9093615456F, 0.9102520353F, 0.9111369440F, 0.9120162792F, 0.9128900484F, 0.9137582595F, 0.9146209204F, 0.9154780394F, 0.9163296248F, 0.9171756853F, 0.9180162296F, 0.9188512667F, 0.9196808057F, 0.9205048559F, 0.9213234270F, 0.9221365285F, 0.9229441704F, 0.9237463629F, 0.9245431160F, 0.9253344404F, 0.9261203465F, 0.9269008453F, 0.9276759477F, 0.9284456648F, 0.9292100080F, 0.9299689889F, 0.9307226190F, 0.9314709103F, 0.9322138747F, 0.9329515245F, 0.9336838721F, 0.9344109300F, 0.9351327108F, 0.9358492275F, 0.9365604931F, 0.9372665208F, 0.9379673239F, 0.9386629160F, 0.9393533107F, 0.9400385220F, 0.9407185637F, 0.9413934501F, 0.9420631954F, 0.9427278141F, 0.9433873208F, 0.9440417304F, 0.9446910576F, 0.9453353176F, 0.9459745255F, 0.9466086968F, 0.9472378469F, 0.9478619915F, 0.9484811463F, 0.9490953274F, 0.9497045506F, 0.9503088323F, 0.9509081888F, 0.9515026365F, 0.9520921921F, 0.9526768723F, 0.9532566940F, 0.9538316742F, 0.9544018300F, 0.9549671786F, 0.9555277375F, 0.9560835241F, 0.9566345562F, 0.9571808513F, 0.9577224275F, 0.9582593027F, 0.9587914949F, 0.9593190225F, 0.9598419038F, 0.9603601571F, 0.9608738012F, 0.9613828546F, 0.9618873361F, 0.9623872646F, 0.9628826591F, 0.9633735388F, 0.9638599227F, 0.9643418303F, 0.9648192808F, 0.9652922939F, 0.9657608890F, 0.9662250860F, 0.9666849046F, 0.9671403646F, 0.9675914861F, 0.9680382891F, 0.9684807937F, 0.9689190202F, 0.9693529890F, 0.9697827203F, 0.9702082347F, 0.9706295529F, 0.9710466953F, 0.9714596828F, 0.9718685362F, 0.9722732762F, 0.9726739240F, 0.9730705005F, 0.9734630267F, 0.9738515239F, 0.9742360134F, 0.9746165163F, 0.9749930540F, 0.9753656481F, 0.9757343198F, 0.9760990909F, 0.9764599829F, 0.9768170175F, 0.9771702164F, 0.9775196013F, 0.9778651941F, 0.9782070167F, 0.9785450909F, 0.9788794388F, 0.9792100824F, 0.9795370437F, 0.9798603449F, 0.9801800080F, 0.9804960554F, 0.9808085092F, 0.9811173916F, 0.9814227251F, 0.9817245318F, 0.9820228343F, 0.9823176549F, 0.9826090160F, 0.9828969402F, 0.9831814498F, 0.9834625674F, 0.9837403156F, 0.9840147169F, 0.9842857939F, 0.9845535692F, 0.9848180654F, 0.9850793052F, 0.9853373113F, 0.9855921062F, 0.9858437127F, 0.9860921535F, 0.9863374512F, 0.9865796287F, 0.9868187085F, 0.9870547136F, 0.9872876664F, 0.9875175899F, 0.9877445067F, 0.9879684396F, 0.9881894112F, 0.9884074444F, 0.9886225619F, 0.9888347863F, 0.9890441404F, 0.9892506468F, 0.9894543284F, 0.9896552077F, 0.9898533074F, 0.9900486502F, 0.9902412587F, 0.9904311555F, 0.9906183633F, 0.9908029045F, 0.9909848019F, 0.9911640779F, 0.9913407550F, 0.9915148557F, 0.9916864025F, 0.9918554179F, 0.9920219241F, 0.9921859437F, 0.9923474989F, 0.9925066120F, 0.9926633054F, 0.9928176012F, 0.9929695218F, 0.9931190891F, 0.9932663254F, 0.9934112527F, 0.9935538932F, 0.9936942686F, 0.9938324012F, 0.9939683126F, 0.9941020248F, 0.9942335597F,Showing the first 500 of 2136 diff lines for this file. This diff is INCOMPLETE; read the file or clone the repository for the rest.
vendor/vorbis/lib/window.hadded
/******************************************************************** * * * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 * * by the Xiph.Org Foundation https://xiph.org/ * * * ******************************************************************** function: window functions ********************************************************************/#ifndef _V_WINDOW_#define _V_WINDOW_extern const float *_vorbis_window_get(int n);extern void _vorbis_apply_window(float *d,int *winno,long *blocksizes, int lW,int W,int nW);#endifvendor/vorbis/sigil_alloca_shim.hadded
/* sigil_alloca_shim.h * * Force-included before every vendored libvorbis source. Toggles * HAVE_ALLOCA_H based on the target platform so libvorbis's os.h * pulls in the right alloca declaration: * * - Linux/macOS: <alloca.h> exists; HAVE_ALLOCA_H=1. * - Windows (MinGW via zig): no <alloca.h>; alloca lives in * <malloc.h>, which os.h already pulls in via its _WIN32 branch. * * Without this shim, defining HAVE_ALLOCA_H unconditionally would * make Windows builds try to include the missing <alloca.h>, and * NOT defining it would leave Linux builds with an implicit-decl * error under -std=c99 (alloca is not a builtin there). * * This file lives outside vendor/vorbis/lib/ on purpose — keeping * upstream sources byte-identical so future bumps stay drop-in. */#ifndef SIGIL_VORBIS_ALLOCA_SHIM_H#define SIGIL_VORBIS_ALLOCA_SHIM_H#if !defined(_WIN32) && !defined(__SYMBIAN32__)# define HAVE_ALLOCA_H 1#endif#endif /* SIGIL_VORBIS_ALLOCA_SHIM_H */