Coverage Report

Created: 2026-01-25 07:18

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libpng-1.6.50/intel/intel_init.c
Line
Count
Source
1
/* intel_init.c - SSE2 optimized filter functions
2
 *
3
 * Copyright (c) 2018 Cosmin Truta
4
 * Copyright (c) 2016-2017 Glenn Randers-Pehrson
5
 * Written by Mike Klein and Matt Sarett, Google, Inc.
6
 * Derived from arm/arm_init.c
7
 *
8
 * This code is released under the libpng license.
9
 * For conditions of distribution and use, see the disclaimer
10
 * and license in png.h
11
 */
12
13
#include "../pngpriv.h"
14
15
#ifdef PNG_READ_SUPPORTED
16
#if PNG_INTEL_SSE_IMPLEMENTATION > 0
17
18
void
19
png_init_filter_functions_sse2(png_structp pp, unsigned int bpp)
20
895
{
21
   /* The techniques used to implement each of these filters in SSE operate on
22
    * one pixel at a time.
23
    * So they generally speed up 3bpp images about 3x, 4bpp images about 4x.
24
    * They can scale up to 6 and 8 bpp images and down to 2 bpp images,
25
    * but they'd not likely have any benefit for 1bpp images.
26
    * Most of these can be implemented using only MMX and 64-bit registers,
27
    * but they end up a bit slower than using the equally-ubiquitous SSE2.
28
   */
29
895
   png_debug(1, "in png_init_filter_functions_sse2");
30
895
   if (bpp == 3)
31
485
   {
32
485
      pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub3_sse2;
33
485
      pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg3_sse2;
34
485
      pp->read_filter[PNG_FILTER_VALUE_PAETH-1] =
35
485
         png_read_filter_row_paeth3_sse2;
36
485
   }
37
410
   else if (bpp == 4)
38
333
   {
39
333
      pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub4_sse2;
40
333
      pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg4_sse2;
41
333
      pp->read_filter[PNG_FILTER_VALUE_PAETH-1] =
42
333
          png_read_filter_row_paeth4_sse2;
43
333
   }
44
45
   /* No need optimize PNG_FILTER_VALUE_UP.  The compiler should
46
    * autovectorize.
47
    */
48
895
}
49
50
#endif /* PNG_INTEL_SSE_IMPLEMENTATION > 0 */
51
#endif /* PNG_READ_SUPPORTED */