From a52a74e0fd759ccef0a0642984ca73bb43427ddf Mon Sep 17 00:00:00 2001
From: Stanislav Dolganov <dolganov@qst.hk>
Date: Fri, 25 Mar 2016 21:21:45 +0300
Subject: [PATCH 2/4] more tests and residual formula

---
 libavcodec/ffv1dec.c                           | 10 ++++++---
 libavcodec/ffv1enc.c                           | 10 ++++++---
 tests/ref/seek/vsynth_lena-ffv1                | 28 +++++++++++++-------------
 tests/ref/vsynth/vsynth1-ffv1                  |  4 ++--
 tests/ref/vsynth/vsynth1-ffv1-v0               |  4 ++--
 tests/ref/vsynth/vsynth1-ffv1-v3-bgr0          |  4 ++--
 tests/ref/vsynth/vsynth1-ffv1-v3-yuv420p       |  4 ++--
 tests/ref/vsynth/vsynth1-ffv1-v3-yuv422p10     |  4 ++--
 tests/ref/vsynth/vsynth1-ffv1-v3-yuv444p16     |  4 ++--
 tests/ref/vsynth/vsynth2-ffv1                  |  4 ++--
 tests/ref/vsynth/vsynth2-ffv1-v0               |  4 ++--
 tests/ref/vsynth/vsynth2-ffv1-v3-bgr0          |  4 ++--
 tests/ref/vsynth/vsynth2-ffv1-v3-yuv420p       |  4 ++--
 tests/ref/vsynth/vsynth2-ffv1-v3-yuv422p10     |  4 ++--
 tests/ref/vsynth/vsynth2-ffv1-v3-yuv444p16     |  4 ++--
 tests/ref/vsynth/vsynth3-ffv1                  |  4 ++--
 tests/ref/vsynth/vsynth3-ffv1-v0               |  4 ++--
 tests/ref/vsynth/vsynth3-ffv1-v3-bgr0          |  4 ++--
 tests/ref/vsynth/vsynth3-ffv1-v3-yuv420p       |  4 ++--
 tests/ref/vsynth/vsynth3-ffv1-v3-yuv422p10     |  4 ++--
 tests/ref/vsynth/vsynth3-ffv1-v3-yuv444p16     |  4 ++--
 tests/ref/vsynth/vsynth_lena-ffv1              |  4 ++--
 tests/ref/vsynth/vsynth_lena-ffv1-v0           |  4 ++--
 tests/ref/vsynth/vsynth_lena-ffv1-v3-bgr0      |  4 ++--
 tests/ref/vsynth/vsynth_lena-ffv1-v3-yuv420p   |  4 ++--
 tests/ref/vsynth/vsynth_lena-ffv1-v3-yuv422p10 |  4 ++--
 tests/ref/vsynth/vsynth_lena-ffv1-v3-yuv444p16 |  4 ++--
 27 files changed, 76 insertions(+), 68 deletions(-)

diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c
index 32e8d9b..5b923f0 100644
--- a/libavcodec/ffv1dec.c
+++ b/libavcodec/ffv1dec.c
@@ -71,6 +71,9 @@ static int ff_predict_frame(AVCodecContext *c, FFV1Context *f)
         const int w1 = (i == 1 || i == 2) ? cw : width;
         const int h1 = (i == 1 || i == 2) ? ch : height;
 
+        const int depth = desc->comp[i].depth;
+        const int max_val = 1 << depth;
+
         for (y = 0; y < h1; y++) {
             memset(f->p_image_line_buf, 0, width * sizeof(*f->p_image_line_buf));
             memset(f->c_image_line_buf, 0, width * sizeof(*f->c_image_line_buf));
@@ -85,19 +88,20 @@ static int ff_predict_frame(AVCodecContext *c, FFV1Context *f)
                               desc,
                               0, y, i, w1, 0);
             for (x = 0; x < w1; ++x)
-                f->c_image_line_buf[x] ^= f->p_image_line_buf[x];
+                //f->c_image_line_buf[x] ^= f->p_image_line_buf[x];
+                f->c_image_line_buf[x] = (f->c_image_line_buf[x] + f->p_image_line_buf[x] - (max_val >> 2)) & (max_val - 1);
             av_write_image_line(f->c_image_line_buf,
                                 residual->data,
                                 residual->linesize,
                                 desc,
                                 0, y, i, w1);
