Diary Of An x264 Developer

03/18/2010 (10:29 pm)

Announcing x264 Summer of Code 2010!

Filed under: development,google,GSOC,x264 ::

With the announcement of Google Summer of Code 2010 and the acceptance of our umbrella organization, Videolan, we are proud to announce the third x264 Summer of Code!  After two years of progressively increasing success, we expect this year to be better than ever.  Last year’s successes include ARM support and weighted P-frame prediction.  This year we have a wide variety of projects of varying difficulty, including some old ones and a host of new tasks.  The qualification tasks are tough, so if you want to get involved, the sooner the better!

Interested in getting started?  Check out the wiki page, hop on #x264 on Freenode IRC, and say hi to the gang!  No prior experience or knowledge in video compression necessary: just dedication and the willingness to ask questions and experiment until you figure things out.

32 Responses to “Announcing x264 Summer of Code 2010!”

  1. Shiretoko Says:

    I hope a successful student picks the implementation of 4:4:4 and 4:2:2 colorspaces.

  2. Erich Ocean Says:

    +1 to 4:4:4 and 4:2:2 colorspaces

  3. onitake Says:

    maybe i should apply? have been wanting 4:4:4 or rgb support for a loooong time, but never had the courage to dig into the code.
    i fear i wouldn’t get it done by end of summer though.

  4. Kurtnoise Says:

    May I ask why would you like include audio encoding in the x264 project ? Why would you want to reinvent the wheel ? There is already FFmpeg for that imo…

    Except libvorbis & libmp3lame, which others libraries are widely used today and GPL compatible ?

  5. Dark Shikari Says:

    @onitake

    There is no requirement you get it done by the end–as long as you’re willing to stick around to finish it.

    @Kurtnoise

    We’re not writing an audio encoder, we’re adding support for calling existing audio encoders. We want to make x264CLI a simple, easy-to-use all-in-one app for media encoding. You could think of it as ffmpeg2theora for x264, except perhaps less crappy.

  6. Manabu Says:

    How exactly one can get “10-15% improvements just from the extra precision!” from 10 bit-depth suport? This is for any qp or only absurdly low qps?

    If 10 bits is more efficient than 8 bits for video data representation, why 8 bit is the standard? Performance issues? And would 12~16 bit-depth be even better? Or some adaptative bit-depht selecion?

  7. Dark Shikari Says:

    @Manabu

    Performance issues are a big one. In hardware it’s 25% more resources, in software it’s basically 2x.

    I haven’t confirmed the improvement myself; this is only what I’ve heard from people who have implemented it. But assuming it’s correct, here’s the reasons I’d expect why:

    1) H.264 is in love with the (A+B+1)>>1 rounding mode. With qpel and bidir all using this round-up rounding, there is a huge number of redundant DC coefficients. Merely changing bidir to use (A+B)>>1 saves ~1% bitrate; you’d probably do much better if you had 4x more intermediate precision.

    2) Raising the output precision of every transform would go a very long way to eliminating +1/-1 errors that constantly propagate from frame to frame (similar to 1), because of qpel aggravating the situation).

    3) Subpel interpolation gives better results when it has more accurate input data. Same with intra prediction.

    4) To make flat areas not look completely banded, an H.264 encoder has to basically throw bits at it. But with 10-bit, it can simply rely on the dither used on playback to fix the problem.

    There’s probably others as well.

  8. Steinar H. Gunderson Says:

    Yay for MBAFF. :-) I wonder if there will be any takers…

  9. rem Says:

    Why stop at 10 and not go all-out for 14?

    Also, about the colorspaces, it’d be a good opportunity to also support monochrome mode.

  10. Dark Shikari Says:

    @rem

    We’d probably support all the way through 14, since internally all the data would go up to 16-bit precision anyways. “10-bit” is just the most common example.

    I tried adding monochrome mode in the past; it was really easy to add, but it improved compression by about 0.01% at most. Hardly worth the bother considering libavcodec doesn’t even support it.

  11. rem Says:

    It’s not for the compression, it’s to avoid juggling around 50% more data when you just need one channel (and that’s not only for B&W video).

    I assumed lavc supported it though, there are a handful of “if(CHROMA)” around the decoder.

    Actually now that I look at it there’s
    #define ALLOW_NOCHROMA
    and
    #define CHROMA h->sps.chroma_format_idc
    enabled by default, so maybe it’s a bug?

  12. Dark Shikari Says:

    @rem

    NOCHROMA is about allowing the callee to set an option to disable chroma decoding. It doesn’t have anything to do with decoding actually-grayscale streams, as far as I recall.

    And yes, it saves a bit of memory and decoding speed to avoid chroma.

  13. rem Says:

    Well, I don’t know if it’s fully implemented and working, but CHROMA (note not “NOCHROMA”) in the h.264 decoder is wired to h->sps.chroma_format_idc which is read from the bitstream (see h264_ps.c line 293), and it influences whether other stuff is read from the bitstream (for example see h264_cabac.c line 1372, where it guards decode_cabac_mb_chroma_pre_mode() which has several get_cabac_noinline() calls).

  14. Dark Shikari Says:

    @rem

    Hmm, it might have been done since I last tested it then.

  15. onitake Says:

    banding is quite a big issue, at least for me. the suggested improvement via higher processing precision sounds interesting.

    i wrote a simple yv12 converter recently, to test out how much (perceived) information is really lost, and i noticed something. not only is the colorspace transformed and the amount of chroma information reduced to 25%, but it also involves a reduction of the color range. if i didn’t miscalculate, an actual 9 of the 24 bits of rgb data per pixel is lost after converting xv12 back to rgb! and this isn’t related at all to the :2:0 chroma plane shrinking.

    please correct me if i’m misunderstanding something.

  16. Adub Says:

    Is it just me, or are the SOC links in the main post leading to 404′s?

  17. transient Says:

    @rem
    totally in on the 14 bit, and monochrome.. This helps preserve some different types of phenomenology and would be beneficial to preserve that opposed to lopping off 6 bits of precision..

    The other suggestion is to look into a random intra-frame refresh in addition to the column of death :P This should produce a more visually pleasing low-latency encode for largish frame sizes at smalish bandwidths.

  18. mmebane Says:

    The “wide variety of projects of varying difficulty” link seems to be broken. Actually, it looks like the whole wiki is redirecting to the forum right now. Server config issues?

  19. MrCommunistGen Says:

    +1 for 10-bit. If what onitake said is correct, then this could be a big boost.

    @Dark Shikari
    I know you said that this would be 25% more resources in hardware and 2x resources in software, but ideally (say with relatively optimized code) would you expect this to do to encoding/decoding speed? Would you expect to see something close to 25% slower, 2x slower, somewhere in-between, or something else?

    Sorry if this question seems ignorant as I really don’t know much about video encoding, and know virtually nothing about coding.

  20. Dark Shikari Says:

    @mmebane

    Yup, Videolan is unfortunately having server issues… I guess I can suggest the google cache?

    @MrCommunistGen

    In the ideal case it will require 2x more resources in SIMD functions in software. This may be increased by things that don’t scale perfectly (e.g. running out of registers, or the lack of a psadwd instruction). Of course, 40% of x264′s time is spent in C code, so this means 60% of x264 gets roughly twice as slow or a bit worse.

    One can take shortcuts though–for example, doing a motion search on the 8-bit video data instead of the full-precision video data.

    Also, note the penalty will be much worse than 2x at first since, at least to start, there won’t be any assembly code written.

    For decoding, probably more than 40% is spent in C code, so the penalty will be a good bit less. Also, a 16-bit deblocking filter is barely slower than 8-bit.

  21. Ashish Says:

    What about Motion Estimation using CUDA ? I see much activity 6 months ago. But, not much since then, is the project already complete ?

    I have had past CUDA experience and would like to work on this, but I have minimal Video experience. I got some head start from Anton of Nvidia, and I am now exploring wiki pages regarding video compression. I hope I get selected.

  22. onitake Says:

    Ashish: gpu offloading would be much appreciated.
    could you consider working with opencl instead of cuda though? it’s available in nvidia and amd drivers on both windows and linux now, and also on osx. cuda is constrained to nvidia hardware.

  23. R.T. Systems Says:

    One thing I am curious about is this: Will encoding using a 10-bit or higher format produce any advantage when starting from an 8-bit source and targeting an 8-bit playback device?

  24. Dark Shikari Says:

    @R.T.

    It will give a compression improvement, but the playback device will have to support 10-bit precision, which is only available in complex profiles such as High 10. No hardware device I know of supports these, so while you will get a compression improvement, it will likely be limited to software only for the time being.

  25. CK159 Says:

    I have 2 little questions:

    How much of a compression boost would 14 and 16 bit precision give? Does it taper off significantly or something at some point?

    Also, how much of an impact would 4:4:4 have on compression, and encode time? When I do game encodes (particularly 2D), the loss of color is sometimes noticeable if you stare at a spot, but if full chroma requires 50% more bitrate or something, than its not worth it.

  26. IgorC Says:

    It might be worth to mention some results of GPU encoders.
    Flacuda (FLAC GPU+CPU encoder).
    http://cuetools.net/doku.php/flacuda

    From what I see GPU and CPU run in parallel. GPU run where CPU is bottleneck and vice verse.
    Unbelievable the bottleneck for FLACUDA -7 (better compression than highest compression more for FLAC -8 -A2) is only HDD.

  27. Dark Shikari Says:

    @CK159

    Precision-wise, it likely tapers off. I’d bet that 50% of the maximum possible benefit will come from the first extra bit, 25% from the second, 12.5% from the third, and so forth. So 12-bit vs 11-bit will only help about 1/8th as much as 9-bit vs 8-bit did.

    Speed-wise, 4:4:4 will probably not have *too* much of an impact, though it depends on how it’s implemented. On compression, it’s hard to say before it’s done, but it almost surely won’t be that bad.

  28. any-SOC2010-progress? Says:

    is there Any Actual progress in this Google Summer of Code 2010 ? i have not seen Any mention of the code being written in any doom8 or dom10 threads and nothing in the vlc/x264 linked urls, but iv not looked hard for any there oc….

    can we have ay least a progress report posted somewere on a messgeboard so people can follow any progress if theres is any OC.

  29. Dark Shikari Says:

    @any

    Check the official GSOC timeline. Acceptances just went out and GSOC starts in about a month.

    We have students for 10-bit, MBAFF, and audio encoding.

  30. any-SOC2010-progress? Says:

    thanks for the update dark , thats good to know all the main wants/likes are potentially covered.

  31. D3C0D3R Says:

    Colorspaces sounds good and useful,
    but really promising for me is GPU motion estimation
    sadly that nobody take it

  32. 3Nitro Says:

    I’m agree with D3C0D3R. GPU motion estimation in x264 will be really useful thing, hope it will not be forgotten

Leave a Reply