Packing bitstream on-the-fly with delayed context updates
authorAttila Nagy <attilanagy@google.com>
Thu, 9 Feb 2012 10:37:03 +0000 (12:37 +0200)
committerYunqing Wang <yunqingwang@google.com>
Wed, 29 Feb 2012 17:13:37 +0000 (12:13 -0500)
commit52cf4dcaea10f97d25d8a3585704a1e47b384751
tree6fb5acff2e02f2e153e206284f5075ebce548674
parentce328b855f951e5a9fd0d9d92df09d65ea0d8be9
Packing bitstream on-the-fly with delayed context updates

Produce the token partitions on-the-fly, while processing each MB.
Context is updated at the beginning of each frame based on the
previoud frame's counters. Optimally encoder outputs partitions in
separate buffers. For frame based output, partitions are concatenated
internally.

Limitations:
    - enabled just in combination with realtime-only mode
    - number of encoding threads has to be equal or less than the
    number of token partitions. For this reason, by default the encoder
    will do 8 token partitions.
    - vpxenc supports partition output (-P) just in combination with
    IVF output format (--ivf)

Performance:
    - Realtime encoder can be up to 13% faster (ARM) depending on the number
    of threads and bitrate settings. Constant gain over the 5-16 speed
    range.
    - Token buffer reduced from one frame to 8 MBs

Quality:
    - quality is affected by the delayed context updates. This again
    dependents on input material, speed and bitrate settings. For VC
    style input the loss seen is up to 0.2dB. If error-resilient=2
    mode is used than the effect of this change is negligible.

Example:
./configure --enable-realtime-only --enable-onthefly-bitpacking
./vpxenc --rt --end-usage=1 --fps=30000/1000 -w 640 -h 480
--target-bitrate=1000 --token-parts=3 --static-thresh=2000
--ivf -P -t 4 -o strm.ivf tanya_640x480.yuv

Change-Id: I127295cb85b835fc287e1c0201a67e378d025d76
configure
vp8/encoder/bitstream.c
vp8/encoder/bitstream.h
vp8/encoder/encodeframe.c
vp8/encoder/ethreading.c
vp8/encoder/onyx_if.c
vp8/encoder/onyx_int.h
vp8/vp8_cx_iface.c
vpxenc.c