[FFmpeg-cvslog] avcodec/jpeg2000dwt: List differences for DWT test

Michael Niedermayer git at videolan.org
Sun Jun 21 14:00:04 CEST 2015


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Jun 21 13:22:38 2015 +0200| [6528b90dea7c704228a5057012d209245e5f2520] | committer: Michael Niedermayer

avcodec/jpeg2000dwt: List differences for DWT test

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6528b90dea7c704228a5057012d209245e5f2520
---

 libavcodec/jpeg2000dwt.c  |    7 +++++++
 tests/fate/libavcodec.mak |    1 -
 tests/ref/fate/j2k-dwt    |   40 ++++++++++++++++++++++++++++++++++++++++
 3 files changed, 47 insertions(+), 1 deletion(-)

diff --git a/libavcodec/jpeg2000dwt.c b/libavcodec/jpeg2000dwt.c
index 8d95eb2..811a869 100644
--- a/libavcodec/jpeg2000dwt.c
+++ b/libavcodec/jpeg2000dwt.c
@@ -615,6 +615,7 @@ void ff_dwt_destroy(DWTContext *s)
 static int test_dwt(int *array, int *ref, uint16_t border[2][2], int decomp_levels, int type, int max_diff) {
     int ret, j;
     DWTContext s1={{{0}}}, *s= &s1;
+    int64_t err2 = 0;
 
     ret = ff_jpeg2000_dwt_init(s,  border, decomp_levels, type);
     if (ret < 0) {
@@ -637,10 +638,16 @@ static int test_dwt(int *array, int *ref, uint16_t border[2][2], int decomp_leve
                     j, array[j], ref[j],decomp_levels, border[0][0], border[0][1], border[1][0], border[1][1]);
             return 2;
         }
+        err2 += (array[j] - ref[j]) * (array[j] - ref[j]);
         array[j] = ref[j];
     }
     ff_dwt_destroy(s);
 
+    printf("%s, decomp:%2d border %3d %3d %3d %3d milli-err2:%9"PRId64"\n",
+           type == FF_DWT53 ? "5/3i" : "9/7i",
+           decomp_levels, border[0][0], border[0][1], border[1][0], border[1][1],
+           1000*err2 / ((border[0][1] - border[0][0])*(border[1][1] - border[1][0])));
+
     return 0;
 }
 
diff --git a/tests/fate/libavcodec.mak b/tests/fate/libavcodec.mak
index 3862f22..fbd8b83 100644
--- a/tests/fate/libavcodec.mak
+++ b/tests/fate/libavcodec.mak
@@ -37,7 +37,6 @@ fate-mathops: REF = /dev/null
 FATE_LIBAVCODEC-$(CONFIG_JPEG2000_ENCODER) += fate-j2k-dwt
 fate-j2k-dwt: libavcodec/jpeg2000dwt-test$(EXESUF)
 fate-j2k-dwt: CMD = run libavcodec/jpeg2000dwt-test
-fate-j2k-dwt: REF = /dev/null
 
 
 FATE_LIBAVCODEC-$(call ENCDEC, FLAC, FLAC) += fate-api-flac
diff --git a/tests/ref/fate/j2k-dwt b/tests/ref/fate/j2k-dwt
new file mode 100644
index 0000000..f3317b7
--- /dev/null
+++ b/tests/ref/fate/j2k-dwt
@@ -0,0 +1,40 @@
+5/3i, decomp:15 border 151 170 140 183 milli-err2:        0
+9/7i, decomp:15 border 151 170 140 183 milli-err2:    13030
+5/3i, decomp:21 border 173 201  81 189 milli-err2:        0
+9/7i, decomp:21 border 173 201  81 189 milli-err2:    21587
+5/3i, decomp:22 border 213 227  76 245 milli-err2:        0
+9/7i, decomp:22 border 213 227  76 245 milli-err2:    13454
+5/3i, decomp:13 border 134 157 184 203 milli-err2:        0
+9/7i, decomp:13 border 134 157 184 203 milli-err2:    19745
+5/3i, decomp: 1 border 204 237   6 106 milli-err2:        0
+9/7i, decomp: 1 border 204 237   6 106 milli-err2:     2236
+5/3i, decomp:28 border  76 211  13 210 milli-err2:        0
+9/7i, decomp:28 border  76 211  13 210 milli-err2:    22341
+5/3i, decomp:21 border  76  99  43 123 milli-err2:        0
+9/7i, decomp:21 border  76  99  43 123 milli-err2:    15450
+5/3i, decomp:15 border 192 243 174 204 milli-err2:        0
+9/7i, decomp:15 border 192 243 174 204 milli-err2:    56308
+5/3i, decomp:21 border  17  68  93 204 milli-err2:        0
+9/7i, decomp:21 border  17  68  93 204 milli-err2:    26234
+5/3i, decomp:11 border 142 168  82 174 milli-err2:        0
+9/7i, decomp:11 border 142 168  82 174 milli-err2:    14802
+5/3i, decomp:23 border 142 209 171 235 milli-err2:        0
+9/7i, decomp:23 border 142 209 171 235 milli-err2:    26230
+5/3i, decomp:30 border  37 185  79 245 milli-err2:        0
+9/7i, decomp:30 border  37 185  79 245 milli-err2:    18994
+5/3i, decomp: 5 border 129 236  30 243 milli-err2:        0
+9/7i, decomp: 5 border 129 236  30 243 milli-err2:    14600
+5/3i, decomp:10 border   5 160 146 247 milli-err2:        0
+9/7i, decomp:10 border   5 160 146 247 milli-err2:    43905
+5/3i, decomp: 5 border 104 162   6  47 milli-err2:        0
+9/7i, decomp: 5 border 104 162   6  47 milli-err2:    12942
+5/3i, decomp:24 border  78 250 102 218 milli-err2:        0
+9/7i, decomp:24 border  78 250 102 218 milli-err2:    24997
+5/3i, decomp:28 border  86  98  56  79 milli-err2:        0
+9/7i, decomp:28 border  86  98  56  79 milli-err2:     8112
+5/3i, decomp: 6 border  95 238 197 214 milli-err2:        0
+9/7i, decomp: 6 border  95 238 197 214 milli-err2:    12925
+5/3i, decomp:17 border  77 169  93 165 milli-err2:        0
+9/7i, decomp:17 border  77 169  93 165 milli-err2:    24949
+5/3i, decomp:22 border 178 187   7 119 milli-err2:        0
+9/7i, decomp:22 border 178 187   7 119 milli-err2:     9838



More information about the ffmpeg-cvslog mailing list