Cairo Experimental Video Codec
C++ C
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
LICENSE
README.md
abac.cpp
abac.h
analysis.h
base.h
bitstream.cpp
bitstream.h
common.cpp
common.h
config.h
convert.cpp
convert.h
deblock.cpp
decode.cpp
egtables.h
encode.cpp
evx1.cpp
evx1.h
evx1dec.cpp
evx1dec.h
evx1enc.cpp
evx1enc.h
golomb.cpp
golomb.h
image.cpp
image.h
imageset.cpp
imageset.h
macroblock.h
math.h
memory.cpp
memory.h
motion.cpp
motion.h
quantize.cpp
quantize.h
scan.h
serialize.cpp
stream.cpp
stream.h
transform.cpp
transform.h
types.h
unserialize.cpp
version.h
xftables.h

README.md

Cairo Experimental Video Codec

Cairo is a simple streaming video codec that was created in 2011 as part of the (now discontinued) everyAir mobile cloud gaming project. Its original purpose was to help us experiment with low latency game streaming on early mobile hardware (original iPad, iPhone 3GS). Using a heavily tuned implementation, Cairo enabled everyAir to stream PC, Mac, and even PS3 games to iOS devices with extremely low encode and decode latencies.

Demo: PS3 streaming
Demo: latency test
Demo: everyAir

Features

  • Support for intra (i-frame) and inter (p-frame) frame prediction modes
  • Motion compensation with half and quarter pixel precision
  • Supports a virtually unlimited number of reference frames
  • Variance adaptive quantization (both uniform and non-uniform)
  • Intelligent skip block detection that minimizes visual artifacts
  • Periodic intra frame insertion (useful for keyframing)
  • Internal support for planar YUV 4:2:0 images
  • Support for multiple lossless backend compressors involving:
    • Adaptive binary arithmetic coding
    • Exponential Golomb coding
    • Huffman coding
    • Run-length encoding
  • Delta coded macroblocks and motion vectors
  • In-loop deblocking filter
  • 100% integer math
  • Cross platform, fully portable code
  • Simple and easy to read, designed for educational purposes

Open Source Release

This release contains an early and unoptimized version of Cairo that demonstrates the basic functionality of the codec. Cairo's new purpose is to serve as an educational resource for students who are interested in video compression. This release presents a simple and easy to read implementation that demonstrates several common techniques without the complexities of optimizations or platform dependencies.

Running Cairo

evx1.h describes the primary interface for Cairo. Follow these steps to create and activate the encoder:

  • Create a bit_stream object and initialize it to some large size.
  • [optional] Set your desired quality level by calling set_quality with a value between 1 and 31 (inclusive).
  • Create an evx1_encoder object and call its encode method to encode a 24 bit interleaved RGB frame.

Follow these steps to create and activate the decoder:

  • Create a bit_stream object and initialize it to some large size.
  • Create an evx1_decoder object and call its decode method to decode a bit_stream and recover an RGB image.

Caution: patent hazard

Note that while this release is provided under an open and permissive copyright license, the algorithms it contains are likely to be covered by existing patents that may restrict your ability to use this codec commercially.

More Information

For more information visit http://www.bertolami.com.