[FFmpeg-devel] [PATCH 1/5] avcodec/proresdsp & idct: move biasing from after the IDCT into the IDCT

Michael Niedermayer michaelni at gmx.at
Sun Jan 12 03:12:37 CET 2014


This replaces 64 additions by 8 additions

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
---
 libavcodec/proresdsp.c                  |    2 +-
 libavcodec/simple_idct.c                |    4 +++-
 tests/ref/fate/prores-422               |    4 ++--
 tests/ref/fate/prores-422_hq            |    4 ++--
 tests/ref/fate/prores-422_lt            |    4 ++--
 tests/ref/fate/prores-422_proxy         |    4 ++--
 tests/ref/fate/prores-alpha             |    4 ++--
 tests/ref/fate/prores-alpha_skip        |    4 ++--
 tests/ref/fate/prores-transparency      |    2 +-
 tests/ref/fate/prores-transparency_skip |    2 +-
 tests/ref/vsynth/vsynth1-prores         |    2 +-
 tests/ref/vsynth/vsynth1-prores_ks      |    2 +-
 tests/ref/vsynth/vsynth2-prores         |    2 +-
 tests/ref/vsynth/vsynth2-prores_ks      |    2 +-
 14 files changed, 22 insertions(+), 20 deletions(-)

diff --git a/libavcodec/proresdsp.c b/libavcodec/proresdsp.c
index 4ff219e..c3d1f5c 100644
--- a/libavcodec/proresdsp.c
+++ b/libavcodec/proresdsp.c
@@ -31,7 +31,7 @@
 #define CLIP_MIN (1 << (PRORES_BITS_PER_SAMPLE - 8))           ///< minimum value for clipping resulting pixels
 #define CLIP_MAX (1 << PRORES_BITS_PER_SAMPLE) - CLIP_MIN - 1  ///< maximum value for clipping resulting pixels
 
