summaryrefslogtreecommitdiff
path: root/src/libffmpeg/libavcodec/ppc/dsputil_h264_altivec.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libffmpeg/libavcodec/ppc/dsputil_h264_altivec.c')
-rwxr-xr-xsrc/libffmpeg/libavcodec/ppc/dsputil_h264_altivec.c86
1 files changed, 43 insertions, 43 deletions
diff --git a/src/libffmpeg/libavcodec/ppc/dsputil_h264_altivec.c b/src/libffmpeg/libavcodec/ppc/dsputil_h264_altivec.c
index 1891e194a..b9fef005e 100755
--- a/src/libffmpeg/libavcodec/ppc/dsputil_h264_altivec.c
+++ b/src/libffmpeg/libavcodec/ppc/dsputil_h264_altivec.c
@@ -13,9 +13,9 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
+
#include "../dsputil.h"
#include "gcc_fixes.h"
@@ -71,7 +71,7 @@ static void OPNAME ## h264_qpel ## SIZE ## _mc00_ ## CODETYPE (uint8_t *dst, uin
}\
\
static void OPNAME ## h264_qpel ## SIZE ## _mc10_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){ \
- uint64_t temp[SIZE*SIZE/8] __align16;\
+ DECLARE_ALIGNED_16(uint64_t, temp[SIZE*SIZE/8]);\
uint8_t * const half= (uint8_t*)temp;\
put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(half, src, SIZE, stride);\
OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, src, half, stride, stride, SIZE);\
@@ -82,14 +82,14 @@ static void OPNAME ## h264_qpel ## SIZE ## _mc20_ ## CODETYPE(uint8_t *dst, uint
}\
\
static void OPNAME ## h264_qpel ## SIZE ## _mc30_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
- uint64_t temp[SIZE*SIZE/8] __align16;\
+ DECLARE_ALIGNED_16(uint64_t, temp[SIZE*SIZE/8]);\
uint8_t * const half= (uint8_t*)temp;\
put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(half, src, SIZE, stride);\
OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, src+1, half, stride, stride, SIZE);\
}\
\
static void OPNAME ## h264_qpel ## SIZE ## _mc01_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
- uint64_t temp[SIZE*SIZE/8] __align16;\
+ DECLARE_ALIGNED_16(uint64_t, temp[SIZE*SIZE/8]);\
uint8_t * const half= (uint8_t*)temp;\
put_h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(half, src, SIZE, stride);\
OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, src, half, stride, stride, SIZE);\
@@ -100,14 +100,14 @@ static void OPNAME ## h264_qpel ## SIZE ## _mc02_ ## CODETYPE(uint8_t *dst, uint
}\
\
static void OPNAME ## h264_qpel ## SIZE ## _mc03_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
- uint64_t temp[SIZE*SIZE/8] __align16;\
+ DECLARE_ALIGNED_16(uint64_t, temp[SIZE*SIZE/8]);\
uint8_t * const half= (uint8_t*)temp;\
put_h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(half, src, SIZE, stride);\
OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, src+stride, half, stride, stride, SIZE);\
}\
\
static void OPNAME ## h264_qpel ## SIZE ## _mc11_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
- uint64_t temp[SIZE*SIZE/4] __align16;\
+ DECLARE_ALIGNED_16(uint64_t, temp[SIZE*SIZE/4]);\
uint8_t * const halfH= (uint8_t*)temp;\
uint8_t * const halfV= ((uint8_t*)temp) + SIZE*SIZE;\
put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(halfH, src, SIZE, stride);\
@@ -116,7 +116,7 @@ static void OPNAME ## h264_qpel ## SIZE ## _mc11_ ## CODETYPE(uint8_t *dst, uint
}\
\
static void OPNAME ## h264_qpel ## SIZE ## _mc31_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
- uint64_t temp[SIZE*SIZE/4] __align16;\
+ DECLARE_ALIGNED_16(uint64_t, temp[SIZE*SIZE/4]);\
uint8_t * const halfH= (uint8_t*)temp;\
uint8_t * const halfV= ((uint8_t*)temp) + SIZE*SIZE;\
put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(halfH, src, SIZE, stride);\
@@ -125,7 +125,7 @@ static void OPNAME ## h264_qpel ## SIZE ## _mc31_ ## CODETYPE(uint8_t *dst, uint
}\
\
static void OPNAME ## h264_qpel ## SIZE ## _mc13_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
- uint64_t temp[SIZE*SIZE/4] __align16;\
+ DECLARE_ALIGNED_16(uint64_t, temp[SIZE*SIZE/4]);\
uint8_t * const halfH= (uint8_t*)temp;\
uint8_t * const halfV= ((uint8_t*)temp) + SIZE*SIZE;\
put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(halfH, src + stride, SIZE, stride);\
@@ -134,7 +134,7 @@ static void OPNAME ## h264_qpel ## SIZE ## _mc13_ ## CODETYPE(uint8_t *dst, uint
}\
\
static void OPNAME ## h264_qpel ## SIZE ## _mc33_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
- uint64_t temp[SIZE*SIZE/4] __align16;\
+ DECLARE_ALIGNED_16(uint64_t, temp[SIZE*SIZE/4]);\
uint8_t * const halfH= (uint8_t*)temp;\
uint8_t * const halfV= ((uint8_t*)temp) + SIZE*SIZE;\
put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(halfH, src + stride, SIZE, stride);\
@@ -143,13 +143,13 @@ static void OPNAME ## h264_qpel ## SIZE ## _mc33_ ## CODETYPE(uint8_t *dst, uint
}\
\
static void OPNAME ## h264_qpel ## SIZE ## _mc22_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
- uint64_t temp[SIZE*(SIZE+8)/4] __align16;\
+ DECLARE_ALIGNED_16(uint64_t, temp[SIZE*(SIZE+8)/4]);\
int16_t * const tmp= (int16_t*)temp;\
OPNAME ## h264_qpel ## SIZE ## _hv_lowpass_ ## CODETYPE(dst, tmp, src, stride, SIZE, stride);\
}\
\
static void OPNAME ## h264_qpel ## SIZE ## _mc21_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
- uint64_t temp[SIZE*(SIZE+8)/4 + SIZE*SIZE/4] __align16;\
+ DECLARE_ALIGNED_16(uint64_t, temp[SIZE*(SIZE+8)/4 + SIZE*SIZE/4]);\
uint8_t * const halfH= (uint8_t*)temp;\
uint8_t * const halfHV= ((uint8_t*)temp) + SIZE*SIZE;\
int16_t * const tmp= ((int16_t*)temp) + SIZE*SIZE;\
@@ -159,7 +159,7 @@ static void OPNAME ## h264_qpel ## SIZE ## _mc21_ ## CODETYPE(uint8_t *dst, uint
}\
\
static void OPNAME ## h264_qpel ## SIZE ## _mc23_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
- uint64_t temp[SIZE*(SIZE+8)/4 + SIZE*SIZE/4] __align16;\
+ DECLARE_ALIGNED_16(uint64_t, temp[SIZE*(SIZE+8)/4 + SIZE*SIZE/4]);\
uint8_t * const halfH= (uint8_t*)temp;\
uint8_t * const halfHV= ((uint8_t*)temp) + SIZE*SIZE;\
int16_t * const tmp= ((int16_t*)temp) + SIZE*SIZE;\
@@ -169,7 +169,7 @@ static void OPNAME ## h264_qpel ## SIZE ## _mc23_ ## CODETYPE(uint8_t *dst, uint
}\
\
static void OPNAME ## h264_qpel ## SIZE ## _mc12_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
- uint64_t temp[SIZE*(SIZE+8)/4 + SIZE*SIZE/4] __align16;\
+ DECLARE_ALIGNED_16(uint64_t, temp[SIZE*(SIZE+8)/4 + SIZE*SIZE/4]);\
uint8_t * const halfV= (uint8_t*)temp;\
uint8_t * const halfHV= ((uint8_t*)temp) + SIZE*SIZE;\
int16_t * const tmp= ((int16_t*)temp) + SIZE*SIZE;\
@@ -179,7 +179,7 @@ static void OPNAME ## h264_qpel ## SIZE ## _mc12_ ## CODETYPE(uint8_t *dst, uint
}\
\
static void OPNAME ## h264_qpel ## SIZE ## _mc32_ ## CODETYPE(uint8_t *dst, uint8_t *src, int stride){\
- uint64_t temp[SIZE*(SIZE+8)/4 + SIZE*SIZE/4] __align16;\
+ DECLARE_ALIGNED_16(uint64_t, temp[SIZE*(SIZE+8)/4 + SIZE*SIZE/4]);\
uint8_t * const halfV= (uint8_t*)temp;\
uint8_t * const halfHV= ((uint8_t*)temp) + SIZE*SIZE;\
int16_t * const tmp= ((int16_t*)temp) + SIZE*SIZE;\
@@ -191,33 +191,33 @@ static void OPNAME ## h264_qpel ## SIZE ## _mc32_ ## CODETYPE(uint8_t *dst, uint
/* from dsputil.c */
static inline void put_pixels8_l2(uint8_t * dst, const uint8_t * src1, const uint8_t * src2, int dst_stride, int src_stride1, int src_stride2, int h) {
- int i;
- for (i = 0; i < h; i++) {
- uint32_t a, b;
- a = (((const struct unaligned_32 *) (&src1[i * src_stride1]))->l);
- b = (((const struct unaligned_32 *) (&src2[i * src_stride2]))->l);
- *((uint32_t *) & dst[i * dst_stride]) = rnd_avg32(a, b);
- a = (((const struct unaligned_32 *) (&src1[i * src_stride1 + 4]))->l);
- b = (((const struct unaligned_32 *) (&src2[i * src_stride2 + 4]))->l);
- *((uint32_t *) & dst[i * dst_stride + 4]) = rnd_avg32(a, b);
- }
+ int i;
+ for (i = 0; i < h; i++) {
+ uint32_t a, b;
+ a = (((const struct unaligned_32 *) (&src1[i * src_stride1]))->l);
+ b = (((const struct unaligned_32 *) (&src2[i * src_stride2]))->l);
+ *((uint32_t *) & dst[i * dst_stride]) = rnd_avg32(a, b);
+ a = (((const struct unaligned_32 *) (&src1[i * src_stride1 + 4]))->l);
+ b = (((const struct unaligned_32 *) (&src2[i * src_stride2 + 4]))->l);
+ *((uint32_t *) & dst[i * dst_stride + 4]) = rnd_avg32(a, b);
+ }
} static inline void avg_pixels8_l2(uint8_t * dst, const uint8_t * src1, const uint8_t * src2, int dst_stride, int src_stride1, int src_stride2, int h) {
- int i;
- for (i = 0; i < h; i++) {
- uint32_t a, b;
- a = (((const struct unaligned_32 *) (&src1[i * src_stride1]))->l);
- b = (((const struct unaligned_32 *) (&src2[i * src_stride2]))->l);
- *((uint32_t *) & dst[i * dst_stride]) = rnd_avg32(*((uint32_t *) & dst[i * dst_stride]), rnd_avg32(a, b));
- a = (((const struct unaligned_32 *) (&src1[i * src_stride1 + 4]))->l);
- b = (((const struct unaligned_32 *) (&src2[i * src_stride2 + 4]))->l);
- *((uint32_t *) & dst[i * dst_stride + 4]) = rnd_avg32(*((uint32_t *) & dst[i * dst_stride + 4]), rnd_avg32(a, b));
- }
+ int i;
+ for (i = 0; i < h; i++) {
+ uint32_t a, b;
+ a = (((const struct unaligned_32 *) (&src1[i * src_stride1]))->l);
+ b = (((const struct unaligned_32 *) (&src2[i * src_stride2]))->l);
+ *((uint32_t *) & dst[i * dst_stride]) = rnd_avg32(*((uint32_t *) & dst[i * dst_stride]), rnd_avg32(a, b));
+ a = (((const struct unaligned_32 *) (&src1[i * src_stride1 + 4]))->l);
+ b = (((const struct unaligned_32 *) (&src2[i * src_stride2 + 4]))->l);
+ *((uint32_t *) & dst[i * dst_stride + 4]) = rnd_avg32(*((uint32_t *) & dst[i * dst_stride + 4]), rnd_avg32(a, b));
+ }
} static inline void put_pixels16_l2(uint8_t * dst, const uint8_t * src1, const uint8_t * src2, int dst_stride, int src_stride1, int src_stride2, int h) {
- put_pixels8_l2(dst, src1, src2, dst_stride, src_stride1, src_stride2, h);
- put_pixels8_l2(dst + 8, src1 + 8, src2 + 8, dst_stride, src_stride1, src_stride2, h);
+ put_pixels8_l2(dst, src1, src2, dst_stride, src_stride1, src_stride2, h);
+ put_pixels8_l2(dst + 8, src1 + 8, src2 + 8, dst_stride, src_stride1, src_stride2, h);
} static inline void avg_pixels16_l2(uint8_t * dst, const uint8_t * src1, const uint8_t * src2, int dst_stride, int src_stride1, int src_stride2, int h) {
- avg_pixels8_l2(dst, src1, src2, dst_stride, src_stride1, src_stride2, h);
- avg_pixels8_l2(dst + 8, src1 + 8, src2 + 8, dst_stride, src_stride1, src_stride2, h);
+ avg_pixels8_l2(dst, src1, src2, dst_stride, src_stride1, src_stride2, h);
+ avg_pixels8_l2(dst + 8, src1 + 8, src2 + 8, dst_stride, src_stride1, src_stride2, h);
}
/* UNIMPLEMENTED YET !! */
@@ -228,7 +228,7 @@ H264_MC(put_, 16, altivec)
H264_MC(avg_, 16, altivec)
void dsputil_h264_init_ppc(DSPContext* c, AVCodecContext *avctx) {
-
+
#ifdef HAVE_ALTIVEC
if (has_altivec()) {
c->put_h264_chroma_pixels_tab[0] = put_h264_chroma_mc8_altivec;
@@ -251,16 +251,16 @@ void dsputil_h264_init_ppc(DSPContext* c, AVCodecContext *avctx) {
c->PFX ## _pixels_tab[IDX][13] = PFX ## NUM ## _mc13_altivec; \
c->PFX ## _pixels_tab[IDX][14] = PFX ## NUM ## _mc23_altivec; \
c->PFX ## _pixels_tab[IDX][15] = PFX ## NUM ## _mc33_altivec
-
+
dspfunc(put_h264_qpel, 0, 16);
dspfunc(avg_h264_qpel, 0, 16);
#undef dspfunc
-
+
} else
#endif /* HAVE_ALTIVEC */
{
// Non-AltiVec PPC optimisations
-
+
// ... pending ...
}
}