rfc-3267

Real-Time Transport Protocol (RTP) Payload Format and File Storage Format for the Adaptive Multi-Rate (AMR) and Adaptive Multi-Rate Wideband (AMR-WB) Audio Codecs

J. Sjoberg, M. Westerlund, A. Lakaniemi, Q. Xie
date2002-07 streamIETF arearai wgavt statusPROPOSED STANDARD pages49 canonicalhttps://www.rfc-editor.org/rfc/rfc3267 doi10.17487/RFC3267 errataview
This document specifies a real-time transport protocol (RTP) payload format to be used for Adaptive Multi-Rate (AMR) and Adaptive Multi-Rate Wideband (AMR-WB) encoded speech signals. The payload format is designed to be able to interoperate with existing AMR and AMR-WB transport formats on non-IP networks. In addition, a file format is specified for transport of AMR and AMR-WB speech data in storage mode applications such as email. Two separate MIME type registrations are included, one for AMR and one for AMR-WB, specifying use of both the RTP payload format and the storage format. [STANDARDS-TRACK]

obsoleted by

Extracted elements (31)

design-rationale §4.3.1

IP endpoints SHOULD NOT set the CMR based on packet loss or congestion because the far end may be a gateway to a non-IP radio network that needs the CMR field for radio-link optimization, and IP-side congestion should instead be signalled via RTCP and managed by the IP sender.

rtp, realtime, congestion

design-rationale §3.7.1

The built-in redundant retransmission scheme (including previous frame-blocks in subsequent payloads) provides equivalent functionality to RFC 2198 with less overhead and complexity in most cases. RFC 2198 is preferred only when the spread between primary and redundant encodings exceeds 5 frame times, or when a non-AMR codec is needed for the redundant encoding.

rtp, realtime

design-rationale §4.3.2

The Q (frame quality indicator) bit is included for interoperability with the ATM payload format (ITU-T I.366.2) and UMTS Iu interface transport formats. It enables damaged frames to be forwarded to the speech decoder for error concealment rather than being discarded, improving speech quality.

rtp, realtime

design-rationale §3.8

Two payload modes are provided: bandwidth-efficient packs all bits contiguously to minimize padding overhead, while octet-aligned aligns every field individually for implementation efficiency. Only octet-aligned mode supports the advanced robustness features: robust sorting, interleaving, and frame CRC.

rtp, realtime

interoperability-note §4.3.2

AMR and AMR-WB are always distinct payload types in RTP. The extra comfort noise frame types native to GSM-EFR, IS-641, and PDC-EFR (included in the AMR frame type table) MUST NOT be used in this payload format because the standardized AMR codec only implements the general AMR SID frame type.

rtp, realtime, voip

interoperability-note §3.9

In a gateway scenario between non-IP (GSM/3GPP) and IP networks, the gateway MUST forward CMR values in both directions. For a GW-to-GW scenario, the gateway should forward the minimum of: the CMR received from the IP side, the CMR calculated from non-IP reception quality, and any CMR the gateway chooses for congestion control on the IP side.

rtp, realtime, voip, nat

normative-requirement §4.1 MUST

A receiver MUST be prepared to receive any speech frame multiple times, in exact duplicates or different AMR rate modes. If multiple versions of the same speech frame are received, it is RECOMMENDED that the mode with the highest rate be used by the speech decoder.

rtp, realtime

normative-requirement §5.3 MUST

Frame-blocks or speech frames lost in transmission MUST be stored as NO_DATA frames (FT=15) or SPEECH_LOST (FT=14, AMR-WB only) in complete frame-blocks in the storage format to maintain synchronization with the original media.

rtp, realtime

normative-requirement §4.3.2 SHOULD

If receiving a ToC entry with a FT value in the range 9-14 for AMR or 10-13 for AMR-WB, the whole packet SHOULD be discarded to avoid loss of data synchronization in depacketization, which can cause severe degradation in speech quality.

rtp, realtime

normative-requirement §7.3 SHOULD

If the calculated payload length based on session parameters and payload header fields does not match the received packet size, the receiver SHOULD discard the packet; decoding a packet with length-field errors can severely degrade speech quality.

rtp, realtime, security

normative-requirement §4.4.2.1 MUST

If the recalculated CRC over received class A bits does not match the payload CRC, the receiver SHALL consider the class A bits damaged and MUST clear the Q flag (set to 0), causing the frame to be marked SPEECH_BAD or SID_BAD before passing to the speech decoder.

rtp, realtime

normative-requirement §4.5 SHOULD

Implementations SHOULD support both bandwidth-efficient and octet-aligned mode for single channel to achieve basic interoperability. No operation mode is mandatory; interleaving, robust sorting, and frame-wise CRC are OPTIONAL.

rtp, realtime

normative-requirement §4.3.2 MUST

In a multi-channel session with N channels and K frame-blocks per packet in bandwidth-efficient mode, there MUST be N*K entries in the ToC; the first N entries are from frame-block 1, the next N from frame-block 2, and so on.

rtp, realtime

normative-requirement §6 RECOMMENDED

It is RECOMMENDED that AMR or AMR-WB applications using this payload format employ congestion control suitable for real-time flows, such as equation-based congestion control for unicast applications (RFC 3448).

rtp, congestion, realtime

