jdk/src/java.desktop/share/native/libsplashscreen/libpng/pngpriv.h
changeset 43321 2b8d397c03a4
parent 40436 94ae0ede53a5
equal deleted inserted replaced
43320:6351c8545289 43321:2b8d397c03a4
    27  * This file is available under and governed by the GNU General Public
    27  * This file is available under and governed by the GNU General Public
    28  * License version 2 only, as published by the Free Software Foundation.
    28  * License version 2 only, as published by the Free Software Foundation.
    29  * However, the following notice accompanied the original version of this
    29  * However, the following notice accompanied the original version of this
    30  * file and, per its terms, should not be removed:
    30  * file and, per its terms, should not be removed:
    31  *
    31  *
    32  * Last changed in libpng 1.6.22 [May 26, 2016]
    32  * Last changed in libpng 1.6.26 [October 20, 2016]
    33  * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
    33  * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
    34  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
    34  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
    35  * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
    35  * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
    36  *
    36  *
    37  * This code is released under the libpng license.
    37  * This code is released under the libpng license.
   207 #  ifndef PNG_ARM_NEON_IMPLEMENTATION
   207 #  ifndef PNG_ARM_NEON_IMPLEMENTATION
   208       /* Use the intrinsics code by default. */
   208       /* Use the intrinsics code by default. */
   209 #     define PNG_ARM_NEON_IMPLEMENTATION 1
   209 #     define PNG_ARM_NEON_IMPLEMENTATION 1
   210 #  endif
   210 #  endif
   211 #endif /* PNG_ARM_NEON_OPT > 0 */
   211 #endif /* PNG_ARM_NEON_OPT > 0 */
       
   212 
       
   213 #ifndef PNG_MIPS_MSA_OPT
       
   214 #  if defined(__mips_msa) && (__mips_isa_rev >= 5) && defined(PNG_ALIGNED_MEMORY_SUPPORTED)
       
   215 #     define PNG_MIPS_MSA_OPT 2
       
   216 #  else
       
   217 #     define PNG_MIPS_MSA_OPT 0
       
   218 #  endif
       
   219 #endif
       
   220 
       
   221 #if PNG_MIPS_MSA_OPT > 0
       
   222 #  define PNG_FILTER_OPTIMIZATIONS png_init_filter_functions_msa
       
   223 #  ifndef PNG_MIPS_MSA_IMPLEMENTATION
       
   224 #     if defined(__mips_msa)
       
   225 #        if defined(__clang__)
       
   226 #        elif defined(__GNUC__)
       
   227 #           if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 7)
       
   228 #              define PNG_MIPS_MSA_IMPLEMENTATION 2
       
   229 #           endif /* no GNUC support */
       
   230 #        endif /* __GNUC__ */
       
   231 #     else /* !defined __mips_msa */
       
   232 #        define PNG_MIPS_MSA_IMPLEMENTATION 2
       
   233 #     endif /* __mips_msa */
       
   234 #  endif /* !PNG_MIPS_MSA_IMPLEMENTATION */
       
   235 
       
   236 #  ifndef PNG_MIPS_MSA_IMPLEMENTATION
       
   237 #     define PNG_MIPS_MSA_IMPLEMENTATION 1
       
   238 #  endif
       
   239 #endif /* PNG_MIPS_MSA_OPT > 0 */
       
   240 
   212 
   241 
   213 /* Is this a build of a DLL where compilation of the object modules requires
   242 /* Is this a build of a DLL where compilation of the object modules requires
   214  * different preprocessor settings to those required for a simple library?  If
   243  * different preprocessor settings to those required for a simple library?  If
   215  * so PNG_BUILD_DLL must be set.
   244  * so PNG_BUILD_DLL must be set.
   216  *
   245  *
   446     */
   475     */
   447 #  include <float.h>
   476 #  include <float.h>
   448 
   477 
   449 #  if (defined(__MWERKS__) && defined(macintosh)) || defined(applec) || \
   478 #  if (defined(__MWERKS__) && defined(macintosh)) || defined(applec) || \
   450     defined(THINK_C) || defined(__SC__) || defined(TARGET_OS_MAC)
   479     defined(THINK_C) || defined(__SC__) || defined(TARGET_OS_MAC)
   451      /* We need to check that <math.h> hasn't already been included earlier
   480    /* We need to check that <math.h> hasn't already been included earlier
   452       * as it seems it doesn't agree with <fp.h>, yet we should really use
   481     * as it seems it doesn't agree with <fp.h>, yet we should really use
   453       * <fp.h> if possible.
   482     * <fp.h> if possible.
   454       */
   483     */
   455 #    if !defined(__MATH_H__) && !defined(__MATH_H) && !defined(__cmath__)
   484 #    if !defined(__MATH_H__) && !defined(__MATH_H) && !defined(__cmath__)
   456 #      include <fp.h>
   485 #      include <fp.h>
   457 #    endif
   486 #    endif
   458 #  else
   487 #  else
   459 #    include <math.h>
   488 #    include <math.h>
   460 #  endif
   489 #  endif
   461 #  if defined(_AMIGA) && defined(__SASC) && defined(_M68881)
   490 #  if defined(_AMIGA) && defined(__SASC) && defined(_M68881)
   462      /* Amiga SAS/C: We must include builtin FPU functions when compiling using
   491    /* Amiga SAS/C: We must include builtin FPU functions when compiling using
   463       * MATH=68881
   492     * MATH=68881
   464       */
   493     */
   465 #    include <m68881.h>
   494 #    include <m68881.h>
   466 #  endif
   495 #  endif
   467 #endif
   496 #endif
   468 
   497 
   469 /* This provides the non-ANSI (far) memory allocation routines. */
   498 /* This provides the non-ANSI (far) memory allocation routines. */
   530 #endif
   559 #endif
   531 
   560 
   532 /* This implicitly assumes alignment is always to a power of 2. */
   561 /* This implicitly assumes alignment is always to a power of 2. */
   533 #ifdef png_alignof
   562 #ifdef png_alignof
   534 #  define png_isaligned(ptr, type)\
   563 #  define png_isaligned(ptr, type)\
   535    ((((const char*)ptr-(const char*)0) & (png_alignof(type)-1)) == 0)
   564    (((type)((const char*)ptr-(const char*)0) & \
       
   565    (type)(png_alignof(type)-1)) == 0)
   536 #else
   566 #else
   537 #  define png_isaligned(ptr, type) 0
   567 #  define png_isaligned(ptr, type) 0
   538 #endif
   568 #endif
   539 
   569 
   540 /* End of memory model/platform independent support */
   570 /* End of memory model/platform independent support */
   547 /* Various modes of operation.  Note that after an init, mode is set to
   577 /* Various modes of operation.  Note that after an init, mode is set to
   548  * zero automatically when the structure is created.  Three of these
   578  * zero automatically when the structure is created.  Three of these
   549  * are defined in png.h because they need to be visible to applications
   579  * are defined in png.h because they need to be visible to applications
   550  * that call png_set_unknown_chunk().
   580  * that call png_set_unknown_chunk().
   551  */
   581  */
   552 /* #define PNG_HAVE_IHDR            0x01 (defined in png.h) */
   582 /* #define PNG_HAVE_IHDR            0x01U (defined in png.h) */
   553 /* #define PNG_HAVE_PLTE            0x02 (defined in png.h) */
   583 /* #define PNG_HAVE_PLTE            0x02U (defined in png.h) */
   554 #define PNG_HAVE_IDAT               0x04
   584 #define PNG_HAVE_IDAT               0x04U
   555 /* #define PNG_AFTER_IDAT           0x08 (defined in png.h) */
   585 /* #define PNG_AFTER_IDAT           0x08U (defined in png.h) */
   556 #define PNG_HAVE_IEND               0x10
   586 #define PNG_HAVE_IEND               0x10U
   557                    /*               0x20 (unused) */
   587                    /*               0x20U (unused) */
   558                    /*               0x40 (unused) */
   588                    /*               0x40U (unused) */
   559                    /*               0x80 (unused) */
   589                    /*               0x80U (unused) */
   560 #define PNG_HAVE_CHUNK_HEADER      0x100
   590 #define PNG_HAVE_CHUNK_HEADER      0x100U
   561 #define PNG_WROTE_tIME             0x200
   591 #define PNG_WROTE_tIME             0x200U
   562 #define PNG_WROTE_INFO_BEFORE_PLTE 0x400
   592 #define PNG_WROTE_INFO_BEFORE_PLTE 0x400U
   563 #define PNG_BACKGROUND_IS_GRAY     0x800
   593 #define PNG_BACKGROUND_IS_GRAY     0x800U
   564 #define PNG_HAVE_PNG_SIGNATURE    0x1000
   594 #define PNG_HAVE_PNG_SIGNATURE    0x1000U
   565 #define PNG_HAVE_CHUNK_AFTER_IDAT 0x2000 /* Have another chunk after IDAT */
   595 #define PNG_HAVE_CHUNK_AFTER_IDAT 0x2000U /* Have another chunk after IDAT */
   566                    /*             0x4000 (unused) */
   596                    /*             0x4000U (unused) */
   567 #define PNG_IS_READ_STRUCT        0x8000 /* Else is a write struct */
   597 #define PNG_IS_READ_STRUCT        0x8000U /* Else is a write struct */
   568 
   598 
   569 /* Flags for the transformations the PNG library does on the image data */
   599 /* Flags for the transformations the PNG library does on the image data */
   570 #define PNG_BGR                 0x0001
   600 #define PNG_BGR                 0x0001U
   571 #define PNG_INTERLACE           0x0002
   601 #define PNG_INTERLACE           0x0002U
   572 #define PNG_PACK                0x0004
   602 #define PNG_PACK                0x0004U
   573 #define PNG_SHIFT               0x0008
   603 #define PNG_SHIFT               0x0008U
   574 #define PNG_SWAP_BYTES          0x0010
   604 #define PNG_SWAP_BYTES          0x0010U
   575 #define PNG_INVERT_MONO         0x0020
   605 #define PNG_INVERT_MONO         0x0020U
   576 #define PNG_QUANTIZE            0x0040
   606 #define PNG_QUANTIZE            0x0040U
   577 #define PNG_COMPOSE             0x0080     /* Was PNG_BACKGROUND */
   607 #define PNG_COMPOSE             0x0080U    /* Was PNG_BACKGROUND */
   578 #define PNG_BACKGROUND_EXPAND   0x0100
   608 #define PNG_BACKGROUND_EXPAND   0x0100U
   579 #define PNG_EXPAND_16           0x0200     /* Added to libpng 1.5.2 */
   609 #define PNG_EXPAND_16           0x0200U    /* Added to libpng 1.5.2 */
   580 #define PNG_16_TO_8             0x0400     /* Becomes 'chop' in 1.5.4 */
   610 #define PNG_16_TO_8             0x0400U    /* Becomes 'chop' in 1.5.4 */
   581 #define PNG_RGBA                0x0800
   611 #define PNG_RGBA                0x0800U
   582 #define PNG_EXPAND              0x1000
   612 #define PNG_EXPAND              0x1000U
   583 #define PNG_GAMMA               0x2000
   613 #define PNG_GAMMA               0x2000U
   584 #define PNG_GRAY_TO_RGB         0x4000
   614 #define PNG_GRAY_TO_RGB         0x4000U
   585 #define PNG_FILLER              0x8000
   615 #define PNG_FILLER              0x8000U
   586 #define PNG_PACKSWAP           0x10000
   616 #define PNG_PACKSWAP           0x10000U
   587 #define PNG_SWAP_ALPHA         0x20000
   617 #define PNG_SWAP_ALPHA         0x20000U
   588 #define PNG_STRIP_ALPHA        0x40000
   618 #define PNG_STRIP_ALPHA        0x40000U
   589 #define PNG_INVERT_ALPHA       0x80000
   619 #define PNG_INVERT_ALPHA       0x80000U
   590 #define PNG_USER_TRANSFORM    0x100000
   620 #define PNG_USER_TRANSFORM    0x100000U
   591 #define PNG_RGB_TO_GRAY_ERR   0x200000
   621 #define PNG_RGB_TO_GRAY_ERR   0x200000U
   592 #define PNG_RGB_TO_GRAY_WARN  0x400000
   622 #define PNG_RGB_TO_GRAY_WARN  0x400000U
   593 #define PNG_RGB_TO_GRAY       0x600000 /* two bits, RGB_TO_GRAY_ERR|WARN */
   623 #define PNG_RGB_TO_GRAY       0x600000U /* two bits, RGB_TO_GRAY_ERR|WARN */
   594 #define PNG_ENCODE_ALPHA      0x800000 /* Added to libpng-1.5.4 */
   624 #define PNG_ENCODE_ALPHA      0x800000U /* Added to libpng-1.5.4 */
   595 #define PNG_ADD_ALPHA        0x1000000 /* Added to libpng-1.2.7 */
   625 #define PNG_ADD_ALPHA        0x1000000U /* Added to libpng-1.2.7 */
   596 #define PNG_EXPAND_tRNS      0x2000000 /* Added to libpng-1.2.9 */
   626 #define PNG_EXPAND_tRNS      0x2000000U /* Added to libpng-1.2.9 */
   597 #define PNG_SCALE_16_TO_8    0x4000000 /* Added to libpng-1.5.4 */
   627 #define PNG_SCALE_16_TO_8    0x4000000U /* Added to libpng-1.5.4 */
   598                        /*    0x8000000 unused */
   628                        /*    0x8000000U unused */
   599                        /*   0x10000000 unused */
   629                        /*   0x10000000U unused */
   600                        /*   0x20000000 unused */
   630                        /*   0x20000000U unused */
   601                        /*   0x40000000 unused */
   631                        /*   0x40000000U unused */
   602 /* Flags for png_create_struct */
   632 /* Flags for png_create_struct */
   603 #define PNG_STRUCT_PNG   0x0001
   633 #define PNG_STRUCT_PNG   0x0001U
   604 #define PNG_STRUCT_INFO  0x0002
   634 #define PNG_STRUCT_INFO  0x0002U
   605 
   635 
   606 /* Flags for the png_ptr->flags rather than declaring a byte for each one */
   636 /* Flags for the png_ptr->flags rather than declaring a byte for each one */
   607 #define PNG_FLAG_ZLIB_CUSTOM_STRATEGY     0x0001
   637 #define PNG_FLAG_ZLIB_CUSTOM_STRATEGY     0x0001U
   608 #define PNG_FLAG_ZSTREAM_INITIALIZED      0x0002 /* Added to libpng-1.6.0 */
   638 #define PNG_FLAG_ZSTREAM_INITIALIZED      0x0002U /* Added to libpng-1.6.0 */
   609                                   /*      0x0004    unused */
   639                                   /*      0x0004U    unused */
   610 #define PNG_FLAG_ZSTREAM_ENDED            0x0008 /* Added to libpng-1.6.0 */
   640 #define PNG_FLAG_ZSTREAM_ENDED            0x0008U /* Added to libpng-1.6.0 */
   611                                   /*      0x0010    unused */
   641                                   /*      0x0010U    unused */
   612                                   /*      0x0020    unused */
   642                                   /*      0x0020U    unused */
   613 #define PNG_FLAG_ROW_INIT                 0x0040
   643 #define PNG_FLAG_ROW_INIT                 0x0040U
   614 #define PNG_FLAG_FILLER_AFTER             0x0080
   644 #define PNG_FLAG_FILLER_AFTER             0x0080U
   615 #define PNG_FLAG_CRC_ANCILLARY_USE        0x0100
   645 #define PNG_FLAG_CRC_ANCILLARY_USE        0x0100U
   616 #define PNG_FLAG_CRC_ANCILLARY_NOWARN     0x0200
   646 #define PNG_FLAG_CRC_ANCILLARY_NOWARN     0x0200U
   617 #define PNG_FLAG_CRC_CRITICAL_USE         0x0400
   647 #define PNG_FLAG_CRC_CRITICAL_USE         0x0400U
   618 #define PNG_FLAG_CRC_CRITICAL_IGNORE      0x0800
   648 #define PNG_FLAG_CRC_CRITICAL_IGNORE      0x0800U
   619 #define PNG_FLAG_ASSUME_sRGB              0x1000 /* Added to libpng-1.5.4 */
   649 #define PNG_FLAG_ASSUME_sRGB              0x1000U /* Added to libpng-1.5.4 */
   620 #define PNG_FLAG_OPTIMIZE_ALPHA           0x2000 /* Added to libpng-1.5.4 */
   650 #define PNG_FLAG_OPTIMIZE_ALPHA           0x2000U /* Added to libpng-1.5.4 */
   621 #define PNG_FLAG_DETECT_UNINITIALIZED     0x4000 /* Added to libpng-1.5.4 */
   651 #define PNG_FLAG_DETECT_UNINITIALIZED     0x4000U /* Added to libpng-1.5.4 */
   622 /* #define PNG_FLAG_KEEP_UNKNOWN_CHUNKS      0x8000 */
   652 /* #define PNG_FLAG_KEEP_UNKNOWN_CHUNKS      0x8000U */
   623 /* #define PNG_FLAG_KEEP_UNSAFE_CHUNKS      0x10000 */
   653 /* #define PNG_FLAG_KEEP_UNSAFE_CHUNKS      0x10000U */
   624 #define PNG_FLAG_LIBRARY_MISMATCH        0x20000
   654 #define PNG_FLAG_LIBRARY_MISMATCH        0x20000U
   625 #define PNG_FLAG_STRIP_ERROR_NUMBERS     0x40000
   655 #define PNG_FLAG_STRIP_ERROR_NUMBERS     0x40000U
   626 #define PNG_FLAG_STRIP_ERROR_TEXT        0x80000
   656 #define PNG_FLAG_STRIP_ERROR_TEXT        0x80000U
   627 #define PNG_FLAG_BENIGN_ERRORS_WARN     0x100000 /* Added to libpng-1.4.0 */
   657 #define PNG_FLAG_BENIGN_ERRORS_WARN     0x100000U /* Added to libpng-1.4.0 */
   628 #define PNG_FLAG_APP_WARNINGS_WARN      0x200000 /* Added to libpng-1.6.0 */
   658 #define PNG_FLAG_APP_WARNINGS_WARN      0x200000U /* Added to libpng-1.6.0 */
   629 #define PNG_FLAG_APP_ERRORS_WARN        0x400000 /* Added to libpng-1.6.0 */
   659 #define PNG_FLAG_APP_ERRORS_WARN        0x400000U /* Added to libpng-1.6.0 */
   630                                   /*    0x800000    unused */
   660                                   /*    0x800000U    unused */
   631                                   /*   0x1000000    unused */
   661                                   /*   0x1000000U    unused */
   632                                   /*   0x2000000    unused */
   662                                   /*   0x2000000U    unused */
   633                                   /*   0x4000000    unused */
   663                                   /*   0x4000000U    unused */
   634                                   /*   0x8000000    unused */
   664                                   /*   0x8000000U    unused */
   635                                   /*  0x10000000    unused */
   665                                   /*  0x10000000U    unused */
   636                                   /*  0x20000000    unused */
   666                                   /*  0x20000000U    unused */
   637                                   /*  0x40000000    unused */
   667                                   /*  0x40000000U    unused */
   638 
   668 
   639 #define PNG_FLAG_CRC_ANCILLARY_MASK (PNG_FLAG_CRC_ANCILLARY_USE | \
   669 #define PNG_FLAG_CRC_ANCILLARY_MASK (PNG_FLAG_CRC_ANCILLARY_USE | \
   640                                      PNG_FLAG_CRC_ANCILLARY_NOWARN)
   670                                      PNG_FLAG_CRC_ANCILLARY_NOWARN)
   641 
   671 
   642 #define PNG_FLAG_CRC_CRITICAL_MASK  (PNG_FLAG_CRC_CRITICAL_USE | \
   672 #define PNG_FLAG_CRC_CRITICAL_MASK  (PNG_FLAG_CRC_CRITICAL_USE | \
   665 /* Added to libpng-1.2.6 JB */
   695 /* Added to libpng-1.2.6 JB */
   666 #define PNG_ROWBYTES(pixel_bits, width) \
   696 #define PNG_ROWBYTES(pixel_bits, width) \
   667     ((pixel_bits) >= 8 ? \
   697     ((pixel_bits) >= 8 ? \
   668     ((png_size_t)(width) * (((png_size_t)(pixel_bits)) >> 3)) : \
   698     ((png_size_t)(width) * (((png_size_t)(pixel_bits)) >> 3)) : \
   669     (( ((png_size_t)(width) * ((png_size_t)(pixel_bits))) + 7) >> 3) )
   699     (( ((png_size_t)(width) * ((png_size_t)(pixel_bits))) + 7) >> 3) )
       
   700 
       
   701 /* This returns the number of trailing bits in the last byte of a row, 0 if the
       
   702  * last byte is completely full of pixels.  It is, in principle, (pixel_bits x
       
   703  * width) % 8, but that would overflow for large 'width'.  The second macro is
       
   704  * the same except that it returns the number of unused bits in the last byte;
       
   705  * (8-TRAILBITS), but 0 when TRAILBITS is 0.
       
   706  *
       
   707  * NOTE: these macros are intended to be self-evidently correct and never
       
   708  * overflow on the assumption that pixel_bits is in the range 0..255.  The
       
   709  * arguments are evaluated only once and they can be signed (e.g. as a result of
       
   710  * the integral promotions).  The result of the expression always has type
       
   711  * (png_uint_32), however the compiler always knows it is in the range 0..7.
       
   712  */
       
   713 #define PNG_TRAILBITS(pixel_bits, width) \
       
   714     (((pixel_bits) * ((width) % (png_uint_32)8)) % 8)
       
   715 
       
   716 #define PNG_PADBITS(pixel_bits, width) \
       
   717     ((8 - PNG_TRAILBITS(pixel_bits, width)) % 8)
   670 
   718 
   671 /* PNG_OUT_OF_RANGE returns true if value is outside the range
   719 /* PNG_OUT_OF_RANGE returns true if value is outside the range
   672  * ideal-delta..ideal+delta.  Each argument is evaluated twice.
   720  * ideal-delta..ideal+delta.  Each argument is evaluated twice.
   673  * "ideal" and "delta" should be constants, normally simple
   721  * "ideal" and "delta" should be constants, normally simple
   674  * integers, "value" a variable. Added to libpng-1.2.6 JB
   722  * integers, "value" a variable. Added to libpng-1.2.6 JB
  1051 #endif
  1099 #endif
  1052 
  1100 
  1053 #ifdef PNG_WRITE_cHRM_SUPPORTED
  1101 #ifdef PNG_WRITE_cHRM_SUPPORTED
  1054 PNG_INTERNAL_FUNCTION(void,png_write_cHRM_fixed,(png_structrp png_ptr,
  1102 PNG_INTERNAL_FUNCTION(void,png_write_cHRM_fixed,(png_structrp png_ptr,
  1055     const png_xy *xy), PNG_EMPTY);
  1103     const png_xy *xy), PNG_EMPTY);
  1056     /* The xy value must have been previously validated */
  1104    /* The xy value must have been previously validated */
  1057 #endif
  1105 #endif
  1058 
  1106 
  1059 #ifdef PNG_WRITE_sRGB_SUPPORTED
  1107 #ifdef PNG_WRITE_sRGB_SUPPORTED
  1060 PNG_INTERNAL_FUNCTION(void,png_write_sRGB,(png_structrp png_ptr,
  1108 PNG_INTERNAL_FUNCTION(void,png_write_sRGB,(png_structrp png_ptr,
  1061     int intent),PNG_EMPTY);
  1109     int intent),PNG_EMPTY);
  1200  * calling it for PNG_FILTER_VALUE_NONE.
  1248  * calling it for PNG_FILTER_VALUE_NONE.
  1201  */
  1249  */
  1202 PNG_INTERNAL_FUNCTION(void,png_read_filter_row,(png_structrp pp, png_row_infop
  1250 PNG_INTERNAL_FUNCTION(void,png_read_filter_row,(png_structrp pp, png_row_infop
  1203     row_info, png_bytep row, png_const_bytep prev_row, int filter),PNG_EMPTY);
  1251     row_info, png_bytep row, png_const_bytep prev_row, int filter),PNG_EMPTY);
  1204 
  1252 
       
  1253 #if PNG_ARM_NEON_OPT > 0
  1205 PNG_INTERNAL_FUNCTION(void,png_read_filter_row_up_neon,(png_row_infop row_info,
  1254 PNG_INTERNAL_FUNCTION(void,png_read_filter_row_up_neon,(png_row_infop row_info,
  1206     png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
  1255     png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
  1207 PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub3_neon,(png_row_infop
  1256 PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub3_neon,(png_row_infop
  1208     row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
  1257     row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
  1209 PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub4_neon,(png_row_infop
  1258 PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub4_neon,(png_row_infop
  1214     row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
  1263     row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
  1215 PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth3_neon,(png_row_infop
  1264 PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth3_neon,(png_row_infop
  1216     row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
  1265     row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
  1217 PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth4_neon,(png_row_infop
  1266 PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth4_neon,(png_row_infop
  1218     row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
  1267     row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
       
  1268 #endif
       
  1269 
       
  1270 #if PNG_MIPS_MSA_OPT > 0
       
  1271 PNG_INTERNAL_FUNCTION(void,png_read_filter_row_up_msa,(png_row_infop row_info,
       
  1272     png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
       
  1273 PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub3_msa,(png_row_infop
       
  1274     row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
       
  1275 PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub4_msa,(png_row_infop
       
  1276     row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
       
  1277 PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg3_msa,(png_row_infop
       
  1278     row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
       
  1279 PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg4_msa,(png_row_infop
       
  1280     row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
       
  1281 PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth3_msa,(png_row_infop
       
  1282     row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
       
  1283 PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth4_msa,(png_row_infop
       
  1284     row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
       
  1285 #endif
  1219 
  1286 
  1220 /* Choose the best filter to use and filter the row data */
  1287 /* Choose the best filter to use and filter the row data */
  1221 PNG_INTERNAL_FUNCTION(void,png_write_find_filter,(png_structrp png_ptr,
  1288 PNG_INTERNAL_FUNCTION(void,png_write_find_filter,(png_structrp png_ptr,
  1222     png_row_infop row_info),PNG_EMPTY);
  1289     png_row_infop row_info),PNG_EMPTY);
  1223 
  1290 
  1241 #endif /* SEQUENTIAL_READ */
  1308 #endif /* SEQUENTIAL_READ */
  1242 
  1309 
  1243 /* Initialize the row buffers, etc. */
  1310 /* Initialize the row buffers, etc. */
  1244 PNG_INTERNAL_FUNCTION(void,png_read_start_row,(png_structrp png_ptr),PNG_EMPTY);
  1311 PNG_INTERNAL_FUNCTION(void,png_read_start_row,(png_structrp png_ptr),PNG_EMPTY);
  1245 
  1312 
  1246 #if PNG_ZLIB_VERNUM >= 0x1240
  1313 #if ZLIB_VERNUM >= 0x1240
  1247 PNG_INTERNAL_FUNCTION(int,png_zlib_inflate,(png_structrp png_ptr, int flush),
  1314 PNG_INTERNAL_FUNCTION(int,png_zlib_inflate,(png_structrp png_ptr, int flush),
  1248       PNG_EMPTY);
  1315       PNG_EMPTY);
  1249 #  define PNG_INFLATE(pp, flush) png_zlib_inflate(pp, flush)
  1316 #  define PNG_INFLATE(pp, flush) png_zlib_inflate(pp, flush)
  1250 #else /* Zlib < 1.2.4 */
  1317 #else /* Zlib < 1.2.4 */
  1251 #  define PNG_INFLATE(pp, flush) inflate(&(pp)->zstream, flush)
  1318 #  define PNG_INFLATE(pp, flush) inflate(&(pp)->zstream, flush)
  1439 PNG_INTERNAL_FUNCTION(void,png_push_have_info,(png_structrp png_ptr,
  1506 PNG_INTERNAL_FUNCTION(void,png_push_have_info,(png_structrp png_ptr,
  1440    png_inforp info_ptr),PNG_EMPTY);
  1507    png_inforp info_ptr),PNG_EMPTY);
  1441 PNG_INTERNAL_FUNCTION(void,png_push_have_end,(png_structrp png_ptr,
  1508 PNG_INTERNAL_FUNCTION(void,png_push_have_end,(png_structrp png_ptr,
  1442    png_inforp info_ptr),PNG_EMPTY);
  1509    png_inforp info_ptr),PNG_EMPTY);
  1443 PNG_INTERNAL_FUNCTION(void,png_push_have_row,(png_structrp png_ptr,
  1510 PNG_INTERNAL_FUNCTION(void,png_push_have_row,(png_structrp png_ptr,
  1444      png_bytep row),PNG_EMPTY);
  1511     png_bytep row),PNG_EMPTY);
  1445 PNG_INTERNAL_FUNCTION(void,png_push_read_end,(png_structrp png_ptr,
  1512 PNG_INTERNAL_FUNCTION(void,png_push_read_end,(png_structrp png_ptr,
  1446     png_inforp info_ptr),PNG_EMPTY);
  1513     png_inforp info_ptr),PNG_EMPTY);
  1447 PNG_INTERNAL_FUNCTION(void,png_process_some_data,(png_structrp png_ptr,
  1514 PNG_INTERNAL_FUNCTION(void,png_process_some_data,(png_structrp png_ptr,
  1448     png_inforp info_ptr),PNG_EMPTY);
  1515     png_inforp info_ptr),PNG_EMPTY);
  1449 PNG_INTERNAL_FUNCTION(void,png_read_push_finish_row,(png_structrp png_ptr),
  1516 PNG_INTERNAL_FUNCTION(void,png_read_push_finish_row,(png_structrp png_ptr),
  1478     * profile.
  1545     * profile.
  1479     */
  1546     */
  1480 
  1547 
  1481 PNG_INTERNAL_FUNCTION(void,png_colorspace_sync_info,(png_const_structrp png_ptr,
  1548 PNG_INTERNAL_FUNCTION(void,png_colorspace_sync_info,(png_const_structrp png_ptr,
  1482     png_inforp info_ptr), PNG_EMPTY);
  1549     png_inforp info_ptr), PNG_EMPTY);
  1483     /* Synchronize the info 'valid' flags with the colorspace */
  1550    /* Synchronize the info 'valid' flags with the colorspace */
  1484 
  1551 
  1485 PNG_INTERNAL_FUNCTION(void,png_colorspace_sync,(png_const_structrp png_ptr,
  1552 PNG_INTERNAL_FUNCTION(void,png_colorspace_sync,(png_const_structrp png_ptr,
  1486     png_inforp info_ptr), PNG_EMPTY);
  1553     png_inforp info_ptr), PNG_EMPTY);
  1487     /* Copy the png_struct colorspace to the info_struct and call the above to
  1554    /* Copy the png_struct colorspace to the info_struct and call the above to
  1488      * synchronize the flags.  Checks for NULL info_ptr and does nothing.
  1555     * synchronize the flags.  Checks for NULL info_ptr and does nothing.
  1489      */
  1556     */
  1490 #endif
  1557 #endif
  1491 
  1558 
  1492 /* Added at libpng version 1.4.0 */
  1559 /* Added at libpng version 1.4.0 */
  1493 #ifdef PNG_COLORSPACE_SUPPORTED
  1560 #ifdef PNG_COLORSPACE_SUPPORTED
  1494 /* These internal functions are for maintaining the colorspace structure within
  1561 /* These internal functions are for maintaining the colorspace structure within
  1518    png_uint_32 profile_length, png_const_bytep profile, int color_type),
  1585    png_uint_32 profile_length, png_const_bytep profile, int color_type),
  1519    PNG_EMPTY);
  1586    PNG_EMPTY);
  1520    /* The 'name' is used for information only */
  1587    /* The 'name' is used for information only */
  1521 
  1588 
  1522 /* Routines for checking parts of an ICC profile. */
  1589 /* Routines for checking parts of an ICC profile. */
       
  1590 #ifdef PNG_READ_iCCP_SUPPORTED
  1523 PNG_INTERNAL_FUNCTION(int,png_icc_check_length,(png_const_structrp png_ptr,
  1591 PNG_INTERNAL_FUNCTION(int,png_icc_check_length,(png_const_structrp png_ptr,
  1524    png_colorspacerp colorspace, png_const_charp name,
  1592    png_colorspacerp colorspace, png_const_charp name,
  1525    png_uint_32 profile_length), PNG_EMPTY);
  1593    png_uint_32 profile_length), PNG_EMPTY);
       
  1594 #endif /* READ_iCCP */
  1526 PNG_INTERNAL_FUNCTION(int,png_icc_check_header,(png_const_structrp png_ptr,
  1595 PNG_INTERNAL_FUNCTION(int,png_icc_check_header,(png_const_structrp png_ptr,
  1527    png_colorspacerp colorspace, png_const_charp name,
  1596    png_colorspacerp colorspace, png_const_charp name,
  1528    png_uint_32 profile_length,
  1597    png_uint_32 profile_length,
  1529    png_const_bytep profile /* first 132 bytes only */, int color_type),
  1598    png_const_bytep profile /* first 132 bytes only */, int color_type),
  1530    PNG_EMPTY);
  1599    PNG_EMPTY);
  1939 #else
  2008 #else
  1940    /* List *all* the possible optimizations here - this branch is required if
  2009    /* List *all* the possible optimizations here - this branch is required if
  1941     * the builder of libpng passes the definition of PNG_FILTER_OPTIMIZATIONS in
  2010     * the builder of libpng passes the definition of PNG_FILTER_OPTIMIZATIONS in
  1942     * CFLAGS in place of CPPFLAGS *and* uses symbol prefixing.
  2011     * CFLAGS in place of CPPFLAGS *and* uses symbol prefixing.
  1943     */
  2012     */
       
  2013 #  if PNG_ARM_NEON_OPT > 0
  1944 PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_neon,
  2014 PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_neon,
  1945    (png_structp png_ptr, unsigned int bpp), PNG_EMPTY);
  2015    (png_structp png_ptr, unsigned int bpp), PNG_EMPTY);
  1946 #endif
  2016 #endif
  1947 
  2017 
       
  2018 #if PNG_MIPS_MSA_OPT > 0
       
  2019 PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_msa,
       
  2020    (png_structp png_ptr, unsigned int bpp), PNG_EMPTY);
       
  2021 #endif
       
  2022 #endif
       
  2023 
  1948 PNG_INTERNAL_FUNCTION(png_uint_32, png_check_keyword, (png_structrp png_ptr,
  2024 PNG_INTERNAL_FUNCTION(png_uint_32, png_check_keyword, (png_structrp png_ptr,
  1949    png_const_charp key, png_bytep new_key), PNG_EMPTY);
  2025    png_const_charp key, png_bytep new_key), PNG_EMPTY);
  1950 
  2026 
  1951 /* Maintainer: Put new private prototypes here ^ */
  2027 /* Maintainer: Put new private prototypes here ^ */
  1952 
  2028