@@ -1333,7 +1333,7 @@ struct InRange_SIMD
1333
1333
}
1334
1334
};
1335
1335
1336
- #if CV_SIMD128
1336
+ #if CV_SIMD
1337
1337
1338
1338
template <>
1339
1339
struct InRange_SIMD <uchar>
@@ -1342,16 +1342,17 @@ struct InRange_SIMD<uchar>
1342
1342
uchar * dst, int len) const
1343
1343
{
1344
1344
int x = 0 ;
1345
- const int width = v_uint8x16 ::nlanes;
1345
+ const int width = v_uint8 ::nlanes;
1346
1346
1347
1347
for (; x <= len - width; x += width)
1348
1348
{
1349
- v_uint8x16 values = v_load (src1 + x);
1350
- v_uint8x16 low = v_load (src2 + x);
1351
- v_uint8x16 high = v_load (src3 + x);
1349
+ v_uint8 values = vx_load (src1 + x);
1350
+ v_uint8 low = vx_load (src2 + x);
1351
+ v_uint8 high = vx_load (src3 + x);
1352
1352
1353
1353
v_store (dst + x, (values >= low) & (high >= values));
1354
1354
}
1355
+ vx_cleanup ();
1355
1356
return x;
1356
1357
}
1357
1358
};
@@ -1363,16 +1364,17 @@ struct InRange_SIMD<schar>
1363
1364
uchar * dst, int len) const
1364
1365
{
1365
1366
int x = 0 ;
1366
- const int width = v_int8x16 ::nlanes;
1367
+ const int width = v_int8 ::nlanes;
1367
1368
1368
1369
for (; x <= len - width; x += width)
1369
1370
{
1370
- v_int8x16 values = v_load (src1 + x);
1371
- v_int8x16 low = v_load (src2 + x);
1372
- v_int8x16 high = v_load (src3 + x);
1371
+ v_int8 values = vx_load (src1 + x);
1372
+ v_int8 low = vx_load (src2 + x);
1373
+ v_int8 high = vx_load (src3 + x);
1373
1374
1374
1375
v_store ((schar*)(dst + x), (values >= low) & (high >= values));
1375
1376
}
1377
+ vx_cleanup ();
1376
1378
return x;
1377
1379
}
1378
1380
};
@@ -1384,20 +1386,21 @@ struct InRange_SIMD<ushort>
1384
1386
uchar * dst, int len) const
1385
1387
{
1386
1388
int x = 0 ;
1387
- const int width = v_uint16x8 ::nlanes * 2 ;
1389
+ const int width = v_uint16 ::nlanes * 2 ;
1388
1390
1389
1391
for (; x <= len - width; x += width)
1390
1392
{
1391
- v_uint16x8 values1 = v_load (src1 + x);
1392
- v_uint16x8 low1 = v_load (src2 + x);
1393
- v_uint16x8 high1 = v_load (src3 + x);
1393
+ v_uint16 values1 = vx_load (src1 + x);
1394
+ v_uint16 low1 = vx_load (src2 + x);
1395
+ v_uint16 high1 = vx_load (src3 + x);
1394
1396
1395
- v_uint16x8 values2 = v_load (src1 + x + v_uint16x8 ::nlanes);
1396
- v_uint16x8 low2 = v_load (src2 + x + v_uint16x8 ::nlanes);
1397
- v_uint16x8 high2 = v_load (src3 + x + v_uint16x8 ::nlanes);
1397
+ v_uint16 values2 = vx_load (src1 + x + v_uint16 ::nlanes);
1398
+ v_uint16 low2 = vx_load (src2 + x + v_uint16 ::nlanes);
1399
+ v_uint16 high2 = vx_load (src3 + x + v_uint16 ::nlanes);
1398
1400
1399
1401
v_store (dst + x, v_pack ((values1 >= low1) & (high1 >= values1), (values2 >= low2) & (high2 >= values2)));
1400
1402
}
1403
+ vx_cleanup ();
1401
1404
return x;
1402
1405
}
1403
1406
};
@@ -1409,20 +1412,21 @@ struct InRange_SIMD<short>
1409
1412
uchar * dst, int len) const
1410
1413
{
1411
1414
int x = 0 ;
1412
- const int width = (int )v_int16x8 ::nlanes * 2 ;
1415
+ const int width = (int )v_int16 ::nlanes * 2 ;
1413
1416
1414
1417
for (; x <= len - width; x += width)
1415
1418
{
1416
- v_int16x8 values1 = v_load (src1 + x);
1417
- v_int16x8 low1 = v_load (src2 + x);
1418
- v_int16x8 high1 = v_load (src3 + x);
1419
+ v_int16 values1 = vx_load (src1 + x);
1420
+ v_int16 low1 = vx_load (src2 + x);
1421
+ v_int16 high1 = vx_load (src3 + x);
1419
1422
1420
- v_int16x8 values2 = v_load (src1 + x + v_int16x8 ::nlanes);
1421
- v_int16x8 low2 = v_load (src2 + x + v_int16x8 ::nlanes);
1422
- v_int16x8 high2 = v_load (src3 + x + v_int16x8 ::nlanes);
1423
+ v_int16 values2 = vx_load (src1 + x + v_int16 ::nlanes);
1424
+ v_int16 low2 = vx_load (src2 + x + v_int16 ::nlanes);
1425
+ v_int16 high2 = vx_load (src3 + x + v_int16 ::nlanes);
1423
1426
1424
1427
v_store ((schar*)(dst + x), v_pack ((values1 >= low1) & (high1 >= values1), (values2 >= low2) & (high2 >= values2)));
1425
1428
}
1429
+ vx_cleanup ();
1426
1430
return x;
1427
1431
}
1428
1432
};
@@ -1434,20 +1438,21 @@ struct InRange_SIMD<int>
1434
1438
uchar * dst, int len) const
1435
1439
{
1436
1440
int x = 0 ;
1437
- const int width = (int )v_int32x4 ::nlanes * 2 ;
1441
+ const int width = (int )v_int32 ::nlanes * 2 ;
1438
1442
1439
1443
for (; x <= len - width; x += width)
1440
1444
{
1441
- v_int32x4 values1 = v_load (src1 + x);
1442
- v_int32x4 low1 = v_load (src2 + x);
1443
- v_int32x4 high1 = v_load (src3 + x);
1445
+ v_int32 values1 = vx_load (src1 + x);
1446
+ v_int32 low1 = vx_load (src2 + x);
1447
+ v_int32 high1 = vx_load (src3 + x);
1444
1448
1445
- v_int32x4 values2 = v_load (src1 + x + v_int32x4 ::nlanes);
1446
- v_int32x4 low2 = v_load (src2 + x + v_int32x4 ::nlanes);
1447
- v_int32x4 high2 = v_load (src3 + x + v_int32x4 ::nlanes);
1449
+ v_int32 values2 = vx_load (src1 + x + v_int32 ::nlanes);
1450
+ v_int32 low2 = vx_load (src2 + x + v_int32 ::nlanes);
1451
+ v_int32 high2 = vx_load (src3 + x + v_int32 ::nlanes);
1448
1452
1449
1453
v_pack_store (dst + x, v_reinterpret_as_u16 (v_pack ((values1 >= low1) & (high1 >= values1), (values2 >= low2) & (high2 >= values2))));
1450
1454
}
1455
+ vx_cleanup ();
1451
1456
return x;
1452
1457
}
1453
1458
};
@@ -1459,20 +1464,21 @@ struct InRange_SIMD<float>
1459
1464
uchar * dst, int len) const
1460
1465
{
1461
1466
int x = 0 ;
1462
- const int width = (int )v_float32x4 ::nlanes * 2 ;
1467
+ const int width = (int )v_float32 ::nlanes * 2 ;
1463
1468
1464
1469
for (; x <= len - width; x += width)
1465
1470
{
1466
- v_float32x4 values1 = v_load (src1 + x);
1467
- v_float32x4 low1 = v_load (src2 + x);
1468
- v_float32x4 high1 = v_load (src3 + x);
1471
+ v_float32 values1 = vx_load (src1 + x);
1472
+ v_float32 low1 = vx_load (src2 + x);
1473
+ v_float32 high1 = vx_load (src3 + x);
1469
1474
1470
- v_float32x4 values2 = v_load (src1 + x + v_float32x4 ::nlanes);
1471
- v_float32x4 low2 = v_load (src2 + x + v_float32x4 ::nlanes);
1472
- v_float32x4 high2 = v_load (src3 + x + v_float32x4 ::nlanes);
1475
+ v_float32 values2 = vx_load (src1 + x + v_float32 ::nlanes);
1476
+ v_float32 low2 = vx_load (src2 + x + v_float32 ::nlanes);
1477
+ v_float32 high2 = vx_load (src3 + x + v_float32 ::nlanes);
1473
1478
1474
1479
v_pack_store (dst + x, v_pack (v_reinterpret_as_u32 ((values1 >= low1) & (high1 >= values1)), v_reinterpret_as_u32 ((values2 >= low2) & (high2 >= values2))));
1475
1480
}
1481
+ vx_cleanup ();
1476
1482
return x;
1477
1483
}
1478
1484
};
0 commit comments