Skip to content

small cleanup of kmeans.cpp#3910

Closed
paroj wants to merge 1 commit intoopencv:masterfrom
paroj:kmeans
Closed

small cleanup of kmeans.cpp#3910
paroj wants to merge 1 commit intoopencv:masterfrom
paroj:kmeans

Conversation

@paroj
Copy link
Copy Markdown
Contributor

@paroj paroj commented Apr 7, 2015

  • move label validation out of inner loop
  • remove manual loop unrolling - the compiler is better at this
  • use functions/ enums instead of macros/ defines

* remove manual loop unrolling - the compiler is better at this
* use functions/ enums instead of macros/ defines
@vpisarev vpisarev self-assigned this Apr 7, 2015
@vpisarev
Copy link
Copy Markdown
Contributor

vpisarev commented Apr 7, 2015

@paroj, thanks for the patch, but we can not accept it, it includes just a few questionable changes and that's it

@vpisarev vpisarev closed this Apr 7, 2015
@paroj
Copy link
Copy Markdown
Contributor Author

paroj commented Apr 7, 2015

feel free to ask about what you think is questionable. the changes (slightly) improve performance and make the code more maintainable (no custom MAX, no old style define)

@paroj
Copy link
Copy Markdown
Contributor Author

paroj commented Apr 7, 2015

note that both the unrolled and not unrolled version of the loop is unrolled to 8 and vectorized by gcc 4.8. However it fails to detect the loop invariant (iter == 0 && a == 0) and thus checks for this in each loop iteration..

mshabunin pushed a commit to mshabunin/opencv that referenced this pull request Aug 25, 2015
…y OR'ed instead of added.

Conflicts:
	modules/features2d/src/draw.cpp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants