mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
[libpng17] Make symbol prefixing work with the ARM neon optimizations. Also
allow pngpriv.h to be included for preprocessor definitions only, so it can be used in non-C/C++ files.
This commit is contained in:
parent
2969375aa6
commit
9124f3e29a
7
ANNOUNCE
7
ANNOUNCE
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
Libpng 1.7.0alpha10 - January 21, 2013
|
Libpng 1.7.0alpha10 - February 4, 2013
|
||||||
|
|
||||||
This is not intended to be a public release. It will be replaced
|
This is not intended to be a public release. It will be replaced
|
||||||
within a few weeks by a public version or by another test version.
|
within a few weeks by a public version or by another test version.
|
||||||
@ -116,7 +116,10 @@ Version 1.7.0alpha08 [January 17, 2013]
|
|||||||
Version 1.7.0alpha09 [January 21, 2013]
|
Version 1.7.0alpha09 [January 21, 2013]
|
||||||
Pulled changes to multi-chunk handling from libpng-1.6.0beta40.
|
Pulled changes to multi-chunk handling from libpng-1.6.0beta40.
|
||||||
|
|
||||||
Version 1.7.0alpha10 [January 21, 2013]
|
Version 1.7.0alpha10 [February 4, 2013]
|
||||||
|
Make symbol prefixing work with the ARM neon optimizations. Also
|
||||||
|
allow pngpriv.h to be included for preprocessor definitions only, so
|
||||||
|
it can be used in non-C/C++ files.
|
||||||
|
|
||||||
===========================================================================
|
===========================================================================
|
||||||
NOTICE November 17, 2012:
|
NOTICE November 17, 2012:
|
||||||
|
5
CHANGES
5
CHANGES
@ -4402,7 +4402,10 @@ Version 1.7.0alpha08 [January 17, 2013]
|
|||||||
Version 1.7.0alpha09 [January 21, 2013]
|
Version 1.7.0alpha09 [January 21, 2013]
|
||||||
Pulled changes to multi-chunk handling from libpng-1.6.0beta40.
|
Pulled changes to multi-chunk handling from libpng-1.6.0beta40.
|
||||||
|
|
||||||
Version 1.7.0alpha10 [January 21, 2013]
|
Version 1.7.0alpha10 [February 4, 2013]
|
||||||
|
Make symbol prefixing work with the ARM neon optimizations. Also
|
||||||
|
allow pngpriv.h to be included for preprocessor definitions only, so
|
||||||
|
it can be used in non-C/C++ files.
|
||||||
|
|
||||||
===========================================================================
|
===========================================================================
|
||||||
NOTICE November 17, 2012:
|
NOTICE November 17, 2012:
|
||||||
|
@ -10,6 +10,10 @@
|
|||||||
* and license in png.h
|
* and license in png.h
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* This is required to get the symbol renames, which are #defines */
|
||||||
|
#define PNG_VERSION_INFO_ONLY
|
||||||
|
#include "../pngpriv.h"
|
||||||
|
|
||||||
#ifdef __arm__
|
#ifdef __arm__
|
||||||
#if defined(__linux__) && defined(__ELF__)
|
#if defined(__linux__) && defined(__ELF__)
|
||||||
.section .note.GNU-stack,"",%progbits /* mark stack as non-executable */
|
.section .note.GNU-stack,"",%progbits /* mark stack as non-executable */
|
||||||
|
2
pngmem.c
2
pngmem.c
@ -154,10 +154,12 @@ png_realloc_array,(png_structrp png_ptr, png_const_voidp old_array,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef PNG_READ_SUPPORTED
|
||||||
/* The potential overflow case. Set the cache counter so libpng will
|
/* The potential overflow case. Set the cache counter so libpng will
|
||||||
* not make any more attempts
|
* not make any more attempts
|
||||||
*/
|
*/
|
||||||
png_ptr->user_chunk_cache_max = 2;
|
png_ptr->user_chunk_cache_max = 2;
|
||||||
|
#endif
|
||||||
|
|
||||||
return NULL; /* error */
|
return NULL; /* error */
|
||||||
}
|
}
|
||||||
|
64
pngpriv.h
64
pngpriv.h
@ -39,9 +39,11 @@
|
|||||||
*/
|
*/
|
||||||
#define _POSIX_SOURCE 1 /* Just the POSIX 1003.1 and C89 APIs */
|
#define _POSIX_SOURCE 1 /* Just the POSIX 1003.1 and C89 APIs */
|
||||||
|
|
||||||
|
#ifndef PNG_VERSION_INFO_ONLY
|
||||||
/* Standard library headers not required by png.h: */
|
/* Standard library headers not required by png.h: */
|
||||||
#include <stdlib.h>
|
# include <stdlib.h>
|
||||||
#include <string.h>
|
# include <string.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#define PNGLIB_BUILD /*libpng is being built, not used*/
|
#define PNGLIB_BUILD /*libpng is being built, not used*/
|
||||||
|
|
||||||
@ -177,10 +179,12 @@
|
|||||||
# ifndef PNG_FLOATING_POINT_SUPPORTED
|
# ifndef PNG_FLOATING_POINT_SUPPORTED
|
||||||
# define PNG_FP_EXPORT(ordinal, type, name, args)\
|
# define PNG_FP_EXPORT(ordinal, type, name, args)\
|
||||||
PNG_INTERNAL_FUNCTION(type, name, args, PNG_EMPTY);
|
PNG_INTERNAL_FUNCTION(type, name, args, PNG_EMPTY);
|
||||||
typedef struct png_incomplete png_double;
|
# ifndef PNG_VERSION_INFO_ONLY
|
||||||
typedef png_double* png_doublep;
|
typedef struct png_incomplete png_double;
|
||||||
typedef const png_double* png_const_doublep;
|
typedef png_double* png_doublep;
|
||||||
typedef png_double** png_doublepp;
|
typedef const png_double* png_const_doublep;
|
||||||
|
typedef png_double** png_doublepp;
|
||||||
|
# endif
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
#ifndef PNG_FIXED_EXPORT
|
#ifndef PNG_FIXED_EXPORT
|
||||||
@ -191,8 +195,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "png.h"
|
#include "png.h"
|
||||||
#include "pngstruct.h"
|
|
||||||
#include "pnginfo.h"
|
|
||||||
|
|
||||||
/* pngconf.h does not set PNG_DLL_EXPORT unless it is required, so: */
|
/* pngconf.h does not set PNG_DLL_EXPORT unless it is required, so: */
|
||||||
#ifndef PNG_DLL_EXPORT
|
#ifndef PNG_DLL_EXPORT
|
||||||
@ -238,11 +240,6 @@
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* This is used for 16 bit gamma tables -- only the top level pointers are
|
|
||||||
* const; this could be changed:
|
|
||||||
*/
|
|
||||||
typedef const png_uint_16p * png_const_uint_16pp;
|
|
||||||
|
|
||||||
/* Moved to pngpriv.h at libpng-1.5.0 */
|
/* Moved to pngpriv.h at libpng-1.5.0 */
|
||||||
/* NOTE: some of these may have been used in external applications as
|
/* NOTE: some of these may have been used in external applications as
|
||||||
* these definitions were exposed in pngconf.h prior to 1.5.
|
* these definitions were exposed in pngconf.h prior to 1.5.
|
||||||
@ -536,19 +533,7 @@ typedef const png_uint_16p * png_const_uint_16pp;
|
|||||||
abs((int)((c1).green) - (int)((c2).green)) + \
|
abs((int)((c1).green) - (int)((c2).green)) + \
|
||||||
abs((int)((c1).blue) - (int)((c2).blue)))
|
abs((int)((c1).blue) - (int)((c2).blue)))
|
||||||
|
|
||||||
/* Added to libpng-1.5.7: sRGB conversion tables */
|
/* See below for the definitions of the tables used in these macros */
|
||||||
#if defined PNG_SIMPLIFIED_READ_SUPPORTED ||\
|
|
||||||
defined PNG_SIMPLIFIED_WRITE_SUPPORTED
|
|
||||||
#ifdef PNG_SIMPLIFIED_READ_SUPPORTED
|
|
||||||
PNG_INTERNAL_DATA(const png_uint_16, png_sRGB_table, [256]);
|
|
||||||
/* Convert from an sRGB encoded value 0..255 to a 16-bit linear value,
|
|
||||||
* 0..65535. This table gives the closest 16-bit answers (no errors).
|
|
||||||
*/
|
|
||||||
#endif
|
|
||||||
|
|
||||||
PNG_INTERNAL_DATA(const png_uint_16, png_sRGB_base, [512]);
|
|
||||||
PNG_INTERNAL_DATA(const png_byte, png_sRGB_delta, [512]);
|
|
||||||
|
|
||||||
#define PNG_sRGB_FROM_LINEAR(linear) ((png_byte)((png_sRGB_base[(linear)>>15] +\
|
#define PNG_sRGB_FROM_LINEAR(linear) ((png_byte)((png_sRGB_base[(linear)>>15] +\
|
||||||
((((linear)&0x7fff)*png_sRGB_delta[(linear)>>15])>>12)) >> 8))
|
((((linear)&0x7fff)*png_sRGB_delta[(linear)>>15])>>12)) >> 8))
|
||||||
/* Given a value 'linear' in the range 0..255*65535 calculate the 8-bit sRGB
|
/* Given a value 'linear' in the range 0..255*65535 calculate the 8-bit sRGB
|
||||||
@ -690,6 +675,32 @@ PNG_INTERNAL_DATA(const png_byte, png_sRGB_delta, [512]);
|
|||||||
#define PNG_GAMMA_MAC_INVERSE 65909
|
#define PNG_GAMMA_MAC_INVERSE 65909
|
||||||
#define PNG_GAMMA_sRGB_INVERSE 45455
|
#define PNG_GAMMA_sRGB_INVERSE 45455
|
||||||
|
|
||||||
|
/* Almost everything below is C specific; the #defines above can be used in
|
||||||
|
* non-C code (so long as it is C-preprocessed) the rest of this stuff cannot.
|
||||||
|
*/
|
||||||
|
#ifndef PNG_VERSION_INFO_ONLY
|
||||||
|
|
||||||
|
#include "pngstruct.h"
|
||||||
|
#include "pnginfo.h"
|
||||||
|
|
||||||
|
/* This is used for 16 bit gamma tables -- only the top level pointers are
|
||||||
|
* const; this could be changed:
|
||||||
|
*/
|
||||||
|
typedef const png_uint_16p * png_const_uint_16pp;
|
||||||
|
|
||||||
|
/* Added to libpng-1.5.7: sRGB conversion tables */
|
||||||
|
#if defined PNG_SIMPLIFIED_READ_SUPPORTED ||\
|
||||||
|
defined PNG_SIMPLIFIED_WRITE_SUPPORTED
|
||||||
|
#ifdef PNG_SIMPLIFIED_READ_SUPPORTED
|
||||||
|
PNG_INTERNAL_DATA(const png_uint_16, png_sRGB_table, [256]);
|
||||||
|
/* Convert from an sRGB encoded value 0..255 to a 16-bit linear value,
|
||||||
|
* 0..65535. This table gives the closest 16-bit answers (no errors).
|
||||||
|
*/
|
||||||
|
#endif
|
||||||
|
|
||||||
|
PNG_INTERNAL_DATA(const png_uint_16, png_sRGB_base, [512]);
|
||||||
|
PNG_INTERNAL_DATA(const png_byte, png_sRGB_delta, [512]);
|
||||||
|
|
||||||
|
|
||||||
/* Inhibit C++ name-mangling for libpng functions but not for system calls. */
|
/* Inhibit C++ name-mangling for libpng functions but not for system calls. */
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
@ -1890,4 +1901,5 @@ PNG_INTERNAL_FUNCTION(void, PNG_FILTER_OPTIMIZATIONS, (png_structrp png_ptr,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#endif /* PNG_VERSION_INFO_ONLY */
|
||||||
#endif /* PNGPRIV_H */
|
#endif /* PNGPRIV_H */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user