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

Diego Biurrun git at videolan.org
Mon Mar 20 12:34:47 EET 2017


ffmpeg | branch: master | Diego Biurrun <diego at biurrun.de> | Thu Sep  1 21:31:22 2016 +0200| [131a85a1fed9966bbd38517f76abfac0237e39dc] | committer: Diego Biurrun

utvideo: 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=131a85a1fed9966bbd38517f76abfac0237e39dc
---

 libavcodec/utvideo.h    |  2 +-
 libavcodec/utvideodec.c | 12 ++++++------
 libavcodec/utvideoenc.c | 13 +++++++------
 3 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/libavcodec/utvideo.h b/libavcodec/utvideo.h
index 0035e9c..c7f5414 100644
--- a/libavcodec/utvideo.h
+++ b/libavcodec/utvideo.h
@@ -77,7 +77,7 @@ typedef struct UtvideoContext {
     int      interlaced;
     int      frame_pred;
 
-    int      slice_stride;
+    ptrdiff_t slice_stride;
     uint8_t *slice_bits, *slice_buffer[4];
     int      slice_bits_size;
 } UtvideoContext;
diff --git a/libavcodec/utvideodec.c b/libavcodec/utvideodec.c
index 30ca4d2..3a58156 100644
--- a/libavcodec/utvideodec.c
+++ b/libavcodec/utvideodec.c
@@ -78,7 +78,7 @@ static int build_huff(const uint8_t *src, VLC *vlc, int *fsym)
 }
 
 static int decode_plane(UtvideoContext *c, int plane_no,
-                        uint8_t *dst, int step, int stride,
+                        uint8_t *dst, int step, ptrdiff_t stride,
                         int width, int height,
                         const uint8_t *src, int use_pred)
 {
@@ -182,8 +182,8 @@ fail:
     return AVERROR_INVALIDDATA;
 }
 
-static void restore_rgb_planes(uint8_t *src, int step, int stride, int width,
-                               int height)
+static void restore_rgb_planes(uint8_t *src, int step, ptrdiff_t stride,
+                               int width, int height)
 {
     int i, j;
     uint8_t r, g, b;
@@ -200,7 +200,7 @@ static void restore_rgb_planes(uint8_t *src, int step, int stride, int width,
     }
 }
 
-static void restore_median(uint8_t *src, int step, int stride,
+static void restore_median(uint8_t *src, int step, ptrdiff_t stride,
                            int width, int height, int slices, int rmode)
 {
     int i, j, slice;
@@ -256,7 +256,7 @@ static void restore_median(uint8_t *src, int step, int stride,
  * so restoring function should take care of possible padding between
  * two parts of the same "line".
  */
-static void restore_median_il(uint8_t *src, int step, int stride,
+static void restore_median_il(uint8_t *src, int step, ptrdiff_t stride,
                               int width, int height, int slices, int rmode)
 {
     int i, j, slice;
@@ -264,7 +264,7 @@ static void restore_median_il(uint8_t *src, int step, int stride,
     uint8_t *bsrc;
     int slice_start, slice_height;
     const int cmask   = ~(rmode ? 3 : 1);
-    const int stride2 = stride << 1;
+    const ptrdiff_t stride2 = stride << 1;
 
     for (slice = 0; slice < slices; slice++) {
         slice_start    = ((slice * height) / slices) & cmask;
diff --git a/libavcodec/utvideoenc.c b/libavcodec/utvideoenc.c
index 4eddd98..ef51ed0 100644
--- a/libavcodec/utvideoenc.c
+++ b/libavcodec/utvideoenc.c
@@ -234,8 +234,9 @@ FF_ENABLE_DEPRECATION_WARNINGS
     return 0;
 }
 
-static void mangle_rgb_planes(uint8_t *dst[4], int dst_stride, uint8_t *src,
-                              int step, int stride, int width, int height)
+static void mangle_rgb_planes(uint8_t *dst[4], ptrdiff_t dst_stride,
+                              uint8_t *src, int step, ptrdiff_t stride,
+                              int width, int height)
 {
     int i, j;
     int k = 2 * dst_stride;
@@ -268,7 +269,7 @@ static void mangle_rgb_planes(uint8_t *dst[4], int dst_stride, uint8_t *src,
 }
 
 /* Write data to a plane with left prediction */
-static void left_predict(uint8_t *src, uint8_t *dst, int stride,
+static void left_predict(uint8_t *src, uint8_t *dst, ptrdiff_t stride,
                          int width, int height)
 {
     int i, j;
@@ -285,8 +286,8 @@ static void left_predict(uint8_t *src, uint8_t *dst, int stride,
 }
 
 /* Write data to a plane with median prediction */
-static void median_predict(UtvideoContext *c, uint8_t *src, uint8_t *dst, int stride,
-                           int width, int height)
+static void median_predict(UtvideoContext *c, uint8_t *src, uint8_t *dst,
+                           ptrdiff_t stride, int width, int height)
 {
     int i, j;
     int A, B;
@@ -387,7 +388,7 @@ static int write_huff_codes(uint8_t *src, uint8_t *dst, int dst_size,
 }
 
 static int encode_plane(AVCodecContext *avctx, uint8_t *src,
-                        uint8_t *dst, int stride,
+                        uint8_t *dst, ptrdiff_t stride,
                         int width, int height, PutByteContext *pb)
 {
     UtvideoContext *c        = avctx->priv_data;



More information about the ffmpeg-cvslog mailing list