Skip to content

Fix alignment check and stride usage in AbsDifference function#306

Open
yuchangminghit wants to merge 1 commit intoermig1979:masterfrom
yuchangminghit:fix-AbsDifference
Open

Fix alignment check and stride usage in AbsDifference function#306
yuchangminghit wants to merge 1 commit intoermig1979:masterfrom
yuchangminghit:fix-AbsDifference

Conversation

@yuchangminghit
Copy link

This pull request addresses two issues in the AbsDifference function:

1.Alignment check for output image c:
When the input images a and b are aligned, the output image c is directly assumed to be aligned without performing an alignment check.
In NEON, it assumes 16‑byte alignment:

uint8_t* _p = (uint8_t*)__builtin_assume_aligned(p, 16);
vst1q_u8(_p, a);

In AVX2, it assumes 32‑byte alignment:

_mm256_store_si256(p, a);

2.Stride assignment for output pointer:
Change c += bStride; to c += cStride; for clarity, although the original code does not affect the calculation result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant