Commit 97cda6b9 authored by Luca Barbato's avatar Luca Barbato

Many steps to avutilized this mess: DECLARE_ALIGNED

Originally committed as revision 8184 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 5c159f40
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#include <avutil.h>
#ifdef CONFIG_DARWIN #ifdef CONFIG_DARWIN
#define AVV(x...) (x) #define AVV(x...) (x)
...@@ -67,7 +68,7 @@ static inline int vertClassify_altivec(uint8_t src[], int stride, PPContext *c) ...@@ -67,7 +68,7 @@ static inline int vertClassify_altivec(uint8_t src[], int stride, PPContext *c)
vector by assuming (stride % 16) == 0, unfortunately vector by assuming (stride % 16) == 0, unfortunately
this is not always true. this is not always true.
*/ */
short __attribute__ ((aligned(16))) data[8]; DECLARE_ALIGNED(16, short, data[8]);
int numEq; int numEq;
uint8_t *src2 = src; uint8_t *src2 = src;
vector signed short v_dcOffset; vector signed short v_dcOffset;
...@@ -206,7 +207,7 @@ static inline void doVertLowPass_altivec(uint8_t *src, int stride, PPContext *c) ...@@ -206,7 +207,7 @@ static inline void doVertLowPass_altivec(uint8_t *src, int stride, PPContext *c)
const vector signed int zero = vec_splat_s32(0); const vector signed int zero = vec_splat_s32(0);
const int properStride = (stride % 16); const int properStride = (stride % 16);
const int srcAlign = ((unsigned long)src2 % 16); const int srcAlign = ((unsigned long)src2 % 16);
short __attribute__ ((aligned(16))) qp[8]; DECLARE_ALIGNED(16, short, qp[8]);
qp[0] = c->QP; qp[0] = c->QP;
vector signed short vqp = vec_ld(0, qp); vector signed short vqp = vec_ld(0, qp);
vqp = vec_splat(vqp, 0); vqp = vec_splat(vqp, 0);
...@@ -392,7 +393,7 @@ static inline void doVertDefFilter_altivec(uint8_t src[], int stride, PPContext ...@@ -392,7 +393,7 @@ static inline void doVertDefFilter_altivec(uint8_t src[], int stride, PPContext
*/ */
uint8_t *src2 = src; uint8_t *src2 = src;
const vector signed int zero = vec_splat_s32(0); const vector signed int zero = vec_splat_s32(0);
short __attribute__ ((aligned(16))) qp[8]; DECLARE_ALIGNED(16, short, qp[8]);
qp[0] = 8*c->QP; qp[0] = 8*c->QP;
vector signed short vqp = vec_ld(0, qp); vector signed short vqp = vec_ld(0, qp);
vqp = vec_splat(vqp, 0); vqp = vec_splat(vqp, 0);
...@@ -515,7 +516,7 @@ static inline void dering_altivec(uint8_t src[], int stride, PPContext *c) { ...@@ -515,7 +516,7 @@ static inline void dering_altivec(uint8_t src[], int stride, PPContext *c) {
src & stride :-( src & stride :-(
*/ */
uint8_t *srcCopy = src; uint8_t *srcCopy = src;
uint8_t __attribute__((aligned(16))) dt[16]; DECLARE_ALIGNED(16, uint8_t, dt[16]);
const vector signed int zero = vec_splat_s32(0); const vector signed int zero = vec_splat_s32(0);
vector unsigned char v_dt; vector unsigned char v_dt;
dt[0] = deringThreshold; dt[0] = deringThreshold;
...@@ -579,7 +580,7 @@ static inline void dering_altivec(uint8_t src[], int stride, PPContext *c) { ...@@ -579,7 +580,7 @@ static inline void dering_altivec(uint8_t src[], int stride, PPContext *c) {
v_avg = vec_avg(v_min, v_max); v_avg = vec_avg(v_min, v_max);
} }
signed int __attribute__((aligned(16))) S[8]; DECLARE_ALIGNED(16, signed int, S[8]);
{ {
const vector unsigned short mask1 = (vector unsigned short) const vector unsigned short mask1 = (vector unsigned short)
AVV(0x0001, 0x0002, 0x0004, 0x0008, AVV(0x0001, 0x0002, 0x0004, 0x0008,
...@@ -675,7 +676,7 @@ static inline void dering_altivec(uint8_t src[], int stride, PPContext *c) { ...@@ -675,7 +676,7 @@ static inline void dering_altivec(uint8_t src[], int stride, PPContext *c) {
/* I'm not sure the following is actually faster /* I'm not sure the following is actually faster
than straight, unvectorized C code :-( */ than straight, unvectorized C code :-( */
int __attribute__((aligned(16))) tQP2[4]; DECLARE_ALIGNED(16, int, tQP2[4]);
tQP2[0]= c->QP/2 + 1; tQP2[0]= c->QP/2 + 1;
vector signed int vQP2 = vec_ld(0, tQP2); vector signed int vQP2 = vec_ld(0, tQP2);
vQP2 = vec_splat(vQP2, 0); vQP2 = vec_splat(vQP2, 0);
......
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