Skip to content

Commit

Permalink
Fix an error in SIMD code of the Sobel operator
Browse files Browse the repository at this point in the history
  • Loading branch information
HolyWu committed Mar 18, 2016
1 parent 43644fe commit cfe9677
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions TCanny/TCanny.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,9 @@ static void detectEdge(float * _srcp, float * _gimg, float * _dimg, const int wi
- Vec8f().load_a(srcp + x + stride - 1) - Vec8f().load(srcp + x + stride) - Vec8f().load(srcp + x + stride + 1)) * pointFive;
} else {
dx = Vec8f().load(srcp + x - stride + 1) + mul_add(two, Vec8f().load(srcp + x + 1), Vec8f().load(srcp + x + stride + 1))
- Vec8f().load_a(srcp + x - stride - 1) - mul_sub(two, Vec8f().load_a(srcp + x - 1), Vec8f().load_a(srcp + x + stride - 1));
- Vec8f().load_a(srcp + x - stride - 1) - mul_add(two, Vec8f().load_a(srcp + x - 1), Vec8f().load_a(srcp + x + stride - 1));
dy = Vec8f().load_a(srcp + x - stride - 1) + mul_add(two, Vec8f().load(srcp + x - stride), Vec8f().load(srcp + x - stride + 1))
- Vec8f().load_a(srcp + x + stride - 1) - mul_sub(two, Vec8f().load(srcp + x + stride), Vec8f().load(srcp + x + stride + 1));
- Vec8f().load_a(srcp + x + stride - 1) - mul_add(two, Vec8f().load(srcp + x + stride), Vec8f().load(srcp + x + stride + 1));
}

sqrt(mul_add(dx, dx, dy * dy)).store(gimg + x);
Expand Down

0 comments on commit cfe9677

Please sign in to comment.