codyc / libyuv

Automatically exported from code.google.com/p/libyuv
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Add Sobel effect #201

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Sobel is useful for edge detection.  The C version implements fairly slow.. 
about 10 ms/frame, using SSE for sqrt.
Optimize for SSE2.

Start with low level Sobel X / Y functions
void SobelYRow_SSE2(const uint8* src_y0, const uint8* src_y1,            
                    uint8* dst_sobely, int width);   
void SobelXRow_SSE2(const uint8* src_y0, const uint8* src_y1, 
                    const uint8* src_y2, uint8* dst_sobelx, int width);  

Original issue reported on code.google.com by fbarch...@chromium.org on 13 Mar 2013 at 7:15

GoogleCodeExporter commented 8 years ago
r608 adds SobelX and SobelY low level row functions and unittest.

Original comment by fbarch...@chromium.org on 18 Mar 2013 at 10:57

GoogleCodeExporter commented 8 years ago
r609 adds ARGBSobel.
1207 - [       OK ] libyuvTest.ARGBSobel_Any (1207 ms)
1198 - [       OK ] libyuvTest.ARGBSobel_Unaligned (1198 ms)
1188 - [       OK ] libyuvTest.ARGBSobel_Invert (1188 ms)
1151 - [       OK ] libyuvTest.ARGBSobel_Opt (1151 ms)
266 - [       OK ] libyuvTest.TestSobelX (266 ms)
261 - [       OK ] libyuvTest.TestSobelY (261 ms)

Original comment by fbarch...@chromium.org on 19 Mar 2013 at 7:26

GoogleCodeExporter commented 8 years ago
r610 adds SobelXY and r611 optimizes Sobel from 5 steps to 4 steps.
2218 - [       OK ] libyuvTest.ARGBSobel_Any (2218 ms)
2193 - [       OK ] libyuvTest.ARGBSobelXY_Any (2193 ms)
1060 - [       OK ] libyuvTest.ARGBSobel_Unaligned (1060 ms)
1055 - [       OK ] libyuvTest.ARGBSobelXY_Unaligned (1055 ms)
1043 - [       OK ] libyuvTest.ARGBSobel_Invert (1043 ms)
1033 - [       OK ] libyuvTest.ARGBSobel_Opt (1033 ms)
1032 - [       OK ] libyuvTest.ARGBSobelXY_Invert (1032 ms)
1025 - [       OK ] libyuvTest.ARGBSobelXY_Opt (1025 ms)
294 - [       OK ] libyuvTest.TestSobelY (294 ms)
282 - [       OK ] libyuvTest.TestSobelX (282 ms)
145 - [       OK ] libyuvTest.TestSobel (145 ms)
138 - [       OK ] libyuvTest.TestSobelXY (138 ms)
[==========] 12 tests from 1 test case ran. (11518 ms total)

Original comment by fbarch...@chromium.org on 20 Mar 2013 at 12:03

GoogleCodeExporter commented 8 years ago
r614 switches to G channel which is consistent and more efficient on all CPUs, 
and reduces stack usage.

Original comment by fbarch...@chromium.org on 22 Mar 2013 at 4:48

GoogleCodeExporter commented 8 years ago
Arm version needs optimization
[       OK ] libyuvTest.TestSobelX (5226 ms)
[       OK ] libyuvTest.TestSobelY (4703 ms)
[       OK ] libyuvTest.TestSobel (2783 ms)
[       OK ] libyuvTest.TestSobelXY (2778 ms)
[       OK ] libyuvTest.ARGBSobel_Any (14363 ms)
[       OK ] libyuvTest.ARGBSobel_Unaligned (14446 ms)
[       OK ] libyuvTest.ARGBSobel_Invert (14547 ms)
[       OK ] libyuvTest.ARGBSobel_Opt (14424 ms)
[       OK ] libyuvTest.ARGBSobelXY_Any (14399 ms)
[       OK ] libyuvTest.ARGBSobelXY_Unaligned (14424 ms)
[       OK ] libyuvTest.ARGBSobelXY_Invert (14539 ms)
[       OK ] libyuvTest.ARGBSobelXY_Opt (14392 ms)
[----------] 12 tests from libyuvTest (131026 ms total)

Original comment by fbarch...@google.com on 2 Apr 2013 at 9:44

GoogleCodeExporter commented 8 years ago
Arm optimized in r644
[       OK ] libyuvTest.TestSobelX (945 ms)
[       OK ] libyuvTest.TestSobelY (916 ms)
[       OK ] libyuvTest.TestSobel (608 ms)
[       OK ] libyuvTest.TestSobelXY (537 ms)
[       OK ] libyuvTest.ARGBSobel_Any (6288 ms)
[       OK ] libyuvTest.ARGBSobel_Unaligned (4458 ms)
[       OK ] libyuvTest.ARGBSobel_Invert (4457 ms)
[       OK ] libyuvTest.ARGBSobel_Opt (4295 ms)
[       OK ] libyuvTest.ARGBSobelXY_Any (6275 ms)
[       OK ] libyuvTest.ARGBSobelXY_Unaligned (4430 ms)
[       OK ] libyuvTest.ARGBSobelXY_Invert (4401 ms)
[       OK ] libyuvTest.ARGBSobelXY_Opt (4282 ms)
[----------] 12 tests from libyuvTest (41893 ms total)

Original comment by fbarch...@chromium.org on 5 Apr 2013 at 4:23