summaryrefslogtreecommitdiff
path: root/libavcodec/ppc
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-05-31 21:48:06 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-05-31 21:48:16 +0200
commit08f229d81e41f3aa5463f0c835bc03b0f8d64a71 (patch)
treedeec8672c923662ea9f25594079b3598d99c9686 /libavcodec/ppc
parente8676c758a627efc1744e2084c01e832c03ed2d0 (diff)
parent7014b65995b1fe6188fb53447bf61b08e3963355 (diff)
Merge commit '7014b65995b1fe6188fb53447bf61b08e3963355'
* commit '7014b65995b1fe6188fb53447bf61b08e3963355': ppc: pixblockdsp: Use the abriged vector types Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/ppc')
-rw-r--r--libavcodec/ppc/pixblockdsp.c43
1 files changed, 20 insertions, 23 deletions
diff --git a/libavcodec/ppc/pixblockdsp.c b/libavcodec/ppc/pixblockdsp.c
index 9bbdf96d12..72519949a8 100644
--- a/libavcodec/ppc/pixblockdsp.c
+++ b/libavcodec/ppc/pixblockdsp.c
@@ -67,24 +67,22 @@ static void get_pixels_altivec(int16_t *restrict block, const uint8_t *pixels,
ptrdiff_t line_size)
{
int i;
- vector unsigned char perm = vec_lvsl(0, pixels);
- const vector unsigned char zero =
- (const vector unsigned char) vec_splat_u8(0);
+ vec_u8 perm = vec_lvsl(0, pixels);
+ const vec_u8 zero = (const vec_u8)vec_splat_u8(0);
for (i = 0; i < 8; i++) {
/* Read potentially unaligned pixels.
* We're reading 16 pixels, and actually only want 8,
* but we simply ignore the extras. */
- vector unsigned char pixl = vec_ld(0, pixels);
- vector unsigned char pixr = vec_ld(7, pixels);
- vector unsigned char bytes = vec_perm(pixl, pixr, perm);
+ vec_u8 pixl = vec_ld(0, pixels);
+ vec_u8 pixr = vec_ld(7, pixels);
+ vec_u8 bytes = vec_perm(pixl, pixr, perm);
// Convert the bytes into shorts.
- vector signed short shorts = (vector signed short) vec_mergeh(zero,
- bytes);
+ vec_s16 shorts = (vec_s16)vec_mergeh(zero, bytes);
// Save the data to the block, we assume the block is 16-byte aligned.
- vec_st(shorts, i * 16, (vector signed short *) block);
+ vec_st(shorts, i * 16, (vec_s16 *)block);
pixels += line_size;
}
@@ -159,22 +157,21 @@ static void diff_pixels_altivec(int16_t *restrict block, const uint8_t *s1,
const uint8_t *s2, int stride)
{
int i;
- vector unsigned char perm1 = vec_lvsl(0, s1);
- vector unsigned char perm2 = vec_lvsl(0, s2);
- const vector unsigned char zero =
- (const vector unsigned char) vec_splat_u8(0);
- vector signed short shorts1, shorts2;
+ vec_u8 perm1 = vec_lvsl(0, s1);
+ vec_u8 perm2 = vec_lvsl(0, s2);
+ const vec_u8 zero = (const vec_u8)vec_splat_u8(0);
+ vec_s16 shorts1, shorts2;
for (i = 0; i < 4; i++) {
/* Read potentially unaligned pixels.
* We're reading 16 pixels, and actually only want 8,
* but we simply ignore the extras. */
- vector unsigned char pixl = vec_ld(0, s1);
- vector unsigned char pixr = vec_ld(15, s1);
- vector unsigned char bytes = vec_perm(pixl, pixr, perm1);
+ vec_u8 pixl = vec_ld(0, s1);
+ vec_u8 pixr = vec_ld(15, s1);
+ vec_u8 bytes = vec_perm(pixl, pixr, perm1);
// Convert the bytes into shorts.
- shorts1 = (vector signed short) vec_mergeh(zero, bytes);
+ shorts1 = (vec_s16)vec_mergeh(zero, bytes);
// Do the same for the second block of pixels.
pixl = vec_ld(0, s2);
@@ -182,13 +179,13 @@ static void diff_pixels_altivec(int16_t *restrict block, const uint8_t *s1,
bytes = vec_perm(pixl, pixr, perm2);
// Convert the bytes into shorts.
- shorts2 = (vector signed short) vec_mergeh(zero, bytes);
+ shorts2 = (vec_s16)vec_mergeh(zero, bytes);
// Do the subtraction.
shorts1 = vec_sub(shorts1, shorts2);
// Save the data to the block, we assume the block is 16-byte aligned.
- vec_st(shorts1, 0, (vector signed short *) block);
+ vec_st(shorts1, 0, (vec_s16 *)block);
s1 += stride;
s2 += stride;
@@ -205,7 +202,7 @@ static void diff_pixels_altivec(int16_t *restrict block, const uint8_t *s1,
bytes = vec_perm(pixl, pixr, perm1);
// Convert the bytes into shorts.
- shorts1 = (vector signed short) vec_mergeh(zero, bytes);
+ shorts1 = (vec_s16)vec_mergeh(zero, bytes);
// Do the same for the second block of pixels.
pixl = vec_ld(0, s2);
@@ -213,13 +210,13 @@ static void diff_pixels_altivec(int16_t *restrict block, const uint8_t *s1,
bytes = vec_perm(pixl, pixr, perm2);
// Convert the bytes into shorts.
- shorts2 = (vector signed short) vec_mergeh(zero, bytes);
+ shorts2 = (vec_s16)vec_mergeh(zero, bytes);
// Do the subtraction.
shorts1 = vec_sub(shorts1, shorts2);
// Save the data to the block, we assume the block is 16-byte aligned.
- vec_st(shorts1, 0, (vector signed short *) block);
+ vec_st(shorts1, 0, (vec_s16 *)block);
s1 += stride;
s2 += stride;