ImBuf: optimize IMB_transform #115653

Merged
Aras Pranckevicius merged 15 commits from aras_p/blender:imb_transform_opt into main 2023-12-14 15:10:41 +01:00
1 changed files with 4 additions and 4 deletions
Showing only changes of commit 0bc8f85648 - Show all commits

View File

@ -414,10 +414,10 @@ void BLI_bilinear_interpolation_char(
int ycoord[4];
_mm_storeu_ps((float *)xcoord, _mm_castsi128_ps(x1234));
_mm_storeu_ps((float *)ycoord, _mm_castsi128_ps(y1234));
int sample1 = ((const int *)buffer)[ycoord[0] * (size_t)width + xcoord[0]];
int sample2 = ((const int *)buffer)[ycoord[1] * (size_t)width + xcoord[1]];
int sample3 = ((const int *)buffer)[ycoord[2] * (size_t)width + xcoord[2]];
int sample4 = ((const int *)buffer)[ycoord[3] * (size_t)width + xcoord[3]];
int sample1 = ((const int *)buffer)[ycoord[0] * (int64_t)width + xcoord[0]];
int sample2 = ((const int *)buffer)[ycoord[1] * (int64_t)width + xcoord[1]];
int sample3 = ((const int *)buffer)[ycoord[2] * (int64_t)width + xcoord[2]];
int sample4 = ((const int *)buffer)[ycoord[3] * (int64_t)width + xcoord[3]];
__m128i samples1234 = _mm_set_epi32(sample4, sample3, sample2, sample1);
/* Set samples to black for the ones that were actually invalid. */
samples1234 = _mm_andnot_si128(invalid_1234, samples1234);