1
0
Fork 0
mirror of https://github.com/Raymo111/i3lock-color.git synced 2024-11-11 13:50:52 -05:00

Minor style changes

This commit is contained in:
Sebastian Frysztak 2017-02-15 11:27:43 +01:00
parent 3598cf19e8
commit 024dc2980e
2 changed files with 4 additions and 5 deletions

4
blur.c
View file

@ -1,6 +1,6 @@
/* /*
* Copyright © 2008 Kristian ¸gsberg * Copyright © 2008 Kristian gsberg
* Copyright © 2009 Chris Wilson * Copyright © 2009 Chris Wilson
* *
* Permission to use, copy, modify, distribute, and sell this software and its * Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that * documentation for any purpose is hereby granted without fee, provided that

View file

@ -10,7 +10,6 @@
#include "blur.h" #include "blur.h"
#include <xmmintrin.h> #include <xmmintrin.h>
#define ALIGN16 __attribute__((aligned(16)))
// number of xmm registers needed to store input pixels for given kernel size // number of xmm registers needed to store input pixels for given kernel size
#define REGISTERS_CNT (KERNEL_SIZE + 4/2) / 4 #define REGISTERS_CNT (KERNEL_SIZE + 4/2) / 4
@ -22,7 +21,7 @@ void blur_impl_horizontal_pass_sse2(uint32_t *src, uint32_t *dst, int width, int
// handle borders // handle borders
int leftBorder = column < HALF_KERNEL; int leftBorder = column < HALF_KERNEL;
int rightBorder = column > width - HALF_KERNEL; int rightBorder = column > width - HALF_KERNEL;
uint32_t _rgbaIn[KERNEL_SIZE] ALIGN16; uint32_t _rgbaIn[KERNEL_SIZE] __attribute__((aligned(16)));
int i = 0; int i = 0;
if (leftBorder) { if (leftBorder) {
// for kernel size 7x7 and column == 0, we have: // for kernel size 7x7 and column == 0, we have:
@ -65,7 +64,7 @@ void blur_impl_horizontal_pass_sse2(uint32_t *src, uint32_t *dst, int width, int
// multiplication is significantly faster than division // multiplication is significantly faster than division
acc = _mm_cvtps_epi32(_mm_mul_ps(_mm_cvtepi32_ps(acc), acc = _mm_cvtps_epi32(_mm_mul_ps(_mm_cvtepi32_ps(acc),
_mm_set1_ps(1/((float)KERNEL_SIZE)))); _mm_set1_ps(1.0/KERNEL_SIZE)));
*(dst + height * column + row) = *(dst + height * column + row) =
_mm_cvtsi128_si32(_mm_packus_epi16(_mm_packs_epi32(acc, zero), zero)); _mm_cvtsi128_si32(_mm_packus_epi16(_mm_packs_epi32(acc, zero), zero));