[FFmpeg-cvslog] idct: Change type of array stride parameters to ptrdiff_t

Diego Biurrun git at videolan.org
Tue Mar 21 20:07:37 EET 2017


ffmpeg | branch: master | Diego Biurrun <diego at biurrun.de> | Wed Sep  7 17:02:06 2016 +0200| [2ec9fa5ec60dcd10e1cb10d8b4e4437e634ea428] | committer: Diego Biurrun

idct: Change type of array stride parameters to ptrdiff_t

ptrdiff_t is the correct type for array strides and similar.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2ec9fa5ec60dcd10e1cb10d8b4e4437e634ea428
---

 doc/optimization.txt                |  2 +-
 libavcodec/arm/idct.h               | 13 ++++----
 libavcodec/arm/idctdsp_arm.S        |  2 +-
 libavcodec/arm/idctdsp_init_arm.c   | 15 ++++++----
 libavcodec/arm/idctdsp_init_armv6.c |  2 +-
 libavcodec/arm/simple_idct_armv6.S  |  4 +--
 libavcodec/arm/simple_idct_neon.S   |  4 +--
 libavcodec/arm/vc1dsp_init_neon.c   | 14 ++++-----
 libavcodec/arm/vc1dsp_neon.S        |  6 ++--
 libavcodec/dct.h                    |  5 ++--
 libavcodec/dv.h                     |  2 +-
 libavcodec/dvdec.c                  |  2 +-
 libavcodec/faanidct.c               | 10 +++++--
 libavcodec/faanidct.h               |  5 ++--
 libavcodec/idctdsp.c                | 10 +++----
 libavcodec/idctdsp.h                | 14 ++++-----
 libavcodec/jrevdct.c                |  4 +--
 libavcodec/ppc/idctdsp.c            |  4 +--
 libavcodec/ppc/vc1dsp_altivec.c     |  3 +-
 libavcodec/simple_idct.c            | 12 ++++----
 libavcodec/simple_idct.h            | 17 ++++++-----
 libavcodec/simple_idct_template.c   |  8 ++---
 libavcodec/tests/dct.c              |  5 ++--
 libavcodec/vc1dsp.c                 | 54 ++++++++++++++++-----------------
 libavcodec/vc1dsp.h                 | 14 ++++-----
 libavcodec/wmv2dsp.c                |  4 +--
 libavcodec/wmv2dsp.h                |  4 +--
 libavcodec/x86/idctdsp.h            |  7 +++--
 libavcodec/x86/idctdsp_mmx.c        |  6 ++--
 libavcodec/x86/simple_idct.c        |  4 +--
 libavcodec/x86/simple_idct.h        |  5 ++--
 libavcodec/x86/vc1dsp_mmx.c         | 60 ++++++++++++++++++-------------------
 libavcodec/x86/xvididct.h           | 13 ++++----
 libavcodec/x86/xvididct_mmx.c       |  8 ++---
 libavcodec/x86/xvididct_sse2.c      |  4 +--
 libavcodec/xvididct.c               |  4 +--
 36 files changed, 184 insertions(+), 166 deletions(-)

diff --git a/doc/optimization.txt b/doc/optimization.txt
index 9847dcf..be12d85 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/arm/idct.h b/libavcodec/arm/idct.h
index 168d64b..db4d6c5 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_arm.S b/libavcodec/arm/idctdsp_arm.S
index 34f467e..0d6a76b 100644
--- a/libavcodec/arm/idctdsp_arm.S
+++ b/libavcodec/arm/idctdsp_arm.S
@@ -22,7 +22,7 @@
 #include "config.h"
 #include "libavutil/arm/asm.S"
 
-@ void ff_add_pixels_clamped_arm(int16_t *block, uint8_t *dest, int stride)
+@ void ff_add_pixels_clamped_arm(int16_t *block, uint8_t *dest, ptrdiff_t stride)
 function ff_add_pixels_clamped_arm, export=1, align=5
         push            {r4-r10}
         mov             r10, #8
