dholroyd / h264-reader

Rust reader for H264 bitsream syntax
Apache License 2.0
72 stars 25 forks source link

Add `decode_nal` to get RBSP of a NAL units bytes #14

Closed fkaa closed 3 years ago

fkaa commented 3 years ago

Adds a helper method decode_nal for easily getting rid of emulation bytes.

dholroyd commented 3 years ago

Using a caller-allocated buffer might be the best general solution, but happy to merge this as-is if its useful to you.

fkaa commented 3 years ago

Thanks for the quick responses!

Letting the caller decide would probably be ideal, yeah. I'm currently hacking away without too much thought to performance, but I'll keep it in mind for future changes :o)