diff options
author | Diego Biurrun <diego@biurrun.de> | 2013-01-29 22:13:55 +0100 |
---|---|---|
committer | Diego Biurrun <diego@biurrun.de> | 2013-02-05 12:59:12 +0100 |
commit | 25841dfe806a13de526ae09c11149ab1f83555a8 (patch) | |
tree | b440e39d40a14e963bd3c36f41a370cb448c6006 | |
parent | e66240f22e240b0f0d970d1b138db80ceb517097 (diff) | |
download | ffmpeg-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.
-rw-r--r-- | libavcodec/alpha/dsputil_alpha.c | 10 | ||||
-rw-r--r-- | libavcodec/alpha/dsputil_alpha.h | 2 | ||||
-rw-r--r-- | libavcodec/arm/dsputil_init_arm.c | 16 | ||||
-rw-r--r-- | libavcodec/arm/dsputil_init_armv6.c | 24 | ||||
-rw-r--r-- | libavcodec/arm/dsputil_init_neon.c | 52 | ||||
-rw-r--r-- | libavcodec/bfin/dsputil_bfin.c | 28 | ||||
-rw-r--r-- | libavcodec/dsputil.h | 2 | ||||
-rw-r--r-- | libavcodec/dsputil_template.c | 22 | ||||
-rw-r--r-- | libavcodec/motion_est.c | 2 | ||||
-rw-r--r-- | libavcodec/ppc/dsputil_altivec.c | 22 | ||||
-rw-r--r-- | libavcodec/ppc/dsputil_altivec.h | 4 | ||||
-rw-r--r-- | libavcodec/sh4/dsputil_align.c | 2 | ||||
-rw-r--r-- | libavcodec/sparc/dsputil_vis.c | 56 | ||||
-rw-r--r-- | libavcodec/x86/dsputil_avg_template.c | 14 | ||||
-rw-r--r-- | libavcodec/x86/dsputil_mmx.c | 50 | ||||
-rw-r--r-- | libavcodec/x86/dsputil_rnd_template.c | 30 | ||||
-rw-r--r-- | libavcodec/x86/hpeldsp.asm | 39 |
17 files changed, 181 insertions, 194 deletions
diff --git a/libavcodec/alpha/dsputil_alpha.c b/libavcodec/alpha/dsputil_alpha.c index 696167471e..d02ebdb3cc 100644 --- a/libavcodec/alpha/dsputil_alpha.c +++ b/libavcodec/alpha/dsputil_alpha.c @@ -32,7 +32,7 @@ void (*add_pixels_clamped_axp_p)(const int16_t *block, uint8_t *pixels, /* These functions were the base for the optimized assembler routines, and remain here for documentation purposes. */ static void put_pixels_clamped_mvi(const int16_t *block, uint8_t *pixels, - int line_size) + ptrdiff_t line_size) { int i = 8; uint64_t clampmask = zap(-1, 0xaa); /* 0x00ff00ff00ff00ff */ @@ -56,7 +56,7 @@ static void put_pixels_clamped_mvi(const int16_t *block, uint8_t *pixels, } void add_pixels_clamped_mvi(const int16_t *block, uint8_t *pixels, - int line_size) + ptrdiff_t line_size) { int h = 8; /* Keep this function a leaf function by generating the constants @@ -212,7 +212,7 @@ static inline uint64_t avg4(uint64_t l1, uint64_t l2, uint64_t l3, uint64_t l4) #define MAKE_OP(OPNAME, SUFF, OPKIND, STORE) \ static void OPNAME ## _pixels ## SUFF ## _axp \ (uint8_t *restrict block, const uint8_t *restrict pixels, \ - int line_size, int h) \ + ptrdiff_t line_size, int h) \ { \ if ((size_t) pixels & 0x7) { \ OPKIND(uldq, STORE); \ @@ -223,7 +223,7 @@ static void OPNAME ## _pixels ## SUFF ## _axp \ \ static void OPNAME ## _pixels16 ## SUFF ## _axp \ (uint8_t *restrict block, const uint8_t *restrict pixels, \ - int line_size, int h) \ + ptrdiff_t line_size, int h) \ { \ OPNAME ## _pixels ## SUFF ## _axp(block, pixels, line_size, h); \ OPNAME ## _pixels ## SUFF ## _axp(block + 8, pixels + 8, line_size, h); \ @@ -262,7 +262,7 @@ PIXOP(put_no_rnd, STORE); PIXOP(avg_no_rnd, STORE); static void put_pixels16_axp_asm(uint8_t *block, const uint8_t *pixels, - int line_size, int h) + ptrdiff_t line_size, int h) { put_pixels_axp_asm(block, pixels, line_size, h); put_pixels_axp_asm(block + 8, pixels + 8, line_size, h); diff --git a/libavcodec/alpha/dsputil_alpha.h b/libavcodec/alpha/dsputil_alpha.h index 6cd2dea4e5..6eee97fe63 100644 --- a/libavcodec/alpha/dsputil_alpha.h +++ b/libavcodec/alpha/dsputil_alpha.h @@ -26,7 +26,7 @@ void ff_simple_idct_put_axp(uint8_t *dest, int line_size, int16_t *block); void ff_simple_idct_add_axp(uint8_t *dest, int line_size, int16_t *block); void put_pixels_axp_asm(uint8_t *block, const uint8_t *pixels, - int line_size, int h); + ptrdiff_t line_size, int h); void put_pixels_clamped_mvi_asm(const int16_t *block, uint8_t *pixels, int line_size); void add_pixels_clamped_mvi_asm(const int16_t *block, uint8_t *pixels, diff --git a/libavcodec/arm/dsputil_init_arm.c b/libavcodec/arm/dsputil_init_arm.c index 1cfb47fab4..7379761917 100644 --- a/libavcodec/arm/dsputil_init_arm.c +++ b/libavcodec/arm/dsputil_init_arm.c @@ -30,16 +30,16 @@ void ff_simple_idct_arm(int16_t *data); static void (*ff_put_pixels_clamped)(const int16_t *block, uint8_t *pixels, int line_size); static void (*ff_add_pixels_clamped)(const int16_t *block, uint8_t *pixels, int line_size); -void ff_put_pixels8_arm(uint8_t *block, const uint8_t *pixels, int line_size, int h); -void ff_put_pixels8_x2_arm(uint8_t *block, const uint8_t *pixels, int line_size, int h); -void ff_put_pixels8_y2_arm(uint8_t *block, const uint8_t *pixels, int line_size, int h); -void ff_put_pixels8_xy2_arm(uint8_t *block, const uint8_t *pixels, int line_size, int h); +void ff_put_pixels8_arm(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h); +void ff_put_pixels8_x2_arm(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h); +void ff_put_pixels8_y2_arm(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h); +void ff_put_pixels8_xy2_arm(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h); -void ff_put_no_rnd_pixels8_x2_arm(uint8_t *block, const uint8_t *pixels, int line_size, int h); -void ff_put_no_rnd_pixels8_y2_arm(uint8_t *block, const uint8_t *pixels, int line_size, int h); -void ff_put_no_rnd_pixels8_xy2_arm(uint8_t *block, const uint8_t *pixels, int line_size, int h); +void ff_put_no_rnd_pixels8_x2_arm(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h); +void ff_put_no_rnd_pixels8_y2_arm(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h); +void ff_put_no_rnd_pixels8_xy2_arm(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h); -void ff_put_pixels16_arm(uint8_t *block, const uint8_t *pixels, int line_size, int h); +void ff_put_pixels16_arm(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h); CALL_2X_PIXELS(ff_put_pixels16_x2_arm, ff_put_pixels8_x2_arm, 8) CALL_2X_PIXELS(ff_put_pixels16_y2_arm, ff_put_pixels8_y2_arm, 8) diff --git a/libavcodec/arm/dsputil_init_armv6.c b/libavcodec/arm/dsputil_init_armv6.c index 53b8934d00..88c31ec419 100644 --- a/libavcodec/arm/dsputil_init_armv6.c +++ b/libavcodec/arm/dsputil_init_armv6.c @@ -28,23 +28,23 @@ void ff_simple_idct_armv6(int16_t *data); void ff_simple_idct_put_armv6(uint8_t *dest, int line_size, int16_t *data); void ff_simple_idct_add_armv6(uint8_t *dest, int line_size, int16_t *data); -void ff_put_pixels16_armv6(uint8_t *, const uint8_t *, int, int); -void ff_put_pixels16_x2_armv6(uint8_t *, const uint8_t *, int, int); -void ff_put_pixels16_y2_armv6(uint8_t *, const uint8_t *, int, int); +void ff_put_pixels16_armv6(uint8_t *, const uint8_t *, ptrdiff_t, int); +void ff_put_pixels16_x2_armv6(uint8_t *, const uint8_t *, ptrdiff_t, int); +void ff_put_pixels16_y2_armv6(uint8_t *, const uint8_t *, ptrdiff_t, int); -void ff_put_pixels16_x2_no_rnd_armv6(uint8_t *, const uint8_t *, int, int); -void ff_put_pixels16_y2_no_rnd_armv6(uint8_t *, const uint8_t *, int, int); +void ff_put_pixels16_x2_no_rnd_armv6(uint8_t *, const uint8_t *, ptrdiff_t, int); +void ff_put_pixels16_y2_no_rnd_armv6(uint8_t *, const uint8_t *, ptrdiff_t, int); -void ff_avg_pixels16_armv6(uint8_t *, const uint8_t *, int, int); +void ff_avg_pixels16_armv6(uint8_t *, const uint8_t *, ptrdiff_t, int); -void ff_put_pixels8_armv6(uint8_t *, const uint8_t *, int, int); -void ff_put_pixels8_x2_armv6(uint8_t *, const uint8_t *, int, int); -void ff_put_pixels8_y2_armv6(uint8_t *, const uint8_t *, int, int); +void ff_put_pixels8_armv6(uint8_t *, const uint8_t *, ptrdiff_t, int); +void ff_put_pixels8_x2_armv6(uint8_t *, const uint8_t *, ptrdiff_t, int); +void ff_put_pixels8_y2_armv6(uint8_t *, const uint8_t *, ptrdiff_t, int); -void ff_put_pixels8_x2_no_rnd_armv6(uint8_t *, const uint8_t *, int, int); -void ff_put_pixels8_y2_no_rnd_armv6(uint8_t *, const uint8_t *, int, int); +void ff_put_pixels8_x2_no_rnd_armv6(uint8_t *, const uint8_t *, ptrdiff_t, int); +void ff_put_pixels8_y2_no_rnd_armv6(uint8_t *, const uint8_t *, ptrdiff_t, int); -void ff_avg_pixels8_armv6(uint8_t *, const uint8_t *, int, int); +void ff_avg_pixels8_armv6(uint8_t *, const uint8_t *, ptrdiff_t, int); void ff_add_pixels_clamped_armv6(const int16_t *block, uint8_t *restrict pixels, diff --git a/libavcodec/arm/dsputil_init_neon.c b/libavcodec/arm/dsputil_init_neon.c index e6544eb1cf..c73b30ee47 100644 --- a/libavcodec/arm/dsputil_init_neon.c +++ b/libavcodec/arm/dsputil_init_neon.c @@ -32,32 +32,32 @@ void ff_simple_idct_add_neon(uint8_t *dest, int line_size, int16_t *data); void ff_clear_block_neon(int16_t *block); void ff_clear_blocks_neon(int16_t *blocks); -void ff_put_pixels16_neon(uint8_t *, const uint8_t *, int, int); -void ff_put_pixels16_x2_neon(uint8_t *, const uint8_t *, int, int); -void ff_put_pixels16_y2_neon(uint8_t *, const uint8_t *, int, int); -void ff_put_pixels16_xy2_neon(uint8_t *, const uint8_t *, int, int); -void ff_put_pixels8_neon(uint8_t *, const uint8_t *, int, int); -void ff_put_pixels8_x2_neon(uint8_t *, const uint8_t *, int, int); -void ff_put_pixels8_y2_neon(uint8_t *, const uint8_t *, int, int); -void ff_put_pixels8_xy2_neon(uint8_t *, const uint8_t *, int, int); -void ff_put_pixels16_x2_no_rnd_neon(uint8_t *, const uint8_t *, int, int); -void ff_put_pixels16_y2_no_rnd_neon(uint8_t *, const uint8_t *, int, int); -void ff_put_pixels16_xy2_no_rnd_neon(uint8_t *, const uint8_t *, int, int); -void ff_put_pixels8_x2_no_rnd_neon(uint8_t *, const uint8_t *, int, int); -void ff_put_pixels8_y2_no_rnd_neon(uint8_t *, const uint8_t *, int, int); -void ff_put_pixels8_xy2_no_rnd_neon(uint8_t *, const uint8_t *, int, int); - -void ff_avg_pixels16_neon(uint8_t *, const uint8_t *, int, int); -void ff_avg_pixels16_x2_neon(uint8_t *, const uint8_t *, int, int); -void ff_avg_pixels16_y2_neon(uint8_t *, const uint8_t *, int, int); -void ff_avg_pixels16_xy2_neon(uint8_t *, const uint8_t *, int, int); -void ff_avg_pixels8_neon(uint8_t *, const uint8_t *, int, int); -void ff_avg_pixels8_x2_neon(uint8_t *, const uint8_t *, int, int); -void ff_avg_pixels8_y2_neon(uint8_t *, const uint8_t *, int, int); -void ff_avg_pixels8_xy2_neon(uint8_t *, const uint8_t *, int, int); -void ff_avg_pixels16_x2_no_rnd_neon(uint8_t *, const uint8_t *, int, int); -void ff_avg_pixels16_y2_no_rnd_neon(uint8_t *, const uint8_t *, int, int); -void ff_avg_pixels16_xy2_no_rnd_neon(uint8_t *, const uint8_t *, int, int); +void ff_put_pixels16_neon(uint8_t *, const uint8_t *, ptrdiff_t, int); +void ff_put_pixels16_x2_neon(uint8_t *, const uint8_t *, ptrdiff_t, int); +void ff_put_pixels16_y2_neon(uint8_t *, const uint8_t *, ptrdiff_t, int); +void ff_put_pixels16_xy2_neon(uint8_t *, const uint8_t *, ptrdiff_t, int); +void ff_put_pixels8_neon(uint8_t *, const uint8_t *, ptrdiff_t, int); +void ff_put_pixels8_x2_neon(uint8_t *, const uint8_t *, ptrdiff_t, int); +void ff_put_pixels8_y2_neon(uint8_t *, const uint8_t *, ptrdiff_t, int); +void ff_put_pixels8_xy2_neon(uint8_t *, const uint8_t *, ptrdiff_t, int); +void ff_put_pixels16_x2_no_rnd_neon(uint8_t *, const uint8_t *, ptrdiff_t, int); +void ff_put_pixels16_y2_no_rnd_neon(uint8_t *, const uint8_t *, ptrdiff_t, int); +void ff_put_pixels16_xy2_no_rnd_neon(uint8_t *, const uint8_t *, ptrdiff_t, int); +void ff_put_pixels8_x2_no_rnd_neon(uint8_t *, const uint8_t *, ptrdiff_t, int); +void ff_put_pixels8_y2_no_rnd_neon(uint8_t *, const uint8_t *, ptrdiff_t, int); +void ff_put_pixels8_xy2_no_rnd_neon(uint8_t *, const uint8_t *, ptrdiff_t, int); + +void ff_avg_pixels16_neon(uint8_t *, const uint8_t *, ptrdiff_t, int); +void ff_avg_pixels16_x2_neon(uint8_t *, const uint8_t *, ptrdiff_t, int); +void ff_avg_pixels16_y2_neon(uint8_t *, const uint8_t *, ptrdiff_t, int); +void ff_avg_pixels16_xy2_neon(uint8_t *, const uint8_t *, ptrdiff_t, int); +void ff_avg_pixels8_neon(uint8_t *, const uint8_t *, ptrdiff_t, int); +void ff_avg_pixels8_x2_neon(uint8_t *, const uint8_t *, ptrdiff_t, int); +void ff_avg_pixels8_y2_neon(uint8_t *, const uint8_t *, ptrdiff_t, int); +void ff_avg_pixels8_xy2_neon(uint8_t *, const uint8_t *, ptrdiff_t, int); +void ff_avg_pixels16_x2_no_rnd_neon(uint8_t *, const uint8_t *, ptrdiff_t, int); +void ff_avg_pixels16_y2_no_rnd_neon(uint8_t *, const uint8_t *, ptrdiff_t, int); +void ff_avg_pixels16_xy2_no_rnd_neon(uint8_t *, const uint8_t *, ptrdiff_t, int); void ff_add_pixels_clamped_neon(const int16_t *, uint8_t *, int); void ff_put_pixels_clamped_neon(const int16_t *, uint8_t *, int); diff --git a/libavcodec/bfin/dsputil_bfin.c b/libavcodec/bfin/dsputil_bfin.c index 896a3c55f6..34e3d1a23e 100644 --- a/libavcodec/bfin/dsputil_bfin.c +++ b/libavcodec/bfin/dsputil_bfin.c @@ -55,73 +55,73 @@ static void bfin_clear_blocks (int16_t *blocks) -static void bfin_put_pixels8 (uint8_t *block, const uint8_t *pixels, int line_size, int h) +static void bfin_put_pixels8 (uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h) { ff_bfin_put_pixels8uc (block, pixels, pixels, line_size, line_size, h); } -static void bfin_put_pixels8_x2(uint8_t *block, const uint8_t *pixels, int line_size, int h) +static void bfin_put_pixels8_x2(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h) { ff_bfin_put_pixels8uc (block, pixels, pixels+1, line_size, line_size, h); } -static void bfin_put_pixels8_y2 (uint8_t *block, const uint8_t *pixels, int line_size, int h) +static void bfin_put_pixels8_y2 (uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h) { ff_bfin_put_pixels8uc (block, pixels, pixels+line_size, line_size, line_size, h); } -static void bfin_put_pixels8_xy2 (uint8_t *block, const uint8_t *s0, int line_size, int h) +static void bfin_put_pixels8_xy2 (uint8_t *block, const uint8_t *s0, ptrdiff_t line_size, int h) { ff_bfin_z_put_pixels8_xy2 (block,s0,line_size, line_size, h); } -static void bfin_put_pixels16 (uint8_t *block, const uint8_t *pixels, int line_size, int h) +static void bfin_put_pixels16 (uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h) { ff_bfin_put_pixels16uc (block, pixels, pixels, line_size, line_size, h); } -static void bfin_put_pixels16_x2 (uint8_t *block, const uint8_t *pixels, int line_size, int h) +static void bfin_put_pixels16_x2 (uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h) { ff_bfin_put_pixels16uc (block, pixels, pixels+1, line_size, line_size, h); } -static void bfin_put_pixels16_y2 (uint8_t *block, const uint8_t *pixels, int line_size, int h) +static void bfin_put_pixels16_y2 (uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h) { ff_bfin_put_pixels16uc (block, pixels, pixels+line_size, line_size, line_size, h); } -static void bfin_put_pixels16_xy2 (uint8_t *block, const uint8_t *s0, int line_size, int h) +static void bfin_put_pixels16_xy2 (uint8_t *block, const uint8_t *s0, ptrdiff_t line_size, int h) { ff_bfin_z_put_pixels16_xy2 (block,s0,line_size, line_size, h); } -static void bfin_put_pixels8_nornd (uint8_t *block, const uint8_t *pixels, int line_size, int h) +static void bfin_put_pixels8_nornd (uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h) { ff_bfin_put_pixels8uc_nornd (block, pixels, pixels, line_size, h); } -static void bfin_put_pixels8_x2_nornd (uint8_t *block, const uint8_t *pixels, int line_size, int h) +static void bfin_put_pixels8_x2_nornd (uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h) { ff_bfin_put_pixels8uc_nornd (block, pixels, pixels+1, line_size, h); } -static void bfin_put_pixels8_y2_nornd (uint8_t *block, const uint8_t *pixels, int line_size, int h) +static void bfin_put_pixels8_y2_nornd (uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h) { ff_bfin_put_pixels8uc_nornd (block, pixels, pixels+line_size, line_size, h); } -static void bfin_put_pixels16_nornd (uint8_t *block, const uint8_t *pixels, int line_size, int h) +static void bfin_put_pixels16_nornd (uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h) { ff_bfin_put_pixels16uc_nornd (block, pixels, pixels, line_size, h); } -static void bfin_put_pixels16_x2_nornd (uint8_t *block, const uint8_t *pixels, int line_size, int h) +static void bfin_put_pixels16_x2_nornd (uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h) { ff_bfin_put_pixels16uc_nornd (block, pixels, pixels+1, line_size, h); } -static void bfin_put_pixels16_y2_nornd (uint8_t *block, const uint8_t *pixels, int line_size, int h) +static void bfin_put_pixels16_y2_nornd (uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h) { ff_bfin_put_pixels16uc_nornd (block, pixels, pixels+line_size, line_size, h); } diff --git a/libavcodec/dsputil.h b/libavcodec/dsputil.h index d656e2680e..f6dbae7346 100644 --- a/libavcodec/dsputil.h +++ b/libavcodec/dsputil.h @@ -137,7 +137,7 @@ void clear_blocks_c(int16_t *blocks); /* add and put pixel (decoding) */ // blocksizes for op_pixels_func are 8x4,8x8 16x8 16x16 //h for op_pixels_func is limited to {width/2, width} but never larger than 16 and never smaller than 4 -typedef void (*op_pixels_func)(uint8_t *block/*align width (8 or 16)*/, const uint8_t *pixels/*align 1*/, int line_size, int h); +typedef void (*op_pixels_func)(uint8_t *block/*align width (8 or 16)*/, const uint8_t *pixels/*align 1*/, ptrdiff_t line_size, int h); typedef void (*tpel_mc_func)(uint8_t *block/*align width (8 or 16)*/, const uint8_t *pixels/*align 1*/, int line_size, int w, int h); typedef void (*qpel_mc_func)(uint8_t *dst/*align width (8 or 16)*/, uint8_t *src/*align 1*/, int stride); typedef void (*h264_chroma_mc_func)(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int srcStride, int h, int x, int y); diff --git a/libavcodec/dsputil_template.c b/libavcodec/dsputil_template.c index 62edd90e8c..1dbeb7102e 100644 --- a/libavcodec/dsputil_template.c +++ b/libavcodec/dsputil_template.c @@ -172,19 +172,19 @@ static inline void FUNC(OPNAME ## _no_rnd_pixels16_l2)(uint8_t *dst, const uint8 FUNC(OPNAME ## _no_rnd_pixels8_l2)(dst+8*sizeof(pixel), src1+8*sizeof(pixel), src2+8*sizeof(pixel), dst_stride, src_stride1, src_stride2, h);\ }\ \ -static inline void FUNCC(OPNAME ## _no_rnd_pixels8_x2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){\ +static inline void FUNCC(OPNAME ## _no_rnd_pixels8_x2)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h){\ FUNC(OPNAME ## _no_rnd_pixels8_l2)(block, pixels, pixels+sizeof(pixel), line_size, line_size, line_size, h);\ }\ \ -static inline void FUNCC(OPNAME ## _pixels8_x2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){\ +static inline void FUNCC(OPNAME ## _pixels8_x2)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h){\ FUNC(OPNAME ## _pixels8_l2)(block, pixels, pixels+sizeof(pixel), line_size, line_size, line_size, h);\ }\ \ -static inline void FUNCC(OPNAME ## _no_rnd_pixels8_y2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){\ +static inline void FUNCC(OPNAME ## _no_rnd_pixels8_y2)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h){\ FUNC(OPNAME ## _no_rnd_pixels8_l2)(block, pixels, pixels+line_size, line_size, line_size, line_size, h);\ }\ \ -static inline void FUNCC(OPNAME ## _pixels8_y2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){\ +static inline void FUNCC(OPNAME ## _pixels8_y2)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h){\ FUNC(OPNAME ## _pixels8_l2)(block, pixels, pixels+line_size, line_size, line_size, line_size, h);\ }\ \ @@ -225,19 +225,19 @@ static inline void FUNC(OPNAME ## _pixels8_l4)(uint8_t *dst, const uint8_t *src1 }\ }\ \ -static inline void FUNCC(OPNAME ## _pixels4_x2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){\ +static inline void FUNCC(OPNAME ## _pixels4_x2)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h){\ FUNC(OPNAME ## _pixels4_l2)(block, pixels, pixels+sizeof(pixel), line_size, line_size, line_size, h);\ }\ \ -static inline void FUNCC(OPNAME ## _pixels4_y2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){\ +static inline void FUNCC(OPNAME ## _pixels4_y2)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h){\ FUNC(OPNAME ## _pixels4_l2)(block, pixels, pixels+line_size, line_size, line_size, line_size, h);\ }\ \ -static inline void FUNCC(OPNAME ## _pixels2_x2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){\ +static inline void FUNCC(OPNAME ## _pixels2_x2)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h){\ FUNC(OPNAME ## _pixels2_l2)(block, pixels, pixels+sizeof(pixel), line_size, line_size, line_size, h);\ }\ \ -static inline void FUNCC(OPNAME ## _pixels2_y2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){\ +static inline void FUNCC(OPNAME ## _pixels2_y2)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h){\ FUNC(OPNAME ## _pixels2_l2)(block, pixels, pixels+line_size, line_size, line_size, line_size, h);\ }\ \ @@ -288,7 +288,7 @@ static inline void FUNC(OPNAME ## _no_rnd_pixels16_l4)(uint8_t *dst, const uint8 FUNC(OPNAME ## _no_rnd_pixels8_l4)(dst+8*sizeof(pixel), src1+8*sizeof(pixel), src2+8*sizeof(pixel), src3+8*sizeof(pixel), src4+8*sizeof(pixel), dst_stride, src_stride1, src_stride2, src_stride3, src_stride4, h);\ }\ \ -static inline void FUNCC(OPNAME ## _pixels2_xy2)(uint8_t *_block, const uint8_t *_pixels, int line_size, int h)\ +static inline void FUNCC(OPNAME ## _pixels2_xy2)(uint8_t *_block, const uint8_t *_pixels, ptrdiff_t line_size, int h)\ {\ int i, a0, b0, a1, b1;\ pixel *block = (pixel*)_block;\ @@ -324,7 +324,7 @@ static inline void FUNCC(OPNAME ## _pixels2_xy2)(uint8_t *_block, const uint8_t }\ }\ \ -static inline void FUNCC(OPNAME ## _pixels4_xy2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)\ +static inline void FUNCC(OPNAME ## _pixels4_xy2)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)\ {\ /* FIXME HIGH BIT DEPTH */\ int i;\ @@ -403,7 +403,7 @@ static inline void FUNCC(OPNAME ## _pixels8_xy2)(uint8_t *block, const uint8_t * }\ }\ \ -static inline void FUNCC(OPNAME ## _no_rnd_pixels8_xy2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)\ +static inline void FUNCC(OPNAME ## _no_rnd_pixels8_xy2)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)\ {\ /* FIXME HIGH BIT DEPTH */\ int j;\ diff --git a/libavcodec/motion_est.c b/libavcodec/motion_est.c index 3244ac06b9..e791690244 100644 --- a/libavcodec/motion_est.c +++ b/libavcodec/motion_est.c @@ -290,7 +290,7 @@ static int zero_cmp(void *s, uint8_t *a, uint8_t *b, int stride, int h){ return 0; } -static void zero_hpel(uint8_t *a, const uint8_t *b, int stride, int h){ +static void zero_hpel(uint8_t *a, const uint8_t *b, ptrdiff_t stride, int h){ } int ff_init_me(MpegEncContext *s){ 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, diff --git a/libavcodec/sh4/dsputil_align.c b/libavcodec/sh4/dsputil_align.c index f723f76743..04df7fd432 100644 --- a/libavcodec/sh4/dsputil_align.c +++ b/libavcodec/sh4/dsputil_align.c @@ -262,7 +262,7 @@ if (sz==16) { \ #define DEFFUNC(op,rnd,xy,sz,OP_N,avgfunc) \ static void op##_##rnd##_pixels##sz##_##xy (uint8_t * dest, const uint8_t * ref, \ - const int stride, int height) \ + const int ptrdiff_t, int height) \ { \ switch((int)ref&3) { \ case 0:OP_N##0(sz,rnd##_##avgfunc); return; \ diff --git a/libavcodec/sparc/dsputil_vis.c b/libavcodec/sparc/dsputil_vis.c index 0822a5816b..1381d09c15 100644 --- a/libavcodec/sparc/dsputil_vis.c +++ b/libavcodec/sparc/dsputil_vis.c @@ -120,7 +120,7 @@ DECLARE_ALIGNED(8, static const int16_t, constants256_1024)[] = #define TMP32 58 static void MC_put_o_16_vis (uint8_t * dest, const uint8_t * ref, - const int stride, int height) + const ptrdiff_t line_size, int height) { ref = vis_alignaddr(ref); do { /* 5 cycles */ @@ -141,7 +141,7 @@ static void MC_put_o_16_vis (uint8_t * dest, const uint8_t * ref, } static void MC_put_o_8_vis (uint8_t * dest, const uint8_t * ref, - const int stride, int height) + const ptrdiff_t line_size, int height) { ref = vis_alignaddr(ref); do { /* 4 cycles */ @@ -160,7 +160,7 @@ static void MC_put_o_8_vis (uint8_t * dest, const uint8_t * ref, static void MC_avg_o_16_vis (uint8_t * dest, const uint8_t * ref, - const int stride, int height) + const ptrdiff_t line_size, int height) { int stride_8 = stride + 8; @@ -320,7 +320,7 @@ static void MC_avg_o_16_vis (uint8_t * dest, const uint8_t * ref, } static void MC_avg_o_8_vis (uint8_t * dest, const uint8_t * ref, - const int stride, int height) + const ptrdiff_t line_size, int height) { ref = vis_alignaddr(ref); @@ -412,7 +412,7 @@ static void MC_avg_o_8_vis (uint8_t * dest, const uint8_t * ref, } static void MC_put_x_16_vis (uint8_t * dest, const uint8_t * ref, - const int stride, int height) + const ptrdiff_t line_size, int height) { unsigned long off = (unsigned long) ref & 0x7; unsigned long off_plus_1 = off + 1; @@ -604,7 +604,7 @@ static void MC_put_x_16_vis (uint8_t * dest, const uint8_t * ref, } static void MC_put_x_8_vis (uint8_t * dest, const uint8_t * ref, - const int stride, int height) + const ptrdiff_t line_size, int height) { unsigned long off = (unsigned long) ref & 0x7; unsigned long off_plus_1 = off + 1; @@ -727,7 +727,7 @@ static void MC_put_x_8_vis (uint8_t * dest, const uint8_t * ref, } static void MC_avg_x_16_vis (uint8_t * dest, const uint8_t * ref, - const int stride, int height) + const ptrdiff_t line_size, int height) { unsigned long off = (unsigned long) ref & 0x7; unsigned long off_plus_1 = off + 1; @@ -817,7 +817,7 @@ static void MC_avg_x_16_vis (uint8_t * dest, const uint8_t * ref, } static void MC_avg_x_8_vis (uint8_t * dest, const uint8_t * ref, - const int stride, int height) + const ptrdiff_t line_size, int height) { unsigned long off = (unsigned long) ref & 0x7; unsigned long off_plus_1 = off + 1; @@ -982,7 +982,7 @@ static void MC_avg_x_8_vis (uint8_t * dest, const uint8_t * ref, } static void MC_put_y_16_vis (uint8_t * dest, const uint8_t * ref, - const int stride, int height) + const ptrdiff_t line_size, int height) { ref = vis_alignaddr(ref); vis_ld64(ref[0], TMP0); @@ -1136,7 +1136,7 @@ static void MC_put_y_16_vis (uint8_t * dest, const uint8_t * ref, } static void MC_put_y_8_vis (uint8_t * dest, const uint8_t * ref, - const int stride, int height) + const ptrdiff_t line_size, int height) { ref = vis_alignaddr(ref); vis_ld64(ref[0], TMP0); @@ -1226,7 +1226,7 @@ static void MC_put_y_8_vis (uint8_t * dest, const uint8_t * ref, } static void MC_avg_y_16_vis (uint8_t * dest, const uint8_t * ref, - const int stride, int height) + const ptrdiff_t line_size, int height) { int stride_8 = stride + 8; int stride_16 = stride + 16; @@ -1354,7 +1354,7 @@ static void MC_avg_y_16_vis (uint8_t * dest, const uint8_t * ref, } static void MC_avg_y_8_vis (uint8_t * dest, const uint8_t * ref, - const int stride, int height) + const ptrdiff_t line_size, int height) { int stride_8 = stride + 8; @@ -1433,7 +1433,7 @@ static void MC_avg_y_8_vis (uint8_t * dest, const uint8_t * ref, } static void MC_put_xy_16_vis (uint8_t * dest, const uint8_t * ref, - const int stride, int height) + const ptrdiff_t line_size, int height) { unsigned long off = (unsigned long) ref & 0x7; unsigned long off_plus_1 = off + 1; @@ -1597,7 +1597,7 @@ static void MC_put_xy_16_vis (uint8_t * dest, const uint8_t * ref, } static void MC_put_xy_8_vis (uint8_t * dest, const uint8_t * ref, - const int stride, int height) + const ptrdiff_t line_size, int height) { unsigned long off = (unsigned long) ref & 0x7; unsigned long off_plus_1 = off + 1; @@ -1701,7 +1701,7 @@ static void MC_put_xy_8_vis (uint8_t * dest, const uint8_t * ref, } static void MC_avg_xy_16_vis (uint8_t * dest, const uint8_t * ref, - const int stride, int height) + const ptrdiff_t line_size, int height) { unsigned long off = (unsigned long) ref & 0x7; unsigned long off_plus_1 = off + 1; @@ -1897,7 +1897,7 @@ static void MC_avg_xy_16_vis (uint8_t * dest, const uint8_t * ref, } static void MC_avg_xy_8_vis (uint8_t * dest, const uint8_t * ref, - const int stride, int height) + const ptrdiff_t line_size, int height) { unsigned long off = (unsigned long) ref & 0x7; unsigned long off_plus_1 = off + 1; @@ -2040,7 +2040,7 @@ static void MC_avg_xy_8_vis (uint8_t * dest, const uint8_t * ref, */ static void MC_put_no_round_o_16_vis (uint8_t * dest, const uint8_t * ref, - const int stride, int height) + const ptrdiff_t line_size, int height) { ref = vis_alignaddr(ref); do { /* 5 cycles */ @@ -2061,7 +2061,7 @@ static void MC_put_no_round_o_16_vis (uint8_t * dest, const uint8_t * ref, } static void MC_put_no_round_o_8_vis (uint8_t * dest, const uint8_t * ref, - const int stride, int height) + const ptrdiff_t line_size, int height) { ref = vis_alignaddr(ref); do { /* 4 cycles */ @@ -2080,7 +2080,7 @@ static void MC_put_no_round_o_8_vis (uint8_t * dest, const uint8_t * ref, static void MC_avg_no_round_o_16_vis (uint8_t * dest, const uint8_t * ref, - const int stride, int height) + const ptrdiff_t line_size, int height) { int stride_8 = stride + 8; @@ -2240,7 +2240,7 @@ static void MC_avg_no_round_o_16_vis (uint8_t * dest, const uint8_t * ref, } static void MC_put_no_round_x_16_vis (uint8_t * dest, const uint8_t * ref, - const int stride, int height) + const ptrdiff_t line_size, int height) { unsigned long off = (unsigned long) ref & 0x7; unsigned long off_plus_1 = off + 1; @@ -2432,7 +2432,7 @@ static void MC_put_no_round_x_16_vis (uint8_t * dest, const uint8_t * ref, } static void MC_put_no_round_x_8_vis (uint8_t * dest, const uint8_t * ref, - const int stride, int height) + const ptrdiff_t line_size, int height) { unsigned long off = (unsigned long) ref & 0x7; unsigned long off_plus_1 = off + 1; @@ -2555,7 +2555,7 @@ static void MC_put_no_round_x_8_vis (uint8_t * dest, const uint8_t * ref, } static void MC_avg_no_round_x_16_vis (uint8_t * dest, const uint8_t * ref, - const int stride, int height) + const ptrdiff_t line_size, int height) { unsigned long off = (unsigned long) ref & 0x7; unsigned long off_plus_1 = off + 1; @@ -2645,7 +2645,7 @@ static void MC_avg_no_round_x_16_vis (uint8_t * dest, const uint8_t * ref, } static void MC_put_no_round_y_16_vis (uint8_t * dest, const uint8_t * ref, - const int stride, int height) + const ptrdiff_t line_size, int height) { ref = vis_alignaddr(ref); vis_ld64(ref[0], TMP0); @@ -2799,7 +2799,7 @@ static void MC_put_no_round_y_16_vis (uint8_t * dest, const uint8_t * ref, } static void MC_put_no_round_y_8_vis (uint8_t * dest, const uint8_t * ref, - const int stride, int height) + const ptrdiff_t line_size, int height) { ref = vis_alignaddr(ref); vis_ld64(ref[0], TMP0); @@ -2889,7 +2889,7 @@ static void MC_put_no_round_y_8_vis (uint8_t * dest, const uint8_t * ref, } static void MC_avg_no_round_y_16_vis (uint8_t * dest, const uint8_t * ref, - const int stride, int height) + const ptrdiff_t line_size, int height) { int stride_8 = stride + 8; int stride_16 = stride + 16; @@ -3017,7 +3017,7 @@ static void MC_avg_no_round_y_16_vis (uint8_t * dest, const uint8_t * ref, } static void MC_put_no_round_xy_16_vis (uint8_t * dest, const uint8_t * ref, - const int stride, int height) + const ptrdiff_t line_size, int height) { unsigned long off = (unsigned long) ref & 0x7; unsigned long off_plus_1 = off + 1; @@ -3181,7 +3181,7 @@ static void MC_put_no_round_xy_16_vis (uint8_t * dest, const uint8_t * ref, } static void MC_put_no_round_xy_8_vis (uint8_t * dest, const uint8_t * ref, - const int stride, int height) + const ptrdiff_t line_size, int height) { unsigned long off = (unsigned long) ref & 0x7; unsigned long off_plus_1 = off + 1; @@ -3285,7 +3285,7 @@ static void MC_put_no_round_xy_8_vis (uint8_t * dest, const uint8_t * ref, } static void MC_avg_no_round_xy_16_vis (uint8_t * dest, const uint8_t * ref, - const int stride, int height) + const ptrdiff_t line_size, int height) { unsigned long off = (unsigned long) ref & 0x7; unsigned long off_plus_1 = off + 1; diff --git a/libavcodec/x86/dsputil_avg_template.c b/libavcodec/x86/dsputil_avg_template.c index 90e4074f7a..2249ce6c97 100644 --- a/libavcodec/x86/dsputil_avg_template.c +++ b/libavcodec/x86/dsputil_avg_template.c @@ -27,14 +27,14 @@ //FIXME the following could be optimized too ... static void DEF(ff_put_no_rnd_pixels16_x2)(uint8_t *block, const uint8_t *pixels, - int line_size, int h) + ptrdiff_t line_size, int h) { DEF(ff_put_no_rnd_pixels8_x2)(block, pixels, line_size, h); DEF(ff_put_no_rnd_pixels8_x2)(block + 8, pixels + 8, line_size, h); } static void DEF(ff_put_pixels16_y2)(uint8_t *block, const uint8_t *pixels, - int line_size, int h) + ptrdiff_t line_size, int h) { DEF(ff_put_pixels8_y2)(block, pixels, line_size, h); DEF(ff_put_pixels8_y2)(block + 8, pixels + 8, line_size, h); @@ -42,35 +42,35 @@ static void DEF(ff_put_pixels16_y2)(uint8_t *block, const uint8_t *pixels, static void DEF(ff_put_no_rnd_pixels16_y2)(uint8_t *block, const uint8_t *pixels, - int line_size, int h) + ptrdiff_t line_size, int h) { DEF(ff_put_no_rnd_pixels8_y2)(block, pixels, line_size, h); DEF(ff_put_no_rnd_pixels8_y2)(block + 8, pixels + 8, line_size, h); } static void DEF(ff_avg_pixels16)(uint8_t *block, const uint8_t *pixels, - int line_size, int h) + ptrdiff_t line_size, int h) { DEF(ff_avg_pixels8)(block, pixels, line_size, h); DEF(ff_avg_pixels8)(block + 8, pixels + 8, line_size, h); } static void DEF(ff_avg_pixels16_x2)(uint8_t *block, const uint8_t *pixels, - int line_size, int h) + ptrdiff_t line_size, int h) { DEF(ff_avg_pixels8_x2)(block, pixels, line_size, h); DEF(ff_avg_pixels8_x2)(block + 8, pixels + 8, line_size, h); } static void DEF(ff_avg_pixels16_y2)(uint8_t *block, const uint8_t *pixels, - int line_size, int h) + ptrdiff_t line_size, int h) { DEF(ff_avg_pixels8_y2)(block, pixels, line_size, h); DEF(ff_avg_pixels8_y2)(block + 8, pixels + 8, line_size, h); } static void DEF(ff_avg_pixels16_xy2)(uint8_t *block, const uint8_t *pixels, - int line_size, int h) + ptrdiff_t line_size, int h) { DEF(ff_avg_pixels8_xy2)(block, pixels, line_size, h); DEF(ff_avg_pixels8_xy2)(block + 8, pixels + 8, line_size, h); diff --git a/libavcodec/x86/dsputil_mmx.c b/libavcodec/x86/dsputil_mmx.c index 3ccef6226d..b882c68a3b 100644 --- a/libavcodec/x86/dsputil_mmx.c +++ b/libavcodec/x86/dsputil_mmx.c @@ -83,9 +83,9 @@ DECLARE_ALIGNED(16, const double, ff_pd_2)[2] = { 2.0, 2.0 }; #if HAVE_YASM void ff_put_pixels8_x2_mmxext(uint8_t *block, const uint8_t *pixels, - int line_size, int h); + ptrdiff_t line_size, int h); void ff_put_pixels8_x2_3dnow(uint8_t *block, const uint8_t *pixels, - int line_size, int h); + ptrdiff_t line_size, int h); void ff_put_pixels8_l2_mmxext(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int src1Stride, int h); void ff_put_no_rnd_pixels8_l2_mmxext(uint8_t *dst, uint8_t *src1, @@ -94,9 +94,9 @@ void ff_put_no_rnd_pixels8_l2_mmxext(uint8_t *dst, uint8_t *src1, void ff_avg_pixels8_l2_mmxext(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int src1Stride, int h); void ff_put_pixels16_x2_mmxext(uint8_t *block, const uint8_t *pixels, - int line_size, int h); + ptrdiff_t line_size, int h); void ff_put_pixels16_x2_3dnow(uint8_t *block, const uint8_t *pixels, - int line_size, int h); + ptrdiff_t line_size, int h); void ff_put_pixels16_l2_mmxext(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int src1Stride, int h); void ff_avg_pixels16_l2_mmxext(uint8_t *dst, uint8_t *src1, uint8_t *src2, @@ -104,47 +104,47 @@ void ff_avg_pixels16_l2_mmxext(uint8_t *dst, uint8_t *src1, uint8_t *src2, void ff_put_no_rnd_pixels16_l2_mmxext(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int src1Stride, int h); void ff_put_no_rnd_pixels8_x2_mmxext(uint8_t *block, const uint8_t *pixels, - int line_size, int h); + ptrdiff_t line_size, int h); void ff_put_no_rnd_pixels8_x2_3dnow(uint8_t *block, const uint8_t *pixels, - int line_size, int h); + ptrdiff_t line_size, int h); void ff_put_no_rnd_pixels8_x2_exact_mmxext(uint8_t *block, const uint8_t *pixels, - int line_size, int h); + ptrdiff_t line_size, int h); void ff_put_no_rnd_pixels8_x2_exact_3dnow(uint8_t *block, const uint8_t *pixels, - int line_size, int h); + ptrdiff_t line_size, int h); void ff_put_pixels8_y2_mmxext(uint8_t *block, const uint8_t *pixels, - int line_size, int h); + ptrdiff_t line_size, int h); void ff_put_pixels8_y2_3dnow(uint8_t *block, const uint8_t *pixels, - int line_size, int h); + ptrdiff_t line_size, int h); void ff_put_no_rnd_pixels8_y2_mmxext(uint8_t *block, const uint8_t *pixels, - int line_size, int h); + ptrdiff_t line_size, int h); void ff_put_no_rnd_pixels8_y2_3dnow(uint8_t *block, const uint8_t *pixels, - int line_size, int h); + ptrdiff_t line_size, int h); void ff_put_no_rnd_pixels8_y2_exact_mmxext(uint8_t *block, const uint8_t *pixels, - int line_size, int h); + ptrdiff_t line_size, int h); void ff_put_no_rnd_pixels8_y2_exact_3dnow(uint8_t *block, const uint8_t *pixels, - int line_size, int h); + ptrdiff_t line_size, int h); void ff_avg_pixels8_mmxext(uint8_t *block, const uint8_t *pixels, - int line_size, int h); + ptrdiff_t line_size, int h); void ff_avg_pixels8_3dnow(uint8_t *block, const uint8_t *pixels, - int line_size, int h); + ptrdiff_t line_size, int h); void ff_avg_pixels8_x2_mmxext(uint8_t *block, const uint8_t *pixels, - int line_size, int h); + ptrdiff_t line_size, int h); void ff_avg_pixels8_x2_3dnow(uint8_t *block, const uint8_t *pixels, - int line_size, int h); + ptrdiff_t line_size, int h); void ff_avg_pixels8_y2_mmxext(uint8_t *block, const uint8_t *pixels, - int line_size, int h); + ptrdiff_t line_size, int h); void ff_avg_pixels8_y2_3dnow(uint8_t *block, const uint8_t *pixels, - int line_size, int h); + ptrdiff_t line_size, int h); void ff_avg_pixels8_xy2_mmxext(uint8_t *block, const uint8_t *pixels, - int line_size, int h); + ptrdiff_t line_size, int h); void ff_avg_pixels8_xy2_3dnow(uint8_t *block, const uint8_t *pixels, - int line_size, int h); + ptrdiff_t line_size, int h); -void ff_put_pixels8_mmxext(uint8_t *block, const uint8_t *pixels, int line_size, int h); +void ff_put_pixels8_mmxext(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h); static void ff_put_pixels16_mmxext(uint8_t *block, const uint8_t *pixels, int line_size, int h) { @@ -1455,9 +1455,9 @@ static void gmc_mmx(uint8_t *dst, uint8_t *src, #endif /* HAVE_INLINE_ASM */ void ff_put_pixels16_sse2(uint8_t *block, const uint8_t *pixels, - int line_size, int h); + ptrdiff_t line_size, int h); void ff_avg_pixels16_sse2(uint8_t *block, const uint8_t *pixels, - int line_size, int h); + ptrdiff_t line_size, int h); void ff_put_h264_chroma_mc8_rnd_mmx (uint8_t *dst, uint8_t *src, int stride, int h, int x, int y); diff --git a/libavcodec/x86/dsputil_rnd_template.c b/libavcodec/x86/dsputil_rnd_template.c index 7fcc6b7533..6ce926c6d1 100644 --- a/libavcodec/x86/dsputil_rnd_template.c +++ b/libavcodec/x86/dsputil_rnd_template.c @@ -25,7 +25,7 @@ */ // put_pixels -static void DEF(put, pixels8_x2)(uint8_t *block, const uint8_t *pixels, int line_size, int h) +static void DEF(put, pixels8_x2)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h) { MOVQ_BFE(mm6); __asm__ volatile( @@ -107,7 +107,7 @@ static void av_unused DEF(put, pixels8_l2)(uint8_t *dst, uint8_t *src1, uint8_t :"memory"); } -static void DEF(put, pixels16_x2)(uint8_t *block, const uint8_t *pixels, int line_size, int h) +static void DEF(put, pixels16_x2)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h) { MOVQ_BFE(mm6); __asm__ volatile( @@ -202,7 +202,7 @@ static void av_unused DEF(put, pixels16_l2)(uint8_t *dst, uint8_t *src1, uint8_t :"memory"); } -static void DEF(put, pixels8_y2)(uint8_t *block, const uint8_t *pixels, int line_size, int h) +static void DEF(put, pixels8_y2)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h) { MOVQ_BFE(mm6); __asm__ volatile( @@ -231,7 +231,7 @@ static void DEF(put, pixels8_y2)(uint8_t *block, const uint8_t *pixels, int line :REG_a, "memory"); } -static void DEF(put, pixels8_xy2)(uint8_t *block, const uint8_t *pixels, int line_size, int h) +static void DEF(put, pixels8_xy2)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h) { MOVQ_ZERO(mm7); SET_RND(mm6); // =2 for rnd and =1 for no_rnd version @@ -298,7 +298,7 @@ static void DEF(put, pixels8_xy2)(uint8_t *block, const uint8_t *pixels, int lin } // avg_pixels -static void av_unused DEF(avg, pixels4)(uint8_t *block, const uint8_t *pixels, int line_size, int h) +static void av_unused DEF(avg, pixels4)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h) { MOVQ_BFE(mm6); JUMPALIGN(); @@ -319,7 +319,7 @@ static void av_unused DEF(avg, pixels4)(uint8_t *block, const uint8_t *pixels, i #ifndef NO_RND // in case more speed is needed - unroling would certainly help -static void DEF(avg, pixels8)(uint8_t *block, const uint8_t *pixels, int line_size, int h) +static void DEF(avg, pixels8)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h) { MOVQ_BFE(mm6); JUMPALIGN(); @@ -339,7 +339,7 @@ static void DEF(avg, pixels8)(uint8_t *block, const uint8_t *pixels, int line_si } #endif // NO_RND -static void DEF(avg, pixels16)(uint8_t *block, const uint8_t *pixels, int line_size, int h) +static void DEF(avg, pixels16)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h) { MOVQ_BFE(mm6); JUMPALIGN(); @@ -363,7 +363,7 @@ static void DEF(avg, pixels16)(uint8_t *block, const uint8_t *pixels, int line_s } #ifndef NO_RND -static void DEF(avg, pixels8_x2)(uint8_t *block, const uint8_t *pixels, int line_size, int h) +static void DEF(avg, pixels8_x2)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h) { MOVQ_BFE(mm6); JUMPALIGN(); @@ -405,7 +405,7 @@ static av_unused void DEF(avg, pixels8_l2)(uint8_t *dst, uint8_t *src1, uint8_t } while (--h); } -static void DEF(avg, pixels16_x2)(uint8_t *block, const uint8_t *pixels, int line_size, int h) +static void DEF(avg, pixels16_x2)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h) { MOVQ_BFE(mm6); JUMPALIGN(); @@ -458,7 +458,7 @@ static av_unused void DEF(avg, pixels16_l2)(uint8_t *dst, uint8_t *src1, uint8_t } while (--h); } -static void DEF(avg, pixels8_y2)(uint8_t *block, const uint8_t *pixels, int line_size, int h) +static void DEF(avg, pixels8_y2)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h) { MOVQ_BFE(mm6); __asm__ volatile( @@ -498,7 +498,7 @@ static void DEF(avg, pixels8_y2)(uint8_t *block, const uint8_t *pixels, int line } // this routine is 'slightly' suboptimal but mostly unused -static void DEF(avg, pixels8_xy2)(uint8_t *block, const uint8_t *pixels, int line_size, int h) +static void DEF(avg, pixels8_xy2)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h) { MOVQ_ZERO(mm7); SET_RND(mm6); // =2 for rnd and =1 for no_rnd version @@ -573,22 +573,22 @@ static void DEF(avg, pixels8_xy2)(uint8_t *block, const uint8_t *pixels, int lin } //FIXME optimize -static void DEF(put, pixels16_y2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){ +static void DEF(put, pixels16_y2)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h){ DEF(put, pixels8_y2)(block , pixels , line_size, h); DEF(put, pixels8_y2)(block+8, pixels+8, line_size, h); } -static void DEF(put, pixels16_xy2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){ +static void DEF(put, pixels16_xy2)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h){ DEF(put, pixels8_xy2)(block , pixels , line_size, h); DEF(put, pixels8_xy2)(block+8, pixels+8, line_size, h); } -static void DEF(avg, pixels16_y2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){ +static void DEF(avg, pixels16_y2)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h){ DEF(avg, pixels8_y2)(block , pixels , line_size, h); DEF(avg, pixels8_y2)(block+8, pixels+8, line_size, h); } -static void DEF(avg, pixels16_xy2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){ +static void DEF(avg, pixels16_xy2)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h){ DEF(avg, pixels8_xy2)(block , pixels , line_size, h); DEF(avg, pixels8_xy2)(block+8, pixels+8, line_size, h); } diff --git a/libavcodec/x86/hpeldsp.asm b/libavcodec/x86/hpeldsp.asm index 920ae67630..d38186c857 100644 --- a/libavcodec/x86/hpeldsp.asm +++ b/libavcodec/x86/hpeldsp.asm @@ -25,10 +25,9 @@ cextern pb_1 SECTION_TEXT -; put_pixels8_x2(uint8_t *block, const uint8_t *pixels, int line_size, int h) +; put_pixels8_x2(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h) %macro PUT_PIXELS8_X2 0 cglobal put_pixels8_x2, 4,5 - movsxdifnidn r2, r2d lea r4, [r2*2] .loop: mova m0, [r1] @@ -58,10 +57,9 @@ INIT_MMX 3dnow PUT_PIXELS8_X2 -; put_pixels16_x2(uint8_t *block, const uint8_t *pixels, int line_size, int h) +; put_pixels16_x2(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h) %macro PUT_PIXELS_16 0 cglobal put_pixels16_x2, 4,5 - movsxdifnidn r2, r2d lea r4, [r2*2] .loop: mova m0, [r1] @@ -103,11 +101,10 @@ INIT_MMX 3dnow PUT_PIXELS_16 -; put_no_rnd_pixels8_x2(uint8_t *block, const uint8_t *pixels, int line_size, int h) +; put_no_rnd_pixels8_x2(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h) %macro PUT_NO_RND_PIXELS8_X2 0 cglobal put_no_rnd_pixels8_x2, 4,5 mova m6, [pb_1] - movsxdifnidn r2, r2d lea r4, [r2*2] .loop: mova m0, [r1] @@ -145,10 +142,9 @@ INIT_MMX 3dnow PUT_NO_RND_PIXELS8_X2 -; put_no_rnd_pixels8_x2_exact(uint8_t *block, const uint8_t *pixels, int line_size, int h) +; put_no_rnd_pixels8_x2_exact(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h) %macro PUT_NO_RND_PIXELS8_X2_EXACT 0 cglobal put_no_rnd_pixels8_x2_exact, 4,5 - movsxdifnidn r2, r2d lea r4, [r2*3] pcmpeqb m6, m6 .loop: @@ -193,10 +189,9 @@ INIT_MMX 3dnow PUT_NO_RND_PIXELS8_X2_EXACT -; put_pixels8_y2(uint8_t *block, const uint8_t *pixels, int line_size, int h) +; put_pixels8_y2(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h) %macro PUT_PIXELS8_Y2 0 cglobal put_pixels8_y2, 4,5 - movsxdifnidn r2, r2d lea r4, [r2*2] mova m0, [r1] sub r0, r2 @@ -228,11 +223,10 @@ INIT_MMX 3dnow PUT_PIXELS8_Y2 -; put_no_rnd_pixels8_y2(uint8_t *block, const uint8_t *pixels, int line_size, int h) +; put_no_rnd_pixels8_y2(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h) %macro PUT_NO_RND_PIXELS8_Y2 0 cglobal put_no_rnd_pixels8_y2, 4,5 mova m6, [pb_1] - movsxdifnidn r2, r2d lea r4, [r2+r2] mova m0, [r1] sub r0, r2 @@ -266,10 +260,9 @@ INIT_MMX 3dnow PUT_NO_RND_PIXELS8_Y2 -; put_no_rnd_pixels8_y2_exact(uint8_t *block, const uint8_t *pixels, int line_size, int h) +; put_no_rnd_pixels8_y2_exact(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h) %macro PUT_NO_RND_PIXELS8_Y2_EXACT 0 cglobal put_no_rnd_pixels8_y2_exact, 4,5 - movsxdifnidn r2, r2d lea r4, [r2*3] mova m0, [r1] pcmpeqb m6, m6 @@ -309,10 +302,9 @@ INIT_MMX 3dnow PUT_NO_RND_PIXELS8_Y2_EXACT -; avg_pixels8(uint8_t *block, const uint8_t *pixels, int line_size, int h) +; avg_pixels8(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h) %macro AVG_PIXELS8 0 cglobal avg_pixels8, 4,5 - movsxdifnidn r2, r2d lea r4, [r2*2] .loop: mova m0, [r0] @@ -340,10 +332,9 @@ INIT_MMX 3dnow AVG_PIXELS8 -; avg_pixels8_x2(uint8_t *block, const uint8_t *pixels, int line_size, int h) +; avg_pixels8_x2(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h) %macro AVG_PIXELS8_X2 0 cglobal avg_pixels8_x2, 4,5 - movsxdifnidn r2, r2d lea r4, [r2*2] .loop: mova m0, [r1] @@ -377,10 +368,9 @@ INIT_MMX 3dnow AVG_PIXELS8_X2 -; avg_pixels8_y2(uint8_t *block, const uint8_t *pixels, int line_size, int h) +; avg_pixels8_y2(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h) %macro AVG_PIXELS8_Y2 0 cglobal avg_pixels8_y2, 4,5 - movsxdifnidn r2, r2d lea r4, [r2*2] mova m0, [r1] sub r0, r2 @@ -420,11 +410,10 @@ INIT_MMX 3dnow AVG_PIXELS8_Y2 -; avg_pixels8_xy2(uint8_t *block, const uint8_t *pixels, int line_size, int h) +; avg_pixels8_xy2(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h) %macro AVG_PIXELS8_XY2 0 cglobal avg_pixels8_xy2, 4,5 mova m6, [pb_1] - movsxdifnidn r2, r2d lea r4, [r2*2] mova m0, [r1] pavgb m0, [r1+1] @@ -465,9 +454,8 @@ INIT_MMX 3dnow AVG_PIXELS8_XY2 INIT_XMM sse2 -; void put_pixels16_sse2(uint8_t *block, const uint8_t *pixels, int line_size, int h) +; void put_pixels16_sse2(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h) cglobal put_pixels16, 4,5,4 - movsxdifnidn r2, r2d lea r4, [r2*3] .loop: movu m0, [r1] @@ -484,9 +472,8 @@ cglobal put_pixels16, 4,5,4 jnz .loop REP_RET -; void avg_pixels16_sse2(uint8_t *block, const uint8_t *pixels, int line_size, int h) +; void avg_pixels16_sse2(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h) cglobal avg_pixels16, 4,5,4 - movsxdifnidn r2, r2d lea r4, [r2*3] .loop: movu m0, [r1] |