# K  Computation of b=AS for AMR and AMR-WB |R10|p. 377

## K.1  Generalp. 377

This Annex contains examples of computing b=AS for AMR and AMR-WB when ptime=20 and when ptime=40. In these examples, it is assumed that no extra bandwidth is allocated for redundancy.

## K.2  Procedure for computing the bandwidthp. 377

The bandwidth is calculated using the following procedure when no extra bandwidth is allocated for redundancy:
1. Calculate the size of the RTP payload, see below.
2. Calculate the size of the IP packets by taking the RTP payload size (in bytes) and adding the IP/UDP/RTP overhead: 20 bytes for IPv4; 40 bytes for IPv6; 8 bytes for UDP; 12 bytes for RTP.
3. Convert the IP packet size to bits.
4. Calculate the required bit rate (bps) given the packet size and the packet rate: 50 packets per second for 1 frame per packet; 25 packets per second for 2 frames per packet.
5. The b=AS bandwidth is then calculated by converting the required bit rate to kbps and rounding to the nearest higher integer value.
When redundancy is used then the RTP payload contains several frames, both non-redundant and redundant. For example, for 100% redundancy each RTP payload contains one non-redundant frame and one redundant frame, giving 2 frames per packet. The packet rate is however still 50 frames per packet.
If the SDP includes multiple codecs and/or configurations then the bandwidth is calculated for each configuration and the b=AS bandwidth is set to the highest of the bandwidths.

## K.3  Computation of RTP payload sizep. 377

When the b=AS bandwidth is computed it is assumed that the codec is using the highest allowed coded mode for each frame.
The RTP payload size for the bandwidth-efficient payload format mode and 1 frame/packet is calculated from the following components:
• N bits for the speech frame (size depends on codec mode)
• Padding bits at the end of the RTP payload to give an integer number of octets
The RTP payload size for the octet-aligned payload format mode and 1 frame/packet is calculated from the following components:
• N bits for the speech frame (size depends on codec mode) + padding bits to give an integer number of octets
• No padding in the end of the RTP payload is needed since each item is already an integer number of octets
The RTP payload size for the bandwidth-efficient payload format mode and 2 frames per packet is calculated from the following components:
• N1 bits for the speech frame 1 (size depends on codec mode)
• N2 bits for the speech frame 2 (size depends on codec mode)
• Padding bits at the end of the RTP payload to give an integer number of octets
The RTP payload size for the octet-aligned payload format mode and 2 frames per packet is calculated from the following components:
• N1 bits for the speech frame 1 (size depends on codec mode) + padding bits to give an integer number of octets
• N2 bits for the speech frame 2 (size depends on codec mode) + padding bits to give an integer number of octets
• No padding in the end of the RTP payload is needed since each item is already an integer number of octets

## K.4  Detailed computationp. 378

