[FFmpeg-devel] [PATCH] DeluxePaint Animation playback system
Michael Niedermayer
michaelni
Fri Jan 8 04:01:23 CET 2010
On Fri, Jan 08, 2010 at 12:03:23AM +1100, pross at xvid.org wrote:
> On Mon, Oct 19, 2009 at 10:36:11PM +0200, Michael Niedermayer wrote:
> > On Sun, Oct 18, 2009 at 04:19:04PM +1100, Peter Ross wrote:
> > > On Thu, Oct 15, 2009 at 07:01:28PM +0200, Diego Biurrun wrote:
> > > > On Thu, Oct 15, 2009 at 07:54:05PM +1100, Peter Ross wrote:
[...]
> +/**
> + * Perform decode operation
> + * @param dst Destination image buffer
> + * @param buf Source buffer (optional, see below)
> + * @param pixel Fill color (optional, see below)
> + * @param count Pixel count
> + * @param x Pointer to x-axis counter
> + * @param width Image width
> + * @param linesize Destination image buffer linesize
> + *
> + * a copy operation is achieved when 'buf' is set
> + * a fill operation is acheived when 'buf' is null and pixel is >= 0
> + * a skip operation is acheived when 'buf' is null and pixel is < 0
> + */
> +static inline void op(uint8_t **dst, const uint8_t *dst_end,
> + const uint8_t **buf, const uint8_t *buf_end,
> + int pixel, int count,
> + int *x, int width, int linesize)
> +{
> + while (((linesize > 0 && *dst < dst_end) || *dst > dst_end) &&
> + count > 0) {
while (((1 && 0) || 1) && 1) {
makes linesize>0 and *dst > dst_end
is that intended?
> + int striplen = FFMIN(count, width - *x);
> + if (buf) {
> + striplen = FFMIN(striplen, buf_end - *buf);
> + memcpy(*dst, *buf, striplen);
> + *buf += striplen;
> + } else if (pixel >= 0)
> + memset(*dst, pixel, striplen);
> + *dst += striplen;
> + *x += striplen;
> + count -= striplen;
> + if (*x >= width) {
> + *dst += linesize - width;
> + *x = 0;
> + }
a remaining= width - *x instead of x would simplify this
also not writing to a *x all the time (1 dereference) should be
faster, it could be written after the loop
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
I have never wished to cater to the crowd; for what I know they do not
approve, and what they approve I do not know. -- Epicurus
-------------- 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/20100108/c65889e4/attachment.pgp>
More information about the ffmpeg-devel
mailing list