mirror of
https://github.com/Q3Rally-Team/q3rally.git
synced 2024-11-29 15:12:07 +00:00
0d5fb492cd
Fix GCC 6 misleading-indentation warning add SECURITY.md OpenGL2: Restore adding fixed ambient light when HDR is enabled Few LCC memory fixes. fix a few potential buffer overwrite in Game VM Enable compiler optimization on all macOS architectures Don't allow qagame module to create "botlib.log" at ANY filesystem location Make FS_BuildOSPath for botlib.log consistent with typical usage tiny readme thing Remove extra plus sign from Huff_Compress() Fix VMs being able to change CVAR_PROTECTED cvars Don't register fs_game cvar everywhere just to get the value Don't let VMs change engine latch cvars immediately Fix fs_game '..' reading outside of home and base path Fix VMs forcing engine latch cvar to update to latched value Revert my recent cvar latch changes Revert "Don't let VMs change engine latch cvars immediately" Partially revert "Fix fs_game '..' reading outside of home and base path" Revert "Fix VMs forcing engine latch cvar to update to latched value" Fix exploit to bypass filename restrictions on Windows Changes to systemd q3a.service Fix Q_vsnprintf for mingw-w64 Fix timelimit causing an infinite map ending loop Fix invalid access to cluster 0 in AAS_AreaRouteToGoalArea() Fix negative frag/capturelimit causing an infinite map end loop OpenGL2: Fix dark lightmap on shader in mpteam6 Make FS_InvalidGameDir() consider subdirectories invalid [qcommon] Remove dead serialization code [qcommon] Make several zone variables and functions static. Fix MAC_OS_X_VERSION_MIN_REQUIRED for macOS 10.10 and later Increase q3_ui .arena filename list buffer size to 4096 bytes OpenGL2: Fix crash when BSP has deluxe maps and vertex lit surfaces Support Unicode characters greater than 0xFF in cl_consoleKeys Fix macOS app bundle with space in name OpenGL1: Use glGenTextures instead of hardcoded values Remove CON_FlushIn function and where STDIN needs flushing, use tcflush POSIX function Update libogg from 1.3.2 to 1.3.3 Rename (already updated) libogg-1.3.2 to libogg-1.3.3 Update libvorbis from 1.3.5 to 1.3.6 * Fix CVE-2018-5146 - out-of-bounds write on codebook decoding. * Fix CVE-2017-14632 - free() on unitialized data * Fix CVE-2017-14633 - out-of-bounds read Rename (already updated) libvorbis-1.3.5 to libvorbis-1.3.6 Update opus from 1.1.4 to 1.2.1 Rename (already updated) opus-1.1.4 to opus-1.2.1 Update opusfile from 0.8 to 0.9 Rename (already updated) opusfile-0.8 to opusfile-0.9 First swing at a CONTRIBUTING.md Allow loading system OpenAL library on macOS again Remove duplicate setting of FREETYPE_CFLAGS in Makefile Fix exploit to reset player by sending wrong serverId Fix "Going to CS_ZOMBIE for [clientname]" developer message Fix MSG_Read*String*() functions not being able to read last byte from message
117 lines
4.8 KiB
C
117 lines
4.8 KiB
C
/********************************************************************
|
|
* *
|
|
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
|
|
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
|
|
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
|
|
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
|
|
* *
|
|
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2015 *
|
|
* by the Xiph.Org Foundation http://www.xiph.org/ *
|
|
* *
|
|
********************************************************************
|
|
|
|
function: basic shared codebook operations
|
|
|
|
********************************************************************/
|
|
|
|
#ifndef _V_CODEBOOK_H_
|
|
#define _V_CODEBOOK_H_
|
|
|
|
#include <ogg/ogg.h>
|
|
|
|
/* This structure encapsulates huffman and VQ style encoding books; it
|
|
doesn't do anything specific to either.
|
|
|
|
valuelist/quantlist are nonNULL (and q_* significant) only if
|
|
there's entry->value mapping to be done.
|
|
|
|
If encode-side mapping must be done (and thus the entry needs to be
|
|
hunted), the auxiliary encode pointer will point to a decision
|
|
tree. This is true of both VQ and huffman, but is mostly useful
|
|
with VQ.
|
|
|
|
*/
|
|
|
|
typedef struct static_codebook{
|
|
long dim; /* codebook dimensions (elements per vector) */
|
|
long entries; /* codebook entries */
|
|
char *lengthlist; /* codeword lengths in bits */
|
|
|
|
/* mapping ***************************************************************/
|
|
int maptype; /* 0=none
|
|
1=implicitly populated values from map column
|
|
2=listed arbitrary values */
|
|
|
|
/* The below does a linear, single monotonic sequence mapping. */
|
|
long q_min; /* packed 32 bit float; quant value 0 maps to minval */
|
|
long q_delta; /* packed 32 bit float; val 1 - val 0 == delta */
|
|
int q_quant; /* bits: 0 < quant <= 16 */
|
|
int q_sequencep; /* bitflag */
|
|
|
|
long *quantlist; /* map == 1: (int)(entries^(1/dim)) element column map
|
|
map == 2: list of dim*entries quantized entry vals
|
|
*/
|
|
int allocedp;
|
|
} static_codebook;
|
|
|
|
typedef struct codebook{
|
|
long dim; /* codebook dimensions (elements per vector) */
|
|
long entries; /* codebook entries */
|
|
long used_entries; /* populated codebook entries */
|
|
const static_codebook *c;
|
|
|
|
/* for encode, the below are entry-ordered, fully populated */
|
|
/* for decode, the below are ordered by bitreversed codeword and only
|
|
used entries are populated */
|
|
float *valuelist; /* list of dim*entries actual entry values */
|
|
ogg_uint32_t *codelist; /* list of bitstream codewords for each entry */
|
|
|
|
int *dec_index; /* only used if sparseness collapsed */
|
|
char *dec_codelengths;
|
|
ogg_uint32_t *dec_firsttable;
|
|
int dec_firsttablen;
|
|
int dec_maxlength;
|
|
|
|
/* The current encoder uses only centered, integer-only lattice books. */
|
|
int quantvals;
|
|
int minval;
|
|
int delta;
|
|
} codebook;
|
|
|
|
extern void vorbis_staticbook_destroy(static_codebook *b);
|
|
extern int vorbis_book_init_encode(codebook *dest,const static_codebook *source);
|
|
extern int vorbis_book_init_decode(codebook *dest,const static_codebook *source);
|
|
extern void vorbis_book_clear(codebook *b);
|
|
|
|
extern float *_book_unquantize(const static_codebook *b,int n,int *map);
|
|
extern float *_book_logdist(const static_codebook *b,float *vals);
|
|
extern float _float32_unpack(long val);
|
|
extern long _float32_pack(float val);
|
|
extern int _best(codebook *book, float *a, int step);
|
|
extern long _book_maptype1_quantvals(const static_codebook *b);
|
|
|
|
extern int vorbis_book_besterror(codebook *book,float *a,int step,int addmul);
|
|
extern long vorbis_book_codeword(codebook *book,int entry);
|
|
extern long vorbis_book_codelen(codebook *book,int entry);
|
|
|
|
|
|
|
|
extern int vorbis_staticbook_pack(const static_codebook *c,oggpack_buffer *b);
|
|
extern static_codebook *vorbis_staticbook_unpack(oggpack_buffer *b);
|
|
|
|
extern int vorbis_book_encode(codebook *book, int a, oggpack_buffer *b);
|
|
|
|
extern long vorbis_book_decode(codebook *book, oggpack_buffer *b);
|
|
extern long vorbis_book_decodevs_add(codebook *book, float *a,
|
|
oggpack_buffer *b,int n);
|
|
extern long vorbis_book_decodev_set(codebook *book, float *a,
|
|
oggpack_buffer *b,int n);
|
|
extern long vorbis_book_decodev_add(codebook *book, float *a,
|
|
oggpack_buffer *b,int n);
|
|
extern long vorbis_book_decodevv_add(codebook *book, float **a,
|
|
long off,int ch,
|
|
oggpack_buffer *b,int n);
|
|
|
|
|
|
|
|
#endif
|