Mercurial > libavcodec.hg
comparison ppc/dsputil_altivec.c @ 2286:0f937b191cc3 libavcodec
Altivec test on AmigaOS4 patch by (Chip <szarlada at freemail dot hu>)
author | michael |
---|---|
date | Tue, 05 Oct 2004 18:36:15 +0000 |
parents | 4a0ec9031804 |
children | ef2149182f1c |
comparison
equal
deleted
inserted
replaced
2285:9891c6a212ca | 2286:0f937b191cc3 |
---|---|
25 #include "dsputil_altivec.h" | 25 #include "dsputil_altivec.h" |
26 | 26 |
27 #ifdef CONFIG_DARWIN | 27 #ifdef CONFIG_DARWIN |
28 #include <sys/sysctl.h> | 28 #include <sys/sysctl.h> |
29 #else /* CONFIG_DARWIN */ | 29 #else /* CONFIG_DARWIN */ |
30 #ifdef __AMIGAOS4__ | |
31 #include <exec/exec.h> | |
32 #include <interfaces/exec.h> | |
33 #include <proto/exec.h> | |
34 #else /* __AMIGAOS4__ */ | |
30 #include <signal.h> | 35 #include <signal.h> |
31 #include <setjmp.h> | 36 #include <setjmp.h> |
32 | 37 |
33 static sigjmp_buf jmpbuf; | 38 static sigjmp_buf jmpbuf; |
34 static volatile sig_atomic_t canjump = 0; | 39 static volatile sig_atomic_t canjump = 0; |
42 | 47 |
43 canjump = 0; | 48 canjump = 0; |
44 siglongjmp (jmpbuf, 1); | 49 siglongjmp (jmpbuf, 1); |
45 } | 50 } |
46 #endif /* CONFIG_DARWIN */ | 51 #endif /* CONFIG_DARWIN */ |
52 #endif /* __AMIGAOS4__ */ | |
47 | 53 |
48 int sad16_x2_altivec(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) | 54 int sad16_x2_altivec(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) |
49 { | 55 { |
50 int i; | 56 int i; |
51 int s __attribute__((aligned(16))); | 57 int s __attribute__((aligned(16))); |
1614 } | 1620 } |
1615 #endif //CONFIG_DARWIN | 1621 #endif //CONFIG_DARWIN |
1616 | 1622 |
1617 int has_altivec(void) | 1623 int has_altivec(void) |
1618 { | 1624 { |
1625 #ifdef __AMIGAOS4__ | |
1626 ULONG result = 0; | |
1627 extern struct ExecIFace *IExec; | |
1628 | |
1629 IExec->GetCPUInfoTags(GCIT_VectorUnit, &result, TAG_DONE); | |
1630 if (result == VECTORTYPE_ALTIVEC) return 1; | |
1631 return 0; | |
1632 #else /* __AMIGAOS4__ */ | |
1633 | |
1619 #ifdef CONFIG_DARWIN | 1634 #ifdef CONFIG_DARWIN |
1620 int sels[2] = {CTL_HW, HW_VECTORUNIT}; | 1635 int sels[2] = {CTL_HW, HW_VECTORUNIT}; |
1621 int has_vu = 0; | 1636 int has_vu = 0; |
1622 size_t len = sizeof(has_vu); | 1637 size_t len = sizeof(has_vu); |
1623 int err; | 1638 int err; |
1644 return 1; | 1659 return 1; |
1645 } | 1660 } |
1646 } | 1661 } |
1647 #endif /* CONFIG_DARWIN */ | 1662 #endif /* CONFIG_DARWIN */ |
1648 return 0; | 1663 return 0; |
1664 #endif /* __AMIGAOS4__ */ | |
1649 } | 1665 } |
1650 | 1666 |
1651 /* next one assumes that ((line_size % 8) == 0) */ | 1667 /* next one assumes that ((line_size % 8) == 0) */ |
1652 void avg_pixels8_xy2_altivec(uint8_t *block, const uint8_t *pixels, int line_size, int h) | 1668 void avg_pixels8_xy2_altivec(uint8_t *block, const uint8_t *pixels, int line_size, int h) |
1653 { | 1669 { |