[MPlayer-cvslog] r34014 - trunk/libvo/gl_common.c
Clément Bœsch
ubitux at gmail.com
Fri Aug 26 21:01:52 CEST 2011
On Fri, Aug 26, 2011 at 08:51:52PM +0200, reimar wrote:
> Author: reimar
> Date: Fri Aug 26 20:51:51 2011
> New Revision: 34014
>
> Log:
> Add disabled feature: noise filter for vo_gl.
>
> Modified:
> trunk/libvo/gl_common.c
>
> Modified: trunk/libvo/gl_common.c
> ==============================================================================
> --- trunk/libvo/gl_common.c Fri Aug 26 11:46:42 2011 (r34013)
> +++ trunk/libvo/gl_common.c Fri Aug 26 20:51:51 2011 (r34014)
> @@ -897,6 +897,36 @@ static void gen_spline_lookup_tex(GLenum
> free(tex);
> }
>
> +#define NOISE_RES 2048
> +
> +/**
> + * \brief creates the 1D lookup texture needed to generate pseudo-random numbers.
> + * \param unit texture unit to attach texture to
> + */
IIRC the current preferred Doxygen syntax is with '@'
> +static void gen_noise_lookup_tex(GLenum unit) {
> + GLfloat *tex = calloc(NOISE_RES, sizeof(*tex));
> + uint32_t lcg = 0x79381c11;
> + int i;
> + for (i = 0; i < NOISE_RES; i++)
> + tex[i] = (double)i / (NOISE_RES - 1);
> + for (i = 0; i < NOISE_RES - 1; i++) {
> + int remain = NOISE_RES - i;
> + int idx = i + (lcg >> 16) % remain;
> + GLfloat tmp = tex[i];
> + tex[i] = tex[idx];
> + tex[idx] = tmp;
> + lcg = lcg * 1664525 + 1013904223;
Maybe use av_lfg?
BTW, what is this for? -vf noise is too slow?
--
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://lists.mplayerhq.hu/pipermail/mplayer-cvslog/attachments/20110826/727d8434/attachment.asc>
More information about the MPlayer-cvslog
mailing list