[FFmpeg-devel] [PATCH 6/6] tests: Add fate-snowenc

Michael Niedermayer michael at niedermayer.cc
Fri Mar 24 02:25:40 EET 2023


Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
 libavcodec/tests/snowenc.c |  4 +-
 tests/fate/libavcodec.mak  |  4 ++
 tests/ref/fate/snowenc     | 75 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 81 insertions(+), 2 deletions(-)
 create mode 100644 tests/ref/fate/snowenc

diff --git a/libavcodec/tests/snowenc.c b/libavcodec/tests/snowenc.c
index 37198cd4e3..b3c46a8874 100644
--- a/libavcodec/tests/snowenc.c
+++ b/libavcodec/tests/snowenc.c
@@ -106,7 +106,7 @@ int main(void){
                     for(x=0; x<width; x++){
                         int64_t d= obuffer[x + y*width];
                         error += d*d;
-                        if(FFABS(width/2-x)<9 && FFABS(height/2-y)<9 && level==2) printf("%8"PRId64" ", d);
+                        if(FFABS(width/2-x)<9 && FFABS(height/2-y)<9 && level==2) printf("%8"PRId64, d);
                     }
                     if(FFABS(height/2-y)<9 && level==2) printf("\n");
                 }
@@ -137,7 +137,7 @@ int main(void){
             for(y=0; y<height; y++){
                 for(x=0; x<width; x++){
                     int64_t d= buffer[0][x + y*width];
-                    if(FFABS(width/2-x)<9 && FFABS(height/2-y)<9) printf("%8"PRId64" ", d);
+                    if(FFABS(width/2-x)<9 && FFABS(height/2-y)<9) printf("%8"PRId64, d);
                 }
                 if(FFABS(height/2-y)<9) printf("\n");
             }
diff --git a/tests/fate/libavcodec.mak b/tests/fate/libavcodec.mak
index 8f56fae3a8..1cb483e402 100644
--- a/tests/fate/libavcodec.mak
+++ b/tests/fate/libavcodec.mak
@@ -80,6 +80,10 @@ fate-rangecoder: libavcodec/tests/rangecoder$(EXESUF)
 fate-rangecoder: CMD = run libavcodec/tests/rangecoder$(EXESUF)
 fate-rangecoder: CMP = null
 
+FATE_LIBAVCODEC-$(CONFIG_SNOW_ENCODER) += fate-snowenc
+fate-snowenc: libavcodec/tests/snowenc$(EXESUF)
+fate-snowenc: CMD = run libavcodec/tests/snowenc$(EXESUF)
+
 FATE_LIBAVCODEC-yes += fate-mathops
 fate-mathops: libavcodec/tests/mathops$(EXESUF)
 fate-mathops: CMD = run libavcodec/tests/mathops$(EXESUF)
diff --git a/tests/ref/fate/snowenc b/tests/ref/fate/snowenc
new file mode 100644
index 0000000000..e073ef1469
--- /dev/null
+++ b/tests/ref/fate/snowenc
@@ -0,0 +1,75 @@
+testing 5/3 DWT
+testing 9/7 DWT
+       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0
+       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0
+       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0
+       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0
+       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0
+       0       0       0       0       0      -6      -4      19      65    -141      65      19      -4      -6       0       0       0
+       0       0       0       0       0      -5      -3      12      43     -95      43      12      -3      -5       0       0       0
+       0       0       0       0       0      43      29    -113    -408     904    -408    -113      29      43       0       0       0
+       0       0       0       0       0      81      54    -216    -774    1710    -774    -216      54      81       0       0       0
+       0       0       0       0       0      43      29    -113    -408     904    -408    -113      29      43       0       0       0
+       0       0       0       0       0      -5      -3      12      43     -95      43      12      -3      -5       0       0       0
+       0       0       0       0       0      -6      -4      19      65    -141      65      19      -4      -6       0       0       0
+       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0
+       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0
+       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0
+       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0
+       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0
+       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0
+       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0
+       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0
+       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0
+       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0
+       0       0       0       0       0      -6      -4      43      81      43      -4      -6       0       0       0       0       0
+       0       0       0       0       0      -5      -3      28      54      28      -3      -5       0       0       0       0       0
+       0       0       0       0       0      18      12    -114    -216    -114      12      18       0       0       0       0       0
+       0       0       0       0       0      64      43    -409    -774    -409      43      64       0       0       0       0       0
+       0       0       0       0       0    -143     -95     902    1710     902     -95    -143       0       0       0       0       0
+       0       0       0       0       0      64      43    -409    -774    -409      43      64       0       0       0       0       0
+       0       0       0       0       0      18      12    -114    -216    -114      12      18       0       0       0       0       0
+       0       0       0       0       0      -5      -3      28      54      28      -3      -5       0       0       0       0       0
+       0       0       0       0       0      -6      -4      43      81      43      -4      -6       0       0       0       0       0
+       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0
+       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0
+       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0
+       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0
+       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0
+       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0
+       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0
+       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0
+       0       0       0       0       0       3       2      -6     -24      54     -24      -6       2       3       0       0       0
+       0       0       0       0       0       1       1      -5     -16      36     -16      -5       1       1       0       0       0
+       0       0       0       0       0      -6      -4      19      65    -141      65      19      -4      -6       0       0       0
+       0       0       0       0       0     -24     -16      64     231    -511     231      64     -16     -24       0       0       0
+       0       0       0       0       0      54      36    -143    -511    1127    -511    -143      36      54       0       0       0
+       0       0       0       0       0     -24     -16      64     231    -511     231      64     -16     -24       0       0       0
+       0       0       0       0       0      -6      -4      19      65    -141      65      19      -4      -6       0       0       0
+       0       0       0       0       0       1       1      -5     -16      36     -16      -5       1       1       0       0       0
+       0       0       0       0       0       3       2      -6     -24      54     -24      -6       2       3       0       0       0
+       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0
+       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0
+       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0       0
+static int const visual_weight[][4]={
+  {   17661,   10919,   10911,    6749,},
+  {       0,    5176,    5175,    3105,},
+  {       0,    2585,    2584,    1633,},
+};
+       0       0       0       0       0       0       0       0       1       1       1       1       1       1       1       1       1
+   52429   52429   52429   52429   52429   52429   52429   52429 -167772 -167772 -167772 -167772 -167772 -167772 -167772 -167772 -167772
+       0       0       0       0       0       0       0       0       1       1       1       1       1       1       1       1       1
+   52429   52429   52429   52429   52429   52429   52429   52429 -167772 -167772 -167772 -167772 -167772 -167772 -167772 -167772 -167772
+       0       0       0       0       0       0       0       0       1       1       1       1       1       1       1       1       1
+   52429   52429   52429   52429   52429   52429   52429   52429 -167772 -167772 -167772 -167772 -167772 -167772 -167772 -167772 -167772
+       0       0       0       0       0       0       0       0       1       1       1       1       1       1       1       1       1
+   52429   52429   52429   52429   52429   52429   52429   52429 -167772 -167772 -167772 -167772 -167772 -167772 -167772 -167772 -167772
+       0       0       0       0       0       0       0       0       1       1       1       1       1       1       1       1       1
+   52429   52429   52429   52429   52429   52429   52429   52429 -167772 -167772 -167772 -167772 -167772 -167772 -167772 -167772 -167772
+       0       0       0       0       0       0       0       0       1       1       1       1       1       1       1       1       1
+   52429   52429   52429   52429   52429   52429   52429   52429 -167772 -167772 -167772 -167772 -167772 -167772 -167772 -167772 -167772
+       0       0       0       0       0       0       0       0       1       1       1       1       1       1       1       1       1
+   52429   52429   52429   52429   52429   52429   52429   52429 -167772 -167772 -167772 -167772 -167772 -167772 -167772 -167772 -167772
+       0       0       0       0       0       0       0       0       1       1       1       1       1       1       1       1       1
+   52429   52429   52429   52429   52429   52429   52429   52429 -167772 -167772 -167772 -167772 -167772 -167772 -167772 -167772 -167772
+       0       0       0       0       0       0       0       0       1       1       1       1       1       1       1       1       1
-- 
2.17.1



More information about the ffmpeg-devel mailing list