Subject: [AVT] carrying G729 in RTP

From: "Murat Artun" <[email-masked]>
Date: Fri, 25 May 2007 12:59:55 +0300

Hello,

I want to clarify a few points about carrying G729 in RTP.

In RFC 3551 on pg 20, it was specified that "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."

Considering this specification, how could be the packetization
procedure for G729 coded frames of 40 ms packetization period (or any
other period more than 10 ms could be considered) with annex B frames
like below?

First frame          annexA
Second frame    annexA
Third frame         annexB
Fourth frame       annexA

As I understand from RFC 3551, the first frame should be sent as a
separate RTP packet and second and third frames should be packed into
another RTP packet and fourth frame should be sent as a separate RTP
packet. True?

In addition, how would be a valid RTP packing scheme for the below case?

First frame          annexB
Second frame    annexA
Third frame         annexB
Fourth frame       annexA

In this case, it turns out that we should always be prepared for
annexB frames from any G729 encoder possibly by buffering some period
of 10 ms frames. However, I do not think switching the order of annexA
and annexB frames will not be valid (Second frame + fourth frame +
first frame + third frame)

Thanks and regards...

-- 
M u r at  A r t u n, MSc.
   Software Engineer

_______________________________________________
Audio/Video Transport Working Group
[email-masked]
https://www1.ietf.org/mailman/listinfo/avt

---

From: Randell Jesup <[email-masked]>
Date: Fri, 25 May 2007 09:55:46 -0400

>another RTP packet and fourth frame should be sent as a separate RTP

No.  The first 3 frames could be in one packet, followed by the 4th frame
in a packet ("zero or more... Annex A frames").  If you're using a
packetization time of 20ms, you might have one packet for frames 1 and 2, 
one packet for frame 3, and one packet for frame 4.

Depending on what follows the 4th frame, you might have more frames in the
packet with it.

>In addition, how would be a valid RTP packing scheme for the below case?

1st packet: frame 1
2nd packet: frames 2 and 3
3rd packet: frame 4

>first frame + third frame)

You cannot re-order frames.

Note: generally an XXms packetization period is only a guideline (unless
maxptime is being used and agreed on).  Also, if for some reason you have
to end packetization "early" (such as due to an annexB frame), you
generally would start accumulating frames for the next packet up to the
total period you're using per packet - you don't need to remember you ended
the previous packet "early".

-- 
Randell Jesup, Worldgate (developers of the Ojo videophone), ex-Amiga OS team
[email-masked]
"The fetters imposed on liberty at home have ever been forged out of the weapons
provided for defence against real, pretended, or imaginary dangers from abroad."
		- James Madison, 4th US president (1751-1836)

---

From: "Murat Artun" <[email-masked]>
Date: Fri, 25 May 2007 18:04:47 +0300

> one packet for frame 3, and one packet for frame 4.

I think 20 ms scenario that you have defined does not comply with what
was said in RFC. I mean from statement "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" I understand that an annex B frame in an RTP
packet is preeded with an annex A frame (Of course this not possible
if 10 ms packetization period is used). True?

> the previous packet "early".

That is OK, thanks...

-- 
M u r at  A r t u n, MSc.
   Software Engineer

---

From: "SOLLAUD Aurelien RD-TECH-LAN" <[email-masked]>
Date: Fri, 25 May 2007 17:30:39 +0200

> > No.  The first 3 frames could be in one packet, followed by the 4th 
> > frame in a packet ("zero or more... Annex A frames").  If 
> you're using 
> > a packetization time of 20ms, you might have one packet for 
> frames 1 
> > and 2, one packet for frame 3, and one packet for frame 4.
> >
> 
> I think 20 ms scenario that you have defined does not comply 
> with what was said in RFC. I mean from statement "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" I understand that an annex B frame in 
> an RTP packet is preeded with an annex A frame (Of course 
> this not possible if 10 ms packetization period is used). True?
> 

An AnnexB frame can be alone in the RTP packet.
It is the case zero G.729 frame, followed by one G.729 Annex B frame.

Aurelien