diff --git a/libavcodec/arm/idctdsp_init_arm.c b/libavcodec/arm/idctdsp_init_arm.c
index 8207c31..8216985 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"
@@ -30,29 +31,33 @@
 #include "idctdsp_arm.h"
 
 void ff_add_pixels_clamped_arm(const int16_t *block, uint8_t *dest,
-                               int line_size);
+                               ptrdiff_t line_size);
 
 /* 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/idctdsp_init_armv6.c b/libavcodec/arm/idctdsp_init_armv6.c
index 8f0c49b..3941ee8 100644
--- a/libavcodec/arm/idctdsp_init_armv6.c
+++ b/libavcodec/arm/idctdsp_init_armv6.c
@@ -27,7 +27,7 @@
 #include "idctdsp_arm.h"
 
 void ff_add_pixels_clamped_armv6(const int16_t *block, uint8_t *pixels,
-                                 int line_size);
+                                 ptrdiff_t line_size);
 
 av_cold void ff_idctdsp_init_armv6(IDCTDSPContext *c, AVCodecContext *avctx,
                                    unsigned high_bit_depth)
diff --git a/libavcodec/arm/simple_idct_armv6.S b/libavcodec/arm/simple_idct_armv6.S
index 6072346..a8de990 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 a1cde8d..9e0a97a 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 9ded7a2..55d3a65 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_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, 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_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 fa87ede..1653a4c 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 4a31f54..46893a6 100644
--- a/libavcodec/dct.h
+++ b/libavcodec/dct.h
@@ -24,6 +24,7 @@
 #ifndef AVCODEC_DCT_H
 #define AVCODEC_DCT_H
 
+#include <stddef.h>
 #include <stdint.h>
 
 #include "rdft.h"
@@ -59,7 +60,7 @@ void ff_fdct248_islow_8(int16_t *data);
 void ff_fdct248_islow_10(int16_t *data);
 
 void ff_j_rev_dct(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 f2c7ecf..9a9ebf1 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 463d108..eca3b86 100644
--- a/libavcodec/dvdec.c
+++ b/libavcodec/dvdec.c
@@ -52,7 +52,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 b132f89..57e52a5 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 0c01520..4eedba8 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 a9b8727..5a267e4 100644
--- a/libavcodec/idctdsp.c
+++ b/libavcodec/idctdsp.c
@@ -79,11 +79,11 @@ av_cold void ff_init_scantable_permutation(uint8_t *idct_permutation,
     }
 }
 
-void (*ff_put_pixels_clamped)(const int16_t *block, uint8_t *pixels, int line_size);
-void (*ff_add_pixels_clamped)(const int16_t *block, uint8_t *pixels, int line_size);
+void (*ff_put_pixels_clamped)(const int16_t *block, uint8_t *pixels, ptrdiff_t line_size);
+void (*ff_add_pixels_clamped)(const int16_t *block, uint8_t *pixels, ptrdiff_t line_size);
 
 static void put_pixels_clamped_c(const int16_t *block, uint8_t *restrict pixels,
-                                 int line_size)
+                                 ptrdiff_t line_size)
 {
     int i;
 
@@ -105,7 +105,7 @@ static void put_pixels_clamped_c(const int16_t *block, uint8_t *restrict pixels,
 
 static void put_signed_pixels_clamped_c(const int16_t *block,
                                         uint8_t *restrict pixels,
-                                        int line_size)
+                                        ptrdiff_t line_size)
 {
     int i, j;
 
@@ -125,7 +125,7 @@ static void put_signed_pixels_clamped_c(const int16_t *block,
 }
 
 static void add_pixels_clamped_c(const int16_t *block, uint8_t *restrict pixels,
-                                 int line_size)
+                                 ptrdiff_t line_size)
 {
     int i;
 
diff --git a/libavcodec/idctdsp.h b/libavcodec/idctdsp.h
index c49a4ca..51de9bc 100644
--- a/libavcodec/idctdsp.h
+++ b/libavcodec/idctdsp.h
@@ -52,13 +52,13 @@ typedef struct IDCTDSPContext {
     /* pixel ops : interface with DCT */
     void (*put_pixels_clamped)(const int16_t *block /* align 16 */,
                                uint8_t *pixels /* align 8 */,
-                               int line_size);
+                               ptrdiff_t line_size);
     void (*put_signed_pixels_clamped)(const int16_t *block /* align 16 */,
                                       uint8_t *pixels /* align 8 */,
-                                      int line_size);
+                                      ptrdiff_t line_size);
     void (*add_pixels_clamped)(const int16_t *block /* align 16 */,
                                uint8_t *pixels /* align 8 */,
-                               int line_size);
+                               ptrdiff_t line_size);
 
     void (*idct)(int16_t *block /* align 16 */);
 
