encodes a single slice (part of frame).
Slices are processed from top to bottom of frame. The number of slices to process depends on the slices_per_frame parameter specified during
should be called before coding the first slice and
should be called after coding the last slice.
is the context handle previously returned by
returns the number of bytes written to the bitstream buffer. If all slices have been coded, zero is returned.