Split residual quantization to separate luma and chroma function.
Re-add rdo control to transformskip decision.

- It got left out when rewriting the function.
Remove openmp stuff
Entropy coding sync works without parallelism, without SAO and without deblocking
Fix tiles when SAO or deblock is enabled.

Was broken by previous commit.
Remove filter_deblock function, which is not used and somewhat dangerous, since it doesn't take into account specific stuff about subencoders.
Add SLEEP() define
threadqueue
encoder_state_encode uses now the threadqueue
Add --threads <int> command line parameter
Free jobs as soon as possible
Improve decision about when to split into threads
Store search borders in a buffer for the whole picture
Add const for the buffers
Use new buffers for search
Take advantage of the new buffers to remove uneeded item assignment
search buffer has to be allocated tile-wise to avoid problems with wavefronts
Fix problems when image dimensions is not a multiple of LCU
Add encoder_state pointer to lcu_order_element, new worker_encoder_state_search_lcu function to run the search stuff on one LCU
Threads should be put in queue in wait state if we want to add dependencies later