Re: [libav-devel] [PATCH 10/14] ea: Change type of array stride parameters to ptrdiff_t

2016-09-29 Thread Martin Storsjö

On Tue, 20 Sep 2016, Diego Biurrun wrote:


ptrdiff_t is the correct type for array strides and similar.
---
libavcodec/eacmv.c  | 4 ++--
libavcodec/eaidct.c | 3 ++-
libavcodec/eaidct.h | 3 ++-
libavcodec/eamad.c  | 4 ++--
libavcodec/eatgq.c  | 6 +++---
libavcodec/eatgv.c  | 2 +-
libavcodec/eatqi.c  | 2 +-
7 files changed, 13 insertions(+), 11 deletions(-)


Ok

// Martin
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


[libav-devel] [PATCH 10/14] ea: Change type of array stride parameters to ptrdiff_t

2016-09-20 Thread Diego Biurrun
ptrdiff_t is the correct type for array strides and similar.
---
 libavcodec/eacmv.c  | 4 ++--
 libavcodec/eaidct.c | 3 ++-
 libavcodec/eaidct.h | 3 ++-
 libavcodec/eamad.c  | 4 ++--
 libavcodec/eatgq.c  | 6 +++---
 libavcodec/eatgv.c  | 2 +-
 libavcodec/eatqi.c  | 2 +-
 7 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/libavcodec/eacmv.c b/libavcodec/eacmv.c
index 9668f64..633c26a 100644
--- a/libavcodec/eacmv.c
+++ b/libavcodec/eacmv.c
@@ -71,8 +71,8 @@ static void cmv_decode_intra(CmvContext * s, AVFrame *frame,
 }
 }
 
-static void cmv_motcomp(unsigned char *dst, int dst_stride,
-const unsigned char *src, int src_stride,
+static void cmv_motcomp(unsigned char *dst, ptrdiff_t dst_stride,
+const unsigned char *src, ptrdiff_t src_stride,
 int x, int y,
 int xoffset, int yoffset,
 int width, int height){
diff --git a/libavcodec/eaidct.c b/libavcodec/eaidct.c
index 5b2db44..271e28c 100644
--- a/libavcodec/eaidct.c
+++ b/libavcodec/eaidct.c
@@ -77,7 +77,8 @@ static inline void ea_idct_col(int16_t *dest, const int16_t 
*src) {
 IDCT_COL(dest, src);
 }
 
-void ff_ea_idct_put_c(uint8_t *dest, int linesize, int16_t *block) {
+void ff_ea_idct_put_c(uint8_t *dest, ptrdiff_t linesize, int16_t *block)
+{
 int i;
 int16_t temp[64];
 block[0] += 4;
diff --git a/libavcodec/eaidct.h b/libavcodec/eaidct.h
index e78de04..395a8ae 100644
--- a/libavcodec/eaidct.h
+++ b/libavcodec/eaidct.h
@@ -19,8 +19,9 @@
 #ifndef AVCODEC_EAIDCT_H
 #define AVCODEC_EAIDCT_H
 
+#include 
 #include 
 
-void ff_ea_idct_put_c(uint8_t *dest, int linesize, int16_t *block);
+void ff_ea_idct_put_c(uint8_t *dest, ptrdiff_t linesize, int16_t *block);
 
 #endif /* AVCODEC_EAIDCT_H */
diff --git a/libavcodec/eamad.c b/libavcodec/eamad.c
index 3e8d4fd..070cfdb 100644
--- a/libavcodec/eamad.c
+++ b/libavcodec/eamad.c
@@ -80,8 +80,8 @@ static av_cold int decode_init(AVCodecContext *avctx)
 return 0;
 }
 
-static inline void comp(unsigned char *dst, int dst_stride,
-unsigned char *src, int src_stride, int add)
+static inline void comp(unsigned char *dst, ptrdiff_t dst_stride,
+unsigned char *src, ptrdiff_t src_stride, int add)
 {
 int j, i;
 for (j=0; j<8; j++)
diff --git a/libavcodec/eatgq.c b/libavcodec/eatgq.c
index ff0aa55..8355471 100644
--- a/libavcodec/eatgq.c
+++ b/libavcodec/eatgq.c
@@ -107,7 +107,7 @@ static void tgq_decode_block(TgqContext *s, int16_t 
block[64], GetBitContext *gb
 static void tgq_idct_put_mb(TgqContext *s, int16_t (*block)[64], AVFrame 
*frame,
 int mb_x, int mb_y)
 {
-int linesize = frame->linesize[0];
+ptrdiff_t linesize = frame->linesize[0];
 uint8_t *dest_y  = frame->data[0] + (mb_y * 16 * linesize)   + 
mb_x * 16;
 uint8_t *dest_cb = frame->data[1] + (mb_y * 8  * frame->linesize[1]) + 
mb_x * 8;
 uint8_t *dest_cr = frame->data[2] + (mb_y * 8  * frame->linesize[2]) + 
mb_x * 8;
@@ -123,7 +123,7 @@ static void tgq_idct_put_mb(TgqContext *s, int16_t 
(*block)[64], AVFrame *frame,
 }
 
 static inline void tgq_dconly(TgqContext *s, unsigned char *dst,
-  int dst_stride, int dc)
+  ptrdiff_t dst_stride, int dc)
 {
 int level = av_clip_uint8((dc*s->qtable[0] + 2056) >> 4);
 int j;
@@ -134,7 +134,7 @@ static inline void tgq_dconly(TgqContext *s, unsigned char 
*dst,
 static void tgq_idct_put_mb_dconly(TgqContext *s, AVFrame *frame,
int mb_x, int mb_y, const int8_t *dc)
 {
-int linesize = frame->linesize[0];
+ptrdiff_t linesize = frame->linesize[0];
 uint8_t *dest_y  = frame->data[0] + (mb_y * 16 * linesize) + 
mb_x * 16;
 uint8_t *dest_cb = frame->data[1] + (mb_y * 8  * frame->linesize[1]) + 
mb_x * 8;
 uint8_t *dest_cr = frame->data[2] + (mb_y * 8  * frame->linesize[2]) + 
mb_x * 8;
diff --git a/libavcodec/eatgv.c b/libavcodec/eatgv.c
index 7f40f45..7a50d01 100644
--- a/libavcodec/eatgv.c
+++ b/libavcodec/eatgv.c
@@ -225,7 +225,7 @@ static int tgv_decode_inter(TgvContext *s, AVFrame *frame,
 for (x = 0; x < s->avctx->width / 4; x++) {
 unsigned int vector = get_bits(, vector_bits);
 const uint8_t *src;
-int src_stride;
+ptrdiff_t src_stride;
 
 if (vector < num_mvs) {
 int mx = x * 4 + s->mv_codebook[vector][0];
diff --git a/libavcodec/eatqi.c b/libavcodec/eatqi.c
index f4cad9c..cb70cda 100644
--- a/libavcodec/eatqi.c
+++ b/libavcodec/eatqi.c
@@ -90,7 +90,7 @@ static inline void tqi_idct_put(AVCodecContext *avctx, 
AVFrame *frame,
 int16_t (*block)[64])
 {
 TqiContext *t = avctx->priv_data;
-int linesize = frame->linesize[0];
+ptrdiff_t linesize = frame->linesize[0];
 uint8_t *dest_y  =