[FFmpeg-soc] [soc]: r805 - in jpeg2000: j2k.h j2kdec.c
Michael Niedermayer
michaelni at gmx.at
Wed Aug 15 13:22:25 CEST 2007
Hi
On Wed, Aug 15, 2007 at 11:56:35AM +0200, k.nowosad wrote:
> Author: k.nowosad
> Date: Wed Aug 15 11:56:35 2007
> New Revision: 805
>
> Log:
> added dwt 9/7 to the decoder
>
>
[...]
> #define PSE (i0 + FFMIN((i-i0+2*(i1-i0-1))%(2*(i1-i0-1)), 2*(i1-i0-1)-(i-i0+2*(i1-i0-1))%(2*(i1-i0-1))))
> int i;
> @@ -828,6 +828,32 @@ static void sr_1d(int *p, int i0, int i1
> p[2*i] -= (p[2*i-1] + p[2*i+1] + 2) >> 2;
> for (i = i0/2; i < i1/2; i++)
> p[2*i+1] += (p[2*i] + p[2*i+2]) >> 1;
> +}
> +
> +static void sr_1d97(float *p, int i0, int i1, int ileft, int iright)
> +{
> + int i;
> +
> + if (i1 == i0 + 1)
> + return;
> +
> + for (i = i0 - ileft; i < i0; i++)
> + p[i] = p[PSE];
> + for (i = i1; i < i1+iright; i++)
> + p[i] = p[PSE];
this is not very efficient speedwise, also its obfuscated
> +
> + for (i = i0/2 - 1; i < i1/2 + 2; i++)
> + p[2*i] *= 1.230174;
> + for (i = i0/2 - 2; i < i1/2 + 2; i++)
> + p[2*i+1] *= 0.812893;
these 2 can maybe be merged with some other scaling
[...]
> + p[2*i] -= -0.052980 * (p[2*i-1] + p[2*i+1]);
p[2*i] += 0.05298 * (p[2*i-1] + p[2*i+1]);
> + for (i = i0/2; i < i1/2; i++)
> + p[2*i+1] -= -1.586134 * (p[2*i] + p[2*i+2]);
p[2*i+1] += 1.586134 * (p[2*i] + p[2*i+2]);
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Thouse who are best at talking, realize last or never when they are wrong.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-soc/attachments/20070815/06684ca3/attachment.pgp>
More information about the FFmpeg-soc
mailing list