summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-01-12 01:23:50 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-01-14 15:58:57 +0100
commitd9e556ebd04c755b61b7d56c796ec21bf8928adf (patch)
tree8bc1983e947f45a5949ad9cddc401059cd8126b7
parent12bc33d7cd04d863466d4a2d18a7fbcb59372429 (diff)
avcodec/proresdsp & idct: move biasing from after the IDCT into the IDCT
This replaces 64 additions by 8 additions MSE Changes from 0.04873672 to 0.05012422 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/dct-test.c3
-rw-r--r--libavcodec/proresdsp.c2
-rw-r--r--libavcodec/simple_idct.c4
-rw-r--r--tests/ref/fate/prores-4224
-rw-r--r--tests/ref/fate/prores-422_hq4
-rw-r--r--tests/ref/fate/prores-422_lt4
-rw-r--r--tests/ref/fate/prores-422_proxy4
-rw-r--r--tests/ref/fate/prores-alpha4
-rw-r--r--tests/ref/fate/prores-alpha_skip4
-rw-r--r--tests/ref/fate/prores-transparency2
-rw-r--r--tests/ref/fate/prores-transparency_skip2
-rw-r--r--tests/ref/vsynth/vsynth1-prores2
-rw-r--r--tests/ref/vsynth/vsynth1-prores_ks2
-rw-r--r--tests/ref/vsynth/vsynth2-prores2
-rw-r--r--tests/ref/vsynth/vsynth2-prores_ks2
15 files changed, 25 insertions, 20 deletions
diff --git a/libavcodec/dct-test.c b/libavcodec/dct-test.c
index bc1af8e19a..35f63a161d 100644
--- a/libavcodec/dct-test.c
+++ b/libavcodec/dct-test.c
@@ -107,6 +107,9 @@ static void ff_prores_idct_wrap(int16_t *dst){
qmat[i]=4;
}
ff_prores_idct(dst, qmat);
+ for(i=0; i<64; i++) {
+ dst[i] -= 512;
+ }
}
#if ARCH_X86_64 && HAVE_MMX && HAVE_YASM
void ff_prores_idct_put_10_sse2(uint16_t *dst, int linesize,
diff --git a/libavcodec/proresdsp.c b/libavcodec/proresdsp.c
index 4ff219e58b..c3d1f5c745 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 73f62b4021..eeb627999c 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 acd09e3da6..679ba5a7c5 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 a404ef4d3f..fc313a7764 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 09e2408cd1..385134d9cb 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 d716f87c2b..d275309751 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 9a8b9eefab..f2333e4e91 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 bdb5c6ee70..7fb03644d2 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 9c71d33e76..3d851f0d8c 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 a2921a4e41..a12c1a542b 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 bc1d8834db..e96682f184 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 76d9d30517..458b555e0a 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 99f56de419..eec960cf49 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 9d05832fa2..e7a0a2f36e 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