Starting work on VP7 encoder

As I said in the previous post, currently I don’t have any features or decoders to add to NihAV (because Paul has not finished his work on Bink2 decoder yet) beside some encoders that nobody will use.

Thus I decided to work on something more advanced than VP6 that allows me to play with more advanced features (like EPZS motion estimation, per macroblock quantiser selection and such). For that I needed to pick some codec probably based on H.264 and there was not that much to pick from:

  • ITU H.264—first and foremost, I don’t have a properly working decoder for it (yet?); second, the format is too complex so just thinking about writing all those SPSes, PPSes and various lists discourages me from even considering to write an encoder for it;
  • RealVideo 3 or 4—tempting but that means I also need to write a RealMedia muxer and the format lacks dquant (in theory it’s supported, in practice it’s never happened). Maybe one day I’ll make my own NihAV-Really? encoder for RV3+Cooker but not today;
  • Sorenson SVQ3—same problems essentially;
  • VP8—Mike has done it over a decade ago;
  • VX—this is a custom game codec which is simplified (even quantiser is rather implicit).

The rough roadmap is the following:

  1. make intra-only encoder that encodes picture somehow;
  2. improve it to select the best whole macroblock prediction mode;
  3. add 4×4 prediction mode and make it select the best mode;
  4. add inter-frame support along with motion compensation;
  5. add EPZS-based motion estimation;
  6. introduce rough motion search for group of frames to determine good golden frame candidate and the macroblocks that should be coded with higher quality;
  7. actually code those macroblocks with higher quality using MB features;
  8. use trellis-based quantiser search for improved coding of frames;
  9. speed it up by using various heuristics instead of brute force search for coding parameters.

This should take some time…

6 Responses to “Starting work on VP7 encoder”

  1. Pere says:

    > VP8—Mike has done it over a decade ago;

    I remember that dark shikari also started xvp8 at that time. It was based on x264, but not sure if it went to anywhere (probably not). Following the same idea, someone also started x262 – that’s probably a dead project too.

    I tried playing Mike’s vp8 sample file, and it does not play in Chrome. It plays well in Firefox, VLC and mpv though.

  2. Kostya says:

    From what I heard x262 still has its niche use in broadcasting scenarios while xvp8 was abandoned after some time (probably because VP8 sucks compared to H.264).

    As for VP8 samples, no idea what’s wrong with Chrome.

  3. Steve Lhomme says:

    There is RV30 and RV40 support in Matroska that should play in VLC. At some point it was a popular ripping format before H264 took over.

  4. Kostya says:

    Yeah, I remember how it was RV3/4 for Chinese content, WMV9 for Japanese content and a complete zoo of formats for American content (where DivX in OGM was not the weirdest one).

  5. Paul says:

    Gonna write screen pressor encoder version 1 and 2 because there is code on github now. Bink2 development is awaiting more sponsors.

  6. Kostya says:

    I see version 4 sources are released as well.

    Good luck getting funding for Bink2 decoder, maybe j-b can help you to find people in gaming community willing to sponsor it.