Tag Archives: Orc

10 and 16 bit Video Processing in GStreamer

Professional video hardware and software usually uses 10 bits per component for color representation. Consumer products are usually 8-bit, and video distribution to consumers is universally 8 bits per component. Up until recently, GStreamer‘s support for 10- and 16-bit formats has been minimal, mostly enough to convert 10-bit input into an 8-bit format for further processing.

One of my side projects recently has been to improve much of the basic video infrastructure to handle 10-bit and also 16-bit color components.  There are a few interesting 10-bit packing structures, mainly v210 and UYVP, which are YCbCr 4:2:2 formats used by QuickTime and SDI capture cards, and also r210, which is a 10-bit RGB format.  Packed structures of this form are difficult to work with in SIMD code, so they tend to be inefficient for most processing.  They are more interesting for interfacing with hardware and reading/writing to disk.

For more computational efficiency, and also to promote using a lot more precision instead of a little more precision, I’m encouraging people to use 4:4:4:4 16-bit AYUV or ARGB as an intermediate format for high color depth work instead of any of the 10 or 12 bit formats.  Many GStreamer plugins already support 8-bit AYUV, so adding support for 16-bit AYUV is usually a pretty simple task.

Orc has made the task easier as well.  I would not have started this task if it had involved writing a bunch of SIMD code directly, since deep-color processing is a specialized interest and I only have a finite amount of spare time.

Format negotiation among elements is similar to how it works with any other format.  The 10 and 16 bit formats are simply extensions of how the existing GStreamer capabilities (caps) system works.

Some elements supporting 10 and 16-bit formats:

  • videotestsrc – The video test signal generator.  Of course, this is the first place to start for implementing any new formats.  The patterns are all still fundamentally 8-bit, unfortunately.
  • videoscale – The video scaling element.
  • colorspace – This is the new format conversion and RGB/YCbCr matrixing element in gst-plugins-bad, which is based on Orc.  At some point, it will be moved to -base and be used instead of ffmpegcolorspace.
  • decklinksrc/sink and linsyssdisrc/sink – These SDI capture and playback elements handle 10-bit video in hardware, so it makes sense to deliver this to the GStreamer pipeline.
  • schroenc/schrodecSchrödinger has handled 10-bit video for several years, but only when handling VC-2 video (i.e., the intra subset of Dirac).
  • qtmux/qtdemux – Handles a few 10 and 16 bit formats in the QuickTime container.
  • pngdec – Decodes 16-bit PNG images.

The project to make Schrödinger handle high-precision video has been moving along as well. Although not ready for end users, it is possible to decode up to 26-bit component depth video. (26 happens to be a natural limitation. 10 and 16 work fine, too. I just said 26 to brag a little.)

Most of this work is done simply to have a high-precision pipeline available for test purposes, such as converting the 16-bit RGB Sintel PNGs into a clean high-bit-depth master for encoder testing. Hopefully soon, enough elements will have been updated to allow entire applications in 16-bit, for example, PiTiVi rendering.

Posted in development, dirac, gstreamer, orc | Tagged , , , , , , , , , , , , | Comments Off

GStreamer Conference Recap

The first GStreamer conference took place last week in Cambridge in the UK, which I attended and gave a presentation about Orc.  I was pleasantly surprised at the number of people that attended, packing the room with people spilling out into the hall.  For those of you that missed it, the presentation was recorded by the people from Free Electrons and will be posted on their site some time soon.

Several people mentioned to me at the conference some variation of “I have no assembly background, but I learned how to use Orc in a few hours, converted my video processing code, and now it’s 4x faster.”  This is always encouraging to hear.  Of course, some mention that Orc-generated code isn’t faster than C code — we’ll have to work on that.

The rest of the GStreamer conference was excellent and a huge success.  The organizer, Christian Schaller, said that the conference was sold out, so it seems likely that we’ll have a bigger and better conference next year.  I was interested in seeing every talk, which means I’ll be spending an entire day watching the ones I missed whenever the video is uploaded.

Posted in conferences | Tagged , , , , , , | Comments Off

Open Video Conference Recap

It’s taken me a week to recover from our week in New York for Open Video Conference and FOMS, but it was so worth it. We had a great time meeting with old friends, some of whom we only see online or once a year at conventions, as well as networking with a ton of terrific new people.

Huge appreciation goes to Ben Moskowitz for organizing an inspiring and well run conference. We were happy to help sponsor Open Video Conference, and look forward to returning. This year the conference was bigger, more diverse, and reflected the evolving world of open video to not only software developers, but end users, film makers, and non-profit groups. It’s an exciting time to be working in this kind of technology.

The first day we ran demos of the Entropy Wave E1000 Live Encoder, streaming up to HD quality video from the E1000 to several devices to show the versatility of the box.

Here’s one of the streams (HD Ogg/Theora/Vorbis over RTP) on a Linux-based laptop

Another of the streams (Ogg/Theora/Vorbis) being played on a stock Nokia N900.

And a third stream (MPEG-TS/H.264/AAC) being played on an Apple iPhone demonstrating H.264, AAC, MPG-TS, and Apple HTTP Live Streaming.

The next day David Schleef moderated a panel discussion on Licensing, Patent Issues, and Standardization of codecs, participants included Laura DeNardis (Executive Director at Yale Isp), Mike Flathers (CTO Sorenson Media), Rob Glidden (Open Video/Digital TV standards advocate), and Timothy Terriberry (codec developer currently with Mozilla). Among the five of them, they represented enough knowledge on the legal and logistical side of open codecs that an entire conference could have been filled with just that discussion. Unfortunately, they only had an hour, but a ton of useful knowledge was shared and an extremely lively discussion ensued.

After that, we ran to David’s next talk, discussing video compression trade-offs, geared towards end users like editors and workflow managers. Again, with only an hour it’s impossible to really cover most of the issues involved, but he and Jon Dahl of Zencoder gave a very decent overview of the encoder options, and in Jon’s case, a discussion of cloud encoding.

The next day was the start of Foundations of Open Media Software, which was well organized and kept on task by Silvia Pfeiffer. In the two days of discussion, a ton was covered. Check out the write-up of day one, general discussion about the advantages and disadvantages of adaptive HTTP streaming, and day two, discussing the creation of a solution for Ogg and WebM.  Sylvia has a great write up on her blog about some of this as well.

We actually did manage to get out and enjoy a bit of the city after the conferences. David and I took in the Metropolitan Museum with some fellow developers, it was nice to get out from behind the laptops and the Met is astounding!

Posted in conferences, Uncategorized | Tagged , , , , , , , , , , , , , , , | Comments Off