mirror of
https://github.com/godotengine/godot.git
synced 2025-04-13 01:00:35 +08:00
Merge pull request #99996 from akien-mga/libpng-1.6.44
libpng: Update to upstream 1.6.44
This commit is contained in:
commit
72839d0085
@ -48,7 +48,6 @@ if env["builtin_libpng"]:
|
||||
neon_sources = []
|
||||
neon_sources.append(env_neon.Object(thirdparty_dir + "arm/arm_init.c"))
|
||||
neon_sources.append(env_neon.Object(thirdparty_dir + "arm/filter_neon_intrinsics.c"))
|
||||
neon_sources.append(env_neon.Object(thirdparty_dir + "arm/filter_neon.S"))
|
||||
neon_sources.append(env_neon.Object(thirdparty_dir + "arm/palette_neon_intrinsics.c"))
|
||||
thirdparty_obj += neon_sources
|
||||
elif env["arch"].startswith("x86"):
|
||||
|
4
thirdparty/README.md
vendored
4
thirdparty/README.md
vendored
@ -511,14 +511,14 @@ Files extracted from upstream source:
|
||||
## libpng
|
||||
|
||||
- Upstream: http://libpng.org/pub/png/libpng.html
|
||||
- Version: 1.6.43 (ed217e3e601d8e462f7fd1e04bed43ac42212429, 2024)
|
||||
- Version: 1.6.44 (f5e92d76973a7a53f517579bc95d61483bf108c0, 2024)
|
||||
- License: libpng/zlib
|
||||
|
||||
Files extracted from upstream source:
|
||||
|
||||
- All `.c` and `.h` files of the main directory, apart from `example.c` and
|
||||
`pngtest.c`
|
||||
- `arm/`, `intel/` and `powerpc/` folders
|
||||
- `arm/` (minus `filter_neon.S`), `intel/` and `powerpc/` (minus `.editorconfig`) folders
|
||||
- `scripts/pnglibconf.h.prebuilt` as `pnglibconf.h`
|
||||
- `LICENSE`
|
||||
|
||||
|
253
thirdparty/libpng/arm/filter_neon.S
vendored
253
thirdparty/libpng/arm/filter_neon.S
vendored
@ -1,253 +0,0 @@
|
||||
|
||||
/* filter_neon.S - NEON optimised filter functions
|
||||
*
|
||||
* Copyright (c) 2018 Cosmin Truta
|
||||
* Copyright (c) 2014,2017 Glenn Randers-Pehrson
|
||||
* Written by Mans Rullgard, 2011.
|
||||
*
|
||||
* This code is released under the libpng license.
|
||||
* For conditions of distribution and use, see the disclaimer
|
||||
* and license in png.h
|
||||
*/
|
||||
|
||||
/* This is required to get the symbol renames, which are #defines, and the
|
||||
* definitions (or not) of PNG_ARM_NEON_OPT and PNG_ARM_NEON_IMPLEMENTATION.
|
||||
*/
|
||||
#define PNG_VERSION_INFO_ONLY
|
||||
#include "../pngpriv.h"
|
||||
|
||||
#if (defined(__linux__) || defined(__FreeBSD__)) && defined(__ELF__)
|
||||
.section .note.GNU-stack,"",%progbits /* mark stack as non-executable */
|
||||
#endif
|
||||
|
||||
#ifdef PNG_READ_SUPPORTED
|
||||
|
||||
/* Assembler NEON support - only works for 32-bit ARM (i.e. it does not work for
|
||||
* ARM64). The code in arm/filter_neon_intrinsics.c supports ARM64, however it
|
||||
* only works if -mfpu=neon is specified on the GCC command line. See pngpriv.h
|
||||
* for the logic which sets PNG_USE_ARM_NEON_ASM:
|
||||
*/
|
||||
#if PNG_ARM_NEON_IMPLEMENTATION == 2 /* hand-coded assembler */
|
||||
|
||||
#if PNG_ARM_NEON_OPT > 0
|
||||
|
||||
#ifdef __ELF__
|
||||
# define ELF
|
||||
#else
|
||||
# define ELF @
|
||||
#endif
|
||||
|
||||
.arch armv7-a
|
||||
.fpu neon
|
||||
|
||||
.macro func name, export=0
|
||||
.macro endfunc
|
||||
ELF .size \name, . - \name
|
||||
.endfunc
|
||||
.purgem endfunc
|
||||
.endm
|
||||
.text
|
||||
|
||||
/* Explicitly specifying alignment here because some versions of
|
||||
* GAS don't align code correctly. This is harmless in correctly
|
||||
* written versions of GAS.
|
||||
*/
|
||||
.align 2
|
||||
|
||||
.if \export
|
||||
.global \name
|
||||
.endif
|
||||
ELF .type \name, STT_FUNC
|
||||
.func \name
|
||||
\name:
|
||||
.endm
|
||||
|
||||
func png_read_filter_row_sub4_neon, export=1
|
||||
ldr r3, [r0, #4] @ rowbytes
|
||||
vmov.i8 d3, #0
|
||||
1:
|
||||
vld4.32 {d4[],d5[],d6[],d7[]}, [r1,:128]
|
||||
vadd.u8 d0, d3, d4
|
||||
vadd.u8 d1, d0, d5
|
||||
vadd.u8 d2, d1, d6
|
||||
vadd.u8 d3, d2, d7
|
||||
vst4.32 {d0[0],d1[0],d2[0],d3[0]},[r1,:128]!
|
||||
subs r3, r3, #16
|
||||
bgt 1b
|
||||
|
||||
bx lr
|
||||
endfunc
|
||||
|
||||
func png_read_filter_row_sub3_neon, export=1
|
||||
ldr r3, [r0, #4] @ rowbytes
|
||||
vmov.i8 d3, #0
|
||||
mov r0, r1
|
||||
mov r2, #3
|
||||
mov r12, #12
|
||||
vld1.8 {q11}, [r0], r12
|
||||
1:
|
||||
vext.8 d5, d22, d23, #3
|
||||
vadd.u8 d0, d3, d22
|
||||
vext.8 d6, d22, d23, #6
|
||||
vadd.u8 d1, d0, d5
|
||||
vext.8 d7, d23, d23, #1
|
||||
vld1.8 {q11}, [r0], r12
|
||||
vst1.32 {d0[0]}, [r1,:32], r2
|
||||
vadd.u8 d2, d1, d6
|
||||
vst1.32 {d1[0]}, [r1], r2
|
||||
vadd.u8 d3, d2, d7
|
||||
vst1.32 {d2[0]}, [r1], r2
|
||||
vst1.32 {d3[0]}, [r1], r2
|
||||
subs r3, r3, #12
|
||||
bgt 1b
|
||||
|
||||
bx lr
|
||||
endfunc
|
||||
|
||||
func png_read_filter_row_up_neon, export=1
|
||||
ldr r3, [r0, #4] @ rowbytes
|
||||
1:
|
||||
vld1.8 {q0}, [r1,:128]
|
||||
vld1.8 {q1}, [r2,:128]!
|
||||
vadd.u8 q0, q0, q1
|
||||
vst1.8 {q0}, [r1,:128]!
|
||||
subs r3, r3, #16
|
||||
bgt 1b
|
||||
|
||||
bx lr
|
||||
endfunc
|
||||
|
||||
func png_read_filter_row_avg4_neon, export=1
|
||||
ldr r12, [r0, #4] @ rowbytes
|
||||
vmov.i8 d3, #0
|
||||
1:
|
||||
vld4.32 {d4[],d5[],d6[],d7[]}, [r1,:128]
|
||||
vld4.32 {d16[],d17[],d18[],d19[]},[r2,:128]!
|
||||
vhadd.u8 d0, d3, d16
|
||||
vadd.u8 d0, d0, d4
|
||||
vhadd.u8 d1, d0, d17
|
||||
vadd.u8 d1, d1, d5
|
||||
vhadd.u8 d2, d1, d18
|
||||
vadd.u8 d2, d2, d6
|
||||
vhadd.u8 d3, d2, d19
|
||||
vadd.u8 d3, d3, d7
|
||||
vst4.32 {d0[0],d1[0],d2[0],d3[0]},[r1,:128]!
|
||||
subs r12, r12, #16
|
||||
bgt 1b
|
||||
|
||||
bx lr
|
||||
endfunc
|
||||
|
||||
func png_read_filter_row_avg3_neon, export=1
|
||||
push {r4,lr}
|
||||
ldr r12, [r0, #4] @ rowbytes
|
||||
vmov.i8 d3, #0
|
||||
mov r0, r1
|
||||
mov r4, #3
|
||||
mov lr, #12
|
||||
vld1.8 {q11}, [r0], lr
|
||||
1:
|
||||
vld1.8 {q10}, [r2], lr
|
||||
vext.8 d5, d22, d23, #3
|
||||
vhadd.u8 d0, d3, d20
|
||||
vext.8 d17, d20, d21, #3
|
||||
vadd.u8 d0, d0, d22
|
||||
vext.8 d6, d22, d23, #6
|
||||
vhadd.u8 d1, d0, d17
|
||||
vext.8 d18, d20, d21, #6
|
||||
vadd.u8 d1, d1, d5
|
||||
vext.8 d7, d23, d23, #1
|
||||
vld1.8 {q11}, [r0], lr
|
||||
vst1.32 {d0[0]}, [r1,:32], r4
|
||||
vhadd.u8 d2, d1, d18
|
||||
vst1.32 {d1[0]}, [r1], r4
|
||||
vext.8 d19, d21, d21, #1
|
||||
vadd.u8 d2, d2, d6
|
||||
vhadd.u8 d3, d2, d19
|
||||
vst1.32 {d2[0]}, [r1], r4
|
||||
vadd.u8 d3, d3, d7
|
||||
vst1.32 {d3[0]}, [r1], r4
|
||||
subs r12, r12, #12
|
||||
bgt 1b
|
||||
|
||||
pop {r4,pc}
|
||||
endfunc
|
||||
|
||||
.macro paeth rx, ra, rb, rc
|
||||
vaddl.u8 q12, \ra, \rb @ a + b
|
||||
vaddl.u8 q15, \rc, \rc @ 2*c
|
||||
vabdl.u8 q13, \rb, \rc @ pa
|
||||
vabdl.u8 q14, \ra, \rc @ pb
|
||||
vabd.u16 q15, q12, q15 @ pc
|
||||
vcle.u16 q12, q13, q14 @ pa <= pb
|
||||
vcle.u16 q13, q13, q15 @ pa <= pc
|
||||
vcle.u16 q14, q14, q15 @ pb <= pc
|
||||
vand q12, q12, q13 @ pa <= pb && pa <= pc
|
||||
vmovn.u16 d28, q14
|
||||
vmovn.u16 \rx, q12
|
||||
vbsl d28, \rb, \rc
|
||||
vbsl \rx, \ra, d28
|
||||
.endm
|
||||
|
||||
func png_read_filter_row_paeth4_neon, export=1
|
||||
ldr r12, [r0, #4] @ rowbytes
|
||||
vmov.i8 d3, #0
|
||||
vmov.i8 d20, #0
|
||||
1:
|
||||
vld4.32 {d4[],d5[],d6[],d7[]}, [r1,:128]
|
||||
vld4.32 {d16[],d17[],d18[],d19[]},[r2,:128]!
|
||||
paeth d0, d3, d16, d20
|
||||
vadd.u8 d0, d0, d4
|
||||
paeth d1, d0, d17, d16
|
||||
vadd.u8 d1, d1, d5
|
||||
paeth d2, d1, d18, d17
|
||||
vadd.u8 d2, d2, d6
|
||||
paeth d3, d2, d19, d18
|
||||
vmov d20, d19
|
||||
vadd.u8 d3, d3, d7
|
||||
vst4.32 {d0[0],d1[0],d2[0],d3[0]},[r1,:128]!
|
||||
subs r12, r12, #16
|
||||
bgt 1b
|
||||
|
||||
bx lr
|
||||
endfunc
|
||||
|
||||
func png_read_filter_row_paeth3_neon, export=1
|
||||
push {r4,lr}
|
||||
ldr r12, [r0, #4] @ rowbytes
|
||||
vmov.i8 d3, #0
|
||||
vmov.i8 d4, #0
|
||||
mov r0, r1
|
||||
mov r4, #3
|
||||
mov lr, #12
|
||||
vld1.8 {q11}, [r0], lr
|
||||
1:
|
||||
vld1.8 {q10}, [r2], lr
|
||||
paeth d0, d3, d20, d4
|
||||
vext.8 d5, d22, d23, #3
|
||||
vadd.u8 d0, d0, d22
|
||||
vext.8 d17, d20, d21, #3
|
||||
paeth d1, d0, d17, d20
|
||||
vst1.32 {d0[0]}, [r1,:32], r4
|
||||
vext.8 d6, d22, d23, #6
|
||||
vadd.u8 d1, d1, d5
|
||||
vext.8 d18, d20, d21, #6
|
||||
paeth d2, d1, d18, d17
|
||||
vext.8 d7, d23, d23, #1
|
||||
vld1.8 {q11}, [r0], lr
|
||||
vst1.32 {d1[0]}, [r1], r4
|
||||
vadd.u8 d2, d2, d6
|
||||
vext.8 d19, d21, d21, #1
|
||||
paeth d3, d2, d19, d18
|
||||
vst1.32 {d2[0]}, [r1], r4
|
||||
vmov d4, d19
|
||||
vadd.u8 d3, d3, d7
|
||||
vst1.32 {d3[0]}, [r1], r4
|
||||
subs r12, r12, #12
|
||||
bgt 1b
|
||||
|
||||
pop {r4,pc}
|
||||
endfunc
|
||||
#endif /* PNG_ARM_NEON_OPT > 0 */
|
||||
#endif /* PNG_ARM_NEON_IMPLEMENTATION == 2 (assembler) */
|
||||
#endif /* READ */
|
101
thirdparty/libpng/png.c
vendored
101
thirdparty/libpng/png.c
vendored
@ -14,7 +14,7 @@
|
||||
#include "pngpriv.h"
|
||||
|
||||
/* Generate a compiler error if there is an old png.h in the search path. */
|
||||
typedef png_libpng_version_1_6_43 Your_png_h_is_not_version_1_6_43;
|
||||
typedef png_libpng_version_1_6_44 Your_png_h_is_not_version_1_6_44;
|
||||
|
||||
/* Tells libpng that we have already handled the first "num_bytes" bytes
|
||||
* of the PNG file signature. If the PNG data is embedded into another
|
||||
@ -794,7 +794,7 @@ png_get_copyright(png_const_structrp png_ptr)
|
||||
return PNG_STRING_COPYRIGHT
|
||||
#else
|
||||
return PNG_STRING_NEWLINE \
|
||||
"libpng version 1.6.43" PNG_STRING_NEWLINE \
|
||||
"libpng version 1.6.44" PNG_STRING_NEWLINE \
|
||||
"Copyright (c) 2018-2024 Cosmin Truta" PNG_STRING_NEWLINE \
|
||||
"Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson" \
|
||||
PNG_STRING_NEWLINE \
|
||||
@ -1203,6 +1203,24 @@ png_colorspace_sync(png_const_structrp png_ptr, png_inforp info_ptr)
|
||||
#endif /* GAMMA */
|
||||
|
||||
#ifdef PNG_COLORSPACE_SUPPORTED
|
||||
static int
|
||||
png_safe_add(png_int_32 *addend0_and_result, png_int_32 addend1,
|
||||
png_int_32 addend2) {
|
||||
/* Safely add three integers. Returns 0 on success, 1 on overlow.
|
||||
* IMPLEMENTATION NOTE: ANSI requires signed overflow not to occur, therefore
|
||||
* relying on addition of two positive values producing a negative one is not
|
||||
* safe.
|
||||
*/
|
||||
int addend0 = *addend0_and_result;
|
||||
if (0x7fffffff - addend0 < addend1)
|
||||
return 1;
|
||||
addend0 += addend1;
|
||||
if (0x7fffffff - addend1 < addend2)
|
||||
return 1;
|
||||
*addend0_and_result = addend0 + addend2;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Added at libpng-1.5.5 to support read and write of true CIEXYZ values for
|
||||
* cHRM, as opposed to using chromaticities. These internal APIs return
|
||||
* non-zero on a parameter error. The X, Y and Z values are required to be
|
||||
@ -1211,38 +1229,52 @@ png_colorspace_sync(png_const_structrp png_ptr, png_inforp info_ptr)
|
||||
static int
|
||||
png_xy_from_XYZ(png_xy *xy, const png_XYZ *XYZ)
|
||||
{
|
||||
png_int_32 d, dwhite, whiteX, whiteY;
|
||||
png_int_32 d, dred, dgreen, dwhite, whiteX, whiteY;
|
||||
|
||||
d = XYZ->red_X + XYZ->red_Y + XYZ->red_Z;
|
||||
/* 'd' in each of the blocks below is just X+Y+Z for each component,
|
||||
* x, y and z are X,Y,Z/(X+Y+Z).
|
||||
*/
|
||||
d = XYZ->red_X;
|
||||
if (png_safe_add(&d, XYZ->red_Y, XYZ->red_Z))
|
||||
return 1;
|
||||
if (png_muldiv(&xy->redx, XYZ->red_X, PNG_FP_1, d) == 0)
|
||||
return 1;
|
||||
if (png_muldiv(&xy->redy, XYZ->red_Y, PNG_FP_1, d) == 0)
|
||||
return 1;
|
||||
dwhite = d;
|
||||
dred = d;
|
||||
whiteX = XYZ->red_X;
|
||||
whiteY = XYZ->red_Y;
|
||||
|
||||
d = XYZ->green_X + XYZ->green_Y + XYZ->green_Z;
|
||||
d = XYZ->green_X;
|
||||
if (png_safe_add(&d, XYZ->green_Y, XYZ->green_Z))
|
||||
return 1;
|
||||
if (png_muldiv(&xy->greenx, XYZ->green_X, PNG_FP_1, d) == 0)
|
||||
return 1;
|
||||
if (png_muldiv(&xy->greeny, XYZ->green_Y, PNG_FP_1, d) == 0)
|
||||
return 1;
|
||||
dwhite += d;
|
||||
dgreen = d;
|
||||
whiteX += XYZ->green_X;
|
||||
whiteY += XYZ->green_Y;
|
||||
|
||||
d = XYZ->blue_X + XYZ->blue_Y + XYZ->blue_Z;
|
||||
d = XYZ->blue_X;
|
||||
if (png_safe_add(&d, XYZ->blue_Y, XYZ->blue_Z))
|
||||
return 1;
|
||||
if (png_muldiv(&xy->bluex, XYZ->blue_X, PNG_FP_1, d) == 0)
|
||||
return 1;
|
||||
if (png_muldiv(&xy->bluey, XYZ->blue_Y, PNG_FP_1, d) == 0)
|
||||
return 1;
|
||||
dwhite += d;
|
||||
whiteX += XYZ->blue_X;
|
||||
whiteY += XYZ->blue_Y;
|
||||
|
||||
/* The reference white is simply the sum of the end-point (X,Y,Z) vectors,
|
||||
* thus:
|
||||
/* The reference white is simply the sum of the end-point (X,Y,Z) vectors so
|
||||
* the fillowing calculates (X+Y+Z) of the reference white (media white,
|
||||
* encoding white) itself:
|
||||
*/
|
||||
if (png_safe_add(&d, dred, dgreen))
|
||||
return 1;
|
||||
|
||||
dwhite = d;
|
||||
|
||||
if (png_muldiv(&xy->whitex, whiteX, PNG_FP_1, dwhite) == 0)
|
||||
return 1;
|
||||
if (png_muldiv(&xy->whitey, whiteY, PNG_FP_1, dwhite) == 0)
|
||||
@ -1257,20 +1289,6 @@ png_XYZ_from_xy(png_XYZ *XYZ, const png_xy *xy)
|
||||
png_fixed_point red_inverse, green_inverse, blue_scale;
|
||||
png_fixed_point left, right, denominator;
|
||||
|
||||
/* Check xy and, implicitly, z. Note that wide gamut color spaces typically
|
||||
* have end points with 0 tristimulus values (these are impossible end
|
||||
* points, but they are used to cover the possible colors). We check
|
||||
* xy->whitey against 5, not 0, to avoid a possible integer overflow.
|
||||
*/
|
||||
if (xy->redx < 0 || xy->redx > PNG_FP_1) return 1;
|
||||
if (xy->redy < 0 || xy->redy > PNG_FP_1-xy->redx) return 1;
|
||||
if (xy->greenx < 0 || xy->greenx > PNG_FP_1) return 1;
|
||||
if (xy->greeny < 0 || xy->greeny > PNG_FP_1-xy->greenx) return 1;
|
||||
if (xy->bluex < 0 || xy->bluex > PNG_FP_1) return 1;
|
||||
if (xy->bluey < 0 || xy->bluey > PNG_FP_1-xy->bluex) return 1;
|
||||
if (xy->whitex < 0 || xy->whitex > PNG_FP_1) return 1;
|
||||
if (xy->whitey < 5 || xy->whitey > PNG_FP_1-xy->whitex) return 1;
|
||||
|
||||
/* The reverse calculation is more difficult because the original tristimulus
|
||||
* value had 9 independent values (red,green,blue)x(X,Y,Z) however only 8
|
||||
* derived values were recorded in the cHRM chunk;
|
||||
@ -1451,16 +1469,16 @@ png_XYZ_from_xy(png_XYZ *XYZ, const png_xy *xy)
|
||||
* value of 2 indicates an internal error to the caller.
|
||||
*/
|
||||
if (png_muldiv(&left, xy->greenx-xy->bluex, xy->redy - xy->bluey, 7) == 0)
|
||||
return 2;
|
||||
return 1;
|
||||
if (png_muldiv(&right, xy->greeny-xy->bluey, xy->redx - xy->bluex, 7) == 0)
|
||||
return 2;
|
||||
return 1;
|
||||
denominator = left - right;
|
||||
|
||||
/* Now find the red numerator. */
|
||||
if (png_muldiv(&left, xy->greenx-xy->bluex, xy->whitey-xy->bluey, 7) == 0)
|
||||
return 2;
|
||||
return 1;
|
||||
if (png_muldiv(&right, xy->greeny-xy->bluey, xy->whitex-xy->bluex, 7) == 0)
|
||||
return 2;
|
||||
return 1;
|
||||
|
||||
/* Overflow is possible here and it indicates an extreme set of PNG cHRM
|
||||
* chunk values. This calculation actually returns the reciprocal of the
|
||||
@ -1473,9 +1491,9 @@ png_XYZ_from_xy(png_XYZ *XYZ, const png_xy *xy)
|
||||
|
||||
/* Similarly for green_inverse: */
|
||||
if (png_muldiv(&left, xy->redy-xy->bluey, xy->whitex-xy->bluex, 7) == 0)
|
||||
return 2;
|
||||
return 1;
|
||||
if (png_muldiv(&right, xy->redx-xy->bluex, xy->whitey-xy->bluey, 7) == 0)
|
||||
return 2;
|
||||
return 1;
|
||||
if (png_muldiv(&green_inverse, xy->whitey, denominator, left-right) == 0 ||
|
||||
green_inverse <= xy->whitey)
|
||||
return 1;
|
||||
@ -1520,25 +1538,14 @@ png_XYZ_from_xy(png_XYZ *XYZ, const png_xy *xy)
|
||||
static int
|
||||
png_XYZ_normalize(png_XYZ *XYZ)
|
||||
{
|
||||
png_int_32 Y;
|
||||
png_int_32 Y, Ytemp;
|
||||
|
||||
if (XYZ->red_Y < 0 || XYZ->green_Y < 0 || XYZ->blue_Y < 0 ||
|
||||
XYZ->red_X < 0 || XYZ->green_X < 0 || XYZ->blue_X < 0 ||
|
||||
XYZ->red_Z < 0 || XYZ->green_Z < 0 || XYZ->blue_Z < 0)
|
||||
/* Normalize by scaling so the sum of the end-point Y values is PNG_FP_1. */
|
||||
Ytemp = XYZ->red_Y;
|
||||
if (png_safe_add(&Ytemp, XYZ->green_Y, XYZ->blue_Y))
|
||||
return 1;
|
||||
|
||||
/* Normalize by scaling so the sum of the end-point Y values is PNG_FP_1.
|
||||
* IMPLEMENTATION NOTE: ANSI requires signed overflow not to occur, therefore
|
||||
* relying on addition of two positive values producing a negative one is not
|
||||
* safe.
|
||||
*/
|
||||
Y = XYZ->red_Y;
|
||||
if (0x7fffffff - Y < XYZ->green_X)
|
||||
return 1;
|
||||
Y += XYZ->green_Y;
|
||||
if (0x7fffffff - Y < XYZ->blue_X)
|
||||
return 1;
|
||||
Y += XYZ->blue_Y;
|
||||
Y = Ytemp;
|
||||
|
||||
if (Y != PNG_FP_1)
|
||||
{
|
||||
|
26
thirdparty/libpng/png.h
vendored
26
thirdparty/libpng/png.h
vendored
@ -1,7 +1,7 @@
|
||||
|
||||
/* png.h - header file for PNG reference library
|
||||
*
|
||||
* libpng version 1.6.43
|
||||
* libpng version 1.6.44
|
||||
*
|
||||
* Copyright (c) 2018-2024 Cosmin Truta
|
||||
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
|
||||
@ -15,7 +15,7 @@
|
||||
* libpng versions 0.89, June 1996, through 0.96, May 1997: Andreas Dilger
|
||||
* libpng versions 0.97, January 1998, through 1.6.35, July 2018:
|
||||
* Glenn Randers-Pehrson
|
||||
* libpng versions 1.6.36, December 2018, through 1.6.43, February 2024:
|
||||
* libpng versions 1.6.36, December 2018, through 1.6.44, September 2024:
|
||||
* Cosmin Truta
|
||||
* See also "Contributing Authors", below.
|
||||
*/
|
||||
@ -239,7 +239,7 @@
|
||||
* ...
|
||||
* 1.5.30 15 10530 15.so.15.30[.0]
|
||||
* ...
|
||||
* 1.6.43 16 10643 16.so.16.43[.0]
|
||||
* 1.6.44 16 10644 16.so.16.44[.0]
|
||||
*
|
||||
* Henceforth the source version will match the shared-library major and
|
||||
* minor numbers; the shared-library major version number will be used for
|
||||
@ -275,7 +275,7 @@
|
||||
*/
|
||||
|
||||
/* Version information for png.h - this should match the version in png.c */
|
||||
#define PNG_LIBPNG_VER_STRING "1.6.43"
|
||||
#define PNG_LIBPNG_VER_STRING "1.6.44"
|
||||
#define PNG_HEADER_VERSION_STRING " libpng version " PNG_LIBPNG_VER_STRING "\n"
|
||||
|
||||
/* The versions of shared library builds should stay in sync, going forward */
|
||||
@ -286,18 +286,18 @@
|
||||
/* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */
|
||||
#define PNG_LIBPNG_VER_MAJOR 1
|
||||
#define PNG_LIBPNG_VER_MINOR 6
|
||||
#define PNG_LIBPNG_VER_RELEASE 43
|
||||
#define PNG_LIBPNG_VER_RELEASE 44
|
||||
|
||||
/* This should be zero for a public release, or non-zero for a
|
||||
* development version.
|
||||
*/
|
||||
#define PNG_LIBPNG_VER_BUILD 0
|
||||
#define PNG_LIBPNG_VER_BUILD 0
|
||||
|
||||
/* Release Status */
|
||||
#define PNG_LIBPNG_BUILD_ALPHA 1
|
||||
#define PNG_LIBPNG_BUILD_BETA 2
|
||||
#define PNG_LIBPNG_BUILD_RC 3
|
||||
#define PNG_LIBPNG_BUILD_STABLE 4
|
||||
#define PNG_LIBPNG_BUILD_ALPHA 1
|
||||
#define PNG_LIBPNG_BUILD_BETA 2
|
||||
#define PNG_LIBPNG_BUILD_RC 3
|
||||
#define PNG_LIBPNG_BUILD_STABLE 4
|
||||
#define PNG_LIBPNG_BUILD_RELEASE_STATUS_MASK 7
|
||||
|
||||
/* Release-Specific Flags */
|
||||
@ -317,7 +317,7 @@
|
||||
* From version 1.0.1 it is:
|
||||
* XXYYZZ, where XX=major, YY=minor, ZZ=release
|
||||
*/
|
||||
#define PNG_LIBPNG_VER 10643 /* 1.6.43 */
|
||||
#define PNG_LIBPNG_VER 10644 /* 1.6.44 */
|
||||
|
||||
/* Library configuration: these options cannot be changed after
|
||||
* the library has been built.
|
||||
@ -427,7 +427,7 @@ extern "C" {
|
||||
/* This triggers a compiler error in png.c, if png.c and png.h
|
||||
* do not agree upon the version number.
|
||||
*/
|
||||
typedef char* png_libpng_version_1_6_43;
|
||||
typedef char* png_libpng_version_1_6_44;
|
||||
|
||||
/* Basic control structions. Read libpng-manual.txt or libpng.3 for more info.
|
||||
*
|
||||
@ -824,7 +824,7 @@ typedef PNG_CALLBACK(int, *png_user_chunk_ptr, (png_structp,
|
||||
* your compiler. This may be very difficult - try using a different compiler
|
||||
* to build the library!
|
||||
*/
|
||||
PNG_FUNCTION(void, (PNGCAPI *png_longjmp_ptr), PNGARG((jmp_buf, int)), typedef);
|
||||
PNG_FUNCTION(void, (PNGCAPI *png_longjmp_ptr), (jmp_buf, int), typedef);
|
||||
#endif
|
||||
|
||||
/* Transform masks for the high-level interface */
|
||||
|
8
thirdparty/libpng/pngconf.h
vendored
8
thirdparty/libpng/pngconf.h
vendored
@ -1,7 +1,7 @@
|
||||
|
||||
/* pngconf.h - machine-configurable file for libpng
|
||||
*
|
||||
* libpng version 1.6.43
|
||||
* libpng version 1.6.44
|
||||
*
|
||||
* Copyright (c) 2018-2024 Cosmin Truta
|
||||
* Copyright (c) 1998-2002,2004,2006-2016,2018 Glenn Randers-Pehrson
|
||||
@ -88,7 +88,7 @@
|
||||
|
||||
/* The PNGARG macro was used in versions of libpng prior to 1.6.0 to protect
|
||||
* against legacy (pre ISOC90) compilers that did not understand function
|
||||
* prototypes. It is not required for modern C compilers.
|
||||
* prototypes. [Deprecated.]
|
||||
*/
|
||||
#ifndef PNGARG
|
||||
# define PNGARG(arglist) arglist
|
||||
@ -298,7 +298,7 @@
|
||||
|
||||
#ifndef PNG_EXPORTA
|
||||
# define PNG_EXPORTA(ordinal, type, name, args, attributes) \
|
||||
PNG_FUNCTION(PNG_EXPORT_TYPE(type), (PNGAPI name), PNGARG(args), \
|
||||
PNG_FUNCTION(PNG_EXPORT_TYPE(type), (PNGAPI name), args, \
|
||||
PNG_LINKAGE_API attributes)
|
||||
#endif
|
||||
|
||||
@ -316,7 +316,7 @@
|
||||
#endif
|
||||
|
||||
#ifndef PNG_CALLBACK
|
||||
# define PNG_CALLBACK(type, name, args) type (PNGCBAPI name) PNGARG(args)
|
||||
# define PNG_CALLBACK(type, name, args) type (PNGCBAPI name) args
|
||||
#endif
|
||||
|
||||
/* Support for compiler specific function attributes. These are used
|
||||
|
9
thirdparty/libpng/pngerror.c
vendored
9
thirdparty/libpng/pngerror.c
vendored
@ -20,13 +20,14 @@
|
||||
|
||||
#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
|
||||
|
||||
static PNG_FUNCTION(void, png_default_error,PNGARG((png_const_structrp png_ptr,
|
||||
png_const_charp error_message)),PNG_NORETURN);
|
||||
static PNG_FUNCTION(void /* PRIVATE */,
|
||||
png_default_error,(png_const_structrp png_ptr, png_const_charp error_message),
|
||||
PNG_NORETURN);
|
||||
|
||||
#ifdef PNG_WARNINGS_SUPPORTED
|
||||
static void /* PRIVATE */
|
||||
png_default_warning PNGARG((png_const_structrp png_ptr,
|
||||
png_const_charp warning_message));
|
||||
png_default_warning(png_const_structrp png_ptr,
|
||||
png_const_charp warning_message);
|
||||
#endif /* WARNINGS */
|
||||
|
||||
/* This function is called whenever there is a fatal error. This function
|
||||
|
2
thirdparty/libpng/pnglibconf.h
vendored
2
thirdparty/libpng/pnglibconf.h
vendored
@ -1,6 +1,6 @@
|
||||
/* pnglibconf.h - library build configuration */
|
||||
|
||||
/* libpng version 1.6.43 */
|
||||
/* libpng version 1.6.44 */
|
||||
|
||||
/* Copyright (c) 2018-2024 Cosmin Truta */
|
||||
/* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson */
|
||||
|
41
thirdparty/libpng/pngpriv.h
vendored
41
thirdparty/libpng/pngpriv.h
vendored
@ -140,47 +140,6 @@
|
||||
* callbacks to do this.
|
||||
*/
|
||||
# define PNG_FILTER_OPTIMIZATIONS png_init_filter_functions_neon
|
||||
|
||||
/* By default the 'intrinsics' code in arm/filter_neon_intrinsics.c is used
|
||||
* if possible - if __ARM_NEON__ is set and the compiler version is not known
|
||||
* to be broken. This is controlled by PNG_ARM_NEON_IMPLEMENTATION which can
|
||||
* be:
|
||||
*
|
||||
* 1 The intrinsics code (the default with __ARM_NEON__)
|
||||
* 2 The hand coded assembler (the default without __ARM_NEON__)
|
||||
*
|
||||
* It is possible to set PNG_ARM_NEON_IMPLEMENTATION in CPPFLAGS, however
|
||||
* this is *NOT* supported and may cease to work even after a minor revision
|
||||
* to libpng. It *is* valid to do this for testing purposes, e.g. speed
|
||||
* testing or a new compiler, but the results should be communicated to the
|
||||
* libpng implementation list for incorporation in the next minor release.
|
||||
*/
|
||||
# ifndef PNG_ARM_NEON_IMPLEMENTATION
|
||||
# if defined(__ARM_NEON__) || defined(__ARM_NEON)
|
||||
# if defined(__clang__)
|
||||
/* At present it is unknown by the libpng developers which versions
|
||||
* of clang support the intrinsics, however some or perhaps all
|
||||
* versions do not work with the assembler so this may be
|
||||
* irrelevant, so just use the default (do nothing here.)
|
||||
*/
|
||||
# elif defined(__GNUC__)
|
||||
/* GCC 4.5.4 NEON support is known to be broken. 4.6.3 is known to
|
||||
* work, so if this *is* GCC, or G++, look for a version >4.5
|
||||
*/
|
||||
# if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 6)
|
||||
# define PNG_ARM_NEON_IMPLEMENTATION 2
|
||||
# endif /* no GNUC support */
|
||||
# endif /* __GNUC__ */
|
||||
# else /* !defined __ARM_NEON__ */
|
||||
/* The 'intrinsics' code simply won't compile without this -mfpu=neon:
|
||||
*/
|
||||
# if !defined(__aarch64__) && !defined(_M_ARM64)
|
||||
/* The assembler code currently does not work on ARM64 */
|
||||
# define PNG_ARM_NEON_IMPLEMENTATION 2
|
||||
# endif /* __aarch64__ */
|
||||
# endif /* __ARM_NEON__ */
|
||||
# endif /* !PNG_ARM_NEON_IMPLEMENTATION */
|
||||
|
||||
# ifndef PNG_ARM_NEON_IMPLEMENTATION
|
||||
/* Use the intrinsics code by default. */
|
||||
# define PNG_ARM_NEON_IMPLEMENTATION 1
|
||||
|
Loading…
x
Reference in New Issue
Block a user