MICROSOFT CONFIDENTIAL
LASTSAVED: 5/24/2002 6:09:00 AM PAGE I
WMA Version 7.0
An Overview of Windows Media Audio
Decoding
Digital Media Division
WMA VERSION 7.0
MICROSOFT CONFIDENTIAL – INTERNAL USE ONLY
LASTSAVED: 5/24/2002 6:09:00 AM PAGE II
Table of Contents
TABLE OF TABLES IV
TABLE OF FIGURES V
AUDIENCE AND DISCLAIMER VI
SUMMARY VI
1 INTRODUCTION 1
1.1 NOTATION 3
1.1.1 Arithmetic Operators 3
1.1.2 Logical operators 4
1.1.3 Relational operators 4
1.1.4 Bitwise operators 4
1.1.5 Assignment 4
1.1.6 Mnemonics 4
1.1.7 Constants 5
1.1.8 How to Read the Bitstream Syntax? 5
2 BITSTREAM SYNTAX/DECODE PROCESS 7
2.1 OVERALL DECODE PROCESS 7
2.2 PACKET LAYER DECODER 8
2.3 FRAME LAYER DECODER 9
2.3.1 Subframe Header 9
2.3.2 Subframe Coefficient (Run-Level) Decoding 13
2.4 PARAMETER DEFINITIONS 13
3 DECODER INITIALIZATION 15
3.1 SAMPLES PER FRAME 15
3.2 CUTOFF FREQUENCIES 16
3.3 WEIGHTING MODE 16
3.4 ALLOW SUPER AND/OR SUB FRAMES 16
3.5 MAXIMUM NUMBER OF SUBFRAMES IN A FRAME 16
3.6 BITS PER SAMPLE 17
3.7 BITS TO INDICATE FRAME SIZE 17
3.8 DITHERING LEVEL 17
3.9 PARAMETERS FOR NOISE SUBSTITUTION 17
4 PACKET LAYER DECODING 20
5 FRAME LAYER DECODING 21
5.1 SUBFRAME HEADER DECODING 21
5.1.1 Bark Band Computation 21
5.1.2 Noise Substitution Header 23
5.1.3 Decoding LPC Header 24
5.1.4 Maximum Level Size, if Escape Code is Used 25
5.2 RUN-LEVEL (ENTROPY) DECODER 25
5.3 INVERSE QUANTIZER & NOISE SUBSTITUTION 27
5.3.1 An Implementation of qrand() 28
5.4 QUANTIZATION NOISE SHAPING (WEIGHTING FACTORS) 29
5.4.1 Computing Un-normalized Weights from Mask Information 29
WMA VERSION 7.0
MICROSOFT CONFIDENTIAL
LASTSAVED: 5/24/2002 6:09:00 AM PAGE III
5.4.2 Computing Un-normalized Weights from LPC Parameters 30
5.4.3 Normalizing Weights 30
5.4.4 Applying Weight Factors 31
5.4.5 Reducing the Overhead of Weighting Factors 31
5.5 MULTI-CHANNEL TRANSFORMATION 32
5.6 INVERSE MODULATED LAPPED TRANSFORM 33
5.6.1 DCT-IV 33
5.6.2 Window Function Generation 34
5.6.3 Obtaining Reconstruction Values 37
5.7 AFTER DECODING A SUBFRAME 38
6 INTERFACING WITH APPLICATIONS (INFORMATIVE) 39
6.1 SOFTWARE API FOR MICROSOFT’S WMA DECODER 41
7 TABLES 54
7.1 CONSTANTS 54
7.2 BARK FREQUENCIES 54
7.3 LSF RECONSTRUCTION VALUES 55
7.4 RUN-LEVEL VARIABLE LENGTH CODING (HUFFMAN)TABLES 56
7.4.1 Group Huffman-RLC-44Q 56
7.4.2 Group Huffman-RLC-44O 69
7.4.3 Group Huffman-RLC-16 93
7.5 MASK VARIABLE LENGTH CODING (HUFFMAN) TABLE 103
7.6 NOISE POWER VARIABLE LENGTH CODING (HUFFMAN) TABLE 105
8 PARAMETER RESTRICTIONS ON LEGAL WMA BITSTREAMS & COMPLIANT WMA
DECODERS 106
8.1 LEGAL WMA VERSION 7 BITSTREAMS 106
8.2 MAXIMUM BUFFER SIZE REQUIREMENTS 106
8.2.1 max_push_buffer_size 106
8.2.2 max_pull_buffer size 107
8.3 COMPLIANT WMA VERSION 7 DECODERS 107
8.3.1 Measuring Compliance of Decoders 107
9 GLOSSARY 1
WMA VERSION 7.0
MICROSOFT CONFIDENTIAL
LASTSAVED: 5/24/2002 6:09:00 AM PAGE IV
TABLE OF TABLES
Table 1 Conditionals & loops in the syntax description 5
Table 2 Array notation 6
Table 3 Syntax of decode_packet_layer() 8
Table 4 Syntax of decode_packet() 8
Table 5 Syntax of decode_packet_header() 8
Table 6 Syntax of decode_subframe_layer() 9
Table 7 Syntax of decode_subframe () 9
Table 8 Syntax of decode_subframe_header() 9
Table 9 Syntax for decode_frame_header_bark() 10
Table 10 Syntax for decode_frame_header_lpc() 11
Table 11 Syntax for decode_frame_header_noisesub() 12
Table 12 Syntax of decode_runlevel() 13
Table 13 Windows Media Audio Decoder API 41
Table 14 Constants used by the decoder 54
Table 15 Bark Frequencies 54
Table 16 LSF Reconstruciton Values 55
Table 17 Huffman-RLC-44Q-Mono 56
Table 18 Huffman-RLC-44Q-Diff 63
Table 19 Huffman-RLC-44O-Mono 69
Table 20 Huffman-RLC-44O-Diff 82
Table 21 Huffman-RLC-16-Mono 93
Table 22 Huffman-RLC-16-Diff 98
Table 23 Huffman Table for Mask Information 103
Table 24 Huffman Table for Noise Power Information 105
Table 25 Parameter limitations of WMA 7.0 legal bit streams 106
Table 26 Modes of Microsoft's WMA Version 7 Encoder 1
WMA VERSION 7.0
MICROSOFT CONFIDENTIAL
LASTSAVED: 5/24/2002 6:09:00 AM PAGE V
TABLE OF FIGURES
Figure 1 Windows Media Audio Encoder Block Diagram 2
Figure 2 Windows Media Audio Decoder Block Diagram 3
Figure 3 Cascaded Packet and Frame Layer Decoders 8
Figure 4 Obtaining LPC Parameters 24
Figure 5 The process to obtain spectral weighting factors 29
Figure 6 Inverse Modulated Lapped Transform Process 33
Figure 7 Window Function Values for various combinations of subframe sizes 36
Figure 8 Flow diagram of interaction between an application and a WMA decoder 40