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

📄 rfc3551.txt

📁 完整的RTP RTSP代码库
💻 TXT
📖 第 1 页 / 共 5 页
字号:
   |0 0 0 0|1 1 0 0|1 1 0 0 0 0 0 0|0 0 0 0 0 0 0 0|0 0 0 0|1 1 0 0|   |3 2 1 0|1 0 9 8|1 0 9 8 7 6 5 4|7 6 5 4 3 2 1 0|3 2 1 0|1 0 9 8|   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+   |   MSBPOS    |Z|POS|  MSBPOS   |     POS0      |POS|   POS0    |   |             | | 0 |           |               | 1 |           |   |0 0 0 0 0 0 0|0|0 0|1 1 1 0 0 0|0 0 0 0 0 0 0 0|0 0|1 1 1 1 1 1|   |6 5 4 3 2 1 0| |1 0|2 1 0 9 8 7|9 8 7 6 5 4 3 2|1 0|5 4 3 2 1 0|   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+   |     POS1      | POS2  | POS1  |     POS2      | POS3  | POS2  |   |               |       |       |               |       |       |   |0 0 0 0 0 0 0 0|0 0 0 0|1 1 1 1|1 1 0 0 0 0 0 0|0 0 0 0|1 1 1 1|   |9 8 7 6 5 4 3 2|3 2 1 0|3 2 1 0|1 0 9 8 7 6 5 4|3 2 1 0|5 4 3 2|   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+   |     POS3      |   PSIG0   |POS|PSIG2|  PSIG1  |  PSIG3  |PSIG2|   |               |           | 3 |     |         |         |     |   |1 1 0 0 0 0 0 0|0 0 0 0 0 0|1 1|0 0 0|0 0 0 0 0|0 0 0 0 0|0 0 0|   |1 0 9 8 7 6 5 4|5 4 3 2 1 0|3 2|2 1 0|4 3 2 1 0|4 3 2 1 0|5 4 3|   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                  Figure 1: G.723 (6.3 kb/s) bit packing   For the 5.3 kb/s data rate, the header (HDR) bits are always "0 1",   as shown in Fig. 2, to indicate operation at 5.3 kb/s.Schulzrinne & Casner        Standards Track                    [Page 16]RFC 3551                    RTP A/V Profile                    July 2003    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   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+   |    LPC    |HDR|      LPC      |      LPC      |   ACL0    |LPC|   |           |   |               |               |           |   |   |0 0 0 0 0 0|0 1|1 1 1 1 0 0 0 0|2 2 1 1 1 1 1 1|0 0 0 0 0 0|2 2|   |5 4 3 2 1 0|   |3 2 1 0 9 8 7 6|1 0 9 8 7 6 5 4|5 4 3 2 1 0|3 2|   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+   |  ACL2   |ACL|A| GAIN0 |ACL|ACL|     GAIN0     |     GAIN1     |   |         | 1 |C|       | 3 | 2 |               |               |   |0 0 0 0 0|0 0|0|0 0 0 0|0 0|0 0|1 1 0 0 0 0 0 0|0 0 0 0 0 0 0 0|   |4 3 2 1 0|1 0|6|3 2 1 0|1 0|6 5|1 0 9 8 7 6 5 4|7 6 5 4 3 2 1 0|   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+   | GAIN2 | GAIN1 |     GAIN2     |    GAIN3      | GRID  | GAIN3 |   |       |       |               |               |       |       |   |0 0 0 0|1 1 0 0|1 1 0 0 0 0 0 0|0 0 0 0 0 0 0 0|0 0 0 0|1 1 0 0|   |3 2 1 0|1 0 9 8|1 0 9 8 7 6 5 4|7 6 5 4 3 2 1 0|4 3 2 1|1 0 9 8|   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+   |     POS0      | POS1  | POS0  |     POS1      |     POS2      |   |               |       |       |               |               |   |0 0 0 0 0 0 0 0|0 0 0 0|1 1 0 0|1 1 0 0 0 0 0 0|0 0 0 0 0 0 0 0|   |7 6 5 4 3 2 1 0|3 2 1 0|1 0 9 8|1 0 9 8 7 6 5 4|7 6 5 4 3 2 1 0|   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+   | POS3  | POS2  |     POS3      | PSIG1 | PSIG0 | PSIG3 | PSIG2 |   |       |       |               |       |       |       |       |   |0 0 0 0|1 1 0 0|1 1 0 0 0 0 0 0|0 0 0 0|0 0 0 0|0 0 0 0|0 0 0 0|   |3 2 1 0|1 0 9 8|1 0 9 8 7 6 5 4|3 2 1 0|3 2 1 0|3 2 1 0|3 2 1 0|   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                  Figure 2: G.723 (5.3 kb/s) bit packing   The packing of G.723.1 SID (silence) frames, which are indicated by   the header (HDR) bits having the pattern "1 0", is depicted in Fig.   3.    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   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+   |    LPC    |HDR|      LPC      |      LPC      |   GAIN    |LPC|   |           |   |               |               |           |   |   |0 0 0 0 0 0|1 0|1 1 1 1 0 0 0 0|2 2 1 1 1 1 1 1|0 0 0 0 0 0|2 2|   |5 4 3 2 1 0|   |3 2 1 0 9 8 7 6|1 0 9 8 7 6 5 4|5 4 3 2 1 0|3 2|   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                   Figure 3: G.723 SID mode bit packingSchulzrinne & Casner        Standards Track                    [Page 17]RFC 3551                    RTP A/V Profile                    July 20034.5.4  G726-40, G726-32, G726-24, and G726-16   ITU-T Recommendation G.726 describes, among others, the algorithm   recommended for conversion of a single 64 kbit/s A-law or mu-law PCM   channel encoded at 8,000 samples/sec to and from a 40, 32, 24, or 16   kbit/s channel.  The conversion is applied to the PCM stream using an   Adaptive Differential Pulse Code Modulation (ADPCM) transcoding   technique.  The ADPCM representation consists of a series of   codewords with a one-to-one correspondence to the samples in the PCM   stream.  The G726 data rates of 40, 32, 24, and 16 kbit/s have   codewords of 5, 4, 3, and 2 bits, respectively.   The 16 and 24 kbit/s encodings do not provide toll quality speech.   They are designed for used in overloaded Digital Circuit   Multiplication Equipment (DCME).  ITU-T G.726 recommends that the 16   and 24 kbit/s encodings should be alternated with higher data rate   encodings to provide an average sample size of between 3.5 and 3.7   bits per sample.   The encodings of G.726 are here denoted as G726-40, G726-32, G726-24,   and G726-16.  Prior to 1990, G721 described the 32 kbit/s ADPCM   encoding, and G723 described the 40, 32, and 16 kbit/s encodings.   Thus, G726-32 designates the same algorithm as G721 in RFC 1890.   A stream of G726 codewords contains no information on the encoding   being used, therefore transitions between G726 encoding types are not   permitted within a sequence of packed codewords.  Applications MUST   determine the encoding type of packed codewords from the RTP payload   identifier.   No payload-specific header information SHALL be included as part of   the audio data.  A stream of G726 codewords MUST be packed into   octets as follows:  the first codeword is placed into the first octet   such that the least significant bit of the codeword aligns with the   least significant bit in the octet, the second codeword is then   packed so that its least significant bit coincides with the least   significant unoccupied bit in the octet.  When a complete codeword   cannot be placed into an octet, the bits overlapping the octet   boundary are placed into the least significant bits of the next   octet.  Packing MUST end with a completely packed final octet.  The   number of codewords packed will therefore be a multiple of 8, 2, 8,   and 4 for G726-40, G726-32, G726-24, and G726-16, respectively.  An   example of the packing scheme for G726-32 codewords is as shown,   where bit 7 is the least significant bit of the first octet, and bit   A3 is the least significant bit of the first codeword:Schulzrinne & Casner        Standards Track                    [Page 18]RFC 3551                    RTP A/V Profile                    July 2003          0                   1          0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-         |B B B B|A A A A|D D D D|C C C C| ...         |0 1 2 3|0 1 2 3|0 1 2 3|0 1 2 3|         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-   An example of the packing scheme for G726-24 codewords follows, where   again bit 7 is the least significant bit of the first octet, and bit   A2 is the least significant bit of the first codeword:          0                   1                   2          0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-         |C C|B B B|A A A|F|E E E|D D D|C|H H H|G G G|F F| ...         |1 2|0 1 2|0 1 2|2|0 1 2|0 1 2|0|0 1 2|0 1 2|0 1|         +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-   Note that the "little-endian" direction in which samples are packed   into octets in the G726-16, -24, -32 and -40 payload formats   specified here is consistent with ITU-T Recommendation X.420, but is   the opposite of what is specified in ITU-T Recommendation I.366.2   Annex E for ATM AAL2 transport.  A second set of RTP payload formats   matching the packetization of I.366.2 Annex E and identified by MIME   subtypes AAL2-G726-16, -24, -32 and -40 will be specified in a   separate document.4.5.5 G728   G728 is specified in ITU-T Recommendation G.728, "Coding of speech at   16 kbit/s using low-delay code excited linear prediction".   A G.278 encoder translates 5 consecutive audio samples into a 10-bit   codebook index, resulting in a bit rate of 16 kb/s for audio sampled   at 8,000 samples per second.  The group of five consecutive samples   is called a vector.  Four consecutive vectors, labeled V1 to V4   (where V1 is to be played first by the receiver), build one G.728   frame.  The four vectors of 40 bits are packed into 5 octets, labeled   B1 through B5.  B1 SHALL be placed first in the RTP packet.   Referring to the figure below, the principle for bit order is   "maintenance of bit significance".  Bits from an older vector are   more significant than bits from newer vectors.  The MSB of the frame   goes to the MSB of B1 and the LSB of the frame goes to LSB of B5.Schulzrinne & Casner        Standards Track                    [Page 19]RFC 3551                    RTP A/V Profile                    July 2003                   1         2         3        3         0         0         0         0        9         ++++++++++++++++++++++++++++++++++++++++         <---V1---><---V2---><---V3---><---V4---> vectors         <--B1--><--B2--><--B3--><--B4--><--B5--> octets         <------------- frame 1 ---------------->   In particular, B1 contains the eight most significant bits of V1,   with the MSB of V1 being the MSB of B1.  B2 contains the two least   significant bits of V1, the more significant of the two in its MSB,   and the six most significant bits of V2.  B1 SHALL be placed first in   the RTP packet and B5 last.4.5.6 G729   G729 is specified in ITU-T Recommendation G.729, "Coding of speech at   8 kbit/s using conjugate structure-algebraic code excited linear   prediction (CS-ACELP)".  A reduced-complexity version of the G.729   algorithm is specified in Annex A to Rec. G.729.  The speech coding   algorithms in the main body of G.729 and in G.729 Annex A are fully   interoperable with each other, so there is no need to further   distinguish between them.  An implementation that signals or accepts   use of G729 payload format may implement either G.729 or G.729A   unless restricted by additional signaling specified elsewhere related   specifically to the encoding rather than the payload format.  The   G.729 and G.729 Annex A codecs were optimized to represent speech   with high quality, where G.729 Annex A trades some speech quality for   an approximate 50% complexity reduction [10].  See the next Section   (4.5.7) for other data rates added in later G.729 Annexes.  For all   data rates, the sampling frequency (and RTP timestamp clock rate) is   8,000 Hz.   A voice activity detector (VAD) and comfort noise generator (CNG)   algorithm in Annex B of G.729 is RECOMMENDED for digital simultaneous   voice and data applications and can be used in conjunction with G.729   or G.729 Annex A.  A G.729 or G.729 Annex A frame contains 10 octets,   while the G.729 Annex B comfort noise frame occupies 2 octets.   Receivers MUST accept comfort noise frames if restriction of their   use has not been signaled.  The MIME registration for G729 in RFC   3555 [7] specifies a parameter that MAY be used with MIME or SDP to   restrict the use of comfort noise frames.   A G729 RTP packet may consist of zero or more G.729 or G.729 Annex A   frames, followed by zero or one G.729 Annex B frames.  The presence   of a comfort noise frame can be deduced from the length of the RTP   payload.  The default packetization interval is 20 ms (two frames),   but in some situations it may be desirable to send 10 ms packets.  AnSchulzrinne & Casner        Standards Track                    [Page 20]RFC 3551                    RTP A/V Profile                    July 2003   example would be a transition from speech to comfort noise in the   first 10 ms of the packet.  For some applications, a longer   packetization interval may be required to reduce the packet rate.       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      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+      |L|      L1     |    L2   |    L3   |       P1      |P|    C1   |      |0|             |         |         |               |0|         |      | |0 1 2 3 4 5 6|0 1 2 3 4|0 1 2 3 4|0 1 2 3 4 5 6 7| |0 1 2 3 4|      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+      |       C1      |  S1   | GA1 |  GB1  |    P2   |      C2       |      |          1 1 1|       |     |       |         |               |      |5 6 7 8 9 0 1 2|0 1 2 3|0 1 2|0 1 2 3|0 1 2 3 4|0 1 2 3 4 5 6 7|      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+      |   C2    |  S2   | GA2 |  GB2  |      |    1 1 1|       |     |       |      |8 9 0 1 2|0 1 2 3|0 1 2|0 1 2 3|      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                    Figure 4: G.729 and G.729A bit packing

⌨️ 快捷键说明

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