[FFmpeg-devel] [PATCH 2/2] avcodec/jpeg2000dwt: merge rescaling with interleave in 9/7 int IDWT

Paul B Mahol onemda at gmail.com
Mon Jun 3 00:04:24 CEST 2013


On 6/2/13, Michael Niedermayer <michaelni at gmx.at> wrote:
> Tha fate tests change because the edge mirroring was wrong before this
> commit
>
> Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> ---
>  libavcodec/jpeg2000dwt.c             |   14 ++++----------
>  tests/ref/vsynth/vsynth1-jpeg2000-97 |    4 ++--
>  tests/ref/vsynth/vsynth2-jpeg2000-97 |    4 ++--
>  3 files changed, 8 insertions(+), 14 deletions(-)
>
> diff --git a/libavcodec/jpeg2000dwt.c b/libavcodec/jpeg2000dwt.c
> index 13712d9..cc7ca8a 100644
> --- a/libavcodec/jpeg2000dwt.c
> +++ b/libavcodec/jpeg2000dwt.c
> @@ -431,12 +431,6 @@ static void sr_1d97_int(int32_t *p, int i0, int i1)
>
>      extend97_int(p, i0, i1);
>
> -    /*step 1*/
> -    for (i = i0 / 2 - 1; i < i1 / 2 + 2; i++)
> -        p[2 * i]      = ((p[2 * i] * I_LFTG_K)     + (1 << 15)) >> 16;
> -    /* step 2*/
> -    for (i = i0 / 2 - 2; i < i1 / 2 + 2; i++)
> -        p[2 * i + 1]  = ((p[2 * i + 1] * I_LFTG_X) + (1 << 15)) >> 16;
>      /* step 3*/

This comment becomes pointless.

>      for (i = i0 / 2 - 1; i < i1 / 2 + 2; i++)
>          p[2 * i]     -= (I_LFTG_DELTA * (p[2 * i - 1] + p[2 * i + 1]) + (1
> << 15)) >> 16;
> @@ -473,9 +467,9 @@ static void dwt_decode97_int(DWTContext *s, int32_t *t)
>              int i, j = 0;
>              // copy with interleaving
>              for (i = mh; i < lh; i += 2, j++)
> -                l[i] = data[w * lp + j];
> +                l[i] = ((data[w * lp + j] * I_LFTG_K) + (1 << 15)) >> 16;
>              for (i = 1 - mh; i < lh; i += 2, j++)
> -                l[i] = data[w * lp + j];
> +                l[i] = ((data[w * lp + j] * I_LFTG_X) + (1 << 15)) >> 16;
>
>              sr_1d97_int(line, mh, mh + lh);
>
> @@ -489,9 +483,9 @@ static void dwt_decode97_int(DWTContext *s, int32_t *t)
>              int i, j = 0;
>              // copy with interleaving

This one too.

>              for (i = mv; i < lv; i += 2, j++)
> -                l[i] = data[w * j + lp];
> +                l[i] = ((data[w * j + lp] * I_LFTG_K) + (1 << 15)) >> 16;
>              for (i = 1 - mv; i < lv; i += 2, j++)
> -                l[i] = data[w * j + lp];
> +                l[i] = ((data[w * j + lp] * I_LFTG_X) + (1 << 15)) >> 16;
>
>              sr_1d97_int(line, mv, mv + lv);
>
> diff --git a/tests/ref/vsynth/vsynth1-jpeg2000-97
> b/tests/ref/vsynth/vsynth1-jpeg2000-97
> index f219406..f8399f2 100644
> --- a/tests/ref/vsynth/vsynth1-jpeg2000-97
> +++ b/tests/ref/vsynth/vsynth1-jpeg2000-97
> @@ -1,4 +1,4 @@
>  c135eb14e9f219242180270c2a242634 *tests/data/fate/vsynth1-jpeg2000-97.avi
>  2243132 tests/data/fate/vsynth1-jpeg2000-97.avi
> -30a9c13e18fe4acaf28062b5003bb671
> *tests/data/fate/vsynth1-jpeg2000-97.out.rawvideo
> -stddev:    6.41 PSNR: 31.99 MAXDIFF:   75 bytes:  7603200/  7603200
> +e1a095b40d7f6440f6c46f2995c4759c
> *tests/data/fate/vsynth1-jpeg2000-97.out.rawvideo
> +stddev:    6.23 PSNR: 32.23 MAXDIFF:   75 bytes:  7603200/  7603200
> diff --git a/tests/ref/vsynth/vsynth2-jpeg2000-97
> b/tests/ref/vsynth/vsynth2-jpeg2000-97
> index 001e840..e7fce13 100644
> --- a/tests/ref/vsynth/vsynth2-jpeg2000-97
> +++ b/tests/ref/vsynth/vsynth2-jpeg2000-97
> @@ -1,4 +1,4 @@
>  3ac3e49a89136bddde9e44bac3e5b4ed *tests/data/fate/vsynth2-jpeg2000-97.avi
>  1118952 tests/data/fate/vsynth2-jpeg2000-97.avi
> -9d69ac6d46152ed2d6dd6a90d5793c80
> *tests/data/fate/vsynth2-jpeg2000-97.out.rawvideo
> -stddev:    5.32 PSNR: 33.61 MAXDIFF:   60 bytes:  7603200/  7603200
> +8ac8b9ee81fa73c873668e9f6b78764d
> *tests/data/fate/vsynth2-jpeg2000-97.out.rawvideo
> +stddev:    4.95 PSNR: 34.23 MAXDIFF:   60 bytes:  7603200/  7603200
> --
> 1.7.9.5
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>

If output match spec it should be ok,


More information about the ffmpeg-devel mailing list