TEncCU: cleanup
TEncCU: fix previous bad patch import
threading: introduce ThreadSafeInteger class

This class uses a condition variable to implement a producer/consumer access
protocol with a single writer and multiple readers for safe multi-core
synchronization

--HG--
extra : rebase_source : b0984c3733391c6dce81fabb2143316532030f45
y4m: fix copy-paste bug in range checks

--HG--
extra : rebase_source : 2ab6e2b79d1c98cde24ec6b85a0681db57b723df
encoder: cleanup nits

--HG--
extra : rebase_source : 89b6ce01f7b6941bd8aa6b997fd59396bc02d53d
cleanup unused m_mvField{A,B,C}

--HG--
extra : rebase_source : cf0e2cc04b007092eca49a73a86bf9979e40adb8
cleanup m_pattern

--HG--
extra : rebase_source : 9cd789dbad0c1e94463600d9f22cb8dc8f91b57a
optimize: rewrite TEncBinCABAC::encodeBin

--HG--
extra : rebase_source : 55f9ae19ba5ab1a5eff17e9ecbd6ce4ca6e83cf7
DC only for HIGH_BIT_DEPTH

--HG--
extra : rebase_source : 27edab0bc2517ec17de18011dab2e61a49ad9cad
encodeResandCalcInterCU: cleanup, no logic change