-            memset(f->p_image_line_buf, 0, width * sizeof(*f->p_image_line_buf));
+            /*memset(f->p_image_line_buf, 0, width * sizeof(*f->p_image_line_buf));
             av_read_image_line(f->p_image_line_buf,
                                (void *)residual->data,
                                residual->linesize,
                                desc,
                                0, y, i, w1, 0);
-            av_assert0(!memcmp(f->p_image_line_buf, f->c_image_line_buf, width * sizeof(*f->c_image_line_buf)));
+            av_assert0(!memcmp(f->p_image_line_buf, f->c_image_line_buf, width * sizeof(*f->c_image_line_buf)));*/
         }
     }
 
diff --git a/libavcodec/ffv1enc.c b/libavcodec/ffv1enc.c
index 6627234..1859c6e 100644
--- a/libavcodec/ffv1enc.c
+++ b/libavcodec/ffv1enc.c
@@ -169,6 +169,9 @@ static int ff_frame_diff(FFV1Context *f, const AVFrame *pict)
         const int w1 = (i == 1 || i == 2) ? cw : width;
         const int h1 = (i == 1 || i == 2) ? ch : height;
 
+        const int depth = desc->comp[i].depth;
+        const int max_val = 1 << depth;
+
         for (y = 0; y < h1; y++) {
             memset(f->p_image_line_buf, 0, width * sizeof(*f->p_image_line_buf));
             memset(f->c_image_line_buf, 0, width * sizeof(*f->c_image_line_buf));
@@ -183,19 +186,20 @@ static int ff_frame_diff(FFV1Context *f, const AVFrame *pict)
                               desc,
                               0, y, i, w1, 0);
             for (x = 0; x < w1; ++x)
-                f->c_image_line_buf[x] ^= f->p_image_line_buf[x];
+                //f->c_image_line_buf[x] ^= f->p_image_line_buf[x];
+                f->c_image_line_buf[x] = (f->c_image_line_buf[x] - f->p_image_line_buf[x] + (max_val >> 2)) & (max_val - 1);
             av_write_image_line(f->c_image_line_buf,
                                 residual->data,
                                 residual->linesize,
                                 desc,
                                 0, y, i, w1);
-            memset(f->p_image_line_buf, 0, width * sizeof(*f->p_image_line_buf));
+            /*memset(f->p_image_line_buf, 0, width * sizeof(*f->p_image_line_buf));
             av_read_image_line(f->p_image_line_buf,
                               (void *)residual->data,
                               residual->linesize,
                               desc,
                               0, y, i, w1, 0);
-            av_assert0(!memcmp(f->p_image_line_buf, f->c_image_line_buf, width * sizeof(*f->c_image_line_buf)));
+            av_assert0(!memcmp(f->p_image_line_buf, f->c_image_line_buf, width * sizeof(*f->c_image_line_buf)));*/
         }
     }
 
diff --git a/tests/ref/seek/vsynth_lena-ffv1 b/tests/ref/seek/vsynth_lena-ffv1
index 5758368..9adb125 100644
--- a/tests/ref/seek/vsynth_lena-ffv1
+++ b/tests/ref/seek/vsynth_lena-ffv1
@@ -2,45 +2,45 @@ ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5694 size: 71707
 ret: 0         st:-1 flags:0  ts:-1.000000
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5694 size: 71707
 ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:2499442 size: 75965
+ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:2711026 size: 75965
 ret: 0         st: 0 flags:0  ts: 0.800000
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:1631574 size: 72710
+ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:1772868 size: 72710
 ret:-1         st: 0 flags:1  ts:-0.320000
 ret:-1         st:-1 flags:0  ts: 2.576668
 ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:2499442 size: 75965
+ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:2711026 size: 75965
 ret: 0         st: 0 flags:0  ts: 0.360000
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 801638 size: 69485
+ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 873944 size: 69485
 ret:-1         st: 0 flags:1  ts:-0.760000
 ret:-1         st:-1 flags:0  ts: 2.153336
 ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:1631574 size: 72710
+ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:1772868 size: 72710
 ret: 0         st: 0 flags:0  ts:-0.040000
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5694 size: 71707
 ret: 0         st: 0 flags:1  ts: 2.840000
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos:3393894 size: 77489
+ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos:3678092 size: 77489
 ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos:3393894 size: 77489
+ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos:3678092 size: 77489
 ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 801638 size: 69485
+ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 873944 size: 69485
 ret: 0         st: 0 flags:0  ts:-0.480000
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5694 size: 71707
 ret: 0         st: 0 flags:1  ts: 2.400000
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos:3393894 size: 77489
+ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos:3678092 size: 77489
 ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:2499442 size: 75965
+ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:2711026 size: 75965
 ret: 0         st:-1 flags:1  ts: 0.200839
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5694 size: 71707
 ret: 0         st: 0 flags:0  ts:-0.920000
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:   5694 size: 71707
 ret: 0         st: 0 flags:1  ts: 2.000000
-ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos:3393894 size: 77489
+ret: 0         st: 0 flags:1 dts: 1.920000 pts: 1.920000 pos:3678092 size: 77489
 ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:1631574 size: 72710
+ret: 0         st: 0 flags:1 dts: 0.960000 pts: 0.960000 pos:1772868 size: 72710
 ret:-1         st:-1 flags:1  ts:-0.222493
 ret:-1         st: 0 flags:0  ts: 2.680000
 ret: 0         st: 0 flags:1  ts: 1.560000
-ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:2499442 size: 75965
+ret: 0         st: 0 flags:1 dts: 1.440000 pts: 1.440000 pos:2711026 size: 75965
 ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 801638 size: 69485
+ret: 0         st: 0 flags:1 dts: 0.480000 pts: 0.480000 pos: 873944 size: 69485
 ret:-1         st:-1 flags:1  ts:-0.645825
diff --git a/tests/ref/vsynth/vsynth1-ffv1 b/tests/ref/vsynth/vsynth1-ffv1
index 477462b..59ad803 100644
--- a/tests/ref/vsynth/vsynth1-ffv1
+++ b/tests/ref/vsynth/vsynth1-ffv1
@@ -1,4 +1,4 @@
-32caa587f6dc41f5f9c0fdf858b202d6 *tests/data/fate/vsynth1-ffv1.avi
-5877448 tests/data/fate/vsynth1-ffv1.avi
+04297f9a747548818ceed86edf356957 *tests/data/fate/vsynth1-ffv1.avi
+3288706 tests/data/fate/vsynth1-ffv1.avi
 c5ccac874dbf808e9088bc3107860042 *tests/data/fate/vsynth1-ffv1.out.rawvideo
 stddev:    0.00 PSNR:999.99 MAXDIFF:    0 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth1-ffv1-v0 b/tests/ref/vsynth/vsynth1-ffv1-v0
index 0a5c3bb..11a12b8 100644
--- a/tests/ref/vsynth/vsynth1-ffv1-v0
+++ b/tests/ref/vsynth/vsynth1-ffv1-v0
@@ -1,4 +1,4 @@
-db9cee61d80d114d4c20dc2999b65feb *tests/data/fate/vsynth1-ffv1-v0.avi
-5784902 tests/data/fate/vsynth1-ffv1-v0.avi
+c7f10cd1ac4ae381c9c71cf67a148135 *tests/data/fate/vsynth1-ffv1-v0.avi
+3193550 tests/data/fate/vsynth1-ffv1-v0.avi
 c5ccac874dbf808e9088bc3107860042 *tests/data/fate/vsynth1-ffv1-v0.out.rawvideo
 stddev:    0.00 PSNR:999.99 MAXDIFF:    0 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth1-ffv1-v3-bgr0 b/tests/ref/vsynth/vsynth1-ffv1-v3-bgr0
index f24001e..b826f07 100644
--- a/tests/ref/vsynth/vsynth1-ffv1-v3-bgr0
+++ b/tests/ref/vsynth/vsynth1-ffv1-v3-bgr0
@@ -1,4 +1,4 @@
-3becb49d5a46e53e27332095bb48c14c *tests/data/fate/vsynth1-ffv1-v3-bgr0.avi
-14332302 tests/data/fate/vsynth1-ffv1-v3-bgr0.avi
+a8e70c3cb0e1762d79886f837215d361 *tests/data/fate/vsynth1-ffv1-v3-bgr0.avi
+10007076 tests/data/fate/vsynth1-ffv1-v3-bgr0.avi
 49c03ab1b73b7cd3cabc3c77a9479c9e *tests/data/fate/vsynth1-ffv1-v3-bgr0.out.rawvideo
 stddev:    3.16 PSNR: 38.12 MAXDIFF:   50 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth1-ffv1-v3-yuv420p b/tests/ref/vsynth/vsynth1-ffv1-v3-yuv420p
