diff options
author | Dinesh K Garg <dineshg@codeaurora.org> | 2010-12-28 15:43:58 -0800 |
---|---|---|
committer | Steve Kondik <shade@chemlab.org> | 2012-07-10 12:53:19 -0700 |
commit | fb9d57017268c5cbe74145e3a677b473b14e0e36 (patch) | |
tree | f8d046cee468510ebcc4e58fccc0a3535080cbba /pngrutil.c | |
parent | 4c5554b04e73f89d4a9bab8cbcec1943d8c274be (diff) | |
download | external_libpng-fb9d57017268c5cbe74145e3a677b473b14e0e36.zip external_libpng-fb9d57017268c5cbe74145e3a677b473b14e0e36.tar.gz external_libpng-fb9d57017268c5cbe74145e3a677b473b14e0e36.tar.bz2 |
VeNum optimizations to libpng to improve PNG decode time
Set correct counter in neon routine for SUB filter type.
Enable Neon optimizations for all filter types and pixel depths.
Change-Id: Ica0d39e828a9e0cba59cbc3632830e4eb3e59607
(cherry picked from commit b912f64bc4bb174fc055cda58e303faaa640b8b1)
Conflicts:
pngrutil.c
Diffstat (limited to 'pngrutil.c')
-rw-r--r-- | pngrutil.c | 20 |
1 files changed, 10 insertions, 10 deletions
@@ -3,6 +3,7 @@ * * Last changed in libpng 1.2.45 [July 7, 2011] * Copyright (c) 1998-2011 Glenn Randers-Pehrson + * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved. * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * @@ -23,6 +24,10 @@ # define WIN32_WCE_OLD #endif +#if defined(__ARM_HAVE_NEON) +extern void png_read_filter_row_neon(png_uint_32 rowbytes, png_byte pixel_depth, png_bytep row, png_bytep prev_row, int filter); +#endif + #ifdef PNG_FLOATING_POINT_SUPPORTED # ifdef WIN32_WCE_OLD /* The strtod() function is not supported on WindowsCE */ @@ -2959,6 +2964,10 @@ png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep row, { png_debug(1, "in png_read_filter_row"); png_debug2(2, "row = %lu, filter = %d", png_ptr->row_number, filter); + +#if defined(__ARM_HAVE_NEON) + png_read_filter_row_neon(row_info->rowbytes, row_info->pixel_depth, row, prev_row, filter); +#else switch (filter) { case PNG_FILTER_VALUE_NONE: @@ -3052,16 +3061,6 @@ png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep row, pb = pc < 0 ? -pc : pc; pc = (p + pc) < 0 ? -(p + pc) : p + pc; #endif - - /* - if (pa <= pb && pa <= pc) - p = a; - else if (pb <= pc) - p = b; - else - p = c; - */ - p = (pa <= pb && pa <= pc) ? a : (pb <= pc) ? b : c; *rp = (png_byte)(((int)(*rp) + p) & 0xff); @@ -3074,6 +3073,7 @@ png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep row, *row = 0; break; } +#endif } #ifdef PNG_INDEX_SUPPORTED |