[FFmpeg-devel] [PATCH] Electronic Arts TGV decoder
pross at xvid.org
pross
Sun Jul 20 04:28:06 CEST 2008
On Sat, Jul 19, 2008 at 11:30:38AM +0200, Reimar D?ffinger wrote:
> Hello,
> > /**
> > - * \brief copy previously decoded bytes to current position
> > - * \param back how many bytes back we start
> > + * \brief deliberate overlapping memcpy implementation
> > + * \param dst destination buffer; must be padded by 12 bytes
> > + * \param back how many bytes back we start (the initial size of the overlapping window)
> > * \param cnt number of bytes to copy, must be >= 0
> > *
> > * cnt > back is valid, this will copy the bytes we just copied,
> > * thus creating a repeating pattern with a period length of back.
> > */
> > -static inline void copy_backptr(LZOContext *c, int back, int cnt) {
> > - register const uint8_t *src = &c->out[-back];
> > - register uint8_t *dst = c->out;
> > - if (src < c->out_start || src > dst) {
> > - c->error |= LZO_INVALID_BACKPTR;
> > - return;
> > - }
> > - if (cnt > c->out_end - dst) {
> > - cnt = FFMAX(c->out_end - dst, 0);
> > - c->error |= LZO_OUTPUT_FULL;
> > - }
> > +void av_memcpy_backptr(uint8_t *dst, int back, int cnt) {
> > + const uint8_t *src = dst-back;
> > if (back == 1) {
> > memset(dst, *src, cnt);
> > dst += cnt;
> > @@ -157,10 +149,32 @@
> > }
> > dst += cnt;
> > }
> > - c->out = dst;
> > }
> >
> > /**
> > + * \brief copy previously decoded bytes to current position
> > + * \param back how many bytes back we start
> > + * \param cnt number of bytes to copy, must be >= 0
> > + *
> > + * cnt > back is valid, this will copy the bytes we just copied,
> > + * thus creating a repeating pattern with a period length of back.
> > + */
> > +static inline void copy_backptr(LZOContext *c, int back, int cnt) {
>
> The diff should be smaller if you change the order of these two
> functions.
Okay, but s/smaller/simpler/.
Updated patch enclosed, addressing your request, and Michael's final
comments.
-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ffmpeg-av_memcpy_backptr-r3.diff
Type: text/x-diff
Size: 2956 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080720/a5fb7206/attachment.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ffmpeg-eatgv-decode-r6.diff
Type: text/x-diff
Size: 13145 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080720/a5fb7206/attachment-0001.diff>
-------------- 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/20080720/a5fb7206/attachment.pgp>
More information about the ffmpeg-devel
mailing list