Fix undefined behavior of EO_IDX.
Fix undefined behavior of EO_IDX.

- Move the whole eo_cat thing to it's own function.

- Casting pixel values to int should solve issues with SIGN3. Not casting them
  was detected as undefined behavior by CLANG. Probably because the result of
  two unsigned might be treated as unsigned (but isn't on VS2010).

lu-zero/kvazaar,ultravideo/kvazaar,lu-zero/kvazaar,lu-zero/kvazaar,ultravideo/kvazaar,ultravideo/kvazaar,ultravideo/kvazaar,lu-zero/kvazaar,ultravideo/kvazaar