more code from decoding_encoding

Just need to fix up the per-frame stuff and we're done
http://ffmpeg.org/doxygen/trunk/decoding__encoding_8c_source.html