mirror of
https://github.com/glennrp/libpng.git
synced 2026-10-24 08:39:18 +03:00
Following up on commit 7c67f70da1:
Replace 22 deprecated pointer typedefs with their underlying types.
The typedefs replaced are:
1. Core structure types:
- png_structp, png_structrp, png_structpp and const variants
- png_infop, png_inforp, png_infopp and const variants
2. Utility structure types:
- png_row_infop, png_row_infopp
- png_imagep, png_imagepp
- png_controlp
3. Color structure types:
- png_colorp, png_colorpp and const variants
- png_color_8p, png_color_8pp and const variants
- png_color_16p, png_color_16pp and const variants
4. Text and time structure types:
- png_textp, png_textpp and const variants
- png_timep, png_timepp and const variants
5. Chunk structure types:
- png_unknown_chunkp, png_unknown_chunkpp and const variants
- png_sPLT_tp, png_sPLT_tpp and const variants
- png_sPLT_entryp, png_sPLT_entrypp and const variants
6. Internal types:
- png_compression_bufferp
- png_dsortp, png_dsortpp
Remove all remaining uses of spurious PNG_RESTRICT qualifiers.
Non-aliasing has already been guaranteed by the type-based aliasing
rules combined with the libpng usage pattern of a single pointer per
type.
Update the user manual accordingly.
This completes the systematic replacement of deprecated pointer
typedefs across the entire libpng codebase. The typedef declarations
remain in png.h for backward compatibility, marked as deprecated.
Reviewed-by: Chris Blume <ProgramMax@gmail.com>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
49 lines
1.7 KiB
C
49 lines
1.7 KiB
C
/* intel_init.c - SSE2 optimized filter functions
|
|
*
|
|
* Copyright (c) 2018 Cosmin Truta
|
|
* Copyright (c) 2016-2017 Glenn Randers-Pehrson
|
|
* Written by Mike Klein and Matt Sarett, Google, Inc.
|
|
* Derived from arm/arm_init.c
|
|
*
|
|
* This code is released under the libpng license.
|
|
* For conditions of distribution and use, see the disclaimer
|
|
* and license in png.h
|
|
*/
|
|
#define png_target_impl "intel-sse"
|
|
|
|
#include "filter_sse2_intrinsics.c"
|
|
|
|
static void
|
|
png_init_filter_functions_sse2(png_struct *pp, unsigned int bpp)
|
|
{
|
|
/* The techniques used to implement each of these filters in SSE operate on
|
|
* one pixel at a time.
|
|
* So they generally speed up 3bpp images about 3x, 4bpp images about 4x.
|
|
* They can scale up to 6 and 8 bpp images and down to 2 bpp images,
|
|
* but they'd not likely have any benefit for 1bpp images.
|
|
* Most of these can be implemented using only MMX and 64-bit registers,
|
|
* but they end up a bit slower than using the equally-ubiquitous SSE2.
|
|
*/
|
|
png_debug(1, "in png_init_filter_functions_sse2");
|
|
if (bpp == 3)
|
|
{
|
|
pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub3_sse2;
|
|
pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg3_sse2;
|
|
pp->read_filter[PNG_FILTER_VALUE_PAETH-1] =
|
|
png_read_filter_row_paeth3_sse2;
|
|
}
|
|
else if (bpp == 4)
|
|
{
|
|
pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub4_sse2;
|
|
pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg4_sse2;
|
|
pp->read_filter[PNG_FILTER_VALUE_PAETH-1] =
|
|
png_read_filter_row_paeth4_sse2;
|
|
}
|
|
|
|
/* No need optimize PNG_FILTER_VALUE_UP. The compiler should
|
|
* autovectorize.
|
|
*/
|
|
}
|
|
|
|
#define png_target_init_filter_functions_impl png_init_filter_functions_sse2
|