index 6d7dbf3..0cfd8e0 100644
--- a/tests/ref/vsynth/vsynth1-ffv1-v3-yuv420p
+++ b/tests/ref/vsynth/vsynth1-ffv1-v3-yuv420p
@@ -1,4 +1,4 @@
-32caa587f6dc41f5f9c0fdf858b202d6 *tests/data/fate/vsynth1-ffv1-v3-yuv420p.avi
-5877448 tests/data/fate/vsynth1-ffv1-v3-yuv420p.avi
+04297f9a747548818ceed86edf356957 *tests/data/fate/vsynth1-ffv1-v3-yuv420p.avi
+3288706 tests/data/fate/vsynth1-ffv1-v3-yuv420p.avi
 c5ccac874dbf808e9088bc3107860042 *tests/data/fate/vsynth1-ffv1-v3-yuv420p.out.rawvideo
 stddev:    0.00 PSNR:999.99 MAXDIFF:    0 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth1-ffv1-v3-yuv422p10 b/tests/ref/vsynth/vsynth1-ffv1-v3-yuv422p10
index d76a70a..5ed1305 100644
--- a/tests/ref/vsynth/vsynth1-ffv1-v3-yuv422p10
+++ b/tests/ref/vsynth/vsynth1-ffv1-v3-yuv422p10
@@ -1,4 +1,4 @@
-ab7b36e05d2de2e00996414b3ad9f064 *tests/data/fate/vsynth1-ffv1-v3-yuv422p10.avi
-5726318 tests/data/fate/vsynth1-ffv1-v3-yuv422p10.avi
+82d46efc73ce5b67129a1027b611dc4d *tests/data/fate/vsynth1-ffv1-v3-yuv422p10.avi
+3328804 tests/data/fate/vsynth1-ffv1-v3-yuv422p10.avi
 c5ccac874dbf808e9088bc3107860042 *tests/data/fate/vsynth1-ffv1-v3-yuv422p10.out.rawvideo
 stddev:    0.00 PSNR:999.99 MAXDIFF:    0 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth1-ffv1-v3-yuv444p16 b/tests/ref/vsynth/vsynth1-ffv1-v3-yuv444p16
index 5e77750..7ff6b1c 100644
--- a/tests/ref/vsynth/vsynth1-ffv1-v3-yuv444p16
+++ b/tests/ref/vsynth/vsynth1-ffv1-v3-yuv444p16
@@ -1,4 +1,4 @@
-a15d66221e9949a851742144f483d332 *tests/data/fate/vsynth1-ffv1-v3-yuv444p16.avi
-7675980 tests/data/fate/vsynth1-ffv1-v3-yuv444p16.avi
+2904edb561150154dcd7ca9203b92f12 *tests/data/fate/vsynth1-ffv1-v3-yuv444p16.avi
+4857352 tests/data/fate/vsynth1-ffv1-v3-yuv444p16.avi
 c5ccac874dbf808e9088bc3107860042 *tests/data/fate/vsynth1-ffv1-v3-yuv444p16.out.rawvideo
 stddev:    0.00 PSNR:999.99 MAXDIFF:    0 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth2-ffv1 b/tests/ref/vsynth/vsynth2-ffv1
index 56a25e8..06c9378 100644
--- a/tests/ref/vsynth/vsynth2-ffv1
+++ b/tests/ref/vsynth/vsynth2-ffv1
@@ -1,4 +1,4 @@
-b694fcc3db64acf3e361f9b43b3a72ad *tests/data/fate/vsynth2-ffv1.avi
-5635324 tests/data/fate/vsynth2-ffv1.avi
+1ce71dca2eed0e0aea5e896646491d42 *tests/data/fate/vsynth2-ffv1.avi
+4034942 tests/data/fate/vsynth2-ffv1.avi
 36d7ca943916e1743cefa609eba0205c *tests/data/fate/vsynth2-ffv1.out.rawvideo
 stddev:    0.00 PSNR:999.99 MAXDIFF:    0 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth2-ffv1-v0 b/tests/ref/vsynth/vsynth2-ffv1-v0
