almost working with mode loop
after merge
sorting and looping

Merge branch 'master' of https://github.com/mkennedy3000/x265