⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rfc2658.txt

📁 <VC++网络游戏建摸与实现>源代码
💻 TXT
📖 第 1 页 / 共 2 页
字号:
Network Working Group                                           K. McKayRequest for Comments: 2658                         QUALCOMM IncorporatedCategory: Standards Track                                    August 1999               RTP Payload Format for PureVoice(tm) AudioStatus of this Memo   This document specifies an Internet standards track protocol for the   Internet community, and requests discussion and suggestions for   improvements.  Please refer to the current edition of the "Internet   Official Protocol Standards" (STD 1) for the standardization state   and status of this protocol.  Distribution of this memo is unlimited.Copyright Notice   Copyright (C) The Internet Society (1999).  All Rights Reserved.ABSTRACT   This document describes the RTP payload format for PureVoice(tm)   Audio.  The packet format supports variable interleaving to reduce   the effect of packet loss on audio quality.1 Introduction   This document describes how compressed PureVoice audio as produced by   the Qualcomm PureVoice CODEC [1] may be formatted for use as an RTP   payload type.  A method is provided to interleave the output of the   compressor to reduce quality degradation due to lost packets.   Furthermore, the sender may choose various interleave settings based   on the importance of low end-to-end delay versus greater tolerance   for lost packets.   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",   "SHOULD", "SHOULD NOT", "RECOMMENDED",  "MAY", and "OPTIONAL" in this   document are to be interpreted as described in RFC 2119 [3].2 Background   The Electronic Industries Association (EIA) & Telecommunications   Industry Association (TIA) standard IS-733 [1] defines an audio   compression algorithm for use in CDMA applications.  In addition to   being the standard CODEC for all wireless CDMA terminals, the   Qualcomm PureVoice CODEC (a.k.a. Qcelp) is used in several Internet   applications most notably JFax(tm), Apple(r) QuickTime(tm), and   Eudora(r).K. McKay                    Standards Track                     [Page 1]RFC 2658       RTP Payload Format for PureVoice(tm) Audio    August 1999   The Qcelp CODEC [1] compresses each 20 milliseconds of 8000 Hz, 16-   bit sampled input speech into one of four different size output   frames:  Rate 1 (266 bits), Rate 1/2 (124 bits), Rate 1/4 (54 bits)   or Rate 1/8 (20 bits).  The CODEC chooses the output frame rate based   on analysis of the input speech and the current operating mode   (either normal or reduced rate).  For typical speech patterns, this   results in an average output of 6.8 k bits/sec for normal mode and   4.7 k bits/sec for reduced rate mode.3 RTP/Qcelp Packet Format   The RTP timestamp is in 1/8000 of a second units.  The RTP payload   data for the Qcelp CODEC has the following format:    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   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+   |                      RTP Header [2]                           |   +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+   |RR | LLL | NNN |                                               |   +-+-+-+-+-+-+-+-+       one or more codec data frames           |   |                             ....                              |   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+   The RTP header has the expected values as described in [2].  The   extension bit is not set and this payload type never sets the marker   bit.  The codec data frames are aligned on octet boundaries.  When   interleaving is in use and/or multiple codec data frames are present   in a single RTP packet, the timestamp is, as always, that of the   oldest data represented in the RTP packet.  The other fields have the   following meaning:   Reserved (RR): 2 bits      MUST be set to zero by sender, SHOULD be ignored by receiver.   Interleave (LLL): 3 bits      MUST have a value between 0 and 5 inclusive.  The remaining two      values (6 and 7) MUST not be used by senders.  If this field is      non-zero, interleaving is enabled.  All receivers MUST support      interleaving.  Senders MAY support interleaving.  Senders that do      not support interleaving MUST set field LLL and NNN to zero.   Interleave Index (NNN): 3 bits      MUST have a value less than or equal to the value of LLL.  Values      of NNN greater than the value of LLL are invalid.K. McKay                    Standards Track                     [Page 2]RFC 2658       RTP Payload Format for PureVoice(tm) Audio    August 19993.1 Receiving Invalid Values   On receipt of an RTP packet with an invalid value of the LLL or NNN   field, the RTP packet MUST be treated as lost by the receiver for the   purpose of generating erasure frames as described in section 4.3.2 CODEC data frame format   The output of the Qcelp CODEC must be converted into CODEC data   frames for inclusion in the RTP payload as follows:   a. Octet 0 of the CODEC data frame indicates the rate and total size      of the CODEC data frame as indicated in this table:      OCTET 0   RATE      TOTAL CODEC data frame size (in octets)      -----------------------------------------------------------        0       Blank     1        1       1/8       4        2       1/4       8        3       1/2       17        4       1         35        5       reserved  8 (SHOULD be treated as a reserved value)       14       Erasure   1 (SHOULD NOT be transmitted by sender)       other    n/a       reserved      Receipt of a CODEC data frame with a reserved value in octet 0      MUST be considered invalid data as described in 3.1.   b. The bits as numbered in the standard [1] from highest to lowest      are packed into octets.  The highest numbered bit (265 for Rate 1,      123 for Rate 1/2, 53 for Rate 1/4 and 19 for Rate 1/8) is placed      in the most significant bit (Internet bit 0) of octet 1 of the      CODEC data frame.  The second highest numbered bit (264 for Rate      1, etc.) is placed in the second most significant bit (Internet      bit 1) of octet 1 of the data frame.  This continues so that bit      258 from the standard Rate 1 frame is placed in the least      significant bit of octet 1.  Bit 257 from the standard is placed      in the most significant bit of octet 2 and so on until bit 0 from      the standard Rate 1 frame is placed in Internet bit 1 of octet 34      of the CODEC data frame.  The remaining unused bits of the last      octet of the CODEC data frame MUST be set to zero.K. McKay                    Standards Track                     [Page 3]RFC 2658       RTP Payload Format for PureVoice(tm) Audio    August 1999      Here is a detail of how a Rate 1/8 frame is converted into a CODEC      data frame:                              CODEC data frame       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      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+      |               |1|1|1|1|1|1|1|1|1|1| | | | | | | | | | | | | | |      | 1 (Rate 1/8)  |9|8|7|6|5|4|3|2|1|0|9|8|7|6|5|4|3|2|1|0|Z|Z|Z|Z|      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+      Octet 0 of the data frame has value 1 (see table above) indicating      the total data frame length (including octet 0) is 4 octets.  Bits      19 through 0 from the standard Rate 1/8 frame are placed as      indicated with bits marked with "Z" being set to zero.  The Rate      1, 1/4 and 1/2 standard frames are converted similarly.3.3 Bundling CODEC data frames   As indicated in section 3, more than one CODEC data frame MAY be   included in a single RTP packet by a sender.  Receivers MUST handle   bundles of up to 10 CODEC data frames in a single RTP packet.   Furthermore, senders have the following additional restrictions:   o  MUST not bundle more CODEC data frames in a single RTP packet than      will fit in the MTU of the RTP transport protocol.  For the      purpose of computing the maximum bundling value, all CODEC data      frames should be assumed to have the Rate 1 size.   o  MUST never bundle more than 10 CODEC data frames in a single RTP      packet.   o  Once beginning transmission with a given SSRC and given bundling      value, MUST NOT increase the bundling value.  If the bundling      value needs to be increased, a new SSRC number MUST be used.   o  MAY decrease the bundling value only between interleave groups      (see section 3.4).  If the bundling value is decreased, it MUST      NOT be increased (even to the original value), although it may be      decreased again at a later time.K. McKay                    Standards Track                     [Page 4]RFC 2658       RTP Payload Format for PureVoice(tm) Audio    August 19993.3.1 Determining the number of bundled CODEC data frames   Since no count is transmitted as part of the RTP payload and the   CODEC data frames have differing lengths, the only way to determine   how many CODEC data frames are present in the RTP packet is to   examine octet 0 of each CODEC data frame in sequence until the end of   the RTP packet is reached.3.4 Interleaving CODEC data frames   Interleaving is meaningful only when more than one CODEC data frame   is bundled into a single RTP packet.   All receivers MUST support interleaving.  Senders MAY support   interleaving.   Given a time-ordered sequence of output frames from the Qcelp CODEC   numbered 0..n, a bundling value B, and an interleave value L where n   = B * (L+1) - 1, the output frames are placed into RTP packets as   follows (the values of the fields LLL and NNN are indicated for each   RTP packet):   First RTP Packet in Interleave group:      LLL=L, NNN=0      Frame 0, Frame L+1, Frame 2(L+1), Frame 3(L+1), ... for a total of      B frames   Second RTP Packet in Interleave group:      LLL=L, NNN=1      Frame 1, Frame 1+L+1, Frame 1+2(L+1), Frame 1+3(L+1), ... for a      total of B frames   This continues to the last RTP packet in the interleave group:   L+1 RTP Packet in Interleave group:      LLL=L, NNN=L      Frame L, Frame L+L+1, Frame L+2(L+1), Frame L+3(L+1), ... for a      total of B frames   Senders MUST transmit in timestamp-increasing order.  Furthermore,   within each interleave group, the RTP packets making up the   interleave group MUST be transmitted in value-increasing order of the   NNN field.  While this does not guarantee reduced end-to-end delay on   the receiving end, when packets are delivered in order by the   underlying transport, delay will be reduced to the minimum possible.K. McKay                    Standards Track                     [Page 5]

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -