[FFmpeg-soc] [soc]: r369 - jpeg2000/j2kenc.c

Michael Niedermayer michaelni at gmx.at
Wed Jul 11 01:16:04 CEST 2007


Hi

On Tue, Jul 10, 2007 at 09:19:03PM +0200, k.nowosad wrote:
> Author: k.nowosad
> Date: Tue Jul 10 21:19:02 2007
> New Revision: 369
> 
> Log:
> changed the dwt_norms table from double to int
> removed the unneeded division by 8192.0 in getwmsedec()
> some minor changes
> 
> 
> Modified:
>    jpeg2000/j2kenc.c
> 
[...]
> @@ -817,14 +818,14 @@ static int getnmsedec_ref(int x, int bpn
>  
>  static double getwmsedec(int nmsedec, int bandpos, int lev, int bpno)
>  {
> -   static const double dwt_norms[4][10] = {
> -    {1.000, 1.500, 2.750, 5.375, 10.68, 21.34, 42.67, 85.33, 170.7, 341.3},
> -    {1.038, 1.592, 2.919, 5.703, 11.33, 22.64, 45.25, 90.48, 180.9},
> -    {1.038, 1.592, 2.919, 5.703, 11.33, 22.64, 45.25, 90.48, 180.9},
> -    {.7186, .9218, 1.586, 3.043, 6.019, 12.01, 24.00, 47.97, 95.93}};
> +   static const int dwt_norms[4][10] = { // multiplied by 10000
> +    {10000, 15000, 27500, 53750, 106800, 213400, 426700, 853300, 1707000, 3413000},
> +    {10380, 15920, 29190, 57030, 113300, 226400, 452500, 904800, 1809000},
> +    {10380, 15920, 29190, 57030, 113300, 226400, 452500, 904800, 1809000},
> +    { 7186,  9218, 15860, 30430,  60190, 120100, 240000, 479700,  959300}};
>  
> -    double t = dwt_norms[bandpos][lev] * (1 << bpno);
> -    return t * t * nmsedec / 8192.0;
> +    int t = (dwt_norms[bandpos][lev]) * (1 << bpno);
> +    return (double) t * (double) t * nmsedec;
>  }

why is the returned values not int64_t or int?
same question for the code which uses getwmsedec() ?

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Those who are too smart to engage in politics are punished by being
governed by those who are dumber. -- Plato 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-soc/attachments/20070711/fe85eff5/attachment.pgp>


More information about the FFmpeg-soc mailing list