[FFmpeg-devel] [PATCH] Electronic Arts TGV decoder

Dominik 'Rathann' Mierzejewski dominik
Sun Jul 13 01:08:17 CEST 2008


On Sunday, 13 July 2008 at 00:12, Michael Niedermayer wrote:
> On Sat, Jul 12, 2008 at 04:32:20PM +1000, pross at xvid.org wrote:
> > On Thu, Jul 10, 2008 at 01:00:32AM +0200, Michael Niedermayer wrote:
> > > On Wed, Jul 09, 2008 at 09:18:13PM +1000, pross at xvid.org wrote:
> > > > Hi!
> > > > 
> > > > Second video codec in the EA series.
> > > > 
> > > > Samples: http://samples.mplayerhq.hu/game-formats/ea-tgv/
> > > > Write-up: http://wiki.multimedia.cx/index.php?title=Electronic_Arts_TGV
> > > [...]
> > 
> > Revised patch enclosed.
> [...]
> > +static inline void memcpy_naive(uint8_t *dst, const uint8_t *src, size_t size)
> > +{
> > +    if (src+size<dst) {
> > +        memcpy(dst, src, size);
> > +    }else {
> > +        /* when src and dst overlap, perform naive copy */
> > +        int i;
> > +        for(i=0; i<size; i++) dst[i] = src[i];
> > +    }
> > +}
> 
> This might be a duplicate of copy_backptr() from libavutil/lzo.c
> factorizig the common code out into a function might be a good idea
> so both can benefit from all the optimizations.

Um... shouldn't you just call memmove in the overlapping case?

Regards,
R.

-- 
MPlayer http://mplayerhq.hu | Livna http://rpm.livna.org
There should be a science of discontent. People need hard times and
oppression to develop psychic muscles.
	-- from "Collected Sayings of Muad'Dib" by the Princess Irulan




More information about the ffmpeg-devel mailing list