diff options
author | Christophe Gisquet <christophe.gisquet@gmail.com> | 2015-10-13 21:21:39 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2015-10-13 22:52:33 +0200 |
commit | 74c414202f0eda01571dc362a4b4cb342dc1fb64 (patch) | |
tree | e052422f8ec2eb345e4cb76b5430435685fda492 | |
parent | 147b12162da60da1ebfe38f626e9f82b2102f26b (diff) | |
download | ffmpeg-74c414202f0eda01571dc362a4b4cb342dc1fb64.tar.gz |
x86: simple_idct10_template: use const
This avoid going through constants.c while still sharing them
with proresdsp.asm
Reviewed-by: "Ronald S. Bultje" <rsbultje@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/x86/constants.c | 28 | ||||
-rw-r--r-- | libavcodec/x86/constants.h | 16 | ||||
-rw-r--r-- | libavcodec/x86/proresdsp.asm | 13 | ||||
-rw-r--r-- | libavcodec/x86/simple_idct10.asm | 26 | ||||
-rw-r--r-- | libavcodec/x86/simple_idct10_template.asm | 13 |
5 files changed, 39 insertions, 57 deletions
diff --git a/libavcodec/x86/constants.c b/libavcodec/x86/constants.c index 7e3d490ec1..0098e20544 100644 --- a/libavcodec/x86/constants.c +++ b/libavcodec/x86/constants.c @@ -89,31 +89,3 @@ DECLARE_ALIGNED(32, const ymm_reg, ff_pd_8192) = { 0x0000200000002000ULL, 0x000 0x0000200000002000ULL, 0x0000200000002000ULL }; DECLARE_ALIGNED(32, const ymm_reg, ff_pd_65535)= { 0x0000ffff0000ffffULL, 0x0000ffff0000ffffULL, 0x0000ffff0000ffffULL, 0x0000ffff0000ffffULL }; - -/* simple idct 10 */ -#define W1sh2 22725 // W1 = 90901 = 22725<<2 + 1 -#define W2sh2 21407 // W2 = 85627 = 21407<<2 - 1 -#define W3sh2 19265 // W3 = 77062 = 19265<<2 + 2 -#define W4sh2 16384 // W4 = 65535 = 16384<<2 - 1 -#define W5sh2 12873 // W5 = 51491 = 12873<<2 - 1 -#define W6sh2 8867 // W6 = 35468 = 8867<<2 -#define W7sh2 4520 // W7 = 18081 = 4520<<2 + 1 - -#define TIMES4(a, b) \ - (((b)&0xFFFFLL)<<48)+(((a)&0xFFFFLL)<<32)+(((b)&0xFFFFLL)<<16)+((a)&0xFFFFLL), \ - (((b)&0xFFFFLL)<<48)+(((a)&0xFFFFLL)<<32)+(((b)&0xFFFFLL)<<16)+((a)&0xFFFFLL) - -#if ARCH_X86_64 -DECLARE_ALIGNED(16, const xmm_reg, ff_w4_plus_w2) = { TIMES4(W4sh2, W2sh2) }; -DECLARE_ALIGNED(16, const xmm_reg, ff_w4_min_w2) = { TIMES4(W4sh2, -W2sh2) }; -DECLARE_ALIGNED(16, const xmm_reg, ff_w4_plus_w6) = { TIMES4(W4sh2, +W6sh2) }; -DECLARE_ALIGNED(16, const xmm_reg, ff_w4_min_w6) = { TIMES4(W4sh2, -W6sh2) }; -DECLARE_ALIGNED(16, const xmm_reg, ff_w1_plus_w3) = { TIMES4(W1sh2, +W3sh2) }; -DECLARE_ALIGNED(16, const xmm_reg, ff_w3_min_w1) = { TIMES4(W3sh2, -W1sh2) }; -DECLARE_ALIGNED(16, const xmm_reg, ff_w7_plus_w3) = { TIMES4(W7sh2, +W3sh2) }; -DECLARE_ALIGNED(16, const xmm_reg, ff_w3_min_w7) = { TIMES4(W3sh2, -W7sh2) }; -DECLARE_ALIGNED(16, const xmm_reg, ff_w1_plus_w5) = { TIMES4(W1sh2, +W5sh2) }; -DECLARE_ALIGNED(16, const xmm_reg, ff_w5_min_w1) = { TIMES4(W5sh2, -W1sh2) }; -DECLARE_ALIGNED(16, const xmm_reg, ff_w5_plus_w7) = { TIMES4(W5sh2, +W7sh2) }; -DECLARE_ALIGNED(16, const xmm_reg, ff_w7_min_w5) = { TIMES4(W7sh2, -W5sh2) }; -#endif diff --git a/libavcodec/x86/constants.h b/libavcodec/x86/constants.h index 496933fa86..f989755ba9 100644 --- a/libavcodec/x86/constants.h +++ b/libavcodec/x86/constants.h @@ -68,20 +68,4 @@ extern const ymm_reg ff_pd_32; extern const ymm_reg ff_pd_8192; extern const ymm_reg ff_pd_65535; -# if ARCH_X86_64 -/* simple_idct10, used by prores and dnxhd */ -extern const xmm_reg ff_w4_plus_w2; -extern const xmm_reg ff_w4_min_w2; -extern const xmm_reg ff_w4_plus_w6; -extern const xmm_reg ff_w4_min_w6; -extern const xmm_reg ff_w1_plus_w3; -extern const xmm_reg ff_w3_min_w1; -extern const xmm_reg ff_w7_plus_w3; -extern const xmm_reg ff_w3_min_w7; -extern const xmm_reg ff_w1_plus_w5; -extern const xmm_reg ff_w5_min_w1; -extern const xmm_reg ff_w5_plus_w7; -extern const xmm_reg ff_w7_min_w5; -# endif - #endif /* AVCODEC_X86_CONSTANTS_H */ diff --git a/libavcodec/x86/proresdsp.asm b/libavcodec/x86/proresdsp.asm index 463384476b..edfd2f7c02 100644 --- a/libavcodec/x86/proresdsp.asm +++ b/libavcodec/x86/proresdsp.asm @@ -32,6 +32,19 @@ pw_88: times 8 dw 0x2008 cextern pw_1 cextern pw_4 cextern pw_1019 +; Below are defined in simple_idct10.asm built from selecting idctdsp +cextern w4_plus_w2 +cextern w4_min_w2 +cextern w4_plus_w6 +cextern w4_min_w6 +cextern w1_plus_w3 +cextern w3_min_w1 +cextern w7_plus_w3 +cextern w3_min_w7 +cextern w1_plus_w5 +cextern w5_min_w1 +cextern w5_plus_w7 +cextern w7_min_w5 %include "libavcodec/x86/simple_idct10_template.asm" diff --git a/libavcodec/x86/simple_idct10.asm b/libavcodec/x86/simple_idct10.asm index ec388f99ed..cd83d61b44 100644 --- a/libavcodec/x86/simple_idct10.asm +++ b/libavcodec/x86/simple_idct10.asm @@ -37,6 +37,32 @@ pd_round_12: times 4 dd 1<<(12-1) pd_round_15: times 4 dd 1<<(15-1) pd_round_19: times 4 dd 1<<(19-1) +%macro CONST_DEC 3 +const %1 +times 4 dw %2, %3 +%endmacro + +%define W1sh2 22725 ; W1 = 90901 = 22725<<2 + 1 +%define W2sh2 21407 ; W2 = 85627 = 21407<<2 - 1 +%define W3sh2 19265 ; W3 = 77062 = 19265<<2 + 2 +%define W4sh2 16384 ; W4 = 65535 = 16384<<2 - 1 +%define W5sh2 12873 ; W5 = 51491 = 12873<<2 - 1 +%define W6sh2 8867 ; W6 = 35468 = 8867<<2 +%define W7sh2 4520 ; W7 = 18081 = 4520<<2 + 1 + +CONST_DEC w4_plus_w2, W4sh2, +W2sh2 +CONST_DEC w4_min_w2, W4sh2, -W2sh2 +CONST_DEC w4_plus_w6, W4sh2, +W6sh2 +CONST_DEC w4_min_w6, W4sh2, -W6sh2 +CONST_DEC w1_plus_w3, W1sh2, +W3sh2 +CONST_DEC w3_min_w1, W3sh2, -W1sh2 +CONST_DEC w7_plus_w3, W7sh2, +W3sh2 +CONST_DEC w3_min_w7, W3sh2, -W7sh2 +CONST_DEC w1_plus_w5, W1sh2, +W5sh2 +CONST_DEC w5_min_w1, W5sh2, -W1sh2 +CONST_DEC w5_plus_w7, W5sh2, +W7sh2 +CONST_DEC w7_min_w5, W7sh2, -W5sh2 + %include "libavcodec/x86/simple_idct10_template.asm" section .text align=16 diff --git a/libavcodec/x86/simple_idct10_template.asm b/libavcodec/x86/simple_idct10_template.asm index 7300c8a4dc..e5deb0f2e2 100644 --- a/libavcodec/x86/simple_idct10_template.asm +++ b/libavcodec/x86/simple_idct10_template.asm @@ -26,19 +26,6 @@ %if ARCH_X86_64 -cextern w4_plus_w2 -cextern w4_min_w2 -cextern w4_plus_w6 -cextern w4_min_w6 -cextern w1_plus_w3 -cextern w3_min_w1 -cextern w7_plus_w3 -cextern w3_min_w7 -cextern w1_plus_w5 -cextern w5_min_w1 -cextern w5_plus_w7 -cextern w7_min_w5 - ; interleave data while maintaining source ; %1=type, %2=dstlo, %3=dsthi, %4=src, %5=interleave %macro SBUTTERFLY3 5 |