Move static function
Correct stride usage
Add support for streaming decoding