I need a simple and fast video codec with alpha support as an alternative to Quicktime Animation, which has terrible compression ratios for regular video.
Since I did not find a good open source encoder / decoder with alpha support, I tried to write my own (with inspiration from huff-yuv).
My strategy is this:
- Convert to YUVA420
- Subtract the current frame from the previous one (no key frames needed).
- Huffman encodes the result of the previous step. Divide each frame into 64x64 blocks and create a new huffman table for each block and encode it.
With this strategy, I achieve a decent compression ratio of 60-80%. Perhaps I could improve the compression speed by dividing each frame into a block after step 1 and adding motion vectors to reduce the data output from step 2. However, a higher compression ratio than 60% is lower than performance.
Permissible compression speed on a quad-core processor is 60 ms / frame.
However, the decoding speed suffers, 40 ms / frame (only in real time with full use of the processor).
My question is, is there a way to compress video with much faster decoding while maintaining an acceptable compression ratio?
, , . , , - , huffman , . , SIMD GPU. ? , .