rfc-4867

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
date2007-04 streamIETF arearai wgavt statusPROPOSED STANDARD pages59 canonicalhttps://www.rfc-editor.org/rfc/rfc4867 doi10.17487/RFC4867 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 media type registrations are included, one for AMR and one for AMR-WB, specifying use of both the RTP payload format and the storage format. This document obsoletes RFC 3267. [STANDARDS-TRACK]

obsoletes

Extracted elements (32)

design-rationale §4.3.1

IP endpoints SHOULD NOT set the CMR field based on packet losses or congestion because (a) the remote end may be a gateway to a non-IP radio network that uses CMR for radio-link optimization, and (b) IP congestion management is the sender's responsibility—feedback via RTCP is the correct mechanism, allowing the sender to choose among codec mode change, FEC reduction, or frame packing.

rtp, realtime, congestion

design-rationale §3.8

Only the octet-aligned mode supports robust sorting, interleaving, and per-frame CRC because these features require independently octet-aligned fields. Bandwidth-efficient mode omits these features to minimize overhead, making it preferable for conversational services over constrained links.

rtp, realtime

design-rationale §3.7.1

The built-in redundant transmission scheme (piggy-backing earlier frame-blocks) provides equivalent functionality to RFC 2198 and is more efficient for spreads up to 5 frames. RFC 2198 is preferred only when the time spread exceeds 5 frames or a non-AMR codec is needed for the redundant encoding.

rtp, realtime

interoperability-note §4.5

For GSM interoperability, encoders SHOULD only perform codec mode changes to neighboring modes and in multiples of 40 ms (two frame-blocks), but decoders SHOULD accept mode changes at any time. The mode-change-period and mode-change-capability parameters in SDP signal these constraints.

rtp, realtime

interoperability-note §4.3.2

The Q (frame quality) bit and NO_DATA/SPEECH_LOST frame type indicators are included for interoperability with the ITU-T I.366.2 ATM payload format, the 3GPP UMTS Iu interface, and other non-IP AMR transport formats, enabling damaged frames to be forwarded to the decoder for error concealment rather than dropped.

rtp, realtime

normative-requirement §4.1 MUST NOT

A given speech frame MUST NOT be encoded as speech in one packet and as comfort noise parameters in another packet.

rtp, realtime

normative-requirement §4.1 MUST

A receiver MUST be prepared to receive any speech frame multiple times (exact duplicates, different AMR rate modes, or data present vs. absent). 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 §4.5 MUST

An application implementing this payload format MUST understand all payload parameters in the out-of-band signaling (e.g., all SDP/media-type parameters defined in this document). To achieve basic interoperability, implementations SHOULD support both bandwidth-efficient and octet-aligned modes.

rtp, realtime

normative-requirement §4.3.2 MUST

For a payload with N channels and K speech frame-blocks, there MUST be exactly N*K entries in the ToC; the first N entries are from the first frame-block, the next N from the second, and so on.

rtp, realtime

normative-requirement §4.3.1 MUST

If a received CMR value is outside the signaled subset of modes, it MUST be ignored. If receiving a payload with a CMR value that is not a speech mode or NO_DATA, the CMR MUST be ignored by the receiver.

rtp, realtime

normative-requirement §4.5.1 SHOULD

If the receiver finds that the calculated payload length (based on payload type information and payload header field values) does not match the received packet size, the receiver SHOULD discard the packet to avoid severe speech quality degradation.

rtp, realtime

normative-requirement §4.4.1 MUST

ILL and ILP fields MUST be present in each packet of a session if interleaving is signaled out-of-band. Interleaving MUST be performed on a frame-block basis, not on a frame basis, in a multi-channel session.

rtp, realtime

normative-requirement §5.3 MUST

Non-received speech frames or frame-blocks between SID updates during non-speech periods MUST be stored as NO_DATA frames (FT=15) in the storage format. Frames lost in transmission MUST be stored as NO_DATA or SPEECH_LOST frames to maintain synchronization.

rtp, realtime

normative-requirement §4.3.1 MUST

The CMR field MUST be set to 15 (no mode request) for all packets sent to a multicast group. The encoder SHOULD ignore codec mode requests when sending to a multicast session but MAY use RTCP feedback as a hint.

rtp, realtime, multicast

normative-requirement §4.3.2 MUST NOT

The extra comfort noise frame types GSM-EFR CN, IS-641 CN, and PDC-EFR CN (frame types beyond the general AMR SID) MUST NOT be used in this RTP payload format.

rtp, realtime

normative-requirement §4.1 SHALL

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; otherwise M SHALL be set to 0.

rtp, realtime

normative-requirement §5.1 MUST

