cinepakenc: fixes and improvements

version 2013-02-08 Rl
- fixes/optimization in multistrip encoding and codebook size choice,
  quality/bitrate is now better than that of the binary proprietary encoder

version 2013-02-12 Rl
- separated codebook training sets, avoided the transfer of wasted bytes,
  which yields both better quality and smaller files
- now using the correct colorspace (TODO: move conversion to libswscale)

version 2013-02-14 Rl "Valentine's Day" version:
- made strip division more robust
- minimized bruteforcing the number of strips,
  (costs some R/D but speeds up compession a lot), the heuristic
  assumption is that score as a function of the number of strips has
  one wide minimum which moves slowly, of course not fully true
- simplified codebook generation,
  the old code was meant for other optimizations than we actually do
- optimized the codebook generation / error estimation for MODE_MC

version 2013-04-28 Rl
- bugfixed codebook optimization logic

version 2014-01-20 Rl
- made the encoder compatible with vintage decoders
  and added some yet unused code for possible future
  incremental codebook updates
- fixed a small memory leak

version 2014-01-21 Rl
- believe it or not, now we get even smaller files, with better quality
  (which means I missed an optimization earlier :)

Signed-off-by: Diego Biurrun <diego@biurrun.de>
