Skip to content

Commit 0225ced

Browse files
janherlingmeta-codesync[bot]
authored andcommitted
Added SSE-based implementation for patchMirroredBorder8BitPerChannel()
Summary: Activated the corresponding unit test. Reviewed By: enpe Differential Revision: D87555939 Privacy Context Container: L1192943 fbshipit-source-id: 7a8ee163e9d5c3f32998f09e6abd52ed90b94c8b
1 parent 49c6ee7 commit 0225ced

File tree

4 files changed

+475
-4
lines changed

4 files changed

+475
-4
lines changed

impl/ocean/cv/SumSquareDifferences.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,14 @@ uint32_t SumSquareDifferences::patchMirroredBorder8BitPerChannel(const uint8_t*
242242
static_assert(tChannels >= 1u, "Invalid channel number!");
243243
static_assert(tPatchSize % 2u == 1u, "Invalid patch size!");
244244

245-
#if defined(OCEAN_HARDWARE_NEON_VERSION) && OCEAN_HARDWARE_NEON_VERSION >= 10
245+
#if defined(OCEAN_HARDWARE_SSE_VERSION) && OCEAN_HARDWARE_SSE_VERSION >= 41
246+
247+
if constexpr (tPatchSize >= 5u)
248+
{
249+
return SumSquareDifferencesSSE::patchMirroredBorder8BitPerChannel<tChannels, tPatchSize>(image0, image1, width0, height0, width1, height1, centerX0, centerY0, centerX1, centerY1, image0PaddingElements, image1PaddingElements);
250+
}
251+
252+
#elif defined(OCEAN_HARDWARE_NEON_VERSION) && OCEAN_HARDWARE_NEON_VERSION >= 10
246253

247254
if constexpr (tPatchSize >= 5u)
248255
{

impl/ocean/cv/SumSquareDifferencesNEON.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ inline unsigned int SumSquareDifferencesNEON::mirrorIndex(const int elementIndex
518518
}
519519
else
520520
{
521-
ocean_assert(elementIndex >= elements);
521+
ocean_assert((unsigned int)(elementIndex) >= elements);
522522

523523
const unsigned int rightElements = elementIndex - elements;
524524

0 commit comments

Comments
 (0)