Accelerate Your Media Apps Today (and Tomorrow) on Intel® Hardware
By Garret Romaine
The Intel® Media Software Development Kit (SDK) 1.0 release, a software development library that exposes the media acceleration capabilities of Intel® platforms for decoding, encoding, and video preprocessing, will be ready for beta release just in time for SIGGRAPH 2009. Already hailed by early adopters for its ease of use and comprehensive approach, the Intel Media SDK reduces code paths, makes current work future-proof for Intel® processors and graphics processing units (GPUs), and provides for x86 legacy support.
According to Craig A. Hurst, senior marketing manager and media strategist for the Intel Visual Computing Software Division, “The Intel Media SDK beta is now available at www.intel.com/software/mediasdk, and we are encouraging developers to download the software package and take it for a spin. We have received such valuable input from our pre-alpha and alpha users that the final release won’t be too far behind.”
Features and Benefits
The new Intel Media SDK has three key benefits: better codecs, a common application programming interface (API), and “future-proof” coding.
Better codecs. The new software development tool helps developers access hardware acceleration for video codecs. Hardware acceleration for video codecs is already present in Intel® hardware today, starting with the four-series chipset family, and developers can expect even more support in upcoming products. Hardware acceleration improves the user experience by creating a more responsive environment that typically uses less power.
New hardware-accelerated codecs will greatly impress end users, offering smoother playback for high-definition content and reducing battery consumption for laptop applications.
Common API. The Intel Media SDK offers a common API for video encode and decode functions, promising to standardize the interfaces for integrated and discrete Intel® Graphics and increasing the return on investment for adopters. The obvious benefit for developers is that once they adopt the Intel Media SDK, they can greatly reduce lead times on subsequent projects by reducing or ending the frustrating code branching necessary for different platforms.
Future-proof coding. Developers can help future-proof their code for Intel’s diverse hardware universe, including processors, GPUs, and add-in cards, including visual computing co-processors such as Larrabee. The Intel Media SDK supports Intel Graphics, including the Intel® G45/GM45 Express Chipset shipping today, as well as future chipsets, processors, and Larrabee, through a single API. The new tool supports encoding for H.264 (advanced video coding) and MPEG-2 video, with decoding for MPEG-2 video, VC-1, and H.264.
Powerful New Tool
The Intel Media SDK provides built-in support for developers to create full 1080p high-definition playback applications without using the notoriously difficult DirectX* Video Acceleration (DXVA), an API that uses the capabilities of the graphics hardware to speed up the decode process of video content. DXVA is not trivial, and there are multiple ways to use it for different pieces of hardware, making it a difficult and challenging environment for a developer. The Intel Media SDK provides a simpler interface for the developer and performs the hard work of talking to the hardware correctly.
According to Eric Sardella, senior technical marketing engineer at Intel, the “bad old days” were just that—bad. Developers were often forced to poke obscure registers bit by bit, hoping to get incremental results they could build on. Sardella recently described for Visual Adrenaline his time in the depths of despair working on Media Player Classic. “DXVA is hard, and sometimes it takes a lot of trial and error putting video in the player,” he explained. “Microsoft’s documentation is very difficult to decipher, and there is precious little sample code available. To make matters even more difficult, Intel hardware has specific implementation rules that were not very well known.”
Sardella provided an example, describing one tough project. “I was asked to write a white paper describing how to implement the DXVA interface for our Intel® G45 graphics part,” he recalled. “One of our ISN community members had recently started a thread asking for the information. He was one of the chief contributors of an open source project called Media Player Classic Home Cinema (http://mpc-hc.sourceforge.net/ ). Over the course of a few months, he and I exchanged e-mails and code. He knew the architecture of the player, and I knew the specifics of what our hardware needed, so we made a good team. Eventually, we had MPC utilizing our hardware to accelerate the playback successfully. The resulting code was checked into SourceForge so the rest of the community could learn from and innovate with it.”
“We found getting all that data to the accelerator the way it wants everything is tough. I read that specification every day for a few weeks. Only by experimentation did we make any progress. It took us a good month of staring at the code before we ever saw a picture. We were fortunate in that we had a framework, plus persistence. One night I was at home and got an e-mail from a guy in France; he got a picture. From there we just hacked away.”
“If I just had the beta version of the Intel Media SDK, all of that struggling would have been taken care of. I’d just put it in, and it would work. What I had to struggle through was the innards. If I had a simple interface I could have been done in a week. I’m looking forward to taking the Intel Media SDK and putting it through its paces.”
Early Adopters Positive
Intel conducted a formal alpha stage for the Intel Media SDK and gathered feedback from a host of sources. Two independent software vendors (ISVs), CyberLink and Nero, responded positively to the new software, reporting greater ease in deploying new software applications quickly.
CyberLink’s product focus is consumer multimedia software. Alice Chang, CyberLink’s CEO, explained that “Photo, audio, and video software require a lot of processing power, so it was a natural fit for both companies to work together. Our relationship with Intel started with the Pentium® CPU. When Intel introduced MMX technology, it was the first time we could use an x86 CPU to process video in real time. After that success, both companies continued to work together closely. CyberLink recognizes that our applications require a fast hardware platform. Intel’s architecture improvements have allowed CyberLink to continuously innovate, providing new ways of managing, editing, and enjoying digital media.”
Louis Chen, CyberLink senior product manager, was also positive. “As a leader in consumer media applications, we started working with Intel to support the Intel Media SDK from the very beginning. We are eager to see Intel Media SDK proliferate to more Intel platforms so consumers can have access to media transcoding capabilities with faster performance. Intel has provided outstanding support to CyberLink, allowing us to enhance our applications in ways that leverage the strengths of the Intel Media SDK.”
CyberLink is particularly interested in gaining consistent quality across different Intel platforms, according to Chen. “By leveraging the Intel Media SDK for core video functions, CyberLink can focus on innovation in our applications. The Intel Media SDK provides automatic allocation of system resources, thus reducing the complexity of software development. The same code can run both on high-end and mainstream PC platforms.”
Intel is also working with Nero, the creator of liquid media technology, which enables liquid content creation and distribution anytime, anywhere, and on any device. Nero provides consumers with the freedom to enjoy music, photos, and videos, regardless of the hardware or file format, by taking a unique platform-neutral, standards-based approach to solution development.
Kris Barton, executive vice president for global products at Nero AG, said his company has worked closely with Intel for five years. “We arranged several in-house training sessions with Intel, and they provided personal engineering support dedicated to us. We were regularly supplied with pre-release hardware and software products, allowing us to verify early that we run well on Intel’s newest hardware. The personal contact with the people from Intel is also very good.”
Barton said that the best part about working with Intel on this type of new product has been Nero’s ability to “contribute our own ideas and have the possibility to influence development. We are in direct touch with the market leader, and we have quick access to the technology of the future.”
According to Barton, Nero heard about the Intel Media SDK for the first time in mid-2008, when some rough ideas were discussed. “Since the end of 2008, there was a more intensive communication and exchange of ideas and findings,” he said. “The documentation and interfaces of the Intel Media SDK are very clean and well thought through. It is obvious that there was a good amount of time put into designing a high-quality and high-performance API. There is a strong possibility to save future development costs, as the Intel Media SDK automatically supports upcoming Intel hardware.”
Intel Media SDK Block Diagram
To better understand the Intel Media SDK, consider the block diagram in Figure 1. ISV applications and plug-ins access the optimized media libraries of Intel Graphics using the Intel Media SDK API for all encoding, decoding, and preprocessing.
Anticipation is Building
Intel offers decode acceleration today on millions of PCs in shipment and will offer encode acceleration in future products. Intel understands that media ISVs want increased performance and ease of development for not only encode but also decode capabilities within their products. Intel will offer hardware acceleration in visual computing co-processors such as Larrabee, but no industry standard API exists for encode operations today. Microsoft has not defined a standard API for encoding within DirectX, defining the decode standard only. While many video hardware vendors are attempting to fill this need for a standard interface, the Intel Media SDK promises to become the de facto standard for hardware-accelerated encode and decode, due to its ease of use, the flexibility to support legacy hardware, and solid support for other codecs.
The Intel® Media SDK beta version will be available for download in time for SIGGRAPH 2009 (August 3-7) at: www.intel.com/software/mediasdk
Intel Graphics platforms promise developers considerable opportunities for scaling up by putting all video efforts going forward under a single API. Given Intel’s hardware volumes, a common API that covers current and legacy platforms gives developers an efficient way to ensure maximum performance.
No SDK article would be complete without a code sample, and we offer two procedures for study. Both examples highlight how easy it is to use the SDK, thanks to solid planning up front. Hurst explained: “As you can see from these code samples, invoking the Intel Media SDK to take advantage of the hardware acceleration in Intel platforms is elegant in its straightforward approach and simplicity.”
Create SDK session
Allocate I/O buffers
While (!EOF || FramesRemaining) do
If !EOF, read bitstream from file
Locate available frame buffers
Write output frames to file
De-allocate I/O buffers
Destroy DECODE & CORE
Destroy SDK session
Create SDK session
Allocate I/O buffers
For each frame do
Locate available frame buffers
Read raw frames from file
If output bitstream available,
then write bitstream to file
De-allocate I/O buffers
Destroy ENCODE & CORE
Destroy SDK session Summary
The Intel Media SDK specifically targets general application developers who integrate encoding and decoding into their applications. The beta release includes simple console samples of media framework components and a transcoding application for a hands-on experience.
Intel has already adopted several suggestions from the alpha round of customer feedback and continues to listen throughout the beta phase. If you want to make your voice heard, download the beta package and start working your way through it. Look for the final version of the SDK to be available soon to integrate into your applications.
About the Author
Garret Romaine is a long-time journalist and technical writer hailing from Portland, Oregon. He was a beta tester for Epic MegaGames in the 1990s, working on titles such as Unreal*, One Must Fall*: 2097, and Jazz Jackrabbit 2*. Garret wrote numerous game reviews and features for Computer Bits magazine and has contributed to ESCMAG.com, specializing in real-time strategy games such as Dune II* and Command & Conquer*.
Sign up today for Intel® Visual Adrenaline magazine: http://va.softwaredispatch.intel.com/ »