@@ -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.
@@ -95,8 +95,8 @@ typedef struct IDCTDSPContext {
     enum idct_permutation_type perm_type;
 } IDCTDSPContext;
 
-extern void (*ff_put_pixels_clamped)(const int16_t *block, uint8_t *pixels, int line_size);
-extern void (*ff_add_pixels_clamped)(const int16_t *block, uint8_t *pixels, int line_size);
+extern void (*ff_put_pixels_clamped)(const int16_t *block, uint8_t *pixels, ptrdiff_t line_size);
+extern void (*ff_add_pixels_clamped)(const int16_t *block, uint8_t *pixels, ptrdiff_t line_size);
 
 void ff_idctdsp_init(IDCTDSPContext *c, AVCodecContext *avctx);
 
diff --git a/libavcodec/jrevdct.c b/libavcodec/jrevdct.c
index 96a884a..808f583 100644
--- a/libavcodec/jrevdct.c
+++ b/libavcodec/jrevdct.c
@@ -943,13 +943,13 @@ void ff_j_rev_dct(DCTBLOCK data)
   }
 }
 
-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/ppc/idctdsp.c b/libavcodec/ppc/idctdsp.c
index 690b08b..0aaaac0 100644
--- a/libavcodec/ppc/idctdsp.c
+++ b/libavcodec/ppc/idctdsp.c
@@ -153,7 +153,7 @@ static const vec_s16 constants[5] = {
     { 19266, 26722, 25172, 22654,  19266,  22654, 25172, 26722 }
 };
 
-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;
@@ -182,7 +182,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 0eec475..d252421 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 6ee1320..9823a6b 100644
--- a/libavcodec/simple_idct.c
+++ b/libavcodec/simple_idct.c
@@ -49,7 +49,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;
 
@@ -85,7 +85,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;
@@ -128,7 +128,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;
 
@@ -173,7 +173,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;
 
@@ -188,7 +188,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;
 
@@ -203,7 +203,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 7f14aae..edc994d 100644
--- a/libavcodec/simple_idct.h
+++ b/libavcodec/simple_idct.h
@@ -28,14 +28,15 @@
 #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);
 /**
  * Special version of ff_simple_idct_10() which does dequantization
@@ -44,10 +45,10 @@ void ff_simple_idct_10(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 171cdf6..d10df31 100644
--- a/libavcodec/simple_idct_template.c
+++ b/libavcodec/simple_idct_template.c
@@ -222,7 +222,7 @@ static inline void FUNC(idctRowCondDC)(int16_t *row, int extra_shift)
         }                                               \
     } while (0)
 
-static inline void FUNC(idctSparseColPut)(pixel *dest, int line_size,
+static inline void FUNC(idctSparseColPut)(pixel *dest, ptrdiff_t line_size,
                                           int16_t *col)
 {
     int a0, a1, a2, a3, b0, b1, b2, b3;
@@ -246,7 +246,7 @@ static inline void FUNC(idctSparseColPut)(pixel *dest, int line_size,
     dest[0] = av_clip_pixel((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;
@@ -286,7 +286,7 @@ static inline void FUNC(idctSparseCol)(int16_t *col)
     col[56] = ((a0 - b0) >> COL_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;
@@ -300,7 +300,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 6c6a4e0..84ad5f3 100644
--- a/libavcodec/tests/dct.c
+++ b/libavcodec/tests/dct.c
@@ -253,7 +253,7 @@ static int dct_error(const struct algo *dct, int test, int is_idct, int speed)
 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];
@@ -334,7 +334,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 cbcc8d2..e630a48 100644
--- a/libavcodec/vc1dsp.c
+++ b/libavcodec/vc1dsp.c
@@ -235,7 +235,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];
@@ -252,7 +252,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;
     }
 }
 
@@ -326,7 +326,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];
@@ -343,11 +343,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;
@@ -392,10 +392,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++;
@@ -403,7 +403,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];
@@ -416,11 +416,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;
@@ -461,14 +461,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++;
@@ -476,7 +476,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];
@@ -489,11 +489,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;
@@ -523,10 +523,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 f2b0c70..a9bd712 100644
--- a/libavcodec/vc1dsp.h
+++ b/libavcodec/vc1dsp.h
@@ -33,13 +33,13 @@
 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 2e3a3ff..90073e4 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 f2f258e..b38f4dc 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 22df3dd..6e6c688 100644
--- a/libavcodec/x86/idctdsp.h
+++ b/libavcodec/x86/idctdsp.h
@@ -19,13 +19,14 @@
 #ifndef AVCODEC_X86_IDCTDSP_H
 #define AVCODEC_X86_IDCTDSP_H
 
+#include <stddef.h>
 #include <stdint.h>
 
 void ff_add_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels,
-                               int line_size);
+                               ptrdiff_t line_size);
 void ff_put_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels,
-                               int line_size);
+                               ptrdiff_t line_size);
 void ff_put_signed_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels,
-                                      int line_size);
+                                      ptrdiff_t line_size);
 
 #endif /* AVCODEC_X86_IDCTDSP_H */
