mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-20 20:24:45 +03:00
SIMD Resample. fix wrong usage of xmax for division compensation
This commit is contained in:
parent
247cba2e30
commit
b3c28911c0
|
@ -231,10 +231,11 @@ ImagingResampleHorizontalConvolution8u(UINT32 *lineOut, UINT32 *lineIn,
|
|||
#if defined(__AVX2__)
|
||||
|
||||
if (xmax < 8) {
|
||||
sss = _mm_set1_epi32((1 << (coefs_precision -1)) + xmax / 2);
|
||||
sss = _mm_set1_epi32(1 << (coefs_precision-1));
|
||||
} else {
|
||||
|
||||
__m256i sss256 = _mm256_set1_epi32((1 << (coefs_precision -2)) + xmax / 4);
|
||||
// Lower part will be added to higher, use only half of the error
|
||||
__m256i sss256 = _mm256_set1_epi32(1 << (coefs_precision-2));
|
||||
|
||||
for (; x < xmax - 7; x += 8) {
|
||||
__m256i pix, mmk, source;
|
||||
|
@ -289,7 +290,7 @@ ImagingResampleHorizontalConvolution8u(UINT32 *lineOut, UINT32 *lineIn,
|
|||
|
||||
#else
|
||||
|
||||
sss = _mm_set1_epi32((1 << (coefs_precision -1)) + xmax / 2);
|
||||
sss = _mm_set1_epi32(1 << (coefs_precision-1));
|
||||
|
||||
for (; x < xmax - 7; x += 8) {
|
||||
__m128i pix, mmk, source;
|
||||
|
|
Loading…
Reference in New Issue
Block a user