WIP: Add a generic bit code writer for encoders.
We need a generic bit code writer for encoders.
To discuss:
- The VA seems to be the only one which needs this now, so we just put these code in the sys/va at first.
- The bit code writer may need to implement two version of output bitstream for mpeg2/H264/H265 because of the emulation prevention bytes. Some usage such as VA, the driver can insert the emulation prevention bytes automatically and so it just needs a pure bitstream. But for other usages, we need to insert emulation prevention bytes to generate a complete NAL for SPS/PPS, etc. We also need to improve the nal writer in nalutils.c to make it easy to use(The current nal_writer_reset_and_get_memory return a GstMemory and is not convenient).