mirror of
https://github.com/glennrp/libpng.git
synced 2026-10-24 08:39:18 +03:00
The change removes the need for build configuration of target specific code such as SIMD enhancements. The extensible framework is based on checks in the new file named pngtarget.h and allows per target description of requirements and capabilities using macros with the prefix PNG_TARGET_. These macros are interpreted by the core libpng code in a target independent way. The PNG_TARGET_ prefixed macros describe the target specific implementation and document how to include it. The actual inclusion of the code is done, at present, by a single target independent core file named pngsimd.c. This approach ensures that no special configuration in the build system is required on any system. It is not required on a system which is compiling for the build host where we can reasonably assume that the compiler is correctly set up. Neither is it required for cross builds so long as the toolchain is correctly set up. In this case the toolchain means the cross build system and any ancilliary programs it requires. More details of the implementation are included in the source files named pngtarget.h and pngsimd.c. These files document in C comments how additional target specific code might be added. The changes consist primarily of movement of target specific code from the core libpng source files to the existing target specific subdirectories such as the ones named intel and arm. This isolates the code into the corresponding subdirectory and eliminates the requirement for changes across the libpng structure. As part of this the ARM processor NEON instruction set specific palette to RGB code has been generalised to allow implementation in other architectures. The resultant updated version of the original (ARM Ltd) implementation has been moved to the subdirectory named arm. In addition some selected changes have been included to allow testing with higher warning levels than the typical compiler defaults. Reviewed-by: Cosmin Truta <ctruta@gmail.com> Signed-off-by: John Bowler <jbowler@acm.org> Signed-off-by: Cosmin Truta <ctruta@gmail.com>
20 lines
675 B
C
20 lines
675 B
C
/* arm/check.h - NEON optimised filter functions
|
|
*
|
|
* Copyright (c) 2018-2022 Cosmin Truta
|
|
* Copyright (c) 2014,2016 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
|
|
*/
|
|
#if defined(__ARM_NEON__) || defined(__ARM_NEON)
|
|
# define PNG_TARGET_CODE_IMPLEMENTATION "arm/arm_init.c"
|
|
# define PNG_TARGET_IMPLEMENTS_FILTERS
|
|
# ifdef PNG_READ_EXPAND_SUPPORTED
|
|
# define PNG_TARGET_STORES_DATA
|
|
# define PNG_TARGET_IMPLEMENTS_EXPAND_PALETTE
|
|
# endif /* READ_EXPAND */
|
|
# define PNG_TARGET_ROW_ALIGNMENT 16
|
|
#endif /* ARM_NEON */
|