index 42cdd11..8b101ab 100644
--- a/tests/ref/vsynth/vsynth2-ffv1-v0
+++ b/tests/ref/vsynth/vsynth2-ffv1-v0
@@ -1,4 +1,4 @@
-de2f14ea38bf8542bfb1408737a6f77f *tests/data/fate/vsynth2-ffv1-v0.avi
-5611322 tests/data/fate/vsynth2-ffv1-v0.avi
+040c5b0bcc42650f7569687ce8a112a7 *tests/data/fate/vsynth2-ffv1-v0.avi
+4018246 tests/data/fate/vsynth2-ffv1-v0.avi
 36d7ca943916e1743cefa609eba0205c *tests/data/fate/vsynth2-ffv1-v0.out.rawvideo
 stddev:    0.00 PSNR:999.99 MAXDIFF:    0 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth2-ffv1-v3-bgr0 b/tests/ref/vsynth/vsynth2-ffv1-v3-bgr0
index 735444b..e58ba7e 100644
--- a/tests/ref/vsynth/vsynth2-ffv1-v3-bgr0
+++ b/tests/ref/vsynth/vsynth2-ffv1-v3-bgr0
@@ -1,4 +1,4 @@
-5f7e1306350f98e2b4c8d09253b3fb54 *tests/data/fate/vsynth2-ffv1-v3-bgr0.avi
-12610264 tests/data/fate/vsynth2-ffv1-v3-bgr0.avi
+0327b6c6d80a65eb58bc85fbb5b6e0c1 *tests/data/fate/vsynth2-ffv1-v3-bgr0.avi
+8806728 tests/data/fate/vsynth2-ffv1-v3-bgr0.avi
 835a86f8dff88917c3e5f2776954c5b7 *tests/data/fate/vsynth2-ffv1-v3-bgr0.out.rawvideo
 stddev:    1.57 PSNR: 44.18 MAXDIFF:   20 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth2-ffv1-v3-yuv420p b/tests/ref/vsynth/vsynth2-ffv1-v3-yuv420p
index 73e5999..4688776 100644
--- a/tests/ref/vsynth/vsynth2-ffv1-v3-yuv420p
+++ b/tests/ref/vsynth/vsynth2-ffv1-v3-yuv420p
@@ -1,4 +1,4 @@
-b694fcc3db64acf3e361f9b43b3a72ad *tests/data/fate/vsynth2-ffv1-v3-yuv420p.avi
-5635324 tests/data/fate/vsynth2-ffv1-v3-yuv420p.avi
+1ce71dca2eed0e0aea5e896646491d42 *tests/data/fate/vsynth2-ffv1-v3-yuv420p.avi
+4034942 tests/data/fate/vsynth2-ffv1-v3-yuv420p.avi
 36d7ca943916e1743cefa609eba0205c *tests/data/fate/vsynth2-ffv1-v3-yuv420p.out.rawvideo
 stddev:    0.00 PSNR:999.99 MAXDIFF:    0 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth2-ffv1-v3-yuv422p10 b/tests/ref/vsynth/vsynth2-ffv1-v3-yuv422p10
index 2f3f9fb..cc9a3ca 100644
--- a/tests/ref/vsynth/vsynth2-ffv1-v3-yuv422p10
+++ b/tests/ref/vsynth/vsynth2-ffv1-v3-yuv422p10
@@ -1,4 +1,4 @@
-bf3c90b9bc53fd4ffd71f2cfd3772d5e *tests/data/fate/vsynth2-ffv1-v3-yuv422p10.avi
-5733518 tests/data/fate/vsynth2-ffv1-v3-yuv422p10.avi
+5cc38db4960939ff28ecbbd312b8f76a *tests/data/fate/vsynth2-ffv1-v3-yuv422p10.avi
+4432290 tests/data/fate/vsynth2-ffv1-v3-yuv422p10.avi
 36d7ca943916e1743cefa609eba0205c *tests/data/fate/vsynth2-ffv1-v3-yuv422p10.out.rawvideo
 stddev:    0.00 PSNR:999.99 MAXDIFF:    0 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth2-ffv1-v3-yuv444p16 b/tests/ref/vsynth/vsynth2-ffv1-v3-yuv444p16
index d4bf4ff..98578d3 100644
--- a/tests/ref/vsynth/vsynth2-ffv1-v3-yuv444p16
+++ b/tests/ref/vsynth/vsynth2-ffv1-v3-yuv444p16
@@ -1,4 +1,4 @@
-ffe94d29e2ac53d94b743f23c20682fc *tests/data/fate/vsynth2-ffv1-v3-yuv444p16.avi
-6877576 tests/data/fate/vsynth2-ffv1-v3-yuv444p16.avi
+b254e76353e46ce065c77fc64a06aef6 *tests/data/fate/vsynth2-ffv1-v3-yuv444p16.avi
+5398792 tests/data/fate/vsynth2-ffv1-v3-yuv444p16.avi
 36d7ca943916e1743cefa609eba0205c *tests/data/fate/vsynth2-ffv1-v3-yuv444p16.out.rawvideo
 stddev:    0.00 PSNR:999.99 MAXDIFF:    0 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth3-ffv1 b/tests/ref/vsynth/vsynth3-ffv1
