Skip to content

Fix alignment check and stride usage in AbsDifference function#306

Merged
ermig1979 merged 1 commit intoermig1979:masterfrom
yuchangminghit:fix-AbsDifference
Feb 18, 2026
Merged

Fix alignment check and stride usage in AbsDifference function#306
ermig1979 merged 1 commit intoermig1979:masterfrom
yuchangminghit:fix-AbsDifference

Conversation

@yuchangminghit
Copy link
Copy Markdown
Contributor

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.

@ermig1979 ermig1979 merged commit 9cd4b87 into ermig1979:master Feb 18, 2026
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.

2 participants