-#define CLIP_AND_BIAS(x) (av_clip((x) + BIAS, CLIP_MIN, CLIP_MAX))
+#define CLIP_AND_BIAS(x) (av_clip((x), CLIP_MIN, CLIP_MAX))
 
 #if CONFIG_PRORES_DECODER | CONFIG_PRORES_LGPL_DECODER
 /**
diff --git a/libavcodec/simple_idct.c b/libavcodec/simple_idct.c
index 73f62b4..eeb6279 100644
--- a/libavcodec/simple_idct.c
+++ b/libavcodec/simple_idct.c
@@ -232,6 +232,8 @@ void ff_prores_idct(int16_t *block, const int16_t *qmat)
     for (i = 0; i < 8; i++)
         idctRowCondDC_10(block + i*8, 2);
 
-    for (i = 0; i < 8; i++)
+    for (i = 0; i < 8; i++) {
+        block[i] += 8192;
         idctSparseCol_10(block + i);
+    }
 }
diff --git a/tests/ref/fate/prores-422 b/tests/ref/fate/prores-422
index acd09e3..679ba5a 100644
--- a/tests/ref/fate/prores-422
+++ b/tests/ref/fate/prores-422
@@ -1,3 +1,3 @@
 #tb 0: 100/2997
-0,          0,          0,        1,  8294400, 0xe8e9d448
-0,          1,          1,        1,  8294400, 0xe8e9d448
+0,          0,          0,        1,  8294400, 0x434ecf5c
+0,          1,          1,        1,  8294400, 0x434ecf5c
diff --git a/tests/ref/fate/prores-422_hq b/tests/ref/fate/prores-422_hq
index a404ef4..fc313a7 100644
--- a/tests/ref/fate/prores-422_hq
+++ b/tests/ref/fate/prores-422_hq
@@ -1,3 +1,3 @@
 #tb 0: 100/2997
-0,          0,          0,        1,  8294400, 0x817063b0
-0,          1,          1,        1,  8294400, 0x817063b0
+0,          0,          0,        1,  8294400, 0xd28b6996
+0,          1,          1,        1,  8294400, 0xd28b6996
diff --git a/tests/ref/fate/prores-422_lt b/tests/ref/fate/prores-422_lt
index 09e2408..385134d 100644
--- a/tests/ref/fate/prores-422_lt
+++ b/tests/ref/fate/prores-422_lt
@@ -1,3 +1,3 @@
 #tb 0: 100/2997
-0,          0,          0,        1,  8294400, 0xcd4ccde1
-0,          1,          1,        1,  8294400, 0xcd4ccde1
+0,          0,          0,        1,  8294400, 0x38b30b72
+0,          1,          1,        1,  8294400, 0x38b30b72
diff --git a/tests/ref/fate/prores-422_proxy b/tests/ref/fate/prores-422_proxy
index d716f87..d275309 100644
--- a/tests/ref/fate/prores-422_proxy
+++ b/tests/ref/fate/prores-422_proxy
@@ -1,3 +1,3 @@
 #tb 0: 100/2997
-0,          0,          0,        1,  8294400, 0x51d29320
-0,          1,          1,        1,  8294400, 0x51d29320
+0,          0,          0,        1,  8294400, 0xc1fa4263
+0,          1,          1,        1,  8294400, 0xc1fa4263
diff --git a/tests/ref/fate/prores-alpha b/tests/ref/fate/prores-alpha
index 9a8b9ee..f2333e4 100644
--- a/tests/ref/fate/prores-alpha
+++ b/tests/ref/fate/prores-alpha
@@ -1,3 +1,3 @@
 #tb 0: 100/2997
-0,          0,          0,        1, 16588800, 0x8dcdb600
-0,          1,          1,        1, 16588800, 0x8dcdb600
+0,          0,          0,        1, 16588800, 0x50d4b7ee
+0,          1,          1,        1, 16588800, 0x50d4b7ee
diff --git a/tests/ref/fate/prores-alpha_skip b/tests/ref/fate/prores-alpha_skip
index bdb5c6e..7fb0364 100644
--- a/tests/ref/fate/prores-alpha_skip
+++ b/tests/ref/fate/prores-alpha_skip
@@ -1,3 +1,3 @@
 #tb 0: 100/2997
-0,          0,          0,        1, 12441600, 0x254d8f95
-0,          1,          1,        1, 12441600, 0x254d8f95
+0,          0,          0,        1, 12441600, 0xd0299183
+0,          1,          1,        1, 12441600, 0xd0299183
diff --git a/tests/ref/fate/prores-transparency b/tests/ref/fate/prores-transparency
index 9c71d33..3d851f0 100644
--- a/tests/ref/fate/prores-transparency
+++ b/tests/ref/fate/prores-transparency
@@ -1,5 +1,5 @@
 #tb 0: 1/25
 #tb 1: 1/48000
-0,          0,          0,        1, 16588800, 0x20778f5e
+0,          0,          0,        1, 16588800, 0xb3cedec5
 1,          0,          0,     1024,     4096, 0x00000000
 1,       1024,       1024,      896,     3584, 0x00000000
diff --git a/tests/ref/fate/prores-transparency_skip b/tests/ref/fate/prores-transparency_skip
index a2921a4..a12c1a5 100644
--- a/tests/ref/fate/prores-transparency_skip
+++ b/tests/ref/fate/prores-transparency_skip
@@ -1,5 +1,5 @@
 #tb 0: 1/25
 #tb 1: 1/48000
-0,          0,          0,        1, 12441600, 0x58bff47d
+0,          0,          0,        1, 12441600, 0x78aa43f3
 1,          0,          0,     1024,     4096, 0x00000000
 1,       1024,       1024,      896,     3584, 0x00000000
diff --git a/tests/ref/vsynth/vsynth1-prores b/tests/ref/vsynth/vsynth1-prores
index bc1d883..e96682f 100644
--- a/tests/ref/vsynth/vsynth1-prores
+++ b/tests/ref/vsynth/vsynth1-prores
@@ -1,4 +1,4 @@
 176b9fa03cc0946c6a41f2dcfad46805 *tests/data/fate/vsynth1-prores.mov
 5022821 tests/data/fate/vsynth1-prores.mov
-a2e2d1d45341a94ff994d1d92629f778 *tests/data/fate/vsynth1-prores.out.rawvideo
+14ab816f1cf83eb990abd02c9e118a8f *tests/data/fate/vsynth1-prores.out.rawvideo
 stddev:    2.47 PSNR: 40.27 MAXDIFF:   31 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth1-prores_ks b/tests/ref/vsynth/vsynth1-prores_ks
index 76d9d30..458b555 100644
--- a/tests/ref/vsynth/vsynth1-prores_ks
+++ b/tests/ref/vsynth/vsynth1-prores_ks
@@ -1,4 +1,4 @@
 1d5522ee2fb507a66d236a09a172dc16 *tests/data/fate/vsynth1-prores_ks.mov
 3858911 tests/data/fate/vsynth1-prores_ks.mov
-0a4153637d0cc0a88a8bcbf04cfaf8c6 *tests/data/fate/vsynth1-prores_ks.out.rawvideo
+54a6453c64e8b1f2d5298ae3dff78656 *tests/data/fate/vsynth1-prores_ks.out.rawvideo
 stddev:    3.17 PSNR: 38.09 MAXDIFF:   39 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth2-prores b/tests/ref/vsynth/vsynth2-prores
index 99f56de..eec960c 100644
--- a/tests/ref/vsynth/vsynth2-prores
+++ b/tests/ref/vsynth/vsynth2-prores
@@ -1,4 +1,4 @@
 af885572d77d28e5ede27932bd68cdde *tests/data/fate/vsynth2-prores.mov
 2844076 tests/data/fate/vsynth2-prores.mov
-b5844025c0f4c7c37db702c3213db232 *tests/data/fate/vsynth2-prores.out.rawvideo
+b959c6e8bc3061c9ef6ec09ce48d22a0 *tests/data/fate/vsynth2-prores.out.rawvideo
 stddev:    1.31 PSNR: 45.77 MAXDIFF:   11 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth2-prores_ks b/tests/ref/vsynth/vsynth2-prores_ks
index 9d05832..e7a0a2f 100644
--- a/tests/ref/vsynth/vsynth2-prores_ks
+++ b/tests/ref/vsynth/vsynth2-prores_ks
@@ -1,4 +1,4 @@
 c1c71cf2dbd6e332aacb6ab1c6affa59 *tests/data/fate/vsynth2-prores_ks.mov
 3884596 tests/data/fate/vsynth2-prores_ks.mov
-ca2f6c1162635dedfa468c90f1fdc0ef *tests/data/fate/vsynth2-prores_ks.out.rawvideo
+ab24f9350a0d615ec5ba864ab77817a8 *tests/data/fate/vsynth2-prores_ks.out.rawvideo
 stddev:    0.92 PSNR: 48.77 MAXDIFF:   10 bytes:  7603200/  7603200
-- 
1.7.9.5



More information about the ffmpeg-devel mailing list