1 #ifndef STB_VORBIS_INCLUDE_STB_VORBIS_H 2 #define STB_VORBIS_INCLUDE_STB_VORBIS_H 55 #ifndef STB_VORBIS_NO_PULLDATA_API 150 #ifndef STB_VORBIS_HEADER_ONLY 162 #define STB_VORBIS_NO_PULLDATA_API 174 #ifndef STB_VORBIS_MAX_CHANNELS 175 #define STB_VORBIS_MAX_CHANNELS 16 184 #ifndef STB_VORBIS_FAST_HUFFMAN_LENGTH 185 #define STB_VORBIS_FAST_HUFFMAN_LENGTH 10 199 #ifndef STB_VORBIS_FAST_HUFFMAN_INT 200 #define STB_VORBIS_FAST_HUFFMAN_SHORT 211 #define STB_VORBIS_NO_HUFFMAN_BINARY_SEARCH 221 #ifndef STB_VORBIS_CODEBOOK_SHORTS 222 #define STB_VORBIS_CODEBOOK_FLOATS 227 #define MAX_BLOCKSIZE_LOG 13 228 #define MAX_BLOCKSIZE (1 << MAX_BLOCKSIZE_LOG) 235 #ifdef STB_VORBIS_CODEBOOK_FLOATS 255 #define FAST_HUFFMAN_TABLE_SIZE (1 << STB_VORBIS_FAST_HUFFMAN_LENGTH) 256 #define FAST_HUFFMAN_TABLE_MASK (FAST_HUFFMAN_TABLE_SIZE - 1) 271 #ifdef STB_VORBIS_FAST_HUFFMAN_SHORT 462 #define IS_PUSH_MODE(f) FALSE 482 #define array_size_required(count,size) (count*(sizeof(void *)+(size))) 484 #define temp_alloc(f,size) (f->alloc.alloc_buffer ? setup_temp_malloc(f,size) : alloca(size)) 485 #define temp_alloc_save(f) ((f)->temp_offset) 486 #define temp_alloc_restore(f,p) ((f)->temp_offset = (p)) 488 #define temp_block_array(f,count,size) make_block_array(temp_alloc(f,array_size_required(count,size)), count, size) 494 void **
p = (
void **)
mem;
495 char *
q = (
char *) (
p +
count);
496 for (i=0; i <
count; ++i) {
506 f->setup_memory_required += sz;
507 if (
f->alloc.alloc_buffer) {
508 void *
p = (
char *)
f->alloc.alloc_buffer +
f->setup_offset;
509 if (
f->setup_offset + sz >
f->temp_offset)
return NULL;
510 f->setup_offset += sz;
518 if (
f->alloc.alloc_buffer)
return;
525 if (
f->alloc.alloc_buffer) {
527 f->temp_offset -= sz;
528 return (
char *)
f->alloc.alloc_buffer +
f->temp_offset;
535 if (
f->alloc.alloc_buffer) {
536 f->temp_offset += (sz+3)&~3;
542 #define CRC32_POLY 0x04c11db7 549 for(i=0; i < 256; i++) {
550 for (
s=i<<24,
j=0;
j < 8; ++
j)
564 n = ((
n & 0xAAAAAAAA) >> 1) | ((
n & 0x55555555) << 1);
565 n = ((
n & 0xCCCCCCCC) >> 2) | ((
n & 0x33333333) << 2);
566 n = ((
n & 0xF0F0F0F0) >> 4) | ((
n & 0x0F0F0F0F) << 4);
567 n = ((
n & 0xFF00FF00) >> 8) | ((
n & 0x00FF00FF) << 8);
568 return (
n >> 16) | (
n << 16);
582 static signed char log2_4[16] = { 0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4 };
586 if (
n < (1 << 4))
return 0 + log2_4[
n ];
587 else if (
n < (1 << 9))
return 5 + log2_4[
n >> 5];
588 else return 10 + log2_4[
n >> 10];
589 else if (
n < (1 << 24))
590 if (
n < (1 << 19))
return 15 + log2_4[
n >> 15];
591 else return 20 + log2_4[
n >> 20];
592 else if (
n < (1 << 29))
return 25 + log2_4[
n >> 25];
593 else if (
n < (1 << 31))
return 30 + log2_4[
n >> 30];
598 #define M_PI 3.14159265358979323846264f 615 double res =
sign ? -(double)mantissa : (
double)mantissa;
616 return (
float) ldexp((
float)
res,
exp-788);
631 c->codewords [symbol] = huff_code;
633 c->codewords [
count] = huff_code;
644 memset(available, 0,
sizeof(available));
647 if (k ==
n) { assert(
c->sorted_entries == 0);
return TRUE; }
651 for (i=1; i <=
len[k]; ++i)
652 available[i] = 1 << (32-i);
657 for (i=k+1; i <
n; ++i) {
667 while (
z > 0 && !available[
z]) --
z;
668 if (
z == 0) { assert(0);
return FALSE; }
675 assert(available[
y] == 0);
676 available[
y] =
res + (1 << (32-
y));
689 c->fast_huffman[i] = -1;
691 len =
c->sparse ?
c->sorted_entries :
c->entries;
695 for (i=0; i <
len; ++i) {
700 c->fast_huffman[
z] = i;
701 z += 1 <<
c->codeword_lengths[i];
708 #define STBV_CDECL __cdecl 717 return x <
y ? -1 :
x >
y;
739 for (i=0; i <
c->entries; ++i)
742 assert(k ==
c->sorted_entries);
744 for (i=0; i <
c->sorted_entries; ++i)
748 qsort(
c->sorted_codewords,
c->sorted_entries,
sizeof(
c->sorted_codewords[0]),
uint32_t_compare);
749 c->sorted_codewords[
c->sorted_entries] = 0xffffffff;
751 len =
c->sparse ?
c->sorted_entries :
c->entries;
757 for (i=0; i <
len; ++i) {
761 int x=0,
n=
c->sorted_entries;
764 int m =
x + (
n >> 1);
765 if (
c->sorted_codewords[
m] <=
code) {
772 assert(
c->sorted_codewords[
x] ==
code);
775 c->codeword_lengths[
x] = huff_len;
777 c->sorted_values[
x] = i;
786 static uint8_t vorbis[6] = {
'v',
'o',
'r',
'b',
'i',
's' };
794 int r = (int)
floor(
exp((
float)
log((
float) entries) / dim));
795 if ((
int)
floor(
pow((
float)
r+1, dim)) <= entries)
797 assert(
pow((
float)
r+1, dim) > entries);
798 assert((
int)
floor(
pow((
float)
r, dim)) <= entries);
805 int n4 =
n >> 2, n8 =
n >> 3;
808 for (k=
k2=0; k < n4; ++k,
k2+=2) {
814 for (k=
k2=0; k < n8; ++k,
k2+=2) {
823 for (i=0; i < n2; ++i)
829 int ld =
ilog(
n) - 1;
831 for (i=0; i < n8; ++i)
837 int n2 =
n >> 1, n4 =
n >> 2, n8 =
n >> 3;
857 for (i=0; i <
n; ++i) {
858 if (
x[i] > low &&
x[i] <
x[
n]) { *plow = i; low =
x[i]; }
859 if (
x[i] < high &&
x[i] >
x[
n]) { *phigh = i; high =
x[i]; }
873 return a->
x <
b->x ? -1 :
a->x >
b->x;
880 if (
z->stream >=
z->stream_end) {
z->eof =
TRUE;
return 0; }
896 if (
z->stream+
n >
z->stream_end) {
z->eof = 1;
return 0; }
905 if (
z->stream >=
z->stream_end)
z->eof = 1;
912 if (
f->stream_start + loc >=
f->stream_end ||
f->stream_start + loc < f->
stream_start) {
913 f->stream =
f->stream_end;
917 f->stream =
f->stream_start + loc;
934 #define PAGEFLAG_continued_packet 1 935 #define PAGEFLAG_first_page 2 936 #define PAGEFLAG_last_page 4 958 f->segment_count =
get8(
f);
959 if (!
getn(
f,
f->segments,
f->segment_count))
962 f->end_seg_with_known_loc = -2;
963 if (loc0 != ~0U || loc1 != ~0U) {
966 for (i=
f->segment_count-1; i >= 0; --i)
967 if (
f->segments[i] < 255)
971 f->end_seg_with_known_loc = i;
972 f->known_loc_for_packet = loc0;
975 if (
f->first_decode) {
979 for (i=0; i <
f->segment_count; ++i)
980 len +=
f->segments[i];
981 len += 27 +
f->segment_count;
982 p.page_start =
f->first_audio_page_offset;
983 p.page_end =
p.page_start +
len;
984 p.after_previous_page_start =
p.page_start;
985 p.first_decoded_sample = 0;
986 p.last_decoded_sample = loc0;
1001 while (
f->next_seg == -1) {
1008 f->packet_bytes = 0;
1009 f->bytes_in_seg = 0;
1016 if (
f->next_seg == -1) {
1018 if (
f->eof)
return FALSE;
1028 f->bytes_in_seg = 0;
1038 if (
f->last_seg)
return 0;
1039 if (
f->next_seg == -1) {
1040 f->last_seg_which =
f->segment_count-1;
1044 len =
f->segments[
f->next_seg++];
1047 f->last_seg_which =
f->next_seg-1;
1049 if (
f->next_seg >=
f->segment_count)
1051 assert(
f->bytes_in_seg == 0);
1052 f->bytes_in_seg =
len;
1057 #define INVALID_BITS (-1) 1061 if (!
f->bytes_in_seg) {
1062 if (
f->last_seg)
return EOP;
1065 assert(
f->bytes_in_seg > 0);
1089 if (
f->valid_bits < 0)
return 0;
1090 if (
f->valid_bits <
n) {
1097 if (
f->valid_bits == 0)
f->acc = 0;
1098 while (
f->valid_bits <
n) {
1104 f->acc +=
z <<
f->valid_bits;
1108 if (
f->valid_bits < 0)
return 0;
1109 z =
f->acc & ((1 <<
n)-1);
1121 if (
f->valid_bits <= 24) {
1122 if (
f->valid_bits == 0)
f->acc = 0;
1125 if (
f->last_seg && !
f->bytes_in_seg)
return;
1127 if (
z ==
EOP)
return;
1128 f->acc +=
z <<
f->valid_bits;
1130 }
while (
f->valid_bits <= 24);
1146 assert(
c->sorted_codewords ||
c->codewords);
1149 if (
c->entries > 8 ?
c->sorted_codewords!=
NULL : !
c->codewords) {
1152 int x=0,
n=
c->sorted_entries,
len;
1156 int m =
x + (
n >> 1);
1157 if (
c->sorted_codewords[
m] <=
code) {
1165 if (!
c->sparse)
x =
c->sorted_values[
x];
1167 len =
c->codeword_lengths[
x];
1168 if (
f->valid_bits >=
len) {
1170 f->valid_bits -=
len;
1180 for (i=0; i <
c->entries; ++i) {
1181 if (
c->codeword_lengths[i] ==
NO_CODE)
continue;
1182 if (
c->codewords[i] == (
f->acc & ((1 <<
c->codeword_lengths[i])-1))) {
1183 if (
f->valid_bits >=
c->codeword_lengths[i]) {
1184 f->acc >>=
c->codeword_lengths[i];
1185 f->valid_bits -=
c->codeword_lengths[i];
1206 i =
c->fast_huffman[i];
1208 f->acc >>=
c->codeword_lengths[i];
1209 f->valid_bits -=
c->codeword_lengths[i];
1210 if (
f->valid_bits < 0) {
f->valid_bits = 0;
return -1; }
1216 #define DECODE_RAW(var,f,c) var = codebook_decode_scalar(f,c); 1218 #define DECODE(var,f,c) \ 1219 DECODE_RAW(var,f,c) \ 1220 if (c->sparse) var = c->sorted_values[var]; 1222 #define DECODE_VQ(var,f,c) DECODE_RAW(var,f,c) 1226 #ifndef STB_VORBIS_CODEBOOK_FLOATS 1227 #define CODEBOOK_ELEMENT(c,off) (c->multiplicands[off] * c->delta_value + c->minimum_value) 1228 #define CODEBOOK_ELEMENT_FAST(c,off) (c->multiplicands[off] * c->delta_value) 1229 #define CODEBOOK_ELEMENT_BASE(c) (c->minimum_value) 1231 #define CODEBOOK_ELEMENT(c,off) (c->multiplicands[off]) 1232 #define CODEBOOK_ELEMENT_FAST(c,off) (c->multiplicands[off]) 1233 #define CODEBOOK_ELEMENT_BASE(c) (0) 1241 if (
c->lookup_type == 0)
1245 if (
c->sparse) assert(
z < c->sorted_entries);
1247 if (!
f->bytes_in_seg)
1260 if (
len >
c->dimensions)
len =
c->dimensions;
1263 if (
c->sequence_p) {
1265 for (i=0; i <
len; ++i) {
1268 last =
val +
c->minimum_value;
1272 for (i=0; i <
len; ++i) {
1285 if (
len >
c->dimensions)
len =
c->dimensions;
1288 for (i=0; i <
len; ++i) {
1291 if (
c->sequence_p) last =
val;
1299 int c_inter = *c_inter_p;
1300 int p_inter = *p_inter_p;
1301 int i,
z, effective =
c->dimensions;
1306 while (total_decode > 0) {
1309 assert(!
c->sparse ||
z < c->sorted_entries);
1311 if (!
f->bytes_in_seg)
1312 if (
f->last_seg)
return FALSE;
1320 if (c_inter + p_inter*ch + effective >
len * ch) {
1321 effective =
len*ch - (p_inter*ch - c_inter);
1325 if (
c->sequence_p) {
1326 for (i=0; i < effective; ++i) {
1330 if (++c_inter == ch) { c_inter = 0; ++p_inter; }
1334 for (i=0; i < effective; ++i) {
1338 if (++c_inter == ch) { c_inter = 0; ++p_inter; }
1342 total_decode -= effective;
1344 *c_inter_p = c_inter;
1345 *p_inter_p = p_inter;
1351 int c_inter = *c_inter_p;
1352 int p_inter = *p_inter_p;
1353 int i,
z, effective =
c->dimensions;
1358 while (total_decode > 0) {
1363 if (!
f->bytes_in_seg)
1364 if (
f->last_seg)
return FALSE;
1373 if (c_inter + p_inter*2 + effective >
len * 2) {
1374 effective =
len*2 - (p_inter*2 - c_inter);
1379 if (
c->sequence_p) {
1381 for (i=0; i < effective; ++i) {
1385 if (++c_inter == 2) { c_inter = 0; ++p_inter; }
1394 c_inter = 0; ++p_inter;
1400 for (; i+1 < effective;) {
1411 if (i < effective) {
1415 if (++c_inter == 2) { c_inter = 0; ++p_inter; }
1420 total_decode -= effective;
1422 *c_inter_p = c_inter;
1423 *p_inter_p = p_inter;
1432 int err = abs(dy) * (
x - x0);
1433 int off = err / adx;
1434 return dy < 0 ? y0 - off : y0 + off;
1440 1.0649863e-07
f, 1.1341951e-07
f, 1.2079015e-07
f, 1.2863978e-07
f,
1441 1.3699951e-07
f, 1.4590251e-07
f, 1.5538408e-07
f, 1.6548181e-07
f,
1442 1.7623575e-07
f, 1.8768855e-07
f, 1.9988561e-07
f, 2.1287530e-07
f,
1443 2.2670913e-07
f, 2.4144197e-07
f, 2.5713223e-07
f, 2.7384213e-07
f,
1444 2.9163793e-07
f, 3.1059021e-07
f, 3.3077411e-07
f, 3.5226968e-07
f,
1445 3.7516214e-07
f, 3.9954229e-07
f, 4.2550680e-07
f, 4.5315863e-07
f,
1446 4.8260743e-07
f, 5.1396998e-07
f, 5.4737065e-07
f, 5.8294187e-07
f,
1447 6.2082472e-07
f, 6.6116941e-07
f, 7.0413592e-07
f, 7.4989464e-07
f,
1448 7.9862701e-07
f, 8.5052630e-07
f, 9.0579828e-07
f, 9.6466216e-07
f,
1449 1.0273513e-06
f, 1.0941144e-06
f, 1.1652161e-06
f, 1.2409384e-06
f,
1450 1.3215816e-06
f, 1.4074654e-06
f, 1.4989305e-06
f, 1.5963394e-06
f,
1451 1.7000785e-06
f, 1.8105592e-06
f, 1.9282195e-06
f, 2.0535261e-06
f,
1452 2.1869758e-06
f, 2.3290978e-06
f, 2.4804557e-06
f, 2.6416497e-06
f,
1453 2.8133190e-06
f, 2.9961443e-06
f, 3.1908506e-06
f, 3.3982101e-06
f,
1454 3.6190449e-06
f, 3.8542308e-06
f, 4.1047004e-06
f, 4.3714470e-06
f,
1455 4.6555282e-06
f, 4.9580707e-06
f, 5.2802740e-06
f, 5.6234160e-06
f,
1456 5.9888572e-06
f, 6.3780469e-06
f, 6.7925283e-06
f, 7.2339451e-06
f,
1457 7.7040476e-06
f, 8.2047000e-06
f, 8.7378876e-06
f, 9.3057248e-06
f,
1458 9.9104632e-06
f, 1.0554501e-05
f, 1.1240392e-05
f, 1.1970856e-05
f,
1459 1.2748789e-05
f, 1.3577278e-05
f, 1.4459606e-05
f, 1.5399272e-05
f,
1460 1.6400004e-05
f, 1.7465768e-05
f, 1.8600792e-05
f, 1.9809576e-05
f,
1461 2.1096914e-05
f, 2.2467911e-05
f, 2.3928002e-05
f, 2.5482978e-05
f,
1462 2.7139006e-05
f, 2.8902651e-05
f, 3.0780908e-05
f, 3.2781225e-05
f,
1463 3.4911534e-05
f, 3.7180282e-05
f, 3.9596466e-05
f, 4.2169667e-05
f,
1464 4.4910090e-05
f, 4.7828601e-05
f, 5.0936773e-05
f, 5.4246931e-05
f,
1465 5.7772202e-05
f, 6.1526565e-05
f, 6.5524908e-05
f, 6.9783085e-05
f,
1466 7.4317983e-05
f, 7.9147585e-05
f, 8.4291040e-05
f, 8.9768747e-05
f,
1467 9.5602426e-05
f, 0.00010181521f, 0.00010843174f, 0.00011547824f,
1468 0.00012298267f, 0.00013097477f, 0.00013948625f, 0.00014855085f,
1469 0.00015820453f, 0.00016848555f, 0.00017943469f, 0.00019109536f,
1470 0.00020351382f, 0.00021673929f, 0.00023082423f, 0.00024582449f,
1471 0.00026179955f, 0.00027881276f, 0.00029693158f, 0.00031622787f,
1472 0.00033677814f, 0.00035866388f, 0.00038197188f, 0.00040679456f,
1473 0.00043323036f, 0.00046138411f, 0.00049136745f, 0.00052329927f,
1474 0.00055730621f, 0.00059352311f, 0.00063209358f, 0.00067317058f,
1475 0.00071691700f, 0.00076350630f, 0.00081312324f, 0.00086596457f,
1476 0.00092223983f, 0.00098217216f, 0.0010459992f, 0.0011139742f,
1477 0.0011863665f, 0.0012634633f, 0.0013455702f, 0.0014330129f,
1478 0.0015261382f, 0.0016253153f, 0.0017309374f, 0.0018434235f,
1479 0.0019632195f, 0.0020908006f, 0.0022266726f, 0.0023713743f,
1480 0.0025254795f, 0.0026895994f, 0.0028643847f, 0.0030505286f,
1481 0.0032487691f, 0.0034598925f, 0.0036847358f, 0.0039241906f,
1482 0.0041792066f, 0.0044507950f, 0.0047400328f, 0.0050480668f,
1483 0.0053761186f, 0.0057254891f, 0.0060975636f, 0.0064938176f,
1484 0.0069158225f, 0.0073652516f, 0.0078438871f, 0.0083536271f,
1485 0.0088964928f, 0.009474637f, 0.010090352f, 0.010746080f,
1486 0.011444421f, 0.012188144f, 0.012980198f, 0.013823725f,
1487 0.014722068f, 0.015678791f, 0.016697687f, 0.017782797f,
1488 0.018938423f, 0.020169149f, 0.021479854f, 0.022875735f,
1489 0.024362330f, 0.025945531f, 0.027631618f, 0.029427276f,
1490 0.031339626f, 0.033376252f, 0.035545228f, 0.037855157f,
1491 0.040315199f, 0.042935108f, 0.045725273f, 0.048696758f,
1492 0.051861348f, 0.055231591f, 0.058820850f, 0.062643361f,
1493 0.066714279f, 0.071049749f, 0.075666962f, 0.080584227f,
1494 0.085821044f, 0.091398179f, 0.097337747f, 0.10366330f,
1495 0.11039993f, 0.11757434f, 0.12521498f, 0.13335215f,
1496 0.14201813f, 0.15124727f, 0.16107617f, 0.17154380f,
1497 0.18269168f, 0.19456402f, 0.20720788f, 0.22067342f,
1498 0.23501402f, 0.25028656f, 0.26655159f, 0.28387361f,
1499 0.30232132f, 0.32196786f, 0.34289114f, 0.36517414f,
1500 0.38890521f, 0.41417847f, 0.44109412f, 0.46975890f,
1501 0.50028648f, 0.53279791f, 0.56742212f, 0.60429640f,
1502 0.64356699f, 0.68538959f, 0.72993007f, 0.77736504f,
1503 0.82788260f, 0.88168307f, 0.9389798f, 1.0f
1515 #define LINE_OP(a,b) a *= b 1525 int base = dy / adx;
1532 ady -= abs(base) * adx;
1535 for (++
x;
x < x1; ++
x) {
1551 for (k=0; k < step; ++k)
1555 for (k=0; k <
n; ) {
1569 int rtype =
f->residue_types[rn];
1571 int classwords =
f->codebooks[
c].dimensions;
1572 int n_read =
r->end -
r->begin;
1573 int part_read = n_read /
r->part_size;
1577 for (i=0; i < ch; ++i)
1578 if (!do_not_decode[i])
1579 memset(residue_buffers[i], 0,
sizeof(
float) *
n);
1581 if (rtype == 2 && ch != 1) {
1582 for (
j=0;
j < ch; ++
j)
1583 if (!do_not_decode[
j])
1588 for (pass=0; pass < 8; ++pass) {
1589 int pcount = 0, class_set = 0;
1591 while (pcount < part_read) {
1592 int z =
r->begin + pcount*
r->part_size;
1593 int c_inter = (
z & 1), p_inter =
z>>1;
1598 if (
q ==
EOP)
goto done;
1599 part_classdata[0][class_set] =
r->classdata[
q];
1601 for (i=0; i < classwords && pcount < part_read; ++i, ++pcount) {
1602 int z =
r->begin + pcount*
r->part_size;
1603 int c = part_classdata[0][class_set][i];
1604 int b =
r->residue_books[
c][pass];
1618 }
else if (ch == 1) {
1619 while (pcount < part_read) {
1620 int z =
r->begin + pcount*
r->part_size;
1621 int c_inter = 0, p_inter =
z;
1626 if (
q ==
EOP)
goto done;
1627 part_classdata[0][class_set] =
r->classdata[
q];
1629 for (i=0; i < classwords && pcount < part_read; ++i, ++pcount) {
1630 int z =
r->begin + pcount*
r->part_size;
1631 int c = part_classdata[0][class_set][i];
1632 int b =
r->residue_books[
c][pass];
1646 while (pcount < part_read) {
1647 int z =
r->begin + pcount*
r->part_size;
1648 int c_inter =
z % ch, p_inter =
z/ch;
1653 if (
q ==
EOP)
goto done;
1654 part_classdata[0][class_set] =
r->classdata[
q];
1656 for (i=0; i < classwords && pcount < part_read; ++i, ++pcount) {
1657 int z =
r->begin + pcount*
r->part_size;
1658 int c = part_classdata[0][class_set][i];
1659 int b =
r->residue_books[
c][pass];
1677 for (pass=0; pass < 8; ++pass) {
1678 int pcount = 0, class_set=0;
1679 while (pcount < part_read) {
1681 for (
j=0;
j < ch; ++
j) {
1682 if (!do_not_decode[
j]) {
1686 if (temp ==
EOP)
goto done;
1687 part_classdata[
j][class_set] =
r->classdata[temp];
1691 for (i=0; i < classwords && pcount < part_read; ++i, ++pcount) {
1692 for (
j=0;
j < ch; ++
j) {
1693 if (!do_not_decode[
j]) {
1694 int c = part_classdata[
j][class_set][i];
1695 int b =
r->residue_books[
c][pass];
1697 float *
target = residue_buffers[
j];
1698 int offset =
r->begin + pcount *
r->part_size;
1699 int n =
r->part_size;
1715 #ifndef LIBVORBIS_MDCT 1716 #define LIBVORBIS_MDCT 0 1733 extern void mdct_init(mdct_lookup *lookup,
int n);
1734 extern void mdct_clear(mdct_lookup *
l);
1735 extern void mdct_backward(mdct_lookup *
init,
float *
in,
float *
out);
1742 if (M1.n ==
n) M = &M1;
1743 else if (M2.n ==
n) M = &M2;
1744 else if (M1.n == 0) { mdct_init(&M1,
n); M = &M1; }
1746 if (M2.n) __asm
int 3;
1761 float *ee0 = e + i_off;
1762 float *ee2 = ee0 + k_off;
1765 assert((
n & 3) == 0);
1766 for (i=(
n>>2); i > 0; --i) {
1767 float k00_20, k01_21;
1768 k00_20 = ee0[ 0] - ee2[ 0];
1769 k01_21 = ee0[-1] - ee2[-1];
1772 ee2[ 0] = k00_20 *
A[0] - k01_21 *
A[1];
1773 ee2[-1] = k01_21 *
A[0] + k00_20 *
A[1];
1776 k00_20 = ee0[-2] - ee2[-2];
1777 k01_21 = ee0[-3] - ee2[-3];
1780 ee2[-2] = k00_20 *
A[0] - k01_21 *
A[1];
1781 ee2[-3] = k01_21 *
A[0] + k00_20 *
A[1];
1784 k00_20 = ee0[-4] - ee2[-4];
1785 k01_21 = ee0[-5] - ee2[-5];
1788 ee2[-4] = k00_20 *
A[0] - k01_21 *
A[1];
1789 ee2[-5] = k01_21 *
A[0] + k00_20 *
A[1];
1792 k00_20 = ee0[-6] - ee2[-6];
1793 k01_21 = ee0[-7] - ee2[-7];
1796 ee2[-6] = k00_20 *
A[0] - k01_21 *
A[1];
1797 ee2[-7] = k01_21 *
A[0] + k00_20 *
A[1];
1807 float k00_20, k01_21;
1810 float *e2 = e0 + k_off;
1812 for (i=lim >> 2; i > 0; --i) {
1813 k00_20 = e0[-0] - e2[-0];
1814 k01_21 = e0[-1] - e2[-1];
1817 e2[-0] = (k00_20)*
A[0] - (k01_21) *
A[1];
1818 e2[-1] = (k01_21)*
A[0] + (k00_20) *
A[1];
1822 k00_20 = e0[-2] - e2[-2];
1823 k01_21 = e0[-3] - e2[-3];
1826 e2[-2] = (k00_20)*
A[0] - (k01_21) *
A[1];
1827 e2[-3] = (k01_21)*
A[0] + (k00_20) *
A[1];
1831 k00_20 = e0[-4] - e2[-4];
1832 k01_21 = e0[-5] - e2[-5];
1835 e2[-4] = (k00_20)*
A[0] - (k01_21) *
A[1];
1836 e2[-5] = (k01_21)*
A[0] + (k00_20) *
A[1];
1840 k00_20 = e0[-6] - e2[-6];
1841 k01_21 = e0[-7] - e2[-7];
1844 e2[-6] = (k00_20)*
A[0] - (k01_21) *
A[1];
1845 e2[-7] = (k01_21)*
A[0] + (k00_20) *
A[1];
1859 float A2 =
A[0+a_off];
1860 float A3 =
A[0+a_off+1];
1861 float A4 =
A[0+a_off*2+0];
1862 float A5 =
A[0+a_off*2+1];
1863 float A6 =
A[0+a_off*3+0];
1864 float A7 =
A[0+a_off*3+1];
1868 float *ee0 = e +i_off;
1869 float *ee2 = ee0+k_off;
1871 for (i=
n; i > 0; --i) {
1872 k00 = ee0[ 0] - ee2[ 0];
1873 k11 = ee0[-1] - ee2[-1];
1874 ee0[ 0] = ee0[ 0] + ee2[ 0];
1875 ee0[-1] = ee0[-1] + ee2[-1];
1876 ee2[ 0] = (k00) * A0 - (k11) * A1;
1877 ee2[-1] = (k11) * A0 + (k00) * A1;
1879 k00 = ee0[-2] - ee2[-2];
1880 k11 = ee0[-3] - ee2[-3];
1881 ee0[-2] = ee0[-2] + ee2[-2];
1882 ee0[-3] = ee0[-3] + ee2[-3];
1883 ee2[-2] = (k00) * A2 - (k11) * A3;
1884 ee2[-3] = (k11) * A2 + (k00) * A3;
1886 k00 = ee0[-4] - ee2[-4];
1887 k11 = ee0[-5] - ee2[-5];
1888 ee0[-4] = ee0[-4] + ee2[-4];
1889 ee0[-5] = ee0[-5] + ee2[-5];
1890 ee2[-4] = (k00) * A4 - (k11) * A5;
1891 ee2[-5] = (k11) * A4 + (k00) * A5;
1893 k00 = ee0[-6] - ee2[-6];
1894 k11 = ee0[-7] - ee2[-7];
1895 ee0[-6] = ee0[-6] + ee2[-6];
1896 ee0[-7] = ee0[-7] + ee2[-7];
1897 ee2[-6] = (k00) * A6 - (k11) * A7;
1898 ee2[-7] = (k11) * A6 + (k00) * A7;
1907 float k00,k11,k22,k33;
1910 k00 =
z[ 0] -
z[-4];
1913 k22 =
z[-2] -
z[-6];
1920 k33 =
z[-3] -
z[-7];
1927 k11 =
z[-1] -
z[-5];
1939 int a_off = base_n >> 3;
1940 float A2 =
A[0+a_off];
1941 float *
z = e + i_off;
1942 float *base =
z - 16 *
n;
1947 k00 =
z[-0] -
z[-8];
1948 k11 =
z[-1] -
z[-9];
1949 z[-0] =
z[-0] +
z[-8];
1950 z[-1] =
z[-1] +
z[-9];
1954 k00 =
z[ -2] -
z[-10];
1955 k11 =
z[ -3] -
z[-11];
1956 z[ -2] =
z[ -2] +
z[-10];
1957 z[ -3] =
z[ -3] +
z[-11];
1958 z[-10] = (k00+k11) * A2;
1959 z[-11] = (k11-k00) * A2;
1961 k00 =
z[-12] -
z[ -4];
1962 k11 =
z[ -5] -
z[-13];
1963 z[ -4] =
z[ -4] +
z[-12];
1964 z[ -5] =
z[ -5] +
z[-13];
1968 k00 =
z[-14] -
z[ -6];
1969 k11 =
z[ -7] -
z[-15];
1970 z[ -6] =
z[ -6] +
z[-14];
1971 z[ -7] =
z[ -7] +
z[-15];
1972 z[-14] = (k00+k11) * A2;
1973 z[-15] = (k00-k11) * A2;
1983 int n2 =
n >> 1, n4 =
n >> 2, n8 =
n >> 3,
l;
1987 float *buf2 = (
float *)
temp_alloc(
f, n2 *
sizeof(*buf2));
1990 float *
A =
f->A[blocktype];
2013 float *d,*e, *AA, *e_stop;
2018 while (e != e_stop) {
2019 d[1] = (e[0] * AA[0] - e[2]*AA[1]);
2020 d[0] = (e[0] * AA[1] + e[2]*AA[0]);
2028 d[1] = (-e[2] * AA[0] - -e[0]*AA[1]);
2029 d[0] = (-e[2] * AA[1] + -e[0]*AA[0]);
2047 float *AA = &
A[n2-8];
2048 float *d0,*d1, *e0, *e1;
2057 float v40_20, v41_21;
2059 v41_21 = e0[1] - e1[1];
2060 v40_20 = e0[0] - e1[0];
2061 d0[1] = e0[1] + e1[1];
2062 d0[0] = e0[0] + e1[0];
2063 d1[1] = v41_21*AA[4] - v40_20*AA[5];
2064 d1[0] = v40_20*AA[4] + v41_21*AA[5];
2066 v41_21 = e0[3] - e1[3];
2067 v40_20 = e0[2] - e1[2];
2068 d0[3] = e0[3] + e1[3];
2069 d0[2] = e0[2] + e1[2];
2070 d1[3] = v41_21*AA[0] - v40_20*AA[1];
2071 d1[2] = v40_20*AA[0] + v41_21*AA[1];
2103 for (;
l < (ld-3)>>1; ++
l) {
2104 int k0 =
n >> (
l+2), k0_2 =
k0>>1;
2105 int lim = 1 << (
l+1);
2107 for (i=0; i < lim; ++i)
2111 for (;
l < ld-6; ++
l) {
2112 int k0 =
n >> (
l+2),
k1 = 1 << (
l+3), k0_2 =
k0>>1;
2113 int rlim =
n >> (
l+6),
r;
2114 int lim = 1 << (
l+1);
2118 for (
r=rlim;
r > 0; --
r) {
2144 float *d0 = &
v[n4-4];
2145 float *d1 = &
v[n2-4];
2175 float *
C =
f->C[blocktype];
2182 float a02,a11,b0,b1,b2,b3;
2187 b0 =
C[1]*a02 +
C[0]*a11;
2188 b1 =
C[1]*a11 -
C[0]*a02;
2201 b0 =
C[3]*a02 +
C[2]*a11;
2202 b1 =
C[3]*a11 -
C[2]*a02;
2230 float *d0,*d1,*d2,*d3;
2232 float *
B =
f->B[blocktype] + n2 - 8;
2233 float *e = buf2 + n2 - 8;
2241 p3 = e[6]*
B[7] - e[7]*
B[6];
2242 p2 = -e[6]*
B[6] - e[7]*
B[7];
2249 p1 = e[4]*
B[5] - e[5]*
B[4];
2250 p0 = -e[4]*
B[4] - e[5]*
B[5];
2257 p3 = e[2]*
B[3] - e[3]*
B[2];
2258 p2 = -e[2]*
B[2] - e[3]*
B[3];
2265 p1 = e[0]*
B[1] - e[1]*
B[0];
2266 p0 = -e[0]*
B[0] - e[1]*
B[1];
2288 if (
len ==
f->blocksize_0)
return f->window[0];
2289 if (
len ==
f->blocksize_1)
return f->window[1];
2301 if (
f->floor_types[
floor] == 0) {
2306 int lx = 0, ly =
finalY[0] *
g->floor1_multiplier;
2307 for (
q=1;
q <
g->values; ++
q) {
2308 j =
g->sorted_order[
q];
2311 int hy =
finalY[
j] *
g->floor1_multiplier;
2312 int hx =
g->Xlist[
j];
2319 for (
j=lx;
j < n2; ++
j)
2328 int i,
n, prev,
next, window_center;
2329 f->channel_buffer_start =
f->channel_buffer_end = 0;
2332 if (
f->eof)
return FALSE;
2343 if (
f->alloc.alloc_buffer)
2344 assert(
f->alloc.alloc_buffer_length_in_bytes ==
f->temp_offset);
2348 if (i >=
f->mode_count)
return FALSE;
2350 m =
f->mode_config + i;
2362 window_center =
n >> 1;
2363 if (
m->blockflag && !prev) {
2364 *p_left_start = (
n -
f->blocksize_0) >> 2;
2365 *p_left_end = (
n +
f->blocksize_0) >> 2;
2368 *p_left_end = window_center;
2370 if (
m->blockflag && !
next) {
2371 *p_right_start = (
n*3 -
f->blocksize_0) >> 2;
2372 *p_right_end = (
n*3 +
f->blocksize_0) >> 2;
2374 *p_right_start = window_center;
2384 int zero_channel[256];
2385 int really_zero_channel[256];
2389 n =
f->blocksize[
m->blockflag];
2390 map = &
f->mapping[
m->mapping];
2395 for (i=0; i <
f->channels; ++i) {
2397 zero_channel[i] =
FALSE;
2399 if (
f->floor_types[
floor] == 0) {
2406 static int range_list[4] = { 256, 128, 86, 64 };
2407 int range = range_list[
g->floor1_multiplier-1];
2412 for (
j=0;
j <
g->partitions; ++
j) {
2413 int pclass =
g->partition_class_list[
j];
2414 int cdim =
g->class_dimensions[pclass];
2415 int cbits =
g->class_subclasses[pclass];
2416 int csub = (1 << cbits)-1;
2419 Codebook *
c =
f->codebooks +
g->class_masterbooks[pclass];
2422 for (k=0; k < cdim; ++k) {
2423 int book =
g->subclass_books[pclass][cval & csub];
2424 cval = cval >> cbits;
2435 step2_flag[0] = step2_flag[1] = 1;
2436 for (
j=2;
j <
g->values; ++
j) {
2437 int low, high, pred, highroom, lowroom,
room,
val;
2438 low =
g->neighbors[
j][0];
2439 high =
g->neighbors[
j][1];
2445 highroom =
range - pred;
2447 if (highroom < lowroom)
2448 room = highroom * 2;
2452 step2_flag[low] = step2_flag[high] = 1;
2455 if (highroom > lowroom)
2471 for (
j=0;
j <
g->values; ++
j) {
2477 zero_channel[i] =
TRUE;
2486 if (
f->alloc.alloc_buffer)
2487 assert(
f->alloc.alloc_buffer_length_in_bytes ==
f->temp_offset);
2490 memcpy(really_zero_channel, zero_channel,
sizeof(really_zero_channel[0]) *
f->channels);
2497 for (i=0; i < map->
submaps; ++i) {
2500 uint8_t do_not_decode[256] = {0};
2502 for (
j=0;
j <
f->channels; ++
j) {
2504 if (zero_channel[
j]) {
2505 do_not_decode[ch] =
TRUE;
2506 residue_buffers[ch] =
NULL;
2508 do_not_decode[ch] =
FALSE;
2509 residue_buffers[ch] =
f->channel_buffers[
j];
2518 if (
f->alloc.alloc_buffer)
2519 assert(
f->alloc.alloc_buffer_length_in_bytes ==
f->temp_offset);
2525 float *
a =
f->channel_buffers[map->
chan[i].
angle ];
2526 for (
j=0;
j < n2; ++
j) {
2544 for (i=0; i <
f->channels; ++i) {
2545 if (really_zero_channel[i]) {
2546 memset(
f->channel_buffers[i], 0,
sizeof(*
f->channel_buffers[i]) * n2);
2553 for (i=0; i <
f->channels; ++i)
2560 if (
f->first_decode) {
2565 f->current_loc = -n2;
2568 f->discard_samples_deferred =
n - right_end;
2569 f->current_loc_valid =
TRUE;
2571 }
else if (
f->discard_samples_deferred) {
2572 left_start +=
f->discard_samples_deferred;
2573 *p_left = left_start;
2574 f->discard_samples_deferred = 0;
2575 }
else if (
f->previous_length == 0 &&
f->current_loc_valid) {
2585 if (
f->last_seg_which ==
f->end_seg_with_known_loc) {
2588 uint32_t current_end =
f->known_loc_for_packet - (
n-right_end);
2595 *
len = current_end -
f->current_loc;
2598 f->current_loc += *
len;
2606 f->current_loc =
f->known_loc_for_packet - (n2-left_start);
2607 f->current_loc_valid =
TRUE;
2609 if (
f->current_loc_valid)
2610 f->current_loc += (right_start - left_start);
2612 if (
f->alloc.alloc_buffer)
2613 assert(
f->alloc.alloc_buffer_length_in_bytes ==
f->temp_offset);
2620 int mode, left_end, right_end;
2637 if (
f->previous_length) {
2638 int i,
j,
n =
f->previous_length;
2640 for (i=0; i <
f->channels; ++i) {
2641 for (
j=0;
j <
n; ++
j)
2642 f->channel_buffers[i][
left+
j] =
2643 f->channel_buffers[i][
left+
j]*
w[
j] +
2644 f->previous_window[i][
j]*
w[
n-1-
j];
2648 prev =
f->previous_length;
2659 for (i=0; i <
f->channels; ++i)
2661 f->previous_window[i][
j] =
f->channel_buffers[i][
right+
j];
2687 int len,i,
j,k, max_submaps = 0;
2688 int longest_floorlist=0;
2717 f->blocksize_0 = 1 << log0;
2718 f->blocksize_1 = 1 << log1;
2735 f->bytes_in_seg = 0;
2752 memset(
f->codebooks, 0,
sizeof(*
f->codebooks) *
f->codebook_count);
2753 for (i=0; i <
f->codebook_count; ++i) {
2755 int ordered, sorted_count;
2778 int current_entry = 0;
2780 while (current_entry < c->entries) {
2781 int limit =
c->entries - current_entry;
2789 for (
j=0;
j <
c->entries; ++
j) {
2800 if (
c->sparse && total >=
c->entries >> 2) {
2802 if (
c->entries > (
int)
f->setup_temp_memory_required)
2803 f->setup_temp_memory_required =
c->entries;
2814 sorted_count = total;
2817 #ifndef STB_VORBIS_NO_HUFFMAN_BINARY_SEARCH 2818 for (
j=0;
j <
c->entries; ++
j)
2824 c->sorted_entries = sorted_count;
2832 if (
c->sorted_entries) {
2840 size =
c->entries + (
sizeof(*
c->codewords) +
sizeof(*
values)) *
c->sorted_entries;
2841 if (
size >
f->setup_temp_memory_required)
2842 f->setup_temp_memory_required =
size;
2850 if (
c->sorted_entries) {
2855 c->sorted_values = (
int *)
setup_malloc(
f,
sizeof(*
c->sorted_values ) * (
c->sorted_entries+1));
2856 if (
c->sorted_values) { ++
c->sorted_values;
c->sorted_values[-1] = -1; }
2864 c->codewords =
NULL;
2871 if (
c->lookup_type > 0) {
2877 if (
c->lookup_type == 1) {
2880 c->lookup_values =
c->entries *
c->dimensions;
2884 for (
j=0;
j < (int)
c->lookup_values; ++
j) {
2890 if (
c->lookup_type == 1) {
2891 int len, sparse =
c->sparse;
2894 if (
c->sorted_entries == 0)
goto skip;
2899 len = sparse ?
c->sorted_entries :
c->entries;
2900 for (
j=0;
j <
len; ++
j) {
2901 int z = sparse ?
c->sorted_values[
j] :
j, div=1;
2902 for (k=0; k <
c->dimensions; ++k) {
2903 int off = (
z / div) %
c->lookup_values;
2904 c->multiplicands[
j*
c->dimensions + k] =
2908 mults[off]*
c->delta_value +
c->minimum_value;
2914 div *=
c->lookup_values;
2923 #ifndef STB_VORBIS_CODEBOOK_FLOATS 2924 memcpy(
c->multiplicands, mults,
sizeof(
c->multiplicands[0]) *
c->lookup_values);
2926 for (
j=0;
j < (int)
c->lookup_values; ++
j)
2927 c->multiplicands[
j] = mults[
j] *
c->delta_value +
c->minimum_value;
2933 #ifdef STB_VORBIS_CODEBOOK_FLOATS 2934 if (
c->lookup_type == 2 &&
c->sequence_p) {
2935 for (
j=1;
j < (int)
c->lookup_values; ++
j)
2936 c->multiplicands[
j] =
c->multiplicands[
j-1];
2946 for (i=0; i <
x; ++i) {
2954 for (i=0; i <
f->floor_count; ++i) {
2957 if (
f->floor_types[i] == 0) {
2958 Floor0 *
g = &
f->floor_config[i].floor0;
2965 for (
j=0;
j <
g->number_of_books; ++
j)
2970 Floor1 *
g = &
f->floor_config[i].floor1;
2973 for (
j=0;
j <
g->partitions; ++
j) {
2975 if (
g->partition_class_list[
j] > max_class)
2976 max_class =
g->partition_class_list[
j];
2978 for (
j=0;
j <= max_class; ++
j) {
2981 if (
g->class_subclasses[
j]) {
2985 for (k=0; k < 1 <<
g->class_subclasses[
j]; ++k) {
2993 g->Xlist[1] = 1 <<
g->rangebits;
2995 for (
j=0;
j <
g->partitions; ++
j) {
2996 int c =
g->partition_class_list[
j];
2997 for (k=0; k <
g->class_dimensions[
c]; ++k) {
3003 for (
j=0;
j <
g->values; ++
j) {
3004 p[
j].x =
g->Xlist[
j];
3008 for (
j=0;
j <
g->values; ++
j)
3011 for (
j=2;
j <
g->values; ++
j)
3016 g->neighbors[
j][0] = low;
3017 g->neighbors[
j][1] = hi;
3020 if (
g->values > longest_floorlist)
3021 longest_floorlist =
g->values;
3028 for (i=0; i <
f->residue_count; ++i) {
3038 for (
j=0;
j <
r->classifications; ++
j) {
3043 residue_cascade[
j] = high_bits*8 + low_bits;
3045 r->residue_books = (short (*)[8])
setup_malloc(
f,
sizeof(
r->residue_books[0]) *
r->classifications);
3046 for (
j=0;
j <
r->classifications; ++
j) {
3047 for (k=0; k < 8; ++k) {
3048 if (residue_cascade[
j] & (1 << k)) {
3052 r->residue_books[
j][k] = -1;
3060 memset(
r->classdata, 0,
sizeof(*
r->classdata) *
f->codebooks[
r->classbook].entries);
3061 for (
j=0;
j <
f->codebooks[
r->classbook].entries; ++
j) {
3062 int classwords =
f->codebooks[
r->classbook].dimensions;
3065 for (k=classwords-1; k >= 0; --k) {
3066 r->classdata[
j][k] = temp %
r->classifications;
3067 temp /=
r->classifications;
3074 for (i=0; i <
f->mapping_count; ++i) {
3083 if (
m->submaps > max_submaps)
3084 max_submaps =
m->submaps;
3087 for (k=0; k <
m->coupling_steps; ++k) {
3095 m->coupling_steps = 0;
3099 if (
m->submaps > 1) {
3100 for (
j=0;
j <
f->channels; ++
j) {
3106 for (
j=0;
j <
f->channels; ++
j)
3109 for (
j=0;
j <
m->submaps; ++
j) {
3120 for (i=0; i <
f->mode_count; ++i) {
3121 Mode *
m =
f->mode_config+i;
3133 f->previous_length = 0;
3135 for (i=0; i <
f->channels; ++i) {
3136 f->channel_buffers[i] = (
float *)
setup_malloc(
f,
sizeof(
float) *
f->blocksize_1);
3137 f->previous_window[i] = (
float *)
setup_malloc(
f,
sizeof(
float) *
f->blocksize_1/2);
3143 f->blocksize[0] =
f->blocksize_0;
3144 f->blocksize[1] =
f->blocksize_1;
3150 uint32_t imdct_mem = (
f->blocksize_1 *
sizeof(float) >> 1);
3152 int i,max_part_read=0;
3153 for (i=0; i <
f->residue_count; ++i) {
3155 int n_read =
r->
end -
r->begin;
3156 int part_read = n_read /
r->part_size;
3157 if (part_read > max_part_read)
3158 max_part_read = part_read;
3160 classify_mem =
f->channels * (
sizeof(
void*) + max_part_read *
sizeof(
uint8_t *));
3162 f->temp_memory_required = classify_mem;
3163 if (imdct_mem >
f->temp_memory_required)
3164 f->temp_memory_required = imdct_mem;
3167 f->first_decode =
TRUE;
3169 if (
f->alloc.alloc_buffer) {
3170 assert(
f->temp_offset ==
f->alloc.alloc_buffer_length_in_bytes);
3172 if (
f->setup_offset +
sizeof(*
f) +
f->temp_memory_required > (
unsigned)
f->temp_offset)
3184 for (i=0; i <
p->residue_count; ++i) {
3187 for (
j=0;
j <
p->codebooks[
r->classbook].entries; ++
j)
3195 for (i=0; i <
p->codebook_count; ++i) {
3208 for (i=0; i <
p->mapping_count; ++i)
3211 for (i=0; i <
p->channels; ++i) {
3216 for (i=0; i < 2; ++i) {
3227 if (
p ==
NULL)
return;
3237 p->alloc.alloc_buffer_length_in_bytes = (
p->alloc.alloc_buffer_length_in_bytes+3) & ~3;
3238 p->temp_offset =
p->alloc.alloc_buffer_length_in_bytes;
3243 p->codebooks =
NULL;
3244 p->page_crc_tests = -1;
3249 if (
f->current_loc_valid)
3250 return f->current_loc;
3281 return (
unsigned int)(
f->stream -
f->stream_start);
3284 #ifndef STB_VORBIS_NO_PULLDATA_API 3291 if (
f->eof)
return 0;
3297 if (retry_loc - 25 >
f->stream_len)
3300 for (i=1; i < 4; ++i)
3303 if (
f->eof)
return 0;
3307 for (i=0; i < 4; ++i)
3310 header[i] =
get8(
f);
3311 if (
f->eof)
return 0;
3312 if (header[4] != 0)
goto invalid;
3313 goal = header[22] + (header[23] << 8) + (header[24]<<16) + (header[25]<<24);
3314 for (i=22; i < 26; ++i)
3317 for (i=0; i < 27; ++i)
3320 for (i=0; i < header[26]; ++i) {
3325 if (
len &&
f->eof)
return 0;
3326 for (i=0; i <
len; ++i)
3341 if (header[5] & 0x04)
3363 #define SAMPLE_unknown 0xffffffff 3380 int num_packet, packet_start;
3389 getn(
f, header, 27);
3390 assert(header[0] ==
'O' && header[1] ==
'g' && header[2] ==
'g' && header[3] ==
'S');
3391 getn(
f, lacing, header[26]);
3395 for (i=0; i < header[26]; ++i)
3399 z->page_end =
z->page_start + 27 + header[26] +
len;
3402 z->last_decoded_sample = header[6] + (header[7] << 8) + (header[8] << 16) + (header[9] << 16);
3404 if (header[5] & 4) {
3418 packet_start = ((header[5] & 1) == 0);
3420 for (i=0; i < header[26]; ++i) {
3423 if (lacing[i] == 0)
goto bail;
3426 if (
n & 1)
goto bail;
3428 b =
ilog(
f->mode_count-1);
3430 if (
n >=
f->mode_count)
goto bail;
3431 packet_type[num_packet++] =
f->mode_config[
n].blockflag;
3432 skip(
f, lacing[i]-1);
3435 packet_start = (lacing[i] < 255);
3451 samples +=
f->blocksize[packet_type[num_packet-1]];
3453 for (i=num_packet-2; i >= 1; --i) {
3456 if (packet_type[i] == 1)
3457 if (packet_type[i+1] == 1)
3460 samples += ((
f->blocksize_1 -
f->blocksize_0) >> 2) + (
f->blocksize_0 >> 1);
3488 z->first_decoded_sample =
z->last_decoded_sample -
samples;
3502 int left_start, left_end, right_start, right_end,
mode,i;
3505 int frames_to_skip, data_to_skip;
3514 frame_start = first_sample;
3536 if (target_sample < frame_start + right_start-
start)
3543 frame_start += right_start -
start;
3556 if (target_sample > frame_start + (left_end - left_start)) {
3562 frames_to_skip =
frame;
3563 data_to_skip = left_end - left_start;
3568 frames_to_skip =
frame - 1;
3569 assert(frames_to_skip >= 0);
3576 for (i=0; i < frames_to_skip; ++i) {
3581 if (data_to_skip >= 0) {
3582 int i,
j,
n =
f->blocksize_0 >> 1;
3583 f->discard_samples_deferred = data_to_skip;
3584 for (i=0; i <
f->channels; ++i)
3585 for (
j=0;
j <
n; ++
j)
3586 f->previous_window[i][
j] = 0;
3587 f->previous_length =
n;
3588 frame_start += data_to_skip;
3590 f->previous_length = 0;
3597 if (target_sample != frame_start) {
3600 assert(target_sample > frame_start);
3601 assert(
f->channel_buffer_start + (
int) (target_sample-frame_start) <
f->channel_buffer_end);
3602 f->channel_buffer_start += (target_sample - frame_start);
3615 if (
f->p_last.page_start == 0) {
3623 if (sample_number >=
f->p_last.last_decoded_sample)
3624 sample_number =
f->p_last.last_decoded_sample-1;
3631 while (
p[0].page_end <
p[1].page_start) {
3638 start_offset =
p[0].page_end;
3639 end_offset =
p[1].after_previous_page_start;
3640 start_sample =
p[0].last_decoded_sample;
3641 end_sample =
p[1].last_decoded_sample;
3650 if (start_offset + 4000 < end_offset)
3654 probe = start_offset + (int)
floor((
float) (end_offset - start_offset) / (end_sample - start_sample) * (sample_number - start_sample));
3658 if (attempts >= 4) {
3659 uint32_t probe2 = start_offset + ((end_offset - start_offset) >> 1);
3662 else if (probe < probe2)
3663 probe = probe + ((probe2 - probe) >> 1);
3665 probe = probe2 + ((probe - probe2) >> 1);
3672 q.after_previous_page_start = probe;
3675 if (
q.page_start ==
p[1].page_start) {
3680 if (sample_number <
q.last_decoded_sample)
3686 if (
p[0].last_decoded_sample <= sample_number && sample_number <
p[1].last_decoded_sample) {
3708 f->previous_length = 0;
3709 f->first_decode =
TRUE;
3716 unsigned int restore_offset, previous_safe;
3717 unsigned int end, last_page_loc;
3720 if (!
f->total_samples) {
3730 if (
f->stream_len >= 65536 &&
f->stream_len-65536 >=
f->first_audio_page_offset)
3731 previous_safe =
f->stream_len - 65536;
3733 previous_safe =
f->first_audio_page_offset;
3742 f->total_samples = 0xffffffff;
3759 previous_safe = last_page_loc+1;
3766 getn(
f, (
unsigned char *)header, 6);
3770 if (lo == 0xffffffff && hi == 0xffffffff) {
3777 f->total_samples = lo;
3779 f->p_last.page_start = last_page_loc;
3780 f->p_last.page_end =
end;
3781 f->p_last.last_decoded_sample = lo;
3783 f->p_last.after_previous_page_start = previous_safe;
3804 f->channel_buffer_start =
f->channel_buffer_end = 0;
3809 for (i=0; i <
f->channels; ++i)
3810 f->outputs[i] =
f->channel_buffers[i] +
left;
3812 f->channel_buffer_start =
left;
3848 int z =
f->channels;
3852 int k =
f->channel_buffer_end -
f->channel_buffer_start;
3854 for (
j=0;
j < k; ++
j) {
3855 for (i=0; i <
z; ++i)
3856 *
buffer++ =
f->channel_buffers[i][
f->channel_buffer_start+
j];
3861 f->channel_buffer_start += k;
3874 int z =
f->channels;
3876 while (
n < num_samples) {
3878 int k =
f->channel_buffer_end -
f->channel_buffer_start;
3879 if (
n+k >= num_samples) k = num_samples -
n;
3881 for (i=0; i <
z; ++i)
3882 memcpy(
buffer[i]+
n,
f->channel_buffers[i]+
f->channel_buffer_start,
sizeof(
float)*k);
3887 f->channel_buffer_start += k;
3888 if (
n == num_samples)
static int error(vorb *f, enum STBVorbisError e)
Definition: stb_vorbis.h:466
int bytes_done
Definition: stb_vorbis.h:353
int mapping_count
Definition: stb_vorbis.h:409
Definition: stb_vorbis.h:292
#define DECODE_VQ(var, f, c)
Definition: stb_vorbis.h:1222
GLsizei samples
Definition: glext.h:7673
int stb_vorbis_get_samples_float_interleaved(stb_vorbis *f, int channels, float *buffer, int num_floats)
Definition: stb_vorbis.h:3843
unsigned int temp_memory_required
Definition: stb_vorbis.h:28
int16_t * finalY[STB_VORBIS_MAX_CHANNELS]
Definition: stb_vorbis.h:423
uint8_t first_decode
Definition: stb_vorbis.h:442
Definition: stb_vorbis.h:21
static u32 bitrev(u32 val)
Definition: card.c:1896
Definition: stb_vorbis.h:1138
int max_frame_size
Definition: stb_vorbis.h:30
int channel_buffer_start
Definition: stb_vorbis.h:458
static INLINE uint32_t crc32_update(uint32_t crc, uint8_t byte)
Definition: stb_vorbis.h:556
uint8_t number_of_books
Definition: stb_vorbis.h:288
static int getn(vorb *z, uint8_t *data, int n)
Definition: stb_vorbis.h:894
uint32_t current_loc
Definition: stb_vorbis.h:425
#define LINE_OP(a, b)
Definition: stb_vorbis.h:1515
int * sorted_values
Definition: stb_vorbis.h:277
Definition: stb_vorbis.h:130
#define STBV_CDECL
Definition: stb_vorbis.h:710
GLenum mode
Definition: glext.h:6857
GLuint GLfloat * val
Definition: glext.h:7847
uint16_t y
Definition: stb_vorbis.h:866
uint8_t floor1_multiplier
Definition: stb_vorbis.h:303
#define INLINE
Definition: retro_inline.h:35
int last_seg_which
Definition: stb_vorbis.h:445
int bytes_left
Definition: stb_vorbis.h:351
#define FAST_HUFFMAN_TABLE_SIZE
Definition: stb_vorbis.h:255
int last_seg
Definition: stb_vorbis.h:444
static void * setup_temp_malloc(vorb *f, int sz)
Definition: stb_vorbis.h:522
uint16_t rate
Definition: stb_vorbis.h:284
Definition: stb_vorbis.h:340
GLboolean GLenum GLenum GLvoid * values
Definition: glext.h:6318
uint8_t angle
Definition: stb_vorbis.h:327
GLuint buffer
Definition: glext.h:6555
uint8_t value_bits
Definition: stb_vorbis.h:264
static void neighbors(uint16_t *x, int n, int *plow, int *phigh)
Definition: stb_vorbis.h:852
Floor * floor_config
Definition: stb_vorbis.h:405
Definition: stb_vorbis.h:314
static int do_floor(vorb *f, Mapping *map, int i, int n, float *target, YTYPE *finalY, uint8_t *step2_flag)
Definition: stb_vorbis.h:2296
void stb_vorbis_seek_start(stb_vorbis *f)
Definition: stb_vorbis.h:3704
Definition: stb_vorbis.h:117
static void vorbis_init(stb_vorbis *p, stb_vorbis_alloc *z)
Definition: stb_vorbis.h:3232
uint8_t bytes_in_seg
Definition: stb_vorbis.h:441
stb_vorbis_codetype * multiplicands
Definition: stb_vorbis.h:269
float * channel_buffers[STB_VORBIS_MAX_CHANNELS]
Definition: stb_vorbis.h:417
GLuint start
Definition: glext.h:6292
int residue_count
Definition: stb_vorbis.h:406
static void flush_packet(vorb *f)
Definition: stb_vorbis.h:1078
static int vorbis_finish_frame(stb_vorbis *f, int len, int left, int right)
Definition: stb_vorbis.h:2625
Definition: stb_vorbis.h:281
Definition: ffmpeg_core.c:151
#define CODEBOOK_ELEMENT_BASE(c)
Definition: stb_vorbis.h:1233
float * B[2]
Definition: stb_vorbis.h:431
Ιστορικό Εικόνα Πληροφορίες Όλοι Οι Χρήστες Χειρίζονται Το Μενού Αριστερό Αναλογικό Αριστερό Αναλογικό Αριστερό Αναλογικό Y Αριστερό Αναλογικό Δεξί Αναλογικό X Δεξί Αναλογικό Δεξί Αναλογικό Y Δεξί Αναλογικό Σκανδάλη Όπλου Όπλο Aux A Όπλο Aux C Όπλο Select Όπλο D pad Κάτω Όπλο D pad Δεξιά Νεκρή Ζώνη Αναλογικού Σύνδεση Όλων Λήξη Χρόνου Σύνδεσης Hide Unbound Core Input Descriptors Κατάλογος Συσκευών Κατάλογος Ποντικιού Duty Cycle Keyboard Gamepad Mapping Enable Κουμπί B(κάτω)" ) MSG_HASH( MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_DOWN
int stb_vorbis_seek_frame(stb_vorbis *f, unsigned int sample_number)
Definition: stb_vorbis.h:3694
GLdouble GLdouble GLdouble r
Definition: glext.h:6406
STBVorbisError
Definition: stb_vorbis.h:109
#define FALSE
Definition: stb_vorbis.h:232
Definition: stb_vorbis.h:10
#define PAGEFLAG_continued_packet
Definition: stb_vorbis.h:934
GLuint res
Definition: glext.h:10520
static float inverse_db_table[256]
Definition: stb_vorbis.h:1438
int packet_bytes
Definition: stb_vorbis.h:448
Definition: stb_vorbis.h:140
GLenum GLsizei len
Definition: glext.h:7389
static int vorbis_decode_initial(vorb *f, int *p_left_start, int *p_left_end, int *p_right_start, int *p_right_end, int *mode)
Definition: stb_vorbis.h:2325
GLenum GLint * range
Definition: glext.h:8206
static int codebook_decode_deinterleave_repeat(vorb *f, Codebook *c, float **outputs, int ch, int *c_inter_p, int *p_inter_p, int len, int total_decode)
Definition: stb_vorbis.h:1297
int blocksize_0
Definition: stb_vorbis.h:400
static void imdct_step3_inner_s_loop_ld654(int n, float *e, int i_off, float *A, int base_n)
Definition: stb_vorbis.h:1937
GLsizeiptr size
Definition: glext.h:6559
GLint limit
Definition: glext.h:11233
GLfloat f
Definition: glext.h:8207
#define PAGEFLAG_first_page
Definition: stb_vorbis.h:935
static int compute_codewords(Codebook *c, uint8_t *len, int n, uint32_t *values)
Definition: stb_vorbis.h:639
set set set set set set set macro pixldst1 abits if abits op else op endif endm macro pixldst2 abits if abits op else op endif endm macro pixldst4 abits if abits op else op endif endm macro pixldst0 abits op endm macro pixldst3 mem_operand op endm macro pixldst30 mem_operand op endm macro pixldst abits if abits elseif abits elseif abits elseif abits elseif abits pixldst0 abits else pixldst0 abits pixldst0 abits pixldst0 abits pixldst0 abits endif elseif abits else pixldst0 abits pixldst0 abits endif elseif abits else error unsupported bpp *numpix else pixst endif endm macro pixld1_s mem_operand if asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl elseif asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl else error unsupported endif endm macro pixld2_s mem_operand if mov asr add asl add asl mov asr sub UNIT_X add asl mov asr add asl add asl mov asr add UNIT_X add asl else pixld1_s mem_operand pixld1_s mem_operand endif endm macro pixld0_s mem_operand if asr adds SRC_WIDTH_FIXED bpl add asl elseif asr adds SRC_WIDTH_FIXED bpl add asl endif endm macro pixld_s_internal mem_operand if mem_operand pixld2_s mem_operand pixdeinterleave basereg elseif mem_operand elseif mem_operand elseif mem_operand elseif mem_operand pixld0_s mem_operand else pixld0_s mem_operand pixld0_s mem_operand pixld0_s mem_operand pixld0_s mem_operand endif elseif mem_operand else pixld0_s mem_operand pixld0_s mem_operand endif elseif mem_operand else error unsupported mem_operand if bpp mem_operand endif endm macro vuzp8 reg2 vuzp d d ®2 endm macro vzip8 reg2 vzip d d ®2 endm macro pixdeinterleave basereg basereg basereg basereg basereg endif endm macro pixinterleave basereg basereg basereg basereg basereg endif endm macro PF boost_increment endif if endif PF tst PF addne PF subne PF cmp ORIG_W if endif if endif if endif PF subge ORIG_W PF subges if endif if endif if endif endif endm macro cache_preload_simple endif if dst_r_bpp pld [DST_R, #(PREFETCH_DISTANCE_SIMPLE *dst_r_bpp/8)] endif if mask_bpp pld endif[MASK, #(PREFETCH_DISTANCE_SIMPLE *mask_bpp/8)] endif endif endm macro fetch_mask_pixblock pixld mask_basereg pixblock_size MASK endm macro ensure_destination_ptr_alignment process_pixblock_tail_head if beq irp local skip1 beq endif SRC MASK if dst_r_bpp DST_R else add endif PF add sub src_basereg pixdeinterleave mask_basereg pixdeinterleave dst_r_basereg process_pixblock_head pixblock_size cache_preload_simple process_pixblock_tail pixinterleave dst_w_basereg irp beq endif process_pixblock_tail_head tst beq irp if pixblock_size chunk_size tst beq pixld_src SRC pixld MASK if DST_R else pixld DST_R endif if
Definition: pixman-arm-neon-asm.h:543
#define NO_CODE
Definition: stb_vorbis.h:602
Definition: stb_vorbis.h:129
Definition: stb_vorbis.h:1136
Definition: stb_vorbis.h:111
static int set_file_offset(stb_vorbis *f, unsigned int loc)
Definition: stb_vorbis.h:909
#define DECODE(var, f, c)
Definition: stb_vorbis.h:1218
GLenum GLenum GLenum GLenum GLenum scale
Definition: glext.h:9939
static int get8_packet(vorb *f)
Definition: stb_vorbis.h:1071
#define next(ls)
Definition: llex.c:32
int memcmp(const void *s1, const void *s2, unsigned int length)
Definition: compat_ctype.c:51
GLdouble s
Definition: glext.h:6390
static void compute_sorted_huffman(Codebook *c, uint8_t *lengths, uint32_t *values)
Definition: stb_vorbis.h:730
Definition: stb_vorbis.h:331
f32 k1
Definition: gx_regdef.h:5098
struct passwd out
Definition: missing_libc_functions.c:51
#define floor(x)
Definition: math.h:25
GLdouble GLdouble z
Definition: glext.h:6514
int dimensions
Definition: stb_vorbis.h:260
uint8_t ** classdata
Definition: stb_vorbis.h:320
uint8_t order
Definition: stb_vorbis.h:283
unsigned char byte
Definition: jsonsax_full.c:47
Definition: stb_vorbis.h:308
Floor1 floor1
Definition: stb_vorbis.h:311
static void skip(vorb *z, int n)
Definition: stb_vorbis.h:902
int channel_buffer_end
Definition: stb_vorbis.h:459
uint32_t page_start
Definition: stb_vorbis.h:359
uint32_t part_size
Definition: stb_vorbis.h:317
uint32_t crc_so_far
Definition: stb_vorbis.h:352
#define exp(a)
Definition: math.h:32
static int codebook_decode_start(vorb *f, Codebook *c)
Definition: stb_vorbis.h:1236
uint16_t * bit_reverse[2]
Definition: stb_vorbis.h:433
GLsizei GLenum GLenum GLuint GLenum GLsizei * lengths
Definition: glext.h:8420
static uint32_t vorbis_find_page(stb_vorbis *f, uint32_t *end, uint32_t *last)
Definition: stb_vorbis.h:3287
Codebook * codebooks
Definition: stb_vorbis.h:402
static void compute_accelerated_huffman(Codebook *c)
Definition: stb_vorbis.h:685
void stb_vorbis_close(stb_vorbis *f)
Definition: stb_vorbis.h:3225
unsigned int temp_memory_required
Definition: stb_vorbis.h:372
static uint8_t ogg_page_header[4]
Definition: stb_vorbis.h:923
uint8_t mux
Definition: stb_vorbis.h:328
GLdouble GLdouble right
Definition: glext.h:11766
uint8_t classbook
Definition: stb_vorbis.h:319
const GLubyte * c
Definition: glext.h:9812
GLboolean GLboolean GLboolean b
Definition: glext.h:6844
#define FAST_HUFFMAN_TABLE_MASK
Definition: stb_vorbis.h:256
Definition: stb_vorbis.h:134
Definition: stb_vorbis.h:116
GLuint GLuint GLsizei count
Definition: glext.h:6292
float4 p3
Definition: remote.h:1
float minimum_value
Definition: stb_vorbis.h:262
int alloc_buffer_length_in_bytes
Definition: stb_vorbis.h:13
uint32_t total_samples
Definition: stb_vorbis.h:414
float delta_value
Definition: stb_vorbis.h:263
float * previous_window[STB_VORBIS_MAX_CHANNELS]
Definition: stb_vorbis.h:420
uint32_t acc
Definition: stb_vorbis.h:446
uint8_t lookup_type
Definition: stb_vorbis.h:265
struct netplay_room * room
Definition: discord.c:49
static int vorbis_validate(uint8_t *data)
Definition: stb_vorbis.h:784
static uint32_t get32(vorb *f)
Definition: stb_vorbis.h:884
Definition: stb_vorbis.h:118
static int vorbis_decode_packet_rest(vorb *f, int *len, Mode *m, int left_start, int left_end, int right_start, int right_end, int *p_left)
Definition: stb_vorbis.h:2380
static stb_vorbis * vorbis_alloc(stb_vorbis *f)
Definition: stb_vorbis.h:3273
uint16_t residue_types[64]
Definition: stb_vorbis.h:407
static void * setup_malloc(vorb *f, int sz)
Definition: stb_vorbis.h:503
uint32_t sample_loc
Definition: stb_vorbis.h:354
ProbedPage p_last
Definition: stb_vorbis.h:385
static int ilog(int32_t n)
Definition: stb_vorbis.h:580
uint32_t * codewords
Definition: stb_vorbis.h:270
static int STBV_CDECL uint32_t_compare(const void *p, const void *q)
Definition: stb_vorbis.h:713
uint8_t classifications
Definition: stb_vorbis.h:318
uint16_t coupling_steps
Definition: stb_vorbis.h:333
#define log(...)
Definition: spirv_cross.cpp:28
Definition: stb_vorbis.h:137
#define NULL
Pointer to 0.
Definition: gctypes.h:65
#define INVALID_BITS
Definition: stb_vorbis.h:1057
set set set set set set set macro pixldst1 abits if abits op else op endif endm macro pixldst2 abits if abits op else op endif endm macro pixldst4 abits if abits op else op endif endm macro pixldst0 abits op endm macro pixldst3 mem_operand op endm macro pixldst30 mem_operand op endm macro pixldst abits if abits elseif abits elseif abits elseif abits elseif abits pixldst0 abits else pixldst0 abits pixldst0 abits pixldst0 abits pixldst0 abits endif elseif abits else pixldst0 abits pixldst0 abits endif elseif abits else error unsupported bpp *numpix else pixst endif endm macro pixld1_s mem_operand if asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl elseif asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl else error unsupported endif endm macro pixld2_s mem_operand if mov asr add asl add asl mov asr sub UNIT_X add asl mov asr add asl add asl mov asr add UNIT_X add asl else pixld1_s mem_operand pixld1_s mem_operand endif endm macro pixld0_s mem_operand if asr adds SRC_WIDTH_FIXED bpl add asl elseif asr adds SRC_WIDTH_FIXED bpl add asl endif endm macro pixld_s_internal mem_operand if mem_operand pixld2_s mem_operand pixdeinterleave basereg elseif mem_operand elseif mem_operand elseif mem_operand elseif mem_operand pixld0_s mem_operand else pixld0_s mem_operand pixld0_s mem_operand pixld0_s mem_operand pixld0_s mem_operand endif elseif mem_operand else pixld0_s mem_operand pixld0_s mem_operand endif elseif mem_operand else error unsupported mem_operand if bpp mem_operand endif endm macro vuzp8 reg2 vuzp d d ®2 endm macro vzip8 reg2 vzip d d ®2 endm macro pixdeinterleave basereg basereg basereg basereg basereg endif endm macro pixinterleave basereg basereg basereg basereg basereg endif endm macro PF boost_increment endif if endif PF tst PF addne PF subne PF cmp ORIG_W if endif if endif if endif PF subge ORIG_W PF subges if endif if endif if endif endif endm macro cache_preload_simple endif if dst_r_bpp pld [DST_R, #(PREFETCH_DISTANCE_SIMPLE *dst_r_bpp/8)] endif if mask_bpp pld if[MASK, #(PREFETCH_DISTANCE_SIMPLE *mask_bpp/8)] endif endif endm macro fetch_mask_pixblock pixld mask_basereg pixblock_size MASK endm macro ensure_destination_ptr_alignment process_pixblock_tail_head if beq irp local skip1(dst_w_bpp<=(lowbit *8)) &&((lowbit *8)<(pixblock_size *dst_w_bpp)) .if lowbit< 16 tst DST_R
Definition: pixman-arm-neon-asm.h:469
static int predict_point(int x, int x0, int x1, int y0, int y1)
Definition: stb_vorbis.h:1427
bool l
Definition: connect_wiiupro.c:37
stb_vorbis_info stb_vorbis_get_info(stb_vorbis *f)
Definition: stb_vorbis.h:3254
stb_vorbis_alloc alloc
Definition: stb_vorbis.h:388
static int include_in_sort(Codebook *c, uint8_t len)
Definition: stb_vorbis.h:720
int channels
Definition: stb_vorbis.h:24
uint8_t submap_floor[15]
Definition: stb_vorbis.h:336
uint8_t blockflag
Definition: stb_vorbis.h:342
uint32_t after_previous_page_start
Definition: stb_vorbis.h:360
int previous_length
Definition: stb_vorbis.h:421
uint16_t floor_types[64]
Definition: stb_vorbis.h:404
Definition: stb_vorbis.h:120
Definition: stb_vorbis.h:365
int stb_vorbis_get_samples_float(stb_vorbis *f, int channels, float **buffer, int num_samples)
Definition: stb_vorbis.h:3870
static int start_page_no_capturepattern(vorb *f)
Definition: stb_vorbis.h:938
uint16_t transformtype
Definition: stb_vorbis.h:345
unsigned int setup_temp_memory_required
Definition: stb_vorbis.h:373
int next_seg
Definition: stb_vorbis.h:443
static int codebook_decode_scalar_raw(vorb *f, Codebook *c)
Definition: stb_vorbis.h:1141
Mapping * mapping
Definition: stb_vorbis.h:410
uint8_t magnitude
Definition: stb_vorbis.h:326
uint32_t end
Definition: stb_vorbis.h:316
static void imdct_step3_inner_s_loop(int n, float *e, int i_off, int k_off, float *A, int a_off, int k0)
Definition: stb_vorbis.h:1854
static int residue_decode(vorb *f, Codebook *book, float *target, int offset, int n, int rtype)
Definition: stb_vorbis.h:1546
static int capture_pattern(vorb *f)
Definition: stb_vorbis.h:925
static void compute_bitreverse(int n, uint16_t *rev)
Definition: stb_vorbis.h:827
static int codebook_decode_step(vorb *f, Codebook *c, float *output, int len, int step)
Definition: stb_vorbis.h:1280
uint8_t sequence_p
Definition: stb_vorbis.h:266
int stb_vorbis_get_sample_offset(stb_vorbis *f)
Definition: stb_vorbis.h:3247
static float float32_unpack(uint32_t x)
Definition: stb_vorbis.h:609
GLfloat v0
Definition: glext.h:6701
signed short int16_t
Definition: stdint.h:122
int blocksize_1
Definition: stb_vorbis.h:400
int stb_vorbis_get_frame_float(stb_vorbis *f, int *channels, float ***output)
Definition: stb_vorbis.h:3798
float4 p1
Definition: notHere.h:1
unsigned int sample_rate
Definition: stb_vorbis.h:23
GLfixed y1
Definition: glsym_gl.h:1051
uint32_t last_decoded_sample
Definition: stb_vorbis.h:362
static void imdct_step3_iter0_loop(int n, float *e, int i_off, int k_off, float *A)
Definition: stb_vorbis.h:1759
unsigned int sample_rate
Definition: stb_vorbis.h:368
uint32_t stream_len
Definition: stb_vorbis.h:379
Definition: stb_vorbis.h:138
uint8_t sparse
Definition: stb_vorbis.h:267
f32 k2
Definition: gx_regdef.h:5099
GLint GLint GLint GLint GLint GLint y
Definition: glext.h:6295
MappingChannel * chan
Definition: stb_vorbis.h:334
static INLINE void iter_54(float *z)
Definition: stb_vorbis.h:1905
int temp_offset
Definition: stb_vorbis.h:390
GLint GLint GLint GLint GLint x
Definition: glext.h:6295
uint32_t * sorted_codewords
Definition: stb_vorbis.h:276
uint8_t * codeword_lengths
Definition: stb_vorbis.h:261
GLuint in
Definition: glext.h:10523
uint8_t amplitude_bits
Definition: stb_vorbis.h:286
GLdouble GLdouble GLdouble GLdouble q
Definition: glext.h:6414
int stb_vorbis_get_error(stb_vorbis *f)
Definition: stb_vorbis.h:3266
static INLINE void prep_huffman(vorb *f)
Definition: stb_vorbis.h:1119
stb_vorbis * stb_vorbis_open_memory(const unsigned char *data, int len, int *error, stb_vorbis_alloc *alloc_buffer)
Definition: stb_vorbis.h:3820
#define A(i)
Definition: ecp_curves.c:884
f32 a2
Definition: gx_regdef.h:5096
int page_crc_tests
Definition: stb_vorbis.h:455
int current_loc_valid
Definition: stb_vorbis.h:426
Definition: inftrees.h:27
#define M_PI
Definition: stb_vorbis.h:598
GLfloat GLfloat p
Definition: glext.h:9809
Definition: stb_vorbis.h:139
static int vorbis_decode_packet(vorb *f, int *len, int *p_left, int *p_right)
Definition: stb_vorbis.h:2618
int valid_bits
Definition: stb_vorbis.h:447
int stb_vorbis_seek(stb_vorbis *f, unsigned int sample_number)
Definition: stb_vorbis.h:3699
signed int int32_t
Definition: stdint.h:123
static int STBV_CDECL point_compare(const void *p, const void *q)
Definition: stb_vorbis.h:869
float * A[2]
Definition: stb_vorbis.h:431
uint32_t samples_output
Definition: stb_vorbis.h:452
#define IS_PUSH_MODE(f)
Definition: stb_vorbis.h:462
Residue * residue_config
Definition: stb_vorbis.h:408
int discard_samples_deferred
Definition: stb_vorbis.h:451
#define temp_alloc(f, size)
Definition: stb_vorbis.h:484
Definition: stb_vorbis.h:115
GLfixed GLfixed GLfixed y2
Definition: glsym_gl.h:1051
Definition: stb_vorbis.h:123
uint32_t goal_crc
Definition: stb_vorbis.h:350
static void compute_window(int n, float *window)
Definition: stb_vorbis.h:820
#define sin(x)
Definition: math.h:23
static void inverse_mdct(float *buffer, int n, vorb *f, int blocktype)
Definition: stb_vorbis.h:1981
static INLINE void draw_line(float *output, int x0, int y0, int x1, int y1, int n)
Definition: stb_vorbis.h:1517
int entries
Definition: stb_vorbis.h:260
uint8_t * stream_start
Definition: stb_vorbis.h:376
uint32_t lookup_values
Definition: stb_vorbis.h:268
#define STB_VORBIS_FAST_HUFFMAN_SHORT
Definition: stb_vorbis.h:200
uint16_t bark_map_size
Definition: stb_vorbis.h:285
uint8_t page_flag
Definition: stb_vorbis.h:440
#define pow(x, y)
Definition: math.h:22
float stb_vorbis_codetype
Definition: stb_vorbis.h:236
#define CRC32_POLY
Definition: stb_vorbis.h:542
static void imdct_step3_inner_r_loop(int lim, float *e, int d0, int k_off, float *A, int k1)
Definition: stb_vorbis.h:1804
const GLdouble * v
Definition: glext.h:6391
static void vorbis_pump_first_frame(stb_vorbis *f)
Definition: stb_vorbis.h:2677
unsigned int stb_vorbis_stream_length_in_samples(stb_vorbis *f)
Definition: stb_vorbis.h:3714
static unsigned int bit_reverse(unsigned int n)
Definition: stb_vorbis.h:562
static void setup_free(vorb *f, void *p)
Definition: stb_vorbis.h:516
static int get8_packet_raw(vorb *f)
Definition: stb_vorbis.h:1059
int values
Definition: stb_vorbis.h:305
static int init_blocksize(vorb *f, int b, int n)
Definition: stb_vorbis.h:835
std::string output
Definition: Config.FromFile.cpp:44
uint16_t x
Definition: stb_vorbis.h:866
static int maybe_start_packet(vorb *f)
Definition: stb_vorbis.h:1014
Definition: stb_vorbis.h:133
static int vorbis_seek_base(stb_vorbis *f, unsigned int sample_number, int fine)
Definition: stb_vorbis.h:3609
unsigned int stb_vorbis_get_file_offset(stb_vorbis *f)
Definition: stb_vorbis.h:3279
GLboolean GLboolean g
Definition: glext.h:6844
static int vorbis_seek_frame_from_page(stb_vorbis *f, uint32_t page_start, uint32_t first_sample, uint32_t target_sample, int fine)
Definition: stb_vorbis.h:3500
uint8_t * stream_end
Definition: stb_vorbis.h:377
Definition: stb_vorbis.h:135
uint8_t rangebits
Definition: stb_vorbis.h:304
GLint j
Definition: nx_glsym.h:307
Definition: stb_vorbis.h:258
float4 p2
Definition: local.h:1
#define STB_VORBIS_FAST_HUFFMAN_LENGTH
Definition: stb_vorbis.h:185
Definition: stb_vorbis.h:357
static int next_segment(vorb *f)
Definition: stb_vorbis.h:1035
uint32_t serial
Definition: stb_vorbis.h:436
int mode_count
Definition: stb_vorbis.h:411
#define PAGEFLAG_last_page
Definition: stb_vorbis.h:936
int floor_count
Definition: stb_vorbis.h:403
uint8_t amplitude_offset
Definition: stb_vorbis.h:287
#define SAMPLE_unknown
Definition: stb_vorbis.h:3363
static int codebook_decode(vorb *f, Codebook *c, float *output, int len)
Definition: stb_vorbis.h:1256
uint8_t submap_residue[15]
Definition: stb_vorbis.h:337
Definition: stb_vorbis.h:1137
#define cos(x)
Definition: math.h:21
uint32_t first_audio_page_offset
Definition: stb_vorbis.h:383
def sign()
Definition: build.py:201
uint32_t known_loc_for_packet
Definition: stb_vorbis.h:450
static int start_decoder(vorb *f)
Definition: stb_vorbis.h:2684
int16_t YTYPE
Definition: stb_vorbis.h:2294
Definition: ffmpeg_fft.c:36
ProbedPage p_first
Definition: stb_vorbis.h:385
static uint32_t get_bits(vorb *f, int n)
Definition: stb_vorbis.h:1085
#define temp_alloc_restore(f, p)
Definition: stb_vorbis.h:486
#define STB_VORBIS_CODEBOOK_FLOATS
Definition: stb_vorbis.h:222
Definition: stb_vorbis.h:136
f32 k0
Definition: gx_regdef.h:5097
int segment_count
Definition: stb_vorbis.h:438
float stb_vorbis_stream_length_in_seconds(stb_vorbis *f)
Definition: stb_vorbis.h:3791
static uint8_t get8(vorb *z)
Definition: stb_vorbis.h:878
static void add_entry(Codebook *c, uint32_t huff_code, int symbol, int count, int len, uint32_t *values)
Definition: stb_vorbis.h:628
uint8_t * stream
Definition: stb_vorbis.h:375
int codebook_count
Definition: stb_vorbis.h:401
Definition: stb_vorbis.h:324
static void decode_residue(vorb *f, float *residue_buffers[], int ch, int n, int rn, uint8_t *do_not_decode)
Definition: stb_vorbis.h:1565
Definition: stb_vorbis.h:119
#define EOP
Definition: stb_vorbis.h:1056
Definition: stb_vorbis.h:864
GLuint GLuint end
Definition: glext.h:6292
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:6742
int blocksize[2]
Definition: stb_vorbis.h:399
#define temp_alloc_save(f)
Definition: stb_vorbis.h:485
uint8_t segments[255]
Definition: stb_vorbis.h:439
Definition: stb_vorbis.h:348
float * C[2]
Definition: stb_vorbis.h:431
int setup_offset
Definition: stb_vorbis.h:389
static void vorbis_deinit(stb_vorbis *p)
Definition: stb_vorbis.h:3181
Definition: video4linux2.c:51
#define TRUE
Definition: stb_vorbis.h:231
GLintptr offset
Definition: glext.h:6560
unsigned int setup_memory_required
Definition: stb_vorbis.h:26
GLint left
Definition: glext.h:8393
unsigned int setup_temp_memory_required
Definition: stb_vorbis.h:27
uint8_t partitions
Definition: stb_vorbis.h:294
uint8_t mapping
Definition: stb_vorbis.h:343
GLfloat GLfloat v1
Definition: glext.h:6702
#define temp_block_array(f, count, size)
Definition: stb_vorbis.h:488
static int vorbis_analyze_page(stb_vorbis *f, ProbedPage *z)
Definition: stb_vorbis.h:3376
static uint32_t stb_vorbis_crc_table[256]
Definition: stb_vorbis.h:544
static float square(float x)
Definition: stb_vorbis.h:571
Definition: stb_vorbis.h:113
int last_page
Definition: stb_vorbis.h:437
unsigned short uint16_t
Definition: stdint.h:125
void * memset(void *b, int c, size_t len)
Definition: string.c:7
static float * get_window(vorb *f, int len)
Definition: stb_vorbis.h:2285
static int codebook_decode_scalar(vorb *f, Codebook *c)
Definition: stb_vorbis.h:1199
static int codebook_decode_deinterleave_repeat_2(vorb *f, Codebook *c, float **outputs, int *c_inter_p, int *p_inter_p, int len, int total_decode)
Definition: stb_vorbis.h:1349
uint8_t submaps
Definition: stb_vorbis.h:335
float * outputs[STB_VORBIS_MAX_CHANNELS]
Definition: stb_vorbis.h:418
GLdouble n
Definition: glext.h:8396
unsigned char uint8_t
Definition: stdint.h:124
unsigned int uint32_t
Definition: stdint.h:126
static void setup_temp_free(vorb *f, void *p, int sz)
Definition: stb_vorbis.h:533
const GLfloat * m
Definition: glext.h:11755
static void crc32_init(void)
Definition: stb_vorbis.h:545
static int start_packet(vorb *f)
Definition: stb_vorbis.h:999
Floor0 floor0
Definition: stb_vorbis.h:310
char * alloc_buffer
Definition: stb_vorbis.h:12
uint16_t windowtype
Definition: stb_vorbis.h:344
enum STBVorbisError error
Definition: stb_vorbis.h:394
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6844
uint32_t first_decoded_sample
Definition: stb_vorbis.h:361
#define STB_VORBIS_MAX_CHANNELS
Definition: stb_vorbis.h:175
int eof
Definition: stb_vorbis.h:393
static void compute_twiddle_factors(int n, float *A, float *B, float *C)
Definition: stb_vorbis.h:803
int sorted_entries
Definition: stb_vorbis.h:278
int channels
Definition: stb_vorbis.h:369
Mode mode_config[64]
Definition: stb_vorbis.h:412
static int start_page(vorb *f)
Definition: stb_vorbis.h:993
static int lookup1_values(int entries, int dim)
Definition: stb_vorbis.h:792
unsigned int setup_memory_required
Definition: stb_vorbis.h:371
#define CODEBOOK_ELEMENT_FAST(c, off)
Definition: stb_vorbis.h:1232
void * memcpy(void *dst, const void *src, size_t len)
Definition: string.c:26
static void * make_block_array(void *mem, int count, int size)
Definition: stb_vorbis.h:491
Definition: stb_vorbis.h:122
set set set set set set set macro pixldst1 abits if abits op else op endif endm macro pixldst2 abits if abits op else op endif endm macro pixldst4 abits if abits op else op endif endm macro pixldst0 abits op endm macro pixldst3 mem_operand op endm macro pixldst30 mem_operand op endm macro pixldst abits if abits elseif abits elseif abits elseif abits elseif abits pixldst0 abits else pixldst0 abits pixldst0 abits pixldst0 abits pixldst0 abits endif elseif abits else pixldst0 abits pixldst0 abits endif elseif abits else error unsupported bpp *numpix else pixst endif endm macro pixld1_s mem_operand if asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl elseif asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl else error unsupported endif endm macro pixld2_s mem_operand if mov asr add asl add asl mov asr sub UNIT_X add asl mov asr add asl add asl mov asr add UNIT_X add asl else pixld1_s mem_operand pixld1_s mem_operand endif endm macro pixld0_s mem_operand if asr adds SRC_WIDTH_FIXED bpl add asl elseif asr adds SRC_WIDTH_FIXED bpl add asl endif endm macro pixld_s_internal mem_operand if mem_operand pixld2_s mem_operand pixdeinterleave basereg elseif mem_operand elseif mem_operand elseif mem_operand elseif mem_operand pixld0_s mem_operand else pixld0_s mem_operand pixld0_s mem_operand pixld0_s mem_operand pixld0_s mem_operand endif elseif mem_operand else pixld0_s mem_operand pixld0_s mem_operand endif elseif mem_operand else error unsupported mem_operand if bpp mem_operand endif endm macro vuzp8 reg2 vuzp d d ®2 endm macro vzip8 reg2 vzip d d ®2 endm macro pixdeinterleave basereg basereg basereg basereg basereg endif endm macro pixinterleave basereg basereg basereg basereg basereg endif endm macro PF boost_increment endif if endif PF tst PF addne PF subne PF cmp ORIG_W if endif if endif if endif PF subge ORIG_W PF subges if endif if endif if endif endif endm macro cache_preload_simple endif if dst_r_bpp pld [DST_R, #(PREFETCH_DISTANCE_SIMPLE *dst_r_bpp/8)] endif if mask_bpp pld init[MASK, #(PREFETCH_DISTANCE_SIMPLE *mask_bpp/8)] endif endif endm macro fetch_mask_pixblock pixld mask_basereg pixblock_size MASK endm macro ensure_destination_ptr_alignment process_pixblock_tail_head if beq irp local skip1 beq endif SRC MASK if dst_r_bpp DST_R else add endif PF add sub src_basereg pixdeinterleave mask_basereg pixdeinterleave dst_r_basereg process_pixblock_head pixblock_size cache_preload_simple process_pixblock_tail pixinterleave dst_w_basereg irp beq endif process_pixblock_tail_head tst beq irp if pixblock_size chunk_size tst beq pixld_src SRC pixld MASK if DST_R else pixld DST_R endif if src_basereg pixdeinterleave mask_basereg pixdeinterleave dst_r_basereg process_pixblock_head if pixblock_size cache_preload_simple endif process_pixblock_tail pixinterleave dst_w_basereg irp if pixblock_size chunk_size tst beq if DST_W else pixst DST_W else mov ORIG_W endif add lsl if lsl endif if lsl endif lsl endif lsl endif lsl endif subs mov DST_W if regs_shortage str endif bge start_of_loop_label endm macro generate_composite_function
Definition: pixman-arm-neon-asm.h:600
int end_seg_with_known_loc
Definition: stb_vorbis.h:449
uint8_t push_mode
Definition: stb_vorbis.h:381