diff options
author | James Almer <jamrial@gmail.com> | 2017-03-21 14:29:52 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2017-03-21 14:29:52 -0300 |
commit | 5a49097b42cbc3eab888d15a91eeaf5520b5c381 (patch) | |
tree | 080300f20bca98deac895f2ca86a25b72a8428e8 | |
parent | 2c8a3aa985acc906ecab37357f2798da7cb9822d (diff) | |
parent | 2ec9fa5ec60dcd10e1cb10d8b4e4437e634ea428 (diff) | |
download | ffmpeg-5a49097b42cbc3eab888d15a91eeaf5520b5c381.tar.gz |
Merge commit '2ec9fa5ec60dcd10e1cb10d8b4e4437e634ea428'
* commit '2ec9fa5ec60dcd10e1cb10d8b4e4437e634ea428':
idct: Change type of array stride parameters to ptrdiff_t
Merged-by: James Almer <jamrial@gmail.com>
40 files changed, 180 insertions, 161 deletions
diff --git a/doc/optimization.txt b/doc/optimization.txt index b4b0a064c3..c39e1e37b9 100644 --- a/doc/optimization.txt +++ b/doc/optimization.txt @@ -142,7 +142,7 @@ Alignment: Some instructions on some architectures have strict alignment restrictions, for example most SSE/SSE2 instructions on x86. The minimum guaranteed alignment is written in the .h files, for example: - void (*put_pixels_clamped)(const int16_t *block/*align 16*/, UINT8 *pixels/*align 8*/, int line_size); + void (*put_pixels_clamped)(const int16_t *block/*align 16*/, uint8_t *pixels/*align 8*/, ptrdiff_t stride); General Tips: diff --git a/libavcodec/aarch64/idct.h b/libavcodec/aarch64/idct.h index 05699c2286..5c49046148 100644 --- a/libavcodec/aarch64/idct.h +++ b/libavcodec/aarch64/idct.h @@ -22,7 +22,7 @@ #include <stdint.h> void ff_simple_idct_neon(int16_t *data); -void ff_simple_idct_put_neon(uint8_t *dest, int line_size, int16_t *data); -void ff_simple_idct_add_neon(uint8_t *dest, int line_size, int16_t *data); +void ff_simple_idct_put_neon(uint8_t *dest, ptrdiff_t line_size, int16_t *data); +void ff_simple_idct_add_neon(uint8_t *dest, ptrdiff_t line_size, int16_t *data); #endif /* AVCODEC_AARCH64_IDCT_H */ diff --git a/libavcodec/alpha/idctdsp_alpha.h b/libavcodec/alpha/idctdsp_alpha.h index bf984950f2..8cc969d7de 100644 --- a/libavcodec/alpha/idctdsp_alpha.h +++ b/libavcodec/alpha/idctdsp_alpha.h @@ -28,7 +28,7 @@ extern void (*add_pixels_clamped_axp_p)(const int16_t *block, uint8_t *pixels, ptrdiff_t line_size); void ff_simple_idct_axp(int16_t *block); -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 ff_simple_idct_put_axp(uint8_t *dest, ptrdiff_t line_size, int16_t *block); +void ff_simple_idct_add_axp(uint8_t *dest, ptrdiff_t line_size, int16_t *block); #endif /* AVCODEC_ALPHA_IDCTDSP_ALPHA_H */ diff --git a/libavcodec/alpha/simple_idct_alpha.c b/libavcodec/alpha/simple_idct_alpha.c index 04be0cef06..6e377ef243 100644 --- a/libavcodec/alpha/simple_idct_alpha.c +++ b/libavcodec/alpha/simple_idct_alpha.c @@ -290,13 +290,13 @@ void ff_simple_idct_axp(int16_t *block) } } -void ff_simple_idct_put_axp(uint8_t *dest, int line_size, int16_t *block) +void ff_simple_idct_put_axp(uint8_t *dest, ptrdiff_t line_size, int16_t *block) { ff_simple_idct_axp(block); put_pixels_clamped_axp_p(block, dest, line_size); } -void ff_simple_idct_add_axp(uint8_t *dest, int line_size, int16_t *block) +void ff_simple_idct_add_axp(uint8_t *dest, ptrdiff_t line_size, int16_t *block) { ff_simple_idct_axp(block); add_pixels_clamped_axp_p(block, dest, line_size); diff --git a/libavcodec/arm/idct.h b/libavcodec/arm/idct.h index 39cef3a874..6c79a69c5f 100644 --- a/libavcodec/arm/idct.h +++ b/libavcodec/arm/idct.h @@ -19,6 +19,7 @@ #ifndef AVCODEC_ARM_IDCT_H #define AVCODEC_ARM_IDCT_H +#include <stddef.h> #include <stdint.h> void ff_j_rev_dct_arm(int16_t *data); @@ -26,15 +27,15 @@ void ff_j_rev_dct_arm(int16_t *data); void ff_simple_idct_arm(int16_t *data); void ff_simple_idct_armv5te(int16_t *data); -void ff_simple_idct_put_armv5te(uint8_t *dest, int line_size, int16_t *data); -void ff_simple_idct_add_armv5te(uint8_t *dest, int line_size, int16_t *data); +void ff_simple_idct_put_armv5te(uint8_t *dest, ptrdiff_t line_size, int16_t *data); +void ff_simple_idct_add_armv5te(uint8_t *dest, ptrdiff_t line_size, int16_t *data); 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_simple_idct_put_armv6(uint8_t *dest, ptrdiff_t line_size, int16_t *data); +void ff_simple_idct_add_armv6(uint8_t *dest, ptrdiff_t line_size, int16_t *data); void ff_simple_idct_neon(int16_t *data); -void ff_simple_idct_put_neon(uint8_t *dest, int line_size, int16_t *data); -void ff_simple_idct_add_neon(uint8_t *dest, int line_size, int16_t *data); +void ff_simple_idct_put_neon(uint8_t *dest, ptrdiff_t line_size, int16_t *data); +void ff_simple_idct_add_neon(uint8_t *dest, ptrdiff_t line_size, int16_t *data); #endif /* AVCODEC_ARM_IDCT_H */ diff --git a/libavcodec/arm/idctdsp_init_arm.c b/libavcodec/arm/idctdsp_init_arm.c index 0068e3f86c..43782b238a 100644 --- a/libavcodec/arm/idctdsp_init_arm.c +++ b/libavcodec/arm/idctdsp_init_arm.c @@ -19,6 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include <stddef.h> #include <stdint.h> #include "libavutil/attributes.h" @@ -34,25 +35,29 @@ void ff_add_pixels_clamped_arm(const int16_t *block, uint8_t *dest, /* XXX: those functions should be suppressed ASAP when all IDCTs are * converted */ -static void j_rev_dct_arm_put(uint8_t *dest, int line_size, int16_t *block) +static void j_rev_dct_arm_put(uint8_t *dest, ptrdiff_t line_size, + int16_t *block) { ff_j_rev_dct_arm(block); ff_put_pixels_clamped(block, dest, line_size); } -static void j_rev_dct_arm_add(uint8_t *dest, int line_size, int16_t *block) +static void j_rev_dct_arm_add(uint8_t *dest, ptrdiff_t line_size, + int16_t *block) { ff_j_rev_dct_arm(block); ff_add_pixels_clamped(block, dest, line_size); } -static void simple_idct_arm_put(uint8_t *dest, int line_size, int16_t *block) +static void simple_idct_arm_put(uint8_t *dest, ptrdiff_t line_size, + int16_t *block) { ff_simple_idct_arm(block); ff_put_pixels_clamped(block, dest, line_size); } -static void simple_idct_arm_add(uint8_t *dest, int line_size, int16_t *block) +static void simple_idct_arm_add(uint8_t *dest, ptrdiff_t line_size, + int16_t *block) { ff_simple_idct_arm(block); ff_add_pixels_clamped(block, dest, line_size); diff --git a/libavcodec/arm/simple_idct_armv6.S b/libavcodec/arm/simple_idct_armv6.S index 79cf5d41fb..f95c20d295 100644 --- a/libavcodec/arm/simple_idct_armv6.S +++ b/libavcodec/arm/simple_idct_armv6.S @@ -390,7 +390,7 @@ function ff_simple_idct_armv6, export=1 pop {r4-r11, pc} endfunc -/* ff_simple_idct_add_armv6(uint8_t *dest, int line_size, int16_t *data); */ +/* ff_simple_idct_add_armv6(uint8_t *dest, ptrdiff_t line_size, int16_t *data); */ function ff_simple_idct_add_armv6, export=1 push {r0, r1, r4-r11, lr} sub sp, sp, #128 @@ -407,7 +407,7 @@ function ff_simple_idct_add_armv6, export=1 pop {r4-r11, pc} endfunc -/* ff_simple_idct_put_armv6(uint8_t *dest, int line_size, int16_t *data); */ +/* ff_simple_idct_put_armv6(uint8_t *dest, ptrdiff_t line_size, int16_t *data); */ function ff_simple_idct_put_armv6, export=1 push {r0, r1, r4-r11, lr} sub sp, sp, #128 diff --git a/libavcodec/arm/simple_idct_neon.S b/libavcodec/arm/simple_idct_neon.S index c3e573c00a..726d4cbefa 100644 --- a/libavcodec/arm/simple_idct_neon.S +++ b/libavcodec/arm/simple_idct_neon.S @@ -261,7 +261,7 @@ endconst pop {r4-r7, pc} .endm -/* void ff_simple_idct_put_neon(uint8_t *dst, int line_size, int16_t *data); */ +/* void ff_simple_idct_put_neon(uint8_t *dst, ptrdiff_t line_size, int16_t *data); */ function ff_simple_idct_put_neon, export=1 idct_start r2 @@ -316,7 +316,7 @@ function idct_col4_add8_neon bx lr endfunc -/* void ff_simple_idct_add_neon(uint8_t *dst, int line_size, int16_t *data); */ +/* void ff_simple_idct_add_neon(uint8_t *dst, ptrdiff_t line_size, int16_t *data); */ function ff_simple_idct_add_neon, export=1 idct_start r2 diff --git a/libavcodec/arm/vc1dsp_init_neon.c b/libavcodec/arm/vc1dsp_init_neon.c index bb873e687e..c3401441eb 100644 --- a/libavcodec/arm/vc1dsp_init_neon.c +++ b/libavcodec/arm/vc1dsp_init_neon.c @@ -25,14 +25,14 @@ #include "config.h" void ff_vc1_inv_trans_8x8_neon(int16_t *block); -void ff_vc1_inv_trans_4x8_neon(uint8_t *dest, int linesize, int16_t *block); -void ff_vc1_inv_trans_8x4_neon(uint8_t *dest, int linesize, int16_t *block); -void ff_vc1_inv_trans_4x4_neon(uint8_t *dest, int linesize, int16_t *block); - -void ff_vc1_inv_trans_8x8_dc_neon(uint8_t *dest, int linesize, int16_t *block); -void ff_vc1_inv_trans_4x8_dc_neon(uint8_t *dest, int linesize, int16_t *block); -void ff_vc1_inv_trans_8x4_dc_neon(uint8_t *dest, int linesize, int16_t *block); -void ff_vc1_inv_trans_4x4_dc_neon(uint8_t *dest, int linesize, int16_t *block); +void ff_vc1_inv_trans_4x8_neon(uint8_t *dest, ptrdiff_t stride, int16_t *block); +void ff_vc1_inv_trans_8x4_neon(uint8_t *dest, ptrdiff_t stride, int16_t *block); +void ff_vc1_inv_trans_4x4_neon(uint8_t *dest, ptrdiff_t stride, int16_t *block); + +void ff_vc1_inv_trans_8x8_dc_neon(uint8_t *dest, ptrdiff_t stride, int16_t *block); +void ff_vc1_inv_trans_4x8_dc_neon(uint8_t *dest, ptrdiff_t stride, int16_t *block); +void ff_vc1_inv_trans_8x4_dc_neon(uint8_t *dest, ptrdiff_t stride, int16_t *block); +void ff_vc1_inv_trans_4x4_dc_neon(uint8_t *dest, ptrdiff_t stride, int16_t *block); void ff_put_pixels8x8_neon(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int rnd); diff --git a/libavcodec/arm/vc1dsp_neon.S b/libavcodec/arm/vc1dsp_neon.S index c4f4db9c8e..611cbf2234 100644 --- a/libavcodec/arm/vc1dsp_neon.S +++ b/libavcodec/arm/vc1dsp_neon.S @@ -426,7 +426,7 @@ function ff_vc1_inv_trans_8x8_neon, export=1 bx lr endfunc -@ (uint8_t *dest [r0], int linesize [r1], int16_t *block [r2]) +@ (uint8_t *dest [r0], ptrdiff_t stride [r1], int16_t *block [r2]) function ff_vc1_inv_trans_8x4_neon, export=1 vld1.64 {q0-q1}, [r2,:128]! @ load 8 * 4 * 2 = 64 bytes / 16 bytes per quad = 4 quad registers vld1.64 {q2-q3}, [r2,:128] @@ -511,7 +511,7 @@ function ff_vc1_inv_trans_8x4_neon, export=1 bx lr endfunc -@ (uint8_t *dest [r0], int linesize [r1], int16_t *block [r2]) +@ (uint8_t *dest [r0], ptrdiff_t stride [r1], int16_t *block [r2]) function ff_vc1_inv_trans_4x8_neon, export=1 mov r12, #(8 * 2) @ 8 elements per line, each element 2 bytes vld4.16 {d0[], d2[], d4[], d6[]}, [r2,:64], r12 @ read each column into a q register @@ -593,7 +593,7 @@ endfunc vshr.s16 q1, q1, #\rshift @ dst[3,1] >>= rshift .endm -@ (uint8_t *dest [r0], int linesize [r1], int16_t *block [r2]) +@ (uint8_t *dest [r0], ptrdiff_t stride [r1], int16_t *block [r2]) function ff_vc1_inv_trans_4x4_neon, export=1 mov r12, #(8 * 2) @ 8 elements per line, each element 2 bytes vld4.16 {d0[], d1[], d2[], d3[]}, [r2,:64], r12 @ read each column into a register diff --git a/libavcodec/dct.h b/libavcodec/dct.h index 05297ba9db..0a03e256d1 100644 --- a/libavcodec/dct.h +++ b/libavcodec/dct.h @@ -24,6 +24,7 @@ #if !defined(AVCODEC_DCT_H) && (!defined(FFT_FLOAT) || FFT_FLOAT) #define AVCODEC_DCT_H +#include <stddef.h> #include <stdint.h> #include "rdft.h" @@ -62,7 +63,7 @@ void ff_j_rev_dct(int16_t *data); void ff_j_rev_dct4(int16_t *data); void ff_j_rev_dct2(int16_t *data); void ff_j_rev_dct1(int16_t *data); -void ff_jref_idct_put(uint8_t *dest, int line_size, int16_t *block); -void ff_jref_idct_add(uint8_t *dest, int line_size, int16_t *block); +void ff_jref_idct_put(uint8_t *dest, ptrdiff_t line_size, int16_t *block); +void ff_jref_idct_add(uint8_t *dest, ptrdiff_t line_size, int16_t *block); #endif /* AVCODEC_DCT_H */ diff --git a/libavcodec/dv.h b/libavcodec/dv.h index d5482d1aa6..6350a16dff 100644 --- a/libavcodec/dv.h +++ b/libavcodec/dv.h @@ -47,7 +47,7 @@ typedef struct DVVideoContext { void (*get_pixels)(int16_t *block, const uint8_t *pixels, ptrdiff_t linesize); void (*fdct[2])(int16_t *block); - void (*idct_put[2])(uint8_t *dest, int line_size, int16_t *block); + void (*idct_put[2])(uint8_t *dest, ptrdiff_t stride, int16_t *block); me_cmp_func ildct_cmp; DVwork_chunk work_chunks[4 * 12 * 27]; uint32_t idct_factor[2 * 4 * 16 * 64]; diff --git a/libavcodec/dvdec.c b/libavcodec/dvdec.c index 0b4c1bc287..d71a660f9d 100644 --- a/libavcodec/dvdec.c +++ b/libavcodec/dvdec.c @@ -54,7 +54,7 @@ typedef struct BlockInfo { const uint32_t *factor_table; const uint8_t *scan_table; uint8_t pos; /* position in block */ - void (*idct_put)(uint8_t *dest, int line_size, int16_t *block); + void (*idct_put)(uint8_t *dest, ptrdiff_t stride, int16_t *block); uint8_t partial_bit_count; uint32_t partial_bit_buffer; int shift_offset; diff --git a/libavcodec/faanidct.c b/libavcodec/faanidct.c index 2aab726850..3921f82dae 100644 --- a/libavcodec/faanidct.c +++ b/libavcodec/faanidct.c @@ -47,7 +47,9 @@ B6*B0/8, B6*B1/8, B6*B2/8, B6*B3/8, B6*B4/8, B6*B5/8, B6*B6/8, B6*B7/8, B7*B0/8, B7*B1/8, B7*B2/8, B7*B3/8, B7*B4/8, B7*B5/8, B7*B6/8, B7*B7/8, }; -static inline void p8idct(int16_t data[64], FLOAT temp[64], uint8_t *dest, int stride, int x, int y, int type){ +static inline void p8idct(int16_t data[64], FLOAT temp[64], uint8_t *dest, + ptrdiff_t stride, int x, int y, int type) +{ int i; FLOAT s04, d04, s17, d17, s26, d26, s53, d53; FLOAT os07, os16, os25, os34; @@ -135,7 +137,8 @@ void ff_faanidct(int16_t block[64]){ p8idct(block, temp, NULL, 0, 8, 1, 1); } -void ff_faanidct_add(uint8_t *dest, int line_size, int16_t block[64]){ +void ff_faanidct_add(uint8_t *dest, ptrdiff_t line_size, int16_t block[64]) +{ FLOAT temp[64]; int i; @@ -148,7 +151,8 @@ void ff_faanidct_add(uint8_t *dest, int line_size, int16_t block[64]){ p8idct(NULL , temp, dest, line_size, 8, 1, 2); } -void ff_faanidct_put(uint8_t *dest, int line_size, int16_t block[64]){ +void ff_faanidct_put(uint8_t *dest, ptrdiff_t line_size, int16_t block[64]) +{ FLOAT temp[64]; int i; diff --git a/libavcodec/faanidct.h b/libavcodec/faanidct.h index 4cd2c7858f..6f4da67c1b 100644 --- a/libavcodec/faanidct.h +++ b/libavcodec/faanidct.h @@ -22,10 +22,11 @@ #ifndef AVCODEC_FAANIDCT_H #define AVCODEC_FAANIDCT_H +#include <stddef.h> #include <stdint.h> void ff_faanidct(int16_t block[64]); -void ff_faanidct_add(uint8_t *dest, int line_size, int16_t block[64]); -void ff_faanidct_put(uint8_t *dest, int line_size, int16_t block[64]); +void ff_faanidct_add(uint8_t *dest, ptrdiff_t line_size, int16_t block[64]); +void ff_faanidct_put(uint8_t *dest, ptrdiff_t line_size, int16_t block[64]); #endif /* AVCODEC_FAANIDCT_H */ diff --git a/libavcodec/idctdsp.c b/libavcodec/idctdsp.c index 37f4640f0d..84dd6457bd 100644 --- a/libavcodec/idctdsp.c +++ b/libavcodec/idctdsp.c @@ -207,33 +207,33 @@ static void add_pixels_clamped2_c(const int16_t *block, uint8_t *av_restrict pix } } -static void ff_jref_idct4_put(uint8_t *dest, int line_size, int16_t *block) +static void ff_jref_idct4_put(uint8_t *dest, ptrdiff_t line_size, int16_t *block) { ff_j_rev_dct4 (block); put_pixels_clamped4_c(block, dest, line_size); } -static void ff_jref_idct4_add(uint8_t *dest, int line_size, int16_t *block) +static void ff_jref_idct4_add(uint8_t *dest, ptrdiff_t line_size, int16_t *block) { ff_j_rev_dct4 (block); add_pixels_clamped4_c(block, dest, line_size); } -static void ff_jref_idct2_put(uint8_t *dest, int line_size, int16_t *block) +static void ff_jref_idct2_put(uint8_t *dest, ptrdiff_t line_size, int16_t *block) { ff_j_rev_dct2 (block); put_pixels_clamped2_c(block, dest, line_size); } -static void ff_jref_idct2_add(uint8_t *dest, int line_size, int16_t *block) +static void ff_jref_idct2_add(uint8_t *dest, ptrdiff_t line_size, int16_t *block) { ff_j_rev_dct2 (block); add_pixels_clamped2_c(block, dest, line_size); } -static void ff_jref_idct1_put(uint8_t *dest, int line_size, int16_t *block) +static void ff_jref_idct1_put(uint8_t *dest, ptrdiff_t line_size, int16_t *block) { dest[0] = av_clip_uint8((block[0] + 4)>>3); } -static void ff_jref_idct1_add(uint8_t *dest, int line_size, int16_t *block) +static void ff_jref_idct1_add(uint8_t *dest, ptrdiff_t line_size, int16_t *block) { dest[0] = av_clip_uint8(dest[0] + ((block[0] + 4)>>3)); } diff --git a/libavcodec/idctdsp.h b/libavcodec/idctdsp.h index e449be310f..abfa587218 100644 --- a/libavcodec/idctdsp.h +++ b/libavcodec/idctdsp.h @@ -68,14 +68,14 @@ typedef struct IDCTDSPContext { * @param line_size size in bytes of a horizontal line of dest */ void (*idct_put)(uint8_t *dest /* align 8 */, - int line_size, int16_t *block /* align 16 */); + ptrdiff_t line_size, int16_t *block /* align 16 */); /** * block -> idct -> add dest -> clip to unsigned 8 bit -> dest. * @param line_size size in bytes of a horizontal line of dest */ void (*idct_add)(uint8_t *dest /* align 8 */, - int line_size, int16_t *block /* align 16 */); + ptrdiff_t line_size, int16_t *block /* align 16 */); /** * IDCT input permutation. diff --git a/libavcodec/jrevdct.c b/libavcodec/jrevdct.c index 55a7392e98..89dd9f2fca 100644 --- a/libavcodec/jrevdct.c +++ b/libavcodec/jrevdct.c @@ -1156,13 +1156,13 @@ void ff_j_rev_dct1(DCTBLOCK data){ #undef FIX #undef CONST_BITS -void ff_jref_idct_put(uint8_t *dest, int line_size, int16_t *block) +void ff_jref_idct_put(uint8_t *dest, ptrdiff_t line_size, int16_t *block) { ff_j_rev_dct(block); ff_put_pixels_clamped(block, dest, line_size); } -void ff_jref_idct_add(uint8_t *dest, int line_size, int16_t *block) +void ff_jref_idct_add(uint8_t *dest, ptrdiff_t line_size, int16_t *block) { ff_j_rev_dct(block); ff_add_pixels_clamped(block, dest, line_size); diff --git a/libavcodec/mips/idctdsp_mips.h b/libavcodec/mips/idctdsp_mips.h index 19267e6705..7ca7c1c93f 100644 --- a/libavcodec/mips/idctdsp_mips.h +++ b/libavcodec/mips/idctdsp_mips.h @@ -34,11 +34,11 @@ void ff_add_pixels_clamped_msa(const int16_t *block, uint8_t *av_restrict pixels, ptrdiff_t line_size); void ff_j_rev_dct_msa(int16_t *data); -void ff_jref_idct_put_msa(uint8_t *dest, int32_t stride, int16_t *block); -void ff_jref_idct_add_msa(uint8_t *dest, int32_t stride, int16_t *block); +void ff_jref_idct_put_msa(uint8_t *dest, ptrdiff_t stride, int16_t *block); +void ff_jref_idct_add_msa(uint8_t *dest, ptrdiff_t stride, int16_t *block); void ff_simple_idct_msa(int16_t *block); -void ff_simple_idct_put_msa(uint8_t *dest, int32_t stride_dst, int16_t *block); -void ff_simple_idct_add_msa(uint8_t *dest, int32_t stride_dst, int16_t *block); +void ff_simple_idct_put_msa(uint8_t *dest, ptrdiff_t stride_dst, int16_t *block); +void ff_simple_idct_add_msa(uint8_t *dest, ptrdiff_t stride_dst, int16_t *block); void ff_put_pixels_clamped_mmi(const int16_t *block, uint8_t *av_restrict pixels, ptrdiff_t line_size); @@ -47,7 +47,7 @@ void ff_put_signed_pixels_clamped_mmi(const int16_t *block, void ff_add_pixels_clamped_mmi(const int16_t *block, uint8_t *av_restrict pixels, ptrdiff_t line_size); void ff_simple_idct_mmi(int16_t *block); -void ff_simple_idct_put_mmi(uint8_t *dest, int32_t line_size, int16_t *block); -void ff_simple_idct_add_mmi(uint8_t *dest, int32_t line_size, int16_t *block); +void ff_simple_idct_put_mmi(uint8_t *dest, ptrdiff_t line_size, int16_t *block); +void ff_simple_idct_add_mmi(uint8_t *dest, ptrdiff_t line_size, int16_t *block); #endif // #ifndef AVCODEC_MIPS_IDCTDSP_MIPS_H diff --git a/libavcodec/mips/simple_idct_msa.c b/libavcodec/mips/simple_idct_msa.c index bd8b31012f..8a7235927e 100644 --- a/libavcodec/mips/simple_idct_msa.c +++ b/libavcodec/mips/simple_idct_msa.c @@ -562,12 +562,12 @@ void ff_simple_idct_msa(int16_t *block) simple_idct_msa(block); } -void ff_simple_idct_put_msa(uint8_t *dst, int32_t dst_stride, int16_t *block) +void ff_simple_idct_put_msa(uint8_t *dst, ptrdiff_t dst_stride, int16_t *block) { simple_idct_put_msa(dst, dst_stride, block); } -void ff_simple_idct_add_msa(uint8_t *dst, int32_t dst_stride, int16_t *block) +void ff_simple_idct_add_msa(uint8_t *dst, ptrdiff_t dst_stride, int16_t *block) { simple_idct_add_msa(dst, dst_stride, block); } diff --git a/libavcodec/mips/vc1dsp_mips.h b/libavcodec/mips/vc1dsp_mips.h index 2cdd90069b..b9b07e1ce3 100644 --- a/libavcodec/mips/vc1dsp_mips.h +++ b/libavcodec/mips/vc1dsp_mips.h @@ -157,14 +157,14 @@ void ff_avg_vc1_mspel_mc33_16_mmi(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int rnd); void ff_vc1_inv_trans_8x8_mmi(int16_t block[64]); -void ff_vc1_inv_trans_8x4_mmi(uint8_t *dest, int linesize, int16_t *block); -void ff_vc1_inv_trans_4x8_mmi(uint8_t *dest, int linesize, int16_t *block); -void ff_vc1_inv_trans_4x4_mmi(uint8_t *dest, int linesize, int16_t *block); +void ff_vc1_inv_trans_8x4_mmi(uint8_t *dest, ptrdiff_t linesize, int16_t *block); +void ff_vc1_inv_trans_4x8_mmi(uint8_t *dest, ptrdiff_t linesize, int16_t *block); +void ff_vc1_inv_trans_4x4_mmi(uint8_t *dest, ptrdiff_t linesize, int16_t *block); -void ff_vc1_inv_trans_4x4_dc_mmi(uint8_t *dest, int linesize, int16_t *block); -void ff_vc1_inv_trans_4x8_dc_mmi(uint8_t *dest, int linesize, int16_t *block); -void ff_vc1_inv_trans_8x4_dc_mmi(uint8_t *dest, int linesize, int16_t *block); -void ff_vc1_inv_trans_8x8_dc_mmi(uint8_t *dest, int linesize, int16_t *block); +void ff_vc1_inv_trans_4x4_dc_mmi(uint8_t *dest, ptrdiff_t linesize, int16_t *block); +void ff_vc1_inv_trans_4x8_dc_mmi(uint8_t *dest, ptrdiff_t linesize, int16_t *block); +void ff_vc1_inv_trans_8x4_dc_mmi(uint8_t *dest, ptrdiff_t linesize, int16_t *block); +void ff_vc1_inv_trans_8x8_dc_mmi(uint8_t *dest, ptrdiff_t linesize, int16_t *block); void ff_vc1_v_overlap_mmi(uint8_t *src, int stride); void ff_vc1_h_overlap_mmi(uint8_t *src, int stride); diff --git a/libavcodec/mips/vc1dsp_mmi.c b/libavcodec/mips/vc1dsp_mmi.c index dfae2d9658..01e7f9f32c 100644 --- a/libavcodec/mips/vc1dsp_mmi.c +++ b/libavcodec/mips/vc1dsp_mmi.c @@ -141,7 +141,7 @@ /* Do inverse transform on 8x8 block */ -void ff_vc1_inv_trans_8x8_dc_mmi(uint8_t *dest, int linesize, int16_t *block) +void ff_vc1_inv_trans_8x8_dc_mmi(uint8_t *dest, ptrdiff_t linesize, int16_t *block) { int dc = block[0]; double ftmp[9]; @@ -368,7 +368,7 @@ void ff_vc1_inv_trans_8x8_mmi(int16_t block[64]) #endif /* Do inverse transform on 8x4 part of block */ -void ff_vc1_inv_trans_8x4_dc_mmi(uint8_t *dest, int linesize, int16_t *block) +void ff_vc1_inv_trans_8x4_dc_mmi(uint8_t *dest, ptrdiff_t linesize, int16_t *block) { int dc = block[0]; double ftmp[9]; @@ -425,7 +425,7 @@ void ff_vc1_inv_trans_8x4_dc_mmi(uint8_t *dest, int linesize, int16_t *block) } #if _MIPS_SIM != _ABIO32 -void ff_vc1_inv_trans_8x4_mmi(uint8_t *dest, int linesize, int16_t *block) +void ff_vc1_inv_trans_8x4_mmi(uint8_t *dest, ptrdiff_t linesize, int16_t *block) { int16_t *src = block; int16_t *dst = block; @@ -599,7 +599,7 @@ void ff_vc1_inv_trans_8x4_mmi(uint8_t *dest, int linesize, int16_t *block) #endif /* Do inverse transform on 4x8 parts of block */ -void ff_vc1_inv_trans_4x8_dc_mmi(uint8_t *dest, int linesize, int16_t *block) +void ff_vc1_inv_trans_4x8_dc_mmi(uint8_t *dest, ptrdiff_t linesize, int16_t *block) { int dc = block[0]; double ftmp[9]; @@ -672,7 +672,7 @@ void ff_vc1_inv_trans_4x8_dc_mmi(uint8_t *dest, int linesize, int16_t *block) } #if _MIPS_SIM != _ABIO32 -void ff_vc1_inv_trans_4x8_mmi(uint8_t *dest, int linesize, int16_t *block) +void ff_vc1_inv_trans_4x8_mmi(uint8_t *dest, ptrdiff_t linesize, int16_t *block) { int16_t *src = block; int16_t *dst = block; @@ -838,7 +838,7 @@ void ff_vc1_inv_trans_4x8_mmi(uint8_t *dest, int linesize, int16_t *block) #endif /* Do inverse transform on 4x4 part of block */ -void ff_vc1_inv_trans_4x4_dc_mmi(uint8_t *dest, int linesize, int16_t *block) +void ff_vc1_inv_trans_4x4_dc_mmi(uint8_t *dest, ptrdiff_t linesize, int16_t *block) { int dc = block[0]; double ftmp[5]; @@ -886,7 +886,7 @@ void ff_vc1_inv_trans_4x4_dc_mmi(uint8_t *dest, int linesize, int16_t *block) ); } -void ff_vc1_inv_trans_4x4_mmi(uint8_t *dest, int linesize, int16_t *block) +void ff_vc1_inv_trans_4x4_mmi(uint8_t *dest, ptrdiff_t linesize, int16_t *block) { int16_t *src = block; int16_t *dst = block; diff --git a/libavcodec/ppc/idctdsp.c b/libavcodec/ppc/idctdsp.c index 80e71fdaf0..f1b42470fb 100644 --- a/libavcodec/ppc/idctdsp.c +++ b/libavcodec/ppc/idctdsp.c @@ -169,7 +169,7 @@ static void idct_altivec(int16_t *blk) block[7] = vx7; } -static void idct_put_altivec(uint8_t *dest, int stride, int16_t *blk) +static void idct_put_altivec(uint8_t *dest, ptrdiff_t stride, int16_t *blk) { vec_s16 *block = (vec_s16 *) blk; vec_u8 tmp; @@ -198,7 +198,7 @@ static void idct_put_altivec(uint8_t *dest, int stride, int16_t *blk) COPY(dest, vx7); } -static void idct_add_altivec(uint8_t *dest, int stride, int16_t *blk) +static void idct_add_altivec(uint8_t *dest, ptrdiff_t stride, int16_t *blk) { vec_s16 *block = (vec_s16 *) blk; vec_u8 tmp; diff --git a/libavcodec/ppc/vc1dsp_altivec.c b/libavcodec/ppc/vc1dsp_altivec.c index 35bb280842..83d537f0c1 100644 --- a/libavcodec/ppc/vc1dsp_altivec.c +++ b/libavcodec/ppc/vc1dsp_altivec.c @@ -229,7 +229,8 @@ static void vc1_inv_trans_8x8_altivec(int16_t block[64]) /** Do inverse transform on 8x4 part of block */ -static void vc1_inv_trans_8x4_altivec(uint8_t *dest, int stride, int16_t *block) +static void vc1_inv_trans_8x4_altivec(uint8_t *dest, ptrdiff_t stride, + int16_t *block) { vector signed short src0, src1, src2, src3, src4, src5, src6, src7; vector signed int s0, s1, s2, s3, s4, s5, s6, s7; diff --git a/libavcodec/simple_idct.c b/libavcodec/simple_idct.c index 65b2911447..1d05b2fe08 100644 --- a/libavcodec/simple_idct.c +++ b/libavcodec/simple_idct.c @@ -58,7 +58,7 @@ and the butterfly must be multiplied by 0.5 * sqrt(2.0) */ #define C_SHIFT (4+1+12) -static inline void idct4col_put(uint8_t *dest, int line_size, const int16_t *col) +static inline void idct4col_put(uint8_t *dest, ptrdiff_t line_size, const int16_t *col) { int c0, c1, c2, c3, a0, a1, a2, a3; @@ -94,7 +94,7 @@ static inline void idct4col_put(uint8_t *dest, int line_size, const int16_t *col /* XXX: I think a 1.0/sqrt(2) normalization should be needed to compensate the extra butterfly stage - I don't have the full DV specification */ -void ff_simple_idct248_put(uint8_t *dest, int line_size, int16_t *block) +void ff_simple_idct248_put(uint8_t *dest, ptrdiff_t line_size, int16_t *block) { int i; int16_t *ptr; @@ -137,7 +137,7 @@ void ff_simple_idct248_put(uint8_t *dest, int line_size, int16_t *block) #define C2 C_FIX(0.2705980501) #define C3 C_FIX(0.5) #define C_SHIFT (4+1+12) -static inline void idct4col_add(uint8_t *dest, int line_size, const int16_t *col) +static inline void idct4col_add(uint8_t *dest, ptrdiff_t line_size, const int16_t *col) { int c0, c1, c2, c3, a0, a1, a2, a3; @@ -182,7 +182,7 @@ static inline void idct4row(int16_t *row) row[3]= (c0 - c1) >> R_SHIFT; } -void ff_simple_idct84_add(uint8_t *dest, int line_size, int16_t *block) +void ff_simple_idct84_add(uint8_t *dest, ptrdiff_t line_size, int16_t *block) { int i; @@ -197,7 +197,7 @@ void ff_simple_idct84_add(uint8_t *dest, int line_size, int16_t *block) } } -void ff_simple_idct48_add(uint8_t *dest, int line_size, int16_t *block) +void ff_simple_idct48_add(uint8_t *dest, ptrdiff_t line_size, int16_t *block) { int i; @@ -212,7 +212,7 @@ void ff_simple_idct48_add(uint8_t *dest, int line_size, int16_t *block) } } -void ff_simple_idct44_add(uint8_t *dest, int line_size, int16_t *block) +void ff_simple_idct44_add(uint8_t *dest, ptrdiff_t line_size, int16_t *block) { int i; diff --git a/libavcodec/simple_idct.h b/libavcodec/simple_idct.h index 154e297470..2a5e1d7f6d 100644 --- a/libavcodec/simple_idct.h +++ b/libavcodec/simple_idct.h @@ -28,18 +28,19 @@ #ifndef AVCODEC_SIMPLE_IDCT_H #define AVCODEC_SIMPLE_IDCT_H +#include <stddef.h> #include <stdint.h> -void ff_simple_idct_put_8(uint8_t *dest, int line_size, int16_t *block); -void ff_simple_idct_add_8(uint8_t *dest, int line_size, int16_t *block); +void ff_simple_idct_put_8(uint8_t *dest, ptrdiff_t line_size, int16_t *block); +void ff_simple_idct_add_8(uint8_t *dest, ptrdiff_t line_size, int16_t *block); void ff_simple_idct_8(int16_t *block); -void ff_simple_idct_put_10(uint8_t *dest, int line_size, int16_t *block); -void ff_simple_idct_add_10(uint8_t *dest, int line_size, int16_t *block); +void ff_simple_idct_put_10(uint8_t *dest, ptrdiff_t line_size, int16_t *block); +void ff_simple_idct_add_10(uint8_t *dest, ptrdiff_t line_size, int16_t *block); void ff_simple_idct_10(int16_t *block); -void ff_simple_idct_put_12(uint8_t *dest, int line_size, int16_t *block); -void ff_simple_idct_add_12(uint8_t *dest, int line_size, int16_t *block); +void ff_simple_idct_put_12(uint8_t *dest, ptrdiff_t line_size, int16_t *block); +void ff_simple_idct_add_12(uint8_t *dest, ptrdiff_t line_size, int16_t *block); void ff_simple_idct_12(int16_t *block); /** @@ -49,10 +50,10 @@ void ff_simple_idct_12(int16_t *block); */ void ff_prores_idct(int16_t *block, const int16_t *qmat); -void ff_simple_idct248_put(uint8_t *dest, int line_size, int16_t *block); +void ff_simple_idct248_put(uint8_t *dest, ptrdiff_t line_size, int16_t *block); -void ff_simple_idct84_add(uint8_t *dest, int line_size, int16_t *block); -void ff_simple_idct48_add(uint8_t *dest, int line_size, int16_t *block); -void ff_simple_idct44_add(uint8_t *dest, int line_size, int16_t *block); +void ff_simple_idct84_add(uint8_t *dest, ptrdiff_t line_size, int16_t *block); +void ff_simple_idct48_add(uint8_t *dest, ptrdiff_t line_size, int16_t *block); +void ff_simple_idct44_add(uint8_t *dest, ptrdiff_t line_size, int16_t *block); #endif /* AVCODEC_SIMPLE_IDCT_H */ diff --git a/libavcodec/simple_idct_template.c b/libavcodec/simple_idct_template.c index c669767761..f532313441 100644 --- a/libavcodec/simple_idct_template.c +++ b/libavcodec/simple_idct_template.c @@ -250,7 +250,7 @@ static inline void FUNC(idctRowCondDC)(int16_t *row, int extra_shift) #ifdef EXTRA_SHIFT static inline void FUNC(idctSparseCol_extrashift)(int16_t *col) #else -static inline void FUNC(idctSparseColPut)(pixel *dest, int line_size, +static inline void FUNC(idctSparseColPut)(pixel *dest, ptrdiff_t line_size, int16_t *col) { SUINT a0, a1, a2, a3, b0, b1, b2, b3; @@ -274,7 +274,7 @@ static inline void FUNC(idctSparseColPut)(pixel *dest, int line_size, dest[0] = av_clip_pixel((int)(a0 - b0) >> COL_SHIFT); } -static inline void FUNC(idctSparseColAdd)(pixel *dest, int line_size, +static inline void FUNC(idctSparseColAdd)(pixel *dest, ptrdiff_t line_size, int16_t *col) { int a0, a1, a2, a3, b0, b1, b2, b3; @@ -316,7 +316,7 @@ static inline void FUNC(idctSparseCol)(int16_t *col) } #ifndef EXTRA_SHIFT -void FUNC(ff_simple_idct_put)(uint8_t *dest_, int line_size, int16_t *block) +void FUNC(ff_simple_idct_put)(uint8_t *dest_, ptrdiff_t line_size, int16_t *block) { pixel *dest = (pixel *)dest_; int i; @@ -330,7 +330,7 @@ void FUNC(ff_simple_idct_put)(uint8_t *dest_, int line_size, int16_t *block) FUNC(idctSparseColPut)(dest + i, line_size, block + i); } -void FUNC(ff_simple_idct_add)(uint8_t *dest_, int line_size, int16_t *block) +void FUNC(ff_simple_idct_add)(uint8_t *dest_, ptrdiff_t line_size, int16_t *block) { pixel *dest = (pixel *)dest_; int i; diff --git a/libavcodec/tests/dct.c b/libavcodec/tests/dct.c index 4f0e0d958e..29af3fea8a 100644 --- a/libavcodec/tests/dct.c +++ b/libavcodec/tests/dct.c @@ -284,7 +284,7 @@ static int dct_error(const struct algo *dct, int test, int is_idct, int speed, c DECLARE_ALIGNED(8, static uint8_t, img_dest)[64]; DECLARE_ALIGNED(8, static uint8_t, img_dest1)[64]; -static void idct248_ref(uint8_t *dest, int linesize, int16_t *block) +static void idct248_ref(uint8_t *dest, ptrdiff_t linesize, int16_t *block) { static int init; static double c8[8][8]; @@ -365,7 +365,8 @@ static void idct248_ref(uint8_t *dest, int linesize, int16_t *block) } static void idct248_error(const char *name, - void (*idct248_put)(uint8_t *dest, int line_size, + void (*idct248_put)(uint8_t *dest, + ptrdiff_t line_size, int16_t *block), int speed) { diff --git a/libavcodec/vc1dsp.c b/libavcodec/vc1dsp.c index 8f48f0cbe7..eaadebe6d0 100644 --- a/libavcodec/vc1dsp.c +++ b/libavcodec/vc1dsp.c @@ -238,7 +238,7 @@ static void vc1_h_loop_filter16_c(uint8_t *src, int stride, int pq) } /* Do inverse transform on 8x8 block */ -static void vc1_inv_trans_8x8_dc_c(uint8_t *dest, int linesize, int16_t *block) +static void vc1_inv_trans_8x8_dc_c(uint8_t *dest, ptrdiff_t stride, int16_t *block) { int i; int dc = block[0]; @@ -255,7 +255,7 @@ static void vc1_inv_trans_8x8_dc_c(uint8_t *dest, int linesize, int16_t *block) dest[5] = av_clip_uint8(dest[5] + dc); dest[6] = av_clip_uint8(dest[6] + dc); dest[7] = av_clip_uint8(dest[7] + dc); - dest += linesize; + dest += stride; } } @@ -329,7 +329,7 @@ static void vc1_inv_trans_8x8_c(int16_t block[64]) } /* Do inverse transform on 8x4 part of block */ -static void vc1_inv_trans_8x4_dc_c(uint8_t *dest, int linesize, int16_t *block) +static void vc1_inv_trans_8x4_dc_c(uint8_t *dest, ptrdiff_t stride, int16_t *block) { int i; int dc = block[0]; @@ -346,11 +346,11 @@ static void vc1_inv_trans_8x4_dc_c(uint8_t *dest, int linesize, int16_t *block) dest[5] = av_clip_uint8(dest[5] + dc); dest[6] = av_clip_uint8(dest[6] + dc); dest[7] = av_clip_uint8(dest[7] + dc); - dest += linesize; + dest += stride; } } -static void vc1_inv_trans_8x4_c(uint8_t *dest, int linesize, int16_t *block) +static void vc1_inv_trans_8x4_c(uint8_t *dest, ptrdiff_t stride, int16_t *block) { int i; register int t1, t2, t3, t4, t5, t6, t7, t8; @@ -395,10 +395,10 @@ static void vc1_inv_trans_8x4_c(uint8_t *dest, int linesize, int16_t *block) t3 = 22 * src[ 8] + 10 * src[24]; t4 = 22 * src[24] - 10 * src[ 8]; - dest[0 * linesize] = av_clip_uint8(dest[0 * linesize] + ((t1 + t3) >> 7)); - dest[1 * linesize] = av_clip_uint8(dest[1 * linesize] + ((t2 - t4) >> 7)); - dest[2 * linesize] = av_clip_uint8(dest[2 * linesize] + ((t2 + t4) >> 7)); - dest[3 * linesize] = av_clip_uint8(dest[3 * linesize] + ((t1 - t3) >> 7)); + dest[0 * stride] = av_clip_uint8(dest[0 * stride] + ((t1 + t3) >> 7)); + dest[1 * stride] = av_clip_uint8(dest[1 * stride] + ((t2 - t4) >> 7)); + dest[2 * stride] = av_clip_uint8(dest[2 * stride] + ((t2 + t4) >> 7)); + dest[3 * stride] = av_clip_uint8(dest[3 * stride] + ((t1 - t3) >> 7)); src++; dest++; @@ -406,7 +406,7 @@ static void vc1_inv_trans_8x4_c(uint8_t *dest, int linesize, int16_t *block) } /* Do inverse transform on 4x8 parts of block */ -static void vc1_inv_trans_4x8_dc_c(uint8_t *dest, int linesize, int16_t *block) +static void vc1_inv_trans_4x8_dc_c(uint8_t *dest, ptrdiff_t stride, int16_t *block) { int i; int dc = block[0]; @@ -419,11 +419,11 @@ static void vc1_inv_trans_4x8_dc_c(uint8_t *dest, int linesize, int16_t *block) dest[1] = av_clip_uint8(dest[1] + dc); dest[2] = av_clip_uint8(dest[2] + dc); dest[3] = av_clip_uint8(dest[3] + dc); - dest += linesize; + dest += stride; } } -static void vc1_inv_trans_4x8_c(uint8_t *dest, int linesize, int16_t *block) +static void vc1_inv_trans_4x8_c(uint8_t *dest, ptrdiff_t stride, int16_t *block) { int i; register int t1, t2, t3, t4, t5, t6, t7, t8; @@ -464,14 +464,14 @@ static void vc1_inv_trans_4x8_c(uint8_t *dest, int linesize, int16_t *block) t3 = 9 * src[ 8] - 16 * src[24] + 4 * src[40] + 15 * src[56]; t4 = 4 * src[ 8] - 9 * src[24] + 15 * src[40] - 16 * src[56]; - dest[0 * linesize] = av_clip_uint8(dest[0 * linesize] + ((t5 + t1) >> 7)); - dest[1 * linesize] = av_clip_uint8(dest[1 * linesize] + ((t6 + t2) >> 7)); - dest[2 * linesize] = av_clip_uint8(dest[2 * linesize] + ((t7 + t3) >> 7)); - dest[3 * linesize] = av_clip_uint8(dest[3 * linesize] + ((t8 + t4) >> 7)); - dest[4 * linesize] = av_clip_uint8(dest[4 * linesize] + ((t8 - t4 + 1) >> 7)); - dest[5 * linesize] = av_clip_uint8(dest[5 * linesize] + ((t7 - t3 + 1) >> 7)); - dest[6 * linesize] = av_clip_uint8(dest[6 * linesize] + ((t6 - t2 + 1) >> 7)); - dest[7 * linesize] = av_clip_uint8(dest[7 * linesize] + ((t5 - t1 + 1) >> 7)); + dest[0 * stride] = av_clip_uint8(dest[0 * stride] + ((t5 + t1) >> 7)); + dest[1 * stride] = av_clip_uint8(dest[1 * stride] + ((t6 + t2) >> 7)); + dest[2 * stride] = av_clip_uint8(dest[2 * stride] + ((t7 + t3) >> 7)); + dest[3 * stride] = av_clip_uint8(dest[3 * stride] + ((t8 + t4) >> 7)); + dest[4 * stride] = av_clip_uint8(dest[4 * stride] + ((t8 - t4 + 1) >> 7)); + dest[5 * stride] = av_clip_uint8(dest[5 * stride] + ((t7 - t3 + 1) >> 7)); + dest[6 * stride] = av_clip_uint8(dest[6 * stride] + ((t6 - t2 + 1) >> 7)); + dest[7 * stride] = av_clip_uint8(dest[7 * stride] + ((t5 - t1 + 1) >> 7)); src++; dest++; @@ -479,7 +479,7 @@ static void vc1_inv_trans_4x8_c(uint8_t *dest, int linesize, int16_t *block) } /* Do inverse transform on 4x4 part of block */ -static void vc1_inv_trans_4x4_dc_c(uint8_t *dest, int linesize, int16_t *block) +static void vc1_inv_trans_4x4_dc_c(uint8_t *dest, ptrdiff_t stride, int16_t *block) { int i; int dc = block[0]; @@ -492,11 +492,11 @@ static void vc1_inv_trans_4x4_dc_c(uint8_t *dest, int linesize, int16_t *block) dest[1] = av_clip_uint8(dest[1] + dc); dest[2] = av_clip_uint8(dest[2] + dc); dest[3] = av_clip_uint8(dest[3] + dc); - dest += linesize; + dest += stride; } } -static void vc1_inv_trans_4x4_c(uint8_t *dest, int linesize, int16_t *block) +static void vc1_inv_trans_4x4_c(uint8_t *dest, ptrdiff_t stride, int16_t *block) { int i; register int t1, t2, t3, t4; @@ -526,10 +526,10 @@ static void vc1_inv_trans_4x4_c(uint8_t *dest, int linesize, int16_t *block) t3 = 22 * src[8] + 10 * src[24]; t4 = 22 * src[24] - 10 * src[8]; - dest[0 * linesize] = av_clip_uint8(dest[0 * linesize] + ((t1 + t3) >> 7)); - dest[1 * linesize] = av_clip_uint8(dest[1 * linesize] + ((t2 - t4) >> 7)); - dest[2 * linesize] = av_clip_uint8(dest[2 * linesize] + ((t2 + t4) >> 7)); - dest[3 * linesize] = av_clip_uint8(dest[3 * linesize] + ((t1 - t3) >> 7)); + dest[0 * stride] = av_clip_uint8(dest[0 * stride] + ((t1 + t3) >> 7)); + dest[1 * stride] = av_clip_uint8(dest[1 * stride] + ((t2 - t4) >> 7)); + dest[2 * stride] = av_clip_uint8(dest[2 * stride] + ((t2 + t4) >> 7)); + dest[3 * stride] = av_clip_uint8(dest[3 * stride] + ((t1 - t3) >> 7)); src++; dest++; diff --git a/libavcodec/vc1dsp.h b/libavcodec/vc1dsp.h index 9543070895..16b3528a75 100644 --- a/libavcodec/vc1dsp.h +++ b/libavcodec/vc1dsp.h @@ -35,13 +35,13 @@ typedef void (*vc1op_pixels_func)(uint8_t *block/*align width (8 or 16)*/, const typedef struct VC1DSPContext { /* vc1 functions */ void (*vc1_inv_trans_8x8)(int16_t *b); - void (*vc1_inv_trans_8x4)(uint8_t *dest, int line_size, int16_t *block); - void (*vc1_inv_trans_4x8)(uint8_t *dest, int line_size, int16_t *block); - void (*vc1_inv_trans_4x4)(uint8_t *dest, int line_size, int16_t *block); - void (*vc1_inv_trans_8x8_dc)(uint8_t *dest, int line_size, int16_t *block); - void (*vc1_inv_trans_8x4_dc)(uint8_t *dest, int line_size, int16_t *block); - void (*vc1_inv_trans_4x8_dc)(uint8_t *dest, int line_size, int16_t *block); - void (*vc1_inv_trans_4x4_dc)(uint8_t *dest, int line_size, int16_t *block); + void (*vc1_inv_trans_8x4)(uint8_t *dest, ptrdiff_t stride, int16_t *block); + void (*vc1_inv_trans_4x8)(uint8_t *dest, ptrdiff_t stride, int16_t *block); + void (*vc1_inv_trans_4x4)(uint8_t *dest, ptrdiff_t stride, int16_t *block); + void (*vc1_inv_trans_8x8_dc)(uint8_t *dest, ptrdiff_t stride, int16_t *block); + void (*vc1_inv_trans_8x4_dc)(uint8_t *dest, ptrdiff_t stride, int16_t *block); + void (*vc1_inv_trans_4x8_dc)(uint8_t *dest, ptrdiff_t stride, int16_t *block); + void (*vc1_inv_trans_4x4_dc)(uint8_t *dest, ptrdiff_t stride, int16_t *block); void (*vc1_v_overlap)(uint8_t *src, int stride); void (*vc1_h_overlap)(uint8_t *src, int stride); void (*vc1_v_s_overlap)(int16_t *top, int16_t *bottom); diff --git a/libavcodec/wmv2dsp.c b/libavcodec/wmv2dsp.c index b9e98d5282..162ac92a72 100644 --- a/libavcodec/wmv2dsp.c +++ b/libavcodec/wmv2dsp.c @@ -93,7 +93,7 @@ static void wmv2_idct_col(short * b) b[8 * 7] = (a0 + a2 - a1 - a5 + (1 << 13)) >> 14; } -static void wmv2_idct_add_c(uint8_t *dest, int line_size, int16_t *block) +static void wmv2_idct_add_c(uint8_t *dest, ptrdiff_t line_size, int16_t *block) { int i; @@ -116,7 +116,7 @@ static void wmv2_idct_add_c(uint8_t *dest, int line_size, int16_t *block) } } -static void wmv2_idct_put_c(uint8_t *dest, int line_size, int16_t *block) +static void wmv2_idct_put_c(uint8_t *dest, ptrdiff_t line_size, int16_t *block) { int i; diff --git a/libavcodec/wmv2dsp.h b/libavcodec/wmv2dsp.h index 62a990d9d7..5e40b30a20 100644 --- a/libavcodec/wmv2dsp.h +++ b/libavcodec/wmv2dsp.h @@ -24,8 +24,8 @@ #include "qpeldsp.h" typedef struct WMV2DSPContext { - void (*idct_add)(uint8_t *dest, int line_size, int16_t *block); - void (*idct_put)(uint8_t *dest, int line_size, int16_t *block); + void (*idct_add)(uint8_t *dest, ptrdiff_t line_size, int16_t *block); + void (*idct_put)(uint8_t *dest, ptrdiff_t line_size, int16_t *block); qpel_mc_func put_mspel_pixels_tab[8]; diff --git a/libavcodec/x86/idctdsp.h b/libavcodec/x86/idctdsp.h index daa4e798ed..e2e296ac81 100644 --- a/libavcodec/x86/idctdsp.h +++ b/libavcodec/x86/idctdsp.h @@ -19,6 +19,7 @@ #ifndef AVCODEC_X86_IDCTDSP_H #define AVCODEC_X86_IDCTDSP_H +#include <stddef.h> #include <stdint.h> #include <stddef.h> @@ -35,4 +36,5 @@ void ff_put_signed_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels, void ff_put_signed_pixels_clamped_sse2(const int16_t *block, uint8_t *pixels, ptrdiff_t line_size); + #endif /* AVCODEC_X86_IDCTDSP_H */ diff --git a/libavcodec/x86/simple_idct.c b/libavcodec/x86/simple_idct.c index 333d6e1a28..d3a19fa60d 100644 --- a/libavcodec/x86/simple_idct.c +++ b/libavcodec/x86/simple_idct.c @@ -904,12 +904,12 @@ void ff_simple_idct_mmx(int16_t *block) //FIXME merge add/put into the idct -void ff_simple_idct_put_mmx(uint8_t *dest, int line_size, int16_t *block) +void ff_simple_idct_put_mmx(uint8_t *dest, ptrdiff_t line_size, int16_t *block) { idct(block); ff_put_pixels_clamped(block, dest, line_size); } -void ff_simple_idct_add_mmx(uint8_t *dest, int line_size, int16_t *block) +void ff_simple_idct_add_mmx(uint8_t *dest, ptrdiff_t line_size, int16_t *block) { idct(block); ff_add_pixels_clamped(block, dest, line_size); diff --git a/libavcodec/x86/simple_idct.h b/libavcodec/x86/simple_idct.h index 8eeb31e299..ad76bafd85 100644 --- a/libavcodec/x86/simple_idct.h +++ b/libavcodec/x86/simple_idct.h @@ -19,22 +19,23 @@ #ifndef AVCODEC_X86_SIMPLE_IDCT_H #define AVCODEC_X86_SIMPLE_IDCT_H +#include <stddef.h> #include <stdint.h> void ff_simple_idct_mmx(int16_t *block); -void ff_simple_idct_add_mmx(uint8_t *dest, int line_size, int16_t *block); -void ff_simple_idct_put_mmx(uint8_t *dest, int line_size, int16_t *block); +void ff_simple_idct_add_mmx(uint8_t *dest, ptrdiff_t line_size, int16_t *block); +void ff_simple_idct_put_mmx(uint8_t *dest, ptrdiff_t line_size, int16_t *block); void ff_simple_idct10_sse2(int16_t *block); void ff_simple_idct10_avx(int16_t *block); -void ff_simple_idct10_put_sse2(uint8_t *dest, int line_size, int16_t *block); -void ff_simple_idct10_put_avx(uint8_t *dest, int line_size, int16_t *block); +void ff_simple_idct10_put_sse2(uint8_t *dest, ptrdiff_t line_size, int16_t *block); +void ff_simple_idct10_put_avx(uint8_t *dest, ptrdiff_t line_size, int16_t *block); void ff_simple_idct12_sse2(int16_t *block); void ff_simple_idct12_avx(int16_t *block); -void ff_simple_idct12_put_sse2(uint8_t *dest, int line_size, int16_t *block); -void ff_simple_idct12_put_avx(uint8_t *dest, int line_size, int16_t *block); +void ff_simple_idct12_put_sse2(uint8_t *dest, ptrdiff_t line_size, int16_t *block); +void ff_simple_idct12_put_avx(uint8_t *dest, ptrdiff_t line_size, int16_t *block); #endif /* AVCODEC_X86_SIMPLE_IDCT_H */ diff --git a/libavcodec/x86/vc1dsp_init.c b/libavcodec/x86/vc1dsp_init.c index c8943fa2f7..e05ae06903 100644 --- a/libavcodec/x86/vc1dsp_init.c +++ b/libavcodec/x86/vc1dsp_init.c @@ -92,13 +92,13 @@ void ff_put_vc1_chroma_mc8_nornd_ssse3(uint8_t *dst, uint8_t *src, int stride, int h, int x, int y); void ff_avg_vc1_chroma_mc8_nornd_ssse3(uint8_t *dst, uint8_t *src, int stride, int h, int x, int y); -void ff_vc1_inv_trans_4x4_dc_mmxext(uint8_t *dest, int linesize, +void ff_vc1_inv_trans_4x4_dc_mmxext(uint8_t *dest, ptrdiff_t linesize, int16_t *block); -void ff_vc1_inv_trans_4x8_dc_mmxext(uint8_t *dest, int linesize, +void ff_vc1_inv_trans_4x8_dc_mmxext(uint8_t *dest, ptrdiff_t linesize, int16_t *block); -void ff_vc1_inv_trans_8x4_dc_mmxext(uint8_t *dest, int linesize, +void ff_vc1_inv_trans_8x4_dc_mmxext(uint8_t *dest, ptrdiff_t linesize, int16_t *block); -void ff_vc1_inv_trans_8x8_dc_mmxext(uint8_t *dest, int linesize, +void ff_vc1_inv_trans_8x8_dc_mmxext(uint8_t *dest, ptrdiff_t linesize, int16_t *block); diff --git a/libavcodec/x86/vc1dsp_mc.asm b/libavcodec/x86/vc1dsp_mc.asm index 175c397ae9..2850ca861d 100644 --- a/libavcodec/x86/vc1dsp_mc.asm +++ b/libavcodec/x86/vc1dsp_mc.asm @@ -225,7 +225,7 @@ HOR_16B_SHIFT2 OP_AVG, avg mov%1 [linesize3q +destq], m5 %endmacro -; ff_vc1_inv_trans_?x?_dc_mmxext(uint8_t *dest, int linesize, int16_t *block) +; ff_vc1_inv_trans_?x?_dc_mmxext(uint8_t *dest, ptrdiff_t linesize, int16_t *block) INIT_MMX mmxext cglobal vc1_inv_trans_4x4_dc, 3,4,0, dest, linesize, block movsx r3d, WORD [blockq] diff --git a/libavcodec/x86/xvididct.h b/libavcodec/x86/xvididct.h index 573b25c6b5..edb5ebfd31 100644 --- a/libavcodec/x86/xvididct.h +++ b/libavcodec/x86/xvididct.h @@ -26,18 +26,19 @@ #ifndef AVCODEC_X86_XVIDIDCT_H #define AVCODEC_X86_XVIDIDCT_H +#include <stddef.h> #include <stdint.h> void ff_xvid_idct_mmx(short *block); -void ff_xvid_idct_mmx_put(uint8_t *dest, int line_size, int16_t *block); -void ff_xvid_idct_mmx_add(uint8_t *dest, int line_size, int16_t *block); +void ff_xvid_idct_mmx_put(uint8_t *dest, ptrdiff_t line_size, int16_t *block); +void ff_xvid_idct_mmx_add(uint8_t *dest, ptrdiff_t line_size, int16_t *block); void ff_xvid_idct_mmxext(short *block); -void ff_xvid_idct_mmxext_put(uint8_t *dest, int line_size, int16_t *block); -void ff_xvid_idct_mmxext_add(uint8_t *dest, int line_size, int16_t *block); +void ff_xvid_idct_mmxext_put(uint8_t *dest, ptrdiff_t line_size, int16_t *block); +void ff_xvid_idct_mmxext_add(uint8_t *dest, ptrdiff_t line_size, int16_t *block); void ff_xvid_idct_sse2(short *block); -void ff_xvid_idct_put_sse2(uint8_t *dest, int line_size, short *block); -void ff_xvid_idct_add_sse2(uint8_t *dest, int line_size, short *block); +void ff_xvid_idct_put_sse2(uint8_t *dest, ptrdiff_t line_size, short *block); +void ff_xvid_idct_add_sse2(uint8_t *dest, ptrdiff_t line_size, short *block); #endif /* AVCODEC_X86_XVIDIDCT_H */ diff --git a/libavcodec/x86/xvididct_init.c b/libavcodec/x86/xvididct_init.c index 8b9d8de0cd..fd10953829 100644 --- a/libavcodec/x86/xvididct_init.c +++ b/libavcodec/x86/xvididct_init.c @@ -27,25 +27,25 @@ #include "xvididct.h" #if ARCH_X86_32 && HAVE_YASM -static void xvid_idct_mmx_put(uint8_t *dest, int line_size, short *block) +static void xvid_idct_mmx_put(uint8_t *dest, ptrdiff_t line_size, short *block) { ff_xvid_idct_mmx(block); ff_put_pixels_clamped(block, dest, line_size); } -static void xvid_idct_mmx_add(uint8_t *dest, int line_size, short *block) +static void xvid_idct_mmx_add(uint8_t *dest, ptrdiff_t line_size, short *block) { ff_xvid_idct_mmx(block); ff_add_pixels_clamped(block, dest, line_size); } -static void xvid_idct_mmxext_put(uint8_t *dest, int line_size, short *block) +static void xvid_idct_mmxext_put(uint8_t *dest, ptrdiff_t line_size, short *block) { ff_xvid_idct_mmxext(block); ff_put_pixels_clamped(block, dest, line_size); } -static void xvid_idct_mmxext_add(uint8_t *dest, int line_size, short *block) +static void xvid_idct_mmxext_add(uint8_t *dest, ptrdiff_t line_size, short *block) { ff_xvid_idct_mmxext(block); ff_add_pixels_clamped(block, dest, line_size); diff --git a/libavcodec/xvididct.c b/libavcodec/xvididct.c index 1f96ccc35c..4642a30d62 100644 --- a/libavcodec/xvididct.c +++ b/libavcodec/xvididct.c @@ -318,13 +318,13 @@ void ff_xvid_idct(int16_t *const in) } } -static void xvid_idct_put(uint8_t *dest, int line_size, int16_t *block) +static void xvid_idct_put(uint8_t *dest, ptrdiff_t line_size, int16_t *block) { ff_xvid_idct(block); ff_put_pixels_clamped(block, dest, line_size); } -static void xvid_idct_add(uint8_t *dest, int line_size, int16_t *block) +static void xvid_idct_add(uint8_t *dest, ptrdiff_t line_size, int16_t *block) { ff_xvid_idct(block); ff_add_pixels_clamped(block, dest, line_size); |