# A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

ANALOG DEVICES Implementing an Ogg Vorbis Decoder on SHARC Processors (Rev 1, 06 2008) Owner's Manual & User Guide

Summary

Enhance your embedded audio applications with this technical guide covering the real-time implementation of an Ogg Vorbis decoder. Designed for engineers utilizing Analog Devices SHARC® processors, this resource details porting open-source multimedia codecs to efficient DSP hardware. It provides deep analysis on using VisualDSP++ tools and specific ADSP architecture features to optimize decoding workflow, ensuring stable performance in high-quality, embedded audio systems.

📄 Preview 📖 Table of Contents Contents PAGE OF 24

Page 1 Text Content

Engineer-to-Engineer Note EE-320

Technical notes on using Analog Devices DSPs, processors and development tools Visit our Web resources http://www.analog.com/ee-notes and http://www.analog.com/processors or e-mail [email protected] or [email protected] for technical support.

Implementing an Ogg Vorbis Decoder on SHARC® Processors Contributed by Jeyanthi Jegadeesan and Kulin Seth Rev 1 – June 10, 2008

Introduction This EE-Note discusses the real-time implementation of an Ogg-Vorbis decoder on SHARC® processors. The Ogg Vorbis decoder is implemented on the ADSP-21364 and ADSP-21369 SHARC processors, although the same concepts apply for all ADSP-2136x SHARC processors. The ADSP-21364 and ADSP- 21369 EZ-KIT Lite® boards are used as the hardware platform, and the Visual DSP++® development tools are used for the software development of the application. The Visual DSP++ source code for the decoder application is provided with this EE-Note in the associated .ZIP file. Throughout this document, details about the following items will be broadly addressed: Ogg Vorbis codecs Visual C++ as a cross-reference tool Architectural advantages of ADSP-2136x SHARC processors Decoder workflow Implementation on ADSP-2136x SHARC processors Features of Visual DSP++ tools Optimization

MIPS calculation

Ogg Vorbis Codecs Ogg is the Xiph.org foundation’s container format that holds multimedia data. Vorbis is a fully open, patent-free, royalty-free audio compression format, which uses Ogg format to store its bit streams as files. In many respects, Vorbis is similar in function to the MPEG-1/2 layer 3 (MP3) format and the newer MPEG-4 (AAC) format. This codec was designed for mid-to-high quality (8-k Hz to 48-k Hz bandwidth, >16-bit, polyphonic) audio at variable bit rates from 16 to 128 Kbps/channel, so it is an ideal format for music. The Ogg transport bit stream is designed to provide framing, error protection and seeking structure for higher-level codec streams that consist of raw, unencapsulated data packets, such as the Vorbis audio codec or Tarkin video codec. Vorbis encodes short-time blocks of PCM data into raw packets of bit- packed data. These raw packets may be used directly by transport mechanisms that provide their own framing and packet-separation mechanisms (such as UDP datagrams). For stream-based storage (such as files) and transport (such as TCP streams or pipes), Vorbis uses the Ogg bit stream format to provide framing/sync, sync recapture after error, landmarks during seeking, and enough information to properly

Copyright 2008, Analog Devices, Inc. All rights reserved. Analog Devices assumes no responsibility for customer product design or the use or application of customers’ products or for any infringements of patents or rights of others which may result from Analog Devices assistance. All trademarks and logos are property of their respective holders. Information furnished by Analog Devices applications and development tools engineers is believed to be accurate and reliable, however no responsibility is assumed by Analog Devices regarding technical accuracy and topicality of the content provided in Analog Devices Engineer-to-Engineer Notes.

Page Summary Contents For ANALOG DEVICES Implementing an Ogg Vorbis Decoder on SHARC Processors (Rev 1, 06 2008) Owner's Manual & User Guide