The tables below give a detailed description of the bandwidth computation. The b=AS bandwidth is not defined for SID. Since a SID is rarely encapsulated with a speech frame or another SID, Tables K.9-16 do not include the computation procedure for the comfort noise frame.
Mode 4.75 5.15 5.9 6.7 7.4 7.95 10.2 12.2 SID
Bits per speech frame9510311813414815920424439
Total bits per 20 ms432440448464480496536576376
Total bit-rate (kbps)21.62222.423.22424.826.828.818.8
AS2222232424252729N/A
Mode 4.75 5.15 5.9 6.7 7.4 7.95 10.2 12.2 SID
Bits per speech frame9510311813414815920424439
Total bits per 20 ms592600608624640656696736536
Total bit-rate (kbps)29.63030.431.23232.834.836.826.8
AS3030313232333537N/A
Mode 4.75 5.15 5.9 6.7 7.4 7.95 10.2 12.2 SID
Bits per speech frame9510311813414815920424439
Speech frame size (bytes)11.8812.8814.7516.7518.519.8825.530.54.88
Rounded-up speech frame size (bytes)12131517192026315
Rounded-up speech frame size (bits)9610412013615216020824840
Total bits per 20 ms432440456472488496544584376
Total bit-rate (kbps)21.62222.823.624.424.827.229.218.8
AS2222232425252830N/A
Mode 4.75 5.15 5.9 6.7 7.4 7.95 10.2 12.2 SID
Bits per speech frame9510311813414815920424439
Speech frame size (bytes)11.8812.8814.7516.7518.519.8825.530.54.88
Rounded-up speech frame size (bytes)12131517192026315
Rounded-up speech frame size (bits)9610412013615216020824840
Total bits per 20 ms592600616632648656704744536
Total bit-rate (kbps)29.63030.831.632.432.835.237.226.8
AS3030313233333638N/A
Mode 6.6 8.85 12.65 14.25 15.85 18.25 19.85 23.05 23.85 SID
Bits per speech frame13217725328531736539746147740
Total bits per 20 ms464512584616648696728792808376
Total bit-rate (kbps)23.225.629.230.832.434.836.439.640.418.8
AS242630313335374041N/A
Mode 6.6 8.85 12.65 14.25 15.85 18.25 19.85 23.05 23.85 SID
Bits per speech frame13217725328531736539746147740
Total bits per 20 ms624672744776808856888952968536
Total bit-rate (kbps)31.233.637.238.840.442.844.447.648.426.8
AS323438394143454849N/A
Mode 6.6 8.85 12.65 14.25 15.85 18.25 19.85 23.05 23.85 SID
Bits per speech frame13217725328531736539746147740
Speech frame size (bytes)16.522.1331.6335.6339.6345.6349.6357.6359.6255
Rounded-up speech frame size (bytes)1723323640465058605
Rounded-up speech frame size (bits)13618425628832036840046448040
Total bits per 20 ms472520592624656704736800816376
Total bit-rate (kbps)23.62629.631.232.835.236.84040.818.8
AS242630323336374041N/A
Mode 6.6 8.85 12.65 14.25 15.85 18.25 19.85 23.05 23.85 SID
Bits per speech frame13217725328531736539746147740
Speech frame size (bytes)16.522.1331.6335.6339.6345.6349.6357.6359.6255
Rounded-up speech frame size (bytes)1723323640465058605
Rounded-up speech frame size (bits)13618425628832036840046448040
Total bits per 20 ms632680752784816864896960976536
Total bit-rate (kbps)31.63437.639.240.843.244.84848.826.8
AS323438404144454849N/A
Mode 4.75 5.15 5.9 6.7 7.4 7.95 10.2 12.2
Bits per speech frame95103118134148159204244
Total bits per 40 ms528544576608632656744824
Total bit-rate (kbps)13.213.614.415.215.816.418.620.6
AS1414151616171921
Mode 4.75 5.15 5.9 6.7 7.4 7.95 10.2 12.2
Bits per speech frame95103118134148159204244
Total bits per 40 ms688704736768792816904984
Total bit-rate (kbps)17.217.618.419.219.820.422.624.6
AS1818192020212325
Mode 4.75 5.15 5.9 6.7 7.4 7.95 10.2 12.2
Bits per speech frame95103118134148159204244
Speech frame size (bytes)2426303438405262
Rounded-up speech frame size (bytes)2426303438405262
Rounded-up speech frame size (bits)192208240272304320416496
Total bits per 40 ms536552584616648664760840
Total bit-rate (kbps)13.413.814.615.416.216.61921
AS1414151617171921
Mode 4.75 5.15 5.9 6.7 7.4 7.95 10.2 12.2
Bits per speech frame95103118134148159204244
Speech frame size (bytes)2426303438405262
Rounded-up speech frame size (bytes)2426303438405262
Rounded-up speech frame size (bits)192208240272304320416496
Total bits per 40 ms6967127447768088249201000
Total bit-rate (kbps)17.417.818.619.420.220.62325
AS1818192021212325
Mode 6.6 8.85 12.65 14.25 15.85 18.25 19.85 23.05 23.85
Bits per speech frame132177253285317365397461477
Total bits per 40 ms6006968489129761072113612641296
Total bit-rate (kbps)1517.421.222.824.426.828.431.632.4
AS151822232527293233
Mode 6.6 8.85 12.65 14.25 15.85 18.25 19.85 23.05 23.85
Bits per speech frame132177253285317365397461477
Total bits per 40 ms7608561008107211361232129614241456
Total bit-rate (kbps)1921.425.226.828.430.832.435.636.4
AS192226272931333637
Mode 6.6 8.85 12.65 14.25 15.85 18.25 19.85 23.05 23.85
Bits per speech frame132177253285317365397461477
Speech frame size (bytes)344664728092100116120
Rounded-up speech frame size (bytes)344664728092100116120
Rounded-up speech frame size (bits)272368512576640736800928960
Total bits per 40 ms6167128569209841080114412721304
Total bit-rate (kbps)15.417.821.42324.62728.631.832.6
AS161822232527293233
Mode 6.6 8.85 12.65 14.25 15.85 18.25 19.85 23.05 23.85
Bits per speech frame132177253285317365397461477
Speech frame size (bytes)344664728092100116120
Rounded-up speech frame size (bytes)344664728092100116120
Rounded-up speech frame size (bits)272368512576640736800928960