Commit d9e556eb authored by Michael Niedermayer's avatar Michael Niedermayer

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: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 12bc33d7
...@@ -107,6 +107,9 @@ static void ff_prores_idct_wrap(int16_t *dst){ ...@@ -107,6 +107,9 @@ static void ff_prores_idct_wrap(int16_t *dst){
qmat[i]=4; qmat[i]=4;
} }
ff_prores_idct(dst, qmat); ff_prores_idct(dst, qmat);
for(i=0; i<64; i++) {
dst[i] -= 512;
}
} }
#if ARCH_X86_64 && HAVE_MMX && HAVE_YASM #if ARCH_X86_64 && HAVE_MMX && HAVE_YASM
void ff_prores_idct_put_10_sse2(uint16_t *dst, int linesize, void ff_prores_idct_put_10_sse2(uint16_t *dst, int linesize,
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#define CLIP_MIN (1 << (PRORES_BITS_PER_SAMPLE - 8)) ///< minimum value for clipping resulting pixels #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_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 #if CONFIG_PRORES_DECODER | CONFIG_PRORES_LGPL_DECODER
/** /**
......
...@@ -232,6 +232,8 @@ void ff_prores_idct(int16_t *block, const int16_t *qmat) ...@@ -232,6 +232,8 @@ void ff_prores_idct(int16_t *block, const int16_t *qmat)
for (i = 0; i < 8; i++) for (i = 0; i < 8; i++)
idctRowCondDC_10(block + i*8, 2); 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); idctSparseCol_10(block + i);
}
} }
#tb 0: 100/2997 #tb 0: 100/2997
0, 0, 0, 1, 8294400, 0xe8e9d448 0, 0, 0, 1, 8294400, 0x434ecf5c
0, 1, 1, 1, 8294400, 0xe8e9d448 0, 1, 1, 1, 8294400, 0x434ecf5c
#tb 0: 100/2997 #tb 0: 100/2997
0, 0, 0, 1, 8294400, 0x817063b0 0, 0, 0, 1, 8294400, 0xd28b6996
0, 1, 1, 1, 8294400, 0x817063b0 0, 1, 1, 1, 8294400, 0xd28b6996
#tb 0: 100/2997 #tb 0: 100/2997
0, 0, 0, 1, 8294400, 0xcd4ccde1 0, 0, 0, 1, 8294400, 0x38b30b72
0, 1, 1, 1, 8294400, 0xcd4ccde1 0, 1, 1, 1, 8294400, 0x38b30b72
#tb 0: 100/2997 #tb 0: 100/2997
0, 0, 0, 1, 8294400, 0x51d29320 0, 0, 0, 1, 8294400, 0xc1fa4263
0, 1, 1, 1, 8294400, 0x51d29320 0, 1, 1, 1, 8294400, 0xc1fa4263
#tb 0: 100/2997 #tb 0: 100/2997
0, 0, 0, 1, 16588800, 0x8dcdb600 0, 0, 0, 1, 16588800, 0x50d4b7ee
0, 1, 1, 1, 16588800, 0x8dcdb600 0, 1, 1, 1, 16588800, 0x50d4b7ee
#tb 0: 100/2997 #tb 0: 100/2997
0, 0, 0, 1, 12441600, 0x254d8f95 0, 0, 0, 1, 12441600, 0xd0299183
0, 1, 1, 1, 12441600, 0x254d8f95 0, 1, 1, 1, 12441600, 0xd0299183
#tb 0: 1/25 #tb 0: 1/25
#tb 1: 1/48000 #tb 1: 1/48000
0, 0, 0, 1, 16588800, 0x20778f5e 0, 0, 0, 1, 16588800, 0xb3cedec5
1, 0, 0, 1024, 4096, 0x00000000 1, 0, 0, 1024, 4096, 0x00000000
1, 1024, 1024, 896, 3584, 0x00000000 1, 1024, 1024, 896, 3584, 0x00000000
#tb 0: 1/25 #tb 0: 1/25
#tb 1: 1/48000 #tb 1: 1/48000
0, 0, 0, 1, 12441600, 0x58bff47d 0, 0, 0, 1, 12441600, 0x78aa43f3
1, 0, 0, 1024, 4096, 0x00000000 1, 0, 0, 1024, 4096, 0x00000000
1, 1024, 1024, 896, 3584, 0x00000000 1, 1024, 1024, 896, 3584, 0x00000000
176b9fa03cc0946c6a41f2dcfad46805 *tests/data/fate/vsynth1-prores.mov 176b9fa03cc0946c6a41f2dcfad46805 *tests/data/fate/vsynth1-prores.mov
5022821 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 stddev: 2.47 PSNR: 40.27 MAXDIFF: 31 bytes: 7603200/ 7603200
1d5522ee2fb507a66d236a09a172dc16 *tests/data/fate/vsynth1-prores_ks.mov 1d5522ee2fb507a66d236a09a172dc16 *tests/data/fate/vsynth1-prores_ks.mov
3858911 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 stddev: 3.17 PSNR: 38.09 MAXDIFF: 39 bytes: 7603200/ 7603200
af885572d77d28e5ede27932bd68cdde *tests/data/fate/vsynth2-prores.mov af885572d77d28e5ede27932bd68cdde *tests/data/fate/vsynth2-prores.mov
2844076 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 stddev: 1.31 PSNR: 45.77 MAXDIFF: 11 bytes: 7603200/ 7603200
c1c71cf2dbd6e332aacb6ab1c6affa59 *tests/data/fate/vsynth2-prores_ks.mov c1c71cf2dbd6e332aacb6ab1c6affa59 *tests/data/fate/vsynth2-prores_ks.mov
3884596 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 stddev: 0.92 PSNR: 48.77 MAXDIFF: 10 bytes: 7603200/ 7603200
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment