Move bitstream write to a separate function, and add assertions about the part which should not write to bitstream.
Move bitstream write to a separate function, and add assertions about the part which should not write to bitstream.

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