RTP Payload Format for G.719
Extracted elements (28)
Interleaving is supported as an optional feature rather than mandatory because, while it improves packet-loss resilience for streaming, it increases end-to-end delay and buffering requirements that are unacceptable for conversational applications with tight delay bounds.
The L field in the ToC uses a non-linear encoding that provides 4 kbps granularity between 32–88 kbps and 8 kbps granularity between 88–128 kbps, allowing efficient representation of all G.719 codec rates in only 5 bits.
Each combination of 'interleaving' and 'channels' configuration parameters produces a unique bit pattern incompatible with other combinations; offerers desiring advanced features are RECOMMENDED to also offer a single-channel non-interleaved payload type to maximize interoperability.
All octets comprising an audio frame SHALL be appended to the payload as a unit, with multi-channel frame-blocks concatenated in the channel order specified in Section 4.1 of RFC 3551, oldest frame-block first within each ToC group.
An application implementing this payload format MUST understand all payload parameters specified in this specification, and any mapping to a signaling protocol MUST support all parameters.
An SDP answerer MUST include 'interleaving' and 'channels' parameters unmodified from the SDP offer (unless removing the payload type); however, the value of 'interleaving' MAY be changed.
Basic mode SHALL be implemented and the interleaved mode SHOULD be implemented; interleaving is not mandated as it has limited applicability for conversational applications requiring tight delay bounds.
Each ToC entry MUST be padded to a byte boundary to ensure octet alignment. The rules regarding maximum payload size given in Section 3.2 of RFC 5405 SHOULD be followed.
If an SDP offer includes the CBR parameter, the answerer MUST send G.719 audio at the constant bitrate if it is within the allowed session bitrate; if the answerer cannot support the stated CBR, this payload type must be refused.
If the receiver finds a mismatch between the size of a received payload and the size indicated by the ToC, the receiver SHOULD discard the packet, as decoding from erroneous ToC data could severely degrade audio quality.
Implementations SHOULD NOT use the CBR parameter unless interacting with a device that cannot support variable bitrate (e.g., an H.320 gateway). When using CBR mode, a receiver MUST monitor packet loss rate to ensure congestion is not caused.
In SDP, the RTP clock rate in 'a=rtpmap' MUST be 48000, and the 'channels' encoding parameter MUST either be explicitly set to N or omitted (defaulting to 1).
In the interleaved mode ToC, DIS1 (the first displacement field) SHALL be set to zero by a sender and SHALL be ignored by a receiver, since the first frame-block's position is uniquely defined by the RTP timestamp.
Reception of redundant audio frames (more than one audio frame from the same source for the same time slot) MUST be supported. If multiple frames at different bitrates are received for the same slot, it is RECOMMENDED to keep the one with the highest bitrate.
Reserved L values [1..7] and [28..31] in the ToC are reserved for future use; if these values occur in a ToC, the entire packet SHOULD be treated as invalid and discarded.
The RTP header marker bit (M) SHALL be set to 1 whenever the first frame-block carried in the packet is the first frame-block in a talkspurt; for all other packets, the marker bit SHALL be set to zero.
When adding redundancy, a sender SHALL NOT increase the total bitrate; instead it must reduce the media bitrate to provide room for redundancy, following the congestion control algorithm in use.
The 'CBR' parameter specifies the exact constant codec bitrate in bits per second that the codec MUST use, intended for gateway scenarios (e.g., H.320) where variable bitrate cannot be supported.
The 'int-delay' parameter specifies the minimal media time delay in milliseconds needed to avoid underrun in the de-interleaving buffer before decoding starts; it is a per-SSRC stream property expressed as a comma-separated list of SSRC:delay pairs with allowed values 0–65535.
The 'interleaving' media type parameter indicates that interleaved mode SHALL be used and specifies the number of frame-block slots in the de-interleaving buffer (including the frame ready to be consumed); its value MUST be greater than zero. If absent, interleaved mode SHALL NOT be used.
The 'max-red' parameter declares the maximum duration in milliseconds between the primary transmission of a frame and any redundant retransmission; allowed values are 0–65535. If omitted, no limitation on redundancy is present.
The RTP timestamp clock frequency for G.719 SHALL be 48000 Hz. The timestamp corresponds to the sampling instant of the first sample encoded for the first frame-block in the packet.
One new media type, audio/G719, has been registered in the IANA media types registry as specified in Section 7.1, allocated from the IETF tree.
Confidentiality, integrity, and source authenticity are the main security concerns for this payload format. Usage of SRTP (RFC 3711) is recommended where suitable; IPsec and TLS are also identified as applicable alternatives.
Using interleaving with encryption can negatively impact confidentiality: when a key change is used to revoke access, frames already distributed in prior packets under the previous key may still allow reconstruction of audio beyond the intended cutoff point.
In basic mode, the basic ToC element is followed by a 1-octet #frames field indicating how many frame-blocks of the same length the ToC entry covers.
In interleaved mode, the basic ToC is followed by a 1-octet #frames field and then DIS fields (4 bits each) expressing the displacement between consecutive frame-blocks in the payload, with 4-bit padding appended if the number of frame-blocks is odd.
The basic ToC element is 1 octet: F (1 bit) indicates whether another ToC entry follows, L (5 bits) encodes the frame length using a non-linear mapping to byte counts (L=0 means NO_DATA, L=8..22 maps to 80+10*(L-8) bytes, L=23..27 maps to 240+20*(L-23) bytes), and R (2 bits) reserved.