Merge branch 'working'
This commit is contained in:
commit
b577583fb9
52
stb_image.h
52
stb_image.h
@ -86,18 +86,18 @@ RECENT REVISION HISTORY:
|
|||||||
|
|
||||||
Bug & warning fixes
|
Bug & warning fixes
|
||||||
Marc LeBlanc David Woo Guillaume George Martins Mozeiko
|
Marc LeBlanc David Woo Guillaume George Martins Mozeiko
|
||||||
Christpher Lloyd Martin Golini Jerry Jansson Joseph Thomson
|
Christpher Lloyd Jerry Jansson Joseph Thomson Phil Jordan
|
||||||
Dave Moore Roy Eltham Hayaki Saito Phil Jordan
|
Dave Moore Roy Eltham Hayaki Saito Nathan Reed
|
||||||
Won Chun Luke Graham Johan Duparc Nathan Reed
|
Won Chun Luke Graham Johan Duparc Nick Verigakis
|
||||||
the Horde3D community Thomas Ruf Ronny Chevalier Nick Verigakis
|
the Horde3D community Thomas Ruf Ronny Chevalier Baldur Karlsson
|
||||||
Janez Zemva John Bartholomew Michal Cichon github:svdijk
|
Janez Zemva John Bartholomew Michal Cichon github:rlyeh
|
||||||
Jonathan Blow Ken Hamada Tero Hanninen Baldur Karlsson
|
Jonathan Blow Ken Hamada Tero Hanninen github:romigrou
|
||||||
Laurent Gomila Cort Stratton Sergio Gonzalez github:romigrou
|
Laurent Gomila Cort Stratton Sergio Gonzalez github:svdijk
|
||||||
Aruelien Pocheville Thibault Reuille Cass Everitt Matthew Gregan
|
Aruelien Pocheville Thibault Reuille Cass Everitt github:snagar
|
||||||
Ryamond Barbiero Paul Du Bois Engin Manap github:snagar
|
Ryamond Barbiero Paul Du Bois Engin Manap github:Zelex
|
||||||
Michaelangel007@github Oriol Ferrer Mesia Dale Weiler github:Zelex
|
Michaelangel007@github Philipp Wiesemann Dale Weiler github:grim210
|
||||||
Philipp Wiesemann Josh Tobin github:rlyeh github:grim210@github
|
Oriol Ferrer Mesia Josh Tobin Matthew Gregan github:sammyhw
|
||||||
Blazej Dariusz Roszkowski github:sammyhw Gregory Mullen
|
Blazej Dariusz Roszkowski Gregory Mullen github:phprus
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -3769,7 +3769,7 @@ stbi_inline static int stbi__bit_reverse(int v, int bits)
|
|||||||
return stbi__bitreverse16(v) >> (16-bits);
|
return stbi__bitreverse16(v) >> (16-bits);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int stbi__zbuild_huffman(stbi__zhuffman *z, stbi_uc *sizelist, int num)
|
static int stbi__zbuild_huffman(stbi__zhuffman *z, const stbi_uc *sizelist, int num)
|
||||||
{
|
{
|
||||||
int i,k=0;
|
int i,k=0;
|
||||||
int code, next_code[16], sizes[17];
|
int code, next_code[16], sizes[17];
|
||||||
@ -4059,9 +4059,24 @@ static int stbi__parse_zlib_header(stbi__zbuf *a)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// @TODO: should statically initialize these for optimal thread safety
|
static const stbi_uc stbi__zdefault_length[288] =
|
||||||
static stbi_uc stbi__zdefault_length[288], stbi__zdefault_distance[32];
|
{
|
||||||
static void stbi__init_zdefaults(void)
|
8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
|
||||||
|
8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
|
||||||
|
8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
|
||||||
|
8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
|
||||||
|
8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
|
||||||
|
9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
|
||||||
|
9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
|
||||||
|
9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
|
||||||
|
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, 7,7,7,7,7,7,7,7,8,8,8,8,8,8,8,8
|
||||||
|
};
|
||||||
|
static const stbi_uc stbi__zdefault_distance[32] =
|
||||||
|
{
|
||||||
|
5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5
|
||||||
|
};
|
||||||
|
/*
|
||||||
|
Init algorithm:
|
||||||
{
|
{
|
||||||
int i; // use <= to match clearly with spec
|
int i; // use <= to match clearly with spec
|
||||||
for (i=0; i <= 143; ++i) stbi__zdefault_length[i] = 8;
|
for (i=0; i <= 143; ++i) stbi__zdefault_length[i] = 8;
|
||||||
@ -4071,6 +4086,7 @@ static void stbi__init_zdefaults(void)
|
|||||||
|
|
||||||
for (i=0; i <= 31; ++i) stbi__zdefault_distance[i] = 5;
|
for (i=0; i <= 31; ++i) stbi__zdefault_distance[i] = 5;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
static int stbi__parse_zlib(stbi__zbuf *a, int parse_header)
|
static int stbi__parse_zlib(stbi__zbuf *a, int parse_header)
|
||||||
{
|
{
|
||||||
@ -4089,7 +4105,6 @@ static int stbi__parse_zlib(stbi__zbuf *a, int parse_header)
|
|||||||
} else {
|
} else {
|
||||||
if (type == 1) {
|
if (type == 1) {
|
||||||
// use fixed code lengths
|
// use fixed code lengths
|
||||||
if (!stbi__zdefault_distance[31]) stbi__init_zdefaults();
|
|
||||||
if (!stbi__zbuild_huffman(&a->z_length , stbi__zdefault_length , 288)) return 0;
|
if (!stbi__zbuild_huffman(&a->z_length , stbi__zdefault_length , 288)) return 0;
|
||||||
if (!stbi__zbuild_huffman(&a->z_distance, stbi__zdefault_distance, 32)) return 0;
|
if (!stbi__zbuild_huffman(&a->z_distance, stbi__zdefault_distance, 32)) return 0;
|
||||||
} else {
|
} else {
|
||||||
@ -6953,7 +6968,8 @@ STBIDEF int stbi_info_from_callbacks(stbi_io_callbacks const *c, void *user, int
|
|||||||
revision history:
|
revision history:
|
||||||
2.15 (2017-03-18) fix png-1,2,4 bug; now all Imagenet JPGs decode;
|
2.15 (2017-03-18) fix png-1,2,4 bug; now all Imagenet JPGs decode;
|
||||||
warning fixes; disable run-time SSE detection on gcc;
|
warning fixes; disable run-time SSE detection on gcc;
|
||||||
uniform handling of optional "return" values
|
uniform handling of optional "return" values;
|
||||||
|
thread-safe initialization of zlib tables
|
||||||
2.14 (2017-03-03) remove deprecated STBI_JPEG_OLD; fixes for Imagenet JPGs
|
2.14 (2017-03-03) remove deprecated STBI_JPEG_OLD; fixes for Imagenet JPGs
|
||||||
2.13 (2016-11-29) add 16-bit API, only supported for PNG right now
|
2.13 (2016-11-29) add 16-bit API, only supported for PNG right now
|
||||||
2.12 (2016-04-02) fix typo in 2.11 PSD fix that caused crashes
|
2.12 (2016-04-02) fix typo in 2.11 PSD fix that caused crashes
|
||||||
|
Loading…
Reference in New Issue
Block a user