diff --git a/3rdparty/libpng/CMakeLists.txt b/3rdparty/libpng/CMakeLists.txt index 73ce1d82ff..70f73f13e4 100644 --- a/3rdparty/libpng/CMakeLists.txt +++ b/3rdparty/libpng/CMakeLists.txt @@ -2,13 +2,23 @@ # CMake file for libpng. See root CMakeLists.txt # # ---------------------------------------------------------------------------- -project(${PNG_LIBRARY}) + +if(NEON) + project(${PNG_LIBRARY} ASM) +else() + project(${PNG_LIBRARY}) +endif() ocv_include_directories("${CMAKE_CURRENT_SOURCE_DIR}" ${ZLIB_INCLUDE_DIR}) file(GLOB lib_srcs *.c) file(GLOB lib_hdrs *.h) +if(NEON) + list(APPEND lib_srcs arm/filter_neon.S) + add_definitions(-DPNG_ARM_NEON) +endif() + # ---------------------------------------------------------------------------------- # Define the library target: # ---------------------------------------------------------------------------------- diff --git a/3rdparty/libpng/pngrutil.c b/3rdparty/libpng/pngrutil.c index aa592ccfbd..5c4dbc3929 100644 --- a/3rdparty/libpng/pngrutil.c +++ b/3rdparty/libpng/pngrutil.c @@ -3662,7 +3662,7 @@ png_read_filter_row_paeth_multibyte_pixel(png_row_infop row_info, png_bytep row, #ifdef PNG_ARM_NEON -#ifdef __linux__ +#if defined __linux__ && !defined __ANDROID__ #include #include #include @@ -3695,7 +3695,7 @@ static int png_have_hwcap(unsigned cap) static void png_init_filter_functions_neon(png_structp pp, unsigned int bpp) { -#ifdef __linux__ +#if defined __linux__ && !defined __ANDROID__ if (!png_have_hwcap(HWCAP_NEON)) return; #endif