[FFmpeg-devel] [PATCH] life: add slow_death, life_color and death_color options.

Clément Bœsch ubitux at gmail.com
Sun Dec 11 14:17:57 CET 2011


On Sun, Dec 11, 2011 at 11:38:24AM +0100, Stefano Sabatini wrote:
[...]
> > Sure.
> > 
> > > > +    int i, j;
> > > > +
> > > > +    /* fill the output picture with the old grid buffer */
> > > > +    for (i = 0; i < life->h; i++) {
> > > > +        uint8_t *p = picref->data[0] + i * picref->linesize[0];
> > > > +        for (j = 0; j < life->w; j++) {
> > > > +            uint8_t v = buf[i*life->w + j];
> > > > +            if (life->mold && v != ALIVE_CELL) {
> > > > +                int death_age = FFMIN((0xff - v) * life->mold, 0xff);
> > >  
> > > > +                *p++ = ((c2[0] << 8) + ((int)c1[0] - (int)c2[0]) * death_age) >> 8;
> > > > +                *p++ = ((c2[1] << 8) + ((int)c1[1] - (int)c2[1]) * death_age) >> 8;
> > > > +                *p++ = ((c2[2] << 8) + ((int)c1[2] - (int)c2[2]) * death_age) >> 8;
> > > 
> > > then I realized this should be divided by 255, check FAST_DIV255 in
> > > vf_overlay.c.
> > > 
> > 
> 
> > Mmh, should we move this code to some common header (in that case which
> > one?) or should I just duplicate the code...
> 
> As you prefer, libavutil or libavfilter/internal.h may do, but this
> looks like premature factorization, and shouldn't block the patch.
> 
> > > Looks good otherwise.
> > 

Pushed with the replicated macro. 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/20111211/f98c3a15/attachment.asc>


More information about the ffmpeg-devel mailing list