1、 International Telecommunication Union ITU-T G.711.0TELECOMMUNICATION STANDARDIZATION SECTOR OF ITU (09/2009) SERIES G: TRANSMISSION SYSTEMS AND MEDIA, DIGITAL SYSTEMS AND NETWORKS Digital terminal equipments Coding of voice and audio signals Lossless compression of G.711 pulse code modulation Recom
2、mendation ITU-T G.711.0 ITU-T G-SERIES RECOMMENDATIONS TRANSMISSION SYSTEMS AND MEDIA, DIGITAL SYSTEMS AND NETWORKS INTERNATIONAL TELEPHONE CONNECTIONS AND CIRCUITS G.100G.199 GENERAL CHARACTERISTICS COMMON TO ALL ANALOGUE CARRIER-TRANSMISSION SYSTEMS G.200G.299 INDIVIDUAL CHARACTERISTICS OF INTERNA
3、TIONAL CARRIER TELEPHONE SYSTEMS ON METALLIC LINES G.300G.399 GENERAL CHARACTERISTICS OF INTERNATIONAL CARRIER TELEPHONE SYSTEMS ON RADIO-RELAY OR SATELLITE LINKS AND INTERCONNECTION WITH METALLIC LINES G.400G.449 COORDINATION OF RADIOTELEPHONY AND LINE TELEPHONY G.450G.499 TRANSMISSION MEDIA AND OP
4、TICAL SYSTEMS CHARACTERISTICS G.600G.699 DIGITAL TERMINAL EQUIPMENTS G.700G.799 General G.700G.709 Coding of voice and audio signals G.710G.729Principal characteristics of primary multiplex equipment G.730G.739 Principal characteristics of second order multiplex equipment G.740G.749 Principal charac
5、teristics of higher order multiplex equipment G.750G.759 Principal characteristics of transcoder and digital multiplication equipment G.760G.769 Operations, administration and maintenance features of transmission equipment G.770G.779 Principal characteristics of multiplexing equipment for the synchr
6、onous digital hierarchy G.780G.789 Other terminal equipment G.790G.799 DIGITAL NETWORKS G.800G.899 DIGITAL SECTIONS AND DIGITAL LINE SYSTEM G.900G.999 MULTIMEDIA QUALITY OF SERVICE AND PERFORMANCE GENERIC AND USER-RELATED ASPECTS G.1000G.1999 TRANSMISSION MEDIA CHARACTERISTICS G.6000G.6999 DATA OVER
7、 TRANSPORT GENERIC ASPECTS G.7000G.7999 PACKET OVER TRANSPORT ASPECTS G.8000G.8999 ACCESS NETWORKS G.9000G.9999 For further details, please refer to the list of ITU-T Recommendations. Rec. ITU-T G.711.0 (09/2009) i Recommendation ITU-T G.711.0 Lossless compression of G.711 pulse code modulation Summ
8、ary Recommendation ITU-T G.711.0 describes a lossless compression scheme of a G.711 bitstream, mainly aimed for transmission over IP (e.g., VoIP). The coder operates on frame lengths of 40, 80, 160, 240 and 320 samples, has a maximum algorithmic delay equal to the frame length, and has a worst-case
9、computational complexity of less than 1.7 weighted million operations per second (WMOPS) for encoder plus decoder. This Recommendation includes an electronic attachment containing a non-exhaustive set of test signals for use with the ANSI C code. ANSI C source code is provided for the fixed-point ar
10、ithmetic implementation of the specification. Source Recommendation ITU-T G.711.0 was approved on 22 September 2009 by ITU-T Study Group 16 (2009-2012) under Recommendation ITU-T A.8 procedures. ii Rec. ITU-T G.711.0 (09/2009) FOREWORD The International Telecommunication Union (ITU) is the United Na
11、tions specialized agency in the field of telecommunications, information and communication technologies (ICTs). The ITU Telecommunication Standardization Sector (ITU-T) is a permanent organ of ITU. ITU-T is responsible for studying technical, operating and tariff questions and issuing Recommendation
12、s on them with a view to standardizing telecommunications on a worldwide basis. The World Telecommunication Standardization Assembly (WTSA), which meets every four years, establishes the topics for study by the ITU-T study groups which, in turn, produce Recommendations on these topics. The approval
13、of ITU-T Recommendations is covered by the procedure laid down in WTSA Resolution 1. In some areas of information technology which fall within ITU-Ts purview, the necessary standards are prepared on a collaborative basis with ISO and IEC. NOTE In this Recommendation, the expression “Administration“
14、is used for conciseness to indicate both a telecommunication administration and a recognized operating agency. Compliance with this Recommendation is voluntary. However, the Recommendation may contain certain mandatory provisions (to ensure e.g., interoperability or applicability) and compliance wit
15、h the Recommendation is achieved when all of these mandatory provisions are met. The words “shall“ or some other obligatory language such as “must“ and the negative equivalents are used to express requirements. The use of such words does not suggest that compliance with the Recommendation is require
16、d of any party. INTELLECTUAL PROPERTY RIGHTS ITU draws attention to the possibility that the practice or implementation of this Recommendation may involve the use of a claimed Intellectual Property Right. ITU takes no position concerning the evidence, validity or applicability of claimed Intellectua
17、l Property Rights, whether asserted by ITU members or others outside of the Recommendation development process. As of the date of approval of this Recommendation, ITU had received notice of intellectual property, protected by patents, which may be required to implement this Recommendation. However,
18、implementers are cautioned that this may not represent the latest information and are therefore strongly urged to consult the TSB patent database at http:/www.itu.int/ITU-T/ipr/. ITU 2010 All rights reserved. No part of this publication may be reproduced, by any means whatsoever, without the prior w
19、ritten permission of ITU. Rec. ITU-T G.711.0 (09/2009) iii CONTENTS Page 1 Scope 1 2 Reference 1 3 Definitions 1 4 Abbreviations and acronyms 1 5 Conventions 2 6 General description of the ITU-T G.711.0 coder . 4 6.1 Encoder . 4 6.2 Decoder . 5 6.3 Supported frame lengths . 6 6.4 Bit rate 6 6.5 Algo
20、rithmic delay . 6 6.6 Computational complexity and memory requirements 7 6.7 Coder description 7 6.8 Mapping functions 7 6.9 Variable-length coding schemes . 10 7 Functional description of the encoder . 10 7.1 Prefix codes for frame length . 10 7.2 Prefix codes associated with each encoding tool . 1
21、1 7.3 Encoding tool selection 12 7.4 Uncompressed coding tool . 14 7.5 Constant value coding tools 14 7.6 Plus-Minus zero Rice coding tool 15 7.7 Binary coding tool 16 7.8 Pulse mode coding tool 16 7.9 Value-location coding tool . 18 7.10 Mapped domain LP coding tool . 21 7.11 Fractional-bit coding
22、tool . 38 7.12 Min-Max level coding tool . 41 7.13 Direct LP coding tool . 45 8 Functional description of the decoder . 45 8.1 Obtaining the frame length and the decoding tool from a prefix code . 45 8.2 Uncompressed decoding tool . 46 8.3 Constant value decoding tools 46 8.4 PM zero Rice decoding t
23、ool . 46 8.5 Binary decoding tool 46 8.6 Pulse mode decoding tool . 46 8.7 Value-location decoding tool . 47 iv Rec. ITU-T G.711.0 (09/2009) Page 8.8 Mapped domain LP decoding tool . 49 8.9 Fractional bit decoding tool 54 8.10 Min-Max level decoding tool . 55 8.11 Direct LP decoding tool 55 9 Bit-ex
24、act description of the ITU-T G.711.0 codec . 55 9.1 Use of the simulation software . 56 9.2 Organization of the simulation software 57 Electronic attachment Fixed-point reference implementation and associated test signals Rec. ITU-T G.711.0 (09/2009) 1 Recommendation ITU-T G.711.0 Lossless compressi
25、on for G.711 pulse code modulation 1 Scope This Recommendation contains the description of a lossless compression scheme of an ITU-T G.711 bitstream. This Recommendation is organized as follows. The references, definitions, abbreviations, acronyms, and conventions used throughout this Recommendation
26、 are defined in clauses 2, 3, 4, and 5, respectively. Clause 6 gives a general outline of the ITU-T G.711.0 algorithm. The ITU-T G.711.0 encoder and decoder principles are discussed in clauses 7 and 8, respectively. Clause 9 describes the software that defines this coder in 16-32 bit fixed-point ari
27、thmetic. This Recommendation contains an electronic attachment with a fixed-point reference implementation and a non-exhaustive set of test signals for use with the reference implementation. 2 Reference The following ITU-T Recommendations and other references contain provisions which, through refere
28、nce in this text, constitute provisions of this Recommendation. At the time of publication, the editions indicated were valid. All Recommendations and other references are subject to revision; users of this Recommendation are therefore encouraged to investigate the possibility of applying the most r
29、ecent edition of the Recommendations and other references listed below. A list of the currently valid ITU-T Recommendations is regularly published. The reference to a document within this Recommendation does not give it, as a stand-alone document, the status of a Recommendation. ITU-T G.191 Recommen
30、dation ITU-T G.191 (2005), Software tools for speech and audio coding standardization. ITU-T G.711 Recommendation ITU-T G.711 (1988), Pulse code modulation (PCM) of voice frequencies. 3 Definitions This Recommendation does not introduce new definitions. 4 Abbreviations and acronyms This Recommendati
31、on uses the following abbreviations and acronyms: IP Internet Protocol LLC LossLess Compression LP Linear Prediction LPC Linear Predictive Coding LSB Least Significant Bit LTP Long-Term Prediction MSB Most Significant Bit PARCOR PARtial autoCOrrelation PCM Pulse Code Modulation VoIP Voice over IP 2
32、Rec. ITU-T G.711.0 (09/2009) WMOPS Weighted Million Operations Per Second 5 Conventions The notational conventions are detailed below. Time domain signals are denoted by their symbol and a sample index between parentheses, e.g., )(ns . The variable n is used as a sample index. The symbol identifies
33、a quantized version of a parameter (e.g., cg ) or a predicted sample value (e.g., )( nx ). Parameter ranges are given between square brackets, and include the boundaries (e.g., 0.6, 0.9). When one of the boundaries is denoted by using a parenthesis, the boundary at that end is not included in the ra
34、nge (e.g., 0.6, 0.9). The sign function gives the polarity of the value and is denoted as )sgn(x , where Ae (6-2) 8 Rec. ITU-T G.711.0 (09/2009) ()=+=+=0if8/256822800if8/256822)(4141PCMAAeAAesmsmnxAAelse =+=+=0if8/82800if8/82)(44PCMAAAAsmsmnx Here, sA, eAand mAare the sign, the exponent and the mant
35、issa of xA(n), respectively. 6.8.1.2 Conversion from -law to uniform PCM A conversion function fPCMwhich maps a -law sample, x(n), to a uniform PCM sample, xPCM(n), is defined as follows: xPCM(n) = fPCM(x(n) (6-3) where, given s= x(n) 0x80 and y= (x(n) 0x7F) 0x7F, ()=+=+=0if4/132412822800if4/1324128
36、22)(F00233PCM4eesmsmnxymye(6-4) Here, s, eand mare the sign, the exponent and the mantissa of x(n), respectively. 6.8.2 Conversion from uniform PCM to A-law/-law 6.8.2.1 Conversion from uniform PCM to A-law A conversion function fPCMAwhich maps a uniform PCM sample, xPCM(n), to an A-law sample, xA(n
37、), is defined as follows: xA(n) = fPCMA(xPCM(n) (6-5) where, given Plus) -01 1ss - 101s s Plus Minus zero only except one sample Pulse mode coding (Minus Plus) -01 100 - 1010 0 Value-location coding -00 0110 - 0101 See clause 7.9 Mapped domain LP coding LTP: enabled 1100 1 - 011 Only for N160 See cl
38、ause 7.10 LTP: disabled -1 - 11 See clause 7.10 Fractional bit coding 0000 0010 to 0001 1111 See clause 7.11 Min-Max level coding 0100 0101 N/A Only for N=40 See clause 7.12 Direct LP coding 0100 1 N/A Only for N=40 See clause 7.13 NOTE The first bits “-“ (for N=40, 80, 160) or “-“ (for N=240, 320)
39、are the prefix codes representing the frame length, given in Table 7-1. 12 Rec. ITU-T G.711.0 (09/2009) 7.3 Encoding tool selection Table 7-3 shows the possible tools for each frame length. A box marked with “x“ indicates that the tool is available for the specific frame length. A box marked with “N
40、/A“ indicates that this tool is not used for the specific frame length. Table 7-3 Possible tools for each frame length Tool type Frame length (N samples) 40 80 160 240 320 Uncompressed coding x x x x x Constant coding tools x x x x x Plus Minus (PM) zero only x x x x x Plus Minus zero only except on
41、e sample x x x x x Value-location coding N/A x x x x Mapped domain LP coding x x x x x Fractional bit coding x x x x x Min-Max level coding x N/A N/A N/A N/A Direct LP coding x N/A N/A N/A N/A Figure 7-1 shows how the tools are selected. The following defined terms are used in Figure 7-1: Perform Y
42、encoding denotes that the encoder actually goes through the entire encoding process of “using“ tool Y in order to determine the encoded frame size. Calculate L(Y) denotes that the encoder does not actually go through the entire process of encoding but rather uses an estimation just to determine the
43、encoded frame size, L(Y), using tool Y. Encode using Y denotes that the encoder needs to actually perform tool Y, encoding the frame if the encoder HAS NOT previously performed Y encoding; or that the encoder simply uses the encoded bitstream of the frame if the encoder HAS already encoded the frame
44、 using tool Y. L(Best) denotes the smallest encoded bitstream size of the frame for the tools in which the bitstream size has already been calculated. Best:Y denotes that tool Y is determined to be the best tool which gives the smallest encoded bitstream size of the frame. If the frame length is zer
45、o, prefix code 0x00 is generated and the encoding process is skipped. For other frame lengths, the coder first checks whether all samples in the input frame are all of equal value. If it is the case, one of the constant value coding tools is applied (see clause 7.5). If all values are plus zero 0+,
46、then the Constant Plus zero coding tool is used. If all values are minus zero 0, then the Constant Minus zero coding tool is used. Otherwise, in case of any other constant value, the Constant non-zero coding tool is used. Rec. ITU-T G.711.0 (09/2009) 13 Figure 7-1 Flow chart for encoding tool select
47、ion Constant?Plus zero only?Encode using Constant Plus zero codingEncode using Constant Minus zero codingEncode using Constant non-zero codingPM zero only?Encode using PM zero Rice codingOnly one non PM zero value?Tool selectionL(PM zero Rice) =L (Uncompressed) ?YesNoMapped domainLP codingNoL (Direc
48、t LP coding) 40 )?(Frame size =40)?NoYesDirect LP codingL (Best) k). Define s1(n) = xint8(n) with n = 0,.,N1. For k =2,.,R1, let sk(j) represent a vector after values v1,.,vk1are removed from the frame data xint8(n). The number of occurrences of vkin xint8(n) is denoted as Nk, and the number of the
49、sk(j) elements is denoted as Dk. Note that the number of elements in vectors sk(j) decreases as k increases: =1111.,2kiikRkNNDND(7-2) The elements sk(j) for k = 2,.,R1 are calculated by excluding all occurrences of vk1in the vector sk1(j) as: set i = 0 for each j = 0,.,Dk1 1 if sk1(j) vk1 then sk(i) = sk1(j) and i = i + 1 (7-3) Note also that the locations of occurrences of v0d