diff --git a/libavcodec/x86/idctdsp_mmx.c b/libavcodec/x86/idctdsp_mmx.c
index 7285b1d..523f368 100644
--- a/libavcodec/x86/idctdsp_mmx.c
+++ b/libavcodec/x86/idctdsp_mmx.c
@@ -31,7 +31,7 @@
 #if HAVE_INLINE_ASM
 
 void ff_put_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels,
-                               int line_size)
+                               ptrdiff_t line_size)
 {
     const int16_t *p;
     uint8_t *pix;
@@ -107,7 +107,7 @@ void ff_put_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels,
     "movq               %%mm4, (%0, %1)     \n\t"
 
 void ff_put_signed_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels,
-                                      int line_size)
+                                      ptrdiff_t line_size)
 {
     x86_reg line_skip = line_size;
     x86_reg line_skip3;
@@ -124,7 +124,7 @@ void ff_put_signed_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels,
 }
 
 void ff_add_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels,
-                               int line_size)
+                               ptrdiff_t line_size)
 {
     const int16_t *p;
     uint8_t *pix;
diff --git a/libavcodec/x86/simple_idct.c b/libavcodec/x86/simple_idct.c
index 49784e2..0939a49 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 4fc2914..15784a9 100644
--- a/libavcodec/x86/simple_idct.h
+++ b/libavcodec/x86/simple_idct.h
@@ -19,10 +19,11 @@
 #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);
 
 #endif /* AVCODEC_X86_SIMPLE_IDCT_H */
diff --git a/libavcodec/x86/vc1dsp_mmx.c b/libavcodec/x86/vc1dsp_mmx.c
index 9bbc234..d64ddf0 100644
--- a/libavcodec/x86/vc1dsp_mmx.c
+++ b/libavcodec/x86/vc1dsp_mmx.c
@@ -498,7 +498,7 @@ DECLARE_FUNCTION(3, 1)
 DECLARE_FUNCTION(3, 2)
 DECLARE_FUNCTION(3, 3)
 
-static void vc1_inv_trans_4x4_dc_mmxext(uint8_t *dest, int linesize,
+static void vc1_inv_trans_4x4_dc_mmxext(uint8_t *dest, ptrdiff_t stride,
                                         int16_t *block)
 {
     int dc = block[0];
@@ -530,14 +530,14 @@ static void vc1_inv_trans_4x4_dc_mmxext(uint8_t *dest, int linesize,
         "movd       %%mm3, %1    \n\t"
         "movd       %%mm4, %2    \n\t"
         "movd       %%mm5, %3    \n\t"
-        :"+m"(*(uint32_t*)(dest+0*linesize)),
-         "+m"(*(uint32_t*)(dest+1*linesize)),
-         "+m"(*(uint32_t*)(dest+2*linesize)),
-         "+m"(*(uint32_t*)(dest+3*linesize))
+        :"+m"(*(uint32_t *)(dest + 0 * stride)),
+         "+m"(*(uint32_t *)(dest + 1 * stride)),
+         "+m"(*(uint32_t *)(dest + 2 * stride)),
+         "+m"(*(uint32_t *)(dest + 3 * stride))
     );
 }
 
-static void vc1_inv_trans_4x8_dc_mmxext(uint8_t *dest, int linesize,
+static void vc1_inv_trans_4x8_dc_mmxext(uint8_t *dest, ptrdiff_t stride,
                                         int16_t *block)
 {
     int dc = block[0];
@@ -569,12 +569,12 @@ static void vc1_inv_trans_4x8_dc_mmxext(uint8_t *dest, int linesize,
         "movd       %%mm3, %1    \n\t"
         "movd       %%mm4, %2    \n\t"
         "movd       %%mm5, %3    \n\t"
-        :"+m"(*(uint32_t*)(dest+0*linesize)),
-         "+m"(*(uint32_t*)(dest+1*linesize)),
-         "+m"(*(uint32_t*)(dest+2*linesize)),
-         "+m"(*(uint32_t*)(dest+3*linesize))
+        :"+m"(*(uint32_t *)(dest + 0 * stride)),
+         "+m"(*(uint32_t *)(dest + 1 * stride)),
+         "+m"(*(uint32_t *)(dest + 2 * stride)),
+         "+m"(*(uint32_t *)(dest + 3 * stride))
     );
-    dest += 4*linesize;
+    dest += 4 * stride;
     __asm__ volatile(
         "movd          %0, %%mm2 \n\t"
         "movd          %1, %%mm3 \n\t"
@@ -592,14 +592,14 @@ static void vc1_inv_trans_4x8_dc_mmxext(uint8_t *dest, int linesize,
         "movd       %%mm3, %1    \n\t"
         "movd       %%mm4, %2    \n\t"
         "movd       %%mm5, %3    \n\t"
-        :"+m"(*(uint32_t*)(dest+0*linesize)),
-         "+m"(*(uint32_t*)(dest+1*linesize)),
-         "+m"(*(uint32_t*)(dest+2*linesize)),
-         "+m"(*(uint32_t*)(dest+3*linesize))
+        :"+m"(*(uint32_t *)(dest + 0 * stride)),
+         "+m"(*(uint32_t *)(dest + 1 * stride)),
+         "+m"(*(uint32_t *)(dest + 2 * stride)),
+         "+m"(*(uint32_t *)(dest + 3 * stride))
     );
 }
 
-static void vc1_inv_trans_8x4_dc_mmxext(uint8_t *dest, int linesize,
+static void vc1_inv_trans_8x4_dc_mmxext(uint8_t *dest, ptrdiff_t stride,
                                         int16_t *block)
 {
     int dc = block[0];
@@ -631,14 +631,14 @@ static void vc1_inv_trans_8x4_dc_mmxext(uint8_t *dest, int linesize,
         "movq       %%mm3, %1    \n\t"
         "movq       %%mm4, %2    \n\t"
         "movq       %%mm5, %3    \n\t"
-        :"+m"(*(uint32_t*)(dest+0*linesize)),
-         "+m"(*(uint32_t*)(dest+1*linesize)),
-         "+m"(*(uint32_t*)(dest+2*linesize)),
-         "+m"(*(uint32_t*)(dest+3*linesize))
+        :"+m"(*(uint32_t *)(dest + 0 * stride)),
+         "+m"(*(uint32_t *)(dest + 1 * stride)),
+         "+m"(*(uint32_t *)(dest + 2 * stride)),
+         "+m"(*(uint32_t *)(dest + 3 * stride))
     );
 }
 
-static void vc1_inv_trans_8x8_dc_mmxext(uint8_t *dest, int linesize,
+static void vc1_inv_trans_8x8_dc_mmxext(uint8_t *dest, ptrdiff_t stride,
                                         int16_t *block)
 {
     int dc = block[0];
@@ -670,12 +670,12 @@ static void vc1_inv_trans_8x8_dc_mmxext(uint8_t *dest, int linesize,
         "movq       %%mm3, %1    \n\t"
         "movq       %%mm4, %2    \n\t"
         "movq       %%mm5, %3    \n\t"
-        :"+m"(*(uint32_t*)(dest+0*linesize)),
-         "+m"(*(uint32_t*)(dest+1*linesize)),
-         "+m"(*(uint32_t*)(dest+2*linesize)),
-         "+m"(*(uint32_t*)(dest+3*linesize))
+        :"+m"(*(uint32_t *)(dest + 0 * stride)),
+         "+m"(*(uint32_t *)(dest + 1 * stride)),
+         "+m"(*(uint32_t *)(dest + 2 * stride)),
+         "+m"(*(uint32_t *)(dest + 3 * stride))
     );
-    dest += 4*linesize;
+    dest += 4 * stride;
     __asm__ volatile(
         "movq          %0, %%mm2 \n\t"
         "movq          %1, %%mm3 \n\t"
@@ -693,10 +693,10 @@ static void vc1_inv_trans_8x8_dc_mmxext(uint8_t *dest, int linesize,
         "movq       %%mm3, %1    \n\t"
         "movq       %%mm4, %2    \n\t"
         "movq       %%mm5, %3    \n\t"
-        :"+m"(*(uint32_t*)(dest+0*linesize)),
-         "+m"(*(uint32_t*)(dest+1*linesize)),
-         "+m"(*(uint32_t*)(dest+2*linesize)),
-         "+m"(*(uint32_t*)(dest+3*linesize))
+        :"+m"(*(uint32_t *)(dest + 0 * stride)),
+         "+m"(*(uint32_t *)(dest + 1 * stride)),
+         "+m"(*(uint32_t *)(dest + 2 * stride)),
+         "+m"(*(uint32_t *)(dest + 3 * stride))
     );
 }
 
diff --git a/libavcodec/x86/xvididct.h b/libavcodec/x86/xvididct.h
index 13a4e85..6640b6b 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_sse2_put(uint8_t *dest, int line_size, short *block);
-void ff_xvid_idct_sse2_add(uint8_t *dest, int line_size, short *block);
+void ff_xvid_idct_sse2_put(uint8_t *dest, ptrdiff_t line_size, short *block);
+void ff_xvid_idct_sse2_add(uint8_t *dest, ptrdiff_t line_size, short *block);
 
 #endif /* AVCODEC_X86_XVIDIDCT_H */
diff --git a/libavcodec/x86/xvididct_mmx.c b/libavcodec/x86/xvididct_mmx.c
index e371142..9bb407c 100644
--- a/libavcodec/x86/xvididct_mmx.c
+++ b/libavcodec/x86/xvididct_mmx.c
@@ -494,13 +494,13 @@ void ff_xvid_idct_mmx(short *block)
         :: "r" (block), "r" (rounder_0), "r" (tab_i_04_mmx), "r" (tg_1_16));
 }
 
-void ff_xvid_idct_mmx_put(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)
 {
     ff_xvid_idct_mmx(block);
     ff_put_pixels_clamped_mmx(block, dest, line_size);
 }
 
-void ff_xvid_idct_mmx_add(uint8_t *dest, int line_size, int16_t *block)
+void ff_xvid_idct_mmx_add(uint8_t *dest, ptrdiff_t line_size, int16_t *block)
 {
     ff_xvid_idct_mmx(block);
     ff_add_pixels_clamped_mmx(block, dest, line_size);
@@ -533,13 +533,13 @@ void ff_xvid_idct_mmxext(short *block)
         :: "r" (block), "r" (rounder_0), "r" (tab_i_04_xmm), "r" (tg_1_16));
 }
 
-void ff_xvid_idct_mmxext_put(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)
 {
     ff_xvid_idct_mmxext(block);
     ff_put_pixels_clamped_mmx(block, dest, line_size);
 }
 
-void ff_xvid_idct_mmxext_add(uint8_t *dest, int line_size, int16_t *block)
+void ff_xvid_idct_mmxext_add(uint8_t *dest, ptrdiff_t line_size, int16_t *block)
 {
     ff_xvid_idct_mmxext(block);
     ff_add_pixels_clamped_mmx(block, dest, line_size);
diff --git a/libavcodec/x86/xvididct_sse2.c b/libavcodec/x86/xvididct_sse2.c
index d4f0169..f318e95 100644
--- a/libavcodec/x86/xvididct_sse2.c
+++ b/libavcodec/x86/xvididct_sse2.c
@@ -390,13 +390,13 @@ inline void ff_xvid_idct_sse2(short *block)
           "%eax", "%ecx", "%edx", "%esi", "memory");
 }
 
-void ff_xvid_idct_sse2_put(uint8_t *dest, int line_size, short *block)
+void ff_xvid_idct_sse2_put(uint8_t *dest, ptrdiff_t line_size, short *block)
 {
     ff_xvid_idct_sse2(block);
     ff_put_pixels_clamped_mmx(block, dest, line_size);
 }
 
-void ff_xvid_idct_sse2_add(uint8_t *dest, int line_size, short *block)
+void ff_xvid_idct_sse2_add(uint8_t *dest, ptrdiff_t line_size, short *block)
 {
     ff_xvid_idct_sse2(block);
     ff_add_pixels_clamped_mmx(block, dest, line_size);
diff --git a/libavcodec/xvididct.c b/libavcodec/xvididct.c
index ca89703..40bd61a 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);



More information about the ffmpeg-cvslog mailing list