summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Gisquet <christophe.gisquet@gmail.com>2014-08-06 07:43:40 +0000
committerMichael Niedermayer <michaelni@gmx.at>2014-08-06 19:24:49 +0200
commit71db2d08b1f1eeda3b47564662365a7886ca5d3e (patch)
tree7cae5424d2e38b06d06745ffa1e39bd924ac4ae4
parent4e128ab0b1b32d2e0a1a8350e224b8d6cc534f93 (diff)
x86: better share ff_pw_2
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/x86/constants.c2
-rw-r--r--libavcodec/x86/constants.h3
-rw-r--r--libavcodec/x86/dwt_yasm.asm3
-rw-r--r--libavcodec/x86/inline_asm.h2
4 files changed, 4 insertions, 6 deletions
diff --git a/libavcodec/x86/constants.c b/libavcodec/x86/constants.c
index ee3f1a5e2a..bfb0ff3036 100644
--- a/libavcodec/x86/constants.c
+++ b/libavcodec/x86/constants.c
@@ -22,8 +22,6 @@
#include "libavutil/x86/asm.h" // for xmm_reg
#include "constants.h"
-DECLARE_ALIGNED(8, const uint64_t, ff_wtwo) = 0x0002000200020002ULL;
-
DECLARE_ALIGNED(16, const xmm_reg, ff_pw_1) = { 0x0001000100010001ULL, 0x0001000100010001ULL };
DECLARE_ALIGNED(16, const xmm_reg, ff_pw_2) = { 0x0002000200020002ULL, 0x0002000200020002ULL };
DECLARE_ALIGNED(16, const xmm_reg, ff_pw_3) = { 0x0003000300030003ULL, 0x0003000300030003ULL };
diff --git a/libavcodec/x86/constants.h b/libavcodec/x86/constants.h
index 4520515c9c..c85a54e773 100644
--- a/libavcodec/x86/constants.h
+++ b/libavcodec/x86/constants.h
@@ -25,8 +25,7 @@
#include "libavutil/x86/asm.h"
-extern const uint64_t ff_wtwo;
-
+extern const xmm_reg ff_pw_2;
extern const xmm_reg ff_pw_3;
extern const xmm_reg ff_pw_4;
extern const xmm_reg ff_pw_5;
diff --git a/libavcodec/x86/dwt_yasm.asm b/libavcodec/x86/dwt_yasm.asm
index 5253abc6c8..1d8e793e70 100644
--- a/libavcodec/x86/dwt_yasm.asm
+++ b/libavcodec/x86/dwt_yasm.asm
@@ -23,11 +23,12 @@
SECTION_RODATA
pw_1: times 8 dw 1
-pw_2: times 8 dw 2
pw_8: times 8 dw 8
pw_16: times 8 dw 16
pw_1991: times 4 dw 9,-1
+cextern pw_2
+
section .text
; %1 -= (%2 + %3 + 2)>>2 %4 is pw_2
diff --git a/libavcodec/x86/inline_asm.h b/libavcodec/x86/inline_asm.h
index c2f1bf0f9c..3e65a76973 100644
--- a/libavcodec/x86/inline_asm.h
+++ b/libavcodec/x86/inline_asm.h
@@ -37,7 +37,7 @@
"paddb %%"#regd", %%"#regd" \n\t" ::)
#ifndef PIC
-#define MOVQ_WTWO(regd) __asm__ volatile ("movq %0, %%"#regd" \n\t" :: "m"(ff_wtwo))
+#define MOVQ_WTWO(regd) __asm__ volatile ("movq %0, %%"#regd" \n\t" :: "m"(ff_pw_2))
#else
// for shared library it's better to use this way for accessing constants
// pcmpeqd -> -1