index 6311cae..e7017ed 100644
--- a/tests/ref/vsynth/vsynth3-ffv1
+++ b/tests/ref/vsynth/vsynth3-ffv1
@@ -1,4 +1,4 @@
-3fc9afe788960bc7cda9c23a8bb97bc7 *tests/data/fate/vsynth3-ffv1.avi
-98168 tests/data/fate/vsynth3-ffv1.avi
+1b51e8ecdf67b9c3ed0797a4a1487008 *tests/data/fate/vsynth3-ffv1.avi
+74022 tests/data/fate/vsynth3-ffv1.avi
 a038ad7c3c09f776304ef7accdea9c74 *tests/data/fate/vsynth3-ffv1.out.rawvideo
 stddev:    0.00 PSNR:999.99 MAXDIFF:    0 bytes:    86700/    86700
diff --git a/tests/ref/vsynth/vsynth3-ffv1-v0 b/tests/ref/vsynth/vsynth3-ffv1-v0
index dff4db9..55d48bf 100644
--- a/tests/ref/vsynth/vsynth3-ffv1-v0
+++ b/tests/ref/vsynth/vsynth3-ffv1-v0
@@ -1,4 +1,4 @@
-e7449d7cbcd59a5526e530fe1e645c8c *tests/data/fate/vsynth3-ffv1-v0.avi
-85114 tests/data/fate/vsynth3-ffv1-v0.avi
+4284165468d39d637d5bb23d1f72ae80 *tests/data/fate/vsynth3-ffv1-v0.avi
+63212 tests/data/fate/vsynth3-ffv1-v0.avi
 a038ad7c3c09f776304ef7accdea9c74 *tests/data/fate/vsynth3-ffv1-v0.out.rawvideo
 stddev:    0.00 PSNR:999.99 MAXDIFF:    0 bytes:    86700/    86700
diff --git a/tests/ref/vsynth/vsynth3-ffv1-v3-bgr0 b/tests/ref/vsynth/vsynth3-ffv1-v3-bgr0
index e89efe8..2ed60d6 100644
--- a/tests/ref/vsynth/vsynth3-ffv1-v3-bgr0
+++ b/tests/ref/vsynth/vsynth3-ffv1-v3-bgr0
@@ -1,4 +1,4 @@
-e802f4a285cc1ce498151a5ad9888900 *tests/data/fate/vsynth3-ffv1-v3-bgr0.avi
-195832 tests/data/fate/vsynth3-ffv1-v3-bgr0.avi
+89b79a02ac63c13cfd9fbd4167281160 *tests/data/fate/vsynth3-ffv1-v3-bgr0.avi
+151412 tests/data/fate/vsynth3-ffv1-v3-bgr0.avi
 5d031d2e891b13593b8cd79e63d083b4 *tests/data/fate/vsynth3-ffv1-v3-bgr0.out.rawvideo
 stddev:    3.23 PSNR: 37.92 MAXDIFF:   50 bytes:    86700/    86700
diff --git a/tests/ref/vsynth/vsynth3-ffv1-v3-yuv420p b/tests/ref/vsynth/vsynth3-ffv1-v3-yuv420p
index 2964628..bb1eff2 100644
--- a/tests/ref/vsynth/vsynth3-ffv1-v3-yuv420p
+++ b/tests/ref/vsynth/vsynth3-ffv1-v3-yuv420p
@@ -1,4 +1,4 @@
-3fc9afe788960bc7cda9c23a8bb97bc7 *tests/data/fate/vsynth3-ffv1-v3-yuv420p.avi
-98168 tests/data/fate/vsynth3-ffv1-v3-yuv420p.avi
+1b51e8ecdf67b9c3ed0797a4a1487008 *tests/data/fate/vsynth3-ffv1-v3-yuv420p.avi
+74022 tests/data/fate/vsynth3-ffv1-v3-yuv420p.avi
 a038ad7c3c09f776304ef7accdea9c74 *tests/data/fate/vsynth3-ffv1-v3-yuv420p.out.rawvideo
 stddev:    0.00 PSNR:999.99 MAXDIFF:    0 bytes:    86700/    86700
