[FFmpeg-devel] H.263 packetizing into RTP

Martin Storsjö martin
Mon Apr 6 22:24:16 CEST 2009


On Mon, 6 Apr 2009, Michael Niedermayer wrote:

> > +            while (p > buf1) {
> > +                if (p[0] == 0 && p[1] == 0) {
> > +                    /* Found a byte aligned startcode. */
> > +                    len = p - buf1;
> > +                    break;
> > +                }
> > +                p--;
> > +            }
> 
> this can be done a little faster by steping by 2 and only checking the
> surounding bytes when the middle one is 0
> basically, using ff_h263_find_resync_marker() should achive that

Ah, clever!

I implemented two different alternatives of this; one searching forward 
using ff_h263_find_resync_marker and uses the last one found, the other 
alternative uses a local reimplementation of the function searching in 
reverse direction, which is potentially a bit more efficient since it 
doesn't necessarily have to search through the whole frame each time.

Which one of these do you prefer?

// Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ffmpeg-rtp-h263-alt1.patch
Type: text/x-diff
Size: 5129 bytes
Desc: 
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090406/9883e15c/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ffmpeg-rtp-h263-alt2.patch
Type: text/x-diff
Size: 5306 bytes
Desc: 
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090406/9883e15c/attachment-0001.patch>



More information about the ffmpeg-devel mailing list