diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-02-06 12:18:25 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-02-06 12:18:25 +0100 |
commit | ede45c4e1da8bd2fefc89ea63e57a49e6c0a3e19 (patch) | |
tree | c288d3a3a358016a16aefbe702b454a9777cf98f /libavcodec | |
parent | 127ff88639e78b9d16fecb973c41b86a843b4fa7 (diff) | |
parent | 25841dfe806a13de526ae09c11149ab1f83555a8 (diff) | |
download | ffmpeg-ede45c4e1da8bd2fefc89ea63e57a49e6c0a3e19.tar.gz |
Merge commit '25841dfe806a13de526ae09c11149ab1f83555a8'
* commit '25841dfe806a13de526ae09c11149ab1f83555a8':
Use ptrdiff_t instead of int for {avg, put}_pixels line_size parameter.
Conflicts:
libavcodec/alpha/dsputil_alpha.c
libavcodec/dsputil_template.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/alpha/dsputil_alpha.c | 14 | ||||
-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 | 26 | ||||
-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, 185 insertions, 198 deletions
diff --git a/libavcodec/alpha/dsputil_alpha.c b/libavcodec/alpha/dsputil_alpha.c index 80d218aa54..0d856315a5 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 @@ -211,8 +211,8 @@ 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 *av_restrict block, const uint8_t *av_restrict pixels, \ - int line_size, int h) \ + (uint8_t *restrict block, const uint8_t *restrict pixels, \ + ptrdiff_t line_size, int h) \ { \ if ((size_t) pixels & 0x7) { \ OPKIND(uldq, STORE); \ @@ -222,8 +222,8 @@ static void OPNAME ## _pixels ## SUFF ## _axp \ } \ \ static void OPNAME ## _pixels16 ## SUFF ## _axp \ - (uint8_t *av_restrict block, const uint8_t *av_restrict pixels, \ - int line_size, int h) \ + (uint8_t *restrict block, const uint8_t *restrict pixels, \ + 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 cdb51358de..16f2d5e6b3 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 ea75c3cc12..8a24c57467 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 dc126fef8a..9fd33f935b 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 3050e8cce4..3987199aa9 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 da6edb5e5e..656fe0e00a 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 b1eba49915..4fea90f666 100644 --- a/libavcodec/dsputil.h +++ b/libavcodec/dsputil.h @@ -144,7 +144,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 7e20995a1d..ceaebea439 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,11 +288,11 @@ 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 *p_block, const uint8_t *p_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*)p_block;\ - const pixel *pixels = (const pixel*)p_pixels;\ + pixel *block = (pixel*)_block;\ + const pixel *pixels = (const pixel*)_pixels;\ line_size >>= sizeof(pixel)-1;\ a0= pixels[0];\ b0= pixels[1] + 2;\ @@ -324,7 +324,7 @@ static inline void FUNCC(OPNAME ## _pixels2_xy2)(uint8_t *p_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 ce61cab15b..5fafb1bb13 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 ab8e3b7fb1..1527bd0245 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 0b5e404225..f23ceaf337 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 fcea3c346b..14274091c0 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 74c5203215..9da80ca778 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 414667c609..b9a8f83400 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 2e8300a788..271d2b3818 100644 --- a/libavcodec/x86/dsputil_mmx.c +++ b/libavcodec/x86/dsputil_mmx.c @@ -84,9 +84,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, @@ -95,9 +95,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, @@ -105,47 +105,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) { @@ -1522,9 +1522,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 c4790af5b7..4568207a2e 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 7f0c285fa3..c83c38870b 100644 --- a/libavcodec/x86/hpeldsp.asm +++ b/libavcodec/x86/hpeldsp.asm @@ -32,10 +32,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] @@ -65,10 +64,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] @@ -110,11 +108,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] @@ -152,10 +149,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: @@ -200,10 +196,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 @@ -235,11 +230,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 @@ -273,10 +267,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 @@ -316,10 +309,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] @@ -347,10 +339,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] @@ -384,10 +375,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 @@ -427,11 +417,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] @@ -472,9 +461,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] @@ -491,9 +479,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] |