Google’s VP8 video codec

Now that the hype is over, let’s talk the real deal. How good is Google’s VP8 video codec? Since “multiple independent implementations help a standard mature quicker and become more useful to its users”, me and others (David for the decoder core and PPC optimizations, Jason for x86 optimizations) decided that we should implement a native VP8 decoder in FFmpeg. This has several advantages from other approaches (e.g. linking to libvpx, which is Google’s decoder library for VP8):

  • we can share code (and more importantly: optimizations) between FFmpeg’s VP8 decoder and decoders for previous versions of the VPx codec series (e.g. the entropy coder is highly similar compared to VP5/6). Thus, your phone’s future media player will be smaller and faster.
  • since H.264 (the current industry standard video codec) and VP8 are highly similar, we can share code (and more importantly: optimizations) between FFmpeg’s H.264 and VP8 decoders (e.g. intra prediction). Thus, again, your desktop computer’s future media player will be smaller and faster.
  • Since FFmpeg’s native VP3/Theora and Vorbis decoders (these are video/audio codecs praised by free software advocates) already perform better than the ones provided by Xiph (libvorbis/libtheora), it is highly likely that our native VP8 decoder will (once properly optimized) also perform better than Google’s libvpx. The pattern here is that since each libXYZ has to reinvent its own wheel, they’ll always fall short of reaching the top. FFmpeg comes closer simply because our existing wheels are like what you’d want on your next sports car.
  • Making a video decoder is fun!

In short, we wrote a video decoder that heavily reuses existing components in FFmpeg, leading to a vp8.c file that is a mere 1400 lines of code (including whitespace, comments and headers) and another 450 for the DSP functions (the actual math backend of the codec, which will be heavily optimized using SIMD). And it provides binary-identical output compared to libvpx for all files in the vector testsuite. libvpx’ vp8/decoder/*.c plus vp8/common/*.c alone is over 10,000 lines of code (i.e. this excludes optimizations), with another > 1000 lines of code in vpx/, which is the public API to actually access the decoder.

Current work is ongoing to optimize the decoder to outperform libvpx on a variety of computer devices (think beyond your desktop, it will crunch anything; performance becomes much more relevant on phones and such devices). More on that later.

Google's Test Suite, Vector 15 screenshot

Google's Test Suite, Vector 15 screenshot

Things to notice so so far:

  • Google’s VP8 specs are not always equally useful. They only describe the baseline profile (0). Other profiles (including those part of the vector testsuite, i.e. 1-3) use features not described in the specifications, such as chroma fullpixel motion vector (MV) rounding, a bilinear motion compensation (MC) filter (instead of a subpixel six-tap MC filter). Several parts of the spec are incomplete (“what if a MV points outside the frame?”) or confusing (the MV reading is oddly spread through 3 sections in a chapter, where the code in each section specifically calls code from the previous section, i.e. they really are one section), which means that in the end, it’s much quicker to just read libvpx source code rather than depend on the spec. Most importantly, the spec really is a straight copypaste of the decoder’s source code. As a specification, that’s not very useful or professional. We hope that over time, this will improve.
  • Google’s libvpx is full of (hopefully) well-performing assembly code, quite some of which isn’t actually compiled or used (e.g. the PPC code), which makes some of us wonder what the purpose of its presence is.
  • Now that VP8 is released, will Google release specifications for older (currently undocumented) media formats such as VP7?
This entry was posted in General. Bookmark the permalink.

20 Responses to Google’s VP8 video codec

  1. Pingback: Tweets that mention Google’s VP8 video codec « Ronald S. Bultje --

  2. Pingback: Ronald Bultje: Google’s VP8 video codec | Gnu Architecture

  3. Pingback: Google's VP8 video codec « Ronald S. Bultje

  4. Pingback: Google's VP8 video codec « Ronald S. Bultje « All About Google

  5. Pingback: Android gaining on iPhone among developers « V E X E D

  6. Martijn says:

    Nicely done!

  7. Pingback: VP8 Codec Coming To FFmpeg | JetLib News

  8. Pingback: Vp8 in ffmpeg con 1400 LoC | bruno trani dot info

  9. Pingback: Vp8 in ffmpeg con 1400 LoC | Giovanni Raco

  10. Pingback: Reimplementing a VP8 decoder « Netcrema – creme de la social news via digg + delicious + stumpleupon + reddit

  11. Pingback: Vp8 in ffmpeg con 1400 LoC | Il blog di

  12. Pingback: Vp8 in ffmpeg con 1400 LoC | SoLife Blog

  13. Pingback: Google’s VP8 Video Codec «

  14. Pingback: Fork de VP8 del proyecto FFmpeg | MuyLinux

  15. Pingback: .NET Violates Patents, Sued | Techrights

  16. Pingback: FFmpeg的VP8编解码器 « 每日IT新闻,最新IT资讯,聚合多站点消息,保证你与世界同步

  17. Pingback: Vp8 in ffmpeg con 1400 LoC | Blog |

  18. Pingback: Tech Reviews » FFmpeg gets its own implementation of Google’s VP8 codec

  19. Pingback: On WebM, H264, and FFmpeg implementation |

  20. Pingback: FFmpeg Team Implements a WebM/VP8 Decoder in 1400 Lines of C | The Buzz Media

Leave a Reply

Your email address will not be published. Required fields are marked *