2016-02-15 14:41:27 -05:00
|
|
|
|
|
|
|
/* intel_init.c - SSE2 optimized filter functions
|
|
|
|
*
|
|
|
|
* Copyright (c) 2016 Google, Inc.
|
|
|
|
*
|
|
|
|
* This code is released under the libpng license.
|
|
|
|
* For conditions of distribution and use, see the disclaimer
|
|
|
|
* and license in png.h
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "../pngpriv.h"
|
|
|
|
|
|
|
|
#ifdef PNG_READ_SUPPORTED
|
2016-02-15 14:45:14 -05:00
|
|
|
#if PNG_INTEL_SSE_OPT > 0
|
2016-02-15 14:41:27 -05:00
|
|
|
|
|
|
|
void
|
|
|
|
png_init_filter_functions_sse2(png_structp pp, unsigned int bpp)
|
|
|
|
{
|
|
|
|
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.
|
|
|
|
}
|
|
|
|
|
2016-02-15 14:45:14 -05:00
|
|
|
#endif /* PNG_INTEL_SSE_OPT > 0 */
|
2016-02-15 14:41:27 -05:00
|
|
|
#endif /* PNG_READ_SUPPORTED */
|