Page 1 Engineer-to-Engineer Note EE-320 Technical notes on using Analog Devices DSPs, processors and development tools Visit our Web resources http://www.analog.com/ee-notes and http://www.analog.com/process...
Page 2 separate data back into packets at the original packet boundaries without relying on decoding to find packet boundaries. Refer to Appendix A ⎯ Ogg Details for more Ogg details. For information about V...
Page 3 Architectural Advantages of SHARC Processors ADSP-2136x SHARC processors are highly integrated, 32/40-bit, floating-point processors optimized for high-performance audio processing. The processor core...
Page 4 width during transfers. The parallel port supports packing of 32-bit words into 8- or 16-bit external memory and programmable external data access duration from 3 to 32 clock cycles. Serial Ports (SPO...
Page 5 Figure 1. Overview of the Ogg Vorbis application Dataflow of the Decoder Vorbis I uses four types of packets in the compressed audio stream (three headers and one audio packet). Before decoding can be...
Page 6 Implementation on SHARC Processors Visual DSP++ File I/O The Visual C++ code is directly ported to the Visual DSP++ tools to check for compatibility. The following modifications are added to make the ...
Page 7 For ADSP-21364 processors, with the byte packing logic, the internal memory was not sufficient for the heap memory needed by the decoder. Hence, the reference application was rewritten according to th...
Page 8 approach. This allowed part of the internal memory to be used for heap, which speeds up algorithm execution. Multiple heaps were used in the decoder. One heap is placed in internal memory, and the oth...
Page 9 MEMORY seg_rth {TYPE(PM RAM) START(0x00090000) END(0x000900ff) WIDTH(48)} seg_init {TYPE(PM RAM) START(0x00090100) END(0x000901ff) WIDTH(48)} seg_int_code {TYPE(PM RAM) START(0x00090200) END(0x000902e...
Page 10 Figure 3. Ping-pong buffer mechanism The output part uses two ping-pong buffers with DMA chaining. The decoder starts filling the decoded data on output buffer 1. Once output buffer 1 is filled, seria...
Page 11 Visual DSP++ Features LDF Programming Linker Description File (.ldf) programming is used for efficient placement of the data and code to internal memory blocks. The default .ldf file is modified to al...
Page 12 Multiple Heaps and Heap Management The SHARC C/C++ run-time library supports the standard heap management functions calloc, free, malloc, and realloc. By default, these functions access the default he...
Page 13 Using Alternate Heaps Alternate heaps can be accessed by the standard functions (calloc, free, malloc, and realloc). The run-time library keeps track of a current heap, which initially is the default ...
Page 14 Code Optimization The code is optimized further in order to improve performance. Code profiling was implemented to understand how different parts of the code consume the processor computing speed (cor...
Page 15 Parallel data fetch The code is modified to add the PM keyword to enable the parallel data fetch operation. Whenever the compiler sees this keyword, it generates code to use the dual data access instr...
Page 16 On the output side, the timing requirement is that the output buffer should be written before it is sent out. With a 48-k Hz frame sync, it takes around 11 ms for the SPORT to send out a data buffer o...
Page 17 Appendix A ⎯ Ogg Details The Ogg transport bitstream is designed to provide framing (logical bitstreams), error protection and seeking structure for higher-level codec streams that consist of raw, un-...
Page 18 Ogg Encapsulation The first Vorbis packet (the identification header), which uniquely identifies the stream as Vorbis audio, is placed alone in the first page of the logical Ogg stream. This results i...
Page 19 The buffer exposure is performed by ogg_sync_buffer(). The data reading is done using fread() or a similar function. ogg_sync_wrote() tells the synchronization layer how many bytes you wrote into the ...
Page 20 Appendix B – Vorbis Details General Overview Vorbis A general-purpose perceptual audio codec Allows maximum encoder flexibility Can be scaled over exceptionally wide range of bit rates both lower and ...
Page 21 Vorbis Encoding Overview Figure 9. Vorbis encoder The Vorbis encoder involves the following stages: 1. Analysis Stage Block switching MDCT Psychoacoustic model 2. Coding Floor generation Channel coupl...
Page 22 Setup Header: Includes extensive codec setup information as well as the complete VQ and Huffman codebooks needed for decode Decode Procedure Decoding and synthesis procedure for all audio packets is e...
Page 23 In un-equal sized overlap, window shape must be modified for seamless lapping. Vorbis also codes two flag bits to specify pre- and post-window shape. Floor Decode Each floor is encoded/decoded in chan...
Page 24 References [1] ADSP-2136x SHARC Processor Hardware Reference (includes ADSP-21362/3/4/5/6), Revision 1.0, October 2005, Analog Devices, Inc. [2] ADSP-21368 SHARC Processor Hardware Reference (includes...

Manual Details

Brand Analog Devices
Pages 24
File Size 731.33 KB
Published June 15, 2026
4 views

Enter the captcha to get the download link:

captcha

Frequently Asked Questions

Which processors are suitable for implementing the Ogg Vorbis decoder?

The ADSP-21364 and ADSP-21369 SHARC processors can be used, with concepts applying to all ADSP-2136x SHARC processors.

What tools are required for the software development of this application?

VisualDSP++ development tools are used for the software development on the specified hardware platforms.

How is the decoded PCM audio output during real-time implementation?

The decoded PCM samples can be sent using a serial port to the DAC of the AD1835 codec on the EZ-KIT Lite board.

What is Vorbis in relation to Ogg format?

Vorbis is an open, patent-free, royalty-free audio compression format that uses the Ogg format to store its bit streams.