Skip to content

threshold() reworked to use wide universal intrinsics - #13631

Merged
opencv-pushbot merged 1 commit into
opencv:3.4from
terfendail:thresh_wintr
Jan 16, 2019
Merged

opencv-pushbot merged 1 commit into
opencv:3.4from
terfendail:thresh_wintr

Conversation

@terfendail

Copy link
Copy Markdown
Contributor

This pullrequest changes

threshold() reworked to use wide universal intrinsics

@terfendail

Copy link
Copy Markdown
Contributor Author
Performance for SSE2 baseline
Performance test Reference time PR time Speedup
threshold::Size_MatType_ThreshType::(127x61, 8UC1, THRESH_BINARY) 0.000 0.000 0.99
threshold::Size_MatType_ThreshType::(127x61, 8UC1, THRESH_BINARY_INV) 0.000 0.000 1.00
threshold::Size_MatType_ThreshType::(127x61, 8UC1, THRESH_TOZERO) 0.000 0.000 1.00
threshold::Size_MatType_ThreshType::(127x61, 8UC1, THRESH_TOZERO_INV) 0.000 0.000 0.99
threshold::Size_MatType_ThreshType::(127x61, 8UC1, THRESH_TRUNC) 0.000 0.000 0.99
threshold::Size_MatType_ThreshType::(127x61, 16SC1, THRESH_BINARY) 0.001 0.001 0.99
threshold::Size_MatType_ThreshType::(127x61, 16SC1, THRESH_BINARY_INV) 0.001 0.001 1.03
threshold::Size_MatType_ThreshType::(127x61, 16SC1, THRESH_TOZERO) 0.001 0.001 0.99
threshold::Size_MatType_ThreshType::(127x61, 16SC1, THRESH_TOZERO_INV) 0.001 0.001 1.00
threshold::Size_MatType_ThreshType::(127x61, 16SC1, THRESH_TRUNC) 0.001 0.001 0.95
threshold::Size_MatType_ThreshType::(127x61, 32FC1, THRESH_BINARY) 0.001 0.001 1.00
threshold::Size_MatType_ThreshType::(127x61, 32FC1, THRESH_BINARY_INV) 0.001 0.001 1.01
threshold::Size_MatType_ThreshType::(127x61, 32FC1, THRESH_TOZERO) 0.001 0.001 1.00
threshold::Size_MatType_ThreshType::(127x61, 32FC1, THRESH_TOZERO_INV) 0.001 0.001 1.01
threshold::Size_MatType_ThreshType::(127x61, 32FC1, THRESH_TRUNC) 0.001 0.001 1.01
threshold::Size_MatType_ThreshType::(127x61, 64FC1, THRESH_BINARY) 0.002 0.002 1.01
threshold::Size_MatType_ThreshType::(127x61, 64FC1, THRESH_BINARY_INV) 0.002 0.002 1.08
threshold::Size_MatType_ThreshType::(127x61, 64FC1, THRESH_TOZERO) 0.002 0.002 1.02
threshold::Size_MatType_ThreshType::(127x61, 64FC1, THRESH_TOZERO_INV) 0.002 0.002 1.00
threshold::Size_MatType_ThreshType::(127x61, 64FC1, THRESH_TRUNC) 0.002 0.002 1.19
threshold::Size_MatType_ThreshType::(640x480, 8UC1, THRESH_BINARY) 0.013 0.013 1.01
threshold::Size_MatType_ThreshType::(640x480, 8UC1, THRESH_BINARY_INV) 0.013 0.013 1.02
threshold::Size_MatType_ThreshType::(640x480, 8UC1, THRESH_TOZERO) 0.011 0.011 1.00
threshold::Size_MatType_ThreshType::(640x480, 8UC1, THRESH_TOZERO_INV) 0.011 0.011 1.01
threshold::Size_MatType_ThreshType::(640x480, 8UC1, THRESH_TRUNC) 0.010 0.010 1.02
threshold::Size_MatType_ThreshType::(640x480, 16SC1, THRESH_BINARY) 0.032 0.030 1.06
threshold::Size_MatType_ThreshType::(640x480, 16SC1, THRESH_BINARY_INV) 0.030 0.030 1.00
threshold::Size_MatType_ThreshType::(640x480, 16SC1, THRESH_TOZERO) 0.030 0.030 1.00
threshold::Size_MatType_ThreshType::(640x480, 16SC1, THRESH_TOZERO_INV) 0.030 0.030 1.00
threshold::Size_MatType_ThreshType::(640x480, 16SC1, THRESH_TRUNC) 0.030 0.029 1.02
threshold::Size_MatType_ThreshType::(640x480, 32FC1, THRESH_BINARY) 0.091 0.092 1.00
threshold::Size_MatType_ThreshType::(640x480, 32FC1, THRESH_BINARY_INV) 0.091 0.092 0.99
threshold::Size_MatType_ThreshType::(640x480, 32FC1, THRESH_TOZERO) 0.091 0.092 0.99
threshold::Size_MatType_ThreshType::(640x480, 32FC1, THRESH_TOZERO_INV) 0.091 0.092 0.99
threshold::Size_MatType_ThreshType::(640x480, 32FC1, THRESH_TRUNC) 0.091 0.091 0.99
threshold::Size_MatType_ThreshType::(640x480, 64FC1, THRESH_BINARY) 0.184 0.183 1.01
threshold::Size_MatType_ThreshType::(640x480, 64FC1, THRESH_BINARY_INV) 0.183 0.183 1.00
threshold::Size_MatType_ThreshType::(640x480, 64FC1, THRESH_TOZERO) 0.184 0.185 0.99
threshold::Size_MatType_ThreshType::(640x480, 64FC1, THRESH_TOZERO_INV) 0.181 0.185 0.98
threshold::Size_MatType_ThreshType::(640x480, 64FC1, THRESH_TRUNC) 0.182 0.183 0.99
threshold::Size_MatType_ThreshType::(1280x720, 8UC1, THRESH_BINARY) 0.068 0.068 1.00
threshold::Size_MatType_ThreshType::(1280x720, 8UC1, THRESH_BINARY_INV) 0.067 0.067 1.00
threshold::Size_MatType_ThreshType::(1280x720, 8UC1, THRESH_TOZERO) 0.067 0.067 1.00
threshold::Size_MatType_ThreshType::(1280x720, 8UC1, THRESH_TOZERO_INV) 0.067 0.067 1.00
threshold::Size_MatType_ThreshType::(1280x720, 8UC1, THRESH_TRUNC) 0.067 0.067 1.01
threshold::Size_MatType_ThreshType::(1280x720, 16SC1, THRESH_BINARY) 0.139 0.139 1.00
threshold::Size_MatType_ThreshType::(1280x720, 16SC1, THRESH_BINARY_INV) 0.136 0.139 0.98
threshold::Size_MatType_ThreshType::(1280x720, 16SC1, THRESH_TOZERO) 0.137 0.139 0.99
threshold::Size_MatType_ThreshType::(1280x720, 16SC1, THRESH_TOZERO_INV) 0.138 0.139 0.99
threshold::Size_MatType_ThreshType::(1280x720, 16SC1, THRESH_TRUNC) 0.138 0.139 1.00
threshold::Size_MatType_ThreshType::(1280x720, 32FC1, THRESH_BINARY) 0.280 0.279 1.01
threshold::Size_MatType_ThreshType::(1280x720, 32FC1, THRESH_BINARY_INV) 0.283 0.290 0.98
threshold::Size_MatType_ThreshType::(1280x720, 32FC1, THRESH_TOZERO) 0.281 0.290 0.97
threshold::Size_MatType_ThreshType::(1280x720, 32FC1, THRESH_TOZERO_INV) 0.280 0.291 0.96
threshold::Size_MatType_ThreshType::(1280x720, 32FC1, THRESH_TRUNC) 0.279 0.289 0.97
threshold::Size_MatType_ThreshType::(1280x720, 64FC1, THRESH_BINARY) 0.660 0.660 1.00
threshold::Size_MatType_ThreshType::(1280x720, 64FC1, THRESH_BINARY_INV) 0.653 0.647 1.01
threshold::Size_MatType_ThreshType::(1280x720, 64FC1, THRESH_TOZERO) 0.656 0.661 0.99
threshold::Size_MatType_ThreshType::(1280x720, 64FC1, THRESH_TOZERO_INV) 0.658 0.649 1.01
threshold::Size_MatType_ThreshType::(1280x720, 64FC1, THRESH_TRUNC) 0.647 0.664 0.97
threshold::Size_MatType_ThreshType::(1920x1080, 8UC1, THRESH_BINARY) 0.155 0.156 0.99
threshold::Size_MatType_ThreshType::(1920x1080, 8UC1, THRESH_BINARY_INV) 0.154 0.157 0.98
threshold::Size_MatType_ThreshType::(1920x1080, 8UC1, THRESH_TOZERO) 0.155 0.155 1.00
threshold::Size_MatType_ThreshType::(1920x1080, 8UC1, THRESH_TOZERO_INV) 0.155 0.157 0.99
threshold::Size_MatType_ThreshType::(1920x1080, 8UC1, THRESH_TRUNC) 0.153 0.157 0.97
threshold::Size_MatType_ThreshType::(1920x1080, 16SC1, THRESH_BINARY) 0.320 0.323 0.99
threshold::Size_MatType_ThreshType::(1920x1080, 16SC1, THRESH_BINARY_INV) 0.323 0.322 1.00
threshold::Size_MatType_ThreshType::(1920x1080, 16SC1, THRESH_TOZERO) 0.321 0.328 0.98
threshold::Size_MatType_ThreshType::(1920x1080, 16SC1, THRESH_TOZERO_INV) 0.319 0.326 0.98
threshold::Size_MatType_ThreshType::(1920x1080, 16SC1, THRESH_TRUNC) 0.318 0.324 0.98
threshold::Size_MatType_ThreshType::(1920x1080, 32FC1, THRESH_BINARY) 0.770 0.773 1.00
threshold::Size_MatType_ThreshType::(1920x1080, 32FC1, THRESH_BINARY_INV) 0.767 0.762 1.01
threshold::Size_MatType_ThreshType::(1920x1080, 32FC1, THRESH_TOZERO) 0.783 0.761 1.03
threshold::Size_MatType_ThreshType::(1920x1080, 32FC1, THRESH_TOZERO_INV) 0.773 0.774 1.00
threshold::Size_MatType_ThreshType::(1920x1080, 32FC1, THRESH_TRUNC) 0.757 0.756 1.00
threshold::Size_MatType_ThreshType::(1920x1080, 64FC1, THRESH_BINARY) 1.905 1.900 1.00
threshold::Size_MatType_ThreshType::(1920x1080, 64FC1, THRESH_BINARY_INV) 1.876 1.877 1.00
threshold::Size_MatType_ThreshType::(1920x1080, 64FC1, THRESH_TOZERO) 1.892 1.895 1.00
threshold::Size_MatType_ThreshType::(1920x1080, 64FC1, THRESH_TOZERO_INV) 1.882 1.866 1.01
threshold::Size_MatType_ThreshType::(1920x1080, 64FC1, THRESH_TRUNC) 1.856 1.815 1.02
Performance for SSE4_2 baseline
Performance test Reference time PR time Speedup
threshold::Size_MatType_ThreshType::(127x61, 8UC1, THRESH_BINARY) 0.000 0.000 0.99
threshold::Size_MatType_ThreshType::(127x61, 8UC1, THRESH_BINARY_INV) 0.000 0.000 0.99
threshold::Size_MatType_ThreshType::(127x61, 8UC1, THRESH_TOZERO) 0.000 0.000 0.99
threshold::Size_MatType_ThreshType::(127x61, 8UC1, THRESH_TOZERO_INV) 0.000 0.000 0.99
threshold::Size_MatType_ThreshType::(127x61, 8UC1, THRESH_TRUNC) 0.000 0.000 0.99
threshold::Size_MatType_ThreshType::(127x61, 16SC1, THRESH_BINARY) 0.001 0.001 1.04
threshold::Size_MatType_ThreshType::(127x61, 16SC1, THRESH_BINARY_INV) 0.001 0.001 0.98
threshold::Size_MatType_ThreshType::(127x61, 16SC1, THRESH_TOZERO) 0.001 0.001 0.99
threshold::Size_MatType_ThreshType::(127x61, 16SC1, THRESH_TOZERO_INV) 0.001 0.001 1.02
threshold::Size_MatType_ThreshType::(127x61, 16SC1, THRESH_TRUNC) 0.001 0.001 1.01
threshold::Size_MatType_ThreshType::(127x61, 32FC1, THRESH_BINARY) 0.001 0.001 1.01
threshold::Size_MatType_ThreshType::(127x61, 32FC1, THRESH_BINARY_INV) 0.001 0.001 1.01
threshold::Size_MatType_ThreshType::(127x61, 32FC1, THRESH_TOZERO) 0.001 0.001 0.99
threshold::Size_MatType_ThreshType::(127x61, 32FC1, THRESH_TOZERO_INV) 0.001 0.001 1.00
threshold::Size_MatType_ThreshType::(127x61, 32FC1, THRESH_TRUNC) 0.001 0.001 0.99
threshold::Size_MatType_ThreshType::(127x61, 64FC1, THRESH_BINARY) 0.002 0.002 0.95
threshold::Size_MatType_ThreshType::(127x61, 64FC1, THRESH_BINARY_INV) 0.002 0.002 0.97
threshold::Size_MatType_ThreshType::(127x61, 64FC1, THRESH_TOZERO) 0.002 0.002 0.96
threshold::Size_MatType_ThreshType::(127x61, 64FC1, THRESH_TOZERO_INV) 0.002 0.002 0.97
threshold::Size_MatType_ThreshType::(127x61, 64FC1, THRESH_TRUNC) 0.002 0.002 1.15
threshold::Size_MatType_ThreshType::(640x480, 8UC1, THRESH_BINARY) 0.013 0.013 0.99
threshold::Size_MatType_ThreshType::(640x480, 8UC1, THRESH_BINARY_INV) 0.013 0.013 1.00
threshold::Size_MatType_ThreshType::(640x480, 8UC1, THRESH_TOZERO) 0.011 0.011 1.04
threshold::Size_MatType_ThreshType::(640x480, 8UC1, THRESH_TOZERO_INV) 0.011 0.011 0.94
threshold::Size_MatType_ThreshType::(640x480, 8UC1, THRESH_TRUNC) 0.010 0.010 0.99
threshold::Size_MatType_ThreshType::(640x480, 16SC1, THRESH_BINARY) 0.033 0.032 1.03
threshold::Size_MatType_ThreshType::(640x480, 16SC1, THRESH_BINARY_INV) 0.028 0.032 0.88
threshold::Size_MatType_ThreshType::(640x480, 16SC1, THRESH_TOZERO) 0.029 0.032 0.90
threshold::Size_MatType_ThreshType::(640x480, 16SC1, THRESH_TOZERO_INV) 0.029 0.032 0.89
threshold::Size_MatType_ThreshType::(640x480, 16SC1, THRESH_TRUNC) 0.028 0.032 0.89
threshold::Size_MatType_ThreshType::(640x480, 32FC1, THRESH_BINARY) 0.091 0.092 0.98
threshold::Size_MatType_ThreshType::(640x480, 32FC1, THRESH_BINARY_INV) 0.091 0.092 0.99
threshold::Size_MatType_ThreshType::(640x480, 32FC1, THRESH_TOZERO) 0.091 0.093 0.98
threshold::Size_MatType_ThreshType::(640x480, 32FC1, THRESH_TOZERO_INV) 0.091 0.092 0.98
threshold::Size_MatType_ThreshType::(640x480, 32FC1, THRESH_TRUNC) 0.091 0.092 0.99
threshold::Size_MatType_ThreshType::(640x480, 64FC1, THRESH_BINARY) 0.181 0.185 0.98
threshold::Size_MatType_ThreshType::(640x480, 64FC1, THRESH_BINARY_INV) 0.181 0.185 0.98
threshold::Size_MatType_ThreshType::(640x480, 64FC1, THRESH_TOZERO) 0.181 0.185 0.98
threshold::Size_MatType_ThreshType::(640x480, 64FC1, THRESH_TOZERO_INV) 0.181 0.185 0.98
threshold::Size_MatType_ThreshType::(640x480, 64FC1, THRESH_TRUNC) 0.181 0.185 0.98
threshold::Size_MatType_ThreshType::(1280x720, 8UC1, THRESH_BINARY) 0.066 0.068 0.98
threshold::Size_MatType_ThreshType::(1280x720, 8UC1, THRESH_BINARY_INV) 0.066 0.067 0.99
threshold::Size_MatType_ThreshType::(1280x720, 8UC1, THRESH_TOZERO) 0.066 0.066 0.99
threshold::Size_MatType_ThreshType::(1280x720, 8UC1, THRESH_TOZERO_INV) 0.066 0.067 0.99
threshold::Size_MatType_ThreshType::(1280x720, 8UC1, THRESH_TRUNC) 0.065 0.066 0.99
threshold::Size_MatType_ThreshType::(1280x720, 16SC1, THRESH_BINARY) 0.138 0.139 0.99
threshold::Size_MatType_ThreshType::(1280x720, 16SC1, THRESH_BINARY_INV) 0.137 0.140 0.98
threshold::Size_MatType_ThreshType::(1280x720, 16SC1, THRESH_TOZERO) 0.137 0.139 0.99
threshold::Size_MatType_ThreshType::(1280x720, 16SC1, THRESH_TOZERO_INV) 0.138 0.139 0.99
threshold::Size_MatType_ThreshType::(1280x720, 16SC1, THRESH_TRUNC) 0.138 0.139 0.99
threshold::Size_MatType_ThreshType::(1280x720, 32FC1, THRESH_BINARY) 0.272 0.281 0.97
threshold::Size_MatType_ThreshType::(1280x720, 32FC1, THRESH_BINARY_INV) 0.275 0.283 0.97
threshold::Size_MatType_ThreshType::(1280x720, 32FC1, THRESH_TOZERO) 0.275 0.281 0.98
threshold::Size_MatType_ThreshType::(1280x720, 32FC1, THRESH_TOZERO_INV) 0.275 0.286 0.96
threshold::Size_MatType_ThreshType::(1280x720, 32FC1, THRESH_TRUNC) 0.274 0.283 0.97
threshold::Size_MatType_ThreshType::(1280x720, 64FC1, THRESH_BINARY) 0.656 0.657 1.00
threshold::Size_MatType_ThreshType::(1280x720, 64FC1, THRESH_BINARY_INV) 0.645 0.647 1.00
threshold::Size_MatType_ThreshType::(1280x720, 64FC1, THRESH_TOZERO) 0.651 0.652 1.00
threshold::Size_MatType_ThreshType::(1280x720, 64FC1, THRESH_TOZERO_INV) 0.641 0.652 0.98
threshold::Size_MatType_ThreshType::(1280x720, 64FC1, THRESH_TRUNC) 0.633 0.635 1.00
threshold::Size_MatType_ThreshType::(1920x1080, 8UC1, THRESH_BINARY) 0.153 0.156 0.98
threshold::Size_MatType_ThreshType::(1920x1080, 8UC1, THRESH_BINARY_INV) 0.154 0.157 0.98
threshold::Size_MatType_ThreshType::(1920x1080, 8UC1, THRESH_TOZERO) 0.155 0.156 0.99
threshold::Size_MatType_ThreshType::(1920x1080, 8UC1, THRESH_TOZERO_INV) 0.154 0.156 0.99
threshold::Size_MatType_ThreshType::(1920x1080, 8UC1, THRESH_TRUNC) 0.154 0.157 0.98
threshold::Size_MatType_ThreshType::(1920x1080, 16SC1, THRESH_BINARY) 0.309 0.318 0.97
threshold::Size_MatType_ThreshType::(1920x1080, 16SC1, THRESH_BINARY_INV) 0.311 0.322 0.97
threshold::Size_MatType_ThreshType::(1920x1080, 16SC1, THRESH_TOZERO) 0.309 0.317 0.97
threshold::Size_MatType_ThreshType::(1920x1080, 16SC1, THRESH_TOZERO_INV) 0.310 0.324 0.96
threshold::Size_MatType_ThreshType::(1920x1080, 16SC1, THRESH_TRUNC) 0.307 0.320 0.96
threshold::Size_MatType_ThreshType::(1920x1080, 32FC1, THRESH_BINARY) 0.783 0.782 1.00
threshold::Size_MatType_ThreshType::(1920x1080, 32FC1, THRESH_BINARY_INV) 0.785 0.767 1.02
threshold::Size_MatType_ThreshType::(1920x1080, 32FC1, THRESH_TOZERO) 0.788 0.774 1.02
threshold::Size_MatType_ThreshType::(1920x1080, 32FC1, THRESH_TOZERO_INV) 0.788 0.767 1.03
threshold::Size_MatType_ThreshType::(1920x1080, 32FC1, THRESH_TRUNC) 0.773 0.757 1.02
threshold::Size_MatType_ThreshType::(1920x1080, 64FC1, THRESH_BINARY) 1.952 1.940 1.01
threshold::Size_MatType_ThreshType::(1920x1080, 64FC1, THRESH_BINARY_INV) 1.923 1.900 1.01
threshold::Size_MatType_ThreshType::(1920x1080, 64FC1, THRESH_TOZERO) 1.978 1.920 1.03
threshold::Size_MatType_ThreshType::(1920x1080, 64FC1, THRESH_TOZERO_INV) 1.908 1.893 1.01
threshold::Size_MatType_ThreshType::(1920x1080, 64FC1, THRESH_TRUNC) 1.942 1.865 1.04
Performance for AVX2 baseline
Performance test Reference time PR time Speedup
threshold::Size_MatType_ThreshType::(127x61, 8UC1, THRESH_BINARY) 0.000 0.000 1.20
threshold::Size_MatType_ThreshType::(127x61, 8UC1, THRESH_BINARY_INV) 0.000 0.000 1.19
threshold::Size_MatType_ThreshType::(127x61, 8UC1, THRESH_TOZERO) 0.000 0.000 1.17
threshold::Size_MatType_ThreshType::(127x61, 8UC1, THRESH_TOZERO_INV) 0.000 0.000 1.18
threshold::Size_MatType_ThreshType::(127x61, 8UC1, THRESH_TRUNC) 0.000 0.000 1.17
threshold::Size_MatType_ThreshType::(127x61, 16SC1, THRESH_BINARY) 0.001 0.001 1.04
threshold::Size_MatType_ThreshType::(127x61, 16SC1, THRESH_BINARY_INV) 0.001 0.001 1.06
threshold::Size_MatType_ThreshType::(127x61, 16SC1, THRESH_TOZERO) 0.001 0.001 1.04
threshold::Size_MatType_ThreshType::(127x61, 16SC1, THRESH_TOZERO_INV) 0.001 0.001 1.01
threshold::Size_MatType_ThreshType::(127x61, 16SC1, THRESH_TRUNC) 0.001 0.001 1.03
threshold::Size_MatType_ThreshType::(127x61, 32FC1, THRESH_BINARY) 0.001 0.001 0.97
threshold::Size_MatType_ThreshType::(127x61, 32FC1, THRESH_BINARY_INV) 0.001 0.001 1.02
threshold::Size_MatType_ThreshType::(127x61, 32FC1, THRESH_TOZERO) 0.001 0.001 1.01
threshold::Size_MatType_ThreshType::(127x61, 32FC1, THRESH_TOZERO_INV) 0.001 0.001 0.93
threshold::Size_MatType_ThreshType::(127x61, 32FC1, THRESH_TRUNC) 0.001 0.001 0.99
threshold::Size_MatType_ThreshType::(127x61, 64FC1, THRESH_BINARY) 0.002 0.002 1.04
threshold::Size_MatType_ThreshType::(127x61, 64FC1, THRESH_BINARY_INV) 0.002 0.002 1.02
threshold::Size_MatType_ThreshType::(127x61, 64FC1, THRESH_TOZERO) 0.002 0.002 1.02
threshold::Size_MatType_ThreshType::(127x61, 64FC1, THRESH_TOZERO_INV) 0.002 0.002 1.01
threshold::Size_MatType_ThreshType::(127x61, 64FC1, THRESH_TRUNC) 0.002 0.002 1.01
threshold::Size_MatType_ThreshType::(640x480, 8UC1, THRESH_BINARY) 0.011 0.009 1.21
threshold::Size_MatType_ThreshType::(640x480, 8UC1, THRESH_BINARY_INV) 0.010 0.009 1.21
threshold::Size_MatType_ThreshType::(640x480, 8UC1, THRESH_TOZERO) 0.011 0.009 1.30
threshold::Size_MatType_ThreshType::(640x480, 8UC1, THRESH_TOZERO_INV) 0.011 0.009 1.26
threshold::Size_MatType_ThreshType::(640x480, 8UC1, THRESH_TRUNC) 0.009 0.009 1.08
threshold::Size_MatType_ThreshType::(640x480, 16SC1, THRESH_BINARY) 0.031 0.031 1.01
threshold::Size_MatType_ThreshType::(640x480, 16SC1, THRESH_BINARY_INV) 0.031 0.031 1.02
threshold::Size_MatType_ThreshType::(640x480, 16SC1, THRESH_TOZERO) 0.032 0.031 1.02
threshold::Size_MatType_ThreshType::(640x480, 16SC1, THRESH_TOZERO_INV) 0.031 0.031 1.02
threshold::Size_MatType_ThreshType::(640x480, 16SC1, THRESH_TRUNC) 0.031 0.030 1.01
threshold::Size_MatType_ThreshType::(640x480, 32FC1, THRESH_BINARY) 0.092 0.091 1.01
threshold::Size_MatType_ThreshType::(640x480, 32FC1, THRESH_BINARY_INV) 0.092 0.091 1.01
threshold::Size_MatType_ThreshType::(640x480, 32FC1, THRESH_TOZERO) 0.091 0.091 1.01
threshold::Size_MatType_ThreshType::(640x480, 32FC1, THRESH_TOZERO_INV) 0.092 0.091 1.01
threshold::Size_MatType_ThreshType::(640x480, 32FC1, THRESH_TRUNC) 0.091 0.091 1.01
threshold::Size_MatType_ThreshType::(640x480, 64FC1, THRESH_BINARY) 0.184 0.182 1.01
threshold::Size_MatType_ThreshType::(640x480, 64FC1, THRESH_BINARY_INV) 0.184 0.183 1.01
threshold::Size_MatType_ThreshType::(640x480, 64FC1, THRESH_TOZERO) 0.183 0.182 1.00
threshold::Size_MatType_ThreshType::(640x480, 64FC1, THRESH_TOZERO_INV) 0.184 0.184 1.00
threshold::Size_MatType_ThreshType::(640x480, 64FC1, THRESH_TRUNC) 0.184 0.182 1.01
threshold::Size_MatType_ThreshType::(1280x720, 8UC1, THRESH_BINARY) 0.066 0.065 1.00
threshold::Size_MatType_ThreshType::(1280x720, 8UC1, THRESH_BINARY_INV) 0.065 0.065 1.00
threshold::Size_MatType_ThreshType::(1280x720, 8UC1, THRESH_TOZERO) 0.066 0.065 1.02
threshold::Size_MatType_ThreshType::(1280x720, 8UC1, THRESH_TOZERO_INV) 0.065 0.065 1.01
threshold::Size_MatType_ThreshType::(1280x720, 8UC1, THRESH_TRUNC) 0.065 0.065 1.01
threshold::Size_MatType_ThreshType::(1280x720, 16SC1, THRESH_BINARY) 0.137 0.139 0.99
threshold::Size_MatType_ThreshType::(1280x720, 16SC1, THRESH_BINARY_INV) 0.138 0.137 1.01
threshold::Size_MatType_ThreshType::(1280x720, 16SC1, THRESH_TOZERO) 0.138 0.137 1.01
threshold::Size_MatType_ThreshType::(1280x720, 16SC1, THRESH_TOZERO_INV) 0.138 0.137 1.01
threshold::Size_MatType_ThreshType::(1280x720, 16SC1, THRESH_TRUNC) 0.138 0.137 1.01
threshold::Size_MatType_ThreshType::(1280x720, 32FC1, THRESH_BINARY) 0.279 0.280 1.00
threshold::Size_MatType_ThreshType::(1280x720, 32FC1, THRESH_BINARY_INV) 0.280 0.279 1.00
threshold::Size_MatType_ThreshType::(1280x720, 32FC1, THRESH_TOZERO) 0.281 0.279 1.01
threshold::Size_MatType_ThreshType::(1280x720, 32FC1, THRESH_TOZERO_INV) 0.279 0.280 1.00
threshold::Size_MatType_ThreshType::(1280x720, 32FC1, THRESH_TRUNC) 0.276 0.281 0.98
threshold::Size_MatType_ThreshType::(1280x720, 64FC1, THRESH_BINARY) 0.643 0.648 0.99
threshold::Size_MatType_ThreshType::(1280x720, 64FC1, THRESH_BINARY_INV) 0.645 0.645 1.00
threshold::Size_MatType_ThreshType::(1280x720, 64FC1, THRESH_TOZERO) 0.645 0.650 0.99
threshold::Size_MatType_ThreshType::(1280x720, 64FC1, THRESH_TOZERO_INV) 0.644 0.638 1.01
threshold::Size_MatType_ThreshType::(1280x720, 64FC1, THRESH_TRUNC) 0.639 0.647 0.99
threshold::Size_MatType_ThreshType::(1920x1080, 8UC1, THRESH_BINARY) 0.156 0.156 1.00
threshold::Size_MatType_ThreshType::(1920x1080, 8UC1, THRESH_BINARY_INV) 0.155 0.155 1.00
threshold::Size_MatType_ThreshType::(1920x1080, 8UC1, THRESH_TOZERO) 0.154 0.154 1.00
threshold::Size_MatType_ThreshType::(1920x1080, 8UC1, THRESH_TOZERO_INV) 0.154 0.154 1.00
threshold::Size_MatType_ThreshType::(1920x1080, 8UC1, THRESH_TRUNC) 0.154 0.154 1.00
threshold::Size_MatType_ThreshType::(1920x1080, 16SC1, THRESH_BINARY) 0.314 0.314 1.00
threshold::Size_MatType_ThreshType::(1920x1080, 16SC1, THRESH_BINARY_INV) 0.318 0.318 1.00
threshold::Size_MatType_ThreshType::(1920x1080, 16SC1, THRESH_TOZERO) 0.317 0.317 1.00
threshold::Size_MatType_ThreshType::(1920x1080, 16SC1, THRESH_TOZERO_INV) 0.315 0.315 1.00
threshold::Size_MatType_ThreshType::(1920x1080, 16SC1, THRESH_TRUNC) 0.313 0.314 1.00
threshold::Size_MatType_ThreshType::(1920x1080, 32FC1, THRESH_BINARY) 0.760 0.760 1.00
threshold::Size_MatType_ThreshType::(1920x1080, 32FC1, THRESH_BINARY_INV) 0.750 0.749 1.00
threshold::Size_MatType_ThreshType::(1920x1080, 32FC1, THRESH_TOZERO) 0.760 0.767 0.99
threshold::Size_MatType_ThreshType::(1920x1080, 32FC1, THRESH_TOZERO_INV) 0.761 0.761 1.00
threshold::Size_MatType_ThreshType::(1920x1080, 32FC1, THRESH_TRUNC) 0.752 0.766 0.98
threshold::Size_MatType_ThreshType::(1920x1080, 64FC1, THRESH_BINARY) 1.873 1.871 1.00
threshold::Size_MatType_ThreshType::(1920x1080, 64FC1, THRESH_BINARY_INV) 1.901 1.889 1.01
threshold::Size_MatType_ThreshType::(1920x1080, 64FC1, THRESH_TOZERO) 1.915 1.938 0.99
threshold::Size_MatType_ThreshType::(1920x1080, 64FC1, THRESH_TOZERO_INV) 1.920 1.904 1.01
threshold::Size_MatType_ThreshType::(1920x1080, 64FC1, THRESH_TRUNC) 1.900 1.908 1.00
Performance for AVX2 vs SSE2 baselines
Performance test Reference time PR time Speedup
threshold::Size_MatType_ThreshType::(127x61, 8UC1, THRESH_BINARY) 0.000 0.000 1.16
threshold::Size_MatType_ThreshType::(127x61, 8UC1, THRESH_BINARY_INV) 0.000 0.000 1.17
threshold::Size_MatType_ThreshType::(127x61, 8UC1, THRESH_TOZERO) 0.000 0.000 1.20
threshold::Size_MatType_ThreshType::(127x61, 8UC1, THRESH_TOZERO_INV) 0.000 0.000 1.15
threshold::Size_MatType_ThreshType::(127x61, 8UC1, THRESH_TRUNC) 0.000 0.000 1.14
threshold::Size_MatType_ThreshType::(127x61, 16SC1, THRESH_BINARY) 0.001 0.001 1.02
threshold::Size_MatType_ThreshType::(127x61, 16SC1, THRESH_BINARY_INV) 0.001 0.001 1.04
threshold::Size_MatType_ThreshType::(127x61, 16SC1, THRESH_TOZERO) 0.001 0.001 1.01
threshold::Size_MatType_ThreshType::(127x61, 16SC1, THRESH_TOZERO_INV) 0.001 0.001 0.94
threshold::Size_MatType_ThreshType::(127x61, 16SC1, THRESH_TRUNC) 0.001 0.001 0.97
threshold::Size_MatType_ThreshType::(127x61, 32FC1, THRESH_BINARY) 0.001 0.001 1.05
threshold::Size_MatType_ThreshType::(127x61, 32FC1, THRESH_BINARY_INV) 0.001 0.001 1.02
threshold::Size_MatType_ThreshType::(127x61, 32FC1, THRESH_TOZERO) 0.001 0.001 1.05
threshold::Size_MatType_ThreshType::(127x61, 32FC1, THRESH_TOZERO_INV) 0.001 0.001 1.06
threshold::Size_MatType_ThreshType::(127x61, 32FC1, THRESH_TRUNC) 0.001 0.001 1.00
threshold::Size_MatType_ThreshType::(127x61, 64FC1, THRESH_BINARY) 0.002 0.002 0.99
threshold::Size_MatType_ThreshType::(127x61, 64FC1, THRESH_BINARY_INV) 0.002 0.002 1.01
threshold::Size_MatType_ThreshType::(127x61, 64FC1, THRESH_TOZERO) 0.002 0.002 0.99
threshold::Size_MatType_ThreshType::(127x61, 64FC1, THRESH_TOZERO_INV) 0.002 0.002 0.97
threshold::Size_MatType_ThreshType::(127x61, 64FC1, THRESH_TRUNC) 0.002 0.002 0.97
threshold::Size_MatType_ThreshType::(640x480, 8UC1, THRESH_BINARY) 0.013 0.009 1.50
threshold::Size_MatType_ThreshType::(640x480, 8UC1, THRESH_BINARY_INV) 0.013 0.009 1.49
threshold::Size_MatType_ThreshType::(640x480, 8UC1, THRESH_TOZERO) 0.011 0.009 1.27
threshold::Size_MatType_ThreshType::(640x480, 8UC1, THRESH_TOZERO_INV) 0.011 0.009 1.26
threshold::Size_MatType_ThreshType::(640x480, 8UC1, THRESH_TRUNC) 0.010 0.008 1.29
threshold::Size_MatType_ThreshType::(640x480, 16SC1, THRESH_BINARY) 0.032 0.028 1.13
threshold::Size_MatType_ThreshType::(640x480, 16SC1, THRESH_BINARY_INV) 0.030 0.029 1.04
threshold::Size_MatType_ThreshType::(640x480, 16SC1, THRESH_TOZERO) 0.030 0.029 1.05
threshold::Size_MatType_ThreshType::(640x480, 16SC1, THRESH_TOZERO_INV) 0.030 0.029 1.05
threshold::Size_MatType_ThreshType::(640x480, 16SC1, THRESH_TRUNC) 0.030 0.028 1.05
threshold::Size_MatType_ThreshType::(640x480, 32FC1, THRESH_BINARY) 0.091 0.092 1.00
threshold::Size_MatType_ThreshType::(640x480, 32FC1, THRESH_BINARY_INV) 0.091 0.092 0.98
threshold::Size_MatType_ThreshType::(640x480, 32FC1, THRESH_TOZERO) 0.091 0.092 0.99
threshold::Size_MatType_ThreshType::(640x480, 32FC1, THRESH_TOZERO_INV) 0.091 0.092 0.98
threshold::Size_MatType_ThreshType::(640x480, 32FC1, THRESH_TRUNC) 0.091 0.092 0.99
threshold::Size_MatType_ThreshType::(640x480, 64FC1, THRESH_BINARY) 0.184 0.185 1.00
threshold::Size_MatType_ThreshType::(640x480, 64FC1, THRESH_BINARY_INV) 0.183 0.184 0.99
threshold::Size_MatType_ThreshType::(640x480, 64FC1, THRESH_TOZERO) 0.184 0.184 1.00
threshold::Size_MatType_ThreshType::(640x480, 64FC1, THRESH_TOZERO_INV) 0.181 0.184 0.99
threshold::Size_MatType_ThreshType::(640x480, 64FC1, THRESH_TRUNC) 0.182 0.184 0.99
threshold::Size_MatType_ThreshType::(1280x720, 8UC1, THRESH_BINARY) 0.068 0.068 1.00
threshold::Size_MatType_ThreshType::(1280x720, 8UC1, THRESH_BINARY_INV) 0.067 0.068 0.99
threshold::Size_MatType_ThreshType::(1280x720, 8UC1, THRESH_TOZERO) 0.067 0.068 0.99
threshold::Size_MatType_ThreshType::(1280x720, 8UC1, THRESH_TOZERO_INV) 0.067 0.067 1.00
threshold::Size_MatType_ThreshType::(1280x720, 8UC1, THRESH_TRUNC) 0.067 0.067 1.00
threshold::Size_MatType_ThreshType::(1280x720, 16SC1, THRESH_BINARY) 0.139 0.140 0.99
threshold::Size_MatType_ThreshType::(1280x720, 16SC1, THRESH_BINARY_INV) 0.136 0.139 0.98
threshold::Size_MatType_ThreshType::(1280x720, 16SC1, THRESH_TOZERO) 0.137 0.139 0.99
threshold::Size_MatType_ThreshType::(1280x720, 16SC1, THRESH_TOZERO_INV) 0.138 0.140 0.99
threshold::Size_MatType_ThreshType::(1280x720, 16SC1, THRESH_TRUNC) 0.138 0.140 0.99
threshold::Size_MatType_ThreshType::(1280x720, 32FC1, THRESH_BINARY) 0.280 0.282 0.99
threshold::Size_MatType_ThreshType::(1280x720, 32FC1, THRESH_BINARY_INV) 0.283 0.285 0.99
threshold::Size_MatType_ThreshType::(1280x720, 32FC1, THRESH_TOZERO) 0.281 0.284 0.99
threshold::Size_MatType_ThreshType::(1280x720, 32FC1, THRESH_TOZERO_INV) 0.280 0.279 1.00
threshold::Size_MatType_ThreshType::(1280x720, 32FC1, THRESH_TRUNC) 0.279 0.279 1.00
threshold::Size_MatType_ThreshType::(1280x720, 64FC1, THRESH_BINARY) 0.660 0.647 1.02
threshold::Size_MatType_ThreshType::(1280x720, 64FC1, THRESH_BINARY_INV) 0.653 0.645 1.01
threshold::Size_MatType_ThreshType::(1280x720, 64FC1, THRESH_TOZERO) 0.656 0.656 1.00
threshold::Size_MatType_ThreshType::(1280x720, 64FC1, THRESH_TOZERO_INV) 0.658 0.649 1.01
threshold::Size_MatType_ThreshType::(1280x720, 64FC1, THRESH_TRUNC) 0.647 0.653 0.99
threshold::Size_MatType_ThreshType::(1920x1080, 8UC1, THRESH_BINARY) 0.155 0.156 0.99
threshold::Size_MatType_ThreshType::(1920x1080, 8UC1, THRESH_BINARY_INV) 0.154 0.156 0.99
threshold::Size_MatType_ThreshType::(1920x1080, 8UC1, THRESH_TOZERO) 0.155 0.155 1.00
threshold::Size_MatType_ThreshType::(1920x1080, 8UC1, THRESH_TOZERO_INV) 0.155 0.155 1.00
threshold::Size_MatType_ThreshType::(1920x1080, 8UC1, THRESH_TRUNC) 0.153 0.156 0.98
threshold::Size_MatType_ThreshType::(1920x1080, 16SC1, THRESH_BINARY) 0.320 0.318 1.01
threshold::Size_MatType_ThreshType::(1920x1080, 16SC1, THRESH_BINARY_INV) 0.323 0.319 1.01
threshold::Size_MatType_ThreshType::(1920x1080, 16SC1, THRESH_TOZERO) 0.321 0.319 1.01
threshold::Size_MatType_ThreshType::(1920x1080, 16SC1, THRESH_TOZERO_INV) 0.319 0.318 1.01
threshold::Size_MatType_ThreshType::(1920x1080, 16SC1, THRESH_TRUNC) 0.318 0.321 0.99
threshold::Size_MatType_ThreshType::(1920x1080, 32FC1, THRESH_BINARY) 0.770 0.765 1.01
threshold::Size_MatType_ThreshType::(1920x1080, 32FC1, THRESH_BINARY_INV) 0.767 0.747 1.03
threshold::Size_MatType_ThreshType::(1920x1080, 32FC1, THRESH_TOZERO) 0.783 0.764 1.02
threshold::Size_MatType_ThreshType::(1920x1080, 32FC1, THRESH_TOZERO_INV) 0.773 0.770 1.00
threshold::Size_MatType_ThreshType::(1920x1080, 32FC1, THRESH_TRUNC) 0.757 0.764 0.99
threshold::Size_MatType_ThreshType::(1920x1080, 64FC1, THRESH_BINARY) 1.905 1.866 1.02
threshold::Size_MatType_ThreshType::(1920x1080, 64FC1, THRESH_BINARY_INV) 1.876 1.896 0.99
threshold::Size_MatType_ThreshType::(1920x1080, 64FC1, THRESH_TOZERO) 1.892 1.897 1.00
threshold::Size_MatType_ThreshType::(1920x1080, 64FC1, THRESH_TOZERO_INV) 1.882 1.911 0.98
threshold::Size_MatType_ThreshType::(1920x1080, 64FC1, THRESH_TRUNC) 1.856 1.928 0.96

@alalek alalek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@opencv-pushbot
opencv-pushbot merged commit a202dc9 into opencv:3.4 Jan 16, 2019
@terfendail
terfendail deleted the thresh_wintr branch January 17, 2019 13:25
@alalek alalek mentioned this pull request Jan 22, 2019
SavyaSanchi-Sharma pushed a commit to SavyaSanchi-Sharma/opencv that referenced this pull request Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants