[vlc-devel] [WIP] sharpen: reimplement with SKIPSM

Ilkka Ollakka ileoo at videolan.org
Fri May 23 09:14:05 CEST 2014


On Thu, May 22, 2014 at 11:30:28AM -0400, Tristan Matthews wrote:
> SKIPSM (Separated-Kernel Image Processing using finite-State Machines) allows
> sharpening with fewer repeated operations. Two finite-state machines
> (a 2 element row FSM, and a width-element column FSM) are used to to avoid
> duplicate reads/arithmetic.

> This is a WIP. sharpen2 is meant to replace sharpen but both are included here
> for ease of live comparison.

Hi,

Nice patch, maybe the UI part could go to separated patch later on.

> +/*****************************************************************************
> + * sharpen2.c: Sharpen video filter
> + *****************************************************************************
> + * Copyright (C) 2003-2007 VLC authors and VideoLAN

Are you sure about those years? ;)

> + * Author: Jérémy DEMEULE <dj_mulder at djduron dot no-ip dot org>
> + *         Jean-Baptiste Kempf <jb at videolan dot org>

You are not authors?

> +#define SIG_TEXT N_("Sharpen strength (0-2)")
> +#define SIG_LONGTEXT N_("Set the Sharpen strength, between 0 and 2. Defaults to 0.05.")

I think that with range vlc outputs limits automaticly, so maybe those
are not needed as translatable strings.

> +/*****************************************************************************
> + * clip: avoid negative value and value > 255
> + *****************************************************************************/
> +inline static uint8_t clip( int32_t a )
> +{
> +    return (a > 255) ? 255 : (a < 0) ? 0 : a;
> +}

VLC_CLIP() ?

> +    /* perform convolution only on Y plane. Avoid border line. */
> +    vlc_mutex_lock( &p_filter->p_sys->lock );

I think it would be better in callback just to set boolean/flag to tell
to call precalc_table on next Filter call. As current way callback could
end und being blocked for relative long time and it's not preferred to
do so. So checking the need for init_precalc_table in Filter would be
better and just set flag for it in SharpenCallback().

-- 
Ilkka Ollakka
To be or not to be.
		-- Shakespeare
To do is to be.
		-- Nietzsche
To be is to do.
		-- Sartre
Do be do be do.
		-- Sinatra
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20140523/63ac7f98/attachment.sig>


More information about the vlc-devel mailing list