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

Måns Rullgård mans
Sun Jul 13 01:22:11 CEST 2008


Dominik 'Rathann' Mierzejewski <dominik at rangers.eu.org> writes:

> 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?

No, this is the opposite of memmove().  In this case, we want the
dst-src first bytes to repeat.

-- 
M?ns Rullg?rd
mans at mansr.com




More information about the ffmpeg-devel mailing list