Symphony Of Empires
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <math.h>
#include <limits.h>
Go to the source code of this file.
Classes | |
struct | stb_vorbis_alloc |
struct | stb_vorbis_info |
struct | stb_vorbis_comment |
struct | Codebook |
struct | Floor0 |
struct | Floor1 |
union | Floor |
struct | Residue |
struct | MappingChannel |
struct | Mapping |
struct | Mode |
struct | CRCscan |
struct | ProbedPage |
struct | stb_vorbis |
struct | stbv__floor_ordering |
union | float_conv |
Macros | |
#define | STB_VORBIS_INCLUDE_STB_VORBIS_H |
#define | STB_VORBIS_MAX_CHANNELS 16 |
#define | STB_VORBIS_PUSHDATA_CRC_COUNT 4 |
#define | STB_VORBIS_FAST_HUFFMAN_LENGTH 10 |
#define | STB_VORBIS_FAST_HUFFMAN_SHORT |
#define | STB_VORBIS_ENDIAN 0 |
#define | __forceinline |
#define | CHECK(f) ((void) 0) |
#define | MAX_BLOCKSIZE_LOG 13 |
#define | MAX_BLOCKSIZE (1 << MAX_BLOCKSIZE_LOG) |
#define | TRUE 1 |
#define | FALSE 0 |
#define | STBV_NOTUSED(v) (void)sizeof(v) |
#define | FAST_HUFFMAN_TABLE_SIZE (1 << STB_VORBIS_FAST_HUFFMAN_LENGTH) |
#define | FAST_HUFFMAN_TABLE_MASK (FAST_HUFFMAN_TABLE_SIZE - 1) |
#define | IS_PUSH_MODE(f) ((f)->push_mode) |
#define | array_size_required(count, size) (count*(sizeof(void *)+(size))) |
#define | temp_alloc(f, size) (f->alloc.alloc_buffer ? setup_temp_malloc(f,size) : alloca(size)) |
#define | temp_free(f, p) (void)0 |
#define | temp_alloc_save(f) ((f)->temp_offset) |
#define | temp_alloc_restore(f, p) ((f)->temp_offset = (p)) |
#define | temp_block_array(f, count, size) make_block_array(temp_alloc(f,array_size_required(count,size)), count, size) |
#define | CRC32_POLY 0x04c11db7 |
#define | M_PI 3.14159265358979323846264f |
#define | NO_CODE 255 |
#define | STBV_CDECL |
#define | USE_MEMORY(z) ((z)->stream) |
#define | PAGEFLAG_continued_packet 1 |
#define | PAGEFLAG_first_page 2 |
#define | PAGEFLAG_last_page 4 |
#define | EOP (-1) |
#define | INVALID_BITS (-1) |
#define | DECODE_RAW(var, f, c) |
#define | DECODE(var, f, c) |
#define | DECODE_VQ(var, f, c) DECODE_RAW(var,f,c) |
#define | CODEBOOK_ELEMENT(c, off) (c->multiplicands[off]) |
#define | CODEBOOK_ELEMENT_FAST(c, off) (c->multiplicands[off]) |
#define | CODEBOOK_ELEMENT_BASE(c) (0) |
#define | LINE_OP(a, b) a *= b |
#define | LIBVORBIS_MDCT 0 |
#define | SAMPLE_unknown 0xffffffff |
#define | PLAYBACK_MONO 1 |
#define | PLAYBACK_LEFT 2 |
#define | PLAYBACK_RIGHT 4 |
#define | L (PLAYBACK_LEFT | PLAYBACK_MONO) |
#define | C (PLAYBACK_LEFT | PLAYBACK_RIGHT | PLAYBACK_MONO) |
#define | R (PLAYBACK_RIGHT | PLAYBACK_MONO) |
#define | FASTDEF(x) float_conv x |
#define | MAGIC(SHIFT) (1.5f * (1 << (23-SHIFT)) + 0.5f/(1 << SHIFT)) |
#define | ADDEND(SHIFT) (((150-SHIFT) << 23) + (1 << 22)) |
#define | FAST_SCALED_FLOAT_TO_INT(temp, x, s) (temp.f = (x) + MAGIC(s), temp.i - ADDEND(s)) |
#define | check_endianness() |
#define | STB_BUFFER_SIZE 32 |
#define | STB_BUFFER_SIZE 32 |
Typedefs | |
typedef struct stb_vorbis | stb_vorbis |
typedef unsigned char | uint8 |
typedef signed char | int8 |
typedef unsigned short | uint16 |
typedef signed short | int16 |
typedef unsigned int | uint32 |
typedef signed int | int32 |
typedef float | codetype |
typedef struct stb_vorbis | vorb |
typedef int16 | YTYPE |
typedef char | stb_vorbis_float_size_test[sizeof(float)==4 &&sizeof(int)==4] |
Functions | |
stb_vorbis_info | stb_vorbis_get_info (stb_vorbis *f) |
stb_vorbis_comment | stb_vorbis_get_comment (stb_vorbis *f) |
int | stb_vorbis_get_error (stb_vorbis *f) |
void | stb_vorbis_close (stb_vorbis *f) |
int | stb_vorbis_get_sample_offset (stb_vorbis *f) |
unsigned int | stb_vorbis_get_file_offset (stb_vorbis *f) |
stb_vorbis * | stb_vorbis_open_pushdata (const unsigned char *datablock, int datablock_length_in_bytes, int *datablock_memory_consumed_in_bytes, int *error, const stb_vorbis_alloc *alloc_buffer) |
int | stb_vorbis_decode_frame_pushdata (stb_vorbis *f, const unsigned char *datablock, int datablock_length_in_bytes, int *channels, float ***output, int *samples) |
void | stb_vorbis_flush_pushdata (stb_vorbis *f) |
int | stb_vorbis_decode_filename (const char *filename, int *channels, int *sample_rate, short **output) |
int | stb_vorbis_decode_memory (const unsigned char *mem, int len, int *channels, int *sample_rate, short **output) |
stb_vorbis * | stb_vorbis_open_memory (const unsigned char *data, int len, int *error, const stb_vorbis_alloc *alloc_buffer) |
stb_vorbis * | stb_vorbis_open_filename (const char *filename, int *error, const stb_vorbis_alloc *alloc_buffer) |
stb_vorbis * | stb_vorbis_open_file (FILE *f, int close_handle_on_close, int *error, const stb_vorbis_alloc *alloc_buffer) |
stb_vorbis * | stb_vorbis_open_file_section (FILE *f, int close_handle_on_close, int *error, const stb_vorbis_alloc *alloc_buffer, unsigned int len) |
int | stb_vorbis_seek_frame (stb_vorbis *f, unsigned int sample_number) |
int | stb_vorbis_seek (stb_vorbis *f, unsigned int sample_number) |
int | stb_vorbis_seek_start (stb_vorbis *f) |
unsigned int | stb_vorbis_stream_length_in_samples (stb_vorbis *f) |
float | stb_vorbis_stream_length_in_seconds (stb_vorbis *f) |
int | stb_vorbis_get_frame_float (stb_vorbis *f, int *channels, float ***output) |
int | stb_vorbis_get_frame_short_interleaved (stb_vorbis *f, int num_c, short *buffer, int num_shorts) |
int | stb_vorbis_get_frame_short (stb_vorbis *f, int num_c, short **buffer, int num_samples) |
int | stb_vorbis_get_samples_float_interleaved (stb_vorbis *f, int channels, float *buffer, int num_floats) |
int | stb_vorbis_get_samples_float (stb_vorbis *f, int channels, float **buffer, int num_samples) |
int | stb_vorbis_get_samples_short_interleaved (stb_vorbis *f, int channels, short *buffer, int num_shorts) |
int | stb_vorbis_get_samples_short (stb_vorbis *f, int channels, short **buffer, int num_samples) |
#define __forceinline |
Definition at line 620 of file stb_vorbis.c.
#define ADDEND | ( | SHIFT | ) | (((150-SHIFT) << 23) + (1 << 22)) |
Definition at line 5156 of file stb_vorbis.c.
#define array_size_required | ( | count, | |
size | |||
) | (count*(sizeof(void *)+(size))) |
Definition at line 928 of file stb_vorbis.c.
#define C (PLAYBACK_LEFT | PLAYBACK_RIGHT | PLAYBACK_MONO) |
Definition at line 5132 of file stb_vorbis.c.
#define CHECK | ( | f | ) | ((void) 0) |
Definition at line 637 of file stb_vorbis.c.
#define check_endianness | ( | ) |
Definition at line 5158 of file stb_vorbis.c.
#define CODEBOOK_ELEMENT | ( | c, | |
off | |||
) | (c->multiplicands[off]) |
Definition at line 1771 of file stb_vorbis.c.
#define CODEBOOK_ELEMENT_BASE | ( | c | ) | (0) |
Definition at line 1773 of file stb_vorbis.c.
#define CODEBOOK_ELEMENT_FAST | ( | c, | |
off | |||
) | (c->multiplicands[off]) |
Definition at line 1772 of file stb_vorbis.c.
#define CRC32_POLY 0x04c11db7 |
Definition at line 989 of file stb_vorbis.c.
#define DECODE | ( | var, | |
f, | |||
c | |||
) |
Definition at line 1754 of file stb_vorbis.c.
#define DECODE_RAW | ( | var, | |
f, | |||
c | |||
) |
Definition at line 1717 of file stb_vorbis.c.
#define DECODE_VQ | ( | var, | |
f, | |||
c | |||
) | DECODE_RAW(var,f,c) |
Definition at line 1759 of file stb_vorbis.c.
#define EOP (-1) |
Definition at line 1560 of file stb_vorbis.c.
#define FALSE 0 |
Definition at line 653 of file stb_vorbis.c.
#define FAST_HUFFMAN_TABLE_MASK (FAST_HUFFMAN_TABLE_SIZE - 1) |
Definition at line 678 of file stb_vorbis.c.
#define FAST_HUFFMAN_TABLE_SIZE (1 << STB_VORBIS_FAST_HUFFMAN_LENGTH) |
Definition at line 677 of file stb_vorbis.c.
Definition at line 5157 of file stb_vorbis.c.
#define FASTDEF | ( | x | ) | float_conv x |
Definition at line 5153 of file stb_vorbis.c.
#define INVALID_BITS (-1) |
Definition at line 1561 of file stb_vorbis.c.
#define IS_PUSH_MODE | ( | f | ) | ((f)->push_mode) |
Definition at line 908 of file stb_vorbis.c.
#define L (PLAYBACK_LEFT | PLAYBACK_MONO) |
Definition at line 5131 of file stb_vorbis.c.
#define LIBVORBIS_MDCT 0 |
Definition at line 2365 of file stb_vorbis.c.
#define LINE_OP | ( | a, | |
b | |||
) | a *= b |
Definition at line 2023 of file stb_vorbis.c.
#define M_PI 3.14159265358979323846264f |
Definition at line 1046 of file stb_vorbis.c.
#define MAGIC | ( | SHIFT | ) | (1.5f * (1 << (23-SHIFT)) + 0.5f/(1 << SHIFT)) |
Definition at line 5155 of file stb_vorbis.c.
#define MAX_BLOCKSIZE (1 << MAX_BLOCKSIZE_LOG) |
Definition at line 641 of file stb_vorbis.c.
#define MAX_BLOCKSIZE_LOG 13 |
Definition at line 640 of file stb_vorbis.c.
#define NO_CODE 255 |
Definition at line 1050 of file stb_vorbis.c.
#define PAGEFLAG_continued_packet 1 |
Definition at line 1440 of file stb_vorbis.c.
#define PAGEFLAG_first_page 2 |
Definition at line 1441 of file stb_vorbis.c.
#define PAGEFLAG_last_page 4 |
Definition at line 1442 of file stb_vorbis.c.
#define PLAYBACK_LEFT 2 |
Definition at line 5128 of file stb_vorbis.c.
#define PLAYBACK_MONO 1 |
Definition at line 5127 of file stb_vorbis.c.
#define PLAYBACK_RIGHT 4 |
Definition at line 5129 of file stb_vorbis.c.
#define R (PLAYBACK_RIGHT | PLAYBACK_MONO) |
Definition at line 5133 of file stb_vorbis.c.
#define SAMPLE_unknown 0xffffffff |
Definition at line 4632 of file stb_vorbis.c.
#define STB_BUFFER_SIZE 32 |
#define STB_BUFFER_SIZE 32 |
#define STB_VORBIS_ENDIAN 0 |
Definition at line 568 of file stb_vorbis.c.
#define STB_VORBIS_FAST_HUFFMAN_LENGTH 10 |
Definition at line 486 of file stb_vorbis.c.
#define STB_VORBIS_FAST_HUFFMAN_SHORT |
Definition at line 500 of file stb_vorbis.c.
#define STB_VORBIS_INCLUDE_STB_VORBIS_H |
Definition at line 75 of file stb_vorbis.c.
#define STB_VORBIS_MAX_CHANNELS 16 |
Definition at line 461 of file stb_vorbis.c.
#define STB_VORBIS_PUSHDATA_CRC_COUNT 4 |
Definition at line 477 of file stb_vorbis.c.
#define STBV_CDECL |
Definition at line 1159 of file stb_vorbis.c.
#define STBV_NOTUSED | ( | v | ) | (void)sizeof(v) |
Definition at line 661 of file stb_vorbis.c.
#define temp_alloc | ( | f, | |
size | |||
) | (f->alloc.alloc_buffer ? setup_temp_malloc(f,size) : alloca(size)) |
Definition at line 930 of file stb_vorbis.c.
#define temp_alloc_restore | ( | f, | |
p | |||
) | ((f)->temp_offset = (p)) |
Definition at line 933 of file stb_vorbis.c.
#define temp_alloc_save | ( | f | ) | ((f)->temp_offset) |
Definition at line 932 of file stb_vorbis.c.
#define temp_block_array | ( | f, | |
count, | |||
size | |||
) | make_block_array(temp_alloc(f,array_size_required(count,size)), count, size) |
Definition at line 935 of file stb_vorbis.c.
#define temp_free | ( | f, | |
p | |||
) | (void)0 |
Definition at line 931 of file stb_vorbis.c.
#define TRUE 1 |
Definition at line 652 of file stb_vorbis.c.
#define USE_MEMORY | ( | z | ) | ((z)->stream) |
Definition at line 1334 of file stb_vorbis.c.
typedef float codetype |
Definition at line 656 of file stb_vorbis.c.
typedef signed short int16 |
Definition at line 647 of file stb_vorbis.c.
typedef signed int int32 |
Definition at line 649 of file stb_vorbis.c.
typedef signed char int8 |
Definition at line 645 of file stb_vorbis.c.
typedef struct stb_vorbis stb_vorbis |
Definition at line 1 of file stb_vorbis.c.
typedef char stb_vorbis_float_size_test[sizeof(float)==4 &&sizeof(int)==4] |
Definition at line 5152 of file stb_vorbis.c.
typedef unsigned short uint16 |
Definition at line 646 of file stb_vorbis.c.
typedef unsigned int uint32 |
Definition at line 648 of file stb_vorbis.c.
typedef unsigned char uint8 |
Definition at line 644 of file stb_vorbis.c.
typedef struct stb_vorbis vorb |
Definition at line 656 of file stb_vorbis.c.
Definition at line 3068 of file stb_vorbis.c.
anonymous enum |
Enumerator | |
---|---|
VORBIS_packet_id | |
VORBIS_packet_comment | |
VORBIS_packet_setup |
Definition at line 1649 of file stb_vorbis.c.
enum STBVorbisError |
Definition at line 374 of file stb_vorbis.c.
void stb_vorbis_close | ( | stb_vorbis * | f | ) |
int stb_vorbis_decode_filename | ( | const char * | filename, |
int * | channels, | ||
int * | sample_rate, | ||
short ** | output | ||
) |
Definition at line 5346 of file stb_vorbis.c.
int stb_vorbis_decode_frame_pushdata | ( | stb_vorbis * | f, |
const unsigned char * | datablock, | ||
int | datablock_length_in_bytes, | ||
int * | channels, | ||
float *** | output, | ||
int * | samples | ||
) |
Definition at line 4444 of file stb_vorbis.c.
int stb_vorbis_decode_memory | ( | const unsigned char * | mem, |
int | len, | ||
int * | channels, | ||
int * | sample_rate, | ||
short ** | output | ||
) |
Definition at line 5386 of file stb_vorbis.c.
void stb_vorbis_flush_pushdata | ( | stb_vorbis * | f | ) |
Definition at line 4341 of file stb_vorbis.c.
stb_vorbis_comment stb_vorbis_get_comment | ( | stb_vorbis * | f | ) |
Definition at line 4317 of file stb_vorbis.c.
int stb_vorbis_get_error | ( | stb_vorbis * | f | ) |
Definition at line 4326 of file stb_vorbis.c.
unsigned int stb_vorbis_get_file_offset | ( | stb_vorbis * | f | ) |
Definition at line 4545 of file stb_vorbis.c.
int stb_vorbis_get_frame_float | ( | stb_vorbis * | f, |
int * | channels, | ||
float *** | output | ||
) |
int stb_vorbis_get_frame_short | ( | stb_vorbis * | f, |
int | num_c, | ||
short ** | buffer, | ||
int | num_samples | ||
) |
Definition at line 5260 of file stb_vorbis.c.
int stb_vorbis_get_frame_short_interleaved | ( | stb_vorbis * | f, |
int | num_c, | ||
short * | buffer, | ||
int | num_shorts | ||
) |
stb_vorbis_info stb_vorbis_get_info | ( | stb_vorbis * | f | ) |
Definition at line 4305 of file stb_vorbis.c.
int stb_vorbis_get_sample_offset | ( | stb_vorbis * | f | ) |
Definition at line 4297 of file stb_vorbis.c.
int stb_vorbis_get_samples_float | ( | stb_vorbis * | f, |
int | channels, | ||
float ** | buffer, | ||
int | num_samples | ||
) |
int stb_vorbis_get_samples_float_interleaved | ( | stb_vorbis * | f, |
int | channels, | ||
float * | buffer, | ||
int | num_floats | ||
) |
int stb_vorbis_get_samples_short | ( | stb_vorbis * | f, |
int | channels, | ||
short ** | buffer, | ||
int | num_samples | ||
) |
Definition at line 5328 of file stb_vorbis.c.
int stb_vorbis_get_samples_short_interleaved | ( | stb_vorbis * | f, |
int | channels, | ||
short * | buffer, | ||
int | num_shorts | ||
) |
Definition at line 5309 of file stb_vorbis.c.
stb_vorbis * stb_vorbis_open_file | ( | FILE * | f, |
int | close_handle_on_close, | ||
int * | error, | ||
const stb_vorbis_alloc * | alloc_buffer | ||
) |
Definition at line 5073 of file stb_vorbis.c.
stb_vorbis * stb_vorbis_open_file_section | ( | FILE * | f, |
int | close_handle_on_close, | ||
int * | error, | ||
const stb_vorbis_alloc * | alloc_buffer, | ||
unsigned int | len | ||
) |
Definition at line 5052 of file stb_vorbis.c.
stb_vorbis * stb_vorbis_open_filename | ( | const char * | filename, |
int * | error, | ||
const stb_vorbis_alloc * | alloc_buffer | ||
) |
stb_vorbis * stb_vorbis_open_memory | ( | const unsigned char * | data, |
int | len, | ||
int * | error, | ||
const stb_vorbis_alloc * | alloc_buffer | ||
) |
Definition at line 5099 of file stb_vorbis.c.
stb_vorbis * stb_vorbis_open_pushdata | ( | const unsigned char * | datablock, |
int | datablock_length_in_bytes, | ||
int * | datablock_memory_consumed_in_bytes, | ||
int * | error, | ||
const stb_vorbis_alloc * | alloc_buffer | ||
) |
Definition at line 4514 of file stb_vorbis.c.
int stb_vorbis_seek | ( | stb_vorbis * | f, |
unsigned int | sample_number | ||
) |
int stb_vorbis_seek_frame | ( | stb_vorbis * | f, |
unsigned int | sample_number | ||
) |
int stb_vorbis_seek_start | ( | stb_vorbis * | f | ) |
Definition at line 4936 of file stb_vorbis.c.
unsigned int stb_vorbis_stream_length_in_samples | ( | stb_vorbis * | f | ) |
float stb_vorbis_stream_length_in_seconds | ( | stb_vorbis * | f | ) |