Some details on RV30/40

RV8 or RV30 is close to earlier H.264 drafts and Sorenson Video 3, because they both use one variable-length code (Golomb codes in case of SVQ3, something special in RV30/RV40) to represent macroblock information (type, intra prediction modes). RV40 uses this code only to represent motion vectors and number of macroblocks to skip, macroblock type and intra prediction modes are coded with variable-length codes chosen from the set of them depending on context.

Here are the main differences from H.264:

  1. Different bitstream. Special codes for elements and own substitution of Golomb code.
  2. Intra prediction types are specified only for luma subblocks, chroma subblocks use some of them for prediction too.
  3. Intra prediction modes are slightly different and some of them require additional context (down left neighbour).
  4. Bidirectionally predicted blocks in B-frames do not use motion vectors from the previous/next frame in motion vector prediction while using them in motion compensation.
  5. Intra prediction for intra blocks in interframes is performed even when neighbouring blocks are not intra blocks.

Main differences between RV30 and RV40:

  1. Bitstream syntax and different codes (RV30 is easier in this matter).
  2. RV30 does not have 8×16 and 16×8 motion compensation modes (while 8×8 mode exists).
  3. Different motion vector prediction algorithm.
  4. B-frames in RV30 do not contain some variant of bidirectionally predicted blocks which RV40 has.

And now here is the list of things I didn’t like in RV30/40:

  1. Slice header does not contain number of macroblocks coded in this title. While it saves whopping 6-13 bits per slice (and frames usually have less than a dozen of slices, usually two or three), it gives unnecessary pain to implementor.
  2. Vertical left intra prediction method uses down left neighbour pixels in calculation for one insignificant pixel (it’s insignificant because it does not affect further intra prediction).
  3. Motion vector prediction is a bit complicated too.
  4. And, of course, the lack of good documentation

5 Responses to “Some details on RV30/40”

  1. Excellent summary. This might make a good Wiki entry as well.

  2. Kostya says:

    I’m also writing an article about format and decoding process for both RV30 and RV40

  3. Iain says:

    I can’t pretend to have read up enough on video codecs to understand a lot of that, but I want to say thank you. Your work on RV30/40 is a great asset for the free software and open source communities. Integrated into a plugin that supports the right streaming protocols (Mplayer?), maybe the day when I can watch more currently inaccessible content (BBC, I’m looking at you) isn’t *too* far off…

    I can dream. Good work.

  4. tootee says:

    Hi Kostya,

    So hows ya progress on the mentioned article 😀

    Good luck!

  5. Noname says:

    Does rv40 perform the loop filter of chroma pixels??