Dependencies: Updated mpg123 to 1.32.10
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
This commit is contained in:
parent
ae71a6a2bc
commit
4b19c15354
43 changed files with 2251 additions and 12255 deletions
BIN
ThirdParty/libraries-debug-overlay.tar.xz
vendored
BIN
ThirdParty/libraries-debug-overlay.tar.xz
vendored
Binary file not shown.
BIN
ThirdParty/libraries.tar.xz
vendored
BIN
ThirdParty/libraries.tar.xz
vendored
Binary file not shown.
41
ThirdParty/mpg123/include/mpg123/abi_align.h
vendored
41
ThirdParty/mpg123/include/mpg123/abi_align.h
vendored
|
@ -1,41 +0,0 @@
|
|||
/*
|
||||
abi_align: An attempt to avoid breakage because of mixing
|
||||
compilers with different alignment.
|
||||
|
||||
copyright 1995-2015 by the mpg123 project
|
||||
free software under the terms of the LGPL 2.1
|
||||
see COPYING and AUTHORS files in distribution or http://mpg123.org
|
||||
|
||||
There used to be code that checks alignment, but it did not really
|
||||
work anyway. The only straw we have is putting that alignment
|
||||
attribute to API functions.
|
||||
*/
|
||||
|
||||
#ifndef MPG123_H_ABI_ALIGN
|
||||
#define MPG123_H_ABI_ALIGN
|
||||
|
||||
#include "config.h"
|
||||
|
||||
/* ABI conformance for other compilers.
|
||||
mpg123 needs 16byte-aligned (or more) stack for SSE and friends.
|
||||
gcc provides that, but others don't necessarily. */
|
||||
#ifdef ABI_ALIGN_FUN
|
||||
|
||||
#ifndef attribute_align_arg
|
||||
|
||||
#if defined(__GNUC__) && (__GNUC__ > 4 || __GNUC__ == 4 && __GNUC_MINOR__>1)
|
||||
# define attribute_align_arg __attribute__((force_align_arg_pointer))
|
||||
/* The gcc that can align the stack does not need the check... nor does it work with gcc 4.3+, anyway. */
|
||||
#else
|
||||
# define attribute_align_arg
|
||||
#endif
|
||||
|
||||
#endif /* attribute_align_arg */
|
||||
|
||||
#else /* ABI_ALIGN_FUN */
|
||||
|
||||
#define attribute_align_arg
|
||||
|
||||
#endif /* ABI_ALIGN_FUN */
|
||||
|
||||
#endif /* MPG123_H_ABI_ALIGN */
|
81
ThirdParty/mpg123/include/mpg123/costabs.h
vendored
81
ThirdParty/mpg123/include/mpg123/costabs.h
vendored
|
@ -1,81 +0,0 @@
|
|||
// cos MPEG decoding tables
|
||||
// output of:
|
||||
// src/libmpg123/calctables cos
|
||||
|
||||
#if defined(RUNTIME_TABLES)
|
||||
|
||||
#ifdef REAL_IS_FLOAT
|
||||
|
||||
// aligned to 16 bytes for vector instructions, e.g. AltiVec
|
||||
|
||||
static ALIGNED(16) real cos64[16];
|
||||
static ALIGNED(16) real cos32[8];
|
||||
static ALIGNED(16) real cos16[4];
|
||||
static ALIGNED(16) real cos8[2];
|
||||
static ALIGNED(16) real cos4[1];
|
||||
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
#ifdef REAL_IS_FLOAT
|
||||
|
||||
// aligned to 16 bytes for vector instructions, e.g. AltiVec
|
||||
|
||||
static const ALIGNED(16) real cos64[16] =
|
||||
{
|
||||
5.00602998e-01, 5.05470960e-01, 5.15447310e-01, 5.31042591e-01
|
||||
, 5.53103896e-01, 5.82934968e-01, 6.22504123e-01, 6.74808341e-01
|
||||
, 7.44536271e-01, 8.39349645e-01, 9.72568238e-01, 1.16943993e+00
|
||||
, 1.48416462e+00, 2.05778101e+00, 3.40760842e+00, 1.01900081e+01
|
||||
};
|
||||
static const ALIGNED(16) real cos32[8] =
|
||||
{
|
||||
5.02419286e-01, 5.22498615e-01, 5.66944035e-01, 6.46821783e-01
|
||||
, 7.88154623e-01, 1.06067769e+00, 1.72244710e+00, 5.10114862e+00
|
||||
};
|
||||
static const ALIGNED(16) real cos16[4] =
|
||||
{
|
||||
5.09795579e-01, 6.01344887e-01, 8.99976223e-01, 2.56291545e+00
|
||||
};
|
||||
static const ALIGNED(16) real cos8[2] =
|
||||
{
|
||||
5.41196100e-01, 1.30656296e+00
|
||||
};
|
||||
static const ALIGNED(16) real cos4[1] =
|
||||
{
|
||||
7.07106781e-01
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef REAL_IS_FIXED
|
||||
|
||||
static const real cos64[16] =
|
||||
{
|
||||
8398725, 8480395, 8647771, 8909416
|
||||
, 9279544, 9780026, 10443886, 11321405
|
||||
, 12491246, 14081950, 16316987, 19619946
|
||||
, 24900150, 34523836, 57170182, 170959967
|
||||
};
|
||||
static const real cos32[8] =
|
||||
{
|
||||
8429197, 8766072, 9511743, 10851869
|
||||
, 13223040, 17795219, 28897867, 85583072
|
||||
};
|
||||
static const real cos16[4] =
|
||||
{
|
||||
8552951, 10088893, 15099095, 42998586
|
||||
};
|
||||
static const real cos8[2] =
|
||||
{
|
||||
9079764, 21920489
|
||||
};
|
||||
static const real cos4[1] =
|
||||
{
|
||||
11863283
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
132
ThirdParty/mpg123/include/mpg123/debug.h
vendored
132
ThirdParty/mpg123/include/mpg123/debug.h
vendored
|
@ -1,132 +0,0 @@
|
|||
/*
|
||||
Some macros for printing debugging/warning/error messages with location info.
|
||||
|
||||
public domain (or LGPL / GPL, if you like that more;-)
|
||||
generated by debugdef.pl, what was
|
||||
trivially written by Thomas Orgis <thomas@orgis.org>
|
||||
|
||||
You decide to define DEBUG or not and write debug("foo") or
|
||||
mdebug("foo: %s", message) and variants with more arguments and this
|
||||
is converted to an elaborate call to fprintf(stderr, ...) that prints your
|
||||
message with a line end attached and with information on where the call
|
||||
occured.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#ifdef ME
|
||||
#define DBGPRFX ME": "
|
||||
#else
|
||||
#define DBGPRFX ""
|
||||
#endif
|
||||
|
||||
#define noop ((void)0)
|
||||
|
||||
#ifdef XDEBUG
|
||||
#define mxdebug(s, ...) mdebug(s, __VA_ARGS__)
|
||||
#define xdebug(s) debug(s)
|
||||
#else
|
||||
#define mxdebug(s, ...) noop
|
||||
#define xdebug(s) noop
|
||||
#endif
|
||||
|
||||
// Used for debugging and warning messages.
|
||||
#include <stdio.h>
|
||||
#define debug_print(t, s, ...) fprintf(stderr, DBGPRFX "[" __FILE__ ":%s():%i] " t ": " s "\n", __func__, __LINE__, __VA_ARGS__)
|
||||
|
||||
#ifdef DEBUG
|
||||
#define mdebug(s, ...) debug_print("debug", s, __VA_ARGS__)
|
||||
#else
|
||||
#define mdebug(s, ...) noop
|
||||
#endif
|
||||
#define debug(s) mdebug("%s", s)
|
||||
|
||||
// Print warning message.
|
||||
#ifndef NO_WARNING
|
||||
#define mwarning(s, ...) debug_print("warning", s, __VA_ARGS__)
|
||||
#else
|
||||
#define mwarning(s, ...)
|
||||
#endif
|
||||
#define warning(s) mwarning("%s", s)
|
||||
|
||||
// Print error message.
|
||||
#ifndef NO_ERRORMSG
|
||||
#define merror(s, ...) debug_print("error", s, __VA_ARGS__)
|
||||
#else
|
||||
#define merror(s, ...) noop
|
||||
#endif
|
||||
#define error(s) merror("%s", s)
|
||||
|
||||
// Print error message and return given value.
|
||||
#ifndef NO_ERETURN
|
||||
#define mereturn(rv, s, ...) do{ debug_print("ereturn", s, __VA_ARGS__); return rv; } while (0)
|
||||
#else
|
||||
#define mereturn(rv, s, ...) return rv
|
||||
#endif
|
||||
#define ereturn(rv, s) mereturn(rv, "%s", s)
|
||||
|
||||
// For old code that had to hardcode the argument number.
|
||||
|
||||
#define debug1(s, a) mdebug(s,a)
|
||||
#define debug2(s, a, b) mdebug(s, a, b)
|
||||
#define debug3(s, a, b, c) mdebug(s, a, b, c)
|
||||
#define debug4(s, a, b, c, d) mdebug(s, a, b, c, d)
|
||||
#define debug5(s, a, b, c, d, e) mdebug(s, a, b, c, d, e)
|
||||
#define debug6(s, a, b, c, d, e, f) mdebug(s, a, b, c, d, e, f)
|
||||
#define debug7(s, a, b, c, d, e, f, g) mdebug(s, a, b, c, d, e, f, g)
|
||||
#define debug8(s, a, b, c, d, e, f, g, h) mdebug(s, a, b, c, d, e, f, g, h)
|
||||
#define debug9(s, a, b, c, d, e, f, g, h, i) mdebug(s, a, b, c, d, e, f, g, h, i)
|
||||
#define debug10(s, a, b, c, d, e, f, g, h, i, j) mdebug(s, a, b, c, d, e, f, g, h, i, j)
|
||||
#define debug11(s, a, b, c, d, e, f, g, h, i, j, k) mdebug(s, a, b, c, d, e, f, g, h, i, j, k)
|
||||
#define debug12(s, a, b, c, d, e, f, g, h, i, j, k, l) mdebug(s, a, b, c, d, e, f, g, h, i, j, k, l)
|
||||
#define debug13(s, a, b, c, d, e, f, g, h, i, j, k, l, m) mdebug(s, a, b, c, d, e, f, g, h, i, j, k, l, m)
|
||||
#define debug14(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n) mdebug(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n)
|
||||
#define debug15(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) mdebug(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)
|
||||
|
||||
#define warning1(s, a) mwarning(s, a)
|
||||
#define warning2(s, a, b) mwarning(s, a, b)
|
||||
#define warning3(s, a, b, c) mwarning(s, a, b, c)
|
||||
#define warning4(s, a, b, c, d) mwarning(s, a, b, c, d)
|
||||
#define warning5(s, a, b, c, d, e) mwarning(s, a, b, c, d, e)
|
||||
#define warning6(s, a, b, c, d, e, f) mwarning(s, a, b, c, d, e, f)
|
||||
#define warning7(s, a, b, c, d, e, f, g) mwarning(s, a, b, c, d, e, f, g)
|
||||
#define warning8(s, a, b, c, d, e, f, g, h) mwarning(s, a, b, c, d, e, f, g, h)
|
||||
#define warning9(s, a, b, c, d, e, f, g, h, i) mwarning(s, a, b, c, d, e, f, g, h, i)
|
||||
#define warning10(s, a, b, c, d, e, f, g, h, i, j) mwarning(s, a, b, c, d, e, f, g, h, i, j)
|
||||
#define warning11(s, a, b, c, d, e, f, g, h, i, j, k) mwarning(s, a, b, c, d, e, f, g, h, i, j, k)
|
||||
#define warning12(s, a, b, c, d, e, f, g, h, i, j, k, l) mwarning(s, a, b, c, d, e, f, g, h, i, j, k, l)
|
||||
#define warning13(s, a, b, c, d, e, f, g, h, i, j, k, l, m) mwarning(s, a, b, c, d, e, f, g, h, i, j, k, l, m)
|
||||
#define warning14(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n) mwarning(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n)
|
||||
#define warning15(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) mwarning(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)
|
||||
|
||||
#define error1(s, a) merror(s, a)
|
||||
#define error2(s, a, b) merror(s, a, b)
|
||||
#define error3(s, a, b, c) merror(s, a, b, c)
|
||||
#define error4(s, a, b, c, d) merror(s, a, b, c, d)
|
||||
#define error5(s, a, b, c, d, e) merror(s, a, b, c, d, e)
|
||||
#define error6(s, a, b, c, d, e, f) merror(s, a, b, c, d, e, f)
|
||||
#define error7(s, a, b, c, d, e, f, g) merror(s, a, b, c, d, e, f, g)
|
||||
#define error8(s, a, b, c, d, e, f, g, h) merror(s, a, b, c, d, e, f, g, h)
|
||||
#define error9(s, a, b, c, d, e, f, g, h, i) merror(s, a, b, c, d, e, f, g, h, i)
|
||||
#define error10(s, a, b, c, d, e, f, g, h, i, j) merror(s, a, b, c, d, e, f, g, h, i, j)
|
||||
#define error11(s, a, b, c, d, e, f, g, h, i, j, k) merror(s, a, b, c, d, e, f, g, h, i, j, k)
|
||||
#define error12(s, a, b, c, d, e, f, g, h, i, j, k, l) merror(s, a, b, c, d, e, f, g, h, i, j, k, l)
|
||||
#define error13(s, a, b, c, d, e, f, g, h, i, j, k, l, m) merror(s, a, b, c, d, e, f, g, h, i, j, k, l, m)
|
||||
#define error14(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n) merror(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n)
|
||||
#define error15(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) merror(s, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)
|
||||
|
||||
#define ereturn1(rv, s, a) mereturn(rv, s, a)
|
||||
#define ereturn2(rv, s, a, b) mereturn(rv, s, a, b)
|
||||
#define ereturn3(rv, s, a, b, c) mereturn(rv, s, a, b, c)
|
||||
#define ereturn4(rv, s, a, b, c, d) mereturn(rv, s, a, b, c, d)
|
||||
#define ereturn5(rv, s, a, b, c, d, e) mereturn(rv, s, a, b, c, d, e)
|
||||
#define ereturn6(rv, s, a, b, c, d, e, f) mereturn(rv, s, a, b, c, d, e, f)
|
||||
#define ereturn7(rv, s, a, b, c, d, e, f, g) mereturn(rv, s, a, b, c, d, e, f, g)
|
||||
#define ereturn8(rv, s, a, b, c, d, e, f, g, h) mereturn(rv, s, a, b, c, d, e, f, g, h)
|
||||
#define ereturn9(rv, s, a, b, c, d, e, f, g, h, i) mereturn(rv, s, a, b, c, d, e, f, g, h, i)
|
||||
#define ereturn10(rv, s, a, b, c, d, e, f, g, h, i, j) mereturn(rv, s, a, b, c, d, e, f, g, h, i, j)
|
||||
#define ereturn11(rv, s, a, b, c, d, e, f, g, h, i, j, k) mereturn(rv, s, a, b, c, d, e, f, g, h, i, j, k)
|
||||
#define ereturn12(rv, s, a, b, c, d, e, f, g, h, i, j, k, l) mereturn(rv, s, a, b, c, d, e, f, g, h, i, j, k, l)
|
||||
#define ereturn13(rv, s, a, b, c, d, e, f, g, h, i, j, k, l, m) mereturn(rv, s, a, b, c, d, e, f, g, h, i, j, k, l, m)
|
||||
#define ereturn14(rv, s, a, b, c, d, e, f, g, h, i, j, k, l, m, n) mereturn(rv, s, a, b, c, d, e, f, g, h, i, j, k, l, m, n)
|
||||
#define ereturn15(rv, s, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) mereturn(rv, s, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)
|
292
ThirdParty/mpg123/include/mpg123/decode.h
vendored
292
ThirdParty/mpg123/include/mpg123/decode.h
vendored
|
@ -1,292 +0,0 @@
|
|||
/*
|
||||
decode.h: common definitions for decode functions
|
||||
|
||||
This file is strongly tied with optimize.h concerning the synth functions.
|
||||
Perhaps one should restructure that a bit.
|
||||
|
||||
copyright 2007-8 by the mpg123 project - free software under the terms of the LGPL 2.1
|
||||
see COPYING and AUTHORS files in distribution or http://mpg123.org
|
||||
initially written by Thomas Orgis, taking WRITE_SAMPLE from decode.c
|
||||
*/
|
||||
#ifndef MPG123_DECODE_H
|
||||
#define MPG123_DECODE_H
|
||||
|
||||
/* Selection of class of output routines for basic format. */
|
||||
#ifndef REAL_IS_FIXED
|
||||
#define OUT_FORMATS 4 /* Basic output formats: 16bit, 8bit, real and s32 */
|
||||
#else
|
||||
#define OUT_FORMATS 2 /* Only up to 16bit */
|
||||
#endif
|
||||
|
||||
#define OUT_16 0
|
||||
#define OUT_8 1
|
||||
/* Those are defined but not supported for fixed point decoding! */
|
||||
#define OUT_REAL 2 /* Write a floating point sample (that is, one matching the internal real type). */
|
||||
#define OUT_S32 3
|
||||
|
||||
#ifdef NO_NTOM
|
||||
#define NTOM_MAX 1
|
||||
#else
|
||||
#define NTOM_MAX 8 /* maximum allowed factor for upsampling */
|
||||
#define NTOM_MAX_FREQ 96000 /* maximum frequency to upsample to / downsample from */
|
||||
#define NTOM_MUL (32768)
|
||||
void ntom_set_ntom(mpg123_handle *fr, off_t num);
|
||||
#endif
|
||||
|
||||
/* Let's collect all possible synth functions here, for an overview.
|
||||
If they are actually defined and used depends on preprocessor machinery.
|
||||
See synth.c and optimize.h for that, also some special C and assembler files. */
|
||||
|
||||
#ifndef NO_16BIT
|
||||
/* The signed-16bit-producing variants. */
|
||||
int synth_1to1 (real*, int, mpg123_handle*, int);
|
||||
int synth_1to1_dither (real*, int, mpg123_handle*, int);
|
||||
int synth_1to1_i386 (real*, int, mpg123_handle*, int);
|
||||
int synth_1to1_i586 (real*, int, mpg123_handle*, int);
|
||||
int synth_1to1_i586_dither(real*, int, mpg123_handle*, int);
|
||||
int synth_1to1_mmx (real*, int, mpg123_handle*, int);
|
||||
int synth_1to1_3dnow (real*, int, mpg123_handle*, int);
|
||||
int synth_1to1_sse (real*, int, mpg123_handle*, int);
|
||||
int synth_1to1_stereo_sse (real*, real*, mpg123_handle*);
|
||||
int synth_1to1_3dnowext (real*, int, mpg123_handle*, int);
|
||||
int synth_1to1_altivec (real*, int, mpg123_handle*, int);
|
||||
int synth_1to1_stereo_altivec(real*, real*, mpg123_handle*);
|
||||
int synth_1to1_x86_64 (real*, int, mpg123_handle*, int);
|
||||
int synth_1to1_stereo_x86_64(real*, real*, mpg123_handle*);
|
||||
int synth_1to1_avx (real*, int, mpg123_handle*, int);
|
||||
int synth_1to1_stereo_avx (real*, real*, mpg123_handle*);
|
||||
int synth_1to1_arm (real*, int, mpg123_handle*, int);
|
||||
int synth_1to1_neon (real*, int, mpg123_handle*, int);
|
||||
int synth_1to1_stereo_neon(real*, real*, mpg123_handle*);
|
||||
int synth_1to1_neon64 (real*, int, mpg123_handle*, int);
|
||||
int synth_1to1_stereo_neon64(real*, real*, mpg123_handle*);
|
||||
/* This is different, special usage in layer3.c only.
|
||||
Hence, the name... and now forget about it.
|
||||
Never use it outside that special portion of code inside layer3.c! */
|
||||
int absynth_1to1_i486(real*, int, mpg123_handle*, int);
|
||||
/* These mono/stereo converters use one of the above for the grunt work. */
|
||||
int synth_1to1_mono (real*, mpg123_handle*);
|
||||
int synth_1to1_m2s(real*, mpg123_handle*);
|
||||
|
||||
/* Sample rate decimation comes in less flavours. */
|
||||
#ifndef NO_DOWNSAMPLE
|
||||
int synth_2to1 (real*, int, mpg123_handle*, int);
|
||||
int synth_2to1_dither (real*, int, mpg123_handle*, int);
|
||||
int synth_2to1_i386 (real*, int, mpg123_handle*, int);
|
||||
int synth_2to1_mono (real*, mpg123_handle*);
|
||||
int synth_2to1_m2s(real*, mpg123_handle*);
|
||||
int synth_4to1 (real *,int, mpg123_handle*, int);
|
||||
int synth_4to1_dither (real *,int, mpg123_handle*, int);
|
||||
int synth_4to1_i386 (real*, int, mpg123_handle*, int);
|
||||
int synth_4to1_mono (real*, mpg123_handle*);
|
||||
int synth_4to1_m2s(real*, mpg123_handle*);
|
||||
#endif
|
||||
#ifndef NO_NTOM
|
||||
/* NtoM is really just one implementation. */
|
||||
int synth_ntom (real *,int, mpg123_handle*, int);
|
||||
int synth_ntom_mono (real *, mpg123_handle *);
|
||||
int synth_ntom_m2s (real *, mpg123_handle *);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef NO_8BIT
|
||||
/* The 8bit-producing variants. */
|
||||
/* There are direct 8-bit synths and wrappers over a possibly optimized 16bit one. */
|
||||
int synth_1to1_8bit (real*, int, mpg123_handle*, int);
|
||||
int synth_1to1_8bit_i386 (real*, int, mpg123_handle*, int);
|
||||
#ifndef NO_16BIT
|
||||
int synth_1to1_8bit_wrap (real*, int, mpg123_handle*, int);
|
||||
int synth_1to1_8bit_mono (real*, mpg123_handle*);
|
||||
#endif
|
||||
int synth_1to1_8bit_m2s(real*, mpg123_handle*);
|
||||
#ifndef NO_16BIT
|
||||
int synth_1to1_8bit_wrap_mono (real*, mpg123_handle*);
|
||||
int synth_1to1_8bit_wrap_m2s(real*, mpg123_handle*);
|
||||
#endif
|
||||
#ifndef NO_DOWNSAMPLE
|
||||
int synth_2to1_8bit (real*, int, mpg123_handle*, int);
|
||||
int synth_2to1_8bit_i386 (real*, int, mpg123_handle*, int);
|
||||
int synth_2to1_8bit_mono (real*, mpg123_handle*);
|
||||
int synth_2to1_8bit_m2s(real*, mpg123_handle*);
|
||||
int synth_4to1_8bit (real*, int, mpg123_handle*, int);
|
||||
int synth_4to1_8bit_i386 (real*, int, mpg123_handle*, int);
|
||||
int synth_4to1_8bit_mono (real*, mpg123_handle*);
|
||||
int synth_4to1_8bit_m2s(real*, mpg123_handle*);
|
||||
#endif
|
||||
#ifndef NO_NTOM
|
||||
int synth_ntom_8bit (real*, int, mpg123_handle*, int);
|
||||
int synth_ntom_8bit_mono (real*, mpg123_handle*);
|
||||
int synth_ntom_8bit_m2s(real*, mpg123_handle*);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef REAL_IS_FIXED
|
||||
|
||||
#ifndef NO_REAL
|
||||
/* The real-producing variants. */
|
||||
int synth_1to1_real (real*, int, mpg123_handle*, int);
|
||||
int synth_1to1_real_i386 (real*, int, mpg123_handle*, int);
|
||||
int synth_1to1_real_sse (real*, int, mpg123_handle*, int);
|
||||
int synth_1to1_real_stereo_sse (real*, real*, mpg123_handle*);
|
||||
int synth_1to1_real_x86_64 (real*, int, mpg123_handle*, int);
|
||||
int synth_1to1_real_stereo_x86_64(real*, real*, mpg123_handle*);
|
||||
int synth_1to1_real_avx (real*, int, mpg123_handle*, int);
|
||||
int synth_1to1_fltst_avx (real*, real*, mpg123_handle*);
|
||||
int synth_1to1_real_altivec (real*, int, mpg123_handle*, int);
|
||||
int synth_1to1_fltst_altivec(real*, real*, mpg123_handle*);
|
||||
int synth_1to1_real_neon (real*, int, mpg123_handle*, int);
|
||||
int synth_1to1_real_stereo_neon(real*, real*, mpg123_handle*);
|
||||
int synth_1to1_real_neon64 (real*, int, mpg123_handle*, int);
|
||||
int synth_1to1_fltst_neon64(real*, real*, mpg123_handle*);
|
||||
int synth_1to1_real_mono (real*, mpg123_handle*);
|
||||
int synth_1to1_real_m2s(real*, mpg123_handle*);
|
||||
#ifndef NO_DOWNSAMPLE
|
||||
int synth_2to1_real (real*, int, mpg123_handle*, int);
|
||||
int synth_2to1_real_i386 (real*, int, mpg123_handle*, int);
|
||||
int synth_2to1_real_mono (real*, mpg123_handle*);
|
||||
int synth_2to1_real_m2s(real*, mpg123_handle*);
|
||||
int synth_4to1_real (real*, int, mpg123_handle*, int);
|
||||
int synth_4to1_real_i386 (real*, int, mpg123_handle*, int);
|
||||
int synth_4to1_real_mono (real*, mpg123_handle*);
|
||||
int synth_4to1_real_m2s(real*, mpg123_handle*);
|
||||
#endif
|
||||
#ifndef NO_NTOM
|
||||
int synth_ntom_real (real*, int, mpg123_handle*, int);
|
||||
int synth_ntom_real_mono (real*, mpg123_handle*);
|
||||
int synth_ntom_real_m2s(real*, mpg123_handle*);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef NO_32BIT
|
||||
/* 32bit integer */
|
||||
int synth_1to1_s32 (real*, int, mpg123_handle*, int);
|
||||
int synth_1to1_s32_i386 (real*, int, mpg123_handle*, int);
|
||||
int synth_1to1_s32_sse (real*, int, mpg123_handle*, int);
|
||||
int synth_1to1_s32_stereo_sse (real*, real*, mpg123_handle*);
|
||||
int synth_1to1_s32_x86_64 (real*, int, mpg123_handle*, int);
|
||||
int synth_1to1_s32_stereo_x86_64(real*, real*, mpg123_handle*);
|
||||
int synth_1to1_s32_avx (real*, int, mpg123_handle*, int);
|
||||
int synth_1to1_s32_stereo_avx (real*, real*, mpg123_handle*);
|
||||
int synth_1to1_s32_altivec (real*, int, mpg123_handle*, int);
|
||||
int synth_1to1_s32_stereo_altivec(real*, real*, mpg123_handle*);
|
||||
int synth_1to1_s32_neon (real*, int, mpg123_handle*, int);
|
||||
int synth_1to1_s32_stereo_neon(real*, real*, mpg123_handle*);
|
||||
int synth_1to1_s32_neon64 (real*, int, mpg123_handle*, int);
|
||||
int synth_1to1_s32st_neon64(real*, real*, mpg123_handle*);
|
||||
int synth_1to1_s32_mono (real*, mpg123_handle*);
|
||||
int synth_1to1_s32_m2s(real*, mpg123_handle*);
|
||||
#ifndef NO_DOWNSAMPLE
|
||||
int synth_2to1_s32 (real*, int, mpg123_handle*, int);
|
||||
int synth_2to1_s32_i386 (real*, int, mpg123_handle*, int);
|
||||
int synth_2to1_s32_mono (real*, mpg123_handle*);
|
||||
int synth_2to1_s32_m2s(real*, mpg123_handle*);
|
||||
int synth_4to1_s32 (real*, int, mpg123_handle*, int);
|
||||
int synth_4to1_s32_i386 (real*, int, mpg123_handle*, int);
|
||||
int synth_4to1_s32_mono (real*, mpg123_handle*);
|
||||
int synth_4to1_s32_m2s(real*, mpg123_handle*);
|
||||
#endif
|
||||
#ifndef NO_NTOM
|
||||
int synth_ntom_s32 (real*, int, mpg123_handle*, int);
|
||||
int synth_ntom_s32_mono (real*, mpg123_handle*);
|
||||
int synth_ntom_s32_m2s(real*, mpg123_handle*);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* FIXED */
|
||||
|
||||
|
||||
/* Inside these synth functions, some dct64 variants may be used.
|
||||
The special optimized ones that only appear in assembler code are not mentioned here.
|
||||
And, generally, these functions are only employed in a matching synth function. */
|
||||
void dct64 (real *,real *,real *);
|
||||
void dct64_i386 (real *,real *,real *);
|
||||
void dct64_altivec(real *,real *,real *);
|
||||
void dct64_i486(int*, int* , real*); /* Yeah, of no use outside of synth_i486.c .*/
|
||||
|
||||
/* This is used by the layer 3 decoder, one generic function and 3DNow variants. */
|
||||
void dct36 (real *,real *,real *,const real *,real *);
|
||||
void dct36_3dnow (real *,real *,real *,const real *,real *);
|
||||
void dct36_3dnowext(real *,real *,real *,const real *,real *);
|
||||
void dct36_x86_64 (real *,real *,real *,const real *,real *);
|
||||
void dct36_sse (real *,real *,real *,const real *,real *);
|
||||
void dct36_avx (real *,real *,real *,const real *,real *);
|
||||
void dct36_neon (real *,real *,real *,const real *,real *);
|
||||
void dct36_neon64 (real *,real *,real *,const real *,real *);
|
||||
|
||||
/* Tools for NtoM resampling synth, defined in ntom.c . */
|
||||
int synth_ntom_set_step(mpg123_handle *fr); /* prepare ntom decoding */
|
||||
unsigned long ntom_val(mpg123_handle *fr, off_t frame); /* compute ntom_val for frame offset */
|
||||
/* Frame and sample offsets. */
|
||||
#ifndef NO_NTOM
|
||||
/*
|
||||
Outsamples of _this_ frame.
|
||||
To be exact: The samples to be expected from the next frame decode (using the current ntom_val). When you already decoded _this_ frame, this is the number of samples to be expected from the next one.
|
||||
*/
|
||||
off_t ntom_frame_outsamples(mpg123_handle *fr);
|
||||
/* Total out/insample offset. */
|
||||
off_t ntom_frmouts(mpg123_handle *fr, off_t frame);
|
||||
off_t ntom_ins2outs(mpg123_handle *fr, off_t ins);
|
||||
off_t ntom_frameoff(mpg123_handle *fr, off_t soff);
|
||||
#endif
|
||||
|
||||
/* Initialization of any static data that majy be needed at runtime.
|
||||
Make sure you call these once before it is too late. */
|
||||
#ifndef NO_LAYER3
|
||||
#ifdef RUNTIME_TABLES
|
||||
void init_layer3(void);
|
||||
#endif
|
||||
real init_layer3_gainpow2(mpg123_handle *fr, int i);
|
||||
void init_layer3_stuff(mpg123_handle *fr, real (*gainpow2)(mpg123_handle *fr, int i));
|
||||
#endif
|
||||
#ifndef NO_LAYER12
|
||||
#ifdef RUNTIME_TABLES
|
||||
void init_layer12(void);
|
||||
#endif
|
||||
real* init_layer12_table(mpg123_handle *fr, real *table, int m);
|
||||
void init_layer12_stuff(mpg123_handle *fr, real* (*init_table)(mpg123_handle *fr, real *table, int m));
|
||||
#endif
|
||||
|
||||
#ifdef RUNTIME_TABLES
|
||||
void init_costabs(void);
|
||||
#else
|
||||
const
|
||||
#endif
|
||||
extern real *pnts[5]; /* costab.h provides, dct64 needs */
|
||||
|
||||
/* Runtime (re)init functions; needed more often. */
|
||||
void make_decode_tables(mpg123_handle *fr); /* For every volume change. */
|
||||
/* Stuff needed after updating synth setup (see set_synth_functions()). */
|
||||
|
||||
#ifdef OPT_MMXORSSE
|
||||
/* Special treatment for mmx-like decoders, these functions go into the slots below. */
|
||||
void make_decode_tables_mmx(mpg123_handle *fr);
|
||||
#ifndef NO_LAYER3
|
||||
real init_layer3_gainpow2_mmx(mpg123_handle *fr, int i);
|
||||
#endif
|
||||
#ifndef NO_LAYER12
|
||||
real* init_layer12_table_mmx(mpg123_handle *fr, real *table, int m);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef NO_8BIT
|
||||
/* Needed when switching to 8bit output. */
|
||||
int make_conv16to8_table(mpg123_handle *fr);
|
||||
#endif
|
||||
|
||||
/* These are the actual workers.
|
||||
They operate on the parsed frame data and handle decompression to audio samples.
|
||||
The synth functions defined above are called from inside the layer handlers. */
|
||||
|
||||
#ifndef NO_LAYER3
|
||||
int do_layer3(mpg123_handle *fr);
|
||||
#endif
|
||||
#ifndef NO_LAYER2
|
||||
int do_layer2(mpg123_handle *fr);
|
||||
#endif
|
||||
#ifndef NO_LAYER1
|
||||
int do_layer1(mpg123_handle *fr);
|
||||
#endif
|
||||
/* There's an 3DNow counterpart in asm. */
|
||||
void do_equalizer(real *bandPtr,int channel, real equalizer[2][32]);
|
||||
|
||||
#endif
|
23
ThirdParty/mpg123/include/mpg123/dither.h
vendored
23
ThirdParty/mpg123/include/mpg123/dither.h
vendored
|
@ -1,23 +0,0 @@
|
|||
/*
|
||||
dither: Generate noise for dithering / noise shaping.
|
||||
|
||||
copyright 2009 by the mpg123 project - free software under the terms of the LGPL 2.1
|
||||
see COPYING and AUTHORS files in distribution or http://mpg123.org
|
||||
initially written by Taihei Monma
|
||||
*/
|
||||
|
||||
#ifndef MPG123_DITHER_H
|
||||
#define MPG123_DITHER_H
|
||||
|
||||
#define DITHERSIZE 65536
|
||||
enum mpg123_noise_type
|
||||
{
|
||||
mpg123_white_noise = 0
|
||||
,mpg123_tpdf_noise
|
||||
,mpg123_highpass_tpdf_noise
|
||||
};
|
||||
|
||||
void mpg123_noise(float* table, size_t count, enum mpg123_noise_type noisetype);
|
||||
void dither_table_init(float *dithertable);
|
||||
|
||||
#endif
|
119
ThirdParty/mpg123/include/mpg123/dither_impl.h
vendored
119
ThirdParty/mpg123/include/mpg123/dither_impl.h
vendored
|
@ -1,119 +0,0 @@
|
|||
/*
|
||||
dither: Generate shaped noise for dithering
|
||||
|
||||
copyright 2009 by the mpg123 project - free software under the terms of the LGPL 2.1
|
||||
see COPYING and AUTHORS files in distribution or http://mpg123.org
|
||||
initially written by Taihei Monma
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "compat.h"
|
||||
#include "dither.h"
|
||||
|
||||
static const uint32_t init_seed = 2463534242UL;
|
||||
|
||||
#define LAP 100
|
||||
|
||||
/*
|
||||
xorshift random number generator, with output scaling to [-0.5, 0.5]
|
||||
This is the white noise...
|
||||
See http://www.jstatsoft.org/v08/i14/paper on XOR shift random number generators.
|
||||
*/
|
||||
static float rand_xorshift32(uint32_t *seed)
|
||||
{
|
||||
union
|
||||
{
|
||||
uint32_t i;
|
||||
float f;
|
||||
} fi;
|
||||
|
||||
fi.i = *seed;
|
||||
fi.i ^= (fi.i<<13);
|
||||
fi.i ^= (fi.i>>17);
|
||||
fi.i ^= (fi.i<<5);
|
||||
*seed = fi.i;
|
||||
|
||||
/* scale the number to [-0.5, 0.5] */
|
||||
#ifdef IEEE_FLOAT
|
||||
fi.i = (fi.i>>9)|0x3f800000;
|
||||
fi.f -= 1.5f;
|
||||
#else
|
||||
fi.f = (double)fi.i / 4294967295.0;
|
||||
fi.f -= 0.5f;
|
||||
#endif
|
||||
return fi.f;
|
||||
}
|
||||
|
||||
static void white_noise(float *table, size_t count)
|
||||
{
|
||||
size_t i;
|
||||
uint32_t seed = init_seed;
|
||||
|
||||
for(i=0; i<count; ++i)
|
||||
table[i] = rand_xorshift32(&seed);
|
||||
}
|
||||
|
||||
static void tpdf_noise(float *table, size_t count)
|
||||
{
|
||||
size_t i;
|
||||
uint32_t seed = init_seed;
|
||||
|
||||
for(i=0; i<count; ++i)
|
||||
table[i] = rand_xorshift32(&seed) + rand_xorshift32(&seed);
|
||||
}
|
||||
|
||||
static void highpass_tpdf_noise(float *table, size_t count)
|
||||
{
|
||||
size_t i;
|
||||
uint32_t seed = init_seed;
|
||||
/* Ensure some minimum lap for keeping the high-pass filter circular. */
|
||||
size_t lap = count > 2*LAP ? LAP : count/2;
|
||||
|
||||
float input_noise;
|
||||
float xv[9], yv[9];
|
||||
|
||||
for(i=0;i<9;i++)
|
||||
{
|
||||
xv[i] = yv[i] = 0.0f;
|
||||
}
|
||||
|
||||
for(i=0;i<count+lap;i++)
|
||||
{
|
||||
if(i==count) seed=init_seed;
|
||||
|
||||
/* generate and add 2 random numbers, to make a TPDF noise distribution */
|
||||
input_noise = rand_xorshift32(&seed) + rand_xorshift32(&seed);
|
||||
|
||||
/* apply 8th order Chebyshev high-pass IIR filter */
|
||||
/* Coefficients are from http://www-users.cs.york.ac.uk/~fisher/mkfilter/trad.html
|
||||
Given parameters are: Chebyshev, Highpass, ripple=-1, order=8, samplerate=44100, corner1=19000 */
|
||||
xv[0] = xv[1]; xv[1] = xv[2]; xv[2] = xv[3]; xv[3] = xv[4]; xv[4] = xv[5]; xv[5] = xv[6]; xv[6] = xv[7]; xv[7] = xv[8];
|
||||
xv[8] = input_noise / 1.382814179e+07;
|
||||
yv[0] = yv[1]; yv[1] = yv[2]; yv[2] = yv[3]; yv[3] = yv[4]; yv[4] = yv[5]; yv[5] = yv[6]; yv[6] = yv[7]; yv[7] = yv[8];
|
||||
yv[8] = (xv[0] + xv[8]) - 8 * (xv[1] + xv[7]) + 28 * (xv[2] + xv[6])
|
||||
- 56 * (xv[3] + xv[5]) + 70 * xv[4]
|
||||
+ ( -0.6706204984 * yv[0]) + ( -5.3720827038 * yv[1])
|
||||
+ (-19.0865382480 * yv[2]) + (-39.2831607860 * yv[3])
|
||||
+ (-51.2308985070 * yv[4]) + (-43.3590135780 * yv[5])
|
||||
+ (-23.2632305320 * yv[6]) + ( -7.2370122050 * yv[7]);
|
||||
if(i>=lap) table[i-lap] = yv[8] * 3.0f;
|
||||
}
|
||||
}
|
||||
|
||||
void mpg123_noise(float* table, size_t count, enum mpg123_noise_type noisetype)
|
||||
{
|
||||
switch(noisetype)
|
||||
{
|
||||
case mpg123_white_noise: white_noise(table, count); break;
|
||||
case mpg123_tpdf_noise: tpdf_noise(table, count); break;
|
||||
case mpg123_highpass_tpdf_noise:
|
||||
highpass_tpdf_noise(table, count);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Generate white noise and shape it with a high pass filter. */
|
||||
void dither_table_init(float *dithertable)
|
||||
{
|
||||
highpass_tpdf_noise(dithertable, DITHERSIZE);
|
||||
}
|
431
ThirdParty/mpg123/include/mpg123/frame.h
vendored
431
ThirdParty/mpg123/include/mpg123/frame.h
vendored
|
@ -1,431 +0,0 @@
|
|||
/*
|
||||
frame: Central data structures and opmitization hooks.
|
||||
|
||||
copyright 2007 by the mpg123 project - free software under the terms of the LGPL 2.1
|
||||
see COPYING and AUTHORS files in distribution or http://mpg123.org
|
||||
initially written by Thomas Orgis
|
||||
*/
|
||||
|
||||
#ifndef MPG123_FRAME_H
|
||||
#define MPG123_FRAME_H
|
||||
|
||||
#include <stdio.h>
|
||||
#include "config.h"
|
||||
#include "mpg123.h"
|
||||
#include "optimize.h"
|
||||
#include "getcpuflags.h"
|
||||
#include "id3.h"
|
||||
#include "icy.h"
|
||||
#include "reader.h"
|
||||
#ifdef FRAME_INDEX
|
||||
#include "index.h"
|
||||
#endif
|
||||
#include "synths.h"
|
||||
|
||||
#ifdef OPT_DITHER
|
||||
#include "dither.h"
|
||||
int frame_dither_init(mpg123_handle *fr);
|
||||
#endif
|
||||
|
||||
/* max = 1728 */
|
||||
#define MAXFRAMESIZE 3456
|
||||
|
||||
struct al_table
|
||||
{
|
||||
short bits;
|
||||
short d;
|
||||
};
|
||||
|
||||
/* the output buffer, used to be pcm_sample, pcm_point and audiobufsize */
|
||||
struct outbuffer
|
||||
{
|
||||
unsigned char *data; /* main data pointer, aligned */
|
||||
unsigned char *p; /* read pointer */
|
||||
size_t fill; /* fill from read pointer */
|
||||
size_t size;
|
||||
unsigned char *rdata; /* unaligned base pointer */
|
||||
};
|
||||
|
||||
struct audioformat
|
||||
{
|
||||
int encoding; /* Final encoding, after post-processing. */
|
||||
int encsize; /* Size of one sample in bytes, plain int should be fine here... */
|
||||
int dec_enc; /* Encoding of decoder synth. */
|
||||
int dec_encsize; /* Size of one decoder sample. */
|
||||
int channels;
|
||||
long rate;
|
||||
};
|
||||
|
||||
void invalidate_format(struct audioformat *af);
|
||||
|
||||
struct mpg123_pars_struct
|
||||
{
|
||||
int verbose; /* verbose level */
|
||||
long flags; /* combination of above */
|
||||
#ifndef NO_NTOM
|
||||
long force_rate;
|
||||
#endif
|
||||
int down_sample;
|
||||
int rva; /* (which) rva to do: 0: nothing, 1: radio/mix/track 2: album/audiophile */
|
||||
long halfspeed;
|
||||
long doublespeed;
|
||||
long timeout;
|
||||
#define NUM_CHANNELS 2
|
||||
char audio_caps[NUM_CHANNELS][MPG123_RATES+1][MPG123_ENCODINGS];
|
||||
/* long start_frame; */ /* frame offset to begin with */
|
||||
/* long frame_number;*/ /* number of frames to decode */
|
||||
#ifndef NO_ICY
|
||||
long icy_interval;
|
||||
#endif
|
||||
double outscale;
|
||||
long resync_limit;
|
||||
long index_size; /* Long, because: negative values have a meaning. */
|
||||
long preframes;
|
||||
#ifndef NO_FEEDER
|
||||
long feedpool;
|
||||
long feedbuffer;
|
||||
#endif
|
||||
long freeformat_framesize;
|
||||
};
|
||||
|
||||
enum frame_state_flags
|
||||
{
|
||||
FRAME_ACCURATE = 0x1 /**< 0001 Positions are considered accurate. */
|
||||
,FRAME_FRANKENSTEIN = 0x2 /**< 0010 This stream is concatenated. */
|
||||
,FRAME_FRESH_DECODER = 0x4 /**< 0100 Decoder is fleshly initialized. */
|
||||
,FRAME_DECODER_LIVE = 0x8 /**< 1000 Decoder can be used. */
|
||||
};
|
||||
|
||||
/* There is a lot to condense here... many ints can be merged as flags; though the main space is still consumed by buffers. */
|
||||
struct mpg123_handle_struct
|
||||
{
|
||||
int fresh; /* to be moved into flags */
|
||||
int new_format;
|
||||
real hybrid_block[2][2][SBLIMIT*SSLIMIT];
|
||||
int hybrid_blc[2];
|
||||
/* the scratch vars for the decoders, sometimes real, sometimes short... sometimes int/long */
|
||||
short *short_buffs[2][2];
|
||||
real *real_buffs[2][2];
|
||||
unsigned char *rawbuffs;
|
||||
int rawbuffss;
|
||||
#ifdef OPT_I486
|
||||
int i486bo[2];
|
||||
#endif
|
||||
int bo; /* Just have it always here. */
|
||||
#ifdef OPT_DITHER
|
||||
int ditherindex;
|
||||
float *dithernoise;
|
||||
#endif
|
||||
unsigned char* rawdecwin; /* the block with all decwins */
|
||||
int rawdecwins; /* size of rawdecwin memory */
|
||||
real *decwin; /* _the_ decode table */
|
||||
#ifdef OPT_MMXORSSE
|
||||
/* I am not really sure that I need both of them... used in assembler */
|
||||
float *decwin_mmx;
|
||||
float *decwins;
|
||||
#endif
|
||||
#ifndef NO_EQUALIZER
|
||||
int have_eq_settings;
|
||||
real equalizer[2][32];
|
||||
#endif
|
||||
/* for halfspeed mode */
|
||||
unsigned char ssave[34];
|
||||
int halfphase;
|
||||
#ifndef NO_8BIT
|
||||
/* a raw buffer and a pointer into the middle for signed short conversion, only allocated on demand */
|
||||
unsigned char *conv16to8_buf;
|
||||
unsigned char *conv16to8;
|
||||
#endif
|
||||
/* There's some possible memory saving for stuff that is not _really_ dynamic. */
|
||||
|
||||
/* layer3 */
|
||||
int longLimit[9][23];
|
||||
int shortLimit[9][14];
|
||||
#ifdef REAL_IS_FIXED
|
||||
const real *gainpow2; // Actually static storage elsewhere.
|
||||
#else
|
||||
real gainpow2[256+118+4]; /* not really dynamic, just different for mmx */
|
||||
#endif
|
||||
/* layer2 */
|
||||
real muls[27][64]; /* also used by layer 1 */
|
||||
|
||||
#ifndef NO_NTOM
|
||||
/* decode_ntom */
|
||||
unsigned long ntom_val[2];
|
||||
unsigned long ntom_step;
|
||||
#endif
|
||||
/* special i486 fun */
|
||||
#ifdef OPT_I486
|
||||
int *int_buffs[2][2];
|
||||
#endif
|
||||
/* special altivec... */
|
||||
#ifdef OPT_ALTIVEC
|
||||
real *areal_buffs[4][4];
|
||||
#endif
|
||||
struct synth_s synths;
|
||||
struct
|
||||
{
|
||||
#ifdef OPT_MULTI
|
||||
|
||||
#ifndef NO_LAYER3
|
||||
#if (defined OPT_3DNOW_VINTAGE || defined OPT_3DNOWEXT_VINTAGE || defined OPT_SSE || defined OPT_X86_64 || defined OPT_AVX || defined OPT_NEON || defined OPT_NEON64)
|
||||
void (*the_dct36)(real *,real *,real *,const real *,real *);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
enum optdec type;
|
||||
enum optcla class;
|
||||
} cpu_opts;
|
||||
#ifdef OPT_CPU_FLAGS
|
||||
struct cpuflags cpu_flags;
|
||||
#endif
|
||||
int verbose; /* 0: nothing, 1: just print chosen decoder, 2: be verbose */
|
||||
|
||||
const struct al_table *alloc;
|
||||
/* The runtime-chosen decoding, based on input and output format. */
|
||||
func_synth synth;
|
||||
func_synth_stereo synth_stereo;
|
||||
func_synth_mono synth_mono;
|
||||
/* Yes, this function is runtime-switched, too. */
|
||||
void (*make_decode_tables)(mpg123_handle *fr); /* That is the volume control. */
|
||||
|
||||
int stereo; /* I _think_ 1 for mono and 2 for stereo */
|
||||
int jsbound;
|
||||
#define SINGLE_STEREO -1
|
||||
#define SINGLE_LEFT 0
|
||||
#define SINGLE_RIGHT 1
|
||||
#define SINGLE_MIX 3
|
||||
int single;
|
||||
int II_sblimit;
|
||||
int down_sample_sblimit;
|
||||
int lsf; /* 0: MPEG 1.0; 1: MPEG 2.0/2.5 -- both used as bool and array index! */
|
||||
/* Many flags in disguise as integers... wasting bytes. */
|
||||
int mpeg25;
|
||||
int down_sample;
|
||||
int header_change;
|
||||
int lay;
|
||||
long spf; /* cached count of samples per frame */
|
||||
int (*do_layer)(mpg123_handle *);
|
||||
int error_protection;
|
||||
int bitrate_index;
|
||||
int sampling_frequency;
|
||||
int padding;
|
||||
int extension;
|
||||
int mode;
|
||||
int mode_ext;
|
||||
int copyright;
|
||||
int original;
|
||||
int emphasis;
|
||||
int framesize; /* computed framesize */
|
||||
int freesize; /* free format frame size */
|
||||
enum mpg123_vbr vbr; /* 1 if variable bitrate was detected */
|
||||
off_t num; /* frame offset ... */
|
||||
off_t input_offset; /* byte offset of this frame in input stream */
|
||||
off_t playnum; /* playback offset... includes repetitions, reset at seeks */
|
||||
off_t audio_start; /* The byte offset in the file where audio data begins. */
|
||||
int state_flags;
|
||||
char silent_resync; /* Do not complain for the next n resyncs. */
|
||||
unsigned char* xing_toc; /* The seek TOC from Xing header. */
|
||||
int freeformat;
|
||||
long freeformat_framesize;
|
||||
|
||||
/* bitstream info; bsi */
|
||||
int bitindex;
|
||||
long bits_avail;
|
||||
unsigned char *wordpointer;
|
||||
/* temporary storage for getbits stuff */
|
||||
unsigned long ultmp;
|
||||
unsigned char uctmp;
|
||||
|
||||
/* rva data, used in common.c, set in id3.c */
|
||||
|
||||
double maxoutburst; /* The maximum amplitude in current sample represenation. */
|
||||
double lastscale;
|
||||
struct
|
||||
{
|
||||
int level[2];
|
||||
float gain[2];
|
||||
float peak[2];
|
||||
} rva;
|
||||
|
||||
/* input data */
|
||||
off_t track_frames;
|
||||
off_t track_samples;
|
||||
double mean_framesize;
|
||||
off_t mean_frames;
|
||||
int fsizeold;
|
||||
int ssize;
|
||||
unsigned int bitreservoir;
|
||||
unsigned char bsspace[2][MAXFRAMESIZE+512+4]; /* MAXFRAMESIZE */
|
||||
unsigned char *bsbuf;
|
||||
unsigned char *bsbufold;
|
||||
int bsnum;
|
||||
/* That is the header matching the last read frame body. */
|
||||
unsigned long oldhead;
|
||||
/* That is the header that is supposedly the first of the stream. */
|
||||
unsigned long firsthead;
|
||||
int abr_rate;
|
||||
#ifdef FRAME_INDEX
|
||||
struct frame_index index;
|
||||
#endif
|
||||
|
||||
/* output data */
|
||||
struct outbuffer buffer;
|
||||
struct audioformat af;
|
||||
int own_buffer;
|
||||
size_t outblock; /* number of bytes that this frame produces (upper bound) */
|
||||
int to_decode; /* this frame holds data to be decoded */
|
||||
int to_ignore; /* the same, somehow */
|
||||
off_t firstframe; /* start decoding from here */
|
||||
off_t lastframe; /* last frame to decode (for gapless or num_frames limit) */
|
||||
off_t ignoreframe; /* frames to decode but discard before firstframe */
|
||||
#ifdef GAPLESS
|
||||
off_t gapless_frames; /* frame count for the gapless part */
|
||||
off_t firstoff; /* number of samples to ignore from firstframe */
|
||||
off_t lastoff; /* number of samples to use from lastframe */
|
||||
off_t begin_s; /* overall begin offset in samples */
|
||||
off_t begin_os;
|
||||
off_t end_s; /* overall end offset in samples */
|
||||
off_t end_os;
|
||||
off_t fullend_os; /* gapless_frames translated to output samples */
|
||||
#endif
|
||||
unsigned int crc; /* Well, I need a safe 16bit type, actually. But wider doesn't hurt. */
|
||||
struct reader *rd; /* pointer to the reading functions */
|
||||
struct reader_data rdat; /* reader data and state info */
|
||||
struct mpg123_pars_struct p;
|
||||
int err;
|
||||
int decoder_change;
|
||||
int delayed_change;
|
||||
long clip;
|
||||
/* the meta crap */
|
||||
int metaflags;
|
||||
unsigned char id3buf[128];
|
||||
#ifndef NO_ID3V2
|
||||
mpg123_id3v2 id3v2;
|
||||
#endif
|
||||
unsigned char *id3v2_raw;
|
||||
size_t id3v2_size;
|
||||
#ifndef NO_ICY
|
||||
struct icy_meta icy;
|
||||
#endif
|
||||
/*
|
||||
More variables needed for decoders, layerX.c.
|
||||
This time it is not about static variables but about the need for alignment which cannot be guaranteed on the stack by certain compilers (Sun Studio).
|
||||
We do not require the compiler to align stuff for our hand-written assembly. We only hope that it's able to align stuff for SSE and similar ops it generates itself.
|
||||
*/
|
||||
/*
|
||||
Those layer-specific structs could actually share memory, as they are not in use simultaneously. One might allocate on decoder switch, too.
|
||||
They all reside in one lump of memory (after each other), allocated to layerscratch.
|
||||
*/
|
||||
real *layerscratch;
|
||||
#ifndef NO_LAYER1
|
||||
struct
|
||||
{
|
||||
real (*fraction)[SBLIMIT]; /* ALIGNED(16) real fraction[2][SBLIMIT]; */
|
||||
} layer1;
|
||||
#endif
|
||||
#ifndef NO_LAYER2
|
||||
struct
|
||||
{
|
||||
real (*fraction)[4][SBLIMIT]; /* ALIGNED(16) real fraction[2][4][SBLIMIT] */
|
||||
} layer2;
|
||||
#endif
|
||||
#ifndef NO_LAYER3
|
||||
/* These are significant chunks of memory already... */
|
||||
struct
|
||||
{
|
||||
real (*hybrid_in)[SBLIMIT][SSLIMIT]; /* ALIGNED(16) real hybridIn[2][SBLIMIT][SSLIMIT]; */
|
||||
real (*hybrid_out)[SSLIMIT][SBLIMIT]; /* ALIGNED(16) real hybridOut[2][SSLIMIT][SBLIMIT]; */
|
||||
} layer3;
|
||||
#endif
|
||||
/* A place for storing additional data for the large file wrapper.
|
||||
This is cruft! */
|
||||
void *wrapperdata;
|
||||
/* A callback used to properly destruct the wrapper data. */
|
||||
void (*wrapperclean)(void*);
|
||||
int enc_delay;
|
||||
int enc_padding;
|
||||
#ifndef NO_MOREINFO
|
||||
struct mpg123_moreinfo *pinfo;
|
||||
#endif
|
||||
};
|
||||
|
||||
/* generic init, does not include dynamic buffers */
|
||||
void frame_init(mpg123_handle *fr);
|
||||
void frame_init_par(mpg123_handle *fr, mpg123_pars *mp);
|
||||
/* output buffer and format */
|
||||
int frame_outbuffer(mpg123_handle *fr);
|
||||
int frame_output_format(mpg123_handle *fr);
|
||||
|
||||
int frame_buffers(mpg123_handle *fr); /* various decoder buffers, needed once */
|
||||
int frame_reset(mpg123_handle* fr); /* reset for next track */
|
||||
int frame_buffers_reset(mpg123_handle *fr);
|
||||
void frame_exit(mpg123_handle *fr); /* end, free all buffers */
|
||||
|
||||
/* Index functions... */
|
||||
/* Well... print it... */
|
||||
int mpg123_print_index(mpg123_handle *fr, FILE* out);
|
||||
/* Find a seek position in index. */
|
||||
off_t frame_index_find(mpg123_handle *fr, off_t want_frame, off_t* get_frame);
|
||||
/* Apply index_size setting. */
|
||||
int frame_index_setup(mpg123_handle *fr);
|
||||
|
||||
void do_volume(mpg123_handle *fr, double factor);
|
||||
void do_rva(mpg123_handle *fr);
|
||||
|
||||
/* samples per frame ...
|
||||
Layer I
|
||||
Layer II
|
||||
Layer III
|
||||
MPEG-1
|
||||
384
|
||||
1152
|
||||
1152
|
||||
MPEG-2 LSF
|
||||
384
|
||||
1152
|
||||
576
|
||||
MPEG 2.5
|
||||
384
|
||||
1152
|
||||
576
|
||||
*/
|
||||
|
||||
// Well, I take that one for granted... at least layer3.
|
||||
// The value is needed for mpg123_getstate() in any build.
|
||||
#define GAPLESS_DELAY 529
|
||||
#ifdef GAPLESS
|
||||
void frame_gapless_init(mpg123_handle *fr, off_t framecount, off_t bskip, off_t eskip);
|
||||
void frame_gapless_realinit(mpg123_handle *fr);
|
||||
void frame_gapless_update(mpg123_handle *mh, off_t total_samples);
|
||||
/*void frame_gapless_position(mpg123_handle* fr);
|
||||
void frame_gapless_bytify(mpg123_handle *fr);
|
||||
void frame_gapless_ignore(mpg123_handle *fr, off_t frames);*/
|
||||
/* void frame_gapless_buffercheck(mpg123_handle *fr); */
|
||||
#endif
|
||||
|
||||
/* Number of samples the decoding of the current frame should yield. */
|
||||
off_t frame_expect_outsamples(mpg123_handle *fr);
|
||||
|
||||
/* Skip this frame... do some fake action to get away without actually decoding it. */
|
||||
void frame_skip(mpg123_handle *fr);
|
||||
|
||||
/*
|
||||
Seeking core functions:
|
||||
- convert input sample offset to output sample offset
|
||||
- convert frame offset to output sample offset
|
||||
- get leading frame offset for output sample offset
|
||||
The offsets are "unadjusted"/internal; resampling is being taken care of.
|
||||
*/
|
||||
off_t frame_ins2outs(mpg123_handle *fr, off_t ins);
|
||||
off_t frame_outs(mpg123_handle *fr, off_t num);
|
||||
/* This one just computes the expected sample count for _this_ frame. */
|
||||
off_t frame_expect_outsampels(mpg123_handle *fr);
|
||||
off_t frame_offset(mpg123_handle *fr, off_t outs);
|
||||
void frame_set_frameseek(mpg123_handle *fr, off_t fe);
|
||||
void frame_set_seek(mpg123_handle *fr, off_t sp);
|
||||
off_t frame_tell_seek(mpg123_handle *fr);
|
||||
/* Take a copy of the Xing VBR TOC for fuzzy seeking. */
|
||||
int frame_fill_toc(mpg123_handle *fr, unsigned char* in);
|
||||
#endif
|
119
ThirdParty/mpg123/include/mpg123/gapless.h
vendored
119
ThirdParty/mpg123/include/mpg123/gapless.h
vendored
|
@ -1,119 +0,0 @@
|
|||
/*
|
||||
sampleadjust: gapless sample offset math
|
||||
|
||||
copyright 1995-2012 by the mpg123 project - free software under the terms of the LGPL 2.1
|
||||
see COPYING and AUTHORS files in distribution or http://mpg123.org
|
||||
|
||||
This is no stand-alone header, precisely to be able to fool it into using fake handle types for testing the math.
|
||||
*/
|
||||
|
||||
#include "debug.h"
|
||||
|
||||
#ifdef GAPLESS
|
||||
/* From internal sample number to external. */
|
||||
static off_t sample_adjust(mpg123_handle *mh, off_t x)
|
||||
{
|
||||
off_t s;
|
||||
if(mh->p.flags & MPG123_GAPLESS)
|
||||
{
|
||||
/* It's a bit tricky to do this computation for the padding samples.
|
||||
They are not there on the outside. */
|
||||
if(x > mh->end_os)
|
||||
{
|
||||
if(x < mh->fullend_os)
|
||||
s = mh->end_os - mh->begin_os;
|
||||
else
|
||||
s = x - (mh->fullend_os - mh->end_os + mh->begin_os);
|
||||
}
|
||||
else
|
||||
s = x - mh->begin_os;
|
||||
}
|
||||
else
|
||||
s = x;
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
/* from external samples to internal */
|
||||
static off_t sample_unadjust(mpg123_handle *mh, off_t x)
|
||||
{
|
||||
off_t s;
|
||||
if(mh->p.flags & MPG123_GAPLESS)
|
||||
{
|
||||
s = x + mh->begin_os;
|
||||
/* There is a hole; we don't create sample positions in there.
|
||||
Jump from the end of the gapless track directly to after the padding. */
|
||||
if(s >= mh->end_os)
|
||||
s += mh->fullend_os - mh->end_os;
|
||||
}
|
||||
else s = x;
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
/*
|
||||
Take the buffer after a frame decode (strictly: it is the data from frame fr->num!) and cut samples out.
|
||||
fr->buffer.fill may then be smaller than before...
|
||||
*/
|
||||
static void frame_buffercheck(mpg123_handle *fr)
|
||||
{
|
||||
/* When we have no accurate position, gapless code does not make sense. */
|
||||
if(!(fr->state_flags & FRAME_ACCURATE)) return;
|
||||
|
||||
/* Get a grip on dirty streams that start with a gapless header.
|
||||
Simply accept all data from frames that are too much,
|
||||
they are supposedly attached to the stream after the fact. */
|
||||
if(fr->gapless_frames > 0 && fr->num >= fr->gapless_frames) return;
|
||||
|
||||
/* Important: We first cut samples from the end, then cut from beginning (including left-shift of the buffer).
|
||||
This order works also for the case where firstframe == lastframe. */
|
||||
|
||||
/* The last interesting (planned) frame: Only use some leading samples.
|
||||
Note a difference from the below: The last frame and offset are unchanges by seeks.
|
||||
The lastoff keeps being valid. */
|
||||
if(fr->lastframe > -1 && fr->num >= fr->lastframe)
|
||||
{
|
||||
/* There can be more than one frame of padding at the end, so we ignore the whole frame if we are beyond lastframe. */
|
||||
off_t byteoff = (fr->num == fr->lastframe) ? samples_to_bytes(fr, fr->lastoff) : 0;
|
||||
if((off_t)fr->buffer.fill > byteoff)
|
||||
{
|
||||
fr->buffer.fill = byteoff;
|
||||
}
|
||||
if(VERBOSE3) fprintf(stderr, "\nNote: Cut frame %"OFF_P" buffer on end of stream to %"OFF_P" samples, fill now %"SIZE_P" bytes.\n", (off_p)fr->num, (off_p)(fr->num == fr->lastframe ? fr->lastoff : 0), (size_p)fr->buffer.fill);
|
||||
}
|
||||
|
||||
/* The first interesting frame: Skip some leading samples. */
|
||||
if(fr->firstoff && fr->num == fr->firstframe)
|
||||
{
|
||||
off_t byteoff = samples_to_bytes(fr, fr->firstoff);
|
||||
if((off_t)fr->buffer.fill > byteoff)
|
||||
{
|
||||
fr->buffer.fill -= byteoff;
|
||||
/* buffer.p != buffer.data only for own buffer */
|
||||
debug6("cutting %li samples/%li bytes on begin, own_buffer=%i at %p=%p, buf[1]=%i",
|
||||
(long)fr->firstoff, (long)byteoff, fr->own_buffer, (void*)fr->buffer.p, (void*)fr->buffer.data, ((short*)fr->buffer.p)[2]);
|
||||
if(fr->own_buffer) fr->buffer.p = fr->buffer.data + byteoff;
|
||||
else memmove(fr->buffer.data, fr->buffer.data + byteoff, fr->buffer.fill);
|
||||
debug3("done cutting, buffer at %p =? %p, buf[1]=%i",
|
||||
(void*)fr->buffer.p, (void*)fr->buffer.data, ((short*)fr->buffer.p)[2]);
|
||||
}
|
||||
else fr->buffer.fill = 0;
|
||||
|
||||
if(VERBOSE3) fprintf(stderr, "\nNote: Cut frame %"OFF_P" buffer on beginning of stream by %"OFF_P" samples, fill now %"SIZE_P" bytes.\n", (off_p)fr->num, (off_p)fr->firstoff, (size_p)fr->buffer.fill);
|
||||
/* We can only reach this frame again by seeking. And on seeking, firstoff will be recomputed.
|
||||
So it is safe to null it here (and it makes the if() decision abort earlier). */
|
||||
fr->firstoff = 0;
|
||||
}
|
||||
}
|
||||
|
||||
#define SAMPLE_ADJUST(mh,x) sample_adjust(mh,x)
|
||||
#define SAMPLE_UNADJUST(mh,x) sample_unadjust(mh,x)
|
||||
#define FRAME_BUFFERCHECK(mh) frame_buffercheck(mh)
|
||||
|
||||
#else /* no gapless code included */
|
||||
|
||||
#define SAMPLE_ADJUST(mh,x) (x)
|
||||
#define SAMPLE_UNADJUST(mh,x) (x)
|
||||
#define FRAME_BUFFERCHECK(mh)
|
||||
|
||||
#endif
|
103
ThirdParty/mpg123/include/mpg123/getbits.h
vendored
103
ThirdParty/mpg123/include/mpg123/getbits.h
vendored
|
@ -1,103 +0,0 @@
|
|||
/*
|
||||
getbits
|
||||
|
||||
copyright ?-2009 by the mpg123 project - free software under the terms of the LGPL 2.1
|
||||
see COPYING and AUTHORS files in distribution or http://mpg123.org
|
||||
initially written by Michael Hipp
|
||||
|
||||
All code is in the header to suggest/force inlining of these small often-used functions.
|
||||
This indeed has some impact on performance.
|
||||
*/
|
||||
|
||||
#ifndef _MPG123_GETBITS_H_
|
||||
#define _MPG123_GETBITS_H_
|
||||
|
||||
#include "mpg123lib_intern.h"
|
||||
#include "debug.h"
|
||||
|
||||
#define backbits(fr,nob) ((void)( \
|
||||
fr->bits_avail += nob, \
|
||||
fr->bitindex -= nob, \
|
||||
fr->wordpointer += (fr->bitindex>>3), \
|
||||
fr->bitindex &= 0x7 ))
|
||||
|
||||
#define getbitoffset(fr) ((-fr->bitindex)&0x7)
|
||||
/* Precomputing the bytes to be read is error-prone, and some over-read
|
||||
is even expected for Huffman. Just play safe and return zeros in case
|
||||
of overflow. This assumes you made bitindex zero already! */
|
||||
#define getbyte(fr) ( (fr)->bits_avail-=8, (fr)->bits_avail >= 0 \
|
||||
? *((fr)->wordpointer++) \
|
||||
: 0 )
|
||||
|
||||
static unsigned int getbits(mpg123_handle *fr, int number_of_bits)
|
||||
{
|
||||
unsigned long rval;
|
||||
|
||||
#ifdef DEBUG_GETBITS
|
||||
fprintf(stderr,"g%d",number_of_bits);
|
||||
#endif
|
||||
fr->bits_avail -= number_of_bits;
|
||||
/* Safety catch until we got the nasty code fully figured out. */
|
||||
/* No, that catch stays here, even if we think we got it figured out! */
|
||||
if(fr->bits_avail < 0)
|
||||
{
|
||||
if(NOQUIET)
|
||||
error2( "Tried to read %i bits with %li available."
|
||||
, number_of_bits, fr->bits_avail );
|
||||
return 0;
|
||||
}
|
||||
/* This is actually slow: if(!number_of_bits)
|
||||
return 0; */
|
||||
|
||||
#if 0
|
||||
check_buffer_range(number_of_bits+fr->bitindex);
|
||||
#endif
|
||||
|
||||
{
|
||||
rval = fr->wordpointer[0];
|
||||
rval <<= 8;
|
||||
rval |= fr->wordpointer[1];
|
||||
rval <<= 8;
|
||||
rval |= fr->wordpointer[2];
|
||||
|
||||
rval <<= fr->bitindex;
|
||||
rval &= 0xffffff;
|
||||
|
||||
fr->bitindex += number_of_bits;
|
||||
|
||||
rval >>= (24-number_of_bits);
|
||||
|
||||
fr->wordpointer += (fr->bitindex>>3);
|
||||
fr->bitindex &= 7;
|
||||
}
|
||||
|
||||
#ifdef DEBUG_GETBITS
|
||||
fprintf(stderr,":%lx\n",rval);
|
||||
#endif
|
||||
|
||||
return rval;
|
||||
}
|
||||
|
||||
|
||||
#define skipbits(fr, nob) fr->ultmp = ( \
|
||||
fr->ultmp = fr->wordpointer[0], fr->ultmp <<= 8, fr->ultmp |= fr->wordpointer[1], \
|
||||
fr->ultmp <<= 8, fr->ultmp |= fr->wordpointer[2], fr->ultmp <<= fr->bitindex, \
|
||||
fr->ultmp &= 0xffffff, fr->bitindex += nob, fr->bits_avail -= nob, \
|
||||
fr->ultmp >>= (24-nob), fr->wordpointer += (fr->bitindex>>3), \
|
||||
fr->bitindex &= 7 )
|
||||
|
||||
#define getbits_fast(fr, nob) ( \
|
||||
fr->ultmp = (unsigned char) (fr->wordpointer[0] << fr->bitindex), \
|
||||
fr->ultmp |= ((unsigned long) fr->wordpointer[1]<<fr->bitindex)>>8, \
|
||||
fr->ultmp <<= nob, fr->ultmp >>= 8, \
|
||||
fr->bitindex += nob, fr->bits_avail -= nob, \
|
||||
fr->wordpointer += (fr->bitindex>>3), \
|
||||
fr->bitindex &= 7, fr->ultmp )
|
||||
|
||||
#define get1bit(fr) ( \
|
||||
fr->uctmp = *fr->wordpointer << fr->bitindex, \
|
||||
++fr->bitindex, --fr->bits_avail, \
|
||||
fr->wordpointer += (fr->bitindex>>3), fr->bitindex &= 7, fr->uctmp>>7 )
|
||||
|
||||
|
||||
#endif
|
97
ThirdParty/mpg123/include/mpg123/getcpuflags.h
vendored
97
ThirdParty/mpg123/include/mpg123/getcpuflags.h
vendored
|
@ -1,97 +0,0 @@
|
|||
/*
|
||||
getcpucpuflags: get cpuflags for ia32
|
||||
|
||||
copyright ?-2007 by the mpg123 project - free software under the terms of the LGPL 2.1
|
||||
see COPYING and AUTHORS files in distribution or http:#mpg123.org
|
||||
initially written by KIMURA Takuhiro (for 3DNow!)
|
||||
extended for general use by Thomas Orgis
|
||||
*/
|
||||
|
||||
#ifndef MPG123_H_GETCPUFLAGS
|
||||
#define MPG123_H_GETCPUFLAGS
|
||||
|
||||
#include "config.h"
|
||||
|
||||
/* standard level flags part 1 (ECX)*/
|
||||
#define FLAG_SSE3 0x00000001
|
||||
#define FLAG_SSSE3 0x00000200
|
||||
#define FLAG_AVX 0x1C000000
|
||||
/* standard level flags part 2 (EDX) */
|
||||
#define FLAG2_MMX 0x00800000
|
||||
#define FLAG2_SSE 0x02000000
|
||||
#define FLAG2_SSE2 0x04000000
|
||||
#define FLAG2_FPU 0x00000001
|
||||
/* cpuid extended level 1 (AMD) */
|
||||
#define XFLAG_MMX 0x00800000
|
||||
#define XFLAG_3DNOW 0x80000000
|
||||
#define XFLAG_3DNOWEXT 0x40000000
|
||||
/* eXtended Control Register 0 */
|
||||
#define XCR0FLAG_AVX 0x00000006
|
||||
|
||||
|
||||
struct cpuflags
|
||||
{
|
||||
#if defined(OPT_ARM) || defined(OPT_NEON) || defined(OPT_NEON64)
|
||||
unsigned int has_neon;
|
||||
#else
|
||||
unsigned int id;
|
||||
unsigned int std;
|
||||
unsigned int std2;
|
||||
unsigned int ext;
|
||||
unsigned int xcr0_lo;
|
||||
#endif
|
||||
};
|
||||
|
||||
unsigned int getcpuflags(struct cpuflags* cf);
|
||||
|
||||
#ifdef WANT_GETCPUFLAGS
|
||||
#include <string.h>
|
||||
// Wrapper needed for ignorant clang memory sanitizer that chokes
|
||||
// because it does not know the assembly code intialized the vlaues.
|
||||
static unsigned int wrap_getcpuflags(struct cpuflags* cf)
|
||||
{
|
||||
memset(cf, 0, sizeof(*cf));
|
||||
return getcpuflags(cf);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if ((defined OPT_X86) || (defined OPT_X86_64) || (defined OPT_NEON) || (defined OPT_NEON64)) && (defined OPT_MULTI)
|
||||
|
||||
// We really evaluate the CPU flags.
|
||||
#define OPT_CPU_FLAGS
|
||||
|
||||
/* checks the family */
|
||||
#define cpu_i586(s) ( ((s.id & 0xf00)>>8) == 0 || ((s.id & 0xf00)>>8) > 4 )
|
||||
/* checking some flags... */
|
||||
#define cpu_fpu(s) (FLAG2_FPU & s.std2)
|
||||
#define cpu_mmx(s) (FLAG2_MMX & s.std2 || XFLAG_MMX & s.ext)
|
||||
#define cpu_3dnow(s) (XFLAG_3DNOW & s.ext)
|
||||
#define cpu_3dnowext(s) (XFLAG_3DNOWEXT & s.ext)
|
||||
#define cpu_sse(s) (FLAG2_SSE & s.std2)
|
||||
#define cpu_sse2(s) (FLAG2_SSE2 & s.std2)
|
||||
#define cpu_sse3(s) (FLAG_SSE3 & s.std)
|
||||
#define cpu_avx(s) ((FLAG_AVX & s.std) == FLAG_AVX && (XCR0FLAG_AVX & s.xcr0_lo) == XCR0FLAG_AVX)
|
||||
#define cpu_fast_sse(s) ((((s.id & 0xf00)>>8) == 6 && FLAG_SSSE3 & s.std) /* for Intel/VIA; family 6 CPUs with SSSE3 */ || \
|
||||
(((s.id & 0xf00)>>8) == 0xf && (((s.id & 0x0ff00000)>>20) > 0 && ((s.id & 0x0ff00000)>>20) != 5))) /* for AMD; family > 0xF CPUs except Bobcat */
|
||||
#define cpu_neon(s) (s.has_neon)
|
||||
|
||||
#else
|
||||
|
||||
/* Faking stuff for non-multi builds. The same code for synth function choice is used.
|
||||
Just no runtime dependency of result... */
|
||||
#define cpu_flags nothing
|
||||
#define cpu_i586(s) 1
|
||||
#define cpu_fpu(s) 1
|
||||
#define cpu_mmx(s) 1
|
||||
#define cpu_3dnow(s) 1
|
||||
#define cpu_3dnowext(s) 1
|
||||
#define cpu_sse(s) 1
|
||||
#define cpu_sse2(s) 1
|
||||
#define cpu_sse3(s) 1
|
||||
#define cpu_avx(s) 1
|
||||
#define cpu_neon(s) 1
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
340
ThirdParty/mpg123/include/mpg123/huffman.h
vendored
340
ThirdParty/mpg123/include/mpg123/huffman.h
vendored
|
@ -1,340 +0,0 @@
|
|||
/*
|
||||
huffman.h: huffman tables ... recalcualted to work with optimized decoder scheme (MH)
|
||||
|
||||
copyright ?-2006 by the mpg123 project - free software under the terms of the LGPL 2.1
|
||||
see COPYING and AUTHORS files in distribution or http://mpg123.org
|
||||
initially written by Michael Hipp
|
||||
|
||||
probably we could save a few bytes of memory, because the
|
||||
smaller tables are often the part of a bigger table
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _MPG123_HUFFMAN_H_
|
||||
#define _MPG123_HUFFMAN_H_
|
||||
|
||||
struct newhuff
|
||||
{
|
||||
unsigned int linbits;
|
||||
const short *table;
|
||||
};
|
||||
|
||||
static const short tab0[] =
|
||||
{
|
||||
0
|
||||
};
|
||||
|
||||
static const short tab1[] =
|
||||
{
|
||||
-5, -3, -1, 17, 1, 16, 0
|
||||
};
|
||||
|
||||
static const short tab2[] =
|
||||
{
|
||||
-15, -11, -9, -5, -3, -1, 34, 2, 18, -1, 33, 32, 17, -1, 1,
|
||||
16, 0
|
||||
};
|
||||
|
||||
static const short tab3[] =
|
||||
{
|
||||
-13, -11, -9, -5, -3, -1, 34, 2, 18, -1, 33, 32, 16, 17, -1,
|
||||
1, 0
|
||||
};
|
||||
|
||||
static const short tab5[] =
|
||||
{
|
||||
-29, -25, -23, -15, -7, -5, -3, -1, 51, 35, 50, 49, -3, -1, 19,
|
||||
3, -1, 48, 34, -3, -1, 18, 33, -1, 2, 32, 17, -1, 1, 16,
|
||||
0
|
||||
};
|
||||
|
||||
static const short tab6[] =
|
||||
{
|
||||
-25, -19, -13, -9, -5, -3, -1, 51, 3, 35, -1, 50, 48, -1, 19,
|
||||
49, -3, -1, 34, 2, 18, -3, -1, 33, 32, 1, -1, 17, -1, 16,
|
||||
0
|
||||
};
|
||||
|
||||
static const short tab7[] =
|
||||
{
|
||||
-69, -65, -57, -39, -29, -17, -11, -7, -3, -1, 85, 69, -1, 84, 83,
|
||||
-1, 53, 68, -3, -1, 37, 82, 21, -5, -1, 81, -1, 5, 52, -1,
|
||||
80, -1, 67, 51, -5, -3, -1, 36, 66, 20, -1, 65, 64, -11, -7,
|
||||
-3, -1, 4, 35, -1, 50, 3, -1, 19, 49, -3, -1, 48, 34, 18,
|
||||
-5, -1, 33, -1, 2, 32, 17, -1, 1, 16, 0
|
||||
};
|
||||
|
||||
static const short tab8[] =
|
||||
{
|
||||
-65, -63, -59, -45, -31, -19, -13, -7, -5, -3, -1, 85, 84, 69, 83,
|
||||
-3, -1, 53, 68, 37, -3, -1, 82, 5, 21, -5, -1, 81, -1, 52,
|
||||
67, -3, -1, 80, 51, 36, -5, -3, -1, 66, 20, 65, -3, -1, 4,
|
||||
64, -1, 35, 50, -9, -7, -3, -1, 19, 49, -1, 3, 48, 34, -1,
|
||||
2, 32, -1, 18, 33, 17, -3, -1, 1, 16, 0
|
||||
};
|
||||
|
||||
static const short tab9[] =
|
||||
{
|
||||
-63, -53, -41, -29, -19, -11, -5, -3, -1, 85, 69, 53, -1, 83, -1,
|
||||
84, 5, -3, -1, 68, 37, -1, 82, 21, -3, -1, 81, 52, -1, 67,
|
||||
-1, 80, 4, -7, -3, -1, 36, 66, -1, 51, 64, -1, 20, 65, -5,
|
||||
-3, -1, 35, 50, 19, -1, 49, -1, 3, 48, -5, -3, -1, 34, 2,
|
||||
18, -1, 33, 32, -3, -1, 17, 1, -1, 16, 0
|
||||
};
|
||||
|
||||
static const short tab10[] =
|
||||
{
|
||||
-125,-121,-111, -83, -55, -35, -21, -13, -7, -3, -1, 119, 103, -1, 118,
|
||||
87, -3, -1, 117, 102, 71, -3, -1, 116, 86, -1, 101, 55, -9, -3,
|
||||
-1, 115, 70, -3, -1, 85, 84, 99, -1, 39, 114, -11, -5, -3, -1,
|
||||
100, 7, 112, -1, 98, -1, 69, 53, -5, -1, 6, -1, 83, 68, 23,
|
||||
-17, -5, -1, 113, -1, 54, 38, -5, -3, -1, 37, 82, 21, -1, 81,
|
||||
-1, 52, 67, -3, -1, 22, 97, -1, 96, -1, 5, 80, -19, -11, -7,
|
||||
-3, -1, 36, 66, -1, 51, 4, -1, 20, 65, -3, -1, 64, 35, -1,
|
||||
50, 3, -3, -1, 19, 49, -1, 48, 34, -7, -3, -1, 18, 33, -1,
|
||||
2, 32, 17, -1, 1, 16, 0
|
||||
};
|
||||
|
||||
static const short tab11[] =
|
||||
{
|
||||
-121,-113, -89, -59, -43, -27, -17, -7, -3, -1, 119, 103, -1, 118, 117,
|
||||
-3, -1, 102, 71, -1, 116, -1, 87, 85, -5, -3, -1, 86, 101, 55,
|
||||
-1, 115, 70, -9, -7, -3, -1, 69, 84, -1, 53, 83, 39, -1, 114,
|
||||
-1, 100, 7, -5, -1, 113, -1, 23, 112, -3, -1, 54, 99, -1, 96,
|
||||
-1, 68, 37, -13, -7, -5, -3, -1, 82, 5, 21, 98, -3, -1, 38,
|
||||
6, 22, -5, -1, 97, -1, 81, 52, -5, -1, 80, -1, 67, 51, -1,
|
||||
36, 66, -15, -11, -7, -3, -1, 20, 65, -1, 4, 64, -1, 35, 50,
|
||||
-1, 19, 49, -5, -3, -1, 3, 48, 34, 33, -5, -1, 18, -1, 2,
|
||||
32, 17, -3, -1, 1, 16, 0
|
||||
};
|
||||
|
||||
static const short tab12[] =
|
||||
{
|
||||
-115, -99, -73, -45, -27, -17, -9, -5, -3, -1, 119, 103, 118, -1, 87,
|
||||
117, -3, -1, 102, 71, -1, 116, 101, -3, -1, 86, 55, -3, -1, 115,
|
||||
85, 39, -7, -3, -1, 114, 70, -1, 100, 23, -5, -1, 113, -1, 7,
|
||||
112, -1, 54, 99, -13, -9, -3, -1, 69, 84, -1, 68, -1, 6, 5,
|
||||
-1, 38, 98, -5, -1, 97, -1, 22, 96, -3, -1, 53, 83, -1, 37,
|
||||
82, -17, -7, -3, -1, 21, 81, -1, 52, 67, -5, -3, -1, 80, 4,
|
||||
36, -1, 66, 20, -3, -1, 51, 65, -1, 35, 50, -11, -7, -5, -3,
|
||||
-1, 64, 3, 48, 19, -1, 49, 34, -1, 18, 33, -7, -5, -3, -1,
|
||||
2, 32, 0, 17, -1, 1, 16
|
||||
};
|
||||
|
||||
static const short tab13[] =
|
||||
{
|
||||
-509,-503,-475,-405,-333,-265,-205,-153,-115, -83, -53, -35, -21, -13, -9,
|
||||
-7, -5, -3, -1, 254, 252, 253, 237, 255, -1, 239, 223, -3, -1, 238,
|
||||
207, -1, 222, 191, -9, -3, -1, 251, 206, -1, 220, -1, 175, 233, -1,
|
||||
236, 221, -9, -5, -3, -1, 250, 205, 190, -1, 235, 159, -3, -1, 249,
|
||||
234, -1, 189, 219, -17, -9, -3, -1, 143, 248, -1, 204, -1, 174, 158,
|
||||
-5, -1, 142, -1, 127, 126, 247, -5, -1, 218, -1, 173, 188, -3, -1,
|
||||
203, 246, 111, -15, -7, -3, -1, 232, 95, -1, 157, 217, -3, -1, 245,
|
||||
231, -1, 172, 187, -9, -3, -1, 79, 244, -3, -1, 202, 230, 243, -1,
|
||||
63, -1, 141, 216, -21, -9, -3, -1, 47, 242, -3, -1, 110, 156, 15,
|
||||
-5, -3, -1, 201, 94, 171, -3, -1, 125, 215, 78, -11, -5, -3, -1,
|
||||
200, 214, 62, -1, 185, -1, 155, 170, -1, 31, 241, -23, -13, -5, -1,
|
||||
240, -1, 186, 229, -3, -1, 228, 140, -1, 109, 227, -5, -1, 226, -1,
|
||||
46, 14, -1, 30, 225, -15, -7, -3, -1, 224, 93, -1, 213, 124, -3,
|
||||
-1, 199, 77, -1, 139, 184, -7, -3, -1, 212, 154, -1, 169, 108, -1,
|
||||
198, 61, -37, -21, -9, -5, -3, -1, 211, 123, 45, -1, 210, 29, -5,
|
||||
-1, 183, -1, 92, 197, -3, -1, 153, 122, 195, -7, -5, -3, -1, 167,
|
||||
151, 75, 209, -3, -1, 13, 208, -1, 138, 168, -11, -7, -3, -1, 76,
|
||||
196, -1, 107, 182, -1, 60, 44, -3, -1, 194, 91, -3, -1, 181, 137,
|
||||
28, -43, -23, -11, -5, -1, 193, -1, 152, 12, -1, 192, -1, 180, 106,
|
||||
-5, -3, -1, 166, 121, 59, -1, 179, -1, 136, 90, -11, -5, -1, 43,
|
||||
-1, 165, 105, -1, 164, -1, 120, 135, -5, -1, 148, -1, 119, 118, 178,
|
||||
-11, -3, -1, 27, 177, -3, -1, 11, 176, -1, 150, 74, -7, -3, -1,
|
||||
58, 163, -1, 89, 149, -1, 42, 162, -47, -23, -9, -3, -1, 26, 161,
|
||||
-3, -1, 10, 104, 160, -5, -3, -1, 134, 73, 147, -3, -1, 57, 88,
|
||||
-1, 133, 103, -9, -3, -1, 41, 146, -3, -1, 87, 117, 56, -5, -1,
|
||||
131, -1, 102, 71, -3, -1, 116, 86, -1, 101, 115, -11, -3, -1, 25,
|
||||
145, -3, -1, 9, 144, -1, 72, 132, -7, -5, -1, 114, -1, 70, 100,
|
||||
40, -1, 130, 24, -41, -27, -11, -5, -3, -1, 55, 39, 23, -1, 113,
|
||||
-1, 85, 7, -7, -3, -1, 112, 54, -1, 99, 69, -3, -1, 84, 38,
|
||||
-1, 98, 53, -5, -1, 129, -1, 8, 128, -3, -1, 22, 97, -1, 6,
|
||||
96, -13, -9, -5, -3, -1, 83, 68, 37, -1, 82, 5, -1, 21, 81,
|
||||
-7, -3, -1, 52, 67, -1, 80, 36, -3, -1, 66, 51, 20, -19, -11,
|
||||
-5, -1, 65, -1, 4, 64, -3, -1, 35, 50, 19, -3, -1, 49, 3,
|
||||
-1, 48, 34, -3, -1, 18, 33, -1, 2, 32, -3, -1, 17, 1, 16,
|
||||
0
|
||||
};
|
||||
|
||||
static const short tab15[] =
|
||||
{
|
||||
-495,-445,-355,-263,-183,-115, -77, -43, -27, -13, -7, -3, -1, 255, 239,
|
||||
-1, 254, 223, -1, 238, -1, 253, 207, -7, -3, -1, 252, 222, -1, 237,
|
||||
191, -1, 251, -1, 206, 236, -7, -3, -1, 221, 175, -1, 250, 190, -3,
|
||||
-1, 235, 205, -1, 220, 159, -15, -7, -3, -1, 249, 234, -1, 189, 219,
|
||||
-3, -1, 143, 248, -1, 204, 158, -7, -3, -1, 233, 127, -1, 247, 173,
|
||||
-3, -1, 218, 188, -1, 111, -1, 174, 15, -19, -11, -3, -1, 203, 246,
|
||||
-3, -1, 142, 232, -1, 95, 157, -3, -1, 245, 126, -1, 231, 172, -9,
|
||||
-3, -1, 202, 187, -3, -1, 217, 141, 79, -3, -1, 244, 63, -1, 243,
|
||||
216, -33, -17, -9, -3, -1, 230, 47, -1, 242, -1, 110, 240, -3, -1,
|
||||
31, 241, -1, 156, 201, -7, -3, -1, 94, 171, -1, 186, 229, -3, -1,
|
||||
125, 215, -1, 78, 228, -15, -7, -3, -1, 140, 200, -1, 62, 109, -3,
|
||||
-1, 214, 227, -1, 155, 185, -7, -3, -1, 46, 170, -1, 226, 30, -5,
|
||||
-1, 225, -1, 14, 224, -1, 93, 213, -45, -25, -13, -7, -3, -1, 124,
|
||||
199, -1, 77, 139, -1, 212, -1, 184, 154, -7, -3, -1, 169, 108, -1,
|
||||
198, 61, -1, 211, 210, -9, -5, -3, -1, 45, 13, 29, -1, 123, 183,
|
||||
-5, -1, 209, -1, 92, 208, -1, 197, 138, -17, -7, -3, -1, 168, 76,
|
||||
-1, 196, 107, -5, -1, 182, -1, 153, 12, -1, 60, 195, -9, -3, -1,
|
||||
122, 167, -1, 166, -1, 192, 11, -1, 194, -1, 44, 91, -55, -29, -15,
|
||||
-7, -3, -1, 181, 28, -1, 137, 152, -3, -1, 193, 75, -1, 180, 106,
|
||||
-5, -3, -1, 59, 121, 179, -3, -1, 151, 136, -1, 43, 90, -11, -5,
|
||||
-1, 178, -1, 165, 27, -1, 177, -1, 176, 105, -7, -3, -1, 150, 74,
|
||||
-1, 164, 120, -3, -1, 135, 58, 163, -17, -7, -3, -1, 89, 149, -1,
|
||||
42, 162, -3, -1, 26, 161, -3, -1, 10, 160, 104, -7, -3, -1, 134,
|
||||
73, -1, 148, 57, -5, -1, 147, -1, 119, 9, -1, 88, 133, -53, -29,
|
||||
-13, -7, -3, -1, 41, 103, -1, 118, 146, -1, 145, -1, 25, 144, -7,
|
||||
-3, -1, 72, 132, -1, 87, 117, -3, -1, 56, 131, -1, 102, 71, -7,
|
||||
-3, -1, 40, 130, -1, 24, 129, -7, -3, -1, 116, 8, -1, 128, 86,
|
||||
-3, -1, 101, 55, -1, 115, 70, -17, -7, -3, -1, 39, 114, -1, 100,
|
||||
23, -3, -1, 85, 113, -3, -1, 7, 112, 54, -7, -3, -1, 99, 69,
|
||||
-1, 84, 38, -3, -1, 98, 22, -3, -1, 6, 96, 53, -33, -19, -9,
|
||||
-5, -1, 97, -1, 83, 68, -1, 37, 82, -3, -1, 21, 81, -3, -1,
|
||||
5, 80, 52, -7, -3, -1, 67, 36, -1, 66, 51, -1, 65, -1, 20,
|
||||
4, -9, -3, -1, 35, 50, -3, -1, 64, 3, 19, -3, -1, 49, 48,
|
||||
34, -9, -7, -3, -1, 18, 33, -1, 2, 32, 17, -3, -1, 1, 16,
|
||||
0
|
||||
};
|
||||
|
||||
static const short tab16[] =
|
||||
{
|
||||
-509,-503,-461,-323,-103, -37, -27, -15, -7, -3, -1, 239, 254, -1, 223,
|
||||
253, -3, -1, 207, 252, -1, 191, 251, -5, -1, 175, -1, 250, 159, -3,
|
||||
-1, 249, 248, 143, -7, -3, -1, 127, 247, -1, 111, 246, 255, -9, -5,
|
||||
-3, -1, 95, 245, 79, -1, 244, 243, -53, -1, 240, -1, 63, -29, -19,
|
||||
-13, -7, -5, -1, 206, -1, 236, 221, 222, -1, 233, -1, 234, 217, -1,
|
||||
238, -1, 237, 235, -3, -1, 190, 205, -3, -1, 220, 219, 174, -11, -5,
|
||||
-1, 204, -1, 173, 218, -3, -1, 126, 172, 202, -5, -3, -1, 201, 125,
|
||||
94, 189, 242, -93, -5, -3, -1, 47, 15, 31, -1, 241, -49, -25, -13,
|
||||
-5, -1, 158, -1, 188, 203, -3, -1, 142, 232, -1, 157, 231, -7, -3,
|
||||
-1, 187, 141, -1, 216, 110, -1, 230, 156, -13, -7, -3, -1, 171, 186,
|
||||
-1, 229, 215, -1, 78, -1, 228, 140, -3, -1, 200, 62, -1, 109, -1,
|
||||
214, 155, -19, -11, -5, -3, -1, 185, 170, 225, -1, 212, -1, 184, 169,
|
||||
-5, -1, 123, -1, 183, 208, 227, -7, -3, -1, 14, 224, -1, 93, 213,
|
||||
-3, -1, 124, 199, -1, 77, 139, -75, -45, -27, -13, -7, -3, -1, 154,
|
||||
108, -1, 198, 61, -3, -1, 92, 197, 13, -7, -3, -1, 138, 168, -1,
|
||||
153, 76, -3, -1, 182, 122, 60, -11, -5, -3, -1, 91, 137, 28, -1,
|
||||
192, -1, 152, 121, -1, 226, -1, 46, 30, -15, -7, -3, -1, 211, 45,
|
||||
-1, 210, 209, -5, -1, 59, -1, 151, 136, 29, -7, -3, -1, 196, 107,
|
||||
-1, 195, 167, -1, 44, -1, 194, 181, -23, -13, -7, -3, -1, 193, 12,
|
||||
-1, 75, 180, -3, -1, 106, 166, 179, -5, -3, -1, 90, 165, 43, -1,
|
||||
178, 27, -13, -5, -1, 177, -1, 11, 176, -3, -1, 105, 150, -1, 74,
|
||||
164, -5, -3, -1, 120, 135, 163, -3, -1, 58, 89, 42, -97, -57, -33,
|
||||
-19, -11, -5, -3, -1, 149, 104, 161, -3, -1, 134, 119, 148, -5, -3,
|
||||
-1, 73, 87, 103, 162, -5, -1, 26, -1, 10, 160, -3, -1, 57, 147,
|
||||
-1, 88, 133, -9, -3, -1, 41, 146, -3, -1, 118, 9, 25, -5, -1,
|
||||
145, -1, 144, 72, -3, -1, 132, 117, -1, 56, 131, -21, -11, -5, -3,
|
||||
-1, 102, 40, 130, -3, -1, 71, 116, 24, -3, -1, 129, 128, -3, -1,
|
||||
8, 86, 55, -9, -5, -1, 115, -1, 101, 70, -1, 39, 114, -5, -3,
|
||||
-1, 100, 85, 7, 23, -23, -13, -5, -1, 113, -1, 112, 54, -3, -1,
|
||||
99, 69, -1, 84, 38, -3, -1, 98, 22, -1, 97, -1, 6, 96, -9,
|
||||
-5, -1, 83, -1, 53, 68, -1, 37, 82, -1, 81, -1, 21, 5, -33,
|
||||
-23, -13, -7, -3, -1, 52, 67, -1, 80, 36, -3, -1, 66, 51, 20,
|
||||
-5, -1, 65, -1, 4, 64, -1, 35, 50, -3, -1, 19, 49, -3, -1,
|
||||
3, 48, 34, -3, -1, 18, 33, -1, 2, 32, -3, -1, 17, 1, 16,
|
||||
0
|
||||
};
|
||||
|
||||
static const short tab24[] =
|
||||
{
|
||||
-451,-117, -43, -25, -15, -7, -3, -1, 239, 254, -1, 223, 253, -3, -1,
|
||||
207, 252, -1, 191, 251, -5, -1, 250, -1, 175, 159, -1, 249, 248, -9,
|
||||
-5, -3, -1, 143, 127, 247, -1, 111, 246, -3, -1, 95, 245, -1, 79,
|
||||
244, -71, -7, -3, -1, 63, 243, -1, 47, 242, -5, -1, 241, -1, 31,
|
||||
240, -25, -9, -1, 15, -3, -1, 238, 222, -1, 237, 206, -7, -3, -1,
|
||||
236, 221, -1, 190, 235, -3, -1, 205, 220, -1, 174, 234, -15, -7, -3,
|
||||
-1, 189, 219, -1, 204, 158, -3, -1, 233, 173, -1, 218, 188, -7, -3,
|
||||
-1, 203, 142, -1, 232, 157, -3, -1, 217, 126, -1, 231, 172, 255,-235,
|
||||
-143, -77, -45, -25, -15, -7, -3, -1, 202, 187, -1, 141, 216, -5, -3,
|
||||
-1, 14, 224, 13, 230, -5, -3, -1, 110, 156, 201, -1, 94, 186, -9,
|
||||
-5, -1, 229, -1, 171, 125, -1, 215, 228, -3, -1, 140, 200, -3, -1,
|
||||
78, 46, 62, -15, -7, -3, -1, 109, 214, -1, 227, 155, -3, -1, 185,
|
||||
170, -1, 226, 30, -7, -3, -1, 225, 93, -1, 213, 124, -3, -1, 199,
|
||||
77, -1, 139, 184, -31, -15, -7, -3, -1, 212, 154, -1, 169, 108, -3,
|
||||
-1, 198, 61, -1, 211, 45, -7, -3, -1, 210, 29, -1, 123, 183, -3,
|
||||
-1, 209, 92, -1, 197, 138, -17, -7, -3, -1, 168, 153, -1, 76, 196,
|
||||
-3, -1, 107, 182, -3, -1, 208, 12, 60, -7, -3, -1, 195, 122, -1,
|
||||
167, 44, -3, -1, 194, 91, -1, 181, 28, -57, -35, -19, -7, -3, -1,
|
||||
137, 152, -1, 193, 75, -5, -3, -1, 192, 11, 59, -3, -1, 176, 10,
|
||||
26, -5, -1, 180, -1, 106, 166, -3, -1, 121, 151, -3, -1, 160, 9,
|
||||
144, -9, -3, -1, 179, 136, -3, -1, 43, 90, 178, -7, -3, -1, 165,
|
||||
27, -1, 177, 105, -1, 150, 164, -17, -9, -5, -3, -1, 74, 120, 135,
|
||||
-1, 58, 163, -3, -1, 89, 149, -1, 42, 162, -7, -3, -1, 161, 104,
|
||||
-1, 134, 119, -3, -1, 73, 148, -1, 57, 147, -63, -31, -15, -7, -3,
|
||||
-1, 88, 133, -1, 41, 103, -3, -1, 118, 146, -1, 25, 145, -7, -3,
|
||||
-1, 72, 132, -1, 87, 117, -3, -1, 56, 131, -1, 102, 40, -17, -7,
|
||||
-3, -1, 130, 24, -1, 71, 116, -5, -1, 129, -1, 8, 128, -1, 86,
|
||||
101, -7, -5, -1, 23, -1, 7, 112, 115, -3, -1, 55, 39, 114, -15,
|
||||
-7, -3, -1, 70, 100, -1, 85, 113, -3, -1, 54, 99, -1, 69, 84,
|
||||
-7, -3, -1, 38, 98, -1, 22, 97, -5, -3, -1, 6, 96, 53, -1,
|
||||
83, 68, -51, -37, -23, -15, -9, -3, -1, 37, 82, -1, 21, -1, 5,
|
||||
80, -1, 81, -1, 52, 67, -3, -1, 36, 66, -1, 51, 20, -9, -5,
|
||||
-1, 65, -1, 4, 64, -1, 35, 50, -1, 19, 49, -7, -5, -3, -1,
|
||||
3, 48, 34, 18, -1, 33, -1, 2, 32, -3, -1, 17, 1, -1, 16,
|
||||
0
|
||||
};
|
||||
|
||||
static const short tab_c0[] =
|
||||
{
|
||||
-29, -21, -13, -7, -3, -1, 11, 15, -1, 13, 14, -3, -1, 7, 5,
|
||||
9, -3, -1, 6, 3, -1, 10, 12, -3, -1, 2, 1, -1, 4, 8,
|
||||
0
|
||||
};
|
||||
|
||||
static const short tab_c1[] =
|
||||
{
|
||||
-15, -7, -3, -1, 15, 14, -1, 13, 12, -3, -1, 11, 10, -1, 9,
|
||||
8, -7, -3, -1, 7, 6, -1, 5, 4, -3, -1, 3, 2, -1, 1,
|
||||
0
|
||||
};
|
||||
|
||||
|
||||
|
||||
static const struct newhuff ht[] =
|
||||
{
|
||||
{ /* 0 */ 0 , tab0 } ,
|
||||
{ /* 2 */ 0 , tab1 } ,
|
||||
{ /* 3 */ 0 , tab2 } ,
|
||||
{ /* 3 */ 0 , tab3 } ,
|
||||
{ /* 0 */ 0 , tab0 } ,
|
||||
{ /* 4 */ 0 , tab5 } ,
|
||||
{ /* 4 */ 0 , tab6 } ,
|
||||
{ /* 6 */ 0 , tab7 } ,
|
||||
{ /* 6 */ 0 , tab8 } ,
|
||||
{ /* 6 */ 0 , tab9 } ,
|
||||
{ /* 8 */ 0 , tab10 } ,
|
||||
{ /* 8 */ 0 , tab11 } ,
|
||||
{ /* 8 */ 0 , tab12 } ,
|
||||
{ /* 16 */ 0 , tab13 } ,
|
||||
{ /* 0 */ 0 , tab0 } ,
|
||||
{ /* 16 */ 0 , tab15 } ,
|
||||
|
||||
{ /* 16 */ 1 , tab16 } ,
|
||||
{ /* 16 */ 2 , tab16 } ,
|
||||
{ /* 16 */ 3 , tab16 } ,
|
||||
{ /* 16 */ 4 , tab16 } ,
|
||||
{ /* 16 */ 6 , tab16 } ,
|
||||
{ /* 16 */ 8 , tab16 } ,
|
||||
{ /* 16 */ 10, tab16 } ,
|
||||
{ /* 16 */ 13, tab16 } ,
|
||||
{ /* 16 */ 4 , tab24 } ,
|
||||
{ /* 16 */ 5 , tab24 } ,
|
||||
{ /* 16 */ 6 , tab24 } ,
|
||||
{ /* 16 */ 7 , tab24 } ,
|
||||
{ /* 16 */ 8 , tab24 } ,
|
||||
{ /* 16 */ 9 , tab24 } ,
|
||||
{ /* 16 */ 11, tab24 } ,
|
||||
{ /* 16 */ 13, tab24 }
|
||||
};
|
||||
|
||||
static const struct newhuff htc[] =
|
||||
{
|
||||
{ /* 1 , 1 , */ 0 , tab_c0 } ,
|
||||
{ /* 1 , 1 , */ 0 , tab_c1 }
|
||||
};
|
||||
|
||||
|
||||
#endif
|
38
ThirdParty/mpg123/include/mpg123/icy.h
vendored
38
ThirdParty/mpg123/include/mpg123/icy.h
vendored
|
@ -1,38 +0,0 @@
|
|||
/*
|
||||
icy: support for SHOUTcast ICY meta info, an attempt to keep it organized
|
||||
|
||||
copyright 2006-7 by the mpg123 project - free software under the terms of the LGPL 2.1
|
||||
see COPYING and AUTHORS files in distribution or http://mpg123.org
|
||||
initially written by Thomas Orgis and modelled after patch by Honza
|
||||
*/
|
||||
#ifndef MPG123_ICY_H
|
||||
#define MPG123_ICY_H
|
||||
|
||||
#ifndef NO_ICY
|
||||
|
||||
#include "compat.h"
|
||||
#include "mpg123.h"
|
||||
|
||||
struct icy_meta
|
||||
{
|
||||
char* data;
|
||||
off_t interval;
|
||||
off_t next;
|
||||
};
|
||||
|
||||
void init_icy(struct icy_meta *);
|
||||
void clear_icy(struct icy_meta *);
|
||||
void reset_icy(struct icy_meta *);
|
||||
|
||||
#else
|
||||
|
||||
#undef init_icy
|
||||
#define init_icy(a)
|
||||
#undef clear_icy
|
||||
#define clear_icy(a)
|
||||
#undef reset_icy
|
||||
#define reset_icy(a)
|
||||
|
||||
#endif /* NO_ICY */
|
||||
|
||||
#endif
|
10
ThirdParty/mpg123/include/mpg123/icy2utf8.h
vendored
10
ThirdParty/mpg123/include/mpg123/icy2utf8.h
vendored
|
@ -1,10 +0,0 @@
|
|||
/* You expect a license plate for _this_ file? */
|
||||
#ifndef MPG123_ICY2UTF_H
|
||||
#define MPG123_ICY2UTF_H
|
||||
|
||||
#ifndef NO_ICY
|
||||
/* (string, force conversion) */
|
||||
char *icy2utf8(const char *, int);
|
||||
#endif
|
||||
|
||||
#endif
|
43
ThirdParty/mpg123/include/mpg123/id3.h
vendored
43
ThirdParty/mpg123/include/mpg123/id3.h
vendored
|
@ -1,43 +0,0 @@
|
|||
/*
|
||||
id3: ID3v2.3 and ID3v2.4 parsing (a relevant subset)
|
||||
|
||||
copyright 2006-2007 by the mpg123 project - free software under the terms of the LGPL 2.1
|
||||
see COPYING and AUTHORS files in distribution or http://mpg123.org
|
||||
initially written by Thomas Orgis
|
||||
*/
|
||||
|
||||
#ifndef MPG123_ID3_H
|
||||
#define MPG123_ID3_H
|
||||
|
||||
/* really need it _here_! */
|
||||
#include "frame.h"
|
||||
|
||||
#ifdef NO_ID3V2
|
||||
# ifdef init_id3
|
||||
# undef init_id3
|
||||
# endif
|
||||
# define init_id3(fr)
|
||||
# ifdef exit_id3
|
||||
# undef exit_id3
|
||||
# endif
|
||||
# define exit_id3(fr)
|
||||
# ifdef reset_id3
|
||||
# undef reset_id3
|
||||
# endif
|
||||
# define reset_id3(fr)
|
||||
# ifdef id3_link
|
||||
# undef id3_link
|
||||
# endif
|
||||
# define id3_link(fr)
|
||||
#else
|
||||
void init_id3(mpg123_handle *fr);
|
||||
void exit_id3(mpg123_handle *fr);
|
||||
void reset_id3(mpg123_handle *fr);
|
||||
void id3_link(mpg123_handle *fr);
|
||||
#endif
|
||||
int parse_new_id3(mpg123_handle *fr, unsigned long first4bytes);
|
||||
/* Convert text from some ID3 encoding to UTf-8.
|
||||
On error, sb->fill is 0. The noquiet flag enables warning/error messages. */
|
||||
void id3_to_utf8(mpg123_string *sb, unsigned char encoding, const unsigned char *source, size_t source_size, int noquiet);
|
||||
|
||||
#endif
|
59
ThirdParty/mpg123/include/mpg123/index.h
vendored
59
ThirdParty/mpg123/include/mpg123/index.h
vendored
|
@ -1,59 +0,0 @@
|
|||
#ifndef MPG123_H_INDEX
|
||||
#define MPG123_H_INDEX
|
||||
|
||||
/*
|
||||
index: frame index data structure and functions
|
||||
|
||||
This is for keeping track of frame positions for accurate seeking.
|
||||
Now in it's own file, with initial code from frame.c and parse.c .
|
||||
|
||||
The idea of the index with a certain amount of entries is to cover
|
||||
all yet-encountered frame positions with minimal coarseness.
|
||||
Meaning: At first every frame position is recorded, then, when
|
||||
the index is full, every second position is trown away to make
|
||||
space. Next time it is full, the same happens. And so on.
|
||||
In this manner we maintain a good resolution with the given
|
||||
maximum index size while covering the whole stream.
|
||||
|
||||
copyright 2007-8 by the mpg123 project - free software under the terms of the LGPL 2.1
|
||||
see COPYING and AUTHORS files in distribution or http://mpg123.org
|
||||
initially written by Thomas Orgis
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "compat.h"
|
||||
|
||||
struct frame_index
|
||||
{
|
||||
off_t *data; /* actual data, the frame positions */
|
||||
off_t step; /* advancement in frame number per index point */
|
||||
off_t next; /* frame offset supposed to come next into the index */
|
||||
size_t size; /* total number of possible entries */
|
||||
size_t fill; /* number of used entries */
|
||||
size_t grow_size; /* if > 0: index allowed to grow on need with these steps, instead of lowering resolution */
|
||||
};
|
||||
|
||||
/* The condition for a framenum to be appended to the index.
|
||||
if(FI_NEXT(fr->index, fr->num)) fi_add(offset); */
|
||||
#define FI_NEXT(fi, framenum) ((fi).size && framenum == (fi).next)
|
||||
|
||||
/* Initialize stuff, set things to zero and NULL... */
|
||||
void fi_init(struct frame_index *fi);
|
||||
/* Deallocate/zero things. */
|
||||
void fi_exit(struct frame_index *fi);
|
||||
|
||||
/* Prepare a given size, preserving current fill, if possible.
|
||||
If the new size is smaller than fill, the entry density is reduced.
|
||||
Return 0 on success. */
|
||||
int fi_resize(struct frame_index *fi, size_t newsize);
|
||||
|
||||
/* Append a frame position, reducing index density if needed. */
|
||||
void fi_add(struct frame_index *fi, off_t pos);
|
||||
|
||||
/* Replace the frame index */
|
||||
int fi_set(struct frame_index *fi, off_t *offsets, off_t step, size_t fill);
|
||||
|
||||
/* Empty the index (setting fill=0 and step=1), but keep current size. */
|
||||
void fi_reset(struct frame_index *fi);
|
||||
|
||||
#endif
|
24
ThirdParty/mpg123/include/mpg123/init_costabs.h
vendored
24
ThirdParty/mpg123/include/mpg123/init_costabs.h
vendored
|
@ -1,24 +0,0 @@
|
|||
/*
|
||||
The function to compute the cos tables at runtime or for pregeneration.
|
||||
|
||||
copyright ?-2021 by the mpg123 project - free software under the terms of the LGPL 2.1
|
||||
see COPYING and AUTHORS files in distribution or http://mpg123.org
|
||||
initially written by Michael Hipp (in tabinit.c).
|
||||
|
||||
The type clreal is either double or float, COS() is cos() or cosf() for runtime.
|
||||
*/
|
||||
|
||||
void init_costabs(void)
|
||||
{
|
||||
clreal *cpnts[] = { cos64,cos32,cos16,cos8,cos4 };
|
||||
int i,k,kr,divv;
|
||||
clreal *costab;
|
||||
|
||||
for(i=0;i<5;i++)
|
||||
{
|
||||
kr=0x10>>i; divv=0x40>>i;
|
||||
costab = cpnts[i];
|
||||
for(k=0;k<kr;k++)
|
||||
costab[k] = 1.0 / (2.0 * COS(M_PI * ((clreal) k * 2.0 + 1.0) / (clreal) divv));
|
||||
}
|
||||
}
|
58
ThirdParty/mpg123/include/mpg123/init_layer12.h
vendored
58
ThirdParty/mpg123/include/mpg123/init_layer12.h
vendored
|
@ -1,58 +0,0 @@
|
|||
/*
|
||||
The function to compute the layer I and II tables at runtime or for pregeneration.
|
||||
|
||||
copyright ?-2021 by the mpg123 project - free software under the terms of the LGPL 2.1
|
||||
see COPYING and AUTHORS files in distribution or http://mpg123.org
|
||||
initially written by Michael Hipp (in layer2.c).
|
||||
|
||||
The type clreal is either double or float. POW() is pow() or powf().
|
||||
*/
|
||||
|
||||
void init_layer12(void)
|
||||
{
|
||||
const clreal mulmul[27] =
|
||||
{
|
||||
0.0 , -2.0/3.0 , 2.0/3.0 ,
|
||||
2.0/7.0 , 2.0/15.0 , 2.0/31.0, 2.0/63.0 , 2.0/127.0 , 2.0/255.0 ,
|
||||
2.0/511.0 , 2.0/1023.0 , 2.0/2047.0 , 2.0/4095.0 , 2.0/8191.0 ,
|
||||
2.0/16383.0 , 2.0/32767.0 , 2.0/65535.0 ,
|
||||
-4.0/5.0 , -2.0/5.0 , 2.0/5.0, 4.0/5.0 ,
|
||||
-8.0/9.0 , -4.0/9.0 , -2.0/9.0 , 2.0/9.0 , 4.0/9.0 , 8.0/9.0
|
||||
};
|
||||
// void init_layer12_stuff()
|
||||
// real* init_layer12_table()
|
||||
for(int k=0;k<27;k++)
|
||||
{
|
||||
int i,j;
|
||||
clreal *table = layer12_table[k];
|
||||
for(j=3,i=0;i<63;i++,j--)
|
||||
*table++ = mulmul[k] * POW(2.0,(clreal) j / 3.0);
|
||||
*table++ = 0.0;
|
||||
}
|
||||
|
||||
// void init_layer12()
|
||||
const unsigned char base[3][9] =
|
||||
{
|
||||
{ 1 , 0, 2 , } ,
|
||||
{ 17, 18, 0 , 19, 20 , } ,
|
||||
{ 21, 1, 22, 23, 0, 24, 25, 2, 26 }
|
||||
};
|
||||
int i,j,k,l,len;
|
||||
const int tablen[3] = { 3 , 5 , 9 };
|
||||
unsigned char *itable;
|
||||
unsigned char *tables[3] = { grp_3tab , grp_5tab , grp_9tab };
|
||||
|
||||
for(i=0;i<3;i++)
|
||||
{
|
||||
itable = tables[i];
|
||||
len = tablen[i];
|
||||
for(j=0;j<len;j++)
|
||||
for(k=0;k<len;k++)
|
||||
for(l=0;l<len;l++)
|
||||
{
|
||||
*itable++ = base[i][l];
|
||||
*itable++ = base[i][k];
|
||||
*itable++ = base[i][j];
|
||||
}
|
||||
}
|
||||
}
|
231
ThirdParty/mpg123/include/mpg123/init_layer3.h
vendored
231
ThirdParty/mpg123/include/mpg123/init_layer3.h
vendored
|
@ -1,231 +0,0 @@
|
|||
/*
|
||||
The function to compute the layer III tables at runtime or for pregeneration.
|
||||
|
||||
copyright ?-2021 by the mpg123 project - free software under the terms of the LGPL 2.1
|
||||
see COPYING and AUTHORS files in distribution or http://mpg123.org
|
||||
initially written by Michael Hipp (in layer3.c).
|
||||
|
||||
The type clreal is either double or float.
|
||||
*/
|
||||
|
||||
// init tables for layer-3 ... specific with the downsampling...
|
||||
void init_layer3(void)
|
||||
{
|
||||
int i,j,k,l;
|
||||
|
||||
for(i=0;i<8207;i++)
|
||||
ispow[i] = POW((clreal)i,(clreal)4.0/3.0);
|
||||
|
||||
for(i=0;i<8;i++)
|
||||
{
|
||||
const clreal Ci[8] = {-0.6,-0.535,-0.33,-0.185,-0.095,-0.041,-0.0142,-0.0037};
|
||||
clreal sq = sqrt(1.0+Ci[i]*Ci[i]);
|
||||
aa_cs[i] = 1.0/sq;
|
||||
aa_ca[i] = Ci[i]/sq;
|
||||
}
|
||||
|
||||
for(i=0;i<18;i++)
|
||||
{
|
||||
win[0][i] = win[1][i] =
|
||||
0.5*SIN(M_PI/72.0 * (clreal)(2*(i+0) +1)) / COS(M_PI * (clreal)(2*(i+0) +19) / 72.0);
|
||||
win[0][i+18] = win[3][i+18] =
|
||||
0.5*SIN(M_PI/72.0 * (clreal)(2*(i+18)+1)) / COS(M_PI * (clreal)(2*(i+18)+19) / 72.0);
|
||||
}
|
||||
for(i=0;i<6;i++)
|
||||
{
|
||||
win[1][i+18] = 0.5 / COS( M_PI * (clreal) (2*(i+18)+19) / 72.0 );
|
||||
win[3][i+12] = 0.5 / COS( M_PI * (clreal) (2*(i+12)+19) / 72.0 );
|
||||
win[1][i+24] = 0.5 * SIN( M_PI / 24.0 * (clreal) (2*i+13) ) / COS( M_PI * (clreal) (2*(i+24)+19) / 72.0 );
|
||||
win[1][i+30] = win[3][i] = 0.0;
|
||||
win[3][i+6 ] = 0.5 * SIN( M_PI / 24.0 * (clreal) (2*i+1 ) ) / COS( M_PI * (clreal) (2*(i+6 )+19) / 72.0 );
|
||||
}
|
||||
|
||||
for(i=0;i<9;i++)
|
||||
COS9[i] = COS( M_PI / 18.0 * (clreal) i);
|
||||
|
||||
for(i=0;i<9;i++)
|
||||
tfcos36[i] = 0.5 / COS( M_PI * (clreal) (i*2+1) / 36.0 );
|
||||
|
||||
for(i=0;i<3;i++)
|
||||
tfcos12[i] = 0.5 / COS( M_PI * (clreal) (i*2+1) / 12.0 );
|
||||
|
||||
COS6_1 = COS( M_PI / 6.0 * (clreal) 1);
|
||||
COS6_2 = COS( M_PI / 6.0 * (clreal) 2);
|
||||
|
||||
cos9[0] = COS(1.0*M_PI/9.0);
|
||||
cos9[1] = COS(5.0*M_PI/9.0);
|
||||
cos9[2] = COS(7.0*M_PI/9.0);
|
||||
cos18[0] = COS(1.0*M_PI/18.0);
|
||||
cos18[1] = COS(11.0*M_PI/18.0);
|
||||
cos18[2] = COS(13.0*M_PI/18.0);
|
||||
|
||||
for(i=0;i<12;i++)
|
||||
{
|
||||
win[2][i] = 0.5 * SIN( M_PI / 24.0 * (clreal) (2*i+1) ) / COS( M_PI * (clreal) (2*i+7) / 24.0 );
|
||||
}
|
||||
|
||||
for(i=0;i<16;i++)
|
||||
{
|
||||
// Special-casing possibly troublesome values where t=inf or
|
||||
// t=-1 in theory. In practice, this never caused issues, but there might
|
||||
// be a system with enough precision in M_PI to raise an exception.
|
||||
// Actually, the special values are not excluded from use in the code, but
|
||||
// in practice, they even have no effect in the compliance tests.
|
||||
if(i > 11) // It's periodic!
|
||||
{
|
||||
tan1_1[i] = tan1_1[i-12];
|
||||
tan2_1[i] = tan2_1[i-12];
|
||||
tan1_2[i] = tan1_2[i-12];
|
||||
tan2_2[i] = tan2_2[i-12];
|
||||
} else if(i == 6) // t=inf
|
||||
{
|
||||
tan1_1[i] = 1.0;
|
||||
tan2_1[i] = 0.0;
|
||||
tan1_2[i] = M_SQRT2;
|
||||
tan2_2[i] = 0.0;
|
||||
} else if(i == 9) // t=-1
|
||||
{
|
||||
tan1_1[i] = -HUGE_VAL;
|
||||
tan2_1[i] = HUGE_VAL;
|
||||
tan1_2[i] = -HUGE_VAL;
|
||||
tan2_2[i] = HUGE_VAL;
|
||||
} else
|
||||
{
|
||||
clreal t = TAN( (clreal) i * M_PI / 12.0 );
|
||||
tan1_1[i] = t / (1.0+t);
|
||||
tan2_1[i] = 1.0 / (1.0 + t);
|
||||
tan1_2[i] = M_SQRT2 * t / (1.0+t);
|
||||
tan2_2[i] = M_SQRT2 / (1.0 + t);
|
||||
}
|
||||
}
|
||||
|
||||
for(i=0;i<32;i++)
|
||||
{
|
||||
for(j=0;j<2;j++)
|
||||
{
|
||||
clreal base = POW(2.0,-0.25*(j+1.0));
|
||||
clreal p1=1.0,p2=1.0;
|
||||
if(i > 0)
|
||||
{
|
||||
if( i & 1 ) p1 = POW(base,(i+1.0)*0.5);
|
||||
else p2 = POW(base,i*0.5);
|
||||
}
|
||||
pow1_1[j][i] = p1;
|
||||
pow2_1[j][i] = p2;
|
||||
pow1_2[j][i] = M_SQRT2 * p1;
|
||||
pow2_2[j][i] = M_SQRT2 * p2;
|
||||
}
|
||||
}
|
||||
|
||||
for(j=0;j<4;j++)
|
||||
{
|
||||
const int len[4] = { 36,36,12,36 };
|
||||
for(i=0;i<len[j];i+=2) win1[j][i] = + win[j][i];
|
||||
|
||||
for(i=1;i<len[j];i+=2) win1[j][i] = - win[j][i];
|
||||
}
|
||||
|
||||
for(j=0;j<9;j++)
|
||||
{
|
||||
const struct bandInfoStruct *bi = &bandInfo[j];
|
||||
short *mp;
|
||||
short cb,lwin;
|
||||
const unsigned char *bdf;
|
||||
int switch_idx;
|
||||
|
||||
mp = map[j][0] = mapbuf0[j];
|
||||
bdf = bi->longDiff;
|
||||
switch_idx = (j < 3) ? 8 : 6;
|
||||
for(i=0,cb = 0; cb < switch_idx ; cb++,i+=*bdf++)
|
||||
{
|
||||
*mp++ = (*bdf) >> 1;
|
||||
*mp++ = i;
|
||||
*mp++ = 3;
|
||||
*mp++ = cb;
|
||||
}
|
||||
bdf = bi->shortDiff+3;
|
||||
for(cb=3;cb<13;cb++)
|
||||
{
|
||||
int l = (*bdf++) >> 1;
|
||||
for(lwin=0;lwin<3;lwin++)
|
||||
{
|
||||
*mp++ = l;
|
||||
*mp++ = i + lwin;
|
||||
*mp++ = lwin;
|
||||
*mp++ = cb;
|
||||
}
|
||||
i += 6*l;
|
||||
}
|
||||
mapend[j][0] = mp;
|
||||
|
||||
mp = map[j][1] = mapbuf1[j];
|
||||
bdf = bi->shortDiff+0;
|
||||
for(i=0,cb=0;cb<13;cb++)
|
||||
{
|
||||
int l = (*bdf++) >> 1;
|
||||
for(lwin=0;lwin<3;lwin++)
|
||||
{
|
||||
*mp++ = l;
|
||||
*mp++ = i + lwin;
|
||||
*mp++ = lwin;
|
||||
*mp++ = cb;
|
||||
}
|
||||
i += 6*l;
|
||||
}
|
||||
mapend[j][1] = mp;
|
||||
|
||||
mp = map[j][2] = mapbuf2[j];
|
||||
bdf = bi->longDiff;
|
||||
for(cb = 0; cb < 22 ; cb++)
|
||||
{
|
||||
*mp++ = (*bdf++) >> 1;
|
||||
*mp++ = cb;
|
||||
}
|
||||
mapend[j][2] = mp;
|
||||
}
|
||||
|
||||
/* Now for some serious loopings! */
|
||||
for(i=0;i<5;i++)
|
||||
for(j=0;j<6;j++)
|
||||
for(k=0;k<6;k++)
|
||||
{
|
||||
int n = k + j * 6 + i * 36;
|
||||
i_slen2[n] = i|(j<<3)|(k<<6)|(3<<12);
|
||||
}
|
||||
for(i=0;i<4;i++)
|
||||
for(j=0;j<4;j++)
|
||||
for(k=0;k<4;k++)
|
||||
{
|
||||
int n = k + j * 4 + i * 16;
|
||||
i_slen2[n+180] = i|(j<<3)|(k<<6)|(4<<12);
|
||||
}
|
||||
for(i=0;i<4;i++)
|
||||
for(j=0;j<3;j++)
|
||||
{
|
||||
int n = j + i * 3;
|
||||
i_slen2[n+244] = i|(j<<3) | (5<<12);
|
||||
n_slen2[n+500] = i|(j<<3) | (2<<12) | (1<<15);
|
||||
}
|
||||
for(i=0;i<5;i++)
|
||||
for(j=0;j<5;j++)
|
||||
for(k=0;k<4;k++)
|
||||
for(l=0;l<4;l++)
|
||||
{
|
||||
int n = l + k * 4 + j * 16 + i * 80;
|
||||
n_slen2[n] = i|(j<<3)|(k<<6)|(l<<9)|(0<<12);
|
||||
}
|
||||
for(i=0;i<5;i++)
|
||||
for(j=0;j<5;j++)
|
||||
for(k=0;k<4;k++)
|
||||
{
|
||||
int n = k + j * 4 + i * 20;
|
||||
n_slen2[n+400] = i|(j<<3)|(k<<6)|(1<<12);
|
||||
}
|
||||
|
||||
#ifdef CALCTABLES
|
||||
// Only needed for fixed point.
|
||||
for(int i=-256;i<118+4;i++)
|
||||
gainpow2[i+256] =
|
||||
DOUBLE_TO_REAL_SCALE_LAYER3(POW((clreal)2.0,-0.25 * (clreal) (i+210)),i+256);
|
||||
#endif
|
||||
}
|
1224
ThirdParty/mpg123/include/mpg123/l12tabs.h
vendored
1224
ThirdParty/mpg123/include/mpg123/l12tabs.h
vendored
File diff suppressed because it is too large
Load diff
167
ThirdParty/mpg123/include/mpg123/l2tables.h
vendored
167
ThirdParty/mpg123/include/mpg123/l2tables.h
vendored
|
@ -1,167 +0,0 @@
|
|||
/*
|
||||
l2tables.h: Layer 2 Alloc tables
|
||||
|
||||
copyright ?-2006 by the mpg123 project - free software under the terms of the LGPL 2.1
|
||||
see COPYING and AUTHORS files in distribution or http://mpg123.org
|
||||
initially written by Michael Hipp
|
||||
|
||||
most other tables are calculated on program start (which is (of course) not ISO-conform)
|
||||
Layer-3 huffman table is in huffman.h
|
||||
|
||||
Note: runtime computation of those other tables is optional now, and only for
|
||||
floating point decoding.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _MPG123_L2TABLES_H_
|
||||
#define _MPG123_L2TABLES_H_
|
||||
|
||||
static const struct al_table alloc_0[] = {
|
||||
{4,0},{5,3},{3,-3},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255},{10,-511},
|
||||
{11,-1023},{12,-2047},{13,-4095},{14,-8191},{15,-16383},{16,-32767},
|
||||
{4,0},{5,3},{3,-3},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255},{10,-511},
|
||||
{11,-1023},{12,-2047},{13,-4095},{14,-8191},{15,-16383},{16,-32767},
|
||||
{4,0},{5,3},{3,-3},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255},{10,-511},
|
||||
{11,-1023},{12,-2047},{13,-4095},{14,-8191},{15,-16383},{16,-32767},
|
||||
{4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
|
||||
{9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767},
|
||||
{4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
|
||||
{9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767},
|
||||
{4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
|
||||
{9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767},
|
||||
{4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
|
||||
{9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767},
|
||||
{4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
|
||||
{9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767},
|
||||
{4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
|
||||
{9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767},
|
||||
{4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
|
||||
{9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767},
|
||||
{4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
|
||||
{9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767},
|
||||
{3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
|
||||
{3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
|
||||
{3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
|
||||
{3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
|
||||
{3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
|
||||
{3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
|
||||
{3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
|
||||
{3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
|
||||
{3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
|
||||
{3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
|
||||
{3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
|
||||
{3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
|
||||
{2,0},{5,3},{7,5},{16,-32767},
|
||||
{2,0},{5,3},{7,5},{16,-32767},
|
||||
{2,0},{5,3},{7,5},{16,-32767},
|
||||
{2,0},{5,3},{7,5},{16,-32767} };
|
||||
|
||||
static const struct al_table alloc_1[] = {
|
||||
{4,0},{5,3},{3,-3},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255},{10,-511},
|
||||
{11,-1023},{12,-2047},{13,-4095},{14,-8191},{15,-16383},{16,-32767},
|
||||
{4,0},{5,3},{3,-3},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255},{10,-511},
|
||||
{11,-1023},{12,-2047},{13,-4095},{14,-8191},{15,-16383},{16,-32767},
|
||||
{4,0},{5,3},{3,-3},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255},{10,-511},
|
||||
{11,-1023},{12,-2047},{13,-4095},{14,-8191},{15,-16383},{16,-32767},
|
||||
{4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
|
||||
{9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767},
|
||||
{4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
|
||||
{9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767},
|
||||
{4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
|
||||
{9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767},
|
||||
{4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
|
||||
{9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767},
|
||||
{4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
|
||||
{9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767},
|
||||
{4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
|
||||
{9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767},
|
||||
{4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
|
||||
{9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767},
|
||||
{4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
|
||||
{9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{16,-32767},
|
||||
{3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
|
||||
{3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
|
||||
{3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
|
||||
{3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
|
||||
{3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
|
||||
{3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
|
||||
{3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
|
||||
{3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
|
||||
{3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
|
||||
{3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
|
||||
{3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
|
||||
{3,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{16,-32767},
|
||||
{2,0},{5,3},{7,5},{16,-32767},
|
||||
{2,0},{5,3},{7,5},{16,-32767},
|
||||
{2,0},{5,3},{7,5},{16,-32767},
|
||||
{2,0},{5,3},{7,5},{16,-32767},
|
||||
{2,0},{5,3},{7,5},{16,-32767},
|
||||
{2,0},{5,3},{7,5},{16,-32767},
|
||||
{2,0},{5,3},{7,5},{16,-32767} };
|
||||
|
||||
static const struct al_table alloc_2[] = {
|
||||
{4,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255},
|
||||
{10,-511},{11,-1023},{12,-2047},{13,-4095},{14,-8191},{15,-16383},
|
||||
{4,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255},
|
||||
{10,-511},{11,-1023},{12,-2047},{13,-4095},{14,-8191},{15,-16383},
|
||||
{3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
|
||||
{3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
|
||||
{3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
|
||||
{3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
|
||||
{3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
|
||||
{3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63} };
|
||||
|
||||
static const struct al_table alloc_3[] = {
|
||||
{4,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255},
|
||||
{10,-511},{11,-1023},{12,-2047},{13,-4095},{14,-8191},{15,-16383},
|
||||
{4,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},{9,-255},
|
||||
{10,-511},{11,-1023},{12,-2047},{13,-4095},{14,-8191},{15,-16383},
|
||||
{3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
|
||||
{3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
|
||||
{3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
|
||||
{3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
|
||||
{3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
|
||||
{3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
|
||||
{3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
|
||||
{3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
|
||||
{3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
|
||||
{3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63} };
|
||||
|
||||
static const struct al_table alloc_4[] = {
|
||||
{4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
|
||||
{9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{14,-8191},
|
||||
{4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
|
||||
{9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{14,-8191},
|
||||
{4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
|
||||
{9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{14,-8191},
|
||||
{4,0},{5,3},{7,5},{3,-3},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},{8,-127},
|
||||
{9,-255},{10,-511},{11,-1023},{12,-2047},{13,-4095},{14,-8191},
|
||||
{3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
|
||||
{3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
|
||||
{3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
|
||||
{3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
|
||||
{3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
|
||||
{3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
|
||||
{3,0},{5,3},{7,5},{10,9},{4,-7},{5,-15},{6,-31},{7,-63},
|
||||
{2,0},{5,3},{7,5},{10,9},
|
||||
{2,0},{5,3},{7,5},{10,9},
|
||||
{2,0},{5,3},{7,5},{10,9},
|
||||
{2,0},{5,3},{7,5},{10,9},
|
||||
{2,0},{5,3},{7,5},{10,9},
|
||||
{2,0},{5,3},{7,5},{10,9},
|
||||
{2,0},{5,3},{7,5},{10,9},
|
||||
{2,0},{5,3},{7,5},{10,9},
|
||||
{2,0},{5,3},{7,5},{10,9},
|
||||
{2,0},{5,3},{7,5},{10,9},
|
||||
{2,0},{5,3},{7,5},{10,9},
|
||||
{2,0},{5,3},{7,5},{10,9},
|
||||
{2,0},{5,3},{7,5},{10,9},
|
||||
{2,0},{5,3},{7,5},{10,9},
|
||||
{2,0},{5,3},{7,5},{10,9},
|
||||
{2,0},{5,3},{7,5},{10,9},
|
||||
{2,0},{5,3},{7,5},{10,9},
|
||||
{2,0},{5,3},{7,5},{10,9},
|
||||
{2,0},{5,3},{7,5},{10,9} };
|
||||
|
||||
#endif
|
||||
|
94
ThirdParty/mpg123/include/mpg123/l3bandgain.h
vendored
94
ThirdParty/mpg123/include/mpg123/l3bandgain.h
vendored
|
@ -1,94 +0,0 @@
|
|||
/*
|
||||
l3bandinfo.h: the layer III bandInfo structures and gainpow2_scale
|
||||
|
||||
copyright 1995-2021 by the mpg123 project - free software under the terms of the LGPL 2.1
|
||||
see COPYING and AUTHORS files in distribution or http://mpg123.org
|
||||
initially written by Michael Hipp
|
||||
|
||||
This is separated out of layer3.c to re-use independently in calctables.
|
||||
*/
|
||||
|
||||
struct bandInfoStruct
|
||||
{
|
||||
unsigned short longIdx[23];
|
||||
unsigned char longDiff[22];
|
||||
unsigned short shortIdx[14];
|
||||
unsigned char shortDiff[13];
|
||||
};
|
||||
|
||||
/* Techy details about our friendly MPEG data. Fairly constant over the years;-) */
|
||||
static const struct bandInfoStruct bandInfo[9] =
|
||||
{
|
||||
{ /* MPEG 1.0 */
|
||||
{0,4,8,12,16,20,24,30,36,44,52,62,74, 90,110,134,162,196,238,288,342,418,576},
|
||||
{4,4,4,4,4,4,6,6,8, 8,10,12,16,20,24,28,34,42,50,54, 76,158},
|
||||
{0,4*3,8*3,12*3,16*3,22*3,30*3,40*3,52*3,66*3, 84*3,106*3,136*3,192*3},
|
||||
{4,4,4,4,6,8,10,12,14,18,22,30,56}
|
||||
},
|
||||
{
|
||||
{0,4,8,12,16,20,24,30,36,42,50,60,72, 88,106,128,156,190,230,276,330,384,576},
|
||||
{4,4,4,4,4,4,6,6,6, 8,10,12,16,18,22,28,34,40,46,54, 54,192},
|
||||
{0,4*3,8*3,12*3,16*3,22*3,28*3,38*3,50*3,64*3, 80*3,100*3,126*3,192*3},
|
||||
{4,4,4,4,6,6,10,12,14,16,20,26,66}
|
||||
},
|
||||
{
|
||||
{0,4,8,12,16,20,24,30,36,44,54,66,82,102,126,156,194,240,296,364,448,550,576},
|
||||
{4,4,4,4,4,4,6,6,8,10,12,16,20,24,30,38,46,56,68,84,102, 26},
|
||||
{0,4*3,8*3,12*3,16*3,22*3,30*3,42*3,58*3,78*3,104*3,138*3,180*3,192*3},
|
||||
{4,4,4,4,6,8,12,16,20,26,34,42,12}
|
||||
},
|
||||
{ /* MPEG 2.0 */
|
||||
{0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576},
|
||||
{6,6,6,6,6,6,8,10,12,14,16,20,24,28,32,38,46,52,60,68,58,54 } ,
|
||||
{0,4*3,8*3,12*3,18*3,24*3,32*3,42*3,56*3,74*3,100*3,132*3,174*3,192*3} ,
|
||||
{4,4,4,6,6,8,10,14,18,26,32,42,18 }
|
||||
},
|
||||
{ /* Twiddling 3 values here (not just 330->332!) fixed bug 1895025. */
|
||||
{0,6,12,18,24,30,36,44,54,66,80,96,114,136,162,194,232,278,332,394,464,540,576},
|
||||
{6,6,6,6,6,6,8,10,12,14,16,18,22,26,32,38,46,54,62,70,76,36 },
|
||||
{0,4*3,8*3,12*3,18*3,26*3,36*3,48*3,62*3,80*3,104*3,136*3,180*3,192*3},
|
||||
{4,4,4,6,8,10,12,14,18,24,32,44,12 }
|
||||
},
|
||||
{
|
||||
{0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576},
|
||||
{6,6,6,6,6,6,8,10,12,14,16,20,24,28,32,38,46,52,60,68,58,54 },
|
||||
{0,4*3,8*3,12*3,18*3,26*3,36*3,48*3,62*3,80*3,104*3,134*3,174*3,192*3},
|
||||
{4,4,4,6,8,10,12,14,18,24,30,40,18 }
|
||||
},
|
||||
{ /* MPEG 2.5 */
|
||||
{0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576},
|
||||
{6,6,6,6,6,6,8,10,12,14,16,20,24,28,32,38,46,52,60,68,58,54},
|
||||
{0,12,24,36,54,78,108,144,186,240,312,402,522,576},
|
||||
{4,4,4,6,8,10,12,14,18,24,30,40,18}
|
||||
},
|
||||
{
|
||||
{0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576},
|
||||
{6,6,6,6,6,6,8,10,12,14,16,20,24,28,32,38,46,52,60,68,58,54},
|
||||
{0,12,24,36,54,78,108,144,186,240,312,402,522,576},
|
||||
{4,4,4,6,8,10,12,14,18,24,30,40,18}
|
||||
},
|
||||
{
|
||||
{0,12,24,36,48,60,72,88,108,132,160,192,232,280,336,400,476,566,568,570,572,574,576},
|
||||
{12,12,12,12,12,12,16,20,24,28,32,40,48,56,64,76,90,2,2,2,2,2},
|
||||
{0, 24, 48, 72,108,156,216,288,372,480,486,492,498,576},
|
||||
{8,8,8,12,16,20,24,28,36,2,2,2,26}
|
||||
}
|
||||
};
|
||||
|
||||
#if defined(REAL_IS_FIXED) || defined(CALCTABLES)
|
||||
static const char gainpow2_scale[256+118+4+1] =
|
||||
{
|
||||
19,19,19,20,20,20,20,21,21,21,21,22,22,22,22,23,23,23,23,24,24,24,24,25,25,25,25,26,26,26,26,27,
|
||||
27,27,27,28,28,28,28,29,29,29,29,30,30,30,30,31,31,31,31,32,32,32,32,33,33,33,33,34,34,34,34,34,
|
||||
34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,
|
||||
34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,
|
||||
34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,
|
||||
34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,
|
||||
34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,
|
||||
34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,
|
||||
34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,
|
||||
34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,
|
||||
34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,
|
||||
34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,0
|
||||
};
|
||||
#endif
|
5285
ThirdParty/mpg123/include/mpg123/l3tabs.h
vendored
5285
ThirdParty/mpg123/include/mpg123/l3tabs.h
vendored
File diff suppressed because it is too large
Load diff
199
ThirdParty/mpg123/include/mpg123/mangle.h
vendored
199
ThirdParty/mpg123/include/mpg123/mangle.h
vendored
|
@ -1,199 +0,0 @@
|
|||
/*
|
||||
mangle: support defines for preprocessed assembler
|
||||
|
||||
copyright 1995-2007 by the mpg123 project - free software under the terms of the LGPL 2.1
|
||||
see COPYING and AUTHORS files in distribution or http://mpg123.org
|
||||
|
||||
This once started out as mangle.h from MPlayer, but you can't really call it derived work... the small part that in principle stems from MPlayer also being not very special (once you decided to use such a header at all, it's quite obvious material).
|
||||
*/
|
||||
|
||||
#ifndef __MANGLE_H
|
||||
#define __MANGLE_H
|
||||
|
||||
#include "config.h"
|
||||
#include "intsym.h"
|
||||
|
||||
#if (defined OPT_I486) || (defined OPT_I586) || (defined OPT_I586_DITHER) \
|
||||
|| (defined OPT_MMX) || (defined OPT_SSE) || (defined OPT_3DNOW) || (defined OPT_3DNOWEXT) \
|
||||
|| (defined OPT_3DNOW_VINTAGE) || (defined OPT_3DNOWEXT_VINTAGE) \
|
||||
|| (defined OPT_SSE_VINTAGE)
|
||||
#define OPT_X86
|
||||
#endif
|
||||
|
||||
#ifdef CCALIGN
|
||||
#define MOVUAPS movaps
|
||||
#else
|
||||
#define MOVUAPS movups
|
||||
#endif
|
||||
|
||||
/*
|
||||
ALIGNX: align to X bytes
|
||||
This differs per compiler/platform in taking the byte count or an exponent for base 2.
|
||||
A way out is balign, if the assembler supports it (gas extension).
|
||||
*/
|
||||
|
||||
#ifdef ASMALIGN_BALIGN
|
||||
|
||||
#define ALIGN4 .balign 4
|
||||
#define ALIGN8 .balign 8
|
||||
#define ALIGN16 .balign 16
|
||||
#define ALIGN32 .balign 32
|
||||
#define ALIGN64 .balign 64
|
||||
|
||||
#else
|
||||
|
||||
#ifdef ASMALIGN_EXP
|
||||
#define ALIGN4 .align 2
|
||||
#define ALIGN8 .align 3
|
||||
#define ALIGN16 .align 4
|
||||
#define ALIGN32 .align 5
|
||||
#define ALIGN64 .align 6
|
||||
#else
|
||||
#ifdef ASMALIGN_BYTE
|
||||
#define ALIGN4 .align 4
|
||||
#define ALIGN8 .align 8
|
||||
#define ALIGN16 .align 16
|
||||
#define ALIGN32 .align 32
|
||||
#define ALIGN64 .align 64
|
||||
#else
|
||||
#ifdef ASMALIGN_ARMASM
|
||||
#define ALIGN4 ALIGN 4
|
||||
#define ALIGN8 ALIGN 8
|
||||
#define ALIGN16 ALIGN 16
|
||||
#define ALIGN32 ALIGN 32
|
||||
#define ALIGN64 ALIGN 64
|
||||
#else
|
||||
#error "Dunno how assembler alignment works. Please specify."
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#define MANGLE_MACROCAT_REALLY(a, b) a ## b
|
||||
#define MANGLE_MACROCAT(a, b) MANGLE_MACROCAT_REALLY(a, b)
|
||||
/* Feel free to add more to the list, eg. a.out IMO */
|
||||
#if defined(__USER_LABEL_PREFIX__)
|
||||
#define ASM_NAME(a) MANGLE_MACROCAT(__USER_LABEL_PREFIX__,a)
|
||||
#define ASM_VALUE(a) MANGLE_MACROCAT($,ASM_NAME(a))
|
||||
#elif defined(__CYGWIN__) || defined(_WIN32) && !defined (_WIN64) && !defined (_M_ARM) || defined(__OS2__) || \
|
||||
(defined(__OpenBSD__) && !defined(__ELF__)) || defined(__APPLE__)
|
||||
#define ASM_NAME(a) MANGLE_MACROCAT(_,a)
|
||||
#define ASM_VALUE(a) MANGLE_MACROCAT($_,a)
|
||||
#else
|
||||
#define ASM_NAME(a) a
|
||||
#define ASM_VALUE(a) MANGLE_MACROCAT($,a)
|
||||
#endif
|
||||
|
||||
/* Enable position-independent code for certain platforms. */
|
||||
|
||||
#if defined(OPT_X86)
|
||||
|
||||
#define _EBX_ %ebx
|
||||
|
||||
#if defined(PIC) && defined(__ELF__)
|
||||
|
||||
/* ELF binaries (Unix/Linux) */
|
||||
#define LOCAL_VAR(a) a ## @GOTOFF(_EBX_)
|
||||
#define GLOBAL_VAR(a) ASM_NAME(a) ## @GOTOFF(_EBX_)
|
||||
#define GLOBAL_VAR_PTR(a) ASM_NAME(a) ## @GOT(_EBX_)
|
||||
#define FUNC(a) ASM_NAME(a)
|
||||
#define EXTERNAL_FUNC(a) ASM_NAME(a) ## @PLT
|
||||
#undef ASM_VALUE
|
||||
#define ASM_VALUE(a) MANGLE_MACROCAT($,a) ##@GOTOFF
|
||||
#define GET_GOT \
|
||||
call 1f; \
|
||||
1: \
|
||||
pop _EBX_; \
|
||||
2: \
|
||||
addl $_GLOBAL_OFFSET_TABLE_ + (2b-1b), _EBX_
|
||||
#define PREPARE_GOT pushl _EBX_
|
||||
#define RESTORE_GOT popl _EBX_
|
||||
|
||||
#elif defined(PIC) && defined(__APPLE__)
|
||||
|
||||
/* Mach-O binaries (OSX/iOS) */
|
||||
#define LOCAL_VAR(a) a ## - Lpic_base(_EBX_)
|
||||
#define GLOBAL_VAR(a) .err This ABI cannot access non-local symbols directly.
|
||||
#define GLOBAL_VAR_PTR(a) L_ ## a ## - Lpic_base(_EBX_)
|
||||
#define FUNC(a) L_ ## a
|
||||
#define EXTERNAL_FUNC(a) L_ ## a
|
||||
#define GET_GOT \
|
||||
call Lpic_base; \
|
||||
Lpic_base: \
|
||||
pop _EBX_
|
||||
#define PREPARE_GOT pushl _EBX_
|
||||
#define RESTORE_GOT popl _EBX_
|
||||
|
||||
#else
|
||||
|
||||
/* Dummies for everyone else. */
|
||||
#define LOCAL_VAR(a) a
|
||||
#define GLOBAL_VAR ASM_NAME
|
||||
#define GLOBAL_VAR_PTR(a) .err Cannot use indirect addressing in non-PIC object.
|
||||
#define FUNC ASM_NAME
|
||||
#define EXTERNAL_FUNC ASM_NAME
|
||||
#define GET_GOT
|
||||
#define PREPARE_GOT
|
||||
#define RESTORE_GOT
|
||||
|
||||
#endif /* PIC variants */
|
||||
|
||||
#endif /* OPT_X86 */
|
||||
|
||||
#if defined(__CYGWIN__) || defined(__MINGW32__) || defined(__APPLE__)
|
||||
#define COMM(a,b,c) .comm a,b
|
||||
#else
|
||||
#define COMM(a,b,c) .comm a,b,c
|
||||
#endif
|
||||
/* more hacks for macosx; no .bss ... */
|
||||
#ifdef __APPLE__
|
||||
#define BSS .data
|
||||
#else
|
||||
#define BSS .bss
|
||||
#endif
|
||||
|
||||
/* armasm for WIN32 UWP */
|
||||
#ifdef _M_ARM
|
||||
#define GLOBAL_SYMBOL EXPORT
|
||||
#else
|
||||
#define GLOBAL_SYMBOL .globl
|
||||
#endif
|
||||
|
||||
/* Mark non-executable stack.
|
||||
It's mainly for GNU on Linux... who else does (not) like this? */
|
||||
#if !defined(__SUNPRO_C) && defined(__linux__) && defined(__ELF__)
|
||||
#if defined(__arm__)
|
||||
#define NONEXEC_STACK .section .note.GNU-stack,"",%progbits
|
||||
#else
|
||||
#define NONEXEC_STACK .section .note.GNU-stack,"",@progbits
|
||||
#endif
|
||||
#else
|
||||
#define NONEXEC_STACK
|
||||
#endif
|
||||
|
||||
#if (defined(__x86_64__) || defined(_M_X64)) && (defined(_WIN64) || defined (__CYGWIN__))
|
||||
#define IS_MSABI 1 /* Not using SYSV */
|
||||
#endif
|
||||
|
||||
/* Macros for +-4GiB PC-relative addressing on AArch64 */
|
||||
#ifdef __APPLE__
|
||||
#define AARCH64_PCREL_HI(label) label@PAGE
|
||||
#define AARCH64_PCREL_LO(label) label@PAGEOFF
|
||||
#else
|
||||
#define AARCH64_PCREL_HI(label) label
|
||||
#define AARCH64_PCREL_LO(label) :lo12:label
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define AARCH64_DUP_4S(dst, src, elem) dup.4s dst, src[elem]
|
||||
#define AARCH64_DUP_2D(dst, src, elem) dup.2d dst, src[elem]
|
||||
#define AARCH64_SQXTN2_8H(dst, src) sqxtn2.8h dst, src
|
||||
#else
|
||||
#define AARCH64_DUP_4S(dst, src, elem) dup dst.4s, src.s[elem]
|
||||
#define AARCH64_DUP_2D(dst, src, elem) dup dst.2d, src.d[elem]
|
||||
#define AARCH64_SQXTN2_8H(dst, src) sqxtn2 dst.8h, src.4s
|
||||
#endif
|
||||
|
||||
#endif /* !__MANGLE_H */
|
||||
|
89
ThirdParty/mpg123/include/mpg123/mpeghead.h
vendored
89
ThirdParty/mpg123/include/mpg123/mpeghead.h
vendored
|
@ -1,89 +0,0 @@
|
|||
/*
|
||||
mpeghead: the bits of an MPEG frame header
|
||||
|
||||
copyright ?-2011 by the mpg123 project - free software under the terms of the LGPL 2.1
|
||||
see COPYING and AUTHORS files in distribution or http://mpg123.org
|
||||
initially written by Michael Hipp & Thomas Orgis (from parse.c)
|
||||
*/
|
||||
#ifndef MPG123_MPEGHEAD_H
|
||||
#define MPG123_MPEGHEAD_H
|
||||
|
||||
/*
|
||||
Avoid human error, let perl do the work of dissecting an MPEG header into parts.
|
||||
To be clear: Never edit the following definitions by hand, modify the code block inside this comment and run it through perl instead!
|
||||
|
||||
$head = "AAAAAAAA AAABBCCD EEEEFFGH IIJJKLMM";
|
||||
%parts = qw(A sync B version C layer D crc E bitrate F samplerate G padding H private I channel J chanex K copyright L original M emphasis);
|
||||
for(sort keys %parts)
|
||||
{
|
||||
$name = uc($parts{$_});
|
||||
$bits = $head;
|
||||
$bits =~ s/$_/1/g;
|
||||
$bits =~ s/[^1 ]/0/g;
|
||||
print "\/\* $bits \*\/\n";
|
||||
$bits =~ s/\s//g;
|
||||
print "#define HDR_$name".(" " x (18-length($name))).sprintf("0x%08x", eval("0b$bits"))."\n";
|
||||
$bits =~ m/(0*)$/;
|
||||
print "#define HDR_${name}_VAL(h)".(" " x (11-length($name)))."(((h)\&HDR_$name) >> ".length($1).")\n";
|
||||
}
|
||||
*/
|
||||
|
||||
/* 11111111 11100000 00000000 00000000 */
|
||||
#define HDR_SYNC 0xffe00000
|
||||
#define HDR_SYNC_VAL(h) (((h)&HDR_SYNC) >> 21)
|
||||
/* 00000000 00011000 00000000 00000000 */
|
||||
#define HDR_VERSION 0x00180000
|
||||
#define HDR_VERSION_VAL(h) (((h)&HDR_VERSION) >> 19)
|
||||
/* 00000000 00000110 00000000 00000000 */
|
||||
#define HDR_LAYER 0x00060000
|
||||
#define HDR_LAYER_VAL(h) (((h)&HDR_LAYER) >> 17)
|
||||
/* 00000000 00000001 00000000 00000000 */
|
||||
#define HDR_CRC 0x00010000
|
||||
#define HDR_CRC_VAL(h) (((h)&HDR_CRC) >> 16)
|
||||
/* 00000000 00000000 11110000 00000000 */
|
||||
#define HDR_BITRATE 0x0000f000
|
||||
#define HDR_BITRATE_VAL(h) (((h)&HDR_BITRATE) >> 12)
|
||||
/* 00000000 00000000 00001100 00000000 */
|
||||
#define HDR_SAMPLERATE 0x00000c00
|
||||
#define HDR_SAMPLERATE_VAL(h) (((h)&HDR_SAMPLERATE) >> 10)
|
||||
/* 00000000 00000000 00000010 00000000 */
|
||||
#define HDR_PADDING 0x00000200
|
||||
#define HDR_PADDING_VAL(h) (((h)&HDR_PADDING) >> 9)
|
||||
/* 00000000 00000000 00000001 00000000 */
|
||||
#define HDR_PRIVATE 0x00000100
|
||||
#define HDR_PRIVATE_VAL(h) (((h)&HDR_PRIVATE) >> 8)
|
||||
/* 00000000 00000000 00000000 11000000 */
|
||||
#define HDR_CHANNEL 0x000000c0
|
||||
#define HDR_CHANNEL_VAL(h) (((h)&HDR_CHANNEL) >> 6)
|
||||
/* 00000000 00000000 00000000 00110000 */
|
||||
#define HDR_CHANEX 0x00000030
|
||||
#define HDR_CHANEX_VAL(h) (((h)&HDR_CHANEX) >> 4)
|
||||
/* 00000000 00000000 00000000 00001000 */
|
||||
#define HDR_COPYRIGHT 0x00000008
|
||||
#define HDR_COPYRIGHT_VAL(h) (((h)&HDR_COPYRIGHT) >> 3)
|
||||
/* 00000000 00000000 00000000 00000100 */
|
||||
#define HDR_ORIGINAL 0x00000004
|
||||
#define HDR_ORIGINAL_VAL(h) (((h)&HDR_ORIGINAL) >> 2)
|
||||
/* 00000000 00000000 00000000 00000011 */
|
||||
#define HDR_EMPHASIS 0x00000003
|
||||
#define HDR_EMPHASIS_VAL(h) (((h)&HDR_EMPHASIS) >> 0)
|
||||
|
||||
/*
|
||||
A generic mask for telling if a header is somewhat valid for the current stream.
|
||||
Meaning: Most basic info is not allowed to change.
|
||||
Checking of channel count needs to be done, too, though. So,
|
||||
if channel count matches, frames are decoded the same way: frame buffers and decoding
|
||||
routines can stay the same, especially frame buffers (think spf * channels!).
|
||||
*/
|
||||
#define HDR_CMPMASK (HDR_SYNC|HDR_VERSION|HDR_LAYER|HDR_SAMPLERATE)
|
||||
|
||||
/* A stricter mask, for matching free format headers. */
|
||||
#define HDR_SAMEMASK (HDR_SYNC|HDR_VERSION|HDR_LAYER|HDR_BITRATE|HDR_SAMPLERATE|HDR_CHANNEL)
|
||||
|
||||
/* Free format headers have zero bitrate value. */
|
||||
#define HDR_FREE_FORMAT(head) (!(head & HDR_BITRATE))
|
||||
|
||||
/* A mask for changed sampling rate (version or rate bits). */
|
||||
#define HDR_SAMPMASK (HDR_VERSION|HDR_SAMPLERATE)
|
||||
|
||||
#endif
|
334
ThirdParty/mpg123/include/mpg123/mpg123.h
vendored
334
ThirdParty/mpg123/include/mpg123/mpg123.h
vendored
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
libmpg123: MPEG Audio Decoder library (version 1.29.3)
|
||||
libmpg123: MPEG Audio Decoder library
|
||||
|
||||
copyright 1995-2015 by the mpg123 project
|
||||
copyright 1995-2023 by the mpg123 project
|
||||
free software under the terms of the LGPL 2.1
|
||||
see COPYING and AUTHORS files in distribution or http://mpg123.org
|
||||
*/
|
||||
|
@ -9,17 +9,17 @@
|
|||
#ifndef MPG123_LIB_H
|
||||
#define MPG123_LIB_H
|
||||
|
||||
#include <fmt123.h>
|
||||
#include "fmt123.h"
|
||||
|
||||
/** \file mpg123.h The header file for the libmpg123 MPEG Audio decoder */
|
||||
|
||||
/** A macro to check at compile time which set of API functions to expect.
|
||||
* This should be incremented at least each time a new symbol is added
|
||||
* This must be incremented at least each time a new symbol is added
|
||||
* to the header.
|
||||
*/
|
||||
#ifndef MPG123_API_VERSION
|
||||
#define MPG123_API_VERSION 46
|
||||
#endif
|
||||
#define MPG123_API_VERSION 48
|
||||
/** library patch level at client build time */
|
||||
#define MPG123_PATCHLEVEL 3
|
||||
|
||||
#ifndef MPG123_EXPORT
|
||||
/** Defines needed for MS Visual Studio(tm) DLL builds.
|
||||
|
@ -71,49 +71,37 @@
|
|||
|
||||
#endif
|
||||
|
||||
/* You can use this file directly, avoiding the autoconf replacements.
|
||||
Might have to set MPG123_NO_LARGENAME, too, in case you have
|
||||
_FILE_OFFSET_BITS defined where it does not make sense. */
|
||||
#ifndef MPG123_NO_CONFIGURE
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
#ifndef MPG123_PORTABLE_API
|
||||
#include <sys/types.h>
|
||||
|
||||
/* A little hack to help MSVC not having ssize_t. */
|
||||
#ifdef _MSC_VER
|
||||
#include <stddef.h>
|
||||
typedef ptrdiff_t mpg123_ssize_t;
|
||||
#else
|
||||
typedef ssize_t mpg123_ssize_t;
|
||||
#endif
|
||||
|
||||
/* You can always enforce largefile hackery by setting MPG123_LARGESUFFIX. */
|
||||
/* Otherwise, this header disables it if the build system decided so. */
|
||||
#if !defined(MPG123_LARGESUFFIX) && 0
|
||||
#ifndef MPG123_NO_LARGENAME
|
||||
#define MPG123_NO_LARGENAME
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* MPG123_NO_CONFIGURE */
|
||||
|
||||
/* Simplified large file handling.
|
||||
I used to have a check here that prevents building for a library with conflicting large file setup
|
||||
(application that uses 32 bit offsets with library that uses 64 bits).
|
||||
While that was perfectly fine in an environment where there is one incarnation of the library,
|
||||
it hurt GNU/Linux and Solaris systems with multilib where the distribution fails to provide the
|
||||
correct header matching the 32 bit library (where large files need explicit support) or
|
||||
the 64 bit library (where there is no distinction).
|
||||
/* Handling of large file offsets.
|
||||
When client code defines _FILE_OFFSET_BITS, it wants non-default large file support,
|
||||
and thus functions with added suffix (mpg123_open_64). The default library build provides
|
||||
wrapper and alias functions to accomodate client code variations (dual-mode library like glibc).
|
||||
|
||||
New approach: When the app defines _FILE_OFFSET_BITS, it wants non-default large file support,
|
||||
and thus functions with added suffix (mpg123_open_64).
|
||||
Any mismatch will be caught at link time because of the _FILE_OFFSET_BITS setting used when
|
||||
building libmpg123. Plus, there's dual mode large file support in mpg123 since 1.12 now.
|
||||
Link failure is not the expected outcome of any half-sane usage anymore.
|
||||
Client code can definie MPG123_NO_LARGENAME and MPG123_LARGESUFFIX, respectively, for disabling
|
||||
or enforcing the suffixes. If explicit usage of 64 bit offsets is desired, the int64_t API
|
||||
(functions with 64 suffix without underscore, notablly mpg123_reader64()) can be used since
|
||||
API version 48 (mpg123 1.32).
|
||||
|
||||
More complication: What about client code defining _LARGEFILE64_SOURCE? It might want direct access to the _64 functions, along with the ones without suffix. Well, that's possible now via defining MPG123_NO_LARGENAME and MPG123_LARGESUFFIX, respectively, for disabling or enforcing the suffix names.
|
||||
When in doubt, use the explicit 64 bit functions and avoid off_t in the API. You can define
|
||||
MPG123_PORTABLE_API to ensure that. That being said, if you and your compiler do not have
|
||||
problems with the concept of off_t, just use the normal API and be happy. Both 32 and 64
|
||||
bit versions will be present where appropriate.
|
||||
*/
|
||||
|
||||
#ifndef MPG123_PORTABLE_API
|
||||
/*
|
||||
Now, the renaming of large file aware functions.
|
||||
By default, it appends underscore _FILE_OFFSET_BITS (so, mpg123_seek_64 for mpg123_seek), if _FILE_OFFSET_BITS is defined. You can force a different suffix via MPG123_LARGESUFFIX (that must include the underscore), or you can just disable the whole mess by defining MPG123_NO_LARGENAME.
|
||||
|
@ -152,6 +140,7 @@ typedef ssize_t mpg123_ssize_t;
|
|||
#define mpg123_framepos MPG123_LARGENAME(mpg123_framepos)
|
||||
|
||||
#endif /* largefile hackery */
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
@ -174,6 +163,21 @@ struct mpg123_handle_struct;
|
|||
*/
|
||||
typedef struct mpg123_handle_struct mpg123_handle;
|
||||
|
||||
/** Get version of the mpg123 distribution this library build came with.
|
||||
* (optional means non-NULL)
|
||||
* \param major optional address to store major version number
|
||||
* \param minor optional address to store minor version number
|
||||
* \param patch optional address to store patchlevel version number
|
||||
* \return full version string (like "1.2.3-beta4 (experimental)")
|
||||
*/
|
||||
const char *mpg123_distversion(unsigned int *major, unsigned int *minor, unsigned int *patch);
|
||||
|
||||
/** Get API version of library build.
|
||||
* \param patch optional address to store patchlevel
|
||||
* \return API version of library
|
||||
*/
|
||||
unsigned int mpg123_libversion(unsigned int *patch);
|
||||
|
||||
/** Useless no-op that used to do initialization work.
|
||||
*
|
||||
* For API version before 46 (mpg123 1.27.0), you had to ensure to have
|
||||
|
@ -488,7 +492,7 @@ enum mpg123_errors
|
|||
MPG123_NO_TIMEOUT, /**< Build does not support stream timeouts. */
|
||||
MPG123_BAD_FILE, /**< File access error. */
|
||||
MPG123_NO_SEEK, /**< Seek not supported by stream. */
|
||||
MPG123_NO_READER, /**< No stream opened. */
|
||||
MPG123_NO_READER, /**< No stream opened or no reader callback setup. */
|
||||
MPG123_BAD_PARS, /**< Bad parameter handle. */
|
||||
MPG123_BAD_INDEX_PAR, /**< Bad parameters to mpg123_index() and mpg123_set_index() */
|
||||
MPG123_OUT_OF_SYNC, /**< Lost track in bytestream and did not try to resync. */
|
||||
|
@ -711,6 +715,7 @@ MPG123_EXPORT int mpg123_getformat2( mpg123_handle *mh
|
|||
* @{
|
||||
*/
|
||||
|
||||
#ifndef MPG123_PORTABLE_API
|
||||
/** Open a simple MPEG file with fixed properties.
|
||||
*
|
||||
* This function shall simplify the common use case of a plain MPEG
|
||||
|
@ -781,10 +786,12 @@ MPG123_EXPORT int mpg123_open(mpg123_handle *mh, const char *path);
|
|||
* \return MPG123_OK on success
|
||||
*/
|
||||
MPG123_EXPORT int mpg123_open_fd(mpg123_handle *mh, int fd);
|
||||
#endif
|
||||
|
||||
/** Use an opaque handle as bitstream input. This works only with the
|
||||
* replaced I/O from mpg123_replace_reader_handle()!
|
||||
* mpg123_close() will call the cleanup callback for your handle (if you gave one).
|
||||
* replaced I/O from mpg123_replace_reader_handle() or mpg123_reader64()!
|
||||
* mpg123_close() will call the cleanup callback for your non-NULL
|
||||
* handle (if you gave one).
|
||||
* \param mh handle
|
||||
* \param iohandle your handle
|
||||
* \return MPG123_OK on success
|
||||
|
@ -853,6 +860,7 @@ MPG123_EXPORT int mpg123_decode( mpg123_handle *mh
|
|||
, const unsigned char *inmemory, size_t inmemsize
|
||||
, void *outmemory, size_t outmemsize, size_t *done );
|
||||
|
||||
#ifndef MPG123_PORTABLE_API
|
||||
/** Decode next MPEG frame to internal buffer
|
||||
* or read a frame and return after setting a new format.
|
||||
* \param mh handle
|
||||
|
@ -875,6 +883,30 @@ MPG123_EXPORT int mpg123_decode_frame( mpg123_handle *mh
|
|||
*/
|
||||
MPG123_EXPORT int mpg123_framebyframe_decode( mpg123_handle *mh
|
||||
, off_t *num, unsigned char **audio, size_t *bytes );
|
||||
#endif /* un-portable API */
|
||||
|
||||
/** Decode next MPEG frame to internal buffer
|
||||
* or read a frame and return after setting a new format.
|
||||
* \param mh handle
|
||||
* \param num current frame offset gets stored there
|
||||
* \param audio This pointer is set to the internal buffer to read the decoded audio from.
|
||||
* \param bytes number of output bytes ready in the buffer
|
||||
* \return MPG123_OK or error/message code
|
||||
*/
|
||||
MPG123_EXPORT int mpg123_decode_frame64( mpg123_handle *mh
|
||||
, int64_t *num, unsigned char **audio, size_t *bytes );
|
||||
|
||||
/** Decode current MPEG frame to internal buffer.
|
||||
* Warning: This is experimental API that might change in future releases!
|
||||
* Please watch mpg123 development closely when using it.
|
||||
* \param mh handle
|
||||
* \param num last frame offset gets stored there
|
||||
* \param audio this pointer is set to the internal buffer to read the decoded audio from.
|
||||
* \param bytes number of output bytes ready in the buffer
|
||||
* \return MPG123_OK or error/message code
|
||||
*/
|
||||
MPG123_EXPORT int mpg123_framebyframe_decode64( mpg123_handle *mh
|
||||
, int64_t *num, unsigned char **audio, size_t *bytes );
|
||||
|
||||
/** Find, read and parse the next mp3 frame
|
||||
* Warning: This is experimental API that might change in future releases!
|
||||
|
@ -902,6 +934,7 @@ MPG123_EXPORT int mpg123_framebyframe_next(mpg123_handle *mh);
|
|||
MPG123_EXPORT int mpg123_framedata( mpg123_handle *mh
|
||||
, unsigned long *header, unsigned char **bodydata, size_t *bodybytes );
|
||||
|
||||
#ifndef MPG123_PORTABLE_API
|
||||
/** Get the input position (byte offset in stream) of the last parsed frame.
|
||||
* This can be used for external seek index building, for example.
|
||||
* It just returns the internally stored offset, regardless of validity --
|
||||
|
@ -910,6 +943,16 @@ MPG123_EXPORT int mpg123_framedata( mpg123_handle *mh
|
|||
* \return byte offset in stream
|
||||
*/
|
||||
MPG123_EXPORT off_t mpg123_framepos(mpg123_handle *mh);
|
||||
#endif
|
||||
|
||||
/** Get the 64 bit input position (byte offset in stream) of the last parsed frame.
|
||||
* This can be used for external seek index building, for example.
|
||||
* It just returns the internally stored offset, regardless of validity --
|
||||
* you ensure that a valid frame has been parsed before!
|
||||
* \param mh handle
|
||||
* \return byte offset in stream
|
||||
*/
|
||||
MPG123_EXPORT int64_t mpg123_framepos64(mpg123_handle *mh);
|
||||
|
||||
/** @} */
|
||||
|
||||
|
@ -936,6 +979,12 @@ MPG123_EXPORT off_t mpg123_framepos(mpg123_handle *mh);
|
|||
* - SEEK_CUR: change position by offset from now
|
||||
* - SEEK_END: set position to offset from end
|
||||
*
|
||||
* Since API version 48 (mpg123 1.32), the offset given with SEEK_END is always
|
||||
* taken to be negative in the terms of standard lseek(). You can only seek from
|
||||
* the end towards the beginning. All earlier versions had the sign wrong, positive
|
||||
* was towards the beginning, negative past the end (which results in error,
|
||||
* anyway).
|
||||
*
|
||||
* Note that sample-accurate seek only works when gapless support has been
|
||||
* enabled at compile time; seek is frame-accurate otherwise.
|
||||
* Also, really sample-accurate seeking (meaning that you get the identical
|
||||
|
@ -956,57 +1005,131 @@ MPG123_EXPORT off_t mpg123_framepos(mpg123_handle *mh);
|
|||
* @{
|
||||
*/
|
||||
|
||||
#ifndef MPG123_PORTABLE_API
|
||||
/** Returns the current position in samples.
|
||||
* On the next successful read, you'd get audio data with that offset.
|
||||
* \param mh handle
|
||||
* \return sample (PCM frame) offset or MPG123_ERR (null handle)
|
||||
*/
|
||||
MPG123_EXPORT off_t mpg123_tell(mpg123_handle *mh);
|
||||
#endif
|
||||
|
||||
/** Returns the current 64 bit position in samples.
|
||||
* On the next successful read, you'd get audio data with that offset.
|
||||
* \param mh handle
|
||||
* \return sample (PCM frame) offset or MPG123_ERR (null handle)
|
||||
*/
|
||||
MPG123_EXPORT int64_t mpg123_tell64(mpg123_handle *mh);
|
||||
|
||||
#ifndef MPG123_PORTABLE_API
|
||||
/** Returns the frame number that the next read will give you data from.
|
||||
* \param mh handle
|
||||
* \return frame offset or MPG123_ERR (null handle)
|
||||
*/
|
||||
MPG123_EXPORT off_t mpg123_tellframe(mpg123_handle *mh);
|
||||
#endif
|
||||
|
||||
/** Returns the 64 bit frame number that the next read will give you data from.
|
||||
* \param mh handle
|
||||
* \return frame offset or MPG123_ERR (null handle)
|
||||
*/
|
||||
MPG123_EXPORT int64_t mpg123_tellframe64(mpg123_handle *mh);
|
||||
|
||||
#ifndef MPG123_PORTABLE_API
|
||||
/** Returns the current byte offset in the input stream.
|
||||
* \param mh handle
|
||||
* \return byte offset or MPG123_ERR (null handle)
|
||||
*/
|
||||
MPG123_EXPORT off_t mpg123_tell_stream(mpg123_handle *mh);
|
||||
#endif
|
||||
|
||||
/** Returns the current 64 bit byte offset in the input stream.
|
||||
* \param mh handle
|
||||
* \return byte offset or MPG123_ERR (null handle)
|
||||
*/
|
||||
MPG123_EXPORT int64_t mpg123_tell_stream64(mpg123_handle *mh);
|
||||
|
||||
|
||||
#ifndef MPG123_PORTABLE_API
|
||||
/** Seek to a desired sample offset.
|
||||
* Usage is modelled afer the standard lseek().
|
||||
* \param mh handle
|
||||
* \param sampleoff offset in samples (PCM frames)
|
||||
* \param whence one of SEEK_SET, SEEK_CUR or SEEK_END
|
||||
* (Offset for SEEK_END is always effectively negative since API
|
||||
* version 48, was inverted from lseek() usage since ever before.)
|
||||
* \return The resulting offset >= 0 or error/message code
|
||||
*/
|
||||
MPG123_EXPORT off_t mpg123_seek( mpg123_handle *mh
|
||||
, off_t sampleoff, int whence );
|
||||
#endif
|
||||
|
||||
/** Seek to a desired 64 bit sample offset.
|
||||
* Usage is modelled afer the standard lseek().
|
||||
* \param mh handle
|
||||
* \param sampleoff offset in samples (PCM frames)
|
||||
* \param whence one of SEEK_SET, SEEK_CUR or SEEK_END
|
||||
* (Offset for SEEK_END is always effectively negative.)
|
||||
* \return The resulting offset >= 0 or error/message code
|
||||
*/
|
||||
MPG123_EXPORT int64_t mpg123_seek64( mpg123_handle *mh
|
||||
, int64_t sampleoff, int whence );
|
||||
|
||||
#ifndef MPG123_PORTABLE_API
|
||||
/** Seek to a desired sample offset in data feeding mode.
|
||||
* This just prepares things to be right only if you ensure that the next chunk
|
||||
* of input data will be from input_offset byte position.
|
||||
* \param mh handle
|
||||
* \param sampleoff offset in samples (PCM frames)
|
||||
* \param whence one of SEEK_SET, SEEK_CUR or SEEK_END
|
||||
* (Offset for SEEK_END is always effectively negative since API
|
||||
* version 48, was inverted from lseek() usage since ever before.)
|
||||
* \param input_offset The position it expects to be at the
|
||||
* next time data is fed to mpg123_decode().
|
||||
* \return The resulting offset >= 0 or error/message code
|
||||
*/
|
||||
MPG123_EXPORT off_t mpg123_feedseek( mpg123_handle *mh
|
||||
, off_t sampleoff, int whence, off_t *input_offset );
|
||||
#endif
|
||||
|
||||
/** Seek to a desired 64 bit sample offset in data feeding mode.
|
||||
* This just prepares things to be right only if you ensure that the next chunk
|
||||
* of input data will be from input_offset byte position.
|
||||
* \param mh handle
|
||||
* \param sampleoff offset in samples (PCM frames)
|
||||
* \param whence one of SEEK_SET, SEEK_CUR or SEEK_END
|
||||
* (Offset for SEEK_END is always effectively negative.)
|
||||
* \param input_offset The position it expects to be at the
|
||||
* next time data is fed to mpg123_decode().
|
||||
* \return The resulting offset >= 0 or error/message code
|
||||
*/
|
||||
MPG123_EXPORT int64_t mpg123_feedseek64( mpg123_handle *mh
|
||||
, int64_t sampleoff, int whence, int64_t *input_offset );
|
||||
|
||||
#ifndef MPG123_PORTABLE_API
|
||||
/** Seek to a desired MPEG frame offset.
|
||||
* Usage is modelled afer the standard lseek().
|
||||
* \param mh handle
|
||||
* \param frameoff offset in MPEG frames
|
||||
* \param whence one of SEEK_SET, SEEK_CUR or SEEK_END
|
||||
* (Offset for SEEK_END is always effectively negative since API
|
||||
* version 48, was inverted from lseek() usage since ever before.)
|
||||
* \return The resulting offset >= 0 or error/message code */
|
||||
MPG123_EXPORT off_t mpg123_seek_frame( mpg123_handle *mh
|
||||
, off_t frameoff, int whence );
|
||||
#endif
|
||||
|
||||
/** Seek to a desired 64 bit MPEG frame offset.
|
||||
* Usage is modelled afer the standard lseek().
|
||||
* \param mh handle
|
||||
* \param frameoff offset in MPEG frames
|
||||
* \param whence one of SEEK_SET, SEEK_CUR or SEEK_END
|
||||
* (Offset for SEEK_END is always effectively negative.)
|
||||
* \return The resulting offset >= 0 or error/message code */
|
||||
MPG123_EXPORT int64_t mpg123_seek_frame64( mpg123_handle *mh
|
||||
, int64_t frameoff, int whence );
|
||||
|
||||
#ifndef MPG123_PORTABLE_API
|
||||
/** Return a MPEG frame offset corresponding to an offset in seconds.
|
||||
* This assumes that the samples per frame do not change in the file/stream, which is a good assumption for any sane file/stream only.
|
||||
* \return frame offset >= 0 or error/message code */
|
||||
|
@ -1014,7 +1137,9 @@ MPG123_EXPORT off_t mpg123_timeframe(mpg123_handle *mh, double sec);
|
|||
|
||||
/** Give access to the frame index table that is managed for seeking.
|
||||
* You are asked not to modify the values... Use mpg123_set_index to set the
|
||||
* seek index
|
||||
* seek index.
|
||||
* Note: This can be just a copy of the data in case a conversion is done
|
||||
* from the internal 64 bit values.
|
||||
* \param mh handle
|
||||
* \param offsets pointer to the index array
|
||||
* \param step one index byte offset advances this many MPEG frames
|
||||
|
@ -1023,10 +1148,31 @@ MPG123_EXPORT off_t mpg123_timeframe(mpg123_handle *mh, double sec);
|
|||
*/
|
||||
MPG123_EXPORT int mpg123_index( mpg123_handle *mh
|
||||
, off_t **offsets, off_t *step, size_t *fill );
|
||||
#endif
|
||||
|
||||
/** Return a 64 bit MPEG frame offset corresponding to an offset in seconds.
|
||||
* This assumes that the samples per frame do not change in the file/stream, which is a good assumption for any sane file/stream only.
|
||||
* \return frame offset >= 0 or error/message code */
|
||||
MPG123_EXPORT int64_t mpg123_timeframe64(mpg123_handle *mh, double sec);
|
||||
|
||||
/** Give access to the 64 bit frame index table that is managed for seeking.
|
||||
* You are asked not to modify the values... Use mpg123_set_index to set the
|
||||
* seek index.
|
||||
* \param mh handle
|
||||
* \param offsets pointer to the index array
|
||||
* \param step one index byte offset advances this many MPEG frames
|
||||
* \param fill number of recorded index offsets; size of the array
|
||||
* \return MPG123_OK on success
|
||||
*/
|
||||
MPG123_EXPORT int mpg123_index64( mpg123_handle *mh
|
||||
, int64_t **offsets, int64_t *step, size_t *fill );
|
||||
|
||||
#ifndef MPG123_PORTABLE_API
|
||||
/** Set the frame index table
|
||||
* Setting offsets to NULL and fill > 0 will allocate fill entries. Setting offsets
|
||||
* to NULL and fill to 0 will clear the index and free the allocated memory used by the index.
|
||||
* Note that this function might involve conversion/copying of data because of
|
||||
* the varying nature of off_t. Better use mpg123_set_index64().
|
||||
* \param mh handle
|
||||
* \param offsets pointer to the index array
|
||||
* \param step one index byte offset advances this many MPEG frames
|
||||
|
@ -1035,15 +1181,31 @@ MPG123_EXPORT int mpg123_index( mpg123_handle *mh
|
|||
*/
|
||||
MPG123_EXPORT int mpg123_set_index( mpg123_handle *mh
|
||||
, off_t *offsets, off_t step, size_t fill );
|
||||
#endif
|
||||
|
||||
/** Set the 64 bit frame index table
|
||||
* Setting offsets to NULL and fill > 0 will allocate fill entries. Setting offsets
|
||||
* to NULL and fill to 0 will clear the index and free the allocated memory used by the index.
|
||||
* \param mh handle
|
||||
* \param offsets pointer to the index array
|
||||
* \param step one index byte offset advances this many MPEG frames
|
||||
* \param fill number of recorded index offsets; size of the array
|
||||
* \return MPG123_OK on success
|
||||
*/
|
||||
MPG123_EXPORT int mpg123_set_index64( mpg123_handle *mh
|
||||
, int64_t *offsets, int64_t step, size_t fill );
|
||||
|
||||
|
||||
#ifndef MPG123_PORTABLE_API
|
||||
/** An old crutch to keep old mpg123 binaries happy.
|
||||
* WARNING: This function is there only to avoid runtime linking errors with
|
||||
* standalone mpg123 before version 1.23.0 (if you strangely update the
|
||||
* standalone mpg123 before version 1.32.0 (if you strangely update the
|
||||
* library but not the end-user program) and actually is broken
|
||||
* for various cases (p.ex. 24 bit output). Do never use. It might eventually
|
||||
* be purged from the library.
|
||||
*/
|
||||
MPG123_EXPORT int mpg123_position( mpg123_handle *mh, off_t frame_offset, off_t buffered_bytes, off_t *current_frame, off_t *frames_left, double *current_seconds, double *seconds_left);
|
||||
MPG123_EXPORT int mpg123_position( mpg123_handle *mh, off_t INT123_frame_offset, off_t buffered_bytes, off_t *current_frame, off_t *frames_left, double *current_seconds, double *seconds_left);
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
|
||||
|
@ -1093,6 +1255,28 @@ MPG123_EXPORT int mpg123_eq( mpg123_handle *mh
|
|||
MPG123_EXPORT int mpg123_eq2( mpg123_handle *mh
|
||||
, int channel, int band, double val );
|
||||
|
||||
/** Set a range of equalizer bands
|
||||
* \param channel Can be #MPG123_LEFT, #MPG123_RIGHT or
|
||||
* #MPG123_LEFT|#MPG123_RIGHT for both.
|
||||
* \param a The first equalizer band to set (from 0 to 31)
|
||||
* \param b The last equalizer band to set (from 0 to 31)
|
||||
* \param factor The (linear) adjustment factor, 1 being neutral.
|
||||
* \return MPG123_OK on success
|
||||
*/
|
||||
MPG123_EXPORT int mpg123_eq_bands( mpg123_handle *mh
|
||||
, int channel, int a, int b, double factor );
|
||||
|
||||
/** Change a range of equalizer bands
|
||||
* \param channel Can be #MPG123_LEFT, #MPG123_RIGHT or
|
||||
* #MPG123_LEFT|#MPG123_RIGHT for both.
|
||||
* \param a The first equalizer band to change (from 0 to 31)
|
||||
* \param b The last equalizer band to change (from 0 to 31)
|
||||
* \param db The adjustment in dB (limited to +/- 60 dB).
|
||||
* \return MPG123_OK on success
|
||||
*/
|
||||
MPG123_EXPORT int mpg123_eq_change( mpg123_handle *mh
|
||||
, int channel, int a, int b, double db );
|
||||
|
||||
#ifdef MPG123_ENUM_API
|
||||
/** Get the 32 Band Audio Equalizer settings.
|
||||
*
|
||||
|
@ -1141,6 +1325,13 @@ MPG123_EXPORT int mpg123_volume(mpg123_handle *mh, double vol);
|
|||
*/
|
||||
MPG123_EXPORT int mpg123_volume_change(mpg123_handle *mh, double change);
|
||||
|
||||
/** Adjust output volume including the RVA setting by chosen amount
|
||||
* \param mh handle
|
||||
* \param db volume adjustment in decibels (limited to +/- 60 dB)
|
||||
* \return MPG123_OK on success
|
||||
*/
|
||||
MPG123_EXPORT int mpg123_volume_change_db(mpg123_handle *mh, double db);
|
||||
|
||||
/** Return current volume setting, the actual value due to RVA, and the RVA
|
||||
* adjustment itself. It's all as double float value to abstract the sample
|
||||
* format. The volume values are linear factors / amplitudes (not percent)
|
||||
|
@ -1304,6 +1495,7 @@ MPG123_EXPORT size_t mpg123_safe_buffer(void);
|
|||
*/
|
||||
MPG123_EXPORT int mpg123_scan(mpg123_handle *mh);
|
||||
|
||||
#ifndef MPG123_PORTABLE_API
|
||||
/** Return, if possible, the full (expected) length of current track in
|
||||
* MPEG frames.
|
||||
* \param mh handle
|
||||
|
@ -1332,6 +1524,36 @@ MPG123_EXPORT off_t mpg123_length(mpg123_handle *mh);
|
|||
* \return MPG123_OK on success
|
||||
*/
|
||||
MPG123_EXPORT int mpg123_set_filesize(mpg123_handle *mh, off_t size);
|
||||
#endif
|
||||
|
||||
/** Return, if possible, the full (expected) length of current track in
|
||||
* MPEG frames as 64 bit number.
|
||||
* \param mh handle
|
||||
* \return length >= 0 or MPG123_ERR if there is no length guess possible.
|
||||
*/
|
||||
MPG123_EXPORT int64_t mpg123_framelength64(mpg123_handle *mh);
|
||||
|
||||
/** Return, if possible, the full (expected) length of current
|
||||
* track in samples (PCM frames) as 64 bit value.
|
||||
*
|
||||
* This relies either on an Info frame at the beginning or a previous
|
||||
* call to mpg123_scan() to get the real number of MPEG frames in a
|
||||
* file. It will guess based on file size if neither Info frame nor
|
||||
* scan data are present. In any case, there is no guarantee that the
|
||||
* decoder will not give you more data, for example in case the open
|
||||
* file gets appended to during decoding.
|
||||
* \param mh handle
|
||||
* \return length >= 0 or MPG123_ERR if there is no length guess possible.
|
||||
*/
|
||||
MPG123_EXPORT int64_t mpg123_length64(mpg123_handle *mh);
|
||||
|
||||
/** Override the 64 bit value for file size in bytes.
|
||||
* Useful for getting sensible track length values in feed mode or for HTTP streams.
|
||||
* \param mh handle
|
||||
* \param size file size in bytes
|
||||
* \return MPG123_OK on success
|
||||
*/
|
||||
MPG123_EXPORT int mpg123_set_filesize64(mpg123_handle *mh, int64_t size);
|
||||
|
||||
/** Get MPEG frame duration in seconds.
|
||||
* \param mh handle
|
||||
|
@ -1741,7 +1963,7 @@ MPG123_EXPORT int mpg123_id3( mpg123_handle *mh
|
|||
, mpg123_id3v1 **v1, mpg123_id3v2 **v2 );
|
||||
|
||||
/** Return pointers to and size of stored raw ID3 data if storage has
|
||||
* been configured with MPG123_RAW_ID3 and stream parsing passed the
|
||||
* been configured with MPG123_STORE_RAW_ID3 and stream parsing passed the
|
||||
* metadata already. Null value with zero size is a possibility!
|
||||
* The storage can change at any next API call.
|
||||
*
|
||||
|
@ -1955,12 +2177,13 @@ MPG123_EXPORT int mpg123_replace_buffer(mpg123_handle *mh
|
|||
*/
|
||||
MPG123_EXPORT size_t mpg123_outblock(mpg123_handle *mh);
|
||||
|
||||
#ifndef MPG123_PORTABLE_API
|
||||
/** Replace low-level stream access functions; read and lseek as known in POSIX.
|
||||
* You can use this to make any fancy file opening/closing yourself,
|
||||
* using mpg123_open_fd() to set the file descriptor for your read/lseek
|
||||
* (doesn't need to be a "real" file descriptor...).
|
||||
* Setting a function to NULL means that the default internal read is
|
||||
* used (active from next mpg123_open call on).
|
||||
* Setting a function to NULL means that just a call to POSIX read/lseek is
|
||||
* done (without handling signals).
|
||||
* Note: As it would be troublesome to mess with this while having a file open,
|
||||
* this implies mpg123_close().
|
||||
* \param mh handle
|
||||
|
@ -1983,7 +2206,7 @@ MPG123_EXPORT int mpg123_replace_reader( mpg123_handle *mh
|
|||
* \param mh handle
|
||||
* \param r_read callback for reading (behaviour like POSIX read)
|
||||
* \param r_lseek callback for seeking (like POSIX lseek)
|
||||
* \param cleanup A callback to clean up an I/O handle on mpg123_close,
|
||||
* \param cleanup A callback to clean up a non-NULL I/O handle on mpg123_close,
|
||||
* can be NULL for none (you take care of cleaning your handles).
|
||||
* \return MPG123_OK on success
|
||||
*/
|
||||
|
@ -1991,6 +2214,27 @@ MPG123_EXPORT int mpg123_replace_reader_handle( mpg123_handle *mh
|
|||
, mpg123_ssize_t (*r_read) (void *, void *, size_t)
|
||||
, off_t (*r_lseek)(void *, off_t, int)
|
||||
, void (*cleanup)(void*) );
|
||||
#endif
|
||||
|
||||
/** Set up portable read functions on an opaque handle.
|
||||
* The handle is a void pointer, so you can pass any data you want...
|
||||
* mpg123_open_handle() is the call you make to use the I/O defined here.
|
||||
* There is no fallback to internal read/seek here.
|
||||
* Note: As it would be troublesome to mess with this while having a file open,
|
||||
* this mpg123_close() is implied here.
|
||||
* \param mh handle
|
||||
* \param r_read callback for reading
|
||||
* The parameters are the handle, the buffer to read into, a byte count to read,
|
||||
* address to store the returned byte count. Return value is zero for
|
||||
* no issue, non-zero for some error. Recoverable signal handling has to happen
|
||||
* inside the callback.
|
||||
* \param r_lseek callback for seeking (like POSIX lseek), maybe NULL for
|
||||
* non-seekable streams
|
||||
* \param cleanup A callback to clean up a non-NULL I/O handle on mpg123_close,
|
||||
* maybe NULL for none
|
||||
* \return MPG123_OK on success
|
||||
*/
|
||||
MPG123_EXPORT int mpg123_reader64( mpg123_handle *mh, int (*r_read) (void *, void *, size_t, size_t *), int64_t (*r_lseek)(void *, int64_t, int), void (*cleanup)(void*) );
|
||||
|
||||
/** @} */
|
||||
|
||||
|
|
342
ThirdParty/mpg123/include/mpg123/mpg123lib_intern.h
vendored
342
ThirdParty/mpg123/include/mpg123/mpg123lib_intern.h
vendored
|
@ -1,342 +0,0 @@
|
|||
/*
|
||||
mpg123lib_intern: Common non-public stuff for libmpg123
|
||||
|
||||
copyright 1995-2021 by the mpg123 project - free software under the terms of the LGPL 2.1
|
||||
see COPYING and AUTHORS files in distribution or http://mpg123.org
|
||||
|
||||
derived from the old mpg123.h
|
||||
*/
|
||||
|
||||
#ifndef MPG123_H_INTERN
|
||||
#define MPG123_H_INTERN
|
||||
|
||||
#define MPG123_RATES 9
|
||||
#define MPG123_ENCODINGS 12
|
||||
|
||||
#include "config.h" /* Load this before _anything_ */
|
||||
#include "intsym.h" /* Prefixing of internal symbols that still are public in a static lib. */
|
||||
|
||||
#include "abi_align.h"
|
||||
|
||||
/* export DLL symbols */
|
||||
#if defined(WIN32) && defined(DYNAMIC_BUILD)
|
||||
#define BUILD_MPG123_DLL
|
||||
#endif
|
||||
#include "compat.h"
|
||||
#define MPG123_ENUM_API
|
||||
#include "mpg123.h"
|
||||
|
||||
#define SKIP_JUNK 1
|
||||
|
||||
#ifndef M_PI
|
||||
# define M_PI 3.14159265358979323846
|
||||
#endif
|
||||
#ifndef M_SQRT2
|
||||
# define M_SQRT2 1.41421356237309504880
|
||||
#endif
|
||||
|
||||
#ifdef SUNOS
|
||||
#define memmove(dst,src,size) bcopy(src,dst,size)
|
||||
#endif
|
||||
|
||||
// The real type is either 32 bit float or integer. We do not attempt
|
||||
// double precision for MPEG audio decoding (or any audio storage/compression
|
||||
// format, even).
|
||||
// The calctables tool works in double precision float, but converts to fixed
|
||||
// point 'real' on output in addition to floating point.
|
||||
|
||||
// The base type used in the computation code.
|
||||
// With C11 we could rely on tgmath for sin() to use the right precision.
|
||||
#ifdef CALCTABLES
|
||||
# define clreal double
|
||||
# define COS cos
|
||||
# define SIN sin
|
||||
# define TAN tan
|
||||
# define POW pow
|
||||
#else
|
||||
# define clreal float
|
||||
# define COS cosf
|
||||
# define SIN sinf
|
||||
# define TAN tanf
|
||||
# define POW powf
|
||||
#endif
|
||||
|
||||
#if defined(REAL_IS_FLOAT) && !defined(CALCTABLES)
|
||||
|
||||
#define real float
|
||||
|
||||
#elif defined(REAL_IS_FIXED) || defined(CALCTABLES)
|
||||
|
||||
#ifdef RUNTIME_TABLES
|
||||
#error "Runtime tables are only for floating point decoders."
|
||||
#endif
|
||||
|
||||
# define real int32_t
|
||||
# define dreal int64_t
|
||||
|
||||
/*
|
||||
for fixed-point decoders, use pre-calculated tables to avoid expensive floating-point maths
|
||||
undef this macro for run-time calculation
|
||||
*/
|
||||
|
||||
# define REAL_RADIX 24
|
||||
# define REAL_FACTOR 16777216.0
|
||||
|
||||
static inline int32_t double_to_long_rounded(double x, double scalefac)
|
||||
{
|
||||
x *= scalefac;
|
||||
x += (x > 0) ? 0.5 : -0.5;
|
||||
return (int32_t)x;
|
||||
}
|
||||
|
||||
static inline int32_t scale_rounded(int32_t x, int shift)
|
||||
{
|
||||
x += (x >> 31);
|
||||
x >>= (shift - 1);
|
||||
x += (x & 1);
|
||||
return (x >> 1);
|
||||
}
|
||||
|
||||
# ifdef __GNUC__
|
||||
# if defined(OPT_I386)
|
||||
/* for i386_nofpu decoder */
|
||||
# define REAL_MUL_ASM(x, y, radix) \
|
||||
({ \
|
||||
long _x=(x), _y=(y); \
|
||||
__asm__ ( \
|
||||
"imull %1 \n\t" \
|
||||
"shrdl %2, %%edx, %0 \n\t" \
|
||||
: "+&a" (_x) \
|
||||
: "mr" (_y), "I" (radix) \
|
||||
: "%edx", "cc" \
|
||||
); \
|
||||
_x; \
|
||||
})
|
||||
|
||||
# define REAL_MUL_SCALE_LAYER3_ASM(x, y, radix) \
|
||||
({ \
|
||||
long _x=(x), _y=(y), _radix=(radix); \
|
||||
__asm__ ( \
|
||||
"imull %1 \n\t" \
|
||||
"shrdl %%cl, %%edx, %0 \n\t" \
|
||||
: "+&a" (_x) \
|
||||
: "mr" (_y), "c" (_radix) \
|
||||
: "%edx", "cc" \
|
||||
); \
|
||||
_x; \
|
||||
})
|
||||
# elif defined(OPT_PPC)
|
||||
/* for powerpc */
|
||||
# define REAL_MUL_ASM(x, y, radix) \
|
||||
({ \
|
||||
long _x=(x), _y=(y), _mull, _mulh; \
|
||||
__asm__ ( \
|
||||
"mullw %0, %2, %3 \n\t" \
|
||||
"mulhw %1, %2, %3 \n\t" \
|
||||
"srwi %0, %0, %4 \n\t" \
|
||||
"rlwimi %0, %1, %5, 0, %6 \n\t" \
|
||||
: "=&r" (_mull), "=&r" (_mulh) \
|
||||
: "r" (_x), "r" (_y), "i" (radix), "i" (32-(radix)), "i" ((radix)-1) \
|
||||
); \
|
||||
_mull; \
|
||||
})
|
||||
|
||||
# define REAL_MUL_SCALE_LAYER3_ASM(x, y, radix) \
|
||||
({ \
|
||||
long _x=(x), _y=(y), _radix=(radix), _mull, _mulh, _radix2; \
|
||||
__asm__ ( \
|
||||
"mullw %0, %3, %4 \n\t" \
|
||||
"mulhw %1, %3, %4 \n\t" \
|
||||
"subfic %2, %5, 32 \n\t" \
|
||||
"srw %0, %0, %5 \n\t" \
|
||||
"slw %1, %1, %2 \n\t" \
|
||||
"or %0, %0, %1 \n\t" \
|
||||
: "=&r" (_mull), "=&r" (_mulh), "=&r" (_radix2) \
|
||||
: "r" (_x), "r" (_y), "r" (_radix) \
|
||||
: "cc" \
|
||||
); \
|
||||
_mull; \
|
||||
})
|
||||
# elif defined(OPT_ARM)
|
||||
/* for arm */
|
||||
# define REAL_MUL_ASM(x, y, radix) \
|
||||
({ \
|
||||
long _x=(x), _y=(y), _mull, _mulh; \
|
||||
__asm__ ( \
|
||||
"smull %0, %1, %2, %3 \n\t" \
|
||||
"mov %0, %0, lsr %4 \n\t" \
|
||||
"orr %0, %0, %1, lsl %5 \n\t" \
|
||||
: "=&r" (_mull), "=&r" (_mulh) \
|
||||
: "r" (_x), "r" (_y), "M" (radix), "M" (32-(radix)) \
|
||||
); \
|
||||
_mull; \
|
||||
})
|
||||
|
||||
# define REAL_MUL_SCALE_LAYER3_ASM(x, y, radix) \
|
||||
({ \
|
||||
long _x=(x), _y=(y), _radix=(radix), _mull, _mulh, _radix2; \
|
||||
__asm__ ( \
|
||||
"smull %0, %1, %3, %4 \n\t" \
|
||||
"mov %0, %0, lsr %5 \n\t" \
|
||||
"rsb %2, %5, #32 \n\t" \
|
||||
"mov %1, %1, lsl %2 \n\t" \
|
||||
"orr %0, %0, %1 \n\t" \
|
||||
: "=&r" (_mull), "=&r" (_mulh), "=&r" (_radix2) \
|
||||
: "r" (_x), "r" (_y), "r" (_radix) \
|
||||
); \
|
||||
_mull; \
|
||||
})
|
||||
# endif
|
||||
# endif
|
||||
|
||||
/* I just changed the (int) to (real) there... seemed right. */
|
||||
# define DOUBLE_TO_REAL(x) (double_to_long_rounded(x, REAL_FACTOR))
|
||||
# define SCALE_15 32768.0
|
||||
# define DOUBLE_TO_REAL_15(x) (double_to_long_rounded(x, SCALE_15))
|
||||
# define SCALE_POW43 8192.0
|
||||
# define DOUBLE_TO_REAL_POW43(x) (double_to_long_rounded(x, SCALE_POW43))
|
||||
# define SCALE_LAYER12 1073741824.0
|
||||
# define DOUBLE_TO_REAL_SCALE_LAYER12(x) (double_to_long_rounded(x, SCALE_LAYER12))
|
||||
# define DOUBLE_TO_REAL_SCALE_LAYER3(x, y) (double_to_long_rounded(x, pow(2.0,gainpow2_scale[y])))
|
||||
# define REAL_TO_DOUBLE(x) ((double)(x) / REAL_FACTOR)
|
||||
# ifdef REAL_MUL_ASM
|
||||
# define REAL_MUL(x, y) REAL_MUL_ASM(x, y, REAL_RADIX)
|
||||
# define REAL_MUL_15(x, y) REAL_MUL_ASM(x, y, 15)
|
||||
# define REAL_MUL_SCALE_LAYER12(x, y) REAL_MUL_ASM(x, y, 15 + 30 - REAL_RADIX)
|
||||
# else
|
||||
# define REAL_MUL(x, y) (((dreal)(x) * (dreal)(y)) >> REAL_RADIX)
|
||||
# define REAL_MUL_15(x, y) (((dreal)(x) * (dreal)(y)) >> 15)
|
||||
# define REAL_MUL_SCALE_LAYER12(x, y) (((dreal)(x) * (dreal)(y)) >> (15 + 30 - REAL_RADIX))
|
||||
# endif
|
||||
# ifdef REAL_MUL_SCALE_LAYER3_ASM
|
||||
# define REAL_MUL_SCALE_LAYER3(x, y, z) REAL_MUL_SCALE_LAYER3_ASM(x, y, 13 + gainpow2_scale[z] - REAL_RADIX)
|
||||
# else
|
||||
# define REAL_MUL_SCALE_LAYER3(x, y, z) (((dreal)(x) * (dreal)(y)) >> (13 + gainpow2_scale[z] - REAL_RADIX))
|
||||
# endif
|
||||
# define REAL_SCALE_LAYER12(x) ((real)((x) >> (30 - REAL_RADIX)))
|
||||
# define REAL_SCALE_LAYER3(x, y) ((real)((x) >> (gainpow2_scale[y] - REAL_RADIX)))
|
||||
# ifdef ACCURATE_ROUNDING
|
||||
# define REAL_MUL_SYNTH(x, y) REAL_MUL(x, y)
|
||||
# define REAL_SCALE_DCT64(x) (x)
|
||||
# define REAL_SCALE_WINDOW(x) (x)
|
||||
# else
|
||||
# define REAL_MUL_SYNTH(x, y) ((x) * (y))
|
||||
# define REAL_SCALE_DCT64(x) ((x) >> 8)
|
||||
# define REAL_SCALE_WINDOW(x) scale_rounded(x, 16)
|
||||
# endif
|
||||
|
||||
#else
|
||||
|
||||
#error "Simple float or fixed-point, nothing else makes sense."
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef REAL_IS_FIXED
|
||||
# if (defined SIZEOF_INT32_T) && (SIZEOF_INT32_T != 4)
|
||||
# error "Bad 32bit types!!!"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef DOUBLE_TO_REAL
|
||||
# define DOUBLE_TO_REAL(x) (real)(x)
|
||||
#endif
|
||||
#ifndef DOUBLE_TO_REAL_15
|
||||
# define DOUBLE_TO_REAL_15(x) (real)(x)
|
||||
#endif
|
||||
#ifndef DOUBLE_TO_REAL_POW43
|
||||
# define DOUBLE_TO_REAL_POW43(x) (real)(x)
|
||||
#endif
|
||||
#ifndef DOUBLE_TO_REAL_SCALE_LAYER12
|
||||
# define DOUBLE_TO_REAL_SCALE_LAYER12(x) (real)(x)
|
||||
#endif
|
||||
#ifndef DOUBLE_TO_REAL_SCALE_LAYER3
|
||||
# define DOUBLE_TO_REAL_SCALE_LAYER3(x, y) (real)(x)
|
||||
#endif
|
||||
#ifndef REAL_TO_DOUBLE
|
||||
# define REAL_TO_DOUBLE(x) (x)
|
||||
#endif
|
||||
|
||||
#ifndef REAL_MUL
|
||||
# define REAL_MUL(x, y) ((x) * (y))
|
||||
#endif
|
||||
#ifndef REAL_MUL_SYNTH
|
||||
# define REAL_MUL_SYNTH(x, y) ((x) * (y))
|
||||
#endif
|
||||
#ifndef REAL_MUL_15
|
||||
# define REAL_MUL_15(x, y) ((x) * (y))
|
||||
#endif
|
||||
#ifndef REAL_MUL_SCALE_LAYER12
|
||||
# define REAL_MUL_SCALE_LAYER12(x, y) ((x) * (y))
|
||||
#endif
|
||||
#ifndef REAL_MUL_SCALE_LAYER3
|
||||
# define REAL_MUL_SCALE_LAYER3(x, y, z) ((x) * (y))
|
||||
#endif
|
||||
#ifndef REAL_SCALE_LAYER12
|
||||
# define REAL_SCALE_LAYER12(x) (x)
|
||||
#endif
|
||||
#ifndef REAL_SCALE_LAYER3
|
||||
# define REAL_SCALE_LAYER3(x, y) (x)
|
||||
#endif
|
||||
#ifndef REAL_SCALE_DCT64
|
||||
# define REAL_SCALE_DCT64(x) (x)
|
||||
#endif
|
||||
|
||||
/* used to be: AUDIOBUFSIZE = n*64 with n=1,2,3 ...
|
||||
now: factor on minimum frame buffer size (which takes upsampling into account) */
|
||||
#define AUDIOBUFSIZE 2
|
||||
|
||||
#include "true.h"
|
||||
|
||||
#define MAX_NAME_SIZE 81
|
||||
#define SBLIMIT 32
|
||||
#define SCALE_BLOCK 12
|
||||
#define SSLIMIT 18
|
||||
|
||||
/* Same as MPG_M_* */
|
||||
#define MPG_MD_STEREO 0
|
||||
#define MPG_MD_JOINT_STEREO 1
|
||||
#define MPG_MD_DUAL_CHANNEL 2
|
||||
#define MPG_MD_MONO 3
|
||||
|
||||
/* We support short or float output samples...
|
||||
Short integer amplitude is scaled by this. */
|
||||
#define SHORT_SCALE 32768
|
||||
/* That scales a short-scaled value to a 32bit integer scaled one
|
||||
value = 2**31/2**15 */
|
||||
#define S32_RESCALE 65536
|
||||
|
||||
/* Pre Shift fo 16 to 8 bit converter table */
|
||||
#define AUSHIFT (3)
|
||||
|
||||
#include "optimize.h"
|
||||
#include "decode.h"
|
||||
#include "parse.h"
|
||||
#include "frame.h"
|
||||
|
||||
/* fr is a mpg123_handle* by convention here... */
|
||||
#define NOQUIET (!(fr->p.flags & MPG123_QUIET))
|
||||
#define VERBOSE (NOQUIET && fr->p.verbose)
|
||||
#define VERBOSE2 (NOQUIET && fr->p.verbose > 1)
|
||||
#define VERBOSE3 (NOQUIET && fr->p.verbose > 2)
|
||||
#define VERBOSE4 (NOQUIET && fr->p.verbose > 3)
|
||||
#define PVERB(mp, level) (!((mp)->flags & MPG123_QUIET) && (mp)->verbose >= (level))
|
||||
|
||||
int decode_update(mpg123_handle *mh);
|
||||
/* residing in format.c */
|
||||
off_t decoder_synth_bytes(mpg123_handle *fr , off_t s);
|
||||
off_t samples_to_bytes(mpg123_handle *fr , off_t s);
|
||||
off_t bytes_to_samples(mpg123_handle *fr , off_t b);
|
||||
off_t outblock_bytes(mpg123_handle *fr, off_t s);
|
||||
/* Postprocessing format conversion of freshly decoded buffer. */
|
||||
void postprocess_buffer(mpg123_handle *fr);
|
||||
|
||||
int open_fixed_pre(mpg123_handle *mh, int channels, int encoding);
|
||||
int open_fixed_post(mpg123_handle *mh, int channels, int encoding);
|
||||
|
||||
/* If networking is enabled and we really mean internal networking, the timeout_read function is available. */
|
||||
#if defined (NETWORK) && !defined (WANT_WIN32_SOCKETS)
|
||||
/* Does not work with win32 */
|
||||
#define TIMEOUT_READ
|
||||
#endif
|
||||
|
||||
#endif
|
824
ThirdParty/mpg123/include/mpg123/newhuffman.h
vendored
824
ThirdParty/mpg123/include/mpg123/newhuffman.h
vendored
|
@ -1,824 +0,0 @@
|
|||
/*
|
||||
nwehuffman.h: optimized huffman tables (radix-4 lookup)
|
||||
|
||||
copyright 1995-2013 by the mpg123 project - free software under the terms of the LGPL 2.1
|
||||
see COPYING and AUTHORS files in distribution or http://mpg123.org
|
||||
initially written by Taihei Monma
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _MPG123_NEWHUFFMAN_H_
|
||||
#define _MPG123_NEWHUFFMAN_H_
|
||||
|
||||
struct newhuff
|
||||
{
|
||||
unsigned int linbits;
|
||||
const short *table;
|
||||
};
|
||||
|
||||
static const short tab0_[] =
|
||||
{
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
};
|
||||
|
||||
static const short tab1_[] =
|
||||
{
|
||||
0x0311, 0x0311, 0x0301, 0x0301, 0x0210, 0x0210, 0x0210, 0x0210,
|
||||
0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100,
|
||||
};
|
||||
|
||||
static const short tab2_[] =
|
||||
{
|
||||
-16, -32, 0x0311, 0x0311, 0x0301, 0x0301, 0x0310, 0x0310,
|
||||
0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100,
|
||||
0x0222, 0x0222, 0x0222, 0x0222, 0x0202, 0x0202, 0x0202, 0x0202,
|
||||
0x0112, 0x0112, 0x0112, 0x0112, 0x0112, 0x0112, 0x0112, 0x0112,
|
||||
0x0121, 0x0121, 0x0121, 0x0121, 0x0121, 0x0121, 0x0121, 0x0121,
|
||||
0x0120, 0x0120, 0x0120, 0x0120, 0x0120, 0x0120, 0x0120, 0x0120,
|
||||
};
|
||||
|
||||
static const short tab3_[] =
|
||||
{
|
||||
-16, -32, 0x0310, 0x0310, 0x0211, 0x0211, 0x0211, 0x0211,
|
||||
0x0201, 0x0201, 0x0201, 0x0201, 0x0200, 0x0200, 0x0200, 0x0200,
|
||||
0x0222, 0x0222, 0x0222, 0x0222, 0x0202, 0x0202, 0x0202, 0x0202,
|
||||
0x0112, 0x0112, 0x0112, 0x0112, 0x0112, 0x0112, 0x0112, 0x0112,
|
||||
0x0121, 0x0121, 0x0121, 0x0121, 0x0121, 0x0121, 0x0121, 0x0121,
|
||||
0x0120, 0x0120, 0x0120, 0x0120, 0x0120, 0x0120, 0x0120, 0x0120
|
||||
};
|
||||
|
||||
static const short tab5_[] =
|
||||
{
|
||||
-16, -32, 0x0311, 0x0311, 0x0301, 0x0301, 0x0310, 0x0310,
|
||||
0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100,
|
||||
0x0433, 0x0423, 0x0332, 0x0332, 0x0231, 0x0231, 0x0231, 0x0231,
|
||||
0x0313, 0x0313, 0x0303, 0x0303, 0x0330, 0x0330, 0x0322, 0x0322,
|
||||
0x0212, 0x0212, 0x0212, 0x0212, 0x0221, 0x0221, 0x0221, 0x0221,
|
||||
0x0202, 0x0202, 0x0202, 0x0202, 0x0220, 0x0220, 0x0220, 0x0220,
|
||||
};
|
||||
|
||||
static const short tab6_[] =
|
||||
{
|
||||
-16, -32, -48, 0x0412, 0x0421, 0x0420, 0x0301, 0x0301,
|
||||
0x0211, 0x0211, 0x0211, 0x0211, 0x0310, 0x0310, 0x0300, 0x0300,
|
||||
0x0333, 0x0333, 0x0303, 0x0303, 0x0223, 0x0223, 0x0223, 0x0223,
|
||||
0x0232, 0x0232, 0x0232, 0x0232, 0x0230, 0x0230, 0x0230, 0x0230,
|
||||
0x0113, 0x0113, 0x0113, 0x0113, 0x0113, 0x0113, 0x0113, 0x0113,
|
||||
0x0131, 0x0131, 0x0131, 0x0131, 0x0131, 0x0131, 0x0131, 0x0131,
|
||||
0x0122, 0x0122, 0x0122, 0x0122, 0x0122, 0x0122, 0x0122, 0x0122,
|
||||
0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102,
|
||||
};
|
||||
|
||||
static const short tab7_[] =
|
||||
{
|
||||
-16, -32, -48, 0x0411, 0x0301, 0x0301, 0x0310, 0x0310,
|
||||
0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100,
|
||||
-48, -64, -80, 0x0415, 0x0451, -96, 0x0450, -112,
|
||||
0x0424, 0x0442, 0x0314, 0x0314, 0x0341, 0x0341, 0x0340, 0x0340,
|
||||
0x0404, 0x0423, 0x0432, 0x0403, 0x0313, 0x0313, 0x0331, 0x0331,
|
||||
0x0330, 0x0330, 0x0322, 0x0322, 0x0212, 0x0212, 0x0212, 0x0212,
|
||||
0x0121, 0x0121, 0x0121, 0x0121, 0x0121, 0x0121, 0x0121, 0x0121,
|
||||
0x0202, 0x0202, 0x0202, 0x0202, 0x0220, 0x0220, 0x0220, 0x0220,
|
||||
0x0255, 0x0255, 0x0255, 0x0255, 0x0245, 0x0245, 0x0245, 0x0245,
|
||||
0x0254, 0x0254, 0x0254, 0x0254, 0x0253, 0x0253, 0x0253, 0x0253,
|
||||
0x0135, 0x0135, 0x0135, 0x0135, 0x0135, 0x0135, 0x0135, 0x0135,
|
||||
0x0144, 0x0144, 0x0144, 0x0144, 0x0144, 0x0144, 0x0144, 0x0144,
|
||||
0x0125, 0x0125, 0x0125, 0x0125, 0x0125, 0x0125, 0x0125, 0x0125,
|
||||
0x0152, 0x0152, 0x0152, 0x0152, 0x0152, 0x0152, 0x0152, 0x0152,
|
||||
0x0105, 0x0105, 0x0105, 0x0105, 0x0105, 0x0105, 0x0105, 0x0105,
|
||||
0x0134, 0x0134, 0x0134, 0x0134, 0x0134, 0x0134, 0x0134, 0x0134,
|
||||
0x0143, 0x0143, 0x0143, 0x0143, 0x0143, 0x0143, 0x0143, 0x0143,
|
||||
0x0133, 0x0133, 0x0133, 0x0133, 0x0133, 0x0133, 0x0133, 0x0133,
|
||||
};
|
||||
|
||||
static const short tab8_[] =
|
||||
{
|
||||
-16, -32, 0x0412, 0x0421, 0x0211, 0x0211, 0x0211, 0x0211,
|
||||
0x0301, 0x0301, 0x0310, 0x0310, 0x0200, 0x0200, 0x0200, 0x0200,
|
||||
-32, -48, -64, 0x0415, 0x0451, -80, -96, 0x0424,
|
||||
0x0442, 0x0414, 0x0341, 0x0341, 0x0404, 0x0440, 0x0423, 0x0432,
|
||||
0x0413, 0x0431, 0x0403, 0x0430, 0x0222, 0x0222, 0x0222, 0x0222,
|
||||
0x0202, 0x0202, 0x0202, 0x0202, 0x0220, 0x0220, 0x0220, 0x0220,
|
||||
0x0355, 0x0355, 0x0354, 0x0354, 0x0245, 0x0245, 0x0245, 0x0245,
|
||||
0x0153, 0x0153, 0x0153, 0x0153, 0x0153, 0x0153, 0x0153, 0x0153,
|
||||
0x0235, 0x0235, 0x0235, 0x0235, 0x0244, 0x0244, 0x0244, 0x0244,
|
||||
0x0125, 0x0125, 0x0125, 0x0125, 0x0125, 0x0125, 0x0125, 0x0125,
|
||||
0x0152, 0x0152, 0x0152, 0x0152, 0x0152, 0x0152, 0x0152, 0x0152,
|
||||
0x0105, 0x0105, 0x0105, 0x0105, 0x0105, 0x0105, 0x0105, 0x0105,
|
||||
0x0134, 0x0134, 0x0134, 0x0134, 0x0134, 0x0134, 0x0134, 0x0134,
|
||||
0x0143, 0x0143, 0x0143, 0x0143, 0x0143, 0x0143, 0x0143, 0x0143,
|
||||
0x0150, 0x0150, 0x0150, 0x0150, 0x0150, 0x0150, 0x0150, 0x0150,
|
||||
0x0133, 0x0133, 0x0133, 0x0133, 0x0133, 0x0133, 0x0133, 0x0133,
|
||||
};
|
||||
|
||||
static const short tab9_[] =
|
||||
{
|
||||
-16, -32, -48, -64, -80, 0x0412, 0x0421, 0x0420,
|
||||
0x0311, 0x0311, 0x0301, 0x0301, 0x0310, 0x0310, 0x0300, 0x0300,
|
||||
-80, 0x0435, 0x0453, -96, 0x0444, 0x0425, 0x0452, 0x0415,
|
||||
0x0351, 0x0351, 0x0334, 0x0334, 0x0343, 0x0343, 0x0450, 0x0404,
|
||||
0x0324, 0x0324, 0x0342, 0x0342, 0x0333, 0x0333, 0x0340, 0x0340,
|
||||
0x0214, 0x0214, 0x0214, 0x0214, 0x0241, 0x0241, 0x0241, 0x0241,
|
||||
0x0223, 0x0223, 0x0223, 0x0223, 0x0232, 0x0232, 0x0232, 0x0232,
|
||||
0x0113, 0x0113, 0x0113, 0x0113, 0x0113, 0x0113, 0x0113, 0x0113,
|
||||
0x0131, 0x0131, 0x0131, 0x0131, 0x0131, 0x0131, 0x0131, 0x0131,
|
||||
0x0203, 0x0203, 0x0203, 0x0203, 0x0230, 0x0230, 0x0230, 0x0230,
|
||||
0x0122, 0x0122, 0x0122, 0x0122, 0x0122, 0x0122, 0x0122, 0x0122,
|
||||
0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102,
|
||||
0x0155, 0x0155, 0x0155, 0x0155, 0x0155, 0x0155, 0x0155, 0x0155,
|
||||
0x0145, 0x0145, 0x0145, 0x0145, 0x0145, 0x0145, 0x0145, 0x0145,
|
||||
0x0154, 0x0154, 0x0154, 0x0154, 0x0154, 0x0154, 0x0154, 0x0154,
|
||||
0x0105, 0x0105, 0x0105, 0x0105, 0x0105, 0x0105, 0x0105, 0x0105,
|
||||
};
|
||||
|
||||
static const short tab10_[] =
|
||||
{
|
||||
-16, -32, -48, 0x0411, 0x0301, 0x0301, 0x0310, 0x0310,
|
||||
0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100,
|
||||
-48, -64, -80, -96, -112, -128, -144, 0x0417,
|
||||
0x0471, -160, -176, -192, 0x0416, 0x0461, 0x0460, -208,
|
||||
-208, -224, 0x0414, 0x0441, 0x0440, 0x0423, 0x0432, 0x0403,
|
||||
0x0313, 0x0313, 0x0331, 0x0331, 0x0330, 0x0330, 0x0322, 0x0322,
|
||||
0x0212, 0x0212, 0x0212, 0x0212, 0x0221, 0x0221, 0x0221, 0x0221,
|
||||
0x0202, 0x0202, 0x0202, 0x0202, 0x0220, 0x0220, 0x0220, 0x0220,
|
||||
0x0377, 0x0377, 0x0367, 0x0367, 0x0376, 0x0376, 0x0357, 0x0357,
|
||||
0x0375, 0x0375, 0x0366, 0x0366, 0x0247, 0x0247, 0x0247, 0x0247,
|
||||
0x0274, 0x0274, 0x0274, 0x0274, 0x0256, 0x0256, 0x0256, 0x0256,
|
||||
0x0265, 0x0265, 0x0265, 0x0265, 0x0237, 0x0237, 0x0237, 0x0237,
|
||||
0x0273, 0x0273, 0x0273, 0x0273, 0x0246, 0x0246, 0x0246, 0x0246,
|
||||
0x0355, 0x0355, 0x0354, 0x0354, 0x0263, 0x0263, 0x0263, 0x0263,
|
||||
0x0127, 0x0127, 0x0127, 0x0127, 0x0127, 0x0127, 0x0127, 0x0127,
|
||||
0x0172, 0x0172, 0x0172, 0x0172, 0x0172, 0x0172, 0x0172, 0x0172,
|
||||
0x0264, 0x0264, 0x0264, 0x0264, 0x0207, 0x0207, 0x0207, 0x0207,
|
||||
0x0170, 0x0170, 0x0170, 0x0170, 0x0170, 0x0170, 0x0170, 0x0170,
|
||||
0x0162, 0x0162, 0x0162, 0x0162, 0x0162, 0x0162, 0x0162, 0x0162,
|
||||
0x0245, 0x0245, 0x0245, 0x0245, 0x0235, 0x0235, 0x0235, 0x0235,
|
||||
0x0106, 0x0106, 0x0106, 0x0106, 0x0106, 0x0106, 0x0106, 0x0106,
|
||||
0x0253, 0x0253, 0x0253, 0x0253, 0x0244, 0x0244, 0x0244, 0x0244,
|
||||
0x0136, 0x0136, 0x0136, 0x0136, 0x0136, 0x0136, 0x0136, 0x0136,
|
||||
0x0126, 0x0126, 0x0126, 0x0126, 0x0126, 0x0126, 0x0126, 0x0126,
|
||||
0x0225, 0x0225, 0x0225, 0x0225, 0x0252, 0x0252, 0x0252, 0x0252,
|
||||
0x0115, 0x0115, 0x0115, 0x0115, 0x0115, 0x0115, 0x0115, 0x0115,
|
||||
0x0151, 0x0151, 0x0151, 0x0151, 0x0151, 0x0151, 0x0151, 0x0151,
|
||||
0x0234, 0x0234, 0x0234, 0x0234, 0x0243, 0x0243, 0x0243, 0x0243,
|
||||
0x0105, 0x0105, 0x0105, 0x0105, 0x0105, 0x0105, 0x0105, 0x0105,
|
||||
0x0150, 0x0150, 0x0150, 0x0150, 0x0150, 0x0150, 0x0150, 0x0150,
|
||||
0x0124, 0x0124, 0x0124, 0x0124, 0x0124, 0x0124, 0x0124, 0x0124,
|
||||
0x0142, 0x0142, 0x0142, 0x0142, 0x0142, 0x0142, 0x0142, 0x0142,
|
||||
0x0133, 0x0133, 0x0133, 0x0133, 0x0133, 0x0133, 0x0133, 0x0133,
|
||||
0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104,
|
||||
};
|
||||
|
||||
static const short tab11_[] =
|
||||
{
|
||||
-16, -32, -48, -64, 0x0412, -80, 0x0311, 0x0311,
|
||||
0x0301, 0x0301, 0x0310, 0x0310, 0x0200, 0x0200, 0x0200, 0x0200,
|
||||
-80, -96, -112, -128, -144, 0x0427, 0x0472, -160,
|
||||
0x0371, 0x0371, 0x0417, 0x0470, 0x0436, 0x0463, 0x0460, -176,
|
||||
-176, 0x0415, 0x0362, 0x0362, 0x0426, 0x0406, 0x0316, 0x0316,
|
||||
0x0361, 0x0361, 0x0451, 0x0434, 0x0450, -192, 0x0424, 0x0442,
|
||||
0x0414, 0x0441, 0x0404, 0x0440, 0x0323, 0x0323, 0x0332, 0x0332,
|
||||
0x0213, 0x0213, 0x0213, 0x0213, 0x0231, 0x0231, 0x0231, 0x0231,
|
||||
0x0303, 0x0303, 0x0330, 0x0330, 0x0222, 0x0222, 0x0222, 0x0222,
|
||||
0x0121, 0x0121, 0x0121, 0x0121, 0x0121, 0x0121, 0x0121, 0x0121,
|
||||
0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102,
|
||||
0x0120, 0x0120, 0x0120, 0x0120, 0x0120, 0x0120, 0x0120, 0x0120,
|
||||
0x0277, 0x0277, 0x0277, 0x0277, 0x0267, 0x0267, 0x0267, 0x0267,
|
||||
0x0276, 0x0276, 0x0276, 0x0276, 0x0275, 0x0275, 0x0275, 0x0275,
|
||||
0x0266, 0x0266, 0x0266, 0x0266, 0x0247, 0x0247, 0x0247, 0x0247,
|
||||
0x0274, 0x0274, 0x0274, 0x0274, 0x0357, 0x0357, 0x0355, 0x0355,
|
||||
0x0256, 0x0256, 0x0256, 0x0256, 0x0265, 0x0265, 0x0265, 0x0265,
|
||||
0x0137, 0x0137, 0x0137, 0x0137, 0x0137, 0x0137, 0x0137, 0x0137,
|
||||
0x0173, 0x0173, 0x0173, 0x0173, 0x0173, 0x0173, 0x0173, 0x0173,
|
||||
0x0146, 0x0146, 0x0146, 0x0146, 0x0146, 0x0146, 0x0146, 0x0146,
|
||||
0x0245, 0x0245, 0x0245, 0x0245, 0x0254, 0x0254, 0x0254, 0x0254,
|
||||
0x0235, 0x0235, 0x0235, 0x0235, 0x0253, 0x0253, 0x0253, 0x0253,
|
||||
0x0164, 0x0164, 0x0164, 0x0164, 0x0164, 0x0164, 0x0164, 0x0164,
|
||||
0x0107, 0x0107, 0x0107, 0x0107, 0x0107, 0x0107, 0x0107, 0x0107,
|
||||
0x0144, 0x0144, 0x0144, 0x0144, 0x0144, 0x0144, 0x0144, 0x0144,
|
||||
0x0125, 0x0125, 0x0125, 0x0125, 0x0125, 0x0125, 0x0125, 0x0125,
|
||||
0x0152, 0x0152, 0x0152, 0x0152, 0x0152, 0x0152, 0x0152, 0x0152,
|
||||
0x0105, 0x0105, 0x0105, 0x0105, 0x0105, 0x0105, 0x0105, 0x0105,
|
||||
0x0143, 0x0143, 0x0143, 0x0143, 0x0143, 0x0143, 0x0143, 0x0143,
|
||||
0x0133, 0x0133, 0x0133, 0x0133, 0x0133, 0x0133, 0x0133, 0x0133,
|
||||
};
|
||||
|
||||
static const short tab12_[] =
|
||||
{
|
||||
-16, -32, -48, -64, -80, -96, 0x0412, 0x0421,
|
||||
-112, 0x0400, 0x0311, 0x0311, 0x0301, 0x0301, 0x0310, 0x0310,
|
||||
-112, -128, -144, -160, 0x0456, 0x0437, -176, 0x0427,
|
||||
0x0472, 0x0446, 0x0464, 0x0417, 0x0471, -192, 0x0436, 0x0463,
|
||||
0x0445, 0x0454, 0x0444, -192, 0x0326, 0x0326, 0x0362, 0x0362,
|
||||
0x0361, 0x0361, 0x0416, 0x0460, 0x0435, 0x0453, 0x0425, 0x0452,
|
||||
0x0315, 0x0315, 0x0351, 0x0351, 0x0334, 0x0334, 0x0343, 0x0343,
|
||||
0x0450, 0x0404, 0x0324, 0x0324, 0x0342, 0x0342, 0x0314, 0x0314,
|
||||
0x0233, 0x0233, 0x0233, 0x0233, 0x0241, 0x0241, 0x0241, 0x0241,
|
||||
0x0223, 0x0223, 0x0223, 0x0223, 0x0232, 0x0232, 0x0232, 0x0232,
|
||||
0x0340, 0x0340, 0x0303, 0x0303, 0x0230, 0x0230, 0x0230, 0x0230,
|
||||
0x0113, 0x0113, 0x0113, 0x0113, 0x0113, 0x0113, 0x0113, 0x0113,
|
||||
0x0131, 0x0131, 0x0131, 0x0131, 0x0131, 0x0131, 0x0131, 0x0131,
|
||||
0x0122, 0x0122, 0x0122, 0x0122, 0x0122, 0x0122, 0x0122, 0x0122,
|
||||
0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102,
|
||||
0x0120, 0x0120, 0x0120, 0x0120, 0x0120, 0x0120, 0x0120, 0x0120,
|
||||
0x0277, 0x0277, 0x0277, 0x0277, 0x0267, 0x0267, 0x0267, 0x0267,
|
||||
0x0176, 0x0176, 0x0176, 0x0176, 0x0176, 0x0176, 0x0176, 0x0176,
|
||||
0x0157, 0x0157, 0x0157, 0x0157, 0x0157, 0x0157, 0x0157, 0x0157,
|
||||
0x0175, 0x0175, 0x0175, 0x0175, 0x0175, 0x0175, 0x0175, 0x0175,
|
||||
0x0166, 0x0166, 0x0166, 0x0166, 0x0166, 0x0166, 0x0166, 0x0166,
|
||||
0x0147, 0x0147, 0x0147, 0x0147, 0x0147, 0x0147, 0x0147, 0x0147,
|
||||
0x0174, 0x0174, 0x0174, 0x0174, 0x0174, 0x0174, 0x0174, 0x0174,
|
||||
0x0165, 0x0165, 0x0165, 0x0165, 0x0165, 0x0165, 0x0165, 0x0165,
|
||||
0x0173, 0x0173, 0x0173, 0x0173, 0x0173, 0x0173, 0x0173, 0x0173,
|
||||
0x0155, 0x0155, 0x0155, 0x0155, 0x0155, 0x0155, 0x0155, 0x0155,
|
||||
0x0107, 0x0107, 0x0107, 0x0107, 0x0107, 0x0107, 0x0107, 0x0107,
|
||||
0x0170, 0x0170, 0x0170, 0x0170, 0x0170, 0x0170, 0x0170, 0x0170,
|
||||
0x0106, 0x0106, 0x0106, 0x0106, 0x0106, 0x0106, 0x0106, 0x0106,
|
||||
0x0105, 0x0105, 0x0105, 0x0105, 0x0105, 0x0105, 0x0105, 0x0105,
|
||||
};
|
||||
|
||||
static const short tab13_[] =
|
||||
{
|
||||
-16, -32, -48, -64, 0x0411, 0x0401, 0x0310, 0x0310,
|
||||
0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100,
|
||||
-64, -80, -96, -112, -128, -144, -160, -176,
|
||||
-192, -208, -224, -240, -256, -272, -288, -304,
|
||||
-304, -320, -336, -352, 0x0481, -368, -384, -400,
|
||||
-416, -432, 0x0415, 0x0451, -448, -464, -480, 0x0414,
|
||||
0x0341, 0x0341, 0x0404, 0x0440, 0x0423, 0x0432, 0x0313, 0x0313,
|
||||
0x0331, 0x0331, 0x0303, 0x0303, 0x0330, 0x0330, 0x0322, 0x0322,
|
||||
0x0212, 0x0212, 0x0212, 0x0212, 0x0221, 0x0221, 0x0221, 0x0221,
|
||||
0x0202, 0x0202, 0x0202, 0x0202, 0x0220, 0x0220, 0x0220, 0x0220,
|
||||
-448, -464, -480, -496, -512, -528, -544, -560,
|
||||
-576, -592, -608, -624, -640, -656, 0x041f, 0x04f1,
|
||||
0x04f0, -656, -672, -688, 0x04e2, -704, 0x041e, 0x04e1,
|
||||
-720, -736, -752, -768, -784, -800, 0x04c6, 0x043d,
|
||||
-800, 0x042d, 0x04d2, 0x041d, 0x04b7, -816, -832, 0x04c3,
|
||||
-848, 0x044b, 0x03d1, 0x03d1, 0x040d, 0x04d0, 0x048a, 0x04a8,
|
||||
0x044c, 0x04c4, 0x046b, 0x04b6, 0x033c, 0x033c, 0x032c, 0x032c,
|
||||
0x03c2, 0x03c2, 0x035b, 0x035b, 0x04b5, 0x0489, 0x031c, 0x031c,
|
||||
0x03c1, 0x03c1, 0x0498, 0x040c, 0x03c0, 0x03c0, 0x04b4, 0x046a,
|
||||
0x04a6, 0x0479, 0x033b, 0x033b, 0x03b3, 0x03b3, 0x0488, 0x045a,
|
||||
0x032b, 0x032b, 0x04a5, 0x0469, 0x03a4, 0x03a4, 0x0478, 0x0487,
|
||||
0x0394, 0x0394, 0x0477, 0x0476, 0x02b2, 0x02b2, 0x02b2, 0x02b2,
|
||||
0x021b, 0x021b, 0x021b, 0x021b, 0x02b1, 0x02b1, 0x02b1, 0x02b1,
|
||||
0x030b, 0x030b, 0x03b0, 0x03b0, 0x0396, 0x0396, 0x034a, 0x034a,
|
||||
0x033a, 0x033a, 0x03a3, 0x03a3, 0x0359, 0x0359, 0x0395, 0x0395,
|
||||
0x022a, 0x022a, 0x022a, 0x022a, 0x02a2, 0x02a2, 0x02a2, 0x02a2,
|
||||
0x021a, 0x021a, 0x021a, 0x021a, 0x02a1, 0x02a1, 0x02a1, 0x02a1,
|
||||
0x030a, 0x030a, 0x0368, 0x0368, 0x02a0, 0x02a0, 0x02a0, 0x02a0,
|
||||
0x0386, 0x0386, 0x0349, 0x0349, 0x0293, 0x0293, 0x0293, 0x0293,
|
||||
0x0339, 0x0339, 0x0358, 0x0358, 0x0385, 0x0385, 0x0367, 0x0367,
|
||||
0x0229, 0x0229, 0x0229, 0x0229, 0x0292, 0x0292, 0x0292, 0x0292,
|
||||
0x0357, 0x0357, 0x0375, 0x0375, 0x0238, 0x0238, 0x0238, 0x0238,
|
||||
0x0283, 0x0283, 0x0283, 0x0283, 0x0366, 0x0366, 0x0347, 0x0347,
|
||||
0x0374, 0x0374, 0x0356, 0x0356, 0x0365, 0x0365, 0x0373, 0x0373,
|
||||
0x0119, 0x0119, 0x0119, 0x0119, 0x0119, 0x0119, 0x0119, 0x0119,
|
||||
0x0191, 0x0191, 0x0191, 0x0191, 0x0191, 0x0191, 0x0191, 0x0191,
|
||||
0x0209, 0x0209, 0x0209, 0x0209, 0x0290, 0x0290, 0x0290, 0x0290,
|
||||
0x0248, 0x0248, 0x0248, 0x0248, 0x0284, 0x0284, 0x0284, 0x0284,
|
||||
0x0272, 0x0272, 0x0272, 0x0272, 0x0346, 0x0346, 0x0364, 0x0364,
|
||||
0x0128, 0x0128, 0x0128, 0x0128, 0x0128, 0x0128, 0x0128, 0x0128,
|
||||
0x0182, 0x0182, 0x0182, 0x0182, 0x0182, 0x0182, 0x0182, 0x0182,
|
||||
0x0118, 0x0118, 0x0118, 0x0118, 0x0118, 0x0118, 0x0118, 0x0118,
|
||||
0x0237, 0x0237, 0x0237, 0x0237, 0x0227, 0x0227, 0x0227, 0x0227,
|
||||
0x0117, 0x0117, 0x0117, 0x0117, 0x0117, 0x0117, 0x0117, 0x0117,
|
||||
0x0171, 0x0171, 0x0171, 0x0171, 0x0171, 0x0171, 0x0171, 0x0171,
|
||||
0x0255, 0x0255, 0x0255, 0x0255, 0x0207, 0x0207, 0x0207, 0x0207,
|
||||
0x0270, 0x0270, 0x0270, 0x0270, 0x0236, 0x0236, 0x0236, 0x0236,
|
||||
0x0263, 0x0263, 0x0263, 0x0263, 0x0245, 0x0245, 0x0245, 0x0245,
|
||||
0x0254, 0x0254, 0x0254, 0x0254, 0x0226, 0x0226, 0x0226, 0x0226,
|
||||
0x0262, 0x0262, 0x0262, 0x0262, 0x0235, 0x0235, 0x0235, 0x0235,
|
||||
0x0108, 0x0108, 0x0108, 0x0108, 0x0108, 0x0108, 0x0108, 0x0108,
|
||||
0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180,
|
||||
0x0116, 0x0116, 0x0116, 0x0116, 0x0116, 0x0116, 0x0116, 0x0116,
|
||||
0x0161, 0x0161, 0x0161, 0x0161, 0x0161, 0x0161, 0x0161, 0x0161,
|
||||
0x0106, 0x0106, 0x0106, 0x0106, 0x0106, 0x0106, 0x0106, 0x0106,
|
||||
0x0160, 0x0160, 0x0160, 0x0160, 0x0160, 0x0160, 0x0160, 0x0160,
|
||||
0x0253, 0x0253, 0x0253, 0x0253, 0x0244, 0x0244, 0x0244, 0x0244,
|
||||
0x0125, 0x0125, 0x0125, 0x0125, 0x0125, 0x0125, 0x0125, 0x0125,
|
||||
0x0152, 0x0152, 0x0152, 0x0152, 0x0152, 0x0152, 0x0152, 0x0152,
|
||||
0x0105, 0x0105, 0x0105, 0x0105, 0x0105, 0x0105, 0x0105, 0x0105,
|
||||
0x0134, 0x0134, 0x0134, 0x0134, 0x0134, 0x0134, 0x0134, 0x0134,
|
||||
0x0143, 0x0143, 0x0143, 0x0143, 0x0143, 0x0143, 0x0143, 0x0143,
|
||||
0x0150, 0x0150, 0x0150, 0x0150, 0x0150, 0x0150, 0x0150, 0x0150,
|
||||
0x0124, 0x0124, 0x0124, 0x0124, 0x0124, 0x0124, 0x0124, 0x0124,
|
||||
0x0142, 0x0142, 0x0142, 0x0142, 0x0142, 0x0142, 0x0142, 0x0142,
|
||||
0x0133, 0x0133, 0x0133, 0x0133, 0x0133, 0x0133, 0x0133, 0x0133,
|
||||
-448, 0x04ff, 0x04ef, 0x04df, 0x04ee, 0x04cf, 0x04de, 0x04bf,
|
||||
0x04fb, 0x04ce, 0x04dc, -464, 0x03ec, 0x03ec, 0x03dd, 0x03dd,
|
||||
0x04fa, 0x04cd, 0x03be, 0x03be, 0x03eb, 0x03eb, 0x039f, 0x039f,
|
||||
0x03f9, 0x03f9, 0x03ea, 0x03ea, 0x03bd, 0x03bd, 0x03db, 0x03db,
|
||||
0x038f, 0x038f, 0x03f8, 0x03f8, 0x03cc, 0x03cc, 0x04ae, 0x049e,
|
||||
0x038e, 0x038e, 0x047f, 0x047e, 0x02f7, 0x02f7, 0x02f7, 0x02f7,
|
||||
0x02da, 0x02da, 0x02da, 0x02da, 0x03ad, 0x03ad, 0x03bc, 0x03bc,
|
||||
0x03cb, 0x03cb, 0x03f6, 0x03f6, 0x026f, 0x026f, 0x026f, 0x026f,
|
||||
0x02e8, 0x02e8, 0x02e8, 0x02e8, 0x025f, 0x025f, 0x025f, 0x025f,
|
||||
0x029d, 0x029d, 0x029d, 0x029d, 0x02d9, 0x02d9, 0x02d9, 0x02d9,
|
||||
0x02f5, 0x02f5, 0x02f5, 0x02f5, 0x02e7, 0x02e7, 0x02e7, 0x02e7,
|
||||
0x02ac, 0x02ac, 0x02ac, 0x02ac, 0x02bb, 0x02bb, 0x02bb, 0x02bb,
|
||||
0x024f, 0x024f, 0x024f, 0x024f, 0x02f4, 0x02f4, 0x02f4, 0x02f4,
|
||||
0x03ca, 0x03ca, 0x03e6, 0x03e6, 0x02f3, 0x02f3, 0x02f3, 0x02f3,
|
||||
0x013f, 0x013f, 0x013f, 0x013f, 0x013f, 0x013f, 0x013f, 0x013f,
|
||||
0x028d, 0x028d, 0x028d, 0x028d, 0x02d8, 0x02d8, 0x02d8, 0x02d8,
|
||||
0x012f, 0x012f, 0x012f, 0x012f, 0x012f, 0x012f, 0x012f, 0x012f,
|
||||
0x01f2, 0x01f2, 0x01f2, 0x01f2, 0x01f2, 0x01f2, 0x01f2, 0x01f2,
|
||||
0x026e, 0x026e, 0x026e, 0x026e, 0x029c, 0x029c, 0x029c, 0x029c,
|
||||
0x010f, 0x010f, 0x010f, 0x010f, 0x010f, 0x010f, 0x010f, 0x010f,
|
||||
0x02c9, 0x02c9, 0x02c9, 0x02c9, 0x025e, 0x025e, 0x025e, 0x025e,
|
||||
0x01ab, 0x01ab, 0x01ab, 0x01ab, 0x01ab, 0x01ab, 0x01ab, 0x01ab,
|
||||
0x027d, 0x027d, 0x027d, 0x027d, 0x02d7, 0x02d7, 0x02d7, 0x02d7,
|
||||
0x014e, 0x014e, 0x014e, 0x014e, 0x014e, 0x014e, 0x014e, 0x014e,
|
||||
0x02c8, 0x02c8, 0x02c8, 0x02c8, 0x02d6, 0x02d6, 0x02d6, 0x02d6,
|
||||
0x013e, 0x013e, 0x013e, 0x013e, 0x013e, 0x013e, 0x013e, 0x013e,
|
||||
0x01b9, 0x01b9, 0x01b9, 0x01b9, 0x01b9, 0x01b9, 0x01b9, 0x01b9,
|
||||
0x029b, 0x029b, 0x029b, 0x029b, 0x02aa, 0x02aa, 0x02aa, 0x02aa,
|
||||
0x01ba, 0x01ba, 0x01ba, 0x01ba, 0x01ba, 0x01ba, 0x01ba, 0x01ba,
|
||||
0x01e5, 0x01e5, 0x01e5, 0x01e5, 0x01e5, 0x01e5, 0x01e5, 0x01e5,
|
||||
0x01e4, 0x01e4, 0x01e4, 0x01e4, 0x01e4, 0x01e4, 0x01e4, 0x01e4,
|
||||
0x018c, 0x018c, 0x018c, 0x018c, 0x018c, 0x018c, 0x018c, 0x018c,
|
||||
0x016d, 0x016d, 0x016d, 0x016d, 0x016d, 0x016d, 0x016d, 0x016d,
|
||||
0x01e3, 0x01e3, 0x01e3, 0x01e3, 0x01e3, 0x01e3, 0x01e3, 0x01e3,
|
||||
0x012e, 0x012e, 0x012e, 0x012e, 0x012e, 0x012e, 0x012e, 0x012e,
|
||||
0x010e, 0x010e, 0x010e, 0x010e, 0x010e, 0x010e, 0x010e, 0x010e,
|
||||
0x01e0, 0x01e0, 0x01e0, 0x01e0, 0x01e0, 0x01e0, 0x01e0, 0x01e0,
|
||||
0x015d, 0x015d, 0x015d, 0x015d, 0x015d, 0x015d, 0x015d, 0x015d,
|
||||
0x01d5, 0x01d5, 0x01d5, 0x01d5, 0x01d5, 0x01d5, 0x01d5, 0x01d5,
|
||||
0x017c, 0x017c, 0x017c, 0x017c, 0x017c, 0x017c, 0x017c, 0x017c,
|
||||
0x01c7, 0x01c7, 0x01c7, 0x01c7, 0x01c7, 0x01c7, 0x01c7, 0x01c7,
|
||||
0x014d, 0x014d, 0x014d, 0x014d, 0x014d, 0x014d, 0x014d, 0x014d,
|
||||
0x018b, 0x018b, 0x018b, 0x018b, 0x018b, 0x018b, 0x018b, 0x018b,
|
||||
0x01b8, 0x01b8, 0x01b8, 0x01b8, 0x01b8, 0x01b8, 0x01b8, 0x01b8,
|
||||
0x01d4, 0x01d4, 0x01d4, 0x01d4, 0x01d4, 0x01d4, 0x01d4, 0x01d4,
|
||||
0x019a, 0x019a, 0x019a, 0x019a, 0x019a, 0x019a, 0x019a, 0x019a,
|
||||
0x01a9, 0x01a9, 0x01a9, 0x01a9, 0x01a9, 0x01a9, 0x01a9, 0x01a9,
|
||||
0x016c, 0x016c, 0x016c, 0x016c, 0x016c, 0x016c, 0x016c, 0x016c,
|
||||
0x01d3, 0x01d3, 0x01d3, 0x01d3, 0x01d3, 0x01d3, 0x01d3, 0x01d3,
|
||||
0x017b, 0x017b, 0x017b, 0x017b, 0x017b, 0x017b, 0x017b, 0x017b,
|
||||
0x015c, 0x015c, 0x015c, 0x015c, 0x015c, 0x015c, 0x015c, 0x015c,
|
||||
0x01c5, 0x01c5, 0x01c5, 0x01c5, 0x01c5, 0x01c5, 0x01c5, 0x01c5,
|
||||
0x0199, 0x0199, 0x0199, 0x0199, 0x0199, 0x0199, 0x0199, 0x0199,
|
||||
0x017a, 0x017a, 0x017a, 0x017a, 0x017a, 0x017a, 0x017a, 0x017a,
|
||||
0x01a7, 0x01a7, 0x01a7, 0x01a7, 0x01a7, 0x01a7, 0x01a7, 0x01a7,
|
||||
0x0197, 0x0197, 0x0197, 0x0197, 0x0197, 0x0197, 0x0197, 0x0197,
|
||||
0x03fe, 0x03fe, 0x03fc, 0x03fc, 0x02fd, 0x02fd, 0x02fd, 0x02fd,
|
||||
0x01ed, 0x01ed, 0x01ed, 0x01ed, 0x01ed, 0x01ed, 0x01ed, 0x01ed,
|
||||
0x01af, 0x01af, 0x01af, 0x01af, 0x01af, 0x01af, 0x01af, 0x01af,
|
||||
0x01e9, 0x01e9, 0x01e9, 0x01e9, 0x01e9, 0x01e9, 0x01e9, 0x01e9,
|
||||
};
|
||||
|
||||
static const short tab15_[] =
|
||||
{
|
||||
-16, -32, -48, -64, -80, -96, -112, -128,
|
||||
-144, -160, 0x0311, 0x0311, 0x0401, 0x0410, 0x0300, 0x0300,
|
||||
-160, -176, -192, -208, -224, -240, -256, -272,
|
||||
-288, -304, -320, -336, -352, -368, -384, -400,
|
||||
-400, -416, -432, -448, -464, -480, -496, -512,
|
||||
-528, -544, -560, -576, -592, -608, -624, -640,
|
||||
-640, -656, 0x0491, -672, -688, -704, -720, -736,
|
||||
0x0428, 0x0482, 0x0418, 0x0481, -752, -768, -784, -800,
|
||||
0x0427, 0x0472, 0x0464, 0x0417, 0x0455, 0x0471, -800, 0x0436,
|
||||
0x0463, 0x0445, 0x0454, 0x0426, 0x0462, 0x0416, -816, 0x0435,
|
||||
0x0361, 0x0361, 0x0453, 0x0444, 0x0325, 0x0325, 0x0352, 0x0352,
|
||||
0x0315, 0x0315, 0x0351, 0x0351, 0x0405, 0x0450, 0x0334, 0x0334,
|
||||
0x0343, 0x0343, 0x0324, 0x0324, 0x0342, 0x0342, 0x0333, 0x0333,
|
||||
0x0241, 0x0241, 0x0241, 0x0241, 0x0314, 0x0314, 0x0304, 0x0304,
|
||||
0x0223, 0x0223, 0x0223, 0x0223, 0x0232, 0x0232, 0x0232, 0x0232,
|
||||
0x0340, 0x0340, 0x0303, 0x0303, 0x0213, 0x0213, 0x0213, 0x0213,
|
||||
0x0231, 0x0231, 0x0231, 0x0231, 0x0230, 0x0230, 0x0230, 0x0230,
|
||||
0x0122, 0x0122, 0x0122, 0x0122, 0x0122, 0x0122, 0x0122, 0x0122,
|
||||
0x0112, 0x0112, 0x0112, 0x0112, 0x0112, 0x0112, 0x0112, 0x0112,
|
||||
0x0121, 0x0121, 0x0121, 0x0121, 0x0121, 0x0121, 0x0121, 0x0121,
|
||||
0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102,
|
||||
0x0120, 0x0120, 0x0120, 0x0120, 0x0120, 0x0120, 0x0120, 0x0120,
|
||||
-720, -736, 0x04ee, -752, -768, -784, 0x04fb, -800,
|
||||
0x04dd, 0x04af, 0x04fa, 0x04be, 0x04eb, 0x04cd, 0x04dc, 0x049f,
|
||||
0x04f9, 0x04ea, 0x04bd, 0x04db, 0x048f, 0x04f8, 0x04cc, 0x049e,
|
||||
0x04e9, 0x047f, 0x04f7, 0x04ad, 0x04da, 0x04bc, 0x046f, -800,
|
||||
0x03cb, 0x03cb, 0x03f6, 0x03f6, 0x048e, 0x04e8, 0x045f, 0x049d,
|
||||
0x03f5, 0x03f5, 0x037e, 0x037e, 0x03e7, 0x03e7, 0x03ac, 0x03ac,
|
||||
0x03ca, 0x03ca, 0x03bb, 0x03bb, 0x04d9, 0x048d, 0x034f, 0x034f,
|
||||
0x03f4, 0x03f4, 0x033f, 0x033f, 0x03f3, 0x03f3, 0x03d8, 0x03d8,
|
||||
0x03e6, 0x03e6, 0x032f, 0x032f, 0x03f2, 0x03f2, 0x046e, 0x04f0,
|
||||
0x031f, 0x031f, 0x03f1, 0x03f1, 0x039c, 0x039c, 0x03c9, 0x03c9,
|
||||
0x035e, 0x035e, 0x03ab, 0x03ab, 0x03ba, 0x03ba, 0x03e5, 0x03e5,
|
||||
0x037d, 0x037d, 0x03d7, 0x03d7, 0x034e, 0x034e, 0x03e4, 0x03e4,
|
||||
0x038c, 0x038c, 0x03c8, 0x03c8, 0x033e, 0x033e, 0x036d, 0x036d,
|
||||
0x03d6, 0x03d6, 0x03e3, 0x03e3, 0x039b, 0x039b, 0x03b9, 0x03b9,
|
||||
0x032e, 0x032e, 0x03aa, 0x03aa, 0x03e2, 0x03e2, 0x031e, 0x031e,
|
||||
0x03e1, 0x03e1, 0x040e, 0x04e0, 0x035d, 0x035d, 0x03d5, 0x03d5,
|
||||
0x037c, 0x037c, 0x03c7, 0x03c7, 0x034d, 0x034d, 0x038b, 0x038b,
|
||||
0x02d4, 0x02d4, 0x02d4, 0x02d4, 0x03b8, 0x03b8, 0x039a, 0x039a,
|
||||
0x03a9, 0x03a9, 0x036c, 0x036c, 0x03c6, 0x03c6, 0x033d, 0x033d,
|
||||
0x02d3, 0x02d3, 0x02d3, 0x02d3, 0x02d2, 0x02d2, 0x02d2, 0x02d2,
|
||||
0x032d, 0x032d, 0x030d, 0x030d, 0x021d, 0x021d, 0x021d, 0x021d,
|
||||
0x027b, 0x027b, 0x027b, 0x027b, 0x02b7, 0x02b7, 0x02b7, 0x02b7,
|
||||
0x02d1, 0x02d1, 0x02d1, 0x02d1, 0x035c, 0x035c, 0x03d0, 0x03d0,
|
||||
0x02c5, 0x02c5, 0x02c5, 0x02c5, 0x028a, 0x028a, 0x028a, 0x028a,
|
||||
0x02a8, 0x02a8, 0x02a8, 0x02a8, 0x024c, 0x024c, 0x024c, 0x024c,
|
||||
0x02c4, 0x02c4, 0x02c4, 0x02c4, 0x026b, 0x026b, 0x026b, 0x026b,
|
||||
0x02b6, 0x02b6, 0x02b6, 0x02b6, 0x0399, 0x0399, 0x030c, 0x030c,
|
||||
0x023c, 0x023c, 0x023c, 0x023c, 0x02c3, 0x02c3, 0x02c3, 0x02c3,
|
||||
0x027a, 0x027a, 0x027a, 0x027a, 0x02a7, 0x02a7, 0x02a7, 0x02a7,
|
||||
0x02a6, 0x02a6, 0x02a6, 0x02a6, 0x03c0, 0x03c0, 0x030b, 0x030b,
|
||||
0x01c2, 0x01c2, 0x01c2, 0x01c2, 0x01c2, 0x01c2, 0x01c2, 0x01c2,
|
||||
0x022c, 0x022c, 0x022c, 0x022c, 0x025b, 0x025b, 0x025b, 0x025b,
|
||||
0x02b5, 0x02b5, 0x02b5, 0x02b5, 0x021c, 0x021c, 0x021c, 0x021c,
|
||||
0x0289, 0x0289, 0x0289, 0x0289, 0x0298, 0x0298, 0x0298, 0x0298,
|
||||
0x02c1, 0x02c1, 0x02c1, 0x02c1, 0x024b, 0x024b, 0x024b, 0x024b,
|
||||
0x02b4, 0x02b4, 0x02b4, 0x02b4, 0x026a, 0x026a, 0x026a, 0x026a,
|
||||
0x023b, 0x023b, 0x023b, 0x023b, 0x0279, 0x0279, 0x0279, 0x0279,
|
||||
0x01b3, 0x01b3, 0x01b3, 0x01b3, 0x01b3, 0x01b3, 0x01b3, 0x01b3,
|
||||
0x0297, 0x0297, 0x0297, 0x0297, 0x0288, 0x0288, 0x0288, 0x0288,
|
||||
0x022b, 0x022b, 0x022b, 0x022b, 0x025a, 0x025a, 0x025a, 0x025a,
|
||||
0x01b2, 0x01b2, 0x01b2, 0x01b2, 0x01b2, 0x01b2, 0x01b2, 0x01b2,
|
||||
0x02a5, 0x02a5, 0x02a5, 0x02a5, 0x021b, 0x021b, 0x021b, 0x021b,
|
||||
0x01b1, 0x01b1, 0x01b1, 0x01b1, 0x01b1, 0x01b1, 0x01b1, 0x01b1,
|
||||
0x02b0, 0x02b0, 0x02b0, 0x02b0, 0x0269, 0x0269, 0x0269, 0x0269,
|
||||
0x0296, 0x0296, 0x0296, 0x0296, 0x024a, 0x024a, 0x024a, 0x024a,
|
||||
0x02a4, 0x02a4, 0x02a4, 0x02a4, 0x0278, 0x0278, 0x0278, 0x0278,
|
||||
0x0287, 0x0287, 0x0287, 0x0287, 0x023a, 0x023a, 0x023a, 0x023a,
|
||||
0x01a3, 0x01a3, 0x01a3, 0x01a3, 0x01a3, 0x01a3, 0x01a3, 0x01a3,
|
||||
0x0159, 0x0159, 0x0159, 0x0159, 0x0159, 0x0159, 0x0159, 0x0159,
|
||||
0x0195, 0x0195, 0x0195, 0x0195, 0x0195, 0x0195, 0x0195, 0x0195,
|
||||
0x012a, 0x012a, 0x012a, 0x012a, 0x012a, 0x012a, 0x012a, 0x012a,
|
||||
0x01a2, 0x01a2, 0x01a2, 0x01a2, 0x01a2, 0x01a2, 0x01a2, 0x01a2,
|
||||
0x011a, 0x011a, 0x011a, 0x011a, 0x011a, 0x011a, 0x011a, 0x011a,
|
||||
0x01a1, 0x01a1, 0x01a1, 0x01a1, 0x01a1, 0x01a1, 0x01a1, 0x01a1,
|
||||
0x020a, 0x020a, 0x020a, 0x020a, 0x02a0, 0x02a0, 0x02a0, 0x02a0,
|
||||
0x0168, 0x0168, 0x0168, 0x0168, 0x0168, 0x0168, 0x0168, 0x0168,
|
||||
0x0186, 0x0186, 0x0186, 0x0186, 0x0186, 0x0186, 0x0186, 0x0186,
|
||||
0x0149, 0x0149, 0x0149, 0x0149, 0x0149, 0x0149, 0x0149, 0x0149,
|
||||
0x0194, 0x0194, 0x0194, 0x0194, 0x0194, 0x0194, 0x0194, 0x0194,
|
||||
0x0139, 0x0139, 0x0139, 0x0139, 0x0139, 0x0139, 0x0139, 0x0139,
|
||||
0x0193, 0x0193, 0x0193, 0x0193, 0x0193, 0x0193, 0x0193, 0x0193,
|
||||
0x0277, 0x0277, 0x0277, 0x0277, 0x0209, 0x0209, 0x0209, 0x0209,
|
||||
0x0158, 0x0158, 0x0158, 0x0158, 0x0158, 0x0158, 0x0158, 0x0158,
|
||||
0x0185, 0x0185, 0x0185, 0x0185, 0x0185, 0x0185, 0x0185, 0x0185,
|
||||
0x0129, 0x0129, 0x0129, 0x0129, 0x0129, 0x0129, 0x0129, 0x0129,
|
||||
0x0167, 0x0167, 0x0167, 0x0167, 0x0167, 0x0167, 0x0167, 0x0167,
|
||||
0x0176, 0x0176, 0x0176, 0x0176, 0x0176, 0x0176, 0x0176, 0x0176,
|
||||
0x0192, 0x0192, 0x0192, 0x0192, 0x0192, 0x0192, 0x0192, 0x0192,
|
||||
0x0119, 0x0119, 0x0119, 0x0119, 0x0119, 0x0119, 0x0119, 0x0119,
|
||||
0x0190, 0x0190, 0x0190, 0x0190, 0x0190, 0x0190, 0x0190, 0x0190,
|
||||
0x0148, 0x0148, 0x0148, 0x0148, 0x0148, 0x0148, 0x0148, 0x0148,
|
||||
0x0184, 0x0184, 0x0184, 0x0184, 0x0184, 0x0184, 0x0184, 0x0184,
|
||||
0x0157, 0x0157, 0x0157, 0x0157, 0x0157, 0x0157, 0x0157, 0x0157,
|
||||
0x0175, 0x0175, 0x0175, 0x0175, 0x0175, 0x0175, 0x0175, 0x0175,
|
||||
0x0138, 0x0138, 0x0138, 0x0138, 0x0138, 0x0138, 0x0138, 0x0138,
|
||||
0x0183, 0x0183, 0x0183, 0x0183, 0x0183, 0x0183, 0x0183, 0x0183,
|
||||
0x0166, 0x0166, 0x0166, 0x0166, 0x0166, 0x0166, 0x0166, 0x0166,
|
||||
0x0147, 0x0147, 0x0147, 0x0147, 0x0147, 0x0147, 0x0147, 0x0147,
|
||||
0x0174, 0x0174, 0x0174, 0x0174, 0x0174, 0x0174, 0x0174, 0x0174,
|
||||
0x0108, 0x0108, 0x0108, 0x0108, 0x0108, 0x0108, 0x0108, 0x0108,
|
||||
0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180, 0x0180,
|
||||
0x0156, 0x0156, 0x0156, 0x0156, 0x0156, 0x0156, 0x0156, 0x0156,
|
||||
0x0165, 0x0165, 0x0165, 0x0165, 0x0165, 0x0165, 0x0165, 0x0165,
|
||||
0x0137, 0x0137, 0x0137, 0x0137, 0x0137, 0x0137, 0x0137, 0x0137,
|
||||
0x0173, 0x0173, 0x0173, 0x0173, 0x0173, 0x0173, 0x0173, 0x0173,
|
||||
0x0146, 0x0146, 0x0146, 0x0146, 0x0146, 0x0146, 0x0146, 0x0146,
|
||||
0x0107, 0x0107, 0x0107, 0x0107, 0x0107, 0x0107, 0x0107, 0x0107,
|
||||
0x0170, 0x0170, 0x0170, 0x0170, 0x0170, 0x0170, 0x0170, 0x0170,
|
||||
0x0106, 0x0106, 0x0106, 0x0106, 0x0106, 0x0106, 0x0106, 0x0106,
|
||||
0x0160, 0x0160, 0x0160, 0x0160, 0x0160, 0x0160, 0x0160, 0x0160,
|
||||
0x01ff, 0x01ff, 0x01ff, 0x01ff, 0x01ff, 0x01ff, 0x01ff, 0x01ff,
|
||||
0x01ef, 0x01ef, 0x01ef, 0x01ef, 0x01ef, 0x01ef, 0x01ef, 0x01ef,
|
||||
0x01fe, 0x01fe, 0x01fe, 0x01fe, 0x01fe, 0x01fe, 0x01fe, 0x01fe,
|
||||
0x01df, 0x01df, 0x01df, 0x01df, 0x01df, 0x01df, 0x01df, 0x01df,
|
||||
0x01fd, 0x01fd, 0x01fd, 0x01fd, 0x01fd, 0x01fd, 0x01fd, 0x01fd,
|
||||
0x01cf, 0x01cf, 0x01cf, 0x01cf, 0x01cf, 0x01cf, 0x01cf, 0x01cf,
|
||||
0x01fc, 0x01fc, 0x01fc, 0x01fc, 0x01fc, 0x01fc, 0x01fc, 0x01fc,
|
||||
0x01de, 0x01de, 0x01de, 0x01de, 0x01de, 0x01de, 0x01de, 0x01de,
|
||||
0x01ed, 0x01ed, 0x01ed, 0x01ed, 0x01ed, 0x01ed, 0x01ed, 0x01ed,
|
||||
0x01bf, 0x01bf, 0x01bf, 0x01bf, 0x01bf, 0x01bf, 0x01bf, 0x01bf,
|
||||
0x01ce, 0x01ce, 0x01ce, 0x01ce, 0x01ce, 0x01ce, 0x01ce, 0x01ce,
|
||||
0x01ec, 0x01ec, 0x01ec, 0x01ec, 0x01ec, 0x01ec, 0x01ec, 0x01ec,
|
||||
0x01ae, 0x01ae, 0x01ae, 0x01ae, 0x01ae, 0x01ae, 0x01ae, 0x01ae,
|
||||
0x010f, 0x010f, 0x010f, 0x010f, 0x010f, 0x010f, 0x010f, 0x010f,
|
||||
};
|
||||
|
||||
static const short tab16_[] =
|
||||
{
|
||||
-16, -32, -48, -64, 0x0411, 0x0401, 0x0310, 0x0310,
|
||||
0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100,
|
||||
-64, -80, -96, 0x04ff, -112, -128, -144, 0x04f2,
|
||||
-160, 0x041f, 0x04f1, -176, -192, -208, -224, -240,
|
||||
-240, -256, -272, -288, -304, -320, -336, -352,
|
||||
-368, -384, -400, -416, -432, -448, 0x0451, -464,
|
||||
-464, -480, -496, 0x0414, 0x0441, -512, 0x0423, 0x0432,
|
||||
0x0313, 0x0313, 0x0331, 0x0331, 0x0403, 0x0430, 0x0322, 0x0322,
|
||||
0x0212, 0x0212, 0x0212, 0x0212, 0x0221, 0x0221, 0x0221, 0x0221,
|
||||
0x0202, 0x0202, 0x0202, 0x0202, 0x0220, 0x0220, 0x0220, 0x0220,
|
||||
0x03ef, 0x03ef, 0x03fe, 0x03fe, 0x03df, 0x03df, 0x03fd, 0x03fd,
|
||||
0x03cf, 0x03cf, 0x03fc, 0x03fc, 0x03bf, 0x03bf, 0x03fb, 0x03fb,
|
||||
0x02af, 0x02af, 0x02af, 0x02af, 0x03fa, 0x03fa, 0x039f, 0x039f,
|
||||
0x03f9, 0x03f9, 0x03f8, 0x03f8, 0x028f, 0x028f, 0x028f, 0x028f,
|
||||
0x027f, 0x027f, 0x027f, 0x027f, 0x02f7, 0x02f7, 0x02f7, 0x02f7,
|
||||
0x026f, 0x026f, 0x026f, 0x026f, 0x02f6, 0x02f6, 0x02f6, 0x02f6,
|
||||
0x025f, 0x025f, 0x025f, 0x025f, 0x02f5, 0x02f5, 0x02f5, 0x02f5,
|
||||
0x014f, 0x014f, 0x014f, 0x014f, 0x014f, 0x014f, 0x014f, 0x014f,
|
||||
0x01f4, 0x01f4, 0x01f4, 0x01f4, 0x01f4, 0x01f4, 0x01f4, 0x01f4,
|
||||
0x01f3, 0x01f3, 0x01f3, 0x01f3, 0x01f3, 0x01f3, 0x01f3, 0x01f3,
|
||||
0x01f0, 0x01f0, 0x01f0, 0x01f0, 0x01f0, 0x01f0, 0x01f0, 0x01f0,
|
||||
0x023f, 0x023f, 0x023f, 0x023f, -416, -432, -448, -464,
|
||||
0x012f, 0x012f, 0x012f, 0x012f, 0x012f, 0x012f, 0x012f, 0x012f,
|
||||
0x010f, 0x010f, 0x010f, 0x010f, 0x010f, 0x010f, 0x010f, 0x010f,
|
||||
-448, -464, -480, -496, -512, -528, -544, -560,
|
||||
-576, -592, -608, 0x04e3, -624, -640, -656, -672,
|
||||
-672, -688, -704, 0x040d, -720, -736, -752, 0x043c,
|
||||
-768, 0x041c, 0x04c0, -784, 0x03e2, 0x03e2, 0x042e, 0x041e,
|
||||
0x04d3, 0x042d, 0x04d2, 0x04d1, 0x043b, -784, 0x031d, 0x031d,
|
||||
0x04c4, 0x046b, 0x04c3, 0x04a7, 0x032c, 0x032c, 0x04c2, 0x04b5,
|
||||
0x04c1, 0x040c, 0x044b, 0x04b4, 0x046a, 0x04a6, 0x03b3, 0x03b3,
|
||||
0x045a, 0x04a5, 0x032b, 0x032b, 0x03b2, 0x03b2, 0x031b, 0x031b,
|
||||
0x03b1, 0x03b1, 0x040b, 0x04b0, 0x0469, 0x0496, 0x044a, 0x04a4,
|
||||
0x0478, 0x0487, 0x03a3, 0x03a3, 0x043a, 0x0459, 0x032a, 0x032a,
|
||||
0x0495, 0x0468, 0x03a1, 0x03a1, 0x0486, 0x0477, 0x0394, 0x0394,
|
||||
0x0449, 0x0457, 0x0367, 0x0367, 0x02a2, 0x02a2, 0x02a2, 0x02a2,
|
||||
0x021a, 0x021a, 0x021a, 0x021a, 0x030a, 0x030a, 0x03a0, 0x03a0,
|
||||
0x0339, 0x0339, 0x0393, 0x0393, 0x0358, 0x0358, 0x0385, 0x0385,
|
||||
0x0229, 0x0229, 0x0229, 0x0229, 0x0292, 0x0292, 0x0292, 0x0292,
|
||||
0x0376, 0x0376, 0x0309, 0x0309, 0x0219, 0x0219, 0x0219, 0x0219,
|
||||
0x0291, 0x0291, 0x0291, 0x0291, 0x0390, 0x0390, 0x0348, 0x0348,
|
||||
0x0384, 0x0384, 0x0375, 0x0375, 0x0338, 0x0338, 0x0383, 0x0383,
|
||||
0x0366, 0x0366, 0x0328, 0x0328, 0x0282, 0x0282, 0x0282, 0x0282,
|
||||
0x0347, 0x0347, 0x0374, 0x0374, 0x0218, 0x0218, 0x0218, 0x0218,
|
||||
0x0281, 0x0281, 0x0281, 0x0281, 0x0280, 0x0280, 0x0280, 0x0280,
|
||||
0x0308, 0x0308, 0x0356, 0x0356, 0x0237, 0x0237, 0x0237, 0x0237,
|
||||
0x0273, 0x0273, 0x0273, 0x0273, 0x0365, 0x0365, 0x0346, 0x0346,
|
||||
0x0227, 0x0227, 0x0227, 0x0227, 0x0272, 0x0272, 0x0272, 0x0272,
|
||||
0x0364, 0x0364, 0x0355, 0x0355, 0x0207, 0x0207, 0x0207, 0x0207,
|
||||
0x0117, 0x0117, 0x0117, 0x0117, 0x0117, 0x0117, 0x0117, 0x0117,
|
||||
0x0171, 0x0171, 0x0171, 0x0171, 0x0171, 0x0171, 0x0171, 0x0171,
|
||||
0x0270, 0x0270, 0x0270, 0x0270, 0x0236, 0x0236, 0x0236, 0x0236,
|
||||
0x0263, 0x0263, 0x0263, 0x0263, 0x0245, 0x0245, 0x0245, 0x0245,
|
||||
0x0254, 0x0254, 0x0254, 0x0254, 0x0226, 0x0226, 0x0226, 0x0226,
|
||||
0x0162, 0x0162, 0x0162, 0x0162, 0x0162, 0x0162, 0x0162, 0x0162,
|
||||
0x0116, 0x0116, 0x0116, 0x0116, 0x0116, 0x0116, 0x0116, 0x0116,
|
||||
0x0161, 0x0161, 0x0161, 0x0161, 0x0161, 0x0161, 0x0161, 0x0161,
|
||||
0x0206, 0x0206, 0x0206, 0x0206, 0x0260, 0x0260, 0x0260, 0x0260,
|
||||
0x0153, 0x0153, 0x0153, 0x0153, 0x0153, 0x0153, 0x0153, 0x0153,
|
||||
0x0235, 0x0235, 0x0235, 0x0235, 0x0244, 0x0244, 0x0244, 0x0244,
|
||||
0x0125, 0x0125, 0x0125, 0x0125, 0x0125, 0x0125, 0x0125, 0x0125,
|
||||
0x0152, 0x0152, 0x0152, 0x0152, 0x0152, 0x0152, 0x0152, 0x0152,
|
||||
0x0115, 0x0115, 0x0115, 0x0115, 0x0115, 0x0115, 0x0115, 0x0115,
|
||||
0x0105, 0x0105, 0x0105, 0x0105, 0x0105, 0x0105, 0x0105, 0x0105,
|
||||
0x0134, 0x0134, 0x0134, 0x0134, 0x0134, 0x0134, 0x0134, 0x0134,
|
||||
0x0143, 0x0143, 0x0143, 0x0143, 0x0143, 0x0143, 0x0143, 0x0143,
|
||||
0x0150, 0x0150, 0x0150, 0x0150, 0x0150, 0x0150, 0x0150, 0x0150,
|
||||
0x0124, 0x0124, 0x0124, 0x0124, 0x0124, 0x0124, 0x0124, 0x0124,
|
||||
0x0142, 0x0142, 0x0142, 0x0142, 0x0142, 0x0142, 0x0142, 0x0142,
|
||||
0x0133, 0x0133, 0x0133, 0x0133, 0x0133, 0x0133, 0x0133, 0x0133,
|
||||
0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104, 0x0104,
|
||||
0x0140, 0x0140, 0x0140, 0x0140, 0x0140, 0x0140, 0x0140, 0x0140,
|
||||
0x04ce, -448, 0x03de, 0x03de, 0x03e9, 0x03e9, 0x04ea, 0x04d9,
|
||||
0x02ee, 0x02ee, 0x02ee, 0x02ee, 0x03ed, 0x03ed, 0x03eb, 0x03eb,
|
||||
0x02be, 0x02be, 0x02be, 0x02be, 0x02cd, 0x02cd, 0x02cd, 0x02cd,
|
||||
0x03dc, 0x03dc, 0x03db, 0x03db, 0x02ae, 0x02ae, 0x02ae, 0x02ae,
|
||||
0x02cc, 0x02cc, 0x02cc, 0x02cc, 0x03ad, 0x03ad, 0x03da, 0x03da,
|
||||
0x037e, 0x037e, 0x03ac, 0x03ac, 0x02ca, 0x02ca, 0x02ca, 0x02ca,
|
||||
0x03c9, 0x03c9, 0x037d, 0x037d, 0x025e, 0x025e, 0x025e, 0x025e,
|
||||
0x01bd, 0x01bd, 0x01bd, 0x01bd, 0x01bd, 0x01bd, 0x01bd, 0x01bd,
|
||||
0x019e, 0x019e, 0x019e, 0x019e, 0x019e, 0x019e, 0x019e, 0x019e,
|
||||
0x02bc, 0x02bc, 0x02bc, 0x02bc, 0x02cb, 0x02cb, 0x02cb, 0x02cb,
|
||||
0x028e, 0x028e, 0x028e, 0x028e, 0x02e8, 0x02e8, 0x02e8, 0x02e8,
|
||||
0x029d, 0x029d, 0x029d, 0x029d, 0x02e7, 0x02e7, 0x02e7, 0x02e7,
|
||||
0x02bb, 0x02bb, 0x02bb, 0x02bb, 0x028d, 0x028d, 0x028d, 0x028d,
|
||||
0x02d8, 0x02d8, 0x02d8, 0x02d8, 0x026e, 0x026e, 0x026e, 0x026e,
|
||||
0x01e6, 0x01e6, 0x01e6, 0x01e6, 0x01e6, 0x01e6, 0x01e6, 0x01e6,
|
||||
0x019c, 0x019c, 0x019c, 0x019c, 0x019c, 0x019c, 0x019c, 0x019c,
|
||||
0x02ab, 0x02ab, 0x02ab, 0x02ab, 0x02ba, 0x02ba, 0x02ba, 0x02ba,
|
||||
0x02e5, 0x02e5, 0x02e5, 0x02e5, 0x02d7, 0x02d7, 0x02d7, 0x02d7,
|
||||
0x014e, 0x014e, 0x014e, 0x014e, 0x014e, 0x014e, 0x014e, 0x014e,
|
||||
0x02e4, 0x02e4, 0x02e4, 0x02e4, 0x028c, 0x028c, 0x028c, 0x028c,
|
||||
0x01c8, 0x01c8, 0x01c8, 0x01c8, 0x01c8, 0x01c8, 0x01c8, 0x01c8,
|
||||
0x013e, 0x013e, 0x013e, 0x013e, 0x013e, 0x013e, 0x013e, 0x013e,
|
||||
0x016d, 0x016d, 0x016d, 0x016d, 0x016d, 0x016d, 0x016d, 0x016d,
|
||||
0x02d6, 0x02d6, 0x02d6, 0x02d6, 0x029b, 0x029b, 0x029b, 0x029b,
|
||||
0x02b9, 0x02b9, 0x02b9, 0x02b9, 0x02aa, 0x02aa, 0x02aa, 0x02aa,
|
||||
0x01e1, 0x01e1, 0x01e1, 0x01e1, 0x01e1, 0x01e1, 0x01e1, 0x01e1,
|
||||
0x01d4, 0x01d4, 0x01d4, 0x01d4, 0x01d4, 0x01d4, 0x01d4, 0x01d4,
|
||||
0x02b8, 0x02b8, 0x02b8, 0x02b8, 0x02a9, 0x02a9, 0x02a9, 0x02a9,
|
||||
0x017b, 0x017b, 0x017b, 0x017b, 0x017b, 0x017b, 0x017b, 0x017b,
|
||||
0x02b7, 0x02b7, 0x02b7, 0x02b7, 0x02d0, 0x02d0, 0x02d0, 0x02d0,
|
||||
0x010e, 0x010e, 0x010e, 0x010e, 0x010e, 0x010e, 0x010e, 0x010e,
|
||||
0x01e0, 0x01e0, 0x01e0, 0x01e0, 0x01e0, 0x01e0, 0x01e0, 0x01e0,
|
||||
0x015d, 0x015d, 0x015d, 0x015d, 0x015d, 0x015d, 0x015d, 0x015d,
|
||||
0x01d5, 0x01d5, 0x01d5, 0x01d5, 0x01d5, 0x01d5, 0x01d5, 0x01d5,
|
||||
0x017c, 0x017c, 0x017c, 0x017c, 0x017c, 0x017c, 0x017c, 0x017c,
|
||||
0x01c7, 0x01c7, 0x01c7, 0x01c7, 0x01c7, 0x01c7, 0x01c7, 0x01c7,
|
||||
0x014d, 0x014d, 0x014d, 0x014d, 0x014d, 0x014d, 0x014d, 0x014d,
|
||||
0x018b, 0x018b, 0x018b, 0x018b, 0x018b, 0x018b, 0x018b, 0x018b,
|
||||
0x019a, 0x019a, 0x019a, 0x019a, 0x019a, 0x019a, 0x019a, 0x019a,
|
||||
0x016c, 0x016c, 0x016c, 0x016c, 0x016c, 0x016c, 0x016c, 0x016c,
|
||||
0x01c6, 0x01c6, 0x01c6, 0x01c6, 0x01c6, 0x01c6, 0x01c6, 0x01c6,
|
||||
0x013d, 0x013d, 0x013d, 0x013d, 0x013d, 0x013d, 0x013d, 0x013d,
|
||||
0x015c, 0x015c, 0x015c, 0x015c, 0x015c, 0x015c, 0x015c, 0x015c,
|
||||
0x01c5, 0x01c5, 0x01c5, 0x01c5, 0x01c5, 0x01c5, 0x01c5, 0x01c5,
|
||||
0x018a, 0x018a, 0x018a, 0x018a, 0x018a, 0x018a, 0x018a, 0x018a,
|
||||
0x01a8, 0x01a8, 0x01a8, 0x01a8, 0x01a8, 0x01a8, 0x01a8, 0x01a8,
|
||||
0x0199, 0x0199, 0x0199, 0x0199, 0x0199, 0x0199, 0x0199, 0x0199,
|
||||
0x014c, 0x014c, 0x014c, 0x014c, 0x014c, 0x014c, 0x014c, 0x014c,
|
||||
0x01b6, 0x01b6, 0x01b6, 0x01b6, 0x01b6, 0x01b6, 0x01b6, 0x01b6,
|
||||
0x017a, 0x017a, 0x017a, 0x017a, 0x017a, 0x017a, 0x017a, 0x017a,
|
||||
0x015b, 0x015b, 0x015b, 0x015b, 0x015b, 0x015b, 0x015b, 0x015b,
|
||||
0x0189, 0x0189, 0x0189, 0x0189, 0x0189, 0x0189, 0x0189, 0x0189,
|
||||
0x0198, 0x0198, 0x0198, 0x0198, 0x0198, 0x0198, 0x0198, 0x0198,
|
||||
0x0179, 0x0179, 0x0179, 0x0179, 0x0179, 0x0179, 0x0179, 0x0179,
|
||||
0x0197, 0x0197, 0x0197, 0x0197, 0x0197, 0x0197, 0x0197, 0x0197,
|
||||
0x0188, 0x0188, 0x0188, 0x0188, 0x0188, 0x0188, 0x0188, 0x0188,
|
||||
0x01ec, 0x01ec, 0x01ec, 0x01ec, 0x01ec, 0x01ec, 0x01ec, 0x01ec,
|
||||
0x01dd, 0x01dd, 0x01dd, 0x01dd, 0x01dd, 0x01dd, 0x01dd, 0x01dd,
|
||||
};
|
||||
|
||||
static const short tab24_[] =
|
||||
{
|
||||
-16, -32, -48, 0x04ff, -64, -80, -96, -112,
|
||||
-128, -144, -160, -176, 0x0411, 0x0401, 0x0410, 0x0400,
|
||||
0x04ef, 0x04fe, 0x04df, 0x04fd, 0x04cf, 0x04fc, 0x04bf, 0x04fb,
|
||||
0x03fa, 0x03fa, 0x04af, 0x049f, 0x03f9, 0x03f9, 0x03f8, 0x03f8,
|
||||
0x048f, 0x047f, 0x03f7, 0x03f7, 0x036f, 0x036f, 0x03f6, 0x03f6,
|
||||
0x035f, 0x035f, 0x03f5, 0x03f5, 0x034f, 0x034f, 0x03f4, 0x03f4,
|
||||
0x033f, 0x033f, 0x03f3, 0x03f3, 0x032f, 0x032f, 0x03f2, 0x03f2,
|
||||
0x03f1, 0x03f1, 0x041f, 0x04f0, -144, -160, -176, -192,
|
||||
-192, -208, -224, -240, -256, -272, -288, -304,
|
||||
-320, -336, -352, -368, -384, -400, -416, -432,
|
||||
-432, -448, -464, -480, -496, -512, -528, -544,
|
||||
-560, -576, -592, -608, -624, -640, -656, -672,
|
||||
-672, -688, -704, -720, -736, -752, -768, -784,
|
||||
-800, -816, -832, -848, -864, 0x0473, -880, 0x0472,
|
||||
0x0446, 0x0464, 0x0455, 0x0471, 0x0436, 0x0463, 0x0445, 0x0454,
|
||||
0x0426, 0x0462, 0x0416, 0x0461, -880, 0x0435, 0x0453, 0x0444,
|
||||
0x0425, 0x0452, 0x0415, -880, 0x0351, 0x0351, 0x0434, 0x0443,
|
||||
0x0324, 0x0324, 0x0342, 0x0342, 0x0333, 0x0333, 0x0314, 0x0314,
|
||||
0x0341, 0x0341, 0x0404, 0x0440, 0x0323, 0x0323, 0x0332, 0x0332,
|
||||
0x0213, 0x0213, 0x0213, 0x0213, 0x0231, 0x0231, 0x0231, 0x0231,
|
||||
0x0303, 0x0303, 0x0330, 0x0330, 0x0222, 0x0222, 0x0222, 0x0222,
|
||||
0x0112, 0x0112, 0x0112, 0x0112, 0x0112, 0x0112, 0x0112, 0x0112,
|
||||
0x0121, 0x0121, 0x0121, 0x0121, 0x0121, 0x0121, 0x0121, 0x0121,
|
||||
0x0202, 0x0202, 0x0202, 0x0202, 0x0220, 0x0220, 0x0220, 0x0220,
|
||||
0x010f, 0x010f, 0x010f, 0x010f, 0x010f, 0x010f, 0x010f, 0x010f,
|
||||
0x03ee, 0x03ee, 0x03de, 0x03de, 0x03ed, 0x03ed, 0x03ce, 0x03ce,
|
||||
0x03ec, 0x03ec, 0x03dd, 0x03dd, 0x03be, 0x03be, 0x03eb, 0x03eb,
|
||||
0x03cd, 0x03cd, 0x03dc, 0x03dc, 0x03ae, 0x03ae, 0x03ea, 0x03ea,
|
||||
0x03bd, 0x03bd, 0x03db, 0x03db, 0x03cc, 0x03cc, 0x039e, 0x039e,
|
||||
0x03e9, 0x03e9, 0x03ad, 0x03ad, 0x03da, 0x03da, 0x03bc, 0x03bc,
|
||||
0x03cb, 0x03cb, 0x038e, 0x038e, 0x03e8, 0x03e8, 0x039d, 0x039d,
|
||||
0x03d9, 0x03d9, 0x037e, 0x037e, 0x03e7, 0x03e7, 0x03ac, 0x03ac,
|
||||
0x03ca, 0x03ca, 0x03bb, 0x03bb, 0x038d, 0x038d, 0x03d8, 0x03d8,
|
||||
0x040e, 0x04e0, 0x030d, 0x030d, 0x02e6, 0x02e6, 0x02e6, 0x02e6,
|
||||
0x036e, 0x036e, 0x039c, 0x039c, 0x02c9, 0x02c9, 0x02c9, 0x02c9,
|
||||
0x025e, 0x025e, 0x025e, 0x025e, 0x02ba, 0x02ba, 0x02ba, 0x02ba,
|
||||
0x02e5, 0x02e5, 0x02e5, 0x02e5, 0x03ab, 0x03ab, 0x037d, 0x037d,
|
||||
0x02d7, 0x02d7, 0x02d7, 0x02d7, 0x02e4, 0x02e4, 0x02e4, 0x02e4,
|
||||
0x028c, 0x028c, 0x028c, 0x028c, 0x02c8, 0x02c8, 0x02c8, 0x02c8,
|
||||
0x034e, 0x034e, 0x032e, 0x032e, 0x023e, 0x023e, 0x023e, 0x023e,
|
||||
0x026d, 0x026d, 0x026d, 0x026d, 0x02d6, 0x02d6, 0x02d6, 0x02d6,
|
||||
0x02e3, 0x02e3, 0x02e3, 0x02e3, 0x029b, 0x029b, 0x029b, 0x029b,
|
||||
0x02b9, 0x02b9, 0x02b9, 0x02b9, 0x02aa, 0x02aa, 0x02aa, 0x02aa,
|
||||
0x02e2, 0x02e2, 0x02e2, 0x02e2, 0x021e, 0x021e, 0x021e, 0x021e,
|
||||
0x02e1, 0x02e1, 0x02e1, 0x02e1, 0x025d, 0x025d, 0x025d, 0x025d,
|
||||
0x02d5, 0x02d5, 0x02d5, 0x02d5, 0x027c, 0x027c, 0x027c, 0x027c,
|
||||
0x02c7, 0x02c7, 0x02c7, 0x02c7, 0x024d, 0x024d, 0x024d, 0x024d,
|
||||
0x028b, 0x028b, 0x028b, 0x028b, 0x02b8, 0x02b8, 0x02b8, 0x02b8,
|
||||
0x02d4, 0x02d4, 0x02d4, 0x02d4, 0x029a, 0x029a, 0x029a, 0x029a,
|
||||
0x02a9, 0x02a9, 0x02a9, 0x02a9, 0x026c, 0x026c, 0x026c, 0x026c,
|
||||
0x02c6, 0x02c6, 0x02c6, 0x02c6, 0x023d, 0x023d, 0x023d, 0x023d,
|
||||
0x02d3, 0x02d3, 0x02d3, 0x02d3, 0x022d, 0x022d, 0x022d, 0x022d,
|
||||
0x02d2, 0x02d2, 0x02d2, 0x02d2, 0x021d, 0x021d, 0x021d, 0x021d,
|
||||
0x027b, 0x027b, 0x027b, 0x027b, 0x02b7, 0x02b7, 0x02b7, 0x02b7,
|
||||
0x02d1, 0x02d1, 0x02d1, 0x02d1, 0x025c, 0x025c, 0x025c, 0x025c,
|
||||
0x02c5, 0x02c5, 0x02c5, 0x02c5, 0x028a, 0x028a, 0x028a, 0x028a,
|
||||
0x02a8, 0x02a8, 0x02a8, 0x02a8, 0x0299, 0x0299, 0x0299, 0x0299,
|
||||
0x024c, 0x024c, 0x024c, 0x024c, 0x02c4, 0x02c4, 0x02c4, 0x02c4,
|
||||
0x026b, 0x026b, 0x026b, 0x026b, 0x02b6, 0x02b6, 0x02b6, 0x02b6,
|
||||
0x03d0, 0x03d0, 0x030c, 0x030c, 0x023c, 0x023c, 0x023c, 0x023c,
|
||||
0x02c3, 0x02c3, 0x02c3, 0x02c3, 0x027a, 0x027a, 0x027a, 0x027a,
|
||||
0x02a7, 0x02a7, 0x02a7, 0x02a7, 0x022c, 0x022c, 0x022c, 0x022c,
|
||||
0x02c2, 0x02c2, 0x02c2, 0x02c2, 0x025b, 0x025b, 0x025b, 0x025b,
|
||||
0x02b5, 0x02b5, 0x02b5, 0x02b5, 0x021c, 0x021c, 0x021c, 0x021c,
|
||||
0x0289, 0x0289, 0x0289, 0x0289, 0x0298, 0x0298, 0x0298, 0x0298,
|
||||
0x02c1, 0x02c1, 0x02c1, 0x02c1, 0x024b, 0x024b, 0x024b, 0x024b,
|
||||
0x03c0, 0x03c0, 0x030b, 0x030b, 0x023b, 0x023b, 0x023b, 0x023b,
|
||||
0x03b0, 0x03b0, 0x030a, 0x030a, 0x021a, 0x021a, 0x021a, 0x021a,
|
||||
0x01b4, 0x01b4, 0x01b4, 0x01b4, 0x01b4, 0x01b4, 0x01b4, 0x01b4,
|
||||
0x026a, 0x026a, 0x026a, 0x026a, 0x02a6, 0x02a6, 0x02a6, 0x02a6,
|
||||
0x0279, 0x0279, 0x0279, 0x0279, 0x0297, 0x0297, 0x0297, 0x0297,
|
||||
0x03a0, 0x03a0, 0x0309, 0x0309, 0x0290, 0x0290, 0x0290, 0x0290,
|
||||
0x01b3, 0x01b3, 0x01b3, 0x01b3, 0x01b3, 0x01b3, 0x01b3, 0x01b3,
|
||||
0x0188, 0x0188, 0x0188, 0x0188, 0x0188, 0x0188, 0x0188, 0x0188,
|
||||
0x022b, 0x022b, 0x022b, 0x022b, 0x025a, 0x025a, 0x025a, 0x025a,
|
||||
0x01b2, 0x01b2, 0x01b2, 0x01b2, 0x01b2, 0x01b2, 0x01b2, 0x01b2,
|
||||
0x02a5, 0x02a5, 0x02a5, 0x02a5, 0x021b, 0x021b, 0x021b, 0x021b,
|
||||
0x02b1, 0x02b1, 0x02b1, 0x02b1, 0x0269, 0x0269, 0x0269, 0x0269,
|
||||
0x0196, 0x0196, 0x0196, 0x0196, 0x0196, 0x0196, 0x0196, 0x0196,
|
||||
0x01a4, 0x01a4, 0x01a4, 0x01a4, 0x01a4, 0x01a4, 0x01a4, 0x01a4,
|
||||
0x024a, 0x024a, 0x024a, 0x024a, 0x0278, 0x0278, 0x0278, 0x0278,
|
||||
0x0187, 0x0187, 0x0187, 0x0187, 0x0187, 0x0187, 0x0187, 0x0187,
|
||||
0x013a, 0x013a, 0x013a, 0x013a, 0x013a, 0x013a, 0x013a, 0x013a,
|
||||
0x01a3, 0x01a3, 0x01a3, 0x01a3, 0x01a3, 0x01a3, 0x01a3, 0x01a3,
|
||||
0x0159, 0x0159, 0x0159, 0x0159, 0x0159, 0x0159, 0x0159, 0x0159,
|
||||
0x0195, 0x0195, 0x0195, 0x0195, 0x0195, 0x0195, 0x0195, 0x0195,
|
||||
0x012a, 0x012a, 0x012a, 0x012a, 0x012a, 0x012a, 0x012a, 0x012a,
|
||||
0x01a2, 0x01a2, 0x01a2, 0x01a2, 0x01a2, 0x01a2, 0x01a2, 0x01a2,
|
||||
0x01a1, 0x01a1, 0x01a1, 0x01a1, 0x01a1, 0x01a1, 0x01a1, 0x01a1,
|
||||
0x0168, 0x0168, 0x0168, 0x0168, 0x0168, 0x0168, 0x0168, 0x0168,
|
||||
0x0186, 0x0186, 0x0186, 0x0186, 0x0186, 0x0186, 0x0186, 0x0186,
|
||||
0x0177, 0x0177, 0x0177, 0x0177, 0x0177, 0x0177, 0x0177, 0x0177,
|
||||
0x0149, 0x0149, 0x0149, 0x0149, 0x0149, 0x0149, 0x0149, 0x0149,
|
||||
0x0194, 0x0194, 0x0194, 0x0194, 0x0194, 0x0194, 0x0194, 0x0194,
|
||||
0x0139, 0x0139, 0x0139, 0x0139, 0x0139, 0x0139, 0x0139, 0x0139,
|
||||
0x0193, 0x0193, 0x0193, 0x0193, 0x0193, 0x0193, 0x0193, 0x0193,
|
||||
0x0158, 0x0158, 0x0158, 0x0158, 0x0158, 0x0158, 0x0158, 0x0158,
|
||||
0x0185, 0x0185, 0x0185, 0x0185, 0x0185, 0x0185, 0x0185, 0x0185,
|
||||
0x0129, 0x0129, 0x0129, 0x0129, 0x0129, 0x0129, 0x0129, 0x0129,
|
||||
0x0167, 0x0167, 0x0167, 0x0167, 0x0167, 0x0167, 0x0167, 0x0167,
|
||||
0x0176, 0x0176, 0x0176, 0x0176, 0x0176, 0x0176, 0x0176, 0x0176,
|
||||
0x0192, 0x0192, 0x0192, 0x0192, 0x0192, 0x0192, 0x0192, 0x0192,
|
||||
0x0119, 0x0119, 0x0119, 0x0119, 0x0119, 0x0119, 0x0119, 0x0119,
|
||||
0x0191, 0x0191, 0x0191, 0x0191, 0x0191, 0x0191, 0x0191, 0x0191,
|
||||
0x0148, 0x0148, 0x0148, 0x0148, 0x0148, 0x0148, 0x0148, 0x0148,
|
||||
0x0184, 0x0184, 0x0184, 0x0184, 0x0184, 0x0184, 0x0184, 0x0184,
|
||||
0x0157, 0x0157, 0x0157, 0x0157, 0x0157, 0x0157, 0x0157, 0x0157,
|
||||
0x0175, 0x0175, 0x0175, 0x0175, 0x0175, 0x0175, 0x0175, 0x0175,
|
||||
0x0138, 0x0138, 0x0138, 0x0138, 0x0138, 0x0138, 0x0138, 0x0138,
|
||||
0x0183, 0x0183, 0x0183, 0x0183, 0x0183, 0x0183, 0x0183, 0x0183,
|
||||
0x0166, 0x0166, 0x0166, 0x0166, 0x0166, 0x0166, 0x0166, 0x0166,
|
||||
0x0128, 0x0128, 0x0128, 0x0128, 0x0128, 0x0128, 0x0128, 0x0128,
|
||||
0x0182, 0x0182, 0x0182, 0x0182, 0x0182, 0x0182, 0x0182, 0x0182,
|
||||
0x0118, 0x0118, 0x0118, 0x0118, 0x0118, 0x0118, 0x0118, 0x0118,
|
||||
0x0147, 0x0147, 0x0147, 0x0147, 0x0147, 0x0147, 0x0147, 0x0147,
|
||||
0x0174, 0x0174, 0x0174, 0x0174, 0x0174, 0x0174, 0x0174, 0x0174,
|
||||
0x0181, 0x0181, 0x0181, 0x0181, 0x0181, 0x0181, 0x0181, 0x0181,
|
||||
0x0208, 0x0208, 0x0208, 0x0208, 0x0280, 0x0280, 0x0280, 0x0280,
|
||||
0x0156, 0x0156, 0x0156, 0x0156, 0x0156, 0x0156, 0x0156, 0x0156,
|
||||
0x0165, 0x0165, 0x0165, 0x0165, 0x0165, 0x0165, 0x0165, 0x0165,
|
||||
0x0117, 0x0117, 0x0117, 0x0117, 0x0117, 0x0117, 0x0117, 0x0117,
|
||||
0x0207, 0x0207, 0x0207, 0x0207, 0x0270, 0x0270, 0x0270, 0x0270,
|
||||
0x0137, 0x0137, 0x0137, 0x0137, 0x0137, 0x0137, 0x0137, 0x0137,
|
||||
0x0127, 0x0127, 0x0127, 0x0127, 0x0127, 0x0127, 0x0127, 0x0127,
|
||||
0x0106, 0x0106, 0x0106, 0x0106, 0x0106, 0x0106, 0x0106, 0x0106,
|
||||
0x0160, 0x0160, 0x0160, 0x0160, 0x0160, 0x0160, 0x0160, 0x0160,
|
||||
0x0105, 0x0105, 0x0105, 0x0105, 0x0105, 0x0105, 0x0105, 0x0105,
|
||||
0x0150, 0x0150, 0x0150, 0x0150, 0x0150, 0x0150, 0x0150, 0x0150,
|
||||
};
|
||||
|
||||
static const short tab_c0[] =
|
||||
{
|
||||
-29, -21, -13, -7, -3, -1, 11, 15, -1, 13, 14, -3, -1, 7, 5,
|
||||
9, -3, -1, 6, 3, -1, 10, 12, -3, -1, 2, 1, -1, 4, 8,
|
||||
0
|
||||
};
|
||||
|
||||
static const short tab_c1[] =
|
||||
{
|
||||
-15, -7, -3, -1, 15, 14, -1, 13, 12, -3, -1, 11, 10, -1, 9,
|
||||
8, -7, -3, -1, 7, 6, -1, 5, 4, -3, -1, 3, 2, -1, 1,
|
||||
0
|
||||
};
|
||||
|
||||
static const struct newhuff ht[] =
|
||||
{
|
||||
{ /* 0 */ 0 , tab0_ } ,
|
||||
{ /* 2 */ 0 , tab1_ } ,
|
||||
{ /* 3 */ 0 , tab2_ } ,
|
||||
{ /* 3 */ 0 , tab3_ } ,
|
||||
{ /* 0 */ 0 , tab0_ } ,
|
||||
{ /* 4 */ 0 , tab5_ } ,
|
||||
{ /* 4 */ 0 , tab6_ } ,
|
||||
{ /* 6 */ 0 , tab7_ } ,
|
||||
{ /* 6 */ 0 , tab8_ } ,
|
||||
{ /* 6 */ 0 , tab9_ } ,
|
||||
{ /* 8 */ 0 , tab10_ } ,
|
||||
{ /* 8 */ 0 , tab11_ } ,
|
||||
{ /* 8 */ 0 , tab12_ } ,
|
||||
{ /* 16 */ 0 , tab13_ } ,
|
||||
{ /* 0 */ 0 , tab0_ } ,
|
||||
{ /* 16 */ 0 , tab15_ } ,
|
||||
|
||||
{ /* 16 */ 1 , tab16_ } ,
|
||||
{ /* 16 */ 2 , tab16_ } ,
|
||||
{ /* 16 */ 3 , tab16_ } ,
|
||||
{ /* 16 */ 4 , tab16_ } ,
|
||||
{ /* 16 */ 6 , tab16_ } ,
|
||||
{ /* 16 */ 8 , tab16_ } ,
|
||||
{ /* 16 */ 10, tab16_ } ,
|
||||
{ /* 16 */ 13, tab16_ } ,
|
||||
{ /* 16 */ 4 , tab24_ } ,
|
||||
{ /* 16 */ 5 , tab24_ } ,
|
||||
{ /* 16 */ 6 , tab24_ } ,
|
||||
{ /* 16 */ 7 , tab24_ } ,
|
||||
{ /* 16 */ 8 , tab24_ } ,
|
||||
{ /* 16 */ 9 , tab24_ } ,
|
||||
{ /* 16 */ 11, tab24_ } ,
|
||||
{ /* 16 */ 13, tab24_ }
|
||||
};
|
||||
|
||||
static const struct newhuff htc[] =
|
||||
{
|
||||
{ /* 1 , 1 , */ 0 , tab_c0 } ,
|
||||
{ /* 1 , 1 , */ 0 , tab_c1 }
|
||||
};
|
||||
|
||||
#endif
|
388
ThirdParty/mpg123/include/mpg123/optimize.h
vendored
388
ThirdParty/mpg123/include/mpg123/optimize.h
vendored
|
@ -1,388 +0,0 @@
|
|||
#ifndef MPG123_H_OPTIMIZE
|
||||
#define MPG123_H_OPTIMIZE
|
||||
/*
|
||||
optimize: get a grip on the different optimizations
|
||||
|
||||
copyright 2007-2013 by the mpg123 project - free software under the terms of the LGPL 2.1
|
||||
see COPYING and AUTHORS files in distribution or http://mpg123.org
|
||||
initially written by Thomas Orgis, taking from mpg123.[hc]
|
||||
|
||||
for building mpg123 with one optimization only, you have to choose exclusively between
|
||||
OPT_GENERIC (generic C code for everyone)
|
||||
OPT_GENERIC_DITHER (same with dithering for 1to1)
|
||||
OPT_I386 (Intel i386)
|
||||
OPT_I486 (Somewhat special code for i486; does not work together with others.)
|
||||
OPT_I586 (Intel Pentium)
|
||||
OPT_I586_DITHER (Intel Pentium with dithering/noise shaping for enhanced quality)
|
||||
OPT_MMX (Intel Pentium and compatibles with MMX, fast, but not the best accuracy)
|
||||
OPT_3DNOW (AMD 3DNow!, K6-2/3, Athlon, compatibles...)
|
||||
OPT_3DNOW_VINTAGE
|
||||
OPT_3DNOWEXT (AMD 3DNow! extended, generally Athlon, compatibles...)
|
||||
OPT_3DNOWEXT_VINTAGE
|
||||
OPT_SSE
|
||||
OPT_SSE_VINTAGE
|
||||
OPT_ALTIVEC (Motorola/IBM PPC with AltiVec under MacOSX)
|
||||
OPT_X86_64 (x86-64 / AMD64 / Intel 64)
|
||||
OPT_AVX
|
||||
|
||||
or you define OPT_MULTI and give a combination which makes sense (do not include i486, do not mix altivec and x86).
|
||||
|
||||
I still have to examine the dynamics of this here together with REAL_IS_FIXED.
|
||||
Basic point is: Don't use REAL_IS_FIXED with something else than generic or i386.
|
||||
|
||||
Also, one should minimize code size by really ensuring that only functions that are really needed are included.
|
||||
Currently, all generic functions will be always there (to be safe for fallbacks for advanced decoders).
|
||||
Strictly, at least the synth_1to1 should not be necessary for single-decoder mode.
|
||||
*/
|
||||
|
||||
|
||||
/* Runtime optimization interface now here: */
|
||||
|
||||
/* Nedit inline Perl script to generate decoder list and name mapping in one place
|
||||
optimize.c defining I_AM_OPTIMIZE to get the names
|
||||
|
||||
perl <<'EOT'
|
||||
## order is important (autodec first, nodec last)
|
||||
@names=
|
||||
(
|
||||
['autodec', 'auto']
|
||||
,['generic', 'generic']
|
||||
,['generic_dither', 'generic_dither']
|
||||
,['idrei', 'i386']
|
||||
,['ivier', 'i486']
|
||||
,['ifuenf', 'i586']
|
||||
,['ifuenf_dither', 'i586_dither']
|
||||
,['mmx', 'MMX']
|
||||
,['dreidnow', '3DNow']
|
||||
,['dreidnowext', '3DNowExt']
|
||||
,['altivec', 'AltiVec']
|
||||
,['sse', 'SSE']
|
||||
,['x86_64', 'x86-64']
|
||||
,['arm','ARM']
|
||||
,['neon','NEON']
|
||||
,['avx','AVX']
|
||||
,['dreidnow_vintage', '3DNow_vintage']
|
||||
,['dreidnowext_vintage', '3DNowExt_vintage']
|
||||
,['sse_vintage', 'SSE_vintage']
|
||||
,['nodec', 'nodec']
|
||||
);
|
||||
|
||||
print "enum optdec\n{\n";
|
||||
for my $n (@names)
|
||||
{
|
||||
$name = $n->[0];
|
||||
$enum = $name eq 'autodec' ? $name = " $name=0" : ",$name";
|
||||
print "\t$enum\n"
|
||||
}
|
||||
print "};\n";
|
||||
print "##ifdef I_AM_OPTIMIZE\n";
|
||||
for my $n (@names)
|
||||
{
|
||||
my $key = $n->[0];
|
||||
my $val = $n->[1];
|
||||
print "static const char dn_$key\[\] = \"$val\";\n";
|
||||
}
|
||||
print "static const char* decname[] =\n{\n";
|
||||
for my $n (@names)
|
||||
{
|
||||
my $key = $n->[0];
|
||||
print "\t".($key eq 'autodec' ? ' ' : ',')."dn_$key\n";
|
||||
}
|
||||
print "};\n##endif"
|
||||
EOT
|
||||
*/
|
||||
enum optdec
|
||||
{
|
||||
autodec=0
|
||||
,generic
|
||||
,generic_dither
|
||||
,idrei
|
||||
,ivier
|
||||
,ifuenf
|
||||
,ifuenf_dither
|
||||
,mmx
|
||||
,dreidnow
|
||||
,dreidnowext
|
||||
,altivec
|
||||
,sse
|
||||
,x86_64
|
||||
,arm
|
||||
,neon
|
||||
,neon64
|
||||
,avx
|
||||
,dreidnow_vintage
|
||||
,dreidnowext_vintage
|
||||
,sse_vintage
|
||||
,nodec
|
||||
};
|
||||
#ifdef I_AM_OPTIMIZE
|
||||
static const char dn_autodec[] = "auto";
|
||||
static const char dn_generic[] = "generic";
|
||||
static const char dn_generic_dither[] = "generic_dither";
|
||||
static const char dn_idrei[] = "i386";
|
||||
static const char dn_ivier[] = "i486";
|
||||
static const char dn_ifuenf[] = "i586";
|
||||
static const char dn_ifuenf_dither[] = "i586_dither";
|
||||
static const char dn_mmx[] = "MMX";
|
||||
static const char dn_dreidnow[] = "3DNow";
|
||||
static const char dn_dreidnowext[] = "3DNowExt";
|
||||
static const char dn_altivec[] = "AltiVec";
|
||||
static const char dn_sse[] = "SSE";
|
||||
static const char dn_x86_64[] = "x86-64";
|
||||
static const char dn_arm[] = "ARM";
|
||||
static const char dn_neon[] = "NEON";
|
||||
static const char dn_neon64[] = "NEON64";
|
||||
static const char dn_avx[] = "AVX";
|
||||
static const char dn_dreidnow_vintage[] = "3DNow_vintage";
|
||||
static const char dn_dreidnowext_vintage[] = "3DNowExt_vintage";
|
||||
static const char dn_sse_vintage[] = "SSE_vintage";
|
||||
static const char dn_nodec[] = "nodec";
|
||||
static const char* decname[] =
|
||||
{
|
||||
dn_autodec
|
||||
,dn_generic
|
||||
,dn_generic_dither
|
||||
,dn_idrei
|
||||
,dn_ivier
|
||||
,dn_ifuenf
|
||||
,dn_ifuenf_dither
|
||||
,dn_mmx
|
||||
,dn_dreidnow
|
||||
,dn_dreidnowext
|
||||
,dn_altivec
|
||||
,dn_sse
|
||||
,dn_x86_64
|
||||
,dn_arm
|
||||
,dn_neon
|
||||
,dn_neon64
|
||||
,dn_avx
|
||||
,dn_dreidnow_vintage
|
||||
,dn_dreidnowext_vintage
|
||||
,dn_sse_vintage
|
||||
,dn_nodec
|
||||
};
|
||||
#endif
|
||||
|
||||
enum optcla { nocla=0, normal, mmxsse };
|
||||
|
||||
/* - Set up the table of synth functions for current decoder choice. */
|
||||
int frame_cpu_opt(mpg123_handle *fr, const char* cpu);
|
||||
/* - Choose, from the synth table, the synth functions to use for current output format/rate. */
|
||||
int set_synth_functions(mpg123_handle *fr);
|
||||
/* - Parse decoder name and return numerical code. */
|
||||
enum optdec dectype(const char* decoder);
|
||||
/* - Return the default decoder type. */
|
||||
enum optdec defdec(void);
|
||||
/* - Return the class of a decoder type (mmxsse or normal). */
|
||||
enum optcla decclass(const enum optdec);
|
||||
|
||||
/* Now comes a whole lot of definitions, for multi decoder mode and single decoder mode.
|
||||
Because of the latter, it may look redundant at times. */
|
||||
|
||||
/* this is included in mpg123.h, which includes config.h */
|
||||
#ifdef CCALIGN
|
||||
#define ALIGNED(a) __attribute__((aligned(a)))
|
||||
#else
|
||||
#define ALIGNED(a)
|
||||
#endif
|
||||
|
||||
/* Safety catch for invalid decoder choice. */
|
||||
#ifdef REAL_IS_FIXED
|
||||
#if (defined OPT_I486) || (defined OPT_I586) || (defined OPT_I586_DITHER) \
|
||||
|| (defined OPT_MMX) || (defined OPT_SSE) || (defined_OPT_ALTIVEC) \
|
||||
|| (defined OPT_3DNOW) || (defined OPT_3DNOWEXT) || (defined OPT_X86_64) \
|
||||
|| (defined OPT_3DNOW_VINTAGE) || (defined OPT_3DNOWEXT_VINTAGE) \
|
||||
|| (defined OPT_SSE_VINTAGE) \
|
||||
|| (defined OPT_NEON) || (defined OPT_NEON64) || (defined OPT_AVX) \
|
||||
|| (defined OPT_GENERIC_DITHER)
|
||||
#error "Bad decoder choice together with fixed point math!"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if (defined NO_LAYER1 && defined NO_LAYER2)
|
||||
#define NO_LAYER12
|
||||
#endif
|
||||
|
||||
#ifdef OPT_GENERIC
|
||||
#ifndef OPT_MULTI
|
||||
# define defopt generic
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef OPT_GENERIC_DITHER
|
||||
#define OPT_DITHER
|
||||
#ifndef OPT_MULTI
|
||||
# define defopt generic_dither
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* i486 is special... always alone! */
|
||||
#ifdef OPT_I486
|
||||
#define OPT_X86
|
||||
#define defopt ivier
|
||||
#ifdef OPT_MULTI
|
||||
#error "i486 can only work alone!"
|
||||
#endif
|
||||
#define FIR_BUFFER_SIZE 128
|
||||
#define FIR_SIZE 16
|
||||
#endif
|
||||
|
||||
#ifdef OPT_I386
|
||||
#define OPT_X86
|
||||
#ifndef OPT_MULTI
|
||||
# define defopt idrei
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef OPT_I586
|
||||
#define OPT_X86
|
||||
#ifndef OPT_MULTI
|
||||
# define defopt ifuenf
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef OPT_I586_DITHER
|
||||
#define OPT_X86
|
||||
#define OPT_DITHER
|
||||
#ifndef OPT_MULTI
|
||||
# define defopt ifuenf_dither
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* We still have some special code around MMX tables. */
|
||||
|
||||
#ifdef OPT_MMX
|
||||
#define OPT_MMXORSSE
|
||||
#define OPT_X86
|
||||
#ifndef OPT_MULTI
|
||||
# define defopt mmx
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef OPT_SSE
|
||||
#define OPT_MMXORSSE
|
||||
#define OPT_MPLAYER
|
||||
#define OPT_X86
|
||||
#ifndef OPT_MULTI
|
||||
# define defopt sse
|
||||
# define opt_dct36(fr) dct36_sse
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef OPT_SSE_VINTAGE
|
||||
#define OPT_MMXORSSE
|
||||
#define OPT_MPLAYER
|
||||
#define OPT_X86
|
||||
#ifndef OPT_MULTI
|
||||
# define defopt sse
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef OPT_3DNOWEXT
|
||||
#define OPT_MMXORSSE
|
||||
#define OPT_MPLAYER
|
||||
#define OPT_X86
|
||||
#ifndef OPT_MULTI
|
||||
# define defopt dreidnowext
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* same as above but also using 3DNowExt dct36 */
|
||||
#ifdef OPT_3DNOWEXT_VINTAGE
|
||||
#define OPT_MMXORSSE
|
||||
#define OPT_MPLAYER
|
||||
#define OPT_X86
|
||||
#ifndef OPT_MULTI
|
||||
# define defopt dreidnowext_vintage
|
||||
# define opt_dct36(fr) dct36_3dnowext
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef OPT_MPLAYER
|
||||
extern const int costab_mmxsse[];
|
||||
#endif
|
||||
|
||||
/* 3dnow used to use synth_1to1_i586 for mono / 8bit conversion - was that intentional? */
|
||||
/* I'm trying to skip the pentium code here ... until I see that that is indeed a bad idea */
|
||||
#ifdef OPT_3DNOW
|
||||
#define OPT_X86
|
||||
#ifndef OPT_MULTI
|
||||
# define defopt dreidnow
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* same as above but also using 3DNow dct36 */
|
||||
#ifdef OPT_3DNOW_VINTAGE
|
||||
#define OPT_X86
|
||||
#ifndef OPT_MULTI
|
||||
# define defopt dreidnow_vintage
|
||||
# define opt_dct36(fr) dct36_3dnow
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef OPT_ALTIVEC
|
||||
#ifndef OPT_MULTI
|
||||
# define defopt altivec
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef OPT_X86_64
|
||||
#define OPT_MMXORSSE
|
||||
#ifndef OPT_MULTI
|
||||
# define defopt x86_64
|
||||
# define opt_dct36(fr) dct36_x86_64
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef OPT_AVX
|
||||
#define OPT_MMXORSSE
|
||||
#ifndef OPT_MULTI
|
||||
# define defopt avx
|
||||
# define opt_dct36(fr) dct36_avx
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef OPT_ARM
|
||||
#ifndef OPT_MULTI
|
||||
# define defopt arm
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef OPT_NEON
|
||||
#define OPT_MMXORSSE
|
||||
#ifndef OPT_MULTI
|
||||
# define defopt neon
|
||||
# define opt_dct36(fr) dct36_neon
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef OPT_NEON64
|
||||
#define OPT_MMXORSSE
|
||||
#ifndef OPT_MULTI
|
||||
# define defopt neon64
|
||||
# define opt_dct36(fr) dct36_neon64
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
Now come two blocks of standard definitions for multi-decoder mode and single-decoder mode.
|
||||
Most stuff is so automatic that it's indeed generated by some inline shell script.
|
||||
Remember to use these scripts when possible, instead of direct repetitive hacking.
|
||||
*/
|
||||
|
||||
#ifdef OPT_MULTI
|
||||
|
||||
# define defopt nodec
|
||||
|
||||
# if (defined OPT_3DNOW_VINTAGE || defined OPT_3DNOWEXT_VINTAGE || defined OPT_SSE || defined OPT_X86_64 || defined OPT_AVX || defined OPT_NEON || defined OPT_NEON64)
|
||||
# define opt_dct36(fr) ((fr)->cpu_opts.the_dct36)
|
||||
# endif
|
||||
|
||||
#endif /* OPT_MULTI else */
|
||||
|
||||
# ifndef opt_dct36
|
||||
# define opt_dct36(fr) dct36
|
||||
# endif
|
||||
|
||||
#endif /* MPG123_H_OPTIMIZE */
|
||||
|
751
ThirdParty/mpg123/include/mpg123/out123.h
vendored
Normal file
751
ThirdParty/mpg123/include/mpg123/out123.h
vendored
Normal file
|
@ -0,0 +1,751 @@
|
|||
/*
|
||||
out123: audio output interface
|
||||
|
||||
copyright 1995-2016 by the mpg123 project,
|
||||
free software under the terms of the LGPL 2.1
|
||||
|
||||
see COPYING and AUTHORS files in distribution or http://mpg123.org
|
||||
initially written as audio.h by Michael Hipp, reworked into out123 API
|
||||
by Thomas Orgis
|
||||
*/
|
||||
|
||||
#ifndef _OUT123_H_
|
||||
#define _OUT123_H_
|
||||
|
||||
/** \file out123.h The header file for the libout123 audio output facility. */
|
||||
|
||||
/** A macro to check at compile time which set of API functions to expect.
|
||||
* This must be incremented at least each time a new symbol is added
|
||||
* to the header.
|
||||
*/
|
||||
#define OUT123_API_VERSION 5
|
||||
/** library patch level at client build time */
|
||||
#define OUT123_PATCHLEVEL 1
|
||||
|
||||
/* We only need size_t definition. */
|
||||
#include <stddef.h>
|
||||
|
||||
/* Common audio encoding specification, including a macro for getting
|
||||
* size of encoded samples in bytes. Said macro is still hardcoded
|
||||
* into out123_encsize(). Relying on this one may help an old program
|
||||
* know sizes of encodings added to fmt123.h later on.
|
||||
* If you don't care, just use the macro.
|
||||
*/
|
||||
#include "fmt123.h"
|
||||
|
||||
#ifndef MPG123_EXPORT
|
||||
/** Defines needed for MS Visual Studio(tm) DLL builds.
|
||||
* Every public function must be prefixed with MPG123_EXPORT. When building
|
||||
* the DLL ensure to define BUILD_MPG123_DLL. This makes the function accessible
|
||||
* for clients and includes it in the import library which is created together
|
||||
* with the DLL. When consuming the DLL ensure to define LINK_MPG123_DLL which
|
||||
* imports the functions from the DLL.
|
||||
*/
|
||||
#ifdef BUILD_MPG123_DLL
|
||||
/* The dll exports. */
|
||||
#define MPG123_EXPORT __declspec(dllexport)
|
||||
#else
|
||||
#ifdef LINK_MPG123_DLL
|
||||
/* The exe imports. */
|
||||
#define MPG123_EXPORT __declspec(dllimport)
|
||||
#else
|
||||
/* Nothing on normal/UNIX builds */
|
||||
#define MPG123_EXPORT
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Earlier versions of libout123 put enums into public API calls,
|
||||
* thich is not exactly safe. There are ABI rules, but you can use
|
||||
* compiler switches to change the sizes of enums. It is safer not
|
||||
* to have them in API calls. Thus, the default is to remap calls and
|
||||
* structs to variants that use plain ints. Define MPG123_ENUM_API to
|
||||
* prevent that remapping.
|
||||
*
|
||||
* You might want to define this to increase the chance of your binary
|
||||
* working with an older version of the library. But if that is your goal,
|
||||
* you should better build with an older version to begin with.
|
||||
*/
|
||||
#ifndef MPG123_ENUM_API
|
||||
|
||||
#define out123_param out123_param2
|
||||
#define out123_getparam out123_getparam2
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/** \defgroup out123_api out123 library API
|
||||
* This is out123, a library focused on continuous playback of audio streams
|
||||
* via various platform-specific output methods. It glosses over details of
|
||||
* the native APIs to give an interface close to simply writing data to a
|
||||
* file. There might be the option to tune details like buffer (period) sizes
|
||||
* and the number of them on the device side in future, but the focus of the
|
||||
* library is to ease the use case of just getting that raw audio data out
|
||||
* there, without interruptions.
|
||||
*
|
||||
* The basic idea is to create a handle with out123_new() and open a certain
|
||||
* output device (using a certain driver module, possibly build-time defaults)
|
||||
* with out123_open(). Now, you can query the output device for supported
|
||||
* encodings for given rate and channel count with out123_get_encodings() and
|
||||
* decide what to use for actually starting playback with out123_start().
|
||||
*
|
||||
* Then, you just need to provide (interleaved pcm) data for playback with
|
||||
* out123_play(), which will block when the device's buffers are full. You get
|
||||
* your timing from that (instead of callbacks). If your program does the
|
||||
* production of the audio data just a little bit faster than the playback,
|
||||
* causing out123_play() to block ever so briefly, you're fine.
|
||||
*
|
||||
* You stop playback with out123_stop(), or just close the device and driver
|
||||
* via out123_close(), or even just decide to drop it all and do out123_del()
|
||||
* right away when you're done.
|
||||
*
|
||||
* There are other functions for specific needs, but the basic idea should be
|
||||
* covered by the above.
|
||||
*
|
||||
* Note that the driver modules that bind to the operating system API for
|
||||
* output might impose restrictions on what you can safely do regarding your
|
||||
* out123_handle and multiple threads or processes. You should be on the safe
|
||||
* side ensuring that you confine usage of a handle to a single thread instead
|
||||
* of passing it around.
|
||||
@{
|
||||
*/
|
||||
|
||||
/** Opaque structure for the libout123 handle. */
|
||||
struct out123_struct;
|
||||
/** Typedef shortcut as preferrend name for the handle type. */
|
||||
typedef struct out123_struct out123_handle;
|
||||
|
||||
/** Get version of the mpg123 distribution this library build came with.
|
||||
* (optional means non-NULL)
|
||||
* \param major optional address to store major version number
|
||||
* \param minor optional address to store minor version number
|
||||
* \param patch optional address to store patchlevel version number
|
||||
* \return full version string (like "1.2.3-beta4 (experimental)")
|
||||
*/
|
||||
MPG123_EXPORT
|
||||
const char *out123_distversion(unsigned int *major, unsigned int *minor, unsigned int *patch);
|
||||
|
||||
/** Get API version of library build.
|
||||
* \param patch optional address to store patchlevel
|
||||
* \return API version of library
|
||||
*/
|
||||
MPG123_EXPORT
|
||||
unsigned int out123_libversion(unsigned int *patch);
|
||||
|
||||
/** Enumeration of codes for the parameters that it is possible to set/get. */
|
||||
enum out123_parms
|
||||
{
|
||||
OUT123_FLAGS = 1 /**< integer, various flags, see enum #out123_flags */
|
||||
, OUT123_PRELOAD /**< float, fraction of buffer to fill before playback */
|
||||
, OUT123_GAIN /**< integer, output device gain (module-specific) */
|
||||
, OUT123_VERBOSE /**< integer, verbosity to stderr, >= 0 */
|
||||
, OUT123_DEVICEBUFFER /**<
|
||||
* float, length of device buffer in seconds;
|
||||
* This might be ignored, might have only a loose relation to actual
|
||||
* buffer sizes and latency, depending on output driver. Try to tune
|
||||
* this before opening a device if you want to influcence latency or reduce
|
||||
* dropouts. Value <= 0 uses some default, usually favouring stable playback
|
||||
* over low latency. Values above 0.5 are probably too much.
|
||||
*/
|
||||
, OUT123_PROPFLAGS /**< integer, query driver/device property flags (r/o) */
|
||||
, OUT123_NAME /**< string, name of this instance (NULL restores default);
|
||||
* The value returned by out123_getparam() might be different if the audio
|
||||
* backend changed it (to be unique among clients, p.ex.).
|
||||
* TODO: The name provided here is used as prefix in diagnostic messages. */
|
||||
, OUT123_BINDIR /**< string, path to a program binary directory to use
|
||||
* as starting point in the search for the output module directory
|
||||
* (e.g. ../lib/mpg123 or ./plugins). The environment variable MPG123_MODDIR
|
||||
* is always tried first and the in-built installation path last.
|
||||
*/
|
||||
, OUT123_ADD_FLAGS /**< enable given flags */
|
||||
, OUT123_REMOVE_FLAGS /**< disable diven flags */
|
||||
};
|
||||
|
||||
/** Flags to tune out123 behaviour */
|
||||
enum out123_flags
|
||||
{
|
||||
OUT123_HEADPHONES = 0x01 /**< output to headphones (if supported) */
|
||||
, OUT123_INTERNAL_SPEAKER = 0x02 /**< output to speaker (if supported) */
|
||||
, OUT123_LINE_OUT = 0x04 /**< output to line out (if supported) */
|
||||
, OUT123_QUIET = 0x08 /**< no printouts to standard error */
|
||||
, OUT123_KEEP_PLAYING = 0x10 /**<
|
||||
* When this is set (default), playback continues in a loop when the device
|
||||
* does not consume all given data at once. This happens when encountering
|
||||
* signals (like SIGSTOP, SIGCONT) that cause interruption of the underlying
|
||||
* functions.
|
||||
* Note that this flag is meaningless when the optional buffer is employed,
|
||||
* There, your program will always block until the buffer completely took
|
||||
* over the data given to it via out123_play(), unless a communication error
|
||||
* arises.
|
||||
*/
|
||||
, OUT123_MUTE = 0x20 /**< software mute (play silent audio) */
|
||||
};
|
||||
|
||||
/** Read-only output driver/device property flags (OUT123_PROPFLAGS). */
|
||||
enum out123_propflags
|
||||
{
|
||||
OUT123_PROP_LIVE = 0x01 /**< This is a live output, meaning that
|
||||
* special care might be needed for pauses in playback (p.ex. stream
|
||||
* of silence instead of interruption), as opposed to files on disk.
|
||||
*/
|
||||
, OUT123_PROP_PERSISTENT = 0x02 /**< This (live) output does not need
|
||||
* special care for pauses (continues with silence itself),
|
||||
* out123_pause() does nothing to the device.
|
||||
*/
|
||||
};
|
||||
|
||||
/** Create a new output handle.
|
||||
* This only allocates and initializes memory, so the only possible
|
||||
* error condition is running out of memory.
|
||||
* \return pointer to new handle or NULL on error
|
||||
*/
|
||||
MPG123_EXPORT
|
||||
out123_handle *out123_new(void);
|
||||
|
||||
/** Delete output handle.
|
||||
* This implies out123_close().
|
||||
*/
|
||||
MPG123_EXPORT
|
||||
void out123_del(out123_handle *ao);
|
||||
|
||||
/** Free plain memory allocated within libout123.
|
||||
* This is for library users that are not sure to use the same underlying
|
||||
* memory allocator as libout123. It is just a wrapper over free() in
|
||||
* the underlying C library.
|
||||
*/
|
||||
MPG123_EXPORT void out123_free(void *ptr);
|
||||
|
||||
/** Error code enumeration
|
||||
* API calls return a useful (positve) value or zero (OUT123_OK) on simple
|
||||
* success. A negative value (-1 == OUT123_ERR) usually indicates that some
|
||||
* error occured. Which one, that can be queried using out123_errcode()
|
||||
* and friends.
|
||||
*/
|
||||
enum out123_error
|
||||
{
|
||||
OUT123_ERR = -1 /**< generic alias for verbosity, always == -1 */
|
||||
, OUT123_OK = 0 /**< just a name for zero, not going to change */
|
||||
, OUT123_DOOM /**< dazzled, out of memory */
|
||||
, OUT123_BAD_DRIVER_NAME /**< bad driver name given */
|
||||
, OUT123_BAD_DRIVER /**< unspecified issue loading a driver */
|
||||
, OUT123_NO_DRIVER /**< no driver loaded */
|
||||
, OUT123_NOT_LIVE /**< no active audio device */
|
||||
, OUT123_DEV_PLAY /**< some device playback error */
|
||||
, OUT123_DEV_OPEN /**< error opening device */
|
||||
, OUT123_BUFFER_ERROR /**<
|
||||
* Some (really unexpected) error in buffer infrastructure.
|
||||
*/
|
||||
, OUT123_MODULE_ERROR /**< basic failure in module loading */
|
||||
, OUT123_ARG_ERROR /**< some bad function arguments supplied */
|
||||
, OUT123_BAD_PARAM /**< unknown parameter code */
|
||||
, OUT123_SET_RO_PARAM /**< attempt to set read-only parameter */
|
||||
, OUT123_BAD_HANDLE /**< bad handle pointer (NULL, usually) */
|
||||
, OUT123_NOT_SUPPORTED /**< some requested operation is not supported (right now) */
|
||||
, OUT123_DEV_ENUMERATE /**< device enumeration itself failed */
|
||||
, OUT123_ERRCOUNT /**< placeholder for shaping arrays */
|
||||
};
|
||||
|
||||
/** Get string representation of last encountered error in the
|
||||
* context of given handle.
|
||||
* \param ao handle
|
||||
* \return error string
|
||||
*/
|
||||
MPG123_EXPORT
|
||||
const char* out123_strerror(out123_handle *ao);
|
||||
|
||||
/** Get the plain errcode intead of a string.
|
||||
* Note that this used to return OUT123_ERR instead of
|
||||
* OUT123_BAD_HANDLE in case of ao==NULL before mpg123-1.23.5 .
|
||||
* \param ao handle
|
||||
* \return error code recorded in handle or OUT123_BAD_HANDLE
|
||||
*/
|
||||
MPG123_EXPORT
|
||||
int out123_errcode(out123_handle *ao);
|
||||
|
||||
/** Return the error string for a given error code.
|
||||
* \param errcode the integer error code
|
||||
* \return error string
|
||||
*/
|
||||
MPG123_EXPORT
|
||||
const char* out123_plain_strerror(int errcode);
|
||||
|
||||
/** Set a desired output buffer size.
|
||||
* This starts a separate process that handles the audio output, decoupling
|
||||
* the latter from the main process with a memory buffer and saving you the
|
||||
* burden to ensure sparing CPU cycles for actual playback.
|
||||
* This is for applicatons that prefer continuous playback over small latency.
|
||||
* In other words: The kind of applications that out123 is designed for.
|
||||
* This routine always kills off any currently active audio output module /
|
||||
* device, even if you just disable the buffer when there is no buffer.
|
||||
*
|
||||
* Keep this in mind for memory-constrainted systems: Activating the
|
||||
* buffer causes a fork of the calling process, doubling the virtual memory
|
||||
* use. Depending on your operating system kernel's behaviour regarding
|
||||
* memory overcommit, it might be wise to call out123_set_buffer() very
|
||||
* early in your program before allocating lots of memory.
|
||||
*
|
||||
* There _might_ be a change to threads in future, but for now this is
|
||||
* classic fork with shared memory, working without any threading library.
|
||||
* If your platform or build does not support that, you will always get an
|
||||
* error on trying to set up a non-zero buffer (but the API call will be
|
||||
* present).
|
||||
*
|
||||
* Also, if you do intend to use this from a multithreaded program, think
|
||||
* twice and make sure that your setup is happy with forking full-blown
|
||||
* processes off threaded programs. Probably you are better off spawning a
|
||||
* buffer thread yourself.
|
||||
*
|
||||
* \param ao handle
|
||||
* \param buffer_bytes size (bytes) of a memory buffer for decoded audio,
|
||||
* a value of zero disables the buffer.
|
||||
* \return 0 on success, OUT123_ERR on error
|
||||
*/
|
||||
MPG123_EXPORT
|
||||
int out123_set_buffer(out123_handle *ao, size_t buffer_bytes);
|
||||
|
||||
#ifdef MPG123_ENUM_API
|
||||
/** Set a parameter on a out123_handle.
|
||||
*
|
||||
* Note that this name is mapped to out123_param2() instead unless
|
||||
* MPG123_ENUM_API is defined.
|
||||
*
|
||||
* The parameters usually only change what happens on next out123_open, not
|
||||
* incfluencing running operation. There are macros To ease the API a bit:
|
||||
* You can call out123_param_int(ao, code, value) for integer (long) values,
|
||||
* same with out123_param_float() and out123_param_string().
|
||||
*
|
||||
* \param ao handle
|
||||
* \param code parameter code
|
||||
* \param value input value for integer parameters
|
||||
* \param fvalue input value for floating point parameters
|
||||
* \param svalue input value for string parameters (contens are copied)
|
||||
* \return 0 on success, OUT123_ERR on error.
|
||||
*/
|
||||
MPG123_EXPORT
|
||||
int out123_param( out123_handle *ao, enum out123_parms code
|
||||
, long value, double fvalue, const char *svalue );
|
||||
#endif
|
||||
|
||||
/** Set a parameter on a out123_handle. No enum.
|
||||
*
|
||||
* This is actually called instead of out123_param()
|
||||
* unless MPG123_ENUM_API is defined.
|
||||
*
|
||||
* The parameters usually only change what happens on next out123_open, not
|
||||
* incfluencing running operation. There are macros To ease the API a bit:
|
||||
* You can call out123_param_int(ao, code, value) for integer (long) values,
|
||||
* same with out123_param_float() and out123_param_string().
|
||||
*
|
||||
* \param ao handle
|
||||
* \param code parameter code (from enum #out123_parms)
|
||||
* \param value input value for integer parameters
|
||||
* \param fvalue input value for floating point parameters
|
||||
* \param svalue input value for string parameters (contens are copied)
|
||||
* \return 0 on success, OUT123_ERR on error.
|
||||
*/
|
||||
MPG123_EXPORT
|
||||
int out123_param2( out123_handle *ao, int code
|
||||
, long value, double fvalue, const char *svalue );
|
||||
|
||||
|
||||
/** Shortcut for out123_param() to set an integer parameter. */
|
||||
#define out123_param_int(ao, code, value) \
|
||||
out123_param((ao), (code), (value), 0., NULL)
|
||||
/** Shortcut for out123_param() to set a float parameter. */
|
||||
#define out123_param_float(ao, code, value) \
|
||||
out123_param((ao), (code), 0, (value), NULL)
|
||||
/** Shortcut for out123_param() to set an string parameter. */
|
||||
#define out123_param_string(ao, code, value) \
|
||||
out123_param((ao), (code), 0, 0., (value))
|
||||
|
||||
#ifdef MPG123_ENUM_API
|
||||
/** Get a parameter from an out123_handle.
|
||||
*
|
||||
* Note that this name is mapped to out123_param2() instead unless
|
||||
* MPG123_ENUM_API is defined.
|
||||
*
|
||||
* \param ao handle
|
||||
* \param code parameter code
|
||||
* \param ret_value output address for integer parameters
|
||||
* \param ret_fvalue output address for floating point parameters
|
||||
* \param ret_svalue output address for string parameters (pointer to
|
||||
* internal memory, so no messing around, please)
|
||||
* \return 0 on success, OUT123_ERR on error (bad parameter name or bad handle).
|
||||
*/
|
||||
MPG123_EXPORT
|
||||
int out123_getparam( out123_handle *ao, enum out123_parms code
|
||||
, long *ret_value, double *ret_fvalue, char* *ret_svalue );
|
||||
#endif
|
||||
|
||||
/** Get a parameter from an out123_handle. No enum.
|
||||
*
|
||||
* This is actually called instead of out123_getparam()
|
||||
* unless MPG123_ENUM_API is defined.
|
||||
*
|
||||
* \param ao handle
|
||||
* \param code parameter code (from enum #out123_parms)
|
||||
* \param ret_value output address for integer parameters
|
||||
* \param ret_fvalue output address for floating point parameters
|
||||
* \param ret_svalue output address for string parameters (pointer to
|
||||
* internal memory, so no messing around, please)
|
||||
* \return 0 on success, OUT123_ERR on error (bad parameter name or bad handle).
|
||||
*/
|
||||
MPG123_EXPORT
|
||||
int out123_getparam2( out123_handle *ao, int code
|
||||
, long *ret_value, double *ret_fvalue, char* *ret_svalue );
|
||||
|
||||
/** Shortcut for out123_getparam() to get an integer parameter. */
|
||||
#define out123_getparam_int(ao, code, value) \
|
||||
out123_getparam((ao), (code), (value), NULL, NULL)
|
||||
/** Shortcut for out123_getparam() to get a float parameter. */
|
||||
#define out123_getparam_float(ao, code, value) \
|
||||
out123_getparam((ao), (code), NULL, (value), NULL)
|
||||
/** Shortcut for out123_getparam() to get a string parameter. */
|
||||
#define out123_getparam_string(ao, code, value) \
|
||||
out123_getparam((ao), (code), NULL, NULL, (value))
|
||||
|
||||
/** Copy parameters from another out123_handle.
|
||||
* \param ao handle
|
||||
* \param from_ao the handle to copy parameters from
|
||||
* \return 0 in success, -1 on error
|
||||
*/
|
||||
MPG123_EXPORT
|
||||
int out123_param_from(out123_handle *ao, out123_handle* from_ao);
|
||||
|
||||
/** Get list of driver modules reachable in system in C argv-style format.
|
||||
*
|
||||
* The client is responsible for freeing the memory of both the individual
|
||||
* strings and the lists themselves. There is out123_stringlists_free()
|
||||
* to assist.
|
||||
*
|
||||
* A module that is not loadable because of missing libraries is simply
|
||||
* skipped. You will get stderr messages about that unless OUT123_QUIET was
|
||||
* was set, though. Failure to open the module directory is a serious error,
|
||||
* resulting in negative return value.
|
||||
*
|
||||
* \param ao handle
|
||||
* \param names address for storing list of names
|
||||
* \param descr address for storing list of descriptions
|
||||
* \return number of drivers found, -1 on error
|
||||
*/
|
||||
MPG123_EXPORT
|
||||
int out123_drivers(out123_handle *ao, char ***names, char ***descr);
|
||||
|
||||
/** Get a list of available output devices for a given driver.
|
||||
*
|
||||
* If the driver supports enumeration, you can get a listing of possible
|
||||
* output devices. If this list is exhaustive, depends on the driver.
|
||||
* Note that this implies out123_close(). When you have a device already
|
||||
* open, you don't need to look for one anymore. If you really do, just
|
||||
* create another handle.
|
||||
*
|
||||
* Your provided pointers are only used for non-negative return values.
|
||||
* In this case, you are responsible for freeing the associated memory of
|
||||
* the strings and the lists themselves. The format of the lists is an
|
||||
* array of char pointers, with the returned count just like the usual
|
||||
* C argv and argc. There is out123_stringlists_free() to assist.
|
||||
*
|
||||
* Note: Calling this on a handle with a configured buffer process will
|
||||
* yield #OUT123_NOT_SUPPORTED.
|
||||
*
|
||||
* \param ao handle
|
||||
* \param driver driver name or comma-separated list of names
|
||||
* to try, just like for out123_open(), possibly NULL for some default
|
||||
* \param names address for storing list of names
|
||||
* \param descr address for storing list of descriptions
|
||||
* \param active_driver address for storing a copy of the actually active
|
||||
* driver name (in case you gave a list or NULL as driver), can be NULL
|
||||
* if not interesting
|
||||
* \return count of devices or #OUT123_ERR if some error was encountered,
|
||||
* possibly just #OUT123_NOT_SUPPORTED if the driver lacks enumeration support
|
||||
*/
|
||||
MPG123_EXPORT
|
||||
int out123_devices( out123_handle *ao, const char *driver
|
||||
, char ***names, char ***descr, char **active_driver );
|
||||
|
||||
/** Helper to free string list memory.
|
||||
*
|
||||
* This aids in freeing the memory allocated by out123_devices() and
|
||||
* out123_drivers().
|
||||
*
|
||||
* Any of the given lists can be NULL and nothing will happen to it.
|
||||
*
|
||||
* \param name first string list
|
||||
* \param descr second string list
|
||||
* \param count count of strings
|
||||
*/
|
||||
MPG123_EXPORT
|
||||
void out123_stringlists_free(char **name, char **descr, int count);
|
||||
|
||||
|
||||
/** Open an output device with a certain driver
|
||||
* Note: Opening means that the driver code is loaded and the desired
|
||||
* device name recorded, possibly tested for availability or tentatively
|
||||
* opened. After out123_open(), you can ask for supported encodings
|
||||
* and then really open the device for playback with out123_start().
|
||||
* \param ao handle
|
||||
* \param driver (comma-separated list of) output driver name(s to try),
|
||||
* NULL for default
|
||||
* \param device device name to open, NULL for default
|
||||
* (stdout for file-based drivers)
|
||||
* \return 0 on success, -1 on error.
|
||||
*/
|
||||
MPG123_EXPORT
|
||||
int out123_open(out123_handle *ao, const char* driver, const char* device);
|
||||
|
||||
/** Give info about currently loaded driver and device
|
||||
* Any of the return addresses can be NULL if you are not interested in
|
||||
* everything. You get pointers to internal storage. They are valid
|
||||
* as long as the driver/device combination is opened.
|
||||
* The device may be NULL indicating some unnamed default.
|
||||
* TODO: Make the driver modules return names for such defaults.
|
||||
* \param ao handle
|
||||
* \param driver return address for driver name
|
||||
* \param device return address for device name
|
||||
* \return 0 on success, -1 on error (i.e. no driver loaded)
|
||||
*/
|
||||
MPG123_EXPORT
|
||||
int out123_driver_info(out123_handle *ao, char **driver, char **device);
|
||||
|
||||
/** Close the current output device and driver.
|
||||
* This implies out123_drain() to ensure no data is lost.
|
||||
* With a buffer, that might cause considerable delay during
|
||||
* which your main application is blocked waiting.
|
||||
* Call out123_drop() beforehand if you want to end things
|
||||
* quickly.
|
||||
* \param ao handle
|
||||
*/
|
||||
MPG123_EXPORT
|
||||
void out123_close(out123_handle *ao);
|
||||
|
||||
/** Get supported audio encodings for given rate and channel count,
|
||||
* for the currently openend audio device.
|
||||
* Usually, a wider range of rates is supported, but the number
|
||||
* of sample encodings is limited, as is the number of channels.
|
||||
* So you can call this with some standard rate and hope that the
|
||||
* returned encodings work also for others, with the tested channel
|
||||
* count.
|
||||
* The return value of -1 on some encountered error conveniently also
|
||||
* does not match any defined format (only 15 bits used for encodings,
|
||||
* so this would even work with 16 bit integers).
|
||||
* This implies out123_stop() to enter query mode.
|
||||
* \param ao handle
|
||||
* \param rate sampling rate
|
||||
* \param channels number of channels
|
||||
* \return supported encodings combined with bitwise or, to be checked
|
||||
* against your favourite bitmask, -1 on error
|
||||
*/
|
||||
MPG123_EXPORT
|
||||
int out123_encodings(out123_handle *ao, long rate, int channels);
|
||||
|
||||
/** Return the size (in bytes) of one mono sample of the named encoding.
|
||||
* \param encoding The encoding value to analyze.
|
||||
* \return positive size of encoding in bytes, 0 on invalid encoding. */
|
||||
MPG123_EXPORT int out123_encsize(int encoding);
|
||||
|
||||
/** Get list of supported formats for currently opened audio device.
|
||||
* Given a list of sampling rates and minimal/maximal channel count,
|
||||
* this quickly checks what formats are supported with these
|
||||
* constraints. The first entry is always reserved for a default
|
||||
* format for the output device. If there is no such default,
|
||||
* all values of the format are -1.
|
||||
* For each requested combination of rate and channels, a format entry is
|
||||
* created, possible with encoding value 0 to indicate that this combination
|
||||
* has been tested and rejected. So, when there is no basic error, the
|
||||
* number of returned format entries should be
|
||||
* (ratecount*(maxchannels-minchannels+1)+1)
|
||||
* . But instead of forcing you to guess, this will be allocated by
|
||||
* successful run.
|
||||
* For the first entry, the encoding member is supposed to be a definite
|
||||
* encoding, for the others it is a bitwise combination of all possible
|
||||
* encodings.
|
||||
* This function is more efficient than many calls to out123_encodings().
|
||||
* \param ao handle
|
||||
* \param rates pointer to an array of sampling rates, may be NULL for none
|
||||
* \param ratecount number of provided sampling rates
|
||||
* \param minchannels minimal channel count
|
||||
* \param maxchannels maximal channel count
|
||||
* \param fmtlist return address for array of supported formats
|
||||
* the encoding field of each entry is a combination of all
|
||||
* supported encodings at this rate and channel count;
|
||||
* Memory shall be freed by user.
|
||||
* \return number of returned format enries, -1 on error
|
||||
*/
|
||||
MPG123_EXPORT
|
||||
int out123_formats( out123_handle *ao, const long *rates, int ratecount
|
||||
, int minchannels, int maxchannels
|
||||
, struct mpg123_fmt **fmtlist );
|
||||
|
||||
/** Get list of encodings known to the library.
|
||||
* You are responsible for freeing the allocated array.
|
||||
* \param enclist return address for allocated array of encoding codes
|
||||
* \return number of encodings, -1 on error
|
||||
*/
|
||||
MPG123_EXPORT
|
||||
int out123_enc_list(int **enclist);
|
||||
|
||||
/** Find encoding code by name.
|
||||
* \param name short or long name to find encoding code for
|
||||
* \return encoding if found (enum #mpg123_enc_enum), else 0
|
||||
*/
|
||||
MPG123_EXPORT
|
||||
int out123_enc_byname(const char *name);
|
||||
|
||||
/** Get name of encoding.
|
||||
* \param encoding code (enum #mpg123_enc_enum)
|
||||
* \return short name for valid encodings, NULL otherwise
|
||||
*/
|
||||
MPG123_EXPORT
|
||||
const char* out123_enc_name(int encoding);
|
||||
|
||||
/** Get long name of encoding.
|
||||
* \param encoding code (enum #mpg123_enc_enum)
|
||||
* \return long name for valid encodings, NULL otherwise
|
||||
*/
|
||||
MPG123_EXPORT
|
||||
const char* out123_enc_longname(int encoding);
|
||||
|
||||
/** Start playback with a certain output format
|
||||
* It might be a good idea to have audio data handy to feed after this
|
||||
* returns with success.
|
||||
* Rationale for not taking a pointer to struct mpg123_fmt: This would
|
||||
* always force you to deal with that type and needlessly enlarge the
|
||||
* shortest possible program.
|
||||
* \param ao handle
|
||||
* \param encoding sample encoding (values matching libmpg123 API)
|
||||
* \param channels number of channels (1 or 2, usually)
|
||||
* \param rate sampling rate
|
||||
* \return 0 on success, negative on error (bad format, usually)
|
||||
*/
|
||||
MPG123_EXPORT
|
||||
int out123_start( out123_handle *ao
|
||||
, long rate, int channels, int encoding );
|
||||
|
||||
/** Pause playback
|
||||
* Interrupt playback, holding any data in the optional buffer.
|
||||
*
|
||||
* This closes the audio device if it is a live sink, ready to be re-opened
|
||||
* by out123_continue() or out123_play() with the existing parameters.
|
||||
* \param ao handle
|
||||
*/
|
||||
MPG123_EXPORT
|
||||
void out123_pause(out123_handle *ao);
|
||||
|
||||
/** Continue playback
|
||||
* The counterpart to out123_pause(). Announce to the driver that playback
|
||||
* shall continue.
|
||||
*
|
||||
* Playback might not resume immediately if the optional buffer is configured
|
||||
* to wait for a minimum fill and close to being empty. You can force playback
|
||||
* of the last scrap with out123_drain(), or just by feeding more data with
|
||||
* out123_play(), which will trigger out123_continue() for you, too.
|
||||
* \param ao handle
|
||||
*/
|
||||
MPG123_EXPORT
|
||||
void out123_continue(out123_handle *ao);
|
||||
|
||||
/** Stop playback.
|
||||
* This waits for pending audio data to drain to the speakers.
|
||||
* You might want to call out123_drop() before stopping if you want
|
||||
* to end things right away.
|
||||
* \param ao handle
|
||||
*/
|
||||
MPG123_EXPORT
|
||||
void out123_stop(out123_handle *ao);
|
||||
|
||||
/** Hand over data for playback and wait in case audio device is busy.
|
||||
* This survives non-fatal signals like SIGSTOP/SIGCONT and keeps on
|
||||
* playing until the buffer is done with if the flag
|
||||
* OUT123_KEEP_PLAYING ist set (default). So, per default, if
|
||||
* you provided a byte count divisible by the PCM frame size, it is an
|
||||
* error when less bytes than given are played.
|
||||
* To be sure if an error occured, check out123_errcode().
|
||||
* Also note that it is no accident that the buffer parameter is not marked
|
||||
* as constant. Some output drivers might need to do things like swap
|
||||
* byte order. This is done in-place instead of wasting memory on yet
|
||||
* another copy. Software muting also overwrites the data.
|
||||
* \param ao handle
|
||||
* \param buffer pointer to raw audio data to be played
|
||||
* \param bytes number of bytes to read from the buffer
|
||||
* \return number of bytes played (might be less than given, even zero)
|
||||
*/
|
||||
MPG123_EXPORT
|
||||
size_t out123_play( out123_handle *ao
|
||||
, void *buffer, size_t bytes );
|
||||
|
||||
/** Drop any buffered data, making next provided data play right away.
|
||||
* This does not imply an actual pause in playback.
|
||||
* You are expected to play something, unless you called out123_pause().
|
||||
* Feel free to call out123_stop() afterwards instead for a quicker
|
||||
* exit than the implied out123_drain().
|
||||
* For live sinks, this may include dropping data from their buffers.
|
||||
* For others (files), this only concerns data in the optional buffer.
|
||||
* \param ao handle
|
||||
*/
|
||||
MPG123_EXPORT
|
||||
void out123_drop(out123_handle *ao);
|
||||
|
||||
/** Drain the output, waiting until all data went to the hardware.
|
||||
* This does imply out123_continue() before and out123_pause()
|
||||
* after draining.
|
||||
* This might involve only the optional buffer process, or the
|
||||
* buffers on the audio driver side, too.
|
||||
* \param ao handle
|
||||
*/
|
||||
MPG123_EXPORT
|
||||
void out123_drain(out123_handle *ao);
|
||||
|
||||
/** Drain the output, but only partially up to the given number of
|
||||
* bytes. This gives you the opportunity to do something while
|
||||
* the optional buffer is writing remaining data instead of having
|
||||
* one atomic API call for it all.
|
||||
*
|
||||
* It is wholly expected that the return value of out123_buffered()
|
||||
* before and after calling this has a bigger difference than the
|
||||
* provided limit, as the buffer is writing all the time in the
|
||||
* background.
|
||||
*
|
||||
* This is just a plain out123_drain() if the optional buffer is not
|
||||
* in use. Also triggers out123_continue(), but only out123_pause()
|
||||
* if there is no buffered data anymore.
|
||||
* \param ao handle
|
||||
* \param bytes limit of buffered bytes to drain
|
||||
* \return number of bytes drained from buffer
|
||||
*/
|
||||
MPG123_EXPORT
|
||||
void out123_ndrain(out123_handle *ao, size_t bytes);
|
||||
|
||||
/** Get an indication of how many bytes reside in the optional buffer.
|
||||
* This might get extended to tell the number of bytes queued up in the
|
||||
* audio backend, too.
|
||||
* \param ao handle
|
||||
* \return number of bytes in out123 library buffer
|
||||
*/
|
||||
MPG123_EXPORT
|
||||
size_t out123_buffered(out123_handle *ao);
|
||||
|
||||
/** Extract currently used audio format from handle.
|
||||
* matching mpg123_getformat().
|
||||
* Given return addresses may be NULL to indicate no interest.
|
||||
* \param ao handle
|
||||
* \param rate address for sample rate
|
||||
* \param channels address for channel count
|
||||
* \param encoding address for encoding
|
||||
* \param framesize size of a full PCM frame (for convenience)
|
||||
* \return 0 on success, -1 on error
|
||||
*/
|
||||
MPG123_EXPORT
|
||||
int out123_getformat( out123_handle *ao
|
||||
, long *rate, int *channels, int *encoding, int *framesize );
|
||||
|
||||
/** @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
25
ThirdParty/mpg123/include/mpg123/parse.h
vendored
25
ThirdParty/mpg123/include/mpg123/parse.h
vendored
|
@ -1,25 +0,0 @@
|
|||
/*
|
||||
parse: spawned from common; clustering around stream/frame parsing
|
||||
|
||||
copyright ?-2007 by the mpg123 project - free software under the terms of the LGPL 2.1
|
||||
see COPYING and AUTHORS files in distribution or http://mpg123.org
|
||||
initially written by Michael Hipp & Thomas Orgis
|
||||
*/
|
||||
|
||||
#ifndef MPG123_PARSE_H
|
||||
#define MPG123_PARSE_H
|
||||
|
||||
#include "frame.h"
|
||||
|
||||
int read_frame_init(mpg123_handle* fr);
|
||||
int frame_bitrate(mpg123_handle *fr);
|
||||
long frame_freq(mpg123_handle *fr);
|
||||
int read_frame_recover(mpg123_handle* fr); /* dead? */
|
||||
int read_frame(mpg123_handle *fr);
|
||||
void set_pointer(mpg123_handle *fr, int part2, long backstep);
|
||||
int position_info(mpg123_handle* fr, unsigned long no, long buffsize, unsigned long* frames_left, double* current_seconds, double* seconds_left);
|
||||
double compute_bpf(mpg123_handle *fr);
|
||||
long time_to_frame(mpg123_handle *fr, double seconds);
|
||||
int get_songlen(mpg123_handle *fr,int no);
|
||||
|
||||
#endif
|
140
ThirdParty/mpg123/include/mpg123/reader.h
vendored
140
ThirdParty/mpg123/include/mpg123/reader.h
vendored
|
@ -1,140 +0,0 @@
|
|||
/*
|
||||
reader: reading input data
|
||||
|
||||
copyright ?-2007 by the mpg123 project - free software under the terms of the LGPL 2.1
|
||||
see COPYING and AUTHORS files in distribution or http://mpg123.org
|
||||
initially written by Thomas Orgis (after code from Michael Hipp)
|
||||
*/
|
||||
|
||||
#ifndef MPG123_READER_H
|
||||
#define MPG123_READER_H
|
||||
|
||||
#include "config.h"
|
||||
#include "mpg123.h"
|
||||
|
||||
#ifndef NO_FEEDER
|
||||
struct buffy
|
||||
{
|
||||
unsigned char *data;
|
||||
ssize_t size;
|
||||
ssize_t realsize;
|
||||
struct buffy *next;
|
||||
};
|
||||
|
||||
|
||||
struct bufferchain
|
||||
{
|
||||
struct buffy* first; /* The beginning of the chain. */
|
||||
struct buffy* last; /* The end... of the chain. */
|
||||
ssize_t size; /* Aggregated size of all buffies. */
|
||||
/* These positions are relative to buffer chain beginning. */
|
||||
ssize_t pos; /* Position in whole chain. */
|
||||
ssize_t firstpos; /* The point of return on non-forget() */
|
||||
/* The "real" filepos is fileoff + pos. */
|
||||
off_t fileoff; /* Beginning of chain is at this file offset. */
|
||||
size_t bufblock; /* Default (minimal) size of buffers. */
|
||||
size_t pool_size; /* Keep that many buffers in storage. */
|
||||
size_t pool_fill; /* That many buffers are there. */
|
||||
/* A pool of buffers to re-use, if activated. It's a linked list that is worked on from the front. */
|
||||
struct buffy *pool;
|
||||
};
|
||||
|
||||
/* Call this before any buffer chain use (even bc_init()). */
|
||||
void bc_prepare(struct bufferchain *, size_t pool_size, size_t bufblock);
|
||||
/* Free persistent data in the buffer chain, after bc_reset(). */
|
||||
void bc_cleanup(struct bufferchain *);
|
||||
/* Change pool size. This does not actually allocate/free anything on itself, just instructs later operations to free less / allocate more buffers. */
|
||||
void bc_poolsize(struct bufferchain *, size_t pool_size, size_t bufblock);
|
||||
/* Return available byte count in the buffer. */
|
||||
size_t bc_fill(struct bufferchain *bc);
|
||||
|
||||
#endif
|
||||
|
||||
struct reader_data
|
||||
{
|
||||
off_t filelen; /* total file length or total buffer size */
|
||||
off_t filepos; /* position in file or position in buffer chain */
|
||||
int filept;
|
||||
/* Custom opaque I/O handle from the client. */
|
||||
void *iohandle;
|
||||
int flags;
|
||||
long timeout_sec;
|
||||
ssize_t (*fdread) (mpg123_handle *, void *, size_t);
|
||||
/* User can replace the read and lseek functions. The r_* are the stored replacement functions or NULL. */
|
||||
ssize_t (*r_read) (int fd, void *buf, size_t count);
|
||||
off_t (*r_lseek)(int fd, off_t offset, int whence);
|
||||
/* These are custom I/O routines for opaque user handles.
|
||||
They get picked if there's some iohandle set. */
|
||||
ssize_t (*r_read_handle) (void *handle, void *buf, size_t count);
|
||||
off_t (*r_lseek_handle)(void *handle, off_t offset, int whence);
|
||||
/* An optional cleaner for the handle on closing the stream. */
|
||||
void (*cleanup_handle)(void *handle);
|
||||
/* These two pointers are the actual workers (default map to POSIX read/lseek). */
|
||||
ssize_t (*read) (int fd, void *buf, size_t count);
|
||||
off_t (*lseek)(int fd, off_t offset, int whence);
|
||||
/* Buffered readers want that abstracted, set internally. */
|
||||
ssize_t (*fullread)(mpg123_handle *, unsigned char *, ssize_t);
|
||||
#ifndef NO_FEEDER
|
||||
struct bufferchain buffer; /* Not dynamically allocated, these few struct bytes aren't worth the trouble. */
|
||||
#endif
|
||||
};
|
||||
|
||||
/* start to use off_t to properly do LFS in future ... used to be long */
|
||||
#ifdef __MORPHOS__
|
||||
#undef tell /* unistd.h defines it as lseek(x, 0L, 1) */
|
||||
#endif
|
||||
struct reader
|
||||
{
|
||||
int (*init) (mpg123_handle *);
|
||||
void (*close) (mpg123_handle *);
|
||||
ssize_t (*fullread) (mpg123_handle *, unsigned char *, ssize_t);
|
||||
int (*head_read) (mpg123_handle *, unsigned long *newhead); /* succ: TRUE, else <= 0 (FALSE or READER_MORE) */
|
||||
int (*head_shift) (mpg123_handle *, unsigned long *head); /* succ: TRUE, else <= 0 (FALSE or READER_MORE) */
|
||||
off_t (*skip_bytes) (mpg123_handle *, off_t len); /* succ: >=0, else error or READER_MORE */
|
||||
int (*read_frame_body)(mpg123_handle *, unsigned char *, int size);
|
||||
int (*back_bytes) (mpg123_handle *, off_t bytes);
|
||||
int (*seek_frame) (mpg123_handle *, off_t num);
|
||||
off_t (*tell) (mpg123_handle *);
|
||||
void (*rewind) (mpg123_handle *);
|
||||
void (*forget) (mpg123_handle *);
|
||||
};
|
||||
|
||||
/* Open a file by path or use an opened file descriptor. */
|
||||
int open_stream(mpg123_handle *, const char *path, int fd);
|
||||
/* Open an external handle. */
|
||||
int open_stream_handle(mpg123_handle *, void *iohandle);
|
||||
|
||||
/* feed based operation has some specials */
|
||||
int open_feed(mpg123_handle *);
|
||||
/* externally called function, returns 0 on success, -1 on error */
|
||||
int feed_more(mpg123_handle *fr, const unsigned char *in, long count);
|
||||
void feed_forget(mpg123_handle *fr); /* forget the data that has been read (free some buffers) */
|
||||
off_t feed_set_pos(mpg123_handle *fr, off_t pos); /* Set position (inside available data if possible), return wanted byte offset of next feed. */
|
||||
|
||||
void open_bad(mpg123_handle *);
|
||||
|
||||
#define READER_FD_OPENED 0x1
|
||||
#define READER_ID3TAG 0x2
|
||||
#define READER_SEEKABLE 0x4
|
||||
#define READER_BUFFERED 0x8
|
||||
#define READER_NONBLOCK 0x20
|
||||
#define READER_HANDLEIO 0x40
|
||||
|
||||
#define READER_STREAM 0
|
||||
#define READER_ICY_STREAM 1
|
||||
#define READER_FEED 2
|
||||
/* These two add a little buffering to enable small seeks for peek ahead. */
|
||||
#define READER_BUF_STREAM 3
|
||||
#define READER_BUF_ICY_STREAM 4
|
||||
|
||||
#ifdef READ_SYSTEM
|
||||
#define READER_SYSTEM 5
|
||||
#define READERS 6
|
||||
#else
|
||||
#define READERS 5
|
||||
#endif
|
||||
|
||||
#define READER_ERROR MPG123_ERR
|
||||
#define READER_MORE MPG123_NEED_MORE
|
||||
|
||||
#endif
|
195
ThirdParty/mpg123/include/mpg123/sample.h
vendored
195
ThirdParty/mpg123/include/mpg123/sample.h
vendored
|
@ -1,195 +0,0 @@
|
|||
/*
|
||||
sample.h: The conversion from internal data to output samples of differing formats.
|
||||
|
||||
copyright 2007-9 by the mpg123 project - free software under the terms of the LGPL 2.1
|
||||
see COPYING and AUTHORS files in distribution or http://mpg123.org
|
||||
initially written by Thomas Orgis, taking WRITE_SAMPLE from decode.c
|
||||
Later added the end-conversion specific macros here, too.
|
||||
*/
|
||||
|
||||
#ifndef SAMPLE_H
|
||||
#define SAMPLE_H
|
||||
|
||||
/* mpg123lib_intern.h is included already, right? */
|
||||
|
||||
/* Special case is fixed point math... which does work, but not that nice yet. */
|
||||
#ifdef REAL_IS_FIXED
|
||||
static inline int16_t idiv_signed_rounded(int32_t x, int shift)
|
||||
{
|
||||
x >>= (shift - 1);
|
||||
x += (x & 1);
|
||||
return (int16_t)(x >> 1);
|
||||
}
|
||||
# define REAL_PLUS_32767 ( 32767 << 15 )
|
||||
# define REAL_MINUS_32768 ( -32768 << 15 )
|
||||
# define REAL_TO_SHORT(x) (idiv_signed_rounded(x, 15))
|
||||
/* No better code (yet). */
|
||||
# define REAL_TO_SHORT_ACCURATE(x) REAL_TO_SHORT(x)
|
||||
/* This is just here for completeness, it is not used! */
|
||||
# define REAL_TO_S32(x) (x)
|
||||
#endif
|
||||
|
||||
/* From now on for single precision float... double precision is a possible option once we added some bits. But, it would be rather insane. */
|
||||
#ifndef REAL_TO_SHORT
|
||||
|
||||
#if (defined FORCE_ACCURATE) || (defined ACCURATE_ROUNDING)
|
||||
/* Define the accurate rounding function. */
|
||||
# if (defined REAL_IS_FLOAT) && (defined IEEE_FLOAT)
|
||||
/* This function is only available for IEEE754 single-precision values
|
||||
This is nearly identical to proper rounding, just -+0.5 is rounded to 0 */
|
||||
static inline int16_t ftoi16(float x)
|
||||
{
|
||||
union
|
||||
{
|
||||
float f;
|
||||
int32_t i;
|
||||
} u_fi;
|
||||
u_fi.f = x + 12582912.0f; /* Magic Number: 2^23 + 2^22 */
|
||||
return (int16_t)u_fi.i;
|
||||
}
|
||||
# define REAL_TO_SHORT_ACCURATE(x) ftoi16(x)
|
||||
# else
|
||||
/* The "proper" rounding, plain C, a bit slow. */
|
||||
# define REAL_TO_SHORT_ACCURATE(x) (short)((x)>0.0?(x)+0.5:(x)-0.5)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Now define the normal rounding. */
|
||||
# ifdef ACCURATE_ROUNDING
|
||||
# define REAL_TO_SHORT(x) REAL_TO_SHORT_ACCURATE(x)
|
||||
# else
|
||||
/* Non-accurate rounding... simple truncation. Fastest, most LSB errors. */
|
||||
# define REAL_TO_SHORT(x) (short)(x)
|
||||
# endif
|
||||
|
||||
#endif /* REAL_TO_SHORT */
|
||||
|
||||
/* We should add dithering for S32, too? */
|
||||
#ifndef REAL_TO_S32
|
||||
# ifdef ACCURATE_ROUNDING
|
||||
# define REAL_TO_S32(x) (int32_t)((x)>0.0?(x)+0.5:(x)-0.5)
|
||||
# else
|
||||
# define REAL_TO_S32(x) (int32_t)(x)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef REAL_PLUS_32767
|
||||
# define REAL_PLUS_32767 32767.0
|
||||
#endif
|
||||
#ifndef REAL_MINUS_32768
|
||||
# define REAL_MINUS_32768 -32768.0
|
||||
#endif
|
||||
#ifndef REAL_PLUS_S32
|
||||
# define REAL_PLUS_S32 2147483647.0
|
||||
#endif
|
||||
#ifndef REAL_MINUS_S32
|
||||
# define REAL_MINUS_S32 -2147483648.0
|
||||
#endif
|
||||
|
||||
|
||||
/* The actual storage of a decoded sample is separated in the following macros.
|
||||
We can handle different types, we could also handle dithering here. */
|
||||
|
||||
#ifdef NEWOLD_WRITE_SAMPLE
|
||||
|
||||
/* This is the old new mpg123 WRITE_SAMPLE, fixed for newer GCC by MPlayer folks.
|
||||
Makes a huge difference on old machines. */
|
||||
#if WORDS_BIGENDIAN
|
||||
#define MANTISSA_OFFSET 1
|
||||
#else
|
||||
#define MANTISSA_OFFSET 0
|
||||
#endif
|
||||
#define WRITE_SHORT_SAMPLE(samples,sum,clip) { \
|
||||
union { double dtemp; int itemp[2]; } u; int v; \
|
||||
u.dtemp = ((((65536.0 * 65536.0 * 16)+(65536.0 * 0.5))* 65536.0)) + (sum);\
|
||||
v = u.itemp[MANTISSA_OFFSET] - 0x80000000; \
|
||||
if( v > 32767) { *(samples) = 0x7fff; (clip)++; } \
|
||||
else if( v < -32768) { *(samples) = -0x8000; (clip)++; } \
|
||||
else { *(samples) = v; } \
|
||||
}
|
||||
|
||||
#else
|
||||
/* Macro to produce a short (signed 16bit) output sample from internal representation,
|
||||
which may be float, double or indeed some integer for fixed point handling. */
|
||||
#define WRITE_SHORT_SAMPLE(samples,sum,clip) \
|
||||
if( (sum) > REAL_PLUS_32767) { *(samples) = 0x7fff; (clip)++; } \
|
||||
else if( (sum) < REAL_MINUS_32768) { *(samples) = -0x8000; (clip)++; } \
|
||||
else { *(samples) = REAL_TO_SHORT(sum); }
|
||||
#endif
|
||||
|
||||
/* Same as above, but always using accurate rounding. Would we want softer clipping here, too? */
|
||||
#define WRITE_SHORT_SAMPLE_ACCURATE(samples,sum,clip) \
|
||||
if( (sum) > REAL_PLUS_32767) { *(samples) = 0x7fff; (clip)++; } \
|
||||
else if( (sum) < REAL_MINUS_32768) { *(samples) = -0x8000; (clip)++; } \
|
||||
else { *(samples) = REAL_TO_SHORT_ACCURATE(sum); }
|
||||
|
||||
/*
|
||||
32bit signed
|
||||
We do clipping with the same old borders... but different conversion.
|
||||
We see here that we need extra work for non-16bit output... we optimized for 16bit.
|
||||
-0x7fffffff-1 is the minimum 32 bit signed integer value expressed so that MSVC
|
||||
does not give a compile time warning.
|
||||
*/
|
||||
#define WRITE_S32_SAMPLE(samples,sum,clip) \
|
||||
{ \
|
||||
real tmpsum = REAL_MUL((sum),S32_RESCALE); \
|
||||
if( tmpsum > REAL_PLUS_S32 ){ *(samples) = 0x7fffffff; (clip)++; } \
|
||||
else if( tmpsum < REAL_MINUS_S32 ) { *(samples) = -0x7fffffff-1; (clip)++; } \
|
||||
else { *(samples) = REAL_TO_S32(tmpsum); } \
|
||||
}
|
||||
|
||||
/* Produce an 8bit sample, via 16bit intermediate. */
|
||||
#define WRITE_8BIT_SAMPLE(samples,sum,clip) \
|
||||
{ \
|
||||
int16_t write_8bit_tmp; \
|
||||
if( (sum) > REAL_PLUS_32767) { write_8bit_tmp = 0x7fff; (clip)++; } \
|
||||
else if( (sum) < REAL_MINUS_32768) { write_8bit_tmp = -0x8000; (clip)++; } \
|
||||
else { write_8bit_tmp = REAL_TO_SHORT(sum); } \
|
||||
*(samples) = fr->conv16to8[write_8bit_tmp>>AUSHIFT]; \
|
||||
}
|
||||
#ifndef REAL_IS_FIXED
|
||||
#define WRITE_REAL_SAMPLE(samples,sum,clip) *(samples) = ((real)1./SHORT_SCALE)*(sum)
|
||||
#endif
|
||||
|
||||
/* Finished 32 bit sample to unsigned 32 bit sample. */
|
||||
#define CONV_SU32(s) \
|
||||
( (s >= 0) \
|
||||
? ((uint32_t)s + (uint32_t)2147483648UL) \
|
||||
: (s == -2147483647L-1L /* Work around to prevent a non-conformant MSVC warning/error */ \
|
||||
? 0 /* Separate because negation would overflow. */ \
|
||||
: (uint32_t)2147483648UL - (uint32_t)(-s) ) \
|
||||
)
|
||||
|
||||
/* Finished 16 bit sample to unsigned 16 bit sample. */
|
||||
#define CONV_SU16(s) (uint16_t)((int32_t)(s)+32768)
|
||||
|
||||
/* Same style for syn123 generic conversion. */
|
||||
#define CONV_SU8(s) (uint8_t)((int16_t)s+128)
|
||||
|
||||
/* Unsigned 32 bit sample to signed 32 bit sample. */
|
||||
#define CONV_US32(u) \
|
||||
( (u >= 2147483648UL) \
|
||||
? (int32_t)((uint32_t)u - (uint32_t)2147483648UL) \
|
||||
: ((u == 0) \
|
||||
? (int32_t)(-2147483647L-1L) \
|
||||
: -(int32_t)((uint32_t)2147483648UL - u) ) \
|
||||
)
|
||||
|
||||
/* Unsigned 16 bit sample to signed 16 bit sample. */
|
||||
#define CONV_US16(s) (int16_t)((int32_t)s-32768)
|
||||
|
||||
/* Same style for syn123 generic conversion. */
|
||||
#define CONV_US8(s) (int8_t)((int16_t)s-128)
|
||||
|
||||
/* 24 bit conversion: drop or add a least significant byte. */
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
/* Highest byte first. Drop last. */
|
||||
#define DROP4BYTE(w,r) {(w)[0]=(r)[0]; (w)[1]=(r)[1]; (w)[2]=(r)[2];}
|
||||
#define ADD4BYTE(w,r) {(w)[0]=(r)[0]; (w)[1]=(r)[1]; (w)[2]=(r)[2]; (w)[3]=0;}
|
||||
#else
|
||||
/* Lowest byte first, drop that. */
|
||||
#define DROP4BYTE(w,r) {(w)[0]=(r)[1]; (w)[1]=(r)[2]; (w)[2]=(r)[3];}
|
||||
#define ADD4BYTE(w,r) {(w)[0]=0; (w)[1]=(r)[0]; (w)[2]=(r)[1]; (w)[3]=(r)[2];}
|
||||
#endif
|
||||
|
||||
#endif
|
103
ThirdParty/mpg123/include/mpg123/swap_bytes_impl.h
vendored
103
ThirdParty/mpg123/include/mpg123/swap_bytes_impl.h
vendored
|
@ -1,103 +0,0 @@
|
|||
/*
|
||||
swap_bytes: Swap byte order of samples in a buffer.
|
||||
|
||||
copyright 2018 by the mpg123 project
|
||||
licensed under the terms of the LGPL 2.1
|
||||
see COPYING and AUTHORS files in distribution or http://mpg123.org
|
||||
|
||||
initially written by Thomas Orgis
|
||||
|
||||
This is C source to include in your code to get the function named
|
||||
swap_bytes. It is serves intentional duplication in libmpg123 and
|
||||
libsyn123 to avoid introducing a dependency between them. This function
|
||||
is too small for that.
|
||||
*/
|
||||
|
||||
/* Other headers are already included! */
|
||||
|
||||
/* Optionally use platform-specific byteswap macros. */
|
||||
#ifdef HAVE_BYTESWAP_H
|
||||
#include <byteswap.h>
|
||||
#endif
|
||||
|
||||
/* Plain stupid swapping of elements in a byte array. */
|
||||
/* This is the fallback when there is no native bswap macro. */
|
||||
#define SWAP(a,b) tmp = p[a]; p[a] = p[b]; p[b] = tmp;
|
||||
|
||||
/* Convert samplecount elements of samplesize bytes each in buffer buf. */
|
||||
static void swap_bytes(void *buf, size_t samplesize, size_t samplecount)
|
||||
{
|
||||
unsigned char *p = buf;
|
||||
unsigned char *pend = (unsigned char*)buf+samplesize*samplecount;
|
||||
unsigned char tmp;
|
||||
|
||||
if(samplesize < 2)
|
||||
return;
|
||||
switch(samplesize)
|
||||
{
|
||||
case 2: /* AB -> BA */
|
||||
#ifdef HAVE_BYTESWAP_H
|
||||
{
|
||||
uint16_t* pp = (uint16_t*)p;
|
||||
for(; pp<(uint16_t*)pend; ++pp)
|
||||
*pp = bswap_16(*pp);
|
||||
}
|
||||
#else
|
||||
for(; p<pend; p+=2)
|
||||
{
|
||||
SWAP(0,1)
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
case 3: /* ABC -> CBA */
|
||||
for(; p<pend; p+=3)
|
||||
{
|
||||
SWAP(0,2)
|
||||
}
|
||||
break;
|
||||
case 4: /* ABCD -> DCBA */
|
||||
#ifdef HAVE_BYTESWAP_H
|
||||
{
|
||||
uint32_t* pp = (uint32_t*)p;
|
||||
for(; pp<(uint32_t*)pend; ++pp)
|
||||
*pp = bswap_32(*pp);
|
||||
}
|
||||
#else
|
||||
for(; p<pend; p+=4)
|
||||
{
|
||||
SWAP(0,3)
|
||||
SWAP(1,2)
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
case 8: /* ABCDEFGH -> HGFEDCBA */
|
||||
#ifdef HAVE_BYTESWAP_H
|
||||
{
|
||||
uint64_t* pp = (uint64_t*)p;
|
||||
for(; pp<(uint64_t*)pend; ++pp)
|
||||
*pp = bswap_64(*pp);
|
||||
}
|
||||
#else
|
||||
for(; p<pend; p+=8)
|
||||
{
|
||||
SWAP(0,7)
|
||||
SWAP(1,6)
|
||||
SWAP(2,5)
|
||||
SWAP(3,4)
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
/* All the weird choices with the full nested loop. */
|
||||
default:
|
||||
for(; p<pend; p+=samplesize)
|
||||
{
|
||||
size_t j;
|
||||
for(j=0; j<samplesize/2; ++j)
|
||||
{
|
||||
SWAP(j, samplesize-j-1)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#undef SWAP
|
1211
ThirdParty/mpg123/include/mpg123/syn123.h
vendored
Normal file
1211
ThirdParty/mpg123/include/mpg123/syn123.h
vendored
Normal file
File diff suppressed because it is too large
Load diff
196
ThirdParty/mpg123/include/mpg123/synth.h
vendored
196
ThirdParty/mpg123/include/mpg123/synth.h
vendored
|
@ -1,196 +0,0 @@
|
|||
/*
|
||||
synth.h: generic synth functions
|
||||
|
||||
copyright 1995-2008 by the mpg123 project - free software under the terms of the LGPL 2.1
|
||||
see COPYING and AUTHORS files in distribution or http://mpg123.org
|
||||
initially written by Michael Hipp, generalized by Thomas Orgis
|
||||
|
||||
This header is used multiple times to create different variants of these functions.
|
||||
See decode.c and friends.
|
||||
Hint: BLOCK, MONO_NAME, MONO2STEREO_NAME, SYNTH_NAME and SAMPLE_T as well as WRITE_SAMPLE do vary.
|
||||
|
||||
Thomas looked closely at the decode_1to1, decode_2to1 and decode_4to1 contents, seeing that they are too similar to be separate files.
|
||||
This is what resulted...
|
||||
|
||||
Basically, you need one set of these functions for each output sample type.
|
||||
That currently means signed short, 8bit or float/double; though unsigned short may come, too.
|
||||
|
||||
Define NO_AUTOINCREMENT i386 code that shall not rely on autoincrement.
|
||||
Actual benefit of this has to be examined; may apply to specific (old) compilers, only.
|
||||
*/
|
||||
|
||||
|
||||
/* Main synth function, uses the plain dct64 or dct64_i386. */
|
||||
int SYNTH_NAME(real *bandPtr, int channel, mpg123_handle *fr, int final)
|
||||
{
|
||||
#ifndef NO_AUTOINCREMENT
|
||||
#define BACKPEDAL 0x10 /* We use autoincrement and thus need this re-adjustment for window/b0. */
|
||||
#define MY_DCT64 dct64
|
||||
#else
|
||||
#define BACKPEDAL 0x00 /* i386 code does not need that. */
|
||||
#define MY_DCT64 dct64_i386
|
||||
#endif
|
||||
static const int step = 2;
|
||||
SAMPLE_T *samples = (SAMPLE_T *) (fr->buffer.data + fr->buffer.fill);
|
||||
|
||||
real *b0, **buf; /* (*buf)[0x110]; */
|
||||
int clip = 0;
|
||||
int bo1;
|
||||
#ifndef NO_EQUALIZER
|
||||
if(fr->have_eq_settings) do_equalizer(bandPtr,channel,fr->equalizer);
|
||||
#endif
|
||||
if(!channel)
|
||||
{
|
||||
fr->bo--;
|
||||
fr->bo &= 0xf;
|
||||
buf = fr->real_buffs[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef USE_DITHER
|
||||
/* We always go forward 32 dither points (and back again for the second channel),
|
||||
(re)sampling the noise the same way as the original signal. */
|
||||
fr->ditherindex -= 32;
|
||||
#endif
|
||||
samples++;
|
||||
buf = fr->real_buffs[1];
|
||||
}
|
||||
#ifdef USE_DITHER
|
||||
/* We check only once for the overflow of dither index here ...
|
||||
this wraps differently than the original i586 dither code, in theory (but when DITHERSIZE % BLOCK/2 == 0 it's the same). */
|
||||
if(DITHERSIZE-fr->ditherindex < 32) fr->ditherindex = 0;
|
||||
/* And we define a macro for the dither action... */
|
||||
#define ADD_DITHER(fr,sum) sum+=fr->dithernoise[fr->ditherindex]; fr->ditherindex += 64/BLOCK;
|
||||
#else
|
||||
#define ADD_DITHER(fr,sum)
|
||||
#endif
|
||||
|
||||
if(fr->bo & 0x1)
|
||||
{
|
||||
b0 = buf[0];
|
||||
bo1 = fr->bo;
|
||||
MY_DCT64(buf[1]+((fr->bo+1)&0xf),buf[0]+fr->bo,bandPtr);
|
||||
}
|
||||
else
|
||||
{
|
||||
b0 = buf[1];
|
||||
bo1 = fr->bo+1;
|
||||
MY_DCT64(buf[0]+fr->bo,buf[1]+fr->bo+1,bandPtr);
|
||||
}
|
||||
|
||||
{
|
||||
register int j;
|
||||
real *window = fr->decwin + 16 - bo1;
|
||||
|
||||
for(j=(BLOCK/4); j; j--, b0+=0x400/BLOCK-BACKPEDAL, window+=0x800/BLOCK-BACKPEDAL, samples+=step)
|
||||
{
|
||||
real sum;
|
||||
#ifndef NO_AUTOINCREMENT
|
||||
sum = REAL_MUL_SYNTH(*window++, *b0++);
|
||||
sum -= REAL_MUL_SYNTH(*window++, *b0++);
|
||||
sum += REAL_MUL_SYNTH(*window++, *b0++);
|
||||
sum -= REAL_MUL_SYNTH(*window++, *b0++);
|
||||
sum += REAL_MUL_SYNTH(*window++, *b0++);
|
||||
sum -= REAL_MUL_SYNTH(*window++, *b0++);
|
||||
sum += REAL_MUL_SYNTH(*window++, *b0++);
|
||||
sum -= REAL_MUL_SYNTH(*window++, *b0++);
|
||||
sum += REAL_MUL_SYNTH(*window++, *b0++);
|
||||
sum -= REAL_MUL_SYNTH(*window++, *b0++);
|
||||
sum += REAL_MUL_SYNTH(*window++, *b0++);
|
||||
sum -= REAL_MUL_SYNTH(*window++, *b0++);
|
||||
sum += REAL_MUL_SYNTH(*window++, *b0++);
|
||||
sum -= REAL_MUL_SYNTH(*window++, *b0++);
|
||||
sum += REAL_MUL_SYNTH(*window++, *b0++);
|
||||
sum -= REAL_MUL_SYNTH(*window++, *b0++);
|
||||
#else
|
||||
sum = REAL_MUL_SYNTH(window[0x0], b0[0x0]);
|
||||
sum -= REAL_MUL_SYNTH(window[0x1], b0[0x1]);
|
||||
sum += REAL_MUL_SYNTH(window[0x2], b0[0x2]);
|
||||
sum -= REAL_MUL_SYNTH(window[0x3], b0[0x3]);
|
||||
sum += REAL_MUL_SYNTH(window[0x4], b0[0x4]);
|
||||
sum -= REAL_MUL_SYNTH(window[0x5], b0[0x5]);
|
||||
sum += REAL_MUL_SYNTH(window[0x6], b0[0x6]);
|
||||
sum -= REAL_MUL_SYNTH(window[0x7], b0[0x7]);
|
||||
sum += REAL_MUL_SYNTH(window[0x8], b0[0x8]);
|
||||
sum -= REAL_MUL_SYNTH(window[0x9], b0[0x9]);
|
||||
sum += REAL_MUL_SYNTH(window[0xA], b0[0xA]);
|
||||
sum -= REAL_MUL_SYNTH(window[0xB], b0[0xB]);
|
||||
sum += REAL_MUL_SYNTH(window[0xC], b0[0xC]);
|
||||
sum -= REAL_MUL_SYNTH(window[0xD], b0[0xD]);
|
||||
sum += REAL_MUL_SYNTH(window[0xE], b0[0xE]);
|
||||
sum -= REAL_MUL_SYNTH(window[0xF], b0[0xF]);
|
||||
#endif
|
||||
|
||||
ADD_DITHER(fr,sum)
|
||||
WRITE_SAMPLE(samples,sum,clip);
|
||||
}
|
||||
|
||||
{
|
||||
real sum;
|
||||
sum = REAL_MUL_SYNTH(window[0x0], b0[0x0]);
|
||||
sum += REAL_MUL_SYNTH(window[0x2], b0[0x2]);
|
||||
sum += REAL_MUL_SYNTH(window[0x4], b0[0x4]);
|
||||
sum += REAL_MUL_SYNTH(window[0x6], b0[0x6]);
|
||||
sum += REAL_MUL_SYNTH(window[0x8], b0[0x8]);
|
||||
sum += REAL_MUL_SYNTH(window[0xA], b0[0xA]);
|
||||
sum += REAL_MUL_SYNTH(window[0xC], b0[0xC]);
|
||||
sum += REAL_MUL_SYNTH(window[0xE], b0[0xE]);
|
||||
|
||||
ADD_DITHER(fr,sum)
|
||||
WRITE_SAMPLE(samples,sum,clip);
|
||||
samples += step;
|
||||
b0-=0x400/BLOCK;
|
||||
window-=0x800/BLOCK;
|
||||
}
|
||||
window += bo1<<1;
|
||||
|
||||
for(j=(BLOCK/4)-1; j; j--, b0-=0x400/BLOCK+BACKPEDAL, window-=0x800/BLOCK-BACKPEDAL, samples+=step)
|
||||
{
|
||||
real sum;
|
||||
#ifndef NO_AUTOINCREMENT
|
||||
sum = -REAL_MUL_SYNTH(*(--window), *b0++);
|
||||
sum -= REAL_MUL_SYNTH(*(--window), *b0++);
|
||||
sum -= REAL_MUL_SYNTH(*(--window), *b0++);
|
||||
sum -= REAL_MUL_SYNTH(*(--window), *b0++);
|
||||
sum -= REAL_MUL_SYNTH(*(--window), *b0++);
|
||||
sum -= REAL_MUL_SYNTH(*(--window), *b0++);
|
||||
sum -= REAL_MUL_SYNTH(*(--window), *b0++);
|
||||
sum -= REAL_MUL_SYNTH(*(--window), *b0++);
|
||||
sum -= REAL_MUL_SYNTH(*(--window), *b0++);
|
||||
sum -= REAL_MUL_SYNTH(*(--window), *b0++);
|
||||
sum -= REAL_MUL_SYNTH(*(--window), *b0++);
|
||||
sum -= REAL_MUL_SYNTH(*(--window), *b0++);
|
||||
sum -= REAL_MUL_SYNTH(*(--window), *b0++);
|
||||
sum -= REAL_MUL_SYNTH(*(--window), *b0++);
|
||||
sum -= REAL_MUL_SYNTH(*(--window), *b0++);
|
||||
sum -= REAL_MUL_SYNTH(*(--window), *b0++);
|
||||
#else
|
||||
sum = -REAL_MUL_SYNTH(window[-0x1], b0[0x0]);
|
||||
sum -= REAL_MUL_SYNTH(window[-0x2], b0[0x1]);
|
||||
sum -= REAL_MUL_SYNTH(window[-0x3], b0[0x2]);
|
||||
sum -= REAL_MUL_SYNTH(window[-0x4], b0[0x3]);
|
||||
sum -= REAL_MUL_SYNTH(window[-0x5], b0[0x4]);
|
||||
sum -= REAL_MUL_SYNTH(window[-0x6], b0[0x5]);
|
||||
sum -= REAL_MUL_SYNTH(window[-0x7], b0[0x6]);
|
||||
sum -= REAL_MUL_SYNTH(window[-0x8], b0[0x7]);
|
||||
sum -= REAL_MUL_SYNTH(window[-0x9], b0[0x8]);
|
||||
sum -= REAL_MUL_SYNTH(window[-0xA], b0[0x9]);
|
||||
sum -= REAL_MUL_SYNTH(window[-0xB], b0[0xA]);
|
||||
sum -= REAL_MUL_SYNTH(window[-0xC], b0[0xB]);
|
||||
sum -= REAL_MUL_SYNTH(window[-0xD], b0[0xC]);
|
||||
sum -= REAL_MUL_SYNTH(window[-0xE], b0[0xD]);
|
||||
sum -= REAL_MUL_SYNTH(window[-0xF], b0[0xE]);
|
||||
sum -= REAL_MUL_SYNTH(window[-0x0], b0[0xF]); /* Is that right? 0x0? Just wondering... */
|
||||
#endif
|
||||
ADD_DITHER(fr,sum)
|
||||
WRITE_SAMPLE(samples,sum,clip);
|
||||
}
|
||||
}
|
||||
|
||||
if(final) fr->buffer.fill += BLOCK*sizeof(SAMPLE_T);
|
||||
|
||||
return clip;
|
||||
#undef ADD_DITHER
|
||||
#undef BACKPEDAL
|
||||
#undef MY_DCT64
|
||||
}
|
86
ThirdParty/mpg123/include/mpg123/synth_8bit.h
vendored
86
ThirdParty/mpg123/include/mpg123/synth_8bit.h
vendored
|
@ -1,86 +0,0 @@
|
|||
/*
|
||||
synth_8bit.h: Wrappers over optimized synth_xtoy for converting signed short to 8bit.
|
||||
|
||||
copyright 1995-2008 by the mpg123 project - free software under the terms of the LGPL 2.1
|
||||
see COPYING and AUTHORS files in distribution or http://mpg123.org
|
||||
initially written by Michael Hipp, code generalized to the wrapper by Thomas Orgis
|
||||
|
||||
Only variable is the BLOCK size to choose 1to1, 2to1 or 4to1.
|
||||
Oh, and the names: BASE_SYNTH_NAME, SYNTH_NAME, MONO_NAME, MONO2STEREO_NAME
|
||||
(p.ex. opt_synth_1to1(fr), synth_1to1_8bit, synth_1to1_8bit_mono, ...).
|
||||
*/
|
||||
|
||||
int SYNTH_NAME(real *bandPtr, int channel, mpg123_handle *fr, int final)
|
||||
{
|
||||
short samples_tmp[BLOCK];
|
||||
short *tmp1 = samples_tmp + channel;
|
||||
int i,ret;
|
||||
|
||||
unsigned char *samples = fr->buffer.data;
|
||||
int pnt = fr->buffer.fill;
|
||||
fr->buffer.data = (unsigned char*) samples_tmp;
|
||||
fr->buffer.fill = 0;
|
||||
ret = BASE_SYNTH_NAME(bandPtr, channel, fr , 0);
|
||||
fr->buffer.data = samples;
|
||||
|
||||
samples += channel + pnt;
|
||||
for(i=0;i<(BLOCK/2);i++)
|
||||
{
|
||||
*samples = fr->conv16to8[*tmp1>>AUSHIFT];
|
||||
samples += 2;
|
||||
tmp1 += 2;
|
||||
}
|
||||
fr->buffer.fill = pnt + (final ? BLOCK : 0 );
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int MONO_NAME(real *bandPtr, mpg123_handle *fr)
|
||||
{
|
||||
short samples_tmp[BLOCK];
|
||||
short *tmp1 = samples_tmp;
|
||||
int i,ret;
|
||||
|
||||
unsigned char *samples = fr->buffer.data;
|
||||
int pnt = fr->buffer.fill;
|
||||
fr->buffer.data = (unsigned char*) samples_tmp;
|
||||
fr->buffer.fill = 0;
|
||||
ret = BASE_SYNTH_NAME(bandPtr, 0, fr, 0);
|
||||
fr->buffer.data = samples;
|
||||
|
||||
samples += pnt;
|
||||
for(i=0;i<(BLOCK/2);i++)
|
||||
{
|
||||
*samples++ = fr->conv16to8[*tmp1>>AUSHIFT];
|
||||
tmp1+=2;
|
||||
}
|
||||
fr->buffer.fill = pnt + BLOCK/2;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int MONO2STEREO_NAME(real *bandPtr, mpg123_handle *fr)
|
||||
{
|
||||
short samples_tmp[BLOCK];
|
||||
short *tmp1 = samples_tmp;
|
||||
int i,ret;
|
||||
|
||||
unsigned char *samples = fr->buffer.data;
|
||||
int pnt = fr->buffer.fill;
|
||||
fr->buffer.data = (unsigned char*) samples_tmp;
|
||||
fr->buffer.fill = 0;
|
||||
ret = BASE_SYNTH_NAME(bandPtr, 0, fr, 0);
|
||||
fr->buffer.data = samples;
|
||||
|
||||
samples += pnt;
|
||||
for(i=0;i<(BLOCK/2);i++)
|
||||
{
|
||||
*samples++ = fr->conv16to8[*tmp1>>AUSHIFT];
|
||||
*samples++ = fr->conv16to8[*tmp1>>AUSHIFT];
|
||||
tmp1 += 2;
|
||||
}
|
||||
fr->buffer.fill = pnt + BLOCK;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
64
ThirdParty/mpg123/include/mpg123/synth_mono.h
vendored
64
ThirdParty/mpg123/include/mpg123/synth_mono.h
vendored
|
@ -1,64 +0,0 @@
|
|||
/*
|
||||
monosynth.h: generic mono related synth functions
|
||||
|
||||
copyright 1995-2008 by the mpg123 project - free software under the terms of the LGPL 2.1
|
||||
see COPYING and AUTHORS files in distribution or http://mpg123.org
|
||||
initially written by Michael Hipp, generalized by Thomas Orgis
|
||||
|
||||
This header is used multiple times to create different variants of these functions.
|
||||
See decode.c and synth.h .
|
||||
Hint: BLOCK, MONO_NAME, MONO2STEREO_NAME, SYNTH_NAME and SAMPLE_T do vary.
|
||||
|
||||
Thomas looked closely at the decode_1to1, decode_2to1 and decode_4to1 contents, seeing that they are too similar to be separate files.
|
||||
This is what resulted...
|
||||
|
||||
Reason to separate this from synth.h:
|
||||
There are decoders that have a special synth_1to1 but still can use these generic derivations for the mono stuff.
|
||||
It generally makes a good deal of sense to set SYNTH_NAME to opt_synth_1to1(fr) (or opt_synth_2to1(fr), etc.).
|
||||
*/
|
||||
|
||||
/* Mono synth, wrapping over SYNTH_NAME */
|
||||
int MONO_NAME(real *bandPtr, mpg123_handle *fr)
|
||||
{
|
||||
SAMPLE_T samples_tmp[BLOCK];
|
||||
SAMPLE_T *tmp1 = samples_tmp;
|
||||
int i,ret;
|
||||
|
||||
/* save buffer stuff, trick samples_tmp into there, decode, restore */
|
||||
unsigned char *samples = fr->buffer.data;
|
||||
int pnt = fr->buffer.fill;
|
||||
fr->buffer.data = (unsigned char*) samples_tmp;
|
||||
fr->buffer.fill = 0;
|
||||
ret = SYNTH_NAME(bandPtr, 0, fr, 0); /* decode into samples_tmp */
|
||||
fr->buffer.data = samples; /* restore original value */
|
||||
|
||||
/* now append samples from samples_tmp */
|
||||
samples += pnt; /* just the next mem in frame buffer */
|
||||
for(i=0;i<(BLOCK/2);i++)
|
||||
{
|
||||
*( (SAMPLE_T *)samples) = *tmp1;
|
||||
samples += sizeof(SAMPLE_T);
|
||||
tmp1 += 2;
|
||||
}
|
||||
fr->buffer.fill = pnt + (BLOCK/2)*sizeof(SAMPLE_T);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Mono to stereo synth, wrapping over SYNTH_NAME */
|
||||
int MONO2STEREO_NAME(real *bandPtr, mpg123_handle *fr)
|
||||
{
|
||||
int i,ret;
|
||||
unsigned char *samples = fr->buffer.data;
|
||||
|
||||
ret = SYNTH_NAME(bandPtr,0,fr,1);
|
||||
samples += fr->buffer.fill - BLOCK*sizeof(SAMPLE_T);
|
||||
|
||||
for(i=0;i<(BLOCK/2);i++)
|
||||
{
|
||||
((SAMPLE_T *)samples)[1] = ((SAMPLE_T *)samples)[0];
|
||||
samples+=2*sizeof(SAMPLE_T);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
213
ThirdParty/mpg123/include/mpg123/synth_ntom.h
vendored
213
ThirdParty/mpg123/include/mpg123/synth_ntom.h
vendored
|
@ -1,213 +0,0 @@
|
|||
/*
|
||||
synth_ntom.h: ntom-resampling synth functions
|
||||
|
||||
This header is used multiple times to create different variants of this function.
|
||||
Hint: MONO_NAME, MONO2STEREO_NAME, SYNTH_NAME and SAMPLE_T as well as WRITE_SAMPLE do vary.
|
||||
|
||||
copyright 1995-2008 by the mpg123 project - free software under the terms of the LGPL 2.1
|
||||
see COPYING and AUTHORS files in distribution or http://mpg123.org
|
||||
initially written by Michael Hipp, generalized by Thomas Orgis
|
||||
|
||||
Well, this is very simple resampling... you may or may not like what you hear.
|
||||
But it's cheap.
|
||||
But still, we don't implement a non-autoincrement version of this one.
|
||||
*/
|
||||
|
||||
/* Note: These mono functions would also work generically,
|
||||
it's just that they need a runtime calculation for the conversion loop...
|
||||
The fixed XtoY functions have the chance for loop unrolling... */
|
||||
|
||||
int MONO_NAME(real *bandPtr, mpg123_handle *fr)
|
||||
{
|
||||
SAMPLE_T samples_tmp[8*64];
|
||||
SAMPLE_T *tmp1 = samples_tmp;
|
||||
size_t i;
|
||||
int ret;
|
||||
|
||||
size_t pnt = fr->buffer.fill;
|
||||
unsigned char *samples = fr->buffer.data;
|
||||
fr->buffer.data = (unsigned char*) samples_tmp;
|
||||
fr->buffer.fill = 0;
|
||||
ret = SYNTH_NAME(bandPtr, 0, fr, 1);
|
||||
fr->buffer.data = samples;
|
||||
|
||||
samples += pnt;
|
||||
for(i=0;i<(fr->buffer.fill/(2*sizeof(SAMPLE_T)));i++)
|
||||
{
|
||||
*( (SAMPLE_T *)samples) = *tmp1;
|
||||
samples += sizeof(SAMPLE_T);
|
||||
tmp1 += 2;
|
||||
}
|
||||
fr->buffer.fill = pnt + (fr->buffer.fill/2);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int MONO2STEREO_NAME(real *bandPtr, mpg123_handle *fr)
|
||||
{
|
||||
size_t i;
|
||||
int ret;
|
||||
size_t pnt1 = fr->buffer.fill;
|
||||
unsigned char *samples = fr->buffer.data + pnt1;
|
||||
|
||||
ret = SYNTH_NAME(bandPtr, 0, fr, 1);
|
||||
|
||||
for(i=0;i<((fr->buffer.fill-pnt1)/(2*sizeof(SAMPLE_T)));i++)
|
||||
{
|
||||
((SAMPLE_T *)samples)[1] = ((SAMPLE_T *)samples)[0];
|
||||
samples+=2*sizeof(SAMPLE_T);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int SYNTH_NAME(real *bandPtr,int channel, mpg123_handle *fr, int final)
|
||||
{
|
||||
static const int step = 2;
|
||||
SAMPLE_T *samples = (SAMPLE_T *) (fr->buffer.data + fr->buffer.fill);
|
||||
|
||||
real *b0, **buf; /* (*buf)[0x110]; */
|
||||
int clip = 0;
|
||||
int bo1;
|
||||
int ntom;
|
||||
#ifndef NO_EQUALIZER
|
||||
if(fr->have_eq_settings) do_equalizer(bandPtr,channel,fr->equalizer);
|
||||
#endif
|
||||
if(!channel)
|
||||
{
|
||||
fr->bo--;
|
||||
fr->bo &= 0xf;
|
||||
buf = fr->real_buffs[0];
|
||||
ntom = fr->ntom_val[1] = fr->ntom_val[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
samples++;
|
||||
buf = fr->real_buffs[1];
|
||||
ntom = fr->ntom_val[1];
|
||||
}
|
||||
|
||||
if(fr->bo & 0x1)
|
||||
{
|
||||
b0 = buf[0];
|
||||
bo1 = fr->bo;
|
||||
dct64(buf[1]+((fr->bo+1)&0xf),buf[0]+fr->bo,bandPtr);
|
||||
}
|
||||
else
|
||||
{
|
||||
b0 = buf[1];
|
||||
bo1 = fr->bo+1;
|
||||
dct64(buf[0]+fr->bo,buf[1]+fr->bo+1,bandPtr);
|
||||
}
|
||||
|
||||
{
|
||||
register int j;
|
||||
real *window = fr->decwin + 16 - bo1;
|
||||
|
||||
for (j=16;j;j--,window+=0x10)
|
||||
{
|
||||
real sum;
|
||||
|
||||
ntom += fr->ntom_step;
|
||||
if(ntom < NTOM_MUL)
|
||||
{
|
||||
window += 16;
|
||||
b0 += 16;
|
||||
continue;
|
||||
}
|
||||
|
||||
sum = REAL_MUL_SYNTH(*window++, *b0++);
|
||||
sum -= REAL_MUL_SYNTH(*window++, *b0++);
|
||||
sum += REAL_MUL_SYNTH(*window++, *b0++);
|
||||
sum -= REAL_MUL_SYNTH(*window++, *b0++);
|
||||
sum += REAL_MUL_SYNTH(*window++, *b0++);
|
||||
sum -= REAL_MUL_SYNTH(*window++, *b0++);
|
||||
sum += REAL_MUL_SYNTH(*window++, *b0++);
|
||||
sum -= REAL_MUL_SYNTH(*window++, *b0++);
|
||||
sum += REAL_MUL_SYNTH(*window++, *b0++);
|
||||
sum -= REAL_MUL_SYNTH(*window++, *b0++);
|
||||
sum += REAL_MUL_SYNTH(*window++, *b0++);
|
||||
sum -= REAL_MUL_SYNTH(*window++, *b0++);
|
||||
sum += REAL_MUL_SYNTH(*window++, *b0++);
|
||||
sum -= REAL_MUL_SYNTH(*window++, *b0++);
|
||||
sum += REAL_MUL_SYNTH(*window++, *b0++);
|
||||
sum -= REAL_MUL_SYNTH(*window++, *b0++);
|
||||
|
||||
while(ntom >= NTOM_MUL)
|
||||
{
|
||||
WRITE_SAMPLE(samples,sum,clip);
|
||||
samples += step;
|
||||
ntom -= NTOM_MUL;
|
||||
}
|
||||
}
|
||||
|
||||
ntom += fr->ntom_step;
|
||||
if(ntom >= NTOM_MUL)
|
||||
{
|
||||
real sum;
|
||||
sum = REAL_MUL_SYNTH(window[0x0], b0[0x0]);
|
||||
sum += REAL_MUL_SYNTH(window[0x2], b0[0x2]);
|
||||
sum += REAL_MUL_SYNTH(window[0x4], b0[0x4]);
|
||||
sum += REAL_MUL_SYNTH(window[0x6], b0[0x6]);
|
||||
sum += REAL_MUL_SYNTH(window[0x8], b0[0x8]);
|
||||
sum += REAL_MUL_SYNTH(window[0xA], b0[0xA]);
|
||||
sum += REAL_MUL_SYNTH(window[0xC], b0[0xC]);
|
||||
sum += REAL_MUL_SYNTH(window[0xE], b0[0xE]);
|
||||
|
||||
while(ntom >= NTOM_MUL)
|
||||
{
|
||||
WRITE_SAMPLE(samples,sum,clip);
|
||||
samples += step;
|
||||
ntom -= NTOM_MUL;
|
||||
}
|
||||
}
|
||||
|
||||
b0-=0x10,window-=0x20;
|
||||
window += bo1<<1;
|
||||
|
||||
for (j=15;j;j--,b0-=0x20,window-=0x10)
|
||||
{
|
||||
real sum;
|
||||
|
||||
ntom += fr->ntom_step;
|
||||
if(ntom < NTOM_MUL)
|
||||
{
|
||||
window -= 16;
|
||||
b0 += 16;
|
||||
continue;
|
||||
}
|
||||
|
||||
sum = REAL_MUL_SYNTH(-*(--window), *b0++);
|
||||
sum -= REAL_MUL_SYNTH(*(--window), *b0++);
|
||||
sum -= REAL_MUL_SYNTH(*(--window), *b0++);
|
||||
sum -= REAL_MUL_SYNTH(*(--window), *b0++);
|
||||
sum -= REAL_MUL_SYNTH(*(--window), *b0++);
|
||||
sum -= REAL_MUL_SYNTH(*(--window), *b0++);
|
||||
sum -= REAL_MUL_SYNTH(*(--window), *b0++);
|
||||
sum -= REAL_MUL_SYNTH(*(--window), *b0++);
|
||||
sum -= REAL_MUL_SYNTH(*(--window), *b0++);
|
||||
sum -= REAL_MUL_SYNTH(*(--window), *b0++);
|
||||
sum -= REAL_MUL_SYNTH(*(--window), *b0++);
|
||||
sum -= REAL_MUL_SYNTH(*(--window), *b0++);
|
||||
sum -= REAL_MUL_SYNTH(*(--window), *b0++);
|
||||
sum -= REAL_MUL_SYNTH(*(--window), *b0++);
|
||||
sum -= REAL_MUL_SYNTH(*(--window), *b0++);
|
||||
sum -= REAL_MUL_SYNTH(*(--window), *b0++);
|
||||
|
||||
while(ntom >= NTOM_MUL)
|
||||
{
|
||||
WRITE_SAMPLE(samples,sum,clip);
|
||||
samples += step;
|
||||
ntom -= NTOM_MUL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fr->ntom_val[channel] = ntom;
|
||||
if(final) fr->buffer.fill = ((unsigned char *) samples - fr->buffer.data - (channel ? sizeof(SAMPLE_T) : 0));
|
||||
|
||||
return clip;
|
||||
}
|
||||
|
268
ThirdParty/mpg123/include/mpg123/synth_sse3d.h
vendored
268
ThirdParty/mpg123/include/mpg123/synth_sse3d.h
vendored
|
@ -1,268 +0,0 @@
|
|||
/*
|
||||
decode_sse3d: Synth for SSE and extended 3DNow (yeah, the name is a relic)
|
||||
|
||||
copyright 2006-2007 by Zuxy Meng/the mpg123 project - free software under the terms of the LGPL 2.1
|
||||
see COPYING and AUTHORS files in distribution or http://mpg123.org
|
||||
initially written by the mysterious higway for MMX (apparently)
|
||||
then developed into SSE opt by Zuxy Meng, also building on Romain Dolbeau's AltiVec
|
||||
Both have agreed to distribution under LGPL 2.1 .
|
||||
|
||||
Transformed back into standalone asm, with help of
|
||||
gcc -S -DHAVE_CONFIG_H -I. -march=pentium -O3 -Wall -pedantic -fno-strict-aliasing -DREAL_IS_FLOAT -c -o decode_mmxsse.{S,c}
|
||||
|
||||
The difference between SSE and 3DNowExt is the dct64 function and the synth function name.
|
||||
This template here uses the SYNTH_NAME and MPL_DCT64 macros for this - see decode_sse.S and decode_3dnowext.S...
|
||||
That's not memory efficient since there's doubled code, but it's easier than giving another function pointer.
|
||||
Maybe I'll change it in future, but now I need something that works.
|
||||
|
||||
Original comment from MPlayer source follows. Regarding the license history see
|
||||
synth_mmx.S, which the original comment about this being licensed under GPL is
|
||||
relating to.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This code was taken from http://www.mpg123.org
|
||||
* See ChangeLog of mpg123-0.59s-pre.1 for detail
|
||||
* Applied to mplayer by Nick Kurshev <nickols_k@mail.ru>
|
||||
*
|
||||
* Local ChangeLog:
|
||||
* - Partial loops unrolling and removing MOVW insn from loops
|
||||
*/
|
||||
|
||||
#include "mangle.h"
|
||||
|
||||
.data
|
||||
ALIGN8
|
||||
one_null:
|
||||
.long -65536
|
||||
.long -65536
|
||||
ALIGN8
|
||||
null_one:
|
||||
.long 65535
|
||||
.long 65535
|
||||
|
||||
.text
|
||||
ALIGN16
|
||||
/* void SYNTH_NAME(real *bandPtr, int channel, short *samples, short *buffs, int *bo, float *decwins) */
|
||||
.globl SYNTH_NAME
|
||||
SYNTH_NAME:
|
||||
pushl %ebp
|
||||
/* stack:0=ebp 4=back 8=bandptr 12=channel 16=samples 20=buffs 24=bo 28=decwins */
|
||||
movl %esp, %ebp
|
||||
|
||||
/* Now the old stack addresses are preserved via %epb. */
|
||||
#ifdef PIC
|
||||
subl $8,%esp /* What has been called temp before. */
|
||||
#else
|
||||
subl $4,%esp /* What has been called temp before. */
|
||||
#endif
|
||||
pushl %edi
|
||||
pushl %esi
|
||||
pushl %ebx
|
||||
|
||||
#ifdef PIC
|
||||
#undef _EBX_
|
||||
#define _EBX_ %eax
|
||||
GET_GOT
|
||||
#define EBXSAVE -4(%ebp)
|
||||
movl _EBX_, EBXSAVE /* save PIC register */
|
||||
#endif
|
||||
|
||||
#define TEMP 12(%esp)
|
||||
/* APP */
|
||||
movl 12(%ebp),%ecx
|
||||
movl 16(%ebp),%edi
|
||||
movl $15,%ebx
|
||||
movl 24(%ebp),%edx
|
||||
leal (%edi,%ecx,2),%edi
|
||||
decl %ecx
|
||||
movl 20(%ebp),%esi
|
||||
movl (%edx),%eax
|
||||
jecxz 1f
|
||||
decl %eax
|
||||
andl %ebx,%eax
|
||||
leal 1088(%esi),%esi
|
||||
movl %eax,(%edx)
|
||||
1:
|
||||
leal (%esi,%eax,2),%edx
|
||||
movl %eax,TEMP
|
||||
incl %eax
|
||||
andl %ebx,%eax
|
||||
leal 544(%esi,%eax,2),%ecx
|
||||
incl %ebx
|
||||
testl $1, %eax
|
||||
jnz 2f
|
||||
xchgl %edx,%ecx
|
||||
incl TEMP
|
||||
leal 544(%esi),%esi
|
||||
2:
|
||||
pushl 8(%ebp)
|
||||
pushl %edx
|
||||
pushl %ecx
|
||||
call MPL_DCT64
|
||||
addl $12, %esp
|
||||
leal 1(%ebx), %ecx
|
||||
subl TEMP,%ebx
|
||||
pushl %ecx
|
||||
/* leal ASM_NAME(decwins)(%ebx,%ebx,1), %edx */
|
||||
movl 28(%ebp),%ecx
|
||||
leal (%ecx,%ebx,2), %edx
|
||||
movl (%esp),%ecx /* restore, but leave value on stack */
|
||||
shrl $1, %ecx
|
||||
#ifdef PIC
|
||||
movl EBXSAVE, _EBX_
|
||||
#endif
|
||||
ALIGN16
|
||||
3:
|
||||
movq (%edx),%mm0
|
||||
movq 64(%edx),%mm4
|
||||
pmaddwd (%esi),%mm0
|
||||
pmaddwd 32(%esi),%mm4
|
||||
movq 8(%edx),%mm1
|
||||
movq 72(%edx),%mm5
|
||||
pmaddwd 8(%esi),%mm1
|
||||
pmaddwd 40(%esi),%mm5
|
||||
movq 16(%edx),%mm2
|
||||
movq 80(%edx),%mm6
|
||||
pmaddwd 16(%esi),%mm2
|
||||
pmaddwd 48(%esi),%mm6
|
||||
movq 24(%edx),%mm3
|
||||
movq 88(%edx),%mm7
|
||||
pmaddwd 24(%esi),%mm3
|
||||
pmaddwd 56(%esi),%mm7
|
||||
paddd %mm1,%mm0
|
||||
paddd %mm5,%mm4
|
||||
paddd %mm2,%mm0
|
||||
paddd %mm6,%mm4
|
||||
paddd %mm3,%mm0
|
||||
paddd %mm7,%mm4
|
||||
movq %mm0,%mm1
|
||||
movq %mm4,%mm5
|
||||
psrlq $32,%mm1
|
||||
psrlq $32,%mm5
|
||||
paddd %mm1,%mm0
|
||||
paddd %mm5,%mm4
|
||||
psrad $13,%mm0
|
||||
psrad $13,%mm4
|
||||
packssdw %mm0,%mm0
|
||||
packssdw %mm4,%mm4
|
||||
movq (%edi), %mm1
|
||||
punpckldq %mm4, %mm0
|
||||
pand LOCAL_VAR(one_null), %mm1
|
||||
pand LOCAL_VAR(null_one), %mm0
|
||||
por %mm0, %mm1
|
||||
movq %mm1,(%edi)
|
||||
leal 64(%esi),%esi
|
||||
leal 128(%edx),%edx
|
||||
leal 8(%edi),%edi
|
||||
decl %ecx
|
||||
jnz 3b
|
||||
popl %ecx
|
||||
andl $1, %ecx
|
||||
jecxz 4f
|
||||
movq (%edx),%mm0
|
||||
pmaddwd (%esi),%mm0
|
||||
movq 8(%edx),%mm1
|
||||
pmaddwd 8(%esi),%mm1
|
||||
movq 16(%edx),%mm2
|
||||
pmaddwd 16(%esi),%mm2
|
||||
movq 24(%edx),%mm3
|
||||
pmaddwd 24(%esi),%mm3
|
||||
paddd %mm1,%mm0
|
||||
paddd %mm2,%mm0
|
||||
paddd %mm3,%mm0
|
||||
movq %mm0,%mm1
|
||||
psrlq $32,%mm1
|
||||
paddd %mm1,%mm0
|
||||
psrad $13,%mm0
|
||||
packssdw %mm0,%mm0
|
||||
movd %mm0,%eax
|
||||
movw %ax, (%edi)
|
||||
leal 32(%esi),%esi
|
||||
leal 64(%edx),%edx
|
||||
leal 4(%edi),%edi
|
||||
4:
|
||||
subl $64,%esi
|
||||
movl $7,%ecx
|
||||
|
||||
#ifdef PIC
|
||||
movl EBXSAVE, _EBX_
|
||||
#endif
|
||||
ALIGN16
|
||||
5:
|
||||
movq (%edx),%mm0
|
||||
movq 64(%edx),%mm4
|
||||
pmaddwd (%esi),%mm0
|
||||
pmaddwd -32(%esi),%mm4
|
||||
movq 8(%edx),%mm1
|
||||
movq 72(%edx),%mm5
|
||||
pmaddwd 8(%esi),%mm1
|
||||
pmaddwd -24(%esi),%mm5
|
||||
movq 16(%edx),%mm2
|
||||
movq 80(%edx),%mm6
|
||||
pmaddwd 16(%esi),%mm2
|
||||
pmaddwd -16(%esi),%mm6
|
||||
movq 24(%edx),%mm3
|
||||
movq 88(%edx),%mm7
|
||||
pmaddwd 24(%esi),%mm3
|
||||
pmaddwd -8(%esi),%mm7
|
||||
paddd %mm1,%mm0
|
||||
paddd %mm5,%mm4
|
||||
paddd %mm2,%mm0
|
||||
paddd %mm6,%mm4
|
||||
paddd %mm3,%mm0
|
||||
paddd %mm7,%mm4
|
||||
movq %mm0,%mm1
|
||||
movq %mm4,%mm5
|
||||
psrlq $32,%mm1
|
||||
psrlq $32,%mm5
|
||||
paddd %mm0,%mm1
|
||||
paddd %mm4,%mm5
|
||||
psrad $13,%mm1
|
||||
psrad $13,%mm5
|
||||
packssdw %mm1,%mm1
|
||||
packssdw %mm5,%mm5
|
||||
psubd %mm0,%mm0
|
||||
psubd %mm4,%mm4
|
||||
psubsw %mm1,%mm0
|
||||
psubsw %mm5,%mm4
|
||||
movq (%edi), %mm1
|
||||
punpckldq %mm4, %mm0
|
||||
pand LOCAL_VAR(one_null), %mm1
|
||||
pand LOCAL_VAR(null_one), %mm0
|
||||
por %mm0, %mm1
|
||||
movq %mm1,(%edi)
|
||||
subl $64,%esi
|
||||
addl $128,%edx
|
||||
leal 8(%edi),%edi
|
||||
decl %ecx
|
||||
jnz 5b
|
||||
movq (%edx),%mm0
|
||||
pmaddwd (%esi),%mm0
|
||||
movq 8(%edx),%mm1
|
||||
pmaddwd 8(%esi),%mm1
|
||||
movq 16(%edx),%mm2
|
||||
pmaddwd 16(%esi),%mm2
|
||||
movq 24(%edx),%mm3
|
||||
pmaddwd 24(%esi),%mm3
|
||||
paddd %mm1,%mm0
|
||||
paddd %mm2,%mm0
|
||||
paddd %mm3,%mm0
|
||||
movq %mm0,%mm1
|
||||
psrlq $32,%mm1
|
||||
paddd %mm0,%mm1
|
||||
psrad $13,%mm1
|
||||
packssdw %mm1,%mm1
|
||||
psubd %mm0,%mm0
|
||||
psubsw %mm1,%mm0
|
||||
movd %mm0,%eax
|
||||
movw %ax,(%edi)
|
||||
emms
|
||||
|
||||
/* NO_APP */
|
||||
popl %ebx
|
||||
popl %esi
|
||||
popl %edi
|
||||
mov %ebp, %esp
|
||||
popl %ebp
|
||||
ret
|
52
ThirdParty/mpg123/include/mpg123/synths.h
vendored
52
ThirdParty/mpg123/include/mpg123/synths.h
vendored
|
@ -1,52 +0,0 @@
|
|||
#ifndef MPG123_SYNTH_H
|
||||
#define MPG123_SYNTH_H
|
||||
|
||||
/* This is included inside frame.h, which is included in mpg123lib_intern.h,
|
||||
at the appropriate place.
|
||||
Explicit header inclusions here would cause circular dependencies. */
|
||||
|
||||
/* The handle needs these types for selecting the decoding routine at runtime.
|
||||
Not just for optimization, mainly for XtoY, mono/stereo. */
|
||||
typedef int (*func_synth)(real *,int, mpg123_handle *,int );
|
||||
typedef int (*func_synth_mono)(real *, mpg123_handle *);
|
||||
typedef int (*func_synth_stereo)(real *, real *, mpg123_handle *);
|
||||
enum synth_channel { c_plain=0, c_stereo, c_m2s, c_mono, c_limit };
|
||||
enum synth_resample
|
||||
{
|
||||
r_none=-1
|
||||
,r_1to1=0
|
||||
# ifndef NO_DOWNSAMPLE
|
||||
,r_2to1
|
||||
,r_4to1
|
||||
# endif
|
||||
# ifndef NO_NTOM
|
||||
,r_ntom
|
||||
# endif
|
||||
,r_limit
|
||||
};
|
||||
enum synth_format
|
||||
{
|
||||
f_none=-1
|
||||
# ifndef NO_16BIT
|
||||
,f_16
|
||||
# endif
|
||||
# ifndef NO_8BIT
|
||||
,f_8
|
||||
# endif
|
||||
# ifndef NO_REAL
|
||||
,f_real
|
||||
# endif
|
||||
# ifndef NO_32BIT
|
||||
,f_32
|
||||
# endif
|
||||
,f_limit
|
||||
};
|
||||
struct synth_s
|
||||
{
|
||||
func_synth plain[r_limit][f_limit];
|
||||
func_synth_stereo stereo[r_limit][f_limit];
|
||||
func_synth_mono mono2stereo[r_limit][f_limit];
|
||||
func_synth_mono mono[r_limit][f_limit];
|
||||
};
|
||||
|
||||
#endif
|
15
ThirdParty/mpg123/include/mpg123/true.h
vendored
15
ThirdParty/mpg123/include/mpg123/true.h
vendored
|
@ -1,15 +0,0 @@
|
|||
/*
|
||||
true: a trivial truth
|
||||
|
||||
copyright ?-2007 by the mpg123 project - free software under the terms of the LGPL 2.1
|
||||
see COPYING and AUTHORS files in distribution or http:#mpg123.org
|
||||
*/
|
||||
|
||||
#ifndef MPG123_H_TRUE
|
||||
#define MPG123_H_TRUE
|
||||
|
||||
#define MAYBE -1
|
||||
#define FALSE 0
|
||||
#define TRUE 1
|
||||
|
||||
#endif
|
Loading…
Reference in a new issue