[FFmpeg-devel] [PATCH] lavc/gif: use transparency.

Clément Bœsch ubitux at gmail.com
Sat Apr 20 00:19:10 CEST 2013


On Fri, Apr 19, 2013 at 07:22:02PM +0000, Paul B Mahol wrote:
[...]
> >      ptr = buf + y_start*linesize + x_start;
> >      for (y = 0; y < height; y++) {
> > -        len += ff_lzw_encode(s->lzw, ptr, width);
> > +        const uint8_t *src_data_line = ptr;
> > +
> > +        if (trans >= 0) {
> > +            const uint8_t *ref = s->last_frame->data[0];
> > +            const int ref_linesize = s->last_frame->linesize[0];
> > +
> > +            memcpy(s->tmpl, ptr, width);
> > +            for (x = 0; x < width; x++)
> > +                if (ref[(y_start + y) * ref_linesize + x_start + x] ==
> 
> This can't overflow?
> 

I don't think so. ref and buf are previous and current frame (same size).
The offsetting is the same for both. I've reworked the code to make this
more explicit though.

[...]
> rest looks ok

Will push soon, thanks.

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130420/427784a9/attachment.asc>


More information about the ffmpeg-devel mailing list