Skip to content

Commit

Permalink
Simd draft
Browse files Browse the repository at this point in the history
  • Loading branch information
homm committed Jul 5, 2024
1 parent 568fc0e commit c3af7f1
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/libImaging/GetBBox.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,19 +201,17 @@ ImagingGetBBox(Imaging im, int bbox[4], int alpha_only) {
break;
}
}
for (x = im->xsize - 1; x >= bbox[2] + 3; x -= 4) {
for (x = bbox[2]; x < im->xsize - 3; x += 4) {
__m128i src = _mm_loadu_si128((__m128i *)(in + x - 4));
if (! _mm_test_all_zeros(mm_mask, src)) {
for (int xx = x; xx > x - 4; xx--) {
for (int xx = x; xx < x + 4; xx++) {
if (in[xx]) {
bbox[2] = xx + 1;
break;
}
}
break;
}
}
for (; x >= bbox[2]; x--) {
for (; x < im->xsize; x++) {
if (in[x] & mask) {
bbox[2] = x + 1;
break;
Expand Down

0 comments on commit c3af7f1

Please sign in to comment.