[vlc-devel] [PATCH 2/6] OldMovie: Old movie style video filter

Jean-Baptiste Kempf jb at videolan.org
Thu Jul 25 13:41:30 CEST 2013


On 25 Jul, Vianney Boyer wrote :
> New video filter making the video like an old movie (projector,
> damages on film...)

Same remarks as freeze apply

> +#define SUB_MIN(val, sub_val, min) val = \
> + ((val-(int32_t)sub_val)<min?min:val-sub_val)
> +#define ADD_MAX(val, add_val, max) val = \
> + ((val+(int32_t)add_val)>max?max:val+add_val)
> +
> +#define PIX_OFS(i_x, i_y, s_plane) ( \
> +        (i_x) * s_plane.i_pixel_pitch \
> +      + (i_y) * s_plane.i_pitch \
> +    )
> +
> +#define CHECK_PIX_OFS(i_x, i_y, s_plane) ( \
> +        (i_x) >= 0 && (i_y) >= 0 && \
> +        (i_x) * s_plane.i_pixel_pitch < s_plane.i_visible_pitch && \
> +        (i_y) < s_plane.i_visible_lines \
> +    )
> +
> +#define DARKEN_PIXEL(i_x, i_y, intensity, s_plane) \
> +        SUB_MIN(s_plane.p_pixels[ PIX_OFS(i_x, i_y, s_plane) ],
> intensity, 0)
> +
> +#define LIGHTEN_PIXEL(i_x, i_y, intensity, s_plane) \
> +        ADD_MAX(s_plane.p_pixels[PIX_OFS(i_x, i_y, s_plane)],
> intensity, 0xFF)
> +
> +#define CHECK_N_DARKEN_PIXEL(i_x, i_y, intensity, s_plane) \
> +        if ( CHECK_PIX_OFS(i_x, i_y, s_plane) ) \
> +            DARKEN_PIXEL(i_x, i_y, intensity, s_plane) \
> +
> +#define CHECK_N_LIGHTEN_PIXEL(i_x, i_y, intensity, s_plane) \
> +        if ( CHECK_PIX_OFS(i_x, i_y, s_plane) ) \
> +            LIGHTEN_PIXEL(i_x, i_y, intensity, s_plane) \

Shouldn't some be static inline?

> +#define CFG_PREFIX "oldmovie-"

unused.

Really cool filter!

Best regards,

-- 
Jean-Baptiste Kempf
http://www.jbkempf.com/ - +33 672 704 734
Sent from my Electronic Device



More information about the vlc-devel mailing list