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

Michael Niedermayer michaelni
Mon Jul 14 13:27:55 CEST 2008


On Mon, Jul 14, 2008 at 09:21:38PM +1000, pross at xvid.org wrote:
> On Sun, Jul 13, 2008 at 12:12:32AM +0200, 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.
> > [...]
> > 
> > 
> > > +                size2 = (src[0] & 0x3F) + 4;
> > > +                src += 3;
> > > +            }
> > > +        } else {  // 0
> > > +            offset = -( ((src[0] & 0x60) << 3) + src[1] ) - 1;
> > > +            size2 = ((src[0] & 0x1C) >> 2) + 3;
> > > +            src += 2;
> > > +        }
> > > +
> > > +
> > > +        /* fetch strip from src */
> > > +        if (src+size1>src_end)
> > > +            break;
> > > +
> > 
> > > +        size -= size1;
> > > +        while(size1>0) {
> > > +            int run = FFMIN(size1, width-x);
> > > +            memcpy(dst + y*stride + x, src, run);
> > > +            src+=run;
> > > +            size1-=run;
> > > +            x+=run;
> > > +            if (x>=width) {
> > > +                x=0; y++;
> > > +                if (y>=height) return 0;
> > > +            }
> > > +        }
> > 
> > Is this more efficient than simply allocating width*height AVFrames?
> > It would require CODEC_CAP_DR1 to be removed though ...
> 
> Certainly worth testing. How do I "cleanly" allocate an AVFrame with
> linesize tied to width? (grepping lavc for -v DR1 examples was not 
> productive...)

my_frame.data[0]= av_malloc(width*height)
linesize[0]= width


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

Freedom in capitalist society always remains about the same as it was in
ancient Greek republics: Freedom for slave owners. -- Vladimir Lenin
-------------- 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/20080714/ab792bd5/attachment.pgp>



More information about the ffmpeg-devel mailing list