📄 rfc3267.txt
字号:
this case at the other end of the IP path. Feedback about
congestion SHOULD be provided to that IP sender through RTCP or
other means, and then the sender can choose to avoid congestion
using the most appropriate mechanism. That may include
adjusting the codec mode, but also includes adjusting the level
of redundancy or number of frames per packet.
The encoder SHOULD follow a received mode request, but MAY change to
a lower-numbered mode if it so chooses, for example to control
congestion.
The CMR field MUST be set to 15 for packets sent to a multicast
group. The encoder in the speech sender SHOULD ignore mode requests
when sending speech to a multicast session but MAY use RTCP feedback
information as a hint that a mode change is needed.
The codec mode selection MAY be restricted by a session parameter to
a subset of the available modes. If so, the requested mode MUST be
among the signalled subset (see Section 8).
4.3.2. The Payload Table of Contents
The table of contents (ToC) consists of a list of ToC entries, each
representing a speech frame.
Sjoberg, et. al. Standards Track [Page 17]
RFC 3267 RTP Payload Format for AMR and AMR-WB June 2002
In bandwidth-efficient mode, a ToC entry takes the following format:
0 1 2 3 4 5
+-+-+-+-+-+-+
|F| FT |Q|
+-+-+-+-+-+-+
F (1 bit): If set to 1, indicates that this frame is followed by
another speech frame in this payload; if set to 0, indicates that
this frame is the last frame in this payload.
FT (4 bits): Frame type index, indicating either the AMR or AMR-WB
speech coding mode or comfort noise (SID) mode of the
corresponding frame carried in this payload.
The value of FT is defined in Table 1a in [2] for AMR and in Table 1a
in [4] for AMR-WB. FT=14 (SPEECH_LOST, only available for AMR-WB)
and FT=15 (NO_DATA) are used to indicate frames that are either lost
or not being transmitted in this payload, respectively.
NO_DATA (FT=15) frame could mean either that there is no data
produced by the speech encoder for that frame or that no data for
that frame is transmitted in the current payload (i.e., valid data
for that frame could be sent in either an earlier or later packet).
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. This is to
avoid the loss of data synchronization in the depacketization
process, which can result in a huge degradation in speech quality.
Note that packets containing only NO_DATA frames SHOULD NOT be
transmitted. Also, frame-blocks containing only NO_DATA frames at
the end of a packet SHOULD NOT be transmitted, except in the case of
interleaving. The AMR SCR/DTX is described in [6] and AMR-WB SCR/DTX
in [7].
The extra comfort noise frame types specified in table 1a in [2]
(i.e., GSM-EFR CN, IS-641 CN, and PDC-EFR CN) MUST NOT be used in
this payload format because the standardized AMR codec is only
required to implement the general AMR SID frame type and not those
that are native to the incorporated encodings.
Q (1 bit): Frame quality indicator. If set to 0, indicates the
corresponding frame is severely damaged and the receiver should
set the RX_TYPE (see [6]) to either SPEECH_BAD or SID_BAD
depending on the frame type (FT).
Sjoberg, et. al. Standards Track [Page 18]
RFC 3267 RTP Payload Format for AMR and AMR-WB June 2002
The frame quality indicator is included for interoperability with the
ATM payload format described in ITU-T I.366.2, the UMTS Iu interface
[16], as well as other transport formats. The frame quality
indicator enables damaged frames to be forwarded to the speech
decoder for error concealment. This can improve the speech quality
comparing to dropping the damaged frames. See Section 4.4.2.1 for
more details.
For multi-channel sessions, the ToC entries of all frames from a
frame-block are placed in the ToC in consecutive order as defined in
Section 4.1 in [24]. When multiple frame-blocks are present in a
packet in bandwidth-efficient mode, they will be placed in the packet
in order of their creation time.
Therefore, with N channels and K speech frame-blocks in a packet,
there MUST be N*K entries in the ToC, and the first N entries will be
from the first frame-block, the second N entries will be from the
second frame-block, and so on.
The following figure shows an example of a ToC of three entries in a
single channel session using bandwidth efficient mode.
0 1
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|1| FT |Q|1| FT |Q|0| FT |Q|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Below is an example of how the ToC entries will appear in the ToC of
a packet carrying 3 consecutive frame-blocks in a session with two
channels (L and R).
+----+----+----+----+----+----+
| 1L | 1R | 2L | 2R | 3L | 3R |
+----+----+----+----+----+----+
|<------->|<------->|<------->|
Frame- Frame- Frame-
Block 1 Block 2 Block 3
4.3.3. Speech Data
Speech data of a payload contains one or more speech frames or
comfort noise frames, as described in the ToC of the payload.
Note, for ToC entries with FT=14 or 15, there will be no
corresponding speech frame present in the speech data.
Sjoberg, et. al. Standards Track [Page 19]
RFC 3267 RTP Payload Format for AMR and AMR-WB June 2002
Each speech frame represents 20 ms of speech encoded with the mode
indicated in the FT field of the corresponding ToC entry. The length
of the speech frame is implicitly defined by the mode indicated in
the FT field. The order and numbering notation of the bits are as
specified for Interface Format 1 (IF1) in [2] for AMR and [4] for
AMR-WB. As specified there, the bits of speech frames have been
rearranged in order of decreasing sensitivity, while the bits of
comfort noise frames are in the order produced by the encoder. The
resulting bit sequence for a frame of length K bits is denoted d(0),
d(1), ..., d(K-1).
4.3.4. Algorithm for Forming the Payload
The complete RTP payload in bandwidth-efficient mode is formed by
packing bits from the payload header, table of contents, and speech
frames, in order as defined by their corresponding ToC entries in the
ToC list, contiguously into octets beginning with the most
significant bits of the fields and the octets.
To be precise, the four-bit payload header is packed into the first
octet of the payload with bit 0 of the payload header in the most
significant bit of the octet. The four most significant bits
(numbered 0-3) of the first ToC entry are packed into the least
significant bits of the octet, ending with bit 3 in the least
significant bit. Packing continues in the second octet with bit 4 of
the first ToC entry in the most significant bit of the octet. If
more than one frame is contained in the payload, then packing
continues with the second and successive ToC entries. Bit 0 of the
first data frame follows immediately after the last ToC bit,
proceeding through all the bits of the frame in numerical order.
Bits from any successive frames follow contiguously in numerical
order for each frame and in consecutive order of the frames.
If speech data is missing for one or more speech frame within the
sequence, because of, for example, DTX, a ToC entry with FT set to
NO_DATA SHALL be included in the ToC for each of the missing frames,
but no data bits are included in the payload for the missing frame
(see Section 4.3.5.2 for an example).
Sjoberg, et. al. Standards Track [Page 20]
RFC 3267 RTP Payload Format for AMR and AMR-WB June 2002
4.3.5 Payload Examples
4.3.5.1. Single Channel Payload Carrying a Single Frame
The following diagram shows a bandwidth-efficient AMR payload from a
single channel session carrying a single speech frame-block.
In the payload, no specific mode is requested (CMR=15), the speech
frame is not damaged at the IP origin (Q=1), and the coding mode is
AMR 7.4 kbps (FT=4). The encoded speech bits, d(0) to d(147), are
arranged in descending sensitivity order according to [2]. Finally,
two zero bits are added to the end as padding to make the payload
octet aligned.
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| CMR=15|0| FT=4 |1|d(0) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| d(147)|P|P|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Sjoberg, et. al. Standards Track [Page 21]
RFC 3267 RTP Payload Format for AMR and AMR-WB June 2002
4.3.5.2. Single Channel Payload Carrying Multiple Frames
The following diagram shows a single channel, bandwidth efficient
compound AMR-WB payload that contains four frames, of which one has
no speech data. The first frame is a speech frame at 6.6 kbps mode
(FT=0) that is composed of speech bits d(0) to d(131). The second
frame is an AMR-WB SID frame (FT=9), consisting of bits g(0) to
g(39). The third frame is NO_DATA frame and does not carry any
speech information, it is represented in the payload by its ToC
entry. The fourth frame in the payload is a speech frame at 8.85
kpbs mode (FT=1), it consists of speech bits h(0) to h(176).
As shown below, the payload carries a mode request for the encoder on
the receiver's side to change its future coding mode to AMR-WB 8.85
kbps (CMR=1). None of the frames is damaged at IP origin (Q=1). The
encoded speech and SID bits, d(0) to d(131), g(0) to g(39) and h(0)
to h(176), are arranged in the payload in descending sensitivity
order according to [4]. (Note, no speech bits are present for the
third frame). Finally, seven 0s are padded to the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