3GPP TS 26.104 V 5.1.0 (2003-03)
Technical Specification
3
rd
Generation Partnership Project;
Technical Specification Group Services and System Aspects;
ANSI-C code for the floating-point Adaptive Multi Rate (AMR)
speech codec
(Release 5)
GLOBAL SYSTEM FOR
MOBILE COMMUNICATIONS
R
The present document has been developed within the 3
rd
Generation Partnership Project (3GPP
TM
) and may be further elaborated for the purposes of 3GPP.
The present document has not been subject to any approval process by the 3GPP
Organisational Partners and shall not be implemented.
This Specification is provided for future development work within 3GPP
only. The Organisational Partners accept no liability for any use of this Specification.
Specifications and reports for implementation of the 3GPP
TM
system should be obtained via the 3GPP Organisational Partners' Publications Offices.
3GPP
3GPP TS 26.104 V 5.1.0 (2003-03)
2
Release 5
Keywords
GSM, UMTS, codec
3GPP
Postal address
3GPP support office address
650 Route des Lucioles - Sophia Antipolis
Valbonne - FRANCE
Tel.: +33 4 92 94 42 00 Fax: +33 4 93 65 47 16
Internet
http://www.3gpp.org
Copyright Notification
No part may be reproduced except as authorized by written permission.
The copyright and the foregoing restriction extend to reproduction in all media.
© 2003, 3GPP Organizational Partners (ARIB, CWTS, ETSI, T1, TTA, TTC).
All rights reserved.
3GPP
3GPP TS 26.104 V 5.1.0 (2003-03)
3
Release 5
Contents
Foreword .............................................................................................................................................................4
1 Scope.........................................................................................................................................................5
2 Normative references................................................................................................................................5
3 Definitions and abbreviations ...................................................................................................................6
3.1 Definitions.................................................................................................................................................................6
3.2 Abbreviations ............................................................................................................................................................6
4 C code structure ........................................................................................................................................6
4.1 Contents of the C source code...................................................................................................................................6
4.2 Program execution.....................................................................................................................................................7
4.3 Coding style...............................................................................................................................................................7
4.4 Code hierarchy ..........................................................................................................................................................7
4.5 Variables, constants and tables................................................................................................................................10
4.5.1 Description of constants used in the C code......................................................................................................11
4.5.2 Description of fixed tables used in the C code ..................................................................................................11
4.5.3 Static variables used in the C code ....................................................................................................................13
5 Homing procedure ..................................................................................................................................16
6 File formats .............................................................................................................................................22
6.1 Speech file (encoder input / decoder output)...........................................................................................................22
6.2 Mode control file (encoder input) ...........................................................................................................................22
6.3 Parameter bitstream file (encoder output / decoder input) ......................................................................................22
Annex A (informative): Change History...............................................................................................23
3GPP
3GPP TS 26.104 V 5.1.0 (2003-03)
4
Release 5
Foreword
This Technical Specification (TS) has been produced by the 3
rd
Generation Partnership Project (3GPP).
The contents of the present document are subject to continuing work within the TSG and may change following formal
TSG approval. Should the TSG modify the contents of the present document, it will be re-released by the TSG with an
identifying change of release date and an increase in version number as follows:
Version x.y.z
where:
x the first digit:
1 presented to TSG for information;
2 presented to TSG for approval;
3 or greater indicates TSG approved document under change control.
y the second digit is incremented for all changes of substance, i.e. technical enhancements, corrections,
updates, etc.
z the third digit is incremented when editorial only changes have been incorporated in the document.
3GPP
3GPP TS 26.104 V 5.1.0 (2003-03)
5
Release 5
1 Scope
This Technical Standard (TS) contains an electronic copy of the ANSI-C code for a floating-point implementation of
the Adaptive Multi-Rate codec. This floating-point codec specification is mainly targeted to be used in multimedia
applications such as the 3G-324M terminal specified in 3GPP TS 26.110, or in packet-based (e.g., H.323) applications.
The bit-exact fixed-point ANSI-C code in 3GPP TS 26.073 remains the preferred implementation for all applications,
but the floating-point codec may be used instead of the fixed-point codec when the implementation platform is better
suited for a floating-point implementation. It has been verified that the fixed-point and floating-point codecs
interoperate with each other without any artifacts.
The floating-point ANSI-C code in this specification is the only standard conforming non-bit-exact implementation of
the Adaptive Multi Rate speech transcoder (3GPP TS 26.090 [2]), Voice Activity Detection (3GPP TS 26.094 [6]),
comfort noise generation (3GPP TS 26.092 [4]), and source controlled rate operation (3GPP TS 26.093 [5]). The
floating-point code also contains example solutions for substituting and muting of lost frames (3GPP TS 26.091 [3]).
The fixed-point specification in 26.073 shall remain the only allowed implementation for the 3G mandatory
speech service and the use of the floating-point codec is strictly limited to other services.
The floating-point encoder in this specification is a non-bit-exact implementation of the fixed-point encoder producing
quality indistinguishable from that of the the fixed-point encoder. The decoder in this specification is functionally a
bit-exact implementation of the fixed-point decoder, but the code has been optimized for speed and the standard fixed-
point libraries are not used as such.
2 Normative references
The following documents contain provisions which, through reference in this text, constitute provisions of the present
document.
� References are either specific (identified by date of publication, edition number, version number, etc.) or
non-specific.
� For a specific reference, subsequent revisions do not apply.
� For a non-specific reference, the latest version applies. In the case of a reference to a 3GPP document (including
a GSM document), a non-specific reference implicitly refers to the latest version of that document in the same
Release as the present document.
[1] 3GPP TS 26.074: "AMR Speech Codec; Test sequences".
[2] 3GPP TS 26.090: "AMR Speech Codec; Speech transcoding".
[3] 3GPP TS 26.091: "AMR Speech Codec; Substitution and muting of lost frames".
[4] 3GPP TS 26.092: "AMR Speech Codec; Comfort noise aspects".
[5] 3GPP TS 26.093: "AMR Speech Codec; Source controlled rate operation".
[6] 3GPP TS 26.094: "AMR Speech Codec; Voice Activity Detection".
[7] 3GPP TS 26.073: "ANSI-C code for the Adaptive Multi Rate speech codec".
[8] 3GPP TS 26.101: "AMR Speech Codec Frame Structure".
[9] RFC 3267 “A Real-Time Transport Protocol (RTP) Payload Format and File Storage Format for
Adaptive Multi-Rate (AMR) and Adaptive Multi-Rate Wideband (AMR-WB) Audio Codecs, June
2002.