|
Packit |
1f69a5 |
The Smoke Codec
|
|
Packit |
1f69a5 |
---------------
|
|
Packit |
1f69a5 |
|
|
Packit |
1f69a5 |
This is a very simple compression algorithm I was toying with when doing a
|
|
Packit |
1f69a5 |
Java based player. Decoding a JPEG in Java has acceptable speed so this codec
|
|
Packit |
1f69a5 |
tries to exploit that feature. The algorithm first compares the last and the
|
|
Packit |
1f69a5 |
new image and finds all 16x16 blocks that have a squared difference bigger than
|
|
Packit |
1f69a5 |
a configurable threshold. Then all these blocks are compressed into an NxM JPEG.
|
|
Packit |
1f69a5 |
The quality of the JPEG is inversely proportional to the number of blocks, this
|
|
Packit |
1f69a5 |
way, the picture quality degrades with heavy motion scenes but the bitrate stays
|
|
Packit |
1f69a5 |
more or less constant.
|
|
Packit |
1f69a5 |
Decoding decompresses the JPEG and then updates the old picture with the new
|
|
Packit |
1f69a5 |
blocks.
|
|
Packit |
1f69a5 |
|
|
Packit |
1f69a5 |
|
|
Packit |
1f69a5 |
TODO:
|
|
Packit |
1f69a5 |
----
|
|
Packit |
1f69a5 |
- make format extensible
|
|
Packit |
1f69a5 |
- motion vectors
|
|
Packit |
1f69a5 |
- do some real bitrate control
|