2626 * whichever of a, b, or c is closest to p=a+b-c.
2727 */
2828
29- static __m128i load4 (const void * p ) {
29+ static __m128i
30+ load4 (const void * p )
31+ {
3032 int tmp ;
3133 memcpy (& tmp , p , sizeof (tmp ));
3234 return _mm_cvtsi32_si128 (tmp );
3335}
3436
35- static void store4 (void * p , __m128i v ) {
37+ static void
38+ store4 (void * p , __m128i v )
39+ {
3640 int tmp = _mm_cvtsi128_si32 (v );
3741 memcpy (p , & tmp , sizeof (int ));
3842}
3943
40- static __m128i load3 (const void * p ) {
44+ static __m128i
45+ load3 (const void * p )
46+ {
4147 png_uint_32 tmp = 0 ;
4248 memcpy (& tmp , p , 3 );
4349 return _mm_cvtsi32_si128 (tmp );
4450}
4551
46- static void store3 (void * p , __m128i v ) {
52+ static void
53+ store3 (void * p , __m128i v )
54+ {
4755 int tmp = _mm_cvtsi128_si32 (v );
4856 memcpy (p , & tmp , 3 );
4957}
5058
51- void png_read_filter_row_sub3_sse2 (png_row_infop row_info , png_bytep row ,
52- png_const_bytep prev )
59+ void
60+ png_read_filter_row_sub3_sse2 (png_row_infop row_info , png_bytep row ,
61+ png_const_bytep prev )
5362{
5463 /* The Sub filter predicts each pixel as the previous pixel, a.
5564 * There is no pixel to the left of the first pixel. It's encoded directly.
@@ -81,8 +90,9 @@ void png_read_filter_row_sub3_sse2(png_row_infop row_info, png_bytep row,
8190 PNG_UNUSED (prev )
8291}
8392
84- void png_read_filter_row_sub4_sse2 (png_row_infop row_info , png_bytep row ,
85- png_const_bytep prev )
93+ void
94+ png_read_filter_row_sub4_sse2 (png_row_infop row_info , png_bytep row ,
95+ png_const_bytep prev )
8696{
8797 /* The Sub filter predicts each pixel as the previous pixel, a.
8898 * There is no pixel to the left of the first pixel. It's encoded directly.
@@ -106,8 +116,9 @@ void png_read_filter_row_sub4_sse2(png_row_infop row_info, png_bytep row,
106116 PNG_UNUSED (prev )
107117}
108118
109- void png_read_filter_row_avg3_sse2 (png_row_infop row_info , png_bytep row ,
110- png_const_bytep prev )
119+ void
120+ png_read_filter_row_avg3_sse2 (png_row_infop row_info , png_bytep row ,
121+ png_const_bytep prev )
111122{
112123 /* The Avg filter predicts each pixel as the (truncated) average of a and b.
113124 * There's no pixel to the left of the first pixel. Luckily, it's
@@ -119,7 +130,7 @@ void png_read_filter_row_avg3_sse2(png_row_infop row_info, png_bytep row,
119130
120131 const __m128i zero = _mm_setzero_si128 ();
121132
122- __m128i b ;
133+ __m128i b ;
123134 __m128i a , d = zero ;
124135
125136 png_debug (1 , "in png_read_filter_row_avg3_sse2" );
@@ -161,8 +172,9 @@ void png_read_filter_row_avg3_sse2(png_row_infop row_info, png_bytep row,
161172 }
162173}
163174
164- void png_read_filter_row_avg4_sse2 (png_row_infop row_info , png_bytep row ,
165- png_const_bytep prev )
175+ void
176+ png_read_filter_row_avg4_sse2 (png_row_infop row_info , png_bytep row ,
177+ png_const_bytep prev )
166178{
167179 /* The Avg filter predicts each pixel as the (truncated) average of a and b.
168180 * There's no pixel to the left of the first pixel. Luckily, it's
@@ -171,7 +183,7 @@ void png_read_filter_row_avg4_sse2(png_row_infop row_info, png_bytep row,
171183 */
172184 size_t rb ;
173185 const __m128i zero = _mm_setzero_si128 ();
174- __m128i b ;
186+ __m128i b ;
175187 __m128i a , d = zero ;
176188
177189 png_debug (1 , "in png_read_filter_row_avg4_sse2" );
@@ -198,7 +210,9 @@ void png_read_filter_row_avg4_sse2(png_row_infop row_info, png_bytep row,
198210}
199211
200212/* Returns |x| for 16-bit lanes. */
201- static __m128i abs_i16 (__m128i x ) {
213+ static __m128i
214+ abs_i16 (__m128i x )
215+ {
202216#if PNG_INTEL_SSE_IMPLEMENTATION >= 2
203217 return _mm_abs_epi16 (x );
204218#else
@@ -217,16 +231,19 @@ static __m128i abs_i16(__m128i x) {
217231}
218232
219233/* Bytewise c ? t : e. */
220- static __m128i if_then_else (__m128i c , __m128i t , __m128i e ) {
234+ static __m128i
235+ if_then_else (__m128i c , __m128i t , __m128i e )
236+ {
221237#if PNG_INTEL_SSE_IMPLEMENTATION >= 3
222238 return _mm_blendv_epi8 (e ,t ,c );
223239#else
224240 return _mm_or_si128 (_mm_and_si128 (c , t ), _mm_andnot_si128 (c , e ));
225241#endif
226242}
227243
228- void png_read_filter_row_paeth3_sse2 (png_row_infop row_info , png_bytep row ,
229- png_const_bytep prev )
244+ void
245+ png_read_filter_row_paeth3_sse2 (png_row_infop row_info , png_bytep row ,
246+ png_const_bytep prev )
230247{
231248 /* Paeth tries to predict pixel d using the pixel to the left of it, a,
232249 * and two pixels from the previous row, b and c:
@@ -324,8 +341,9 @@ void png_read_filter_row_paeth3_sse2(png_row_infop row_info, png_bytep row,
324341 }
325342}
326343
327- void png_read_filter_row_paeth4_sse2 (png_row_infop row_info , png_bytep row ,
328- png_const_bytep prev )
344+ void
345+ png_read_filter_row_paeth4_sse2 (png_row_infop row_info , png_bytep row ,
346+ png_const_bytep prev )
329347{
330348 /* Paeth tries to predict pixel d using the pixel to the left of it, a,
331349 * and two pixels from the previous row, b and c:
0 commit comments