normative-requirement §4.3.1 MUST

The CMR field MUST be set to 15 for packets sent to a multicast group. The encoder SHOULD ignore mode requests when sending to a multicast session but MAY use RTCP feedback as a hint that a mode change is needed.

rtp, realtime, multicast

normative-requirement §4.4.2.1 MUST

The frame CRC MUST be calculated only over all class A bits of the frame; class B and C bits MUST NOT be included in the CRC calculation and SHOULD NOT be covered by the transport-layer checksum.

rtp, realtime

normative-requirement §4.1 MUST

The RTP header marker bit (M) SHALL be set to 1 if the first frame-block in the packet contains a speech frame that is the first in a talkspurt; for all other packets the marker bit SHALL be set to zero.

rtp, realtime

normative-requirement §4.1 MUST

The RTP timestamp corresponds to the sampling instant of the first sample of the first frame-block in the packet. The timestamp is increased by 160 for AMR (8 kHz sampling) and by 320 for AMR-WB (16 kHz sampling) for each consecutive 20 ms frame-block.

rtp, realtime

normative-requirement §4.4.1 MUST

The sender MUST only apply interleaving if the receiver has signalled its use out-of-band. When performing interleaving, the sender MUST use frame-block counts (N) and ILL such that N*(L+1) <= I, where I is the receiver's declared maximum interleave group size.

rtp, realtime

protocol-element §4.3.1

The CMR (Codec Mode Request) is a 4-bit field in the payload header. Values 0-7 (AMR) or 0-8 (AMR-WB) indicate the requested speech mode; CMR=15 indicates no mode request; other values are reserved. The CMR is valid until the next CMR is received.

rtp, realtime

protocol-element §4.3.2

The Table of Contents (ToC) consists of one entry per speech frame. Each entry carries: F (1 bit, more frames follow), FT (4 bits, frame type index including SID, SPEECH_LOST, or NO_DATA), and Q (1 bit, frame quality indicator set to 0 for severely damaged frames).

rtp, realtime

registry §8.1

MIME type audio/AMR registered for the Adaptive Multi-Rate codec, covering both RTP real-time transfer and storage file format. Optional RTP parameters include octet-align, mode-set, mode-change-period, mode-change-neighbor, maxptime, ptime, channels, interleaving, and robust-sorting.

registry, rtp, realtime

registry §8.2

MIME type audio/AMR-WB registered for the Adaptive Multi-Rate Wideband codec, covering both RTP real-time transfer and storage file format. Optional parameters mirror those for audio/AMR, adapted for the 9-mode AMR-WB codec operating at 16 kHz.

registry, rtp, realtime

security-consideration §7

This payload format has no built-in security mechanisms; external mechanisms such as SRTP MAY be used. When UED/UEP is combined with encryption, stream ciphers without error-propagation are preferred because block ciphers may severely reduce error robustness of the robust-sorting scheme.

security, rtp, realtime

security-consideration §7.2

To prevent man-in-the-middle tampering, authentication mechanisms SHOULD protect the payload header, ToC, frame CRCs, RTP timestamp, sequence number, and marker bit in addition to speech bits. Combining UED/UEP with authentication is difficult because any bit error in covered bits will cause authentication failure.

security, rtp, realtime

wire-format §4.3.1

Bandwidth-efficient mode payload: 4-bit CMR packed MSB-first into the first octet, followed immediately by 6-bit ToC entries (F|FT|Q) and speech data bits packed contiguously, with zero-bit padding at the end to achieve octet alignment of the complete payload.

rtp, realtime

wire-format §4.4.2.1

Frame CRC in octet-aligned mode: 8-bit CRC (c0..c7) calculated over all class A bits using generator polynomial C(x) = 1 + x^2 + x^3 + x^4 + x^8 (binary: 101110001 MSB..LSB). One CRC per speech frame, placed as a list after the ToC entries; no CRC is present for FT=14 or FT=15 frames.

rtp, realtime

wire-format §4.4.1

Octet-aligned mode payload header: 4-bit CMR followed by 4 reserved R bits (MUST be zero, MUST be ignored on receipt). If interleaving is signalled, an additional 8-bit interleaving header follows with 4-bit ILL (interleaving length = ILL+1 frame-blocks) and 4-bit ILP (interleaving index, 0 to ILL).

rtp, realtime

wire-format §5.2

Storage format multi-channel header: magic number '#!AMR_MC1.0\n' or '#!AMR-WB_MC1.0\n' followed by a 32-bit channel description field; bits 0-27 are reserved (write zero, ignore on read) and bits 28-31 (CHAN, 4-bit unsigned) indicate the number of audio channels.

rtp, realtime

wire-format §5.1

Storage format single-channel file header: AMR magic number '#!AMR\n' (0x2321414d520a) or AMR-WB magic number '#!AMR-WB\n' (0x2321414d522d57420a). The trailing '\n' is a required part of the magic number and must be included in comparisons.

rtp, realtime

wire-format §5.3

Storage format speech frame: one-octet header (P|FT|Q|P|P) followed by speech bits in the same bit order as bandwidth-efficient RTP mode, with the last octet zero-padded to achieve octet alignment. Frame-blocks are stored consecutively in time with channels in ascending order.

rtp, realtime