[FFmpeg-devel] H.263 packetizing into RTP

Michael Niedermayer michaelni
Mon Apr 6 22:33:26 CEST 2009


On Mon, Apr 06, 2009 at 11:24:16PM +0300, Martin Storsj? wrote:
> 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?

the reverse search one

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

it is not once nor twice but times without number that the same ideas make
their appearance in the world. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090406/ac480e07/attachment.pgp>



More information about the ffmpeg-devel mailing list