# h264bsd [![Build Status](](

This is a software-based library that was extracted from the Android project with the intention of being used elsewhere.

Some modifications have been made to the original project in order to remove the top-level API, add an alloc and free for encoder storage, convert to ARGB format, and add optimizations for certain platforms.

The intention is to provide a simple H.264 decoder that can be easily invoked from [ffi]( systems.

## Implementation Notes

Currently, the process of decoding modifies the input data. This has tripped me a few times in the past so others should be aware of it.

The decoder only works nicely if it has a single consistent stream to deal with. If you want to change the width/height or restart the stream with a new access unit delimiter, it's better to shutdown and init a new decoder.

## Directories

* *src* The modified source.
* *test* Contains test data available for all platforms.
* *win* Visual Studio project files and test application.
* *posix* Simple c file that loads a test file and runs through a decode loop.
* *js* JavaScript version of the library created using [emscripten](
* *wasm* JavaScript version using WebAssembly created using [emscripten](
* *ios* XCode project and objective-c wrapper classes.

This project was heavily inspired by [Broadway.js]( Much love to them for pioneering the idea.
Last 5 commits (shortlog)
Date Author Short message Commit hash
2020-09-16 Sigrid report more errors; give up on non-baseline profile immediately 73e0ce9f876fc6ea042072addeb21cd9cbac443b
2020-09-15 Sigrid remove prototypes of non-existing funcs 7d0cb59987f5c5c70cf55e35e65aa6b7a5bc460e
2020-09-15 Sigrid add faster x86 version of clz 4b7065cc238365afc13bd3a92c500b4629ea629b
2020-09-15 Sigrid fix lots of warnings fbf22d9c44e81ab5593664bdf77d6f7a0bc63770
2020-09-15 Sigrid use werrstr in nal unit parser adb27023e44aa64b868881e0b9e11bbb6ea4cae9
Files (browse)