The single-channel AMR storage file magic number MUST be the ASCII string "#!AMR\n" (0x2321414d520a). The single-channel AMR-WB magic number MUST be "#!AMR-WB\n" (0x2321414d522d57420a). The "\n" MUST be included in the comparison.

rtp, realtime

normative-requirement §4.4.2.1 MUST

When frame CRC is used, the CRC MUST be calculated only over all class A bits in the AMR or AMR-WB frame; class B and C bits MUST NOT be included. If the recalculated CRC mismatches the received value, the receiver SHALL consider class A bits damaged and MUST clear the Q flag (set to 0).

rtp, realtime

protocol-element §4.2

The AMR/AMR-WB RTP payload consists of three parts in order: a payload header (CMR field), a payload table of contents (list of per-frame ToC entries), and speech data. Payloads carrying more than one speech frame-block are called compound payloads.

rtp, realtime

protocol-element §4.4.3

The robust sorting order interleaves octets of all speech frames at the octet level in a compound payload: the first octet of each frame in turn, then the second octet of each frame, and so on. This concentrates the perceptually most sensitive bits (which appear first within each frame) near the beginning of the packet, enabling UEP/UED coverage with a partial checksum.

rtp, realtime

protocol-element §4.1

The RTP timestamp for AMR increments by 160 samples (8 kHz, 20 ms frame) per frame-block, and by 320 samples (16 kHz, 20 ms frame) per frame-block for AMR-WB. The timestamp corresponds to the first sample of the first frame-block in the packet.

rtp, realtime

registry §8.1

This document registers the 'audio/AMR' media type with IANA. Key parameters include: octet-align, crc, robust-sorting, interleaving, ptime, channels, mode-set, mode-change-period, mode-change-neighbor, mode-change-capability, maxptime, and ptime.

rtp, realtime, registry

registry §8.2

This document registers the 'audio/AMR-WB' media type with IANA. Parameters mirror those of audio/AMR except that mode-set values 0–8 reflect AMR-WB's nine coding modes (6.6–23.85 kbps).

rtp, realtime, registry

security-consideration §7.2

Authentication and integrity of AMR/AMR-WB RTP payloads SHOULD be provided by SRTP. Without authentication, an attacker can inject or modify packets, potentially degrading speech quality or causing denial of service. The CMR field is particularly sensitive as an attacker could force inefficient codec modes.

rtp, realtime, security

security-consideration §7.1

Confidentiality for AMR/AMR-WB RTP payloads SHOULD be achieved using the Secure Real-time Transport Protocol (SRTP). The payload format itself does not define encryption mechanisms.

rtp, realtime, security

wire-format §5.3

Each speech frame in the storage format begins with a 1-octet frame header: P (1 bit, padding/reserved), FT (4 bits, frame type), Q (1 bit, quality), and 2 padding bits. Speech bits follow, octet-aligned, with the last octet zero-padded.

rtp, realtime

wire-format §4.3.2

In bandwidth-efficient mode, each ToC entry is 6 bits: F (1 bit, more-frames flag), FT (4 bits, frame type index), Q (1 bit, frame quality indicator). Entries are packed contiguously without octet boundaries.

rtp, realtime

wire-format §4.3.1

In bandwidth-efficient mode, the payload header is a single 4-bit CMR (Codec Mode Request) field packed into the most significant bits of the first octet, shared with the first ToC entry bits. The entire payload is octet-aligned by appending 0–7 zero padding bits at the end.

rtp, realtime

wire-format §4.4.2

In octet-aligned mode, each ToC entry occupies exactly 1 octet: F (1 bit), FT (4 bits), Q (1 bit), and 2 padding bits (PP) that MUST be set to zero and ignored on reception.

rtp, realtime

wire-format §4.4.1

In octet-aligned mode, the payload header is 8 bits: CMR (4 bits) followed by 4 reserved R bits (MUST be zero). If interleaving is signaled, an additional 8-bit interleaving header follows: ILL (4 bits) and ILP (4 bits).

rtp, realtime

wire-format §4.4.2

The optional frame CRC in octet-aligned mode is 8 bits per speech frame, calculated only over the class A bits of that frame using cyclic generator polynomial C(x) = 1 + x^2 + x^3 + x^4 + x^8 (binary 101110001). One CRC octet is included for each ToC entry where FT is neither 14 nor 15.

rtp, realtime

wire-format §5.2

The storage format multi-channel header consists of a magic number ("#!AMR_MC1.0\n" for AMR or "#!AMR-WB_MC1.0\n" for AMR-WB) followed by a 32-bit channel description field whose 4 least-significant bits (CHAN) encode the number of audio channels; all other bits are reserved and MUST be zero.

rtp, realtime