aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-03-14 01:56:25 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-03-14 01:56:25 +0100
commit3141b04c7fd46ca09acbc4a7b4d89788df273dd7 (patch)
treeabcef65d35b4384b8a96bfed45c0c5552c802069
parent91a61c4c156dcc4d5a8ac579b6b5dd310deeaefe (diff)
parentda785231ea0b82b5c2526babbb2871c935b21a87 (diff)
downloadffmpeg-3141b04c7fd46ca09acbc4a7b4d89788df273dd7.tar.gz
Merge commit 'da785231ea0b82b5c2526babbb2871c935b21a87'
* commit 'da785231ea0b82b5c2526babbb2871c935b21a87': bfin: Refactor duplicated assembly-related macros Conflicts: libavcodec/bfin/hpel_pixels_bfin.S Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/bfin/fdct_bfin.S17
-rw-r--r--libavcodec/bfin/hpel_pixels_bfin.S3
-rw-r--r--libavcodec/bfin/idct_bfin.S13
-rw-r--r--libavcodec/bfin/pixels_bfin.S3
-rw-r--r--libavcodec/bfin/vp3_idct_bfin.S13
-rw-r--r--libavutil/bfin/asm.h (renamed from libavcodec/bfin/config_bfin.h)28
-rw-r--r--libswscale/bfin/internal_bfin.S18
7 files changed, 26 insertions, 69 deletions
diff --git a/libavcodec/bfin/fdct_bfin.S b/libavcodec/bfin/fdct_bfin.S
index 916957467c..1b839aafb2 100644
--- a/libavcodec/bfin/fdct_bfin.S
+++ b/libavcodec/bfin/fdct_bfin.S
@@ -127,21 +127,16 @@ root:/u/ffmpeg/bhead/libavcodec>
*/
-#include "config.h"
-#include "config_bfin.h"
-
-#if defined(__FDPIC__) && CONFIG_SRAM
-.section .l1.data.B,"aw",@progbits
-#else
-.data
-#endif
+#include "libavutil/bfin/asm.h"
+
+SECTION_L1_DATA_B
+
.align 4;
dct_coeff:
.short 0x5a82, 0x2d41, 0x187e, 0x3b21, 0x0c7c, 0x3ec5, 0x238e, 0x3537;
-#if defined(__FDPIC__) && CONFIG_SRAM
-.section .l1.data.A,"aw",@progbits
-#endif
+SECTION_L1_DATA_A
+
.align 4
vtmp: .space 128
diff --git a/libavcodec/bfin/hpel_pixels_bfin.S b/libavcodec/bfin/hpel_pixels_bfin.S
index 32607941dd..c6b9190a4e 100644
--- a/libavcodec/bfin/hpel_pixels_bfin.S
+++ b/libavcodec/bfin/hpel_pixels_bfin.S
@@ -18,7 +18,8 @@
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "config_bfin.h"
+
+#include "libavutil/bfin/asm.h"
/*
motion compensation
diff --git a/libavcodec/bfin/idct_bfin.S b/libavcodec/bfin/idct_bfin.S
index bd80447bde..0ae3f5ac37 100644
--- a/libavcodec/bfin/idct_bfin.S
+++ b/libavcodec/bfin/idct_bfin.S
@@ -55,14 +55,9 @@ IDCT BFINidct: 88.3 kdct/s
*/
-#include "config.h"
-#include "config_bfin.h"
+#include "libavutil/bfin/asm.h"
-#if defined(__FDPIC__) && CONFIG_SRAM
-.section .l1.data.B,"aw",@progbits
-#else
-.data
-#endif
+SECTION_L1_DATA_B
.align 4;
coefs:
@@ -77,9 +72,7 @@ coefs:
.short 0x18F9; //cos(7pi/16)
.short 0x7D8A; //cos(pi/16)
-#if defined(__FDPIC__) && CONFIG_SRAM
-.section .l1.data.A,"aw",@progbits
-#endif
+SECTION_L1_DATA_A
vtmp: .space 256
diff --git a/libavcodec/bfin/pixels_bfin.S b/libavcodec/bfin/pixels_bfin.S
index 2c84deb83f..25bdac2520 100644
--- a/libavcodec/bfin/pixels_bfin.S
+++ b/libavcodec/bfin/pixels_bfin.S
@@ -18,7 +18,8 @@
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "config_bfin.h"
+
+#include "libavutil/bfin/asm.h"
DEFUN(put_pixels_clamped,mL1,
(int16_t *block, uint8_t *dest, int line_size)):
diff --git a/libavcodec/bfin/vp3_idct_bfin.S b/libavcodec/bfin/vp3_idct_bfin.S
index 5d88801f95..216926c104 100644
--- a/libavcodec/bfin/vp3_idct_bfin.S
+++ b/libavcodec/bfin/vp3_idct_bfin.S
@@ -28,14 +28,9 @@ Registers Used : A0, A1, R0-R7, I0-I3, B0, B2, B3, M0-M2, L0-L3, P0-P5, LC0.
*/
-#include "config.h"
-#include "config_bfin.h"
+#include "libavutil/bfin/asm.h"
-#if defined(__FDPIC__) && CONFIG_SRAM
-.section .l1.data.B,"aw",@progbits
-#else
-.data
-#endif
+SECTION_L1_DATA_B
.align 4;
coefs:
@@ -50,9 +45,7 @@ coefs:
.short 0x18F9; //cos(7pi/16)
.short 0x7D8A; //cos(pi/16)
-#if defined(__FDPIC__) && CONFIG_SRAM
-.section .l1.data.A,"aw",@progbits
-#endif
+SECTION_L1_DATA_A
vtmp: .space 256
diff --git a/libavcodec/bfin/config_bfin.h b/libavutil/bfin/asm.h
index 682fc1d89d..703e65d9a8 100644
--- a/libavcodec/bfin/config_bfin.h
+++ b/libavutil/bfin/asm.h
@@ -18,32 +18,22 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-/*
- * low level assembler interface wrapper
- *
- * DEFUN(put_pixels_clamped,mL1,
- * (int16_t *block, uint8_t *dest, int line_size)):
- *
- * body
- *
- * rts;
- */
-
-#ifndef AVCODEC_BFIN_CONFIG_BFIN_H
-#define AVCODEC_BFIN_CONFIG_BFIN_H
+#ifndef AVUTIL_BFIN_ASM_H
+#define AVUTIL_BFIN_ASM_H
#include "config.h"
-#ifndef DEFUN
-
#define mL3 .text
-#ifndef mL1
+
#if defined(__FDPIC__) && CONFIG_SRAM
#define mL1 .l1.text
+#define SECTION_L1_DATA_A .section .l1.data.A,"aw",@progbits
+#define SECTION_L1_DATA_B .section .l1.data.B,"aw",@progbits
#else
#define mL1 mL3
+#define SECTION_L1_DATA_A
+#define SECTION_L1_DATA_B .data
#endif
-#endif /* mL1 */
#define DEFUN(fname, where, interface) \
.section where; \
@@ -61,6 +51,4 @@
#define RELOC(reg, got, obj) reg.L = obj; reg.H = obj
#endif
-#endif /* DEFUN */
-
-#endif /* AVCODEC_BFIN_CONFIG_BFIN_H */
+#endif /* AVUTIL_BFIN_ASM_H */
diff --git a/libswscale/bfin/internal_bfin.S b/libswscale/bfin/internal_bfin.S
index eab30aa6ce..5ea0f1f90e 100644
--- a/libswscale/bfin/internal_bfin.S
+++ b/libswscale/bfin/internal_bfin.S
@@ -93,23 +93,9 @@ huge variation on the reference codes on Blackfin I guess it must have
to do with the memory system.
*/
-#define mL3 .text
-#if defined(__FDPIC__) && CONFIG_SRAM
-#define mL1 .l1.text
-#else
-#define mL1 mL3
-#endif
-#define MEM mL1
-
-#define DEFUN(fname,where,interface) \
- .section where; \
- .global _ff_bfin_ ## fname; \
- .type _ff_bfin_ ## fname, STT_FUNC; \
- .align 8; \
- _ff_bfin_ ## fname
+#include "libavutil/bfin/asm.h"
-#define DEFUN_END(fname) \
- .size _ff_bfin_ ## fname, . - _ff_bfin_ ## fname
+#define MEM mL1
.text