aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/ppc
diff options
context:
space:
mode:
authorDiego Biurrun <diego@biurrun.de>2013-01-29 22:13:55 +0100
committerDiego Biurrun <diego@biurrun.de>2013-02-05 12:59:12 +0100
commit25841dfe806a13de526ae09c11149ab1f83555a8 (patch)
treeb440e39d40a14e963bd3c36f41a370cb448c6006 /libavcodec/ppc
parente66240f22e240b0f0d970d1b138db80ceb517097 (diff)
downloadffmpeg-25841dfe806a13de526ae09c11149ab1f83555a8.tar.gz
Use ptrdiff_t instead of int for {avg, put}_pixels line_size parameter.
This avoids SIMD-optimized functions having to sign-extend their line size argument manually to be able to do pointer arithmetic.
Diffstat (limited to 'libavcodec/ppc')
-rw-r--r--libavcodec/ppc/dsputil_altivec.c22
-rw-r--r--libavcodec/ppc/dsputil_altivec.h4
2 files changed, 13 insertions, 13 deletions
diff --git a/libavcodec/ppc/dsputil_altivec.c b/libavcodec/ppc/dsputil_altivec.c
index 4f7e12a7b2..da9022d965 100644
--- a/libavcodec/ppc/dsputil_altivec.c
+++ b/libavcodec/ppc/dsputil_altivec.c
@@ -607,7 +607,7 @@ static void add_bytes_altivec(uint8_t *dst, uint8_t *src, int w) {
}
/* next one assumes that ((line_size % 16) == 0) */
-void ff_put_pixels16_altivec(uint8_t *block, const uint8_t *pixels, int line_size, int h)
+void ff_put_pixels16_altivec(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
{
register vector unsigned char pixelsv1, pixelsv2;
register vector unsigned char pixelsv1B, pixelsv2B;
@@ -616,9 +616,9 @@ void ff_put_pixels16_altivec(uint8_t *block, const uint8_t *pixels, int line_siz
register vector unsigned char perm = vec_lvsl(0, pixels);
int i;
- register int line_size_2 = line_size << 1;
- register int line_size_3 = line_size + line_size_2;
- register int line_size_4 = line_size << 2;
+ register ptrdiff_t line_size_2 = line_size << 1;
+ register ptrdiff_t line_size_3 = line_size + line_size_2;
+ register ptrdiff_t line_size_4 = line_size << 2;
// hand-unrolling the loop by 4 gains about 15%
// mininum execution time goes from 74 to 60 cycles
@@ -649,7 +649,7 @@ void ff_put_pixels16_altivec(uint8_t *block, const uint8_t *pixels, int line_siz
/* next one assumes that ((line_size % 16) == 0) */
#define op_avg(a,b) a = ( ((a)|(b)) - ((((a)^(b))&0xFEFEFEFEUL)>>1) )
-void ff_avg_pixels16_altivec(uint8_t *block, const uint8_t *pixels, int line_size, int h)
+void ff_avg_pixels16_altivec(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
{
register vector unsigned char pixelsv1, pixelsv2, pixelsv, blockv;
register vector unsigned char perm = vec_lvsl(0, pixels);
@@ -668,7 +668,7 @@ void ff_avg_pixels16_altivec(uint8_t *block, const uint8_t *pixels, int line_siz
}
/* next one assumes that ((line_size % 8) == 0) */
-static void avg_pixels8_altivec(uint8_t * block, const uint8_t * pixels, int line_size, int h)
+static void avg_pixels8_altivec(uint8_t * block, const uint8_t * pixels, ptrdiff_t line_size, int h)
{
register vector unsigned char pixelsv1, pixelsv2, pixelsv, blockv;
int i;
@@ -699,7 +699,7 @@ static void avg_pixels8_altivec(uint8_t * block, const uint8_t * pixels, int lin
}
/* next one assumes that ((line_size % 8) == 0) */
-static void put_pixels8_xy2_altivec(uint8_t *block, const uint8_t *pixels, int line_size, int h)
+static void put_pixels8_xy2_altivec(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
{
register int i;
register vector unsigned char pixelsv1, pixelsv2, pixelsavg;
@@ -758,7 +758,7 @@ static void put_pixels8_xy2_altivec(uint8_t *block, const uint8_t *pixels, int l
}
/* next one assumes that ((line_size % 8) == 0) */
-static void put_no_rnd_pixels8_xy2_altivec(uint8_t *block, const uint8_t *pixels, int line_size, int h)
+static void put_no_rnd_pixels8_xy2_altivec(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
{
register int i;
register vector unsigned char pixelsv1, pixelsv2, pixelsavg;
@@ -818,7 +818,7 @@ static void put_no_rnd_pixels8_xy2_altivec(uint8_t *block, const uint8_t *pixels
}
/* next one assumes that ((line_size % 16) == 0) */
-static void put_pixels16_xy2_altivec(uint8_t * block, const uint8_t * pixels, int line_size, int h)
+static void put_pixels16_xy2_altivec(uint8_t * block, const uint8_t * pixels, ptrdiff_t line_size, int h)
{
register int i;
register vector unsigned char pixelsv1, pixelsv2, pixelsv3, pixelsv4;
@@ -886,7 +886,7 @@ static void put_pixels16_xy2_altivec(uint8_t * block, const uint8_t * pixels, in
}
/* next one assumes that ((line_size % 16) == 0) */
-static void put_no_rnd_pixels16_xy2_altivec(uint8_t * block, const uint8_t * pixels, int line_size, int h)
+static void put_no_rnd_pixels16_xy2_altivec(uint8_t * block, const uint8_t * pixels, ptrdiff_t line_size, int h)
{
register int i;
register vector unsigned char pixelsv1, pixelsv2, pixelsv3, pixelsv4;
@@ -1284,7 +1284,7 @@ static int hadamard8_diff16_altivec(/*MpegEncContext*/ void *s, uint8_t *dst, ui
}
/* next one assumes that ((line_size % 8) == 0) */
-static void avg_pixels8_xy2_altivec(uint8_t *block, const uint8_t *pixels, int line_size, int h)
+static void avg_pixels8_xy2_altivec(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
{
register int i;
register vector unsigned char pixelsv1, pixelsv2, pixelsavg;
diff --git a/libavcodec/ppc/dsputil_altivec.h b/libavcodec/ppc/dsputil_altivec.h
index 7cbda36988..e97234400f 100644
--- a/libavcodec/ppc/dsputil_altivec.h
+++ b/libavcodec/ppc/dsputil_altivec.h
@@ -26,9 +26,9 @@
#include <stdint.h>
#include "libavcodec/dsputil.h"
-void ff_put_pixels16_altivec(uint8_t *block, const uint8_t *pixels, int line_size, int h);
+void ff_put_pixels16_altivec(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h);
-void ff_avg_pixels16_altivec(uint8_t *block, const uint8_t *pixels, int line_size, int h);
+void ff_avg_pixels16_altivec(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h);
void ff_fdct_altivec(int16_t *block);
void ff_gmc1_altivec(uint8_t *dst, uint8_t *src, int stride, int h,