[vlc-devel] [PATCH 1/2] Anti-flicker filter initial version

dharani prabhu dharani.prabhu.s at gmail.com
Mon May 9 21:38:59 CEST 2011


Attached the patch updating the softening phase as mentioned below

-Dharani

On Mon, May 9, 2011 at 12:51 AM, Laurent Aimar <fenrir at elivagar.org> wrote:

> Hi,
>
> On Mon, May 09, 2011 at 12:37:17AM +0530, dharani prabhu wrote:
> > Attached the changes ...
> > +    /******* Temporal softening phase. Adapted from code by Steven Don
> ******/
> > +    uint8_t *src1, *src2;
> > +    int ofs = (i_num_lines * i_out_pitch + i_num_cols);
> > +    int pitch = i_out_pitch;
> > +    src1 = p_outpic->p[Y_PLANE].p_pixels;
> > +    src2 = p_filter->p_sys->p_old_data;
> > +
> > +    do
> > +    {
> > +        int diff = abs(*src1 - *src2);
> > +        if (diff < i_softening)
> > +        {
> > +            if (diff > (i_softening >> 1))
> > +            {
> > +                *src2 = (*src1 + *src1 + *src2 )/ 3;
> > +            }
> > +        }
> > +        else
> > +        {
> > +            *src2 = *src1;
> > +        }
> > +        *src1 = *src2;
> > +        src1++; src2++;
> > +        if( --pitch == 0 )
> > +        {
> > +          src2 += (p_filter->fmt_in.video.i_width - i_out_pitch );
> > +          pitch = i_out_pitch;
> > +        }
> > +    } while (--ofs);
> This cannot work, as p_filter->fmt_in.video.i_width will usually be lower
> than i_out_pitch.
> Why not simply doing a double loops like:
> for( int i_line = 0 ; i_line < i_num_lines ; i_line++ )
> {
>    for( int i_col = 0; i_col < i_num_cols  ; i_col++ )
>    {
>    }
> }
> as you did in your code (a bit above)?
>
> --
> fenrir
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> http://mailman.videolan.org/listinfo/vlc-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20110510/9e8bac51/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Antiflicker-filter-initial-version.patch
Type: application/octet-stream
Size: 15051 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20110510/9e8bac51/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Antiflicker-filter-initial-version.patch
Type: application/octet-stream
Size: 4276 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20110510/9e8bac51/attachment-0001.obj>


More information about the vlc-devel mailing list