Port of a fixed point MPEG2-AAC encoder
- n a ARM platform
Romain Pagniez University College Dublin
Information Hiding Laboratory Department of Computer Science Belfield, Dublin 4 – Ireland http://ihl.ucd.ie/
⊲ UCD, August 2004
Port of a fixed point MPEG2-AAC encoder on a ARM platform Romain - - PowerPoint PPT Presentation
Port of a fixed point MPEG2-AAC encoder on a ARM platform Romain Pagniez University College Dublin Information Hiding Laboratory Department of Computer Science Belfield, Dublin 4 Ireland http://ihl.ucd.ie/ UCD, August 2004 Overview
⊲ UCD, August 2004
Introduction Perceptual Audio Coding Fixed Point Elements Development Toolset Implementation Results Summary
⊲ 1/22
MPEG2 AAC: state of the art in perceptual audio compression. It
MPEG-like perceptual encoders are quite complex and involve a
Computing the algorithm on a dedicated hardware chip could be an
Hardware encoding research is been conduced in the IHL on that
⊲ 2/22
Having the encoder properly working on a ARM platform. Communication functions: serial port of the board. Ethernet port. Double precision multiplication algorithm.
⊲ 3/22
AAC Specifications Floating Point Software Encoder Fixed Point Software Encoder Fixed Point ARM Encoder Fixed Point FPGA Encoder
Keith Cullen (PhD) Keith Cullen (PhD) Alexis Guerin (MSc) My project
⊲ 4/22
Filterbank Time / Frequency Mapping Digital Audio Input Bit / Noise Allocation and Coding Bitstream Formatting Psychoacoustic Model Encoded Bitstream Ancillary Data (optional)
Filter bank:
Psychoacoustic model: simultaneously determines the overall masking
Allocation block: uses the masking threshold to decide how many
Bitstream formatting: multiplexes all the data to be transmitted.
⊲ 5/22
10
1
10
2
10
3
10
4
20 40 60 80 100
Frequency (Hz) Sound Pressure Level (dB) Threshold in Quiet
⊲ 6/22
Frequency Amplitude MaskingThreshold MaskingTone MaskedTone
⊲ 7/22
Time Level (dB) Frequency
⊲ 8/22
S
2 2 2 2
1
WL IWL FWL
Fixed point representation virtually places a radix point somewhere
This is equivalent to considering integers of portion of some unit. For example, one might represent 1/100ths of a unit; with 4 decimal
What is the more accurate position for the radix point ?
⊲ 9/22
Range 4-bit Unsigned Step Size
1.00000 0.50000 0.25000 0.12500 0.06250 2.00000 0.03125 [0, 0.93750] [0, 7.50000] [0, 30.00000] [0, 15.00000] [0, 1.87500] [0, 0.46875] [0, 3.75000]
⊲ 10/22
The optimal position of the radix point must be chosen considering
The goal is to minimize error: overflow must be avoided and precision
Position of the binary point may vary along the encoding process. Simulations must be carried out to determine the optimal position of
⊲ 11/22
EPXA1 development board: EPXA1F484C device
32 Mo RAM 8 Mo flash 100 Mbit Ethernet JTAG header LCD display Quartus II software GNUpro compiler
⊲ 12/22
⊲ 13/22
ARM PLD
LCD Serial Port Switch LEDs Ethernet etc. AHB
The PLD is the only interface of the ARM processor. We must configure the FPGA.
⊲ 14/22
Quartus II Software Builder quartus_swb
Software Source Files
MegaWizard Plug-in Manager
System Build Descriptor File Slave Binary Image File From Quartus II Hardware Compiler (full compilation) Flash Programming File Simulator Initialisation Files To Quartus II Simulator or
Simulation Tools
⊲ 15/22
Simulation program running on a PC
Fixed Point AAC Encoder
Simulated fixed point environment Audio data
AAC Compressed audio file
⊲ 16/22
Master program running on a host PC
Fixed Point AAC Encoder
Audio data
AAC Compressed audio file
Slave fixed point encoder running on the EPXA1
Communication Functions Communication Functions
⊲ 17/22
Bit Rate (4 Bytes) encode (2 Bytes) 1024 audio samples (mono - 1024 * 2 Bytes)
Number of samples (4 Bytes) Bytes per sample (4 Bytes) Sample Rate (4 Bytes) Number of channels (4 Bytes) encode (2 Bytes) Size of Buffer (4 Bytes) Encoded Bitstream (size_of_buffer * 1 Byte) Size of Buffer (4 Bytes) Encoded Bitstream (size_of_buffer * 1 Byte) STOP (2 Bytes) Size of Buffer (4 Bytes) Encoded Bitstream (size_of_buffer * 1 Byte)
From Host PC to Board From Board to Host PC
⊲ 18/22
AAC Encoding AAC Encoding AAC Encoding
Host PC EPXA1 Dev. Board Host PC EPXA1 Dev. Board
AAC Encoding AAC Encoding AAC Encoding AAC Encoding Time
⊲ 19/22
Naive implementation
Communication overlapped with (faster) computations
⊲ 20/22
Encoding time for the communication overlapped with computations
⊲ 21/22
The encoder works as expected Communications on the serial port, even if slower the Ethernet, are
⊲ 22/22