You are here:  Articles


 
 
 
INSIDE DSP ARTICLES  

Current Articles | Categories | Search

Inside DSP on Digital Video: Developing Software for a Digital Video Product
By Amit Shoham, 3/14/2005

Implementing real-time video processing functions in software is a challenging task. In this article we explore the particularly difficult challenges presented by video compression algorithms. Although we focus on video compression algorithms, the ideas and techniques in this article also apply to other types of video processing software.

What’s Unique about Video Software?
Software development for video applications presents many of the same challenges as those found in other embedded signal processing applications. High computational demands coupled with a need to keep costs low in consumer products often mean that aggressive software optimization is required. Non-deterministic timing of processor features such as caches can make it difficult to guarantee that software will meet strict real-time constraints. Developing efficient implementations of signal processing algorithms on today’s complex processors requires in-depth understanding of both the algorithms and the processor architecture, so engineers often face a tough learning curve when working with new algorithms or processors.

But video applications compound these challenges. For example, requirements for large amounts of memory and high memory bandwidth in video applications often present additional optimization constraints and software development challenges. And video applications and algorithms tend to be particularly complex.

Video Product Software Anatomy
Figure 1 illustrates the anatomy of software in a typical video product. A real-time operating system schedules application tasks, manages I/O device drivers, and maintains file systems on the mass storage devices. A player/recorder application interprets user commands and manages signal processing modules such as audio and video encoders and decoders, image scaling, color conversion, and audio equalization.

Anatomy of software in a typical video product.

In many video applications a single processor is not capable of performing all of the desired signal processing tasks. In such cases, one or more signal processing modules are often implemented using additional processors and/or fixed-function hardware. For example, the video decoder task shown in Figure 1 might manage communication and synchronization with a video decoder running on a separate DSP processor instead of actually performing the decoding on the host processor. Alternatively, the video decoder task may perform some of the decoding, and utilize additional hardware such as a DSP or fixed-function accelerator to offload some of the most computationally demanding portions of the video decoding algorithm. See “Processors for Video: Know Your Options” for more information on processors used in these applications.

Putting the Pieces Together
Ideally, all of the software components required for the application are available as licensable off-the-shelf modules. Operating systems, video and audio encoders and decoders, and many common pre- and post-processing functions are available as off-the-shelf modules targeting a variety of processors. However, application software often must be written from scratch. Occasionally a suitable reference design may serve as a reasonable starting point.

Even when most of the needed software components are available in off-the-shelf form, integrating these components can be a significant undertaking. For example, maintaining synchronization of audio and video codecs during recording or playback can be tricky. To maintain synchronization, application software must read and write timestamps embedded in the multimedia stream. This can sometimes require compensation for delays introduced by pre- or post-processing modules.

Starting from Scratch
Implementing a complex signal processing module such as a video decoder or encoder is probably the most challenging software development task in video applications. (See “Squeeze Play: How Video Compression Works” in the March 2004 edition of Inside DSP for an introduction to video compression algorithms. Also see “H.264: The Video Codec to Watch” for details on the popular new H.264 algorithm.) Aggressive optimization is typically required in order to get video applications to meet cost and power targets. When the desired module isn’t available from the processor vendor or a third party and must be developed from scratch, knowing where to start is often the first hurdle.

The complexity of today’s video compression algorithms can make standards specifications difficult to understand, so implementing an encoder or decoder from scratch is a daunting proposition. Reference source code is available for most standards-based encoders and decoders. However, such reference code is typically written to illustrate the standard specification rather than to implement the algorithm efficiently. In addition to being inefficient, reference code may include superfluous code such as unneeded debugging modes. Therefore, such reference source code is awkward to use as a basis for an efficient implementation of the encoder or decoder.

Most video standards precisely specify the compressed bit stream format and the behavior of the decoder, but do not specify the behavior of the encoder. This allows developers to use their own proprietary algorithms for critical encoding steps such as motion estimation. Encoder implementations can thus compete for highest video quality or lowest bit rate, or make tradeoffs between quality, bit rate, and computational demands. Reference source code merely illustrates one possible encoding algorithm, and developers should carefully consider other approaches—such as alternative motion estimation search heuristics—if they have the requisite algorithm design expertise.

Previous Page | Next Page
 
 
FPGAs for DSP, Second Edition
  
HomeAbout Inside DSPArticlesSearch ArticlesArchivesResourcesContact UsSubscribe to Inside DSPAdvertise with Inside DSP
Copyright 2006-2008 by BDTI  |  Terms Of Use  |  Privacy Statement
  |