Commitd4ced127Recorded24 Apr 2026Repositorysigil-audio

Vendor libogg 1.3.6 + libvorbis 1.3.7 (v0.10.0)

Message

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).

Changed
 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(-)
Diff
CHANGELOG.mdmodified
@@ -5,6 +5,33 @@ All notable changes to this project will be documented in this file.
5
The format is based on [Keep a Changelog](https://keepachangelog.com/),
6
and this project adheres to [Semantic Versioning](https://semver.org/).
7
+8
## [0.10.0] - 2026-04-24
+9
+10
### Added
+11
+12
- Vendored libogg 1.3.6 + libvorbis 1.3.7 under `vendor/ogg/` and
+13
`vendor/vorbis/`. OGG Vorbis encoding/decoding is now
+14
self-contained: no external `-lvorbis` / `-lvorbisenc` / `-logg`
+15
link dependency, no system `libogg-dev` / `libvorbis-dev`
+16
packages needed on Linux or macOS.
+17
- Windows cross-compile target (`sigil build --config
+18
windows-amd64`) — uses zig with `x86_64-windows-gnu`. WASAPI
+19
backend links against `-lole32 -lwinmm -lksuser`. Verified by
+20
building libsigil-audio.a + test-linking a PE32+ Windows .exe.
+21
- Per-tree `vendor/ogg/README.md` and `vendor/vorbis/README.md`
+22
recording upstream version + tarball SHA256 + upgrade procedure.
+23
+24
### Changed
+25
+26
- `package.sgl` library `link-flags`: dropped
+27
`-lvorbis -lvorbisenc -logg` from every host branch; added a
+28
`(windows)` branch with WASAPI link flags.
+29
- `manifest.scm`: removed `libvorbis` / `libogg` system deps —
+30
vendored sources cover them.
+31
- Binary size grows by ~1 MB (libvorbis codebook tables dominate).
+32
Acceptable trade-off for the install-time ergonomics + cross-
+33
compile capability.
+34
35
## [0.9.0] - 2026-04-18
36
37
### Added
README.mdmodified
@@ -14,6 +14,15 @@ Provides audio playback capabilities via sokol_audio. Sound effects are loaded i
14
15
- ALSA development headers on Linux (`libasound2-dev` / `alsa-lib-devel`)
16
- AudioToolbox framework on macOS (included with Xcode)
+17
- Windows: nothing extra — sokol_audio drives WASAPI through
+18
`ole32` / `winmm` / `ksuser`, all bundled with the OS.
+19
+20
OGG Vorbis encoding/decoding is **vendored** (libogg 1.3.6 +
+21
libvorbis 1.3.7, see `vendor/ogg/README.md` and
+22
`vendor/vorbis/README.md`). No system `libogg` / `libvorbis` /
+23
`libvorbisenc` packages need to be installed — sigil-audio links
+24
them statically into `libsigil-audio.a`. This adds ~1 MB to the
+25
final binary and unblocks Windows cross-compile.
26
27
## Dependencies
28
@@ -23,7 +32,8 @@ Provides audio playback capabilities via sokol_audio. Sound effects are loaded i
32
33
```sh
34
sigil deps install
26
sigil build
+35
sigil build # native (host platform)
+36
sigil build --config windows-amd64 # cross-compile for Windows (zig)
37
```
38
39
## Streaming audio sink
@@ -101,4 +111,9 @@ over-run semantics.
111
112
## License
113
104
BSD-3-Clause
+114
BSD-3-Clause.
+115
+116
Vendored libogg (1.3.6) and libvorbis (1.3.7) are also distributed
+117
under BSD-3-Clause (see `vendor/ogg/COPYING` and
+118
`vendor/vorbis/COPYING`). Both licenses are compatible with this
+119
package's BSD-3-Clause terms.
manifest.scmmodified
@@ -1,14 +1,14 @@
1
;; sigil-audio Development Environment
2
;; Use with: guix shell -m manifest.scm
3
+4
;; libogg / libvorbis used to live here but are now vendored under
+5
;; vendor/ogg + vendor/vorbis (see package.sgl), so the system
+6
;; packages are no longer required to build sigil-audio.
+7
8
(specifications->manifest
9
'("gcc-toolchain"
10
"pkg-config"
11
"binutils"
12
9
;; Audio playback (Sokol backend)
10
"alsa-lib"
11
12
;; OGG Vorbis encoding
13
"libvorbis"
14
"libogg"))
13
No newline at end of file
+14
;; Audio playback (Sokol backend) — still a system dep on Linux.
+15
"alsa-lib"))
16
No newline at end of file
package.sglmodified
@@ -2,10 +2,11 @@
2
;;;
3
;;; Provides audio playback capabilities via sokol_audio.
4
;;; Sound effects are loaded into memory, music is streamed via stb_vorbis.
+5
;;; OGG Vorbis encoding ships in-tree via vendored libogg + libvorbis.
6
7
(package
8
name: "sigil-audio"
8
version: "0.9.1"
+9
version: "0.10.0"
10
description: "Audio playback and streaming for Sigil"
11
url: "https://codeberg.org/sigil/sigil-audio"
12
license: "BSD-3-Clause"
@@ -21,7 +22,21 @@
22
name: 'release
23
output-dir: "build/release"
24
debug?: #f
24
optimize: 2))
+25
optimize: 2)
+26
+27
;; Windows x86_64 (MinGW via zig) — built so downstream consumers
+28
;; like cinder-cantata can produce Windows binaries from Linux.
+29
;; Mirrors the windows-amd64 config in the main sigil package.
+30
(config
+31
name: 'windows-amd64
+32
output-dir: "build/windows-amd64"
+33
toolchain: 'zig
+34
target: "x86_64-windows-gnu"
+35
backend: 'native
+36
static?: #t
+37
debug?: #f
+38
optimize: 2
+39
features: '(release cross windows)))
40
41
dependencies: (list
42
(from-git url: "codeberg:sigil/sigil" package: "sigil-stdlib" version: "^0.13.0"))
@@ -30,22 +45,97 @@
45
(library
46
name: 'sigil-audio
47
c-sources: '("src/c/sokol-audio.c" "src/c/audio.c" "src/c/audio-stream.c" "src/c/ogg-encode.c")
33
c-include-dirs: '("vendor/sokol" "vendor/stb")
+48
;; vendor/ogg/include + vendor/vorbis/include expose the public
+49
;; ogg/vorbis headers consumed by ogg-encode.c. vendor/vorbis/lib
+50
;; is needed because libvorbis internal .c files include their
+51
;; siblings by bare filename (e.g. #include "codebook.h").
+52
c-include-dirs: '("vendor/sokol" "vendor/stb"
+53
"vendor/ogg/include"
+54
"vendor/vorbis/include"
+55
"vendor/vorbis/lib")
56
native-init: "sigil__init_sigil_audio_module"
35
;; Platform-specific linker flags for audio + OGG Vorbis encoding
+57
;; Platform-specific linker flags for sokol_audio's audio backend.
+58
;; OGG Vorbis is now vendored — no more -lvorbis/-lvorbisenc/-logg.
59
link-flags: (case (host-os)
37
((linux) '("-lasound" "-lvorbis" "-lvorbisenc" "-logg"))
38
((darwin) '("-framework" "AudioToolbox" "-lvorbis" "-lvorbisenc" "-logg"))
39
(else '("-lvorbis" "-lvorbisenc" "-logg")))))
+60
((linux) '("-lasound"))
+61
((darwin) '("-framework" "AudioToolbox"))
+62
;; sokol_audio's WASAPI backend uses CoCreateInstance
+63
;; / CoInitializeEx (ole32). winmm + ksuser are
+64
;; carried for completeness against future sokol
+65
;; revisions that touch waveOut / kernel-streaming.
+66
((windows) '("-lole32" "-lwinmm" "-lksuser"))
+67
(else '()))))
68
69
tasks: (list
70
(task
71
name: 'build
72
description: "Build sigil-audio"
73
steps: (list
+74
;; Compile vendored libogg with relaxed warning flags. Upstream
+75
;; sources are byte-identical to the 1.3.6 tarball (see
+76
;; vendor/ogg/README.md); keeping warnings off avoids polluting
+77
;; sigil-audio's own strict-flag set when upstream's style
+78
;; trips -Wparentheses / -Wunused-* / -Wsign-compare.
+79
(compile-c-sources
+80
sources: '("vendor/ogg/src/bitwise.c"
+81
"vendor/ogg/src/framing.c")
+82
include-dirs: '("vendor/ogg/include")
+83
flags: '("-std=c99"
+84
"-Wno-parentheses"
+85
"-Wno-unused-function"
+86
"-Wno-unused-but-set-variable"
+87
"-Wno-sign-compare"
+88
"-Wno-strict-aliasing"))
+89
+90
;; Compile vendored libvorbis (full library + encoder + file
+91
;; I/O). Upstream sources are byte-identical to the 1.3.7
+92
;; tarball (see vendor/vorbis/README.md). Same relaxed-warning
+93
;; rationale as libogg above.
+94
(compile-c-sources
+95
sources: '("vendor/vorbis/lib/analysis.c"
+96
"vendor/vorbis/lib/bitrate.c"
+97
"vendor/vorbis/lib/block.c"
+98
"vendor/vorbis/lib/codebook.c"
+99
"vendor/vorbis/lib/envelope.c"
+100
"vendor/vorbis/lib/floor0.c"
+101
"vendor/vorbis/lib/floor1.c"
+102
"vendor/vorbis/lib/info.c"
+103
"vendor/vorbis/lib/lookup.c"
+104
"vendor/vorbis/lib/lpc.c"
+105
"vendor/vorbis/lib/lsp.c"
+106
"vendor/vorbis/lib/mapping0.c"
+107
"vendor/vorbis/lib/mdct.c"
+108
"vendor/vorbis/lib/psy.c"
+109
"vendor/vorbis/lib/registry.c"
+110
"vendor/vorbis/lib/res0.c"
+111
"vendor/vorbis/lib/sharedbook.c"
+112
"vendor/vorbis/lib/smallft.c"
+113
"vendor/vorbis/lib/synthesis.c"
+114
"vendor/vorbis/lib/vorbisenc.c"
+115
"vendor/vorbis/lib/vorbisfile.c"
+116
"vendor/vorbis/lib/window.c")
+117
include-dirs: '("vendor/ogg/include"
+118
"vendor/vorbis/include"
+119
"vendor/vorbis/lib")
+120
;; vendor/vorbis/sigil_alloca_shim.h is force-included so
+121
;; HAVE_ALLOCA_H gets defined on Linux/macOS (where vorbis
+122
;; needs it for the alloca prototype under -std=c99) but
+123
;; NOT on Windows/MinGW (where <alloca.h> is missing and
+124
;; vorbis's _WIN32 branch handles alloca via <malloc.h>).
+125
flags: '("-std=c99"
+126
"-include" "vendor/vorbis/sigil_alloca_shim.h"
+127
"-Wno-parentheses"
+128
"-Wno-unused-function"
+129
"-Wno-unused-but-set-variable"
+130
"-Wno-sign-compare"
+131
"-Wno-strict-aliasing"))
+132
+133
;; sigil-audio's own C sources.
134
(compile-c-sources
135
sources: '("src/c/sokol-audio.c" "src/c/audio.c" "src/c/audio-stream.c" "src/c/ogg-encode.c")
48
include-dirs: '("vendor/sokol" "vendor/stb")
+136
include-dirs: '("vendor/sokol" "vendor/stb"
+137
"vendor/ogg/include"
+138
"vendor/vorbis/include")
139
flags: (with-sigil-c-flags '("-std=c11" "-D_GNU_SOURCE"
140
"-Wno-unused-parameter" "-Wno-unused-function" "-Wno-sign-compare")))
141
(create-static-library name: "sigil-audio")
vendor/ogg/COPYINGadded
@@ -0,0 +1,28 @@
+1
Copyright (c) 2002, Xiph.org Foundation
+2
+3
Redistribution and use in source and binary forms, with or without
+4
modification, are permitted provided that the following conditions
+5
are met:
+6
+7
- Redistributions of source code must retain the above copyright
+8
notice, this list of conditions and the following disclaimer.
+9
+10
- Redistributions in binary form must reproduce the above copyright
+11
notice, this list of conditions and the following disclaimer in the
+12
documentation and/or other materials provided with the distribution.
+13
+14
- Neither the name of the Xiph.org Foundation nor the names of its
+15
contributors may be used to endorse or promote products derived from
+16
this software without specific prior written permission.
+17
+18
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+19
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+20
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+21
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION
+22
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+23
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+24
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+25
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+26
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+27
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+28
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
vendor/ogg/README.mdadded
@@ -0,0 +1,35 @@
+1
# libogg (vendored)
+2
+3
Upstream: https://xiph.org/ogg/
+4
+5
- **Version**: 1.3.6
+6
- **Source**: https://downloads.xiph.org/releases/ogg/libogg-1.3.6.tar.xz
+7
- **SHA256**: `5c8253428e181840cd20d41f3ca16557a9cc04bad4a3d04cce84808677fa1061`
+8
- **License**: BSD-3-Clause (see `COPYING`)
+9
+10
## What's included
+11
+12
Sources required to build `libogg.a`:
+13
+14
- `src/bitwise.c`, `src/framing.c`, `src/crctable.h`
+15
- `include/ogg/ogg.h`, `include/ogg/os_types.h`
+16
- `include/ogg/config_types.h` — locally maintained substitute for
+17
upstream's `config_types.h.in` template. See the header comment in
+18
that file for rationale.
+19
+20
Everything else from the tarball (`docs/`, `cmake/`, `m4/`,
+21
`win32/`, `Makefile.in`/`Makefile.am`, `configure`, doxygen,
+22
autotools machinery) is intentionally omitted — sigil-audio drives
+23
the build through `package.sgl`, not autotools.
+24
+25
## Upgrading
+26
+27
1. Download the new upstream tarball, verify SHA256 against
+28
xiph.org's release announcement.
+29
2. Replace `src/bitwise.c`, `src/framing.c`, `src/crctable.h`,
+30
`include/ogg/ogg.h`, `include/ogg/os_types.h`, `COPYING` with
+31
the upstream files (byte-identical drop-in).
+32
3. Update version + SHA256 in this README.
+33
4. Re-check whether upstream changed `config_types.h.in`. If a new
+34
typedef appeared, mirror it in `include/ogg/config_types.h`.
+35
5. Rebuild + run `test/test-ogg-encode.sgl`.
vendor/ogg/include/ogg/config_types.hadded
@@ -0,0 +1,28 @@
+1
/* config_types.h
+2
*
+3
* Vendored substitute for libogg's autotools/cmake-generated
+4
* config_types.h. Upstream ships only `config_types.h.in`, which is
+5
* normally expanded at configure time by detecting native int sizes.
+6
*
+7
* This vendored sigil-audio build skips the configure step entirely
+8
* and assumes a C99 host with stdint.h — which is true for every
+9
* platform sigil targets (Linux/glibc, macOS, MinGW-w64 via zig).
+10
*
+11
* If a target ever surfaces where stdint.h is unavailable, this file
+12
* is the right place to add the alternate typedef branch — do not
+13
* patch upstream sources.
+14
*/
+15
#ifndef __CONFIG_TYPES_H__
+16
#define __CONFIG_TYPES_H__
+17
+18
#include <stdint.h>
+19
#include <sys/types.h>
+20
+21
typedef int16_t ogg_int16_t;
+22
typedef uint16_t ogg_uint16_t;
+23
typedef int32_t ogg_int32_t;
+24
typedef uint32_t ogg_uint32_t;
+25
typedef int64_t ogg_int64_t;
+26
typedef uint64_t ogg_uint64_t;
+27
+28
#endif
vendor/ogg/include/ogg/ogg.hadded
@@ -0,0 +1,209 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 *
+9
* by the Xiph.Org Foundation http://www.xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: toplevel libogg include
+14
+15
********************************************************************/
+16
#ifndef _OGG_H
+17
#define _OGG_H
+18
+19
#ifdef __cplusplus
+20
extern "C" {
+21
#endif
+22
+23
#include <stddef.h>
+24
#include <ogg/os_types.h>
+25
+26
typedef struct {
+27
void *iov_base;
+28
size_t iov_len;
+29
} ogg_iovec_t;
+30
+31
typedef struct {
+32
long endbyte;
+33
int endbit;
+34
+35
unsigned char *buffer;
+36
unsigned char *ptr;
+37
long storage;
+38
} oggpack_buffer;
+39
+40
/* ogg_page is used to encapsulate the data in one Ogg bitstream page *****/
+41
+42
typedef struct {
+43
unsigned char *header;
+44
long header_len;
+45
unsigned char *body;
+46
long body_len;
+47
} ogg_page;
+48
+49
/* ogg_stream_state contains the current encode/decode state of a logical
+50
Ogg bitstream **********************************************************/
+51
+52
typedef struct {
+53
unsigned char *body_data; /* bytes from packet bodies */
+54
long body_storage; /* storage elements allocated */
+55
long body_fill; /* elements stored; fill mark */
+56
long body_returned; /* elements of fill returned */
+57
+58
+59
int *lacing_vals; /* The values that will go to the segment table */
+60
ogg_int64_t *granule_vals; /* granulepos values for headers. Not compact
+61
this way, but it is simple coupled to the
+62
lacing fifo */
+63
long lacing_storage;
+64
long lacing_fill;
+65
long lacing_packet;
+66
long lacing_returned;
+67
+68
unsigned char header[282]; /* working space for header encode */
+69
int header_fill;
+70
+71
int e_o_s; /* set when we have buffered the last packet in the
+72
logical bitstream */
+73
int b_o_s; /* set after we've written the initial page
+74
of a logical bitstream */
+75
long serialno;
+76
long pageno;
+77
ogg_int64_t packetno; /* sequence number for decode; the framing
+78
knows where there's a hole in the data,
+79
but we need coupling so that the codec
+80
(which is in a separate abstraction
+81
layer) also knows about the gap */
+82
ogg_int64_t granulepos;
+83
+84
} ogg_stream_state;
+85
+86
/* ogg_packet is used to encapsulate the data and metadata belonging
+87
to a single raw Ogg/Vorbis packet *************************************/
+88
+89
typedef struct {
+90
unsigned char *packet;
+91
long bytes;
+92
long b_o_s;
+93
long e_o_s;
+94
+95
ogg_int64_t granulepos;
+96
+97
ogg_int64_t packetno; /* sequence number for decode; the framing
+98
knows where there's a hole in the data,
+99
but we need coupling so that the codec
+100
(which is in a separate abstraction
+101
layer) also knows about the gap */
+102
} ogg_packet;
+103
+104
typedef struct {
+105
unsigned char *data;
+106
int storage;
+107
int fill;
+108
int returned;
+109
+110
int unsynced;
+111
int headerbytes;
+112
int bodybytes;
+113
} ogg_sync_state;
+114
+115
/* Ogg BITSTREAM PRIMITIVES: bitstream ************************/
+116
+117
extern void oggpack_writeinit(oggpack_buffer *b);
+118
extern int oggpack_writecheck(oggpack_buffer *b);
+119
extern void oggpack_writetrunc(oggpack_buffer *b,long bits);
+120
extern void oggpack_writealign(oggpack_buffer *b);
+121
extern void oggpack_writecopy(oggpack_buffer *b,void *source,long bits);
+122
extern void oggpack_reset(oggpack_buffer *b);
+123
extern void oggpack_writeclear(oggpack_buffer *b);
+124
extern void oggpack_readinit(oggpack_buffer *b,unsigned char *buf,int bytes);
+125
extern void oggpack_write(oggpack_buffer *b,unsigned long value,int bits);
+126
extern long oggpack_look(oggpack_buffer *b,int bits);
+127
extern long oggpack_look1(oggpack_buffer *b);
+128
extern void oggpack_adv(oggpack_buffer *b,int bits);
+129
extern void oggpack_adv1(oggpack_buffer *b);
+130
extern long oggpack_read(oggpack_buffer *b,int bits);
+131
extern long oggpack_read1(oggpack_buffer *b);
+132
extern long oggpack_bytes(oggpack_buffer *b);
+133
extern long oggpack_bits(oggpack_buffer *b);
+134
extern unsigned char *oggpack_get_buffer(oggpack_buffer *b);
+135
+136
extern void oggpackB_writeinit(oggpack_buffer *b);
+137
extern int oggpackB_writecheck(oggpack_buffer *b);
+138
extern void oggpackB_writetrunc(oggpack_buffer *b,long bits);
+139
extern void oggpackB_writealign(oggpack_buffer *b);
+140
extern void oggpackB_writecopy(oggpack_buffer *b,void *source,long bits);
+141
extern void oggpackB_reset(oggpack_buffer *b);
+142
extern void oggpackB_writeclear(oggpack_buffer *b);
+143
extern void oggpackB_readinit(oggpack_buffer *b,unsigned char *buf,int bytes);
+144
extern void oggpackB_write(oggpack_buffer *b,unsigned long value,int bits);
+145
extern long oggpackB_look(oggpack_buffer *b,int bits);
+146
extern long oggpackB_look1(oggpack_buffer *b);
+147
extern void oggpackB_adv(oggpack_buffer *b,int bits);
+148
extern void oggpackB_adv1(oggpack_buffer *b);
+149
extern long oggpackB_read(oggpack_buffer *b,int bits);
+150
extern long oggpackB_read1(oggpack_buffer *b);
+151
extern long oggpackB_bytes(oggpack_buffer *b);
+152
extern long oggpackB_bits(oggpack_buffer *b);
+153
extern unsigned char *oggpackB_get_buffer(oggpack_buffer *b);
+154
+155
/* Ogg BITSTREAM PRIMITIVES: encoding **************************/
+156
+157
extern int ogg_stream_packetin(ogg_stream_state *os, ogg_packet *op);
+158
extern int ogg_stream_iovecin(ogg_stream_state *os, ogg_iovec_t *iov,
+159
int count, long e_o_s, ogg_int64_t granulepos);
+160
extern int ogg_stream_pageout(ogg_stream_state *os, ogg_page *og);
+161
extern int ogg_stream_pageout_fill(ogg_stream_state *os, ogg_page *og, int nfill);
+162
extern int ogg_stream_flush(ogg_stream_state *os, ogg_page *og);
+163
extern int ogg_stream_flush_fill(ogg_stream_state *os, ogg_page *og, int nfill);
+164
+165
/* Ogg BITSTREAM PRIMITIVES: decoding **************************/
+166
+167
extern int ogg_sync_init(ogg_sync_state *oy);
+168
extern int ogg_sync_clear(ogg_sync_state *oy);
+169
extern int ogg_sync_reset(ogg_sync_state *oy);
+170
extern int ogg_sync_destroy(ogg_sync_state *oy);
+171
extern int ogg_sync_check(ogg_sync_state *oy);
+172
+173
extern char *ogg_sync_buffer(ogg_sync_state *oy, long size);
+174
extern int ogg_sync_wrote(ogg_sync_state *oy, long bytes);
+175
extern long ogg_sync_pageseek(ogg_sync_state *oy,ogg_page *og);
+176
extern int ogg_sync_pageout(ogg_sync_state *oy, ogg_page *og);
+177
extern int ogg_stream_pagein(ogg_stream_state *os, ogg_page *og);
+178
extern int ogg_stream_packetout(ogg_stream_state *os,ogg_packet *op);
+179
extern int ogg_stream_packetpeek(ogg_stream_state *os,ogg_packet *op);
+180
+181
/* Ogg BITSTREAM PRIMITIVES: general ***************************/
+182
+183
extern int ogg_stream_init(ogg_stream_state *os,int serialno);
+184
extern int ogg_stream_clear(ogg_stream_state *os);
+185
extern int ogg_stream_reset(ogg_stream_state *os);
+186
extern int ogg_stream_reset_serialno(ogg_stream_state *os,int serialno);
+187
extern int ogg_stream_destroy(ogg_stream_state *os);
+188
extern int ogg_stream_check(ogg_stream_state *os);
+189
extern int ogg_stream_eos(ogg_stream_state *os);
+190
+191
extern void ogg_page_checksum_set(ogg_page *og);
+192
+193
extern int ogg_page_version(const ogg_page *og);
+194
extern int ogg_page_continued(const ogg_page *og);
+195
extern int ogg_page_bos(const ogg_page *og);
+196
extern int ogg_page_eos(const ogg_page *og);
+197
extern ogg_int64_t ogg_page_granulepos(const ogg_page *og);
+198
extern int ogg_page_serialno(const ogg_page *og);
+199
extern long ogg_page_pageno(const ogg_page *og);
+200
extern int ogg_page_packets(const ogg_page *og);
+201
+202
extern void ogg_packet_clear(ogg_packet *op);
+203
+204
+205
#ifdef __cplusplus
+206
}
+207
#endif
+208
+209
#endif /* _OGG_H */
vendor/ogg/include/ogg/os_types.hadded
@@ -0,0 +1,158 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2002 *
+9
* by the Xiph.Org Foundation http://www.xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: Define a consistent set of types on each platform.
+14
+15
********************************************************************/
+16
#ifndef _OS_TYPES_H
+17
#define _OS_TYPES_H
+18
+19
/* make it easy on the folks that want to compile the libs with a
+20
different malloc than stdlib */
+21
#define _ogg_malloc malloc
+22
#define _ogg_calloc calloc
+23
#define _ogg_realloc realloc
+24
#define _ogg_free free
+25
+26
#if defined(_WIN32)
+27
+28
# if defined(__CYGWIN__)
+29
# include <stdint.h>
+30
typedef int16_t ogg_int16_t;
+31
typedef uint16_t ogg_uint16_t;
+32
typedef int32_t ogg_int32_t;
+33
typedef uint32_t ogg_uint32_t;
+34
typedef int64_t ogg_int64_t;
+35
typedef uint64_t ogg_uint64_t;
+36
# elif defined(__MINGW32__)
+37
# include <sys/types.h>
+38
typedef short ogg_int16_t;
+39
typedef unsigned short ogg_uint16_t;
+40
typedef int ogg_int32_t;
+41
typedef unsigned int ogg_uint32_t;
+42
typedef long long ogg_int64_t;
+43
typedef unsigned long long ogg_uint64_t;
+44
# elif defined(__MWERKS__)
+45
typedef long long ogg_int64_t;
+46
typedef unsigned long long ogg_uint64_t;
+47
typedef int ogg_int32_t;
+48
typedef unsigned int ogg_uint32_t;
+49
typedef short ogg_int16_t;
+50
typedef unsigned short ogg_uint16_t;
+51
# else
+52
# if defined(_MSC_VER) && (_MSC_VER >= 1800) /* MSVC 2013 and newer */
+53
# include <stdint.h>
+54
typedef int16_t ogg_int16_t;
+55
typedef uint16_t ogg_uint16_t;
+56
typedef int32_t ogg_int32_t;
+57
typedef uint32_t ogg_uint32_t;
+58
typedef int64_t ogg_int64_t;
+59
typedef uint64_t ogg_uint64_t;
+60
# else
+61
/* MSVC/Borland */
+62
typedef __int64 ogg_int64_t;
+63
typedef __int32 ogg_int32_t;
+64
typedef unsigned __int32 ogg_uint32_t;
+65
typedef unsigned __int64 ogg_uint64_t;
+66
typedef __int16 ogg_int16_t;
+67
typedef unsigned __int16 ogg_uint16_t;
+68
# endif
+69
# endif
+70
+71
#elif (defined(__APPLE__) && defined(__MACH__)) /* MacOS X Framework build */
+72
+73
# include <sys/types.h>
+74
typedef int16_t ogg_int16_t;
+75
typedef u_int16_t ogg_uint16_t;
+76
typedef int32_t ogg_int32_t;
+77
typedef u_int32_t ogg_uint32_t;
+78
typedef int64_t ogg_int64_t;
+79
typedef u_int64_t ogg_uint64_t;
+80
+81
#elif defined(__HAIKU__)
+82
+83
/* Haiku */
+84
# include <sys/types.h>
+85
typedef short ogg_int16_t;
+86
typedef unsigned short ogg_uint16_t;
+87
typedef int ogg_int32_t;
+88
typedef unsigned int ogg_uint32_t;
+89
typedef long long ogg_int64_t;
+90
typedef unsigned long long ogg_uint64_t;
+91
+92
#elif defined(__BEOS__)
+93
+94
/* Be */
+95
# include <inttypes.h>
+96
typedef int16_t ogg_int16_t;
+97
typedef uint16_t ogg_uint16_t;
+98
typedef int32_t ogg_int32_t;
+99
typedef uint32_t ogg_uint32_t;
+100
typedef int64_t ogg_int64_t;
+101
typedef uint64_t ogg_uint64_t;
+102
+103
#elif defined (__EMX__)
+104
+105
/* OS/2 GCC */
+106
typedef short ogg_int16_t;
+107
typedef unsigned short ogg_uint16_t;
+108
typedef int ogg_int32_t;
+109
typedef unsigned int ogg_uint32_t;
+110
typedef long long ogg_int64_t;
+111
typedef unsigned long long ogg_uint64_t;
+112
+113
+114
#elif defined (DJGPP)
+115
+116
/* DJGPP */
+117
typedef short ogg_int16_t;
+118
typedef int ogg_int32_t;
+119
typedef unsigned int ogg_uint32_t;
+120
typedef long long ogg_int64_t;
+121
typedef unsigned long long ogg_uint64_t;
+122
+123
#elif defined(R5900)
+124
+125
/* PS2 EE */
+126
typedef long ogg_int64_t;
+127
typedef unsigned long ogg_uint64_t;
+128
typedef int ogg_int32_t;
+129
typedef unsigned ogg_uint32_t;
+130
typedef short ogg_int16_t;
+131
+132
#elif defined(__SYMBIAN32__)
+133
+134
/* Symbian GCC */
+135
typedef signed short ogg_int16_t;
+136
typedef unsigned short ogg_uint16_t;
+137
typedef signed int ogg_int32_t;
+138
typedef unsigned int ogg_uint32_t;
+139
typedef long long int ogg_int64_t;
+140
typedef unsigned long long int ogg_uint64_t;
+141
+142
#elif defined(__TMS320C6X__)
+143
+144
/* TI C64x compiler */
+145
typedef signed short ogg_int16_t;
+146
typedef unsigned short ogg_uint16_t;
+147
typedef signed int ogg_int32_t;
+148
typedef unsigned int ogg_uint32_t;
+149
typedef long long int ogg_int64_t;
+150
typedef unsigned long long int ogg_uint64_t;
+151
+152
#else
+153
+154
# include <ogg/config_types.h>
+155
+156
#endif
+157
+158
#endif /* _OS_TYPES_H */
vendor/ogg/src/bitwise.cadded
@@ -0,0 +1,1089 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE Ogg CONTAINER SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2014 *
+9
* by the Xiph.Org Foundation http://www.xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: packing variable sized words into an octet stream
+14
+15
********************************************************************/
+16
+17
/* We're 'LSb' endian; if we write a word but read individual bits,
+18
then we'll read the lsb first */
+19
+20
#include <string.h>
+21
#include <stdlib.h>
+22
#include <limits.h>
+23
#include <ogg/ogg.h>
+24
+25
#define BUFFER_INCREMENT 256
+26
+27
static const unsigned long mask[]=
+28
{0x00000000,0x00000001,0x00000003,0x00000007,0x0000000f,
+29
0x0000001f,0x0000003f,0x0000007f,0x000000ff,0x000001ff,
+30
0x000003ff,0x000007ff,0x00000fff,0x00001fff,0x00003fff,
+31
0x00007fff,0x0000ffff,0x0001ffff,0x0003ffff,0x0007ffff,
+32
0x000fffff,0x001fffff,0x003fffff,0x007fffff,0x00ffffff,
+33
0x01ffffff,0x03ffffff,0x07ffffff,0x0fffffff,0x1fffffff,
+34
0x3fffffff,0x7fffffff,0xffffffff };
+35
+36
static const unsigned int mask8B[]=
+37
{0x00,0x80,0xc0,0xe0,0xf0,0xf8,0xfc,0xfe,0xff};
+38
+39
void oggpack_writeinit(oggpack_buffer *b){
+40
memset(b,0,sizeof(*b));
+41
b->ptr=b->buffer=_ogg_malloc(BUFFER_INCREMENT);
+42
if (!b->buffer)
+43
return;
+44
b->buffer[0]='\0';
+45
b->storage=BUFFER_INCREMENT;
+46
}
+47
+48
void oggpackB_writeinit(oggpack_buffer *b){
+49
oggpack_writeinit(b);
+50
}
+51
+52
int oggpack_writecheck(oggpack_buffer *b){
+53
if(!b->ptr || !b->storage)return -1;
+54
return 0;
+55
}
+56
+57
int oggpackB_writecheck(oggpack_buffer *b){
+58
return oggpack_writecheck(b);
+59
}
+60
+61
void oggpack_writetrunc(oggpack_buffer *b,long bits){
+62
long bytes=bits>>3;
+63
if(b->ptr){
+64
bits-=bytes*8;
+65
b->ptr=b->buffer+bytes;
+66
b->endbit=bits;
+67
b->endbyte=bytes;
+68
*b->ptr&=mask[bits];
+69
}
+70
}
+71
+72
void oggpackB_writetrunc(oggpack_buffer *b,long bits){
+73
long bytes=bits>>3;
+74
if(b->ptr){
+75
bits-=bytes*8;
+76
b->ptr=b->buffer+bytes;
+77
b->endbit=bits;
+78
b->endbyte=bytes;
+79
*b->ptr&=mask8B[bits];
+80
}
+81
}
+82
+83
/* Takes only up to 32 bits. */
+84
void oggpack_write(oggpack_buffer *b,unsigned long value,int bits){
+85
if(bits<0 || bits>32) goto err;
+86
if(b->endbyte>=b->storage-4){
+87
void *ret;
+88
if(!b->ptr)return;
+89
if(b->storage>LONG_MAX-BUFFER_INCREMENT) goto err;
+90
ret=_ogg_realloc(b->buffer,b->storage+BUFFER_INCREMENT);
+91
if(!ret) goto err;
+92
b->buffer=ret;
+93
b->storage+=BUFFER_INCREMENT;
+94
b->ptr=b->buffer+b->endbyte;
+95
}
+96
+97
value&=mask[bits];
+98
bits+=b->endbit;
+99
+100
b->ptr[0]|=value<<b->endbit;
+101
+102
if(bits>=8){
+103
b->ptr[1]=(unsigned char)(value>>(8-b->endbit));
+104
if(bits>=16){
+105
b->ptr[2]=(unsigned char)(value>>(16-b->endbit));
+106
if(bits>=24){
+107
b->ptr[3]=(unsigned char)(value>>(24-b->endbit));
+108
if(bits>=32){
+109
if(b->endbit)
+110
b->ptr[4]=(unsigned char)(value>>(32-b->endbit));
+111
else
+112
b->ptr[4]=0;
+113
}
+114
}
+115
}
+116
}
+117
+118
b->endbyte+=bits/8;
+119
b->ptr+=bits/8;
+120
b->endbit=bits&7;
+121
return;
+122
err:
+123
oggpack_writeclear(b);
+124
}
+125
+126
/* Takes only up to 32 bits. */
+127
void oggpackB_write(oggpack_buffer *b,unsigned long value,int bits){
+128
if(bits<0 || bits>32) goto err;
+129
if(b->endbyte>=b->storage-4){
+130
void *ret;
+131
if(!b->ptr)return;
+132
if(b->storage>LONG_MAX-BUFFER_INCREMENT) goto err;
+133
ret=_ogg_realloc(b->buffer,b->storage+BUFFER_INCREMENT);
+134
if(!ret) goto err;
+135
b->buffer=ret;
+136
b->storage+=BUFFER_INCREMENT;
+137
b->ptr=b->buffer+b->endbyte;
+138
}
+139
+140
value=(value&mask[bits])<<(32-bits);
+141
bits+=b->endbit;
+142
+143
b->ptr[0]|=value>>(24+b->endbit);
+144
+145
if(bits>=8){
+146
b->ptr[1]=(unsigned char)(value>>(16+b->endbit));
+147
if(bits>=16){
+148
b->ptr[2]=(unsigned char)(value>>(8+b->endbit));
+149
if(bits>=24){
+150
b->ptr[3]=(unsigned char)(value>>(b->endbit));
+151
if(bits>=32){
+152
if(b->endbit)
+153
b->ptr[4]=(unsigned char)(value<<(8-b->endbit));
+154
else
+155
b->ptr[4]=0;
+156
}
+157
}
+158
}
+159
}
+160
+161
b->endbyte+=bits/8;
+162
b->ptr+=bits/8;
+163
b->endbit=bits&7;
+164
return;
+165
err:
+166
oggpack_writeclear(b);
+167
}
+168
+169
void oggpack_writealign(oggpack_buffer *b){
+170
int bits=8-b->endbit;
+171
if(bits<8)
+172
oggpack_write(b,0,bits);
+173
}
+174
+175
void oggpackB_writealign(oggpack_buffer *b){
+176
int bits=8-b->endbit;
+177
if(bits<8)
+178
oggpackB_write(b,0,bits);
+179
}
+180
+181
static void oggpack_writecopy_helper(oggpack_buffer *b,
+182
void *source,
+183
long bits,
+184
void (*w)(oggpack_buffer *,
+185
unsigned long,
+186
int),
+187
int msb){
+188
unsigned char *ptr=(unsigned char *)source;
+189
+190
long bytes=bits/8;
+191
long pbytes=(b->endbit+bits)/8;
+192
bits-=bytes*8;
+193
+194
/* expand storage up-front */
+195
if(b->endbyte+pbytes>=b->storage){
+196
void *ret;
+197
if(!b->ptr) goto err;
+198
if(b->storage>b->endbyte+pbytes+BUFFER_INCREMENT) goto err;
+199
b->storage=b->endbyte+pbytes+BUFFER_INCREMENT;
+200
ret=_ogg_realloc(b->buffer,b->storage);
+201
if(!ret) goto err;
+202
b->buffer=ret;
+203
b->ptr=b->buffer+b->endbyte;
+204
}
+205
+206
/* copy whole octets */
+207
if(b->endbit){
+208
int i;
+209
/* unaligned copy. Do it the hard way. */
+210
for(i=0;i<bytes;i++)
+211
w(b,(unsigned long)(ptr[i]),8);
+212
}else{
+213
/* aligned block copy */
+214
memmove(b->ptr,source,bytes);
+215
b->ptr+=bytes;
+216
b->endbyte+=bytes;
+217
*b->ptr=0;
+218
}
+219
+220
/* copy trailing bits */
+221
if(bits){
+222
if(msb)
+223
w(b,(unsigned long)(ptr[bytes]>>(8-bits)),bits);
+224
else
+225
w(b,(unsigned long)(ptr[bytes]),bits);
+226
}
+227
return;
+228
err:
+229
oggpack_writeclear(b);
+230
}
+231
+232
void oggpack_writecopy(oggpack_buffer *b,void *source,long bits){
+233
oggpack_writecopy_helper(b,source,bits,oggpack_write,0);
+234
}
+235
+236
void oggpackB_writecopy(oggpack_buffer *b,void *source,long bits){
+237
oggpack_writecopy_helper(b,source,bits,oggpackB_write,1);
+238
}
+239
+240
void oggpack_reset(oggpack_buffer *b){
+241
if(!b->ptr)return;
+242
b->ptr=b->buffer;
+243
b->buffer[0]=0;
+244
b->endbit=b->endbyte=0;
+245
}
+246
+247
void oggpackB_reset(oggpack_buffer *b){
+248
oggpack_reset(b);
+249
}
+250
+251
void oggpack_writeclear(oggpack_buffer *b){
+252
if(b->buffer)_ogg_free(b->buffer);
+253
memset(b,0,sizeof(*b));
+254
}
+255
+256
void oggpackB_writeclear(oggpack_buffer *b){
+257
oggpack_writeclear(b);
+258
}
+259
+260
void oggpack_readinit(oggpack_buffer *b,unsigned char *buf,int bytes){
+261
memset(b,0,sizeof(*b));
+262
b->buffer=b->ptr=buf;
+263
b->storage=bytes;
+264
}
+265
+266
void oggpackB_readinit(oggpack_buffer *b,unsigned char *buf,int bytes){
+267
oggpack_readinit(b,buf,bytes);
+268
}
+269
+270
/* Read in bits without advancing the bitptr; bits <= 32 */
+271
long oggpack_look(oggpack_buffer *b,int bits){
+272
unsigned long ret;
+273
unsigned long m;
+274
+275
if(bits<0 || bits>32) return -1;
+276
m=mask[bits];
+277
bits+=b->endbit;
+278
+279
if(b->endbyte >= b->storage-4){
+280
/* not the main path */
+281
if(b->endbyte > b->storage-((bits+7)>>3)) return -1;
+282
/* special case to avoid reading b->ptr[0], which might be past the end of
+283
the buffer; also skips some useless accounting */
+284
else if(!bits)return(0L);
+285
}
+286
+287
ret=b->ptr[0]>>b->endbit;
+288
if(bits>8){
+289
ret|=(unsigned long)b->ptr[1]<<(8-b->endbit);
+290
if(bits>16){
+291
ret|=(unsigned long)b->ptr[2]<<(16-b->endbit);
+292
if(bits>24){
+293
ret|=(unsigned long)b->ptr[3]<<(24-b->endbit);
+294
if(bits>32 && b->endbit)
+295
ret|=(unsigned long)b->ptr[4]<<(32-b->endbit);
+296
}
+297
}
+298
}
+299
return(m&ret);
+300
}
+301
+302
/* Read in bits without advancing the bitptr; bits <= 32 */
+303
long oggpackB_look(oggpack_buffer *b,int bits){
+304
unsigned long ret;
+305
int m=32-bits;
+306
+307
if(m<0 || m>32) return -1;
+308
bits+=b->endbit;
+309
+310
if(b->endbyte >= b->storage-4){
+311
/* not the main path */
+312
if(b->endbyte > b->storage-((bits+7)>>3)) return -1;
+313
/* special case to avoid reading b->ptr[0], which might be past the end of
+314
the buffer; also skips some useless accounting */
+315
else if(!bits)return(0L);
+316
}
+317
+318
ret=(unsigned long)b->ptr[0]<<(24+b->endbit);
+319
if(bits>8){
+320
ret|=(unsigned long)b->ptr[1]<<(16+b->endbit);
+321
if(bits>16){
+322
ret|=(unsigned long)b->ptr[2]<<(8+b->endbit);
+323
if(bits>24){
+324
ret|=(unsigned long)b->ptr[3]<<(b->endbit);
+325
if(bits>32 && b->endbit)
+326
ret|=b->ptr[4]>>(8-b->endbit);
+327
}
+328
}
+329
}
+330
return ((ret&0xffffffff)>>(m>>1))>>((m+1)>>1);
+331
}
+332
+333
long oggpack_look1(oggpack_buffer *b){
+334
if(b->endbyte>=b->storage)return(-1);
+335
return((b->ptr[0]>>b->endbit)&1);
+336
}
+337
+338
long oggpackB_look1(oggpack_buffer *b){
+339
if(b->endbyte>=b->storage)return(-1);
+340
return((b->ptr[0]>>(7-b->endbit))&1);
+341
}
+342
+343
void oggpack_adv(oggpack_buffer *b,int bits){
+344
bits+=b->endbit;
+345
+346
if(b->endbyte > b->storage-((bits+7)>>3)) goto overflow;
+347
+348
b->ptr+=bits/8;
+349
b->endbyte+=bits/8;
+350
b->endbit=bits&7;
+351
return;
+352
+353
overflow:
+354
b->ptr=NULL;
+355
b->endbyte=b->storage;
+356
b->endbit=1;
+357
}
+358
+359
void oggpackB_adv(oggpack_buffer *b,int bits){
+360
oggpack_adv(b,bits);
+361
}
+362
+363
void oggpack_adv1(oggpack_buffer *b){
+364
if(++(b->endbit)>7){
+365
b->endbit=0;
+366
b->ptr++;
+367
b->endbyte++;
+368
}
+369
}
+370
+371
void oggpackB_adv1(oggpack_buffer *b){
+372
oggpack_adv1(b);
+373
}
+374
+375
/* bits <= 32 */
+376
long oggpack_read(oggpack_buffer *b,int bits){
+377
long ret;
+378
unsigned long m;
+379
+380
if(bits<0 || bits>32) goto err;
+381
m=mask[bits];
+382
bits+=b->endbit;
+383
+384
if(b->endbyte >= b->storage-4){
+385
/* not the main path */
+386
if(b->endbyte > b->storage-((bits+7)>>3)) goto overflow;
+387
/* special case to avoid reading b->ptr[0], which might be past the end of
+388
the buffer; also skips some useless accounting */
+389
else if(!bits)return(0L);
+390
}
+391
+392
ret=b->ptr[0]>>b->endbit;
+393
if(bits>8){
+394
ret|=(unsigned long)b->ptr[1]<<(8-b->endbit);
+395
if(bits>16){
+396
ret|=(unsigned long)b->ptr[2]<<(16-b->endbit);
+397
if(bits>24){
+398
ret|=(unsigned long)b->ptr[3]<<(24-b->endbit);
+399
if(bits>32 && b->endbit){
+400
ret|=(unsigned long)b->ptr[4]<<(32-b->endbit);
+401
}
+402
}
+403
}
+404
}
+405
ret&=m;
+406
b->ptr+=bits/8;
+407
b->endbyte+=bits/8;
+408
b->endbit=bits&7;
+409
return ret;
+410
+411
overflow:
+412
err:
+413
b->ptr=NULL;
+414
b->endbyte=b->storage;
+415
b->endbit=1;
+416
return -1L;
+417
}
+418
+419
/* bits <= 32 */
+420
long oggpackB_read(oggpack_buffer *b,int bits){
+421
long ret;
+422
long m=32-bits;
+423
+424
if(m<0 || m>32) goto err;
+425
bits+=b->endbit;
+426
+427
if(b->endbyte+4>=b->storage){
+428
/* not the main path */
+429
if(b->endbyte > b->storage-((bits+7)>>3)) goto overflow;
+430
/* special case to avoid reading b->ptr[0], which might be past the end of
+431
the buffer; also skips some useless accounting */
+432
else if(!bits)return(0L);
+433
}
+434
+435
ret=(unsigned long)b->ptr[0]<<(24+b->endbit);
+436
if(bits>8){
+437
ret|=(unsigned long)b->ptr[1]<<(16+b->endbit);
+438
if(bits>16){
+439
ret|=(unsigned long)b->ptr[2]<<(8+b->endbit);
+440
if(bits>24){
+441
ret|=(unsigned long)b->ptr[3]<<(b->endbit);
+442
if(bits>32 && b->endbit)
+443
ret|=b->ptr[4]>>(8-b->endbit);
+444
}
+445
}
+446
}
+447
ret=((ret&0xffffffffUL)>>(m>>1))>>((m+1)>>1);
+448
+449
b->ptr+=bits/8;
+450
b->endbyte+=bits/8;
+451
b->endbit=bits&7;
+452
return ret;
+453
+454
overflow:
+455
err:
+456
b->ptr=NULL;
+457
b->endbyte=b->storage;
+458
b->endbit=1;
+459
return -1L;
+460
}
+461
+462
long oggpack_read1(oggpack_buffer *b){
+463
long ret;
+464
+465
if(b->endbyte >= b->storage) goto overflow;
+466
ret=(b->ptr[0]>>b->endbit)&1;
+467
+468
b->endbit++;
+469
if(b->endbit>7){
+470
b->endbit=0;
+471
b->ptr++;
+472
b->endbyte++;
+473
}
+474
return ret;
+475
+476
overflow:
+477
b->ptr=NULL;
+478
b->endbyte=b->storage;
+479
b->endbit=1;
+480
return -1L;
+481
}
+482
+483
long oggpackB_read1(oggpack_buffer *b){
+484
long ret;
+485
+486
if(b->endbyte >= b->storage) goto overflow;
+487
ret=(b->ptr[0]>>(7-b->endbit))&1;
+488
+489
b->endbit++;
+490
if(b->endbit>7){
+491
b->endbit=0;
+492
b->ptr++;
+493
b->endbyte++;
+494
}
+495
return ret;
+496
+497
overflow:
+498
b->ptr=NULL;
+499
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
@@ -0,0 +1,278 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE Ogg CONTAINER SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2018 *
+9
* by the Xiph.Org Foundation http://www.xiph.org/ *
+10
* *
+11
********************************************************************/
+12
+13
#include <ogg/os_types.h>
+14
+15
static const ogg_uint32_t crc_lookup[8][256]={
+16
{0x00000000,0x04c11db7,0x09823b6e,0x0d4326d9,0x130476dc,0x17c56b6b,0x1a864db2,0x1e475005,
+17
0x2608edb8,0x22c9f00f,0x2f8ad6d6,0x2b4bcb61,0x350c9b64,0x31cd86d3,0x3c8ea00a,0x384fbdbd,
+18
0x4c11db70,0x48d0c6c7,0x4593e01e,0x4152fda9,0x5f15adac,0x5bd4b01b,0x569796c2,0x52568b75,
+19
0x6a1936c8,0x6ed82b7f,0x639b0da6,0x675a1011,0x791d4014,0x7ddc5da3,0x709f7b7a,0x745e66cd,
+20
0x9823b6e0,0x9ce2ab57,0x91a18d8e,0x95609039,0x8b27c03c,0x8fe6dd8b,0x82a5fb52,0x8664e6e5,
+21
0xbe2b5b58,0xbaea46ef,0xb7a96036,0xb3687d81,0xad2f2d84,0xa9ee3033,0xa4ad16ea,0xa06c0b5d,
+22
0xd4326d90,0xd0f37027,0xddb056fe,0xd9714b49,0xc7361b4c,0xc3f706fb,0xceb42022,0xca753d95,
+23
0xf23a8028,0xf6fb9d9f,0xfbb8bb46,0xff79a6f1,0xe13ef6f4,0xe5ffeb43,0xe8bccd9a,0xec7dd02d,
+24
0x34867077,0x30476dc0,0x3d044b19,0x39c556ae,0x278206ab,0x23431b1c,0x2e003dc5,0x2ac12072,
+25
0x128e9dcf,0x164f8078,0x1b0ca6a1,0x1fcdbb16,0x018aeb13,0x054bf6a4,0x0808d07d,0x0cc9cdca,
+26
0x7897ab07,0x7c56b6b0,0x71159069,0x75d48dde,0x6b93dddb,0x6f52c06c,0x6211e6b5,0x66d0fb02,
+27
0x5e9f46bf,0x5a5e5b08,0x571d7dd1,0x53dc6066,0x4d9b3063,0x495a2dd4,0x44190b0d,0x40d816ba,
+28
0xaca5c697,0xa864db20,0xa527fdf9,0xa1e6e04e,0xbfa1b04b,0xbb60adfc,0xb6238b25,0xb2e29692,
+29
0x8aad2b2f,0x8e6c3698,0x832f1041,0x87ee0df6,0x99a95df3,0x9d684044,0x902b669d,0x94ea7b2a,
+30
0xe0b41de7,0xe4750050,0xe9362689,0xedf73b3e,0xf3b06b3b,0xf771768c,0xfa325055,0xfef34de2,
+31
0xc6bcf05f,0xc27dede8,0xcf3ecb31,0xcbffd686,0xd5b88683,0xd1799b34,0xdc3abded,0xd8fba05a,
+32
0x690ce0ee,0x6dcdfd59,0x608edb80,0x644fc637,0x7a089632,0x7ec98b85,0x738aad5c,0x774bb0eb,
+33
0x4f040d56,0x4bc510e1,0x46863638,0x42472b8f,0x5c007b8a,0x58c1663d,0x558240e4,0x51435d53,
+34
0x251d3b9e,0x21dc2629,0x2c9f00f0,0x285e1d47,0x36194d42,0x32d850f5,0x3f9b762c,0x3b5a6b9b,
+35
0x0315d626,0x07d4cb91,0x0a97ed48,0x0e56f0ff,0x1011a0fa,0x14d0bd4d,0x19939b94,0x1d528623,
+36
0xf12f560e,0xf5ee4bb9,0xf8ad6d60,0xfc6c70d7,0xe22b20d2,0xe6ea3d65,0xeba91bbc,0xef68060b,
+37
0xd727bbb6,0xd3e6a601,0xdea580d8,0xda649d6f,0xc423cd6a,0xc0e2d0dd,0xcda1f604,0xc960ebb3,
+38
0xbd3e8d7e,0xb9ff90c9,0xb4bcb610,0xb07daba7,0xae3afba2,0xaafbe615,0xa7b8c0cc,0xa379dd7b,
+39
0x9b3660c6,0x9ff77d71,0x92b45ba8,0x9675461f,0x8832161a,0x8cf30bad,0x81b02d74,0x857130c3,
+40
0x5d8a9099,0x594b8d2e,0x5408abf7,0x50c9b640,0x4e8ee645,0x4a4ffbf2,0x470cdd2b,0x43cdc09c,
+41
0x7b827d21,0x7f436096,0x7200464f,0x76c15bf8,0x68860bfd,0x6c47164a,0x61043093,0x65c52d24,
+42
0x119b4be9,0x155a565e,0x18197087,0x1cd86d30,0x029f3d35,0x065e2082,0x0b1d065b,0x0fdc1bec,
+43
0x3793a651,0x3352bbe6,0x3e119d3f,0x3ad08088,0x2497d08d,0x2056cd3a,0x2d15ebe3,0x29d4f654,
+44
0xc5a92679,0xc1683bce,0xcc2b1d17,0xc8ea00a0,0xd6ad50a5,0xd26c4d12,0xdf2f6bcb,0xdbee767c,
+45
0xe3a1cbc1,0xe760d676,0xea23f0af,0xeee2ed18,0xf0a5bd1d,0xf464a0aa,0xf9278673,0xfde69bc4,
+46
0x89b8fd09,0x8d79e0be,0x803ac667,0x84fbdbd0,0x9abc8bd5,0x9e7d9662,0x933eb0bb,0x97ffad0c,
+47
0xafb010b1,0xab710d06,0xa6322bdf,0xa2f33668,0xbcb4666d,0xb8757bda,0xb5365d03,0xb1f740b4},
+48
+49
{0x00000000,0xd219c1dc,0xa0f29e0f,0x72eb5fd3,0x452421a9,0x973de075,0xe5d6bfa6,0x37cf7e7a,
+50
0x8a484352,0x5851828e,0x2abadd5d,0xf8a31c81,0xcf6c62fb,0x1d75a327,0x6f9efcf4,0xbd873d28,
+51
0x10519b13,0xc2485acf,0xb0a3051c,0x62bac4c0,0x5575baba,0x876c7b66,0xf58724b5,0x279ee569,
+52
0x9a19d841,0x4800199d,0x3aeb464e,0xe8f28792,0xdf3df9e8,0x0d243834,0x7fcf67e7,0xadd6a63b,
+53
0x20a33626,0xf2baf7fa,0x8051a829,0x524869f5,0x6587178f,0xb79ed653,0xc5758980,0x176c485c,
+54
0xaaeb7574,0x78f2b4a8,0x0a19eb7b,0xd8002aa7,0xefcf54dd,0x3dd69501,0x4f3dcad2,0x9d240b0e,
+55
0x30f2ad35,0xe2eb6ce9,0x9000333a,0x4219f2e6,0x75d68c9c,0xa7cf4d40,0xd5241293,0x073dd34f,
+56
0xbabaee67,0x68a32fbb,0x1a487068,0xc851b1b4,0xff9ecfce,0x2d870e12,0x5f6c51c1,0x8d75901d,
+57
0x41466c4c,0x935fad90,0xe1b4f243,0x33ad339f,0x04624de5,0xd67b8c39,0xa490d3ea,0x76891236,
+58
0xcb0e2f1e,0x1917eec2,0x6bfcb111,0xb9e570cd,0x8e2a0eb7,0x5c33cf6b,0x2ed890b8,0xfcc15164,
+59
0x5117f75f,0x830e3683,0xf1e56950,0x23fca88c,0x1433d6f6,0xc62a172a,0xb4c148f9,0x66d88925,
+60
0xdb5fb40d,0x094675d1,0x7bad2a02,0xa9b4ebde,0x9e7b95a4,0x4c625478,0x3e890bab,0xec90ca77,
+61
0x61e55a6a,0xb3fc9bb6,0xc117c465,0x130e05b9,0x24c17bc3,0xf6d8ba1f,0x8433e5cc,0x562a2410,
+62
0xebad1938,0x39b4d8e4,0x4b5f8737,0x994646eb,0xae893891,0x7c90f94d,0x0e7ba69e,0xdc626742,
+63
0x71b4c179,0xa3ad00a5,0xd1465f76,0x035f9eaa,0x3490e0d0,0xe689210c,0x94627edf,0x467bbf03,
+64
0xfbfc822b,0x29e543f7,0x5b0e1c24,0x8917ddf8,0xbed8a382,0x6cc1625e,0x1e2a3d8d,0xcc33fc51,
+65
0x828cd898,0x50951944,0x227e4697,0xf067874b,0xc7a8f931,0x15b138ed,0x675a673e,0xb543a6e2,
+66
0x08c49bca,0xdadd5a16,0xa83605c5,0x7a2fc419,0x4de0ba63,0x9ff97bbf,0xed12246c,0x3f0be5b0,
+67
0x92dd438b,0x40c48257,0x322fdd84,0xe0361c58,0xd7f96222,0x05e0a3fe,0x770bfc2d,0xa5123df1,
+68
0x189500d9,0xca8cc105,0xb8679ed6,0x6a7e5f0a,0x5db12170,0x8fa8e0ac,0xfd43bf7f,0x2f5a7ea3,
+69
0xa22feebe,0x70362f62,0x02dd70b1,0xd0c4b16d,0xe70bcf17,0x35120ecb,0x47f95118,0x95e090c4,
+70
0x2867adec,0xfa7e6c30,0x889533e3,0x5a8cf23f,0x6d438c45,0xbf5a4d99,0xcdb1124a,0x1fa8d396,
+71
0xb27e75ad,0x6067b471,0x128ceba2,0xc0952a7e,0xf75a5404,0x254395d8,0x57a8ca0b,0x85b10bd7,
+72
0x383636ff,0xea2ff723,0x98c4a8f0,0x4add692c,0x7d121756,0xaf0bd68a,0xdde08959,0x0ff94885,
+73
0xc3cab4d4,0x11d37508,0x63382adb,0xb121eb07,0x86ee957d,0x54f754a1,0x261c0b72,0xf405caae,
+74
0x4982f786,0x9b9b365a,0xe9706989,0x3b69a855,0x0ca6d62f,0xdebf17f3,0xac544820,0x7e4d89fc,
+75
0xd39b2fc7,0x0182ee1b,0x7369b1c8,0xa1707014,0x96bf0e6e,0x44a6cfb2,0x364d9061,0xe45451bd,
+76
0x59d36c95,0x8bcaad49,0xf921f29a,0x2b383346,0x1cf74d3c,0xceee8ce0,0xbc05d333,0x6e1c12ef,
+77
0xe36982f2,0x3170432e,0x439b1cfd,0x9182dd21,0xa64da35b,0x74546287,0x06bf3d54,0xd4a6fc88,
+78
0x6921c1a0,0xbb38007c,0xc9d35faf,0x1bca9e73,0x2c05e009,0xfe1c21d5,0x8cf77e06,0x5eeebfda,
+79
0xf33819e1,0x2121d83d,0x53ca87ee,0x81d34632,0xb61c3848,0x6405f994,0x16eea647,0xc4f7679b,
+80
0x79705ab3,0xab699b6f,0xd982c4bc,0x0b9b0560,0x3c547b1a,0xee4dbac6,0x9ca6e515,0x4ebf24c9},
+81
+82
{0x00000000,0x01d8ac87,0x03b1590e,0x0269f589,0x0762b21c,0x06ba1e9b,0x04d3eb12,0x050b4795,
+83
0x0ec56438,0x0f1dc8bf,0x0d743d36,0x0cac91b1,0x09a7d624,0x087f7aa3,0x0a168f2a,0x0bce23ad,
+84
0x1d8ac870,0x1c5264f7,0x1e3b917e,0x1fe33df9,0x1ae87a6c,0x1b30d6eb,0x19592362,0x18818fe5,
+85
0x134fac48,0x129700cf,0x10fef546,0x112659c1,0x142d1e54,0x15f5b2d3,0x179c475a,0x1644ebdd,
+86
0x3b1590e0,0x3acd3c67,0x38a4c9ee,0x397c6569,0x3c7722fc,0x3daf8e7b,0x3fc67bf2,0x3e1ed775,
+87
0x35d0f4d8,0x3408585f,0x3661add6,0x37b90151,0x32b246c4,0x336aea43,0x31031fca,0x30dbb34d,
+88
0x269f5890,0x2747f417,0x252e019e,0x24f6ad19,0x21fdea8c,0x2025460b,0x224cb382,0x23941f05,
+89
0x285a3ca8,0x2982902f,0x2beb65a6,0x2a33c921,0x2f388eb4,0x2ee02233,0x2c89d7ba,0x2d517b3d,
+90
0x762b21c0,0x77f38d47,0x759a78ce,0x7442d449,0x714993dc,0x70913f5b,0x72f8cad2,0x73206655,
+91
0x78ee45f8,0x7936e97f,0x7b5f1cf6,0x7a87b071,0x7f8cf7e4,0x7e545b63,0x7c3daeea,0x7de5026d,
+92
0x6ba1e9b0,0x6a794537,0x6810b0be,0x69c81c39,0x6cc35bac,0x6d1bf72b,0x6f7202a2,0x6eaaae25,
+93
0x65648d88,0x64bc210f,0x66d5d486,0x670d7801,0x62063f94,0x63de9313,0x61b7669a,0x606fca1d,
+94
0x4d3eb120,0x4ce61da7,0x4e8fe82e,0x4f5744a9,0x4a5c033c,0x4b84afbb,0x49ed5a32,0x4835f6b5,
+95
0x43fbd518,0x4223799f,0x404a8c16,0x41922091,0x44996704,0x4541cb83,0x47283e0a,0x46f0928d,
+96
0x50b47950,0x516cd5d7,0x5305205e,0x52dd8cd9,0x57d6cb4c,0x560e67cb,0x54679242,0x55bf3ec5,
+97
0x5e711d68,0x5fa9b1ef,0x5dc04466,0x5c18e8e1,0x5913af74,0x58cb03f3,0x5aa2f67a,0x5b7a5afd,
+98
0xec564380,0xed8eef07,0xefe71a8e,0xee3fb609,0xeb34f19c,0xeaec5d1b,0xe885a892,0xe95d0415,
+99
0xe29327b8,0xe34b8b3f,0xe1227eb6,0xe0fad231,0xe5f195a4,0xe4293923,0xe640ccaa,0xe798602d,
+100
0xf1dc8bf0,0xf0042777,0xf26dd2fe,0xf3b57e79,0xf6be39ec,0xf766956b,0xf50f60e2,0xf4d7cc65,
+101
0xff19efc8,0xfec1434f,0xfca8b6c6,0xfd701a41,0xf87b5dd4,0xf9a3f153,0xfbca04da,0xfa12a85d,
+102
0xd743d360,0xd69b7fe7,0xd4f28a6e,0xd52a26e9,0xd021617c,0xd1f9cdfb,0xd3903872,0xd24894f5,
+103
0xd986b758,0xd85e1bdf,0xda37ee56,0xdbef42d1,0xdee40544,0xdf3ca9c3,0xdd555c4a,0xdc8df0cd,
+104
0xcac91b10,0xcb11b797,0xc978421e,0xc8a0ee99,0xcdaba90c,0xcc73058b,0xce1af002,0xcfc25c85,
+105
0xc40c7f28,0xc5d4d3af,0xc7bd2626,0xc6658aa1,0xc36ecd34,0xc2b661b3,0xc0df943a,0xc10738bd,
+106
0x9a7d6240,0x9ba5cec7,0x99cc3b4e,0x981497c9,0x9d1fd05c,0x9cc77cdb,0x9eae8952,0x9f7625d5,
+107
0x94b80678,0x9560aaff,0x97095f76,0x96d1f3f1,0x93dab464,0x920218e3,0x906bed6a,0x91b341ed,
+108
0x87f7aa30,0x862f06b7,0x8446f33e,0x859e5fb9,0x8095182c,0x814db4ab,0x83244122,0x82fceda5,
+109
0x8932ce08,0x88ea628f,0x8a839706,0x8b5b3b81,0x8e507c14,0x8f88d093,0x8de1251a,0x8c39899d,
+110
0xa168f2a0,0xa0b05e27,0xa2d9abae,0xa3010729,0xa60a40bc,0xa7d2ec3b,0xa5bb19b2,0xa463b535,
+111
0xafad9698,0xae753a1f,0xac1ccf96,0xadc46311,0xa8cf2484,0xa9178803,0xab7e7d8a,0xaaa6d10d,
+112
0xbce23ad0,0xbd3a9657,0xbf5363de,0xbe8bcf59,0xbb8088cc,0xba58244b,0xb831d1c2,0xb9e97d45,
+113
0xb2275ee8,0xb3fff26f,0xb19607e6,0xb04eab61,0xb545ecf4,0xb49d4073,0xb6f4b5fa,0xb72c197d},
+114
+115
{0x00000000,0xdc6d9ab7,0xbc1a28d9,0x6077b26e,0x7cf54c05,0xa098d6b2,0xc0ef64dc,0x1c82fe6b,
+116
0xf9ea980a,0x258702bd,0x45f0b0d3,0x999d2a64,0x851fd40f,0x59724eb8,0x3905fcd6,0xe5686661,
+117
0xf7142da3,0x2b79b714,0x4b0e057a,0x97639fcd,0x8be161a6,0x578cfb11,0x37fb497f,0xeb96d3c8,
+118
0x0efeb5a9,0xd2932f1e,0xb2e49d70,0x6e8907c7,0x720bf9ac,0xae66631b,0xce11d175,0x127c4bc2,
+119
0xeae946f1,0x3684dc46,0x56f36e28,0x8a9ef49f,0x961c0af4,0x4a719043,0x2a06222d,0xf66bb89a,
+120
0x1303defb,0xcf6e444c,0xaf19f622,0x73746c95,0x6ff692fe,0xb39b0849,0xd3ecba27,0x0f812090,
+121
0x1dfd6b52,0xc190f1e5,0xa1e7438b,0x7d8ad93c,0x61082757,0xbd65bde0,0xdd120f8e,0x017f9539,
+122
0xe417f358,0x387a69ef,0x580ddb81,0x84604136,0x98e2bf5d,0x448f25ea,0x24f89784,0xf8950d33,
+123
0xd1139055,0x0d7e0ae2,0x6d09b88c,0xb164223b,0xade6dc50,0x718b46e7,0x11fcf489,0xcd916e3e,
+124
0x28f9085f,0xf49492e8,0x94e32086,0x488eba31,0x540c445a,0x8861deed,0xe8166c83,0x347bf634,
+125
0x2607bdf6,0xfa6a2741,0x9a1d952f,0x46700f98,0x5af2f1f3,0x869f6b44,0xe6e8d92a,0x3a85439d,
+126
0xdfed25fc,0x0380bf4b,0x63f70d25,0xbf9a9792,0xa31869f9,0x7f75f34e,0x1f024120,0xc36fdb97,
+127
0x3bfad6a4,0xe7974c13,0x87e0fe7d,0x5b8d64ca,0x470f9aa1,0x9b620016,0xfb15b278,0x277828cf,
+128
0xc2104eae,0x1e7dd419,0x7e0a6677,0xa267fcc0,0xbee502ab,0x6288981c,0x02ff2a72,0xde92b0c5,
+129
0xcceefb07,0x108361b0,0x70f4d3de,0xac994969,0xb01bb702,0x6c762db5,0x0c019fdb,0xd06c056c,
+130
0x3504630d,0xe969f9ba,0x891e4bd4,0x5573d163,0x49f12f08,0x959cb5bf,0xf5eb07d1,0x29869d66,
+131
0xa6e63d1d,0x7a8ba7aa,0x1afc15c4,0xc6918f73,0xda137118,0x067eebaf,0x660959c1,0xba64c376,
+132
0x5f0ca517,0x83613fa0,0xe3168dce,0x3f7b1779,0x23f9e912,0xff9473a5,0x9fe3c1cb,0x438e5b7c,
+133
0x51f210be,0x8d9f8a09,0xede83867,0x3185a2d0,0x2d075cbb,0xf16ac60c,0x911d7462,0x4d70eed5,
+134
0xa81888b4,0x74751203,0x1402a06d,0xc86f3ada,0xd4edc4b1,0x08805e06,0x68f7ec68,0xb49a76df,
+135
0x4c0f7bec,0x9062e15b,0xf0155335,0x2c78c982,0x30fa37e9,0xec97ad5e,0x8ce01f30,0x508d8587,
+136
0xb5e5e3e6,0x69887951,0x09ffcb3f,0xd5925188,0xc910afe3,0x157d3554,0x750a873a,0xa9671d8d,
+137
0xbb1b564f,0x6776ccf8,0x07017e96,0xdb6ce421,0xc7ee1a4a,0x1b8380fd,0x7bf43293,0xa799a824,
+138
0x42f1ce45,0x9e9c54f2,0xfeebe69c,0x22867c2b,0x3e048240,0xe26918f7,0x821eaa99,0x5e73302e,
+139
0x77f5ad48,0xab9837ff,0xcbef8591,0x17821f26,0x0b00e14d,0xd76d7bfa,0xb71ac994,0x6b775323,
+140
0x8e1f3542,0x5272aff5,0x32051d9b,0xee68872c,0xf2ea7947,0x2e87e3f0,0x4ef0519e,0x929dcb29,
+141
0x80e180eb,0x5c8c1a5c,0x3cfba832,0xe0963285,0xfc14ccee,0x20795659,0x400ee437,0x9c637e80,
+142
0x790b18e1,0xa5668256,0xc5113038,0x197caa8f,0x05fe54e4,0xd993ce53,0xb9e47c3d,0x6589e68a,
+143
0x9d1cebb9,0x4171710e,0x2106c360,0xfd6b59d7,0xe1e9a7bc,0x3d843d0b,0x5df38f65,0x819e15d2,
+144
0x64f673b3,0xb89be904,0xd8ec5b6a,0x0481c1dd,0x18033fb6,0xc46ea501,0xa419176f,0x78748dd8,
+145
0x6a08c61a,0xb6655cad,0xd612eec3,0x0a7f7474,0x16fd8a1f,0xca9010a8,0xaae7a2c6,0x768a3871,
+146
0x93e25e10,0x4f8fc4a7,0x2ff876c9,0xf395ec7e,0xef171215,0x337a88a2,0x530d3acc,0x8f60a07b},
+147
+148
{0x00000000,0x490d678d,0x921acf1a,0xdb17a897,0x20f48383,0x69f9e40e,0xb2ee4c99,0xfbe32b14,
+149
0x41e90706,0x08e4608b,0xd3f3c81c,0x9afeaf91,0x611d8485,0x2810e308,0xf3074b9f,0xba0a2c12,
+150
0x83d20e0c,0xcadf6981,0x11c8c116,0x58c5a69b,0xa3268d8f,0xea2bea02,0x313c4295,0x78312518,
+151
0xc23b090a,0x8b366e87,0x5021c610,0x192ca19d,0xe2cf8a89,0xabc2ed04,0x70d54593,0x39d8221e,
+152
0x036501af,0x4a686622,0x917fceb5,0xd872a938,0x2391822c,0x6a9ce5a1,0xb18b4d36,0xf8862abb,
+153
0x428c06a9,0x0b816124,0xd096c9b3,0x999bae3e,0x6278852a,0x2b75e2a7,0xf0624a30,0xb96f2dbd,
+154
0x80b70fa3,0xc9ba682e,0x12adc0b9,0x5ba0a734,0xa0438c20,0xe94eebad,0x3259433a,0x7b5424b7,
+155
0xc15e08a5,0x88536f28,0x5344c7bf,0x1a49a032,0xe1aa8b26,0xa8a7ecab,0x73b0443c,0x3abd23b1,
+156
0x06ca035e,0x4fc764d3,0x94d0cc44,0xddddabc9,0x263e80dd,0x6f33e750,0xb4244fc7,0xfd29284a,
+157
0x47230458,0x0e2e63d5,0xd539cb42,0x9c34accf,0x67d787db,0x2edae056,0xf5cd48c1,0xbcc02f4c,
+158
0x85180d52,0xcc156adf,0x1702c248,0x5e0fa5c5,0xa5ec8ed1,0xece1e95c,0x37f641cb,0x7efb2646,
+159
0xc4f10a54,0x8dfc6dd9,0x56ebc54e,0x1fe6a2c3,0xe40589d7,0xad08ee5a,0x761f46cd,0x3f122140,
+160
0x05af02f1,0x4ca2657c,0x97b5cdeb,0xdeb8aa66,0x255b8172,0x6c56e6ff,0xb7414e68,0xfe4c29e5,
+161
0x444605f7,0x0d4b627a,0xd65ccaed,0x9f51ad60,0x64b28674,0x2dbfe1f9,0xf6a8496e,0xbfa52ee3,
+162
0x867d0cfd,0xcf706b70,0x1467c3e7,0x5d6aa46a,0xa6898f7e,0xef84e8f3,0x34934064,0x7d9e27e9,
+163
0xc7940bfb,0x8e996c76,0x558ec4e1,0x1c83a36c,0xe7608878,0xae6deff5,0x757a4762,0x3c7720ef,
+164
0x0d9406bc,0x44996131,0x9f8ec9a6,0xd683ae2b,0x2d60853f,0x646de2b2,0xbf7a4a25,0xf6772da8,
+165
0x4c7d01ba,0x05706637,0xde67cea0,0x976aa92d,0x6c898239,0x2584e5b4,0xfe934d23,0xb79e2aae,
+166
0x8e4608b0,0xc74b6f3d,0x1c5cc7aa,0x5551a027,0xaeb28b33,0xe7bfecbe,0x3ca84429,0x75a523a4,
+167
0xcfaf0fb6,0x86a2683b,0x5db5c0ac,0x14b8a721,0xef5b8c35,0xa656ebb8,0x7d41432f,0x344c24a2,
+168
0x0ef10713,0x47fc609e,0x9cebc809,0xd5e6af84,0x2e058490,0x6708e31d,0xbc1f4b8a,0xf5122c07,
+169
0x4f180015,0x06156798,0xdd02cf0f,0x940fa882,0x6fec8396,0x26e1e41b,0xfdf64c8c,0xb4fb2b01,
+170
0x8d23091f,0xc42e6e92,0x1f39c605,0x5634a188,0xadd78a9c,0xe4daed11,0x3fcd4586,0x76c0220b,
+171
0xccca0e19,0x85c76994,0x5ed0c103,0x17dda68e,0xec3e8d9a,0xa533ea17,0x7e244280,0x3729250d,
+172
0x0b5e05e2,0x4253626f,0x9944caf8,0xd049ad75,0x2baa8661,0x62a7e1ec,0xb9b0497b,0xf0bd2ef6,
+173
0x4ab702e4,0x03ba6569,0xd8adcdfe,0x91a0aa73,0x6a438167,0x234ee6ea,0xf8594e7d,0xb15429f0,
+174
0x888c0bee,0xc1816c63,0x1a96c4f4,0x539ba379,0xa878886d,0xe175efe0,0x3a624777,0x736f20fa,
+175
0xc9650ce8,0x80686b65,0x5b7fc3f2,0x1272a47f,0xe9918f6b,0xa09ce8e6,0x7b8b4071,0x328627fc,
+176
0x083b044d,0x413663c0,0x9a21cb57,0xd32cacda,0x28cf87ce,0x61c2e043,0xbad548d4,0xf3d82f59,
+177
0x49d2034b,0x00df64c6,0xdbc8cc51,0x92c5abdc,0x692680c8,0x202be745,0xfb3c4fd2,0xb231285f,
+178
0x8be90a41,0xc2e46dcc,0x19f3c55b,0x50fea2d6,0xab1d89c2,0xe210ee4f,0x390746d8,0x700a2155,
+179
0xca000d47,0x830d6aca,0x581ac25d,0x1117a5d0,0xeaf48ec4,0xa3f9e949,0x78ee41de,0x31e32653},
+180
+181
{0x00000000,0x1b280d78,0x36501af0,0x2d781788,0x6ca035e0,0x77883898,0x5af02f10,0x41d82268,
+182
0xd9406bc0,0xc26866b8,0xef107130,0xf4387c48,0xb5e05e20,0xaec85358,0x83b044d0,0x989849a8,
+183
0xb641ca37,0xad69c74f,0x8011d0c7,0x9b39ddbf,0xdae1ffd7,0xc1c9f2af,0xecb1e527,0xf799e85f,
+184
0x6f01a1f7,0x7429ac8f,0x5951bb07,0x4279b67f,0x03a19417,0x1889996f,0x35f18ee7,0x2ed9839f,
+185
0x684289d9,0x736a84a1,0x5e129329,0x453a9e51,0x04e2bc39,0x1fcab141,0x32b2a6c9,0x299aabb1,
+186
0xb102e219,0xaa2aef61,0x8752f8e9,0x9c7af591,0xdda2d7f9,0xc68ada81,0xebf2cd09,0xf0dac071,
+187
0xde0343ee,0xc52b4e96,0xe853591e,0xf37b5466,0xb2a3760e,0xa98b7b76,0x84f36cfe,0x9fdb6186,
+188
0x0743282e,0x1c6b2556,0x311332de,0x2a3b3fa6,0x6be31dce,0x70cb10b6,0x5db3073e,0x469b0a46,
+189
0xd08513b2,0xcbad1eca,0xe6d50942,0xfdfd043a,0xbc252652,0xa70d2b2a,0x8a753ca2,0x915d31da,
+190
0x09c57872,0x12ed750a,0x3f956282,0x24bd6ffa,0x65654d92,0x7e4d40ea,0x53355762,0x481d5a1a,
+191
0x66c4d985,0x7decd4fd,0x5094c375,0x4bbcce0d,0x0a64ec65,0x114ce11d,0x3c34f695,0x271cfbed,
+192
0xbf84b245,0xa4acbf3d,0x89d4a8b5,0x92fca5cd,0xd32487a5,0xc80c8add,0xe5749d55,0xfe5c902d,
+193
0xb8c79a6b,0xa3ef9713,0x8e97809b,0x95bf8de3,0xd467af8b,0xcf4fa2f3,0xe237b57b,0xf91fb803,
+194
0x6187f1ab,0x7aaffcd3,0x57d7eb5b,0x4cffe623,0x0d27c44b,0x160fc933,0x3b77debb,0x205fd3c3,
+195
0x0e86505c,0x15ae5d24,0x38d64aac,0x23fe47d4,0x622665bc,0x790e68c4,0x54767f4c,0x4f5e7234,
+196
0xd7c63b9c,0xccee36e4,0xe196216c,0xfabe2c14,0xbb660e7c,0xa04e0304,0x8d36148c,0x961e19f4,
+197
0xa5cb3ad3,0xbee337ab,0x939b2023,0x88b32d5b,0xc96b0f33,0xd243024b,0xff3b15c3,0xe41318bb,
+198
0x7c8b5113,0x67a35c6b,0x4adb4be3,0x51f3469b,0x102b64f3,0x0b03698b,0x267b7e03,0x3d53737b,
+199
0x138af0e4,0x08a2fd9c,0x25daea14,0x3ef2e76c,0x7f2ac504,0x6402c87c,0x497adff4,0x5252d28c,
+200
0xcaca9b24,0xd1e2965c,0xfc9a81d4,0xe7b28cac,0xa66aaec4,0xbd42a3bc,0x903ab434,0x8b12b94c,
+201
0xcd89b30a,0xd6a1be72,0xfbd9a9fa,0xe0f1a482,0xa12986ea,0xba018b92,0x97799c1a,0x8c519162,
+202
0x14c9d8ca,0x0fe1d5b2,0x2299c23a,0x39b1cf42,0x7869ed2a,0x6341e052,0x4e39f7da,0x5511faa2,
+203
0x7bc8793d,0x60e07445,0x4d9863cd,0x56b06eb5,0x17684cdd,0x0c4041a5,0x2138562d,0x3a105b55,
+204
0xa28812fd,0xb9a01f85,0x94d8080d,0x8ff00575,0xce28271d,0xd5002a65,0xf8783ded,0xe3503095,
+205
0x754e2961,0x6e662419,0x431e3391,0x58363ee9,0x19ee1c81,0x02c611f9,0x2fbe0671,0x34960b09,
+206
0xac0e42a1,0xb7264fd9,0x9a5e5851,0x81765529,0xc0ae7741,0xdb867a39,0xf6fe6db1,0xedd660c9,
+207
0xc30fe356,0xd827ee2e,0xf55ff9a6,0xee77f4de,0xafafd6b6,0xb487dbce,0x99ffcc46,0x82d7c13e,
+208
0x1a4f8896,0x016785ee,0x2c1f9266,0x37379f1e,0x76efbd76,0x6dc7b00e,0x40bfa786,0x5b97aafe,
+209
0x1d0ca0b8,0x0624adc0,0x2b5cba48,0x3074b730,0x71ac9558,0x6a849820,0x47fc8fa8,0x5cd482d0,
+210
0xc44ccb78,0xdf64c600,0xf21cd188,0xe934dcf0,0xa8ecfe98,0xb3c4f3e0,0x9ebce468,0x8594e910,
+211
0xab4d6a8f,0xb06567f7,0x9d1d707f,0x86357d07,0xc7ed5f6f,0xdcc55217,0xf1bd459f,0xea9548e7,
+212
0x720d014f,0x69250c37,0x445d1bbf,0x5f7516c7,0x1ead34af,0x058539d7,0x28fd2e5f,0x33d52327},
+213
+214
{0x00000000,0x4f576811,0x9eaed022,0xd1f9b833,0x399cbdf3,0x76cbd5e2,0xa7326dd1,0xe86505c0,
+215
0x73397be6,0x3c6e13f7,0xed97abc4,0xa2c0c3d5,0x4aa5c615,0x05f2ae04,0xd40b1637,0x9b5c7e26,
+216
0xe672f7cc,0xa9259fdd,0x78dc27ee,0x378b4fff,0xdfee4a3f,0x90b9222e,0x41409a1d,0x0e17f20c,
+217
0x954b8c2a,0xda1ce43b,0x0be55c08,0x44b23419,0xacd731d9,0xe38059c8,0x3279e1fb,0x7d2e89ea,
+218
0xc824f22f,0x87739a3e,0x568a220d,0x19dd4a1c,0xf1b84fdc,0xbeef27cd,0x6f169ffe,0x2041f7ef,
+219
0xbb1d89c9,0xf44ae1d8,0x25b359eb,0x6ae431fa,0x8281343a,0xcdd65c2b,0x1c2fe418,0x53788c09,
+220
0x2e5605e3,0x61016df2,0xb0f8d5c1,0xffafbdd0,0x17cab810,0x589dd001,0x89646832,0xc6330023,
+221
0x5d6f7e05,0x12381614,0xc3c1ae27,0x8c96c636,0x64f3c3f6,0x2ba4abe7,0xfa5d13d4,0xb50a7bc5,
+222
0x9488f9e9,0xdbdf91f8,0x0a2629cb,0x457141da,0xad14441a,0xe2432c0b,0x33ba9438,0x7cedfc29,
+223
0xe7b1820f,0xa8e6ea1e,0x791f522d,0x36483a3c,0xde2d3ffc,0x917a57ed,0x4083efde,0x0fd487cf,
+224
0x72fa0e25,0x3dad6634,0xec54de07,0xa303b616,0x4b66b3d6,0x0431dbc7,0xd5c863f4,0x9a9f0be5,
+225
0x01c375c3,0x4e941dd2,0x9f6da5e1,0xd03acdf0,0x385fc830,0x7708a021,0xa6f11812,0xe9a67003,
+226
0x5cac0bc6,0x13fb63d7,0xc202dbe4,0x8d55b3f5,0x6530b635,0x2a67de24,0xfb9e6617,0xb4c90e06,
+227
0x2f957020,0x60c21831,0xb13ba002,0xfe6cc813,0x1609cdd3,0x595ea5c2,0x88a71df1,0xc7f075e0,
+228
0xbadefc0a,0xf589941b,0x24702c28,0x6b274439,0x834241f9,0xcc1529e8,0x1dec91db,0x52bbf9ca,
+229
0xc9e787ec,0x86b0effd,0x574957ce,0x181e3fdf,0xf07b3a1f,0xbf2c520e,0x6ed5ea3d,0x2182822c,
+230
0x2dd0ee65,0x62878674,0xb37e3e47,0xfc295656,0x144c5396,0x5b1b3b87,0x8ae283b4,0xc5b5eba5,
+231
0x5ee99583,0x11befd92,0xc04745a1,0x8f102db0,0x67752870,0x28224061,0xf9dbf852,0xb68c9043,
+232
0xcba219a9,0x84f571b8,0x550cc98b,0x1a5ba19a,0xf23ea45a,0xbd69cc4b,0x6c907478,0x23c71c69,
+233
0xb89b624f,0xf7cc0a5e,0x2635b26d,0x6962da7c,0x8107dfbc,0xce50b7ad,0x1fa90f9e,0x50fe678f,
+234
0xe5f41c4a,0xaaa3745b,0x7b5acc68,0x340da479,0xdc68a1b9,0x933fc9a8,0x42c6719b,0x0d91198a,
+235
0x96cd67ac,0xd99a0fbd,0x0863b78e,0x4734df9f,0xaf51da5f,0xe006b24e,0x31ff0a7d,0x7ea8626c,
+236
0x0386eb86,0x4cd18397,0x9d283ba4,0xd27f53b5,0x3a1a5675,0x754d3e64,0xa4b48657,0xebe3ee46,
+237
0x70bf9060,0x3fe8f871,0xee114042,0xa1462853,0x49232d93,0x06744582,0xd78dfdb1,0x98da95a0,
+238
0xb958178c,0xf60f7f9d,0x27f6c7ae,0x68a1afbf,0x80c4aa7f,0xcf93c26e,0x1e6a7a5d,0x513d124c,
+239
0xca616c6a,0x8536047b,0x54cfbc48,0x1b98d459,0xf3fdd199,0xbcaab988,0x6d5301bb,0x220469aa,
+240
0x5f2ae040,0x107d8851,0xc1843062,0x8ed35873,0x66b65db3,0x29e135a2,0xf8188d91,0xb74fe580,
+241
0x2c139ba6,0x6344f3b7,0xb2bd4b84,0xfdea2395,0x158f2655,0x5ad84e44,0x8b21f677,0xc4769e66,
+242
0x717ce5a3,0x3e2b8db2,0xefd23581,0xa0855d90,0x48e05850,0x07b73041,0xd64e8872,0x9919e063,
+243
0x02459e45,0x4d12f654,0x9ceb4e67,0xd3bc2676,0x3bd923b6,0x748e4ba7,0xa577f394,0xea209b85,
+244
0x970e126f,0xd8597a7e,0x09a0c24d,0x46f7aa5c,0xae92af9c,0xe1c5c78d,0x303c7fbe,0x7f6b17af,
+245
0xe4376989,0xab600198,0x7a99b9ab,0x35ced1ba,0xddabd47a,0x92fcbc6b,0x43050458,0x0c526c49},
+246
+247
{0x00000000,0x5ba1dcca,0xb743b994,0xece2655e,0x6a466e9f,0x31e7b255,0xdd05d70b,0x86a40bc1,
+248
0xd48cdd3e,0x8f2d01f4,0x63cf64aa,0x386eb860,0xbecab3a1,0xe56b6f6b,0x09890a35,0x5228d6ff,
+249
0xadd8a7cb,0xf6797b01,0x1a9b1e5f,0x413ac295,0xc79ec954,0x9c3f159e,0x70dd70c0,0x2b7cac0a,
+250
0x79547af5,0x22f5a63f,0xce17c361,0x95b61fab,0x1312146a,0x48b3c8a0,0xa451adfe,0xfff07134,
+251
0x5f705221,0x04d18eeb,0xe833ebb5,0xb392377f,0x35363cbe,0x6e97e074,0x8275852a,0xd9d459e0,
+252
0x8bfc8f1f,0xd05d53d5,0x3cbf368b,0x671eea41,0xe1bae180,0xba1b3d4a,0x56f95814,0x0d5884de,
+253
0xf2a8f5ea,0xa9092920,0x45eb4c7e,0x1e4a90b4,0x98ee9b75,0xc34f47bf,0x2fad22e1,0x740cfe2b,
+254
0x262428d4,0x7d85f41e,0x91679140,0xcac64d8a,0x4c62464b,0x17c39a81,0xfb21ffdf,0xa0802315,
+255
0xbee0a442,0xe5417888,0x09a31dd6,0x5202c11c,0xd4a6cadd,0x8f071617,0x63e57349,0x3844af83,
+256
0x6a6c797c,0x31cda5b6,0xdd2fc0e8,0x868e1c22,0x002a17e3,0x5b8bcb29,0xb769ae77,0xecc872bd,
+257
0x13380389,0x4899df43,0xa47bba1d,0xffda66d7,0x797e6d16,0x22dfb1dc,0xce3dd482,0x959c0848,
+258
0xc7b4deb7,0x9c15027d,0x70f76723,0x2b56bbe9,0xadf2b028,0xf6536ce2,0x1ab109bc,0x4110d576,
+259
0xe190f663,0xba312aa9,0x56d34ff7,0x0d72933d,0x8bd698fc,0xd0774436,0x3c952168,0x6734fda2,
+260
0x351c2b5d,0x6ebdf797,0x825f92c9,0xd9fe4e03,0x5f5a45c2,0x04fb9908,0xe819fc56,0xb3b8209c,
+261
0x4c4851a8,0x17e98d62,0xfb0be83c,0xa0aa34f6,0x260e3f37,0x7dafe3fd,0x914d86a3,0xcaec5a69,
+262
0x98c48c96,0xc365505c,0x2f873502,0x7426e9c8,0xf282e209,0xa9233ec3,0x45c15b9d,0x1e608757,
+263
0x79005533,0x22a189f9,0xce43eca7,0x95e2306d,0x13463bac,0x48e7e766,0xa4058238,0xffa45ef2,
+264
0xad8c880d,0xf62d54c7,0x1acf3199,0x416eed53,0xc7cae692,0x9c6b3a58,0x70895f06,0x2b2883cc,
+265
0xd4d8f2f8,0x8f792e32,0x639b4b6c,0x383a97a6,0xbe9e9c67,0xe53f40ad,0x09dd25f3,0x527cf939,
+266
0x00542fc6,0x5bf5f30c,0xb7179652,0xecb64a98,0x6a124159,0x31b39d93,0xdd51f8cd,0x86f02407,
+267
0x26700712,0x7dd1dbd8,0x9133be86,0xca92624c,0x4c36698d,0x1797b547,0xfb75d019,0xa0d40cd3,
+268
0xf2fcda2c,0xa95d06e6,0x45bf63b8,0x1e1ebf72,0x98bab4b3,0xc31b6879,0x2ff90d27,0x7458d1ed,
+269
0x8ba8a0d9,0xd0097c13,0x3ceb194d,0x674ac587,0xe1eece46,0xba4f128c,0x56ad77d2,0x0d0cab18,
+270
0x5f247de7,0x0485a12d,0xe867c473,0xb3c618b9,0x35621378,0x6ec3cfb2,0x8221aaec,0xd9807626,
+271
0xc7e0f171,0x9c412dbb,0x70a348e5,0x2b02942f,0xada69fee,0xf6074324,0x1ae5267a,0x4144fab0,
+272
0x136c2c4f,0x48cdf085,0xa42f95db,0xff8e4911,0x792a42d0,0x228b9e1a,0xce69fb44,0x95c8278e,
+273
0x6a3856ba,0x31998a70,0xdd7bef2e,0x86da33e4,0x007e3825,0x5bdfe4ef,0xb73d81b1,0xec9c5d7b,
+274
0xbeb48b84,0xe515574e,0x09f73210,0x5256eeda,0xd4f2e51b,0x8f5339d1,0x63b15c8f,0x38108045,
+275
0x9890a350,0xc3317f9a,0x2fd31ac4,0x7472c60e,0xf2d6cdcf,0xa9771105,0x4595745b,0x1e34a891,
+276
0x4c1c7e6e,0x17bda2a4,0xfb5fc7fa,0xa0fe1b30,0x265a10f1,0x7dfbcc3b,0x9119a965,0xcab875af,
+277
0x3548049b,0x6ee9d851,0x820bbd0f,0xd9aa61c5,0x5f0e6a04,0x04afb6ce,0xe84dd390,0xb3ec0f5a,
+278
0xe1c4d9a5,0xba65056f,0x56876031,0x0d26bcfb,0x8b82b73a,0xd0236bf0,0x3cc10eae,0x6760d264}};
vendor/ogg/src/framing.cadded
@@ -0,0 +1,2138 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE Ogg CONTAINER SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2018 *
+9
* by the Xiph.Org Foundation http://www.xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: code raw packets into framed OggSquish stream and
+14
decode Ogg streams back into raw packets
+15
+16
note: The CRC code is directly derived from public domain code by
+17
Ross Williams ([email protected]). See docs/framing.html
+18
for details.
+19
+20
********************************************************************/
+21
+22
#ifdef HAVE_CONFIG_H
+23
#include "config.h"
+24
#endif
+25
+26
#include <stdlib.h>
+27
#include <limits.h>
+28
#include <string.h>
+29
#include <ogg/ogg.h>
+30
+31
/* A complete description of Ogg framing exists in docs/framing.html */
+32
+33
int ogg_page_version(const ogg_page *og){
+34
return((int)(og->header[4]));
+35
}
+36
+37
int ogg_page_continued(const ogg_page *og){
+38
return((int)(og->header[5]&0x01));
+39
}
+40
+41
int ogg_page_bos(const ogg_page *og){
+42
return((int)(og->header[5]&0x02));
+43
}
+44
+45
int ogg_page_eos(const ogg_page *og){
+46
return((int)(og->header[5]&0x04));
+47
}
+48
+49
ogg_int64_t ogg_page_granulepos(const ogg_page *og){
+50
unsigned char *page=og->header;
+51
ogg_uint64_t granulepos=page[13]&(0xff);
+52
granulepos= (granulepos<<8)|(page[12]&0xff);
+53
granulepos= (granulepos<<8)|(page[11]&0xff);
+54
granulepos= (granulepos<<8)|(page[10]&0xff);
+55
granulepos= (granulepos<<8)|(page[9]&0xff);
+56
granulepos= (granulepos<<8)|(page[8]&0xff);
+57
granulepos= (granulepos<<8)|(page[7]&0xff);
+58
granulepos= (granulepos<<8)|(page[6]&0xff);
+59
return((ogg_int64_t)granulepos);
+60
}
+61
+62
int ogg_page_serialno(const ogg_page *og){
+63
return((int)((ogg_uint32_t)og->header[14]) |
+64
((ogg_uint32_t)og->header[15]<<8) |
+65
((ogg_uint32_t)og->header[16]<<16) |
+66
((ogg_uint32_t)og->header[17]<<24));
+67
}
+68
+69
long ogg_page_pageno(const ogg_page *og){
+70
return((long)((ogg_uint32_t)og->header[18]) |
+71
((ogg_uint32_t)og->header[19]<<8) |
+72
((ogg_uint32_t)og->header[20]<<16) |
+73
((ogg_uint32_t)og->header[21]<<24));
+74
}
+75
+76
+77
+78
/* returns the number of packets that are completed on this page (if
+79
the leading packet is begun on a previous page, but ends on this
+80
page, it's counted */
+81
+82
/* NOTE:
+83
If a page consists of a packet begun on a previous page, and a new
+84
packet begun (but not completed) on this page, the return will be:
+85
ogg_page_packets(page) ==1,
+86
ogg_page_continued(page) !=0
+87
+88
If a page happens to be a single packet that was begun on a
+89
previous page, and spans to the next page (in the case of a three or
+90
more page packet), the return will be:
+91
ogg_page_packets(page) ==0,
+92
ogg_page_continued(page) !=0
+93
*/
+94
+95
int ogg_page_packets(const ogg_page *og){
+96
int i,n=og->header[26],count=0;
+97
for(i=0;i<n;i++)
+98
if(og->header[27+i]<255)count++;
+99
return(count);
+100
}
+101
+102
+103
#if 0
+104
/* helper to initialize lookup for direct-table CRC (illustrative; we
+105
use the static init in crctable.h) */
+106
+107
static void _ogg_crc_init(){
+108
int i, j;
+109
ogg_uint32_t polynomial, crc;
+110
polynomial = 0x04c11db7; /* The same as the ethernet generator
+111
polynomial, although we use an
+112
unreflected alg and an init/final
+113
of 0, not 0xffffffff */
+114
for (i = 0; i <= 0xFF; i++){
+115
crc = i << 24;
+116
+117
for (j = 0; j < 8; j++)
+118
crc = (crc << 1) ^ (crc & (1 << 31) ? polynomial : 0);
+119
+120
crc_lookup[0][i] = crc;
+121
}
+122
+123
for (i = 0; i <= 0xFF; i++)
+124
for (j = 1; j < 8; j++)
+125
crc_lookup[j][i] = crc_lookup[0][(crc_lookup[j - 1][i] >> 24) & 0xFF] ^ (crc_lookup[j - 1][i] << 8);
+126
}
+127
#endif
+128
+129
#include "crctable.h"
+130
+131
/* init the encode/decode logical stream state */
+132
+133
int ogg_stream_init(ogg_stream_state *os,int serialno){
+134
if(os){
+135
memset(os,0,sizeof(*os));
+136
os->body_storage=16*1024;
+137
os->lacing_storage=1024;
+138
+139
os->body_data=_ogg_malloc(os->body_storage*sizeof(*os->body_data));
+140
os->lacing_vals=_ogg_malloc(os->lacing_storage*sizeof(*os->lacing_vals));
+141
os->granule_vals=_ogg_malloc(os->lacing_storage*sizeof(*os->granule_vals));
+142
+143
if(!os->body_data || !os->lacing_vals || !os->granule_vals){
+144
ogg_stream_clear(os);
+145
return -1;
+146
}
+147
+148
os->serialno=serialno;
+149
+150
return(0);
+151
}
+152
return(-1);
+153
}
+154
+155
/* async/delayed error detection for the ogg_stream_state */
+156
int ogg_stream_check(ogg_stream_state *os){
+157
if(!os || !os->body_data) return -1;
+158
return 0;
+159
}
+160
+161
/* _clear does not free os, only the non-flat storage within */
+162
int ogg_stream_clear(ogg_stream_state *os){
+163
if(os){
+164
if(os->body_data)_ogg_free(os->body_data);
+165
if(os->lacing_vals)_ogg_free(os->lacing_vals);
+166
if(os->granule_vals)_ogg_free(os->granule_vals);
+167
+168
memset(os,0,sizeof(*os));
+169
}
+170
return(0);
+171
}
+172
+173
int ogg_stream_destroy(ogg_stream_state *os){
+174
if(os){
+175
ogg_stream_clear(os);
+176
_ogg_free(os);
+177
}
+178
return(0);
+179
}
+180
+181
/* Helpers for ogg_stream_encode; this keeps the structure and
+182
what's happening fairly clear */
+183
+184
static int _os_body_expand(ogg_stream_state *os,long needed){
+185
if(os->body_storage-needed<=os->body_fill){
+186
long body_storage;
+187
void *ret;
+188
if(os->body_storage>LONG_MAX-needed){
+189
ogg_stream_clear(os);
+190
return -1;
+191
}
+192
body_storage=os->body_storage+needed;
+193
if(body_storage<LONG_MAX-1024)body_storage+=1024;
+194
ret=_ogg_realloc(os->body_data,body_storage*sizeof(*os->body_data));
+195
if(!ret){
+196
ogg_stream_clear(os);
+197
return -1;
+198
}
+199
os->body_storage=body_storage;
+200
os->body_data=ret;
+201
}
+202
return 0;
+203
}
+204
+205
static int _os_lacing_expand(ogg_stream_state *os,long needed){
+206
if(os->lacing_storage-needed<=os->lacing_fill){
+207
long lacing_storage;
+208
void *ret;
+209
if(os->lacing_storage>LONG_MAX-needed){
+210
ogg_stream_clear(os);
+211
return -1;
+212
}
+213
lacing_storage=os->lacing_storage+needed;
+214
if(lacing_storage<LONG_MAX-32)lacing_storage+=32;
+215
ret=_ogg_realloc(os->lacing_vals,lacing_storage*sizeof(*os->lacing_vals));
+216
if(!ret){
+217
ogg_stream_clear(os);
+218
return -1;
+219
}
+220
os->lacing_vals=ret;
+221
ret=_ogg_realloc(os->granule_vals,lacing_storage*
+222
sizeof(*os->granule_vals));
+223
if(!ret){
+224
ogg_stream_clear(os);
+225
return -1;
+226
}
+227
os->granule_vals=ret;
+228
os->lacing_storage=lacing_storage;
+229
}
+230
return 0;
+231
}
+232
+233
/* checksum the page */
+234
/* Direct table CRC; note that this will be faster in the future if we
+235
perform the checksum simultaneously with other copies */
+236
+237
static ogg_uint32_t _os_update_crc(ogg_uint32_t crc, unsigned char *buffer, int size){
+238
while (size>=8){
+239
crc^=((ogg_uint32_t)buffer[0]<<24)|((ogg_uint32_t)buffer[1]<<16)|((ogg_uint32_t)buffer[2]<<8)|((ogg_uint32_t)buffer[3]);
+240
+241
crc=crc_lookup[7][ crc>>24 ]^crc_lookup[6][(crc>>16)&0xFF]^
+242
crc_lookup[5][(crc>> 8)&0xFF]^crc_lookup[4][ crc &0xFF]^
+243
crc_lookup[3][buffer[4] ]^crc_lookup[2][buffer[5] ]^
+244
crc_lookup[1][buffer[6] ]^crc_lookup[0][buffer[7] ];
+245
+246
buffer+=8;
+247
size-=8;
+248
}
+249
+250
while (size--)
+251
crc=(crc<<8)^crc_lookup[0][((crc >> 24)&0xff)^*buffer++];
+252
return crc;
+253
}
+254
+255
void ogg_page_checksum_set(ogg_page *og){
+256
if(og){
+257
ogg_uint32_t crc_reg=0;
+258
+259
/* safety; needed for API behavior, but not framing code */
+260
og->header[22]=0;
+261
og->header[23]=0;
+262
og->header[24]=0;
+263
og->header[25]=0;
+264
+265
crc_reg=_os_update_crc(crc_reg,og->header,og->header_len);
+266
crc_reg=_os_update_crc(crc_reg,og->body,og->body_len);
+267
+268
og->header[22]=(unsigned char)(crc_reg&0xff);
+269
og->header[23]=(unsigned char)((crc_reg>>8)&0xff);
+270
og->header[24]=(unsigned char)((crc_reg>>16)&0xff);
+271
og->header[25]=(unsigned char)((crc_reg>>24)&0xff);
+272
}
+273
}
+274
+275
/* submit data to the internal buffer of the framing engine */
+276
int ogg_stream_iovecin(ogg_stream_state *os, ogg_iovec_t *iov, int count,
+277
long e_o_s, ogg_int64_t granulepos){
+278
+279
long bytes = 0, lacing_vals;
+280
int i;
+281
+282
if(ogg_stream_check(os)) return -1;
+283
if(!iov) return 0;
+284
+285
for (i = 0; i < count; ++i){
+286
if(iov[i].iov_len>LONG_MAX) return -1;
+287
if(bytes>LONG_MAX-(long)iov[i].iov_len) return -1;
+288
bytes += (long)iov[i].iov_len;
+289
}
+290
lacing_vals=bytes/255+1;
+291
+292
if(os->body_returned){
+293
/* advance packet data according to the body_returned pointer. We
+294
had to keep it around to return a pointer into the buffer last
+295
call */
+296
+297
os->body_fill-=os->body_returned;
+298
if(os->body_fill)
+299
memmove(os->body_data,os->body_data+os->body_returned,
+300
os->body_fill);
+301
os->body_returned=0;
+302
}
+303
+304
/* make sure we have the buffer storage */
+305
if(_os_body_expand(os,bytes) || _os_lacing_expand(os,lacing_vals))
+306
return -1;
+307
+308
/* Copy in the submitted packet. Yes, the copy is a waste; this is
+309
the liability of overly clean abstraction for the time being. It
+310
will actually be fairly easy to eliminate the extra copy in the
+311
future */
+312
+313
for (i = 0; i < count; ++i) {
+314
memcpy(os->body_data+os->body_fill, iov[i].iov_base, iov[i].iov_len);
+315
os->body_fill += (int)iov[i].iov_len;
+316
}
+317
+318
/* Store lacing vals for this packet */
+319
for(i=0;i<lacing_vals-1;i++){
+320
os->lacing_vals[os->lacing_fill+i]=255;
+321
os->granule_vals[os->lacing_fill+i]=os->granulepos;
+322
}
+323
os->lacing_vals[os->lacing_fill+i]=bytes%255;
+324
os->granulepos=os->granule_vals[os->lacing_fill+i]=granulepos;
+325
+326
/* flag the first segment as the beginning of the packet */
+327
os->lacing_vals[os->lacing_fill]|= 0x100;
+328
+329
os->lacing_fill+=lacing_vals;
+330
+331
/* for the sake of completeness */
+332
os->packetno++;
+333
+334
if(e_o_s)os->e_o_s=1;
+335
+336
return(0);
+337
}
+338
+339
int ogg_stream_packetin(ogg_stream_state *os,ogg_packet *op){
+340
ogg_iovec_t iov;
+341
iov.iov_base = op->packet;
+342
iov.iov_len = op->bytes;
+343
return ogg_stream_iovecin(os, &iov, 1, op->e_o_s, op->granulepos);
+344
}
+345
+346
/* Conditionally flush a page; force==0 will only flush nominal-size
+347
pages, force==1 forces us to flush a page regardless of page size
+348
so long as there's any data available at all. */
+349
static int ogg_stream_flush_i(ogg_stream_state *os,ogg_page *og, int force, int nfill){
+350
int i;
+351
int vals=0;
+352
int maxvals;
+353
int bytes=0;
+354
long acc=0;
+355
ogg_int64_t granule_pos=-1;
+356
+357
if(ogg_stream_check(os)) return(0);
+358
maxvals=(os->lacing_fill>255?255:os->lacing_fill);
+359
if(maxvals==0) return(0);
+360
+361
/* construct a page */
+362
/* decide how many segments to include */
+363
+364
/* If this is the initial header case, the first page must only include
+365
the initial header packet */
+366
if(os->b_o_s==0){ /* 'initial header page' case */
+367
granule_pos=0;
+368
for(vals=0;vals<maxvals;vals++){
+369
if((os->lacing_vals[vals]&0x0ff)<255){
+370
vals++;
+371
break;
+372
}
+373
}
+374
}else{
+375
+376
/* The extra packets_done, packet_just_done logic here attempts to do two things:
+377
1) Don't unnecessarily span pages.
+378
2) Unless necessary, don't flush pages if there are less than four packets on
+379
them; this expands page size to reduce unnecessary overhead if incoming packets
+380
are large.
+381
These are not necessary behaviors, just 'always better than naive flushing'
+382
without requiring an application to explicitly request a specific optimized
+383
behavior. We'll want an explicit behavior setup pathway eventually as well. */
+384
+385
int packets_done=0;
+386
int packet_just_done=0;
+387
for(vals=0;vals<maxvals;vals++){
+388
if(acc>nfill && packet_just_done>=4){
+389
force=1;
+390
break;
+391
}
+392
acc+=os->lacing_vals[vals]&0x0ff;
+393
if((os->lacing_vals[vals]&0xff)<255){
+394
granule_pos=os->granule_vals[vals];
+395
packet_just_done=++packets_done;
+396
}else
+397
packet_just_done=0;
+398
}
+399
if(vals==255)force=1;
+400
}
+401
+402
if(!force) return(0);
+403
+404
/* construct the header in temp storage */
+405
memcpy(os->header,"OggS",4);
+406
+407
/* stream structure version */
+408
os->header[4]=0x00;
+409
+410
/* continued packet flag? */
+411
os->header[5]=0x00;
+412
if((os->lacing_vals[0]&0x100)==0)os->header[5]|=0x01;
+413
/* first page flag? */
+414
if(os->b_o_s==0)os->header[5]|=0x02;
+415
/* last page flag? */
+416
if(os->e_o_s && os->lacing_fill==vals)os->header[5]|=0x04;
+417
os->b_o_s=1;
+418
+419
/* 64 bits of PCM position */
+420
for(i=6;i<14;i++){
+421
os->header[i]=(unsigned char)(granule_pos&0xff);
+422
granule_pos>>=8;
+423
}
+424
+425
/* 32 bits of stream serial number */
+426
{
+427
long serialno=os->serialno;
+428
for(i=14;i<18;i++){
+429
os->header[i]=(unsigned char)(serialno&0xff);
+430
serialno>>=8;
+431
}
+432
}
+433
+434
/* 32 bits of page counter (we have both counter and page header
+435
because this val can roll over) */
+436
if(os->pageno==-1)os->pageno=0; /* because someone called
+437
stream_reset; this would be a
+438
strange thing to do in an
+439
encode stream, but it has
+440
plausible uses */
+441
{
+442
long pageno=os->pageno++;
+443
for(i=18;i<22;i++){
+444
os->header[i]=(unsigned char)(pageno&0xff);
+445
pageno>>=8;
+446
}
+447
}
+448
+449
/* zero for computation; filled in later */
+450
os->header[22]=0;
+451
os->header[23]=0;
+452
os->header[24]=0;
+453
os->header[25]=0;
+454
+455
/* segment table */
+456
os->header[26]=(unsigned char)(vals&0xff);
+457
for(i=0;i<vals;i++)
+458
bytes+=os->header[i+27]=(unsigned char)(os->lacing_vals[i]&0xff);
+459
+460
/* set pointers in the ogg_page struct */
+461
og->header=os->header;
+462
og->header_len=os->header_fill=vals+27;
+463
og->body=os->body_data+os->body_returned;
+464
og->body_len=bytes;
+465
+466
/* advance the lacing data and set the body_returned pointer */
+467
+468
os->lacing_fill-=vals;
+469
memmove(os->lacing_vals,os->lacing_vals+vals,os->lacing_fill*sizeof(*os->lacing_vals));
+470
memmove(os->granule_vals,os->granule_vals+vals,os->lacing_fill*sizeof(*os->granule_vals));
+471
os->body_returned+=bytes;
+472
+473
/* calculate the checksum */
+474
+475
ogg_page_checksum_set(og);
+476
+477
/* done */
+478
return(1);
+479
}
+480
+481
/* This will flush remaining packets into a page (returning nonzero),
+482
even if there is not enough data to trigger a flush normally
+483
(undersized page). If there are no packets or partial packets to
+484
flush, ogg_stream_flush returns 0. Note that ogg_stream_flush will
+485
try to flush a normal sized page like ogg_stream_pageout; a call to
+486
ogg_stream_flush does not guarantee that all packets have flushed.
+487
Only a return value of 0 from ogg_stream_flush indicates all packet
+488
data is flushed into pages.
+489
+490
since ogg_stream_flush will flush the last page in a stream even if
+491
it's undersized, you almost certainly want to use ogg_stream_pageout
+492
(and *not* ogg_stream_flush) unless you specifically need to flush
+493
a page regardless of size in the middle of a stream. */
+494
+495
int ogg_stream_flush(ogg_stream_state *os,ogg_page *og){
+496
return ogg_stream_flush_i(os,og,1,4096);
+497
}
+498
+499
/* Like the above, but an argument is provided to adjust the nominal

Showing 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
@@ -0,0 +1,28 @@
+1
Copyright (c) 2002-2020 Xiph.org Foundation
+2
+3
Redistribution and use in source and binary forms, with or without
+4
modification, are permitted provided that the following conditions
+5
are met:
+6
+7
- Redistributions of source code must retain the above copyright
+8
notice, this list of conditions and the following disclaimer.
+9
+10
- Redistributions in binary form must reproduce the above copyright
+11
notice, this list of conditions and the following disclaimer in the
+12
documentation and/or other materials provided with the distribution.
+13
+14
- Neither the name of the Xiph.org Foundation nor the names of its
+15
contributors may be used to endorse or promote products derived from
+16
this software without specific prior written permission.
+17
+18
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+19
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+20
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+21
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION
+22
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+23
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+24
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+25
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+26
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+27
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+28
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
vendor/vorbis/README.mdadded
@@ -0,0 +1,42 @@
+1
# libvorbis (vendored)
+2
+3
Upstream: https://xiph.org/vorbis/
+4
+5
- **Version**: 1.3.7
+6
- **Source**: https://downloads.xiph.org/releases/vorbis/libvorbis-1.3.7.tar.xz
+7
- **SHA256**: `b33cc4934322bcbf6efcbacf49e3ca01aadbea4114ec9589d1b1e9d20f72954b`
+8
- **License**: BSD-3-Clause (see `COPYING`)
+9
+10
## What's included
+11
+12
Sources required to build the full `libvorbis.a` (encoder, decoder,
+13
file I/O):
+14
+15
- `lib/*.c` — every C source from upstream's `lib/` *except* the
+16
`barkmel.c` / `tone.c` / `psytune.c` standalone test programs,
+17
which are unrelated to the library itself.
+18
- `lib/*.h` — every internal header.
+19
- `lib/books/{coupled,floor,uncoupled}/*.h` — codebook data
+20
tables (about 42K lines of static const data).
+21
- `lib/modes/*.h` — psychoacoustic + residue setup tables.
+22
- `include/vorbis/{codec,vorbisenc,vorbisfile}.h` — public headers.
+23
+24
Build pulls in libogg via `vendor/ogg/include`. Internal `.c` files
+25
include their siblings by bare filename (e.g.
+26
`#include "codebook.h"`), so `vendor/vorbis/lib` itself must be
+27
on the include path — see `package.sgl`.
+28
+29
Everything else from the tarball (`docs/`, `examples/`, `test/`,
+30
`vq/`, `cmake/`, `macosx/`, `symbian/`, `win32/`, `m4/`,
+31
autotools machinery) is intentionally omitted.
+32
+33
## Upgrading
+34
+35
1. Download the new upstream tarball, verify SHA256 against
+36
xiph.org's release announcement.
+37
2. Replace `lib/*.c`, `lib/*.h`, `lib/books/**/*.h`,
+38
`lib/modes/*.h`, `include/vorbis/*.h`, `COPYING` with the
+39
upstream files (byte-identical drop-in). Skip `barkmel.c`,
+40
`tone.c`, `psytune.c`.
+41
3. Update version + SHA256 in this README.
+42
4. Rebuild + run `test/test-ogg-encode.sgl`.
vendor/vorbis/include/vorbis/codec.hadded
@@ -0,0 +1,242 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001 *
+9
* by the Xiph.Org Foundation https://xiph.org/ *
+10
+11
********************************************************************
+12
+13
function: libvorbis codec headers
+14
+15
********************************************************************/
+16
+17
#ifndef _vorbis_codec_h_
+18
#define _vorbis_codec_h_
+19
+20
#ifdef __cplusplus
+21
extern "C"
+22
{
+23
#endif /* __cplusplus */
+24
+25
#include <ogg/ogg.h>
+26
+27
typedef struct vorbis_info{
+28
int version;
+29
int channels;
+30
long rate;
+31
+32
/* The below bitrate declarations are *hints*.
+33
Combinations of the three values carry the following implications:
+34
+35
all three set to the same value:
+36
implies a fixed rate bitstream
+37
only nominal set:
+38
implies a VBR stream that averages the nominal bitrate. No hard
+39
upper/lower limit
+40
upper and or lower set:
+41
implies a VBR bitstream that obeys the bitrate limits. nominal
+42
may also be set to give a nominal rate.
+43
none set:
+44
the coder does not care to speculate.
+45
*/
+46
+47
long bitrate_upper;
+48
long bitrate_nominal;
+49
long bitrate_lower;
+50
long bitrate_window;
+51
+52
void *codec_setup;
+53
} vorbis_info;
+54
+55
/* vorbis_dsp_state buffers the current vorbis audio
+56
analysis/synthesis state. The DSP state belongs to a specific
+57
logical bitstream ****************************************************/
+58
typedef struct vorbis_dsp_state{
+59
int analysisp;
+60
vorbis_info *vi;
+61
+62
float **pcm;
+63
float **pcmret;
+64
int pcm_storage;
+65
int pcm_current;
+66
int pcm_returned;
+67
+68
int preextrapolate;
+69
int eofflag;
+70
+71
long lW;
+72
long W;
+73
long nW;
+74
long centerW;
+75
+76
ogg_int64_t granulepos;
+77
ogg_int64_t sequence;
+78
+79
ogg_int64_t glue_bits;
+80
ogg_int64_t time_bits;
+81
ogg_int64_t floor_bits;
+82
ogg_int64_t res_bits;
+83
+84
void *backend_state;
+85
} vorbis_dsp_state;
+86
+87
typedef struct vorbis_block{
+88
/* necessary stream state for linking to the framing abstraction */
+89
float **pcm; /* this is a pointer into local storage */
+90
oggpack_buffer opb;
+91
+92
long lW;
+93
long W;
+94
long nW;
+95
int pcmend;
+96
int mode;
+97
+98
int eofflag;
+99
ogg_int64_t granulepos;
+100
ogg_int64_t sequence;
+101
vorbis_dsp_state *vd; /* For read-only access of configuration */
+102
+103
/* local storage to avoid remallocing; it's up to the mapping to
+104
structure it */
+105
void *localstore;
+106
long localtop;
+107
long localalloc;
+108
long totaluse;
+109
struct alloc_chain *reap;
+110
+111
/* bitmetrics for the frame */
+112
long glue_bits;
+113
long time_bits;
+114
long floor_bits;
+115
long res_bits;
+116
+117
void *internal;
+118
+119
} vorbis_block;
+120
+121
/* vorbis_block is a single block of data to be processed as part of
+122
the analysis/synthesis stream; it belongs to a specific logical
+123
bitstream, but is independent from other vorbis_blocks belonging to
+124
that logical bitstream. *************************************************/
+125
+126
struct alloc_chain{
+127
void *ptr;
+128
struct alloc_chain *next;
+129
};
+130
+131
/* vorbis_info contains all the setup information specific to the
+132
specific compression/decompression mode in progress (eg,
+133
psychoacoustic settings, channel setup, options, codebook
+134
etc). vorbis_info and substructures are in backends.h.
+135
*********************************************************************/
+136
+137
/* the comments are not part of vorbis_info so that vorbis_info can be
+138
static storage */
+139
typedef struct vorbis_comment{
+140
/* unlimited user comment fields. libvorbis writes 'libvorbis'
+141
whatever vendor is set to in encode */
+142
char **user_comments;
+143
int *comment_lengths;
+144
int comments;
+145
char *vendor;
+146
+147
} vorbis_comment;
+148
+149
+150
/* libvorbis encodes in two abstraction layers; first we perform DSP
+151
and produce a packet (see docs/analysis.txt). The packet is then
+152
coded into a framed OggSquish bitstream by the second layer (see
+153
docs/framing.txt). Decode is the reverse process; we sync/frame
+154
the bitstream and extract individual packets, then decode the
+155
packet back into PCM audio.
+156
+157
The extra framing/packetizing is used in streaming formats, such as
+158
files. Over the net (such as with UDP), the framing and
+159
packetization aren't necessary as they're provided by the transport
+160
and the streaming layer is not used */
+161
+162
/* Vorbis PRIMITIVES: general ***************************************/
+163
+164
extern void vorbis_info_init(vorbis_info *vi);
+165
extern void vorbis_info_clear(vorbis_info *vi);
+166
extern int vorbis_info_blocksize(vorbis_info *vi,int zo);
+167
extern void vorbis_comment_init(vorbis_comment *vc);
+168
extern void vorbis_comment_add(vorbis_comment *vc, const char *comment);
+169
extern void vorbis_comment_add_tag(vorbis_comment *vc,
+170
const char *tag, const char *contents);
+171
extern char *vorbis_comment_query(vorbis_comment *vc, const char *tag, int count);
+172
extern int vorbis_comment_query_count(vorbis_comment *vc, const char *tag);
+173
extern void vorbis_comment_clear(vorbis_comment *vc);
+174
+175
extern int vorbis_block_init(vorbis_dsp_state *v, vorbis_block *vb);
+176
extern int vorbis_block_clear(vorbis_block *vb);
+177
extern void vorbis_dsp_clear(vorbis_dsp_state *v);
+178
extern double vorbis_granule_time(vorbis_dsp_state *v,
+179
ogg_int64_t granulepos);
+180
+181
extern const char *vorbis_version_string(void);
+182
+183
/* Vorbis PRIMITIVES: analysis/DSP layer ****************************/
+184
+185
extern int vorbis_analysis_init(vorbis_dsp_state *v,vorbis_info *vi);
+186
extern int vorbis_commentheader_out(vorbis_comment *vc, ogg_packet *op);
+187
extern int vorbis_analysis_headerout(vorbis_dsp_state *v,
+188
vorbis_comment *vc,
+189
ogg_packet *op,
+190
ogg_packet *op_comm,
+191
ogg_packet *op_code);
+192
extern float **vorbis_analysis_buffer(vorbis_dsp_state *v,int vals);
+193
extern int vorbis_analysis_wrote(vorbis_dsp_state *v,int vals);
+194
extern int vorbis_analysis_blockout(vorbis_dsp_state *v,vorbis_block *vb);
+195
extern int vorbis_analysis(vorbis_block *vb,ogg_packet *op);
+196
+197
extern int vorbis_bitrate_addblock(vorbis_block *vb);
+198
extern int vorbis_bitrate_flushpacket(vorbis_dsp_state *vd,
+199
ogg_packet *op);
+200
+201
/* Vorbis PRIMITIVES: synthesis layer *******************************/
+202
extern int vorbis_synthesis_idheader(ogg_packet *op);
+203
extern int vorbis_synthesis_headerin(vorbis_info *vi,vorbis_comment *vc,
+204
ogg_packet *op);
+205
+206
extern int vorbis_synthesis_init(vorbis_dsp_state *v,vorbis_info *vi);
+207
extern int vorbis_synthesis_restart(vorbis_dsp_state *v);
+208
extern int vorbis_synthesis(vorbis_block *vb,ogg_packet *op);
+209
extern int vorbis_synthesis_trackonly(vorbis_block *vb,ogg_packet *op);
+210
extern int vorbis_synthesis_blockin(vorbis_dsp_state *v,vorbis_block *vb);
+211
extern int vorbis_synthesis_pcmout(vorbis_dsp_state *v,float ***pcm);
+212
extern int vorbis_synthesis_lapout(vorbis_dsp_state *v,float ***pcm);
+213
extern int vorbis_synthesis_read(vorbis_dsp_state *v,int samples);
+214
extern long vorbis_packet_blocksize(vorbis_info *vi,ogg_packet *op);
+215
+216
extern int vorbis_synthesis_halfrate(vorbis_info *v,int flag);
+217
extern int vorbis_synthesis_halfrate_p(vorbis_info *v);
+218
+219
/* Vorbis ERRORS and return codes ***********************************/
+220
+221
#define OV_FALSE -1
+222
#define OV_EOF -2
+223
#define OV_HOLE -3
+224
+225
#define OV_EREAD -128
+226
#define OV_EFAULT -129
+227
#define OV_EIMPL -130
+228
#define OV_EINVAL -131
+229
#define OV_ENOTVORBIS -132
+230
#define OV_EBADHEADER -133
+231
#define OV_EVERSION -134
+232
#define OV_ENOTAUDIO -135
+233
#define OV_EBADPACKET -136
+234
#define OV_EBADLINK -137
+235
#define OV_ENOSEEK -138
+236
+237
#ifdef __cplusplus
+238
}
+239
#endif /* __cplusplus */
+240
+241
#endif
+242
vendor/vorbis/include/vorbis/vorbisenc.hadded
@@ -0,0 +1,435 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001 *
+9
* by the Xiph.Org Foundation https://xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: vorbis encode-engine setup
+14
+15
********************************************************************/
+16
+17
/** \file
+18
* Libvorbisenc is a convenient API for setting up an encoding
+19
* environment using libvorbis. Libvorbisenc encapsulates the
+20
* actions needed to set up the encoder properly.
+21
*/
+22
+23
#ifndef _OV_ENC_H_
+24
#define _OV_ENC_H_
+25
+26
#ifdef __cplusplus
+27
extern "C"
+28
{
+29
#endif /* __cplusplus */
+30
+31
#include "codec.h"
+32
+33
/**
+34
* This is the primary function within libvorbisenc for setting up managed
+35
* bitrate modes.
+36
*
+37
* Before this function is called, the \ref vorbis_info
+38
* struct should be initialized by using vorbis_info_init() from the libvorbis
+39
* API. After encoding, vorbis_info_clear() should be called.
+40
*
+41
* The max_bitrate, nominal_bitrate, and min_bitrate settings are used to set
+42
* constraints for the encoded file. This function uses these settings to
+43
* select the appropriate encoding mode and set it up.
+44
*
+45
* \param vi Pointer to an initialized \ref vorbis_info struct.
+46
* \param channels The number of channels to be encoded.
+47
* \param rate The sampling rate of the source audio.
+48
* \param max_bitrate Desired maximum bitrate (limit). -1 indicates unset.
+49
* \param nominal_bitrate Desired average, or central, bitrate. -1 indicates unset.
+50
* \param min_bitrate Desired minimum bitrate. -1 indicates unset.
+51
*
+52
* \return Zero for success, and negative values for failure.
+53
*
+54
* \retval 0 Success.
+55
* \retval OV_EFAULT Internal logic fault; indicates a bug or heap/stack corruption.
+56
* \retval OV_EINVAL Invalid setup request, eg, out of range argument.
+57
* \retval OV_EIMPL Unimplemented mode; unable to comply with bitrate request.
+58
*/
+59
extern int vorbis_encode_init(vorbis_info *vi,
+60
long channels,
+61
long rate,
+62
+63
long max_bitrate,
+64
long nominal_bitrate,
+65
long min_bitrate);
+66
+67
/**
+68
* This function performs step-one of a three-step bitrate-managed encode
+69
* setup. It functions similarly to the one-step setup performed by \ref
+70
* vorbis_encode_init but allows an application to make further encode setup
+71
* tweaks using \ref vorbis_encode_ctl before finally calling \ref
+72
* vorbis_encode_setup_init to complete the setup process.
+73
*
+74
* Before this function is called, the \ref vorbis_info struct should be
+75
* initialized by using vorbis_info_init() from the libvorbis API. After
+76
* encoding, vorbis_info_clear() should be called.
+77
*
+78
* The max_bitrate, nominal_bitrate, and min_bitrate settings are used to set
+79
* constraints for the encoded file. This function uses these settings to
+80
* select the appropriate encoding mode and set it up.
+81
*
+82
* \param vi Pointer to an initialized vorbis_info struct.
+83
* \param channels The number of channels to be encoded.
+84
* \param rate The sampling rate of the source audio.
+85
* \param max_bitrate Desired maximum bitrate (limit). -1 indicates unset.
+86
* \param nominal_bitrate Desired average, or central, bitrate. -1 indicates unset.
+87
* \param min_bitrate Desired minimum bitrate. -1 indicates unset.
+88
*
+89
* \return Zero for success, and negative for failure.
+90
*
+91
* \retval 0 Success
+92
* \retval OV_EFAULT Internal logic fault; indicates a bug or heap/stack corruption.
+93
* \retval OV_EINVAL Invalid setup request, eg, out of range argument.
+94
* \retval OV_EIMPL Unimplemented mode; unable to comply with bitrate request.
+95
*/
+96
extern int vorbis_encode_setup_managed(vorbis_info *vi,
+97
long channels,
+98
long rate,
+99
+100
long max_bitrate,
+101
long nominal_bitrate,
+102
long min_bitrate);
+103
+104
/**
+105
* This function performs step-one of a three-step variable bitrate
+106
* (quality-based) encode setup. It functions similarly to the one-step setup
+107
* performed by \ref vorbis_encode_init_vbr() but allows an application to
+108
* make further encode setup tweaks using \ref vorbis_encode_ctl() before
+109
* finally calling \ref vorbis_encode_setup_init to complete the setup
+110
* process.
+111
*
+112
* Before this function is called, the \ref vorbis_info struct should be
+113
* initialized by using \ref vorbis_info_init() from the libvorbis API. After
+114
* encoding, vorbis_info_clear() should be called.
+115
*
+116
* \param vi Pointer to an initialized vorbis_info struct.
+117
* \param channels The number of channels to be encoded.
+118
* \param rate The sampling rate of the source audio.
+119
* \param quality Desired quality level, currently from -0.1 to 1.0 (lo to hi).
+120
*
+121
* \return Zero for success, and negative values for failure.
+122
*
+123
* \retval 0 Success
+124
* \retval OV_EFAULT Internal logic fault; indicates a bug or heap/stack corruption.
+125
* \retval OV_EINVAL Invalid setup request, eg, out of range argument.
+126
* \retval OV_EIMPL Unimplemented mode; unable to comply with quality level request.
+127
*/
+128
extern int vorbis_encode_setup_vbr(vorbis_info *vi,
+129
long channels,
+130
long rate,
+131
+132
float quality
+133
);
+134
+135
/**
+136
* This is the primary function within libvorbisenc for setting up variable
+137
* bitrate ("quality" based) modes.
+138
*
+139
*
+140
* Before this function is called, the vorbis_info struct should be
+141
* initialized by using vorbis_info_init() from the libvorbis API. After
+142
* encoding, vorbis_info_clear() should be called.
+143
*
+144
* \param vi Pointer to an initialized vorbis_info struct.
+145
* \param channels The number of channels to be encoded.
+146
* \param rate The sampling rate of the source audio.
+147
* \param base_quality Desired quality level, currently from -0.1 to 1.0 (lo to hi).
+148
*
+149
*
+150
* \return Zero for success, or a negative number for failure.
+151
*
+152
* \retval 0 Success
+153
* \retval OV_EFAULT Internal logic fault; indicates a bug or heap/stack corruption.
+154
* \retval OV_EINVAL Invalid setup request, eg, out of range argument.
+155
* \retval OV_EIMPL Unimplemented mode; unable to comply with quality level request.
+156
*/
+157
extern int vorbis_encode_init_vbr(vorbis_info *vi,
+158
long channels,
+159
long rate,
+160
+161
float base_quality
+162
);
+163
+164
/**
+165
* This function performs the last stage of three-step encoding setup, as
+166
* described in the API overview under managed bitrate modes.
+167
*
+168
* Before this function is called, the \ref vorbis_info struct should be
+169
* initialized by using vorbis_info_init() from the libvorbis API, one of
+170
* \ref vorbis_encode_setup_managed() or \ref vorbis_encode_setup_vbr() called to
+171
* initialize the high-level encoding setup, and \ref vorbis_encode_ctl()
+172
* called if necessary to make encoding setup changes.
+173
* vorbis_encode_setup_init() finalizes the highlevel encoding structure into
+174
* a complete encoding setup after which the application may make no further
+175
* setup changes.
+176
*
+177
* After encoding, vorbis_info_clear() should be called.
+178
*
+179
* \param vi Pointer to an initialized \ref vorbis_info struct.
+180
*
+181
* \return Zero for success, and negative values for failure.
+182
*
+183
* \retval 0 Success.
+184
* \retval OV_EFAULT Internal logic fault; indicates a bug or heap/stack corruption.
+185
*
+186
* \retval OV_EINVAL Attempt to use vorbis_encode_setup_init() without first
+187
* calling one of vorbis_encode_setup_managed() or vorbis_encode_setup_vbr() to
+188
* initialize the high-level encoding setup
+189
*
+190
*/
+191
extern int vorbis_encode_setup_init(vorbis_info *vi);
+192
+193
/**
+194
* This function implements a generic interface to miscellaneous encoder
+195
* settings similar to the classic UNIX 'ioctl()' system call. Applications
+196
* may use vorbis_encode_ctl() to query or set bitrate management or quality
+197
* mode details by using one of several \e request arguments detailed below.
+198
* vorbis_encode_ctl() must be called after one of
+199
* vorbis_encode_setup_managed() or vorbis_encode_setup_vbr(). When used
+200
* to modify settings, \ref vorbis_encode_ctl() must be called before \ref
+201
* vorbis_encode_setup_init().
+202
*
+203
* \param vi Pointer to an initialized vorbis_info struct.
+204
*
+205
* \param number Specifies the desired action; See \ref encctlcodes "the list
+206
* of available requests".
+207
*
+208
* \param arg void * pointing to a data structure matching the request
+209
* argument.
+210
*
+211
* \retval 0 Success. Any further return information (such as the result of a
+212
* query) is placed into the storage pointed to by *arg.
+213
*
+214
* \retval OV_EINVAL Invalid argument, or an attempt to modify a setting after
+215
* calling vorbis_encode_setup_init().
+216
*
+217
* \retval OV_EIMPL Unimplemented or unknown request
+218
*/
+219
extern int vorbis_encode_ctl(vorbis_info *vi,int number,void *arg);
+220
+221
/**
+222
* \deprecated This is a deprecated interface. Please use vorbis_encode_ctl()
+223
* with the \ref ovectl_ratemanage2_arg struct and \ref
+224
* OV_ECTL_RATEMANAGE2_GET and \ref OV_ECTL_RATEMANAGE2_SET calls in new code.
+225
*
+226
* The \ref ovectl_ratemanage_arg structure is used with vorbis_encode_ctl()
+227
* and the \ref OV_ECTL_RATEMANAGE_GET, \ref OV_ECTL_RATEMANAGE_SET, \ref
+228
* OV_ECTL_RATEMANAGE_AVG, \ref OV_ECTL_RATEMANAGE_HARD calls in order to
+229
* query and modify specifics of the encoder's bitrate management
+230
* configuration.
+231
*/
+232
struct ovectl_ratemanage_arg {
+233
int management_active; /**< nonzero if bitrate management is active*/
+234
/** hard lower limit (in kilobits per second) below which the stream bitrate
+235
will never be allowed for any given bitrate_hard_window seconds of time.*/
+236
long bitrate_hard_min;
+237
/** hard upper limit (in kilobits per second) above which the stream bitrate
+238
will never be allowed for any given bitrate_hard_window seconds of time.*/
+239
long bitrate_hard_max;
+240
/** the window period (in seconds) used to regulate the hard bitrate minimum
+241
and maximum*/
+242
double bitrate_hard_window;
+243
/** soft lower limit (in kilobits per second) below which the average bitrate
+244
tracker will start nudging the bitrate higher.*/
+245
long bitrate_av_lo;
+246
/** soft upper limit (in kilobits per second) above which the average bitrate
+247
tracker will start nudging the bitrate lower.*/
+248
long bitrate_av_hi;
+249
/** the window period (in seconds) used to regulate the average bitrate
+250
minimum and maximum.*/
+251
double bitrate_av_window;
+252
/** Regulates the relative centering of the average and hard windows; in
+253
libvorbis 1.0 and 1.0.1, the hard window regulation overlapped but
+254
followed the average window regulation. In libvorbis 1.1 a bit-reservoir
+255
interface replaces the old windowing interface; the older windowing
+256
interface is simulated and this field has no effect.*/
+257
double bitrate_av_window_center;
+258
};
+259
+260
/**
+261
* \name struct ovectl_ratemanage2_arg
+262
*
+263
* The ovectl_ratemanage2_arg structure is used with vorbis_encode_ctl() and
+264
* the OV_ECTL_RATEMANAGE2_GET and OV_ECTL_RATEMANAGE2_SET calls in order to
+265
* query and modify specifics of the encoder's bitrate management
+266
* configuration.
+267
*
+268
*/
+269
struct ovectl_ratemanage2_arg {
+270
int management_active; /**< nonzero if bitrate management is active */
+271
/** Lower allowed bitrate limit in kilobits per second */
+272
long bitrate_limit_min_kbps;
+273
/** Upper allowed bitrate limit in kilobits per second */
+274
long bitrate_limit_max_kbps;
+275
long bitrate_limit_reservoir_bits; /**<Size of the bitrate reservoir in bits */
+276
/** Regulates the bitrate reservoir's preferred fill level in a range from 0.0
+277
* to 1.0; 0.0 tries to bank bits to buffer against future bitrate spikes, 1.0
+278
* buffers against future sudden drops in instantaneous bitrate. Default is
+279
* 0.1
+280
*/
+281
double bitrate_limit_reservoir_bias;
+282
/** Average bitrate setting in kilobits per second */
+283
long bitrate_average_kbps;
+284
/** Slew rate limit setting for average bitrate adjustment; sets the minimum
+285
* time in seconds the bitrate tracker may swing from one extreme to the
+286
* other when boosting or damping average bitrate.
+287
*/
+288
double bitrate_average_damping;
+289
};
+290
+291
+292
/**
+293
* \name vorbis_encode_ctl() codes
+294
*
+295
* \anchor encctlcodes
+296
*
+297
* These values are passed as the \c number parameter of vorbis_encode_ctl().
+298
* The type of the referent of that function's \c arg pointer depends on these
+299
* codes.
+300
*/
+301
/*@{*/
+302
+303
/**
+304
* Query the current encoder bitrate management setting.
+305
*
+306
*Argument: <tt>struct ovectl_ratemanage2_arg *</tt>
+307
*
+308
* Used to query the current encoder bitrate management setting. Also used to
+309
* initialize fields of an ovectl_ratemanage2_arg structure for use with
+310
* \ref OV_ECTL_RATEMANAGE2_SET.
+311
*/
+312
#define OV_ECTL_RATEMANAGE2_GET 0x14
+313
+314
/**
+315
* Set the current encoder bitrate management settings.
+316
*
+317
* Argument: <tt>struct ovectl_ratemanage2_arg *</tt>
+318
*
+319
* Used to set the current encoder bitrate management settings to the values
+320
* listed in the ovectl_ratemanage2_arg. Passing a NULL pointer will disable
+321
* bitrate management.
+322
*/
+323
#define OV_ECTL_RATEMANAGE2_SET 0x15
+324
+325
/**
+326
* Returns the current encoder hard-lowpass setting (kHz) in the double
+327
* pointed to by arg.
+328
*
+329
* Argument: <tt>double *</tt>
+330
*/
+331
#define OV_ECTL_LOWPASS_GET 0x20
+332
+333
/**
+334
* Sets the encoder hard-lowpass to the value (kHz) pointed to by arg. Valid
+335
* lowpass settings range from 2 to 99.
+336
*
+337
* Argument: <tt>double *</tt>
+338
*/
+339
#define OV_ECTL_LOWPASS_SET 0x21
+340
+341
/**
+342
* Returns the current encoder impulse block setting in the double pointed
+343
* to by arg.
+344
*
+345
* Argument: <tt>double *</tt>
+346
*/
+347
#define OV_ECTL_IBLOCK_GET 0x30
+348
+349
/**
+350
* Sets the impulse block bias to the the value pointed to by arg.
+351
*
+352
* Argument: <tt>double *</tt>
+353
*
+354
* Valid range is -15.0 to 0.0 [default]. A negative impulse block bias will
+355
* direct to encoder to use more bits when incoding short blocks that contain
+356
* strong impulses, thus improving the accuracy of impulse encoding.
+357
*/
+358
#define OV_ECTL_IBLOCK_SET 0x31
+359
+360
/**
+361
* Returns the current encoder coupling setting in the int pointed
+362
* to by arg.
+363
*
+364
* Argument: <tt>int *</tt>
+365
*/
+366
#define OV_ECTL_COUPLING_GET 0x40
+367
+368
/**
+369
* Enables/disables channel coupling in multichannel encoding according to arg.
+370
*
+371
* Argument: <tt>int *</tt>
+372
*
+373
* Zero disables channel coupling for multichannel inputs, nonzer enables
+374
* channel coupling. Setting has no effect on monophonic encoding or
+375
* multichannel counts that do not offer coupling. At present, coupling is
+376
* available for stereo and 5.1 encoding.
+377
*/
+378
#define OV_ECTL_COUPLING_SET 0x41
+379
+380
/* deprecated rate management supported only for compatibility */
+381
+382
/**
+383
* Old interface to querying bitrate management settings.
+384
*
+385
* Deprecated after move to bit-reservoir style management in 1.1 rendered
+386
* this interface partially obsolete.
+387
+388
* \deprecated Please use \ref OV_ECTL_RATEMANAGE2_GET instead.
+389
*
+390
* Argument: <tt>struct ovectl_ratemanage_arg *</tt>
+391
*/
+392
#define OV_ECTL_RATEMANAGE_GET 0x10
+393
/**
+394
* Old interface to modifying bitrate management settings.
+395
*
+396
* deprecated after move to bit-reservoir style management in 1.1 rendered
+397
* this interface partially obsolete.
+398
*
+399
* \deprecated Please use \ref OV_ECTL_RATEMANAGE2_SET instead.
+400
*
+401
* Argument: <tt>struct ovectl_ratemanage_arg *</tt>
+402
*/
+403
#define OV_ECTL_RATEMANAGE_SET 0x11
+404
/**
+405
* Old interface to setting average-bitrate encoding mode.
+406
*
+407
* Deprecated after move to bit-reservoir style management in 1.1 rendered
+408
* this interface partially obsolete.
+409
*
+410
* \deprecated Please use \ref OV_ECTL_RATEMANAGE2_SET instead.
+411
*
+412
* Argument: <tt>struct ovectl_ratemanage_arg *</tt>
+413
*/
+414
#define OV_ECTL_RATEMANAGE_AVG 0x12
+415
/**
+416
* Old interface to setting bounded-bitrate encoding modes.
+417
*
+418
* deprecated after move to bit-reservoir style management in 1.1 rendered
+419
* this interface partially obsolete.
+420
*
+421
* \deprecated Please use \ref OV_ECTL_RATEMANAGE2_SET instead.
+422
*
+423
* Argument: <tt>struct ovectl_ratemanage_arg *</tt>
+424
*/
+425
#define OV_ECTL_RATEMANAGE_HARD 0x13
+426
+427
/*@}*/
+428
+429
+430
+431
#ifdef __cplusplus
+432
}
+433
#endif /* __cplusplus */
+434
+435
#endif
vendor/vorbis/include/vorbis/vorbisfile.hadded
@@ -0,0 +1,205 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 *
+9
* by the Xiph.Org Foundation https://xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: stdio-based convenience library for opening/seeking/decoding
+14
+15
********************************************************************/
+16
+17
#ifndef _OV_FILE_H_
+18
#define _OV_FILE_H_
+19
+20
#ifdef __cplusplus
+21
extern "C"
+22
{
+23
#endif /* __cplusplus */
+24
+25
#include <stdio.h>
+26
#include "codec.h"
+27
+28
/* The function prototypes for the callbacks are basically the same as for
+29
* the stdio functions fread, fseek, fclose, ftell.
+30
* The one difference is that the FILE * arguments have been replaced with
+31
* a void * - this is to be used as a pointer to whatever internal data these
+32
* functions might need. In the stdio case, it's just a FILE * cast to a void *
+33
*
+34
* If you use other functions, check the docs for these functions and return
+35
* the right values. For seek_func(), you *MUST* return -1 if the stream is
+36
* unseekable
+37
*/
+38
typedef struct {
+39
size_t (*read_func) (void *ptr, size_t size, size_t nmemb, void *datasource);
+40
int (*seek_func) (void *datasource, ogg_int64_t offset, int whence);
+41
int (*close_func) (void *datasource);
+42
long (*tell_func) (void *datasource);
+43
} ov_callbacks;
+44
+45
#ifndef OV_EXCLUDE_STATIC_CALLBACKS
+46
+47
/* a few sets of convenient callbacks, especially for use under
+48
* Windows where ov_open_callbacks() should always be used instead of
+49
* ov_open() to avoid problems with incompatible crt.o version linking
+50
* issues. */
+51
+52
static int _ov_header_fseek_wrap(FILE *f,ogg_int64_t off,int whence){
+53
if(f==NULL)return(-1);
+54
+55
#ifdef __MINGW32__
+56
return fseeko64(f,off,whence);
+57
#elif defined (_WIN32)
+58
return _fseeki64(f,off,whence);
+59
#else
+60
return fseek(f,off,whence);
+61
#endif
+62
}
+63
+64
/* These structs below (OV_CALLBACKS_DEFAULT etc) are defined here as
+65
* static data. That means that every file which includes this header
+66
* will get its own copy of these structs whether it uses them or
+67
* not unless it #defines OV_EXCLUDE_STATIC_CALLBACKS.
+68
* These static symbols are essential on platforms such as Windows on
+69
* which several different versions of stdio support may be linked to
+70
* by different DLLs, and we need to be certain we know which one
+71
* we're using (the same one as the main application).
+72
*/
+73
+74
static ov_callbacks OV_CALLBACKS_DEFAULT = {
+75
(size_t (*)(void *, size_t, size_t, void *)) fread,
+76
(int (*)(void *, ogg_int64_t, int)) _ov_header_fseek_wrap,
+77
(int (*)(void *)) fclose,
+78
(long (*)(void *)) ftell
+79
};
+80
+81
static ov_callbacks OV_CALLBACKS_NOCLOSE = {
+82
(size_t (*)(void *, size_t, size_t, void *)) fread,
+83
(int (*)(void *, ogg_int64_t, int)) _ov_header_fseek_wrap,
+84
(int (*)(void *)) NULL,
+85
(long (*)(void *)) ftell
+86
};
+87
+88
static ov_callbacks OV_CALLBACKS_STREAMONLY = {
+89
(size_t (*)(void *, size_t, size_t, void *)) fread,
+90
(int (*)(void *, ogg_int64_t, int)) NULL,
+91
(int (*)(void *)) fclose,
+92
(long (*)(void *)) NULL
+93
};
+94
+95
static ov_callbacks OV_CALLBACKS_STREAMONLY_NOCLOSE = {
+96
(size_t (*)(void *, size_t, size_t, void *)) fread,
+97
(int (*)(void *, ogg_int64_t, int)) NULL,
+98
(int (*)(void *)) NULL,
+99
(long (*)(void *)) NULL
+100
};
+101
+102
#endif
+103
+104
#define NOTOPEN 0
+105
#define PARTOPEN 1
+106
#define OPENED 2
+107
#define STREAMSET 3
+108
#define INITSET 4
+109
+110
typedef struct OggVorbis_File {
+111
void *datasource; /* Pointer to a FILE *, etc. */
+112
int seekable;
+113
ogg_int64_t offset;
+114
ogg_int64_t end;
+115
ogg_sync_state oy;
+116
+117
/* If the FILE handle isn't seekable (eg, a pipe), only the current
+118
stream appears */
+119
int links;
+120
ogg_int64_t *offsets;
+121
ogg_int64_t *dataoffsets;
+122
long *serialnos;
+123
ogg_int64_t *pcmlengths; /* overloaded to maintain binary
+124
compatibility; x2 size, stores both
+125
beginning and end values */
+126
vorbis_info *vi;
+127
vorbis_comment *vc;
+128
+129
/* Decoding working state local storage */
+130
ogg_int64_t pcm_offset;
+131
int ready_state;
+132
long current_serialno;
+133
int current_link;
+134
+135
double bittrack;
+136
double samptrack;
+137
+138
ogg_stream_state os; /* take physical pages, weld into a logical
+139
stream of packets */
+140
vorbis_dsp_state vd; /* central working state for the packet->PCM decoder */
+141
vorbis_block vb; /* local working space for packet->PCM decode */
+142
+143
ov_callbacks callbacks;
+144
+145
} OggVorbis_File;
+146
+147
+148
extern int ov_clear(OggVorbis_File *vf);
+149
extern int ov_fopen(const char *path,OggVorbis_File *vf);
+150
extern int ov_open(FILE *f,OggVorbis_File *vf,const char *initial,long ibytes);
+151
extern int ov_open_callbacks(void *datasource, OggVorbis_File *vf,
+152
const char *initial, long ibytes, ov_callbacks callbacks);
+153
+154
extern int ov_test(FILE *f,OggVorbis_File *vf,const char *initial,long ibytes);
+155
extern int ov_test_callbacks(void *datasource, OggVorbis_File *vf,
+156
const char *initial, long ibytes, ov_callbacks callbacks);
+157
extern int ov_test_open(OggVorbis_File *vf);
+158
+159
extern long ov_bitrate(OggVorbis_File *vf,int i);
+160
extern long ov_bitrate_instant(OggVorbis_File *vf);
+161
extern long ov_streams(OggVorbis_File *vf);
+162
extern long ov_seekable(OggVorbis_File *vf);
+163
extern long ov_serialnumber(OggVorbis_File *vf,int i);
+164
+165
extern ogg_int64_t ov_raw_total(OggVorbis_File *vf,int i);
+166
extern ogg_int64_t ov_pcm_total(OggVorbis_File *vf,int i);
+167
extern double ov_time_total(OggVorbis_File *vf,int i);
+168
+169
extern int ov_raw_seek(OggVorbis_File *vf,ogg_int64_t pos);
+170
extern int ov_pcm_seek(OggVorbis_File *vf,ogg_int64_t pos);
+171
extern int ov_pcm_seek_page(OggVorbis_File *vf,ogg_int64_t pos);
+172
extern int ov_time_seek(OggVorbis_File *vf,double pos);
+173
extern int ov_time_seek_page(OggVorbis_File *vf,double pos);
+174
+175
extern int ov_raw_seek_lap(OggVorbis_File *vf,ogg_int64_t pos);
+176
extern int ov_pcm_seek_lap(OggVorbis_File *vf,ogg_int64_t pos);
+177
extern int ov_pcm_seek_page_lap(OggVorbis_File *vf,ogg_int64_t pos);
+178
extern int ov_time_seek_lap(OggVorbis_File *vf,double pos);
+179
extern int ov_time_seek_page_lap(OggVorbis_File *vf,double pos);
+180
+181
extern ogg_int64_t ov_raw_tell(OggVorbis_File *vf);
+182
extern ogg_int64_t ov_pcm_tell(OggVorbis_File *vf);
+183
extern double ov_time_tell(OggVorbis_File *vf);
+184
+185
extern vorbis_info *ov_info(OggVorbis_File *vf,int link);
+186
extern vorbis_comment *ov_comment(OggVorbis_File *vf,int link);
+187
+188
extern long ov_read_float(OggVorbis_File *vf,float ***pcm_channels,int samples,
+189
int *bitstream);
+190
extern long ov_read_filter(OggVorbis_File *vf,char *buffer,int length,
+191
int bigendianp,int word,int sgned,int *bitstream,
+192
void (*filter)(float **pcm,long channels,long samples,void *filter_param),void *filter_param);
+193
extern long ov_read(OggVorbis_File *vf,char *buffer,int length,
+194
int bigendianp,int word,int sgned,int *bitstream);
+195
extern int ov_crosslap(OggVorbis_File *vf1,OggVorbis_File *vf2);
+196
+197
extern int ov_halfrate(OggVorbis_File *vf,int flag);
+198
extern int ov_halfrate_p(OggVorbis_File *vf);
+199
+200
#ifdef __cplusplus
+201
}
+202
#endif /* __cplusplus */
+203
+204
#endif
+205
vendor/vorbis/lib/analysis.cadded
@@ -0,0 +1,119 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 *
+9
* by the Xiph.Org Foundation https://xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: single-block PCM analysis mode dispatch
+14
+15
********************************************************************/
+16
+17
#include <stdio.h>
+18
#include <string.h>
+19
#include <math.h>
+20
#include <ogg/ogg.h>
+21
#include "vorbis/codec.h"
+22
#include "codec_internal.h"
+23
#include "registry.h"
+24
#include "scales.h"
+25
#include "os.h"
+26
#include "misc.h"
+27
+28
/* decides between modes, dispatches to the appropriate mapping. */
+29
int vorbis_analysis(vorbis_block *vb, ogg_packet *op){
+30
int ret,i;
+31
vorbis_block_internal *vbi=vb->internal;
+32
+33
vb->glue_bits=0;
+34
vb->time_bits=0;
+35
vb->floor_bits=0;
+36
vb->res_bits=0;
+37
+38
/* first things first. Make sure encode is ready */
+39
for(i=0;i<PACKETBLOBS;i++)
+40
oggpack_reset(vbi->packetblob[i]);
+41
+42
/* we only have one mapping type (0), and we let the mapping code
+43
itself figure out what soft mode to use. This allows easier
+44
bitrate management */
+45
+46
if((ret=_mapping_P[0]->forward(vb)))
+47
return(ret);
+48
+49
if(op){
+50
if(vorbis_bitrate_managed(vb))
+51
/* The app is using a bitmanaged mode... but not using the
+52
bitrate management interface. */
+53
return(OV_EINVAL);
+54
+55
op->packet=oggpack_get_buffer(&vb->opb);
+56
op->bytes=oggpack_bytes(&vb->opb);
+57
op->b_o_s=0;
+58
op->e_o_s=vb->eofflag;
+59
op->granulepos=vb->granulepos;
+60
op->packetno=vb->sequence; /* for sake of completeness */
+61
}
+62
return(0);
+63
}
+64
+65
#ifdef ANALYSIS
+66
int analysis_noisy=1;
+67
+68
/* there was no great place to put this.... */
+69
void _analysis_output_always(char *base,int i,float *v,int n,int bark,int dB,ogg_int64_t off){
+70
int j;
+71
FILE *of;
+72
char buffer[80];
+73
+74
sprintf(buffer,"%s_%d.m",base,i);
+75
of=fopen(buffer,"w");
+76
+77
if(!of)perror("failed to open data dump file");
+78
+79
for(j=0;j<n;j++){
+80
if(bark){
+81
float b=toBARK((4000.f*j/n)+.25);
+82
fprintf(of,"%f ",b);
+83
}else
+84
if(off!=0)
+85
fprintf(of,"%f ",(double)(j+off)/8000.);
+86
else
+87
fprintf(of,"%f ",(double)j);
+88
+89
if(dB){
+90
float val;
+91
if(v[j]==0.)
+92
val=-140.;
+93
else
+94
val=todB(v+j);
+95
fprintf(of,"%f\n",val);
+96
}else{
+97
fprintf(of,"%f\n",v[j]);
+98
}
+99
}
+100
fclose(of);
+101
}
+102
+103
void _analysis_output(char *base,int i,float *v,int n,int bark,int dB,
+104
ogg_int64_t off){
+105
if(analysis_noisy)_analysis_output_always(base,i,v,n,bark,dB,off);
+106
}
+107
+108
#endif
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
vendor/vorbis/lib/backends.hadded
@@ -0,0 +1,143 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 *
+9
* by the Xiph.Org Foundation https://xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: libvorbis backend and mapping structures; needed for
+14
static mode headers
+15
+16
********************************************************************/
+17
+18
/* this is exposed up here because we need it for static modes.
+19
Lookups for each backend aren't exposed because there's no reason
+20
to do so */
+21
+22
#ifndef _vorbis_backend_h_
+23
#define _vorbis_backend_h_
+24
+25
#include "codec_internal.h"
+26
+27
/* this would all be simpler/shorter with templates, but.... */
+28
/* Floor backend generic *****************************************/
+29
typedef struct{
+30
void (*pack) (vorbis_info_floor *,oggpack_buffer *);
+31
vorbis_info_floor *(*unpack)(vorbis_info *,oggpack_buffer *);
+32
vorbis_look_floor *(*look) (vorbis_dsp_state *,vorbis_info_floor *);
+33
void (*free_info) (vorbis_info_floor *);
+34
void (*free_look) (vorbis_look_floor *);
+35
void *(*inverse1) (struct vorbis_block *,vorbis_look_floor *);
+36
int (*inverse2) (struct vorbis_block *,vorbis_look_floor *,
+37
void *buffer,float *);
+38
} vorbis_func_floor;
+39
+40
typedef struct{
+41
int order;
+42
long rate;
+43
long barkmap;
+44
+45
int ampbits;
+46
int ampdB;
+47
+48
int numbooks; /* <= 16 */
+49
int books[16];
+50
+51
float lessthan; /* encode-only config setting hacks for libvorbis */
+52
float greaterthan; /* encode-only config setting hacks for libvorbis */
+53
+54
} vorbis_info_floor0;
+55
+56
+57
#define VIF_POSIT 63
+58
#define VIF_CLASS 16
+59
#define VIF_PARTS 31
+60
typedef struct{
+61
int partitions; /* 0 to 31 */
+62
int partitionclass[VIF_PARTS]; /* 0 to 15 */
+63
+64
int class_dim[VIF_CLASS]; /* 1 to 8 */
+65
int class_subs[VIF_CLASS]; /* 0,1,2,3 (bits: 1<<n poss) */
+66
int class_book[VIF_CLASS]; /* subs ^ dim entries */
+67
int class_subbook[VIF_CLASS][8]; /* [VIF_CLASS][subs] */
+68
+69
+70
int mult; /* 1 2 3 or 4 */
+71
int postlist[VIF_POSIT+2]; /* first two implicit */
+72
+73
+74
/* encode side analysis parameters */
+75
float maxover;
+76
float maxunder;
+77
float maxerr;
+78
+79
float twofitweight;
+80
float twofitatten;
+81
+82
int n;
+83
+84
} vorbis_info_floor1;
+85
+86
/* Residue backend generic *****************************************/
+87
typedef struct{
+88
void (*pack) (vorbis_info_residue *,oggpack_buffer *);
+89
vorbis_info_residue *(*unpack)(vorbis_info *,oggpack_buffer *);
+90
vorbis_look_residue *(*look) (vorbis_dsp_state *,
+91
vorbis_info_residue *);
+92
void (*free_info) (vorbis_info_residue *);
+93
void (*free_look) (vorbis_look_residue *);
+94
long **(*class) (struct vorbis_block *,vorbis_look_residue *,
+95
int **,int *,int);
+96
int (*forward) (oggpack_buffer *,struct vorbis_block *,
+97
vorbis_look_residue *,
+98
int **,int *,int,long **,int);
+99
int (*inverse) (struct vorbis_block *,vorbis_look_residue *,
+100
float **,int *,int);
+101
} vorbis_func_residue;
+102
+103
typedef struct vorbis_info_residue0{
+104
/* block-partitioned VQ coded straight residue */
+105
long begin;
+106
long end;
+107
+108
/* first stage (lossless partitioning) */
+109
int grouping; /* group n vectors per partition */
+110
int partitions; /* possible codebooks for a partition */
+111
int partvals; /* partitions ^ groupbook dim */
+112
int groupbook; /* huffbook for partitioning */
+113
int secondstages[64]; /* expanded out to pointers in lookup */
+114
int booklist[512]; /* list of second stage books */
+115
+116
const int classmetric1[64];
+117
const int classmetric2[64];
+118
} vorbis_info_residue0;
+119
+120
/* Mapping backend generic *****************************************/
+121
typedef struct{
+122
void (*pack) (vorbis_info *,vorbis_info_mapping *,
+123
oggpack_buffer *);
+124
vorbis_info_mapping *(*unpack)(vorbis_info *,oggpack_buffer *);
+125
void (*free_info) (vorbis_info_mapping *);
+126
int (*forward) (struct vorbis_block *vb);
+127
int (*inverse) (struct vorbis_block *vb,vorbis_info_mapping *);
+128
} vorbis_func_mapping;
+129
+130
typedef struct vorbis_info_mapping0{
+131
int submaps; /* <= 16 */
+132
int chmuxlist[256]; /* up to 256 channels in a Vorbis stream */
+133
+134
int floorsubmap[16]; /* [mux] submap to floors */
+135
int residuesubmap[16]; /* [mux] submap to residue */
+136
+137
int coupling_steps;
+138
int coupling_mag[256];
+139
int coupling_ang[256];
+140
+141
} vorbis_info_mapping0;
+142
+143
#endif
vendor/vorbis/lib/bitrate.cadded
@@ -0,0 +1,252 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 *
+9
* by the Xiph.Org Foundation https://xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: bitrate tracking and management
+14
+15
********************************************************************/
+16
+17
#include <stdlib.h>
+18
#include <string.h>
+19
#include <math.h>
+20
#include <ogg/ogg.h>
+21
#include "vorbis/codec.h"
+22
#include "codec_internal.h"
+23
#include "os.h"
+24
#include "misc.h"
+25
#include "bitrate.h"
+26
+27
/* compute bitrate tracking setup */
+28
void vorbis_bitrate_init(vorbis_info *vi,bitrate_manager_state *bm){
+29
codec_setup_info *ci=vi->codec_setup;
+30
bitrate_manager_info *bi=&ci->bi;
+31
+32
memset(bm,0,sizeof(*bm));
+33
+34
if(bi && (bi->reservoir_bits>0)){
+35
long ratesamples=vi->rate;
+36
int halfsamples=ci->blocksizes[0]>>1;
+37
+38
bm->short_per_long=ci->blocksizes[1]/ci->blocksizes[0];
+39
bm->managed=1;
+40
+41
bm->avg_bitsper= rint(1.*bi->avg_rate*halfsamples/ratesamples);
+42
bm->min_bitsper= rint(1.*bi->min_rate*halfsamples/ratesamples);
+43
bm->max_bitsper= rint(1.*bi->max_rate*halfsamples/ratesamples);
+44
+45
bm->avgfloat=PACKETBLOBS/2;
+46
+47
/* not a necessary fix, but one that leads to a more balanced
+48
typical initialization */
+49
{
+50
long desired_fill=bi->reservoir_bits*bi->reservoir_bias;
+51
bm->minmax_reservoir=desired_fill;
+52
bm->avg_reservoir=desired_fill;
+53
}
+54
+55
}
+56
}
+57
+58
void vorbis_bitrate_clear(bitrate_manager_state *bm){
+59
memset(bm,0,sizeof(*bm));
+60
return;
+61
}
+62
+63
int vorbis_bitrate_managed(vorbis_block *vb){
+64
vorbis_dsp_state *vd=vb->vd;
+65
private_state *b=vd->backend_state;
+66
bitrate_manager_state *bm=&b->bms;
+67
+68
if(bm && bm->managed)return(1);
+69
return(0);
+70
}
+71
+72
/* finish taking in the block we just processed */
+73
int vorbis_bitrate_addblock(vorbis_block *vb){
+74
vorbis_block_internal *vbi=vb->internal;
+75
vorbis_dsp_state *vd=vb->vd;
+76
private_state *b=vd->backend_state;
+77
bitrate_manager_state *bm=&b->bms;
+78
vorbis_info *vi=vd->vi;
+79
codec_setup_info *ci=vi->codec_setup;
+80
bitrate_manager_info *bi=&ci->bi;
+81
+82
int choice=rint(bm->avgfloat);
+83
long this_bits=oggpack_bytes(vbi->packetblob[choice])*8;
+84
long min_target_bits=(vb->W?bm->min_bitsper*bm->short_per_long:bm->min_bitsper);
+85
long max_target_bits=(vb->W?bm->max_bitsper*bm->short_per_long:bm->max_bitsper);
+86
int samples=ci->blocksizes[vb->W]>>1;
+87
long desired_fill=bi->reservoir_bits*bi->reservoir_bias;
+88
if(!bm->managed){
+89
/* not a bitrate managed stream, but for API simplicity, we'll
+90
buffer the packet to keep the code path clean */
+91
+92
if(bm->vb)return(-1); /* one has been submitted without
+93
being claimed */
+94
bm->vb=vb;
+95
return(0);
+96
}
+97
+98
bm->vb=vb;
+99
+100
/* look ahead for avg floater */
+101
if(bm->avg_bitsper>0){
+102
double slew=0.;
+103
long avg_target_bits=(vb->W?bm->avg_bitsper*bm->short_per_long:bm->avg_bitsper);
+104
double slewlimit= 15./bi->slew_damp;
+105
+106
/* choosing a new floater:
+107
if we're over target, we slew down
+108
if we're under target, we slew up
+109
+110
choose slew as follows: look through packetblobs of this frame
+111
and set slew as the first in the appropriate direction that
+112
gives us the slew we want. This may mean no slew if delta is
+113
already favorable.
+114
+115
Then limit slew to slew max */
+116
+117
if(bm->avg_reservoir+(this_bits-avg_target_bits)>desired_fill){
+118
while(choice>0 && this_bits>avg_target_bits &&
+119
bm->avg_reservoir+(this_bits-avg_target_bits)>desired_fill){
+120
choice--;
+121
this_bits=oggpack_bytes(vbi->packetblob[choice])*8;
+122
}
+123
}else if(bm->avg_reservoir+(this_bits-avg_target_bits)<desired_fill){
+124
while(choice+1<PACKETBLOBS && this_bits<avg_target_bits &&
+125
bm->avg_reservoir+(this_bits-avg_target_bits)<desired_fill){
+126
choice++;
+127
this_bits=oggpack_bytes(vbi->packetblob[choice])*8;
+128
}
+129
}
+130
+131
slew=rint(choice-bm->avgfloat)/samples*vi->rate;
+132
if(slew<-slewlimit)slew=-slewlimit;
+133
if(slew>slewlimit)slew=slewlimit;
+134
choice=rint(bm->avgfloat+= slew/vi->rate*samples);
+135
this_bits=oggpack_bytes(vbi->packetblob[choice])*8;
+136
}
+137
+138
+139
+140
/* enforce min(if used) on the current floater (if used) */
+141
if(bm->min_bitsper>0){
+142
/* do we need to force the bitrate up? */
+143
if(this_bits<min_target_bits){
+144
while(bm->minmax_reservoir-(min_target_bits-this_bits)<0){
+145
choice++;
+146
if(choice>=PACKETBLOBS)break;
+147
this_bits=oggpack_bytes(vbi->packetblob[choice])*8;
+148
}
+149
}
+150
}
+151
+152
/* enforce max (if used) on the current floater (if used) */
+153
if(bm->max_bitsper>0){
+154
/* do we need to force the bitrate down? */
+155
if(this_bits>max_target_bits){
+156
while(bm->minmax_reservoir+(this_bits-max_target_bits)>bi->reservoir_bits){
+157
choice--;
+158
if(choice<0)break;
+159
this_bits=oggpack_bytes(vbi->packetblob[choice])*8;
+160
}
+161
}
+162
}
+163
+164
/* Choice of packetblobs now made based on floater, and min/max
+165
requirements. Now boundary check extreme choices */
+166
+167
if(choice<0){
+168
/* choosing a smaller packetblob is insufficient to trim bitrate.
+169
frame will need to be truncated */
+170
long maxsize=(max_target_bits+(bi->reservoir_bits-bm->minmax_reservoir))/8;
+171
bm->choice=choice=0;
+172
+173
if(oggpack_bytes(vbi->packetblob[choice])>maxsize){
+174
+175
oggpack_writetrunc(vbi->packetblob[choice],maxsize*8);
+176
this_bits=oggpack_bytes(vbi->packetblob[choice])*8;
+177
}
+178
}else{
+179
long minsize=(min_target_bits-bm->minmax_reservoir+7)/8;
+180
if(choice>=PACKETBLOBS)
+181
choice=PACKETBLOBS-1;
+182
+183
bm->choice=choice;
+184
+185
/* prop up bitrate according to demand. pad this frame out with zeroes */
+186
minsize-=oggpack_bytes(vbi->packetblob[choice]);
+187
while(minsize-->0)oggpack_write(vbi->packetblob[choice],0,8);
+188
this_bits=oggpack_bytes(vbi->packetblob[choice])*8;
+189
+190
}
+191
+192
/* now we have the final packet and the final packet size. Update statistics */
+193
/* min and max reservoir */
+194
if(bm->min_bitsper>0 || bm->max_bitsper>0){
+195
+196
if(max_target_bits>0 && this_bits>max_target_bits){
+197
bm->minmax_reservoir+=(this_bits-max_target_bits);
+198
}else if(min_target_bits>0 && this_bits<min_target_bits){
+199
bm->minmax_reservoir+=(this_bits-min_target_bits);
+200
}else{
+201
/* inbetween; we want to take reservoir toward but not past desired_fill */
+202
if(bm->minmax_reservoir>desired_fill){
+203
if(max_target_bits>0){ /* logical bulletproofing against initialization state */
+204
bm->minmax_reservoir+=(this_bits-max_target_bits);
+205
if(bm->minmax_reservoir<desired_fill)bm->minmax_reservoir=desired_fill;
+206
}else{
+207
bm->minmax_reservoir=desired_fill;
+208
}
+209
}else{
+210
if(min_target_bits>0){ /* logical bulletproofing against initialization state */
+211
bm->minmax_reservoir+=(this_bits-min_target_bits);
+212
if(bm->minmax_reservoir>desired_fill)bm->minmax_reservoir=desired_fill;
+213
}else{
+214
bm->minmax_reservoir=desired_fill;
+215
}
+216
}
+217
}
+218
}
+219
+220
/* avg reservoir */
+221
if(bm->avg_bitsper>0){
+222
long avg_target_bits=(vb->W?bm->avg_bitsper*bm->short_per_long:bm->avg_bitsper);
+223
bm->avg_reservoir+=this_bits-avg_target_bits;
+224
}
+225
+226
return(0);
+227
}
+228
+229
int vorbis_bitrate_flushpacket(vorbis_dsp_state *vd,ogg_packet *op){
+230
private_state *b=vd->backend_state;
+231
bitrate_manager_state *bm=&b->bms;
+232
vorbis_block *vb=bm->vb;
+233
int choice=PACKETBLOBS/2;
+234
if(!vb)return 0;
+235
+236
if(op){
+237
vorbis_block_internal *vbi=vb->internal;
+238
+239
if(vorbis_bitrate_managed(vb))
+240
choice=bm->choice;
+241
+242
op->packet=oggpack_get_buffer(vbi->packetblob[choice]);
+243
op->bytes=oggpack_bytes(vbi->packetblob[choice]);
+244
op->b_o_s=0;
+245
op->e_o_s=vb->eofflag;
+246
op->granulepos=vb->granulepos;
+247
op->packetno=vb->sequence; /* for sake of completeness */
+248
}
+249
+250
bm->vb=0;
+251
return(1);
+252
}
vendor/vorbis/lib/bitrate.hadded
@@ -0,0 +1,58 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 *
+9
* by the Xiph.Org Foundation https://xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: bitrate tracking and management
+14
+15
********************************************************************/
+16
+17
#ifndef _V_BITRATE_H_
+18
#define _V_BITRATE_H_
+19
+20
#include "vorbis/codec.h"
+21
#include "codec_internal.h"
+22
#include "os.h"
+23
+24
/* encode side bitrate tracking */
+25
typedef struct bitrate_manager_state {
+26
int managed;
+27
+28
long avg_reservoir;
+29
long minmax_reservoir;
+30
long avg_bitsper;
+31
long min_bitsper;
+32
long max_bitsper;
+33
+34
long short_per_long;
+35
double avgfloat;
+36
+37
vorbis_block *vb;
+38
int choice;
+39
} bitrate_manager_state;
+40
+41
typedef struct bitrate_manager_info{
+42
long avg_rate;
+43
long min_rate;
+44
long max_rate;
+45
long reservoir_bits;
+46
double reservoir_bias;
+47
+48
double slew_damp;
+49
+50
} bitrate_manager_info;
+51
+52
extern void vorbis_bitrate_init(vorbis_info *vi,bitrate_manager_state *bs);
+53
extern void vorbis_bitrate_clear(bitrate_manager_state *bs);
+54
extern int vorbis_bitrate_managed(vorbis_block *vb);
+55
extern int vorbis_bitrate_addblock(vorbis_block *vb);
+56
extern int vorbis_bitrate_flushpacket(vorbis_dsp_state *vd, ogg_packet *op);
+57
+58
#endif
vendor/vorbis/lib/block.cadded
@@ -0,0 +1,1046 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2015 *
+9
* by the Xiph.Org Foundation https://xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: PCM data vector blocking, windowing and dis/reassembly
+14
+15
Handle windowing, overlap-add, etc of the PCM vectors. This is made
+16
more amusing by Vorbis' current two allowed block sizes.
+17
+18
********************************************************************/
+19
+20
#include <stdio.h>
+21
#include <stdlib.h>
+22
#include <string.h>
+23
#include <ogg/ogg.h>
+24
#include "vorbis/codec.h"
+25
#include "codec_internal.h"
+26
+27
#include "window.h"
+28
#include "mdct.h"
+29
#include "lpc.h"
+30
#include "registry.h"
+31
#include "misc.h"
+32
+33
/* pcm accumulator examples (not exhaustive):
+34
+35
<-------------- lW ---------------->
+36
<--------------- W ---------------->
+37
: .....|..... _______________ |
+38
: .''' | '''_--- | |\ |
+39
:.....''' |_____--- '''......| | \_______|
+40
:.................|__________________|_______|__|______|
+41
|<------ Sl ------>| > Sr < |endW
+42
|beginSl |endSl | |endSr
+43
|beginW |endlW |beginSr
+44
+45
+46
|< lW >|
+47
<--------------- W ---------------->
+48
| | .. ______________ |
+49
| | ' `/ | ---_ |
+50
|___.'___/`. | ---_____|
+51
|_______|__|_______|_________________|
+52
| >|Sl|< |<------ Sr ----->|endW
+53
| | |endSl |beginSr |endSr
+54
|beginW | |endlW
+55
mult[0] |beginSl mult[n]
+56
+57
<-------------- lW ----------------->
+58
|<--W-->|
+59
: .............. ___ | |
+60
: .''' |`/ \ | |
+61
:.....''' |/`....\|...|
+62
:.........................|___|___|___|
+63
|Sl |Sr |endW
+64
| | |endSr
+65
| |beginSr
+66
| |endSl
+67
|beginSl
+68
|beginW
+69
*/
+70
+71
/* block abstraction setup *********************************************/
+72
+73
#ifndef WORD_ALIGN
+74
#define WORD_ALIGN 8
+75
#endif
+76
+77
int vorbis_block_init(vorbis_dsp_state *v, vorbis_block *vb){
+78
int i;
+79
memset(vb,0,sizeof(*vb));
+80
vb->vd=v;
+81
vb->localalloc=0;
+82
vb->localstore=NULL;
+83
if(v->analysisp){
+84
vorbis_block_internal *vbi=
+85
vb->internal=_ogg_calloc(1,sizeof(vorbis_block_internal));
+86
vbi->ampmax=-9999;
+87
+88
for(i=0;i<PACKETBLOBS;i++){
+89
if(i==PACKETBLOBS/2){
+90
vbi->packetblob[i]=&vb->opb;
+91
}else{
+92
vbi->packetblob[i]=
+93
_ogg_calloc(1,sizeof(oggpack_buffer));
+94
}
+95
oggpack_writeinit(vbi->packetblob[i]);
+96
}
+97
}
+98
+99
return(0);
+100
}
+101
+102
void *_vorbis_block_alloc(vorbis_block *vb,long bytes){
+103
bytes=(bytes+(WORD_ALIGN-1)) & ~(WORD_ALIGN-1);
+104
if(bytes+vb->localtop>vb->localalloc){
+105
/* can't just _ogg_realloc... there are outstanding pointers */
+106
if(vb->localstore){
+107
struct alloc_chain *link=_ogg_malloc(sizeof(*link));
+108
vb->totaluse+=vb->localtop;
+109
link->next=vb->reap;
+110
link->ptr=vb->localstore;
+111
vb->reap=link;
+112
}
+113
/* highly conservative */
+114
vb->localalloc=bytes;
+115
vb->localstore=_ogg_malloc(vb->localalloc);
+116
vb->localtop=0;
+117
}
+118
{
+119
void *ret=(void *)(((char *)vb->localstore)+vb->localtop);
+120
vb->localtop+=bytes;
+121
return ret;
+122
}
+123
}
+124
+125
/* reap the chain, pull the ripcord */
+126
void _vorbis_block_ripcord(vorbis_block *vb){
+127
/* reap the chain */
+128
struct alloc_chain *reap=vb->reap;
+129
while(reap){
+130
struct alloc_chain *next=reap->next;
+131
_ogg_free(reap->ptr);
+132
memset(reap,0,sizeof(*reap));
+133
_ogg_free(reap);
+134
reap=next;
+135
}
+136
/* consolidate storage */
+137
if(vb->totaluse){
+138
vb->localstore=_ogg_realloc(vb->localstore,vb->totaluse+vb->localalloc);
+139
vb->localalloc+=vb->totaluse;
+140
vb->totaluse=0;
+141
}
+142
+143
/* pull the ripcord */
+144
vb->localtop=0;
+145
vb->reap=NULL;
+146
}
+147
+148
int vorbis_block_clear(vorbis_block *vb){
+149
int i;
+150
vorbis_block_internal *vbi=vb->internal;
+151
+152
_vorbis_block_ripcord(vb);
+153
if(vb->localstore)_ogg_free(vb->localstore);
+154
+155
if(vbi){
+156
for(i=0;i<PACKETBLOBS;i++){
+157
oggpack_writeclear(vbi->packetblob[i]);
+158
if(i!=PACKETBLOBS/2)_ogg_free(vbi->packetblob[i]);
+159
}
+160
_ogg_free(vbi);
+161
}
+162
memset(vb,0,sizeof(*vb));
+163
return(0);
+164
}
+165
+166
/* Analysis side code, but directly related to blocking. Thus it's
+167
here and not in analysis.c (which is for analysis transforms only).
+168
The init is here because some of it is shared */
+169
+170
static int _vds_shared_init(vorbis_dsp_state *v,vorbis_info *vi,int encp){
+171
int i;
+172
codec_setup_info *ci=vi->codec_setup;
+173
private_state *b=NULL;
+174
int hs;
+175
+176
if(ci==NULL||
+177
ci->modes<=0||
+178
ci->blocksizes[0]<64||
+179
ci->blocksizes[1]<ci->blocksizes[0]){
+180
return 1;
+181
}
+182
hs=ci->halfrate_flag;
+183
+184
memset(v,0,sizeof(*v));
+185
b=v->backend_state=_ogg_calloc(1,sizeof(*b));
+186
+187
v->vi=vi;
+188
b->modebits=ov_ilog(ci->modes-1);
+189
+190
b->transform[0]=_ogg_calloc(VI_TRANSFORMB,sizeof(*b->transform[0]));
+191
b->transform[1]=_ogg_calloc(VI_TRANSFORMB,sizeof(*b->transform[1]));
+192
+193
/* MDCT is tranform 0 */
+194
+195
b->transform[0][0]=_ogg_calloc(1,sizeof(mdct_lookup));
+196
b->transform[1][0]=_ogg_calloc(1,sizeof(mdct_lookup));
+197
mdct_init(b->transform[0][0],ci->blocksizes[0]>>hs);
+198
mdct_init(b->transform[1][0],ci->blocksizes[1]>>hs);
+199
+200
/* Vorbis I uses only window type 0 */
+201
/* note that the correct computation below is technically:
+202
b->window[0]=ov_ilog(ci->blocksizes[0]-1)-6;
+203
b->window[1]=ov_ilog(ci->blocksizes[1]-1)-6;
+204
but since blocksizes are always powers of two,
+205
the below is equivalent.
+206
*/
+207
b->window[0]=ov_ilog(ci->blocksizes[0])-7;
+208
b->window[1]=ov_ilog(ci->blocksizes[1])-7;
+209
+210
if(encp){ /* encode/decode differ here */
+211
+212
/* analysis always needs an fft */
+213
drft_init(&b->fft_look[0],ci->blocksizes[0]);
+214
drft_init(&b->fft_look[1],ci->blocksizes[1]);
+215
+216
/* finish the codebooks */
+217
if(!ci->fullbooks){
+218
ci->fullbooks=_ogg_calloc(ci->books,sizeof(*ci->fullbooks));
+219
for(i=0;i<ci->books;i++)
+220
vorbis_book_init_encode(ci->fullbooks+i,ci->book_param[i]);
+221
}
+222
+223
b->psy=_ogg_calloc(ci->psys,sizeof(*b->psy));
+224
for(i=0;i<ci->psys;i++){
+225
_vp_psy_init(b->psy+i,
+226
ci->psy_param[i],
+227
&ci->psy_g_param,
+228
ci->blocksizes[ci->psy_param[i]->blockflag]/2,
+229
vi->rate);
+230
}
+231
+232
v->analysisp=1;
+233
}else{
+234
/* finish the codebooks */
+235
if(!ci->fullbooks){
+236
ci->fullbooks=_ogg_calloc(ci->books,sizeof(*ci->fullbooks));
+237
for(i=0;i<ci->books;i++){
+238
if(ci->book_param[i]==NULL)
+239
goto abort_books;
+240
if(vorbis_book_init_decode(ci->fullbooks+i,ci->book_param[i]))
+241
goto abort_books;
+242
/* decode codebooks are now standalone after init */
+243
vorbis_staticbook_destroy(ci->book_param[i]);
+244
ci->book_param[i]=NULL;
+245
}
+246
}
+247
}
+248
+249
/* initialize the storage vectors. blocksize[1] is small for encode,
+250
but the correct size for decode */
+251
v->pcm_storage=ci->blocksizes[1];
+252
v->pcm=_ogg_malloc(vi->channels*sizeof(*v->pcm));
+253
v->pcmret=_ogg_malloc(vi->channels*sizeof(*v->pcmret));
+254
{
+255
int i;
+256
for(i=0;i<vi->channels;i++)
+257
v->pcm[i]=_ogg_calloc(v->pcm_storage,sizeof(*v->pcm[i]));
+258
}
+259
+260
/* all 1 (large block) or 0 (small block) */
+261
/* explicitly set for the sake of clarity */
+262
v->lW=0; /* previous window size */
+263
v->W=0; /* current window size */
+264
+265
/* all vector indexes */
+266
v->centerW=ci->blocksizes[1]/2;
+267
+268
v->pcm_current=v->centerW;
+269
+270
/* initialize all the backend lookups */
+271
b->flr=_ogg_calloc(ci->floors,sizeof(*b->flr));
+272
b->residue=_ogg_calloc(ci->residues,sizeof(*b->residue));
+273
+274
for(i=0;i<ci->floors;i++)
+275
b->flr[i]=_floor_P[ci->floor_type[i]]->
+276
look(v,ci->floor_param[i]);
+277
+278
for(i=0;i<ci->residues;i++)
+279
b->residue[i]=_residue_P[ci->residue_type[i]]->
+280
look(v,ci->residue_param[i]);
+281
+282
return 0;
+283
abort_books:
+284
for(i=0;i<ci->books;i++){
+285
if(ci->book_param[i]!=NULL){
+286
vorbis_staticbook_destroy(ci->book_param[i]);
+287
ci->book_param[i]=NULL;
+288
}
+289
}
+290
vorbis_dsp_clear(v);
+291
return -1;
+292
}
+293
+294
/* arbitrary settings and spec-mandated numbers get filled in here */
+295
int vorbis_analysis_init(vorbis_dsp_state *v,vorbis_info *vi){
+296
private_state *b=NULL;
+297
+298
if(_vds_shared_init(v,vi,1))return 1;
+299
b=v->backend_state;
+300
b->psy_g_look=_vp_global_look(vi);
+301
+302
/* Initialize the envelope state storage */
+303
b->ve=_ogg_calloc(1,sizeof(*b->ve));
+304
_ve_envelope_init(b->ve,vi);
+305
+306
vorbis_bitrate_init(vi,&b->bms);
+307
+308
/* compressed audio packets start after the headers
+309
with sequence number 3 */
+310
v->sequence=3;
+311
+312
return(0);
+313
}
+314
+315
void vorbis_dsp_clear(vorbis_dsp_state *v){
+316
int i;
+317
if(v){
+318
vorbis_info *vi=v->vi;
+319
codec_setup_info *ci=(vi?vi->codec_setup:NULL);
+320
private_state *b=v->backend_state;
+321
+322
if(b){
+323
+324
if(b->ve){
+325
_ve_envelope_clear(b->ve);
+326
_ogg_free(b->ve);
+327
}
+328
+329
if(b->transform[0]){
+330
mdct_clear(b->transform[0][0]);
+331
_ogg_free(b->transform[0][0]);
+332
_ogg_free(b->transform[0]);
+333
}
+334
if(b->transform[1]){
+335
mdct_clear(b->transform[1][0]);
+336
_ogg_free(b->transform[1][0]);
+337
_ogg_free(b->transform[1]);
+338
}
+339
+340
if(b->flr){
+341
if(ci)
+342
for(i=0;i<ci->floors;i++)
+343
_floor_P[ci->floor_type[i]]->
+344
free_look(b->flr[i]);
+345
_ogg_free(b->flr);
+346
}
+347
if(b->residue){
+348
if(ci)
+349
for(i=0;i<ci->residues;i++)
+350
_residue_P[ci->residue_type[i]]->
+351
free_look(b->residue[i]);
+352
_ogg_free(b->residue);
+353
}
+354
if(b->psy){
+355
if(ci)
+356
for(i=0;i<ci->psys;i++)
+357
_vp_psy_clear(b->psy+i);
+358
_ogg_free(b->psy);
+359
}
+360
+361
if(b->psy_g_look)_vp_global_free(b->psy_g_look);
+362
vorbis_bitrate_clear(&b->bms);
+363
+364
drft_clear(&b->fft_look[0]);
+365
drft_clear(&b->fft_look[1]);
+366
+367
}
+368
+369
if(v->pcm){
+370
if(vi)
+371
for(i=0;i<vi->channels;i++)
+372
if(v->pcm[i])_ogg_free(v->pcm[i]);
+373
_ogg_free(v->pcm);
+374
if(v->pcmret)_ogg_free(v->pcmret);
+375
}
+376
+377
if(b){
+378
/* free header, header1, header2 */
+379
if(b->header)_ogg_free(b->header);
+380
if(b->header1)_ogg_free(b->header1);
+381
if(b->header2)_ogg_free(b->header2);
+382
_ogg_free(b);
+383
}
+384
+385
memset(v,0,sizeof(*v));
+386
}
+387
}
+388
+389
float **vorbis_analysis_buffer(vorbis_dsp_state *v, int vals){
+390
int i;
+391
vorbis_info *vi=v->vi;
+392
private_state *b=v->backend_state;
+393
+394
/* free header, header1, header2 */
+395
if(b->header)_ogg_free(b->header);b->header=NULL;
+396
if(b->header1)_ogg_free(b->header1);b->header1=NULL;
+397
if(b->header2)_ogg_free(b->header2);b->header2=NULL;
+398
+399
/* Do we have enough storage space for the requested buffer? If not,
+400
expand the PCM (and envelope) storage */
+401
+402
if(v->pcm_current+vals>=v->pcm_storage){
+403
v->pcm_storage=v->pcm_current+vals*2;
+404
+405
for(i=0;i<vi->channels;i++){
+406
v->pcm[i]=_ogg_realloc(v->pcm[i],v->pcm_storage*sizeof(*v->pcm[i]));
+407
}
+408
}
+409
+410
for(i=0;i<vi->channels;i++)
+411
v->pcmret[i]=v->pcm[i]+v->pcm_current;
+412
+413
return(v->pcmret);
+414
}
+415
+416
static void _preextrapolate_helper(vorbis_dsp_state *v){
+417
int i;
+418
int order=16;
+419
float *lpc=alloca(order*sizeof(*lpc));
+420
float *work=alloca(v->pcm_current*sizeof(*work));
+421
long j;
+422
v->preextrapolate=1;
+423
+424
if(v->pcm_current-v->centerW>order*2){ /* safety */
+425
for(i=0;i<v->vi->channels;i++){
+426
/* need to run the extrapolation in reverse! */
+427
for(j=0;j<v->pcm_current;j++)
+428
work[j]=v->pcm[i][v->pcm_current-j-1];
+429
+430
/* prime as above */
+431
vorbis_lpc_from_data(work,lpc,v->pcm_current-v->centerW,order);
+432
+433
#if 0
+434
if(v->vi->channels==2){
+435
if(i==0)
+436
_analysis_output("predataL",0,work,v->pcm_current-v->centerW,0,0,0);
+437
else
+438
_analysis_output("predataR",0,work,v->pcm_current-v->centerW,0,0,0);
+439
}else{
+440
_analysis_output("predata",0,work,v->pcm_current-v->centerW,0,0,0);
+441
}
+442
#endif
+443
+444
/* run the predictor filter */
+445
vorbis_lpc_predict(lpc,work+v->pcm_current-v->centerW-order,
+446
order,
+447
work+v->pcm_current-v->centerW,
+448
v->centerW);
+449
+450
for(j=0;j<v->pcm_current;j++)
+451
v->pcm[i][v->pcm_current-j-1]=work[j];
+452
+453
}
+454
}
+455
}
+456
+457
+458
/* call with val<=0 to set eof */
+459
+460
int vorbis_analysis_wrote(vorbis_dsp_state *v, int vals){
+461
vorbis_info *vi=v->vi;
+462
codec_setup_info *ci=vi->codec_setup;
+463
+464
if(vals<=0){
+465
int order=32;
+466
int i;
+467
float *lpc=alloca(order*sizeof(*lpc));
+468
+469
/* if it wasn't done earlier (very short sample) */
+470
if(!v->preextrapolate)
+471
_preextrapolate_helper(v);
+472
+473
/* We're encoding the end of the stream. Just make sure we have
+474
[at least] a few full blocks of zeroes at the end. */
+475
/* actually, we don't want zeroes; that could drop a large
+476
amplitude off a cliff, creating spread spectrum noise that will
+477
suck to encode. Extrapolate for the sake of cleanliness. */
+478
+479
vorbis_analysis_buffer(v,ci->blocksizes[1]*3);
+480
v->eofflag=v->pcm_current;
+481
v->pcm_current+=ci->blocksizes[1]*3;
+482
+483
for(i=0;i<vi->channels;i++){
+484
if(v->eofflag>order*2){
+485
/* extrapolate with LPC to fill in */
+486
long n;
+487
+488
/* make a predictor filter */
+489
n=v->eofflag;
+490
if(n>ci->blocksizes[1])n=ci->blocksizes[1];
+491
vorbis_lpc_from_data(v->pcm[i]+v->eofflag-n,lpc,n,order);
+492
+493
/* run the predictor filter */
+494
vorbis_lpc_predict(lpc,v->pcm[i]+v->eofflag-order,order,
+495
v->pcm[i]+v->eofflag,v->pcm_current-v->eofflag);
+496
}else{
+497
/* not enough data to extrapolate (unlikely to happen due to
+498
guarding the overlap, but bulletproof in case that
+499
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
@@ -0,0 +1,12273 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2010 *
+9
* by the Xiph.Org Foundation https://xiph.org/ *
+10
* *
+11
********************************************************************
+12
*
+13
* function: static codebooks for 5.1 surround
+14
*
+15
********************************************************************/
+16
+17
static const long _vq_quantlist__44p0_l0_0[] = {
+18
6,
+19
5,
+20
7,
+21
4,
+22
8,
+23
3,
+24
9,
+25
2,
+26
10,
+27
1,
+28
11,
+29
0,
+30
12,
+31
};
+32
+33
static const char _vq_lengthlist__44p0_l0_0[] = {
+34
1, 3, 4, 7, 7, 8, 8, 9, 9, 9,10,10,10, 5, 6, 5,
+35
8, 7, 9, 8, 9, 9,10, 9,11,10, 5, 5, 7, 7, 8, 8,
+36
9, 9, 9, 9,10,10,11, 8, 9, 8,10, 9,10, 9,10, 9,
+37
11,10,11,10, 8, 8, 9, 9,10, 9,10, 9,11,10,11,10,
+38
11,10,11,11,11,11,11,11,11,11,11,11,11,11,10,11,
+39
11,11,12,11,11,11,11,11,11,10,12,12,12,12,12,12,
+40
12,11,12,12,12,11,11,11,12,12,12,12,12,12,12,11,
+41
12,11,12,11,11,13,12,12,12,13,12,12,12,12,11,12,
+42
11,11,13,13,13,12,12,12,12,12,12,11,11,11,10,13,
+43
13,13,12,13,12,13,11,13,10,12,11,11,13,13,12,13,
+44
12,12,12,12,11,12,11,11,11,
+45
};
+46
+47
static const static_codebook _44p0_l0_0 = {
+48
2, 169,
+49
(char *)_vq_lengthlist__44p0_l0_0,
+50
1, -526516224, 1616117760, 4, 0,
+51
(long *)_vq_quantlist__44p0_l0_0,
+52
0
+53
};
+54
+55
static const long _vq_quantlist__44p0_l0_1[] = {
+56
2,
+57
1,
+58
3,
+59
0,
+60
4,
+61
};
+62
+63
static const char _vq_lengthlist__44p0_l0_1[] = {
+64
1, 4, 4, 6, 6, 5, 5, 5, 7, 5, 5, 5, 5, 6, 7, 7,
+65
6, 7, 7, 7, 6, 7, 7, 7, 7,
+66
};
+67
+68
static const static_codebook _44p0_l0_1 = {
+69
2, 25,
+70
(char *)_vq_lengthlist__44p0_l0_1,
+71
1, -533725184, 1611661312, 3, 0,
+72
(long *)_vq_quantlist__44p0_l0_1,
+73
0
+74
};
+75
+76
static const long _vq_quantlist__44p0_l1_0[] = {
+77
1,
+78
0,
+79
2,
+80
};
+81
+82
static const char _vq_lengthlist__44p0_l1_0[] = {
+83
1, 4, 4, 4, 4, 4, 4, 4, 4,
+84
};
+85
+86
static const static_codebook _44p0_l1_0 = {
+87
2, 9,
+88
(char *)_vq_lengthlist__44p0_l1_0,
+89
1, -516716544, 1630767104, 2, 0,
+90
(long *)_vq_quantlist__44p0_l1_0,
+91
0
+92
};
+93
+94
static const char _huff_lengthlist__44p0_lfe[] = {
+95
1, 3, 2, 3,
+96
};
+97
+98
static const static_codebook _huff_book__44p0_lfe = {
+99
2, 4,
+100
(char *)_huff_lengthlist__44p0_lfe,
+101
0, 0, 0, 0, 0,
+102
NULL,
+103
0
+104
};
+105
+106
static const char _huff_lengthlist__44p0_long[] = {
+107
2, 3, 6, 7,10,14,16, 3, 2, 5, 7,11,14,17, 6, 5,
+108
5, 7,10,12,14, 7, 7, 6, 6, 7, 9,13,10,11, 9, 6,
+109
6, 9,11,15,15,13,10, 9,10,12,18,18,16,14,12,13,
+110
16,
+111
};
+112
+113
static const static_codebook _huff_book__44p0_long = {
+114
2, 49,
+115
(char *)_huff_lengthlist__44p0_long,
+116
0, 0, 0, 0, 0,
+117
NULL,
+118
0
+119
};
+120
+121
static const long _vq_quantlist__44p0_p1_0[] = {
+122
1,
+123
0,
+124
2,
+125
};
+126
+127
static const char _vq_lengthlist__44p0_p1_0[] = {
+128
1, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+129
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+130
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+131
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+132
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+133
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+134
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+135
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+136
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+137
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+138
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+139
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+140
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+141
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+142
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+143
0, 0, 0,
+144
};
+145
+146
static const static_codebook _44p0_p1_0 = {
+147
5, 243,
+148
(char *)_vq_lengthlist__44p0_p1_0,
+149
1, -535822336, 1611661312, 2, 0,
+150
(long *)_vq_quantlist__44p0_p1_0,
+151
0
+152
};
+153
+154
static const long _vq_quantlist__44p0_p2_0[] = {
+155
1,
+156
0,
+157
2,
+158
};
+159
+160
static const char _vq_lengthlist__44p0_p2_0[] = {
+161
1, 5, 5, 0, 7, 7, 0, 8, 8, 0, 9, 9, 0,12,12, 0,
+162
8, 8, 0, 9, 9, 0,12,12, 0, 8, 8, 0, 6, 6, 0,11,
+163
11, 0,12,12, 0,12,12, 0,15,15, 0,11,11, 0,12,12,
+164
0,15,15, 0,12,12, 0, 5, 5, 0, 5, 5, 0, 6, 6, 0,
+165
7, 7, 0,11,11, 0, 6, 6, 0, 7, 7, 0,10,11, 0, 6,
+166
6, 0, 7, 7, 0,11,11, 0,12,12, 0,11,11, 0,15,15,
+167
0,10,10, 0,12,12, 0,15,15, 0,12,12, 0, 6, 6, 0,
+168
12,12, 0,12,12, 0,12,12, 0,15,15, 0,11,11, 0,12,
+169
12, 0,15,15, 0,12,12, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+170
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+171
0, 0, 0, 8, 8, 0,12,12, 0,12,12, 0,12,12, 0,15,
+172
15, 0,12,12, 0,11,12, 0,15,16, 0,11,11, 0, 6, 6,
+173
0,11,12, 0,12,12, 0,12,12, 0,16,15, 0,12,12, 0,
+174
13,12, 0,15,14, 0,12,12, 0, 0, 0, 0, 0, 0, 0, 0,
+175
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+176
0, 0, 0,
+177
};
+178
+179
static const static_codebook _44p0_p2_0 = {
+180
5, 243,
+181
(char *)_vq_lengthlist__44p0_p2_0,
+182
1, -533200896, 1614282752, 2, 0,
+183
(long *)_vq_quantlist__44p0_p2_0,
+184
0
+185
};
+186
+187
static const long _vq_quantlist__44p0_p2_1[] = {
+188
1,
+189
0,
+190
2,
+191
};
+192
+193
static const char _vq_lengthlist__44p0_p2_1[] = {
+194
1, 3, 3, 0, 9, 9, 0, 9, 9, 0,10,10, 0, 9, 9, 0,
+195
10,10, 0,10,10, 0, 9, 9, 0,10,10, 0, 7, 7, 0, 7,
+196
7, 0, 6, 6, 0, 8, 8, 0, 7, 7, 0, 8, 8, 0, 8, 9,
+197
0, 8, 8, 0, 8, 8, 0, 7, 7, 0, 9, 9, 0, 8, 8, 0,
+198
10,10, 0, 9, 9, 0,10,10, 0,10,10, 0, 9, 9, 0,10,
+199
10, 0, 9, 9, 0,11,11, 0,11,11, 0,12,12, 0,11,11,
+200
0,12,12, 0,13,13, 0,12,12, 0,13,12, 0, 8, 8, 0,
+201
12,12, 0,12,12, 0,13,13, 0,12,12, 0,13,13, 0,13,
+202
13, 0,13,13, 0,13,13, 0, 7, 7, 0, 0, 0, 0, 0, 0,
+203
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+204
0, 0, 0, 9, 9, 0,11,11, 0,12,12, 0,13,13, 0,12,
+205
12, 0,13,13, 0,13,13, 0,12,12, 0,12,12, 0, 8, 8,
+206
0,12,12, 0,12,12, 0,13,13, 0,13,13, 0,13,14, 0,
+207
14,13, 0,13,13, 0,13,13, 0, 7, 7, 0, 0, 0, 0, 0,
+208
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+209
0, 0, 0,
+210
};
+211
+212
static const static_codebook _44p0_p2_1 = {
+213
5, 243,
+214
(char *)_vq_lengthlist__44p0_p2_1,
+215
1, -535822336, 1611661312, 2, 0,
+216
(long *)_vq_quantlist__44p0_p2_1,
+217
0
+218
};
+219
+220
static const long _vq_quantlist__44p0_p3_0[] = {
+221
1,
+222
0,
+223
2,
+224
};
+225
+226
static const char _vq_lengthlist__44p0_p3_0[] = {
+227
1, 6, 6, 7, 8, 8, 7, 8, 8, 7, 9, 9,10,12,11, 9,
+228
8, 8, 7, 9, 9,11,12,12, 9, 9, 9, 6, 7, 7,10,11,
+229
11,10,11,11,10,11,11,13,13,14,12,12,12,11,11,11,
+230
14,14,14,12,12,12, 6, 5, 5, 9, 6, 5, 9, 6, 6, 9,
+231
7, 7,12,10,10,11, 6, 6,10, 7, 7,13,10,10,12, 7,
+232
7, 7, 8, 8,12,10,10,12,10,10,11,10,10,15,13,13,
+233
13, 9, 9,12,11,11,16,13,13,15,11,11, 8, 7, 7,12,
+234
12,12,12,11,11,12,11,11,14,14,14,14,12,12,12,12,
+235
12,16,15,15,14,12,12, 0,10,10, 0,12,12, 0,12,12,
+236
0,11,11, 0,14,14, 0,11,11, 0,12,12, 0,15,15, 0,
+237
11,11, 8, 8, 8,13,11,11,13,10,10,13,11,11,15,13,
+238
13,14,11,11,12,10,10,16,14,14,14,10,10, 9, 7, 7,
+239
13,11,11,13,11,11,12,11,11,16,14,14,14,12,12,13,
+240
12,12,15,14,14,15,13,12, 0,11,11, 0,12,12, 0,12,
+241
12, 0,12,12, 0,15,15, 0,12,12, 0,13,12, 0,14,15,
+242
0,12,12,
+243
};
+244
+245
static const static_codebook _44p0_p3_0 = {
+246
5, 243,
+247
(char *)_vq_lengthlist__44p0_p3_0,
+248
1, -531365888, 1616117760, 2, 0,
+249
(long *)_vq_quantlist__44p0_p3_0,
+250
0
+251
};
+252
+253
static const long _vq_quantlist__44p0_p3_1[] = {
+254
2,
+255
1,
+256
3,
+257
0,
+258
4,
+259
};
+260
+261
static const char _vq_lengthlist__44p0_p3_1[] = {
+262
2, 4, 4, 8, 8,10,12,12,11,11, 9,11,11,12,13,11,
+263
12,12,11,11,11,12,12,12,12,10,13,12,13,13,11,12,
+264
12,13,13,11,12,12,13,13,11,12,13,13,13,11,13,13,
+265
13,13,10,13,13,12,13,11,12,12,14,14,11,13,12,12,
+266
12,11,12,12,13,13,11,13,13,12,12,11,13,13,13,13,
+267
11,12,12,13,13,11,13,13,12,12,11,12,12,13,13,11,
+268
13,13,12,12,11,13,13,13,13,11,12,12,14,14,11,13,
+269
13,12,12,11,12,12,13,13,11,13,13,12,12,11,10,10,
+270
10,10,12,10,10,11,11,11, 8, 8,11,11,13,10,10,10,
+271
10,12,10,10,10,10,13,11,11,11,11,13,10,10,11,11,
+272
13,11,11,12,12,13,11,11,11,11,13,11,11,12,12,13,
+273
11,11,12,12,13,10,10,11,11,13,11,11,11,11,13,11,
+274
10,11,11,13,11,11,11,11,13,11,11,11,11,13,10,10,
+275
11,11,13,11,11,11,11,12,10,11,11,11,13,11,11,11,
+276
11,13,11,11,11,11,13,10,10,11,11,13,11,11,11,11,
+277
13,11,11,11,11,13,11,11,11,11,11,10,10,10,10,12,
+278
10,10, 9, 9,12,12,12,11,11,13,12,12, 9, 9,13,12,
+279
12,10,10,12,12,12,12,12,13,13,13,14,14,13,12,12,
+280
11,11,13,13,13,12,12,13,12,12,11,11,13,12,13,11,
+281
11,13,13,13,14,14,13,12,12,10,10,13,13,13,11,11,
+282
13,12,12,10,10,13,13,13,11,11,13,13,13,14,14,13,
+283
12,12,10,10,13,13,13,11,11,13,12,13,10,10,13,13,
+284
13,11,11,13,13,13,14,14,13,12,12,10,10,13,13,13,
+285
11,11,13,13,12,10,10,14,12,12, 8, 8,14,12,12, 9,
+286
9,14,11,11, 9, 9,14,12,12, 8, 8,14,11,11, 7, 7,
+287
14,13,13,10,10,15,12,12,10,10,15,13,13,10,10,15,
+288
12,12, 9, 9,15,13,13,10,10,15,13,13,10,10,15,12,
+289
12,10,10,15,13,13,10,10,14,12,12, 9, 9,14,13,13,
+290
9, 9,14,13,13, 9, 9,15,12,12, 9, 9,15,13,13, 9,
+291
9,14,12,12, 9, 9,14,13,13, 9, 9,14,13,13, 9, 9,
+292
15,12,12, 9, 9,14,13,13, 9, 9,14,12,12, 9, 9,14,
+293
13,13, 9, 9,13,12,12, 8, 8,13,13,13, 8, 8,14,13,
+294
13, 9, 9,13,13,13, 7, 7,14,13,13, 8, 8,14,14,14,
+295
10,10,14,14,14,11,11,14,14,14, 9, 9,14,14,14,10,
+296
10,14,14,14, 9, 9,14,14,14,10, 9,15,14,14,11,11,
+297
14,14,14, 9, 9,14,14,14,10,10,14,14,14, 9, 9,14,
+298
14,14, 9, 9,15,14,14,11,11,14,14,14, 8, 8,14,14,
+299
14, 9, 9,14,14,14, 8, 8,14,14,14, 9, 9,15,14,14,
+300
11,11,14,14,14, 8, 8,14,14,14, 9, 9,14,14,14, 8,
+301
8,12,12,12,13,13,16,15,15,11,11,16,15,16,12,12,
+302
17,16,16,11,11,17,15,15,12,11,16,16,16,12,13,16,
+303
15,15,13,13,16,16,16,12,12,16,16,15,13,13,16,16,
+304
16,12,12,16,16,16,13,13,17,16,16,14,14,17,17,16,
+305
12,12,17,16,16,13,13,17,17,16,12,13,16,16,17,13,
+306
12,17,16,16,14,13,17,16,16,12,12,17,16,16,12,12,
+307
17,16,17,12,12,17,17,17,13,13,16,16,16,13,14,17,
+308
17,16,12,12,16,16,16,13,13,17,17,17,12,12,13,14,
+309
14,10,10,16,14,14,12,12,16,15,15,14,14,16,14,14,
+310
12,12,15,14,14,13,13,17,15,15,14,13,16,16,15,15,
+311
15,16,15,15,14,14,16,15,15,14,14,17,15,15,14,14,
+312
16,15,15,14,14,16,16,15,15,15,17,15,15,13,13,16,
+313
15,15,14,14,17,15,15,13,13,17,15,15,14,14,16,15,
+314
15,15,15,16,14,14,13,13,16,15,15,14,14,16,14,14,
+315
13,13,17,15,15,14,14,16,16,15,15,15,17,14,14,13,
+316
13,16,15,15,14,14,17,14,14,13,13,13,11,11,10,10,
+317
16,14,14,13,13,15,14,14,13,13,16,14,14,12,12,16,
+318
14,14,12,12,15,15,15,14,14,16,14,14,14,14,16,15,
+319
14,14,14,16,14,14,14,14,16,15,15,14,13,16,15,15,
+320
14,14,16,14,14,14,14,17,15,15,14,14,16,14,14,14,
+321
14,16,15,15,13,14,16,15,15,14,14,16,14,14,14,14,
+322
16,15,15,13,13,16,14,14,13,13,16,15,15,13,13,16,
+323
15,15,14,14,16,14,14,14,14,17,15,15,13,13,16,15,
+324
14,13,13,17,15,15,13,13,14,14,14, 9, 9,14,14,14,
+325
17,17,14,15,15,18,18,14,14,14,18,19,14,14,14,18,
+326
18,15,15,15,19,18,15,16,15,18,20,15,15,15,18,19,
+327
15,15,15,19,19,15,15,15,18,20,15,15,15,18,19,15,
+328
15,16,20,18,15,15,15,18,18,15,15,15,19,19,15,15,
+329
15,18,19,15,15,15,18,19,15,15,15,19,19,14,15,14,
+330
19,19,15,15,15,20,19,15,14,14,19,18,14,15,15,18,
+331
19,15,15,16,20,20,14,14,14,18,19,15,15,15,19,18,
+332
14,14,14,18,18,14,12,12, 9, 9,13,14,14,18,18,14,
+333
13,13,18,19,14,14,14,18,18,14,14,14,18,18,15,15,
+334
15,19,19,15,14,14,19,18,14,15,15,19,18,15,14,14,
+335
18,18,15,15,15,19,18,14,15,15,19,19,15,14,14,19,
+336
18,14,15,15,19,18,15,14,14,19,18,14,15,15,19,18,
+337
15,15,15,21,18,15,14,14,19,18,14,15,15,18,19,14,
+338
15,14,20,19,14,15,15,18,19,14,15,15,19,19,15,14,
+339
14,19,20,14,15,15,18,18,14,14,14,19,19,14,15,15,
+340
19,18,12,12,12,13,13,16,15,15,11,11,16,15,15,12,
+341
12,16,16,16,11,11,16,15,15,11,11,16,16,16,13,13,
+342
17,16,16,13,13,17,17,17,12,12,16,16,16,13,13,17,
+343
16,17,13,12,15,16,16,12,12,16,15,15,13,13,17,16,
+344
16,12,12,16,16,15,12,12,16,16,16,12,12,17,17,16,
+345
13,12,16,16,16,13,13,17,16,16,12,12,17,16,16,12,
+346
12,17,17,16,12,12,16,17,16,12,12,17,15,15,13,13,
+347
17,16,16,12,12,16,16,16,12,12,16,16,16,12,12,13,
+348
13,13, 9, 9,15,14,14,13,13,16,15,14,14,14,16,14,
+349
14,13,13,15,14,14,13,13,17,15,15,14,14,16,15,15,
+350
15,15,16,15,15,14,14,16,15,15,15,15,17,15,15,14,
+351
14,16,15,15,14,14,16,15,15,15,15,17,14,15,14,14,
+352
16,15,15,14,14,17,15,15,13,14,17,15,15,14,14,16,
+353
15,15,15,15,17,14,14,13,13,16,15,15,14,14,17,14,
+354
14,13,13,17,15,15,14,14,16,15,16,15,15,17,14,14,
+355
13,13,16,15,15,14,14,18,14,14,13,13,13,11,11,11,
+356
11,15,14,14,12,12,15,14,14,13,13,16,14,14,12,12,
+357
16,13,14,12,12,16,15,15,13,13,16,14,14,14,14,16,
+358
15,15,13,13,16,14,14,13,13,16,14,15,13,13,15,15,
+359
15,13,13,16,14,14,14,13,16,14,14,13,13,16,14,14,
+360
13,13,16,15,15,13,13,16,15,15,13,13,16,14,14,14,
+361
14,16,15,15,12,12,16,14,14,13,13,16,15,15,12,12,
+362
16,15,15,13,13,16,14,14,14,14,17,15,14,12,12,16,
+363
14,14,13,13,16,15,15,12,12,14,14,14, 8, 8,14,14,
+364
14,17,18,14,15,15,17,18,14,14,14,17,18,14,14,14,
+365
18,18,14,15,15,18,18,14,16,15,19,19,15,15,15,18,
+366
19,15,16,15,20,19,15,15,15,18,18,14,15,15,18,19,
+367
15,16,16,20,19,15,15,15,19,17,14,15,15,20,18,14,
+368
15,15,18,18,14,15,15,18,19,14,15,15,19,20,14,14,
+369
14,18,18,14,15,15,18,19,14,14,14,18,19,14,15,15,
+370
19,18,15,16,16,20,21,14,14,15,19,19,14,15,15,19,
+371
19,14,14,14,19,18,13,12,12, 9, 9,13,14,14,18,19,
+372
14,14,14,18,19,14,14,14,18,18,14,14,14,18,18,14,
+373
15,15,19,19,15,14,14,19,18,15,15,15,19,19,15,14,
+374
14,19,20,14,15,15,18,19,14,15,15,20,18,15,14,14,
+375
18,18,14,15,15,18,18,14,14,14,19,19,14,15,15,18,
+376
18,14,15,15,19,18,15,14,14,19,19,14,15,15,19,18,
+377
15,14,14,19,18,14,14,15,18,19,14,15,15,19,18,15,
+378
14,14,18,19,14,15,14,19,20,14,14,14,19,19,14,15,
+379
15,19,19,12,12,12,13,13,16,16,16,11,11,16,16,16,
+380
12,12,17,16,16,11,11,17,15,15,11,11,16,16,16,13,
+381
13,17,15,16,13,13,16,16,16,12,12,17,16,16,13,13,
+382
17,17,16,12,12,17,17,16,13,13,17,16,16,13,13,17,
+383
17,17,12,12,17,16,16,13,13,17,17,17,12,12,16,16,
+384
16,12,12,17,15,15,13,13,17,16,16,11,11,17,16,16,
+385
12,12,16,16,16,11,11,16,17,16,12,12,17,16,16,13,
+386
13,17,17,16,12,12,17,17,16,12,12,17,16,16,11,11,
+387
13,14,14, 9, 9,16,14,14,13,13,16,14,15,14,14,16,
+388
14,14,12,12,16,14,14,13,13,17,15,15,14,14,16,15,
+389
15,15,15,17,15,15,14,14,16,15,15,14,14,17,15,15,
+390
14,14,16,15,15,14,14,16,15,15,15,16,17,14,15,14,
+391
14,16,15,15,14,14,17,15,15,14,14,16,15,15,14,14,
+392
16,15,15,15,15,17,14,14,13,13,16,15,15,14,14,16,
+393
14,14,13,13,17,15,15,14,14,16,16,15,15,15,17,14,
+394
14,13,13,16,15,15,14,14,17,14,14,13,13,13,11,11,
+395
10,10,16,14,14,12,12,15,13,13,13,12,16,14,14,11,
+396
11,16,14,14,11,11,16,14,15,13,14,16,14,14,13,13,
+397
16,15,15,13,13,16,14,14,13,13,16,15,15,13,13,16,
+398
15,15,13,13,17,14,14,14,14,17,15,15,13,13,16,14,
+399
15,13,13,16,15,15,13,13,16,15,15,13,13,16,14,14,
+400
13,13,17,15,15,12,12,16,14,14,12,12,16,15,15,12,
+401
12,16,15,15,13,13,16,14,14,13,13,17,15,15,12,12,
+402
17,14,14,12,12,16,15,15,12,12,13,14,14, 8, 8,13,
+403
14,14,18,18,13,15,15,17,18,14,14,14,18,19,14,14,
+404
14,19,18,14,15,15,19,18,15,15,16,21,18,15,15,15,
+405
19,19,14,16,16,19,19,14,15,15,18,19,14,15,15,19,
+406
20,14,16,16,19,18,15,15,15,18,19,14,15,15,19,18,
+407
15,15,15,18,18,15,15,15,20,18,15,16,16,20,19,14,
+408
15,14,18,19,14,15,16,19,20,14,15,15,19,18,15,15,
+409
15,19,18,15,16,16,20,19,15,14,14,18,18,14,15,15,
+410
19,19,14,15,15,18,18,13,12,12, 8, 8,13,14,14,19,
+411
18,14,13,13,20,18,14,14,14,19,18,14,13,13,18,19,
+412
14,15,15,20,19,15,14,14,19,19,14,15,15,19,18,15,
+413
14,14,20,20,15,15,15,19,18,14,15,15,19,18,15,14,
+414
14,19,18,14,15,15,20,19,14,14,14,20,19,14,15,15,
+415
19,18,15,15,15,18,18,15,14,14,18,18,14,15,15,19,
+416
19,14,14,14,19,19,14,15,15,19,19,15,15,15,19,18,
+417
15,14,14,20,19,15,15,15,19,19,14,14,14,20,19,14,
+418
15,15,20,20,12,12,12,13,13,17,16,16,11,11,16,16,
+419
15,12,12,17,16,16,11,11,17,15,15,11,11,17,17,17,
+420
13,13,17,16,16,13,13,17,17,17,12,12,17,16,16,13,
+421
13,17,17,16,12,13,16,17,16,13,13,17,16,15,13,13,
+422
17,16,16,12,12,17,16,16,12,13,17,16,17,12,12,17,
+423
17,17,12,12,17,16,15,13,13,17,16,16,12,12,17,16,
+424
16,12,12,17,16,16,11,11,16,16,16,12,12,17,15,15,
+425
13,13,17,16,15,11,11,16,16,16,12,12,17,16,16,11,
+426
11,13,14,14, 9, 9,16,14,14,13,13,16,14,15,14,14,
+427
16,14,14,12,12,16,14,14,13,13,17,15,15,14,15,16,
+428
15,15,15,15,17,15,15,14,14,16,15,15,15,14,16,15,
+429
15,14,14,16,15,15,14,14,16,15,16,15,15,17,15,14,
+430
14,14,16,15,15,14,14,17,15,15,13,13,16,15,15,14,
+431
14,16,16,16,15,15,17,14,14,13,13,16,15,15,14,14,
+432
18,14,15,13,13,16,15,15,14,14,16,16,15,15,15,16,
+433
14,14,13,13,16,15,15,14,14,17,14,15,13,13,13,11,
+434
11,10,10,15,14,14,12,12,15,14,14,13,13,16,14,14,
+435
12,12,16,13,14,12,12,16,14,15,14,13,16,14,14,14,
+436
14,16,15,15,13,13,16,14,14,13,13,16,15,15,13,13,
+437
15,15,15,13,13,16,14,14,14,14,17,15,15,13,13,16,
+438
14,14,13,13,16,15,15,13,13,16,15,15,13,13,16,14,
+439
14,13,13,17,15,15,12,12,16,14,14,12,12,16,14,15,
+440
12,12,16,15,15,13,13,16,14,14,13,13,17,15,15,12,
+441
12,16,14,14,12,12,16,15,15,12,12,14,14,14, 8, 8,
+442
14,14,14,17,17,14,15,15,18,18,14,14,14,18,17,14,
+443
14,14,18,18,14,15,15,18,20,15,16,15,19,18,15,15,
+444
15,19,18,15,15,16,19,18,15,15,15,18,18,14,15,15,
+445
18,18,15,16,16,18,19,15,15,15,18,18,15,15,15,19,
+446
20,15,15,15,18,18,15,15,15,18,18,15,16,16,19,19,
+447
15,14,15,19,19,15,15,15,19,20,14,14,15,18,18,15,
+448
15,15,19,19,15,16,16,19,19,15,15,14,18,19,15,15,
+449
15,20,20,15,15,14,18,18,13,12,12, 8, 8,13,14,14,
+450
18,18,14,14,14,18,18,14,14,14,18,20,14,14,14,18,
+451
18,14,15,15,19,18,15,14,14,18,19,15,15,15,18,19,
+452
15,14,14,18,19,15,15,15,18,18,14,15,14,18,19,15,
+453
14,14,21,19,15,15,15,19,18,14,14,14,19,18,14,15,
+454
15,19,18,15,15,15,20,19,15,14,14,20,18,14,15,15,
+455
18,19,14,14,14,19,18,14,15,15,18,19,15,15,15,18,
+456
19,15,14,14,19,19,15,15,15,19,19,14,14,14,19,20,
+457
14,15,15,18,19,
+458
};
+459
+460
static const static_codebook _44p0_p3_1 = {
+461
5, 3125,
+462
(char *)_vq_lengthlist__44p0_p3_1,
+463
1, -533725184, 1611661312, 3, 0,
+464
(long *)_vq_quantlist__44p0_p3_1,
+465
0
+466
};
+467
+468
static const long _vq_quantlist__44p0_p4_0[] = {
+469
2,
+470
1,
+471
3,
+472
0,
+473
4,
+474
};
+475
+476
static const char _vq_lengthlist__44p0_p4_0[] = {
+477
2, 6, 6,14,14, 6, 8, 8,14,14, 7, 7, 7,14,14, 0,
+478
13,13,15,16, 0,13,13,15,15, 7, 8, 8,15,15, 9,10,
+479
10,16,16, 9, 8, 8,14,15, 0,13,13,17,17, 0,13,13,
+480
16,16, 8, 8, 8,15,15,12,11,11,16,16, 9, 8, 8,14,
+481
14, 0,13,13,17,17, 0,13,13,15,15, 0,14,14,16,16,
+482
0, 0, 0,18,19, 0,12,12,16,15, 0,16,16, 0,20, 0,
+483
14,14,16,16, 0,14,14,17,17, 0, 0, 0,19,19, 0,12,
+484
12,15,15, 0,18,17,21,21, 0,14,14,16,16, 5, 7, 7,
+485
12,13, 9,10, 9,14,14,11,10,10,14,14, 0, 0, 0,18,
+486
17, 0,20,21,18,18, 9,10,10,14,14,12,12,12,17,16,
+487
12,10,10,14,14, 0,20,20,18,17, 0,21,21,17,17,11,
+488
10,10,14,14,15,13,13,18,18,13,11,11,14,14, 0,20,
+489
0,18,18, 0,20,21,18,17, 0,21, 0,18,19, 0, 0, 0,
+490
0,21, 0,21,20,16,17, 0, 0, 0,21,21, 0, 0, 0,20,
+491
18, 0,20, 0,17,18, 0, 0, 0, 0, 0, 0, 0,20,16,17,
+492
0, 0, 0,20, 0, 0, 0, 0,18,18, 6, 6, 6,13,13, 8,
+493
5, 5,11,11, 9, 6, 6,13,13, 0, 9, 9,12,12, 0,10,
+494
10,14,14, 9, 7, 7,13,13,12, 9, 9,13,13,10, 6, 6,
+495
13,13, 0,10,10,14,14, 0,10,10,13,13, 9, 7, 7,13,
+496
13,13,10,10,13,13,11, 6, 6,13,13, 0,10,10,15,15,
+497
0,10,10,13,13, 0,12,11,15,15, 0,20,19,17,16, 0,
+498
9, 9,13,13, 0,13,13,20,19, 0,11,11,13,13, 0,11,
+499
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
@@ -0,0 +1,15782 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 *
+9
* by the Xiph.Org Foundation https://xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: static codebooks autogenerated by huff/huffbuld
+14
+15
********************************************************************/
+16
+17
#include "codebook.h"
+18
+19
static const long _vq_quantlist__16c0_s_p1_0[] = {
+20
1,
+21
0,
+22
2,
+23
};
+24
+25
static const char _vq_lengthlist__16c0_s_p1_0[] = {
+26
1, 4, 4, 0, 0, 0, 0, 0, 0, 5, 7, 7, 0, 0, 0, 0,
+27
0, 0, 5, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+28
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+29
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+30
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+31
0, 5, 8, 8, 0, 0, 0, 0, 0, 0, 8, 9,10, 0, 0, 0,
+32
0, 0, 0, 7, 9,10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+33
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+34
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+35
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+36
0, 0, 5, 8, 8, 0, 0, 0, 0, 0, 0, 7, 9, 9, 0, 0,
+37
0, 0, 0, 0, 7, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+38
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+39
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+40
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+41
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+42
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+43
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+44
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+45
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+46
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+47
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+48
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+49
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+50
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+51
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+52
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+53
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+54
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+55
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+56
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+57
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+58
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+59
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+60
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+61
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+62
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+63
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+64
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+65
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+66
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+67
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+68
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+69
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+70
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+71
0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 8, 8, 0, 0, 0, 0,
+72
0, 0, 8,10,10, 0, 0, 0, 0, 0, 0, 8,10,10, 0, 0,
+73
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+74
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+75
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+76
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7,10,10, 0, 0, 0,
+77
0, 0, 0, 9, 9,12, 0, 0, 0, 0, 0, 0,10,12,11, 0,
+78
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+79
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+80
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+81
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7,10,10, 0, 0,
+82
0, 0, 0, 0, 9,12,10, 0, 0, 0, 0, 0, 0,10,11,12,
+83
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+84
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+85
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+86
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+87
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+88
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+89
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+90
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+91
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+92
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+93
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+94
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+95
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+96
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+97
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+98
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+99
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+100
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+101
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+102
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+103
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+104
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+105
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+106
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+107
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+108
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+109
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+110
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+111
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+112
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+113
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+114
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+115
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+116
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+117
0, 0, 5, 8, 8, 0, 0, 0, 0, 0, 0, 8,10,10, 0, 0,
+118
0, 0, 0, 0, 8,10,10, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+119
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+120
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+121
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+122
0, 0, 0, 7,10,10, 0, 0, 0, 0, 0, 0,10,12,11, 0,
+123
0, 0, 0, 0, 0, 9,10,12, 0, 0, 0, 0, 0, 0, 0, 0,
+124
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+125
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+126
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+127
0, 0, 0, 0, 7,10,10, 0, 0, 0, 0, 0, 0,10,11,12,
+128
0, 0, 0, 0, 0, 0, 9,12, 9, 0, 0, 0, 0, 0, 0, 0,
+129
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+130
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+131
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+132
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+133
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+134
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+135
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+136
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+137
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+138
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+139
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+140
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+141
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+142
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+143
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+144
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+145
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+146
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+147
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+148
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+149
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+150
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+151
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+152
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+153
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+154
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+155
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+156
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+157
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+158
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+159
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+160
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+161
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+162
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+163
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+164
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+165
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+166
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+167
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+168
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+169
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+170
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+171
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+172
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+173
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+174
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+175
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+176
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+177
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+178
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+179
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+180
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+181
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+182
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+183
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+184
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+185
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+186
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+187
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+188
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+189
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+190
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+191
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+192
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+193
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+194
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+195
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+196
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+197
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+198
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+199
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+200
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+201
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+202
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+203
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+204
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+205
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+206
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+207
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+208
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+209
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+210
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+211
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+212
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+213
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+214
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+215
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+216
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+217
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+218
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+219
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+220
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+221
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+222
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+223
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+224
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+225
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+226
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+227
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+228
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+229
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+230
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+231
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+232
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+233
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+234
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+235
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+236
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+237
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+238
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+239
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+240
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+241
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+242
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+243
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+244
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+245
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+246
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+247
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+248
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+249
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+250
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+251
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+252
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+253
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+254
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+255
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+256
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+257
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+258
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+259
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+260
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+261
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+262
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+263
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+264
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+265
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+266
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+267
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+268
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+269
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+270
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+271
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+272
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+273
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+274
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+275
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+276
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+277
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+278
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+279
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+280
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+281
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+282
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+283
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+284
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+285
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+286
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+287
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+288
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+289
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+290
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+291
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+292
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+293
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+294
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+295
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+296
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+297
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+298
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+299
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+300
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+301
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+302
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+303
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+304
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+305
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+306
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+307
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+308
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+309
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+310
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+311
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+312
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+313
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+314
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+315
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+316
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+317
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+318
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+319
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+320
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+321
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+322
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+323
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+324
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+325
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+326
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+327
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+328
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+329
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+330
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+331
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+332
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+333
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+334
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+335
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+336
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+337
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+338
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+339
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+340
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+341
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+342
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+343
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+344
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+345
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+346
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+347
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+348
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+349
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+350
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+351
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+352
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+353
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+354
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+355
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+356
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+357
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+358
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+359
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+360
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+361
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+362
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+363
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+364
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+365
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+366
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+367
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+368
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+369
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+370
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+371
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+372
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+373
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+374
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+375
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+376
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+377
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+378
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+379
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+380
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+381
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+382
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+383
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+384
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+385
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+386
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+387
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+388
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+389
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+390
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+391
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+392
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+393
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+394
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+395
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+396
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+397
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+398
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+399
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+400
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+401
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+402
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+403
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+404
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+405
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+406
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+407
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+408
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+409
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+410
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+411
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+412
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+413
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+414
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+415
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+416
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+417
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+418
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+419
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+420
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+421
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+422
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+423
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+424
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+425
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+426
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+427
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+428
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+429
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+430
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+431
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+432
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+433
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+434
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+435
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+436
0,
+437
};
+438
+439
static const static_codebook _16c0_s_p1_0 = {
+440
8, 6561,
+441
(char *)_vq_lengthlist__16c0_s_p1_0,
+442
1, -535822336, 1611661312, 2, 0,
+443
(long *)_vq_quantlist__16c0_s_p1_0,
+444
0
+445
};
+446
+447
static const long _vq_quantlist__16c0_s_p3_0[] = {
+448
2,
+449
1,
+450
3,
+451
0,
+452
4,
+453
};
+454
+455
static const char _vq_lengthlist__16c0_s_p3_0[] = {
+456
1, 4, 4, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+457
0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 6, 6, 7, 6, 0, 0,
+458
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+459
0, 0, 4, 6, 6, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+460
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 6, 6, 9, 9,
+461
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+462
0, 0, 0, 0, 6, 6, 6, 9, 9, 0, 0, 0, 0, 0, 0, 0,
+463
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+464
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+465
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+466
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+467
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+468
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+469
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+470
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+471
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+472
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+473
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+474
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+475
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+476
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+477
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+478
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+479
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+480
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+481
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+482
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+483
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+484
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+485
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+486
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+487
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+488
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+489
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+490
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+491
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+492
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+493
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+494
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+495
0,
+496
};
+497
+498
static const static_codebook _16c0_s_p3_0 = {
+499
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
@@ -0,0 +1,1546 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 *
+9
* by the Xiph.Org Foundation https://xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: static codebooks autogenerated by huff/huffbuld
+14
+15
********************************************************************/
+16
+17
#include "codebook.h"
+18
+19
static const char _huff_lengthlist_line_256x7_0sub1[] = {
+20
0, 2, 3, 3, 3, 3, 4, 3, 4,
+21
};
+22
+23
static const static_codebook _huff_book_line_256x7_0sub1 = {
+24
1, 9,
+25
(char *)_huff_lengthlist_line_256x7_0sub1,
+26
0, 0, 0, 0, 0,
+27
NULL,
+28
0
+29
};
+30
+31
static const char _huff_lengthlist_line_256x7_0sub2[] = {
+32
0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 3, 4, 3, 5, 3,
+33
6, 3, 6, 4, 6, 4, 7, 5, 7,
+34
};
+35
+36
static const static_codebook _huff_book_line_256x7_0sub2 = {
+37
1, 25,
+38
(char *)_huff_lengthlist_line_256x7_0sub2,
+39
0, 0, 0, 0, 0,
+40
NULL,
+41
0
+42
};
+43
+44
static const char _huff_lengthlist_line_256x7_0sub3[] = {
+45
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+46
0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 5, 2, 5, 3, 5, 3,
+47
6, 3, 6, 4, 7, 6, 7, 8, 7, 9, 8, 9, 9, 9,10, 9,
+48
11,13,11,13,10,10,13,13,13,13,13,13,12,12,12,12,
+49
};
+50
+51
static const static_codebook _huff_book_line_256x7_0sub3 = {
+52
1, 64,
+53
(char *)_huff_lengthlist_line_256x7_0sub3,
+54
0, 0, 0, 0, 0,
+55
NULL,
+56
0
+57
};
+58
+59
static const char _huff_lengthlist_line_256x7_1sub1[] = {
+60
0, 3, 3, 3, 3, 2, 4, 3, 4,
+61
};
+62
+63
static const static_codebook _huff_book_line_256x7_1sub1 = {
+64
1, 9,
+65
(char *)_huff_lengthlist_line_256x7_1sub1,
+66
0, 0, 0, 0, 0,
+67
NULL,
+68
0
+69
};
+70
+71
static const char _huff_lengthlist_line_256x7_1sub2[] = {
+72
0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 3, 4, 3, 4, 4,
+73
5, 4, 6, 5, 6, 7, 6, 8, 8,
+74
};
+75
+76
static const static_codebook _huff_book_line_256x7_1sub2 = {
+77
1, 25,
+78
(char *)_huff_lengthlist_line_256x7_1sub2,
+79
0, 0, 0, 0, 0,
+80
NULL,
+81
0
+82
};
+83
+84
static const char _huff_lengthlist_line_256x7_1sub3[] = {
+85
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+86
0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 2, 4, 3, 6, 3, 7,
+87
3, 8, 5, 8, 6, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
+88
8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7,
+89
};
+90
+91
static const static_codebook _huff_book_line_256x7_1sub3 = {
+92
1, 64,
+93
(char *)_huff_lengthlist_line_256x7_1sub3,
+94
0, 0, 0, 0, 0,
+95
NULL,
+96
0
+97
};
+98
+99
static const char _huff_lengthlist_line_256x7_class0[] = {
+100
7, 5, 5, 9, 9, 6, 6, 9,12, 8, 7, 8,11, 8, 9,15,
+101
6, 3, 3, 7, 7, 4, 3, 6, 9, 6, 5, 6, 8, 6, 8,15,
+102
8, 5, 5, 9, 8, 5, 4, 6,10, 7, 5, 5,11, 8, 7,15,
+103
14,15,13,13,13,13, 8,11,15,10, 7, 6,11, 9,10,15,
+104
};
+105
+106
static const static_codebook _huff_book_line_256x7_class0 = {
+107
1, 64,
+108
(char *)_huff_lengthlist_line_256x7_class0,
+109
0, 0, 0, 0, 0,
+110
NULL,
+111
0
+112
};
+113
+114
static const char _huff_lengthlist_line_256x7_class1[] = {
+115
5, 6, 8,15, 6, 9,10,15,10,11,12,15,15,15,15,15,
+116
4, 6, 7,15, 6, 7, 8,15, 9, 8, 9,15,15,15,15,15,
+117
6, 8, 9,15, 7, 7, 8,15,10, 9,10,15,15,15,15,15,
+118
15,13,15,15,15,10,11,15,15,13,13,15,15,15,15,15,
+119
4, 6, 7,15, 6, 8, 9,15,10,10,12,15,15,15,15,15,
+120
2, 5, 6,15, 5, 6, 7,15, 8, 6, 7,15,15,15,15,15,
+121
5, 6, 8,15, 5, 6, 7,15, 9, 6, 7,15,15,15,15,15,
+122
14,12,13,15,12,10,11,15,15,15,15,15,15,15,15,15,
+123
7, 8, 9,15, 9,10,10,15,15,14,14,15,15,15,15,15,
+124
5, 6, 7,15, 7, 8, 9,15,12, 9,10,15,15,15,15,15,
+125
7, 7, 9,15, 7, 7, 8,15,12, 8, 9,15,15,15,15,15,
+126
13,13,14,15,12,11,12,15,15,15,15,15,15,15,15,15,
+127
15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,
+128
13,13,13,15,15,15,15,15,15,15,15,15,15,15,15,15,
+129
15,12,13,15,15,12,13,15,15,14,15,15,15,15,15,15,
+130
15,15,15,15,15,15,13,15,15,15,15,15,15,15,15,15,
+131
};
+132
+133
static const static_codebook _huff_book_line_256x7_class1 = {
+134
1, 256,
+135
(char *)_huff_lengthlist_line_256x7_class1,
+136
0, 0, 0, 0, 0,
+137
NULL,
+138
0
+139
};
+140
+141
static const char _huff_lengthlist_line_512x17_0sub0[] = {
+142
4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+143
5, 6, 5, 6, 6, 6, 6, 5, 6, 6, 7, 6, 7, 6, 7, 6,
+144
7, 6, 8, 7, 8, 7, 8, 7, 8, 7, 8, 7, 9, 7, 9, 7,
+145
9, 7, 9, 8, 9, 8,10, 8,10, 8,10, 7,10, 6,10, 8,
+146
10, 8,11, 7,10, 7,11, 8,11,11,12,12,11,11,12,11,
+147
13,11,13,11,13,12,15,12,13,13,14,14,14,14,14,15,
+148
15,15,16,14,17,19,19,18,18,18,18,18,18,18,18,18,
+149
18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,
+150
};
+151
+152
static const static_codebook _huff_book_line_512x17_0sub0 = {
+153
1, 128,
+154
(char *)_huff_lengthlist_line_512x17_0sub0,
+155
0, 0, 0, 0, 0,
+156
NULL,
+157
0
+158
};
+159
+160
static const char _huff_lengthlist_line_512x17_1sub0[] = {
+161
2, 4, 5, 4, 5, 4, 5, 4, 5, 5, 5, 5, 5, 5, 6, 5,
+162
6, 5, 6, 6, 7, 6, 7, 6, 8, 7, 8, 7, 8, 7, 8, 7,
+163
};
+164
+165
static const static_codebook _huff_book_line_512x17_1sub0 = {
+166
1, 32,
+167
(char *)_huff_lengthlist_line_512x17_1sub0,
+168
0, 0, 0, 0, 0,
+169
NULL,
+170
0
+171
};
+172
+173
static const char _huff_lengthlist_line_512x17_1sub1[] = {
+174
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+175
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+176
4, 3, 5, 3, 5, 4, 5, 4, 5, 4, 5, 5, 5, 5, 6, 5,
+177
6, 5, 7, 5, 8, 6, 8, 6, 8, 6, 8, 6, 8, 7, 9, 7,
+178
9, 7,11, 9,11,11,12,11,14,12,14,16,14,16,13,16,
+179
14,16,12,15,13,16,14,16,13,14,12,15,13,15,13,13,
+180
13,15,12,14,14,15,13,15,12,15,15,15,15,15,15,15,
+181
15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,
+182
};
+183
+184
static const static_codebook _huff_book_line_512x17_1sub1 = {
+185
1, 128,
+186
(char *)_huff_lengthlist_line_512x17_1sub1,
+187
0, 0, 0, 0, 0,
+188
NULL,
+189
0
+190
};
+191
+192
static const char _huff_lengthlist_line_512x17_2sub1[] = {
+193
0, 4, 5, 4, 4, 4, 5, 4, 4, 4, 5, 4, 5, 4, 5, 3,
+194
5, 3,
+195
};
+196
+197
static const static_codebook _huff_book_line_512x17_2sub1 = {
+198
1, 18,
+199
(char *)_huff_lengthlist_line_512x17_2sub1,
+200
0, 0, 0, 0, 0,
+201
NULL,
+202
0
+203
};
+204
+205
static const char _huff_lengthlist_line_512x17_2sub2[] = {
+206
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+207
0, 0, 4, 3, 4, 3, 4, 4, 5, 4, 5, 4, 6, 4, 6, 5,
+208
6, 5, 7, 5, 7, 6, 8, 6, 8, 6, 8, 7, 8, 7, 9, 7,
+209
9, 8,
+210
};
+211
+212
static const static_codebook _huff_book_line_512x17_2sub2 = {
+213
1, 50,
+214
(char *)_huff_lengthlist_line_512x17_2sub2,
+215
0, 0, 0, 0, 0,
+216
NULL,
+217
0
+218
};
+219
+220
static const char _huff_lengthlist_line_512x17_2sub3[] = {
+221
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+222
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+223
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+224
0, 0, 3, 3, 3, 3, 4, 3, 4, 4, 5, 5, 6, 6, 7, 7,
+225
7, 8, 8,11, 8, 9, 9, 9,10,11,11,11, 9,10,10,11,
+226
11,11,11,10,10,10,10,10,10,10,10,10,10,10,10,10,
+227
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
+228
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
+229
};
+230
+231
static const static_codebook _huff_book_line_512x17_2sub3 = {
+232
1, 128,
+233
(char *)_huff_lengthlist_line_512x17_2sub3,
+234
0, 0, 0, 0, 0,
+235
NULL,
+236
0
+237
};
+238
+239
static const char _huff_lengthlist_line_512x17_3sub1[] = {
+240
0, 4, 4, 4, 4, 4, 4, 3, 4, 4, 4, 4, 4, 5, 4, 5,
+241
5, 5,
+242
};
+243
+244
static const static_codebook _huff_book_line_512x17_3sub1 = {
+245
1, 18,
+246
(char *)_huff_lengthlist_line_512x17_3sub1,
+247
0, 0, 0, 0, 0,
+248
NULL,
+249
0
+250
};
+251
+252
static const char _huff_lengthlist_line_512x17_3sub2[] = {
+253
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+254
0, 0, 2, 3, 3, 4, 3, 5, 4, 6, 4, 6, 5, 7, 6, 7,
+255
6, 8, 6, 8, 7, 9, 8,10, 8,12, 9,13,10,15,10,15,
+256
11,14,
+257
};
+258
+259
static const static_codebook _huff_book_line_512x17_3sub2 = {
+260
1, 50,
+261
(char *)_huff_lengthlist_line_512x17_3sub2,
+262
0, 0, 0, 0, 0,
+263
NULL,
+264
0
+265
};
+266
+267
static const char _huff_lengthlist_line_512x17_3sub3[] = {
+268
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+269
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+270
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+271
0, 0, 4, 8, 4, 8, 4, 8, 4, 8, 5, 8, 5, 8, 6, 8,
+272
4, 8, 4, 8, 5, 8, 5, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+273
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+274
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+275
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+276
};
+277
+278
static const static_codebook _huff_book_line_512x17_3sub3 = {
+279
1, 128,
+280
(char *)_huff_lengthlist_line_512x17_3sub3,
+281
0, 0, 0, 0, 0,
+282
NULL,
+283
0
+284
};
+285
+286
static const char _huff_lengthlist_line_512x17_class1[] = {
+287
1, 2, 3, 6, 5, 4, 7, 7,
+288
};
+289
+290
static const static_codebook _huff_book_line_512x17_class1 = {
+291
1, 8,
+292
(char *)_huff_lengthlist_line_512x17_class1,
+293
0, 0, 0, 0, 0,
+294
NULL,
+295
0
+296
};
+297
+298
static const char _huff_lengthlist_line_512x17_class2[] = {
+299
3, 3, 3,14, 5, 4, 4,11, 8, 6, 6,10,17,12,11,17,
+300
6, 5, 5,15, 5, 3, 4,11, 8, 5, 5, 8,16, 9,10,14,
+301
10, 8, 9,17, 8, 6, 6,13,10, 7, 7,10,16,11,13,14,
+302
17,17,17,17,17,16,16,16,16,15,16,16,16,16,16,16,
+303
};
+304
+305
static const static_codebook _huff_book_line_512x17_class2 = {
+306
1, 64,
+307
(char *)_huff_lengthlist_line_512x17_class2,
+308
0, 0, 0, 0, 0,
+309
NULL,
+310
0
+311
};
+312
+313
static const char _huff_lengthlist_line_512x17_class3[] = {
+314
2, 4, 6,17, 4, 5, 7,17, 8, 7,10,17,17,17,17,17,
+315
3, 4, 6,15, 3, 3, 6,15, 7, 6, 9,17,17,17,17,17,
+316
6, 8,10,17, 6, 6, 8,16, 9, 8,10,17,17,15,16,17,
+317
17,17,17,17,12,15,15,16,12,15,15,16,16,16,16,16,
+318
};
+319
+320
static const static_codebook _huff_book_line_512x17_class3 = {
+321
1, 64,
+322
(char *)_huff_lengthlist_line_512x17_class3,
+323
0, 0, 0, 0, 0,
+324
NULL,
+325
0
+326
};
+327
+328
static const char _huff_lengthlist_line_128x4_class0[] = {
+329
7, 7, 7,11, 6, 6, 7,11, 7, 6, 6,10,12,10,10,13,
+330
7, 7, 8,11, 7, 7, 7,11, 7, 6, 7,10,11,10,10,13,
+331
10,10, 9,12, 9, 9, 9,11, 8, 8, 8,11,13,11,10,14,
+332
15,15,14,15,15,14,13,14,15,12,12,17,17,17,17,17,
+333
7, 7, 6, 9, 6, 6, 6, 9, 7, 6, 6, 8,11,11,10,12,
+334
7, 7, 7, 9, 7, 6, 6, 9, 7, 6, 6, 9,13,10,10,11,
+335
10, 9, 8,10, 9, 8, 8,10, 8, 8, 7, 9,13,12,10,11,
+336
17,14,14,13,15,14,12,13,17,13,12,15,17,17,14,17,
+337
7, 6, 6, 7, 6, 6, 5, 7, 6, 6, 6, 6,11, 9, 9, 9,
+338
7, 7, 6, 7, 7, 6, 6, 7, 6, 6, 6, 6,10, 9, 8, 9,
+339
10, 9, 8, 8, 9, 8, 7, 8, 8, 7, 6, 8,11,10, 9,10,
+340
17,17,12,15,15,15,12,14,14,14,10,12,15,13,12,13,
+341
11,10, 8,10,11,10, 8, 8,10, 9, 7, 7,10, 9, 9,11,
+342
11,11, 9,10,11,10, 8, 9,10, 8, 6, 8,10, 9, 9,11,
+343
14,13,10,12,12,11,10,10, 8, 7, 8,10,10,11,11,12,
+344
17,17,15,17,17,17,17,17,17,13,12,17,17,17,14,17,
+345
};
+346
+347
static const static_codebook _huff_book_line_128x4_class0 = {
+348
1, 256,
+349
(char *)_huff_lengthlist_line_128x4_class0,
+350
0, 0, 0, 0, 0,
+351
NULL,
+352
0
+353
};
+354
+355
static const char _huff_lengthlist_line_128x4_0sub0[] = {
+356
2, 2, 2, 2,
+357
};
+358
+359
static const static_codebook _huff_book_line_128x4_0sub0 = {
+360
1, 4,
+361
(char *)_huff_lengthlist_line_128x4_0sub0,
+362
0, 0, 0, 0, 0,
+363
NULL,
+364
0
+365
};
+366
+367
static const char _huff_lengthlist_line_128x4_0sub1[] = {
+368
0, 0, 0, 0, 3, 2, 3, 2, 3, 3,
+369
};
+370
+371
static const static_codebook _huff_book_line_128x4_0sub1 = {
+372
1, 10,
+373
(char *)_huff_lengthlist_line_128x4_0sub1,
+374
0, 0, 0, 0, 0,
+375
NULL,
+376
0
+377
};
+378
+379
static const char _huff_lengthlist_line_128x4_0sub2[] = {
+380
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 4, 3, 4, 3,
+381
4, 4, 5, 4, 5, 4, 6, 5, 6,
+382
};
+383
+384
static const static_codebook _huff_book_line_128x4_0sub2 = {
+385
1, 25,
+386
(char *)_huff_lengthlist_line_128x4_0sub2,
+387
0, 0, 0, 0, 0,
+388
NULL,
+389
0
+390
};
+391
+392
static const char _huff_lengthlist_line_128x4_0sub3[] = {
+393
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+394
0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 3, 5, 3, 5, 3,
+395
5, 4, 6, 5, 6, 5, 7, 6, 6, 7, 7, 9, 9,11,11,16,
+396
11,14,10,11,11,13,16,15,15,15,15,15,15,15,15,15,
+397
};
+398
+399
static const static_codebook _huff_book_line_128x4_0sub3 = {
+400
1, 64,
+401
(char *)_huff_lengthlist_line_128x4_0sub3,
+402
0, 0, 0, 0, 0,
+403
NULL,
+404
0
+405
};
+406
+407
static const char _huff_lengthlist_line_256x4_class0[] = {
+408
6, 7, 7,12, 6, 6, 7,12, 7, 6, 6,10,15,12,11,13,
+409
7, 7, 8,13, 7, 7, 8,12, 7, 7, 7,11,12,12,11,13,
+410
10, 9, 9,11, 9, 9, 9,10,10, 8, 8,12,14,12,12,14,
+411
11,11,12,14,11,12,11,15,15,12,13,15,15,15,15,15,
+412
6, 6, 7,10, 6, 6, 6,11, 7, 6, 6, 9,14,12,11,13,
+413
7, 7, 7,10, 6, 6, 7, 9, 7, 7, 6,10,13,12,10,12,
+414
9, 9, 9,11, 9, 9, 8, 9, 9, 8, 8,10,13,12,10,12,
+415
12,12,11,13,12,12,11,12,15,13,12,15,15,15,14,14,
+416
6, 6, 6, 8, 6, 6, 5, 6, 7, 7, 6, 5,11,10, 9, 8,
+417
7, 6, 6, 7, 6, 6, 5, 6, 7, 7, 6, 6,11,10, 9, 8,
+418
8, 8, 8, 9, 8, 8, 7, 8, 8, 8, 6, 7,11,10, 9, 9,
+419
14,11,10,14,14,11,10,15,13,11, 9,11,15,12,12,11,
+420
11, 9, 8, 8,10, 9, 8, 9,11,10, 9, 8,12,11,12,11,
+421
13,10, 8, 9,11,10, 8, 9,10, 9, 8, 9,10, 8,12,12,
+422
15,11,10,10,13,11,10,10, 8, 8, 7,12,10, 9,11,12,
+423
15,12,11,15,13,11,11,15,12,14,11,13,15,15,13,13,
+424
};
+425
+426
static const static_codebook _huff_book_line_256x4_class0 = {
+427
1, 256,
+428
(char *)_huff_lengthlist_line_256x4_class0,
+429
0, 0, 0, 0, 0,
+430
NULL,
+431
0
+432
};
+433
+434
static const char _huff_lengthlist_line_256x4_0sub0[] = {
+435
2, 2, 2, 2,
+436
};
+437
+438
static const static_codebook _huff_book_line_256x4_0sub0 = {
+439
1, 4,
+440
(char *)_huff_lengthlist_line_256x4_0sub0,
+441
0, 0, 0, 0, 0,
+442
NULL,
+443
0
+444
};
+445
+446
static const char _huff_lengthlist_line_256x4_0sub1[] = {
+447
0, 0, 0, 0, 2, 2, 3, 3, 3, 3,
+448
};
+449
+450
static const static_codebook _huff_book_line_256x4_0sub1 = {
+451
1, 10,
+452
(char *)_huff_lengthlist_line_256x4_0sub1,
+453
0, 0, 0, 0, 0,
+454
NULL,
+455
0
+456
};
+457
+458
static const char _huff_lengthlist_line_256x4_0sub2[] = {
+459
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 3, 4, 3, 4, 3,
+460
5, 3, 5, 4, 5, 4, 6, 4, 6,
+461
};
+462
+463
static const static_codebook _huff_book_line_256x4_0sub2 = {
+464
1, 25,
+465
(char *)_huff_lengthlist_line_256x4_0sub2,
+466
0, 0, 0, 0, 0,
+467
NULL,
+468
0
+469
};
+470
+471
static const char _huff_lengthlist_line_256x4_0sub3[] = {
+472
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+473
0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 3, 5, 3, 5, 3,
+474
6, 4, 7, 4, 7, 5, 7, 6, 7, 6, 7, 8,10,13,13,13,
+475
13,13,13,13,13,13,13,13,13,13,13,12,12,12,12,12,
+476
};
+477
+478
static const static_codebook _huff_book_line_256x4_0sub3 = {
+479
1, 64,
+480
(char *)_huff_lengthlist_line_256x4_0sub3,
+481
0, 0, 0, 0, 0,
+482
NULL,
+483
0
+484
};
+485
+486
static const char _huff_lengthlist_line_128x7_class0[] = {
+487
10, 7, 8,13, 9, 6, 7,11,10, 8, 8,12,17,17,17,17,
+488
7, 5, 5, 9, 6, 4, 4, 8, 8, 5, 5, 8,16,14,13,16,
+489
7, 5, 5, 7, 6, 3, 3, 5, 8, 5, 4, 7,14,12,12,15,
+490
10, 7, 8, 9, 7, 5, 5, 6, 9, 6, 5, 5,15,12, 9,10,
+491
};
+492
+493
static const static_codebook _huff_book_line_128x7_class0 = {
+494
1, 64,
+495
(char *)_huff_lengthlist_line_128x7_class0,
+496
0, 0, 0, 0, 0,
+497
NULL,
+498
0
+499
};

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
@@ -0,0 +1,7757 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 *
+9
* by the Xiph.Org Foundation https://xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: static codebooks autogenerated by huff/huffbuld
+14
+15
********************************************************************/
+16
+17
#include "codebook.h"
+18
+19
static const long _vq_quantlist__16u0__p1_0[] = {
+20
1,
+21
0,
+22
2,
+23
};
+24
+25
static const char _vq_lengthlist__16u0__p1_0[] = {
+26
1, 4, 4, 5, 7, 7, 5, 7, 8, 5, 8, 8, 8,10,10, 8,
+27
10,11, 5, 8, 8, 8,10,10, 8,10,10, 4, 9, 9, 9,12,
+28
11, 8,11,11, 8,12,11,10,12,14,10,13,13, 7,11,11,
+29
10,14,12,11,14,14, 4, 9, 9, 8,11,11, 9,11,12, 7,
+30
11,11,10,13,14,10,12,14, 8,11,12,10,14,14,10,13,
+31
12,
+32
};
+33
+34
static const static_codebook _16u0__p1_0 = {
+35
4, 81,
+36
(char *)_vq_lengthlist__16u0__p1_0,
+37
1, -535822336, 1611661312, 2, 0,
+38
(long *)_vq_quantlist__16u0__p1_0,
+39
0
+40
};
+41
+42
static const long _vq_quantlist__16u0__p2_0[] = {
+43
1,
+44
0,
+45
2,
+46
};
+47
+48
static const char _vq_lengthlist__16u0__p2_0[] = {
+49
2, 4, 4, 5, 6, 6, 5, 6, 6, 5, 7, 7, 7, 8, 9, 7,
+50
8, 9, 5, 7, 7, 7, 9, 8, 7, 9, 7, 4, 7, 7, 7, 9,
+51
9, 7, 8, 8, 6, 9, 8, 7, 8,11, 9,11,10, 6, 8, 9,
+52
8,11, 8, 9,10,11, 4, 7, 7, 7, 8, 8, 7, 9, 9, 6,
+53
9, 8, 9,11,10, 8, 8,11, 6, 8, 9, 9,10,11, 8,11,
+54
8,
+55
};
+56
+57
static const static_codebook _16u0__p2_0 = {
+58
4, 81,
+59
(char *)_vq_lengthlist__16u0__p2_0,
+60
1, -535822336, 1611661312, 2, 0,
+61
(long *)_vq_quantlist__16u0__p2_0,
+62
0
+63
};
+64
+65
static const long _vq_quantlist__16u0__p3_0[] = {
+66
2,
+67
1,
+68
3,
+69
0,
+70
4,
+71
};
+72
+73
static const char _vq_lengthlist__16u0__p3_0[] = {
+74
1, 5, 5, 7, 7, 6, 7, 7, 8, 8, 6, 7, 8, 8, 8, 8,
+75
9, 9,11,11, 8, 9, 9,11,11, 6, 9, 8,10,10, 8,10,
+76
10,11,11, 8,10,10,11,11,10,11,10,13,12, 9,11,10,
+77
13,13, 6, 8, 9,10,10, 8,10,10,11,11, 8,10,10,11,
+78
11, 9,10,11,13,12,10,10,11,12,12, 8,11,11,14,13,
+79
10,12,11,15,13, 9,12,11,15,14,12,14,13,16,14,12,
+80
13,13,17,14, 8,11,11,13,14, 9,11,12,14,15,10,11,
+81
12,13,15,11,13,13,14,16,12,13,14,14,16, 5, 9, 9,
+82
11,11, 9,11,11,12,12, 8,11,11,12,12,11,12,12,15,
+83
14,10,12,12,15,15, 8,11,11,13,12,10,12,12,13,13,
+84
10,12,12,14,13,12,12,13,14,15,11,13,13,17,16, 7,
+85
11,11,13,13,10,12,12,14,13,10,12,12,13,14,12,13,
+86
12,15,14,11,13,13,15,14, 9,12,12,16,15,11,13,13,
+87
17,16,10,13,13,16,16,13,14,15,15,16,13,15,14,19,
+88
17, 9,12,12,14,16,11,13,13,15,16,10,13,13,17,16,
+89
13,14,13,17,15,12,15,15,16,17, 5, 9, 9,11,11, 8,
+90
11,11,13,12, 9,11,11,12,12,10,12,12,14,15,11,12,
+91
12,14,14, 7,11,10,13,12,10,12,12,14,13,10,11,12,
+92
13,13,11,13,13,15,16,12,12,13,15,15, 7,11,11,13,
+93
13,10,13,13,14,14,10,12,12,13,13,11,13,13,16,15,
+94
12,13,13,15,14, 9,12,12,15,15,10,13,13,17,16,11,
+95
12,13,15,15,12,15,14,18,18,13,14,14,16,17, 9,12,
+96
12,15,16,10,13,13,15,16,11,13,13,15,16,13,15,15,
+97
17,17,13,15,14,16,15, 7,11,11,15,16,10,13,12,16,
+98
17,10,12,13,15,17,15,16,16,18,17,13,15,15,17,18,
+99
8,12,12,16,16,11,13,14,17,18,11,13,13,18,16,15,
+100
17,16,17,19,14,15,15,17,16, 8,12,12,16,15,11,14,
+101
13,18,17,11,13,14,18,17,15,16,16,18,17,13,16,16,
+102
18,18,11,15,14,18,17,13,14,15,18, 0,12,15,15, 0,
+103
17,17,16,17,17,18,14,16,18,18, 0,11,14,14,17, 0,
+104
12,15,14,17,19,12,15,14,18, 0,15,18,16, 0,17,14,
+105
18,16,18, 0, 7,11,11,16,15,10,12,12,18,16,10,13,
+106
13,16,15,13,15,14,17,17,14,16,16,19,18, 8,12,12,
+107
16,16,11,13,13,18,16,11,13,14,17,16,14,15,15,19,
+108
18,15,16,16, 0,19, 8,12,12,16,17,11,13,13,17,17,
+109
11,14,13,17,17,13,15,15,17,19,15,17,17,19, 0,11,
+110
14,15,19,17,12,15,16,18,18,12,14,15,19,17,14,16,
+111
17, 0,18,16,16,19,17, 0,11,14,14,18,19,12,15,14,
+112
17,17,13,16,14,17,16,14,17,16,18,18,15,18,15, 0,
+113
18,
+114
};
+115
+116
static const static_codebook _16u0__p3_0 = {
+117
4, 625,
+118
(char *)_vq_lengthlist__16u0__p3_0,
+119
1, -533725184, 1611661312, 3, 0,
+120
(long *)_vq_quantlist__16u0__p3_0,
+121
0
+122
};
+123
+124
static const long _vq_quantlist__16u0__p4_0[] = {
+125
2,
+126
1,
+127
3,
+128
0,
+129
4,
+130
};
+131
+132
static const char _vq_lengthlist__16u0__p4_0[] = {
+133
3, 5, 5, 8, 8, 6, 6, 6, 9, 9, 6, 6, 6, 9, 9, 9,
+134
10, 9,11,11, 9, 9, 9,11,11, 6, 7, 7,10,10, 7, 7,
+135
8,10,10, 7, 7, 8,10,10,10,10,10,11,12, 9,10,10,
+136
11,12, 6, 7, 7,10,10, 7, 8, 7,10,10, 7, 8, 7,10,
+137
10,10,11,10,12,11,10,10,10,13,10, 9,10,10,12,12,
+138
10,11,10,14,12, 9,11,11,13,13,11,12,13,13,13,11,
+139
12,12,15,13, 9,10,10,12,13, 9,11,10,12,13,10,10,
+140
11,12,13,11,12,12,12,13,11,12,12,13,13, 5, 7, 7,
+141
10,10, 7, 8, 8,10,10, 7, 8, 8,10,10,10,11,10,12,
+142
13,10,10,11,12,12, 6, 8, 8,11,10, 7, 8, 9,10,12,
+143
8, 9, 9,11,11,11,10,11,11,12,10,11,11,13,12, 7,
+144
8, 8,10,11, 8, 9, 8,11,10, 8, 9, 9,11,11,10,12,
+145
10,13,11,10,11,11,13,13,10,11,10,14,13,10,10,11,
+146
13,13,10,12,11,14,13,12,11,13,12,13,13,12,13,14,
+147
14,10,11,11,13,13,10,11,10,12,13,10,12,12,12,14,
+148
12,12,12,14,12,12,13,12,17,15, 5, 7, 7,10,10, 7,
+149
8, 8,10,10, 7, 8, 8,11,10,10,10,11,12,12,10,11,
+150
11,12,13, 6, 8, 8,11,10, 8, 9, 9,11,11, 7, 8, 9,
+151
10,11,11,11,11,12,12,10,10,11,12,13, 6, 8, 8,10,
+152
11, 8, 9, 9,11,11, 7, 9, 7,11,10,10,12,12,13,13,
+153
11,11,10,13,11, 9,11,10,14,13,11,11,11,15,13,10,
+154
10,11,13,13,12,13,13,14,14,12,11,12,12,13,10,11,
+155
11,12,13,10,11,12,13,13,10,11,10,13,12,12,12,13,
+156
14, 0,12,13,11,13,11, 8,10,10,13,13,10,11,11,14,
+157
13,10,11,11,13,12,13,14,14,14,15,12,12,12,15,14,
+158
9,11,10,13,12,10,10,11,13,14,11,11,11,15,12,13,
+159
12,14,15,16,13,13,13,14,13, 9,11,11,12,12,10,12,
+160
11,13,13,10,11,11,13,14,13,13,13,15,15,13,13,14,
+161
17,15,11,12,12,14,14,10,11,12,13,15,12,13,13, 0,
+162
15,13,11,14,12,16,14,16,14, 0,15,11,12,12,14,16,
+163
11,13,12,16,15,12,13,13,14,15,12,14,12,15,13,15,
+164
14,14,16,16, 8,10,10,13,13,10,11,10,13,14,10,11,
+165
11,13,13,13,13,12,14,14,14,13,13,16,17, 9,10,10,
+166
12,14,10,12,11,14,13,10,11,12,13,14,12,12,12,15,
+167
15,13,13,13,14,14, 9,10,10,13,13,10,11,12,12,14,
+168
10,11,10,13,13,13,13,13,14,16,13,13,13,14,14,11,
+169
12,13,15,13,12,14,13,14,16,12,12,13,13,14,13,14,
+170
14,17,15,13,12,17,13,16,11,12,13,14,15,12,13,14,
+171
14,17,11,12,11,14,14,13,16,14,16, 0,14,15,11,15,
+172
11,
+173
};
+174
+175
static const static_codebook _16u0__p4_0 = {
+176
4, 625,
+177
(char *)_vq_lengthlist__16u0__p4_0,
+178
1, -533725184, 1611661312, 3, 0,
+179
(long *)_vq_quantlist__16u0__p4_0,
+180
0
+181
};
+182
+183
static const long _vq_quantlist__16u0__p5_0[] = {
+184
4,
+185
3,
+186
5,
+187
2,
+188
6,
+189
1,
+190
7,
+191
0,
+192
8,
+193
};
+194
+195
static const char _vq_lengthlist__16u0__p5_0[] = {
+196
1, 4, 4, 7, 7, 7, 7, 9, 9, 4, 6, 6, 8, 8, 8, 8,
+197
9, 9, 4, 6, 6, 8, 8, 8, 8, 9, 9, 7, 8, 8, 9, 9,
+198
9, 9,11,10, 7, 8, 8, 9, 9, 9, 9,10,11, 7, 8, 8,
+199
9, 9,10,10,11,11, 7, 8, 8, 9, 9,10,10,11,11, 9,
+200
9, 9,10,10,11,11,12,12, 9, 9, 9,10,10,11,11,12,
+201
12,
+202
};
+203
+204
static const static_codebook _16u0__p5_0 = {
+205
2, 81,
+206
(char *)_vq_lengthlist__16u0__p5_0,
+207
1, -531628032, 1611661312, 4, 0,
+208
(long *)_vq_quantlist__16u0__p5_0,
+209
0
+210
};
+211
+212
static const long _vq_quantlist__16u0__p6_0[] = {
+213
6,
+214
5,
+215
7,
+216
4,
+217
8,
+218
3,
+219
9,
+220
2,
+221
10,
+222
1,
+223
11,
+224
0,
+225
12,
+226
};
+227
+228
static const char _vq_lengthlist__16u0__p6_0[] = {
+229
1, 4, 4, 7, 7,10,10,12,12,13,13,18,17, 3, 6, 6,
+230
9, 9,11,11,13,13,14,14,18,17, 3, 6, 6, 9, 9,11,
+231
11,13,13,14,14,17,18, 7, 9, 9,11,11,13,13,14,14,
+232
15,15, 0, 0, 7, 9, 9,11,11,13,13,14,14,15,16,19,
+233
18,10,11,11,13,13,14,14,16,15,17,18, 0, 0,10,11,
+234
11,13,13,14,14,15,15,16,18, 0, 0,11,13,13,14,14,
+235
15,15,17,17, 0,19, 0, 0,11,13,13,14,14,14,15,16,
+236
18, 0,19, 0, 0,13,14,14,15,15,18,17,18,18, 0,19,
+237
0, 0,13,14,14,15,16,16,16,18,18,19, 0, 0, 0,16,
+238
17,17, 0,17,19,19, 0,19, 0, 0, 0, 0,16,19,16,17,
+239
18, 0,19, 0, 0, 0, 0, 0, 0,
+240
};
+241
+242
static const static_codebook _16u0__p6_0 = {
+243
2, 169,
+244
(char *)_vq_lengthlist__16u0__p6_0,
+245
1, -526516224, 1616117760, 4, 0,
+246
(long *)_vq_quantlist__16u0__p6_0,
+247
0
+248
};
+249
+250
static const long _vq_quantlist__16u0__p6_1[] = {
+251
2,
+252
1,
+253
3,
+254
0,
+255
4,
+256
};
+257
+258
static const char _vq_lengthlist__16u0__p6_1[] = {
+259
1, 4, 5, 6, 6, 4, 6, 6, 6, 6, 4, 6, 6, 6, 6, 6,
+260
6, 6, 7, 7, 6, 6, 6, 7, 7,
+261
};
+262
+263
static const static_codebook _16u0__p6_1 = {
+264
2, 25,
+265
(char *)_vq_lengthlist__16u0__p6_1,
+266
1, -533725184, 1611661312, 3, 0,
+267
(long *)_vq_quantlist__16u0__p6_1,
+268
0
+269
};
+270
+271
static const long _vq_quantlist__16u0__p7_0[] = {
+272
1,
+273
0,
+274
2,
+275
};
+276
+277
static const char _vq_lengthlist__16u0__p7_0[] = {
+278
1, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
+279
8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
+280
8, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+281
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+282
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+283
7,
+284
};
+285
+286
static const static_codebook _16u0__p7_0 = {
+287
4, 81,
+288
(char *)_vq_lengthlist__16u0__p7_0,
+289
1, -518803456, 1628680192, 2, 0,
+290
(long *)_vq_quantlist__16u0__p7_0,
+291
0
+292
};
+293
+294
static const long _vq_quantlist__16u0__p7_1[] = {
+295
7,
+296
6,
+297
8,
+298
5,
+299
9,
+300
4,
+301
10,
+302
3,
+303
11,
+304
2,
+305
12,
+306
1,
+307
13,
+308
0,
+309
14,
+310
};
+311
+312
static const char _vq_lengthlist__16u0__p7_1[] = {
+313
1, 5, 5, 6, 5, 9,10,11,11,10,10,10,10,10,10, 5,
+314
8, 8, 8,10,10,10,10,10,10,10,10,10,10,10, 5, 8,
+315
9, 9, 9,10,10,10,10,10,10,10,10,10,10, 5,10, 8,
+316
10,10,10,10,10,10,10,10,10,10,10,10, 4, 8, 9,10,
+317
10,10,10,10,10,10,10,10,10,10,10, 9,10,10,10,10,
+318
10,10,10,10,10,10,10,10,10,10, 9,10,10,10,10,10,
+319
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
+320
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
+321
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
+322
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
+323
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
+324
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
+325
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
+326
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
+327
10,
+328
};
+329
+330
static const static_codebook _16u0__p7_1 = {
+331
2, 225,
+332
(char *)_vq_lengthlist__16u0__p7_1,
+333
1, -520986624, 1620377600, 4, 0,
+334
(long *)_vq_quantlist__16u0__p7_1,
+335
0
+336
};
+337
+338
static const long _vq_quantlist__16u0__p7_2[] = {
+339
10,
+340
9,
+341
11,
+342
8,
+343
12,
+344
7,
+345
13,
+346
6,
+347
14,
+348
5,
+349
15,
+350
4,
+351
16,
+352
3,
+353
17,
+354
2,
+355
18,
+356
1,
+357
19,
+358
0,
+359
20,
+360
};
+361
+362
static const char _vq_lengthlist__16u0__p7_2[] = {
+363
1, 6, 6, 7, 8, 7, 7,10, 9,10, 9,11,10, 9,11,10,
+364
9, 9, 9, 9,10, 6, 8, 7, 9, 9, 8, 8,10,10, 9,11,
+365
11,12,12,10, 9,11, 9,12,10, 9, 6, 9, 8, 9,12, 8,
+366
8,11, 9,11,11,12,11,12,12,10,11,11,10,10,11, 7,
+367
10, 9, 9, 9, 9, 9,10, 9,10, 9,10,10,12,10,10,10,
+368
11,12,10,10, 7, 9, 9, 9,10, 9, 9,10,10, 9, 9, 9,
+369
11,11,10,10,10,10, 9, 9,12, 7, 9,10, 9,11, 9,10,
+370
9,10,11,11,11,10,11,12, 9,12,11,10,10,10, 7, 9,
+371
9, 9, 9,10,12,10, 9,11,12,10,11,12,12,11, 9,10,
+372
11,10,11, 7, 9,10,10,11,10, 9,10,11,11,11,10,12,
+373
12,12,11,11,10,11,11,12, 8, 9,10,12,11,10,10,12,
+374
12,12,12,12,10,11,11, 9,11,10,12,11,11, 8, 9,10,
+375
10,11,12,11,11,10,10,10,12,12,12, 9,10,12,12,12,
+376
12,12, 8,10,11,10,10,12, 9,11,12,12,11,12,12,12,
+377
12,10,12,10,10,10,10, 8,12,11,11,11,10,10,11,12,
+378
12,12,12,11,12,12,12,11,11,11,12,10, 9,10,10,12,
+379
10,12,10,12,12,10,10,10,11,12,12,12,11,12,12,12,
+380
11,10,11,12,12,12,11,12,12,11,12,12,11,12,12,12,
+381
12,11,12,12,10,10,10,10,11,11,12,11,12,12,12,12,
+382
12,12,12,11,12,11,10,11,11,12,11,11, 9,10,10,10,
+383
12,10,10,11, 9,11,12,11,12,11,12,12,10,11,10,12,
+384
9, 9, 9,12,11,10,11,10,12,10,12,10,12,12,12,11,
+385
11,11,11,11,10, 9,10,10,11,10,11,11,12,11,10,11,
+386
12,12,12,11,11, 9,12,10,12, 9,10,12,10,10,11,10,
+387
11,11,12,11,10,11,10,11,11,11,11,12,11,11,10, 9,
+388
10,10,10, 9,11,11,10, 9,12,10,11,12,11,12,12,11,
+389
12,11,12,11,10,11,10,12,11,12,11,12,11,12,10,11,
+390
10,10,12,11,10,11,11,11,10,
+391
};
+392
+393
static const static_codebook _16u0__p7_2 = {
+394
2, 441,
+395
(char *)_vq_lengthlist__16u0__p7_2,
+396
1, -529268736, 1611661312, 5, 0,
+397
(long *)_vq_quantlist__16u0__p7_2,
+398
0
+399
};
+400
+401
static const char _huff_lengthlist__16u0__single[] = {
+402
3, 5, 8, 7,14, 8, 9,19, 5, 2, 5, 5, 9, 6, 9,19,
+403
8, 4, 5, 7, 8, 9,13,19, 7, 4, 6, 5, 9, 6, 9,19,
+404
12, 8, 7, 9,10,11,13,19, 8, 5, 8, 6, 9, 6, 7,19,
+405
8, 8,10, 7, 7, 4, 5,19,12,17,19,15,18,13,11,18,
+406
};
+407
+408
static const static_codebook _huff_book__16u0__single = {
+409
2, 64,
+410
(char *)_huff_lengthlist__16u0__single,
+411
0, 0, 0, 0, 0,
+412
NULL,
+413
0
+414
};
+415
+416
static const char _huff_lengthlist__16u1__long[] = {
+417
3, 6,10, 8,12, 8,14, 8,14,19, 5, 3, 5, 5, 7, 6,
+418
11, 7,16,19, 7, 5, 6, 7, 7, 9,11,12,19,19, 6, 4,
+419
7, 5, 7, 6,10, 7,18,18, 8, 6, 7, 7, 7, 7, 8, 9,
+420
18,18, 7, 5, 8, 5, 7, 5, 8, 6,18,18,12, 9,10, 9,
+421
9, 9, 8, 9,18,18, 8, 7,10, 6, 8, 5, 6, 4,11,18,
+422
11,15,16,12,11, 8, 8, 6, 9,18,14,18,18,18,16,16,
+423
16,13,16,18,
+424
};
+425
+426
static const static_codebook _huff_book__16u1__long = {
+427
2, 100,
+428
(char *)_huff_lengthlist__16u1__long,
+429
0, 0, 0, 0, 0,
+430
NULL,
+431
0
+432
};
+433
+434
static const long _vq_quantlist__16u1__p1_0[] = {
+435
1,
+436
0,
+437
2,
+438
};
+439
+440
static const char _vq_lengthlist__16u1__p1_0[] = {
+441
1, 4, 4, 5, 7, 7, 5, 7, 7, 5, 8, 7, 7,10,10, 7,
+442
9,10, 5, 7, 8, 7,10, 9, 7,10,10, 5, 8, 8, 8,10,
+443
10, 8,10,10, 7,10,10,10,11,12,10,12,13, 7,10,10,
+444
9,13,11,10,12,13, 5, 8, 8, 8,10,10, 8,10,10, 7,
+445
10,10,10,12,12, 9,11,12, 7,10,11,10,12,12,10,13,
+446
11,
+447
};
+448
+449
static const static_codebook _16u1__p1_0 = {
+450
4, 81,
+451
(char *)_vq_lengthlist__16u1__p1_0,
+452
1, -535822336, 1611661312, 2, 0,
+453
(long *)_vq_quantlist__16u1__p1_0,
+454
0
+455
};
+456
+457
static const long _vq_quantlist__16u1__p2_0[] = {
+458
1,
+459
0,
+460
2,
+461
};
+462
+463
static const char _vq_lengthlist__16u1__p2_0[] = {
+464
3, 4, 4, 5, 6, 6, 5, 6, 6, 5, 6, 6, 6, 7, 8, 6,
+465
7, 8, 5, 6, 6, 6, 8, 7, 6, 8, 7, 5, 6, 6, 6, 8,
+466
8, 6, 8, 8, 6, 8, 8, 7, 7,10, 8, 9, 9, 6, 8, 8,
+467
7, 9, 8, 8, 9,10, 5, 6, 6, 6, 8, 8, 7, 8, 8, 6,
+468
8, 8, 8,10, 9, 7, 8, 9, 6, 8, 8, 8, 9, 9, 7,10,
+469
8,
+470
};
+471
+472
static const static_codebook _16u1__p2_0 = {
+473
4, 81,
+474
(char *)_vq_lengthlist__16u1__p2_0,
+475
1, -535822336, 1611661312, 2, 0,
+476
(long *)_vq_quantlist__16u1__p2_0,
+477
0
+478
};
+479
+480
static const long _vq_quantlist__16u1__p3_0[] = {
+481
2,
+482
1,
+483
3,
+484
0,
+485
4,
+486
};
+487
+488
static const char _vq_lengthlist__16u1__p3_0[] = {
+489
1, 5, 5, 8, 8, 6, 7, 7, 9, 9, 5, 7, 7, 9, 9, 9,
+490
10, 9,11,11, 9, 9,10,11,11, 6, 8, 8,10,10, 8, 9,
+491
10,11,11, 8, 9,10,11,11,10,11,11,12,13,10,11,11,
+492
13,13, 6, 8, 8,10,10, 8,10, 9,11,11, 8,10, 9,11,
+493
11,10,11,11,13,13,10,11,11,13,12, 9,11,11,14,13,
+494
10,12,12,15,14,10,12,11,14,13,12,13,13,15,15,12,
+495
13,13,16,14, 9,11,11,13,14,10,11,12,14,14,10,12,
+496
12,14,15,12,13,13,14,15,12,13,14,15,16, 5, 8, 8,
+497
11,11, 8,10,10,12,12, 8,10,10,12,12,11,12,12,14,
+498
14,11,12,12,14,14, 8,10,10,12,12, 9,11,12,12,13,
+499
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
@@ -0,0 +1,461 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2015 *
+9
* by the Xiph.Org Foundation https://xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: basic codebook pack/unpack/code/decode operations
+14
+15
********************************************************************/
+16
+17
#include <stdlib.h>
+18
#include <string.h>
+19
#include <math.h>
+20
#include <ogg/ogg.h>
+21
#include "vorbis/codec.h"
+22
#include "codebook.h"
+23
#include "scales.h"
+24
#include "misc.h"
+25
#include "os.h"
+26
+27
/* packs the given codebook into the bitstream **************************/
+28
+29
int vorbis_staticbook_pack(const static_codebook *c,oggpack_buffer *opb){
+30
long i,j;
+31
int ordered=0;
+32
+33
/* first the basic parameters */
+34
oggpack_write(opb,0x564342,24);
+35
oggpack_write(opb,c->dim,16);
+36
oggpack_write(opb,c->entries,24);
+37
+38
/* pack the codewords. There are two packings; length ordered and
+39
length random. Decide between the two now. */
+40
+41
for(i=1;i<c->entries;i++)
+42
if(c->lengthlist[i-1]==0 || c->lengthlist[i]<c->lengthlist[i-1])break;
+43
if(i==c->entries)ordered=1;
+44
+45
if(ordered){
+46
/* length ordered. We only need to say how many codewords of
+47
each length. The actual codewords are generated
+48
deterministically */
+49
+50
long count=0;
+51
oggpack_write(opb,1,1); /* ordered */
+52
oggpack_write(opb,c->lengthlist[0]-1,5); /* 1 to 32 */
+53
+54
for(i=1;i<c->entries;i++){
+55
char this=c->lengthlist[i];
+56
char last=c->lengthlist[i-1];
+57
if(this>last){
+58
for(j=last;j<this;j++){
+59
oggpack_write(opb,i-count,ov_ilog(c->entries-count));
+60
count=i;
+61
}
+62
}
+63
}
+64
oggpack_write(opb,i-count,ov_ilog(c->entries-count));
+65
+66
}else{
+67
/* length random. Again, we don't code the codeword itself, just
+68
the length. This time, though, we have to encode each length */
+69
oggpack_write(opb,0,1); /* unordered */
+70
+71
/* algortihmic mapping has use for 'unused entries', which we tag
+72
here. The algorithmic mapping happens as usual, but the unused
+73
entry has no codeword. */
+74
for(i=0;i<c->entries;i++)
+75
if(c->lengthlist[i]==0)break;
+76
+77
if(i==c->entries){
+78
oggpack_write(opb,0,1); /* no unused entries */
+79
for(i=0;i<c->entries;i++)
+80
oggpack_write(opb,c->lengthlist[i]-1,5);
+81
}else{
+82
oggpack_write(opb,1,1); /* we have unused entries; thus we tag */
+83
for(i=0;i<c->entries;i++){
+84
if(c->lengthlist[i]==0){
+85
oggpack_write(opb,0,1);
+86
}else{
+87
oggpack_write(opb,1,1);
+88
oggpack_write(opb,c->lengthlist[i]-1,5);
+89
}
+90
}
+91
}
+92
}
+93
+94
/* is the entry number the desired return value, or do we have a
+95
mapping? If we have a mapping, what type? */
+96
oggpack_write(opb,c->maptype,4);
+97
switch(c->maptype){
+98
case 0:
+99
/* no mapping */
+100
break;
+101
case 1:case 2:
+102
/* implicitly populated value mapping */
+103
/* explicitly populated value mapping */
+104
+105
if(!c->quantlist){
+106
/* no quantlist? error */
+107
return(-1);
+108
}
+109
+110
/* values that define the dequantization */
+111
oggpack_write(opb,c->q_min,32);
+112
oggpack_write(opb,c->q_delta,32);
+113
oggpack_write(opb,c->q_quant-1,4);
+114
oggpack_write(opb,c->q_sequencep,1);
+115
+116
{
+117
int quantvals;
+118
switch(c->maptype){
+119
case 1:
+120
/* a single column of (c->entries/c->dim) quantized values for
+121
building a full value list algorithmically (square lattice) */
+122
quantvals=_book_maptype1_quantvals(c);
+123
break;
+124
case 2:
+125
/* every value (c->entries*c->dim total) specified explicitly */
+126
quantvals=c->entries*c->dim;
+127
break;
+128
default: /* NOT_REACHABLE */
+129
quantvals=-1;
+130
}
+131
+132
/* quantized values */
+133
for(i=0;i<quantvals;i++)
+134
oggpack_write(opb,labs(c->quantlist[i]),c->q_quant);
+135
+136
}
+137
break;
+138
default:
+139
/* error case; we don't have any other map types now */
+140
return(-1);
+141
}
+142
+143
return(0);
+144
}
+145
+146
/* unpacks a codebook from the packet buffer into the codebook struct,
+147
readies the codebook auxiliary structures for decode *************/
+148
static_codebook *vorbis_staticbook_unpack(oggpack_buffer *opb){
+149
long i,j;
+150
static_codebook *s=_ogg_calloc(1,sizeof(*s));
+151
s->allocedp=1;
+152
+153
/* make sure alignment is correct */
+154
if(oggpack_read(opb,24)!=0x564342)goto _eofout;
+155
+156
/* first the basic parameters */
+157
s->dim=oggpack_read(opb,16);
+158
s->entries=oggpack_read(opb,24);
+159
if(s->entries==-1)goto _eofout;
+160
+161
if(ov_ilog(s->dim)+ov_ilog(s->entries)>24)goto _eofout;
+162
+163
/* codeword ordering.... length ordered or unordered? */
+164
switch((int)oggpack_read(opb,1)){
+165
case 0:{
+166
long unused;
+167
/* allocated but unused entries? */
+168
unused=oggpack_read(opb,1);
+169
if((s->entries*(unused?1:5)+7)>>3>opb->storage-oggpack_bytes(opb))
+170
goto _eofout;
+171
/* unordered */
+172
s->lengthlist=_ogg_malloc(sizeof(*s->lengthlist)*s->entries);
+173
+174
/* allocated but unused entries? */
+175
if(unused){
+176
/* yes, unused entries */
+177
+178
for(i=0;i<s->entries;i++){
+179
if(oggpack_read(opb,1)){
+180
long num=oggpack_read(opb,5);
+181
if(num==-1)goto _eofout;
+182
s->lengthlist[i]=num+1;
+183
}else
+184
s->lengthlist[i]=0;
+185
}
+186
}else{
+187
/* all entries used; no tagging */
+188
for(i=0;i<s->entries;i++){
+189
long num=oggpack_read(opb,5);
+190
if(num==-1)goto _eofout;
+191
s->lengthlist[i]=num+1;
+192
}
+193
}
+194
+195
break;
+196
}
+197
case 1:
+198
/* ordered */
+199
{
+200
long length=oggpack_read(opb,5)+1;
+201
if(length==0)goto _eofout;
+202
s->lengthlist=_ogg_malloc(sizeof(*s->lengthlist)*s->entries);
+203
+204
for(i=0;i<s->entries;){
+205
long num=oggpack_read(opb,ov_ilog(s->entries-i));
+206
if(num==-1)goto _eofout;
+207
if(length>32 || num>s->entries-i ||
+208
(num>0 && (num-1)>>(length-1)>1)){
+209
goto _errout;
+210
}
+211
if(length>32)goto _errout;
+212
for(j=0;j<num;j++,i++)
+213
s->lengthlist[i]=length;
+214
length++;
+215
}
+216
}
+217
break;
+218
default:
+219
/* EOF */
+220
goto _eofout;
+221
}
+222
+223
/* Do we have a mapping to unpack? */
+224
switch((s->maptype=oggpack_read(opb,4))){
+225
case 0:
+226
/* no mapping */
+227
break;
+228
case 1: case 2:
+229
/* implicitly populated value mapping */
+230
/* explicitly populated value mapping */
+231
+232
s->q_min=oggpack_read(opb,32);
+233
s->q_delta=oggpack_read(opb,32);
+234
s->q_quant=oggpack_read(opb,4)+1;
+235
s->q_sequencep=oggpack_read(opb,1);
+236
if(s->q_sequencep==-1)goto _eofout;
+237
+238
{
+239
int quantvals=0;
+240
switch(s->maptype){
+241
case 1:
+242
quantvals=(s->dim==0?0:_book_maptype1_quantvals(s));
+243
break;
+244
case 2:
+245
quantvals=s->entries*s->dim;
+246
break;
+247
}
+248
+249
/* quantized values */
+250
if(((quantvals*s->q_quant+7)>>3)>opb->storage-oggpack_bytes(opb))
+251
goto _eofout;
+252
s->quantlist=_ogg_malloc(sizeof(*s->quantlist)*quantvals);
+253
for(i=0;i<quantvals;i++)
+254
s->quantlist[i]=oggpack_read(opb,s->q_quant);
+255
+256
if(quantvals&&s->quantlist[quantvals-1]==-1)goto _eofout;
+257
}
+258
break;
+259
default:
+260
goto _errout;
+261
}
+262
+263
/* all set */
+264
return(s);
+265
+266
_errout:
+267
_eofout:
+268
vorbis_staticbook_destroy(s);
+269
return(NULL);
+270
}
+271
+272
/* returns the number of bits ************************************************/
+273
int vorbis_book_encode(codebook *book, int a, oggpack_buffer *b){
+274
if(a<0 || a>=book->c->entries)return(0);
+275
oggpack_write(b,book->codelist[a],book->c->lengthlist[a]);
+276
return(book->c->lengthlist[a]);
+277
}
+278
+279
/* the 'eliminate the decode tree' optimization actually requires the
+280
codewords to be MSb first, not LSb. This is an annoying inelegancy
+281
(and one of the first places where carefully thought out design
+282
turned out to be wrong; Vorbis II and future Ogg codecs should go
+283
to an MSb bitpacker), but not actually the huge hit it appears to
+284
be. The first-stage decode table catches most words so that
+285
bitreverse is not in the main execution path. */
+286
+287
static ogg_uint32_t bitreverse(ogg_uint32_t x){
+288
x= ((x>>16)&0x0000ffff) | ((x<<16)&0xffff0000);
+289
x= ((x>> 8)&0x00ff00ff) | ((x<< 8)&0xff00ff00);
+290
x= ((x>> 4)&0x0f0f0f0f) | ((x<< 4)&0xf0f0f0f0);
+291
x= ((x>> 2)&0x33333333) | ((x<< 2)&0xcccccccc);
+292
return((x>> 1)&0x55555555) | ((x<< 1)&0xaaaaaaaa);
+293
}
+294
+295
STIN long decode_packed_entry_number(codebook *book, oggpack_buffer *b){
+296
int read=book->dec_maxlength;
+297
long lo,hi;
+298
long lok = oggpack_look(b,book->dec_firsttablen);
+299
+300
if (lok >= 0) {
+301
long entry = book->dec_firsttable[lok];
+302
if(entry&0x80000000UL){
+303
lo=(entry>>15)&0x7fff;
+304
hi=book->used_entries-(entry&0x7fff);
+305
}else{
+306
oggpack_adv(b, book->dec_codelengths[entry-1]);
+307
return(entry-1);
+308
}
+309
}else{
+310
lo=0;
+311
hi=book->used_entries;
+312
}
+313
+314
/* Single entry codebooks use a firsttablen of 1 and a
+315
dec_maxlength of 1. If a single-entry codebook gets here (due to
+316
failure to read one bit above), the next look attempt will also
+317
fail and we'll correctly kick out instead of trying to walk the
+318
underformed tree */
+319
+320
lok = oggpack_look(b, read);
+321
+322
while(lok<0 && read>1)
+323
lok = oggpack_look(b, --read);
+324
if(lok<0)return -1;
+325
+326
/* bisect search for the codeword in the ordered list */
+327
{
+328
ogg_uint32_t testword=bitreverse((ogg_uint32_t)lok);
+329
+330
while(hi-lo>1){
+331
long p=(hi-lo)>>1;
+332
long test=book->codelist[lo+p]>testword;
+333
lo+=p&(test-1);
+334
hi-=p&(-test);
+335
}
+336
+337
if(book->dec_codelengths[lo]<=read){
+338
oggpack_adv(b, book->dec_codelengths[lo]);
+339
return(lo);
+340
}
+341
}
+342
+343
oggpack_adv(b, read);
+344
+345
return(-1);
+346
}
+347
+348
/* Decode side is specced and easier, because we don't need to find
+349
matches using different criteria; we simply read and map. There are
+350
two things we need to do 'depending':
+351
+352
We may need to support interleave. We don't really, but it's
+353
convenient to do it here rather than rebuild the vector later.
+354
+355
Cascades may be additive or multiplicitive; this is not inherent in
+356
the codebook, but set in the code using the codebook. Like
+357
interleaving, it's easiest to do it here.
+358
addmul==0 -> declarative (set the value)
+359
addmul==1 -> additive
+360
addmul==2 -> multiplicitive */
+361
+362
/* returns the [original, not compacted] entry number or -1 on eof *********/
+363
long vorbis_book_decode(codebook *book, oggpack_buffer *b){
+364
if(book->used_entries>0){
+365
long packed_entry=decode_packed_entry_number(book,b);
+366
if(packed_entry>=0)
+367
return(book->dec_index[packed_entry]);
+368
}
+369
+370
/* if there's no dec_index, the codebook unpacking isn't collapsed */
+371
return(-1);
+372
}
+373
+374
/* returns 0 on OK or -1 on eof *************************************/
+375
/* decode vector / dim granularity gaurding is done in the upper layer */
+376
long vorbis_book_decodevs_add(codebook *book,float *a,oggpack_buffer *b,int n){
+377
if(book->used_entries>0){
+378
int step=n/book->dim;
+379
long *entry = alloca(sizeof(*entry)*step);
+380
float **t = alloca(sizeof(*t)*step);
+381
int i,j,o;
+382
+383
for (i = 0; i < step; i++) {
+384
entry[i]=decode_packed_entry_number(book,b);
+385
if(entry[i]==-1)return(-1);
+386
t[i] = book->valuelist+entry[i]*book->dim;
+387
}
+388
for(i=0,o=0;i<book->dim;i++,o+=step)
+389
for (j=0;o+j<n && j<step;j++)
+390
a[o+j]+=t[j][i];
+391
}
+392
return(0);
+393
}
+394
+395
/* decode vector / dim granularity gaurding is done in the upper layer */
+396
long vorbis_book_decodev_add(codebook *book,float *a,oggpack_buffer *b,int n){
+397
if(book->used_entries>0){
+398
int i,j,entry;
+399
float *t;
+400
+401
for(i=0;i<n;){
+402
entry = decode_packed_entry_number(book,b);
+403
if(entry==-1)return(-1);
+404
t = book->valuelist+entry*book->dim;
+405
for(j=0;i<n && j<book->dim;)
+406
a[i++]+=t[j++];
+407
}
+408
}
+409
return(0);
+410
}
+411
+412
/* unlike the others, we guard against n not being an integer number
+413
of <dim> internally rather than in the upper layer (called only by
+414
floor0) */
+415
long vorbis_book_decodev_set(codebook *book,float *a,oggpack_buffer *b,int n){
+416
if(book->used_entries>0){
+417
int i,j,entry;
+418
float *t;
+419
+420
for(i=0;i<n;){
+421
entry = decode_packed_entry_number(book,b);
+422
if(entry==-1)return(-1);
+423
t = book->valuelist+entry*book->dim;
+424
for (j=0;i<n && j<book->dim;){
+425
a[i++]=t[j++];
+426
}
+427
}
+428
}else{
+429
int i;
+430
+431
for(i=0;i<n;){
+432
a[i++]=0.f;
+433
}
+434
}
+435
return(0);
+436
}
+437
+438
long vorbis_book_decodevv_add(codebook *book,float **a,long offset,int ch,
+439
oggpack_buffer *b,int n){
+440
+441
long i,j,entry;
+442
int chptr=0;
+443
if(book->used_entries>0){
+444
int m=(offset+n)/ch;
+445
for(i=offset/ch;i<m;){
+446
entry = decode_packed_entry_number(book,b);
+447
if(entry==-1)return(-1);
+448
{
+449
const float *t = book->valuelist+entry*book->dim;
+450
for (j=0;i<m && j<book->dim;j++){
+451
a[chptr++][i]+=t[j];
+452
if(chptr==ch){
+453
chptr=0;
+454
i++;
+455
}
+456
}
+457
}
+458
}
+459
}
+460
return(0);
+461
}
vendor/vorbis/lib/codebook.hadded
@@ -0,0 +1,117 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2015 *
+9
* by the Xiph.Org Foundation https://xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: basic shared codebook operations
+14
+15
********************************************************************/
+16
+17
#ifndef _V_CODEBOOK_H_
+18
#define _V_CODEBOOK_H_
+19
+20
#include <ogg/ogg.h>
+21
+22
/* This structure encapsulates huffman and VQ style encoding books; it
+23
doesn't do anything specific to either.
+24
+25
valuelist/quantlist are nonNULL (and q_* significant) only if
+26
there's entry->value mapping to be done.
+27
+28
If encode-side mapping must be done (and thus the entry needs to be
+29
hunted), the auxiliary encode pointer will point to a decision
+30
tree. This is true of both VQ and huffman, but is mostly useful
+31
with VQ.
+32
+33
*/
+34
+35
typedef struct static_codebook{
+36
long dim; /* codebook dimensions (elements per vector) */
+37
long entries; /* codebook entries */
+38
char *lengthlist; /* codeword lengths in bits */
+39
+40
/* mapping ***************************************************************/
+41
int maptype; /* 0=none
+42
1=implicitly populated values from map column
+43
2=listed arbitrary values */
+44
+45
/* The below does a linear, single monotonic sequence mapping. */
+46
long q_min; /* packed 32 bit float; quant value 0 maps to minval */
+47
long q_delta; /* packed 32 bit float; val 1 - val 0 == delta */
+48
int q_quant; /* bits: 0 < quant <= 16 */
+49
int q_sequencep; /* bitflag */
+50
+51
long *quantlist; /* map == 1: (int)(entries^(1/dim)) element column map
+52
map == 2: list of dim*entries quantized entry vals
+53
*/
+54
int allocedp;
+55
} static_codebook;
+56
+57
typedef struct codebook{
+58
long dim; /* codebook dimensions (elements per vector) */
+59
long entries; /* codebook entries */
+60
long used_entries; /* populated codebook entries */
+61
const static_codebook *c;
+62
+63
/* for encode, the below are entry-ordered, fully populated */
+64
/* for decode, the below are ordered by bitreversed codeword and only
+65
used entries are populated */
+66
float *valuelist; /* list of dim*entries actual entry values */
+67
ogg_uint32_t *codelist; /* list of bitstream codewords for each entry */
+68
+69
int *dec_index; /* only used if sparseness collapsed */
+70
char *dec_codelengths;
+71
ogg_uint32_t *dec_firsttable;
+72
int dec_firsttablen;
+73
int dec_maxlength;
+74
+75
/* The current encoder uses only centered, integer-only lattice books. */
+76
int quantvals;
+77
int minval;
+78
int delta;
+79
} codebook;
+80
+81
extern void vorbis_staticbook_destroy(static_codebook *b);
+82
extern int vorbis_book_init_encode(codebook *dest,const static_codebook *source);
+83
extern int vorbis_book_init_decode(codebook *dest,const static_codebook *source);
+84
extern void vorbis_book_clear(codebook *b);
+85
+86
extern float *_book_unquantize(const static_codebook *b,int n,int *map);
+87
extern float *_book_logdist(const static_codebook *b,float *vals);
+88
extern float _float32_unpack(long val);
+89
extern long _float32_pack(float val);
+90
extern int _best(codebook *book, float *a, int step);
+91
extern long _book_maptype1_quantvals(const static_codebook *b);
+92
+93
extern int vorbis_book_besterror(codebook *book,float *a,int step,int addmul);
+94
extern long vorbis_book_codeword(codebook *book,int entry);
+95
extern long vorbis_book_codelen(codebook *book,int entry);
+96
+97
+98
+99
extern int vorbis_staticbook_pack(const static_codebook *c,oggpack_buffer *b);
+100
extern static_codebook *vorbis_staticbook_unpack(oggpack_buffer *b);
+101
+102
extern int vorbis_book_encode(codebook *book, int a, oggpack_buffer *b);
+103
+104
extern long vorbis_book_decode(codebook *book, oggpack_buffer *b);
+105
extern long vorbis_book_decodevs_add(codebook *book, float *a,
+106
oggpack_buffer *b,int n);
+107
extern long vorbis_book_decodev_set(codebook *book, float *a,
+108
oggpack_buffer *b,int n);
+109
extern long vorbis_book_decodev_add(codebook *book, float *a,
+110
oggpack_buffer *b,int n);
+111
extern long vorbis_book_decodevv_add(codebook *book, float **a,
+112
long off,int ch,
+113
oggpack_buffer *b,int n);
+114
+115
+116
+117
#endif
vendor/vorbis/lib/codec_internal.hadded
@@ -0,0 +1,166 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 *
+9
* by the Xiph.Org Foundation https://xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: libvorbis codec headers
+14
+15
********************************************************************/
+16
+17
#ifndef _V_CODECI_H_
+18
#define _V_CODECI_H_
+19
+20
#include "envelope.h"
+21
#include "codebook.h"
+22
+23
#define BLOCKTYPE_IMPULSE 0
+24
#define BLOCKTYPE_PADDING 1
+25
#define BLOCKTYPE_TRANSITION 0
+26
#define BLOCKTYPE_LONG 1
+27
+28
#define PACKETBLOBS 15
+29
+30
typedef struct vorbis_block_internal{
+31
float **pcmdelay; /* this is a pointer into local storage */
+32
float ampmax;
+33
int blocktype;
+34
+35
oggpack_buffer *packetblob[PACKETBLOBS]; /* initialized, must be freed;
+36
blob [PACKETBLOBS/2] points to
+37
the oggpack_buffer in the
+38
main vorbis_block */
+39
} vorbis_block_internal;
+40
+41
typedef void vorbis_look_floor;
+42
typedef void vorbis_look_residue;
+43
typedef void vorbis_look_transform;
+44
+45
/* mode ************************************************************/
+46
typedef struct {
+47
int blockflag;
+48
int windowtype;
+49
int transformtype;
+50
int mapping;
+51
} vorbis_info_mode;
+52
+53
typedef void vorbis_info_floor;
+54
typedef void vorbis_info_residue;
+55
typedef void vorbis_info_mapping;
+56
+57
#include "psy.h"
+58
#include "bitrate.h"
+59
+60
typedef struct private_state {
+61
/* local lookup storage */
+62
envelope_lookup *ve; /* envelope lookup */
+63
int window[2];
+64
vorbis_look_transform **transform[2]; /* block, type */
+65
drft_lookup fft_look[2];
+66
+67
int modebits;
+68
vorbis_look_floor **flr;
+69
vorbis_look_residue **residue;
+70
vorbis_look_psy *psy;
+71
vorbis_look_psy_global *psy_g_look;
+72
+73
/* local storage, only used on the encoding side. This way the
+74
application does not need to worry about freeing some packets'
+75
memory and not others'; packet storage is always tracked.
+76
Cleared next call to a _dsp_ function */
+77
unsigned char *header;
+78
unsigned char *header1;
+79
unsigned char *header2;
+80
+81
bitrate_manager_state bms;
+82
+83
ogg_int64_t sample_count;
+84
} private_state;
+85
+86
/* codec_setup_info contains all the setup information specific to the
+87
specific compression/decompression mode in progress (eg,
+88
psychoacoustic settings, channel setup, options, codebook
+89
etc).
+90
*********************************************************************/
+91
+92
#include "highlevel.h"
+93
typedef struct codec_setup_info {
+94
+95
/* Vorbis supports only short and long blocks, but allows the
+96
encoder to choose the sizes */
+97
+98
long blocksizes[2];
+99
+100
/* modes are the primary means of supporting on-the-fly different
+101
blocksizes, different channel mappings (LR or M/A),
+102
different residue backends, etc. Each mode consists of a
+103
blocksize flag and a mapping (along with the mapping setup */
+104
+105
int modes;
+106
int maps;
+107
int floors;
+108
int residues;
+109
int books;
+110
int psys; /* encode only */
+111
+112
vorbis_info_mode *mode_param[64];
+113
int map_type[64];
+114
vorbis_info_mapping *map_param[64];
+115
int floor_type[64];
+116
vorbis_info_floor *floor_param[64];
+117
int residue_type[64];
+118
vorbis_info_residue *residue_param[64];
+119
static_codebook *book_param[256];
+120
codebook *fullbooks;
+121
+122
vorbis_info_psy *psy_param[4]; /* encode only */
+123
vorbis_info_psy_global psy_g_param;
+124
+125
bitrate_manager_info bi;
+126
highlevel_encode_setup hi; /* used only by vorbisenc.c. It's a
+127
highly redundant structure, but
+128
improves clarity of program flow. */
+129
int halfrate_flag; /* painless downsample for decode */
+130
} codec_setup_info;
+131
+132
extern vorbis_look_psy_global *_vp_global_look(vorbis_info *vi);
+133
extern void _vp_global_free(vorbis_look_psy_global *look);
+134
+135
+136
+137
typedef struct {
+138
int sorted_index[VIF_POSIT+2];
+139
int forward_index[VIF_POSIT+2];
+140
int reverse_index[VIF_POSIT+2];
+141
+142
int hineighbor[VIF_POSIT];
+143
int loneighbor[VIF_POSIT];
+144
int posts;
+145
+146
int n;
+147
int quant_q;
+148
vorbis_info_floor1 *vi;
+149
+150
long phrasebits;
+151
long postbits;
+152
long frames;
+153
} vorbis_look_floor1;
+154
+155
+156
+157
extern int *floor1_fit(vorbis_block *vb,vorbis_look_floor1 *look,
+158
const float *logmdct, /* in */
+159
const float *logmask);
+160
extern int *floor1_interpolate_fit(vorbis_block *vb,vorbis_look_floor1 *look,
+161
int *A,int *B,
+162
int del);
+163
extern int floor1_encode(oggpack_buffer *opb,vorbis_block *vb,
+164
vorbis_look_floor1 *look,
+165
int *post,int *ilogmask);
+166
#endif
vendor/vorbis/lib/envelope.cadded
@@ -0,0 +1,374 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 *
+9
* by the Xiph.Org Foundation https://xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: PCM data envelope analysis
+14
+15
********************************************************************/
+16
+17
#include <stdlib.h>
+18
#include <string.h>
+19
#include <stdio.h>
+20
#include <math.h>
+21
#include <ogg/ogg.h>
+22
#include "vorbis/codec.h"
+23
#include "codec_internal.h"
+24
+25
#include "os.h"
+26
#include "scales.h"
+27
#include "envelope.h"
+28
#include "mdct.h"
+29
#include "misc.h"
+30
+31
void _ve_envelope_init(envelope_lookup *e,vorbis_info *vi){
+32
codec_setup_info *ci=vi->codec_setup;
+33
vorbis_info_psy_global *gi=&ci->psy_g_param;
+34
int ch=vi->channels;
+35
int i,j;
+36
int n=e->winlength=128;
+37
e->searchstep=64; /* not random */
+38
+39
e->minenergy=gi->preecho_minenergy;
+40
e->ch=ch;
+41
e->storage=128;
+42
e->cursor=ci->blocksizes[1]/2;
+43
e->mdct_win=_ogg_calloc(n,sizeof(*e->mdct_win));
+44
mdct_init(&e->mdct,n);
+45
+46
for(i=0;i<n;i++){
+47
e->mdct_win[i]=sin(i/(n-1.)*M_PI);
+48
e->mdct_win[i]*=e->mdct_win[i];
+49
}
+50
+51
/* magic follows */
+52
e->band[0].begin=2; e->band[0].end=4;
+53
e->band[1].begin=4; e->band[1].end=5;
+54
e->band[2].begin=6; e->band[2].end=6;
+55
e->band[3].begin=9; e->band[3].end=8;
+56
e->band[4].begin=13; e->band[4].end=8;
+57
e->band[5].begin=17; e->band[5].end=8;
+58
e->band[6].begin=22; e->band[6].end=8;
+59
+60
for(j=0;j<VE_BANDS;j++){
+61
n=e->band[j].end;
+62
e->band[j].window=_ogg_malloc(n*sizeof(*e->band[0].window));
+63
for(i=0;i<n;i++){
+64
e->band[j].window[i]=sin((i+.5)/n*M_PI);
+65
e->band[j].total+=e->band[j].window[i];
+66
}
+67
e->band[j].total=1./e->band[j].total;
+68
}
+69
+70
e->filter=_ogg_calloc(VE_BANDS*ch,sizeof(*e->filter));
+71
e->mark=_ogg_calloc(e->storage,sizeof(*e->mark));
+72
+73
}
+74
+75
void _ve_envelope_clear(envelope_lookup *e){
+76
int i;
+77
mdct_clear(&e->mdct);
+78
for(i=0;i<VE_BANDS;i++)
+79
_ogg_free(e->band[i].window);
+80
_ogg_free(e->mdct_win);
+81
_ogg_free(e->filter);
+82
_ogg_free(e->mark);
+83
memset(e,0,sizeof(*e));
+84
}
+85
+86
/* fairly straight threshhold-by-band based until we find something
+87
that works better and isn't patented. */
+88
+89
static int _ve_amp(envelope_lookup *ve,
+90
vorbis_info_psy_global *gi,
+91
float *data,
+92
envelope_band *bands,
+93
envelope_filter_state *filters){
+94
long n=ve->winlength;
+95
int ret=0;
+96
long i,j;
+97
float decay;
+98
+99
/* we want to have a 'minimum bar' for energy, else we're just
+100
basing blocks on quantization noise that outweighs the signal
+101
itself (for low power signals) */
+102
+103
float minV=ve->minenergy;
+104
float *vec=alloca(n*sizeof(*vec));
+105
+106
/* stretch is used to gradually lengthen the number of windows
+107
considered prevoius-to-potential-trigger */
+108
int stretch=max(VE_MINSTRETCH,ve->stretch/2);
+109
float penalty=gi->stretch_penalty-(ve->stretch/2-VE_MINSTRETCH);
+110
if(penalty<0.f)penalty=0.f;
+111
if(penalty>gi->stretch_penalty)penalty=gi->stretch_penalty;
+112
+113
/*_analysis_output_always("lpcm",seq2,data,n,0,0,
+114
totalshift+pos*ve->searchstep);*/
+115
+116
/* window and transform */
+117
for(i=0;i<n;i++)
+118
vec[i]=data[i]*ve->mdct_win[i];
+119
mdct_forward(&ve->mdct,vec,vec);
+120
+121
/*_analysis_output_always("mdct",seq2,vec,n/2,0,1,0); */
+122
+123
/* near-DC spreading function; this has nothing to do with
+124
psychoacoustics, just sidelobe leakage and window size */
+125
{
+126
float temp=vec[0]*vec[0]+.7*vec[1]*vec[1]+.2*vec[2]*vec[2];
+127
int ptr=filters->nearptr;
+128
+129
/* the accumulation is regularly refreshed from scratch to avoid
+130
floating point creep */
+131
if(ptr==0){
+132
decay=filters->nearDC_acc=filters->nearDC_partialacc+temp;
+133
filters->nearDC_partialacc=temp;
+134
}else{
+135
decay=filters->nearDC_acc+=temp;
+136
filters->nearDC_partialacc+=temp;
+137
}
+138
filters->nearDC_acc-=filters->nearDC[ptr];
+139
filters->nearDC[ptr]=temp;
+140
+141
decay*=(1./(VE_NEARDC+1));
+142
filters->nearptr++;
+143
if(filters->nearptr>=VE_NEARDC)filters->nearptr=0;
+144
decay=todB(&decay)*.5-15.f;
+145
}
+146
+147
/* perform spreading and limiting, also smooth the spectrum. yes,
+148
the MDCT results in all real coefficients, but it still *behaves*
+149
like real/imaginary pairs */
+150
for(i=0;i<n/2;i+=2){
+151
float val=vec[i]*vec[i]+vec[i+1]*vec[i+1];
+152
val=todB(&val)*.5f;
+153
if(val<decay)val=decay;
+154
if(val<minV)val=minV;
+155
vec[i>>1]=val;
+156
decay-=8.;
+157
}
+158
+159
/*_analysis_output_always("spread",seq2++,vec,n/4,0,0,0);*/
+160
+161
/* perform preecho/postecho triggering by band */
+162
for(j=0;j<VE_BANDS;j++){
+163
float acc=0.;
+164
float valmax,valmin;
+165
+166
/* accumulate amplitude */
+167
for(i=0;i<bands[j].end;i++)
+168
acc+=vec[i+bands[j].begin]*bands[j].window[i];
+169
+170
acc*=bands[j].total;
+171
+172
/* convert amplitude to delta */
+173
{
+174
int p,this=filters[j].ampptr;
+175
float postmax,postmin,premax=-99999.f,premin=99999.f;
+176
+177
p=this;
+178
p--;
+179
if(p<0)p+=VE_AMP;
+180
postmax=max(acc,filters[j].ampbuf[p]);
+181
postmin=min(acc,filters[j].ampbuf[p]);
+182
+183
for(i=0;i<stretch;i++){
+184
p--;
+185
if(p<0)p+=VE_AMP;
+186
premax=max(premax,filters[j].ampbuf[p]);
+187
premin=min(premin,filters[j].ampbuf[p]);
+188
}
+189
+190
valmin=postmin-premin;
+191
valmax=postmax-premax;
+192
+193
/*filters[j].markers[pos]=valmax;*/
+194
filters[j].ampbuf[this]=acc;
+195
filters[j].ampptr++;
+196
if(filters[j].ampptr>=VE_AMP)filters[j].ampptr=0;
+197
}
+198
+199
/* look at min/max, decide trigger */
+200
if(valmax>gi->preecho_thresh[j]+penalty){
+201
ret|=1;
+202
ret|=4;
+203
}
+204
if(valmin<gi->postecho_thresh[j]-penalty)ret|=2;
+205
}
+206
+207
return(ret);
+208
}
+209
+210
#if 0
+211
static int seq=0;
+212
static ogg_int64_t totalshift=-1024;
+213
#endif
+214
+215
long _ve_envelope_search(vorbis_dsp_state *v){
+216
vorbis_info *vi=v->vi;
+217
codec_setup_info *ci=vi->codec_setup;
+218
vorbis_info_psy_global *gi=&ci->psy_g_param;
+219
envelope_lookup *ve=((private_state *)(v->backend_state))->ve;
+220
long i,j;
+221
+222
int first=ve->current/ve->searchstep;
+223
int last=v->pcm_current/ve->searchstep-VE_WIN;
+224
if(first<0)first=0;
+225
+226
/* make sure we have enough storage to match the PCM */
+227
if(last+VE_WIN+VE_POST>ve->storage){
+228
ve->storage=last+VE_WIN+VE_POST; /* be sure */
+229
ve->mark=_ogg_realloc(ve->mark,ve->storage*sizeof(*ve->mark));
+230
}
+231
+232
for(j=first;j<last;j++){
+233
int ret=0;
+234
+235
ve->stretch++;
+236
if(ve->stretch>VE_MAXSTRETCH*2)
+237
ve->stretch=VE_MAXSTRETCH*2;
+238
+239
for(i=0;i<ve->ch;i++){
+240
float *pcm=v->pcm[i]+ve->searchstep*(j);
+241
ret|=_ve_amp(ve,gi,pcm,ve->band,ve->filter+i*VE_BANDS);
+242
}
+243
+244
ve->mark[j+VE_POST]=0;
+245
if(ret&1){
+246
ve->mark[j]=1;
+247
ve->mark[j+1]=1;
+248
}
+249
+250
if(ret&2){
+251
ve->mark[j]=1;
+252
if(j>0)ve->mark[j-1]=1;
+253
}
+254
+255
if(ret&4)ve->stretch=-1;
+256
}
+257
+258
ve->current=last*ve->searchstep;
+259
+260
{
+261
long centerW=v->centerW;
+262
long testW=
+263
centerW+
+264
ci->blocksizes[v->W]/4+
+265
ci->blocksizes[1]/2+
+266
ci->blocksizes[0]/4;
+267
+268
j=ve->cursor;
+269
+270
while(j<ve->current-(ve->searchstep)){/* account for postecho
+271
working back one window */
+272
if(j>=testW)return(1);
+273
+274
ve->cursor=j;
+275
+276
if(ve->mark[j/ve->searchstep]){
+277
if(j>centerW){
+278
+279
#if 0
+280
if(j>ve->curmark){
+281
float *marker=alloca(v->pcm_current*sizeof(*marker));
+282
int l,m;
+283
memset(marker,0,sizeof(*marker)*v->pcm_current);
+284
fprintf(stderr,"mark! seq=%d, cursor:%fs time:%fs\n",
+285
seq,
+286
(totalshift+ve->cursor)/44100.,
+287
(totalshift+j)/44100.);
+288
_analysis_output_always("pcmL",seq,v->pcm[0],v->pcm_current,0,0,totalshift);
+289
_analysis_output_always("pcmR",seq,v->pcm[1],v->pcm_current,0,0,totalshift);
+290
+291
_analysis_output_always("markL",seq,v->pcm[0],j,0,0,totalshift);
+292
_analysis_output_always("markR",seq,v->pcm[1],j,0,0,totalshift);
+293
+294
for(m=0;m<VE_BANDS;m++){
+295
char buf[80];
+296
sprintf(buf,"delL%d",m);
+297
for(l=0;l<last;l++)marker[l*ve->searchstep]=ve->filter[m].markers[l]*.1;
+298
_analysis_output_always(buf,seq,marker,v->pcm_current,0,0,totalshift);
+299
}
+300
+301
for(m=0;m<VE_BANDS;m++){
+302
char buf[80];
+303
sprintf(buf,"delR%d",m);
+304
for(l=0;l<last;l++)marker[l*ve->searchstep]=ve->filter[m+VE_BANDS].markers[l]*.1;
+305
_analysis_output_always(buf,seq,marker,v->pcm_current,0,0,totalshift);
+306
}
+307
+308
for(l=0;l<last;l++)marker[l*ve->searchstep]=ve->mark[l]*.4;
+309
_analysis_output_always("mark",seq,marker,v->pcm_current,0,0,totalshift);
+310
+311
+312
seq++;
+313
+314
}
+315
#endif
+316
+317
ve->curmark=j;
+318
if(j>=testW)return(1);
+319
return(0);
+320
}
+321
}
+322
j+=ve->searchstep;
+323
}
+324
}
+325
+326
return(-1);
+327
}
+328
+329
int _ve_envelope_mark(vorbis_dsp_state *v){
+330
envelope_lookup *ve=((private_state *)(v->backend_state))->ve;
+331
vorbis_info *vi=v->vi;
+332
codec_setup_info *ci=vi->codec_setup;
+333
long centerW=v->centerW;
+334
long beginW=centerW-ci->blocksizes[v->W]/4;
+335
long endW=centerW+ci->blocksizes[v->W]/4;
+336
if(v->W){
+337
beginW-=ci->blocksizes[v->lW]/4;
+338
endW+=ci->blocksizes[v->nW]/4;
+339
}else{
+340
beginW-=ci->blocksizes[0]/4;
+341
endW+=ci->blocksizes[0]/4;
+342
}
+343
+344
if(ve->curmark>=beginW && ve->curmark<endW)return(1);
+345
{
+346
long first=beginW/ve->searchstep;
+347
long last=endW/ve->searchstep;
+348
long i;
+349
for(i=first;i<last;i++)
+350
if(ve->mark[i])return(1);
+351
}
+352
return(0);
+353
}
+354
+355
void _ve_envelope_shift(envelope_lookup *e,long shift){
+356
int smallsize=e->current/e->searchstep+VE_POST; /* adjust for placing marks
+357
ahead of ve->current */
+358
int smallshift=shift/e->searchstep;
+359
+360
memmove(e->mark,e->mark+smallshift,(smallsize-smallshift)*sizeof(*e->mark));
+361
+362
#if 0
+363
for(i=0;i<VE_BANDS*e->ch;i++)
+364
memmove(e->filter[i].markers,
+365
e->filter[i].markers+smallshift,
+366
(1024-smallshift)*sizeof(*(*e->filter).markers));
+367
totalshift+=shift;
+368
#endif
+369
+370
e->current-=shift;
+371
if(e->curmark>=0)
+372
e->curmark-=shift;
+373
e->cursor-=shift;
+374
}
vendor/vorbis/lib/envelope.hadded
@@ -0,0 +1,79 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 *
+9
* by the Xiph.Org Foundation https://xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: PCM data envelope analysis and manipulation
+14
+15
********************************************************************/
+16
+17
#ifndef _V_ENVELOPE_
+18
#define _V_ENVELOPE_
+19
+20
#include "mdct.h"
+21
+22
#define VE_PRE 16
+23
#define VE_WIN 4
+24
#define VE_POST 2
+25
#define VE_AMP (VE_PRE+VE_POST-1)
+26
+27
#define VE_BANDS 7
+28
#define VE_NEARDC 15
+29
+30
#define VE_MINSTRETCH 2 /* a bit less than short block */
+31
#define VE_MAXSTRETCH 12 /* one-third full block */
+32
+33
typedef struct {
+34
float ampbuf[VE_AMP];
+35
int ampptr;
+36
+37
float nearDC[VE_NEARDC];
+38
float nearDC_acc;
+39
float nearDC_partialacc;
+40
int nearptr;
+41
+42
} envelope_filter_state;
+43
+44
typedef struct {
+45
int begin;
+46
int end;
+47
float *window;
+48
float total;
+49
} envelope_band;
+50
+51
typedef struct {
+52
int ch;
+53
int winlength;
+54
int searchstep;
+55
float minenergy;
+56
+57
mdct_lookup mdct;
+58
float *mdct_win;
+59
+60
envelope_band band[VE_BANDS];
+61
envelope_filter_state *filter;
+62
int stretch;
+63
+64
int *mark;
+65
+66
long storage;
+67
long current;
+68
long curmark;
+69
long cursor;
+70
} envelope_lookup;
+71
+72
extern void _ve_envelope_init(envelope_lookup *e,vorbis_info *vi);
+73
extern void _ve_envelope_clear(envelope_lookup *e);
+74
extern long _ve_envelope_search(vorbis_dsp_state *v);
+75
extern void _ve_envelope_shift(envelope_lookup *e,long shift);
+76
extern int _ve_envelope_mark(vorbis_dsp_state *v);
+77
+78
+79
#endif
vendor/vorbis/lib/floor0.cadded
@@ -0,0 +1,223 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2015 *
+9
* by the Xiph.Org Foundation https://xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: floor backend 0 implementation
+14
+15
********************************************************************/
+16
+17
#include <stdlib.h>
+18
#include <string.h>
+19
#include <math.h>
+20
#include <ogg/ogg.h>
+21
#include "vorbis/codec.h"
+22
#include "codec_internal.h"
+23
#include "registry.h"
+24
#include "lpc.h"
+25
#include "lsp.h"
+26
#include "codebook.h"
+27
#include "scales.h"
+28
#include "misc.h"
+29
#include "os.h"
+30
+31
#include "misc.h"
+32
#include <stdio.h>
+33
+34
typedef struct {
+35
int ln;
+36
int m;
+37
int **linearmap;
+38
int n[2];
+39
+40
vorbis_info_floor0 *vi;
+41
+42
long bits;
+43
long frames;
+44
} vorbis_look_floor0;
+45
+46
+47
/***********************************************/
+48
+49
static void floor0_free_info(vorbis_info_floor *i){
+50
vorbis_info_floor0 *info=(vorbis_info_floor0 *)i;
+51
if(info){
+52
memset(info,0,sizeof(*info));
+53
_ogg_free(info);
+54
}
+55
}
+56
+57
static void floor0_free_look(vorbis_look_floor *i){
+58
vorbis_look_floor0 *look=(vorbis_look_floor0 *)i;
+59
if(look){
+60
+61
if(look->linearmap){
+62
+63
if(look->linearmap[0])_ogg_free(look->linearmap[0]);
+64
if(look->linearmap[1])_ogg_free(look->linearmap[1]);
+65
+66
_ogg_free(look->linearmap);
+67
}
+68
memset(look,0,sizeof(*look));
+69
_ogg_free(look);
+70
}
+71
}
+72
+73
static vorbis_info_floor *floor0_unpack (vorbis_info *vi,oggpack_buffer *opb){
+74
codec_setup_info *ci=vi->codec_setup;
+75
int j;
+76
+77
vorbis_info_floor0 *info=_ogg_malloc(sizeof(*info));
+78
info->order=oggpack_read(opb,8);
+79
info->rate=oggpack_read(opb,16);
+80
info->barkmap=oggpack_read(opb,16);
+81
info->ampbits=oggpack_read(opb,6);
+82
info->ampdB=oggpack_read(opb,8);
+83
info->numbooks=oggpack_read(opb,4)+1;
+84
+85
if(info->order<1)goto err_out;
+86
if(info->rate<1)goto err_out;
+87
if(info->barkmap<1)goto err_out;
+88
if(info->numbooks<1)goto err_out;
+89
+90
for(j=0;j<info->numbooks;j++){
+91
info->books[j]=oggpack_read(opb,8);
+92
if(info->books[j]<0 || info->books[j]>=ci->books)goto err_out;
+93
if(ci->book_param[info->books[j]]->maptype==0)goto err_out;
+94
if(ci->book_param[info->books[j]]->dim<1)goto err_out;
+95
}
+96
return(info);
+97
+98
err_out:
+99
floor0_free_info(info);
+100
return(NULL);
+101
}
+102
+103
/* initialize Bark scale and normalization lookups. We could do this
+104
with static tables, but Vorbis allows a number of possible
+105
combinations, so it's best to do it computationally.
+106
+107
The below is authoritative in terms of defining scale mapping.
+108
Note that the scale depends on the sampling rate as well as the
+109
linear block and mapping sizes */
+110
+111
static void floor0_map_lazy_init(vorbis_block *vb,
+112
vorbis_info_floor *infoX,
+113
vorbis_look_floor0 *look){
+114
if(!look->linearmap[vb->W]){
+115
vorbis_dsp_state *vd=vb->vd;
+116
vorbis_info *vi=vd->vi;
+117
codec_setup_info *ci=vi->codec_setup;
+118
vorbis_info_floor0 *info=(vorbis_info_floor0 *)infoX;
+119
int W=vb->W;
+120
int n=ci->blocksizes[W]/2,j;
+121
+122
/* we choose a scaling constant so that:
+123
floor(bark(rate/2-1)*C)=mapped-1
+124
floor(bark(rate/2)*C)=mapped */
+125
float scale=look->ln/toBARK(info->rate/2.f);
+126
+127
/* the mapping from a linear scale to a smaller bark scale is
+128
straightforward. We do *not* make sure that the linear mapping
+129
does not skip bark-scale bins; the decoder simply skips them and
+130
the encoder may do what it wishes in filling them. They're
+131
necessary in some mapping combinations to keep the scale spacing
+132
accurate */
+133
look->linearmap[W]=_ogg_malloc((n+1)*sizeof(**look->linearmap));
+134
for(j=0;j<n;j++){
+135
int val=floor( toBARK((info->rate/2.f)/n*j)
+136
*scale); /* bark numbers represent band edges */
+137
if(val>=look->ln)val=look->ln-1; /* guard against the approximation */
+138
look->linearmap[W][j]=val;
+139
}
+140
look->linearmap[W][j]=-1;
+141
look->n[W]=n;
+142
}
+143
}
+144
+145
static vorbis_look_floor *floor0_look(vorbis_dsp_state *vd,
+146
vorbis_info_floor *i){
+147
vorbis_info_floor0 *info=(vorbis_info_floor0 *)i;
+148
vorbis_look_floor0 *look=_ogg_calloc(1,sizeof(*look));
+149
+150
(void)vd;
+151
+152
look->m=info->order;
+153
look->ln=info->barkmap;
+154
look->vi=info;
+155
+156
look->linearmap=_ogg_calloc(2,sizeof(*look->linearmap));
+157
+158
return look;
+159
}
+160
+161
static void *floor0_inverse1(vorbis_block *vb,vorbis_look_floor *i){
+162
vorbis_look_floor0 *look=(vorbis_look_floor0 *)i;
+163
vorbis_info_floor0 *info=look->vi;
+164
int j,k;
+165
+166
int ampraw=oggpack_read(&vb->opb,info->ampbits);
+167
if(ampraw>0){ /* also handles the -1 out of data case */
+168
long maxval=(1<<info->ampbits)-1;
+169
float amp=(float)ampraw/maxval*info->ampdB;
+170
int booknum=oggpack_read(&vb->opb,ov_ilog(info->numbooks));
+171
+172
if(booknum!=-1 && booknum<info->numbooks){ /* be paranoid */
+173
codec_setup_info *ci=vb->vd->vi->codec_setup;
+174
codebook *b=ci->fullbooks+info->books[booknum];
+175
float last=0.f;
+176
+177
/* the additional b->dim is a guard against any possible stack
+178
smash; b->dim is provably more than we can overflow the
+179
vector */
+180
float *lsp=_vorbis_block_alloc(vb,sizeof(*lsp)*(look->m+b->dim+1));
+181
+182
if(vorbis_book_decodev_set(b,lsp,&vb->opb,look->m)==-1)goto eop;
+183
for(j=0;j<look->m;){
+184
for(k=0;j<look->m && k<b->dim;k++,j++)lsp[j]+=last;
+185
last=lsp[j-1];
+186
}
+187
+188
lsp[look->m]=amp;
+189
return(lsp);
+190
}
+191
}
+192
eop:
+193
return(NULL);
+194
}
+195
+196
static int floor0_inverse2(vorbis_block *vb,vorbis_look_floor *i,
+197
void *memo,float *out){
+198
vorbis_look_floor0 *look=(vorbis_look_floor0 *)i;
+199
vorbis_info_floor0 *info=look->vi;
+200
+201
floor0_map_lazy_init(vb,info,look);
+202
+203
if(memo){
+204
float *lsp=(float *)memo;
+205
float amp=lsp[look->m];
+206
+207
/* take the coefficients back to a spectral envelope curve */
+208
vorbis_lsp_to_curve(out,
+209
look->linearmap[vb->W],
+210
look->n[vb->W],
+211
look->ln,
+212
lsp,look->m,amp,(float)info->ampdB);
+213
return(1);
+214
}
+215
memset(out,0,sizeof(*out)*look->n[vb->W]);
+216
return(0);
+217
}
+218
+219
/* export hooks */
+220
const vorbis_func_floor floor0_exportbundle={
+221
NULL,&floor0_unpack,&floor0_look,&floor0_free_info,
+222
&floor0_free_look,&floor0_inverse1,&floor0_inverse2
+223
};
vendor/vorbis/lib/floor1.cadded
@@ -0,0 +1,1086 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2015 *
+9
* by the Xiph.Org Foundation https://xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: floor backend 1 implementation
+14
+15
********************************************************************/
+16
+17
#include <stdlib.h>
+18
#include <string.h>
+19
#include <math.h>
+20
#include <ogg/ogg.h>
+21
#include "vorbis/codec.h"
+22
#include "codec_internal.h"
+23
#include "registry.h"
+24
#include "codebook.h"
+25
#include "misc.h"
+26
#include "scales.h"
+27
+28
#include <stdio.h>
+29
+30
#define floor1_rangedB 140 /* floor 1 fixed at -140dB to 0dB range */
+31
+32
typedef struct lsfit_acc{
+33
int x0;
+34
int x1;
+35
+36
int xa;
+37
int ya;
+38
int x2a;
+39
int y2a;
+40
int xya;
+41
int an;
+42
+43
int xb;
+44
int yb;
+45
int x2b;
+46
int y2b;
+47
int xyb;
+48
int bn;
+49
} lsfit_acc;
+50
+51
/***********************************************/
+52
+53
static void floor1_free_info(vorbis_info_floor *i){
+54
vorbis_info_floor1 *info=(vorbis_info_floor1 *)i;
+55
if(info){
+56
memset(info,0,sizeof(*info));
+57
_ogg_free(info);
+58
}
+59
}
+60
+61
static void floor1_free_look(vorbis_look_floor *i){
+62
vorbis_look_floor1 *look=(vorbis_look_floor1 *)i;
+63
if(look){
+64
/*fprintf(stderr,"floor 1 bit usage %f:%f (%f total)\n",
+65
(float)look->phrasebits/look->frames,
+66
(float)look->postbits/look->frames,
+67
(float)(look->postbits+look->phrasebits)/look->frames);*/
+68
+69
memset(look,0,sizeof(*look));
+70
_ogg_free(look);
+71
}
+72
}
+73
+74
static void floor1_pack (vorbis_info_floor *i,oggpack_buffer *opb){
+75
vorbis_info_floor1 *info=(vorbis_info_floor1 *)i;
+76
int j,k;
+77
int count=0;
+78
int rangebits;
+79
int maxposit=info->postlist[1];
+80
int maxclass=-1;
+81
+82
/* save out partitions */
+83
oggpack_write(opb,info->partitions,5); /* only 0 to 31 legal */
+84
for(j=0;j<info->partitions;j++){
+85
oggpack_write(opb,info->partitionclass[j],4); /* only 0 to 15 legal */
+86
if(maxclass<info->partitionclass[j])maxclass=info->partitionclass[j];
+87
}
+88
+89
/* save out partition classes */
+90
for(j=0;j<maxclass+1;j++){
+91
oggpack_write(opb,info->class_dim[j]-1,3); /* 1 to 8 */
+92
oggpack_write(opb,info->class_subs[j],2); /* 0 to 3 */
+93
if(info->class_subs[j])oggpack_write(opb,info->class_book[j],8);
+94
for(k=0;k<(1<<info->class_subs[j]);k++)
+95
oggpack_write(opb,info->class_subbook[j][k]+1,8);
+96
}
+97
+98
/* save out the post list */
+99
oggpack_write(opb,info->mult-1,2); /* only 1,2,3,4 legal now */
+100
/* maxposit cannot legally be less than 1; this is encode-side, we
+101
can assume our setup is OK */
+102
oggpack_write(opb,ov_ilog(maxposit-1),4);
+103
rangebits=ov_ilog(maxposit-1);
+104
+105
for(j=0,k=0;j<info->partitions;j++){
+106
count+=info->class_dim[info->partitionclass[j]];
+107
for(;k<count;k++)
+108
oggpack_write(opb,info->postlist[k+2],rangebits);
+109
}
+110
}
+111
+112
static int icomp(const void *a,const void *b){
+113
return(**(int **)a-**(int **)b);
+114
}
+115
+116
static vorbis_info_floor *floor1_unpack (vorbis_info *vi,oggpack_buffer *opb){
+117
codec_setup_info *ci=vi->codec_setup;
+118
int j,k,count=0,maxclass=-1,rangebits;
+119
+120
vorbis_info_floor1 *info=_ogg_calloc(1,sizeof(*info));
+121
/* read partitions */
+122
info->partitions=oggpack_read(opb,5); /* only 0 to 31 legal */
+123
for(j=0;j<info->partitions;j++){
+124
info->partitionclass[j]=oggpack_read(opb,4); /* only 0 to 15 legal */
+125
if(info->partitionclass[j]<0)goto err_out;
+126
if(maxclass<info->partitionclass[j])maxclass=info->partitionclass[j];
+127
}
+128
+129
/* read partition classes */
+130
for(j=0;j<maxclass+1;j++){
+131
info->class_dim[j]=oggpack_read(opb,3)+1; /* 1 to 8 */
+132
info->class_subs[j]=oggpack_read(opb,2); /* 0,1,2,3 bits */
+133
if(info->class_subs[j]<0)
+134
goto err_out;
+135
if(info->class_subs[j])info->class_book[j]=oggpack_read(opb,8);
+136
if(info->class_book[j]<0 || info->class_book[j]>=ci->books)
+137
goto err_out;
+138
for(k=0;k<(1<<info->class_subs[j]);k++){
+139
info->class_subbook[j][k]=oggpack_read(opb,8)-1;
+140
if(info->class_subbook[j][k]<-1 || info->class_subbook[j][k]>=ci->books)
+141
goto err_out;
+142
}
+143
}
+144
+145
/* read the post list */
+146
info->mult=oggpack_read(opb,2)+1; /* only 1,2,3,4 legal now */
+147
rangebits=oggpack_read(opb,4);
+148
if(rangebits<0)goto err_out;
+149
+150
for(j=0,k=0;j<info->partitions;j++){
+151
count+=info->class_dim[info->partitionclass[j]];
+152
if(count>VIF_POSIT) goto err_out;
+153
for(;k<count;k++){
+154
int t=info->postlist[k+2]=oggpack_read(opb,rangebits);
+155
if(t<0 || t>=(1<<rangebits))
+156
goto err_out;
+157
}
+158
}
+159
info->postlist[0]=0;
+160
info->postlist[1]=1<<rangebits;
+161
+162
/* don't allow repeated values in post list as they'd result in
+163
zero-length segments */
+164
{
+165
int *sortpointer[VIF_POSIT+2];
+166
for(j=0;j<count+2;j++)sortpointer[j]=info->postlist+j;
+167
qsort(sortpointer,count+2,sizeof(*sortpointer),icomp);
+168
+169
for(j=1;j<count+2;j++)
+170
if(*sortpointer[j-1]==*sortpointer[j])goto err_out;
+171
}
+172
+173
return(info);
+174
+175
err_out:
+176
floor1_free_info(info);
+177
return(NULL);
+178
}
+179
+180
static vorbis_look_floor *floor1_look(vorbis_dsp_state *vd,
+181
vorbis_info_floor *in){
+182
+183
int *sortpointer[VIF_POSIT+2];
+184
vorbis_info_floor1 *info=(vorbis_info_floor1 *)in;
+185
vorbis_look_floor1 *look=_ogg_calloc(1,sizeof(*look));
+186
int i,j,n=0;
+187
+188
(void)vd;
+189
+190
look->vi=info;
+191
look->n=info->postlist[1];
+192
+193
/* we drop each position value in-between already decoded values,
+194
and use linear interpolation to predict each new value past the
+195
edges. The positions are read in the order of the position
+196
list... we precompute the bounding positions in the lookup. Of
+197
course, the neighbors can change (if a position is declined), but
+198
this is an initial mapping */
+199
+200
for(i=0;i<info->partitions;i++)n+=info->class_dim[info->partitionclass[i]];
+201
n+=2;
+202
look->posts=n;
+203
+204
/* also store a sorted position index */
+205
for(i=0;i<n;i++)sortpointer[i]=info->postlist+i;
+206
qsort(sortpointer,n,sizeof(*sortpointer),icomp);
+207
+208
/* points from sort order back to range number */
+209
for(i=0;i<n;i++)look->forward_index[i]=sortpointer[i]-info->postlist;
+210
/* points from range order to sorted position */
+211
for(i=0;i<n;i++)look->reverse_index[look->forward_index[i]]=i;
+212
/* we actually need the post values too */
+213
for(i=0;i<n;i++)look->sorted_index[i]=info->postlist[look->forward_index[i]];
+214
+215
/* quantize values to multiplier spec */
+216
switch(info->mult){
+217
case 1: /* 1024 -> 256 */
+218
look->quant_q=256;
+219
break;
+220
case 2: /* 1024 -> 128 */
+221
look->quant_q=128;
+222
break;
+223
case 3: /* 1024 -> 86 */
+224
look->quant_q=86;
+225
break;
+226
case 4: /* 1024 -> 64 */
+227
look->quant_q=64;
+228
break;
+229
}
+230
+231
/* discover our neighbors for decode where we don't use fit flags
+232
(that would push the neighbors outward) */
+233
for(i=0;i<n-2;i++){
+234
int lo=0;
+235
int hi=1;
+236
int lx=0;
+237
int hx=look->n;
+238
int currentx=info->postlist[i+2];
+239
for(j=0;j<i+2;j++){
+240
int x=info->postlist[j];
+241
if(x>lx && x<currentx){
+242
lo=j;
+243
lx=x;
+244
}
+245
if(x<hx && x>currentx){
+246
hi=j;
+247
hx=x;
+248
}
+249
}
+250
look->loneighbor[i]=lo;
+251
look->hineighbor[i]=hi;
+252
}
+253
+254
return(look);
+255
}
+256
+257
static int render_point(int x0,int x1,int y0,int y1,int x){
+258
y0&=0x7fff; /* mask off flag */
+259
y1&=0x7fff;
+260
+261
{
+262
int dy=y1-y0;
+263
int adx=x1-x0;
+264
int ady=abs(dy);
+265
int err=ady*(x-x0);
+266
+267
int off=err/adx;
+268
if(dy<0)return(y0-off);
+269
return(y0+off);
+270
}
+271
}
+272
+273
static int vorbis_dBquant(const float *x){
+274
int i= *x*7.3142857f+1023.5f;
+275
if(i>1023)return(1023);
+276
if(i<0)return(0);
+277
return i;
+278
}
+279
+280
static const float FLOOR1_fromdB_LOOKUP[256]={
+281
1.0649863e-07F, 1.1341951e-07F, 1.2079015e-07F, 1.2863978e-07F,
+282
1.3699951e-07F, 1.4590251e-07F, 1.5538408e-07F, 1.6548181e-07F,
+283
1.7623575e-07F, 1.8768855e-07F, 1.9988561e-07F, 2.128753e-07F,
+284
2.2670913e-07F, 2.4144197e-07F, 2.5713223e-07F, 2.7384213e-07F,
+285
2.9163793e-07F, 3.1059021e-07F, 3.3077411e-07F, 3.5226968e-07F,
+286
3.7516214e-07F, 3.9954229e-07F, 4.2550680e-07F, 4.5315863e-07F,
+287
4.8260743e-07F, 5.1396998e-07F, 5.4737065e-07F, 5.8294187e-07F,
+288
6.2082472e-07F, 6.6116941e-07F, 7.0413592e-07F, 7.4989464e-07F,
+289
7.9862701e-07F, 8.5052630e-07F, 9.0579828e-07F, 9.6466216e-07F,
+290
1.0273513e-06F, 1.0941144e-06F, 1.1652161e-06F, 1.2409384e-06F,
+291
1.3215816e-06F, 1.4074654e-06F, 1.4989305e-06F, 1.5963394e-06F,
+292
1.7000785e-06F, 1.8105592e-06F, 1.9282195e-06F, 2.0535261e-06F,
+293
2.1869758e-06F, 2.3290978e-06F, 2.4804557e-06F, 2.6416497e-06F,
+294
2.8133190e-06F, 2.9961443e-06F, 3.1908506e-06F, 3.3982101e-06F,
+295
3.6190449e-06F, 3.8542308e-06F, 4.1047004e-06F, 4.3714470e-06F,
+296
4.6555282e-06F, 4.9580707e-06F, 5.2802740e-06F, 5.6234160e-06F,
+297
5.9888572e-06F, 6.3780469e-06F, 6.7925283e-06F, 7.2339451e-06F,
+298
7.7040476e-06F, 8.2047000e-06F, 8.7378876e-06F, 9.3057248e-06F,
+299
9.9104632e-06F, 1.0554501e-05F, 1.1240392e-05F, 1.1970856e-05F,
+300
1.2748789e-05F, 1.3577278e-05F, 1.4459606e-05F, 1.5399272e-05F,
+301
1.6400004e-05F, 1.7465768e-05F, 1.8600792e-05F, 1.9809576e-05F,
+302
2.1096914e-05F, 2.2467911e-05F, 2.3928002e-05F, 2.5482978e-05F,
+303
2.7139006e-05F, 2.8902651e-05F, 3.0780908e-05F, 3.2781225e-05F,
+304
3.4911534e-05F, 3.7180282e-05F, 3.9596466e-05F, 4.2169667e-05F,
+305
4.4910090e-05F, 4.7828601e-05F, 5.0936773e-05F, 5.4246931e-05F,
+306
5.7772202e-05F, 6.1526565e-05F, 6.5524908e-05F, 6.9783085e-05F,
+307
7.4317983e-05F, 7.9147585e-05F, 8.4291040e-05F, 8.9768747e-05F,
+308
9.5602426e-05F, 0.00010181521F, 0.00010843174F, 0.00011547824F,
+309
0.00012298267F, 0.00013097477F, 0.00013948625F, 0.00014855085F,
+310
0.00015820453F, 0.00016848555F, 0.00017943469F, 0.00019109536F,
+311
0.00020351382F, 0.00021673929F, 0.00023082423F, 0.00024582449F,
+312
0.00026179955F, 0.00027881276F, 0.00029693158F, 0.00031622787F,
+313
0.00033677814F, 0.00035866388F, 0.00038197188F, 0.00040679456F,
+314
0.00043323036F, 0.00046138411F, 0.00049136745F, 0.00052329927F,
+315
0.00055730621F, 0.00059352311F, 0.00063209358F, 0.00067317058F,
+316
0.00071691700F, 0.00076350630F, 0.00081312324F, 0.00086596457F,
+317
0.00092223983F, 0.00098217216F, 0.0010459992F, 0.0011139742F,
+318
0.0011863665F, 0.0012634633F, 0.0013455702F, 0.0014330129F,
+319
0.0015261382F, 0.0016253153F, 0.0017309374F, 0.0018434235F,
+320
0.0019632195F, 0.0020908006F, 0.0022266726F, 0.0023713743F,
+321
0.0025254795F, 0.0026895994F, 0.0028643847F, 0.0030505286F,
+322
0.0032487691F, 0.0034598925F, 0.0036847358F, 0.0039241906F,
+323
0.0041792066F, 0.0044507950F, 0.0047400328F, 0.0050480668F,
+324
0.0053761186F, 0.0057254891F, 0.0060975636F, 0.0064938176F,
+325
0.0069158225F, 0.0073652516F, 0.0078438871F, 0.0083536271F,
+326
0.0088964928F, 0.009474637F, 0.010090352F, 0.010746080F,
+327
0.011444421F, 0.012188144F, 0.012980198F, 0.013823725F,
+328
0.014722068F, 0.015678791F, 0.016697687F, 0.017782797F,
+329
0.018938423F, 0.020169149F, 0.021479854F, 0.022875735F,
+330
0.024362330F, 0.025945531F, 0.027631618F, 0.029427276F,
+331
0.031339626F, 0.033376252F, 0.035545228F, 0.037855157F,
+332
0.040315199F, 0.042935108F, 0.045725273F, 0.048696758F,
+333
0.051861348F, 0.055231591F, 0.058820850F, 0.062643361F,
+334
0.066714279F, 0.071049749F, 0.075666962F, 0.080584227F,
+335
0.085821044F, 0.091398179F, 0.097337747F, 0.10366330F,
+336
0.11039993F, 0.11757434F, 0.12521498F, 0.13335215F,
+337
0.14201813F, 0.15124727F, 0.16107617F, 0.17154380F,
+338
0.18269168F, 0.19456402F, 0.20720788F, 0.22067342F,
+339
0.23501402F, 0.25028656F, 0.26655159F, 0.28387361F,
+340
0.30232132F, 0.32196786F, 0.34289114F, 0.36517414F,
+341
0.38890521F, 0.41417847F, 0.44109412F, 0.46975890F,
+342
0.50028648F, 0.53279791F, 0.56742212F, 0.60429640F,
+343
0.64356699F, 0.68538959F, 0.72993007F, 0.77736504F,
+344
0.82788260F, 0.88168307F, 0.9389798F, 1.F,
+345
};
+346
+347
static void render_line(int n, int x0,int x1,int y0,int y1,float *d){
+348
int dy=y1-y0;
+349
int adx=x1-x0;
+350
int ady=abs(dy);
+351
int base=dy/adx;
+352
int sy=(dy<0?base-1:base+1);
+353
int x=x0;
+354
int y=y0;
+355
int err=0;
+356
+357
ady-=abs(base*adx);
+358
+359
if(n>x1)n=x1;
+360
+361
if(x<n)
+362
d[x]*=FLOOR1_fromdB_LOOKUP[y];
+363
+364
while(++x<n){
+365
err=err+ady;
+366
if(err>=adx){
+367
err-=adx;
+368
y+=sy;
+369
}else{
+370
y+=base;
+371
}
+372
d[x]*=FLOOR1_fromdB_LOOKUP[y];
+373
}
+374
}
+375
+376
static void render_line0(int n, int x0,int x1,int y0,int y1,int *d){
+377
int dy=y1-y0;
+378
int adx=x1-x0;
+379
int ady=abs(dy);
+380
int base=dy/adx;
+381
int sy=(dy<0?base-1:base+1);
+382
int x=x0;
+383
int y=y0;
+384
int err=0;
+385
+386
ady-=abs(base*adx);
+387
+388
if(n>x1)n=x1;
+389
+390
if(x<n)
+391
d[x]=y;
+392
+393
while(++x<n){
+394
err=err+ady;
+395
if(err>=adx){
+396
err-=adx;
+397
y+=sy;
+398
}else{
+399
y+=base;
+400
}
+401
d[x]=y;
+402
}
+403
}
+404
+405
/* the floor has already been filtered to only include relevant sections */
+406
static int accumulate_fit(const float *flr,const float *mdct,
+407
int x0, int x1,lsfit_acc *a,
+408
int n,vorbis_info_floor1 *info){
+409
long i;
+410
+411
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;
+412
+413
memset(a,0,sizeof(*a));
+414
a->x0=x0;
+415
a->x1=x1;
+416
if(x1>=n)x1=n-1;
+417
+418
for(i=x0;i<=x1;i++){
+419
int quantized=vorbis_dBquant(flr+i);
+420
if(quantized){
+421
if(mdct[i]+info->twofitatten>=flr[i]){
+422
xa += i;
+423
ya += quantized;
+424
x2a += i*i;
+425
y2a += quantized*quantized;
+426
xya += i*quantized;
+427
na++;
+428
}else{
+429
xb += i;
+430
yb += quantized;
+431
x2b += i*i;
+432
y2b += quantized*quantized;
+433
xyb += i*quantized;
+434
nb++;
+435
}
+436
}
+437
}
+438
+439
a->xa=xa;
+440
a->ya=ya;
+441
a->x2a=x2a;
+442
a->y2a=y2a;
+443
a->xya=xya;
+444
a->an=na;
+445
+446
a->xb=xb;
+447
a->yb=yb;
+448
a->x2b=x2b;
+449
a->y2b=y2b;
+450
a->xyb=xyb;
+451
a->bn=nb;
+452
+453
return(na);
+454
}
+455
+456
static int fit_line(lsfit_acc *a,int fits,int *y0,int *y1,
+457
vorbis_info_floor1 *info){
+458
double xb=0,yb=0,x2b=0,y2b=0,xyb=0,bn=0;
+459
int i;
+460
int x0=a[0].x0;
+461
int x1=a[fits-1].x1;
+462
+463
for(i=0;i<fits;i++){
+464
double weight = (a[i].bn+a[i].an)*info->twofitweight/(a[i].an+1)+1.;
+465
+466
xb+=a[i].xb + a[i].xa * weight;
+467
yb+=a[i].yb + a[i].ya * weight;
+468
x2b+=a[i].x2b + a[i].x2a * weight;
+469
y2b+=a[i].y2b + a[i].y2a * weight;
+470
xyb+=a[i].xyb + a[i].xya * weight;
+471
bn+=a[i].bn + a[i].an * weight;
+472
}
+473
+474
if(*y0>=0){
+475
xb+= x0;
+476
yb+= *y0;
+477
x2b+= x0 * x0;
+478
y2b+= *y0 * *y0;
+479
xyb+= *y0 * x0;
+480
bn++;
+481
}
+482
+483
if(*y1>=0){
+484
xb+= x1;
+485
yb+= *y1;
+486
x2b+= x1 * x1;
+487
y2b+= *y1 * *y1;
+488
xyb+= *y1 * x1;
+489
bn++;
+490
}
+491
+492
{
+493
double denom=(bn*x2b-xb*xb);
+494
+495
if(denom>0.){
+496
double a=(yb*x2b-xyb*xb)/denom;
+497
double b=(bn*xyb-xb*yb)/denom;
+498
*y0=rint(a+b*x0);
+499
*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
@@ -0,0 +1,57 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 *
+9
* by the Xiph.Org Foundation https://xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: highlevel encoder setup struct separated out for vorbisenc clarity
+14
+15
********************************************************************/
+16
+17
typedef struct highlevel_byblocktype {
+18
double tone_mask_setting;
+19
double tone_peaklimit_setting;
+20
double noise_bias_setting;
+21
double noise_compand_setting;
+22
} highlevel_byblocktype;
+23
+24
typedef struct highlevel_encode_setup {
+25
int set_in_stone;
+26
const void *setup;
+27
double base_setting;
+28
+29
double impulse_noisetune;
+30
+31
/* bitrate management below all settable */
+32
float req;
+33
int managed;
+34
long bitrate_min;
+35
long bitrate_av;
+36
double bitrate_av_damp;
+37
long bitrate_max;
+38
long bitrate_reservoir;
+39
double bitrate_reservoir_bias;
+40
+41
int impulse_block_p;
+42
int noise_normalize_p;
+43
int coupling_p;
+44
+45
double stereo_point_setting;
+46
double lowpass_kHz;
+47
int lowpass_altered;
+48
+49
double ath_floating_dB;
+50
double ath_absolute_dB;
+51
+52
double amplitude_track_dBpersec;
+53
double trigger_setting;
+54
+55
highlevel_byblocktype block[4]; /* padding, impulse, transition, long */
+56
+57
} highlevel_encode_setup;
vendor/vorbis/lib/info.cadded
@@ -0,0 +1,687 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2015 *
+9
* by the Xiph.Org Foundation https://xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: maintain the info structure, info <-> header packets
+14
+15
********************************************************************/
+16
+17
/* general handling of the header and the vorbis_info structure (and
+18
substructures) */
+19
+20
#include <stdlib.h>
+21
#include <string.h>
+22
#include <ogg/ogg.h>
+23
#include "vorbis/codec.h"
+24
#include "codec_internal.h"
+25
#include "codebook.h"
+26
#include "registry.h"
+27
#include "window.h"
+28
#include "psy.h"
+29
#include "misc.h"
+30
#include "os.h"
+31
+32
#define GENERAL_VENDOR_STRING "Xiph.Org libVorbis 1.3.7"
+33
#define ENCODE_VENDOR_STRING "Xiph.Org libVorbis I 20200704 (Reducing Environment)"
+34
+35
/* helpers */
+36
static void _v_writestring(oggpack_buffer *o,const char *s, int bytes){
+37
+38
while(bytes--){
+39
oggpack_write(o,*s++,8);
+40
}
+41
}
+42
+43
static void _v_readstring(oggpack_buffer *o,char *buf,int bytes){
+44
while(bytes--){
+45
*buf++=oggpack_read(o,8);
+46
}
+47
}
+48
+49
static int _v_toupper(int c) {
+50
return (c >= 'a' && c <= 'z') ? (c & ~('a' - 'A')) : c;
+51
}
+52
+53
void vorbis_comment_init(vorbis_comment *vc){
+54
memset(vc,0,sizeof(*vc));
+55
}
+56
+57
void vorbis_comment_add(vorbis_comment *vc,const char *comment){
+58
vc->user_comments=_ogg_realloc(vc->user_comments,
+59
(vc->comments+2)*sizeof(*vc->user_comments));
+60
vc->comment_lengths=_ogg_realloc(vc->comment_lengths,
+61
(vc->comments+2)*sizeof(*vc->comment_lengths));
+62
vc->comment_lengths[vc->comments]=strlen(comment);
+63
vc->user_comments[vc->comments]=_ogg_malloc(vc->comment_lengths[vc->comments]+1);
+64
strcpy(vc->user_comments[vc->comments], comment);
+65
vc->comments++;
+66
vc->user_comments[vc->comments]=NULL;
+67
}
+68
+69
void vorbis_comment_add_tag(vorbis_comment *vc, const char *tag, const char *contents){
+70
/* Length for key and value +2 for = and \0 */
+71
char *comment=_ogg_malloc(strlen(tag)+strlen(contents)+2);
+72
strcpy(comment, tag);
+73
strcat(comment, "=");
+74
strcat(comment, contents);
+75
vorbis_comment_add(vc, comment);
+76
_ogg_free(comment);
+77
}
+78
+79
/* This is more or less the same as strncasecmp - but that doesn't exist
+80
* everywhere, and this is a fairly trivial function, so we include it */
+81
static int tagcompare(const char *s1, const char *s2, int n){
+82
int c=0;
+83
while(c < n){
+84
if(_v_toupper(s1[c]) != _v_toupper(s2[c]))
+85
return !0;
+86
c++;
+87
}
+88
return 0;
+89
}
+90
+91
char *vorbis_comment_query(vorbis_comment *vc, const char *tag, int count){
+92
long i;
+93
int found = 0;
+94
int taglen = strlen(tag)+1; /* +1 for the = we append */
+95
char *fulltag = _ogg_malloc(taglen+1);
+96
+97
strcpy(fulltag, tag);
+98
strcat(fulltag, "=");
+99
+100
for(i=0;i<vc->comments;i++){
+101
if(!tagcompare(vc->user_comments[i], fulltag, taglen)){
+102
if(count == found) {
+103
/* We return a pointer to the data, not a copy */
+104
_ogg_free(fulltag);
+105
return vc->user_comments[i] + taglen;
+106
} else {
+107
found++;
+108
}
+109
}
+110
}
+111
_ogg_free(fulltag);
+112
return NULL; /* didn't find anything */
+113
}
+114
+115
int vorbis_comment_query_count(vorbis_comment *vc, const char *tag){
+116
int i,count=0;
+117
int taglen = strlen(tag)+1; /* +1 for the = we append */
+118
char *fulltag = _ogg_malloc(taglen+1);
+119
strcpy(fulltag,tag);
+120
strcat(fulltag, "=");
+121
+122
for(i=0;i<vc->comments;i++){
+123
if(!tagcompare(vc->user_comments[i], fulltag, taglen))
+124
count++;
+125
}
+126
+127
_ogg_free(fulltag);
+128
return count;
+129
}
+130
+131
void vorbis_comment_clear(vorbis_comment *vc){
+132
if(vc){
+133
long i;
+134
if(vc->user_comments){
+135
for(i=0;i<vc->comments;i++)
+136
if(vc->user_comments[i])_ogg_free(vc->user_comments[i]);
+137
_ogg_free(vc->user_comments);
+138
}
+139
if(vc->comment_lengths)_ogg_free(vc->comment_lengths);
+140
if(vc->vendor)_ogg_free(vc->vendor);
+141
memset(vc,0,sizeof(*vc));
+142
}
+143
}
+144
+145
/* blocksize 0 is guaranteed to be short, 1 is guaranteed to be long.
+146
They may be equal, but short will never ge greater than long */
+147
int vorbis_info_blocksize(vorbis_info *vi,int zo){
+148
codec_setup_info *ci = vi->codec_setup;
+149
return ci ? ci->blocksizes[zo] : -1;
+150
}
+151
+152
/* used by synthesis, which has a full, alloced vi */
+153
void vorbis_info_init(vorbis_info *vi){
+154
memset(vi,0,sizeof(*vi));
+155
vi->codec_setup=_ogg_calloc(1,sizeof(codec_setup_info));
+156
}
+157
+158
void vorbis_info_clear(vorbis_info *vi){
+159
codec_setup_info *ci=vi->codec_setup;
+160
int i;
+161
+162
if(ci){
+163
+164
for(i=0;i<ci->modes;i++)
+165
if(ci->mode_param[i])_ogg_free(ci->mode_param[i]);
+166
+167
for(i=0;i<ci->maps;i++) /* unpack does the range checking */
+168
if(ci->map_param[i]) /* this may be cleaning up an aborted
+169
unpack, in which case the below type
+170
cannot be trusted */
+171
_mapping_P[ci->map_type[i]]->free_info(ci->map_param[i]);
+172
+173
for(i=0;i<ci->floors;i++) /* unpack does the range checking */
+174
if(ci->floor_param[i]) /* this may be cleaning up an aborted
+175
unpack, in which case the below type
+176
cannot be trusted */
+177
_floor_P[ci->floor_type[i]]->free_info(ci->floor_param[i]);
+178
+179
for(i=0;i<ci->residues;i++) /* unpack does the range checking */
+180
if(ci->residue_param[i]) /* this may be cleaning up an aborted
+181
unpack, in which case the below type
+182
cannot be trusted */
+183
_residue_P[ci->residue_type[i]]->free_info(ci->residue_param[i]);
+184
+185
for(i=0;i<ci->books;i++){
+186
if(ci->book_param[i]){
+187
/* knows if the book was not alloced */
+188
vorbis_staticbook_destroy(ci->book_param[i]);
+189
}
+190
if(ci->fullbooks)
+191
vorbis_book_clear(ci->fullbooks+i);
+192
}
+193
if(ci->fullbooks)
+194
_ogg_free(ci->fullbooks);
+195
+196
for(i=0;i<ci->psys;i++)
+197
_vi_psy_free(ci->psy_param[i]);
+198
+199
_ogg_free(ci);
+200
}
+201
+202
memset(vi,0,sizeof(*vi));
+203
}
+204
+205
/* Header packing/unpacking ********************************************/
+206
+207
static int _vorbis_unpack_info(vorbis_info *vi,oggpack_buffer *opb){
+208
codec_setup_info *ci=vi->codec_setup;
+209
int bs;
+210
if(!ci)return(OV_EFAULT);
+211
+212
vi->version=oggpack_read(opb,32);
+213
if(vi->version!=0)return(OV_EVERSION);
+214
+215
vi->channels=oggpack_read(opb,8);
+216
vi->rate=oggpack_read(opb,32);
+217
+218
vi->bitrate_upper=(ogg_int32_t)oggpack_read(opb,32);
+219
vi->bitrate_nominal=(ogg_int32_t)oggpack_read(opb,32);
+220
vi->bitrate_lower=(ogg_int32_t)oggpack_read(opb,32);
+221
+222
bs = oggpack_read(opb,4);
+223
if(bs<0)goto err_out;
+224
ci->blocksizes[0]=1<<bs;
+225
bs = oggpack_read(opb,4);
+226
if(bs<0)goto err_out;
+227
ci->blocksizes[1]=1<<bs;
+228
+229
if(vi->rate<1)goto err_out;
+230
if(vi->channels<1)goto err_out;
+231
if(ci->blocksizes[0]<64)goto err_out;
+232
if(ci->blocksizes[1]<ci->blocksizes[0])goto err_out;
+233
if(ci->blocksizes[1]>8192)goto err_out;
+234
+235
if(oggpack_read(opb,1)!=1)goto err_out; /* EOP check */
+236
+237
return(0);
+238
err_out:
+239
vorbis_info_clear(vi);
+240
return(OV_EBADHEADER);
+241
}
+242
+243
static int _vorbis_unpack_comment(vorbis_comment *vc,oggpack_buffer *opb){
+244
int i;
+245
int vendorlen=oggpack_read(opb,32);
+246
if(vendorlen<0)goto err_out;
+247
if(vendorlen>opb->storage-8)goto err_out;
+248
vc->vendor=_ogg_calloc(vendorlen+1,1);
+249
_v_readstring(opb,vc->vendor,vendorlen);
+250
i=oggpack_read(opb,32);
+251
if(i<0)goto err_out;
+252
if(i>((opb->storage-oggpack_bytes(opb))>>2))goto err_out;
+253
vc->comments=i;
+254
vc->user_comments=_ogg_calloc(vc->comments+1,sizeof(*vc->user_comments));
+255
vc->comment_lengths=_ogg_calloc(vc->comments+1, sizeof(*vc->comment_lengths));
+256
+257
for(i=0;i<vc->comments;i++){
+258
int len=oggpack_read(opb,32);
+259
if(len<0)goto err_out;
+260
if(len>opb->storage-oggpack_bytes(opb))goto err_out;
+261
vc->comment_lengths[i]=len;
+262
vc->user_comments[i]=_ogg_calloc(len+1,1);
+263
_v_readstring(opb,vc->user_comments[i],len);
+264
}
+265
if(oggpack_read(opb,1)!=1)goto err_out; /* EOP check */
+266
+267
return(0);
+268
err_out:
+269
vorbis_comment_clear(vc);
+270
return(OV_EBADHEADER);
+271
}
+272
+273
/* all of the real encoding details are here. The modes, books,
+274
everything */
+275
static int _vorbis_unpack_books(vorbis_info *vi,oggpack_buffer *opb){
+276
codec_setup_info *ci=vi->codec_setup;
+277
int i;
+278
+279
/* codebooks */
+280
ci->books=oggpack_read(opb,8)+1;
+281
if(ci->books<=0)goto err_out;
+282
for(i=0;i<ci->books;i++){
+283
ci->book_param[i]=vorbis_staticbook_unpack(opb);
+284
if(!ci->book_param[i])goto err_out;
+285
}
+286
+287
/* time backend settings; hooks are unused */
+288
{
+289
int times=oggpack_read(opb,6)+1;
+290
if(times<=0)goto err_out;
+291
for(i=0;i<times;i++){
+292
int test=oggpack_read(opb,16);
+293
if(test<0 || test>=VI_TIMEB)goto err_out;
+294
}
+295
}
+296
+297
/* floor backend settings */
+298
ci->floors=oggpack_read(opb,6)+1;
+299
if(ci->floors<=0)goto err_out;
+300
for(i=0;i<ci->floors;i++){
+301
ci->floor_type[i]=oggpack_read(opb,16);
+302
if(ci->floor_type[i]<0 || ci->floor_type[i]>=VI_FLOORB)goto err_out;
+303
ci->floor_param[i]=_floor_P[ci->floor_type[i]]->unpack(vi,opb);
+304
if(!ci->floor_param[i])goto err_out;
+305
}
+306
+307
/* residue backend settings */
+308
ci->residues=oggpack_read(opb,6)+1;
+309
if(ci->residues<=0)goto err_out;
+310
for(i=0;i<ci->residues;i++){
+311
ci->residue_type[i]=oggpack_read(opb,16);
+312
if(ci->residue_type[i]<0 || ci->residue_type[i]>=VI_RESB)goto err_out;
+313
ci->residue_param[i]=_residue_P[ci->residue_type[i]]->unpack(vi,opb);
+314
if(!ci->residue_param[i])goto err_out;
+315
}
+316
+317
/* map backend settings */
+318
ci->maps=oggpack_read(opb,6)+1;
+319
if(ci->maps<=0)goto err_out;
+320
for(i=0;i<ci->maps;i++){
+321
ci->map_type[i]=oggpack_read(opb,16);
+322
if(ci->map_type[i]<0 || ci->map_type[i]>=VI_MAPB)goto err_out;
+323
ci->map_param[i]=_mapping_P[ci->map_type[i]]->unpack(vi,opb);
+324
if(!ci->map_param[i])goto err_out;
+325
}
+326
+327
/* mode settings */
+328
ci->modes=oggpack_read(opb,6)+1;
+329
if(ci->modes<=0)goto err_out;
+330
for(i=0;i<ci->modes;i++){
+331
ci->mode_param[i]=_ogg_calloc(1,sizeof(*ci->mode_param[i]));
+332
ci->mode_param[i]->blockflag=oggpack_read(opb,1);
+333
ci->mode_param[i]->windowtype=oggpack_read(opb,16);
+334
ci->mode_param[i]->transformtype=oggpack_read(opb,16);
+335
ci->mode_param[i]->mapping=oggpack_read(opb,8);
+336
+337
if(ci->mode_param[i]->windowtype>=VI_WINDOWB)goto err_out;
+338
if(ci->mode_param[i]->transformtype>=VI_WINDOWB)goto err_out;
+339
if(ci->mode_param[i]->mapping>=ci->maps)goto err_out;
+340
if(ci->mode_param[i]->mapping<0)goto err_out;
+341
}
+342
+343
if(oggpack_read(opb,1)!=1)goto err_out; /* top level EOP check */
+344
+345
return(0);
+346
err_out:
+347
vorbis_info_clear(vi);
+348
return(OV_EBADHEADER);
+349
}
+350
+351
/* Is this packet a vorbis ID header? */
+352
int vorbis_synthesis_idheader(ogg_packet *op){
+353
oggpack_buffer opb;
+354
char buffer[6];
+355
+356
if(op){
+357
oggpack_readinit(&opb,op->packet,op->bytes);
+358
+359
if(!op->b_o_s)
+360
return(0); /* Not the initial packet */
+361
+362
if(oggpack_read(&opb,8) != 1)
+363
return 0; /* not an ID header */
+364
+365
memset(buffer,0,6);
+366
_v_readstring(&opb,buffer,6);
+367
if(memcmp(buffer,"vorbis",6))
+368
return 0; /* not vorbis */
+369
+370
return 1;
+371
}
+372
+373
return 0;
+374
}
+375
+376
/* The Vorbis header is in three packets; the initial small packet in
+377
the first page that identifies basic parameters, a second packet
+378
with bitstream comments and a third packet that holds the
+379
codebook. */
+380
+381
int vorbis_synthesis_headerin(vorbis_info *vi,vorbis_comment *vc,ogg_packet *op){
+382
oggpack_buffer opb;
+383
+384
if(op){
+385
oggpack_readinit(&opb,op->packet,op->bytes);
+386
+387
/* Which of the three types of header is this? */
+388
/* Also verify header-ness, vorbis */
+389
{
+390
char buffer[6];
+391
int packtype=oggpack_read(&opb,8);
+392
memset(buffer,0,6);
+393
_v_readstring(&opb,buffer,6);
+394
if(memcmp(buffer,"vorbis",6)){
+395
/* not a vorbis header */
+396
return(OV_ENOTVORBIS);
+397
}
+398
switch(packtype){
+399
case 0x01: /* least significant *bit* is read first */
+400
if(!op->b_o_s){
+401
/* Not the initial packet */
+402
return(OV_EBADHEADER);
+403
}
+404
if(vi->rate!=0){
+405
/* previously initialized info header */
+406
return(OV_EBADHEADER);
+407
}
+408
+409
return(_vorbis_unpack_info(vi,&opb));
+410
+411
case 0x03: /* least significant *bit* is read first */
+412
if(vi->rate==0){
+413
/* um... we didn't get the initial header */
+414
return(OV_EBADHEADER);
+415
}
+416
if(vc->vendor!=NULL){
+417
/* previously initialized comment header */
+418
return(OV_EBADHEADER);
+419
}
+420
+421
return(_vorbis_unpack_comment(vc,&opb));
+422
+423
case 0x05: /* least significant *bit* is read first */
+424
if(vi->rate==0 || vc->vendor==NULL){
+425
/* um... we didn;t get the initial header or comments yet */
+426
return(OV_EBADHEADER);
+427
}
+428
if(vi->codec_setup==NULL){
+429
/* improperly initialized vorbis_info */
+430
return(OV_EFAULT);
+431
}
+432
if(((codec_setup_info *)vi->codec_setup)->books>0){
+433
/* previously initialized setup header */
+434
return(OV_EBADHEADER);
+435
}
+436
+437
return(_vorbis_unpack_books(vi,&opb));
+438
+439
default:
+440
/* Not a valid vorbis header type */
+441
return(OV_EBADHEADER);
+442
break;
+443
}
+444
}
+445
}
+446
return(OV_EBADHEADER);
+447
}
+448
+449
/* pack side **********************************************************/
+450
+451
static int _vorbis_pack_info(oggpack_buffer *opb,vorbis_info *vi){
+452
codec_setup_info *ci=vi->codec_setup;
+453
if(!ci||
+454
ci->blocksizes[0]<64||
+455
ci->blocksizes[1]<ci->blocksizes[0]){
+456
return(OV_EFAULT);
+457
}
+458
+459
/* preamble */
+460
oggpack_write(opb,0x01,8);
+461
_v_writestring(opb,"vorbis", 6);
+462
+463
/* basic information about the stream */
+464
oggpack_write(opb,0x00,32);
+465
oggpack_write(opb,vi->channels,8);
+466
oggpack_write(opb,vi->rate,32);
+467
+468
oggpack_write(opb,vi->bitrate_upper,32);
+469
oggpack_write(opb,vi->bitrate_nominal,32);
+470
oggpack_write(opb,vi->bitrate_lower,32);
+471
+472
oggpack_write(opb,ov_ilog(ci->blocksizes[0]-1),4);
+473
oggpack_write(opb,ov_ilog(ci->blocksizes[1]-1),4);
+474
oggpack_write(opb,1,1);
+475
+476
return(0);
+477
}
+478
+479
static int _vorbis_pack_comment(oggpack_buffer *opb,vorbis_comment *vc){
+480
int bytes = strlen(ENCODE_VENDOR_STRING);
+481
+482
/* preamble */
+483
oggpack_write(opb,0x03,8);
+484
_v_writestring(opb,"vorbis", 6);
+485
+486
/* vendor */
+487
oggpack_write(opb,bytes,32);
+488
_v_writestring(opb,ENCODE_VENDOR_STRING, bytes);
+489
+490
/* comments */
+491
+492
oggpack_write(opb,vc->comments,32);
+493
if(vc->comments){
+494
int i;
+495
for(i=0;i<vc->comments;i++){
+496
if(vc->user_comments[i]){
+497
oggpack_write(opb,vc->comment_lengths[i],32);
+498
_v_writestring(opb,vc->user_comments[i], vc->comment_lengths[i]);
+499
}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
@@ -0,0 +1,93 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 *
+9
* by the Xiph.Org Foundation https://xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: lookup based functions
+14
+15
********************************************************************/
+16
+17
#include <math.h>
+18
#include "lookup.h"
+19
#include "lookup_data.h"
+20
#include "os.h"
+21
#include "misc.h"
+22
+23
#ifdef FLOAT_LOOKUP
+24
+25
/* interpolated lookup based cos function, domain 0 to PI only */
+26
float vorbis_coslook(float a){
+27
double d=a*(.31830989*(float)COS_LOOKUP_SZ);
+28
int i=vorbis_ftoi(d-.5);
+29
+30
return COS_LOOKUP[i]+ (d-i)*(COS_LOOKUP[i+1]-COS_LOOKUP[i]);
+31
}
+32
+33
/* interpolated 1./sqrt(p) where .5 <= p < 1. */
+34
float vorbis_invsqlook(float a){
+35
double d=a*(2.f*(float)INVSQ_LOOKUP_SZ)-(float)INVSQ_LOOKUP_SZ;
+36
int i=vorbis_ftoi(d-.5f);
+37
return INVSQ_LOOKUP[i]+ (d-i)*(INVSQ_LOOKUP[i+1]-INVSQ_LOOKUP[i]);
+38
}
+39
+40
/* interpolated 1./sqrt(p) where .5 <= p < 1. */
+41
float vorbis_invsq2explook(int a){
+42
return INVSQ2EXP_LOOKUP[a-INVSQ2EXP_LOOKUP_MIN];
+43
}
+44
+45
#include <stdio.h>
+46
/* interpolated lookup based fromdB function, domain -140dB to 0dB only */
+47
float vorbis_fromdBlook(float a){
+48
int i=vorbis_ftoi(a*((float)(-(1<<FROMdB2_SHIFT)))-.5f);
+49
return (i<0)?1.f:
+50
((i>=(FROMdB_LOOKUP_SZ<<FROMdB_SHIFT))?0.f:
+51
FROMdB_LOOKUP[i>>FROMdB_SHIFT]*FROMdB2_LOOKUP[i&FROMdB2_MASK]);
+52
}
+53
+54
#endif
+55
+56
#ifdef INT_LOOKUP
+57
/* interpolated 1./sqrt(p) where .5 <= a < 1. (.100000... to .111111...) in
+58
16.16 format
+59
+60
returns in m.8 format */
+61
long vorbis_invsqlook_i(long a,long e){
+62
long i=(a&0x7fff)>>(INVSQ_LOOKUP_I_SHIFT-1);
+63
long d=(a&INVSQ_LOOKUP_I_MASK)<<(16-INVSQ_LOOKUP_I_SHIFT); /* 0.16 */
+64
long val=INVSQ_LOOKUP_I[i]- /* 1.16 */
+65
(((INVSQ_LOOKUP_I[i]-INVSQ_LOOKUP_I[i+1])* /* 0.16 */
+66
d)>>16); /* result 1.16 */
+67
+68
e+=32;
+69
if(e&1)val=(val*5792)>>13; /* multiply val by 1/sqrt(2) */
+70
e=(e>>1)-8;
+71
+72
return(val>>e);
+73
}
+74
+75
/* interpolated lookup based fromdB function, domain -140dB to 0dB only */
+76
/* a is in n.12 format */
+77
float vorbis_fromdBlook_i(long a){
+78
int i=(-a)>>(12-FROMdB2_SHIFT);
+79
return (i<0)?1.f:
+80
((i>=(FROMdB_LOOKUP_SZ<<FROMdB_SHIFT))?0.f:
+81
FROMdB_LOOKUP[i>>FROMdB_SHIFT]*FROMdB2_LOOKUP[i&FROMdB2_MASK]);
+82
}
+83
+84
/* interpolated lookup based cos function, domain 0 to PI only */
+85
/* a is in 0.16 format, where 0==0, 2^^16-1==PI, return 0.14 */
+86
long vorbis_coslook_i(long a){
+87
int i=a>>COS_LOOKUP_I_SHIFT;
+88
int d=a&COS_LOOKUP_I_MASK;
+89
return COS_LOOKUP_I[i]- ((d*(COS_LOOKUP_I[i]-COS_LOOKUP_I[i+1]))>>
+90
COS_LOOKUP_I_SHIFT);
+91
}
+92
+93
#endif
vendor/vorbis/lib/lookup.hadded
@@ -0,0 +1,31 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 *
+9
* by the Xiph.Org Foundation https://xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: lookup based functions
+14
+15
********************************************************************/
+16
+17
#ifndef _V_LOOKUP_H_
+18
+19
#ifdef FLOAT_LOOKUP
+20
extern float vorbis_coslook(float a);
+21
extern float vorbis_invsqlook(float a);
+22
extern float vorbis_invsq2explook(int a);
+23
extern float vorbis_fromdBlook(float a);
+24
#endif
+25
#ifdef INT_LOOKUP
+26
extern long vorbis_invsqlook_i(long a,long e);
+27
extern long vorbis_coslook_i(long a);
+28
extern float vorbis_fromdBlook_i(long a);
+29
#endif
+30
+31
#endif
vendor/vorbis/lib/lookup_data.hadded
@@ -0,0 +1,191 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 *
+9
* by the Xiph.Org Foundation https://xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: lookup data; generated by lookups.pl; edit there
+14
+15
********************************************************************/
+16
+17
#ifndef _V_LOOKUP_DATA_H_
+18
+19
#ifdef FLOAT_LOOKUP
+20
#define COS_LOOKUP_SZ 128
+21
static const float COS_LOOKUP[COS_LOOKUP_SZ+1]={
+22
+1.0000000000000f,+0.9996988186962f,+0.9987954562052f,+0.9972904566787f,
+23
+0.9951847266722f,+0.9924795345987f,+0.9891765099648f,+0.9852776423889f,
+24
+0.9807852804032f,+0.9757021300385f,+0.9700312531945f,+0.9637760657954f,
+25
+0.9569403357322f,+0.9495281805930f,+0.9415440651830f,+0.9329927988347f,
+26
+0.9238795325113f,+0.9142097557035f,+0.9039892931234f,+0.8932243011955f,
+27
+0.8819212643484f,+0.8700869911087f,+0.8577286100003f,+0.8448535652497f,
+28
+0.8314696123025f,+0.8175848131516f,+0.8032075314806f,+0.7883464276266f,
+29
+0.7730104533627f,+0.7572088465065f,+0.7409511253550f,+0.7242470829515f,
+30
+0.7071067811865f,+0.6895405447371f,+0.6715589548470f,+0.6531728429538f,
+31
+0.6343932841636f,+0.6152315905806f,+0.5956993044924f,+0.5758081914178f,
+32
+0.5555702330196f,+0.5349976198871f,+0.5141027441932f,+0.4928981922298f,
+33
+0.4713967368260f,+0.4496113296546f,+0.4275550934303f,+0.4052413140050f,
+34
+0.3826834323651f,+0.3598950365350f,+0.3368898533922f,+0.3136817403989f,
+35
+0.2902846772545f,+0.2667127574749f,+0.2429801799033f,+0.2191012401569f,
+36
+0.1950903220161f,+0.1709618887603f,+0.1467304744554f,+0.1224106751992f,
+37
+0.0980171403296f,+0.0735645635997f,+0.0490676743274f,+0.0245412285229f,
+38
+0.0000000000000f,-0.0245412285229f,-0.0490676743274f,-0.0735645635997f,
+39
-0.0980171403296f,-0.1224106751992f,-0.1467304744554f,-0.1709618887603f,
+40
-0.1950903220161f,-0.2191012401569f,-0.2429801799033f,-0.2667127574749f,
+41
-0.2902846772545f,-0.3136817403989f,-0.3368898533922f,-0.3598950365350f,
+42
-0.3826834323651f,-0.4052413140050f,-0.4275550934303f,-0.4496113296546f,
+43
-0.4713967368260f,-0.4928981922298f,-0.5141027441932f,-0.5349976198871f,
+44
-0.5555702330196f,-0.5758081914178f,-0.5956993044924f,-0.6152315905806f,
+45
-0.6343932841636f,-0.6531728429538f,-0.6715589548470f,-0.6895405447371f,
+46
-0.7071067811865f,-0.7242470829515f,-0.7409511253550f,-0.7572088465065f,
+47
-0.7730104533627f,-0.7883464276266f,-0.8032075314806f,-0.8175848131516f,
+48
-0.8314696123025f,-0.8448535652497f,-0.8577286100003f,-0.8700869911087f,
+49
-0.8819212643484f,-0.8932243011955f,-0.9039892931234f,-0.9142097557035f,
+50
-0.9238795325113f,-0.9329927988347f,-0.9415440651830f,-0.9495281805930f,
+51
-0.9569403357322f,-0.9637760657954f,-0.9700312531945f,-0.9757021300385f,
+52
-0.9807852804032f,-0.9852776423889f,-0.9891765099648f,-0.9924795345987f,
+53
-0.9951847266722f,-0.9972904566787f,-0.9987954562052f,-0.9996988186962f,
+54
-1.0000000000000f,
+55
};
+56
+57
#define INVSQ_LOOKUP_SZ 32
+58
static const float INVSQ_LOOKUP[INVSQ_LOOKUP_SZ+1]={
+59
1.414213562373f,1.392621247646f,1.371988681140f,1.352246807566f,
+60
1.333333333333f,1.315191898443f,1.297771369046f,1.281025230441f,
+61
1.264911064067f,1.249390095109f,1.234426799697f,1.219988562661f,
+62
1.206045378311f,1.192569588000f,1.179535649239f,1.166919931983f,
+63
1.154700538379f,1.142857142857f,1.131370849898f,1.120224067222f,
+64
1.109400392450f,1.098884511590f,1.088662107904f,1.078719779941f,
+65
1.069044967650f,1.059625885652f,1.050451462878f,1.041511287847f,
+66
1.032795558989f,1.024295039463f,1.016001016002f,1.007905261358f,
+67
1.000000000000f,
+68
};
+69
+70
#define INVSQ2EXP_LOOKUP_MIN (-32)
+71
#define INVSQ2EXP_LOOKUP_MAX 32
+72
static const float INVSQ2EXP_LOOKUP[INVSQ2EXP_LOOKUP_MAX-\
+73
INVSQ2EXP_LOOKUP_MIN+1]={
+74
65536.f, 46340.95001f, 32768.f, 23170.47501f,
+75
16384.f, 11585.2375f, 8192.f, 5792.618751f,
+76
4096.f, 2896.309376f, 2048.f, 1448.154688f,
+77
1024.f, 724.0773439f, 512.f, 362.038672f,
+78
256.f, 181.019336f, 128.f, 90.50966799f,
+79
64.f, 45.254834f, 32.f, 22.627417f,
+80
16.f, 11.3137085f, 8.f, 5.656854249f,
+81
4.f, 2.828427125f, 2.f, 1.414213562f,
+82
1.f, 0.7071067812f, 0.5f, 0.3535533906f,
+83
0.25f, 0.1767766953f, 0.125f, 0.08838834765f,
+84
0.0625f, 0.04419417382f, 0.03125f, 0.02209708691f,
+85
0.015625f, 0.01104854346f, 0.0078125f, 0.005524271728f,
+86
0.00390625f, 0.002762135864f, 0.001953125f, 0.001381067932f,
+87
0.0009765625f, 0.000690533966f, 0.00048828125f, 0.000345266983f,
+88
0.000244140625f,0.0001726334915f,0.0001220703125f,8.631674575e-05f,
+89
6.103515625e-05f,4.315837288e-05f,3.051757812e-05f,2.157918644e-05f,
+90
1.525878906e-05f,
+91
};
+92
+93
#endif
+94
+95
#define FROMdB_LOOKUP_SZ 35
+96
#define FROMdB2_LOOKUP_SZ 32
+97
#define FROMdB_SHIFT 5
+98
#define FROMdB2_SHIFT 3
+99
#define FROMdB2_MASK 31
+100
+101
#ifdef FLOAT_LOOKUP
+102
static const float FROMdB_LOOKUP[FROMdB_LOOKUP_SZ]={
+103
1.f, 0.6309573445f, 0.3981071706f, 0.2511886432f,
+104
0.1584893192f, 0.1f, 0.06309573445f, 0.03981071706f,
+105
0.02511886432f, 0.01584893192f, 0.01f, 0.006309573445f,
+106
0.003981071706f, 0.002511886432f, 0.001584893192f, 0.001f,
+107
0.0006309573445f,0.0003981071706f,0.0002511886432f,0.0001584893192f,
+108
0.0001f,6.309573445e-05f,3.981071706e-05f,2.511886432e-05f,
+109
1.584893192e-05f, 1e-05f,6.309573445e-06f,3.981071706e-06f,
+110
2.511886432e-06f,1.584893192e-06f, 1e-06f,6.309573445e-07f,
+111
3.981071706e-07f,2.511886432e-07f,1.584893192e-07f,
+112
};
+113
+114
static const float FROMdB2_LOOKUP[FROMdB2_LOOKUP_SZ]={
+115
0.9928302478f, 0.9786445908f, 0.9646616199f, 0.9508784391f,
+116
0.9372921937f, 0.92390007f, 0.9106992942f, 0.8976871324f,
+117
0.8848608897f, 0.8722179097f, 0.8597555737f, 0.8474713009f,
+118
0.835362547f, 0.8234268041f, 0.8116616003f, 0.8000644989f,
+119
0.7886330981f, 0.7773650302f, 0.7662579617f, 0.755309592f,
+120
0.7445176537f, 0.7338799116f, 0.7233941627f, 0.7130582353f,
+121
0.7028699885f, 0.6928273125f, 0.6829281272f, 0.6731703824f,
+122
0.6635520573f, 0.6540711597f, 0.6447257262f, 0.6355138211f,
+123
};
+124
#endif
+125
+126
#ifdef INT_LOOKUP
+127
+128
#define INVSQ_LOOKUP_I_SHIFT 10
+129
#define INVSQ_LOOKUP_I_MASK 1023
+130
static const long INVSQ_LOOKUP_I[64+1]={
+131
92682l, 91966l, 91267l, 90583l,
+132
89915l, 89261l, 88621l, 87995l,
+133
87381l, 86781l, 86192l, 85616l,
+134
85051l, 84497l, 83953l, 83420l,
+135
82897l, 82384l, 81880l, 81385l,
+136
80899l, 80422l, 79953l, 79492l,
+137
79039l, 78594l, 78156l, 77726l,
+138
77302l, 76885l, 76475l, 76072l,
+139
75674l, 75283l, 74898l, 74519l,
+140
74146l, 73778l, 73415l, 73058l,
+141
72706l, 72359l, 72016l, 71679l,
+142
71347l, 71019l, 70695l, 70376l,
+143
70061l, 69750l, 69444l, 69141l,
+144
68842l, 68548l, 68256l, 67969l,
+145
67685l, 67405l, 67128l, 66855l,
+146
66585l, 66318l, 66054l, 65794l,
+147
65536l,
+148
};
+149
+150
#define COS_LOOKUP_I_SHIFT 9
+151
#define COS_LOOKUP_I_MASK 511
+152
#define COS_LOOKUP_I_SZ 128
+153
static const long COS_LOOKUP_I[COS_LOOKUP_I_SZ+1]={
+154
16384l, 16379l, 16364l, 16340l,
+155
16305l, 16261l, 16207l, 16143l,
+156
16069l, 15986l, 15893l, 15791l,
+157
15679l, 15557l, 15426l, 15286l,
+158
15137l, 14978l, 14811l, 14635l,
+159
14449l, 14256l, 14053l, 13842l,
+160
13623l, 13395l, 13160l, 12916l,
+161
12665l, 12406l, 12140l, 11866l,
+162
11585l, 11297l, 11003l, 10702l,
+163
10394l, 10080l, 9760l, 9434l,
+164
9102l, 8765l, 8423l, 8076l,
+165
7723l, 7366l, 7005l, 6639l,
+166
6270l, 5897l, 5520l, 5139l,
+167
4756l, 4370l, 3981l, 3590l,
+168
3196l, 2801l, 2404l, 2006l,
+169
1606l, 1205l, 804l, 402l,
+170
0l, -401l, -803l, -1204l,
+171
-1605l, -2005l, -2403l, -2800l,
+172
-3195l, -3589l, -3980l, -4369l,
+173
-4755l, -5138l, -5519l, -5896l,
+174
-6269l, -6638l, -7004l, -7365l,
+175
-7722l, -8075l, -8422l, -8764l,
+176
-9101l, -9433l, -9759l, -10079l,
+177
-10393l, -10701l, -11002l, -11296l,
+178
-11584l, -11865l, -12139l, -12405l,
+179
-12664l, -12915l, -13159l, -13394l,
+180
-13622l, -13841l, -14052l, -14255l,
+181
-14448l, -14634l, -14810l, -14977l,
+182
-15136l, -15285l, -15425l, -15556l,
+183
-15678l, -15790l, -15892l, -15985l,
+184
-16068l, -16142l, -16206l, -16260l,
+185
-16304l, -16339l, -16363l, -16378l,
+186
-16383l,
+187
};
+188
+189
#endif
+190
+191
#endif
vendor/vorbis/lib/lpc.cadded
@@ -0,0 +1,159 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 *
+9
* by the Xiph.Org Foundation https://xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: LPC low level routines
+14
+15
********************************************************************/
+16
+17
/* Some of these routines (autocorrelator, LPC coefficient estimator)
+18
are derived from code written by Jutta Degener and Carsten Bormann;
+19
thus we include their copyright below. The entirety of this file
+20
is freely redistributable on the condition that both of these
+21
copyright notices are preserved without modification. */
+22
+23
/* Preserved Copyright: *********************************************/
+24
+25
/* Copyright 1992, 1993, 1994 by Jutta Degener and Carsten Bormann,
+26
Technische Universita"t Berlin
+27
+28
Any use of this software is permitted provided that this notice is not
+29
removed and that neither the authors nor the Technische Universita"t
+30
Berlin are deemed to have made any representations as to the
+31
suitability of this software for any purpose nor are held responsible
+32
for any defects of this software. THERE IS ABSOLUTELY NO WARRANTY FOR
+33
THIS SOFTWARE.
+34
+35
As a matter of courtesy, the authors request to be informed about uses
+36
this software has found, about bugs in this software, and about any
+37
improvements that may be of general interest.
+38
+39
Berlin, 28.11.1994
+40
Jutta Degener
+41
Carsten Bormann
+42
+43
*********************************************************************/
+44
+45
#include <stdlib.h>
+46
#include <string.h>
+47
#include <math.h>
+48
#include "os.h"
+49
#include "smallft.h"
+50
#include "lpc.h"
+51
#include "scales.h"
+52
#include "misc.h"
+53
+54
/* Autocorrelation LPC coeff generation algorithm invented by
+55
N. Levinson in 1947, modified by J. Durbin in 1959. */
+56
+57
/* Input : n elements of time doamin data
+58
Output: m lpc coefficients, excitation energy */
+59
+60
float vorbis_lpc_from_data(float *data,float *lpci,int n,int m){
+61
double *aut=alloca(sizeof(*aut)*(m+1));
+62
double *lpc=alloca(sizeof(*lpc)*(m));
+63
double error;
+64
double epsilon;
+65
int i,j;
+66
+67
/* autocorrelation, p+1 lag coefficients */
+68
j=m+1;
+69
while(j--){
+70
double d=0; /* double needed for accumulator depth */
+71
for(i=j;i<n;i++)d+=(double)data[i]*data[i-j];
+72
aut[j]=d;
+73
}
+74
+75
/* Generate lpc coefficients from autocorr values */
+76
+77
/* set our noise floor to about -100dB */
+78
error=aut[0] * (1. + 1e-10);
+79
epsilon=1e-9*aut[0]+1e-10;
+80
+81
for(i=0;i<m;i++){
+82
double r= -aut[i+1];
+83
+84
if(error<epsilon){
+85
memset(lpc+i,0,(m-i)*sizeof(*lpc));
+86
goto done;
+87
}
+88
+89
/* Sum up this iteration's reflection coefficient; note that in
+90
Vorbis we don't save it. If anyone wants to recycle this code
+91
and needs reflection coefficients, save the results of 'r' from
+92
each iteration. */
+93
+94
for(j=0;j<i;j++)r-=lpc[j]*aut[i-j];
+95
r/=error;
+96
+97
/* Update LPC coefficients and total error */
+98
+99
lpc[i]=r;
+100
for(j=0;j<i/2;j++){
+101
double tmp=lpc[j];
+102
+103
lpc[j]+=r*lpc[i-1-j];
+104
lpc[i-1-j]+=r*tmp;
+105
}
+106
if(i&1)lpc[j]+=lpc[j]*r;
+107
+108
error*=1.-r*r;
+109
+110
}
+111
+112
done:
+113
+114
/* slightly damp the filter */
+115
{
+116
double g = .99;
+117
double damp = g;
+118
for(j=0;j<m;j++){
+119
lpc[j]*=damp;
+120
damp*=g;
+121
}
+122
}
+123
+124
for(j=0;j<m;j++)lpci[j]=(float)lpc[j];
+125
+126
/* we need the error value to know how big an impulse to hit the
+127
filter with later */
+128
+129
return error;
+130
}
+131
+132
void vorbis_lpc_predict(float *coeff,float *prime,int m,
+133
float *data,long n){
+134
+135
/* in: coeff[0...m-1] LPC coefficients
+136
prime[0...m-1] initial values (allocated size of n+m-1)
+137
out: data[0...n-1] data samples */
+138
+139
long i,j,o,p;
+140
float y;
+141
float *work=alloca(sizeof(*work)*(m+n));
+142
+143
if(!prime)
+144
for(i=0;i<m;i++)
+145
work[i]=0.f;
+146
else
+147
for(i=0;i<m;i++)
+148
work[i]=prime[i];
+149
+150
for(i=0;i<n;i++){
+151
y=0;
+152
o=i;
+153
p=m;
+154
for(j=0;j<m;j++)
+155
y-=work[o++]*coeff[--p];
+156
+157
data[i]=work[o]=y;
+158
}
+159
}
vendor/vorbis/lib/lpc.hadded
@@ -0,0 +1,28 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 *
+9
* by the Xiph.Org Foundation https://xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: LPC low level routines
+14
+15
********************************************************************/
+16
+17
#ifndef _V_LPC_H_
+18
#define _V_LPC_H_
+19
+20
#include "vorbis/codec.h"
+21
+22
/* simple linear scale LPC code */
+23
extern float vorbis_lpc_from_data(float *data,float *lpc,int n,int m);
+24
+25
extern void vorbis_lpc_predict(float *coeff,float *prime,int m,
+26
float *data,long n);
+27
+28
#endif
vendor/vorbis/lib/lsp.cadded
@@ -0,0 +1,454 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 *
+9
* by the Xiph.Org Foundation https://xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: LSP (also called LSF) conversion routines
+14
+15
The LSP generation code is taken (with minimal modification and a
+16
few bugfixes) from "On the Computation of the LSP Frequencies" by
+17
Joseph Rothweiler (see http://www.rothweiler.us for contact info).
+18
+19
The paper is available at:
+20
+21
https://web.archive.org/web/20110810174000/http://home.myfairpoint.net/vzenxj75/myown1/joe/lsf/index.html
+22
+23
********************************************************************/
+24
+25
/* Note that the lpc-lsp conversion finds the roots of polynomial with
+26
an iterative root polisher (CACM algorithm 283). It *is* possible
+27
to confuse this algorithm into not converging; that should only
+28
happen with absurdly closely spaced roots (very sharp peaks in the
+29
LPC f response) which in turn should be impossible in our use of
+30
the code. If this *does* happen anyway, it's a bug in the floor
+31
finder; find the cause of the confusion (probably a single bin
+32
spike or accidental near-float-limit resolution problems) and
+33
correct it. */
+34
+35
#include <math.h>
+36
#include <string.h>
+37
#include <stdlib.h>
+38
#include "lsp.h"
+39
#include "os.h"
+40
#include "misc.h"
+41
#include "lookup.h"
+42
#include "scales.h"
+43
+44
/* three possible LSP to f curve functions; the exact computation
+45
(float), a lookup based float implementation, and an integer
+46
implementation. The float lookup is likely the optimal choice on
+47
any machine with an FPU. The integer implementation is *not* fixed
+48
point (due to the need for a large dynamic range and thus a
+49
separately tracked exponent) and thus much more complex than the
+50
relatively simple float implementations. It's mostly for future
+51
work on a fully fixed point implementation for processors like the
+52
ARM family. */
+53
+54
/* define either of these (preferably FLOAT_LOOKUP) to have faster
+55
but less precise implementation. */
+56
#undef FLOAT_LOOKUP
+57
#undef INT_LOOKUP
+58
+59
#ifdef FLOAT_LOOKUP
+60
#include "lookup.c" /* catch this in the build system; we #include for
+61
compilers (like gcc) that can't inline across
+62
modules */
+63
+64
/* side effect: changes *lsp to cosines of lsp */
+65
void vorbis_lsp_to_curve(float *curve,int *map,int n,int ln,float *lsp,int m,
+66
float amp,float ampoffset){
+67
int i;
+68
float wdel=M_PI/ln;
+69
vorbis_fpu_control fpu;
+70
+71
vorbis_fpu_setround(&fpu);
+72
for(i=0;i<m;i++)lsp[i]=vorbis_coslook(lsp[i]);
+73
+74
i=0;
+75
while(i<n){
+76
int k=map[i];
+77
int qexp;
+78
float p=.7071067812f;
+79
float q=.7071067812f;
+80
float w=vorbis_coslook(wdel*k);
+81
float *ftmp=lsp;
+82
int c=m>>1;
+83
+84
while(c--){
+85
q*=ftmp[0]-w;
+86
p*=ftmp[1]-w;
+87
ftmp+=2;
+88
}
+89
+90
if(m&1){
+91
/* odd order filter; slightly assymetric */
+92
/* the last coefficient */
+93
q*=ftmp[0]-w;
+94
q*=q;
+95
p*=p*(1.f-w*w);
+96
}else{
+97
/* even order filter; still symmetric */
+98
q*=q*(1.f+w);
+99
p*=p*(1.f-w);
+100
}
+101
+102
q=frexp(p+q,&qexp);
+103
q=vorbis_fromdBlook(amp*
+104
vorbis_invsqlook(q)*
+105
vorbis_invsq2explook(qexp+m)-
+106
ampoffset);
+107
+108
do{
+109
curve[i++]*=q;
+110
}while(map[i]==k);
+111
}
+112
vorbis_fpu_restore(fpu);
+113
}
+114
+115
#else
+116
+117
#ifdef INT_LOOKUP
+118
#include "lookup.c" /* catch this in the build system; we #include for
+119
compilers (like gcc) that can't inline across
+120
modules */
+121
+122
static const int MLOOP_1[64]={
+123
0,10,11,11, 12,12,12,12, 13,13,13,13, 13,13,13,13,
+124
14,14,14,14, 14,14,14,14, 14,14,14,14, 14,14,14,14,
+125
15,15,15,15, 15,15,15,15, 15,15,15,15, 15,15,15,15,
+126
15,15,15,15, 15,15,15,15, 15,15,15,15, 15,15,15,15,
+127
};
+128
+129
static const int MLOOP_2[64]={
+130
0,4,5,5, 6,6,6,6, 7,7,7,7, 7,7,7,7,
+131
8,8,8,8, 8,8,8,8, 8,8,8,8, 8,8,8,8,
+132
9,9,9,9, 9,9,9,9, 9,9,9,9, 9,9,9,9,
+133
9,9,9,9, 9,9,9,9, 9,9,9,9, 9,9,9,9,
+134
};
+135
+136
static const int MLOOP_3[8]={0,1,2,2,3,3,3,3};
+137
+138
+139
/* side effect: changes *lsp to cosines of lsp */
+140
void vorbis_lsp_to_curve(float *curve,int *map,int n,int ln,float *lsp,int m,
+141
float amp,float ampoffset){
+142
+143
/* 0 <= m < 256 */
+144
+145
/* set up for using all int later */
+146
int i;
+147
int ampoffseti=rint(ampoffset*4096.f);
+148
int ampi=rint(amp*16.f);
+149
long *ilsp=alloca(m*sizeof(*ilsp));
+150
for(i=0;i<m;i++)ilsp[i]=vorbis_coslook_i(lsp[i]/M_PI*65536.f+.5f);
+151
+152
i=0;
+153
while(i<n){
+154
int j,k=map[i];
+155
unsigned long pi=46341; /* 2**-.5 in 0.16 */
+156
unsigned long qi=46341;
+157
int qexp=0,shift;
+158
long wi=vorbis_coslook_i(k*65536/ln);
+159
+160
qi*=labs(ilsp[0]-wi);
+161
pi*=labs(ilsp[1]-wi);
+162
+163
for(j=3;j<m;j+=2){
+164
if(!(shift=MLOOP_1[(pi|qi)>>25]))
+165
if(!(shift=MLOOP_2[(pi|qi)>>19]))
+166
shift=MLOOP_3[(pi|qi)>>16];
+167
qi=(qi>>shift)*labs(ilsp[j-1]-wi);
+168
pi=(pi>>shift)*labs(ilsp[j]-wi);
+169
qexp+=shift;
+170
}
+171
if(!(shift=MLOOP_1[(pi|qi)>>25]))
+172
if(!(shift=MLOOP_2[(pi|qi)>>19]))
+173
shift=MLOOP_3[(pi|qi)>>16];
+174
+175
/* pi,qi normalized collectively, both tracked using qexp */
+176
+177
if(m&1){
+178
/* odd order filter; slightly assymetric */
+179
/* the last coefficient */
+180
qi=(qi>>shift)*labs(ilsp[j-1]-wi);
+181
pi=(pi>>shift)<<14;
+182
qexp+=shift;
+183
+184
if(!(shift=MLOOP_1[(pi|qi)>>25]))
+185
if(!(shift=MLOOP_2[(pi|qi)>>19]))
+186
shift=MLOOP_3[(pi|qi)>>16];
+187
+188
pi>>=shift;
+189
qi>>=shift;
+190
qexp+=shift-14*((m+1)>>1);
+191
+192
pi=((pi*pi)>>16);
+193
qi=((qi*qi)>>16);
+194
qexp=qexp*2+m;
+195
+196
pi*=(1<<14)-((wi*wi)>>14);
+197
qi+=pi>>14;
+198
+199
}else{
+200
/* even order filter; still symmetric */
+201
+202
/* p*=p(1-w), q*=q(1+w), let normalization drift because it isn't
+203
worth tracking step by step */
+204
+205
pi>>=shift;
+206
qi>>=shift;
+207
qexp+=shift-7*m;
+208
+209
pi=((pi*pi)>>16);
+210
qi=((qi*qi)>>16);
+211
qexp=qexp*2+m;
+212
+213
pi*=(1<<14)-wi;
+214
qi*=(1<<14)+wi;
+215
qi=(qi+pi)>>14;
+216
+217
}
+218
+219
+220
/* we've let the normalization drift because it wasn't important;
+221
however, for the lookup, things must be normalized again. We
+222
need at most one right shift or a number of left shifts */
+223
+224
if(qi&0xffff0000){ /* checks for 1.xxxxxxxxxxxxxxxx */
+225
qi>>=1; qexp++;
+226
}else
+227
while(qi && !(qi&0x8000)){ /* checks for 0.0xxxxxxxxxxxxxxx or less*/
+228
qi<<=1; qexp--;
+229
}
+230
+231
amp=vorbis_fromdBlook_i(ampi* /* n.4 */
+232
vorbis_invsqlook_i(qi,qexp)-
+233
/* m.8, m+n<=8 */
+234
ampoffseti); /* 8.12[0] */
+235
+236
curve[i]*=amp;
+237
while(map[++i]==k)curve[i]*=amp;
+238
}
+239
}
+240
+241
#else
+242
+243
/* old, nonoptimized but simple version for any poor sap who needs to
+244
figure out what the hell this code does, or wants the other
+245
fraction of a dB precision */
+246
+247
/* side effect: changes *lsp to cosines of lsp */
+248
void vorbis_lsp_to_curve(float *curve,int *map,int n,int ln,float *lsp,int m,
+249
float amp,float ampoffset){
+250
int i;
+251
float wdel=M_PI/ln;
+252
for(i=0;i<m;i++)lsp[i]=2.f*cos(lsp[i]);
+253
+254
i=0;
+255
while(i<n){
+256
int j,k=map[i];
+257
float p=.5f;
+258
float q=.5f;
+259
float w=2.f*cos(wdel*k);
+260
for(j=1;j<m;j+=2){
+261
q *= w-lsp[j-1];
+262
p *= w-lsp[j];
+263
}
+264
if(j==m){
+265
/* odd order filter; slightly assymetric */
+266
/* the last coefficient */
+267
q*=w-lsp[j-1];
+268
p*=p*(4.f-w*w);
+269
q*=q;
+270
}else{
+271
/* even order filter; still symmetric */
+272
p*=p*(2.f-w);
+273
q*=q*(2.f+w);
+274
}
+275
+276
q=fromdB(amp/sqrt(p+q)-ampoffset);
+277
+278
curve[i]*=q;
+279
while(map[++i]==k)curve[i]*=q;
+280
}
+281
}
+282
+283
#endif
+284
#endif
+285
+286
static void cheby(float *g, int ord) {
+287
int i, j;
+288
+289
g[0] *= .5f;
+290
for(i=2; i<= ord; i++) {
+291
for(j=ord; j >= i; j--) {
+292
g[j-2] -= g[j];
+293
g[j] += g[j];
+294
}
+295
}
+296
}
+297
+298
static int comp(const void *a,const void *b){
+299
return (*(float *)a<*(float *)b)-(*(float *)a>*(float *)b);
+300
}
+301
+302
/* Newton-Raphson-Maehly actually functioned as a decent root finder,
+303
but there are root sets for which it gets into limit cycles
+304
(exacerbated by zero suppression) and fails. We can't afford to
+305
fail, even if the failure is 1 in 100,000,000, so we now use
+306
Laguerre and later polish with Newton-Raphson (which can then
+307
afford to fail) */
+308
+309
#define EPSILON 10e-7
+310
static int Laguerre_With_Deflation(float *a,int ord,float *r){
+311
int i,m;
+312
double *defl=alloca(sizeof(*defl)*(ord+1));
+313
for(i=0;i<=ord;i++)defl[i]=a[i];
+314
+315
for(m=ord;m>0;m--){
+316
double new=0.f,delta;
+317
+318
/* iterate a root */
+319
while(1){
+320
double p=defl[m],pp=0.f,ppp=0.f,denom;
+321
+322
/* eval the polynomial and its first two derivatives */
+323
for(i=m;i>0;i--){
+324
ppp = new*ppp + pp;
+325
pp = new*pp + p;
+326
p = new*p + defl[i-1];
+327
}
+328
+329
/* Laguerre's method */
+330
denom=(m-1) * ((m-1)*pp*pp - m*p*ppp);
+331
if(denom<0)
+332
return(-1); /* complex root! The LPC generator handed us a bad filter */
+333
+334
if(pp>0){
+335
denom = pp + sqrt(denom);
+336
if(denom<EPSILON)denom=EPSILON;
+337
}else{
+338
denom = pp - sqrt(denom);
+339
if(denom>-(EPSILON))denom=-(EPSILON);
+340
}
+341
+342
delta = m*p/denom;
+343
new -= delta;
+344
+345
if(delta<0.f)delta*=-1;
+346
+347
if(fabs(delta/new)<10e-12)break;
+348
}
+349
+350
r[m-1]=new;
+351
+352
/* forward deflation */
+353
+354
for(i=m;i>0;i--)
+355
defl[i-1]+=new*defl[i];
+356
defl++;
+357
+358
}
+359
return(0);
+360
}
+361
+362
+363
/* for spit-and-polish only */
+364
static int Newton_Raphson(float *a,int ord,float *r){
+365
int i, k, count=0;
+366
double error=1.f;
+367
double *root=alloca(ord*sizeof(*root));
+368
+369
for(i=0; i<ord;i++) root[i] = r[i];
+370
+371
while(error>1e-20){
+372
error=0;
+373
+374
for(i=0; i<ord; i++) { /* Update each point. */
+375
double pp=0.,delta;
+376
double rooti=root[i];
+377
double p=a[ord];
+378
for(k=ord-1; k>= 0; k--) {
+379
+380
pp= pp* rooti + p;
+381
p = p * rooti + a[k];
+382
}
+383
+384
delta = p/pp;
+385
root[i] -= delta;
+386
error+= delta*delta;
+387
}
+388
+389
if(count>40)return(-1);
+390
+391
count++;
+392
}
+393
+394
/* Replaced the original bubble sort with a real sort. With your
+395
help, we can eliminate the bubble sort in our lifetime. --Monty */
+396
+397
for(i=0; i<ord;i++) r[i] = root[i];
+398
return(0);
+399
}
+400
+401
+402
/* Convert lpc coefficients to lsp coefficients */
+403
int vorbis_lpc_to_lsp(float *lpc,float *lsp,int m){
+404
int order2=(m+1)>>1;
+405
int g1_order,g2_order;
+406
float *g1=alloca(sizeof(*g1)*(order2+1));
+407
float *g2=alloca(sizeof(*g2)*(order2+1));
+408
float *g1r=alloca(sizeof(*g1r)*(order2+1));
+409
float *g2r=alloca(sizeof(*g2r)*(order2+1));
+410
int i;
+411
+412
/* even and odd are slightly different base cases */
+413
g1_order=(m+1)>>1;
+414
g2_order=(m) >>1;
+415
+416
/* Compute the lengths of the x polynomials. */
+417
/* Compute the first half of K & R F1 & F2 polynomials. */
+418
/* Compute half of the symmetric and antisymmetric polynomials. */
+419
/* Remove the roots at +1 and -1. */
+420
+421
g1[g1_order] = 1.f;
+422
for(i=1;i<=g1_order;i++) g1[g1_order-i] = lpc[i-1]+lpc[m-i];
+423
g2[g2_order] = 1.f;
+424
for(i=1;i<=g2_order;i++) g2[g2_order-i] = lpc[i-1]-lpc[m-i];
+425
+426
if(g1_order>g2_order){
+427
for(i=2; i<=g2_order;i++) g2[g2_order-i] += g2[g2_order-i+2];
+428
}else{
+429
for(i=1; i<=g1_order;i++) g1[g1_order-i] -= g1[g1_order-i+1];
+430
for(i=1; i<=g2_order;i++) g2[g2_order-i] += g2[g2_order-i+1];
+431
}
+432
+433
/* Convert into polynomials in cos(alpha) */
+434
cheby(g1,g1_order);
+435
cheby(g2,g2_order);
+436
+437
/* Find the roots of the 2 even polynomials.*/
+438
if(Laguerre_With_Deflation(g1,g1_order,g1r) ||
+439
Laguerre_With_Deflation(g2,g2_order,g2r))
+440
return(-1);
+441
+442
Newton_Raphson(g1,g1_order,g1r); /* if it fails, it leaves g1r alone */
+443
Newton_Raphson(g2,g2_order,g2r); /* if it fails, it leaves g2r alone */
+444
+445
qsort(g1r,g1_order,sizeof(*g1r),comp);
+446
qsort(g2r,g2_order,sizeof(*g2r),comp);
+447
+448
for(i=0;i<g1_order;i++)
+449
lsp[i*2] = acos(g1r[i]);
+450
+451
for(i=0;i<g2_order;i++)
+452
lsp[i*2+1] = acos(g2r[i]);
+453
return(0);
+454
}
vendor/vorbis/lib/lsp.hadded
@@ -0,0 +1,27 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 *
+9
* by the Xiph.Org Foundation https://xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: LSP (also called LSF) conversion routines
+14
+15
********************************************************************/
+16
+17
+18
#ifndef _V_LSP_H_
+19
#define _V_LSP_H_
+20
+21
extern int vorbis_lpc_to_lsp(float *lpc,float *lsp,int m);
+22
+23
extern void vorbis_lsp_to_curve(float *curve,int *map,int n,int ln,
+24
float *lsp,int m,
+25
float amp,float ampoffset);
+26
+27
#endif
vendor/vorbis/lib/mapping0.cadded
@@ -0,0 +1,808 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2010 *
+9
* by the Xiph.Org Foundation https://xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: channel mapping 0 implementation
+14
+15
********************************************************************/
+16
+17
#include <stdlib.h>
+18
#include <stdio.h>
+19
#include <string.h>
+20
#include <math.h>
+21
#include <ogg/ogg.h>
+22
#include "vorbis/codec.h"
+23
#include "codec_internal.h"
+24
#include "codebook.h"
+25
#include "window.h"
+26
#include "registry.h"
+27
#include "psy.h"
+28
#include "misc.h"
+29
+30
/* simplistic, wasteful way of doing this (unique lookup for each
+31
mode/submapping); there should be a central repository for
+32
identical lookups. That will require minor work, so I'm putting it
+33
off as low priority.
+34
+35
Why a lookup for each backend in a given mode? Because the
+36
blocksize is set by the mode, and low backend lookups may require
+37
parameters from other areas of the mode/mapping */
+38
+39
static void mapping0_free_info(vorbis_info_mapping *i){
+40
vorbis_info_mapping0 *info=(vorbis_info_mapping0 *)i;
+41
if(info){
+42
memset(info,0,sizeof(*info));
+43
_ogg_free(info);
+44
}
+45
}
+46
+47
static void mapping0_pack(vorbis_info *vi,vorbis_info_mapping *vm,
+48
oggpack_buffer *opb){
+49
int i;
+50
vorbis_info_mapping0 *info=(vorbis_info_mapping0 *)vm;
+51
+52
/* another 'we meant to do it this way' hack... up to beta 4, we
+53
packed 4 binary zeros here to signify one submapping in use. We
+54
now redefine that to mean four bitflags that indicate use of
+55
deeper features; bit0:submappings, bit1:coupling,
+56
bit2,3:reserved. This is backward compatable with all actual uses
+57
of the beta code. */
+58
+59
if(info->submaps>1){
+60
oggpack_write(opb,1,1);
+61
oggpack_write(opb,info->submaps-1,4);
+62
}else
+63
oggpack_write(opb,0,1);
+64
+65
if(info->coupling_steps>0){
+66
oggpack_write(opb,1,1);
+67
oggpack_write(opb,info->coupling_steps-1,8);
+68
+69
for(i=0;i<info->coupling_steps;i++){
+70
oggpack_write(opb,info->coupling_mag[i],ov_ilog(vi->channels-1));
+71
oggpack_write(opb,info->coupling_ang[i],ov_ilog(vi->channels-1));
+72
}
+73
}else
+74
oggpack_write(opb,0,1);
+75
+76
oggpack_write(opb,0,2); /* 2,3:reserved */
+77
+78
/* we don't write the channel submappings if we only have one... */
+79
if(info->submaps>1){
+80
for(i=0;i<vi->channels;i++)
+81
oggpack_write(opb,info->chmuxlist[i],4);
+82
}
+83
for(i=0;i<info->submaps;i++){
+84
oggpack_write(opb,0,8); /* time submap unused */
+85
oggpack_write(opb,info->floorsubmap[i],8);
+86
oggpack_write(opb,info->residuesubmap[i],8);
+87
}
+88
}
+89
+90
/* also responsible for range checking */
+91
static vorbis_info_mapping *mapping0_unpack(vorbis_info *vi,oggpack_buffer *opb){
+92
int i,b;
+93
vorbis_info_mapping0 *info=_ogg_calloc(1,sizeof(*info));
+94
codec_setup_info *ci=vi->codec_setup;
+95
if(vi->channels<=0)goto err_out;
+96
+97
b=oggpack_read(opb,1);
+98
if(b<0)goto err_out;
+99
if(b){
+100
info->submaps=oggpack_read(opb,4)+1;
+101
if(info->submaps<=0)goto err_out;
+102
}else
+103
info->submaps=1;
+104
+105
b=oggpack_read(opb,1);
+106
if(b<0)goto err_out;
+107
if(b){
+108
info->coupling_steps=oggpack_read(opb,8)+1;
+109
if(info->coupling_steps<=0)goto err_out;
+110
for(i=0;i<info->coupling_steps;i++){
+111
/* vi->channels > 0 is enforced in the caller */
+112
int testM=info->coupling_mag[i]=
+113
oggpack_read(opb,ov_ilog(vi->channels-1));
+114
int testA=info->coupling_ang[i]=
+115
oggpack_read(opb,ov_ilog(vi->channels-1));
+116
+117
if(testM<0 ||
+118
testA<0 ||
+119
testM==testA ||
+120
testM>=vi->channels ||
+121
testA>=vi->channels) goto err_out;
+122
}
+123
+124
}
+125
+126
if(oggpack_read(opb,2)!=0)goto err_out; /* 2,3:reserved */
+127
+128
if(info->submaps>1){
+129
for(i=0;i<vi->channels;i++){
+130
info->chmuxlist[i]=oggpack_read(opb,4);
+131
if(info->chmuxlist[i]>=info->submaps || info->chmuxlist[i]<0)goto err_out;
+132
}
+133
}
+134
for(i=0;i<info->submaps;i++){
+135
oggpack_read(opb,8); /* time submap unused */
+136
info->floorsubmap[i]=oggpack_read(opb,8);
+137
if(info->floorsubmap[i]>=ci->floors || info->floorsubmap[i]<0)goto err_out;
+138
info->residuesubmap[i]=oggpack_read(opb,8);
+139
if(info->residuesubmap[i]>=ci->residues || info->residuesubmap[i]<0)goto err_out;
+140
}
+141
+142
return info;
+143
+144
err_out:
+145
mapping0_free_info(info);
+146
return(NULL);
+147
}
+148
+149
#include "os.h"
+150
#include "lpc.h"
+151
#include "lsp.h"
+152
#include "envelope.h"
+153
#include "mdct.h"
+154
#include "psy.h"
+155
#include "scales.h"
+156
+157
#if 0
+158
static long seq=0;
+159
static ogg_int64_t total=0;
+160
static float FLOOR1_fromdB_LOOKUP[256]={
+161
1.0649863e-07F, 1.1341951e-07F, 1.2079015e-07F, 1.2863978e-07F,
+162
1.3699951e-07F, 1.4590251e-07F, 1.5538408e-07F, 1.6548181e-07F,
+163
1.7623575e-07F, 1.8768855e-07F, 1.9988561e-07F, 2.128753e-07F,
+164
2.2670913e-07F, 2.4144197e-07F, 2.5713223e-07F, 2.7384213e-07F,
+165
2.9163793e-07F, 3.1059021e-07F, 3.3077411e-07F, 3.5226968e-07F,
+166
3.7516214e-07F, 3.9954229e-07F, 4.2550680e-07F, 4.5315863e-07F,
+167
4.8260743e-07F, 5.1396998e-07F, 5.4737065e-07F, 5.8294187e-07F,
+168
6.2082472e-07F, 6.6116941e-07F, 7.0413592e-07F, 7.4989464e-07F,
+169
7.9862701e-07F, 8.5052630e-07F, 9.0579828e-07F, 9.6466216e-07F,
+170
1.0273513e-06F, 1.0941144e-06F, 1.1652161e-06F, 1.2409384e-06F,
+171
1.3215816e-06F, 1.4074654e-06F, 1.4989305e-06F, 1.5963394e-06F,
+172
1.7000785e-06F, 1.8105592e-06F, 1.9282195e-06F, 2.0535261e-06F,
+173
2.1869758e-06F, 2.3290978e-06F, 2.4804557e-06F, 2.6416497e-06F,
+174
2.8133190e-06F, 2.9961443e-06F, 3.1908506e-06F, 3.3982101e-06F,
+175
3.6190449e-06F, 3.8542308e-06F, 4.1047004e-06F, 4.3714470e-06F,
+176
4.6555282e-06F, 4.9580707e-06F, 5.2802740e-06F, 5.6234160e-06F,
+177
5.9888572e-06F, 6.3780469e-06F, 6.7925283e-06F, 7.2339451e-06F,
+178
7.7040476e-06F, 8.2047000e-06F, 8.7378876e-06F, 9.3057248e-06F,
+179
9.9104632e-06F, 1.0554501e-05F, 1.1240392e-05F, 1.1970856e-05F,
+180
1.2748789e-05F, 1.3577278e-05F, 1.4459606e-05F, 1.5399272e-05F,
+181
1.6400004e-05F, 1.7465768e-05F, 1.8600792e-05F, 1.9809576e-05F,
+182
2.1096914e-05F, 2.2467911e-05F, 2.3928002e-05F, 2.5482978e-05F,
+183
2.7139006e-05F, 2.8902651e-05F, 3.0780908e-05F, 3.2781225e-05F,
+184
3.4911534e-05F, 3.7180282e-05F, 3.9596466e-05F, 4.2169667e-05F,
+185
4.4910090e-05F, 4.7828601e-05F, 5.0936773e-05F, 5.4246931e-05F,
+186
5.7772202e-05F, 6.1526565e-05F, 6.5524908e-05F, 6.9783085e-05F,
+187
7.4317983e-05F, 7.9147585e-05F, 8.4291040e-05F, 8.9768747e-05F,
+188
9.5602426e-05F, 0.00010181521F, 0.00010843174F, 0.00011547824F,
+189
0.00012298267F, 0.00013097477F, 0.00013948625F, 0.00014855085F,
+190
0.00015820453F, 0.00016848555F, 0.00017943469F, 0.00019109536F,
+191
0.00020351382F, 0.00021673929F, 0.00023082423F, 0.00024582449F,
+192
0.00026179955F, 0.00027881276F, 0.00029693158F, 0.00031622787F,
+193
0.00033677814F, 0.00035866388F, 0.00038197188F, 0.00040679456F,
+194
0.00043323036F, 0.00046138411F, 0.00049136745F, 0.00052329927F,
+195
0.00055730621F, 0.00059352311F, 0.00063209358F, 0.00067317058F,
+196
0.00071691700F, 0.00076350630F, 0.00081312324F, 0.00086596457F,
+197
0.00092223983F, 0.00098217216F, 0.0010459992F, 0.0011139742F,
+198
0.0011863665F, 0.0012634633F, 0.0013455702F, 0.0014330129F,
+199
0.0015261382F, 0.0016253153F, 0.0017309374F, 0.0018434235F,
+200
0.0019632195F, 0.0020908006F, 0.0022266726F, 0.0023713743F,
+201
0.0025254795F, 0.0026895994F, 0.0028643847F, 0.0030505286F,
+202
0.0032487691F, 0.0034598925F, 0.0036847358F, 0.0039241906F,
+203
0.0041792066F, 0.0044507950F, 0.0047400328F, 0.0050480668F,
+204
0.0053761186F, 0.0057254891F, 0.0060975636F, 0.0064938176F,
+205
0.0069158225F, 0.0073652516F, 0.0078438871F, 0.0083536271F,
+206
0.0088964928F, 0.009474637F, 0.010090352F, 0.010746080F,
+207
0.011444421F, 0.012188144F, 0.012980198F, 0.013823725F,
+208
0.014722068F, 0.015678791F, 0.016697687F, 0.017782797F,
+209
0.018938423F, 0.020169149F, 0.021479854F, 0.022875735F,
+210
0.024362330F, 0.025945531F, 0.027631618F, 0.029427276F,
+211
0.031339626F, 0.033376252F, 0.035545228F, 0.037855157F,
+212
0.040315199F, 0.042935108F, 0.045725273F, 0.048696758F,
+213
0.051861348F, 0.055231591F, 0.058820850F, 0.062643361F,
+214
0.066714279F, 0.071049749F, 0.075666962F, 0.080584227F,
+215
0.085821044F, 0.091398179F, 0.097337747F, 0.10366330F,
+216
0.11039993F, 0.11757434F, 0.12521498F, 0.13335215F,
+217
0.14201813F, 0.15124727F, 0.16107617F, 0.17154380F,
+218
0.18269168F, 0.19456402F, 0.20720788F, 0.22067342F,
+219
0.23501402F, 0.25028656F, 0.26655159F, 0.28387361F,
+220
0.30232132F, 0.32196786F, 0.34289114F, 0.36517414F,
+221
0.38890521F, 0.41417847F, 0.44109412F, 0.46975890F,
+222
0.50028648F, 0.53279791F, 0.56742212F, 0.60429640F,
+223
0.64356699F, 0.68538959F, 0.72993007F, 0.77736504F,
+224
0.82788260F, 0.88168307F, 0.9389798F, 1.F,
+225
};
+226
+227
#endif
+228
+229
+230
static int mapping0_forward(vorbis_block *vb){
+231
vorbis_dsp_state *vd=vb->vd;
+232
vorbis_info *vi=vd->vi;
+233
codec_setup_info *ci=vi->codec_setup;
+234
private_state *b=vb->vd->backend_state;
+235
vorbis_block_internal *vbi=(vorbis_block_internal *)vb->internal;
+236
int n=vb->pcmend;
+237
int i,j,k;
+238
+239
int *nonzero = alloca(sizeof(*nonzero)*vi->channels);
+240
float **gmdct = _vorbis_block_alloc(vb,vi->channels*sizeof(*gmdct));
+241
int **iwork = _vorbis_block_alloc(vb,vi->channels*sizeof(*iwork));
+242
int ***floor_posts = _vorbis_block_alloc(vb,vi->channels*sizeof(*floor_posts));
+243
+244
float global_ampmax=vbi->ampmax;
+245
float *local_ampmax=alloca(sizeof(*local_ampmax)*vi->channels);
+246
int blocktype=vbi->blocktype;
+247
+248
int modenumber=vb->W;
+249
vorbis_info_mapping0 *info=ci->map_param[modenumber];
+250
vorbis_look_psy *psy_look=b->psy+blocktype+(vb->W?2:0);
+251
+252
vb->mode=modenumber;
+253
+254
for(i=0;i<vi->channels;i++){
+255
float scale=4.f/n;
+256
float scale_dB;
+257
+258
float *pcm =vb->pcm[i];
+259
float *logfft =pcm;
+260
+261
iwork[i]=_vorbis_block_alloc(vb,n/2*sizeof(**iwork));
+262
gmdct[i]=_vorbis_block_alloc(vb,n/2*sizeof(**gmdct));
+263
+264
scale_dB=todB(&scale) + .345; /* + .345 is a hack; the original
+265
todB estimation used on IEEE 754
+266
compliant machines had a bug that
+267
returned dB values about a third
+268
of a decibel too high. The bug
+269
was harmless because tunings
+270
implicitly took that into
+271
account. However, fixing the bug
+272
in the estimator requires
+273
changing all the tunings as well.
+274
For now, it's easier to sync
+275
things back up here, and
+276
recalibrate the tunings in the
+277
next major model upgrade. */
+278
+279
#if 0
+280
if(vi->channels==2){
+281
if(i==0)
+282
_analysis_output("pcmL",seq,pcm,n,0,0,total-n/2);
+283
else
+284
_analysis_output("pcmR",seq,pcm,n,0,0,total-n/2);
+285
}else{
+286
_analysis_output("pcm",seq,pcm,n,0,0,total-n/2);
+287
}
+288
#endif
+289
+290
/* window the PCM data */
+291
_vorbis_apply_window(pcm,b->window,ci->blocksizes,vb->lW,vb->W,vb->nW);
+292
+293
#if 0
+294
if(vi->channels==2){
+295
if(i==0)
+296
_analysis_output("windowedL",seq,pcm,n,0,0,total-n/2);
+297
else
+298
_analysis_output("windowedR",seq,pcm,n,0,0,total-n/2);
+299
}else{
+300
_analysis_output("windowed",seq,pcm,n,0,0,total-n/2);
+301
}
+302
#endif
+303
+304
/* transform the PCM data */
+305
/* only MDCT right now.... */
+306
mdct_forward(b->transform[vb->W][0],pcm,gmdct[i]);
+307
+308
/* FFT yields more accurate tonal estimation (not phase sensitive) */
+309
drft_forward(&b->fft_look[vb->W],pcm);
+310
logfft[0]=scale_dB+todB(pcm) + .345; /* + .345 is a hack; the
+311
original todB estimation used on
+312
IEEE 754 compliant machines had a
+313
bug that returned dB values about
+314
a third of a decibel too high.
+315
The bug was harmless because
+316
tunings implicitly took that into
+317
account. However, fixing the bug
+318
in the estimator requires
+319
changing all the tunings as well.
+320
For now, it's easier to sync
+321
things back up here, and
+322
recalibrate the tunings in the
+323
next major model upgrade. */
+324
local_ampmax[i]=logfft[0];
+325
for(j=1;j<n-1;j+=2){
+326
float temp=pcm[j]*pcm[j]+pcm[j+1]*pcm[j+1];
+327
temp=logfft[(j+1)>>1]=scale_dB+.5f*todB(&temp) + .345; /* +
+328
.345 is a hack; the original todB
+329
estimation used on IEEE 754
+330
compliant machines had a bug that
+331
returned dB values about a third
+332
of a decibel too high. The bug
+333
was harmless because tunings
+334
implicitly took that into
+335
account. However, fixing the bug
+336
in the estimator requires
+337
changing all the tunings as well.
+338
For now, it's easier to sync
+339
things back up here, and
+340
recalibrate the tunings in the
+341
next major model upgrade. */
+342
if(temp>local_ampmax[i])local_ampmax[i]=temp;
+343
}
+344
+345
if(local_ampmax[i]>0.f)local_ampmax[i]=0.f;
+346
if(local_ampmax[i]>global_ampmax)global_ampmax=local_ampmax[i];
+347
+348
#if 0
+349
if(vi->channels==2){
+350
if(i==0){
+351
_analysis_output("fftL",seq,logfft,n/2,1,0,0);
+352
}else{
+353
_analysis_output("fftR",seq,logfft,n/2,1,0,0);
+354
}
+355
}else{
+356
_analysis_output("fft",seq,logfft,n/2,1,0,0);
+357
}
+358
#endif
+359
+360
}
+361
+362
{
+363
float *noise = _vorbis_block_alloc(vb,n/2*sizeof(*noise));
+364
float *tone = _vorbis_block_alloc(vb,n/2*sizeof(*tone));
+365
+366
for(i=0;i<vi->channels;i++){
+367
/* the encoder setup assumes that all the modes used by any
+368
specific bitrate tweaking use the same floor */
+369
+370
int submap=info->chmuxlist[i];
+371
+372
/* the following makes things clearer to *me* anyway */
+373
float *mdct =gmdct[i];
+374
float *logfft =vb->pcm[i];
+375
+376
float *logmdct =logfft+n/2;
+377
float *logmask =logfft;
+378
+379
vb->mode=modenumber;
+380
+381
floor_posts[i]=_vorbis_block_alloc(vb,PACKETBLOBS*sizeof(**floor_posts));
+382
memset(floor_posts[i],0,sizeof(**floor_posts)*PACKETBLOBS);
+383
+384
for(j=0;j<n/2;j++)
+385
logmdct[j]=todB(mdct+j) + .345; /* + .345 is a hack; the original
+386
todB estimation used on IEEE 754
+387
compliant machines had a bug that
+388
returned dB values about a third
+389
of a decibel too high. The bug
+390
was harmless because tunings
+391
implicitly took that into
+392
account. However, fixing the bug
+393
in the estimator requires
+394
changing all the tunings as well.
+395
For now, it's easier to sync
+396
things back up here, and
+397
recalibrate the tunings in the
+398
next major model upgrade. */
+399
+400
#if 0
+401
if(vi->channels==2){
+402
if(i==0)
+403
_analysis_output("mdctL",seq,logmdct,n/2,1,0,0);
+404
else
+405
_analysis_output("mdctR",seq,logmdct,n/2,1,0,0);
+406
}else{
+407
_analysis_output("mdct",seq,logmdct,n/2,1,0,0);
+408
}
+409
#endif
+410
+411
/* first step; noise masking. Not only does 'noise masking'
+412
give us curves from which we can decide how much resolution
+413
to give noise parts of the spectrum, it also implicitly hands
+414
us a tonality estimate (the larger the value in the
+415
'noise_depth' vector, the more tonal that area is) */
+416
+417
_vp_noisemask(psy_look,
+418
logmdct,
+419
noise); /* noise does not have by-frequency offset
+420
bias applied yet */
+421
#if 0
+422
if(vi->channels==2){
+423
if(i==0)
+424
_analysis_output("noiseL",seq,noise,n/2,1,0,0);
+425
else
+426
_analysis_output("noiseR",seq,noise,n/2,1,0,0);
+427
}else{
+428
_analysis_output("noise",seq,noise,n/2,1,0,0);
+429
}
+430
#endif
+431
+432
/* second step: 'all the other crap'; all the stuff that isn't
+433
computed/fit for bitrate management goes in the second psy
+434
vector. This includes tone masking, peak limiting and ATH */
+435
+436
_vp_tonemask(psy_look,
+437
logfft,
+438
tone,
+439
global_ampmax,
+440
local_ampmax[i]);
+441
+442
#if 0
+443
if(vi->channels==2){
+444
if(i==0)
+445
_analysis_output("toneL",seq,tone,n/2,1,0,0);
+446
else
+447
_analysis_output("toneR",seq,tone,n/2,1,0,0);
+448
}else{
+449
_analysis_output("tone",seq,tone,n/2,1,0,0);
+450
}
+451
#endif
+452
+453
/* third step; we offset the noise vectors, overlay tone
+454
masking. We then do a floor1-specific line fit. If we're
+455
performing bitrate management, the line fit is performed
+456
multiple times for up/down tweakage on demand. */
+457
+458
#if 0
+459
{
+460
float aotuv[psy_look->n];
+461
#endif
+462
+463
_vp_offset_and_mix(psy_look,
+464
noise,
+465
tone,
+466
1,
+467
logmask,
+468
mdct,
+469
logmdct);
+470
+471
#if 0
+472
if(vi->channels==2){
+473
if(i==0)
+474
_analysis_output("aotuvM1_L",seq,aotuv,psy_look->n,1,1,0);
+475
else
+476
_analysis_output("aotuvM1_R",seq,aotuv,psy_look->n,1,1,0);
+477
}else{
+478
_analysis_output("aotuvM1",seq,aotuv,psy_look->n,1,1,0);
+479
}
+480
}
+481
#endif
+482
+483
+484
#if 0
+485
if(vi->channels==2){
+486
if(i==0)
+487
_analysis_output("mask1L",seq,logmask,n/2,1,0,0);
+488
else
+489
_analysis_output("mask1R",seq,logmask,n/2,1,0,0);
+490
}else{
+491
_analysis_output("mask1",seq,logmask,n/2,1,0,0);
+492
}
+493
#endif
+494
+495
/* this algorithm is hardwired to floor 1 for now; abort out if
+496
we're *not* floor1. This won't happen unless someone has
+497
broken the encode setup lib. Guard it anyway. */
+498
if(ci->floor_type[info->floorsubmap[submap]]!=1)return(-1);
+499

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
@@ -0,0 +1,784 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 *
+9
* by the Xiph.Org Foundation https://xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: masking curve data for psychoacoustics
+14
+15
********************************************************************/
+16
+17
#ifndef _V_MASKING_H_
+18
#define _V_MASKING_H_
+19
+20
/* more detailed ATH; the bass if flat to save stressing the floor
+21
overly for only a bin or two of savings. */
+22
+23
#define MAX_ATH 88
+24
static const float ATH[]={
+25
/*15*/ -51, -52, -53, -54, -55, -56, -57, -58,
+26
/*31*/ -59, -60, -61, -62, -63, -64, -65, -66,
+27
/*63*/ -67, -68, -69, -70, -71, -72, -73, -74,
+28
/*125*/ -75, -76, -77, -78, -80, -81, -82, -83,
+29
/*250*/ -84, -85, -86, -87, -88, -88, -89, -89,
+30
/*500*/ -90, -91, -91, -92, -93, -94, -95, -96,
+31
/*1k*/ -96, -97, -98, -98, -99, -99,-100,-100,
+32
/*2k*/ -101,-102,-103,-104,-106,-107,-107,-107,
+33
/*4k*/ -107,-105,-103,-102,-101, -99, -98, -96,
+34
/*8k*/ -95, -95, -96, -97, -96, -95, -93, -90,
+35
/*16k*/ -80, -70, -50, -40, -30, -30, -30, -30
+36
};
+37
+38
/* The tone masking curves from Ehmer's and Fielder's papers have been
+39
replaced by an empirically collected data set. The previously
+40
published values were, far too often, simply on crack. */
+41
+42
#define EHMER_OFFSET 16
+43
#define EHMER_MAX 56
+44
+45
/* masking tones from -50 to 0dB, 62.5 through 16kHz at half octaves
+46
test tones from -2 octaves to +5 octaves sampled at eighth octaves */
+47
/* (Vorbis 0dB, the loudest possible tone, is assumed to be ~100dB SPL
+48
for collection of these curves) */
+49
+50
static const float tonemasks[P_BANDS][6][EHMER_MAX]={
+51
/* 62.5 Hz */
+52
{{ -60, -60, -60, -60, -60, -60, -60, -60,
+53
-60, -60, -60, -60, -62, -62, -65, -73,
+54
-69, -68, -68, -67, -70, -70, -72, -74,
+55
-75, -79, -79, -80, -83, -88, -93, -100,
+56
-110, -999, -999, -999, -999, -999, -999, -999,
+57
-999, -999, -999, -999, -999, -999, -999, -999,
+58
-999, -999, -999, -999, -999, -999, -999, -999},
+59
{ -48, -48, -48, -48, -48, -48, -48, -48,
+60
-48, -48, -48, -48, -48, -53, -61, -66,
+61
-66, -68, -67, -70, -76, -76, -72, -73,
+62
-75, -76, -78, -79, -83, -88, -93, -100,
+63
-110, -999, -999, -999, -999, -999, -999, -999,
+64
-999, -999, -999, -999, -999, -999, -999, -999,
+65
-999, -999, -999, -999, -999, -999, -999, -999},
+66
{ -37, -37, -37, -37, -37, -37, -37, -37,
+67
-38, -40, -42, -46, -48, -53, -55, -62,
+68
-65, -58, -56, -56, -61, -60, -65, -67,
+69
-69, -71, -77, -77, -78, -80, -82, -84,
+70
-88, -93, -98, -106, -112, -999, -999, -999,
+71
-999, -999, -999, -999, -999, -999, -999, -999,
+72
-999, -999, -999, -999, -999, -999, -999, -999},
+73
{ -25, -25, -25, -25, -25, -25, -25, -25,
+74
-25, -26, -27, -29, -32, -38, -48, -52,
+75
-52, -50, -48, -48, -51, -52, -54, -60,
+76
-67, -67, -66, -68, -69, -73, -73, -76,
+77
-80, -81, -81, -85, -85, -86, -88, -93,
+78
-100, -110, -999, -999, -999, -999, -999, -999,
+79
-999, -999, -999, -999, -999, -999, -999, -999},
+80
{ -16, -16, -16, -16, -16, -16, -16, -16,
+81
-17, -19, -20, -22, -26, -28, -31, -40,
+82
-47, -39, -39, -40, -42, -43, -47, -51,
+83
-57, -52, -55, -55, -60, -58, -62, -63,
+84
-70, -67, -69, -72, -73, -77, -80, -82,
+85
-83, -87, -90, -94, -98, -104, -115, -999,
+86
-999, -999, -999, -999, -999, -999, -999, -999},
+87
{ -8, -8, -8, -8, -8, -8, -8, -8,
+88
-8, -8, -10, -11, -15, -19, -25, -30,
+89
-34, -31, -30, -31, -29, -32, -35, -42,
+90
-48, -42, -44, -46, -50, -50, -51, -52,
+91
-59, -54, -55, -55, -58, -62, -63, -66,
+92
-72, -73, -76, -75, -78, -80, -80, -81,
+93
-84, -88, -90, -94, -98, -101, -106, -110}},
+94
/* 88Hz */
+95
{{ -66, -66, -66, -66, -66, -66, -66, -66,
+96
-66, -66, -66, -66, -66, -67, -67, -67,
+97
-76, -72, -71, -74, -76, -76, -75, -78,
+98
-79, -79, -81, -83, -86, -89, -93, -97,
+99
-100, -105, -110, -999, -999, -999, -999, -999,
+100
-999, -999, -999, -999, -999, -999, -999, -999,
+101
-999, -999, -999, -999, -999, -999, -999, -999},
+102
{ -47, -47, -47, -47, -47, -47, -47, -47,
+103
-47, -47, -47, -48, -51, -55, -59, -66,
+104
-66, -66, -67, -66, -68, -69, -70, -74,
+105
-79, -77, -77, -78, -80, -81, -82, -84,
+106
-86, -88, -91, -95, -100, -108, -116, -999,
+107
-999, -999, -999, -999, -999, -999, -999, -999,
+108
-999, -999, -999, -999, -999, -999, -999, -999},
+109
{ -36, -36, -36, -36, -36, -36, -36, -36,
+110
-36, -37, -37, -41, -44, -48, -51, -58,
+111
-62, -60, -57, -59, -59, -60, -63, -65,
+112
-72, -71, -70, -72, -74, -77, -76, -78,
+113
-81, -81, -80, -83, -86, -91, -96, -100,
+114
-105, -110, -999, -999, -999, -999, -999, -999,
+115
-999, -999, -999, -999, -999, -999, -999, -999},
+116
{ -28, -28, -28, -28, -28, -28, -28, -28,
+117
-28, -30, -32, -32, -33, -35, -41, -49,
+118
-50, -49, -47, -48, -48, -52, -51, -57,
+119
-65, -61, -59, -61, -64, -69, -70, -74,
+120
-77, -77, -78, -81, -84, -85, -87, -90,
+121
-92, -96, -100, -107, -112, -999, -999, -999,
+122
-999, -999, -999, -999, -999, -999, -999, -999},
+123
{ -19, -19, -19, -19, -19, -19, -19, -19,
+124
-20, -21, -23, -27, -30, -35, -36, -41,
+125
-46, -44, -42, -40, -41, -41, -43, -48,
+126
-55, -53, -52, -53, -56, -59, -58, -60,
+127
-67, -66, -69, -71, -72, -75, -79, -81,
+128
-84, -87, -90, -93, -97, -101, -107, -114,
+129
-999, -999, -999, -999, -999, -999, -999, -999},
+130
{ -9, -9, -9, -9, -9, -9, -9, -9,
+131
-11, -12, -12, -15, -16, -20, -23, -30,
+132
-37, -34, -33, -34, -31, -32, -32, -38,
+133
-47, -44, -41, -40, -47, -49, -46, -46,
+134
-58, -50, -50, -54, -58, -62, -64, -67,
+135
-67, -70, -72, -76, -79, -83, -87, -91,
+136
-96, -100, -104, -110, -999, -999, -999, -999}},
+137
/* 125 Hz */
+138
{{ -62, -62, -62, -62, -62, -62, -62, -62,
+139
-62, -62, -63, -64, -66, -67, -66, -68,
+140
-75, -72, -76, -75, -76, -78, -79, -82,
+141
-84, -85, -90, -94, -101, -110, -999, -999,
+142
-999, -999, -999, -999, -999, -999, -999, -999,
+143
-999, -999, -999, -999, -999, -999, -999, -999,
+144
-999, -999, -999, -999, -999, -999, -999, -999},
+145
{ -59, -59, -59, -59, -59, -59, -59, -59,
+146
-59, -59, -59, -60, -60, -61, -63, -66,
+147
-71, -68, -70, -70, -71, -72, -72, -75,
+148
-81, -78, -79, -82, -83, -86, -90, -97,
+149
-103, -113, -999, -999, -999, -999, -999, -999,
+150
-999, -999, -999, -999, -999, -999, -999, -999,
+151
-999, -999, -999, -999, -999, -999, -999, -999},
+152
{ -53, -53, -53, -53, -53, -53, -53, -53,
+153
-53, -54, -55, -57, -56, -57, -55, -61,
+154
-65, -60, -60, -62, -63, -63, -66, -68,
+155
-74, -73, -75, -75, -78, -80, -80, -82,
+156
-85, -90, -96, -101, -108, -999, -999, -999,
+157
-999, -999, -999, -999, -999, -999, -999, -999,
+158
-999, -999, -999, -999, -999, -999, -999, -999},
+159
{ -46, -46, -46, -46, -46, -46, -46, -46,
+160
-46, -46, -47, -47, -47, -47, -48, -51,
+161
-57, -51, -49, -50, -51, -53, -54, -59,
+162
-66, -60, -62, -67, -67, -70, -72, -75,
+163
-76, -78, -81, -85, -88, -94, -97, -104,
+164
-112, -999, -999, -999, -999, -999, -999, -999,
+165
-999, -999, -999, -999, -999, -999, -999, -999},
+166
{ -36, -36, -36, -36, -36, -36, -36, -36,
+167
-39, -41, -42, -42, -39, -38, -41, -43,
+168
-52, -44, -40, -39, -37, -37, -40, -47,
+169
-54, -50, -48, -50, -55, -61, -59, -62,
+170
-66, -66, -66, -69, -69, -73, -74, -74,
+171
-75, -77, -79, -82, -87, -91, -95, -100,
+172
-108, -115, -999, -999, -999, -999, -999, -999},
+173
{ -28, -26, -24, -22, -20, -20, -23, -29,
+174
-30, -31, -28, -27, -28, -28, -28, -35,
+175
-40, -33, -32, -29, -30, -30, -30, -37,
+176
-45, -41, -37, -38, -45, -47, -47, -48,
+177
-53, -49, -48, -50, -49, -49, -51, -52,
+178
-58, -56, -57, -56, -60, -61, -62, -70,
+179
-72, -74, -78, -83, -88, -93, -100, -106}},
+180
/* 177 Hz */
+181
{{-999, -999, -999, -999, -999, -999, -999, -999,
+182
-999, -110, -105, -100, -95, -91, -87, -83,
+183
-80, -78, -76, -78, -78, -81, -83, -85,
+184
-86, -85, -86, -87, -90, -97, -107, -999,
+185
-999, -999, -999, -999, -999, -999, -999, -999,
+186
-999, -999, -999, -999, -999, -999, -999, -999,
+187
-999, -999, -999, -999, -999, -999, -999, -999},
+188
{-999, -999, -999, -110, -105, -100, -95, -90,
+189
-85, -81, -77, -73, -70, -67, -67, -68,
+190
-75, -73, -70, -69, -70, -72, -75, -79,
+191
-84, -83, -84, -86, -88, -89, -89, -93,
+192
-98, -105, -112, -999, -999, -999, -999, -999,
+193
-999, -999, -999, -999, -999, -999, -999, -999,
+194
-999, -999, -999, -999, -999, -999, -999, -999},
+195
{-105, -100, -95, -90, -85, -80, -76, -71,
+196
-68, -68, -65, -63, -63, -62, -62, -64,
+197
-65, -64, -61, -62, -63, -64, -66, -68,
+198
-73, -73, -74, -75, -76, -81, -83, -85,
+199
-88, -89, -92, -95, -100, -108, -999, -999,
+200
-999, -999, -999, -999, -999, -999, -999, -999,
+201
-999, -999, -999, -999, -999, -999, -999, -999},
+202
{ -80, -75, -71, -68, -65, -63, -62, -61,
+203
-61, -61, -61, -59, -56, -57, -53, -50,
+204
-58, -52, -50, -50, -52, -53, -54, -58,
+205
-67, -63, -67, -68, -72, -75, -78, -80,
+206
-81, -81, -82, -85, -89, -90, -93, -97,
+207
-101, -107, -114, -999, -999, -999, -999, -999,
+208
-999, -999, -999, -999, -999, -999, -999, -999},
+209
{ -65, -61, -59, -57, -56, -55, -55, -56,
+210
-56, -57, -55, -53, -52, -47, -44, -44,
+211
-50, -44, -41, -39, -39, -42, -40, -46,
+212
-51, -49, -50, -53, -54, -63, -60, -61,
+213
-62, -66, -66, -66, -70, -73, -74, -75,
+214
-76, -75, -79, -85, -89, -91, -96, -102,
+215
-110, -999, -999, -999, -999, -999, -999, -999},
+216
{ -52, -50, -49, -49, -48, -48, -48, -49,
+217
-50, -50, -49, -46, -43, -39, -35, -33,
+218
-38, -36, -32, -29, -32, -32, -32, -35,
+219
-44, -39, -38, -38, -46, -50, -45, -46,
+220
-53, -50, -50, -50, -54, -54, -53, -53,
+221
-56, -57, -59, -66, -70, -72, -74, -79,
+222
-83, -85, -90, -97, -114, -999, -999, -999}},
+223
/* 250 Hz */
+224
{{-999, -999, -999, -999, -999, -999, -110, -105,
+225
-100, -95, -90, -86, -80, -75, -75, -79,
+226
-80, -79, -80, -81, -82, -88, -95, -103,
+227
-110, -999, -999, -999, -999, -999, -999, -999,
+228
-999, -999, -999, -999, -999, -999, -999, -999,
+229
-999, -999, -999, -999, -999, -999, -999, -999,
+230
-999, -999, -999, -999, -999, -999, -999, -999},
+231
{-999, -999, -999, -999, -108, -103, -98, -93,
+232
-88, -83, -79, -78, -75, -71, -67, -68,
+233
-73, -73, -72, -73, -75, -77, -80, -82,
+234
-88, -93, -100, -107, -114, -999, -999, -999,
+235
-999, -999, -999, -999, -999, -999, -999, -999,
+236
-999, -999, -999, -999, -999, -999, -999, -999,
+237
-999, -999, -999, -999, -999, -999, -999, -999},
+238
{-999, -999, -999, -110, -105, -101, -96, -90,
+239
-86, -81, -77, -73, -69, -66, -61, -62,
+240
-66, -64, -62, -65, -66, -70, -72, -76,
+241
-81, -80, -84, -90, -95, -102, -110, -999,
+242
-999, -999, -999, -999, -999, -999, -999, -999,
+243
-999, -999, -999, -999, -999, -999, -999, -999,
+244
-999, -999, -999, -999, -999, -999, -999, -999},
+245
{-999, -999, -999, -107, -103, -97, -92, -88,
+246
-83, -79, -74, -70, -66, -59, -53, -58,
+247
-62, -55, -54, -54, -54, -58, -61, -62,
+248
-72, -70, -72, -75, -78, -80, -81, -80,
+249
-83, -83, -88, -93, -100, -107, -115, -999,
+250
-999, -999, -999, -999, -999, -999, -999, -999,
+251
-999, -999, -999, -999, -999, -999, -999, -999},
+252
{-999, -999, -999, -105, -100, -95, -90, -85,
+253
-80, -75, -70, -66, -62, -56, -48, -44,
+254
-48, -46, -46, -43, -46, -48, -48, -51,
+255
-58, -58, -59, -60, -62, -62, -61, -61,
+256
-65, -64, -65, -68, -70, -74, -75, -78,
+257
-81, -86, -95, -110, -999, -999, -999, -999,
+258
-999, -999, -999, -999, -999, -999, -999, -999},
+259
{-999, -999, -105, -100, -95, -90, -85, -80,
+260
-75, -70, -65, -61, -55, -49, -39, -33,
+261
-40, -35, -32, -38, -40, -33, -35, -37,
+262
-46, -41, -45, -44, -46, -42, -45, -46,
+263
-52, -50, -50, -50, -54, -54, -55, -57,
+264
-62, -64, -66, -68, -70, -76, -81, -90,
+265
-100, -110, -999, -999, -999, -999, -999, -999}},
+266
/* 354 hz */
+267
{{-999, -999, -999, -999, -999, -999, -999, -999,
+268
-105, -98, -90, -85, -82, -83, -80, -78,
+269
-84, -79, -80, -83, -87, -89, -91, -93,
+270
-99, -106, -117, -999, -999, -999, -999, -999,
+271
-999, -999, -999, -999, -999, -999, -999, -999,
+272
-999, -999, -999, -999, -999, -999, -999, -999,
+273
-999, -999, -999, -999, -999, -999, -999, -999},
+274
{-999, -999, -999, -999, -999, -999, -999, -999,
+275
-105, -98, -90, -85, -80, -75, -70, -68,
+276
-74, -72, -74, -77, -80, -82, -85, -87,
+277
-92, -89, -91, -95, -100, -106, -112, -999,
+278
-999, -999, -999, -999, -999, -999, -999, -999,
+279
-999, -999, -999, -999, -999, -999, -999, -999,
+280
-999, -999, -999, -999, -999, -999, -999, -999},
+281
{-999, -999, -999, -999, -999, -999, -999, -999,
+282
-105, -98, -90, -83, -75, -71, -63, -64,
+283
-67, -62, -64, -67, -70, -73, -77, -81,
+284
-84, -83, -85, -89, -90, -93, -98, -104,
+285
-109, -114, -999, -999, -999, -999, -999, -999,
+286
-999, -999, -999, -999, -999, -999, -999, -999,
+287
-999, -999, -999, -999, -999, -999, -999, -999},
+288
{-999, -999, -999, -999, -999, -999, -999, -999,
+289
-103, -96, -88, -81, -75, -68, -58, -54,
+290
-56, -54, -56, -56, -58, -60, -63, -66,
+291
-74, -69, -72, -72, -75, -74, -77, -81,
+292
-81, -82, -84, -87, -93, -96, -99, -104,
+293
-110, -999, -999, -999, -999, -999, -999, -999,
+294
-999, -999, -999, -999, -999, -999, -999, -999},
+295
{-999, -999, -999, -999, -999, -108, -102, -96,
+296
-91, -85, -80, -74, -68, -60, -51, -46,
+297
-48, -46, -43, -45, -47, -47, -49, -48,
+298
-56, -53, -55, -58, -57, -63, -58, -60,
+299
-66, -64, -67, -70, -70, -74, -77, -84,
+300
-86, -89, -91, -93, -94, -101, -109, -118,
+301
-999, -999, -999, -999, -999, -999, -999, -999},
+302
{-999, -999, -999, -108, -103, -98, -93, -88,
+303
-83, -78, -73, -68, -60, -53, -44, -35,
+304
-38, -38, -34, -34, -36, -40, -41, -44,
+305
-51, -45, -46, -47, -46, -54, -50, -49,
+306
-50, -50, -50, -51, -54, -57, -58, -60,
+307
-66, -66, -66, -64, -65, -68, -77, -82,
+308
-87, -95, -110, -999, -999, -999, -999, -999}},
+309
/* 500 Hz */
+310
{{-999, -999, -999, -999, -999, -999, -999, -999,
+311
-107, -102, -97, -92, -87, -83, -78, -75,
+312
-82, -79, -83, -85, -89, -92, -95, -98,
+313
-101, -105, -109, -113, -999, -999, -999, -999,
+314
-999, -999, -999, -999, -999, -999, -999, -999,
+315
-999, -999, -999, -999, -999, -999, -999, -999,
+316
-999, -999, -999, -999, -999, -999, -999, -999},
+317
{-999, -999, -999, -999, -999, -999, -999, -106,
+318
-100, -95, -90, -86, -81, -78, -74, -69,
+319
-74, -74, -76, -79, -83, -84, -86, -89,
+320
-92, -97, -93, -100, -103, -107, -110, -999,
+321
-999, -999, -999, -999, -999, -999, -999, -999,
+322
-999, -999, -999, -999, -999, -999, -999, -999,
+323
-999, -999, -999, -999, -999, -999, -999, -999},
+324
{-999, -999, -999, -999, -999, -999, -106, -100,
+325
-95, -90, -87, -83, -80, -75, -69, -60,
+326
-66, -66, -68, -70, -74, -78, -79, -81,
+327
-81, -83, -84, -87, -93, -96, -99, -103,
+328
-107, -110, -999, -999, -999, -999, -999, -999,
+329
-999, -999, -999, -999, -999, -999, -999, -999,
+330
-999, -999, -999, -999, -999, -999, -999, -999},
+331
{-999, -999, -999, -999, -999, -108, -103, -98,
+332
-93, -89, -85, -82, -78, -71, -62, -55,
+333
-58, -58, -54, -54, -55, -59, -61, -62,
+334
-70, -66, -66, -67, -70, -72, -75, -78,
+335
-84, -84, -84, -88, -91, -90, -95, -98,
+336
-102, -103, -106, -110, -999, -999, -999, -999,
+337
-999, -999, -999, -999, -999, -999, -999, -999},
+338
{-999, -999, -999, -999, -108, -103, -98, -94,
+339
-90, -87, -82, -79, -73, -67, -58, -47,
+340
-50, -45, -41, -45, -48, -44, -44, -49,
+341
-54, -51, -48, -47, -49, -50, -51, -57,
+342
-58, -60, -63, -69, -70, -69, -71, -74,
+343
-78, -82, -90, -95, -101, -105, -110, -999,
+344
-999, -999, -999, -999, -999, -999, -999, -999},
+345
{-999, -999, -999, -105, -101, -97, -93, -90,
+346
-85, -80, -77, -72, -65, -56, -48, -37,
+347
-40, -36, -34, -40, -50, -47, -38, -41,
+348
-47, -38, -35, -39, -38, -43, -40, -45,
+349
-50, -45, -44, -47, -50, -55, -48, -48,
+350
-52, -66, -70, -76, -82, -90, -97, -105,
+351
-110, -999, -999, -999, -999, -999, -999, -999}},
+352
/* 707 Hz */
+353
{{-999, -999, -999, -999, -999, -999, -999, -999,
+354
-999, -108, -103, -98, -93, -86, -79, -76,
+355
-83, -81, -85, -87, -89, -93, -98, -102,
+356
-107, -112, -999, -999, -999, -999, -999, -999,
+357
-999, -999, -999, -999, -999, -999, -999, -999,
+358
-999, -999, -999, -999, -999, -999, -999, -999,
+359
-999, -999, -999, -999, -999, -999, -999, -999},
+360
{-999, -999, -999, -999, -999, -999, -999, -999,
+361
-999, -108, -103, -98, -93, -86, -79, -71,
+362
-77, -74, -77, -79, -81, -84, -85, -90,
+363
-92, -93, -92, -98, -101, -108, -112, -999,
+364
-999, -999, -999, -999, -999, -999, -999, -999,
+365
-999, -999, -999, -999, -999, -999, -999, -999,
+366
-999, -999, -999, -999, -999, -999, -999, -999},
+367
{-999, -999, -999, -999, -999, -999, -999, -999,
+368
-108, -103, -98, -93, -87, -78, -68, -65,
+369
-66, -62, -65, -67, -70, -73, -75, -78,
+370
-82, -82, -83, -84, -91, -93, -98, -102,
+371
-106, -110, -999, -999, -999, -999, -999, -999,
+372
-999, -999, -999, -999, -999, -999, -999, -999,
+373
-999, -999, -999, -999, -999, -999, -999, -999},
+374
{-999, -999, -999, -999, -999, -999, -999, -999,
+375
-105, -100, -95, -90, -82, -74, -62, -57,
+376
-58, -56, -51, -52, -52, -54, -54, -58,
+377
-66, -59, -60, -63, -66, -69, -73, -79,
+378
-83, -84, -80, -81, -81, -82, -88, -92,
+379
-98, -105, -113, -999, -999, -999, -999, -999,
+380
-999, -999, -999, -999, -999, -999, -999, -999},
+381
{-999, -999, -999, -999, -999, -999, -999, -107,
+382
-102, -97, -92, -84, -79, -69, -57, -47,
+383
-52, -47, -44, -45, -50, -52, -42, -42,
+384
-53, -43, -43, -48, -51, -56, -55, -52,
+385
-57, -59, -61, -62, -67, -71, -78, -83,
+386
-86, -94, -98, -103, -110, -999, -999, -999,
+387
-999, -999, -999, -999, -999, -999, -999, -999},
+388
{-999, -999, -999, -999, -999, -999, -105, -100,
+389
-95, -90, -84, -78, -70, -61, -51, -41,
+390
-40, -38, -40, -46, -52, -51, -41, -40,
+391
-46, -40, -38, -38, -41, -46, -41, -46,
+392
-47, -43, -43, -45, -41, -45, -56, -67,
+393
-68, -83, -87, -90, -95, -102, -107, -113,
+394
-999, -999, -999, -999, -999, -999, -999, -999}},
+395
/* 1000 Hz */
+396
{{-999, -999, -999, -999, -999, -999, -999, -999,
+397
-999, -109, -105, -101, -96, -91, -84, -77,
+398
-82, -82, -85, -89, -94, -100, -106, -110,
+399
-999, -999, -999, -999, -999, -999, -999, -999,
+400
-999, -999, -999, -999, -999, -999, -999, -999,
+401
-999, -999, -999, -999, -999, -999, -999, -999,
+402
-999, -999, -999, -999, -999, -999, -999, -999},
+403
{-999, -999, -999, -999, -999, -999, -999, -999,
+404
-999, -106, -103, -98, -92, -85, -80, -71,
+405
-75, -72, -76, -80, -84, -86, -89, -93,
+406
-100, -107, -113, -999, -999, -999, -999, -999,
+407
-999, -999, -999, -999, -999, -999, -999, -999,
+408
-999, -999, -999, -999, -999, -999, -999, -999,
+409
-999, -999, -999, -999, -999, -999, -999, -999},
+410
{-999, -999, -999, -999, -999, -999, -999, -107,
+411
-104, -101, -97, -92, -88, -84, -80, -64,
+412
-66, -63, -64, -66, -69, -73, -77, -83,
+413
-83, -86, -91, -98, -104, -111, -999, -999,
+414
-999, -999, -999, -999, -999, -999, -999, -999,
+415
-999, -999, -999, -999, -999, -999, -999, -999,
+416
-999, -999, -999, -999, -999, -999, -999, -999},
+417
{-999, -999, -999, -999, -999, -999, -999, -107,
+418
-104, -101, -97, -92, -90, -84, -74, -57,
+419
-58, -52, -55, -54, -50, -52, -50, -52,
+420
-63, -62, -69, -76, -77, -78, -78, -79,
+421
-82, -88, -94, -100, -106, -111, -999, -999,
+422
-999, -999, -999, -999, -999, -999, -999, -999,
+423
-999, -999, -999, -999, -999, -999, -999, -999},
+424
{-999, -999, -999, -999, -999, -999, -106, -102,
+425
-98, -95, -90, -85, -83, -78, -70, -50,
+426
-50, -41, -44, -49, -47, -50, -50, -44,
+427
-55, -46, -47, -48, -48, -54, -49, -49,
+428
-58, -62, -71, -81, -87, -92, -97, -102,
+429
-108, -114, -999, -999, -999, -999, -999, -999,
+430
-999, -999, -999, -999, -999, -999, -999, -999},
+431
{-999, -999, -999, -999, -999, -999, -106, -102,
+432
-98, -95, -90, -85, -83, -78, -70, -45,
+433
-43, -41, -47, -50, -51, -50, -49, -45,
+434
-47, -41, -44, -41, -39, -43, -38, -37,
+435
-40, -41, -44, -50, -58, -65, -73, -79,
+436
-85, -92, -97, -101, -105, -109, -113, -999,
+437
-999, -999, -999, -999, -999, -999, -999, -999}},
+438
/* 1414 Hz */
+439
{{-999, -999, -999, -999, -999, -999, -999, -999,
+440
-999, -999, -999, -107, -100, -95, -87, -81,
+441
-85, -83, -88, -93, -100, -107, -114, -999,
+442
-999, -999, -999, -999, -999, -999, -999, -999,
+443
-999, -999, -999, -999, -999, -999, -999, -999,
+444
-999, -999, -999, -999, -999, -999, -999, -999,
+445
-999, -999, -999, -999, -999, -999, -999, -999},
+446
{-999, -999, -999, -999, -999, -999, -999, -999,
+447
-999, -999, -107, -101, -95, -88, -83, -76,
+448
-73, -72, -79, -84, -90, -95, -100, -105,
+449
-110, -115, -999, -999, -999, -999, -999, -999,
+450
-999, -999, -999, -999, -999, -999, -999, -999,
+451
-999, -999, -999, -999, -999, -999, -999, -999,
+452
-999, -999, -999, -999, -999, -999, -999, -999},
+453
{-999, -999, -999, -999, -999, -999, -999, -999,
+454
-999, -999, -104, -98, -92, -87, -81, -70,
+455
-65, -62, -67, -71, -74, -80, -85, -91,
+456
-95, -99, -103, -108, -111, -114, -999, -999,
+457
-999, -999, -999, -999, -999, -999, -999, -999,
+458
-999, -999, -999, -999, -999, -999, -999, -999,
+459
-999, -999, -999, -999, -999, -999, -999, -999},
+460
{-999, -999, -999, -999, -999, -999, -999, -999,
+461
-999, -999, -103, -97, -90, -85, -76, -60,
+462
-56, -54, -60, -62, -61, -56, -63, -65,
+463
-73, -74, -77, -75, -78, -81, -86, -87,
+464
-88, -91, -94, -98, -103, -110, -999, -999,
+465
-999, -999, -999, -999, -999, -999, -999, -999,
+466
-999, -999, -999, -999, -999, -999, -999, -999},
+467
{-999, -999, -999, -999, -999, -999, -999, -105,
+468
-100, -97, -92, -86, -81, -79, -70, -57,
+469
-51, -47, -51, -58, -60, -56, -53, -50,
+470
-58, -52, -50, -50, -53, -55, -64, -69,
+471
-71, -85, -82, -78, -81, -85, -95, -102,
+472
-112, -999, -999, -999, -999, -999, -999, -999,
+473
-999, -999, -999, -999, -999, -999, -999, -999},
+474
{-999, -999, -999, -999, -999, -999, -999, -105,
+475
-100, -97, -92, -85, -83, -79, -72, -49,
+476
-40, -43, -43, -54, -56, -51, -50, -40,
+477
-43, -38, -36, -35, -37, -38, -37, -44,
+478
-54, -60, -57, -60, -70, -75, -84, -92,
+479
-103, -112, -999, -999, -999, -999, -999, -999,
+480
-999, -999, -999, -999, -999, -999, -999, -999}},
+481
/* 2000 Hz */
+482
{{-999, -999, -999, -999, -999, -999, -999, -999,
+483
-999, -999, -999, -110, -102, -95, -89, -82,
+484
-83, -84, -90, -92, -99, -107, -113, -999,
+485
-999, -999, -999, -999, -999, -999, -999, -999,
+486
-999, -999, -999, -999, -999, -999, -999, -999,
+487
-999, -999, -999, -999, -999, -999, -999, -999,
+488
-999, -999, -999, -999, -999, -999, -999, -999},
+489
{-999, -999, -999, -999, -999, -999, -999, -999,
+490
-999, -999, -107, -101, -95, -89, -83, -72,
+491
-74, -78, -85, -88, -88, -90, -92, -98,
+492
-105, -111, -999, -999, -999, -999, -999, -999,
+493
-999, -999, -999, -999, -999, -999, -999, -999,
+494
-999, -999, -999, -999, -999, -999, -999, -999,
+495
-999, -999, -999, -999, -999, -999, -999, -999},
+496
{-999, -999, -999, -999, -999, -999, -999, -999,
+497
-999, -109, -103, -97, -93, -87, -81, -70,
+498
-70, -67, -75, -73, -76, -79, -81, -83,
+499
-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
@@ -0,0 +1,562 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 *
+9
* by the Xiph.Org Foundation https://xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: normalized modified discrete cosine transform
+14
power of two length transform only [64 <= n ]
+15
+16
Original algorithm adapted long ago from _The use of multirate filter
+17
banks for coding of high quality digital audio_, by T. Sporer,
+18
K. Brandenburg and B. Edler, collection of the European Signal
+19
Processing Conference (EUSIPCO), Amsterdam, June 1992, Vol.1, pp
+20
211-214
+21
+22
The below code implements an algorithm that no longer looks much like
+23
that presented in the paper, but the basic structure remains if you
+24
dig deep enough to see it.
+25
+26
This module DOES NOT INCLUDE code to generate/apply the window
+27
function. Everybody has their own weird favorite including me... I
+28
happen to like the properties of y=sin(.5PI*sin^2(x)), but others may
+29
vehemently disagree.
+30
+31
********************************************************************/
+32
+33
/* this can also be run as an integer transform by uncommenting a
+34
define in mdct.h; the integerization is a first pass and although
+35
it's likely stable for Vorbis, the dynamic range is constrained and
+36
roundoff isn't done (so it's noisy). Consider it functional, but
+37
only a starting point. There's no point on a machine with an FPU */
+38
+39
#include <stdio.h>
+40
#include <stdlib.h>
+41
#include <string.h>
+42
#include <math.h>
+43
#include "vorbis/codec.h"
+44
#include "mdct.h"
+45
#include "os.h"
+46
#include "misc.h"
+47
+48
/* build lookups for trig functions; also pre-figure scaling and
+49
some window function algebra. */
+50
+51
void mdct_init(mdct_lookup *lookup,int n){
+52
int *bitrev=_ogg_malloc(sizeof(*bitrev)*(n/4));
+53
DATA_TYPE *T=_ogg_malloc(sizeof(*T)*(n+n/4));
+54
+55
int i;
+56
int n2=n>>1;
+57
int log2n=lookup->log2n=rint(log((float)n)/log(2.f));
+58
lookup->n=n;
+59
lookup->trig=T;
+60
lookup->bitrev=bitrev;
+61
+62
/* trig lookups... */
+63
+64
for(i=0;i<n/4;i++){
+65
T[i*2]=FLOAT_CONV(cos((M_PI/n)*(4*i)));
+66
T[i*2+1]=FLOAT_CONV(-sin((M_PI/n)*(4*i)));
+67
T[n2+i*2]=FLOAT_CONV(cos((M_PI/(2*n))*(2*i+1)));
+68
T[n2+i*2+1]=FLOAT_CONV(sin((M_PI/(2*n))*(2*i+1)));
+69
}
+70
for(i=0;i<n/8;i++){
+71
T[n+i*2]=FLOAT_CONV(cos((M_PI/n)*(4*i+2))*.5);
+72
T[n+i*2+1]=FLOAT_CONV(-sin((M_PI/n)*(4*i+2))*.5);
+73
}
+74
+75
/* bitreverse lookup... */
+76
+77
{
+78
int mask=(1<<(log2n-1))-1,i,j;
+79
int msb=1<<(log2n-2);
+80
for(i=0;i<n/8;i++){
+81
int acc=0;
+82
for(j=0;msb>>j;j++)
+83
if((msb>>j)&i)acc|=1<<j;
+84
bitrev[i*2]=((~acc)&mask)-1;
+85
bitrev[i*2+1]=acc;
+86
+87
}
+88
}
+89
lookup->scale=FLOAT_CONV(4.f/n);
+90
}
+91
+92
/* 8 point butterfly (in place, 4 register) */
+93
STIN void mdct_butterfly_8(DATA_TYPE *x){
+94
REG_TYPE r0 = x[6] + x[2];
+95
REG_TYPE r1 = x[6] - x[2];
+96
REG_TYPE r2 = x[4] + x[0];
+97
REG_TYPE r3 = x[4] - x[0];
+98
+99
x[6] = r0 + r2;
+100
x[4] = r0 - r2;
+101
+102
r0 = x[5] - x[1];
+103
r2 = x[7] - x[3];
+104
x[0] = r1 + r0;
+105
x[2] = r1 - r0;
+106
+107
r0 = x[5] + x[1];
+108
r1 = x[7] + x[3];
+109
x[3] = r2 + r3;
+110
x[1] = r2 - r3;
+111
x[7] = r1 + r0;
+112
x[5] = r1 - r0;
+113
+114
}
+115
+116
/* 16 point butterfly (in place, 4 register) */
+117
STIN void mdct_butterfly_16(DATA_TYPE *x){
+118
REG_TYPE r0 = x[1] - x[9];
+119
REG_TYPE r1 = x[0] - x[8];
+120
+121
x[8] += x[0];
+122
x[9] += x[1];
+123
x[0] = MULT_NORM((r0 + r1) * cPI2_8);
+124
x[1] = MULT_NORM((r0 - r1) * cPI2_8);
+125
+126
r0 = x[3] - x[11];
+127
r1 = x[10] - x[2];
+128
x[10] += x[2];
+129
x[11] += x[3];
+130
x[2] = r0;
+131
x[3] = r1;
+132
+133
r0 = x[12] - x[4];
+134
r1 = x[13] - x[5];
+135
x[12] += x[4];
+136
x[13] += x[5];
+137
x[4] = MULT_NORM((r0 - r1) * cPI2_8);
+138
x[5] = MULT_NORM((r0 + r1) * cPI2_8);
+139
+140
r0 = x[14] - x[6];
+141
r1 = x[15] - x[7];
+142
x[14] += x[6];
+143
x[15] += x[7];
+144
x[6] = r0;
+145
x[7] = r1;
+146
+147
mdct_butterfly_8(x);
+148
mdct_butterfly_8(x+8);
+149
}
+150
+151
/* 32 point butterfly (in place, 4 register) */
+152
STIN void mdct_butterfly_32(DATA_TYPE *x){
+153
REG_TYPE r0 = x[30] - x[14];
+154
REG_TYPE r1 = x[31] - x[15];
+155
+156
x[30] += x[14];
+157
x[31] += x[15];
+158
x[14] = r0;
+159
x[15] = r1;
+160
+161
r0 = x[28] - x[12];
+162
r1 = x[29] - x[13];
+163
x[28] += x[12];
+164
x[29] += x[13];
+165
x[12] = MULT_NORM( r0 * cPI1_8 - r1 * cPI3_8 );
+166
x[13] = MULT_NORM( r0 * cPI3_8 + r1 * cPI1_8 );
+167
+168
r0 = x[26] - x[10];
+169
r1 = x[27] - x[11];
+170
x[26] += x[10];
+171
x[27] += x[11];
+172
x[10] = MULT_NORM(( r0 - r1 ) * cPI2_8);
+173
x[11] = MULT_NORM(( r0 + r1 ) * cPI2_8);
+174
+175
r0 = x[24] - x[8];
+176
r1 = x[25] - x[9];
+177
x[24] += x[8];
+178
x[25] += x[9];
+179
x[8] = MULT_NORM( r0 * cPI3_8 - r1 * cPI1_8 );
+180
x[9] = MULT_NORM( r1 * cPI3_8 + r0 * cPI1_8 );
+181
+182
r0 = x[22] - x[6];
+183
r1 = x[7] - x[23];
+184
x[22] += x[6];
+185
x[23] += x[7];
+186
x[6] = r1;
+187
x[7] = r0;
+188
+189
r0 = x[4] - x[20];
+190
r1 = x[5] - x[21];
+191
x[20] += x[4];
+192
x[21] += x[5];
+193
x[4] = MULT_NORM( r1 * cPI1_8 + r0 * cPI3_8 );
+194
x[5] = MULT_NORM( r1 * cPI3_8 - r0 * cPI1_8 );
+195
+196
r0 = x[2] - x[18];
+197
r1 = x[3] - x[19];
+198
x[18] += x[2];
+199
x[19] += x[3];
+200
x[2] = MULT_NORM(( r1 + r0 ) * cPI2_8);
+201
x[3] = MULT_NORM(( r1 - r0 ) * cPI2_8);
+202
+203
r0 = x[0] - x[16];
+204
r1 = x[1] - x[17];
+205
x[16] += x[0];
+206
x[17] += x[1];
+207
x[0] = MULT_NORM( r1 * cPI3_8 + r0 * cPI1_8 );
+208
x[1] = MULT_NORM( r1 * cPI1_8 - r0 * cPI3_8 );
+209
+210
mdct_butterfly_16(x);
+211
mdct_butterfly_16(x+16);
+212
+213
}
+214
+215
/* N point first stage butterfly (in place, 2 register) */
+216
STIN void mdct_butterfly_first(DATA_TYPE *T,
+217
DATA_TYPE *x,
+218
int points){
+219
+220
DATA_TYPE *x1 = x + points - 8;
+221
DATA_TYPE *x2 = x + (points>>1) - 8;
+222
REG_TYPE r0;
+223
REG_TYPE r1;
+224
+225
do{
+226
+227
r0 = x1[6] - x2[6];
+228
r1 = x1[7] - x2[7];
+229
x1[6] += x2[6];
+230
x1[7] += x2[7];
+231
x2[6] = MULT_NORM(r1 * T[1] + r0 * T[0]);
+232
x2[7] = MULT_NORM(r1 * T[0] - r0 * T[1]);
+233
+234
r0 = x1[4] - x2[4];
+235
r1 = x1[5] - x2[5];
+236
x1[4] += x2[4];
+237
x1[5] += x2[5];
+238
x2[4] = MULT_NORM(r1 * T[5] + r0 * T[4]);
+239
x2[5] = MULT_NORM(r1 * T[4] - r0 * T[5]);
+240
+241
r0 = x1[2] - x2[2];
+242
r1 = x1[3] - x2[3];
+243
x1[2] += x2[2];
+244
x1[3] += x2[3];
+245
x2[2] = MULT_NORM(r1 * T[9] + r0 * T[8]);
+246
x2[3] = MULT_NORM(r1 * T[8] - r0 * T[9]);
+247
+248
r0 = x1[0] - x2[0];
+249
r1 = x1[1] - x2[1];
+250
x1[0] += x2[0];
+251
x1[1] += x2[1];
+252
x2[0] = MULT_NORM(r1 * T[13] + r0 * T[12]);
+253
x2[1] = MULT_NORM(r1 * T[12] - r0 * T[13]);
+254
+255
x1-=8;
+256
x2-=8;
+257
T+=16;
+258
+259
}while(x2>=x);
+260
}
+261
+262
/* N/stage point generic N stage butterfly (in place, 2 register) */
+263
STIN void mdct_butterfly_generic(DATA_TYPE *T,
+264
DATA_TYPE *x,
+265
int points,
+266
int trigint){
+267
+268
DATA_TYPE *x1 = x + points - 8;
+269
DATA_TYPE *x2 = x + (points>>1) - 8;
+270
REG_TYPE r0;
+271
REG_TYPE r1;
+272
+273
do{
+274
+275
r0 = x1[6] - x2[6];
+276
r1 = x1[7] - x2[7];
+277
x1[6] += x2[6];
+278
x1[7] += x2[7];
+279
x2[6] = MULT_NORM(r1 * T[1] + r0 * T[0]);
+280
x2[7] = MULT_NORM(r1 * T[0] - r0 * T[1]);
+281
+282
T+=trigint;
+283
+284
r0 = x1[4] - x2[4];
+285
r1 = x1[5] - x2[5];
+286
x1[4] += x2[4];
+287
x1[5] += x2[5];
+288
x2[4] = MULT_NORM(r1 * T[1] + r0 * T[0]);
+289
x2[5] = MULT_NORM(r1 * T[0] - r0 * T[1]);
+290
+291
T+=trigint;
+292
+293
r0 = x1[2] - x2[2];
+294
r1 = x1[3] - x2[3];
+295
x1[2] += x2[2];
+296
x1[3] += x2[3];
+297
x2[2] = MULT_NORM(r1 * T[1] + r0 * T[0]);
+298
x2[3] = MULT_NORM(r1 * T[0] - r0 * T[1]);
+299
+300
T+=trigint;
+301
+302
r0 = x1[0] - x2[0];
+303
r1 = x1[1] - x2[1];
+304
x1[0] += x2[0];
+305
x1[1] += x2[1];
+306
x2[0] = MULT_NORM(r1 * T[1] + r0 * T[0]);
+307
x2[1] = MULT_NORM(r1 * T[0] - r0 * T[1]);
+308
+309
T+=trigint;
+310
x1-=8;
+311
x2-=8;
+312
+313
}while(x2>=x);
+314
}
+315
+316
STIN void mdct_butterflies(mdct_lookup *init,
+317
DATA_TYPE *x,
+318
int points){
+319
+320
DATA_TYPE *T=init->trig;
+321
int stages=init->log2n-5;
+322
int i,j;
+323
+324
if(--stages>0){
+325
mdct_butterfly_first(T,x,points);
+326
}
+327
+328
for(i=1;--stages>0;i++){
+329
for(j=0;j<(1<<i);j++)
+330
mdct_butterfly_generic(T,x+(points>>i)*j,points>>i,4<<i);
+331
}
+332
+333
for(j=0;j<points;j+=32)
+334
mdct_butterfly_32(x+j);
+335
+336
}
+337
+338
void mdct_clear(mdct_lookup *l){
+339
if(l){
+340
if(l->trig)_ogg_free(l->trig);
+341
if(l->bitrev)_ogg_free(l->bitrev);
+342
memset(l,0,sizeof(*l));
+343
}
+344
}
+345
+346
STIN void mdct_bitreverse(mdct_lookup *init,
+347
DATA_TYPE *x){
+348
int n = init->n;
+349
int *bit = init->bitrev;
+350
DATA_TYPE *w0 = x;
+351
DATA_TYPE *w1 = x = w0+(n>>1);
+352
DATA_TYPE *T = init->trig+n;
+353
+354
do{
+355
DATA_TYPE *x0 = x+bit[0];
+356
DATA_TYPE *x1 = x+bit[1];
+357
+358
REG_TYPE r0 = x0[1] - x1[1];
+359
REG_TYPE r1 = x0[0] + x1[0];
+360
REG_TYPE r2 = MULT_NORM(r1 * T[0] + r0 * T[1]);
+361
REG_TYPE r3 = MULT_NORM(r1 * T[1] - r0 * T[0]);
+362
+363
w1 -= 4;
+364
+365
r0 = HALVE(x0[1] + x1[1]);
+366
r1 = HALVE(x0[0] - x1[0]);
+367
+368
w0[0] = r0 + r2;
+369
w1[2] = r0 - r2;
+370
w0[1] = r1 + r3;
+371
w1[3] = r3 - r1;
+372
+373
x0 = x+bit[2];
+374
x1 = x+bit[3];
+375
+376
r0 = x0[1] - x1[1];
+377
r1 = x0[0] + x1[0];
+378
r2 = MULT_NORM(r1 * T[2] + r0 * T[3]);
+379
r3 = MULT_NORM(r1 * T[3] - r0 * T[2]);
+380
+381
r0 = HALVE(x0[1] + x1[1]);
+382
r1 = HALVE(x0[0] - x1[0]);
+383
+384
w0[2] = r0 + r2;
+385
w1[0] = r0 - r2;
+386
w0[3] = r1 + r3;
+387
w1[1] = r3 - r1;
+388
+389
T += 4;
+390
bit += 4;
+391
w0 += 4;
+392
+393
}while(w0<w1);
+394
}
+395
+396
void mdct_backward(mdct_lookup *init, DATA_TYPE *in, DATA_TYPE *out){
+397
int n=init->n;
+398
int n2=n>>1;
+399
int n4=n>>2;
+400
+401
/* rotate */
+402
+403
DATA_TYPE *iX = in+n2-7;
+404
DATA_TYPE *oX = out+n2+n4;
+405
DATA_TYPE *T = init->trig+n4;
+406
+407
do{
+408
oX -= 4;
+409
oX[0] = MULT_NORM(-iX[2] * T[3] - iX[0] * T[2]);
+410
oX[1] = MULT_NORM (iX[0] * T[3] - iX[2] * T[2]);
+411
oX[2] = MULT_NORM(-iX[6] * T[1] - iX[4] * T[0]);
+412
oX[3] = MULT_NORM (iX[4] * T[1] - iX[6] * T[0]);
+413
iX -= 8;
+414
T += 4;
+415
}while(iX>=in);
+416
+417
iX = in+n2-8;
+418
oX = out+n2+n4;
+419
T = init->trig+n4;
+420
+421
do{
+422
T -= 4;
+423
oX[0] = MULT_NORM (iX[4] * T[3] + iX[6] * T[2]);
+424
oX[1] = MULT_NORM (iX[4] * T[2] - iX[6] * T[3]);
+425
oX[2] = MULT_NORM (iX[0] * T[1] + iX[2] * T[0]);
+426
oX[3] = MULT_NORM (iX[0] * T[0] - iX[2] * T[1]);
+427
iX -= 8;
+428
oX += 4;
+429
}while(iX>=in);
+430
+431
mdct_butterflies(init,out+n2,n2);
+432
mdct_bitreverse(init,out);
+433
+434
/* roatate + window */
+435
+436
{
+437
DATA_TYPE *oX1=out+n2+n4;
+438
DATA_TYPE *oX2=out+n2+n4;
+439
DATA_TYPE *iX =out;
+440
T =init->trig+n2;
+441
+442
do{
+443
oX1-=4;
+444
+445
oX1[3] = MULT_NORM (iX[0] * T[1] - iX[1] * T[0]);
+446
oX2[0] = -MULT_NORM (iX[0] * T[0] + iX[1] * T[1]);
+447
+448
oX1[2] = MULT_NORM (iX[2] * T[3] - iX[3] * T[2]);
+449
oX2[1] = -MULT_NORM (iX[2] * T[2] + iX[3] * T[3]);
+450
+451
oX1[1] = MULT_NORM (iX[4] * T[5] - iX[5] * T[4]);
+452
oX2[2] = -MULT_NORM (iX[4] * T[4] + iX[5] * T[5]);
+453
+454
oX1[0] = MULT_NORM (iX[6] * T[7] - iX[7] * T[6]);
+455
oX2[3] = -MULT_NORM (iX[6] * T[6] + iX[7] * T[7]);
+456
+457
oX2+=4;
+458
iX += 8;
+459
T += 8;
+460
}while(iX<oX1);
+461
+462
iX=out+n2+n4;
+463
oX1=out+n4;
+464
oX2=oX1;
+465
+466
do{
+467
oX1-=4;
+468
iX-=4;
+469
+470
oX2[0] = -(oX1[3] = iX[3]);
+471
oX2[1] = -(oX1[2] = iX[2]);
+472
oX2[2] = -(oX1[1] = iX[1]);
+473
oX2[3] = -(oX1[0] = iX[0]);
+474
+475
oX2+=4;
+476
}while(oX2<iX);
+477
+478
iX=out+n2+n4;
+479
oX1=out+n2+n4;
+480
oX2=out+n2;
+481
do{
+482
oX1-=4;
+483
oX1[0]= iX[3];
+484
oX1[1]= iX[2];
+485
oX1[2]= iX[1];
+486
oX1[3]= iX[0];
+487
iX+=4;
+488
}while(oX1>oX2);
+489
}
+490
}
+491
+492
void mdct_forward(mdct_lookup *init, DATA_TYPE *in, DATA_TYPE *out){
+493
int n=init->n;
+494
int n2=n>>1;
+495
int n4=n>>2;
+496
int n8=n>>3;
+497
DATA_TYPE *w=alloca(n*sizeof(*w)); /* forward needs working space */
+498
DATA_TYPE *w2=w+n2;
+499

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
@@ -0,0 +1,70 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 *
+9
* by the Xiph.Org Foundation https://xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: modified discrete cosine transform prototypes
+14
+15
********************************************************************/
+16
+17
#ifndef _OGG_mdct_H_
+18
#define _OGG_mdct_H_
+19
+20
#include "vorbis/codec.h"
+21
+22
+23
+24
+25
+26
/*#define MDCT_INTEGERIZED <- be warned there could be some hurt left here*/
+27
#ifdef MDCT_INTEGERIZED
+28
+29
#define DATA_TYPE int
+30
#define REG_TYPE register int
+31
#define TRIGBITS 14
+32
#define cPI3_8 6270
+33
#define cPI2_8 11585
+34
#define cPI1_8 15137
+35
+36
#define FLOAT_CONV(x) ((int)((x)*(1<<TRIGBITS)+.5))
+37
#define MULT_NORM(x) ((x)>>TRIGBITS)
+38
#define HALVE(x) ((x)>>1)
+39
+40
#else
+41
+42
#define DATA_TYPE float
+43
#define REG_TYPE float
+44
#define cPI3_8 .38268343236508977175F
+45
#define cPI2_8 .70710678118654752441F
+46
#define cPI1_8 .92387953251128675613F
+47
+48
#define FLOAT_CONV(x) (x)
+49
#define MULT_NORM(x) (x)
+50
#define HALVE(x) ((x)*.5f)
+51
+52
#endif
+53
+54
+55
typedef struct {
+56
int n;
+57
int log2n;
+58
+59
DATA_TYPE *trig;
+60
int *bitrev;
+61
+62
DATA_TYPE scale;
+63
} mdct_lookup;
+64
+65
extern void mdct_init(mdct_lookup *lookup,int n);
+66
extern void mdct_clear(mdct_lookup *l);
+67
extern void mdct_forward(mdct_lookup *init, DATA_TYPE *in, DATA_TYPE *out);
+68
extern void mdct_backward(mdct_lookup *init, DATA_TYPE *in, DATA_TYPE *out);
+69
+70
#endif
vendor/vorbis/lib/misc.hadded
@@ -0,0 +1,57 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2015 *
+9
* by the Xiph.Org Foundation https://xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: miscellaneous prototypes
+14
+15
********************************************************************/
+16
+17
#ifndef _V_RANDOM_H_
+18
#define _V_RANDOM_H_
+19
#include "vorbis/codec.h"
+20
+21
extern void *_vorbis_block_alloc(vorbis_block *vb,long bytes);
+22
extern void _vorbis_block_ripcord(vorbis_block *vb);
+23
extern int ov_ilog(ogg_uint32_t v);
+24
+25
#ifdef ANALYSIS
+26
extern int analysis_noisy;
+27
extern void _analysis_output(char *base,int i,float *v,int n,int bark,int dB,
+28
ogg_int64_t off);
+29
extern void _analysis_output_always(char *base,int i,float *v,int n,int bark,int dB,
+30
ogg_int64_t off);
+31
#endif
+32
+33
#ifdef DEBUG_MALLOC
+34
+35
#define _VDBG_GRAPHFILE "malloc.m"
+36
#undef _VDBG_GRAPHFILE
+37
extern void *_VDBG_malloc(void *ptr,long bytes,char *file,long line);
+38
extern void _VDBG_free(void *ptr,char *file,long line);
+39
+40
#ifndef MISC_C
+41
#undef _ogg_malloc
+42
#undef _ogg_calloc
+43
#undef _ogg_realloc
+44
#undef _ogg_free
+45
+46
#define _ogg_malloc(x) _VDBG_malloc(NULL,(x),__FILE__,__LINE__)
+47
#define _ogg_calloc(x,y) _VDBG_malloc(NULL,(x)*(y),__FILE__,__LINE__)
+48
#define _ogg_realloc(x,y) _VDBG_malloc((x),(y),__FILE__,__LINE__)
+49
#define _ogg_free(x) _VDBG_free((x),__FILE__,__LINE__)
+50
#endif
+51
#endif
+52
+53
#endif
+54
+55
+56
+57
vendor/vorbis/lib/modes/floor_all.hadded
@@ -0,0 +1,259 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 *
+9
* by the Xiph.Org Foundation https://xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: key floor settings
+14
+15
********************************************************************/
+16
+17
#include "vorbis/codec.h"
+18
#include "backends.h"
+19
#include "books/floor/floor_books.h"
+20
+21
static const static_codebook*const _floor_128x4_books[]={
+22
&_huff_book_line_128x4_class0,
+23
&_huff_book_line_128x4_0sub0,
+24
&_huff_book_line_128x4_0sub1,
+25
&_huff_book_line_128x4_0sub2,
+26
&_huff_book_line_128x4_0sub3,
+27
};
+28
static const static_codebook*const _floor_256x4_books[]={
+29
&_huff_book_line_256x4_class0,
+30
&_huff_book_line_256x4_0sub0,
+31
&_huff_book_line_256x4_0sub1,
+32
&_huff_book_line_256x4_0sub2,
+33
&_huff_book_line_256x4_0sub3,
+34
};
+35
static const static_codebook*const _floor_128x7_books[]={
+36
&_huff_book_line_128x7_class0,
+37
&_huff_book_line_128x7_class1,
+38
+39
&_huff_book_line_128x7_0sub1,
+40
&_huff_book_line_128x7_0sub2,
+41
&_huff_book_line_128x7_0sub3,
+42
&_huff_book_line_128x7_1sub1,
+43
&_huff_book_line_128x7_1sub2,
+44
&_huff_book_line_128x7_1sub3,
+45
};
+46
static const static_codebook*const _floor_256x7_books[]={
+47
&_huff_book_line_256x7_class0,
+48
&_huff_book_line_256x7_class1,
+49
+50
&_huff_book_line_256x7_0sub1,
+51
&_huff_book_line_256x7_0sub2,
+52
&_huff_book_line_256x7_0sub3,
+53
&_huff_book_line_256x7_1sub1,
+54
&_huff_book_line_256x7_1sub2,
+55
&_huff_book_line_256x7_1sub3,
+56
};
+57
static const static_codebook*const _floor_128x11_books[]={
+58
&_huff_book_line_128x11_class1,
+59
&_huff_book_line_128x11_class2,
+60
&_huff_book_line_128x11_class3,
+61
+62
&_huff_book_line_128x11_0sub0,
+63
&_huff_book_line_128x11_1sub0,
+64
&_huff_book_line_128x11_1sub1,
+65
&_huff_book_line_128x11_2sub1,
+66
&_huff_book_line_128x11_2sub2,
+67
&_huff_book_line_128x11_2sub3,
+68
&_huff_book_line_128x11_3sub1,
+69
&_huff_book_line_128x11_3sub2,
+70
&_huff_book_line_128x11_3sub3,
+71
};
+72
static const static_codebook*const _floor_128x17_books[]={
+73
&_huff_book_line_128x17_class1,
+74
&_huff_book_line_128x17_class2,
+75
&_huff_book_line_128x17_class3,
+76
+77
&_huff_book_line_128x17_0sub0,
+78
&_huff_book_line_128x17_1sub0,
+79
&_huff_book_line_128x17_1sub1,
+80
&_huff_book_line_128x17_2sub1,
+81
&_huff_book_line_128x17_2sub2,
+82
&_huff_book_line_128x17_2sub3,
+83
&_huff_book_line_128x17_3sub1,
+84
&_huff_book_line_128x17_3sub2,
+85
&_huff_book_line_128x17_3sub3,
+86
};
+87
static const static_codebook*const _floor_256x4low_books[]={
+88
&_huff_book_line_256x4low_class0,
+89
&_huff_book_line_256x4low_0sub0,
+90
&_huff_book_line_256x4low_0sub1,
+91
&_huff_book_line_256x4low_0sub2,
+92
&_huff_book_line_256x4low_0sub3,
+93
};
+94
static const static_codebook*const _floor_1024x27_books[]={
+95
&_huff_book_line_1024x27_class1,
+96
&_huff_book_line_1024x27_class2,
+97
&_huff_book_line_1024x27_class3,
+98
&_huff_book_line_1024x27_class4,
+99
+100
&_huff_book_line_1024x27_0sub0,
+101
&_huff_book_line_1024x27_1sub0,
+102
&_huff_book_line_1024x27_1sub1,
+103
&_huff_book_line_1024x27_2sub0,
+104
&_huff_book_line_1024x27_2sub1,
+105
&_huff_book_line_1024x27_3sub1,
+106
&_huff_book_line_1024x27_3sub2,
+107
&_huff_book_line_1024x27_3sub3,
+108
&_huff_book_line_1024x27_4sub1,
+109
&_huff_book_line_1024x27_4sub2,
+110
&_huff_book_line_1024x27_4sub3,
+111
};
+112
static const static_codebook*const _floor_2048x27_books[]={
+113
&_huff_book_line_2048x27_class1,
+114
&_huff_book_line_2048x27_class2,
+115
&_huff_book_line_2048x27_class3,
+116
&_huff_book_line_2048x27_class4,
+117
+118
&_huff_book_line_2048x27_0sub0,
+119
&_huff_book_line_2048x27_1sub0,
+120
&_huff_book_line_2048x27_1sub1,
+121
&_huff_book_line_2048x27_2sub0,
+122
&_huff_book_line_2048x27_2sub1,
+123
&_huff_book_line_2048x27_3sub1,
+124
&_huff_book_line_2048x27_3sub2,
+125
&_huff_book_line_2048x27_3sub3,
+126
&_huff_book_line_2048x27_4sub1,
+127
&_huff_book_line_2048x27_4sub2,
+128
&_huff_book_line_2048x27_4sub3,
+129
};
+130
+131
static const static_codebook*const _floor_512x17_books[]={
+132
&_huff_book_line_512x17_class1,
+133
&_huff_book_line_512x17_class2,
+134
&_huff_book_line_512x17_class3,
+135
+136
&_huff_book_line_512x17_0sub0,
+137
&_huff_book_line_512x17_1sub0,
+138
&_huff_book_line_512x17_1sub1,
+139
&_huff_book_line_512x17_2sub1,
+140
&_huff_book_line_512x17_2sub2,
+141
&_huff_book_line_512x17_2sub3,
+142
&_huff_book_line_512x17_3sub1,
+143
&_huff_book_line_512x17_3sub2,
+144
&_huff_book_line_512x17_3sub3,
+145
};
+146
+147
static const static_codebook*const _floor_Xx0_books[]={
+148
0
+149
};
+150
+151
static const static_codebook*const *const _floor_books[11]={
+152
_floor_128x4_books,
+153
_floor_256x4_books,
+154
_floor_128x7_books,
+155
_floor_256x7_books,
+156
_floor_128x11_books,
+157
_floor_128x17_books,
+158
_floor_256x4low_books,
+159
_floor_1024x27_books,
+160
_floor_2048x27_books,
+161
_floor_512x17_books,
+162
_floor_Xx0_books,
+163
};
+164
+165
static const vorbis_info_floor1 _floor[11]={
+166
/* 0: 128 x 4 */
+167
{
+168
1,{0},{4},{2},{0},
+169
{{1,2,3,4}},
+170
4,{0,128, 33,8,16,70},
+171
+172
60,30,500, 1.,18., 128
+173
},
+174
/* 1: 256 x 4 */
+175
{
+176
1,{0},{4},{2},{0},
+177
{{1,2,3,4}},
+178
4,{0,256, 66,16,32,140},
+179
+180
60,30,500, 1.,18., 256
+181
},
+182
/* 2: 128 x 7 */
+183
{
+184
2,{0,1},{3,4},{2,2},{0,1},
+185
{{-1,2,3,4},{-1,5,6,7}},
+186
4,{0,128, 14,4,58, 2,8,28,90},
+187
+188
60,30,500, 1.,18., 128
+189
},
+190
/* 3: 256 x 7 */
+191
{
+192
2,{0,1},{3,4},{2,2},{0,1},
+193
{{-1,2,3,4},{-1,5,6,7}},
+194
4,{0,256, 28,8,116, 4,16,56,180},
+195
+196
60,30,500, 1.,18., 256
+197
},
+198
/* 4: 128 x 11 */
+199
{
+200
4,{0,1,2,3},{2,3,3,3},{0,1,2,2},{-1,0,1,2},
+201
{{3},{4,5},{-1,6,7,8},{-1,9,10,11}},
+202
+203
2,{0,128, 8,33, 4,16,70, 2,6,12, 23,46,90},
+204
+205
60,30,500, 1,18., 128
+206
},
+207
/* 5: 128 x 17 */
+208
{
+209
6,{0,1,1,2,3,3},{2,3,3,3},{0,1,2,2},{-1,0,1,2},
+210
{{3},{4,5},{-1,6,7,8},{-1,9,10,11}},
+211
2,{0,128, 12,46, 4,8,16, 23,33,70, 2,6,10, 14,19,28, 39,58,90},
+212
+213
60,30,500, 1,18., 128
+214
},
+215
/* 6: 256 x 4 (low bitrate version) */
+216
{
+217
1,{0},{4},{2},{0},
+218
{{1,2,3,4}},
+219
4,{0,256, 66,16,32,140},
+220
+221
60,30,500, 1.,18., 256
+222
},
+223
/* 7: 1024 x 27 */
+224
{
+225
8,{0,1,2,2,3,3,4,4},{3,4,3,4,3},{0,1,1,2,2},{-1,0,1,2,3},
+226
{{4},{5,6},{7,8},{-1,9,10,11},{-1,12,13,14}},
+227
2,{0,1024, 93,23,372, 6,46,186,750, 14,33,65, 130,260,556,
+228
3,10,18,28, 39,55,79,111, 158,220,312, 464,650,850},
+229
+230
60,30,500, 3,18., 1024
+231
},
+232
/* 8: 2048 x 27 */
+233
{
+234
8,{0,1,2,2,3,3,4,4},{3,4,3,4,3},{0,1,1,2,2},{-1,0,1,2,3},
+235
{{4},{5,6},{7,8},{-1,9,10,11},{-1,12,13,14}},
+236
2,{0,2048, 186,46,744, 12,92,372,1500, 28,66,130, 260,520,1112,
+237
6,20,36,56, 78,110,158,222, 316,440,624, 928,1300,1700},
+238
+239
60,30,500, 3,18., 2048
+240
},
+241
/* 9: 512 x 17 */
+242
{
+243
6,{0,1,1,2,3,3},{2,3,3,3},{0,1,2,2},{-1,0,1,2},
+244
{{3},{4,5},{-1,6,7,8},{-1,9,10,11}},
+245
2,{0,512, 46,186, 16,33,65, 93,130,278,
+246
7,23,39, 55,79,110, 156,232,360},
+247
+248
60,30,500, 1,18., 512
+249
},
+250
+251
/* 10: X x 0 (LFE floor; edge posts only) */
+252
{
+253
0,{0}, {0},{0},{-1},
+254
{{-1}},
+255
2,{0,12},
+256
60,30,500, 1.,18., 10
+257
},
+258
+259
};
vendor/vorbis/lib/modes/psych_11.hadded
@@ -0,0 +1,50 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 *
+9
* by the Xiph.Org Foundation https://xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: 11kHz settings
+14
+15
********************************************************************/
+16
+17
static const double _psy_lowpass_11[3]={4.5,5.5,30.,};
+18
+19
static const att3 _psy_tone_masteratt_11[3]={
+20
{{ 30, 25, 12}, 0, 0}, /* 0 */
+21
{{ 30, 25, 12}, 0, 0}, /* 0 */
+22
{{ 20, 0, -14}, 0, 0}, /* 0 */
+23
};
+24
+25
static const vp_adjblock _vp_tonemask_adj_11[3]={
+26
/* adjust for mode zero */
+27
/* 63 125 250 500 1 2 4 8 16 */
+28
{{-20,-20,-20,-20,-20,-16,-10, 0, 0, 0, 0,10, 2, 0,99,99,99}}, /* 0 */
+29
{{-20,-20,-20,-20,-20,-16,-10, 0, 0, 0, 0, 5, 0, 0,99,99,99}}, /* 1 */
+30
{{-20,-20,-20,-20,-20,-16,-10, 0, 0, 0, 0, 0, 0, 0,99,99,99}}, /* 2 */
+31
};
+32
+33
+34
static const noise3 _psy_noisebias_11[3]={
+35
/* 63 125 250 500 1k 2k 4k 8k 16k*/
+36
{{{-10,-10,-10,-10, -5, -5, -5, 0, 4, 10, 10, 12, 12, 12, 99, 99, 99},
+37
{-15,-15,-15,-15,-10,-10, -5, 0, 0, 4, 4, 5, 5, 10, 99, 99, 99},
+38
{-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, 99, 99, 99}}},
+39
+40
{{{-10,-10,-10,-10, -5, -5, -5, 0, 4, 10, 10, 12, 12, 12, 99, 99, 99},
+41
{-15,-15,-15,-15,-10,-10, -5, -5, -5, 0, 0, 0, 0, 0, 99, 99, 99},
+42
{-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, 99, 99, 99}}},
+43
+44
{{{-15,-15,-15,-15,-15,-12,-10, -8, 0, 2, 4, 4, 5, 5, 99, 99, 99},
+45
{-30,-30,-30,-30,-26,-22,-20,-14,-12,-12,-10,-10,-10,-10, 99, 99, 99},
+46
{-30,-30,-30,-30,-26,-26,-26,-26,-26,-26,-26,-26,-26,-24, 99, 99, 99}}},
+47
};
+48
+49
static const double _noise_thresh_11[3]={ .3,.5,.5 };
+50
vendor/vorbis/lib/modes/psych_16.hadded
@@ -0,0 +1,132 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 *
+9
* by the Xiph.Org Foundation https://xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: 16kHz settings
+14
+15
********************************************************************/
+16
+17
/* stereo mode by base quality level */
+18
static const adj_stereo _psy_stereo_modes_16[4]={
+19
/* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 */
+20
{{ 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3},
+21
{ 6, 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4},
+22
{ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 4, 4},
+23
{ 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
+24
{{ 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3},
+25
{ 6, 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4},
+26
{ 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 4, 4, 4, 4, 4},
+27
{ 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
+28
{{ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3},
+29
{ 5, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3},
+30
{ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4},
+31
{ 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
+32
{{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
+33
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
+34
{ 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8},
+35
{ 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
+36
};
+37
+38
static const double _psy_lowpass_16[4]={6.5,8,30.,99.};
+39
+40
static const att3 _psy_tone_masteratt_16[4]={
+41
{{ 30, 25, 12}, 0, 0}, /* 0 */
+42
{{ 25, 22, 12}, 0, 0}, /* 0 */
+43
{{ 20, 12, 0}, 0, 0}, /* 0 */
+44
{{ 15, 0, -14}, 0, 0}, /* 0 */
+45
};
+46
+47
static const vp_adjblock _vp_tonemask_adj_16[4]={
+48
/* adjust for mode zero */
+49
/* 63 125 250 500 1 2 4 8 16 */
+50
{{-20,-20,-20,-20,-20,-16,-10, 0, 0, 0, 0,10, 0, 0, 0, 0, 0}}, /* 0 */
+51
{{-20,-20,-20,-20,-20,-16,-10, 0, 0, 0, 0,10, 0, 0, 0, 0, 0}}, /* 1 */
+52
{{-20,-20,-20,-20,-20,-16,-10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, /* 2 */
+53
{{-30,-30,-30,-30,-30,-26,-20,-10, -5, 0, 0, 0, 0, 0, 0, 0, 0}}, /* 2 */
+54
};
+55
+56
+57
static const noise3 _psy_noisebias_16_short[4]={
+58
/* 63 125 250 500 1k 2k 4k 8k 16k*/
+59
{{{-15,-15,-15,-15,-15,-10,-10,-5, 4, 10, 10, 10, 10, 12, 12, 14, 20},
+60
{-15,-15,-15,-15,-15,-10,-10, -5, 0, 0, 4, 5, 5, 6, 8, 8, 15},
+61
{-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -6, -6}}},
+62
+63
{{{-15,-15,-15,-15,-15,-10,-10,-5, 4, 6, 6, 6, 6, 8, 10, 12, 20},
+64
{-15,-15,-15,-15,-15,-15,-15,-10, -5, -5, -5, 4, 5, 6, 8, 8, 15},
+65
{-30,-30,-30,-30,-30,-24,-20,-14,-10,-10,-10,-10,-10,-10,-10,-10,-10}}},
+66
+67
{{{-15,-15,-15,-15,-15,-12,-10, -8, 0, 2, 4, 4, 5, 5, 5, 8, 12},
+68
{-20,-20,-20,-20,-16,-12,-20,-14,-10,-10, -8, 0, 0, 0, 0, 2, 5},
+69
{-30,-30,-30,-30,-26,-26,-26,-26,-26,-26,-26,-26,-26,-24,-20,-20,-20}}},
+70
+71
{{{-15,-15,-15,-15,-15,-12,-10, -8, -5, -5, -5, -5, -5, 0, 0, 0, 6},
+72
{-30,-30,-30,-30,-26,-22,-20,-14,-12,-12,-10,-10,-10,-10,-10,-10, -6},
+73
{-30,-30,-30,-30,-26,-26,-26,-26,-26,-26,-26,-26,-26,-24,-20,-20,-20}}},
+74
};
+75
+76
static const noise3 _psy_noisebias_16_impulse[4]={
+77
/* 63 125 250 500 1k 2k 4k 8k 16k*/
+78
{{{-15,-15,-15,-15,-15,-10,-10,-5, 4, 10, 10, 10, 10, 12, 12, 14, 20},
+79
{-15,-15,-15,-15,-15,-10,-10, -5, 0, 0, 4, 5, 5, 6, 8, 8, 15},
+80
{-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -6, -6}}},
+81
+82
{{{-15,-15,-15,-15,-15,-10,-10,-5, 4, 4, 4, 4, 5, 5, 6, 8, 15},
+83
{-15,-15,-15,-15,-15,-15,-15,-10, -5, -5, -5, 0, 0, 0, 0, 4, 10},
+84
{-30,-30,-30,-30,-30,-24,-20,-14,-10,-10,-10,-10,-10,-10,-10,-10,-10}}},
+85
+86
{{{-15,-15,-15,-15,-15,-12,-10, -8, 0, 0, 0, 0, 0, 0, 0, 4, 10},
+87
{-20,-20,-20,-20,-16,-12,-20,-14,-10,-10,-10,-10,-10,-10,-10, -7, -5},
+88
{-30,-30,-30,-30,-26,-26,-26,-26,-26,-26,-26,-26,-26,-24,-20,-20,-20}}},
+89
+90
{{{-15,-15,-15,-15,-15,-12,-10, -8, -5, -5, -5, -5, -5, 0, 0, 0, 6},
+91
{-30,-30,-30,-30,-26,-22,-20,-18,-18,-18,-20,-20,-20,-20,-20,-20,-16},
+92
{-30,-30,-30,-30,-26,-26,-26,-26,-26,-26,-26,-26,-26,-24,-20,-20,-20}}},
+93
};
+94
+95
static const noise3 _psy_noisebias_16[4]={
+96
/* 63 125 250 500 1k 2k 4k 8k 16k*/
+97
{{{-10,-10,-10,-10, -5, -5, -5, 0, 4, 6, 8, 8, 10, 10, 10, 14, 20},
+98
{-10,-10,-10,-10,-10, -5, -2, -2, 0, 0, 0, 4, 5, 6, 8, 8, 15},
+99
{-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -6, -6}}},
+100
+101
{{{-10,-10,-10,-10, -5, -5, -5, 0, 4, 6, 6, 6, 6, 8, 10, 12, 20},
+102
{-15,-15,-15,-15,-15,-10, -5, -5, 0, 0, 0, 4, 5, 6, 8, 8, 15},
+103
{-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -6, -6}}},
+104
+105
{{{-15,-15,-15,-15,-15,-12,-10, -8, 0, 2, 4, 4, 5, 5, 5, 8, 12},
+106
{-20,-20,-20,-20,-16,-12,-20,-10, -5, -5, 0, 0, 0, 0, 0, 2, 5},
+107
{-30,-30,-30,-30,-26,-26,-26,-26,-26,-26,-26,-26,-26,-24,-20,-20,-20}}},
+108
+109
{{{-15,-15,-15,-15,-15,-12,-10, -8, -5, -5, -5, -5, -5, 0, 0, 0, 6},
+110
{-30,-30,-30,-30,-26,-22,-20,-14,-12,-12,-10,-10,-10,-10,-10,-10, -6},
+111
{-30,-30,-30,-30,-26,-26,-26,-26,-26,-26,-26,-26,-26,-24,-20,-20,-20}}},
+112
};
+113
+114
static const noiseguard _psy_noiseguards_16[4]={
+115
{10,10,-1},
+116
{10,10,-1},
+117
{20,20,-1},
+118
{20,20,-1},
+119
};
+120
+121
static const double _noise_thresh_16[4]={ .3,.5,.5,.5 };
+122
+123
static const int _noise_start_16[3]={ 256,256,9999 };
+124
static const int _noise_part_16[4]={ 8,8,8,8 };
+125
+126
static const int _psy_ath_floater_16[4]={
+127
-100,-100,-100,-105,
+128
};
+129
+130
static const int _psy_ath_abs_16[4]={
+131
-130,-130,-130,-140,
+132
};
vendor/vorbis/lib/modes/psych_44.hadded
@@ -0,0 +1,641 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 *
+9
* by the Xiph.Org Foundation https://xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: key psychoacoustic settings for 44.1/48kHz
+14
+15
********************************************************************/
+16
+17
+18
/* preecho trigger settings *****************************************/
+19
+20
static const vorbis_info_psy_global _psy_global_44[5]={
+21
+22
{8, /* lines per eighth octave */
+23
{20.f,14.f,12.f,12.f,12.f,12.f,12.f},
+24
{-60.f,-30.f,-40.f,-40.f,-40.f,-40.f,-40.f}, 2,-75.f,
+25
-6.f,
+26
{99.},{{99.},{99.}},{0},{0},{{0.},{0.}}
+27
},
+28
{8, /* lines per eighth octave */
+29
{14.f,10.f,10.f,10.f,10.f,10.f,10.f},
+30
{-40.f,-30.f,-25.f,-25.f,-25.f,-25.f,-25.f}, 2,-80.f,
+31
-6.f,
+32
{99.},{{99.},{99.}},{0},{0},{{0.},{0.}}
+33
},
+34
{8, /* lines per eighth octave */
+35
{12.f,10.f,10.f,10.f,10.f,10.f,10.f},
+36
{-20.f,-20.f,-15.f,-15.f,-15.f,-15.f,-15.f}, 0,-80.f,
+37
-6.f,
+38
{99.},{{99.},{99.}},{0},{0},{{0.},{0.}}
+39
},
+40
{8, /* lines per eighth octave */
+41
{10.f,8.f,8.f,8.f,8.f,8.f,8.f},
+42
{-20.f,-15.f,-12.f,-12.f,-12.f,-12.f,-12.f}, 0,-80.f,
+43
-6.f,
+44
{99.},{{99.},{99.}},{0},{0},{{0.},{0.}}
+45
},
+46
{8, /* lines per eighth octave */
+47
{10.f,6.f,6.f,6.f,6.f,6.f,6.f},
+48
{-15.f,-15.f,-12.f,-12.f,-12.f,-12.f,-12.f}, 0,-85.f,
+49
-6.f,
+50
{99.},{{99.},{99.}},{0},{0},{{0.},{0.}}
+51
},
+52
};
+53
+54
/* noise compander lookups * low, mid, high quality ****************/
+55
static const compandblock _psy_compand_44[6]={
+56
/* sub-mode Z short */
+57
{{
+58
0, 1, 2, 3, 4, 5, 6, 7, /* 7dB */
+59
8, 9,10,11,12,13,14, 15, /* 15dB */
+60
16,17,18,19,20,21,22, 23, /* 23dB */
+61
24,25,26,27,28,29,30, 31, /* 31dB */
+62
32,33,34,35,36,37,38, 39, /* 39dB */
+63
}},
+64
/* mode_Z nominal short */
+65
{{
+66
0, 1, 2, 3, 4, 5, 6, 6, /* 7dB */
+67
7, 7, 7, 7, 6, 6, 6, 7, /* 15dB */
+68
7, 8, 9,10,11,12,13, 14, /* 23dB */
+69
15,16,17,17,17,18,18, 19, /* 31dB */
+70
19,19,20,21,22,23,24, 25, /* 39dB */
+71
}},
+72
/* mode A short */
+73
{{
+74
0, 1, 2, 3, 4, 5, 5, 5, /* 7dB */
+75
6, 6, 6, 5, 4, 4, 4, 4, /* 15dB */
+76
4, 4, 5, 5, 5, 6, 6, 6, /* 23dB */
+77
7, 7, 7, 8, 8, 8, 9, 10, /* 31dB */
+78
11,12,13,14,15,16,17, 18, /* 39dB */
+79
}},
+80
/* sub-mode Z long */
+81
{{
+82
0, 1, 2, 3, 4, 5, 6, 7, /* 7dB */
+83
8, 9,10,11,12,13,14, 15, /* 15dB */
+84
16,17,18,19,20,21,22, 23, /* 23dB */
+85
24,25,26,27,28,29,30, 31, /* 31dB */
+86
32,33,34,35,36,37,38, 39, /* 39dB */
+87
}},
+88
/* mode_Z nominal long */
+89
{{
+90
0, 1, 2, 3, 4, 5, 6, 7, /* 7dB */
+91
8, 9,10,11,12,12,13, 13, /* 15dB */
+92
13,14,14,14,15,15,15, 15, /* 23dB */
+93
16,16,17,17,17,18,18, 19, /* 31dB */
+94
19,19,20,21,22,23,24, 25, /* 39dB */
+95
}},
+96
/* mode A long */
+97
{{
+98
0, 1, 2, 3, 4, 5, 6, 7, /* 7dB */
+99
8, 8, 7, 6, 5, 4, 4, 4, /* 15dB */
+100
4, 4, 5, 5, 5, 6, 6, 6, /* 23dB */
+101
7, 7, 7, 8, 8, 8, 9, 10, /* 31dB */
+102
11,12,13,14,15,16,17, 18, /* 39dB */
+103
}}
+104
};
+105
+106
/* tonal masking curve level adjustments *************************/
+107
+108
static const vp_adjblock _vp_tonemask_adj_longblock[12]={
+109
+110
/* 63 125 250 500 1 2 4 8 16 */
+111
+112
{{ -3, -8,-13,-15,-10,-10,-10,-10,-10,-10,-10, 0, 0, 0, 0, 0, 0}}, /* -1 */
+113
+114
/* {{-15,-15,-15,-15,-10, -8, -4, -2, 0, 0, 0, 10, 0, 0, 0, 0, 0}}, 0 */
+115
{{ -4,-10,-14,-16,-15,-14,-13,-12,-12,-12,-11, -1, -1, -1, -1, -1, 0}}, /* 0 */
+116
+117
/* {{-15,-15,-15,-15,-15,-12,-10, -8, 0, 0, 0, 5, 0, 0, 0, 0, 0}}, 1 */
+118
{{ -6,-12,-14,-16,-15,-15,-14,-13,-13,-12,-12, -2, -2, -1, -1, -1, 0}}, /* 1 */
+119
+120
/* {{-15,-15,-15,-15,-15,-12,-10, -8, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, 2 */
+121
{{-12,-13,-14,-16,-16,-16,-15,-14,-13,-12,-12, -6, -3, -1, -1, -1, 0}}, /* 2 */
+122
+123
/* {{-15,-15,-15,-15,-15,-12,-10, -8, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, 3 */
+124
{{-15,-15,-15,-16,-16,-16,-16,-14,-13,-13,-13,-10, -4, -2, -1, -1, 0}}, /* 3 */
+125
+126
/* {{-15,-15,-15,-15,-15,-12,-10, -8, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, *//* 4 */
+127
{{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-13,-11, -7 -3, -1, -1 , 0}}, /* 4 */
+128
+129
/* {{-15,-15,-15,-15,-15,-12,-10, -8, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, 5 */
+130
{{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-13,-11, -7 -3, -1, -1 , 0}}, /* 5 */
+131
+132
/* {{-15,-15,-15,-15,-15,-12,-10, -8, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, 6 */
+133
{{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-14,-12, -8, -4, -2, -2, 0}}, /* 6 */
+134
+135
/* {{-15,-15,-15,-15,-15,-12,-10, -8, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, 7 */
+136
{{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-14,-12, -9, -4, -2, -2, 0}}, /* 7 */
+137
+138
/* {{-15,-15,-15,-15,-15,-12,-10, -8, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, 8 */
+139
{{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-14,-12, -9, -4, -2, -2, 0}}, /* 8 */
+140
+141
/* {{-15,-15,-15,-15,-15,-12,-10, -8, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, 9 */
+142
{{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-14,-12, -9, -4, -2, -2, 0}}, /* 9 */
+143
+144
/* {{-15,-15,-15,-15,-15,-12,-10, -8, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, 10 */
+145
{{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-14,-12, -9, -4, -2, -2, 0}}, /* 10 */
+146
};
+147
+148
static const vp_adjblock _vp_tonemask_adj_otherblock[12]={
+149
/* 63 125 250 500 1 2 4 8 16 */
+150
+151
{{ -3, -8,-13,-15,-10,-10, -9, -9, -9, -9, -9, 1, 1, 1, 1, 1, 1}}, /* -1 */
+152
+153
/* {{-20,-20,-20,-20,-14,-12,-10, -8, -4, 0, 0, 10, 0, 0, 0, 0, 0}}, 0 */
+154
{{ -4,-10,-14,-16,-14,-13,-12,-12,-11,-11,-10, 0, 0, 0, 0, 0, 0}}, /* 0 */
+155
+156
/* {{-20,-20,-20,-20,-20,-18,-16,-14,-10, 0, 0, 5, 0, 0, 0, 0, 0}}, 1 */
+157
{{ -6,-12,-14,-16,-15,-15,-14,-13,-13,-12,-12, -2, -2, -1, 0, 0, 0}}, /* 1 */
+158
+159
/* {{-20,-20,-20,-20,-20,-18,-16,-14,-10, 0, 0, 0, 0, 0, 0, 0, 0}}, 2 */
+160
{{-12,-13,-14,-16,-16,-16,-15,-14,-13,-12,-12, -5, -2, -1, 0, 0, 0}}, /* 2 */
+161
+162
/* {{-20,-20,-20,-20,-20,-18,-16,-14,-10, 0, 0, 0, 0, 0, 0, 0, 0}}, 3 */
+163
{{-15,-15,-15,-16,-16,-16,-16,-14,-13,-13,-13,-10, -4, -2, 0, 0, 0}}, /* 3 */
+164
+165
/* {{-20,-20,-20,-20,-20,-18,-16,-14,-10, 0, 0, 0, 0, 0, 0, 0, 0}}, 4 */
+166
{{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-13,-11, -7 -3, -1, -1 , 0}}, /* 4 */
+167
+168
/* {{-20,-20,-20,-20,-20,-18,-16,-14,-10, 0, 0, 0, 0, 0, 0, 0, 0}}, 5 */
+169
{{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-13,-11, -7 -3, -1, -1 , 0}}, /* 5 */
+170
+171
/* {{-20,-20,-20,-20,-20,-18,-16,-14,-10, 0, 0, 0, 0, 0, 0, 0, 0}}, 6 */
+172
{{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-14,-12, -8, -4, -2, -2, 0}}, /* 6 */
+173
+174
/* {{-20,-20,-20,-20,-20,-18,-16,-14,-10, 0, 0, 0, 0, 0, 0, 0, 0}}, 7 */
+175
{{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-14,-12, -9, -4, -2, -2, 0}}, /* 7 */
+176
+177
/* {{-20,-20,-20,-20,-20,-18,-16,-14,-10, 0, 0, 0, 0, 0, 0, 0, 0}}, 8 */
+178
{{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-14,-12, -9, -4, -2, -2, 0}}, /* 8 */
+179
+180
/* {{-20,-20,-20,-20,-20,-18,-16,-14,-10, 0, 0, 0, 0, 0, 0, 0, 0}}, 9 */
+181
{{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-14,-12, -9, -4, -2, -2, 0}}, /* 9 */
+182
+183
/* {{-20,-20,-20,-20,-20,-18,-16,-14,-10, 0, 0, 0, 0, 0, 0, 0, 0}}, 10 */
+184
{{-16,-16,-16,-16,-16,-16,-16,-15,-14,-14,-14,-12, -9, -4, -2, -2, 0}}, /* 10 */
+185
};
+186
+187
/* noise bias (transition block) */
+188
static const noise3 _psy_noisebias_trans[12]={
+189
/* 63 125 250 500 1k 2k 4k 8k 16k*/
+190
/* -1 */
+191
{{{-10,-10,-10,-10,-10, -4, 0, 0, 4, 8, 8, 8, 8, 10, 12, 14, 20},
+192
{-30,-30,-30,-30,-26,-20,-16, -8, -6, -6, -2, 2, 2, 3, 6, 6, 15},
+193
{-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -4, -2}}},
+194
/* 0
+195
{{{-15,-15,-15,-15,-15,-12,-10, -8, 0, 2, 4, 4, 5, 5, 5, 8, 10},
+196
{-30,-30,-30,-30,-26,-22,-20,-14, -8, -4, 0, 0, 0, 0, 2, 4, 10},
+197
{-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -6, -6, -6, -4, -4, -4, -2}}},*/
+198
{{{-15,-15,-15,-15,-15,-12, -6, -4, 0, 2, 4, 4, 5, 5, 5, 8, 10},
+199
{-30,-30,-30,-30,-26,-22,-20,-14, -8, -4, 0, 0, 0, 0, 2, 3, 6},
+200
{-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -6, -6, -6, -4, -4, -4, -2}}},
+201
/* 1
+202
{{{-15,-15,-15,-15,-15,-12,-10, -8, 0, 2, 4, 4, 5, 5, 5, 8, 10},
+203
{-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -2, -2, -2, -2, 0, 2, 8},
+204
{-30,-30,-30,-30,-26,-22,-20,-14,-10, -8, -8, -8, -8, -6, -6, -6, -4}}},*/
+205
{{{-15,-15,-15,-15,-15,-12,-10, -8, 0, 2, 4, 4, 5, 5, 5, 8, 10},
+206
{-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -2, -2, -2, -2, 0, 1, 4},
+207
{-30,-30,-30,-30,-26,-22,-20,-14,-10, -8, -8, -8, -8, -6, -6, -6, -4}}},
+208
/* 2
+209
{{{-15,-15,-15,-15,-15,-12,-10, -8, 0, 2, 2, 2, 4, 4, 5, 6, 10},
+210
{-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -2, -2, -2, -2, 0, 2, 6},
+211
{-30,-30,-30,-30,-26,-22,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -4}}}, */
+212
{{{-15,-15,-15,-15,-15,-12,-10, -8, 0, 2, 2, 2, 4, 4, 5, 6, 10},
+213
{-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -3, -3, -3, -2, -1, 0, 3},
+214
{-30,-30,-30,-30,-26,-22,-20,-14,-10,-10,-10,-10,-10, -8, -8, -7, -4}}},
+215
/* 3
+216
{{{-15,-15,-15,-15,-15,-12,-10, -8, 0, 2, 2, 2, 4, 4, 4, 5, 8},
+217
{-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -3, -3, -3, -3, -1, 1, 6},
+218
{-30,-30,-30,-30,-26,-22,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -4}}},*/
+219
{{{-15,-15,-15,-15,-15,-12,-10, -8, 0, 2, 2, 2, 4, 4, 4, 5, 8},
+220
{-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -3, -3, -3, -3, -2, 0, 2},
+221
{-30,-30,-30,-30,-26,-22,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -4}}},
+222
/* 4
+223
{{{-20,-20,-20,-20,-20,-18,-14, -8, -1, 1, 1, 1, 2, 3, 3, 4, 7},
+224
{-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -3, -3, -3, -3, -1, 1, 5},
+225
{-30,-30,-30,-30,-26,-22,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -4}}},*/
+226
{{{-20,-20,-20,-20,-20,-18,-14, -8, -1, 1, 1, 1, 2, 3, 3, 4, 7},
+227
{-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -3, -3, -3, -3, -2, -1, 1},
+228
{-30,-30,-30,-30,-26,-22,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -4}}},
+229
/* 5
+230
{{{-24,-24,-24,-24,-20,-18,-14, -8, -1, 1, 1, 1, 2, 3, 3, 4, 7},
+231
{-32,-32,-32,-32,-28,-24,-22,-16,-12, -6, -4, -4, -4, -4, -2, -1, 2},
+232
{-34,-34,-34,-34,-30,-24,-24,-18,-14,-12,-12,-12,-12,-10,-10, -9, -5}}}, */
+233
{{{-24,-24,-24,-24,-20,-18,-14, -8, -1, 1, 1, 1, 2, 3, 3, 4, 7},
+234
{-32,-32,-32,-32,-28,-24,-22,-16,-12, -6, -4, -4, -4, -4, -3, -1, 0},
+235
{-34,-34,-34,-34,-30,-24,-24,-18,-14,-12,-12,-12,-12,-10,-10, -9, -5}}},
+236
/* 6
+237
{{{-24,-24,-24,-24,-20,-18,-14, -8, -1, 1, 1, 1, 2, 3, 3, 4, 7},
+238
{-32,-32,-32,-32,-28,-24,-24,-18,-14, -8, -6, -6, -6, -6, -4, -2, 1},
+239
{-34,-34,-34,-34,-30,-26,-24,-18,-17,-15,-15,-15,-15,-13,-13,-12, -8}}},*/
+240
{{{-24,-24,-24,-24,-20,-18,-14, -8, -1, 1, 1, 1, 2, 3, 3, 4, 7},
+241
{-32,-32,-32,-32,-28,-24,-24,-18,-14, -8, -6, -6, -6, -6, -5, -2, 0},
+242
{-34,-34,-34,-34,-30,-26,-26,-24,-22,-19,-19,-19,-19,-18,-17,-16,-12}}},
+243
/* 7
+244
{{{-24,-24,-24,-24,-20,-18,-14, -8, -1, 1, 1, 1, 2, 3, 3, 4, 7},
+245
{-32,-32,-32,-32,-28,-24,-24,-18,-14,-12,-10, -8, -8, -8, -6, -4, 0},
+246
{-34,-34,-34,-34,-30,-26,-26,-24,-22,-19,-19,-19,-19,-18,-17,-16,-12}}},*/
+247
{{{-24,-24,-24,-24,-20,-18,-14, -8, -1, 1, 1, 1, 2, 3, 3, 4, 7},
+248
{-32,-32,-32,-32,-28,-24,-24,-24,-18,-14,-12,-10,-10,-10, -8, -6, -2},
+249
{-34,-34,-34,-34,-30,-26,-26,-26,-24,-24,-24,-24,-24,-24,-24,-20,-16}}},
+250
/* 8
+251
{{{-24,-24,-24,-24,-22,-20,-15,-10, -8, -2, 0, 0, 0, 1, 2, 3, 7},
+252
{-36,-36,-36,-36,-30,-30,-30,-24,-18,-14,-12,-10,-10,-10, -8, -6, -2},
+253
{-36,-36,-36,-36,-34,-30,-28,-26,-24,-24,-24,-24,-24,-24,-24,-20,-16}}},*/
+254
{{{-24,-24,-24,-24,-22,-20,-15,-10, -8, -2, 0, 0, 0, 1, 2, 3, 7},
+255
{-36,-36,-36,-36,-30,-30,-30,-24,-20,-16,-16,-16,-16,-14,-12,-10, -7},
+256
{-36,-36,-36,-36,-34,-30,-28,-26,-24,-30,-30,-30,-30,-30,-30,-24,-20}}},
+257
/* 9
+258
{{{-28,-28,-28,-28,-28,-28,-28,-20,-14, -8, -4, -4, -4, -4, -4, -2, 2},
+259
{-36,-36,-36,-36,-34,-32,-32,-28,-20,-16,-16,-16,-16,-14,-12,-10, -7},
+260
{-40,-40,-40,-40,-40,-40,-40,-32,-30,-30,-30,-30,-30,-30,-30,-24,-20}}},*/
+261
{{{-28,-28,-28,-28,-28,-28,-28,-20,-14, -8, -4, -4, -4, -4, -4, -2, 2},
+262
{-38,-38,-38,-38,-36,-34,-34,-30,-24,-20,-20,-20,-20,-18,-16,-12,-10},
+263
{-40,-40,-40,-40,-40,-40,-40,-38,-35,-35,-35,-35,-35,-35,-35,-35,-30}}},
+264
/* 10 */
+265
{{{-30,-30,-30,-30,-30,-30,-30,-28,-20,-14,-14,-14,-14,-14,-14,-12,-10},
+266
{-40,-40,-40,-40,-40,-40,-40,-40,-35,-30,-30,-30,-30,-30,-30,-30,-20},
+267
{-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40}}},
+268
};
+269
+270
/* noise bias (long block) */
+271
static const noise3 _psy_noisebias_long[12]={
+272
/*63 125 250 500 1k 2k 4k 8k 16k*/
+273
/* -1 */
+274
{{{-10,-10,-10,-10,-10, -4, 0, 0, 0, 6, 6, 6, 6, 10, 10, 12, 20},
+275
{-20,-20,-20,-20,-20,-20,-10, -2, 0, 0, 0, 0, 0, 2, 4, 6, 15},
+276
{-20,-20,-20,-20,-20,-20,-20,-10, -6, -6, -6, -6, -6, -4, -4, -4, -2}}},
+277
+278
/* 0 */
+279
/* {{{-10,-10,-10,-10,-10,-10, -8, 2, 2, 2, 4, 4, 5, 5, 5, 8, 10},
+280
{-20,-20,-20,-20,-20,-20,-20,-14, -6, 0, 0, 0, 0, 0, 2, 4, 10},
+281
{-20,-20,-20,-20,-20,-20,-20,-14, -8, -6, -6, -6, -6, -4, -4, -4, -2}}},*/
+282
{{{-10,-10,-10,-10,-10,-10, -8, 2, 2, 2, 4, 4, 5, 5, 5, 8, 10},
+283
{-20,-20,-20,-20,-20,-20,-20,-14, -6, 0, 0, 0, 0, 0, 2, 3, 6},
+284
{-20,-20,-20,-20,-20,-20,-20,-14, -8, -6, -6, -6, -6, -4, -4, -4, -2}}},
+285
/* 1 */
+286
/* {{{-10,-10,-10,-10,-10,-10, -8, -4, 0, 2, 4, 4, 5, 5, 5, 8, 10},
+287
{-20,-20,-20,-20,-20,-20,-20,-14,-10, -4, -2, -2, -2, -2, 0, 2, 8},
+288
{-20,-20,-20,-20,-20,-20,-20,-14,-10, -8, -8, -8, -8, -6, -6, -6, -4}}},*/
+289
{{{-10,-10,-10,-10,-10,-10, -8, -4, 0, 2, 4, 4, 5, 5, 5, 8, 10},
+290
{-20,-20,-20,-20,-20,-20,-20,-14,-10, -4, -2, -2, -2, -2, 0, 1, 4},
+291
{-20,-20,-20,-20,-20,-20,-20,-14,-10, -8, -8, -8, -8, -6, -6, -6, -4}}},
+292
/* 2 */
+293
/* {{{-10,-10,-10,-10,-10,-10,-10, -8, 0, 2, 2, 2, 4, 4, 5, 6, 10},
+294
{-20,-20,-20,-20,-20,-20,-20,-14,-10, -4, -2, -2, -2, -2, 0, 2, 6},
+295
{-20,-20,-20,-20,-20,-20,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -4}}},*/
+296
{{{-10,-10,-10,-10,-10,-10,-10, -8, 0, 2, 2, 2, 4, 4, 5, 6, 10},
+297
{-20,-20,-20,-20,-20,-20,-20,-14,-10, -4, -3, -3, -3, -2, -1, 0, 3},
+298
{-20,-20,-20,-20,-20,-20,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -4}}},
+299
/* 3 */
+300
/* {{{-10,-10,-10,-10,-10,-10,-10, -8, 0, 2, 2, 2, 4, 4, 4, 5, 8},
+301
{-20,-20,-20,-20,-20,-20,-20,-14,-10, -4, -3, -3, -3, -3, -1, 1, 6},
+302
{-20,-20,-20,-20,-20,-20,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -4}}},*/
+303
{{{-10,-10,-10,-10,-10,-10,-10, -8, 0, 2, 2, 2, 4, 4, 4, 5, 8},
+304
{-20,-20,-20,-20,-20,-20,-20,-14,-10, -4, -3, -3, -3, -3, -2, 0, 2},
+305
{-20,-20,-20,-20,-20,-20,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -5}}},
+306
/* 4 */
+307
/* {{{-15,-15,-15,-15,-15,-15,-15,-10, -4, 1, 1, 1, 2, 3, 3, 4, 7},
+308
{-20,-20,-20,-20,-20,-20,-20,-14,-10, -4, -3, -3, -3, -3, -1, 1, 5},
+309
{-20,-20,-20,-20,-20,-20,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -4}}},*/
+310
{{{-15,-15,-15,-15,-15,-15,-15,-10, -4, 1, 1, 1, 2, 3, 3, 4, 7},
+311
{-20,-20,-20,-20,-20,-20,-20,-14,-10, -4, -3, -3, -3, -3, -2, -1, 1},
+312
{-20,-20,-20,-20,-20,-20,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -7}}},
+313
/* 5 */
+314
/* {{{-15,-15,-15,-15,-15,-15,-15,-10, -4, 1, 1, 1, 2, 3, 3, 4, 7},
+315
{-22,-22,-22,-22,-22,-22,-22,-16,-12, -6, -4, -4, -4, -4, -2, -1, 2},
+316
{-24,-24,-24,-24,-24,-24,-24,-18,-14,-12,-12,-12,-12,-10,-10, -9, -5}}},*/
+317
{{{-15,-15,-15,-15,-15,-15,-15,-10, -4, 1, 1, 1, 2, 3, 3, 4, 7},
+318
{-22,-22,-22,-22,-22,-22,-22,-16,-12, -6, -4, -4, -4, -4, -3, -1, 0},
+319
{-24,-24,-24,-24,-24,-24,-24,-18,-14,-12,-12,-12,-12,-10,-10, -9, -8}}},
+320
/* 6 */
+321
/* {{{-15,-15,-15,-15,-15,-15,-15,-10, -4, 1, 1, 1, 2, 3, 3, 4, 7},
+322
{-24,-24,-24,-24,-24,-24,-24,-18,-14, -8, -6, -6, -6, -6, -4, -2, 1},
+323
{-26,-26,-26,-26,-26,-26,-26,-18,-16,-15,-15,-15,-15,-13,-13,-12, -8}}},*/
+324
{{{-15,-15,-15,-15,-15,-15,-15,-10, -4, 1, 1, 1, 2, 3, 3, 4, 7},
+325
{-24,-24,-24,-24,-24,-24,-24,-18,-14, -8, -6, -6, -6, -6, -5, -2, 0},
+326
{-26,-26,-26,-26,-26,-26,-26,-18,-16,-15,-15,-15,-15,-13,-13,-12,-10}}},
+327
/* 7 */
+328
{{{-15,-15,-15,-15,-15,-15,-15,-10, -4, 1, 1, 1, 2, 3, 3, 4, 7},
+329
{-24,-24,-24,-24,-24,-24,-24,-18,-14,-10, -8, -8, -8, -8, -6, -4, 0},
+330
{-26,-26,-26,-26,-26,-26,-26,-22,-20,-19,-19,-19,-19,-18,-17,-16,-12}}},
+331
/* 8 */
+332
{{{-15,-15,-15,-15,-15,-15,-15,-10, -4, 0, 0, 0, 0, 1, 2, 3, 7},
+333
{-26,-26,-26,-26,-26,-26,-26,-20,-16,-12,-10,-10,-10,-10, -8, -6, -2},
+334
{-28,-28,-28,-28,-28,-28,-28,-26,-24,-24,-24,-24,-24,-24,-24,-20,-16}}},
+335
/* 9 */
+336
{{{-22,-22,-22,-22,-22,-22,-22,-18,-14, -8, -4, -4, -4, -4, -4, -2, 2},
+337
{-26,-26,-26,-26,-26,-26,-26,-22,-18,-16,-16,-16,-16,-14,-12,-10, -7},
+338
{-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-24,-20}}},
+339
/* 10 */
+340
{{{-24,-24,-24,-24,-24,-24,-24,-24,-24,-18,-14,-14,-14,-14,-14,-12,-10},
+341
{-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-20},
+342
{-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40}}},
+343
};
+344
+345
/* noise bias (impulse block) */
+346
static const noise3 _psy_noisebias_impulse[12]={
+347
/* 63 125 250 500 1k 2k 4k 8k 16k*/
+348
/* -1 */
+349
{{{-10,-10,-10,-10,-10, -4, 0, 0, 4, 8, 8, 8, 8, 10, 12, 14, 20},
+350
{-30,-30,-30,-30,-26,-20,-16, -8, -6, -6, -2, 2, 2, 3, 6, 6, 15},
+351
{-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -4, -2}}},
+352
+353
/* 0 */
+354
/* {{{-10,-10,-10,-10,-10, -4, 0, 0, 4, 4, 8, 8, 8, 10, 12, 14, 20},
+355
{-30,-30,-30,-30,-26,-22,-20,-14, -6, -2, 0, 0, 0, 0, 2, 4, 10},
+356
{-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -4, -2}}},*/
+357
{{{-10,-10,-10,-10,-10, -4, 0, 0, 4, 4, 8, 8, 8, 10, 12, 14, 20},
+358
{-30,-30,-30,-30,-26,-22,-20,-14, -6, -2, 0, 0, 0, 0, 2, 3, 6},
+359
{-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -4, -2}}},
+360
/* 1 */
+361
{{{-12,-12,-12,-12,-12, -8, -6, -4, 0, 4, 4, 4, 4, 10, 12, 14, 20},
+362
{-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -4, -4, -2, -2, -2, -2, 2},
+363
{-30,-30,-30,-30,-26,-22,-20,-14,-10, -8,-10,-10, -8, -8, -8, -6, -4}}},
+364
/* 2 */
+365
{{{-14,-14,-14,-14,-14,-10, -8, -6, -2, 2, 2, 2, 2, 8, 10, 10, 16},
+366
{-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -6, -6, -4, -4, -4, -2, 0},
+367
{-30,-30,-30,-30,-26,-22,-20,-14,-10,-10,-10,-10,-10,-10,-10, -8, -4}}},
+368
/* 3 */
+369
{{{-14,-14,-14,-14,-14,-10, -8, -6, -2, 2, 2, 2, 2, 6, 8, 8, 14},
+370
{-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -6, -6, -4, -4, -4, -2, 0},
+371
{-30,-30,-30,-30,-26,-22,-20,-14,-10,-10,-10,-10,-10,-10,-10, -8, -4}}},
+372
/* 4 */
+373
{{{-16,-16,-16,-16,-16,-12,-10, -6, -2, 0, 0, 0, 0, 4, 6, 6, 12},
+374
{-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -6, -6, -4, -4, -4, -2, 0},
+375
{-30,-30,-30,-30,-26,-22,-20,-14,-10,-10,-10,-10,-10,-10,-10, -8, -4}}},
+376
/* 5 */
+377
{{{-20,-20,-20,-20,-20,-18,-14,-10, -4, 0, 0, 0, 0, 4, 4, 6, 11},
+378
{-32,-32,-32,-32,-28,-24,-22,-16,-10, -6, -8, -8, -6, -6, -6, -4, -2},
+379
{-34,-34,-34,-34,-30,-26,-24,-18,-14,-12,-12,-12,-12,-12,-10, -9, -5}}},
+380
/* 6
+381
{{{-20,-20,-20,-20,-20,-18,-14,-10, -4, 0, 0, 0, 0, 4, 4, 6, 11},
+382
{-34,-34,-34,-34,-30,-30,-24,-20,-12,-12,-14,-14,-10, -9, -8, -6, -4},
+383
{-34,-34,-34,-34,-34,-30,-26,-20,-16,-15,-15,-15,-15,-15,-13,-12, -8}}},*/
+384
{{{-20,-20,-20,-20,-20,-18,-14,-10, -4, 0, 0, 0, 0, 4, 4, 6, 11},
+385
{-34,-34,-34,-34,-30,-30,-30,-24,-16,-16,-16,-16,-16,-16,-14,-14,-12},
+386
{-36,-36,-36,-36,-36,-34,-28,-24,-20,-20,-20,-20,-20,-20,-20,-18,-16}}},
+387
/* 7 */
+388
/* {{{-22,-22,-22,-22,-22,-20,-14,-10, -6, 0, 0, 0, 0, 4, 4, 6, 11},
+389
{-34,-34,-34,-34,-30,-30,-24,-20,-14,-14,-16,-16,-14,-12,-10,-10,-10},
+390
{-34,-34,-34,-34,-32,-32,-30,-24,-20,-19,-19,-19,-19,-19,-17,-16,-12}}},*/
+391
{{{-22,-22,-22,-22,-22,-20,-14,-10, -6, 0, 0, 0, 0, 4, 4, 6, 11},
+392
{-34,-34,-34,-34,-30,-30,-30,-30,-26,-26,-26,-26,-26,-26,-26,-24,-22},
+393
{-40,-40,-40,-40,-40,-40,-40,-32,-30,-30,-30,-30,-30,-30,-30,-30,-24}}},
+394
/* 8 */
+395
/* {{{-24,-24,-24,-24,-24,-22,-14,-10, -6, -1, -1, -1, -1, 3, 3, 5, 10},
+396
{-34,-34,-34,-34,-30,-30,-30,-24,-20,-20,-20,-20,-20,-18,-16,-16,-14},
+397
{-36,-36,-36,-36,-36,-34,-28,-24,-24,-24,-24,-24,-24,-24,-24,-20,-16}}},*/
+398
{{{-24,-24,-24,-24,-24,-22,-14,-10, -6, -1, -1, -1, -1, 3, 3, 5, 10},
+399
{-34,-34,-34,-34,-34,-32,-32,-30,-26,-26,-26,-26,-26,-26,-26,-26,-24},
+400
{-40,-40,-40,-40,-40,-40,-40,-32,-30,-30,-30,-30,-30,-30,-30,-30,-24}}},
+401
/* 9 */
+402
/* {{{-28,-28,-28,-28,-28,-28,-28,-20,-14, -8, -4, -4, -4, -4, -4, -2, 2},
+403
{-36,-36,-36,-36,-34,-32,-32,-30,-26,-26,-26,-26,-26,-22,-20,-20,-18},
+404
{-40,-40,-40,-40,-40,-40,-40,-32,-30,-30,-30,-30,-30,-30,-30,-24,-20}}},*/
+405
{{{-28,-28,-28,-28,-28,-28,-28,-20,-14, -8, -4, -4, -4, -4, -4, -2, 2},
+406
{-36,-36,-36,-36,-34,-32,-32,-30,-26,-26,-26,-26,-26,-26,-26,-26,-26},
+407
{-40,-40,-40,-40,-40,-40,-40,-32,-30,-30,-30,-30,-30,-30,-30,-24,-20}}},
+408
/* 10 */
+409
{{{-30,-30,-30,-30,-30,-26,-24,-24,-24,-20,-16,-16,-16,-16,-16,-14,-12},
+410
{-40,-40,-40,-40,-40,-40,-40,-40,-35,-30,-30,-30,-30,-30,-30,-30,-26},
+411
{-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40}}},
+412
};
+413
+414
/* noise bias (padding block) */
+415
static const noise3 _psy_noisebias_padding[12]={
+416
/* 63 125 250 500 1k 2k 4k 8k 16k*/
+417
+418
/* -1 */
+419
{{{-10,-10,-10,-10,-10, -4, 0, 0, 4, 8, 8, 8, 8, 10, 12, 14, 20},
+420
{-30,-30,-30,-30,-26,-20,-16, -8, -6, -6, -2, 2, 2, 3, 6, 6, 15},
+421
{-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -4, -2}}},
+422
+423
/* 0 */
+424
{{{-10,-10,-10,-10,-10, -4, 0, 0, 4, 8, 8, 8, 8, 10, 12, 14, 20},
+425
{-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -2, 2, 3, 6, 6, 8, 10},
+426
{-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -4, -4, -4, -4, -2, 0, 2}}},
+427
/* 1 */
+428
{{{-12,-12,-12,-12,-12, -8, -6, -4, 0, 4, 4, 4, 4, 10, 12, 14, 20},
+429
{-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, 0, 0, 0, 2, 2, 4, 8},
+430
{-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -6, -6, -6, -6, -4, -2, 0}}},
+431
/* 2 */
+432
/* {{{-14,-14,-14,-14,-14,-10, -8, -6, -2, 2, 2, 2, 2, 8, 10, 10, 16},
+433
{-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, 0, 0, 0, 2, 2, 4, 8},
+434
{-30,-30,-30,-30,-26,-22,-20,-14,-10, -8, -8, -8, -8, -8, -6, -4, -2}}},*/
+435
{{{-14,-14,-14,-14,-14,-10, -8, -6, -2, 2, 2, 2, 2, 8, 10, 10, 16},
+436
{-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -1, -1, -1, 0, 0, 2, 6},
+437
{-30,-30,-30,-30,-26,-22,-20,-14,-10, -8, -8, -8, -8, -8, -6, -4, -2}}},
+438
/* 3 */
+439
{{{-14,-14,-14,-14,-14,-10, -8, -6, -2, 2, 2, 2, 2, 6, 8, 8, 14},
+440
{-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -1, -1, -1, 0, 0, 2, 6},
+441
{-30,-30,-30,-30,-26,-22,-20,-14,-10, -8, -8, -8, -8, -8, -6, -4, -2}}},
+442
/* 4 */
+443
{{{-16,-16,-16,-16,-16,-12,-10, -6, -2, 0, 0, 0, 0, 4, 6, 6, 12},
+444
{-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -1, -1, -1, -1, 0, 2, 6},
+445
{-30,-30,-30,-30,-26,-22,-20,-14,-10, -8, -8, -8, -8, -8, -6, -4, -2}}},
+446
/* 5 */
+447
{{{-20,-20,-20,-20,-20,-18,-14,-10, -4, 0, 0, 0, 0, 4, 6, 6, 12},
+448
{-32,-32,-32,-32,-28,-24,-22,-16,-12, -6, -3, -3, -3, -3, -2, 0, 4},
+449
{-34,-34,-34,-34,-30,-26,-24,-18,-14,-10,-10,-10,-10,-10, -8, -5, -3}}},
+450
/* 6 */
+451
{{{-20,-20,-20,-20,-20,-18,-14,-10, -4, 0, 0, 0, 0, 4, 6, 6, 12},
+452
{-34,-34,-34,-34,-30,-30,-24,-20,-14, -8, -4, -4, -4, -4, -3, -1, 4},
+453
{-34,-34,-34,-34,-34,-30,-26,-20,-16,-13,-13,-13,-13,-13,-11, -8, -6}}},
+454
/* 7 */
+455
{{{-20,-20,-20,-20,-20,-18,-14,-10, -4, 0, 0, 0, 0, 4, 6, 6, 12},
+456
{-34,-34,-34,-34,-30,-30,-30,-24,-16,-10, -8, -6, -6, -6, -5, -3, 1},
+457
{-34,-34,-34,-34,-32,-32,-28,-22,-18,-16,-16,-16,-16,-16,-14,-12,-10}}},
+458
/* 8 */
+459
{{{-22,-22,-22,-22,-22,-20,-14,-10, -4, 0, 0, 0, 0, 3, 5, 5, 11},
+460
{-34,-34,-34,-34,-30,-30,-30,-24,-16,-12,-10, -8, -8, -8, -7, -5, -2},
+461
{-36,-36,-36,-36,-36,-34,-28,-22,-20,-20,-20,-20,-20,-20,-20,-16,-14}}},
+462
/* 9 */
+463
{{{-28,-28,-28,-28,-28,-28,-28,-20,-14, -8, -2, -2, -2, -2, 0, 2, 6},
+464
{-36,-36,-36,-36,-34,-32,-32,-24,-16,-12,-12,-12,-12,-12,-10, -8, -5},
+465
{-40,-40,-40,-40,-40,-40,-40,-32,-26,-24,-24,-24,-24,-24,-24,-20,-18}}},
+466
/* 10 */
+467
{{{-30,-30,-30,-30,-30,-26,-24,-24,-24,-20,-12,-12,-12,-12,-12,-10, -8},
+468
{-40,-40,-40,-40,-40,-40,-40,-40,-35,-30,-25,-25,-25,-25,-25,-25,-15},
+469
{-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40}}},
+470
};
+471
+472
+473
static const noiseguard _psy_noiseguards_44[4]={
+474
{3,3,15},
+475
{3,3,15},
+476
{10,10,100},
+477
{10,10,100},
+478
};
+479
+480
static const int _psy_tone_suppress[12]={
+481
-20,-20,-20,-20,-20,-24,-30,-40,-40,-45,-45,-45,
+482
};
+483
static const int _psy_tone_0dB[12]={
+484
90,90,95,95,95,95,105,105,105,105,105,105,
+485
};
+486
static const int _psy_noise_suppress[12]={
+487
-20,-20,-24,-24,-24,-24,-30,-40,-40,-45,-45,-45,
+488
};
+489
+490
static const vorbis_info_psy _psy_info_template={
+491
/* blockflag */
+492
-1,
+493
/* ath_adjatt, ath_maxatt */
+494
-140.,-140.,
+495
/* tonemask att boost/decay,suppr,curves */
+496
{0.f,0.f,0.f}, 0.,0., -40.f, {0.},
+497
+498
/*noisemaskp,supp, low/high window, low/hi guard, minimum */
+499
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
@@ -0,0 +1,100 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 *
+9
* by the Xiph.Org Foundation https://xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: 8kHz psychoacoustic settings
+14
+15
********************************************************************/
+16
+17
static const att3 _psy_tone_masteratt_8[3]={
+18
{{ 32, 25, 12}, 0, 0}, /* 0 */
+19
{{ 30, 25, 12}, 0, 0}, /* 0 */
+20
{{ 20, 0, -14}, 0, 0}, /* 0 */
+21
};
+22
+23
static const vp_adjblock _vp_tonemask_adj_8[3]={
+24
/* adjust for mode zero */
+25
/* 63 125 250 500 1 2 4 8 16 */
+26
{{-15,-15,-15,-15,-10,-10, -6, 0, 0, 0, 0,10, 0, 0,99,99,99}}, /* 1 */
+27
{{-15,-15,-15,-15,-10,-10, -6, 0, 0, 0, 0,10, 0, 0,99,99,99}}, /* 1 */
+28
{{-15,-15,-15,-15,-10,-10, -6, 0, 0, 0, 0, 0, 0, 0,99,99,99}}, /* 1 */
+29
};
+30
+31
+32
static const noise3 _psy_noisebias_8[3]={
+33
/* 63 125 250 500 1k 2k 4k 8k 16k*/
+34
{{{-10,-10,-10,-10, -5, -5, -5, 0, 4, 8, 8, 8, 10, 10, 99, 99, 99},
+35
{-10,-10,-10,-10, -5, -5, -5, 0, 0, 4, 4, 4, 4, 4, 99, 99, 99},
+36
{-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, 99, 99, 99}}},
+37
+38
{{{-10,-10,-10,-10, -5, -5, -5, 0, 4, 8, 8, 8, 10, 10, 99, 99, 99},
+39
{-10,-10,-10,-10,-10,-10, -5, -5, -5, 0, 0, 0, 0, 0, 99, 99, 99},
+40
{-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, 99, 99, 99}}},
+41
+42
{{{-15,-15,-15,-15,-15,-12,-10, -8, 0, 2, 4, 4, 5, 5, 99, 99, 99},
+43
{-30,-30,-30,-30,-26,-22,-20,-14,-12,-12,-10,-10,-10,-10, 99, 99, 99},
+44
{-30,-30,-30,-30,-26,-26,-26,-26,-26,-26,-26,-26,-26,-24, 99, 99, 99}}},
+45
};
+46
+47
/* stereo mode by base quality level */
+48
static const adj_stereo _psy_stereo_modes_8[3]={
+49
/* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 */
+50
{{ 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3},
+51
{ 6, 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4},
+52
{ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
+53
{ 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
+54
{{ 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3},
+55
{ 6, 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4},
+56
{ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
+57
{ 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
+58
{{ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3},
+59
{ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4},
+60
{ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
+61
{ 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
+62
};
+63
+64
static const noiseguard _psy_noiseguards_8[2]={
+65
{10,10,-1},
+66
{10,10,-1},
+67
};
+68
+69
static const compandblock _psy_compand_8[2]={
+70
{{
+71
0, 1, 2, 3, 4, 5, 6, 7, /* 7dB */
+72
8, 8, 9, 9,10,10,11, 11, /* 15dB */
+73
12,12,13,13,14,14,15, 15, /* 23dB */
+74
16,16,17,17,17,18,18, 19, /* 31dB */
+75
19,19,20,21,22,23,24, 25, /* 39dB */
+76
}},
+77
{{
+78
0, 1, 2, 3, 4, 5, 6, 6, /* 7dB */
+79
7, 7, 6, 6, 5, 5, 4, 4, /* 15dB */
+80
3, 3, 3, 4, 5, 6, 7, 8, /* 23dB */
+81
9,10,11,12,13,14,15, 16, /* 31dB */
+82
17,18,19,20,21,22,23, 24, /* 39dB */
+83
}},
+84
};
+85
+86
static const double _psy_lowpass_8[3]={3.,4.,4.};
+87
static const int _noise_start_8[2]={
+88
64,64,
+89
};
+90
static const int _noise_part_8[2]={
+91
8,8,
+92
};
+93
+94
static const int _psy_ath_floater_8[3]={
+95
-100,-100,-105,
+96
};
+97
+98
static const int _psy_ath_abs_8[3]={
+99
-130,-130,-140,
+100
};
vendor/vorbis/lib/modes/residue_16.hadded
@@ -0,0 +1,162 @@
+1
/********************************************************************
+2
* *
+3
* This FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 *
+9
* by the Xiph.Org Foundation https://xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: toplevel residue templates 16/22kHz
+14
+15
********************************************************************/
+16
+17
/***** residue backends *********************************************/
+18
+19
static const static_bookblock _resbook_16s_0={
+20
{
+21
{0},
+22
{0,0,&_16c0_s_p1_0},
+23
{0},
+24
{0,0,&_16c0_s_p3_0},
+25
{0,0,&_16c0_s_p4_0},
+26
{0,0,&_16c0_s_p5_0},
+27
{0,0,&_16c0_s_p6_0},
+28
{&_16c0_s_p7_0,&_16c0_s_p7_1},
+29
{&_16c0_s_p8_0,&_16c0_s_p8_1},
+30
{&_16c0_s_p9_0,&_16c0_s_p9_1,&_16c0_s_p9_2}
+31
}
+32
};
+33
static const static_bookblock _resbook_16s_1={
+34
{
+35
{0},
+36
{0,0,&_16c1_s_p1_0},
+37
{0},
+38
{0,0,&_16c1_s_p3_0},
+39
{0,0,&_16c1_s_p4_0},
+40
{0,0,&_16c1_s_p5_0},
+41
{0,0,&_16c1_s_p6_0},
+42
{&_16c1_s_p7_0,&_16c1_s_p7_1},
+43
{&_16c1_s_p8_0,&_16c1_s_p8_1},
+44
{&_16c1_s_p9_0,&_16c1_s_p9_1,&_16c1_s_p9_2}
+45
}
+46
};
+47
static const static_bookblock _resbook_16s_2={
+48
{
+49
{0},
+50
{0,0,&_16c2_s_p1_0},
+51
{0,0,&_16c2_s_p2_0},
+52
{0,0,&_16c2_s_p3_0},
+53
{0,0,&_16c2_s_p4_0},
+54
{&_16c2_s_p5_0,&_16c2_s_p5_1},
+55
{&_16c2_s_p6_0,&_16c2_s_p6_1},
+56
{&_16c2_s_p7_0,&_16c2_s_p7_1},
+57
{&_16c2_s_p8_0,&_16c2_s_p8_1},
+58
{&_16c2_s_p9_0,&_16c2_s_p9_1,&_16c2_s_p9_2}
+59
}
+60
};
+61
+62
static const vorbis_residue_template _res_16s_0[]={
+63
{2,0,32, &_residue_44_mid,
+64
&_huff_book__16c0_s_single,&_huff_book__16c0_s_single,
+65
&_resbook_16s_0,&_resbook_16s_0},
+66
};
+67
static const vorbis_residue_template _res_16s_1[]={
+68
{2,0,32, &_residue_44_mid,
+69
&_huff_book__16c1_s_short,&_huff_book__16c1_s_short,
+70
&_resbook_16s_1,&_resbook_16s_1},
+71
+72
{2,0,32, &_residue_44_mid,
+73
&_huff_book__16c1_s_long,&_huff_book__16c1_s_long,
+74
&_resbook_16s_1,&_resbook_16s_1}
+75
};
+76
static const vorbis_residue_template _res_16s_2[]={
+77
{2,0,32, &_residue_44_high,
+78
&_huff_book__16c2_s_short,&_huff_book__16c2_s_short,
+79
&_resbook_16s_2,&_resbook_16s_2},
+80
+81
{2,0,32, &_residue_44_high,
+82
&_huff_book__16c2_s_long,&_huff_book__16c2_s_long,
+83
&_resbook_16s_2,&_resbook_16s_2}
+84
};
+85
+86
static const vorbis_mapping_template _mapres_template_16_stereo[3]={
+87
{ _map_nominal, _res_16s_0 }, /* 0 */
+88
{ _map_nominal, _res_16s_1 }, /* 1 */
+89
{ _map_nominal, _res_16s_2 }, /* 2 */
+90
};
+91
+92
static const static_bookblock _resbook_16u_0={
+93
{
+94
{0},
+95
{0,0,&_16u0__p1_0},
+96
{0,0,&_16u0__p2_0},
+97
{0,0,&_16u0__p3_0},
+98
{0,0,&_16u0__p4_0},
+99
{0,0,&_16u0__p5_0},
+100
{&_16u0__p6_0,&_16u0__p6_1},
+101
{&_16u0__p7_0,&_16u0__p7_1,&_16u0__p7_2}
+102
}
+103
};
+104
static const static_bookblock _resbook_16u_1={
+105
{
+106
{0},
+107
{0,0,&_16u1__p1_0},
+108
{0,0,&_16u1__p2_0},
+109
{0,0,&_16u1__p3_0},
+110
{0,0,&_16u1__p4_0},
+111
{0,0,&_16u1__p5_0},
+112
{0,0,&_16u1__p6_0},
+113
{&_16u1__p7_0,&_16u1__p7_1},
+114
{&_16u1__p8_0,&_16u1__p8_1},
+115
{&_16u1__p9_0,&_16u1__p9_1,&_16u1__p9_2}
+116
}
+117
};
+118
static const static_bookblock _resbook_16u_2={
+119
{
+120
{0},
+121
{0,0,&_16u2_p1_0},
+122
{0,0,&_16u2_p2_0},
+123
{0,0,&_16u2_p3_0},
+124
{0,0,&_16u2_p4_0},
+125
{&_16u2_p5_0,&_16u2_p5_1},
+126
{&_16u2_p6_0,&_16u2_p6_1},
+127
{&_16u2_p7_0,&_16u2_p7_1},
+128
{&_16u2_p8_0,&_16u2_p8_1},
+129
{&_16u2_p9_0,&_16u2_p9_1,&_16u2_p9_2}
+130
}
+131
};
+132
+133
static const vorbis_residue_template _res_16u_0[]={
+134
{1,0,32, &_residue_44_low_un,
+135
&_huff_book__16u0__single,&_huff_book__16u0__single,
+136
&_resbook_16u_0,&_resbook_16u_0},
+137
};
+138
static const vorbis_residue_template _res_16u_1[]={
+139
{1,0,32, &_residue_44_mid_un,
+140
&_huff_book__16u1__short,&_huff_book__16u1__short,
+141
&_resbook_16u_1,&_resbook_16u_1},
+142
+143
{1,0,32, &_residue_44_mid_un,
+144
&_huff_book__16u1__long,&_huff_book__16u1__long,
+145
&_resbook_16u_1,&_resbook_16u_1}
+146
};
+147
static const vorbis_residue_template _res_16u_2[]={
+148
{1,0,32, &_residue_44_hi_un,
+149
&_huff_book__16u2__short,&_huff_book__16u2__short,
+150
&_resbook_16u_2,&_resbook_16u_2},
+151
+152
{1,0,32, &_residue_44_hi_un,
+153
&_huff_book__16u2__long,&_huff_book__16u2__long,
+154
&_resbook_16u_2,&_resbook_16u_2}
+155
};
+156
+157
+158
static const vorbis_mapping_template _mapres_template_16_uncoupled[3]={
+159
{ _map_nominal_u, _res_16u_0 }, /* 0 */
+160
{ _map_nominal_u, _res_16u_1 }, /* 1 */
+161
{ _map_nominal_u, _res_16u_2 }, /* 2 */
+162
};
vendor/vorbis/lib/modes/residue_44.hadded
@@ -0,0 +1,291 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 *
+9
* by the Xiph.Org Foundation https://xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: toplevel residue templates for 32/44.1/48kHz
+14
+15
********************************************************************/
+16
+17
#include "vorbis/codec.h"
+18
#include "backends.h"
+19
#include "books/coupled/res_books_stereo.h"
+20
+21
/***** residue backends *********************************************/
+22
+23
static const vorbis_info_residue0 _residue_44_low={
+24
0,-1, -1, 9,-1,-1,
+25
/* 0 1 2 3 4 5 6 7 */
+26
{0},
+27
{-1},
+28
{ 0, 1, 2, 2, 4, 8, 16, 32},
+29
{ 0, 0, 0,999, 4, 8, 16, 32},
+30
};
+31
+32
static const vorbis_info_residue0 _residue_44_mid={
+33
0,-1, -1, 10,-1,-1,
+34
/* 0 1 2 3 4 5 6 7 8 */
+35
{0},
+36
{-1},
+37
{ 0, 1, 1, 2, 2, 4, 8, 16, 32},
+38
{ 0, 0,999, 0,999, 4, 8, 16, 32},
+39
};
+40
+41
static const vorbis_info_residue0 _residue_44_high={
+42
0,-1, -1, 10,-1,-1,
+43
/* 0 1 2 3 4 5 6 7 8 */
+44
{0},
+45
{-1},
+46
{ 0, 1, 2, 4, 8, 16, 32, 71,157},
+47
{ 0, 1, 2, 3, 4, 8, 16, 71,157},
+48
};
+49
+50
static const static_bookblock _resbook_44s_n1={
+51
{
+52
{0},{0,0,&_44cn1_s_p1_0},{0,0,&_44cn1_s_p2_0},
+53
{0,0,&_44cn1_s_p3_0},{0,0,&_44cn1_s_p4_0},{0,0,&_44cn1_s_p5_0},
+54
{&_44cn1_s_p6_0,&_44cn1_s_p6_1},{&_44cn1_s_p7_0,&_44cn1_s_p7_1},
+55
{&_44cn1_s_p8_0,&_44cn1_s_p8_1,&_44cn1_s_p8_2}
+56
}
+57
};
+58
static const static_bookblock _resbook_44sm_n1={
+59
{
+60
{0},{0,0,&_44cn1_sm_p1_0},{0,0,&_44cn1_sm_p2_0},
+61
{0,0,&_44cn1_sm_p3_0},{0,0,&_44cn1_sm_p4_0},{0,0,&_44cn1_sm_p5_0},
+62
{&_44cn1_sm_p6_0,&_44cn1_sm_p6_1},{&_44cn1_sm_p7_0,&_44cn1_sm_p7_1},
+63
{&_44cn1_sm_p8_0,&_44cn1_sm_p8_1,&_44cn1_sm_p8_2}
+64
}
+65
};
+66
+67
static const static_bookblock _resbook_44s_0={
+68
{
+69
{0},{0,0,&_44c0_s_p1_0},{0,0,&_44c0_s_p2_0},
+70
{0,0,&_44c0_s_p3_0},{0,0,&_44c0_s_p4_0},{0,0,&_44c0_s_p5_0},
+71
{&_44c0_s_p6_0,&_44c0_s_p6_1},{&_44c0_s_p7_0,&_44c0_s_p7_1},
+72
{&_44c0_s_p8_0,&_44c0_s_p8_1,&_44c0_s_p8_2}
+73
}
+74
};
+75
static const static_bookblock _resbook_44sm_0={
+76
{
+77
{0},{0,0,&_44c0_sm_p1_0},{0,0,&_44c0_sm_p2_0},
+78
{0,0,&_44c0_sm_p3_0},{0,0,&_44c0_sm_p4_0},{0,0,&_44c0_sm_p5_0},
+79
{&_44c0_sm_p6_0,&_44c0_sm_p6_1},{&_44c0_sm_p7_0,&_44c0_sm_p7_1},
+80
{&_44c0_sm_p8_0,&_44c0_sm_p8_1,&_44c0_sm_p8_2}
+81
}
+82
};
+83
+84
static const static_bookblock _resbook_44s_1={
+85
{
+86
{0},{0,0,&_44c1_s_p1_0},{0,0,&_44c1_s_p2_0},
+87
{0,0,&_44c1_s_p3_0},{0,0,&_44c1_s_p4_0},{0,0,&_44c1_s_p5_0},
+88
{&_44c1_s_p6_0,&_44c1_s_p6_1},{&_44c1_s_p7_0,&_44c1_s_p7_1},
+89
{&_44c1_s_p8_0,&_44c1_s_p8_1,&_44c1_s_p8_2}
+90
}
+91
};
+92
static const static_bookblock _resbook_44sm_1={
+93
{
+94
{0},{0,0,&_44c1_sm_p1_0},{0,0,&_44c1_sm_p2_0},
+95
{0,0,&_44c1_sm_p3_0},{0,0,&_44c1_sm_p4_0},{0,0,&_44c1_sm_p5_0},
+96
{&_44c1_sm_p6_0,&_44c1_sm_p6_1},{&_44c1_sm_p7_0,&_44c1_sm_p7_1},
+97
{&_44c1_sm_p8_0,&_44c1_sm_p8_1,&_44c1_sm_p8_2}
+98
}
+99
};
+100
+101
static const static_bookblock _resbook_44s_2={
+102
{
+103
{0},{0,0,&_44c2_s_p1_0},{0,0,&_44c2_s_p2_0},{0,0,&_44c2_s_p3_0},
+104
{0,0,&_44c2_s_p4_0},{0,0,&_44c2_s_p5_0},{0,0,&_44c2_s_p6_0},
+105
{&_44c2_s_p7_0,&_44c2_s_p7_1},{&_44c2_s_p8_0,&_44c2_s_p8_1},
+106
{&_44c2_s_p9_0,&_44c2_s_p9_1,&_44c2_s_p9_2}
+107
}
+108
};
+109
static const static_bookblock _resbook_44s_3={
+110
{
+111
{0},{0,0,&_44c3_s_p1_0},{0,0,&_44c3_s_p2_0},{0,0,&_44c3_s_p3_0},
+112
{0,0,&_44c3_s_p4_0},{0,0,&_44c3_s_p5_0},{0,0,&_44c3_s_p6_0},
+113
{&_44c3_s_p7_0,&_44c3_s_p7_1},{&_44c3_s_p8_0,&_44c3_s_p8_1},
+114
{&_44c3_s_p9_0,&_44c3_s_p9_1,&_44c3_s_p9_2}
+115
}
+116
};
+117
static const static_bookblock _resbook_44s_4={
+118
{
+119
{0},{0,0,&_44c4_s_p1_0},{0,0,&_44c4_s_p2_0},{0,0,&_44c4_s_p3_0},
+120
{0,0,&_44c4_s_p4_0},{0,0,&_44c4_s_p5_0},{0,0,&_44c4_s_p6_0},
+121
{&_44c4_s_p7_0,&_44c4_s_p7_1},{&_44c4_s_p8_0,&_44c4_s_p8_1},
+122
{&_44c4_s_p9_0,&_44c4_s_p9_1,&_44c4_s_p9_2}
+123
}
+124
};
+125
static const static_bookblock _resbook_44s_5={
+126
{
+127
{0},{0,0,&_44c5_s_p1_0},{0,0,&_44c5_s_p2_0},{0,0,&_44c5_s_p3_0},
+128
{0,0,&_44c5_s_p4_0},{0,0,&_44c5_s_p5_0},{0,0,&_44c5_s_p6_0},
+129
{&_44c5_s_p7_0,&_44c5_s_p7_1},{&_44c5_s_p8_0,&_44c5_s_p8_1},
+130
{&_44c5_s_p9_0,&_44c5_s_p9_1,&_44c5_s_p9_2}
+131
}
+132
};
+133
static const static_bookblock _resbook_44s_6={
+134
{
+135
{0},{0,0,&_44c6_s_p1_0},{0,0,&_44c6_s_p2_0},{0,0,&_44c6_s_p3_0},
+136
{0,0,&_44c6_s_p4_0},
+137
{&_44c6_s_p5_0,&_44c6_s_p5_1},
+138
{&_44c6_s_p6_0,&_44c6_s_p6_1},
+139
{&_44c6_s_p7_0,&_44c6_s_p7_1},
+140
{&_44c6_s_p8_0,&_44c6_s_p8_1},
+141
{&_44c6_s_p9_0,&_44c6_s_p9_1,&_44c6_s_p9_2}
+142
}
+143
};
+144
static const static_bookblock _resbook_44s_7={
+145
{
+146
{0},{0,0,&_44c7_s_p1_0},{0,0,&_44c7_s_p2_0},{0,0,&_44c7_s_p3_0},
+147
{0,0,&_44c7_s_p4_0},
+148
{&_44c7_s_p5_0,&_44c7_s_p5_1},
+149
{&_44c7_s_p6_0,&_44c7_s_p6_1},
+150
{&_44c7_s_p7_0,&_44c7_s_p7_1},
+151
{&_44c7_s_p8_0,&_44c7_s_p8_1},
+152
{&_44c7_s_p9_0,&_44c7_s_p9_1,&_44c7_s_p9_2}
+153
}
+154
};
+155
static const static_bookblock _resbook_44s_8={
+156
{
+157
{0},{0,0,&_44c8_s_p1_0},{0,0,&_44c8_s_p2_0},{0,0,&_44c8_s_p3_0},
+158
{0,0,&_44c8_s_p4_0},
+159
{&_44c8_s_p5_0,&_44c8_s_p5_1},
+160
{&_44c8_s_p6_0,&_44c8_s_p6_1},
+161
{&_44c8_s_p7_0,&_44c8_s_p7_1},
+162
{&_44c8_s_p8_0,&_44c8_s_p8_1},
+163
{&_44c8_s_p9_0,&_44c8_s_p9_1,&_44c8_s_p9_2}
+164
}
+165
};
+166
static const static_bookblock _resbook_44s_9={
+167
{
+168
{0},{0,0,&_44c9_s_p1_0},{0,0,&_44c9_s_p2_0},{0,0,&_44c9_s_p3_0},
+169
{0,0,&_44c9_s_p4_0},
+170
{&_44c9_s_p5_0,&_44c9_s_p5_1},
+171
{&_44c9_s_p6_0,&_44c9_s_p6_1},
+172
{&_44c9_s_p7_0,&_44c9_s_p7_1},
+173
{&_44c9_s_p8_0,&_44c9_s_p8_1},
+174
{&_44c9_s_p9_0,&_44c9_s_p9_1,&_44c9_s_p9_2}
+175
}
+176
};
+177
+178
static const vorbis_residue_template _res_44s_n1[]={
+179
{2,0,32, &_residue_44_low,
+180
&_huff_book__44cn1_s_short,&_huff_book__44cn1_sm_short,
+181
&_resbook_44s_n1,&_resbook_44sm_n1},
+182
+183
{2,0,32, &_residue_44_low,
+184
&_huff_book__44cn1_s_long,&_huff_book__44cn1_sm_long,
+185
&_resbook_44s_n1,&_resbook_44sm_n1}
+186
};
+187
static const vorbis_residue_template _res_44s_0[]={
+188
{2,0,16, &_residue_44_low,
+189
&_huff_book__44c0_s_short,&_huff_book__44c0_sm_short,
+190
&_resbook_44s_0,&_resbook_44sm_0},
+191
+192
{2,0,32, &_residue_44_low,
+193
&_huff_book__44c0_s_long,&_huff_book__44c0_sm_long,
+194
&_resbook_44s_0,&_resbook_44sm_0}
+195
};
+196
static const vorbis_residue_template _res_44s_1[]={
+197
{2,0,16, &_residue_44_low,
+198
&_huff_book__44c1_s_short,&_huff_book__44c1_sm_short,
+199
&_resbook_44s_1,&_resbook_44sm_1},
+200
+201
{2,0,32, &_residue_44_low,
+202
&_huff_book__44c1_s_long,&_huff_book__44c1_sm_long,
+203
&_resbook_44s_1,&_resbook_44sm_1}
+204
};
+205
+206
static const vorbis_residue_template _res_44s_2[]={
+207
{2,0,16, &_residue_44_mid,
+208
&_huff_book__44c2_s_short,&_huff_book__44c2_s_short,
+209
&_resbook_44s_2,&_resbook_44s_2},
+210
+211
{2,0,32, &_residue_44_mid,
+212
&_huff_book__44c2_s_long,&_huff_book__44c2_s_long,
+213
&_resbook_44s_2,&_resbook_44s_2}
+214
};
+215
static const vorbis_residue_template _res_44s_3[]={
+216
{2,0,16, &_residue_44_mid,
+217
&_huff_book__44c3_s_short,&_huff_book__44c3_s_short,
+218
&_resbook_44s_3,&_resbook_44s_3},
+219
+220
{2,0,32, &_residue_44_mid,
+221
&_huff_book__44c3_s_long,&_huff_book__44c3_s_long,
+222
&_resbook_44s_3,&_resbook_44s_3}
+223
};
+224
static const vorbis_residue_template _res_44s_4[]={
+225
{2,0,16, &_residue_44_mid,
+226
&_huff_book__44c4_s_short,&_huff_book__44c4_s_short,
+227
&_resbook_44s_4,&_resbook_44s_4},
+228
+229
{2,0,32, &_residue_44_mid,
+230
&_huff_book__44c4_s_long,&_huff_book__44c4_s_long,
+231
&_resbook_44s_4,&_resbook_44s_4}
+232
};
+233
static const vorbis_residue_template _res_44s_5[]={
+234
{2,0,16, &_residue_44_mid,
+235
&_huff_book__44c5_s_short,&_huff_book__44c5_s_short,
+236
&_resbook_44s_5,&_resbook_44s_5},
+237
+238
{2,0,32, &_residue_44_mid,
+239
&_huff_book__44c5_s_long,&_huff_book__44c5_s_long,
+240
&_resbook_44s_5,&_resbook_44s_5}
+241
};
+242
static const vorbis_residue_template _res_44s_6[]={
+243
{2,0,16, &_residue_44_high,
+244
&_huff_book__44c6_s_short,&_huff_book__44c6_s_short,
+245
&_resbook_44s_6,&_resbook_44s_6},
+246
+247
{2,0,32, &_residue_44_high,
+248
&_huff_book__44c6_s_long,&_huff_book__44c6_s_long,
+249
&_resbook_44s_6,&_resbook_44s_6}
+250
};
+251
static const vorbis_residue_template _res_44s_7[]={
+252
{2,0,16, &_residue_44_high,
+253
&_huff_book__44c7_s_short,&_huff_book__44c7_s_short,
+254
&_resbook_44s_7,&_resbook_44s_7},
+255
+256
{2,0,32, &_residue_44_high,
+257
&_huff_book__44c7_s_long,&_huff_book__44c7_s_long,
+258
&_resbook_44s_7,&_resbook_44s_7}
+259
};
+260
static const vorbis_residue_template _res_44s_8[]={
+261
{2,0,16, &_residue_44_high,
+262
&_huff_book__44c8_s_short,&_huff_book__44c8_s_short,
+263
&_resbook_44s_8,&_resbook_44s_8},
+264
+265
{2,0,32, &_residue_44_high,
+266
&_huff_book__44c8_s_long,&_huff_book__44c8_s_long,
+267
&_resbook_44s_8,&_resbook_44s_8}
+268
};
+269
static const vorbis_residue_template _res_44s_9[]={
+270
{2,0,16, &_residue_44_high,
+271
&_huff_book__44c9_s_short,&_huff_book__44c9_s_short,
+272
&_resbook_44s_9,&_resbook_44s_9},
+273
+274
{2,0,32, &_residue_44_high,
+275
&_huff_book__44c9_s_long,&_huff_book__44c9_s_long,
+276
&_resbook_44s_9,&_resbook_44s_9}
+277
};
+278
+279
static const vorbis_mapping_template _mapres_template_44_stereo[]={
+280
{ _map_nominal, _res_44s_n1 }, /* -1 */
+281
{ _map_nominal, _res_44s_0 }, /* 0 */
+282
{ _map_nominal, _res_44s_1 }, /* 1 */
+283
{ _map_nominal, _res_44s_2 }, /* 2 */
+284
{ _map_nominal, _res_44s_3 }, /* 3 */
+285
{ _map_nominal, _res_44s_4 }, /* 4 */
+286
{ _map_nominal, _res_44s_5 }, /* 5 */
+287
{ _map_nominal, _res_44s_6 }, /* 6 */
+288
{ _map_nominal, _res_44s_7 }, /* 7 */
+289
{ _map_nominal, _res_44s_8 }, /* 8 */
+290
{ _map_nominal, _res_44s_9 }, /* 9 */
+291
};
vendor/vorbis/lib/modes/residue_44p51.hadded
@@ -0,0 +1,450 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2010 *
+9
* by the Xiph.Org Foundation https://xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: toplevel residue templates for 32/44.1/48kHz uncoupled
+14
+15
********************************************************************/
+16
+17
#include "vorbis/codec.h"
+18
#include "backends.h"
+19
+20
#include "books/coupled/res_books_51.h"
+21
+22
/***** residue backends *********************************************/
+23
+24
static const vorbis_info_residue0 _residue_44p_lo={
+25
0,-1, -1, 7,-1,-1,
+26
/* 0 1 2 3 4 5 6 7 8 */
+27
{0},
+28
{-1},
+29
{ 0, 1, 2, 7, 17, 31},
+30
{ 0, 0, 99, 7, 17, 31},
+31
};
+32
+33
static const vorbis_info_residue0 _residue_44p={
+34
0,-1, -1, 8,-1,-1,
+35
/* 0 1 2 3 4 5 6 7 8 */
+36
{0},
+37
{-1},
+38
{ 0, 1, 1, 2, 7, 17, 31},
+39
{ 0, 0, 99, 99, 7, 17, 31},
+40
};
+41
+42
static const vorbis_info_residue0 _residue_44p_hi={
+43
0,-1, -1, 8,-1,-1,
+44
/* 0 1 2 3 4 5 6 7 8 */
+45
{0},
+46
{-1},
+47
{ 0, 1, 2, 4, 7, 17, 31},
+48
{ 0, 1, 2, 4, 7, 17, 31},
+49
};
+50
+51
static const vorbis_info_residue0 _residue_44p_lfe={
+52
0,-1, -1, 2,-1,-1,
+53
/* 0 1 2 3 4 5 6 7 8 */
+54
{0},
+55
{-1},
+56
{ 32},
+57
{ -1}
+58
};
+59
+60
static const static_bookblock _resbook_44p_n1={
+61
{
+62
{0},
+63
{0,&_44pn1_p1_0},
+64
+65
{&_44pn1_p2_0,&_44pn1_p2_1,0},
+66
{&_44pn1_p3_0,&_44pn1_p3_1,0},
+67
{&_44pn1_p4_0,&_44pn1_p4_1,0},
+68
+69
{&_44pn1_p5_0,&_44pn1_p5_1,&_44pn1_p4_1},
+70
{&_44pn1_p6_0,&_44pn1_p6_1,&_44pn1_p6_2},
+71
}
+72
};
+73
+74
static const static_bookblock _resbook_44p_0={
+75
{
+76
{0},
+77
{0,&_44p0_p1_0},
+78
+79
{&_44p0_p2_0,&_44p0_p2_1,0},
+80
{&_44p0_p3_0,&_44p0_p3_1,0},
+81
{&_44p0_p4_0,&_44p0_p4_1,0},
+82
+83
{&_44p0_p5_0,&_44p0_p5_1,&_44p0_p4_1},
+84
{&_44p0_p6_0,&_44p0_p6_1,&_44p0_p6_2},
+85
}
+86
};
+87
+88
static const static_bookblock _resbook_44p_1={
+89
{
+90
{0},
+91
{0,&_44p1_p1_0},
+92
+93
{&_44p1_p2_0,&_44p1_p2_1,0},
+94
{&_44p1_p3_0,&_44p1_p3_1,0},
+95
{&_44p1_p4_0,&_44p1_p4_1,0},
+96
+97
{&_44p1_p5_0,&_44p1_p5_1,&_44p1_p4_1},
+98
{&_44p1_p6_0,&_44p1_p6_1,&_44p1_p6_2},
+99
}
+100
};
+101
+102
static const static_bookblock _resbook_44p_2={
+103
{
+104
{0},
+105
{0,0,&_44p2_p1_0},
+106
{0,&_44p2_p2_0,0},
+107
+108
{&_44p2_p3_0,&_44p2_p3_1,0},
+109
{&_44p2_p4_0,&_44p2_p4_1,0},
+110
{&_44p2_p5_0,&_44p2_p5_1,0},
+111
+112
{&_44p2_p6_0,&_44p2_p6_1,&_44p2_p5_1},
+113
{&_44p2_p7_0,&_44p2_p7_1,&_44p2_p7_2,&_44p2_p7_3}
+114
}
+115
};
+116
static const static_bookblock _resbook_44p_3={
+117
{
+118
{0},
+119
{0,0,&_44p3_p1_0},
+120
{0,&_44p3_p2_0,0},
+121
+122
{&_44p3_p3_0,&_44p3_p3_1,0},
+123
{&_44p3_p4_0,&_44p3_p4_1,0},
+124
{&_44p3_p5_0,&_44p3_p5_1,0},
+125
+126
{&_44p3_p6_0,&_44p3_p6_1,&_44p3_p5_1},
+127
{&_44p3_p7_0,&_44p3_p7_1,&_44p3_p7_2,&_44p3_p7_3}
+128
}
+129
};
+130
static const static_bookblock _resbook_44p_4={
+131
{
+132
{0},
+133
{0,0,&_44p4_p1_0},
+134
{0,&_44p4_p2_0,0},
+135
+136
{&_44p4_p3_0,&_44p4_p3_1,0},
+137
{&_44p4_p4_0,&_44p4_p4_1,0},
+138
{&_44p4_p5_0,&_44p4_p5_1,0},
+139
+140
{&_44p4_p6_0,&_44p4_p6_1,&_44p4_p5_1},
+141
{&_44p4_p7_0,&_44p4_p7_1,&_44p4_p7_2,&_44p4_p7_3}
+142
}
+143
};
+144
static const static_bookblock _resbook_44p_5={
+145
{
+146
{0},
+147
{0,0,&_44p5_p1_0},
+148
{0,&_44p5_p2_0,0},
+149
+150
{&_44p5_p3_0,&_44p5_p3_1,0},
+151
{&_44p5_p4_0,&_44p5_p4_1,0},
+152
{&_44p5_p5_0,&_44p5_p5_1,0},
+153
+154
{&_44p5_p6_0,&_44p5_p6_1,&_44p5_p5_1},
+155
{&_44p5_p7_0,&_44p5_p7_1,&_44p5_p7_2,&_44p5_p7_3}
+156
}
+157
};
+158
static const static_bookblock _resbook_44p_6={
+159
{
+160
{0},
+161
{0,0,&_44p6_p1_0},
+162
{0,&_44p6_p2_0,0},
+163
+164
{&_44p6_p3_0,&_44p6_p3_1,0},
+165
{&_44p6_p4_0,&_44p6_p4_1,0},
+166
{&_44p6_p5_0,&_44p6_p5_1,0},
+167
+168
{&_44p6_p6_0,&_44p6_p6_1,&_44p6_p5_1},
+169
{&_44p6_p7_0,&_44p6_p7_1,&_44p6_p7_2,&_44p6_p7_3}
+170
}
+171
};
+172
static const static_bookblock _resbook_44p_7={
+173
{
+174
{0},
+175
{0,0,&_44p7_p1_0},
+176
{0,&_44p7_p2_0,0},
+177
+178
{&_44p7_p3_0,&_44p7_p3_1,0},
+179
{&_44p7_p4_0,&_44p7_p4_1,0},
+180
{&_44p7_p5_0,&_44p7_p5_1,0},
+181
+182
{&_44p7_p6_0,&_44p7_p6_1,&_44p7_p5_1},
+183
{&_44p7_p7_0,&_44p7_p7_1,&_44p7_p7_2,&_44p7_p7_3}
+184
}
+185
};
+186
static const static_bookblock _resbook_44p_8={
+187
{
+188
{0},
+189
{0,0,&_44p8_p1_0},
+190
{0,&_44p8_p2_0,0},
+191
+192
{&_44p8_p3_0,&_44p8_p3_1,0},
+193
{&_44p8_p4_0,&_44p8_p4_1,0},
+194
{&_44p8_p5_0,&_44p8_p5_1,0},
+195
+196
{&_44p8_p6_0,&_44p8_p6_1,&_44p8_p5_1},
+197
{&_44p8_p7_0,&_44p8_p7_1,&_44p8_p7_2,&_44p8_p7_3}
+198
}
+199
};
+200
static const static_bookblock _resbook_44p_9={
+201
{
+202
{0},
+203
{0,0,&_44p9_p1_0},
+204
{0,&_44p9_p2_0,0},
+205
+206
{&_44p9_p3_0,&_44p9_p3_1,0},
+207
{&_44p9_p4_0,&_44p9_p4_1,0},
+208
{&_44p9_p5_0,&_44p9_p5_1,0},
+209
+210
{&_44p9_p6_0,&_44p9_p6_1,&_44p9_p5_1},
+211
{&_44p9_p7_0,&_44p9_p7_1,&_44p9_p7_2,&_44p9_p7_3}
+212
}
+213
};
+214
+215
static const static_bookblock _resbook_44p_ln1={
+216
{
+217
{&_44pn1_l0_0,&_44pn1_l0_1,0},
+218
{&_44pn1_l1_0,&_44pn1_p6_1,&_44pn1_p6_2},
+219
}
+220
};
+221
static const static_bookblock _resbook_44p_l0={
+222
{
+223
{&_44p0_l0_0,&_44p0_l0_1,0},
+224
{&_44p0_l1_0,&_44p0_p6_1,&_44p0_p6_2},
+225
}
+226
};
+227
static const static_bookblock _resbook_44p_l1={
+228
{
+229
{&_44p1_l0_0,&_44p1_l0_1,0},
+230
{&_44p1_l1_0,&_44p1_p6_1,&_44p1_p6_2},
+231
}
+232
};
+233
static const static_bookblock _resbook_44p_l2={
+234
{
+235
{&_44p2_l0_0,&_44p2_l0_1,0},
+236
{&_44p2_l1_0,&_44p2_p7_2,&_44p2_p7_3},
+237
}
+238
};
+239
static const static_bookblock _resbook_44p_l3={
+240
{
+241
{&_44p3_l0_0,&_44p3_l0_1,0},
+242
{&_44p3_l1_0,&_44p3_p7_2,&_44p3_p7_3},
+243
}
+244
};
+245
static const static_bookblock _resbook_44p_l4={
+246
{
+247
{&_44p4_l0_0,&_44p4_l0_1,0},
+248
{&_44p4_l1_0,&_44p4_p7_2,&_44p4_p7_3},
+249
}
+250
};
+251
static const static_bookblock _resbook_44p_l5={
+252
{
+253
{&_44p5_l0_0,&_44p5_l0_1,0},
+254
{&_44p5_l1_0,&_44p5_p7_2,&_44p5_p7_3},
+255
}
+256
};
+257
static const static_bookblock _resbook_44p_l6={
+258
{
+259
{&_44p6_l0_0,&_44p6_l0_1,0},
+260
{&_44p6_l1_0,&_44p6_p7_2,&_44p6_p7_3},
+261
}
+262
};
+263
static const static_bookblock _resbook_44p_l7={
+264
{
+265
{&_44p7_l0_0,&_44p7_l0_1,0},
+266
{&_44p7_l1_0,&_44p7_p7_2,&_44p7_p7_3},
+267
}
+268
};
+269
static const static_bookblock _resbook_44p_l8={
+270
{
+271
{&_44p8_l0_0,&_44p8_l0_1,0},
+272
{&_44p8_l1_0,&_44p8_p7_2,&_44p8_p7_3},
+273
}
+274
};
+275
static const static_bookblock _resbook_44p_l9={
+276
{
+277
{&_44p9_l0_0,&_44p9_l0_1,0},
+278
{&_44p9_l1_0,&_44p9_p7_2,&_44p9_p7_3},
+279
}
+280
};
+281
+282
+283
static const vorbis_info_mapping0 _map_nominal_51[2]={
+284
{2, {0,0,0,0,0,1}, {0,2}, {0,2}, 4,{0,3,0,0},{2,4,1,3}},
+285
{2, {0,0,0,0,0,1}, {1,2}, {1,2}, 4,{0,3,0,0},{2,4,1,3}}
+286
};
+287
static const vorbis_info_mapping0 _map_nominal_51u[2]={
+288
{2, {0,0,0,0,0,1}, {0,2}, {0,2}, 0,{0},{0}},
+289
{2, {0,0,0,0,0,1}, {1,2}, {1,2}, 0,{0},{0}}
+290
};
+291
+292
static const vorbis_residue_template _res_44p51_n1[]={
+293
{2,0,30, &_residue_44p_lo,
+294
&_huff_book__44pn1_short,&_huff_book__44pn1_short,
+295
&_resbook_44p_n1,&_resbook_44p_n1},
+296
+297
{2,0,30, &_residue_44p_lo,
+298
&_huff_book__44pn1_long,&_huff_book__44pn1_long,
+299
&_resbook_44p_n1,&_resbook_44p_n1},
+300
+301
{1,2,6, &_residue_44p_lfe,
+302
&_huff_book__44pn1_lfe,&_huff_book__44pn1_lfe,
+303
&_resbook_44p_ln1,&_resbook_44p_ln1}
+304
};
+305
static const vorbis_residue_template _res_44p51_0[]={
+306
{2,0,15, &_residue_44p_lo,
+307
&_huff_book__44p0_short,&_huff_book__44p0_short,
+308
&_resbook_44p_0,&_resbook_44p_0},
+309
+310
{2,0,30, &_residue_44p_lo,
+311
&_huff_book__44p0_long,&_huff_book__44p0_long,
+312
&_resbook_44p_0,&_resbook_44p_0},
+313
+314
{1,2,6, &_residue_44p_lfe,
+315
&_huff_book__44p0_lfe,&_huff_book__44p0_lfe,
+316
&_resbook_44p_l0,&_resbook_44p_l0}
+317
};
+318
static const vorbis_residue_template _res_44p51_1[]={
+319
{2,0,15, &_residue_44p_lo,
+320
&_huff_book__44p1_short,&_huff_book__44p1_short,
+321
&_resbook_44p_1,&_resbook_44p_1},
+322
+323
{2,0,30, &_residue_44p_lo,
+324
&_huff_book__44p1_long,&_huff_book__44p1_long,
+325
&_resbook_44p_1,&_resbook_44p_1},
+326
+327
{1,2,6, &_residue_44p_lfe,
+328
&_huff_book__44p1_lfe,&_huff_book__44p1_lfe,
+329
&_resbook_44p_l1,&_resbook_44p_l1}
+330
};
+331
static const vorbis_residue_template _res_44p51_2[]={
+332
{2,0,15, &_residue_44p,
+333
&_huff_book__44p2_short,&_huff_book__44p2_short,
+334
&_resbook_44p_2,&_resbook_44p_2},
+335
+336
{2,0,30, &_residue_44p,
+337
&_huff_book__44p2_long,&_huff_book__44p2_long,
+338
&_resbook_44p_2,&_resbook_44p_2},
+339
+340
{1,2,6, &_residue_44p_lfe,
+341
&_huff_book__44p2_lfe,&_huff_book__44p2_lfe,
+342
&_resbook_44p_l2,&_resbook_44p_l2}
+343
};
+344
static const vorbis_residue_template _res_44p51_3[]={
+345
{2,0,15, &_residue_44p,
+346
&_huff_book__44p3_short,&_huff_book__44p3_short,
+347
&_resbook_44p_3,&_resbook_44p_3},
+348
+349
{2,0,30, &_residue_44p,
+350
&_huff_book__44p3_long,&_huff_book__44p3_long,
+351
&_resbook_44p_3,&_resbook_44p_3},
+352
+353
{1,2,6, &_residue_44p_lfe,
+354
&_huff_book__44p3_lfe,&_huff_book__44p3_lfe,
+355
&_resbook_44p_l3,&_resbook_44p_l3}
+356
};
+357
static const vorbis_residue_template _res_44p51_4[]={
+358
{2,0,15, &_residue_44p,
+359
&_huff_book__44p4_short,&_huff_book__44p4_short,
+360
&_resbook_44p_4,&_resbook_44p_4},
+361
+362
{2,0,30, &_residue_44p,
+363
&_huff_book__44p4_long,&_huff_book__44p4_long,
+364
&_resbook_44p_4,&_resbook_44p_4},
+365
+366
{1,2,6, &_residue_44p_lfe,
+367
&_huff_book__44p4_lfe,&_huff_book__44p4_lfe,
+368
&_resbook_44p_l4,&_resbook_44p_l4}
+369
};
+370
static const vorbis_residue_template _res_44p51_5[]={
+371
{2,0,15, &_residue_44p_hi,
+372
&_huff_book__44p5_short,&_huff_book__44p5_short,
+373
&_resbook_44p_5,&_resbook_44p_5},
+374
+375
{2,0,30, &_residue_44p_hi,
+376
&_huff_book__44p5_long,&_huff_book__44p5_long,
+377
&_resbook_44p_5,&_resbook_44p_5},
+378
+379
{1,2,6, &_residue_44p_lfe,
+380
&_huff_book__44p5_lfe,&_huff_book__44p5_lfe,
+381
&_resbook_44p_l5,&_resbook_44p_l5}
+382
};
+383
static const vorbis_residue_template _res_44p51_6[]={
+384
{2,0,15, &_residue_44p_hi,
+385
&_huff_book__44p6_short,&_huff_book__44p6_short,
+386
&_resbook_44p_6,&_resbook_44p_6},
+387
+388
{2,0,30, &_residue_44p_hi,
+389
&_huff_book__44p6_long,&_huff_book__44p6_long,
+390
&_resbook_44p_6,&_resbook_44p_6},
+391
+392
{1,2,6, &_residue_44p_lfe,
+393
&_huff_book__44p6_lfe,&_huff_book__44p6_lfe,
+394
&_resbook_44p_l6,&_resbook_44p_l6}
+395
};
+396
+397
+398
static const vorbis_residue_template _res_44p51_7[]={
+399
{2,0,15, &_residue_44p_hi,
+400
&_huff_book__44p7_short,&_huff_book__44p7_short,
+401
&_resbook_44p_7,&_resbook_44p_7},
+402
+403
{2,0,30, &_residue_44p_hi,
+404
&_huff_book__44p7_long,&_huff_book__44p7_long,
+405
&_resbook_44p_7,&_resbook_44p_7},
+406
+407
{1,2,6, &_residue_44p_lfe,
+408
&_huff_book__44p6_lfe,&_huff_book__44p6_lfe,
+409
&_resbook_44p_l6,&_resbook_44p_l6}
+410
};
+411
static const vorbis_residue_template _res_44p51_8[]={
+412
{2,0,15, &_residue_44p_hi,
+413
&_huff_book__44p8_short,&_huff_book__44p8_short,
+414
&_resbook_44p_8,&_resbook_44p_8},
+415
+416
{2,0,30, &_residue_44p_hi,
+417
&_huff_book__44p8_long,&_huff_book__44p8_long,
+418
&_resbook_44p_8,&_resbook_44p_8},
+419
+420
{1,2,6, &_residue_44p_lfe,
+421
&_huff_book__44p6_lfe,&_huff_book__44p6_lfe,
+422
&_resbook_44p_l6,&_resbook_44p_l6}
+423
};
+424
static const vorbis_residue_template _res_44p51_9[]={
+425
{2,0,15, &_residue_44p_hi,
+426
&_huff_book__44p9_short,&_huff_book__44p9_short,
+427
&_resbook_44p_9,&_resbook_44p_9},
+428
+429
{2,0,30, &_residue_44p_hi,
+430
&_huff_book__44p9_long,&_huff_book__44p9_long,
+431
&_resbook_44p_9,&_resbook_44p_9},
+432
+433
{1,2,6, &_residue_44p_lfe,
+434
&_huff_book__44p6_lfe,&_huff_book__44p6_lfe,
+435
&_resbook_44p_l6,&_resbook_44p_l6}
+436
};
+437
+438
static const vorbis_mapping_template _mapres_template_44_51[]={
+439
{ _map_nominal_51, _res_44p51_n1 }, /* -1 */
+440
{ _map_nominal_51, _res_44p51_0 }, /* 0 */
+441
{ _map_nominal_51, _res_44p51_1 }, /* 1 */
+442
{ _map_nominal_51, _res_44p51_2 }, /* 2 */
+443
{ _map_nominal_51, _res_44p51_3 }, /* 3 */
+444
{ _map_nominal_51, _res_44p51_4 }, /* 4 */
+445
{ _map_nominal_51u, _res_44p51_5 }, /* 5 */
+446
{ _map_nominal_51u, _res_44p51_6 }, /* 6 */
+447
{ _map_nominal_51u, _res_44p51_7 }, /* 7 */
+448
{ _map_nominal_51u, _res_44p51_8 }, /* 8 */
+449
{ _map_nominal_51u, _res_44p51_9 }, /* 9 */
+450
};
vendor/vorbis/lib/modes/residue_44u.hadded
@@ -0,0 +1,317 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 *
+9
* by the Xiph.Org Foundation https://xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: toplevel residue templates for 32/44.1/48kHz uncoupled
+14
+15
********************************************************************/
+16
+17
#include "vorbis/codec.h"
+18
#include "backends.h"
+19
#include "books/uncoupled/res_books_uncoupled.h"
+20
+21
/***** residue backends *********************************************/
+22
+23
+24
static const vorbis_info_residue0 _residue_44_low_un={
+25
0,-1, -1, 8,-1,-1,
+26
{0},
+27
{-1},
+28
{ 0, 1, 1, 2, 2, 4, 28},
+29
{ -1, 25, -1, 45, -1, -1, -1}
+30
};
+31
+32
static const vorbis_info_residue0 _residue_44_mid_un={
+33
0,-1, -1, 10,-1,-1,
+34
/* 0 1 2 3 4 5 6 7 8 9 */
+35
{0},
+36
{-1},
+37
{ 0, 1, 1, 2, 2, 4, 4, 16, 60},
+38
{ -1, 30, -1, 50, -1, 80, -1, -1, -1}
+39
};
+40
+41
static const vorbis_info_residue0 _residue_44_hi_un={
+42
0,-1, -1, 10,-1,-1,
+43
/* 0 1 2 3 4 5 6 7 8 9 */
+44
{0},
+45
{-1},
+46
{ 0, 1, 2, 4, 8, 16, 32, 71,157},
+47
{ -1, -1, -1, -1, -1, -1, -1, -1, -1}
+48
};
+49
+50
/* mapping conventions:
+51
only one submap (this would change for efficient 5.1 support for example)*/
+52
/* Four psychoacoustic profiles are used, one for each blocktype */
+53
static const vorbis_info_mapping0 _map_nominal_u[2]={
+54
{1, {0,0,0,0,0,0}, {0}, {0}, 0,{0},{0}},
+55
{1, {0,0,0,0,0,0}, {1}, {1}, 0,{0},{0}}
+56
};
+57
+58
static const static_bookblock _resbook_44u_n1={
+59
{
+60
{0},
+61
{0,0,&_44un1__p1_0},
+62
{0,0,&_44un1__p2_0},
+63
{0,0,&_44un1__p3_0},
+64
{0,0,&_44un1__p4_0},
+65
{0,0,&_44un1__p5_0},
+66
{&_44un1__p6_0,&_44un1__p6_1},
+67
{&_44un1__p7_0,&_44un1__p7_1,&_44un1__p7_2}
+68
}
+69
};
+70
static const static_bookblock _resbook_44u_0={
+71
{
+72
{0},
+73
{0,0,&_44u0__p1_0},
+74
{0,0,&_44u0__p2_0},
+75
{0,0,&_44u0__p3_0},
+76
{0,0,&_44u0__p4_0},
+77
{0,0,&_44u0__p5_0},
+78
{&_44u0__p6_0,&_44u0__p6_1},
+79
{&_44u0__p7_0,&_44u0__p7_1,&_44u0__p7_2}
+80
}
+81
};
+82
static const static_bookblock _resbook_44u_1={
+83
{
+84
{0},
+85
{0,0,&_44u1__p1_0},
+86
{0,0,&_44u1__p2_0},
+87
{0,0,&_44u1__p3_0},
+88
{0,0,&_44u1__p4_0},
+89
{0,0,&_44u1__p5_0},
+90
{&_44u1__p6_0,&_44u1__p6_1},
+91
{&_44u1__p7_0,&_44u1__p7_1,&_44u1__p7_2}
+92
}
+93
};
+94
static const static_bookblock _resbook_44u_2={
+95
{
+96
{0},
+97
{0,0,&_44u2__p1_0},
+98
{0,0,&_44u2__p2_0},
+99
{0,0,&_44u2__p3_0},
+100
{0,0,&_44u2__p4_0},
+101
{0,0,&_44u2__p5_0},
+102
{&_44u2__p6_0,&_44u2__p6_1},
+103
{&_44u2__p7_0,&_44u2__p7_1,&_44u2__p7_2}
+104
}
+105
};
+106
static const static_bookblock _resbook_44u_3={
+107
{
+108
{0},
+109
{0,0,&_44u3__p1_0},
+110
{0,0,&_44u3__p2_0},
+111
{0,0,&_44u3__p3_0},
+112
{0,0,&_44u3__p4_0},
+113
{0,0,&_44u3__p5_0},
+114
{&_44u3__p6_0,&_44u3__p6_1},
+115
{&_44u3__p7_0,&_44u3__p7_1,&_44u3__p7_2}
+116
}
+117
};
+118
static const static_bookblock _resbook_44u_4={
+119
{
+120
{0},
+121
{0,0,&_44u4__p1_0},
+122
{0,0,&_44u4__p2_0},
+123
{0,0,&_44u4__p3_0},
+124
{0,0,&_44u4__p4_0},
+125
{0,0,&_44u4__p5_0},
+126
{&_44u4__p6_0,&_44u4__p6_1},
+127
{&_44u4__p7_0,&_44u4__p7_1,&_44u4__p7_2}
+128
}
+129
};
+130
static const static_bookblock _resbook_44u_5={
+131
{
+132
{0},
+133
{0,0,&_44u5__p1_0},
+134
{0,0,&_44u5__p2_0},
+135
{0,0,&_44u5__p3_0},
+136
{0,0,&_44u5__p4_0},
+137
{0,0,&_44u5__p5_0},
+138
{0,0,&_44u5__p6_0},
+139
{&_44u5__p7_0,&_44u5__p7_1},
+140
{&_44u5__p8_0,&_44u5__p8_1},
+141
{&_44u5__p9_0,&_44u5__p9_1,&_44u5__p9_2}
+142
}
+143
};
+144
static const static_bookblock _resbook_44u_6={
+145
{
+146
{0},
+147
{0,0,&_44u6__p1_0},
+148
{0,0,&_44u6__p2_0},
+149
{0,0,&_44u6__p3_0},
+150
{0,0,&_44u6__p4_0},
+151
{0,0,&_44u6__p5_0},
+152
{0,0,&_44u6__p6_0},
+153
{&_44u6__p7_0,&_44u6__p7_1},
+154
{&_44u6__p8_0,&_44u6__p8_1},
+155
{&_44u6__p9_0,&_44u6__p9_1,&_44u6__p9_2}
+156
}
+157
};
+158
static const static_bookblock _resbook_44u_7={
+159
{
+160
{0},
+161
{0,0,&_44u7__p1_0},
+162
{0,0,&_44u7__p2_0},
+163
{0,0,&_44u7__p3_0},
+164
{0,0,&_44u7__p4_0},
+165
{0,0,&_44u7__p5_0},
+166
{0,0,&_44u7__p6_0},
+167
{&_44u7__p7_0,&_44u7__p7_1},
+168
{&_44u7__p8_0,&_44u7__p8_1},
+169
{&_44u7__p9_0,&_44u7__p9_1,&_44u7__p9_2}
+170
}
+171
};
+172
static const static_bookblock _resbook_44u_8={
+173
{
+174
{0},
+175
{0,0,&_44u8_p1_0},
+176
{0,0,&_44u8_p2_0},
+177
{0,0,&_44u8_p3_0},
+178
{0,0,&_44u8_p4_0},
+179
{&_44u8_p5_0,&_44u8_p5_1},
+180
{&_44u8_p6_0,&_44u8_p6_1},
+181
{&_44u8_p7_0,&_44u8_p7_1},
+182
{&_44u8_p8_0,&_44u8_p8_1},
+183
{&_44u8_p9_0,&_44u8_p9_1,&_44u8_p9_2}
+184
}
+185
};
+186
static const static_bookblock _resbook_44u_9={
+187
{
+188
{0},
+189
{0,0,&_44u9_p1_0},
+190
{0,0,&_44u9_p2_0},
+191
{0,0,&_44u9_p3_0},
+192
{0,0,&_44u9_p4_0},
+193
{&_44u9_p5_0,&_44u9_p5_1},
+194
{&_44u9_p6_0,&_44u9_p6_1},
+195
{&_44u9_p7_0,&_44u9_p7_1},
+196
{&_44u9_p8_0,&_44u9_p8_1},
+197
{&_44u9_p9_0,&_44u9_p9_1,&_44u9_p9_2}
+198
}
+199
};
+200
+201
static const vorbis_residue_template _res_44u_n1[]={
+202
{1,0,32, &_residue_44_low_un,
+203
&_huff_book__44un1__short,&_huff_book__44un1__short,
+204
&_resbook_44u_n1,&_resbook_44u_n1},
+205
+206
{1,0,32, &_residue_44_low_un,
+207
&_huff_book__44un1__long,&_huff_book__44un1__long,
+208
&_resbook_44u_n1,&_resbook_44u_n1}
+209
};
+210
static const vorbis_residue_template _res_44u_0[]={
+211
{1,0,16, &_residue_44_low_un,
+212
&_huff_book__44u0__short,&_huff_book__44u0__short,
+213
&_resbook_44u_0,&_resbook_44u_0},
+214
+215
{1,0,32, &_residue_44_low_un,
+216
&_huff_book__44u0__long,&_huff_book__44u0__long,
+217
&_resbook_44u_0,&_resbook_44u_0}
+218
};
+219
static const vorbis_residue_template _res_44u_1[]={
+220
{1,0,16, &_residue_44_low_un,
+221
&_huff_book__44u1__short,&_huff_book__44u1__short,
+222
&_resbook_44u_1,&_resbook_44u_1},
+223
+224
{1,0,32, &_residue_44_low_un,
+225
&_huff_book__44u1__long,&_huff_book__44u1__long,
+226
&_resbook_44u_1,&_resbook_44u_1}
+227
};
+228
static const vorbis_residue_template _res_44u_2[]={
+229
{1,0,16, &_residue_44_low_un,
+230
&_huff_book__44u2__short,&_huff_book__44u2__short,
+231
&_resbook_44u_2,&_resbook_44u_2},
+232
+233
{1,0,32, &_residue_44_low_un,
+234
&_huff_book__44u2__long,&_huff_book__44u2__long,
+235
&_resbook_44u_2,&_resbook_44u_2}
+236
};
+237
static const vorbis_residue_template _res_44u_3[]={
+238
{1,0,16, &_residue_44_low_un,
+239
&_huff_book__44u3__short,&_huff_book__44u3__short,
+240
&_resbook_44u_3,&_resbook_44u_3},
+241
+242
{1,0,32, &_residue_44_low_un,
+243
&_huff_book__44u3__long,&_huff_book__44u3__long,
+244
&_resbook_44u_3,&_resbook_44u_3}
+245
};
+246
static const vorbis_residue_template _res_44u_4[]={
+247
{1,0,16, &_residue_44_low_un,
+248
&_huff_book__44u4__short,&_huff_book__44u4__short,
+249
&_resbook_44u_4,&_resbook_44u_4},
+250
+251
{1,0,32, &_residue_44_low_un,
+252
&_huff_book__44u4__long,&_huff_book__44u4__long,
+253
&_resbook_44u_4,&_resbook_44u_4}
+254
};
+255
+256
static const vorbis_residue_template _res_44u_5[]={
+257
{1,0,16, &_residue_44_mid_un,
+258
&_huff_book__44u5__short,&_huff_book__44u5__short,
+259
&_resbook_44u_5,&_resbook_44u_5},
+260
+261
{1,0,32, &_residue_44_mid_un,
+262
&_huff_book__44u5__long,&_huff_book__44u5__long,
+263
&_resbook_44u_5,&_resbook_44u_5}
+264
};
+265
+266
static const vorbis_residue_template _res_44u_6[]={
+267
{1,0,16, &_residue_44_mid_un,
+268
&_huff_book__44u6__short,&_huff_book__44u6__short,
+269
&_resbook_44u_6,&_resbook_44u_6},
+270
+271
{1,0,32, &_residue_44_mid_un,
+272
&_huff_book__44u6__long,&_huff_book__44u6__long,
+273
&_resbook_44u_6,&_resbook_44u_6}
+274
};
+275
+276
static const vorbis_residue_template _res_44u_7[]={
+277
{1,0,16, &_residue_44_mid_un,
+278
&_huff_book__44u7__short,&_huff_book__44u7__short,
+279
&_resbook_44u_7,&_resbook_44u_7},
+280
+281
{1,0,32, &_residue_44_mid_un,
+282
&_huff_book__44u7__long,&_huff_book__44u7__long,
+283
&_resbook_44u_7,&_resbook_44u_7}
+284
};
+285
+286
static const vorbis_residue_template _res_44u_8[]={
+287
{1,0,16, &_residue_44_hi_un,
+288
&_huff_book__44u8__short,&_huff_book__44u8__short,
+289
&_resbook_44u_8,&_resbook_44u_8},
+290
+291
{1,0,32, &_residue_44_hi_un,
+292
&_huff_book__44u8__long,&_huff_book__44u8__long,
+293
&_resbook_44u_8,&_resbook_44u_8}
+294
};
+295
static const vorbis_residue_template _res_44u_9[]={
+296
{1,0,16, &_residue_44_hi_un,
+297
&_huff_book__44u9__short,&_huff_book__44u9__short,
+298
&_resbook_44u_9,&_resbook_44u_9},
+299
+300
{1,0,32, &_residue_44_hi_un,
+301
&_huff_book__44u9__long,&_huff_book__44u9__long,
+302
&_resbook_44u_9,&_resbook_44u_9}
+303
};
+304
+305
static const vorbis_mapping_template _mapres_template_44_uncoupled[]={
+306
{ _map_nominal_u, _res_44u_n1 }, /* -1 */
+307
{ _map_nominal_u, _res_44u_0 }, /* 0 */
+308
{ _map_nominal_u, _res_44u_1 }, /* 1 */
+309
{ _map_nominal_u, _res_44u_2 }, /* 2 */
+310
{ _map_nominal_u, _res_44u_3 }, /* 3 */
+311
{ _map_nominal_u, _res_44u_4 }, /* 4 */
+312
{ _map_nominal_u, _res_44u_5 }, /* 5 */
+313
{ _map_nominal_u, _res_44u_6 }, /* 6 */
+314
{ _map_nominal_u, _res_44u_7 }, /* 7 */
+315
{ _map_nominal_u, _res_44u_8 }, /* 8 */
+316
{ _map_nominal_u, _res_44u_9 }, /* 9 */
+317
};
vendor/vorbis/lib/modes/residue_8.hadded
@@ -0,0 +1,108 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 *
+9
* by the Xiph.Org Foundation https://xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: toplevel residue templates 8/11kHz
+14
+15
********************************************************************/
+16
+17
#include "vorbis/codec.h"
+18
#include "backends.h"
+19
+20
/***** residue backends *********************************************/
+21
+22
static const static_bookblock _resbook_8s_0={
+23
{
+24
{0},
+25
{0,0,&_8c0_s_p1_0},
+26
{0},
+27
{0,0,&_8c0_s_p3_0},
+28
{0,0,&_8c0_s_p4_0},
+29
{0,0,&_8c0_s_p5_0},
+30
{0,0,&_8c0_s_p6_0},
+31
{&_8c0_s_p7_0,&_8c0_s_p7_1},
+32
{&_8c0_s_p8_0,&_8c0_s_p8_1},
+33
{&_8c0_s_p9_0,&_8c0_s_p9_1,&_8c0_s_p9_2}
+34
}
+35
};
+36
static const static_bookblock _resbook_8s_1={
+37
{
+38
{0},
+39
{0,0,&_8c1_s_p1_0},
+40
{0},
+41
{0,0,&_8c1_s_p3_0},
+42
{0,0,&_8c1_s_p4_0},
+43
{0,0,&_8c1_s_p5_0},
+44
{0,0,&_8c1_s_p6_0},
+45
{&_8c1_s_p7_0,&_8c1_s_p7_1},
+46
{&_8c1_s_p8_0,&_8c1_s_p8_1},
+47
{&_8c1_s_p9_0,&_8c1_s_p9_1,&_8c1_s_p9_2}
+48
}
+49
};
+50
+51
static const vorbis_residue_template _res_8s_0[]={
+52
{2,0,32, &_residue_44_mid,
+53
&_huff_book__8c0_s_single,&_huff_book__8c0_s_single,
+54
&_resbook_8s_0,&_resbook_8s_0},
+55
};
+56
static const vorbis_residue_template _res_8s_1[]={
+57
{2,0,32, &_residue_44_mid,
+58
&_huff_book__8c1_s_single,&_huff_book__8c1_s_single,
+59
&_resbook_8s_1,&_resbook_8s_1},
+60
};
+61
+62
static const vorbis_mapping_template _mapres_template_8_stereo[2]={
+63
{ _map_nominal, _res_8s_0 }, /* 0 */
+64
{ _map_nominal, _res_8s_1 }, /* 1 */
+65
};
+66
+67
static const static_bookblock _resbook_8u_0={
+68
{
+69
{0},
+70
{0,0,&_8u0__p1_0},
+71
{0,0,&_8u0__p2_0},
+72
{0,0,&_8u0__p3_0},
+73
{0,0,&_8u0__p4_0},
+74
{0,0,&_8u0__p5_0},
+75
{&_8u0__p6_0,&_8u0__p6_1},
+76
{&_8u0__p7_0,&_8u0__p7_1,&_8u0__p7_2}
+77
}
+78
};
+79
static const static_bookblock _resbook_8u_1={
+80
{
+81
{0},
+82
{0,0,&_8u1__p1_0},
+83
{0,0,&_8u1__p2_0},
+84
{0,0,&_8u1__p3_0},
+85
{0,0,&_8u1__p4_0},
+86
{0,0,&_8u1__p5_0},
+87
{0,0,&_8u1__p6_0},
+88
{&_8u1__p7_0,&_8u1__p7_1},
+89
{&_8u1__p8_0,&_8u1__p8_1},
+90
{&_8u1__p9_0,&_8u1__p9_1,&_8u1__p9_2}
+91
}
+92
};
+93
+94
static const vorbis_residue_template _res_8u_0[]={
+95
{1,0,32, &_residue_44_low_un,
+96
&_huff_book__8u0__single,&_huff_book__8u0__single,
+97
&_resbook_8u_0,&_resbook_8u_0},
+98
};
+99
static const vorbis_residue_template _res_8u_1[]={
+100
{1,0,32, &_residue_44_mid_un,
+101
&_huff_book__8u1__single,&_huff_book__8u1__single,
+102
&_resbook_8u_1,&_resbook_8u_1},
+103
};
+104
+105
static const vorbis_mapping_template _mapres_template_8_uncoupled[2]={
+106
{ _map_nominal_u, _res_8u_0 }, /* 0 */
+107
{ _map_nominal_u, _res_8u_1 }, /* 1 */
+108
};
vendor/vorbis/lib/modes/setup_11.hadded
@@ -0,0 +1,142 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 *
+9
* by the Xiph.Org Foundation https://xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: 11kHz settings
+14
+15
********************************************************************/
+16
+17
#include "psych_11.h"
+18
+19
static const int blocksize_11[2]={
+20
512,512
+21
};
+22
+23
static const int _floor_mapping_11a[]={
+24
6,6
+25
};
+26
static const int *_floor_mapping_11[]={
+27
_floor_mapping_11a
+28
};
+29
+30
static const double rate_mapping_11[3]={
+31
8000.,13000.,44000.,
+32
};
+33
+34
static const double rate_mapping_11_uncoupled[3]={
+35
12000.,20000.,50000.,
+36
};
+37
+38
static const double quality_mapping_11[3]={
+39
-.1,.0,1.
+40
};
+41
+42
static const ve_setup_data_template ve_setup_11_stereo={
+43
2,
+44
rate_mapping_11,
+45
quality_mapping_11,
+46
2,
+47
9000,
+48
15000,
+49
+50
blocksize_11,
+51
blocksize_11,
+52
+53
_psy_tone_masteratt_11,
+54
_psy_tone_0dB,
+55
_psy_tone_suppress,
+56
+57
_vp_tonemask_adj_11,
+58
NULL,
+59
_vp_tonemask_adj_11,
+60
+61
_psy_noiseguards_8,
+62
_psy_noisebias_11,
+63
_psy_noisebias_11,
+64
NULL,
+65
NULL,
+66
_psy_noise_suppress,
+67
+68
_psy_compand_8,
+69
_psy_compand_8_mapping,
+70
NULL,
+71
+72
{_noise_start_8,_noise_start_8},
+73
{_noise_part_8,_noise_part_8},
+74
_noise_thresh_11,
+75
+76
_psy_ath_floater_8,
+77
_psy_ath_abs_8,
+78
+79
_psy_lowpass_11,
+80
+81
_psy_global_44,
+82
_global_mapping_8,
+83
_psy_stereo_modes_8,
+84
+85
_floor_books,
+86
_floor,
+87
1,
+88
_floor_mapping_11,
+89
+90
_mapres_template_8_stereo
+91
};
+92
+93
static const ve_setup_data_template ve_setup_11_uncoupled={
+94
2,
+95
rate_mapping_11_uncoupled,
+96
quality_mapping_11,
+97
-1,
+98
9000,
+99
15000,
+100
+101
blocksize_11,
+102
blocksize_11,
+103
+104
_psy_tone_masteratt_11,
+105
_psy_tone_0dB,
+106
_psy_tone_suppress,
+107
+108
_vp_tonemask_adj_11,
+109
NULL,
+110
_vp_tonemask_adj_11,
+111
+112
_psy_noiseguards_8,
+113
_psy_noisebias_11,
+114
_psy_noisebias_11,
+115
NULL,
+116
NULL,
+117
_psy_noise_suppress,
+118
+119
_psy_compand_8,
+120
_psy_compand_8_mapping,
+121
NULL,
+122
+123
{_noise_start_8,_noise_start_8},
+124
{_noise_part_8,_noise_part_8},
+125
_noise_thresh_11,
+126
+127
_psy_ath_floater_8,
+128
_psy_ath_abs_8,
+129
+130
_psy_lowpass_11,
+131
+132
_psy_global_44,
+133
_global_mapping_8,
+134
_psy_stereo_modes_8,
+135
+136
_floor_books,
+137
_floor,
+138
1,
+139
_floor_mapping_11,
+140
+141
_mapres_template_8_uncoupled
+142
};
vendor/vorbis/lib/modes/setup_16.hadded
@@ -0,0 +1,152 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 *
+9
* by the Xiph.Org Foundation https://xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: 16kHz settings
+14
+15
********************************************************************/
+16
+17
#include "psych_16.h"
+18
#include "residue_16.h"
+19
+20
static const int blocksize_16_short[3]={
+21
1024,512,512
+22
};
+23
static const int blocksize_16_long[3]={
+24
1024,1024,1024
+25
};
+26
+27
static const int _floor_mapping_16a[]={
+28
9,3,3
+29
};
+30
static const int _floor_mapping_16b[]={
+31
9,9,9
+32
};
+33
static const int *_floor_mapping_16[]={
+34
_floor_mapping_16a,
+35
_floor_mapping_16b
+36
};
+37
+38
static const double rate_mapping_16[4]={
+39
12000.,20000.,44000.,86000.
+40
};
+41
+42
static const double rate_mapping_16_uncoupled[4]={
+43
16000.,28000.,64000.,100000.
+44
};
+45
+46
static const double _global_mapping_16[4]={ 1., 2., 3., 4. };
+47
+48
static const double quality_mapping_16[4]={ -.1,.05,.5,1. };
+49
+50
static const double _psy_compand_16_mapping[4]={ 0., .8, 1., 1.};
+51
+52
static const ve_setup_data_template ve_setup_16_stereo={
+53
3,
+54
rate_mapping_16,
+55
quality_mapping_16,
+56
2,
+57
15000,
+58
19000,
+59
+60
blocksize_16_short,
+61
blocksize_16_long,
+62
+63
_psy_tone_masteratt_16,
+64
_psy_tone_0dB,
+65
_psy_tone_suppress,
+66
+67
_vp_tonemask_adj_16,
+68
_vp_tonemask_adj_16,
+69
_vp_tonemask_adj_16,
+70
+71
_psy_noiseguards_16,
+72
_psy_noisebias_16_impulse,
+73
_psy_noisebias_16_short,
+74
_psy_noisebias_16_short,
+75
_psy_noisebias_16,
+76
_psy_noise_suppress,
+77
+78
_psy_compand_8,
+79
_psy_compand_16_mapping,
+80
_psy_compand_16_mapping,
+81
+82
{_noise_start_16,_noise_start_16},
+83
{ _noise_part_16, _noise_part_16},
+84
_noise_thresh_16,
+85
+86
_psy_ath_floater_16,
+87
_psy_ath_abs_16,
+88
+89
_psy_lowpass_16,
+90
+91
_psy_global_44,
+92
_global_mapping_16,
+93
_psy_stereo_modes_16,
+94
+95
_floor_books,
+96
_floor,
+97
2,
+98
_floor_mapping_16,
+99
+100
_mapres_template_16_stereo
+101
};
+102
+103
static const ve_setup_data_template ve_setup_16_uncoupled={
+104
3,
+105
rate_mapping_16_uncoupled,
+106
quality_mapping_16,
+107
-1,
+108
15000,
+109
19000,
+110
+111
blocksize_16_short,
+112
blocksize_16_long,
+113
+114
_psy_tone_masteratt_16,
+115
_psy_tone_0dB,
+116
_psy_tone_suppress,
+117
+118
_vp_tonemask_adj_16,
+119
_vp_tonemask_adj_16,
+120
_vp_tonemask_adj_16,
+121
+122
_psy_noiseguards_16,
+123
_psy_noisebias_16_impulse,
+124
_psy_noisebias_16_short,
+125
_psy_noisebias_16_short,
+126
_psy_noisebias_16,
+127
_psy_noise_suppress,
+128
+129
_psy_compand_8,
+130
_psy_compand_16_mapping,
+131
_psy_compand_16_mapping,
+132
+133
{_noise_start_16,_noise_start_16},
+134
{ _noise_part_16, _noise_part_16},
+135
_noise_thresh_16,
+136
+137
_psy_ath_floater_16,
+138
_psy_ath_abs_16,
+139
+140
_psy_lowpass_16,
+141
+142
_psy_global_44,
+143
_global_mapping_16,
+144
_psy_stereo_modes_16,
+145
+146
_floor_books,
+147
_floor,
+148
2,
+149
_floor_mapping_16,
+150
+151
_mapres_template_16_uncoupled
+152
};
vendor/vorbis/lib/modes/setup_22.hadded
@@ -0,0 +1,127 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 *
+9
* by the Xiph.Org Foundation https://xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: 22kHz settings
+14
+15
********************************************************************/
+16
+17
static const double rate_mapping_22[4]={
+18
15000.,20000.,44000.,86000.
+19
};
+20
+21
static const double rate_mapping_22_uncoupled[4]={
+22
16000.,28000.,50000.,90000.
+23
};
+24
+25
static const double _psy_lowpass_22[4]={9.5,11.,30.,99.};
+26
+27
static const ve_setup_data_template ve_setup_22_stereo={
+28
3,
+29
rate_mapping_22,
+30
quality_mapping_16,
+31
2,
+32
19000,
+33
26000,
+34
+35
blocksize_16_short,
+36
blocksize_16_long,
+37
+38
_psy_tone_masteratt_16,
+39
_psy_tone_0dB,
+40
_psy_tone_suppress,
+41
+42
_vp_tonemask_adj_16,
+43
_vp_tonemask_adj_16,
+44
_vp_tonemask_adj_16,
+45
+46
_psy_noiseguards_16,
+47
_psy_noisebias_16_impulse,
+48
_psy_noisebias_16_short,
+49
_psy_noisebias_16_short,
+50
_psy_noisebias_16,
+51
_psy_noise_suppress,
+52
+53
_psy_compand_8,
+54
_psy_compand_16_mapping,
+55
_psy_compand_16_mapping,
+56
+57
{_noise_start_16,_noise_start_16},
+58
{ _noise_part_16, _noise_part_16},
+59
_noise_thresh_16,
+60
+61
_psy_ath_floater_16,
+62
_psy_ath_abs_16,
+63
+64
_psy_lowpass_22,
+65
+66
_psy_global_44,
+67
_global_mapping_16,
+68
_psy_stereo_modes_16,
+69
+70
_floor_books,
+71
_floor,
+72
2,
+73
_floor_mapping_16,
+74
+75
_mapres_template_16_stereo
+76
};
+77
+78
static const ve_setup_data_template ve_setup_22_uncoupled={
+79
3,
+80
rate_mapping_22_uncoupled,
+81
quality_mapping_16,
+82
-1,
+83
19000,
+84
26000,
+85
+86
blocksize_16_short,
+87
blocksize_16_long,
+88
+89
_psy_tone_masteratt_16,
+90
_psy_tone_0dB,
+91
_psy_tone_suppress,
+92
+93
_vp_tonemask_adj_16,
+94
_vp_tonemask_adj_16,
+95
_vp_tonemask_adj_16,
+96
+97
_psy_noiseguards_16,
+98
_psy_noisebias_16_impulse,
+99
_psy_noisebias_16_short,
+100
_psy_noisebias_16_short,
+101
_psy_noisebias_16,
+102
_psy_noise_suppress,
+103
+104
_psy_compand_8,
+105
_psy_compand_16_mapping,
+106
_psy_compand_16_mapping,
+107
+108
{_noise_start_16,_noise_start_16},
+109
{ _noise_part_16, _noise_part_16},
+110
_noise_thresh_16,
+111
+112
_psy_ath_floater_16,
+113
_psy_ath_abs_16,
+114
+115
_psy_lowpass_22,
+116
+117
_psy_global_44,
+118
_global_mapping_16,
+119
_psy_stereo_modes_16,
+120
+121
_floor_books,
+122
_floor,
+123
2,
+124
_floor_mapping_16,
+125
+126
_mapres_template_16_uncoupled
+127
};
vendor/vorbis/lib/modes/setup_32.hadded
@@ -0,0 +1,131 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 *
+9
* by the Xiph.Org Foundation https://xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: toplevel settings for 32kHz
+14
+15
********************************************************************/
+16
+17
static const double rate_mapping_32[12]={
+18
18000.,28000.,35000.,45000.,56000.,60000.,
+19
75000.,90000.,100000.,115000.,150000.,190000.,
+20
};
+21
+22
static const double rate_mapping_32_un[12]={
+23
30000.,42000.,52000.,64000.,72000.,78000.,
+24
86000.,92000.,110000.,120000.,140000.,190000.,
+25
};
+26
+27
static const double _psy_lowpass_32[12]={
+28
12.3,13.,13.,14.,15.,99.,99.,99.,99.,99.,99.,99.
+29
};
+30
+31
static const ve_setup_data_template ve_setup_32_stereo={
+32
11,
+33
rate_mapping_32,
+34
quality_mapping_44,
+35
2,
+36
26000,
+37
40000,
+38
+39
blocksize_short_44,
+40
blocksize_long_44,
+41
+42
_psy_tone_masteratt_44,
+43
_psy_tone_0dB,
+44
_psy_tone_suppress,
+45
+46
_vp_tonemask_adj_otherblock,
+47
_vp_tonemask_adj_longblock,
+48
_vp_tonemask_adj_otherblock,
+49
+50
_psy_noiseguards_44,
+51
_psy_noisebias_impulse,
+52
_psy_noisebias_padding,
+53
_psy_noisebias_trans,
+54
_psy_noisebias_long,
+55
_psy_noise_suppress,
+56
+57
_psy_compand_44,
+58
_psy_compand_short_mapping,
+59
_psy_compand_long_mapping,
+60
+61
{_noise_start_short_44,_noise_start_long_44},
+62
{_noise_part_short_44,_noise_part_long_44},
+63
_noise_thresh_44,
+64
+65
_psy_ath_floater,
+66
_psy_ath_abs,
+67
+68
_psy_lowpass_32,
+69
+70
_psy_global_44,
+71
_global_mapping_44,
+72
_psy_stereo_modes_44,
+73
+74
_floor_books,
+75
_floor,
+76
2,
+77
_floor_mapping_44,
+78
+79
_mapres_template_44_stereo
+80
};
+81
+82
static const ve_setup_data_template ve_setup_32_uncoupled={
+83
11,
+84
rate_mapping_32_un,
+85
quality_mapping_44,
+86
-1,
+87
26000,
+88
40000,
+89
+90
blocksize_short_44,
+91
blocksize_long_44,
+92
+93
_psy_tone_masteratt_44,
+94
_psy_tone_0dB,
+95
_psy_tone_suppress,
+96
+97
_vp_tonemask_adj_otherblock,
+98
_vp_tonemask_adj_longblock,
+99
_vp_tonemask_adj_otherblock,
+100
+101
_psy_noiseguards_44,
+102
_psy_noisebias_impulse,
+103
_psy_noisebias_padding,
+104
_psy_noisebias_trans,
+105
_psy_noisebias_long,
+106
_psy_noise_suppress,
+107
+108
_psy_compand_44,
+109
_psy_compand_short_mapping,
+110
_psy_compand_long_mapping,
+111
+112
{_noise_start_short_44,_noise_start_long_44},
+113
{_noise_part_short_44,_noise_part_long_44},
+114
_noise_thresh_44,
+115
+116
_psy_ath_floater,
+117
_psy_ath_abs,
+118
+119
_psy_lowpass_32,
+120
+121
_psy_global_44,
+122
_global_mapping_44,
+123
NULL,
+124
+125
_floor_books,
+126
_floor,
+127
2,
+128
_floor_mapping_44,
+129
+130
_mapres_template_44_uncoupled
+131
};
vendor/vorbis/lib/modes/setup_44.hadded
@@ -0,0 +1,116 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 *
+9
* by the Xiph.Org Foundation https://xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: toplevel settings for 44.1/48kHz
+14
+15
********************************************************************/
+16
+17
#include "modes/floor_all.h"
+18
#include "modes/residue_44.h"
+19
#include "modes/psych_44.h"
+20
+21
static const double rate_mapping_44_stereo[12]={
+22
22500.,32000.,40000.,48000.,56000.,64000.,
+23
80000.,96000.,112000.,128000.,160000.,250001.
+24
};
+25
+26
static const double quality_mapping_44[12]={
+27
-.1,.0,.1,.2,.3,.4,.5,.6,.7,.8,.9,1.0
+28
};
+29
+30
static const int blocksize_short_44[11]={
+31
512,256,256,256,256,256,256,256,256,256,256
+32
};
+33
static const int blocksize_long_44[11]={
+34
4096,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048
+35
};
+36
+37
static const double _psy_compand_short_mapping[12]={
+38
0.5, 1., 1., 1.3, 1.6, 2., 2., 2., 2., 2., 2., 2.
+39
};
+40
static const double _psy_compand_long_mapping[12]={
+41
3.5, 4., 4., 4.3, 4.6, 5., 5., 5., 5., 5., 5., 5.
+42
};
+43
+44
static const double _global_mapping_44[12]={
+45
/* 1., 1., 1.5, 2., 2., 2.5, 2.7, 3.0, 3.5, 4., 4. */
+46
0., 1., 1., 1.5, 2., 2., 2.5, 2.7, 3.0, 3.7, 4., 4.
+47
};
+48
+49
static const int _floor_mapping_44a[11]={
+50
1,0,0,2,2,4,5,5,5,5,5
+51
};
+52
+53
static const int _floor_mapping_44b[11]={
+54
8,7,7,7,7,7,7,7,7,7,7
+55
};
+56
+57
static const int _floor_mapping_44c[11]={
+58
10,10,10,10,10,10,10,10,10,10,10
+59
};
+60
+61
static const int *_floor_mapping_44[]={
+62
_floor_mapping_44a,
+63
_floor_mapping_44b,
+64
_floor_mapping_44c,
+65
};
+66
+67
static const ve_setup_data_template ve_setup_44_stereo={
+68
11,
+69
rate_mapping_44_stereo,
+70
quality_mapping_44,
+71
2,
+72
40000,
+73
50000,
+74
+75
blocksize_short_44,
+76
blocksize_long_44,
+77
+78
_psy_tone_masteratt_44,
+79
_psy_tone_0dB,
+80
_psy_tone_suppress,
+81
+82
_vp_tonemask_adj_otherblock,
+83
_vp_tonemask_adj_longblock,
+84
_vp_tonemask_adj_otherblock,
+85
+86
_psy_noiseguards_44,
+87
_psy_noisebias_impulse,
+88
_psy_noisebias_padding,
+89
_psy_noisebias_trans,
+90
_psy_noisebias_long,
+91
_psy_noise_suppress,
+92
+93
_psy_compand_44,
+94
_psy_compand_short_mapping,
+95
_psy_compand_long_mapping,
+96
+97
{_noise_start_short_44,_noise_start_long_44},
+98
{_noise_part_short_44,_noise_part_long_44},
+99
_noise_thresh_44,
+100
+101
_psy_ath_floater,
+102
_psy_ath_abs,
+103
+104
_psy_lowpass_44,
+105
+106
_psy_global_44,
+107
_global_mapping_44,
+108
_psy_stereo_modes_44,
+109
+110
_floor_books,
+111
_floor,
+112
2,
+113
_floor_mapping_44,
+114
+115
_mapres_template_44_stereo
+116
};
vendor/vorbis/lib/modes/setup_44p51.hadded
@@ -0,0 +1,73 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2010 *
+9
* by the Xiph.Org Foundation https://xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: toplevel settings for 44.1/48kHz 5.1 surround modes
+14
+15
********************************************************************/
+16
+17
#include "modes/residue_44p51.h"
+18
+19
static const double rate_mapping_44p51[12]={
+20
14000.,20000.,28000.,38000.,46000.,54000.,
+21
75000.,96000.,120000.,140000.,180000.,240001.
+22
};
+23
+24
static const ve_setup_data_template ve_setup_44_51={
+25
11,
+26
rate_mapping_44p51,
+27
quality_mapping_44,
+28
6,
+29
40000,
+30
70000,
+31
+32
blocksize_short_44,
+33
blocksize_long_44,
+34
+35
_psy_tone_masteratt_44,
+36
_psy_tone_0dB,
+37
_psy_tone_suppress,
+38
+39
_vp_tonemask_adj_otherblock,
+40
_vp_tonemask_adj_longblock,
+41
_vp_tonemask_adj_otherblock,
+42
+43
_psy_noiseguards_44,
+44
_psy_noisebias_impulse,
+45
_psy_noisebias_padding,
+46
_psy_noisebias_trans,
+47
_psy_noisebias_long,
+48
_psy_noise_suppress,
+49
+50
_psy_compand_44,
+51
_psy_compand_short_mapping,
+52
_psy_compand_long_mapping,
+53
+54
{_noise_start_short_44,_noise_start_long_44},
+55
{_noise_part_short_44,_noise_part_long_44},
+56
_noise_thresh_44,
+57
+58
_psy_ath_floater,
+59
_psy_ath_abs,
+60
+61
_psy_lowpass_44,
+62
+63
_psy_global_44,
+64
_global_mapping_44,
+65
_psy_stereo_modes_44,
+66
+67
_floor_books,
+68
_floor,
+69
3,
+70
_floor_mapping_44,
+71
+72
_mapres_template_44_51
+73
};
vendor/vorbis/lib/modes/setup_44u.hadded
@@ -0,0 +1,73 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 *
+9
* by the Xiph.Org Foundation https://xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: toplevel settings for 44.1/48kHz uncoupled modes
+14
+15
********************************************************************/
+16
+17
#include "modes/residue_44u.h"
+18
+19
static const double rate_mapping_44_un[12]={
+20
32000.,48000.,60000.,70000.,80000.,86000.,
+21
96000.,110000.,120000.,140000.,160000.,240001.
+22
};
+23
+24
static const ve_setup_data_template ve_setup_44_uncoupled={
+25
11,
+26
rate_mapping_44_un,
+27
quality_mapping_44,
+28
-1,
+29
40000,
+30
50000,
+31
+32
blocksize_short_44,
+33
blocksize_long_44,
+34
+35
_psy_tone_masteratt_44,
+36
_psy_tone_0dB,
+37
_psy_tone_suppress,
+38
+39
_vp_tonemask_adj_otherblock,
+40
_vp_tonemask_adj_longblock,
+41
_vp_tonemask_adj_otherblock,
+42
+43
_psy_noiseguards_44,
+44
_psy_noisebias_impulse,
+45
_psy_noisebias_padding,
+46
_psy_noisebias_trans,
+47
_psy_noisebias_long,
+48
_psy_noise_suppress,
+49
+50
_psy_compand_44,
+51
_psy_compand_short_mapping,
+52
_psy_compand_long_mapping,
+53
+54
{_noise_start_short_44,_noise_start_long_44},
+55
{_noise_part_short_44,_noise_part_long_44},
+56
_noise_thresh_44,
+57
+58
_psy_ath_floater,
+59
_psy_ath_abs,
+60
+61
_psy_lowpass_44,
+62
+63
_psy_global_44,
+64
_global_mapping_44,
+65
_psy_stereo_modes_44,
+66
+67
_floor_books,
+68
_floor,
+69
2,
+70
_floor_mapping_44,
+71
+72
_mapres_template_44_uncoupled
+73
};
vendor/vorbis/lib/modes/setup_8.hadded
@@ -0,0 +1,148 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 *
+9
* by the Xiph.Org Foundation https://xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: 8kHz settings
+14
+15
********************************************************************/
+16
+17
#include "psych_8.h"
+18
#include "residue_8.h"
+19
+20
static const int blocksize_8[2]={
+21
512,512
+22
};
+23
+24
static const int _floor_mapping_8a[]={
+25
6,6
+26
};
+27
+28
static const int *_floor_mapping_8[]={
+29
_floor_mapping_8a
+30
};
+31
+32
static const double rate_mapping_8[3]={
+33
6000.,9000.,32000.,
+34
};
+35
+36
static const double rate_mapping_8_uncoupled[3]={
+37
8000.,14000.,42000.,
+38
};
+39
+40
static const double quality_mapping_8[3]={
+41
-.1,.0,1.
+42
};
+43
+44
static const double _psy_compand_8_mapping[3]={ 0., 1., 1.};
+45
+46
static const double _global_mapping_8[3]={ 1., 2., 3. };
+47
+48
static const ve_setup_data_template ve_setup_8_stereo={
+49
2,
+50
rate_mapping_8,
+51
quality_mapping_8,
+52
2,
+53
8000,
+54
9000,
+55
+56
blocksize_8,
+57
blocksize_8,
+58
+59
_psy_tone_masteratt_8,
+60
_psy_tone_0dB,
+61
_psy_tone_suppress,
+62
+63
_vp_tonemask_adj_8,
+64
NULL,
+65
_vp_tonemask_adj_8,
+66
+67
_psy_noiseguards_8,
+68
_psy_noisebias_8,
+69
_psy_noisebias_8,
+70
NULL,
+71
NULL,
+72
_psy_noise_suppress,
+73
+74
_psy_compand_8,
+75
_psy_compand_8_mapping,
+76
NULL,
+77
+78
{_noise_start_8,_noise_start_8},
+79
{_noise_part_8,_noise_part_8},
+80
_noise_thresh_5only,
+81
+82
_psy_ath_floater_8,
+83
_psy_ath_abs_8,
+84
+85
_psy_lowpass_8,
+86
+87
_psy_global_44,
+88
_global_mapping_8,
+89
_psy_stereo_modes_8,
+90
+91
_floor_books,
+92
_floor,
+93
1,
+94
_floor_mapping_8,
+95
+96
_mapres_template_8_stereo
+97
};
+98
+99
static const ve_setup_data_template ve_setup_8_uncoupled={
+100
2,
+101
rate_mapping_8_uncoupled,
+102
quality_mapping_8,
+103
-1,
+104
8000,
+105
9000,
+106
+107
blocksize_8,
+108
blocksize_8,
+109
+110
_psy_tone_masteratt_8,
+111
_psy_tone_0dB,
+112
_psy_tone_suppress,
+113
+114
_vp_tonemask_adj_8,
+115
NULL,
+116
_vp_tonemask_adj_8,
+117
+118
_psy_noiseguards_8,
+119
_psy_noisebias_8,
+120
_psy_noisebias_8,
+121
NULL,
+122
NULL,
+123
_psy_noise_suppress,
+124
+125
_psy_compand_8,
+126
_psy_compand_8_mapping,
+127
NULL,
+128
+129
{_noise_start_8,_noise_start_8},
+130
{_noise_part_8,_noise_part_8},
+131
_noise_thresh_5only,
+132
+133
_psy_ath_floater_8,
+134
_psy_ath_abs_8,
+135
+136
_psy_lowpass_8,
+137
+138
_psy_global_44,
+139
_global_mapping_8,
+140
_psy_stereo_modes_8,
+141
+142
_floor_books,
+143
_floor,
+144
1,
+145
_floor_mapping_8,
+146
+147
_mapres_template_8_uncoupled
+148
};
vendor/vorbis/lib/modes/setup_X.hadded
@@ -0,0 +1,224 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 *
+9
* by the Xiph.Org Foundation https://xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: catch-all toplevel settings for q modes only
+14
+15
********************************************************************/
+16
+17
static const double rate_mapping_X[12]={
+18
-1.,-1.,-1.,-1.,-1.,-1.,
+19
-1.,-1.,-1.,-1.,-1.,-1.
+20
};
+21
+22
static const ve_setup_data_template ve_setup_X_stereo={
+23
11,
+24
rate_mapping_X,
+25
quality_mapping_44,
+26
2,
+27
50000,
+28
200000,
+29
+30
blocksize_short_44,
+31
blocksize_long_44,
+32
+33
_psy_tone_masteratt_44,
+34
_psy_tone_0dB,
+35
_psy_tone_suppress,
+36
+37
_vp_tonemask_adj_otherblock,
+38
_vp_tonemask_adj_longblock,
+39
_vp_tonemask_adj_otherblock,
+40
+41
_psy_noiseguards_44,
+42
_psy_noisebias_impulse,
+43
_psy_noisebias_padding,
+44
_psy_noisebias_trans,
+45
_psy_noisebias_long,
+46
_psy_noise_suppress,
+47
+48
_psy_compand_44,
+49
_psy_compand_short_mapping,
+50
_psy_compand_long_mapping,
+51
+52
{_noise_start_short_44,_noise_start_long_44},
+53
{_noise_part_short_44,_noise_part_long_44},
+54
_noise_thresh_44,
+55
+56
_psy_ath_floater,
+57
_psy_ath_abs,
+58
+59
_psy_lowpass_44,
+60
+61
_psy_global_44,
+62
_global_mapping_44,
+63
_psy_stereo_modes_44,
+64
+65
_floor_books,
+66
_floor,
+67
2,
+68
_floor_mapping_44,
+69
+70
_mapres_template_44_stereo
+71
};
+72
+73
static const ve_setup_data_template ve_setup_X_uncoupled={
+74
11,
+75
rate_mapping_X,
+76
quality_mapping_44,
+77
-1,
+78
50000,
+79
200000,
+80
+81
blocksize_short_44,
+82
blocksize_long_44,
+83
+84
_psy_tone_masteratt_44,
+85
_psy_tone_0dB,
+86
_psy_tone_suppress,
+87
+88
_vp_tonemask_adj_otherblock,
+89
_vp_tonemask_adj_longblock,
+90
_vp_tonemask_adj_otherblock,
+91
+92
_psy_noiseguards_44,
+93
_psy_noisebias_impulse,
+94
_psy_noisebias_padding,
+95
_psy_noisebias_trans,
+96
_psy_noisebias_long,
+97
_psy_noise_suppress,
+98
+99
_psy_compand_44,
+100
_psy_compand_short_mapping,
+101
_psy_compand_long_mapping,
+102
+103
{_noise_start_short_44,_noise_start_long_44},
+104
{_noise_part_short_44,_noise_part_long_44},
+105
_noise_thresh_44,
+106
+107
_psy_ath_floater,
+108
_psy_ath_abs,
+109
+110
_psy_lowpass_44,
+111
+112
_psy_global_44,
+113
_global_mapping_44,
+114
NULL,
+115
+116
_floor_books,
+117
_floor,
+118
2,
+119
_floor_mapping_44,
+120
+121
_mapres_template_44_uncoupled
+122
};
+123
+124
static const ve_setup_data_template ve_setup_XX_stereo={
+125
2,
+126
rate_mapping_X,
+127
quality_mapping_8,
+128
2,
+129
0,
+130
8000,
+131
+132
blocksize_8,
+133
blocksize_8,
+134
+135
_psy_tone_masteratt_8,
+136
_psy_tone_0dB,
+137
_psy_tone_suppress,
+138
+139
_vp_tonemask_adj_8,
+140
NULL,
+141
_vp_tonemask_adj_8,
+142
+143
_psy_noiseguards_8,
+144
_psy_noisebias_8,
+145
_psy_noisebias_8,
+146
NULL,
+147
NULL,
+148
_psy_noise_suppress,
+149
+150
_psy_compand_8,
+151
_psy_compand_8_mapping,
+152
NULL,
+153
+154
{_noise_start_8,_noise_start_8},
+155
{_noise_part_8,_noise_part_8},
+156
_noise_thresh_5only,
+157
+158
_psy_ath_floater_8,
+159
_psy_ath_abs_8,
+160
+161
_psy_lowpass_8,
+162
+163
_psy_global_44,
+164
_global_mapping_8,
+165
_psy_stereo_modes_8,
+166
+167
_floor_books,
+168
_floor,
+169
1,
+170
_floor_mapping_8,
+171
+172
_mapres_template_8_stereo
+173
};
+174
+175
static const ve_setup_data_template ve_setup_XX_uncoupled={
+176
2,
+177
rate_mapping_X,
+178
quality_mapping_8,
+179
-1,
+180
0,
+181
8000,
+182
+183
blocksize_8,
+184
blocksize_8,
+185
+186
_psy_tone_masteratt_8,
+187
_psy_tone_0dB,
+188
_psy_tone_suppress,
+189
+190
_vp_tonemask_adj_8,
+191
NULL,
+192
_vp_tonemask_adj_8,
+193
+194
_psy_noiseguards_8,
+195
_psy_noisebias_8,
+196
_psy_noisebias_8,
+197
NULL,
+198
NULL,
+199
_psy_noise_suppress,
+200
+201
_psy_compand_8,
+202
_psy_compand_8_mapping,
+203
NULL,
+204
+205
{_noise_start_8,_noise_start_8},
+206
{_noise_part_8,_noise_part_8},
+207
_noise_thresh_5only,
+208
+209
_psy_ath_floater_8,
+210
_psy_ath_abs_8,
+211
+212
_psy_lowpass_8,
+213
+214
_psy_global_44,
+215
_global_mapping_8,
+216
_psy_stereo_modes_8,
+217
+218
_floor_books,
+219
_floor,
+220
1,
+221
_floor_mapping_8,
+222
+223
_mapres_template_8_uncoupled
+224
};
vendor/vorbis/lib/os.hadded
@@ -0,0 +1,189 @@
+1
#ifndef _OS_H
+2
#define _OS_H
+3
/********************************************************************
+4
* *
+5
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+6
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+7
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+8
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+9
* *
+10
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2015 *
+11
* by the Xiph.Org Foundation https://xiph.org/ *
+12
* *
+13
********************************************************************
+14
+15
function: #ifdef jail to whip a few platforms into the UNIX ideal.
+16
+17
********************************************************************/
+18
+19
#ifdef HAVE_CONFIG_H
+20
#include "config.h"
+21
#endif
+22
+23
#include <math.h>
+24
#include <ogg/os_types.h>
+25
+26
#include "misc.h"
+27
+28
#ifndef _V_IFDEFJAIL_H_
+29
# define _V_IFDEFJAIL_H_
+30
+31
# ifdef __GNUC__
+32
# define STIN static __inline__
+33
# elif defined(_WIN32)
+34
# define STIN static __inline
+35
# else
+36
# define STIN static
+37
# endif
+38
+39
#ifdef DJGPP
+40
# define rint(x) (floor((x)+0.5f))
+41
#endif
+42
+43
#ifndef M_PI
+44
# define M_PI (3.1415926536f)
+45
#endif
+46
+47
#if defined(_WIN32) && !defined(__SYMBIAN32__)
+48
# include <malloc.h>
+49
# define rint(x) (floor((x)+0.5f))
+50
# define NO_FLOAT_MATH_LIB
+51
# define FAST_HYPOT(a, b) sqrt((a)*(a) + (b)*(b))
+52
#endif
+53
+54
#if defined(__SYMBIAN32__) && defined(__WINS__)
+55
void *_alloca(size_t size);
+56
# define alloca _alloca
+57
#endif
+58
+59
#ifndef FAST_HYPOT
+60
# define FAST_HYPOT hypot
+61
#endif
+62
+63
#endif /* _V_IFDEFJAIL_H_ */
+64
+65
#ifdef HAVE_ALLOCA_H
+66
# include <alloca.h>
+67
#endif
+68
+69
#ifdef USE_MEMORY_H
+70
# include <memory.h>
+71
#endif
+72
+73
#ifndef min
+74
# define min(x,y) ((x)>(y)?(y):(x))
+75
#endif
+76
+77
#ifndef max
+78
# define max(x,y) ((x)<(y)?(y):(x))
+79
#endif
+80
+81
+82
/* Special i386 GCC implementation */
+83
#if defined(__i386__) && defined(__GNUC__) && !defined(__BEOS__) && !defined(__SSE2_MATH__)
+84
# define VORBIS_FPU_CONTROL
+85
/* both GCC and MSVC are kinda stupid about rounding/casting to int.
+86
Because of encapsulation constraints (GCC can't see inside the asm
+87
block and so we end up doing stupid things like a store/load that
+88
is collectively a noop), we do it this way */
+89
+90
/* we must set up the fpu before this works!! */
+91
+92
typedef ogg_int16_t vorbis_fpu_control;
+93
+94
static inline void vorbis_fpu_setround(vorbis_fpu_control *fpu){
+95
ogg_int16_t ret;
+96
ogg_int16_t temp;
+97
__asm__ __volatile__("fnstcw %0\n\t"
+98
"movw %0,%%dx\n\t"
+99
"andw $62463,%%dx\n\t"
+100
"movw %%dx,%1\n\t"
+101
"fldcw %1\n\t":"=m"(ret):"m"(temp): "dx");
+102
*fpu=ret;
+103
}
+104
+105
static inline void vorbis_fpu_restore(vorbis_fpu_control fpu){
+106
__asm__ __volatile__("fldcw %0":: "m"(fpu));
+107
}
+108
+109
/* assumes the FPU is in round mode! */
+110
static inline int vorbis_ftoi(double f){ /* yes, double! Otherwise,
+111
we get extra fst/fld to
+112
truncate precision */
+113
int i;
+114
__asm__("fistl %0": "=m"(i) : "t"(f));
+115
return(i);
+116
}
+117
#endif /* Special i386 GCC implementation */
+118
+119
+120
/* MSVC inline assembly. 32 bit only; inline ASM isn't implemented in the
+121
* 64 bit compiler and doesn't work on arm. */
+122
#if defined(_MSC_VER) && defined(_M_IX86) && !defined(_WIN32_WCE)
+123
# define VORBIS_FPU_CONTROL
+124
+125
typedef ogg_int16_t vorbis_fpu_control;
+126
+127
static __inline int vorbis_ftoi(double f){
+128
int i;
+129
__asm{
+130
fld f
+131
fistp i
+132
}
+133
return i;
+134
}
+135
+136
static __inline void vorbis_fpu_setround(vorbis_fpu_control *fpu){
+137
(void)fpu;
+138
}
+139
+140
static __inline void vorbis_fpu_restore(vorbis_fpu_control fpu){
+141
(void)fpu;
+142
}
+143
+144
#endif /* Special MSVC 32 bit implementation */
+145
+146
+147
/* Optimized code path for x86_64 builds. Uses SSE2 intrinsics. This can be
+148
done safely because all x86_64 CPUs supports SSE2. */
+149
#if (defined(_MSC_VER) && defined(_M_X64)) || (defined(__GNUC__) && defined (__SSE2_MATH__))
+150
# define VORBIS_FPU_CONTROL
+151
+152
typedef ogg_int16_t vorbis_fpu_control;
+153
+154
#include <emmintrin.h>
+155
static __inline int vorbis_ftoi(double f){
+156
return _mm_cvtsd_si32(_mm_load_sd(&f));
+157
}
+158
+159
static __inline void vorbis_fpu_setround(vorbis_fpu_control *fpu){
+160
(void)fpu;
+161
}
+162
+163
static __inline void vorbis_fpu_restore(vorbis_fpu_control fpu){
+164
(void)fpu;
+165
}
+166
+167
#endif /* Special MSVC x64 implementation */
+168
+169
+170
/* If no special implementation was found for the current compiler / platform,
+171
use the default implementation here: */
+172
#ifndef VORBIS_FPU_CONTROL
+173
+174
typedef int vorbis_fpu_control;
+175
+176
STIN int vorbis_ftoi(double f){
+177
/* Note: MSVC and GCC (at least on some systems) round towards zero, thus,
+178
the floor() call is required to ensure correct roudning of
+179
negative numbers */
+180
return (int)floor(f+.5);
+181
}
+182
+183
/* We don't have special code for this compiler/arch, so do it the slow way */
+184
# define vorbis_fpu_setround(vorbis_fpu_control) {}
+185
# define vorbis_fpu_restore(vorbis_fpu_control) {}
+186
+187
#endif /* default implementation */
+188
+189
#endif /* _OS_H */
vendor/vorbis/lib/psy.cadded
@@ -0,0 +1,1209 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2010 *
+9
* by the Xiph.Org Foundation https://xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: psychoacoustics not including preecho
+14
+15
********************************************************************/
+16
+17
#include <stdlib.h>
+18
#include <math.h>
+19
#include <string.h>
+20
#include "vorbis/codec.h"
+21
#include "codec_internal.h"
+22
+23
#include "masking.h"
+24
#include "psy.h"
+25
#include "os.h"
+26
#include "lpc.h"
+27
#include "smallft.h"
+28
#include "scales.h"
+29
#include "misc.h"
+30
+31
#define NEGINF -9999.f
+32
static const double stereo_threshholds[]={0.0, .5, 1.0, 1.5, 2.5, 4.5, 8.5, 16.5, 9e10};
+33
static const double stereo_threshholds_limited[]={0.0, .5, 1.0, 1.5, 2.0, 2.5, 4.5, 8.5, 9e10};
+34
+35
vorbis_look_psy_global *_vp_global_look(vorbis_info *vi){
+36
codec_setup_info *ci=vi->codec_setup;
+37
vorbis_info_psy_global *gi=&ci->psy_g_param;
+38
vorbis_look_psy_global *look=_ogg_calloc(1,sizeof(*look));
+39
+40
look->channels=vi->channels;
+41
+42
look->ampmax=-9999.;
+43
look->gi=gi;
+44
return(look);
+45
}
+46
+47
void _vp_global_free(vorbis_look_psy_global *look){
+48
if(look){
+49
memset(look,0,sizeof(*look));
+50
_ogg_free(look);
+51
}
+52
}
+53
+54
void _vi_gpsy_free(vorbis_info_psy_global *i){
+55
if(i){
+56
memset(i,0,sizeof(*i));
+57
_ogg_free(i);
+58
}
+59
}
+60
+61
void _vi_psy_free(vorbis_info_psy *i){
+62
if(i){
+63
memset(i,0,sizeof(*i));
+64
_ogg_free(i);
+65
}
+66
}
+67
+68
static void min_curve(float *c,
+69
float *c2){
+70
int i;
+71
for(i=0;i<EHMER_MAX;i++)if(c2[i]<c[i])c[i]=c2[i];
+72
}
+73
static void max_curve(float *c,
+74
float *c2){
+75
int i;
+76
for(i=0;i<EHMER_MAX;i++)if(c2[i]>c[i])c[i]=c2[i];
+77
}
+78
+79
static void attenuate_curve(float *c,float att){
+80
int i;
+81
for(i=0;i<EHMER_MAX;i++)
+82
c[i]+=att;
+83
}
+84
+85
static float ***setup_tone_curves(float curveatt_dB[P_BANDS],float binHz,int n,
+86
float center_boost, float center_decay_rate){
+87
int i,j,k,m;
+88
float ath[EHMER_MAX];
+89
float workc[P_BANDS][P_LEVELS][EHMER_MAX];
+90
float athc[P_LEVELS][EHMER_MAX];
+91
float *brute_buffer=alloca(n*sizeof(*brute_buffer));
+92
+93
float ***ret=_ogg_malloc(sizeof(*ret)*P_BANDS);
+94
+95
memset(workc,0,sizeof(workc));
+96
+97
for(i=0;i<P_BANDS;i++){
+98
/* we add back in the ATH to avoid low level curves falling off to
+99
-infinity and unnecessarily cutting off high level curves in the
+100
curve limiting (last step). */
+101
+102
/* A half-band's settings must be valid over the whole band, and
+103
it's better to mask too little than too much */
+104
int ath_offset=i*4;
+105
for(j=0;j<EHMER_MAX;j++){
+106
float min=999.;
+107
for(k=0;k<4;k++)
+108
if(j+k+ath_offset<MAX_ATH){
+109
if(min>ATH[j+k+ath_offset])min=ATH[j+k+ath_offset];
+110
}else{
+111
if(min>ATH[MAX_ATH-1])min=ATH[MAX_ATH-1];
+112
}
+113
ath[j]=min;
+114
}
+115
+116
/* copy curves into working space, replicate the 50dB curve to 30
+117
and 40, replicate the 100dB curve to 110 */
+118
for(j=0;j<6;j++)
+119
memcpy(workc[i][j+2],tonemasks[i][j],EHMER_MAX*sizeof(*tonemasks[i][j]));
+120
memcpy(workc[i][0],tonemasks[i][0],EHMER_MAX*sizeof(*tonemasks[i][0]));
+121
memcpy(workc[i][1],tonemasks[i][0],EHMER_MAX*sizeof(*tonemasks[i][0]));
+122
+123
/* apply centered curve boost/decay */
+124
for(j=0;j<P_LEVELS;j++){
+125
for(k=0;k<EHMER_MAX;k++){
+126
float adj=center_boost+abs(EHMER_OFFSET-k)*center_decay_rate;
+127
if(adj<0. && center_boost>0)adj=0.;
+128
if(adj>0. && center_boost<0)adj=0.;
+129
workc[i][j][k]+=adj;
+130
}
+131
}
+132
+133
/* normalize curves so the driving amplitude is 0dB */
+134
/* make temp curves with the ATH overlayed */
+135
for(j=0;j<P_LEVELS;j++){
+136
attenuate_curve(workc[i][j],curveatt_dB[i]+100.-(j<2?2:j)*10.-P_LEVEL_0);
+137
memcpy(athc[j],ath,EHMER_MAX*sizeof(**athc));
+138
attenuate_curve(athc[j],+100.-j*10.f-P_LEVEL_0);
+139
max_curve(athc[j],workc[i][j]);
+140
}
+141
+142
/* Now limit the louder curves.
+143
+144
the idea is this: We don't know what the playback attenuation
+145
will be; 0dB SL moves every time the user twiddles the volume
+146
knob. So that means we have to use a single 'most pessimal' curve
+147
for all masking amplitudes, right? Wrong. The *loudest* sound
+148
can be in (we assume) a range of ...+100dB] SL. However, sounds
+149
20dB down will be in a range ...+80], 40dB down is from ...+60],
+150
etc... */
+151
+152
for(j=1;j<P_LEVELS;j++){
+153
min_curve(athc[j],athc[j-1]);
+154
min_curve(workc[i][j],athc[j]);
+155
}
+156
}
+157
+158
for(i=0;i<P_BANDS;i++){
+159
int hi_curve,lo_curve,bin;
+160
ret[i]=_ogg_malloc(sizeof(**ret)*P_LEVELS);
+161
+162
/* low frequency curves are measured with greater resolution than
+163
the MDCT/FFT will actually give us; we want the curve applied
+164
to the tone data to be pessimistic and thus apply the minimum
+165
masking possible for a given bin. That means that a single bin
+166
could span more than one octave and that the curve will be a
+167
composite of multiple octaves. It also may mean that a single
+168
bin may span > an eighth of an octave and that the eighth
+169
octave values may also be composited. */
+170
+171
/* which octave curves will we be compositing? */
+172
bin=floor(fromOC(i*.5)/binHz);
+173
lo_curve= ceil(toOC(bin*binHz+1)*2);
+174
hi_curve= floor(toOC((bin+1)*binHz)*2);
+175
if(lo_curve>i)lo_curve=i;
+176
if(lo_curve<0)lo_curve=0;
+177
if(hi_curve>=P_BANDS)hi_curve=P_BANDS-1;
+178
+179
for(m=0;m<P_LEVELS;m++){
+180
ret[i][m]=_ogg_malloc(sizeof(***ret)*(EHMER_MAX+2));
+181
+182
for(j=0;j<n;j++)brute_buffer[j]=999.;
+183
+184
/* render the curve into bins, then pull values back into curve.
+185
The point is that any inherent subsampling aliasing results in
+186
a safe minimum */
+187
for(k=lo_curve;k<=hi_curve;k++){
+188
int l=0;
+189
+190
for(j=0;j<EHMER_MAX;j++){
+191
int lo_bin= fromOC(j*.125+k*.5-2.0625)/binHz;
+192
int hi_bin= fromOC(j*.125+k*.5-1.9375)/binHz+1;
+193
+194
if(lo_bin<0)lo_bin=0;
+195
if(lo_bin>n)lo_bin=n;
+196
if(lo_bin<l)l=lo_bin;
+197
if(hi_bin<0)hi_bin=0;
+198
if(hi_bin>n)hi_bin=n;
+199
+200
for(;l<hi_bin && l<n;l++)
+201
if(brute_buffer[l]>workc[k][m][j])
+202
brute_buffer[l]=workc[k][m][j];
+203
}
+204
+205
for(;l<n;l++)
+206
if(brute_buffer[l]>workc[k][m][EHMER_MAX-1])
+207
brute_buffer[l]=workc[k][m][EHMER_MAX-1];
+208
+209
}
+210
+211
/* be equally paranoid about being valid up to next half ocatve */
+212
if(i+1<P_BANDS){
+213
int l=0;
+214
k=i+1;
+215
for(j=0;j<EHMER_MAX;j++){
+216
int lo_bin= fromOC(j*.125+i*.5-2.0625)/binHz;
+217
int hi_bin= fromOC(j*.125+i*.5-1.9375)/binHz+1;
+218
+219
if(lo_bin<0)lo_bin=0;
+220
if(lo_bin>n)lo_bin=n;
+221
if(lo_bin<l)l=lo_bin;
+222
if(hi_bin<0)hi_bin=0;
+223
if(hi_bin>n)hi_bin=n;
+224
+225
for(;l<hi_bin && l<n;l++)
+226
if(brute_buffer[l]>workc[k][m][j])
+227
brute_buffer[l]=workc[k][m][j];
+228
}
+229
+230
for(;l<n;l++)
+231
if(brute_buffer[l]>workc[k][m][EHMER_MAX-1])
+232
brute_buffer[l]=workc[k][m][EHMER_MAX-1];
+233
+234
}
+235
+236
+237
for(j=0;j<EHMER_MAX;j++){
+238
int bin=fromOC(j*.125+i*.5-2.)/binHz;
+239
if(bin<0){
+240
ret[i][m][j+2]=-999.;
+241
}else{
+242
if(bin>=n){
+243
ret[i][m][j+2]=-999.;
+244
}else{
+245
ret[i][m][j+2]=brute_buffer[bin];
+246
}
+247
}
+248
}
+249
+250
/* add fenceposts */
+251
for(j=0;j<EHMER_OFFSET;j++)
+252
if(ret[i][m][j+2]>-200.f)break;
+253
ret[i][m][0]=j;
+254
+255
for(j=EHMER_MAX-1;j>EHMER_OFFSET+1;j--)
+256
if(ret[i][m][j+2]>-200.f)
+257
break;
+258
ret[i][m][1]=j;
+259
+260
}
+261
}
+262
+263
return(ret);
+264
}
+265
+266
void _vp_psy_init(vorbis_look_psy *p,vorbis_info_psy *vi,
+267
vorbis_info_psy_global *gi,int n,long rate){
+268
long i,j,lo=-99,hi=1;
+269
long maxoc;
+270
memset(p,0,sizeof(*p));
+271
+272
p->eighth_octave_lines=gi->eighth_octave_lines;
+273
p->shiftoc=rint(log(gi->eighth_octave_lines*8.f)/log(2.f))-1;
+274
+275
p->firstoc=toOC(.25f*rate*.5/n)*(1<<(p->shiftoc+1))-gi->eighth_octave_lines;
+276
maxoc=toOC((n+.25f)*rate*.5/n)*(1<<(p->shiftoc+1))+.5f;
+277
p->total_octave_lines=maxoc-p->firstoc+1;
+278
p->ath=_ogg_malloc(n*sizeof(*p->ath));
+279
+280
p->octave=_ogg_malloc(n*sizeof(*p->octave));
+281
p->bark=_ogg_malloc(n*sizeof(*p->bark));
+282
p->vi=vi;
+283
p->n=n;
+284
p->rate=rate;
+285
+286
/* AoTuV HF weighting */
+287
p->m_val = 1.;
+288
if(rate < 26000) p->m_val = 0;
+289
else if(rate < 38000) p->m_val = .94; /* 32kHz */
+290
else if(rate > 46000) p->m_val = 1.275; /* 48kHz */
+291
+292
/* set up the lookups for a given blocksize and sample rate */
+293
+294
for(i=0,j=0;i<MAX_ATH-1;i++){
+295
int endpos=rint(fromOC((i+1)*.125-2.)*2*n/rate);
+296
float base=ATH[i];
+297
if(j<endpos){
+298
float delta=(ATH[i+1]-base)/(endpos-j);
+299
for(;j<endpos && j<n;j++){
+300
p->ath[j]=base+100.;
+301
base+=delta;
+302
}
+303
}
+304
}
+305
+306
for(;j<n;j++){
+307
p->ath[j]=p->ath[j-1];
+308
}
+309
+310
for(i=0;i<n;i++){
+311
float bark=toBARK(rate/(2*n)*i);
+312
+313
for(;lo+vi->noisewindowlomin<i &&
+314
toBARK(rate/(2*n)*lo)<(bark-vi->noisewindowlo);lo++);
+315
+316
for(;hi<=n && (hi<i+vi->noisewindowhimin ||
+317
toBARK(rate/(2*n)*hi)<(bark+vi->noisewindowhi));hi++);
+318
+319
p->bark[i]=((lo-1)<<16)+(hi-1);
+320
+321
}
+322
+323
for(i=0;i<n;i++)
+324
p->octave[i]=toOC((i+.25f)*.5*rate/n)*(1<<(p->shiftoc+1))+.5f;
+325
+326
p->tonecurves=setup_tone_curves(vi->toneatt,rate*.5/n,n,
+327
vi->tone_centerboost,vi->tone_decay);
+328
+329
/* set up rolling noise median */
+330
p->noiseoffset=_ogg_malloc(P_NOISECURVES*sizeof(*p->noiseoffset));
+331
for(i=0;i<P_NOISECURVES;i++)
+332
p->noiseoffset[i]=_ogg_malloc(n*sizeof(**p->noiseoffset));
+333
+334
for(i=0;i<n;i++){
+335
float halfoc=toOC((i+.5)*rate/(2.*n))*2.;
+336
int inthalfoc;
+337
float del;
+338
+339
if(halfoc<0)halfoc=0;
+340
if(halfoc>=P_BANDS-1)halfoc=P_BANDS-1;
+341
inthalfoc=(int)halfoc;
+342
del=halfoc-inthalfoc;
+343
+344
for(j=0;j<P_NOISECURVES;j++)
+345
p->noiseoffset[j][i]=
+346
p->vi->noiseoff[j][inthalfoc]*(1.-del) +
+347
p->vi->noiseoff[j][inthalfoc+1]*del;
+348
+349
}
+350
#if 0
+351
{
+352
static int ls=0;
+353
_analysis_output_always("noiseoff0",ls,p->noiseoffset[0],n,1,0,0);
+354
_analysis_output_always("noiseoff1",ls,p->noiseoffset[1],n,1,0,0);
+355
_analysis_output_always("noiseoff2",ls++,p->noiseoffset[2],n,1,0,0);
+356
}
+357
#endif
+358
}
+359
+360
void _vp_psy_clear(vorbis_look_psy *p){
+361
int i,j;
+362
if(p){
+363
if(p->ath)_ogg_free(p->ath);
+364
if(p->octave)_ogg_free(p->octave);
+365
if(p->bark)_ogg_free(p->bark);
+366
if(p->tonecurves){
+367
for(i=0;i<P_BANDS;i++){
+368
for(j=0;j<P_LEVELS;j++){
+369
_ogg_free(p->tonecurves[i][j]);
+370
}
+371
_ogg_free(p->tonecurves[i]);
+372
}
+373
_ogg_free(p->tonecurves);
+374
}
+375
if(p->noiseoffset){
+376
for(i=0;i<P_NOISECURVES;i++){
+377
_ogg_free(p->noiseoffset[i]);
+378
}
+379
_ogg_free(p->noiseoffset);
+380
}
+381
memset(p,0,sizeof(*p));
+382
}
+383
}
+384
+385
/* octave/(8*eighth_octave_lines) x scale and dB y scale */
+386
static void seed_curve(float *seed,
+387
const float **curves,
+388
float amp,
+389
int oc, int n,
+390
int linesper,float dBoffset){
+391
int i,post1;
+392
int seedptr;
+393
const float *posts,*curve;
+394
+395
int choice=(int)((amp+dBoffset-P_LEVEL_0)*.1f);
+396
choice=max(choice,0);
+397
choice=min(choice,P_LEVELS-1);
+398
posts=curves[choice];
+399
curve=posts+2;
+400
post1=(int)posts[1];
+401
seedptr=oc+(posts[0]-EHMER_OFFSET)*linesper-(linesper>>1);
+402
+403
for(i=posts[0];i<post1;i++){
+404
if(seedptr>0){
+405
float lin=amp+curve[i];
+406
if(seed[seedptr]<lin)seed[seedptr]=lin;
+407
}
+408
seedptr+=linesper;
+409
if(seedptr>=n)break;
+410
}
+411
}
+412
+413
static void seed_loop(vorbis_look_psy *p,
+414
const float ***curves,
+415
const float *f,
+416
const float *flr,
+417
float *seed,
+418
float specmax){
+419
vorbis_info_psy *vi=p->vi;
+420
long n=p->n,i;
+421
float dBoffset=vi->max_curve_dB-specmax;
+422
+423
/* prime the working vector with peak values */
+424
+425
for(i=0;i<n;i++){
+426
float max=f[i];
+427
long oc=p->octave[i];
+428
while(i+1<n && p->octave[i+1]==oc){
+429
i++;
+430
if(f[i]>max)max=f[i];
+431
}
+432
+433
if(max+6.f>flr[i]){
+434
oc=oc>>p->shiftoc;
+435
+436
if(oc>=P_BANDS)oc=P_BANDS-1;
+437
if(oc<0)oc=0;
+438
+439
seed_curve(seed,
+440
curves[oc],
+441
max,
+442
p->octave[i]-p->firstoc,
+443
p->total_octave_lines,
+444
p->eighth_octave_lines,
+445
dBoffset);
+446
}
+447
}
+448
}
+449
+450
static void seed_chase(float *seeds, int linesper, long n){
+451
long *posstack=alloca(n*sizeof(*posstack));
+452
float *ampstack=alloca(n*sizeof(*ampstack));
+453
long stack=0;
+454
long pos=0;
+455
long i;
+456
+457
for(i=0;i<n;i++){
+458
if(stack<2){
+459
posstack[stack]=i;
+460
ampstack[stack++]=seeds[i];
+461
}else{
+462
while(1){
+463
if(seeds[i]<ampstack[stack-1]){
+464
posstack[stack]=i;
+465
ampstack[stack++]=seeds[i];
+466
break;
+467
}else{
+468
if(i<posstack[stack-1]+linesper){
+469
if(stack>1 && ampstack[stack-1]<=ampstack[stack-2] &&
+470
i<posstack[stack-2]+linesper){
+471
/* we completely overlap, making stack-1 irrelevant. pop it */
+472
stack--;
+473
continue;
+474
}
+475
}
+476
posstack[stack]=i;
+477
ampstack[stack++]=seeds[i];
+478
break;
+479
+480
}
+481
}
+482
}
+483
}
+484
+485
/* the stack now contains only the positions that are relevant. Scan
+486
'em straight through */
+487
+488
for(i=0;i<stack;i++){
+489
long endpos;
+490
if(i<stack-1 && ampstack[i+1]>ampstack[i]){
+491
endpos=posstack[i+1];
+492
}else{
+493
endpos=posstack[i]+linesper+1; /* +1 is important, else bin 0 is
+494
discarded in short frames */
+495
}
+496
if(endpos>n)endpos=n;
+497
for(;pos<endpos;pos++)
+498
seeds[pos]=ampstack[i];
+499
}

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
@@ -0,0 +1,153 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 *
+9
* by the Xiph.Org Foundation https://xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: random psychoacoustics (not including preecho)
+14
+15
********************************************************************/
+16
+17
#ifndef _V_PSY_H_
+18
#define _V_PSY_H_
+19
#include "smallft.h"
+20
+21
#include "backends.h"
+22
#include "envelope.h"
+23
+24
#ifndef EHMER_MAX
+25
#define EHMER_MAX 56
+26
#endif
+27
+28
/* psychoacoustic setup ********************************************/
+29
#define P_BANDS 17 /* 62Hz to 16kHz */
+30
#define P_LEVELS 8 /* 30dB to 100dB */
+31
#define P_LEVEL_0 30. /* 30 dB */
+32
#define P_NOISECURVES 3
+33
+34
#define NOISE_COMPAND_LEVELS 40
+35
typedef struct vorbis_info_psy{
+36
int blockflag;
+37
+38
float ath_adjatt;
+39
float ath_maxatt;
+40
+41
float tone_masteratt[P_NOISECURVES];
+42
float tone_centerboost;
+43
float tone_decay;
+44
float tone_abs_limit;
+45
float toneatt[P_BANDS];
+46
+47
int noisemaskp;
+48
float noisemaxsupp;
+49
float noisewindowlo;
+50
float noisewindowhi;
+51
int noisewindowlomin;
+52
int noisewindowhimin;
+53
int noisewindowfixed;
+54
float noiseoff[P_NOISECURVES][P_BANDS];
+55
float noisecompand[NOISE_COMPAND_LEVELS];
+56
+57
float max_curve_dB;
+58
+59
int normal_p;
+60
int normal_start;
+61
int normal_partition;
+62
double normal_thresh;
+63
} vorbis_info_psy;
+64
+65
typedef struct{
+66
int eighth_octave_lines;
+67
+68
/* for block long/short tuning; encode only */
+69
float preecho_thresh[VE_BANDS];
+70
float postecho_thresh[VE_BANDS];
+71
float stretch_penalty;
+72
float preecho_minenergy;
+73
+74
float ampmax_att_per_sec;
+75
+76
/* channel coupling config */
+77
int coupling_pkHz[PACKETBLOBS];
+78
int coupling_pointlimit[2][PACKETBLOBS];
+79
int coupling_prepointamp[PACKETBLOBS];
+80
int coupling_postpointamp[PACKETBLOBS];
+81
int sliding_lowpass[2][PACKETBLOBS];
+82
+83
} vorbis_info_psy_global;
+84
+85
typedef struct {
+86
float ampmax;
+87
int channels;
+88
+89
vorbis_info_psy_global *gi;
+90
int coupling_pointlimit[2][P_NOISECURVES];
+91
} vorbis_look_psy_global;
+92
+93
+94
typedef struct {
+95
int n;
+96
struct vorbis_info_psy *vi;
+97
+98
float ***tonecurves;
+99
float **noiseoffset;
+100
+101
float *ath;
+102
long *octave; /* in n.ocshift format */
+103
long *bark;
+104
+105
long firstoc;
+106
long shiftoc;
+107
int eighth_octave_lines; /* power of two, please */
+108
int total_octave_lines;
+109
long rate; /* cache it */
+110
+111
float m_val; /* Masking compensation value */
+112
+113
} vorbis_look_psy;
+114
+115
extern void _vp_psy_init(vorbis_look_psy *p,vorbis_info_psy *vi,
+116
vorbis_info_psy_global *gi,int n,long rate);
+117
extern void _vp_psy_clear(vorbis_look_psy *p);
+118
extern void *_vi_psy_dup(void *source);
+119
+120
extern void _vi_psy_free(vorbis_info_psy *i);
+121
extern vorbis_info_psy *_vi_psy_copy(vorbis_info_psy *i);
+122
+123
extern void _vp_noisemask(vorbis_look_psy *p,
+124
float *logmdct,
+125
float *logmask);
+126
+127
extern void _vp_tonemask(vorbis_look_psy *p,
+128
float *logfft,
+129
float *logmask,
+130
float global_specmax,
+131
float local_specmax);
+132
+133
extern void _vp_offset_and_mix(vorbis_look_psy *p,
+134
float *noise,
+135
float *tone,
+136
int offset_select,
+137
float *logmask,
+138
float *mdct,
+139
float *logmdct);
+140
+141
extern float _vp_ampmax_decay(float amp,vorbis_dsp_state *vd);
+142
+143
extern void _vp_couple_quantize_normalize(int blobno,
+144
vorbis_info_psy_global *g,
+145
vorbis_look_psy *p,
+146
vorbis_info_mapping0 *vi,
+147
float **mdct,
+148
int **iwork,
+149
int *nonzero,
+150
int sliding_lowpass,
+151
int ch);
+152
+153
#endif
vendor/vorbis/lib/registry.cadded
@@ -0,0 +1,44 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 *
+9
* by the Xiph.Org Foundation https://xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: registry for time, floor, res backends and channel mappings
+14
+15
********************************************************************/
+16
+17
#include "vorbis/codec.h"
+18
#include "codec_internal.h"
+19
#include "registry.h"
+20
#include "misc.h"
+21
/* seems like major overkill now; the backend numbers will grow into
+22
the infrastructure soon enough */
+23
+24
extern const vorbis_func_floor floor0_exportbundle;
+25
extern const vorbis_func_floor floor1_exportbundle;
+26
extern const vorbis_func_residue residue0_exportbundle;
+27
extern const vorbis_func_residue residue1_exportbundle;
+28
extern const vorbis_func_residue residue2_exportbundle;
+29
extern const vorbis_func_mapping mapping0_exportbundle;
+30
+31
const vorbis_func_floor *const _floor_P[]={
+32
&floor0_exportbundle,
+33
&floor1_exportbundle,
+34
};
+35
+36
const vorbis_func_residue *const _residue_P[]={
+37
&residue0_exportbundle,
+38
&residue1_exportbundle,
+39
&residue2_exportbundle,
+40
};
+41
+42
const vorbis_func_mapping *const _mapping_P[]={
+43
&mapping0_exportbundle,
+44
};
vendor/vorbis/lib/registry.hadded
@@ -0,0 +1,31 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 *
+9
* by the Xiph.Org Foundation https://xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: registry for time, floor, res backends and channel mappings
+14
+15
********************************************************************/
+16
+17
#ifndef _V_REG_H_
+18
#define _V_REG_H_
+19
+20
#define VI_TRANSFORMB 1
+21
#define VI_WINDOWB 1
+22
#define VI_TIMEB 1
+23
#define VI_FLOORB 2
+24
#define VI_RESB 3
+25
#define VI_MAPB 1
+26
+27
extern const vorbis_func_floor *const _floor_P[];
+28
extern const vorbis_func_residue *const _residue_P[];
+29
extern const vorbis_func_mapping *const _mapping_P[];
+30
+31
#endif
vendor/vorbis/lib/res0.cadded
@@ -0,0 +1,886 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2010 *
+9
* by the Xiph.Org Foundation https://xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: residue backend 0, 1 and 2 implementation
+14
+15
********************************************************************/
+16
+17
/* Slow, slow, slow, simpleminded and did I mention it was slow? The
+18
encode/decode loops are coded for clarity and performance is not
+19
yet even a nagging little idea lurking in the shadows. Oh and BTW,
+20
it's slow. */
+21
+22
#include <stdlib.h>
+23
#include <string.h>
+24
#include <math.h>
+25
#include <ogg/ogg.h>
+26
#include "vorbis/codec.h"
+27
#include "codec_internal.h"
+28
#include "registry.h"
+29
#include "codebook.h"
+30
#include "misc.h"
+31
#include "os.h"
+32
+33
#if defined(TRAIN_RES) || defined (TRAIN_RESAUX)
+34
#include <stdio.h>
+35
#endif
+36
+37
typedef struct {
+38
vorbis_info_residue0 *info;
+39
+40
int parts;
+41
int stages;
+42
codebook *fullbooks;
+43
codebook *phrasebook;
+44
codebook ***partbooks;
+45
+46
int partvals;
+47
int **decodemap;
+48
+49
long postbits;
+50
long phrasebits;
+51
long frames;
+52
+53
#if defined(TRAIN_RES) || defined(TRAIN_RESAUX)
+54
int train_seq;
+55
long *training_data[8][64];
+56
float training_max[8][64];
+57
float training_min[8][64];
+58
float tmin;
+59
float tmax;
+60
int submap;
+61
#endif
+62
+63
} vorbis_look_residue0;
+64
+65
void res0_free_info(vorbis_info_residue *i){
+66
vorbis_info_residue0 *info=(vorbis_info_residue0 *)i;
+67
if(info){
+68
memset(info,0,sizeof(*info));
+69
_ogg_free(info);
+70
}
+71
}
+72
+73
void res0_free_look(vorbis_look_residue *i){
+74
int j;
+75
if(i){
+76
+77
vorbis_look_residue0 *look=(vorbis_look_residue0 *)i;
+78
+79
#ifdef TRAIN_RES
+80
{
+81
int j,k,l;
+82
for(j=0;j<look->parts;j++){
+83
/*fprintf(stderr,"partition %d: ",j);*/
+84
for(k=0;k<8;k++)
+85
if(look->training_data[k][j]){
+86
char buffer[80];
+87
FILE *of;
+88
codebook *statebook=look->partbooks[j][k];
+89
+90
/* long and short into the same bucket by current convention */
+91
sprintf(buffer,"res_sub%d_part%d_pass%d.vqd",look->submap,j,k);
+92
of=fopen(buffer,"a");
+93
+94
for(l=0;l<statebook->entries;l++)
+95
fprintf(of,"%d:%ld\n",l,look->training_data[k][j][l]);
+96
+97
fclose(of);
+98
+99
/*fprintf(stderr,"%d(%.2f|%.2f) ",k,
+100
look->training_min[k][j],look->training_max[k][j]);*/
+101
+102
_ogg_free(look->training_data[k][j]);
+103
look->training_data[k][j]=NULL;
+104
}
+105
/*fprintf(stderr,"\n");*/
+106
}
+107
}
+108
fprintf(stderr,"min/max residue: %g::%g\n",look->tmin,look->tmax);
+109
+110
/*fprintf(stderr,"residue bit usage %f:%f (%f total)\n",
+111
(float)look->phrasebits/look->frames,
+112
(float)look->postbits/look->frames,
+113
(float)(look->postbits+look->phrasebits)/look->frames);*/
+114
#endif
+115
+116
+117
/*vorbis_info_residue0 *info=look->info;
+118
+119
fprintf(stderr,
+120
"%ld frames encoded in %ld phrasebits and %ld residue bits "
+121
"(%g/frame) \n",look->frames,look->phrasebits,
+122
look->resbitsflat,
+123
(look->phrasebits+look->resbitsflat)/(float)look->frames);
+124
+125
for(j=0;j<look->parts;j++){
+126
long acc=0;
+127
fprintf(stderr,"\t[%d] == ",j);
+128
for(k=0;k<look->stages;k++)
+129
if((info->secondstages[j]>>k)&1){
+130
fprintf(stderr,"%ld,",look->resbits[j][k]);
+131
acc+=look->resbits[j][k];
+132
}
+133
+134
fprintf(stderr,":: (%ld vals) %1.2fbits/sample\n",look->resvals[j],
+135
acc?(float)acc/(look->resvals[j]*info->grouping):0);
+136
}
+137
fprintf(stderr,"\n");*/
+138
+139
for(j=0;j<look->parts;j++)
+140
if(look->partbooks[j])_ogg_free(look->partbooks[j]);
+141
_ogg_free(look->partbooks);
+142
for(j=0;j<look->partvals;j++)
+143
_ogg_free(look->decodemap[j]);
+144
_ogg_free(look->decodemap);
+145
+146
memset(look,0,sizeof(*look));
+147
_ogg_free(look);
+148
}
+149
}
+150
+151
static int icount(unsigned int v){
+152
int ret=0;
+153
while(v){
+154
ret+=v&1;
+155
v>>=1;
+156
}
+157
return(ret);
+158
}
+159
+160
+161
void res0_pack(vorbis_info_residue *vr,oggpack_buffer *opb){
+162
vorbis_info_residue0 *info=(vorbis_info_residue0 *)vr;
+163
int j,acc=0;
+164
oggpack_write(opb,info->begin,24);
+165
oggpack_write(opb,info->end,24);
+166
+167
oggpack_write(opb,info->grouping-1,24); /* residue vectors to group and
+168
code with a partitioned book */
+169
oggpack_write(opb,info->partitions-1,6); /* possible partition choices */
+170
oggpack_write(opb,info->groupbook,8); /* group huffman book */
+171
+172
/* secondstages is a bitmask; as encoding progresses pass by pass, a
+173
bitmask of one indicates this partition class has bits to write
+174
this pass */
+175
for(j=0;j<info->partitions;j++){
+176
if(ov_ilog(info->secondstages[j])>3){
+177
/* yes, this is a minor hack due to not thinking ahead */
+178
oggpack_write(opb,info->secondstages[j],3);
+179
oggpack_write(opb,1,1);
+180
oggpack_write(opb,info->secondstages[j]>>3,5);
+181
}else
+182
oggpack_write(opb,info->secondstages[j],4); /* trailing zero */
+183
acc+=icount(info->secondstages[j]);
+184
}
+185
for(j=0;j<acc;j++)
+186
oggpack_write(opb,info->booklist[j],8);
+187
+188
}
+189
+190
/* vorbis_info is for range checking */
+191
vorbis_info_residue *res0_unpack(vorbis_info *vi,oggpack_buffer *opb){
+192
int j,acc=0;
+193
vorbis_info_residue0 *info=_ogg_calloc(1,sizeof(*info));
+194
codec_setup_info *ci=vi->codec_setup;
+195
+196
info->begin=oggpack_read(opb,24);
+197
info->end=oggpack_read(opb,24);
+198
info->grouping=oggpack_read(opb,24)+1;
+199
info->partitions=oggpack_read(opb,6)+1;
+200
info->groupbook=oggpack_read(opb,8);
+201
+202
/* check for premature EOP */
+203
if(info->groupbook<0)goto errout;
+204
+205
for(j=0;j<info->partitions;j++){
+206
int cascade=oggpack_read(opb,3);
+207
int cflag=oggpack_read(opb,1);
+208
if(cflag<0) goto errout;
+209
if(cflag){
+210
int c=oggpack_read(opb,5);
+211
if(c<0) goto errout;
+212
cascade|=(c<<3);
+213
}
+214
info->secondstages[j]=cascade;
+215
+216
acc+=icount(cascade);
+217
}
+218
for(j=0;j<acc;j++){
+219
int book=oggpack_read(opb,8);
+220
if(book<0) goto errout;
+221
info->booklist[j]=book;
+222
}
+223
+224
if(info->groupbook>=ci->books)goto errout;
+225
for(j=0;j<acc;j++){
+226
if(info->booklist[j]>=ci->books)goto errout;
+227
if(ci->book_param[info->booklist[j]]->maptype==0)goto errout;
+228
}
+229
+230
/* verify the phrasebook is not specifying an impossible or
+231
inconsistent partitioning scheme. */
+232
/* modify the phrasebook ranging check from r16327; an early beta
+233
encoder had a bug where it used an oversized phrasebook by
+234
accident. These files should continue to be playable, but don't
+235
allow an exploit */
+236
{
+237
int entries = ci->book_param[info->groupbook]->entries;
+238
int dim = ci->book_param[info->groupbook]->dim;
+239
int partvals = 1;
+240
if (dim<1) goto errout;
+241
while(dim>0){
+242
partvals *= info->partitions;
+243
if(partvals > entries) goto errout;
+244
dim--;
+245
}
+246
info->partvals = partvals;
+247
}
+248
+249
return(info);
+250
errout:
+251
res0_free_info(info);
+252
return(NULL);
+253
}
+254
+255
vorbis_look_residue *res0_look(vorbis_dsp_state *vd,
+256
vorbis_info_residue *vr){
+257
vorbis_info_residue0 *info=(vorbis_info_residue0 *)vr;
+258
vorbis_look_residue0 *look=_ogg_calloc(1,sizeof(*look));
+259
codec_setup_info *ci=vd->vi->codec_setup;
+260
+261
int j,k,acc=0;
+262
int dim;
+263
int maxstage=0;
+264
look->info=info;
+265
+266
look->parts=info->partitions;
+267
look->fullbooks=ci->fullbooks;
+268
look->phrasebook=ci->fullbooks+info->groupbook;
+269
dim=look->phrasebook->dim;
+270
+271
look->partbooks=_ogg_calloc(look->parts,sizeof(*look->partbooks));
+272
+273
for(j=0;j<look->parts;j++){
+274
int stages=ov_ilog(info->secondstages[j]);
+275
if(stages){
+276
if(stages>maxstage)maxstage=stages;
+277
look->partbooks[j]=_ogg_calloc(stages,sizeof(*look->partbooks[j]));
+278
for(k=0;k<stages;k++)
+279
if(info->secondstages[j]&(1<<k)){
+280
look->partbooks[j][k]=ci->fullbooks+info->booklist[acc++];
+281
#ifdef TRAIN_RES
+282
look->training_data[k][j]=_ogg_calloc(look->partbooks[j][k]->entries,
+283
sizeof(***look->training_data));
+284
#endif
+285
}
+286
}
+287
}
+288
+289
look->partvals=1;
+290
for(j=0;j<dim;j++)
+291
look->partvals*=look->parts;
+292
+293
look->stages=maxstage;
+294
look->decodemap=_ogg_malloc(look->partvals*sizeof(*look->decodemap));
+295
for(j=0;j<look->partvals;j++){
+296
long val=j;
+297
long mult=look->partvals/look->parts;
+298
look->decodemap[j]=_ogg_malloc(dim*sizeof(*look->decodemap[j]));
+299
for(k=0;k<dim;k++){
+300
long deco=val/mult;
+301
val-=deco*mult;
+302
mult/=look->parts;
+303
look->decodemap[j][k]=deco;
+304
}
+305
}
+306
#if defined(TRAIN_RES) || defined (TRAIN_RESAUX)
+307
{
+308
static int train_seq=0;
+309
look->train_seq=train_seq++;
+310
}
+311
#endif
+312
return(look);
+313
}
+314
+315
/* break an abstraction and copy some code for performance purposes */
+316
static int local_book_besterror(codebook *book,int *a){
+317
int dim=book->dim;
+318
int i,j,o;
+319
int minval=book->minval;
+320
int del=book->delta;
+321
int qv=book->quantvals;
+322
int ze=(qv>>1);
+323
int index=0;
+324
/* assumes integer/centered encoder codebook maptype 1 no more than dim 8 */
+325
int p[8]={0,0,0,0,0,0,0,0};
+326
+327
if(del!=1){
+328
for(i=0,o=dim;i<dim;i++){
+329
int v = (a[--o]-minval+(del>>1))/del;
+330
int m = (v<ze ? ((ze-v)<<1)-1 : ((v-ze)<<1));
+331
index = index*qv+ (m<0?0:(m>=qv?qv-1:m));
+332
p[o]=v*del+minval;
+333
}
+334
}else{
+335
for(i=0,o=dim;i<dim;i++){
+336
int v = a[--o]-minval;
+337
int m = (v<ze ? ((ze-v)<<1)-1 : ((v-ze)<<1));
+338
index = index*qv+ (m<0?0:(m>=qv?qv-1:m));
+339
p[o]=v*del+minval;
+340
}
+341
}
+342
+343
if(book->c->lengthlist[index]<=0){
+344
const static_codebook *c=book->c;
+345
int best=-1;
+346
/* assumes integer/centered encoder codebook maptype 1 no more than dim 8 */
+347
int e[8]={0,0,0,0,0,0,0,0};
+348
int maxval = book->minval + book->delta*(book->quantvals-1);
+349
for(i=0;i<book->entries;i++){
+350
if(c->lengthlist[i]>0){
+351
int this=0;
+352
for(j=0;j<dim;j++){
+353
int val=(e[j]-a[j]);
+354
this+=val*val;
+355
}
+356
if(best==-1 || this<best){
+357
memcpy(p,e,sizeof(p));
+358
best=this;
+359
index=i;
+360
}
+361
}
+362
/* assumes the value patterning created by the tools in vq/ */
+363
j=0;
+364
while(e[j]>=maxval)
+365
e[j++]=0;
+366
if(e[j]>=0)
+367
e[j]+=book->delta;
+368
e[j]= -e[j];
+369
}
+370
}
+371
+372
if(index>-1){
+373
for(i=0;i<dim;i++)
+374
*a++ -= p[i];
+375
}
+376
+377
return(index);
+378
}
+379
+380
#ifdef TRAIN_RES
+381
static int _encodepart(oggpack_buffer *opb,int *vec, int n,
+382
codebook *book,long *acc){
+383
#else
+384
static int _encodepart(oggpack_buffer *opb,int *vec, int n,
+385
codebook *book){
+386
#endif
+387
int i,bits=0;
+388
int dim=book->dim;
+389
int step=n/dim;
+390
+391
for(i=0;i<step;i++){
+392
int entry=local_book_besterror(book,vec+i*dim);
+393
+394
#ifdef TRAIN_RES
+395
if(entry>=0)
+396
acc[entry]++;
+397
#endif
+398
+399
bits+=vorbis_book_encode(book,entry,opb);
+400
+401
}
+402
+403
return(bits);
+404
}
+405
+406
static long **_01class(vorbis_block *vb,vorbis_look_residue *vl,
+407
int **in,int ch){
+408
long i,j,k;
+409
vorbis_look_residue0 *look=(vorbis_look_residue0 *)vl;
+410
vorbis_info_residue0 *info=look->info;
+411
+412
/* move all this setup out later */
+413
int samples_per_partition=info->grouping;
+414
int possible_partitions=info->partitions;
+415
int n=info->end-info->begin;
+416
+417
int partvals=n/samples_per_partition;
+418
long **partword=_vorbis_block_alloc(vb,ch*sizeof(*partword));
+419
float scale=100./samples_per_partition;
+420
+421
/* we find the partition type for each partition of each
+422
channel. We'll go back and do the interleaved encoding in a
+423
bit. For now, clarity */
+424
+425
for(i=0;i<ch;i++){
+426
partword[i]=_vorbis_block_alloc(vb,n/samples_per_partition*sizeof(*partword[i]));
+427
memset(partword[i],0,n/samples_per_partition*sizeof(*partword[i]));
+428
}
+429
+430
for(i=0;i<partvals;i++){
+431
int offset=i*samples_per_partition+info->begin;
+432
for(j=0;j<ch;j++){
+433
int max=0;
+434
int ent=0;
+435
for(k=0;k<samples_per_partition;k++){
+436
if(abs(in[j][offset+k])>max)max=abs(in[j][offset+k]);
+437
ent+=abs(in[j][offset+k]);
+438
}
+439
ent*=scale;
+440
+441
for(k=0;k<possible_partitions-1;k++)
+442
if(max<=info->classmetric1[k] &&
+443
(info->classmetric2[k]<0 || ent<info->classmetric2[k]))
+444
break;
+445
+446
partword[j][i]=k;
+447
}
+448
}
+449
+450
#ifdef TRAIN_RESAUX
+451
{
+452
FILE *of;
+453
char buffer[80];
+454
+455
for(i=0;i<ch;i++){
+456
sprintf(buffer,"resaux_%d.vqd",look->train_seq);
+457
of=fopen(buffer,"a");
+458
for(j=0;j<partvals;j++)
+459
fprintf(of,"%ld, ",partword[i][j]);
+460
fprintf(of,"\n");
+461
fclose(of);
+462
}
+463
}
+464
#endif
+465
look->frames++;
+466
+467
return(partword);
+468
}
+469
+470
/* designed for stereo or other modes where the partition size is an
+471
integer multiple of the number of channels encoded in the current
+472
submap */
+473
static long **_2class(vorbis_block *vb,vorbis_look_residue *vl,int **in,
+474
int ch){
+475
long i,j,k,l;
+476
vorbis_look_residue0 *look=(vorbis_look_residue0 *)vl;
+477
vorbis_info_residue0 *info=look->info;
+478
+479
/* move all this setup out later */
+480
int samples_per_partition=info->grouping;
+481
int possible_partitions=info->partitions;
+482
int n=info->end-info->begin;
+483
+484
int partvals=n/samples_per_partition;
+485
long **partword=_vorbis_block_alloc(vb,sizeof(*partword));
+486
+487
#if defined(TRAIN_RES) || defined (TRAIN_RESAUX)
+488
FILE *of;
+489
char buffer[80];
+490
#endif
+491
+492
partword[0]=_vorbis_block_alloc(vb,partvals*sizeof(*partword[0]));
+493
memset(partword[0],0,partvals*sizeof(*partword[0]));
+494
+495
for(i=0,l=info->begin/ch;i<partvals;i++){
+496
int magmax=0;
+497
int angmax=0;
+498
for(j=0;j<samples_per_partition;j+=ch){
+499
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
@@ -0,0 +1,89 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 *
+9
* by the Xiph.Org Foundation https://xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: linear scale -> dB, Bark and Mel scales
+14
+15
********************************************************************/
+16
+17
#ifndef _V_SCALES_H_
+18
#define _V_SCALES_H_
+19
+20
#include <math.h>
+21
#include "os.h"
+22
+23
#ifdef _MSC_VER
+24
/* MS Visual Studio doesn't have C99 inline keyword. */
+25
#define inline __inline
+26
#endif
+27
+28
/* 20log10(x) */
+29
#define VORBIS_IEEE_FLOAT32 1
+30
#ifdef VORBIS_IEEE_FLOAT32
+31
+32
static inline float unitnorm(float x){
+33
union {
+34
ogg_uint32_t i;
+35
float f;
+36
} ix;
+37
ix.f = x;
+38
ix.i = (ix.i & 0x80000000U) | (0x3f800000U);
+39
return ix.f;
+40
}
+41
+42
/* Segher was off (too high) by ~ .3 decibel. Center the conversion correctly. */
+43
static inline float todB(const float *x){
+44
union {
+45
ogg_uint32_t i;
+46
float f;
+47
} ix;
+48
ix.f = *x;
+49
ix.i = ix.i&0x7fffffff;
+50
return (float)(ix.i * 7.17711438e-7f -764.6161886f);
+51
}
+52
+53
#define todB_nn(x) todB(x)
+54
+55
#else
+56
+57
static float unitnorm(float x){
+58
if(x<0)return(-1.f);
+59
return(1.f);
+60
}
+61
+62
#define todB(x) (*(x)==0?-400.f:log(*(x)**(x))*4.34294480f)
+63
#define todB_nn(x) (*(x)==0.f?-400.f:log(*(x))*8.6858896f)
+64
+65
#endif
+66
+67
#define fromdB(x) (exp((x)*.11512925f))
+68
+69
/* The bark scale equations are approximations, since the original
+70
table was somewhat hand rolled. The below are chosen to have the
+71
best possible fit to the rolled tables, thus their somewhat odd
+72
appearance (these are more accurate and over a longer range than
+73
the oft-quoted bark equations found in the texts I have). The
+74
approximations are valid from 0 - 30kHz (nyquist) or so.
+75
+76
all f in Hz, z in Bark */
+77
+78
#define toBARK(n) (13.1f*atan(.00074f*(n))+2.24f*atan((n)*(n)*1.85e-8f)+1e-4f*(n))
+79
#define fromBARK(z) (102.f*(z)-2.f*pow(z,2.f)+.4f*pow(z,3.f)+pow(1.46f,z)-1.f)
+80
#define toMEL(n) (log(1.f+(n)*.001f)*1442.695f)
+81
#define fromMEL(m) (1000.f*exp((m)/1442.695f)-1000.f)
+82
+83
/* Frequency to octave. We arbitrarily declare 63.5 Hz to be octave
+84
0.0 */
+85
+86
#define toOC(n) (log(n)*1.442695f-5.965784f)
+87
#define fromOC(o) (exp(((o)+5.965784f)*.693147f))
+88
+89
#endif
vendor/vorbis/lib/sharedbook.cadded
@@ -0,0 +1,604 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2015 *
+9
* by the Xiph.Org Foundation https://xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: basic shared codebook operations
+14
+15
********************************************************************/
+16
+17
#include <stdlib.h>
+18
#include <limits.h>
+19
#include <math.h>
+20
#include <string.h>
+21
#include <ogg/ogg.h>
+22
#include "os.h"
+23
#include "misc.h"
+24
#include "vorbis/codec.h"
+25
#include "codebook.h"
+26
#include "scales.h"
+27
+28
/**** pack/unpack helpers ******************************************/
+29
+30
int ov_ilog(ogg_uint32_t v){
+31
int ret;
+32
for(ret=0;v;ret++)v>>=1;
+33
return ret;
+34
}
+35
+36
/* 32 bit float (not IEEE; nonnormalized mantissa +
+37
biased exponent) : neeeeeee eeemmmmm mmmmmmmm mmmmmmmm
+38
Why not IEEE? It's just not that important here. */
+39
+40
#define VQ_FEXP 10
+41
#define VQ_FMAN 21
+42
#define VQ_FEXP_BIAS 768 /* bias toward values smaller than 1. */
+43
+44
/* doesn't currently guard under/overflow */
+45
long _float32_pack(float val){
+46
int sign=0;
+47
long exp;
+48
long mant;
+49
if(val<0){
+50
sign=0x80000000;
+51
val= -val;
+52
}
+53
exp= floor(log(val)/log(2.f)+.001); /* +epsilon */
+54
mant=rint(ldexp(val,(VQ_FMAN-1)-exp));
+55
exp=(exp+VQ_FEXP_BIAS)<<VQ_FMAN;
+56
+57
return(sign|exp|mant);
+58
}
+59
+60
float _float32_unpack(long val){
+61
double mant=val&0x1fffff;
+62
int sign=val&0x80000000;
+63
long exp =(val&0x7fe00000L)>>VQ_FMAN;
+64
if(sign)mant= -mant;
+65
exp=exp-(VQ_FMAN-1)-VQ_FEXP_BIAS;
+66
/* clamp excessive exponent values */
+67
if (exp>63){
+68
exp=63;
+69
}
+70
if (exp<-63){
+71
exp=-63;
+72
}
+73
return(ldexp(mant,exp));
+74
}
+75
+76
/* given a list of word lengths, generate a list of codewords. Works
+77
for length ordered or unordered, always assigns the lowest valued
+78
codewords first. Extended to handle unused entries (length 0) */
+79
ogg_uint32_t *_make_words(char *l,long n,long sparsecount){
+80
long i,j,count=0;
+81
ogg_uint32_t marker[33];
+82
ogg_uint32_t *r=_ogg_malloc((sparsecount?sparsecount:n)*sizeof(*r));
+83
memset(marker,0,sizeof(marker));
+84
+85
for(i=0;i<n;i++){
+86
long length=l[i];
+87
if(length>0){
+88
ogg_uint32_t entry=marker[length];
+89
+90
/* when we claim a node for an entry, we also claim the nodes
+91
below it (pruning off the imagined tree that may have dangled
+92
from it) as well as blocking the use of any nodes directly
+93
above for leaves */
+94
+95
/* update ourself */
+96
if(length<32 && (entry>>length)){
+97
/* error condition; the lengths must specify an overpopulated tree */
+98
_ogg_free(r);
+99
return(NULL);
+100
}
+101
r[count++]=entry;
+102
+103
/* Look to see if the next shorter marker points to the node
+104
above. if so, update it and repeat. */
+105
{
+106
for(j=length;j>0;j--){
+107
+108
if(marker[j]&1){
+109
/* have to jump branches */
+110
if(j==1)
+111
marker[1]++;
+112
else
+113
marker[j]=marker[j-1]<<1;
+114
break; /* invariant says next upper marker would already
+115
have been moved if it was on the same path */
+116
}
+117
marker[j]++;
+118
}
+119
}
+120
+121
/* prune the tree; the implicit invariant says all the longer
+122
markers were dangling from our just-taken node. Dangle them
+123
from our *new* node. */
+124
for(j=length+1;j<33;j++)
+125
if((marker[j]>>1) == entry){
+126
entry=marker[j];
+127
marker[j]=marker[j-1]<<1;
+128
}else
+129
break;
+130
}else
+131
if(sparsecount==0)count++;
+132
}
+133
+134
/* any underpopulated tree must be rejected. */
+135
/* Single-entry codebooks are a retconned extension to the spec.
+136
They have a single codeword '0' of length 1 that results in an
+137
underpopulated tree. Shield that case from the underformed tree check. */
+138
if(!(count==1 && marker[2]==2)){
+139
for(i=1;i<33;i++)
+140
if(marker[i] & (0xffffffffUL>>(32-i))){
+141
_ogg_free(r);
+142
return(NULL);
+143
}
+144
}
+145
+146
/* bitreverse the words because our bitwise packer/unpacker is LSb
+147
endian */
+148
for(i=0,count=0;i<n;i++){
+149
ogg_uint32_t temp=0;
+150
for(j=0;j<l[i];j++){
+151
temp<<=1;
+152
temp|=(r[count]>>j)&1;
+153
}
+154
+155
if(sparsecount){
+156
if(l[i])
+157
r[count++]=temp;
+158
}else
+159
r[count++]=temp;
+160
}
+161
+162
return(r);
+163
}
+164
+165
/* there might be a straightforward one-line way to do the below
+166
that's portable and totally safe against roundoff, but I haven't
+167
thought of it. Therefore, we opt on the side of caution */
+168
long _book_maptype1_quantvals(const static_codebook *b){
+169
long vals;
+170
if(b->entries<1){
+171
return(0);
+172
}
+173
vals=floor(pow((float)b->entries,1.f/b->dim));
+174
+175
/* the above *should* be reliable, but we'll not assume that FP is
+176
ever reliable when bitstream sync is at stake; verify via integer
+177
means that vals really is the greatest value of dim for which
+178
vals^b->bim <= b->entries */
+179
/* treat the above as an initial guess */
+180
if(vals<1){
+181
vals=1;
+182
}
+183
while(1){
+184
long acc=1;
+185
long acc1=1;
+186
int i;
+187
for(i=0;i<b->dim;i++){
+188
if(b->entries/vals<acc)break;
+189
acc*=vals;
+190
if(LONG_MAX/(vals+1)<acc1)acc1=LONG_MAX;
+191
else acc1*=vals+1;
+192
}
+193
if(i>=b->dim && acc<=b->entries && acc1>b->entries){
+194
return(vals);
+195
}else{
+196
if(i<b->dim || acc>b->entries){
+197
vals--;
+198
}else{
+199
vals++;
+200
}
+201
}
+202
}
+203
}
+204
+205
/* unpack the quantized list of values for encode/decode ***********/
+206
/* we need to deal with two map types: in map type 1, the values are
+207
generated algorithmically (each column of the vector counts through
+208
the values in the quant vector). in map type 2, all the values came
+209
in in an explicit list. Both value lists must be unpacked */
+210
float *_book_unquantize(const static_codebook *b,int n,int *sparsemap){
+211
long j,k,count=0;
+212
if(b->maptype==1 || b->maptype==2){
+213
int quantvals;
+214
float mindel=_float32_unpack(b->q_min);
+215
float delta=_float32_unpack(b->q_delta);
+216
float *r=_ogg_calloc(n*b->dim,sizeof(*r));
+217
+218
/* maptype 1 and 2 both use a quantized value vector, but
+219
different sizes */
+220
switch(b->maptype){
+221
case 1:
+222
/* most of the time, entries%dimensions == 0, but we need to be
+223
well defined. We define that the possible vales at each
+224
scalar is values == entries/dim. If entries%dim != 0, we'll
+225
have 'too few' values (values*dim<entries), which means that
+226
we'll have 'left over' entries; left over entries use zeroed
+227
values (and are wasted). So don't generate codebooks like
+228
that */
+229
quantvals=_book_maptype1_quantvals(b);
+230
for(j=0;j<b->entries;j++){
+231
if((sparsemap && b->lengthlist[j]) || !sparsemap){
+232
float last=0.f;
+233
int indexdiv=1;
+234
for(k=0;k<b->dim;k++){
+235
int index= (j/indexdiv)%quantvals;
+236
float val=b->quantlist[index];
+237
val=fabs(val)*delta+mindel+last;
+238
if(b->q_sequencep)last=val;
+239
if(sparsemap)
+240
r[sparsemap[count]*b->dim+k]=val;
+241
else
+242
r[count*b->dim+k]=val;
+243
indexdiv*=quantvals;
+244
}
+245
count++;
+246
}
+247
+248
}
+249
break;
+250
case 2:
+251
for(j=0;j<b->entries;j++){
+252
if((sparsemap && b->lengthlist[j]) || !sparsemap){
+253
float last=0.f;
+254
+255
for(k=0;k<b->dim;k++){
+256
float val=b->quantlist[j*b->dim+k];
+257
val=fabs(val)*delta+mindel+last;
+258
if(b->q_sequencep)last=val;
+259
if(sparsemap)
+260
r[sparsemap[count]*b->dim+k]=val;
+261
else
+262
r[count*b->dim+k]=val;
+263
}
+264
count++;
+265
}
+266
}
+267
break;
+268
}
+269
+270
return(r);
+271
}
+272
return(NULL);
+273
}
+274
+275
void vorbis_staticbook_destroy(static_codebook *b){
+276
if(b->allocedp){
+277
if(b->quantlist)_ogg_free(b->quantlist);
+278
if(b->lengthlist)_ogg_free(b->lengthlist);
+279
memset(b,0,sizeof(*b));
+280
_ogg_free(b);
+281
} /* otherwise, it is in static memory */
+282
}
+283
+284
void vorbis_book_clear(codebook *b){
+285
/* static book is not cleared; we're likely called on the lookup and
+286
the static codebook belongs to the info struct */
+287
if(b->valuelist)_ogg_free(b->valuelist);
+288
if(b->codelist)_ogg_free(b->codelist);
+289
+290
if(b->dec_index)_ogg_free(b->dec_index);
+291
if(b->dec_codelengths)_ogg_free(b->dec_codelengths);
+292
if(b->dec_firsttable)_ogg_free(b->dec_firsttable);
+293
+294
memset(b,0,sizeof(*b));
+295
}
+296
+297
int vorbis_book_init_encode(codebook *c,const static_codebook *s){
+298
+299
memset(c,0,sizeof(*c));
+300
c->c=s;
+301
c->entries=s->entries;
+302
c->used_entries=s->entries;
+303
c->dim=s->dim;
+304
c->codelist=_make_words(s->lengthlist,s->entries,0);
+305
/* c->valuelist=_book_unquantize(s,s->entries,NULL); */
+306
c->quantvals=_book_maptype1_quantvals(s);
+307
c->minval=(int)rint(_float32_unpack(s->q_min));
+308
c->delta=(int)rint(_float32_unpack(s->q_delta));
+309
+310
return(0);
+311
}
+312
+313
static ogg_uint32_t bitreverse(ogg_uint32_t x){
+314
x= ((x>>16)&0x0000ffffUL) | ((x<<16)&0xffff0000UL);
+315
x= ((x>> 8)&0x00ff00ffUL) | ((x<< 8)&0xff00ff00UL);
+316
x= ((x>> 4)&0x0f0f0f0fUL) | ((x<< 4)&0xf0f0f0f0UL);
+317
x= ((x>> 2)&0x33333333UL) | ((x<< 2)&0xccccccccUL);
+318
return((x>> 1)&0x55555555UL) | ((x<< 1)&0xaaaaaaaaUL);
+319
}
+320
+321
static int sort32a(const void *a,const void *b){
+322
return ( **(ogg_uint32_t **)a>**(ogg_uint32_t **)b)-
+323
( **(ogg_uint32_t **)a<**(ogg_uint32_t **)b);
+324
}
+325
+326
/* decode codebook arrangement is more heavily optimized than encode */
+327
int vorbis_book_init_decode(codebook *c,const static_codebook *s){
+328
int i,j,n=0,tabn;
+329
int *sortindex;
+330
+331
memset(c,0,sizeof(*c));
+332
+333
/* count actually used entries and find max length */
+334
for(i=0;i<s->entries;i++)
+335
if(s->lengthlist[i]>0)
+336
n++;
+337
+338
c->entries=s->entries;
+339
c->used_entries=n;
+340
c->dim=s->dim;
+341
+342
if(n>0){
+343
/* two different remappings go on here.
+344
+345
First, we collapse the likely sparse codebook down only to
+346
actually represented values/words. This collapsing needs to be
+347
indexed as map-valueless books are used to encode original entry
+348
positions as integers.
+349
+350
Second, we reorder all vectors, including the entry index above,
+351
by sorted bitreversed codeword to allow treeless decode. */
+352
+353
/* perform sort */
+354
ogg_uint32_t *codes=_make_words(s->lengthlist,s->entries,c->used_entries);
+355
ogg_uint32_t **codep=alloca(sizeof(*codep)*n);
+356
+357
if(codes==NULL)goto err_out;
+358
+359
for(i=0;i<n;i++){
+360
codes[i]=bitreverse(codes[i]);
+361
codep[i]=codes+i;
+362
}
+363
+364
qsort(codep,n,sizeof(*codep),sort32a);
+365
+366
sortindex=alloca(n*sizeof(*sortindex));
+367
c->codelist=_ogg_malloc(n*sizeof(*c->codelist));
+368
/* the index is a reverse index */
+369
for(i=0;i<n;i++){
+370
int position=codep[i]-codes;
+371
sortindex[position]=i;
+372
}
+373
+374
for(i=0;i<n;i++)
+375
c->codelist[sortindex[i]]=codes[i];
+376
_ogg_free(codes);
+377
+378
c->valuelist=_book_unquantize(s,n,sortindex);
+379
c->dec_index=_ogg_malloc(n*sizeof(*c->dec_index));
+380
+381
for(n=0,i=0;i<s->entries;i++)
+382
if(s->lengthlist[i]>0)
+383
c->dec_index[sortindex[n++]]=i;
+384
+385
c->dec_codelengths=_ogg_malloc(n*sizeof(*c->dec_codelengths));
+386
c->dec_maxlength=0;
+387
for(n=0,i=0;i<s->entries;i++)
+388
if(s->lengthlist[i]>0){
+389
c->dec_codelengths[sortindex[n++]]=s->lengthlist[i];
+390
if(s->lengthlist[i]>c->dec_maxlength)
+391
c->dec_maxlength=s->lengthlist[i];
+392
}
+393
+394
if(n==1 && c->dec_maxlength==1){
+395
/* special case the 'single entry codebook' with a single bit
+396
fastpath table (that always returns entry 0 )in order to use
+397
unmodified decode paths. */
+398
c->dec_firsttablen=1;
+399
c->dec_firsttable=_ogg_calloc(2,sizeof(*c->dec_firsttable));
+400
c->dec_firsttable[0]=c->dec_firsttable[1]=1;
+401
+402
}else{
+403
c->dec_firsttablen=ov_ilog(c->used_entries)-4; /* this is magic */
+404
if(c->dec_firsttablen<5)c->dec_firsttablen=5;
+405
if(c->dec_firsttablen>8)c->dec_firsttablen=8;
+406
+407
tabn=1<<c->dec_firsttablen;
+408
c->dec_firsttable=_ogg_calloc(tabn,sizeof(*c->dec_firsttable));
+409
+410
for(i=0;i<n;i++){
+411
if(c->dec_codelengths[i]<=c->dec_firsttablen){
+412
ogg_uint32_t orig=bitreverse(c->codelist[i]);
+413
for(j=0;j<(1<<(c->dec_firsttablen-c->dec_codelengths[i]));j++)
+414
c->dec_firsttable[orig|(j<<c->dec_codelengths[i])]=i+1;
+415
}
+416
}
+417
+418
/* now fill in 'unused' entries in the firsttable with hi/lo search
+419
hints for the non-direct-hits */
+420
{
+421
ogg_uint32_t mask=0xfffffffeUL<<(31-c->dec_firsttablen);
+422
long lo=0,hi=0;
+423
+424
for(i=0;i<tabn;i++){
+425
ogg_uint32_t word=i<<(32-c->dec_firsttablen);
+426
if(c->dec_firsttable[bitreverse(word)]==0){
+427
while((lo+1)<n && c->codelist[lo+1]<=word)lo++;
+428
while( hi<n && word>=(c->codelist[hi]&mask))hi++;
+429
+430
/* we only actually have 15 bits per hint to play with here.
+431
In order to overflow gracefully (nothing breaks, efficiency
+432
just drops), encode as the difference from the extremes. */
+433
{
+434
unsigned long loval=lo;
+435
unsigned long hival=n-hi;
+436
+437
if(loval>0x7fff)loval=0x7fff;
+438
if(hival>0x7fff)hival=0x7fff;
+439
c->dec_firsttable[bitreverse(word)]=
+440
0x80000000UL | (loval<<15) | hival;
+441
}
+442
}
+443
}
+444
}
+445
}
+446
}
+447
+448
return(0);
+449
err_out:
+450
vorbis_book_clear(c);
+451
return(-1);
+452
}
+453
+454
long vorbis_book_codeword(codebook *book,int entry){
+455
if(book->c) /* only use with encode; decode optimizations are
+456
allowed to break this */
+457
return book->codelist[entry];
+458
return -1;
+459
}
+460
+461
long vorbis_book_codelen(codebook *book,int entry){
+462
if(book->c) /* only use with encode; decode optimizations are
+463
allowed to break this */
+464
return book->c->lengthlist[entry];
+465
return -1;
+466
}
+467
+468
#ifdef _V_SELFTEST
+469
+470
/* Unit tests of the dequantizer; this stuff will be OK
+471
cross-platform, I simply want to be sure that special mapping cases
+472
actually work properly; a bug could go unnoticed for a while */
+473
+474
#include <stdio.h>
+475
+476
/* cases:
+477
+478
no mapping
+479
full, explicit mapping
+480
algorithmic mapping
+481
+482
nonsequential
+483
sequential
+484
*/
+485
+486
static long full_quantlist1[]={0,1,2,3, 4,5,6,7, 8,3,6,1};
+487
static long partial_quantlist1[]={0,7,2};
+488
+489
/* no mapping */
+490
static_codebook test1={
+491
4,16,
+492
NULL,
+493
0,
+494
0,0,0,0,
+495
NULL,
+496
0
+497
};
+498
static float *test1_result=NULL;
+499

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
@@ -0,0 +1,1254 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 *
+9
* by the Xiph.Org Foundation https://xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: *unnormalized* fft transform
+14
+15
********************************************************************/
+16
+17
/* FFT implementation from OggSquish, minus cosine transforms,
+18
* minus all but radix 2/4 case. In Vorbis we only need this
+19
* cut-down version.
+20
*
+21
* To do more than just power-of-two sized vectors, see the full
+22
* version I wrote for NetLib.
+23
*
+24
* Note that the packing is a little strange; rather than the FFT r/i
+25
* packing following R_0, I_n, R_1, I_1, R_2, I_2 ... R_n-1, I_n-1,
+26
* it follows R_0, R_1, I_1, R_2, I_2 ... R_n-1, I_n-1, I_n like the
+27
* FORTRAN version
+28
*/
+29
+30
#include <stdlib.h>
+31
#include <string.h>
+32
#include <math.h>
+33
#include "smallft.h"
+34
#include "os.h"
+35
#include "misc.h"
+36
+37
static void drfti1(int n, float *wa, int *ifac){
+38
static int ntryh[4] = { 4,2,3,5 };
+39
static float tpi = 6.28318530717958648f;
+40
float arg,argh,argld,fi;
+41
int ntry=0,i,j=-1;
+42
int k1, l1, l2, ib;
+43
int ld, ii, ip, is, nq, nr;
+44
int ido, ipm, nfm1;
+45
int nl=n;
+46
int nf=0;
+47
+48
L101:
+49
j++;
+50
if (j < 4)
+51
ntry=ntryh[j];
+52
else
+53
ntry+=2;
+54
+55
L104:
+56
nq=nl/ntry;
+57
nr=nl-ntry*nq;
+58
if (nr!=0) goto L101;
+59
+60
nf++;
+61
ifac[nf+1]=ntry;
+62
nl=nq;
+63
if(ntry!=2)goto L107;
+64
if(nf==1)goto L107;
+65
+66
for (i=1;i<nf;i++){
+67
ib=nf-i+1;
+68
ifac[ib+1]=ifac[ib];
+69
}
+70
ifac[2] = 2;
+71
+72
L107:
+73
if(nl!=1)goto L104;
+74
ifac[0]=n;
+75
ifac[1]=nf;
+76
argh=tpi/n;
+77
is=0;
+78
nfm1=nf-1;
+79
l1=1;
+80
+81
if(nfm1==0)return;
+82
+83
for (k1=0;k1<nfm1;k1++){
+84
ip=ifac[k1+2];
+85
ld=0;
+86
l2=l1*ip;
+87
ido=n/l2;
+88
ipm=ip-1;
+89
+90
for (j=0;j<ipm;j++){
+91
ld+=l1;
+92
i=is;
+93
argld=(float)ld*argh;
+94
fi=0.f;
+95
for (ii=2;ii<ido;ii+=2){
+96
fi+=1.f;
+97
arg=fi*argld;
+98
wa[i++]=cos(arg);
+99
wa[i++]=sin(arg);
+100
}
+101
is+=ido;
+102
}
+103
l1=l2;
+104
}
+105
}
+106
+107
static void fdrffti(int n, float *wsave, int *ifac){
+108
+109
if (n == 1) return;
+110
drfti1(n, wsave+n, ifac);
+111
}
+112
+113
static void dradf2(int ido,int l1,float *cc,float *ch,float *wa1){
+114
int i,k;
+115
float ti2,tr2;
+116
int t0,t1,t2,t3,t4,t5,t6;
+117
+118
t1=0;
+119
t0=(t2=l1*ido);
+120
t3=ido<<1;
+121
for(k=0;k<l1;k++){
+122
ch[t1<<1]=cc[t1]+cc[t2];
+123
ch[(t1<<1)+t3-1]=cc[t1]-cc[t2];
+124
t1+=ido;
+125
t2+=ido;
+126
}
+127
+128
if(ido<2)return;
+129
if(ido==2)goto L105;
+130
+131
t1=0;
+132
t2=t0;
+133
for(k=0;k<l1;k++){
+134
t3=t2;
+135
t4=(t1<<1)+(ido<<1);
+136
t5=t1;
+137
t6=t1+t1;
+138
for(i=2;i<ido;i+=2){
+139
t3+=2;
+140
t4-=2;
+141
t5+=2;
+142
t6+=2;
+143
tr2=wa1[i-2]*cc[t3-1]+wa1[i-1]*cc[t3];
+144
ti2=wa1[i-2]*cc[t3]-wa1[i-1]*cc[t3-1];
+145
ch[t6]=cc[t5]+ti2;
+146
ch[t4]=ti2-cc[t5];
+147
ch[t6-1]=cc[t5-1]+tr2;
+148
ch[t4-1]=cc[t5-1]-tr2;
+149
}
+150
t1+=ido;
+151
t2+=ido;
+152
}
+153
+154
if(ido%2==1)return;
+155
+156
L105:
+157
t3=(t2=(t1=ido)-1);
+158
t2+=t0;
+159
for(k=0;k<l1;k++){
+160
ch[t1]=-cc[t2];
+161
ch[t1-1]=cc[t3];
+162
t1+=ido<<1;
+163
t2+=ido;
+164
t3+=ido;
+165
}
+166
}
+167
+168
static void dradf4(int ido,int l1,float *cc,float *ch,float *wa1,
+169
float *wa2,float *wa3){
+170
static float hsqt2 = .70710678118654752f;
+171
int i,k,t0,t1,t2,t3,t4,t5,t6;
+172
float ci2,ci3,ci4,cr2,cr3,cr4,ti1,ti2,ti3,ti4,tr1,tr2,tr3,tr4;
+173
t0=l1*ido;
+174
+175
t1=t0;
+176
t4=t1<<1;
+177
t2=t1+(t1<<1);
+178
t3=0;
+179
+180
for(k=0;k<l1;k++){
+181
tr1=cc[t1]+cc[t2];
+182
tr2=cc[t3]+cc[t4];
+183
+184
ch[t5=t3<<2]=tr1+tr2;
+185
ch[(ido<<2)+t5-1]=tr2-tr1;
+186
ch[(t5+=(ido<<1))-1]=cc[t3]-cc[t4];
+187
ch[t5]=cc[t2]-cc[t1];
+188
+189
t1+=ido;
+190
t2+=ido;
+191
t3+=ido;
+192
t4+=ido;
+193
}
+194
+195
if(ido<2)return;
+196
if(ido==2)goto L105;
+197
+198
+199
t1=0;
+200
for(k=0;k<l1;k++){
+201
t2=t1;
+202
t4=t1<<2;
+203
t5=(t6=ido<<1)+t4;
+204
for(i=2;i<ido;i+=2){
+205
t3=(t2+=2);
+206
t4+=2;
+207
t5-=2;
+208
+209
t3+=t0;
+210
cr2=wa1[i-2]*cc[t3-1]+wa1[i-1]*cc[t3];
+211
ci2=wa1[i-2]*cc[t3]-wa1[i-1]*cc[t3-1];
+212
t3+=t0;
+213
cr3=wa2[i-2]*cc[t3-1]+wa2[i-1]*cc[t3];
+214
ci3=wa2[i-2]*cc[t3]-wa2[i-1]*cc[t3-1];
+215
t3+=t0;
+216
cr4=wa3[i-2]*cc[t3-1]+wa3[i-1]*cc[t3];
+217
ci4=wa3[i-2]*cc[t3]-wa3[i-1]*cc[t3-1];
+218
+219
tr1=cr2+cr4;
+220
tr4=cr4-cr2;
+221
ti1=ci2+ci4;
+222
ti4=ci2-ci4;
+223
+224
ti2=cc[t2]+ci3;
+225
ti3=cc[t2]-ci3;
+226
tr2=cc[t2-1]+cr3;
+227
tr3=cc[t2-1]-cr3;
+228
+229
ch[t4-1]=tr1+tr2;
+230
ch[t4]=ti1+ti2;
+231
+232
ch[t5-1]=tr3-ti4;
+233
ch[t5]=tr4-ti3;
+234
+235
ch[t4+t6-1]=ti4+tr3;
+236
ch[t4+t6]=tr4+ti3;
+237
+238
ch[t5+t6-1]=tr2-tr1;
+239
ch[t5+t6]=ti1-ti2;
+240
}
+241
t1+=ido;
+242
}
+243
if(ido&1)return;
+244
+245
L105:
+246
+247
t2=(t1=t0+ido-1)+(t0<<1);
+248
t3=ido<<2;
+249
t4=ido;
+250
t5=ido<<1;
+251
t6=ido;
+252
+253
for(k=0;k<l1;k++){
+254
ti1=-hsqt2*(cc[t1]+cc[t2]);
+255
tr1=hsqt2*(cc[t1]-cc[t2]);
+256
+257
ch[t4-1]=tr1+cc[t6-1];
+258
ch[t4+t5-1]=cc[t6-1]-tr1;
+259
+260
ch[t4]=ti1-cc[t1+t0];
+261
ch[t4+t5]=ti1+cc[t1+t0];
+262
+263
t1+=ido;
+264
t2+=ido;
+265
t4+=t3;
+266
t6+=ido;
+267
}
+268
}
+269
+270
static void dradfg(int ido,int ip,int l1,int idl1,float *cc,float *c1,
+271
float *c2,float *ch,float *ch2,float *wa){
+272
+273
static float tpi=6.283185307179586f;
+274
int idij,ipph,i,j,k,l,ic,ik,is;
+275
int t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
+276
float dc2,ai1,ai2,ar1,ar2,ds2;
+277
int nbd;
+278
float dcp,arg,dsp,ar1h,ar2h;
+279
int idp2,ipp2;
+280
+281
arg=tpi/(float)ip;
+282
dcp=cos(arg);
+283
dsp=sin(arg);
+284
ipph=(ip+1)>>1;
+285
ipp2=ip;
+286
idp2=ido;
+287
nbd=(ido-1)>>1;
+288
t0=l1*ido;
+289
t10=ip*ido;
+290
+291
if(ido==1)goto L119;
+292
for(ik=0;ik<idl1;ik++)ch2[ik]=c2[ik];
+293
+294
t1=0;
+295
for(j=1;j<ip;j++){
+296
t1+=t0;
+297
t2=t1;
+298
for(k=0;k<l1;k++){
+299
ch[t2]=c1[t2];
+300
t2+=ido;
+301
}
+302
}
+303
+304
is=-ido;
+305
t1=0;
+306
if(nbd>l1){
+307
for(j=1;j<ip;j++){
+308
t1+=t0;
+309
is+=ido;
+310
t2= -ido+t1;
+311
for(k=0;k<l1;k++){
+312
idij=is-1;
+313
t2+=ido;
+314
t3=t2;
+315
for(i=2;i<ido;i+=2){
+316
idij+=2;
+317
t3+=2;
+318
ch[t3-1]=wa[idij-1]*c1[t3-1]+wa[idij]*c1[t3];
+319
ch[t3]=wa[idij-1]*c1[t3]-wa[idij]*c1[t3-1];
+320
}
+321
}
+322
}
+323
}else{
+324
+325
for(j=1;j<ip;j++){
+326
is+=ido;
+327
idij=is-1;
+328
t1+=t0;
+329
t2=t1;
+330
for(i=2;i<ido;i+=2){
+331
idij+=2;
+332
t2+=2;
+333
t3=t2;
+334
for(k=0;k<l1;k++){
+335
ch[t3-1]=wa[idij-1]*c1[t3-1]+wa[idij]*c1[t3];
+336
ch[t3]=wa[idij-1]*c1[t3]-wa[idij]*c1[t3-1];
+337
t3+=ido;
+338
}
+339
}
+340
}
+341
}
+342
+343
t1=0;
+344
t2=ipp2*t0;
+345
if(nbd<l1){
+346
for(j=1;j<ipph;j++){
+347
t1+=t0;
+348
t2-=t0;
+349
t3=t1;
+350
t4=t2;
+351
for(i=2;i<ido;i+=2){
+352
t3+=2;
+353
t4+=2;
+354
t5=t3-ido;
+355
t6=t4-ido;
+356
for(k=0;k<l1;k++){
+357
t5+=ido;
+358
t6+=ido;
+359
c1[t5-1]=ch[t5-1]+ch[t6-1];
+360
c1[t6-1]=ch[t5]-ch[t6];
+361
c1[t5]=ch[t5]+ch[t6];
+362
c1[t6]=ch[t6-1]-ch[t5-1];
+363
}
+364
}
+365
}
+366
}else{
+367
for(j=1;j<ipph;j++){
+368
t1+=t0;
+369
t2-=t0;
+370
t3=t1;
+371
t4=t2;
+372
for(k=0;k<l1;k++){
+373
t5=t3;
+374
t6=t4;
+375
for(i=2;i<ido;i+=2){
+376
t5+=2;
+377
t6+=2;
+378
c1[t5-1]=ch[t5-1]+ch[t6-1];
+379
c1[t6-1]=ch[t5]-ch[t6];
+380
c1[t5]=ch[t5]+ch[t6];
+381
c1[t6]=ch[t6-1]-ch[t5-1];
+382
}
+383
t3+=ido;
+384
t4+=ido;
+385
}
+386
}
+387
}
+388
+389
L119:
+390
for(ik=0;ik<idl1;ik++)c2[ik]=ch2[ik];
+391
+392
t1=0;
+393
t2=ipp2*idl1;
+394
for(j=1;j<ipph;j++){
+395
t1+=t0;
+396
t2-=t0;
+397
t3=t1-ido;
+398
t4=t2-ido;
+399
for(k=0;k<l1;k++){
+400
t3+=ido;
+401
t4+=ido;
+402
c1[t3]=ch[t3]+ch[t4];
+403
c1[t4]=ch[t4]-ch[t3];
+404
}
+405
}
+406
+407
ar1=1.f;
+408
ai1=0.f;
+409
t1=0;
+410
t2=ipp2*idl1;
+411
t3=(ip-1)*idl1;
+412
for(l=1;l<ipph;l++){
+413
t1+=idl1;
+414
t2-=idl1;
+415
ar1h=dcp*ar1-dsp*ai1;
+416
ai1=dcp*ai1+dsp*ar1;
+417
ar1=ar1h;
+418
t4=t1;
+419
t5=t2;
+420
t6=t3;
+421
t7=idl1;
+422
+423
for(ik=0;ik<idl1;ik++){
+424
ch2[t4++]=c2[ik]+ar1*c2[t7++];
+425
ch2[t5++]=ai1*c2[t6++];
+426
}
+427
+428
dc2=ar1;
+429
ds2=ai1;
+430
ar2=ar1;
+431
ai2=ai1;
+432
+433
t4=idl1;
+434
t5=(ipp2-1)*idl1;
+435
for(j=2;j<ipph;j++){
+436
t4+=idl1;
+437
t5-=idl1;
+438
+439
ar2h=dc2*ar2-ds2*ai2;
+440
ai2=dc2*ai2+ds2*ar2;
+441
ar2=ar2h;
+442
+443
t6=t1;
+444
t7=t2;
+445
t8=t4;
+446
t9=t5;
+447
for(ik=0;ik<idl1;ik++){
+448
ch2[t6++]+=ar2*c2[t8++];
+449
ch2[t7++]+=ai2*c2[t9++];
+450
}
+451
}
+452
}
+453
+454
t1=0;
+455
for(j=1;j<ipph;j++){
+456
t1+=idl1;
+457
t2=t1;
+458
for(ik=0;ik<idl1;ik++)ch2[ik]+=c2[t2++];
+459
}
+460
+461
if(ido<l1)goto L132;
+462
+463
t1=0;
+464
t2=0;
+465
for(k=0;k<l1;k++){
+466
t3=t1;
+467
t4=t2;
+468
for(i=0;i<ido;i++)cc[t4++]=ch[t3++];
+469
t1+=ido;
+470
t2+=t10;
+471
}
+472
+473
goto L135;
+474
+475
L132:
+476
for(i=0;i<ido;i++){
+477
t1=i;
+478
t2=i;
+479
for(k=0;k<l1;k++){
+480
cc[t2]=ch[t1];
+481
t1+=ido;
+482
t2+=t10;
+483
}
+484
}
+485
+486
L135:
+487
t1=0;
+488
t2=ido<<1;
+489
t3=0;
+490
t4=ipp2*t0;
+491
for(j=1;j<ipph;j++){
+492
+493
t1+=t2;
+494
t3+=t0;
+495
t4-=t0;
+496
+497
t5=t1;
+498
t6=t3;
+499
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
@@ -0,0 +1,33 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 *
+9
* by the Xiph.Org Foundation https://xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: fft transform
+14
+15
********************************************************************/
+16
+17
#ifndef _V_SMFT_H_
+18
#define _V_SMFT_H_
+19
+20
#include "vorbis/codec.h"
+21
+22
typedef struct {
+23
int n;
+24
float *trigcache;
+25
int *splitcache;
+26
} drft_lookup;
+27
+28
extern void drft_forward(drft_lookup *l,float *data);
+29
extern void drft_backward(drft_lookup *l,float *data);
+30
extern void drft_init(drft_lookup *l,int n);
+31
extern void drft_clear(drft_lookup *l);
+32
+33
#endif
vendor/vorbis/lib/synthesis.cadded
@@ -0,0 +1,179 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2015 *
+9
* by the Xiph.Org Foundation https://xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: single-block PCM synthesis
+14
+15
********************************************************************/
+16
+17
#include <stdio.h>
+18
#include <ogg/ogg.h>
+19
#include "vorbis/codec.h"
+20
#include "codec_internal.h"
+21
#include "registry.h"
+22
#include "misc.h"
+23
#include "os.h"
+24
+25
int vorbis_synthesis(vorbis_block *vb,ogg_packet *op){
+26
vorbis_dsp_state *vd= vb ? vb->vd : 0;
+27
private_state *b= vd ? vd->backend_state : 0;
+28
vorbis_info *vi= vd ? vd->vi : 0;
+29
codec_setup_info *ci= vi ? vi->codec_setup : 0;
+30
oggpack_buffer *opb=vb ? &vb->opb : 0;
+31
int type,mode,i;
+32
+33
if (!vd || !b || !vi || !ci || !opb) {
+34
return OV_EBADPACKET;
+35
}
+36
+37
/* first things first. Make sure decode is ready */
+38
_vorbis_block_ripcord(vb);
+39
oggpack_readinit(opb,op->packet,op->bytes);
+40
+41
/* Check the packet type */
+42
if(oggpack_read(opb,1)!=0){
+43
/* Oops. This is not an audio data packet */
+44
return(OV_ENOTAUDIO);
+45
}
+46
+47
/* read our mode and pre/post windowsize */
+48
mode=oggpack_read(opb,b->modebits);
+49
if(mode==-1){
+50
return(OV_EBADPACKET);
+51
}
+52
+53
vb->mode=mode;
+54
if(!ci->mode_param[mode]){
+55
return(OV_EBADPACKET);
+56
}
+57
+58
vb->W=ci->mode_param[mode]->blockflag;
+59
if(vb->W){
+60
+61
/* this doesn;t get mapped through mode selection as it's used
+62
only for window selection */
+63
vb->lW=oggpack_read(opb,1);
+64
vb->nW=oggpack_read(opb,1);
+65
if(vb->nW==-1){
+66
return(OV_EBADPACKET);
+67
}
+68
}else{
+69
vb->lW=0;
+70
vb->nW=0;
+71
}
+72
+73
/* more setup */
+74
vb->granulepos=op->granulepos;
+75
vb->sequence=op->packetno;
+76
vb->eofflag=op->e_o_s;
+77
+78
/* alloc pcm passback storage */
+79
vb->pcmend=ci->blocksizes[vb->W];
+80
vb->pcm=_vorbis_block_alloc(vb,sizeof(*vb->pcm)*vi->channels);
+81
for(i=0;i<vi->channels;i++)
+82
vb->pcm[i]=_vorbis_block_alloc(vb,vb->pcmend*sizeof(*vb->pcm[i]));
+83
+84
/* unpack_header enforces range checking */
+85
type=ci->map_type[ci->mode_param[mode]->mapping];
+86
+87
return(_mapping_P[type]->inverse(vb,ci->map_param[ci->mode_param[mode]->
+88
mapping]));
+89
}
+90
+91
/* used to track pcm position without actually performing decode.
+92
Useful for sequential 'fast forward' */
+93
int vorbis_synthesis_trackonly(vorbis_block *vb,ogg_packet *op){
+94
vorbis_dsp_state *vd=vb->vd;
+95
private_state *b=vd->backend_state;
+96
vorbis_info *vi=vd->vi;
+97
codec_setup_info *ci=vi->codec_setup;
+98
oggpack_buffer *opb=&vb->opb;
+99
int mode;
+100
+101
/* first things first. Make sure decode is ready */
+102
_vorbis_block_ripcord(vb);
+103
oggpack_readinit(opb,op->packet,op->bytes);
+104
+105
/* Check the packet type */
+106
if(oggpack_read(opb,1)!=0){
+107
/* Oops. This is not an audio data packet */
+108
return(OV_ENOTAUDIO);
+109
}
+110
+111
/* read our mode and pre/post windowsize */
+112
mode=oggpack_read(opb,b->modebits);
+113
if(mode==-1)return(OV_EBADPACKET);
+114
+115
vb->mode=mode;
+116
if(!ci->mode_param[mode]){
+117
return(OV_EBADPACKET);
+118
}
+119
+120
vb->W=ci->mode_param[mode]->blockflag;
+121
if(vb->W){
+122
vb->lW=oggpack_read(opb,1);
+123
vb->nW=oggpack_read(opb,1);
+124
if(vb->nW==-1) return(OV_EBADPACKET);
+125
}else{
+126
vb->lW=0;
+127
vb->nW=0;
+128
}
+129
+130
/* more setup */
+131
vb->granulepos=op->granulepos;
+132
vb->sequence=op->packetno;
+133
vb->eofflag=op->e_o_s;
+134
+135
/* no pcm */
+136
vb->pcmend=0;
+137
vb->pcm=NULL;
+138
+139
return(0);
+140
}
+141
+142
long vorbis_packet_blocksize(vorbis_info *vi,ogg_packet *op){
+143
codec_setup_info *ci=vi->codec_setup;
+144
oggpack_buffer opb;
+145
int mode;
+146
+147
if(ci==NULL || ci->modes<=0){
+148
/* codec setup not properly intialized */
+149
return(OV_EFAULT);
+150
}
+151
+152
oggpack_readinit(&opb,op->packet,op->bytes);
+153
+154
/* Check the packet type */
+155
if(oggpack_read(&opb,1)!=0){
+156
/* Oops. This is not an audio data packet */
+157
return(OV_ENOTAUDIO);
+158
}
+159
+160
/* read our mode and pre/post windowsize */
+161
mode=oggpack_read(&opb,ov_ilog(ci->modes-1));
+162
if(mode==-1 || !ci->mode_param[mode])return(OV_EBADPACKET);
+163
return(ci->blocksizes[ci->mode_param[mode]->blockflag]);
+164
}
+165
+166
int vorbis_synthesis_halfrate(vorbis_info *vi,int flag){
+167
/* set / clear half-sample-rate mode */
+168
codec_setup_info *ci=vi->codec_setup;
+169
+170
/* right now, our MDCT can't handle < 64 sample windows. */
+171
if(ci->blocksizes[0]<=64 && flag)return -1;
+172
ci->halfrate_flag=(flag?1:0);
+173
return 0;
+174
}
+175
+176
int vorbis_synthesis_halfrate_p(vorbis_info *vi){
+177
codec_setup_info *ci=vi->codec_setup;
+178
return ci->halfrate_flag;
+179
}
vendor/vorbis/lib/vorbisenc.cadded
@@ -0,0 +1,1224 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2015 *
+9
* by the Xiph.Org Foundation https://xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: simple programmatic interface for encoder mode setup
+14
+15
********************************************************************/
+16
+17
#include <stdlib.h>
+18
#include <string.h>
+19
#include <math.h>
+20
+21
#include "vorbis/codec.h"
+22
#include "vorbis/vorbisenc.h"
+23
+24
#include "codec_internal.h"
+25
+26
#include "os.h"
+27
#include "misc.h"
+28
+29
/* careful with this; it's using static array sizing to make managing
+30
all the modes a little less annoying. If we use a residue backend
+31
with > 12 partition types, or a different division of iteration,
+32
this needs to be updated. */
+33
typedef struct {
+34
const static_codebook *books[12][4];
+35
} static_bookblock;
+36
+37
typedef struct {
+38
int res_type;
+39
int limit_type; /* 0 lowpass limited, 1 point stereo limited */
+40
int grouping;
+41
const vorbis_info_residue0 *res;
+42
const static_codebook *book_aux;
+43
const static_codebook *book_aux_managed;
+44
const static_bookblock *books_base;
+45
const static_bookblock *books_base_managed;
+46
} vorbis_residue_template;
+47
+48
typedef struct {
+49
const vorbis_info_mapping0 *map;
+50
const vorbis_residue_template *res;
+51
} vorbis_mapping_template;
+52
+53
typedef struct vp_adjblock{
+54
int block[P_BANDS];
+55
} vp_adjblock;
+56
+57
typedef struct {
+58
int data[NOISE_COMPAND_LEVELS];
+59
} compandblock;
+60
+61
/* high level configuration information for setting things up
+62
step-by-step with the detailed vorbis_encode_ctl interface.
+63
There's a fair amount of redundancy such that interactive setup
+64
does not directly deal with any vorbis_info or codec_setup_info
+65
initialization; it's all stored (until full init) in this highlevel
+66
setup, then flushed out to the real codec setup structs later. */
+67
+68
typedef struct {
+69
int att[P_NOISECURVES];
+70
float boost;
+71
float decay;
+72
} att3;
+73
typedef struct { int data[P_NOISECURVES]; } adj3;
+74
+75
typedef struct {
+76
int pre[PACKETBLOBS];
+77
int post[PACKETBLOBS];
+78
float kHz[PACKETBLOBS];
+79
float lowpasskHz[PACKETBLOBS];
+80
} adj_stereo;
+81
+82
typedef struct {
+83
int lo;
+84
int hi;
+85
int fixed;
+86
} noiseguard;
+87
typedef struct {
+88
int data[P_NOISECURVES][17];
+89
} noise3;
+90
+91
typedef struct {
+92
int mappings;
+93
const double *rate_mapping;
+94
const double *quality_mapping;
+95
int coupling_restriction;
+96
long samplerate_min_restriction;
+97
long samplerate_max_restriction;
+98
+99
+100
const int *blocksize_short;
+101
const int *blocksize_long;
+102
+103
const att3 *psy_tone_masteratt;
+104
const int *psy_tone_0dB;
+105
const int *psy_tone_dBsuppress;
+106
+107
const vp_adjblock *psy_tone_adj_impulse;
+108
const vp_adjblock *psy_tone_adj_long;
+109
const vp_adjblock *psy_tone_adj_other;
+110
+111
const noiseguard *psy_noiseguards;
+112
const noise3 *psy_noise_bias_impulse;
+113
const noise3 *psy_noise_bias_padding;
+114
const noise3 *psy_noise_bias_trans;
+115
const noise3 *psy_noise_bias_long;
+116
const int *psy_noise_dBsuppress;
+117
+118
const compandblock *psy_noise_compand;
+119
const double *psy_noise_compand_short_mapping;
+120
const double *psy_noise_compand_long_mapping;
+121
+122
const int *psy_noise_normal_start[2];
+123
const int *psy_noise_normal_partition[2];
+124
const double *psy_noise_normal_thresh;
+125
+126
const int *psy_ath_float;
+127
const int *psy_ath_abs;
+128
+129
const double *psy_lowpass;
+130
+131
const vorbis_info_psy_global *global_params;
+132
const double *global_mapping;
+133
const adj_stereo *stereo_modes;
+134
+135
const static_codebook *const *const *const floor_books;
+136
const vorbis_info_floor1 *floor_params;
+137
const int floor_mappings;
+138
const int **floor_mapping_list;
+139
+140
const vorbis_mapping_template *maps;
+141
} ve_setup_data_template;
+142
+143
/* a few static coder conventions */
+144
static const vorbis_info_mode _mode_template[2]={
+145
{0,0,0,0},
+146
{1,0,0,1}
+147
};
+148
+149
static const vorbis_info_mapping0 _map_nominal[2]={
+150
{1, {0,0}, {0}, {0}, 1,{0},{1}},
+151
{1, {0,0}, {1}, {1}, 1,{0},{1}}
+152
};
+153
+154
#include "modes/setup_44.h"
+155
#include "modes/setup_44u.h"
+156
#include "modes/setup_44p51.h"
+157
#include "modes/setup_32.h"
+158
#include "modes/setup_8.h"
+159
#include "modes/setup_11.h"
+160
#include "modes/setup_16.h"
+161
#include "modes/setup_22.h"
+162
#include "modes/setup_X.h"
+163
+164
static const ve_setup_data_template *const setup_list[]={
+165
&ve_setup_44_stereo,
+166
&ve_setup_44_51,
+167
&ve_setup_44_uncoupled,
+168
+169
&ve_setup_32_stereo,
+170
&ve_setup_32_uncoupled,
+171
+172
&ve_setup_22_stereo,
+173
&ve_setup_22_uncoupled,
+174
&ve_setup_16_stereo,
+175
&ve_setup_16_uncoupled,
+176
+177
&ve_setup_11_stereo,
+178
&ve_setup_11_uncoupled,
+179
&ve_setup_8_stereo,
+180
&ve_setup_8_uncoupled,
+181
+182
&ve_setup_X_stereo,
+183
&ve_setup_X_uncoupled,
+184
&ve_setup_XX_stereo,
+185
&ve_setup_XX_uncoupled,
+186
0
+187
};
+188
+189
static void vorbis_encode_floor_setup(vorbis_info *vi,int s,
+190
const static_codebook *const *const *const books,
+191
const vorbis_info_floor1 *in,
+192
const int *x){
+193
int i,k,is=s;
+194
vorbis_info_floor1 *f=_ogg_calloc(1,sizeof(*f));
+195
codec_setup_info *ci=vi->codec_setup;
+196
+197
memcpy(f,in+x[is],sizeof(*f));
+198
+199
/* books */
+200
{
+201
int partitions=f->partitions;
+202
int maxclass=-1;
+203
int maxbook=-1;
+204
for(i=0;i<partitions;i++)
+205
if(f->partitionclass[i]>maxclass)maxclass=f->partitionclass[i];
+206
for(i=0;i<=maxclass;i++){
+207
if(f->class_book[i]>maxbook)maxbook=f->class_book[i];
+208
f->class_book[i]+=ci->books;
+209
for(k=0;k<(1<<f->class_subs[i]);k++){
+210
if(f->class_subbook[i][k]>maxbook)maxbook=f->class_subbook[i][k];
+211
if(f->class_subbook[i][k]>=0)f->class_subbook[i][k]+=ci->books;
+212
}
+213
}
+214
+215
for(i=0;i<=maxbook;i++)
+216
ci->book_param[ci->books++]=(static_codebook *)books[x[is]][i];
+217
}
+218
+219
/* for now, we're only using floor 1 */
+220
ci->floor_type[ci->floors]=1;
+221
ci->floor_param[ci->floors]=f;
+222
ci->floors++;
+223
+224
return;
+225
}
+226
+227
static void vorbis_encode_global_psych_setup(vorbis_info *vi,double s,
+228
const vorbis_info_psy_global *in,
+229
const double *x){
+230
int i,is=s;
+231
double ds=s-is;
+232
codec_setup_info *ci=vi->codec_setup;
+233
vorbis_info_psy_global *g=&ci->psy_g_param;
+234
+235
memcpy(g,in+(int)x[is],sizeof(*g));
+236
+237
ds=x[is]*(1.-ds)+x[is+1]*ds;
+238
is=(int)ds;
+239
ds-=is;
+240
if(ds==0 && is>0){
+241
is--;
+242
ds=1.;
+243
}
+244
+245
/* interpolate the trigger threshholds */
+246
for(i=0;i<4;i++){
+247
g->preecho_thresh[i]=in[is].preecho_thresh[i]*(1.-ds)+in[is+1].preecho_thresh[i]*ds;
+248
g->postecho_thresh[i]=in[is].postecho_thresh[i]*(1.-ds)+in[is+1].postecho_thresh[i]*ds;
+249
}
+250
g->ampmax_att_per_sec=ci->hi.amplitude_track_dBpersec;
+251
return;
+252
}
+253
+254
static void vorbis_encode_global_stereo(vorbis_info *vi,
+255
const highlevel_encode_setup *const hi,
+256
const adj_stereo *p){
+257
float s=hi->stereo_point_setting;
+258
int i,is=s;
+259
double ds=s-is;
+260
codec_setup_info *ci=vi->codec_setup;
+261
vorbis_info_psy_global *g=&ci->psy_g_param;
+262
+263
if(p){
+264
memcpy(g->coupling_prepointamp,p[is].pre,sizeof(*p[is].pre)*PACKETBLOBS);
+265
memcpy(g->coupling_postpointamp,p[is].post,sizeof(*p[is].post)*PACKETBLOBS);
+266
+267
if(hi->managed){
+268
/* interpolate the kHz threshholds */
+269
for(i=0;i<PACKETBLOBS;i++){
+270
float kHz=p[is].kHz[i]*(1.-ds)+p[is+1].kHz[i]*ds;
+271
g->coupling_pointlimit[0][i]=kHz*1000./vi->rate*ci->blocksizes[0];
+272
g->coupling_pointlimit[1][i]=kHz*1000./vi->rate*ci->blocksizes[1];
+273
g->coupling_pkHz[i]=kHz;
+274
+275
kHz=p[is].lowpasskHz[i]*(1.-ds)+p[is+1].lowpasskHz[i]*ds;
+276
g->sliding_lowpass[0][i]=kHz*1000./vi->rate*ci->blocksizes[0];
+277
g->sliding_lowpass[1][i]=kHz*1000./vi->rate*ci->blocksizes[1];
+278
+279
}
+280
}else{
+281
float kHz=p[is].kHz[PACKETBLOBS/2]*(1.-ds)+p[is+1].kHz[PACKETBLOBS/2]*ds;
+282
for(i=0;i<PACKETBLOBS;i++){
+283
g->coupling_pointlimit[0][i]=kHz*1000./vi->rate*ci->blocksizes[0];
+284
g->coupling_pointlimit[1][i]=kHz*1000./vi->rate*ci->blocksizes[1];
+285
g->coupling_pkHz[i]=kHz;
+286
}
+287
+288
kHz=p[is].lowpasskHz[PACKETBLOBS/2]*(1.-ds)+p[is+1].lowpasskHz[PACKETBLOBS/2]*ds;
+289
for(i=0;i<PACKETBLOBS;i++){
+290
g->sliding_lowpass[0][i]=kHz*1000./vi->rate*ci->blocksizes[0];
+291
g->sliding_lowpass[1][i]=kHz*1000./vi->rate*ci->blocksizes[1];
+292
}
+293
}
+294
}else{
+295
for(i=0;i<PACKETBLOBS;i++){
+296
g->sliding_lowpass[0][i]=ci->blocksizes[0];
+297
g->sliding_lowpass[1][i]=ci->blocksizes[1];
+298
}
+299
}
+300
return;
+301
}
+302
+303
static void vorbis_encode_psyset_setup(vorbis_info *vi,double s,
+304
const int *nn_start,
+305
const int *nn_partition,
+306
const double *nn_thresh,
+307
int block){
+308
codec_setup_info *ci=vi->codec_setup;
+309
vorbis_info_psy *p=ci->psy_param[block];
+310
highlevel_encode_setup *hi=&ci->hi;
+311
int is=s;
+312
+313
if(block>=ci->psys)
+314
ci->psys=block+1;
+315
if(!p){
+316
p=_ogg_calloc(1,sizeof(*p));
+317
ci->psy_param[block]=p;
+318
}
+319
+320
memcpy(p,&_psy_info_template,sizeof(*p));
+321
p->blockflag=block>>1;
+322
+323
if(hi->noise_normalize_p){
+324
p->normal_p=1;
+325
p->normal_start=nn_start[is];
+326
p->normal_partition=nn_partition[is];
+327
p->normal_thresh=nn_thresh[is];
+328
}
+329
+330
return;
+331
}
+332
+333
static void vorbis_encode_tonemask_setup(vorbis_info *vi,double s,int block,
+334
const att3 *att,
+335
const int *max,
+336
const vp_adjblock *in){
+337
int i,is=s;
+338
double ds=s-is;
+339
codec_setup_info *ci=vi->codec_setup;
+340
vorbis_info_psy *p=ci->psy_param[block];
+341
+342
/* 0 and 2 are only used by bitmanagement, but there's no harm to always
+343
filling the values in here */
+344
p->tone_masteratt[0]=att[is].att[0]*(1.-ds)+att[is+1].att[0]*ds;
+345
p->tone_masteratt[1]=att[is].att[1]*(1.-ds)+att[is+1].att[1]*ds;
+346
p->tone_masteratt[2]=att[is].att[2]*(1.-ds)+att[is+1].att[2]*ds;
+347
p->tone_centerboost=att[is].boost*(1.-ds)+att[is+1].boost*ds;
+348
p->tone_decay=att[is].decay*(1.-ds)+att[is+1].decay*ds;
+349
+350
p->max_curve_dB=max[is]*(1.-ds)+max[is+1]*ds;
+351
+352
for(i=0;i<P_BANDS;i++)
+353
p->toneatt[i]=in[is].block[i]*(1.-ds)+in[is+1].block[i]*ds;
+354
return;
+355
}
+356
+357
+358
static void vorbis_encode_compand_setup(vorbis_info *vi,double s,int block,
+359
const compandblock *in,
+360
const double *x){
+361
int i,is=s;
+362
double ds=s-is;
+363
codec_setup_info *ci=vi->codec_setup;
+364
vorbis_info_psy *p=ci->psy_param[block];
+365
+366
ds=x[is]*(1.-ds)+x[is+1]*ds;
+367
is=(int)ds;
+368
ds-=is;
+369
if(ds==0 && is>0){
+370
is--;
+371
ds=1.;
+372
}
+373
+374
/* interpolate the compander settings */
+375
for(i=0;i<NOISE_COMPAND_LEVELS;i++)
+376
p->noisecompand[i]=in[is].data[i]*(1.-ds)+in[is+1].data[i]*ds;
+377
return;
+378
}
+379
+380
static void vorbis_encode_peak_setup(vorbis_info *vi,double s,int block,
+381
const int *suppress){
+382
int is=s;
+383
double ds=s-is;
+384
codec_setup_info *ci=vi->codec_setup;
+385
vorbis_info_psy *p=ci->psy_param[block];
+386
+387
p->tone_abs_limit=suppress[is]*(1.-ds)+suppress[is+1]*ds;
+388
+389
return;
+390
}
+391
+392
static void vorbis_encode_noisebias_setup(vorbis_info *vi,double s,int block,
+393
const int *suppress,
+394
const noise3 *in,
+395
const noiseguard *guard,
+396
double userbias){
+397
int i,is=s,j;
+398
double ds=s-is;
+399
codec_setup_info *ci=vi->codec_setup;
+400
vorbis_info_psy *p=ci->psy_param[block];
+401
+402
p->noisemaxsupp=suppress[is]*(1.-ds)+suppress[is+1]*ds;
+403
p->noisewindowlomin=guard[block].lo;
+404
p->noisewindowhimin=guard[block].hi;
+405
p->noisewindowfixed=guard[block].fixed;
+406
+407
for(j=0;j<P_NOISECURVES;j++)
+408
for(i=0;i<P_BANDS;i++)
+409
p->noiseoff[j][i]=in[is].data[j][i]*(1.-ds)+in[is+1].data[j][i]*ds;
+410
+411
/* impulse blocks may take a user specified bias to boost the
+412
nominal/high noise encoding depth */
+413
for(j=0;j<P_NOISECURVES;j++){
+414
float min=p->noiseoff[j][0]+6; /* the lowest it can go */
+415
for(i=0;i<P_BANDS;i++){
+416
p->noiseoff[j][i]+=userbias;
+417
if(p->noiseoff[j][i]<min)p->noiseoff[j][i]=min;
+418
}
+419
}
+420
+421
return;
+422
}
+423
+424
static void vorbis_encode_ath_setup(vorbis_info *vi,int block){
+425
codec_setup_info *ci=vi->codec_setup;
+426
vorbis_info_psy *p=ci->psy_param[block];
+427
+428
p->ath_adjatt=ci->hi.ath_floating_dB;
+429
p->ath_maxatt=ci->hi.ath_absolute_dB;
+430
return;
+431
}
+432
+433
+434
static int book_dup_or_new(codec_setup_info *ci,const static_codebook *book){
+435
int i;
+436
for(i=0;i<ci->books;i++)
+437
if(ci->book_param[i]==book)return(i);
+438
+439
return(ci->books++);
+440
}
+441
+442
static void vorbis_encode_blocksize_setup(vorbis_info *vi,double s,
+443
const int *shortb,const int *longb){
+444
+445
codec_setup_info *ci=vi->codec_setup;
+446
int is=s;
+447
+448
int blockshort=shortb[is];
+449
int blocklong=longb[is];
+450
ci->blocksizes[0]=blockshort;
+451
ci->blocksizes[1]=blocklong;
+452
+453
}
+454
+455
static void vorbis_encode_residue_setup(vorbis_info *vi,
+456
int number, int block,
+457
const vorbis_residue_template *res){
+458
+459
codec_setup_info *ci=vi->codec_setup;
+460
int i;
+461
+462
vorbis_info_residue0 *r=ci->residue_param[number]=
+463
_ogg_malloc(sizeof(*r));
+464
+465
memcpy(r,res->res,sizeof(*r));
+466
if(ci->residues<=number)ci->residues=number+1;
+467
+468
r->grouping=res->grouping;
+469
ci->residue_type[number]=res->res_type;
+470
+471
/* fill in all the books */
+472
{
+473
int booklist=0,k;
+474
+475
if(ci->hi.managed){
+476
for(i=0;i<r->partitions;i++)
+477
for(k=0;k<4;k++)
+478
if(res->books_base_managed->books[i][k])
+479
r->secondstages[i]|=(1<<k);
+480
+481
r->groupbook=book_dup_or_new(ci,res->book_aux_managed);
+482
ci->book_param[r->groupbook]=(static_codebook *)res->book_aux_managed;
+483
+484
for(i=0;i<r->partitions;i++){
+485
for(k=0;k<4;k++){
+486
if(res->books_base_managed->books[i][k]){
+487
int bookid=book_dup_or_new(ci,res->books_base_managed->books[i][k]);
+488
r->booklist[booklist++]=bookid;
+489
ci->book_param[bookid]=(static_codebook *)res->books_base_managed->books[i][k];
+490
}
+491
}
+492
}
+493
+494
}else{
+495
+496
for(i=0;i<r->partitions;i++)
+497
for(k=0;k<4;k++)
+498
if(res->books_base->books[i][k])
+499
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
@@ -0,0 +1,2427 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2015 *
+9
* by the Xiph.Org Foundation https://xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: stdio-based convenience library for opening/seeking/decoding
+14
+15
********************************************************************/
+16
+17
#include <stdlib.h>
+18
#include <stdio.h>
+19
#include <errno.h>
+20
#include <string.h>
+21
#include <math.h>
+22
+23
#include "vorbis/codec.h"
+24
+25
/* we don't need or want the static callback symbols here */
+26
#define OV_EXCLUDE_STATIC_CALLBACKS
+27
#include "vorbis/vorbisfile.h"
+28
+29
#include "os.h"
+30
#include "misc.h"
+31
+32
/* A 'chained bitstream' is a Vorbis bitstream that contains more than
+33
one logical bitstream arranged end to end (the only form of Ogg
+34
multiplexing allowed in a Vorbis bitstream; grouping [parallel
+35
multiplexing] is not allowed in Vorbis) */
+36
+37
/* A Vorbis file can be played beginning to end (streamed) without
+38
worrying ahead of time about chaining (see decoder_example.c). If
+39
we have the whole file, however, and want random access
+40
(seeking/scrubbing) or desire to know the total length/time of a
+41
file, we need to account for the possibility of chaining. */
+42
+43
/* We can handle things a number of ways; we can determine the entire
+44
bitstream structure right off the bat, or find pieces on demand.
+45
This example determines and caches structure for the entire
+46
bitstream, but builds a virtual decoder on the fly when moving
+47
between links in the chain. */
+48
+49
/* There are also different ways to implement seeking. Enough
+50
information exists in an Ogg bitstream to seek to
+51
sample-granularity positions in the output. Or, one can seek by
+52
picking some portion of the stream roughly in the desired area if
+53
we only want coarse navigation through the stream. */
+54
+55
/*************************************************************************
+56
* Many, many internal helpers. The intention is not to be confusing;
+57
* rampant duplication and monolithic function implementation would be
+58
* harder to understand anyway. The high level functions are last. Begin
+59
* grokking near the end of the file */
+60
+61
/* read a little more data from the file/pipe into the ogg_sync framer
+62
*/
+63
#define CHUNKSIZE 65536 /* greater-than-page-size granularity seeking */
+64
#define READSIZE 2048 /* a smaller read size is needed for low-rate streaming. */
+65
+66
static long _get_data(OggVorbis_File *vf){
+67
errno=0;
+68
if(!(vf->callbacks.read_func))return(-1);
+69
if(vf->datasource){
+70
char *buffer=ogg_sync_buffer(&vf->oy,READSIZE);
+71
long bytes=(vf->callbacks.read_func)(buffer,1,READSIZE,vf->datasource);
+72
if(bytes>0)ogg_sync_wrote(&vf->oy,bytes);
+73
if(bytes==0 && errno)return(-1);
+74
return(bytes);
+75
}else
+76
return(0);
+77
}
+78
+79
/* save a tiny smidge of verbosity to make the code more readable */
+80
static int _seek_helper(OggVorbis_File *vf,ogg_int64_t offset){
+81
if(vf->datasource){
+82
/* only seek if the file position isn't already there */
+83
if(vf->offset != offset){
+84
if(!(vf->callbacks.seek_func)||
+85
(vf->callbacks.seek_func)(vf->datasource, offset, SEEK_SET) == -1)
+86
return OV_EREAD;
+87
vf->offset=offset;
+88
ogg_sync_reset(&vf->oy);
+89
}
+90
}else{
+91
/* shouldn't happen unless someone writes a broken callback */
+92
return OV_EFAULT;
+93
}
+94
return 0;
+95
}
+96
+97
/* The read/seek functions track absolute position within the stream */
+98
+99
/* from the head of the stream, get the next page. boundary specifies
+100
if the function is allowed to fetch more data from the stream (and
+101
how much) or only use internally buffered data.
+102
+103
boundary: -1) unbounded search
+104
0) read no additional data; use cached only
+105
n) search for a new page beginning for n bytes
+106
+107
return: <0) did not find a page (OV_FALSE, OV_EOF, OV_EREAD)
+108
n) found a page at absolute offset n */
+109
+110
static ogg_int64_t _get_next_page(OggVorbis_File *vf,ogg_page *og,
+111
ogg_int64_t boundary){
+112
if(boundary>0)boundary+=vf->offset;
+113
while(1){
+114
long more;
+115
+116
if(boundary>0 && vf->offset>=boundary)return(OV_FALSE);
+117
more=ogg_sync_pageseek(&vf->oy,og);
+118
+119
if(more<0){
+120
/* skipped n bytes */
+121
vf->offset-=more;
+122
}else{
+123
if(more==0){
+124
/* send more paramedics */
+125
if(!boundary)return(OV_FALSE);
+126
{
+127
long ret=_get_data(vf);
+128
if(ret==0)return(OV_EOF);
+129
if(ret<0)return(OV_EREAD);
+130
}
+131
}else{
+132
/* got a page. Return the offset at the page beginning,
+133
advance the internal offset past the page end */
+134
ogg_int64_t ret=vf->offset;
+135
vf->offset+=more;
+136
return(ret);
+137
+138
}
+139
}
+140
}
+141
}
+142
+143
/* find the latest page beginning before the passed in position. Much
+144
dirtier than the above as Ogg doesn't have any backward search
+145
linkage. no 'readp' as it will certainly have to read. */
+146
/* returns offset or OV_EREAD, OV_FAULT */
+147
static ogg_int64_t _get_prev_page(OggVorbis_File *vf,ogg_int64_t begin,ogg_page *og){
+148
ogg_int64_t end = begin;
+149
ogg_int64_t ret;
+150
ogg_int64_t offset=-1;
+151
+152
while(offset==-1){
+153
begin-=CHUNKSIZE;
+154
if(begin<0)
+155
begin=0;
+156
+157
ret=_seek_helper(vf,begin);
+158
if(ret)return(ret);
+159
+160
while(vf->offset<end){
+161
memset(og,0,sizeof(*og));
+162
ret=_get_next_page(vf,og,end-vf->offset);
+163
if(ret==OV_EREAD)return(OV_EREAD);
+164
if(ret<0){
+165
break;
+166
}else{
+167
offset=ret;
+168
}
+169
}
+170
}
+171
+172
/* In a fully compliant, non-multiplexed stream, we'll still be
+173
holding the last page. In multiplexed (or noncompliant streams),
+174
we will probably have to re-read the last page we saw */
+175
if(og->header_len==0){
+176
ret=_seek_helper(vf,offset);
+177
if(ret)return(ret);
+178
+179
ret=_get_next_page(vf,og,CHUNKSIZE);
+180
if(ret<0)
+181
/* this shouldn't be possible */
+182
return(OV_EFAULT);
+183
}
+184
+185
return(offset);
+186
}
+187
+188
static void _add_serialno(ogg_page *og,long **serialno_list, int *n){
+189
long s = ogg_page_serialno(og);
+190
(*n)++;
+191
+192
if(*serialno_list){
+193
*serialno_list = _ogg_realloc(*serialno_list, sizeof(**serialno_list)*(*n));
+194
}else{
+195
*serialno_list = _ogg_malloc(sizeof(**serialno_list));
+196
}
+197
+198
(*serialno_list)[(*n)-1] = s;
+199
}
+200
+201
/* returns nonzero if found */
+202
static int _lookup_serialno(long s, long *serialno_list, int n){
+203
if(serialno_list){
+204
while(n--){
+205
if(*serialno_list == s) return 1;
+206
serialno_list++;
+207
}
+208
}
+209
return 0;
+210
}
+211
+212
static int _lookup_page_serialno(ogg_page *og, long *serialno_list, int n){
+213
long s = ogg_page_serialno(og);
+214
return _lookup_serialno(s,serialno_list,n);
+215
}
+216
+217
/* performs the same search as _get_prev_page, but prefers pages of
+218
the specified serial number. If a page of the specified serialno is
+219
spotted during the seek-back-and-read-forward, it will return the
+220
info of last page of the matching serial number instead of the very
+221
last page. If no page of the specified serialno is seen, it will
+222
return the info of last page and alter *serialno. */
+223
static ogg_int64_t _get_prev_page_serial(OggVorbis_File *vf, ogg_int64_t begin,
+224
long *serial_list, int serial_n,
+225
int *serialno, ogg_int64_t *granpos){
+226
ogg_page og;
+227
ogg_int64_t end=begin;
+228
ogg_int64_t ret;
+229
+230
ogg_int64_t prefoffset=-1;
+231
ogg_int64_t offset=-1;
+232
ogg_int64_t ret_serialno=-1;
+233
ogg_int64_t ret_gran=-1;
+234
+235
while(offset==-1){
+236
begin-=CHUNKSIZE;
+237
if(begin<0)
+238
begin=0;
+239
+240
ret=_seek_helper(vf,begin);
+241
if(ret)return(ret);
+242
+243
while(vf->offset<end){
+244
ret=_get_next_page(vf,&og,end-vf->offset);
+245
if(ret==OV_EREAD)return(OV_EREAD);
+246
if(ret<0){
+247
break;
+248
}else{
+249
ret_serialno=ogg_page_serialno(&og);
+250
ret_gran=ogg_page_granulepos(&og);
+251
offset=ret;
+252
+253
if(ret_serialno == *serialno){
+254
prefoffset=ret;
+255
*granpos=ret_gran;
+256
}
+257
+258
if(!_lookup_serialno(ret_serialno,serial_list,serial_n)){
+259
/* we fell off the end of the link, which means we seeked
+260
back too far and shouldn't have been looking in that link
+261
to begin with. If we found the preferred serial number,
+262
forget that we saw it. */
+263
prefoffset=-1;
+264
}
+265
}
+266
}
+267
/*We started from the beginning of the stream and found nothing.
+268
This should be impossible unless the contents of the stream changed out
+269
from under us after we read from it.*/
+270
if(!begin&&vf->offset<0)return OV_EBADLINK;
+271
}
+272
+273
/* we're not interested in the page... just the serialno and granpos. */
+274
if(prefoffset>=0)return(prefoffset);
+275
+276
*serialno = ret_serialno;
+277
*granpos = ret_gran;
+278
return(offset);
+279
+280
}
+281
+282
/* uses the local ogg_stream storage in vf; this is important for
+283
non-streaming input sources */
+284
static int _fetch_headers(OggVorbis_File *vf,vorbis_info *vi,vorbis_comment *vc,
+285
long **serialno_list, int *serialno_n,
+286
ogg_page *og_ptr){
+287
ogg_page og;
+288
ogg_packet op;
+289
int i,ret;
+290
int allbos=0;
+291
+292
if(!og_ptr){
+293
ogg_int64_t llret=_get_next_page(vf,&og,CHUNKSIZE);
+294
if(llret==OV_EREAD)return(OV_EREAD);
+295
if(llret<0)return(OV_ENOTVORBIS);
+296
og_ptr=&og;
+297
}
+298
+299
vorbis_info_init(vi);
+300
vorbis_comment_init(vc);
+301
vf->ready_state=OPENED;
+302
+303
/* extract the serialnos of all BOS pages + the first set of vorbis
+304
headers we see in the link */
+305
+306
while(ogg_page_bos(og_ptr)){
+307
if(serialno_list){
+308
if(_lookup_page_serialno(og_ptr,*serialno_list,*serialno_n)){
+309
/* a dupe serialnumber in an initial header packet set == invalid stream */
+310
if(*serialno_list)_ogg_free(*serialno_list);
+311
*serialno_list=0;
+312
*serialno_n=0;
+313
ret=OV_EBADHEADER;
+314
goto bail_header;
+315
}
+316
+317
_add_serialno(og_ptr,serialno_list,serialno_n);
+318
}
+319
+320
if(vf->ready_state<STREAMSET){
+321
/* we don't have a vorbis stream in this link yet, so begin
+322
prospective stream setup. We need a stream to get packets */
+323
ogg_stream_reset_serialno(&vf->os,ogg_page_serialno(og_ptr));
+324
ogg_stream_pagein(&vf->os,og_ptr);
+325
+326
if(ogg_stream_packetout(&vf->os,&op) > 0 &&
+327
vorbis_synthesis_idheader(&op)){
+328
/* vorbis header; continue setup */
+329
vf->ready_state=STREAMSET;
+330
if((ret=vorbis_synthesis_headerin(vi,vc,&op))){
+331
ret=OV_EBADHEADER;
+332
goto bail_header;
+333
}
+334
}
+335
}
+336
+337
/* get next page */
+338
{
+339
ogg_int64_t llret=_get_next_page(vf,og_ptr,CHUNKSIZE);
+340
if(llret==OV_EREAD){
+341
ret=OV_EREAD;
+342
goto bail_header;
+343
}
+344
if(llret<0){
+345
ret=OV_ENOTVORBIS;
+346
goto bail_header;
+347
}
+348
+349
/* if this page also belongs to our vorbis stream, submit it and break */
+350
if(vf->ready_state==STREAMSET &&
+351
vf->os.serialno == ogg_page_serialno(og_ptr)){
+352
ogg_stream_pagein(&vf->os,og_ptr);
+353
break;
+354
}
+355
}
+356
}
+357
+358
if(vf->ready_state!=STREAMSET){
+359
ret = OV_ENOTVORBIS;
+360
goto bail_header;
+361
}
+362
+363
while(1){
+364
+365
i=0;
+366
while(i<2){ /* get a page loop */
+367
+368
while(i<2){ /* get a packet loop */
+369
+370
int result=ogg_stream_packetout(&vf->os,&op);
+371
if(result==0)break;
+372
if(result==-1){
+373
ret=OV_EBADHEADER;
+374
goto bail_header;
+375
}
+376
+377
if((ret=vorbis_synthesis_headerin(vi,vc,&op)))
+378
goto bail_header;
+379
+380
i++;
+381
}
+382
+383
while(i<2){
+384
if(_get_next_page(vf,og_ptr,CHUNKSIZE)<0){
+385
ret=OV_EBADHEADER;
+386
goto bail_header;
+387
}
+388
+389
/* if this page belongs to the correct stream, go parse it */
+390
if(vf->os.serialno == ogg_page_serialno(og_ptr)){
+391
ogg_stream_pagein(&vf->os,og_ptr);
+392
break;
+393
}
+394
+395
/* if we never see the final vorbis headers before the link
+396
ends, abort */
+397
if(ogg_page_bos(og_ptr)){
+398
if(allbos){
+399
ret = OV_EBADHEADER;
+400
goto bail_header;
+401
}else
+402
allbos=1;
+403
}
+404
+405
/* otherwise, keep looking */
+406
}
+407
}
+408
+409
return 0;
+410
}
+411
+412
bail_header:
+413
vorbis_info_clear(vi);
+414
vorbis_comment_clear(vc);
+415
vf->ready_state=OPENED;
+416
+417
return ret;
+418
}
+419
+420
/* Starting from current cursor position, get initial PCM offset of
+421
next page. Consumes the page in the process without decoding
+422
audio, however this is only called during stream parsing upon
+423
seekable open. */
+424
static ogg_int64_t _initial_pcmoffset(OggVorbis_File *vf, vorbis_info *vi){
+425
ogg_page og;
+426
ogg_int64_t accumulated=0;
+427
long lastblock=-1;
+428
int result;
+429
int serialno = vf->os.serialno;
+430
+431
while(1){
+432
ogg_packet op;
+433
if(_get_next_page(vf,&og,-1)<0)
+434
break; /* should not be possible unless the file is truncated/mangled */
+435
+436
if(ogg_page_bos(&og)) break;
+437
if(ogg_page_serialno(&og)!=serialno) continue;
+438
+439
/* count blocksizes of all frames in the page */
+440
ogg_stream_pagein(&vf->os,&og);
+441
while((result=ogg_stream_packetout(&vf->os,&op))){
+442
if(result>0){ /* ignore holes */
+443
long thisblock=vorbis_packet_blocksize(vi,&op);
+444
if(thisblock>=0){
+445
if(lastblock!=-1)
+446
accumulated+=(lastblock+thisblock)>>2;
+447
lastblock=thisblock;
+448
}
+449
}
+450
}
+451
+452
if(ogg_page_granulepos(&og)!=-1){
+453
/* pcm offset of last packet on the first audio page */
+454
accumulated= ogg_page_granulepos(&og)-accumulated;
+455
break;
+456
}
+457
}
+458
+459
/* less than zero? Either a corrupt file or a stream with samples
+460
trimmed off the beginning, a normal occurrence; in both cases set
+461
the offset to zero */
+462
if(accumulated<0)accumulated=0;
+463
+464
return accumulated;
+465
}
+466
+467
/* finds each bitstream link one at a time using a bisection search
+468
(has to begin by knowing the offset of the lb's initial page).
+469
Recurses for each link so it can alloc the link storage after
+470
finding them all, then unroll and fill the cache at the same time */
+471
static int _bisect_forward_serialno(OggVorbis_File *vf,
+472
ogg_int64_t begin,
+473
ogg_int64_t searched,
+474
ogg_int64_t end,
+475
ogg_int64_t endgran,
+476
int endserial,
+477
long *currentno_list,
+478
int currentnos,
+479
long m){
+480
ogg_int64_t pcmoffset;
+481
ogg_int64_t dataoffset=searched;
+482
ogg_int64_t endsearched=end;
+483
ogg_int64_t next=end;
+484
ogg_int64_t searchgran=-1;
+485
ogg_page og;
+486
ogg_int64_t ret,last;
+487
int serialno = vf->os.serialno;
+488
+489
/* invariants:
+490
we have the headers and serialnos for the link beginning at 'begin'
+491
we have the offset and granpos of the last page in the file (potentially
+492
not a page we care about)
+493
*/
+494
+495
/* Is the last page in our list of current serialnumbers? */
+496
if(_lookup_serialno(endserial,currentno_list,currentnos)){
+497
+498
/* last page is in the starting serialno list, so we've bisected
+499
down to (or just started with) a single link. Now we need to

Showing 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
@@ -0,0 +1,2135 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 *
+9
* by the Xiph.Org Foundation https://xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: window functions
+14
+15
********************************************************************/
+16
+17
#include <stdlib.h>
+18
#include <math.h>
+19
#include "os.h"
+20
#include "misc.h"
+21
#include "window.h"
+22
+23
static const float vwin64[32] = {
+24
0.0009460463F, 0.0085006468F, 0.0235352254F, 0.0458950567F,
+25
0.0753351908F, 0.1115073077F, 0.1539457973F, 0.2020557475F,
+26
0.2551056759F, 0.3122276645F, 0.3724270287F, 0.4346027792F,
+27
0.4975789974F, 0.5601459521F, 0.6211085051F, 0.6793382689F,
+28
0.7338252629F, 0.7837245849F, 0.8283939355F, 0.8674186656F,
+29
0.9006222429F, 0.9280614787F, 0.9500073081F, 0.9669131782F,
+30
0.9793740220F, 0.9880792941F, 0.9937636139F, 0.9971582668F,
+31
0.9989462667F, 0.9997230082F, 0.9999638688F, 0.9999995525F,
+32
};
+33
+34
static const float vwin128[64] = {
+35
0.0002365472F, 0.0021280687F, 0.0059065254F, 0.0115626550F,
+36
0.0190823442F, 0.0284463735F, 0.0396300935F, 0.0526030430F,
+37
0.0673285281F, 0.0837631763F, 0.1018564887F, 0.1215504095F,
+38
0.1427789367F, 0.1654677960F, 0.1895342001F, 0.2148867160F,
+39
0.2414252576F, 0.2690412240F, 0.2976177952F, 0.3270303960F,
+40
0.3571473350F, 0.3878306189F, 0.4189369387F, 0.4503188188F,
+41
0.4818259135F, 0.5133064334F, 0.5446086751F, 0.5755826278F,
+42
0.6060816248F, 0.6359640047F, 0.6650947483F, 0.6933470543F,
+43
0.7206038179F, 0.7467589810F, 0.7717187213F, 0.7954024542F,
+44
0.8177436264F, 0.8386902831F, 0.8582053981F, 0.8762669622F,
+45
0.8928678298F, 0.9080153310F, 0.9217306608F, 0.9340480615F,
+46
0.9450138200F, 0.9546851041F, 0.9631286621F, 0.9704194171F,
+47
0.9766389810F, 0.9818741197F, 0.9862151938F, 0.9897546035F,
+48
0.9925852598F, 0.9947991032F, 0.9964856900F, 0.9977308602F,
+49
0.9986155015F, 0.9992144193F, 0.9995953200F, 0.9998179155F,
+50
0.9999331503F, 0.9999825563F, 0.9999977357F, 0.9999999720F,
+51
};
+52
+53
static const float vwin256[128] = {
+54
0.0000591390F, 0.0005321979F, 0.0014780301F, 0.0028960636F,
+55
0.0047854363F, 0.0071449926F, 0.0099732775F, 0.0132685298F,
+56
0.0170286741F, 0.0212513119F, 0.0259337111F, 0.0310727950F,
+57
0.0366651302F, 0.0427069140F, 0.0491939614F, 0.0561216907F,
+58
0.0634851102F, 0.0712788035F, 0.0794969160F, 0.0881331402F,
+59
0.0971807028F, 0.1066323515F, 0.1164803426F, 0.1267164297F,
+60
0.1373318534F, 0.1483173323F, 0.1596630553F, 0.1713586755F,
+61
0.1833933062F, 0.1957555184F, 0.2084333404F, 0.2214142599F,
+62
0.2346852280F, 0.2482326664F, 0.2620424757F, 0.2761000481F,
+63
0.2903902813F, 0.3048975959F, 0.3196059553F, 0.3344988887F,
+64
0.3495595160F, 0.3647705766F, 0.3801144597F, 0.3955732382F,
+65
0.4111287047F, 0.4267624093F, 0.4424557009F, 0.4581897696F,
+66
0.4739456913F, 0.4897044744F, 0.5054471075F, 0.5211546088F,
+67
0.5368080763F, 0.5523887395F, 0.5678780103F, 0.5832575361F,
+68
0.5985092508F, 0.6136154277F, 0.6285587300F, 0.6433222619F,
+69
0.6578896175F, 0.6722449294F, 0.6863729144F, 0.7002589187F,
+70
0.7138889597F, 0.7272497662F, 0.7403288154F, 0.7531143679F,
+71
0.7655954985F, 0.7777621249F, 0.7896050322F, 0.8011158947F,
+72
0.8122872932F, 0.8231127294F, 0.8335866365F, 0.8437043850F,
+73
0.8534622861F, 0.8628575905F, 0.8718884835F, 0.8805540765F,
+74
0.8888543947F, 0.8967903616F, 0.9043637797F, 0.9115773078F,
+75
0.9184344360F, 0.9249394562F, 0.9310974312F, 0.9369141608F,
+76
0.9423961446F, 0.9475505439F, 0.9523851406F, 0.9569082947F,
+77
0.9611289005F, 0.9650563408F, 0.9687004405F, 0.9720714191F,
+78
0.9751798427F, 0.9780365753F, 0.9806527301F, 0.9830396204F,
+79
0.9852087111F, 0.9871715701F, 0.9889398207F, 0.9905250941F,
+80
0.9919389832F, 0.9931929973F, 0.9942985174F, 0.9952667537F,
+81
0.9961087037F, 0.9968351119F, 0.9974564312F, 0.9979827858F,
+82
0.9984239359F, 0.9987892441F, 0.9990876435F, 0.9993276081F,
+83
0.9995171241F, 0.9996636648F, 0.9997741654F, 0.9998550016F,
+84
0.9999119692F, 0.9999502656F, 0.9999744742F, 0.9999885497F,
+85
0.9999958064F, 0.9999989077F, 0.9999998584F, 0.9999999983F,
+86
};
+87
+88
static const float vwin512[256] = {
+89
0.0000147849F, 0.0001330607F, 0.0003695946F, 0.0007243509F,
+90
0.0011972759F, 0.0017882983F, 0.0024973285F, 0.0033242588F,
+91
0.0042689632F, 0.0053312973F, 0.0065110982F, 0.0078081841F,
+92
0.0092223540F, 0.0107533880F, 0.0124010466F, 0.0141650703F,
+93
0.0160451800F, 0.0180410758F, 0.0201524373F, 0.0223789233F,
+94
0.0247201710F, 0.0271757958F, 0.0297453914F, 0.0324285286F,
+95
0.0352247556F, 0.0381335972F, 0.0411545545F, 0.0442871045F,
+96
0.0475306997F, 0.0508847676F, 0.0543487103F, 0.0579219038F,
+97
0.0616036982F, 0.0653934164F, 0.0692903546F, 0.0732937809F,
+98
0.0774029356F, 0.0816170305F, 0.0859352485F, 0.0903567428F,
+99
0.0948806375F, 0.0995060259F, 0.1042319712F, 0.1090575056F,
+100
0.1139816300F, 0.1190033137F, 0.1241214941F, 0.1293350764F,
+101
0.1346429333F, 0.1400439046F, 0.1455367974F, 0.1511203852F,
+102
0.1567934083F, 0.1625545735F, 0.1684025537F, 0.1743359881F,
+103
0.1803534820F, 0.1864536069F, 0.1926349000F, 0.1988958650F,
+104
0.2052349715F, 0.2116506555F, 0.2181413191F, 0.2247053313F,
+105
0.2313410275F, 0.2380467105F, 0.2448206500F, 0.2516610835F,
+106
0.2585662164F, 0.2655342226F, 0.2725632448F, 0.2796513950F,
+107
0.2867967551F, 0.2939973773F, 0.3012512852F, 0.3085564739F,
+108
0.3159109111F, 0.3233125375F, 0.3307592680F, 0.3382489922F,
+109
0.3457795756F, 0.3533488602F, 0.3609546657F, 0.3685947904F,
+110
0.3762670121F, 0.3839690896F, 0.3916987634F, 0.3994537572F,
+111
0.4072317788F, 0.4150305215F, 0.4228476653F, 0.4306808783F,
+112
0.4385278181F, 0.4463861329F, 0.4542534630F, 0.4621274424F,
+113
0.4700057001F, 0.4778858615F, 0.4857655502F, 0.4936423891F,
+114
0.5015140023F, 0.5093780165F, 0.5172320626F, 0.5250737772F,
+115
0.5329008043F, 0.5407107971F, 0.5485014192F, 0.5562703465F,
+116
0.5640152688F, 0.5717338914F, 0.5794239366F, 0.5870831457F,
+117
0.5947092801F, 0.6023001235F, 0.6098534829F, 0.6173671907F,
+118
0.6248391059F, 0.6322671161F, 0.6396491384F, 0.6469831217F,
+119
0.6542670475F, 0.6614989319F, 0.6686768267F, 0.6757988210F,
+120
0.6828630426F, 0.6898676592F, 0.6968108799F, 0.7036909564F,
+121
0.7105061843F, 0.7172549043F, 0.7239355032F, 0.7305464154F,
+122
0.7370861235F, 0.7435531598F, 0.7499461068F, 0.7562635986F,
+123
0.7625043214F, 0.7686670148F, 0.7747504721F, 0.7807535410F,
+124
0.7866751247F, 0.7925141825F, 0.7982697296F, 0.8039408387F,
+125
0.8095266395F, 0.8150263196F, 0.8204391248F, 0.8257643590F,
+126
0.8310013848F, 0.8361496236F, 0.8412085555F, 0.8461777194F,
+127
0.8510567129F, 0.8558451924F, 0.8605428730F, 0.8651495278F,
+128
0.8696649882F, 0.8740891432F, 0.8784219392F, 0.8826633797F,
+129
0.8868135244F, 0.8908724888F, 0.8948404441F, 0.8987176157F,
+130
0.9025042831F, 0.9062007791F, 0.9098074886F, 0.9133248482F,
+131
0.9167533451F, 0.9200935163F, 0.9233459472F, 0.9265112712F,
+132
0.9295901680F, 0.9325833632F, 0.9354916263F, 0.9383157705F,
+133
0.9410566504F, 0.9437151618F, 0.9462922398F, 0.9487888576F,
+134
0.9512060252F, 0.9535447882F, 0.9558062262F, 0.9579914516F,
+135
0.9601016078F, 0.9621378683F, 0.9641014348F, 0.9659935361F,
+136
0.9678154261F, 0.9695683830F, 0.9712537071F, 0.9728727198F,
+137
0.9744267618F, 0.9759171916F, 0.9773453842F, 0.9787127293F,
+138
0.9800206298F, 0.9812705006F, 0.9824637665F, 0.9836018613F,
+139
0.9846862258F, 0.9857183066F, 0.9866995544F, 0.9876314227F,
+140
0.9885153662F, 0.9893528393F, 0.9901452948F, 0.9908941823F,
+141
0.9916009470F, 0.9922670279F, 0.9928938570F, 0.9934828574F,
+142
0.9940354423F, 0.9945530133F, 0.9950369595F, 0.9954886562F,
+143
0.9959094633F, 0.9963007242F, 0.9966637649F, 0.9969998925F,
+144
0.9973103939F, 0.9975965351F, 0.9978595598F, 0.9981006885F,
+145
0.9983211172F, 0.9985220166F, 0.9987045311F, 0.9988697776F,
+146
0.9990188449F, 0.9991527924F, 0.9992726499F, 0.9993794157F,
+147
0.9994740570F, 0.9995575079F, 0.9996306699F, 0.9996944099F,
+148
0.9997495605F, 0.9997969190F, 0.9998372465F, 0.9998712678F,
+149
0.9998996704F, 0.9999231041F, 0.9999421807F, 0.9999574732F,
+150
0.9999695157F, 0.9999788026F, 0.9999857885F, 0.9999908879F,
+151
0.9999944746F, 0.9999968817F, 0.9999984010F, 0.9999992833F,
+152
0.9999997377F, 0.9999999317F, 0.9999999911F, 0.9999999999F,
+153
};
+154
+155
static const float vwin1024[512] = {
+156
0.0000036962F, 0.0000332659F, 0.0000924041F, 0.0001811086F,
+157
0.0002993761F, 0.0004472021F, 0.0006245811F, 0.0008315063F,
+158
0.0010679699F, 0.0013339631F, 0.0016294757F, 0.0019544965F,
+159
0.0023090133F, 0.0026930125F, 0.0031064797F, 0.0035493989F,
+160
0.0040217533F, 0.0045235250F, 0.0050546946F, 0.0056152418F,
+161
0.0062051451F, 0.0068243817F, 0.0074729278F, 0.0081507582F,
+162
0.0088578466F, 0.0095941655F, 0.0103596863F, 0.0111543789F,
+163
0.0119782122F, 0.0128311538F, 0.0137131701F, 0.0146242260F,
+164
0.0155642855F, 0.0165333111F, 0.0175312640F, 0.0185581042F,
+165
0.0196137903F, 0.0206982797F, 0.0218115284F, 0.0229534910F,
+166
0.0241241208F, 0.0253233698F, 0.0265511886F, 0.0278075263F,
+167
0.0290923308F, 0.0304055484F, 0.0317471241F, 0.0331170013F,
+168
0.0345151222F, 0.0359414274F, 0.0373958560F, 0.0388783456F,
+169
0.0403888325F, 0.0419272511F, 0.0434935347F, 0.0450876148F,
+170
0.0467094213F, 0.0483588828F, 0.0500359261F, 0.0517404765F,
+171
0.0534724575F, 0.0552317913F, 0.0570183983F, 0.0588321971F,
+172
0.0606731048F, 0.0625410369F, 0.0644359070F, 0.0663576272F,
+173
0.0683061077F, 0.0702812571F, 0.0722829821F, 0.0743111878F,
+174
0.0763657775F, 0.0784466526F, 0.0805537129F, 0.0826868561F,
+175
0.0848459782F, 0.0870309736F, 0.0892417345F, 0.0914781514F,
+176
0.0937401128F, 0.0960275056F, 0.0983402145F, 0.1006781223F,
+177
0.1030411101F, 0.1054290568F, 0.1078418397F, 0.1102793336F,
+178
0.1127414119F, 0.1152279457F, 0.1177388042F, 0.1202738544F,
+179
0.1228329618F, 0.1254159892F, 0.1280227980F, 0.1306532471F,
+180
0.1333071937F, 0.1359844927F, 0.1386849970F, 0.1414085575F,
+181
0.1441550230F, 0.1469242403F, 0.1497160539F, 0.1525303063F,
+182
0.1553668381F, 0.1582254875F, 0.1611060909F, 0.1640084822F,
+183
0.1669324936F, 0.1698779549F, 0.1728446939F, 0.1758325362F,
+184
0.1788413055F, 0.1818708232F, 0.1849209084F, 0.1879913785F,
+185
0.1910820485F, 0.1941927312F, 0.1973232376F, 0.2004733764F,
+186
0.2036429541F, 0.2068317752F, 0.2100396421F, 0.2132663552F,
+187
0.2165117125F, 0.2197755102F, 0.2230575422F, 0.2263576007F,
+188
0.2296754753F, 0.2330109540F, 0.2363638225F, 0.2397338646F,
+189
0.2431208619F, 0.2465245941F, 0.2499448389F, 0.2533813719F,
+190
0.2568339669F, 0.2603023956F, 0.2637864277F, 0.2672858312F,
+191
0.2708003718F, 0.2743298135F, 0.2778739186F, 0.2814324472F,
+192
0.2850051576F, 0.2885918065F, 0.2921921485F, 0.2958059366F,
+193
0.2994329219F, 0.3030728538F, 0.3067254799F, 0.3103905462F,
+194
0.3140677969F, 0.3177569747F, 0.3214578205F, 0.3251700736F,
+195
0.3288934718F, 0.3326277513F, 0.3363726468F, 0.3401278914F,
+196
0.3438932168F, 0.3476683533F, 0.3514530297F, 0.3552469734F,
+197
0.3590499106F, 0.3628615659F, 0.3666816630F, 0.3705099239F,
+198
0.3743460698F, 0.3781898204F, 0.3820408945F, 0.3858990095F,
+199
0.3897638820F, 0.3936352274F, 0.3975127601F, 0.4013961936F,
+200
0.4052852405F, 0.4091796123F, 0.4130790198F, 0.4169831732F,
+201
0.4208917815F, 0.4248045534F, 0.4287211965F, 0.4326414181F,
+202
0.4365649248F, 0.4404914225F, 0.4444206167F, 0.4483522125F,
+203
0.4522859146F, 0.4562214270F, 0.4601584538F, 0.4640966984F,
+204
0.4680358644F, 0.4719756548F, 0.4759157726F, 0.4798559209F,
+205
0.4837958024F, 0.4877351199F, 0.4916735765F, 0.4956108751F,
+206
0.4995467188F, 0.5034808109F, 0.5074128550F, 0.5113425550F,
+207
0.5152696149F, 0.5191937395F, 0.5231146336F, 0.5270320028F,
+208
0.5309455530F, 0.5348549910F, 0.5387600239F, 0.5426603597F,
+209
0.5465557070F, 0.5504457754F, 0.5543302752F, 0.5582089175F,
+210
0.5620814145F, 0.5659474793F, 0.5698068262F, 0.5736591704F,
+211
0.5775042283F, 0.5813417176F, 0.5851713571F, 0.5889928670F,
+212
0.5928059689F, 0.5966103856F, 0.6004058415F, 0.6041920626F,
+213
0.6079687761F, 0.6117357113F, 0.6154925986F, 0.6192391705F,
+214
0.6229751612F, 0.6267003064F, 0.6304143441F, 0.6341170137F,
+215
0.6378080569F, 0.6414872173F, 0.6451542405F, 0.6488088741F,
+216
0.6524508681F, 0.6560799742F, 0.6596959469F, 0.6632985424F,
+217
0.6668875197F, 0.6704626398F, 0.6740236662F, 0.6775703649F,
+218
0.6811025043F, 0.6846198554F, 0.6881221916F, 0.6916092892F,
+219
0.6950809269F, 0.6985368861F, 0.7019769510F, 0.7054009085F,
+220
0.7088085484F, 0.7121996632F, 0.7155740484F, 0.7189315023F,
+221
0.7222718263F, 0.7255948245F, 0.7289003043F, 0.7321880760F,
+222
0.7354579530F, 0.7387097518F, 0.7419432921F, 0.7451583966F,
+223
0.7483548915F, 0.7515326059F, 0.7546913723F, 0.7578310265F,
+224
0.7609514077F, 0.7640523581F, 0.7671337237F, 0.7701953535F,
+225
0.7732371001F, 0.7762588195F, 0.7792603711F, 0.7822416178F,
+226
0.7852024259F, 0.7881426654F, 0.7910622097F, 0.7939609356F,
+227
0.7968387237F, 0.7996954579F, 0.8025310261F, 0.8053453193F,
+228
0.8081382324F, 0.8109096638F, 0.8136595156F, 0.8163876936F,
+229
0.8190941071F, 0.8217786690F, 0.8244412960F, 0.8270819086F,
+230
0.8297004305F, 0.8322967896F, 0.8348709171F, 0.8374227481F,
+231
0.8399522213F, 0.8424592789F, 0.8449438672F, 0.8474059356F,
+232
0.8498454378F, 0.8522623306F, 0.8546565748F, 0.8570281348F,
+233
0.8593769787F, 0.8617030779F, 0.8640064080F, 0.8662869477F,
+234
0.8685446796F, 0.8707795899F, 0.8729916682F, 0.8751809079F,
+235
0.8773473059F, 0.8794908626F, 0.8816115819F, 0.8837094713F,
+236
0.8857845418F, 0.8878368079F, 0.8898662874F, 0.8918730019F,
+237
0.8938569760F, 0.8958182380F, 0.8977568194F, 0.8996727552F,
+238
0.9015660837F, 0.9034368465F, 0.9052850885F, 0.9071108577F,
+239
0.9089142057F, 0.9106951869F, 0.9124538591F, 0.9141902832F,
+240
0.9159045233F, 0.9175966464F, 0.9192667228F, 0.9209148257F,
+241
0.9225410313F, 0.9241454187F, 0.9257280701F, 0.9272890704F,
+242
0.9288285075F, 0.9303464720F, 0.9318430576F, 0.9333183603F,
+243
0.9347724792F, 0.9362055158F, 0.9376175745F, 0.9390087622F,
+244
0.9403791881F, 0.9417289644F, 0.9430582055F, 0.9443670283F,
+245
0.9456555521F, 0.9469238986F, 0.9481721917F, 0.9494005577F,
+246
0.9506091252F, 0.9517980248F, 0.9529673894F, 0.9541173540F,
+247
0.9552480557F, 0.9563596334F, 0.9574522282F, 0.9585259830F,
+248
0.9595810428F, 0.9606175542F, 0.9616356656F, 0.9626355274F,
+249
0.9636172915F, 0.9645811114F, 0.9655271425F, 0.9664555414F,
+250
0.9673664664F, 0.9682600774F, 0.9691365355F, 0.9699960034F,
+251
0.9708386448F, 0.9716646250F, 0.9724741103F, 0.9732672685F,
+252
0.9740442683F, 0.9748052795F, 0.9755504729F, 0.9762800205F,
+253
0.9769940950F, 0.9776928703F, 0.9783765210F, 0.9790452223F,
+254
0.9796991504F, 0.9803384823F, 0.9809633954F, 0.9815740679F,
+255
0.9821706784F, 0.9827534063F, 0.9833224312F, 0.9838779332F,
+256
0.9844200928F, 0.9849490910F, 0.9854651087F, 0.9859683274F,
+257
0.9864589286F, 0.9869370940F, 0.9874030054F, 0.9878568447F,
+258
0.9882987937F, 0.9887290343F, 0.9891477481F, 0.9895551169F,
+259
0.9899513220F, 0.9903365446F, 0.9907109658F, 0.9910747662F,
+260
0.9914281260F, 0.9917712252F, 0.9921042433F, 0.9924273593F,
+261
0.9927407516F, 0.9930445982F, 0.9933390763F, 0.9936243626F,
+262
0.9939006331F, 0.9941680631F, 0.9944268269F, 0.9946770982F,
+263
0.9949190498F, 0.9951528537F, 0.9953786808F, 0.9955967011F,
+264
0.9958070836F, 0.9960099963F, 0.9962056061F, 0.9963940787F,
+265
0.9965755786F, 0.9967502693F, 0.9969183129F, 0.9970798704F,
+266
0.9972351013F, 0.9973841640F, 0.9975272151F, 0.9976644103F,
+267
0.9977959036F, 0.9979218476F, 0.9980423932F, 0.9981576901F,
+268
0.9982678862F, 0.9983731278F, 0.9984735596F, 0.9985693247F,
+269
0.9986605645F, 0.9987474186F, 0.9988300248F, 0.9989085193F,
+270
0.9989830364F, 0.9990537085F, 0.9991206662F, 0.9991840382F,
+271
0.9992439513F, 0.9993005303F, 0.9993538982F, 0.9994041757F,
+272
0.9994514817F, 0.9994959330F, 0.9995376444F, 0.9995767286F,
+273
0.9996132960F, 0.9996474550F, 0.9996793121F, 0.9997089710F,
+274
0.9997365339F, 0.9997621003F, 0.9997857677F, 0.9998076311F,
+275
0.9998277836F, 0.9998463156F, 0.9998633155F, 0.9998788692F,
+276
0.9998930603F, 0.9999059701F, 0.9999176774F, 0.9999282586F,
+277
0.9999377880F, 0.9999463370F, 0.9999539749F, 0.9999607685F,
+278
0.9999667820F, 0.9999720773F, 0.9999767136F, 0.9999807479F,
+279
0.9999842344F, 0.9999872249F, 0.9999897688F, 0.9999919127F,
+280
0.9999937009F, 0.9999951749F, 0.9999963738F, 0.9999973342F,
+281
0.9999980900F, 0.9999986724F, 0.9999991103F, 0.9999994297F,
+282
0.9999996543F, 0.9999998049F, 0.9999999000F, 0.9999999552F,
+283
0.9999999836F, 0.9999999957F, 0.9999999994F, 1.0000000000F,
+284
};
+285
+286
static const float vwin2048[1024] = {
+287
0.0000009241F, 0.0000083165F, 0.0000231014F, 0.0000452785F,
+288
0.0000748476F, 0.0001118085F, 0.0001561608F, 0.0002079041F,
+289
0.0002670379F, 0.0003335617F, 0.0004074748F, 0.0004887765F,
+290
0.0005774661F, 0.0006735427F, 0.0007770054F, 0.0008878533F,
+291
0.0010060853F, 0.0011317002F, 0.0012646969F, 0.0014050742F,
+292
0.0015528307F, 0.0017079650F, 0.0018704756F, 0.0020403610F,
+293
0.0022176196F, 0.0024022497F, 0.0025942495F, 0.0027936173F,
+294
0.0030003511F, 0.0032144490F, 0.0034359088F, 0.0036647286F,
+295
0.0039009061F, 0.0041444391F, 0.0043953253F, 0.0046535621F,
+296
0.0049191472F, 0.0051920781F, 0.0054723520F, 0.0057599664F,
+297
0.0060549184F, 0.0063572052F, 0.0066668239F, 0.0069837715F,
+298
0.0073080449F, 0.0076396410F, 0.0079785566F, 0.0083247884F,
+299
0.0086783330F, 0.0090391871F, 0.0094073470F, 0.0097828092F,
+300
0.0101655700F, 0.0105556258F, 0.0109529726F, 0.0113576065F,
+301
0.0117695237F, 0.0121887200F, 0.0126151913F, 0.0130489335F,
+302
0.0134899422F, 0.0139382130F, 0.0143937415F, 0.0148565233F,
+303
0.0153265536F, 0.0158038279F, 0.0162883413F, 0.0167800889F,
+304
0.0172790660F, 0.0177852675F, 0.0182986882F, 0.0188193231F,
+305
0.0193471668F, 0.0198822141F, 0.0204244594F, 0.0209738974F,
+306
0.0215305225F, 0.0220943289F, 0.0226653109F, 0.0232434627F,
+307
0.0238287784F, 0.0244212519F, 0.0250208772F, 0.0256276481F,
+308
0.0262415582F, 0.0268626014F, 0.0274907711F, 0.0281260608F,
+309
0.0287684638F, 0.0294179736F, 0.0300745833F, 0.0307382859F,
+310
0.0314090747F, 0.0320869424F, 0.0327718819F, 0.0334638860F,
+311
0.0341629474F, 0.0348690586F, 0.0355822122F, 0.0363024004F,
+312
0.0370296157F, 0.0377638502F, 0.0385050960F, 0.0392533451F,
+313
0.0400085896F, 0.0407708211F, 0.0415400315F, 0.0423162123F,
+314
0.0430993552F, 0.0438894515F, 0.0446864926F, 0.0454904698F,
+315
0.0463013742F, 0.0471191969F, 0.0479439288F, 0.0487755607F,
+316
0.0496140836F, 0.0504594879F, 0.0513117642F, 0.0521709031F,
+317
0.0530368949F, 0.0539097297F, 0.0547893979F, 0.0556758894F,
+318
0.0565691941F, 0.0574693019F, 0.0583762026F, 0.0592898858F,
+319
0.0602103410F, 0.0611375576F, 0.0620715250F, 0.0630122324F,
+320
0.0639596688F, 0.0649138234F, 0.0658746848F, 0.0668422421F,
+321
0.0678164838F, 0.0687973985F, 0.0697849746F, 0.0707792005F,
+322
0.0717800645F, 0.0727875547F, 0.0738016591F, 0.0748223656F,
+323
0.0758496620F, 0.0768835359F, 0.0779239751F, 0.0789709668F,
+324
0.0800244985F, 0.0810845574F, 0.0821511306F, 0.0832242052F,
+325
0.0843037679F, 0.0853898056F, 0.0864823050F, 0.0875812525F,
+326
0.0886866347F, 0.0897984378F, 0.0909166480F, 0.0920412513F,
+327
0.0931722338F, 0.0943095813F, 0.0954532795F, 0.0966033140F,
+328
0.0977596702F, 0.0989223336F, 0.1000912894F, 0.1012665227F,
+329
0.1024480185F, 0.1036357616F, 0.1048297369F, 0.1060299290F,
+330
0.1072363224F, 0.1084489014F, 0.1096676504F, 0.1108925534F,
+331
0.1121235946F, 0.1133607577F, 0.1146040267F, 0.1158533850F,
+332
0.1171088163F, 0.1183703040F, 0.1196378312F, 0.1209113812F,
+333
0.1221909370F, 0.1234764815F, 0.1247679974F, 0.1260654674F,
+334
0.1273688740F, 0.1286781995F, 0.1299934263F, 0.1313145365F,
+335
0.1326415121F, 0.1339743349F, 0.1353129866F, 0.1366574490F,
+336
0.1380077035F, 0.1393637315F, 0.1407255141F, 0.1420930325F,
+337
0.1434662677F, 0.1448452004F, 0.1462298115F, 0.1476200814F,
+338
0.1490159906F, 0.1504175195F, 0.1518246482F, 0.1532373569F,
+339
0.1546556253F, 0.1560794333F, 0.1575087606F, 0.1589435866F,
+340
0.1603838909F, 0.1618296526F, 0.1632808509F, 0.1647374648F,
+341
0.1661994731F, 0.1676668546F, 0.1691395880F, 0.1706176516F,
+342
0.1721010238F, 0.1735896829F, 0.1750836068F, 0.1765827736F,
+343
0.1780871610F, 0.1795967468F, 0.1811115084F, 0.1826314234F,
+344
0.1841564689F, 0.1856866221F, 0.1872218600F, 0.1887621595F,
+345
0.1903074974F, 0.1918578503F, 0.1934131947F, 0.1949735068F,
+346
0.1965387630F, 0.1981089393F, 0.1996840117F, 0.2012639560F,
+347
0.2028487479F, 0.2044383630F, 0.2060327766F, 0.2076319642F,
+348
0.2092359007F, 0.2108445614F, 0.2124579211F, 0.2140759545F,
+349
0.2156986364F, 0.2173259411F, 0.2189578432F, 0.2205943168F,
+350
0.2222353361F, 0.2238808751F, 0.2255309076F, 0.2271854073F,
+351
0.2288443480F, 0.2305077030F, 0.2321754457F, 0.2338475493F,
+352
0.2355239869F, 0.2372047315F, 0.2388897560F, 0.2405790329F,
+353
0.2422725350F, 0.2439702347F, 0.2456721043F, 0.2473781159F,
+354
0.2490882418F, 0.2508024539F, 0.2525207240F, 0.2542430237F,
+355
0.2559693248F, 0.2576995986F, 0.2594338166F, 0.2611719498F,
+356
0.2629139695F, 0.2646598466F, 0.2664095520F, 0.2681630564F,
+357
0.2699203304F, 0.2716813445F, 0.2734460691F, 0.2752144744F,
+358
0.2769865307F, 0.2787622079F, 0.2805414760F, 0.2823243047F,
+359
0.2841106637F, 0.2859005227F, 0.2876938509F, 0.2894906179F,
+360
0.2912907928F, 0.2930943447F, 0.2949012426F, 0.2967114554F,
+361
0.2985249520F, 0.3003417009F, 0.3021616708F, 0.3039848301F,
+362
0.3058111471F, 0.3076405901F, 0.3094731273F, 0.3113087266F,
+363
0.3131473560F, 0.3149889833F, 0.3168335762F, 0.3186811024F,
+364
0.3205315294F, 0.3223848245F, 0.3242409552F, 0.3260998886F,
+365
0.3279615918F, 0.3298260319F, 0.3316931758F, 0.3335629903F,
+366
0.3354354423F, 0.3373104982F, 0.3391881247F, 0.3410682882F,
+367
0.3429509551F, 0.3448360917F, 0.3467236642F, 0.3486136387F,
+368
0.3505059811F, 0.3524006575F, 0.3542976336F, 0.3561968753F,
+369
0.3580983482F, 0.3600020179F, 0.3619078499F, 0.3638158096F,
+370
0.3657258625F, 0.3676379737F, 0.3695521086F, 0.3714682321F,
+371
0.3733863094F, 0.3753063055F, 0.3772281852F, 0.3791519134F,
+372
0.3810774548F, 0.3830047742F, 0.3849338362F, 0.3868646053F,
+373
0.3887970459F, 0.3907311227F, 0.3926667998F, 0.3946040417F,
+374
0.3965428125F, 0.3984830765F, 0.4004247978F, 0.4023679403F,
+375
0.4043124683F, 0.4062583455F, 0.4082055359F, 0.4101540034F,
+376
0.4121037117F, 0.4140546246F, 0.4160067058F, 0.4179599190F,
+377
0.4199142277F, 0.4218695956F, 0.4238259861F, 0.4257833627F,
+378
0.4277416888F, 0.4297009279F, 0.4316610433F, 0.4336219983F,
+379
0.4355837562F, 0.4375462803F, 0.4395095337F, 0.4414734797F,
+380
0.4434380815F, 0.4454033021F, 0.4473691046F, 0.4493354521F,
+381
0.4513023078F, 0.4532696345F, 0.4552373954F, 0.4572055533F,
+382
0.4591740713F, 0.4611429123F, 0.4631120393F, 0.4650814151F,
+383
0.4670510028F, 0.4690207650F, 0.4709906649F, 0.4729606651F,
+384
0.4749307287F, 0.4769008185F, 0.4788708972F, 0.4808409279F,
+385
0.4828108732F, 0.4847806962F, 0.4867503597F, 0.4887198264F,
+386
0.4906890593F, 0.4926580213F, 0.4946266753F, 0.4965949840F,
+387
0.4985629105F, 0.5005304176F, 0.5024974683F, 0.5044640255F,
+388
0.5064300522F, 0.5083955114F, 0.5103603659F, 0.5123245790F,
+389
0.5142881136F, 0.5162509328F, 0.5182129997F, 0.5201742774F,
+390
0.5221347290F, 0.5240943178F, 0.5260530070F, 0.5280107598F,
+391
0.5299675395F, 0.5319233095F, 0.5338780330F, 0.5358316736F,
+392
0.5377841946F, 0.5397355596F, 0.5416857320F, 0.5436346755F,
+393
0.5455823538F, 0.5475287304F, 0.5494737691F, 0.5514174337F,
+394
0.5533596881F, 0.5553004962F, 0.5572398218F, 0.5591776291F,
+395
0.5611138821F, 0.5630485449F, 0.5649815818F, 0.5669129570F,
+396
0.5688426349F, 0.5707705799F, 0.5726967564F, 0.5746211290F,
+397
0.5765436624F, 0.5784643212F, 0.5803830702F, 0.5822998743F,
+398
0.5842146984F, 0.5861275076F, 0.5880382669F, 0.5899469416F,
+399
0.5918534968F, 0.5937578981F, 0.5956601107F, 0.5975601004F,
+400
0.5994578326F, 0.6013532732F, 0.6032463880F, 0.6051371429F,
+401
0.6070255039F, 0.6089114372F, 0.6107949090F, 0.6126758856F,
+402
0.6145543334F, 0.6164302191F, 0.6183035092F, 0.6201741706F,
+403
0.6220421700F, 0.6239074745F, 0.6257700513F, 0.6276298674F,
+404
0.6294868903F, 0.6313410873F, 0.6331924262F, 0.6350408745F,
+405
0.6368864001F, 0.6387289710F, 0.6405685552F, 0.6424051209F,
+406
0.6442386364F, 0.6460690702F, 0.6478963910F, 0.6497205673F,
+407
0.6515415682F, 0.6533593625F, 0.6551739194F, 0.6569852082F,
+408
0.6587931984F, 0.6605978593F, 0.6623991609F, 0.6641970728F,
+409
0.6659915652F, 0.6677826081F, 0.6695701718F, 0.6713542268F,
+410
0.6731347437F, 0.6749116932F, 0.6766850461F, 0.6784547736F,
+411
0.6802208469F, 0.6819832374F, 0.6837419164F, 0.6854968559F,
+412
0.6872480275F, 0.6889954034F, 0.6907389556F, 0.6924786566F,
+413
0.6942144788F, 0.6959463950F, 0.6976743780F, 0.6993984008F,
+414
0.7011184365F, 0.7028344587F, 0.7045464407F, 0.7062543564F,
+415
0.7079581796F, 0.7096578844F, 0.7113534450F, 0.7130448359F,
+416
0.7147320316F, 0.7164150070F, 0.7180937371F, 0.7197681970F,
+417
0.7214383620F, 0.7231042077F, 0.7247657098F, 0.7264228443F,
+418
0.7280755871F, 0.7297239147F, 0.7313678035F, 0.7330072301F,
+419
0.7346421715F, 0.7362726046F, 0.7378985069F, 0.7395198556F,
+420
0.7411366285F, 0.7427488034F, 0.7443563584F, 0.7459592717F,
+421
0.7475575218F, 0.7491510873F, 0.7507399471F, 0.7523240803F,
+422
0.7539034661F, 0.7554780839F, 0.7570479136F, 0.7586129349F,
+423
0.7601731279F, 0.7617284730F, 0.7632789506F, 0.7648245416F,
+424
0.7663652267F, 0.7679009872F, 0.7694318044F, 0.7709576599F,
+425
0.7724785354F, 0.7739944130F, 0.7755052749F, 0.7770111035F,
+426
0.7785118815F, 0.7800075916F, 0.7814982170F, 0.7829837410F,
+427
0.7844641472F, 0.7859394191F, 0.7874095408F, 0.7888744965F,
+428
0.7903342706F, 0.7917888476F, 0.7932382124F, 0.7946823501F,
+429
0.7961212460F, 0.7975548855F, 0.7989832544F, 0.8004063386F,
+430
0.8018241244F, 0.8032365981F, 0.8046437463F, 0.8060455560F,
+431
0.8074420141F, 0.8088331080F, 0.8102188253F, 0.8115991536F,
+432
0.8129740810F, 0.8143435957F, 0.8157076861F, 0.8170663409F,
+433
0.8184195489F, 0.8197672994F, 0.8211095817F, 0.8224463853F,
+434
0.8237777001F, 0.8251035161F, 0.8264238235F, 0.8277386129F,
+435
0.8290478750F, 0.8303516008F, 0.8316497814F, 0.8329424083F,
+436
0.8342294731F, 0.8355109677F, 0.8367868841F, 0.8380572148F,
+437
0.8393219523F, 0.8405810893F, 0.8418346190F, 0.8430825345F,
+438
0.8443248294F, 0.8455614974F, 0.8467925323F, 0.8480179285F,
+439
0.8492376802F, 0.8504517822F, 0.8516602292F, 0.8528630164F,
+440
0.8540601391F, 0.8552515928F, 0.8564373733F, 0.8576174766F,
+441
0.8587918990F, 0.8599606368F, 0.8611236868F, 0.8622810460F,
+442
0.8634327113F, 0.8645786802F, 0.8657189504F, 0.8668535195F,
+443
0.8679823857F, 0.8691055472F, 0.8702230025F, 0.8713347503F,
+444
0.8724407896F, 0.8735411194F, 0.8746357394F, 0.8757246489F,
+445
0.8768078479F, 0.8778853364F, 0.8789571146F, 0.8800231832F,
+446
0.8810835427F, 0.8821381942F, 0.8831871387F, 0.8842303777F,
+447
0.8852679127F, 0.8862997456F, 0.8873258784F, 0.8883463132F,
+448
0.8893610527F, 0.8903700994F, 0.8913734562F, 0.8923711263F,
+449
0.8933631129F, 0.8943494196F, 0.8953300500F, 0.8963050083F,
+450
0.8972742985F, 0.8982379249F, 0.8991958922F, 0.9001482052F,
+451
0.9010948688F, 0.9020358883F, 0.9029712690F, 0.9039010165F,
+452
0.9048251367F, 0.9057436357F, 0.9066565195F, 0.9075637946F,
+453
0.9084654678F, 0.9093615456F, 0.9102520353F, 0.9111369440F,
+454
0.9120162792F, 0.9128900484F, 0.9137582595F, 0.9146209204F,
+455
0.9154780394F, 0.9163296248F, 0.9171756853F, 0.9180162296F,
+456
0.9188512667F, 0.9196808057F, 0.9205048559F, 0.9213234270F,
+457
0.9221365285F, 0.9229441704F, 0.9237463629F, 0.9245431160F,
+458
0.9253344404F, 0.9261203465F, 0.9269008453F, 0.9276759477F,
+459
0.9284456648F, 0.9292100080F, 0.9299689889F, 0.9307226190F,
+460
0.9314709103F, 0.9322138747F, 0.9329515245F, 0.9336838721F,
+461
0.9344109300F, 0.9351327108F, 0.9358492275F, 0.9365604931F,
+462
0.9372665208F, 0.9379673239F, 0.9386629160F, 0.9393533107F,
+463
0.9400385220F, 0.9407185637F, 0.9413934501F, 0.9420631954F,
+464
0.9427278141F, 0.9433873208F, 0.9440417304F, 0.9446910576F,
+465
0.9453353176F, 0.9459745255F, 0.9466086968F, 0.9472378469F,
+466
0.9478619915F, 0.9484811463F, 0.9490953274F, 0.9497045506F,
+467
0.9503088323F, 0.9509081888F, 0.9515026365F, 0.9520921921F,
+468
0.9526768723F, 0.9532566940F, 0.9538316742F, 0.9544018300F,
+469
0.9549671786F, 0.9555277375F, 0.9560835241F, 0.9566345562F,
+470
0.9571808513F, 0.9577224275F, 0.9582593027F, 0.9587914949F,
+471
0.9593190225F, 0.9598419038F, 0.9603601571F, 0.9608738012F,
+472
0.9613828546F, 0.9618873361F, 0.9623872646F, 0.9628826591F,
+473
0.9633735388F, 0.9638599227F, 0.9643418303F, 0.9648192808F,
+474
0.9652922939F, 0.9657608890F, 0.9662250860F, 0.9666849046F,
+475
0.9671403646F, 0.9675914861F, 0.9680382891F, 0.9684807937F,
+476
0.9689190202F, 0.9693529890F, 0.9697827203F, 0.9702082347F,
+477
0.9706295529F, 0.9710466953F, 0.9714596828F, 0.9718685362F,
+478
0.9722732762F, 0.9726739240F, 0.9730705005F, 0.9734630267F,
+479
0.9738515239F, 0.9742360134F, 0.9746165163F, 0.9749930540F,
+480
0.9753656481F, 0.9757343198F, 0.9760990909F, 0.9764599829F,
+481
0.9768170175F, 0.9771702164F, 0.9775196013F, 0.9778651941F,
+482
0.9782070167F, 0.9785450909F, 0.9788794388F, 0.9792100824F,
+483
0.9795370437F, 0.9798603449F, 0.9801800080F, 0.9804960554F,
+484
0.9808085092F, 0.9811173916F, 0.9814227251F, 0.9817245318F,
+485
0.9820228343F, 0.9823176549F, 0.9826090160F, 0.9828969402F,
+486
0.9831814498F, 0.9834625674F, 0.9837403156F, 0.9840147169F,
+487
0.9842857939F, 0.9845535692F, 0.9848180654F, 0.9850793052F,
+488
0.9853373113F, 0.9855921062F, 0.9858437127F, 0.9860921535F,
+489
0.9863374512F, 0.9865796287F, 0.9868187085F, 0.9870547136F,
+490
0.9872876664F, 0.9875175899F, 0.9877445067F, 0.9879684396F,
+491
0.9881894112F, 0.9884074444F, 0.9886225619F, 0.9888347863F,
+492
0.9890441404F, 0.9892506468F, 0.9894543284F, 0.9896552077F,
+493
0.9898533074F, 0.9900486502F, 0.9902412587F, 0.9904311555F,
+494
0.9906183633F, 0.9908029045F, 0.9909848019F, 0.9911640779F,
+495
0.9913407550F, 0.9915148557F, 0.9916864025F, 0.9918554179F,
+496
0.9920219241F, 0.9921859437F, 0.9923474989F, 0.9925066120F,
+497
0.9926633054F, 0.9928176012F, 0.9929695218F, 0.9931190891F,
+498
0.9932663254F, 0.9934112527F, 0.9935538932F, 0.9936942686F,
+499
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
@@ -0,0 +1,25 @@
+1
/********************************************************************
+2
* *
+3
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
+4
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+5
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+6
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+7
* *
+8
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 *
+9
* by the Xiph.Org Foundation https://xiph.org/ *
+10
* *
+11
********************************************************************
+12
+13
function: window functions
+14
+15
********************************************************************/
+16
+17
#ifndef _V_WINDOW_
+18
#define _V_WINDOW_
+19
+20
extern const float *_vorbis_window_get(int n);
+21
extern void _vorbis_apply_window(float *d,int *winno,long *blocksizes,
+22
int lW,int W,int nW);
+23
+24
+25
#endif
vendor/vorbis/sigil_alloca_shim.hadded
@@ -0,0 +1,26 @@
+1
/* sigil_alloca_shim.h
+2
*
+3
* Force-included before every vendored libvorbis source. Toggles
+4
* HAVE_ALLOCA_H based on the target platform so libvorbis's os.h
+5
* pulls in the right alloca declaration:
+6
*
+7
* - Linux/macOS: <alloca.h> exists; HAVE_ALLOCA_H=1.
+8
* - Windows (MinGW via zig): no <alloca.h>; alloca lives in
+9
* <malloc.h>, which os.h already pulls in via its _WIN32 branch.
+10
*
+11
* Without this shim, defining HAVE_ALLOCA_H unconditionally would
+12
* make Windows builds try to include the missing <alloca.h>, and
+13
* NOT defining it would leave Linux builds with an implicit-decl
+14
* error under -std=c99 (alloca is not a builtin there).
+15
*
+16
* This file lives outside vendor/vorbis/lib/ on purpose — keeping
+17
* upstream sources byte-identical so future bumps stay drop-in.
+18
*/
+19
#ifndef SIGIL_VORBIS_ALLOCA_SHIM_H
+20
#define SIGIL_VORBIS_ALLOCA_SHIM_H
+21
+22
#if !defined(_WIN32) && !defined(__SYMBIAN32__)
+23
# define HAVE_ALLOCA_H 1
+24
#endif
+25
+26
#endif /* SIGIL_VORBIS_ALLOCA_SHIM_H */