diff --git a/tests/ref/vsynth/vsynth3-ffv1-v3-yuv422p10 b/tests/ref/vsynth/vsynth3-ffv1-v3-yuv422p10
index 4eb1cb8..0b201b9 100644
--- a/tests/ref/vsynth/vsynth3-ffv1-v3-yuv422p10
+++ b/tests/ref/vsynth/vsynth3-ffv1-v3-yuv422p10
@@ -1,4 +1,4 @@
-c30329d9efb8f3aedd51899df89830d0 *tests/data/fate/vsynth3-ffv1-v3-yuv422p10.avi
-107410 tests/data/fate/vsynth3-ffv1-v3-yuv422p10.avi
+470815903ae0205d6f78a4855f26ef1d *tests/data/fate/vsynth3-ffv1-v3-yuv422p10.avi
+74144 tests/data/fate/vsynth3-ffv1-v3-yuv422p10.avi
 a038ad7c3c09f776304ef7accdea9c74 *tests/data/fate/vsynth3-ffv1-v3-yuv422p10.out.rawvideo
 stddev:    0.00 PSNR:999.99 MAXDIFF:    0 bytes:    86700/    86700
diff --git a/tests/ref/vsynth/vsynth3-ffv1-v3-yuv444p16 b/tests/ref/vsynth/vsynth3-ffv1-v3-yuv444p16
index 0f320cb..6739be1 100644
--- a/tests/ref/vsynth/vsynth3-ffv1-v3-yuv444p16
+++ b/tests/ref/vsynth/vsynth3-ffv1-v3-yuv444p16
@@ -1,4 +1,4 @@
-4ac7c1149c41adadca2a91804c671c97 *tests/data/fate/vsynth3-ffv1-v3-yuv444p16.avi
-107964 tests/data/fate/vsynth3-ffv1-v3-yuv444p16.avi
+6124e301d0d0336816817cf10e368fce *tests/data/fate/vsynth3-ffv1-v3-yuv444p16.avi
+79972 tests/data/fate/vsynth3-ffv1-v3-yuv444p16.avi
 a038ad7c3c09f776304ef7accdea9c74 *tests/data/fate/vsynth3-ffv1-v3-yuv444p16.out.rawvideo
 stddev:    0.00 PSNR:999.99 MAXDIFF:    0 bytes:    86700/    86700
diff --git a/tests/ref/vsynth/vsynth_lena-ffv1 b/tests/ref/vsynth/vsynth_lena-ffv1
index 4060d8e..4da41e3 100644
--- a/tests/ref/vsynth/vsynth_lena-ffv1
+++ b/tests/ref/vsynth/vsynth_lena-ffv1
@@ -1,4 +1,4 @@
-ed72c22374718589ffacd7ea15424687 *tests/data/fate/vsynth_lena-ffv1.avi
-3547792 tests/data/fate/vsynth_lena-ffv1.avi
+355a386d41a9b97156f85f30d7fae138 *tests/data/fate/vsynth_lena-ffv1.avi
+3838964 tests/data/fate/vsynth_lena-ffv1.avi
 dde5895817ad9d219f79a52d0bdfb001 *tests/data/fate/vsynth_lena-ffv1.out.rawvideo
 stddev:    0.00 PSNR:999.99 MAXDIFF:    0 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth_lena-ffv1-v0 b/tests/ref/vsynth/vsynth_lena-ffv1-v0
index cbfb4af..8d24e04 100644
--- a/tests/ref/vsynth/vsynth_lena-ffv1-v0
+++ b/tests/ref/vsynth/vsynth_lena-ffv1-v0
@@ -1,4 +1,4 @@
-ad518c7014bdd6a72514a79a9102f64f *tests/data/fate/vsynth_lena-ffv1-v0.avi
-3525796 tests/data/fate/vsynth_lena-ffv1-v0.avi
+4cc1f6f680519578dcbf9b598af5b2ff *tests/data/fate/vsynth_lena-ffv1-v0.avi
+3820696 tests/data/fate/vsynth_lena-ffv1-v0.avi
 dde5895817ad9d219f79a52d0bdfb001 *tests/data/fate/vsynth_lena-ffv1-v0.out.rawvideo
 stddev:    0.00 PSNR:999.99 MAXDIFF:    0 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth_lena-ffv1-v3-bgr0 b/tests/ref/vsynth/vsynth_lena-ffv1-v3-bgr0
