[FFmpeg-devel] [PATCH] RTP depacketizer for H.263

Martin Storsjö martin
Tue Jan 26 09:00:13 CET 2010


On Mon, 25 Jan 2010, Ronald S. Bultje wrote:

> On Mon, Jan 25, 2010 at 10:05 AM, Martin Storsj? <martin at martin.st> wrote:
> > On Mon, 25 Jan 2010, Ronald S. Bultje wrote:
> >> > + ? ?int P, V, plen, pebit;
> >> [..]
> >> > + ? ?P = buf[0] & 0x04;
> >> > + ? ?V = buf[0] & 0x02;
> >>
> >> Can you document what P and V are?
> >
> > Sure! Added a much more verbose comment in the updated patch, attached.
> 
> Some more:
> 
> > +    P = buf[0] & 0x04;
> [..]
> > +    if (av_new_packet(pkt, len + (P ? 2 : 0))) {
> 
> P>>1 (or assign P with buf[0]&0x4>>1).

Ok, done.

> > +     * pebit is the number of bits to ignore of the last byte of the extra
> > +     * picture header.
> [..]
> > +    pebit = buf[1] & 0x03;
> 
> But it's unused. Better to document it nd just not actually assign the
> bits at all.

Ok, removed that variable but kept the documentation.

> Also, some of the other bits are undocumented, is it
> known what they are?

Yes, they are reserved and should be ignored. Added docs about this.

> Lastly, could you read buf[0]/buf[1] as a BE16
> and easify the calculation of plen?

Done.

Also, as Michael requested better variable names, I changed P, V and plen 
into startcode, vrc, picture_header. I'm not all that familiar with H.263 
other than what I can read from the RFC, so if you've got better 
suggestions, just say.

Updated patch attached.

// Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rtpdec-h263.patch
Type: text/x-diff
Size: 7939 bytes
Desc: 
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100126/baf2b9e4/attachment.patch>



More information about the ffmpeg-devel mailing list