Initial fixes and tests for video encoding and decoding (addresses #112)