index cfc98f6..6a9269d 100644
--- a/tests/ref/vsynth/vsynth_lena-ffv1-v3-bgr0
+++ b/tests/ref/vsynth/vsynth_lena-ffv1-v3-bgr0
@@ -1,4 +1,4 @@
-edf0987619d4d63f8b7e3022a8d0a724 *tests/data/fate/vsynth_lena-ffv1-v3-bgr0.avi
-6013028 tests/data/fate/vsynth_lena-ffv1-v3-bgr0.avi
+febf3325261fb0d66d624c29357acfdb *tests/data/fate/vsynth_lena-ffv1-v3-bgr0.avi
+7974894 tests/data/fate/vsynth_lena-ffv1-v3-bgr0.avi
 0a8b7ddfec03622e37c869c5b552f9fc *tests/data/fate/vsynth_lena-ffv1-v3-bgr0.out.rawvideo
 stddev:    1.24 PSNR: 46.26 MAXDIFF:   17 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth_lena-ffv1-v3-yuv420p b/tests/ref/vsynth/vsynth_lena-ffv1-v3-yuv420p
index 1cffcb6..d17e8ef 100644
--- a/tests/ref/vsynth/vsynth_lena-ffv1-v3-yuv420p
+++ b/tests/ref/vsynth/vsynth_lena-ffv1-v3-yuv420p
@@ -1,4 +1,4 @@
-ed72c22374718589ffacd7ea15424687 *tests/data/fate/vsynth_lena-ffv1-v3-yuv420p.avi
-3547792 tests/data/fate/vsynth_lena-ffv1-v3-yuv420p.avi
+355a386d41a9b97156f85f30d7fae138 *tests/data/fate/vsynth_lena-ffv1-v3-yuv420p.avi
+3838964 tests/data/fate/vsynth_lena-ffv1-v3-yuv420p.avi
 dde5895817ad9d219f79a52d0bdfb001 *tests/data/fate/vsynth_lena-ffv1-v3-yuv420p.out.rawvideo
 stddev:    0.00 PSNR:999.99 MAXDIFF:    0 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth_lena-ffv1-v3-yuv422p10 b/tests/ref/vsynth/vsynth_lena-ffv1-v3-yuv422p10
index ab1cd34..5ee62a9 100644
--- a/tests/ref/vsynth/vsynth_lena-ffv1-v3-yuv422p10
+++ b/tests/ref/vsynth/vsynth_lena-ffv1-v3-yuv422p10
@@ -1,4 +1,4 @@
-cd3f5b3d4544a30bd08a9a11945a8adc *tests/data/fate/vsynth_lena-ffv1-v3-yuv422p10.avi
-3910306 tests/data/fate/vsynth_lena-ffv1-v3-yuv422p10.avi
+68cf9416362532ee12fc129728c63e89 *tests/data/fate/vsynth_lena-ffv1-v3-yuv422p10.avi
+4233142 tests/data/fate/vsynth_lena-ffv1-v3-yuv422p10.avi
 dde5895817ad9d219f79a52d0bdfb001 *tests/data/fate/vsynth_lena-ffv1-v3-yuv422p10.out.rawvideo
 stddev:    0.00 PSNR:999.99 MAXDIFF:    0 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth_lena-ffv1-v3-yuv444p16 b/tests/ref/vsynth/vsynth_lena-ffv1-v3-yuv444p16
index 08f9f0e..3e12280 100644
--- a/tests/ref/vsynth/vsynth_lena-ffv1-v3-yuv444p16
+++ b/tests/ref/vsynth/vsynth_lena-ffv1-v3-yuv444p16
@@ -1,4 +1,4 @@
-e65ad01440ad756b1872b22d3cfa23d7 *tests/data/fate/vsynth_lena-ffv1-v3-yuv444p16.avi
-4871266 tests/data/fate/vsynth_lena-ffv1-v3-yuv444p16.avi
+69c52fad786025a8463a2042464d2ecd *tests/data/fate/vsynth_lena-ffv1-v3-yuv444p16.avi
+5105946 tests/data/fate/vsynth_lena-ffv1-v3-yuv444p16.avi
 dde5895817ad9d219f79a52d0bdfb001 *tests/data/fate/vsynth_lena-ffv1-v3-yuv444p16.out.rawvideo
 stddev:    0.00 PSNR:999.99 MAXDIFF:    0 bytes:  7603200/  7603200
-- 
2.6.4 (Apple Git-63)

