aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-02-06 13:16:31 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-02-06 13:22:19 +0100
commit0ddca7d416cc8b80d9943405d6d0bb39bc2dec06 (patch)
tree78c1a6834e65ea7376353819338482c5eea83b2e
parentede45c4e1da8bd2fefc89ea63e57a49e6c0a3e19 (diff)
downloadffmpeg-0ddca7d416cc8b80d9943405d6d0bb39bc2dec06.tar.gz
dsputil: fixup half a dozen bugs with ptrdiff vs int linesize
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/dsputil.h2
-rw-r--r--libavcodec/dsputil_template.c2
-rw-r--r--libavcodec/hpel_template.c6
-rw-r--r--libavcodec/snow.c2
-rw-r--r--libavcodec/vc1dsp.h6
-rw-r--r--libavcodec/x86/dsputil_mmx.c4
6 files changed, 12 insertions, 10 deletions
diff --git a/libavcodec/dsputil.h b/libavcodec/dsputil.h
index 4fea90f666..f0158cdf2a 100644
--- a/libavcodec/dsputil.h
+++ b/libavcodec/dsputil.h
@@ -170,7 +170,7 @@ DEF_OLD_QPEL(qpel8_mc13_old_c)
DEF_OLD_QPEL(qpel8_mc33_old_c)
#define CALL_2X_PIXELS(a, b, n)\
-static void a(uint8_t *block, const uint8_t *pixels, int line_size, int h){\
+static void a(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h){\
b(block , pixels , line_size, h);\
b(block+n, pixels+n, line_size, h);\
}
diff --git a/libavcodec/dsputil_template.c b/libavcodec/dsputil_template.c
index ceaebea439..201aa55828 100644
--- a/libavcodec/dsputil_template.c
+++ b/libavcodec/dsputil_template.c
@@ -361,7 +361,7 @@ static inline void FUNCC(OPNAME ## _pixels4_xy2)(uint8_t *block, const uint8_t *
}\
}\
\
-static inline void FUNCC(OPNAME ## _pixels8_xy2)(uint8_t *block, const uint8_t *pixels, int line_size, int h)\
+static inline void FUNCC(OPNAME ## _pixels8_xy2)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)\
{\
/* FIXME HIGH BIT DEPTH */\
int j;\
diff --git a/libavcodec/hpel_template.c b/libavcodec/hpel_template.c
index 67a1bcb380..3b4699927f 100644
--- a/libavcodec/hpel_template.c
+++ b/libavcodec/hpel_template.c
@@ -20,7 +20,7 @@
*/
#define DEF_HPEL(OPNAME, OP) \
-static inline void FUNCC(OPNAME ## _pixels2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){\
+static inline void FUNCC(OPNAME ## _pixels2)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h){\
int i;\
for(i=0; i<h; i++){\
OP(*((pixel2*)(block )), AV_RN2P(pixels ));\
@@ -28,7 +28,7 @@ static inline void FUNCC(OPNAME ## _pixels2)(uint8_t *block, const uint8_t *pixe
block +=line_size;\
}\
}\
-static inline void FUNCC(OPNAME ## _pixels4)(uint8_t *block, const uint8_t *pixels, int line_size, int h){\
+static inline void FUNCC(OPNAME ## _pixels4)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h){\
int i;\
for(i=0; i<h; i++){\
OP(*((pixel4*)(block )), AV_RN4P(pixels ));\
@@ -36,7 +36,7 @@ static inline void FUNCC(OPNAME ## _pixels4)(uint8_t *block, const uint8_t *pixe
block +=line_size;\
}\
}\
-static inline void FUNCC(OPNAME ## _pixels8)(uint8_t *block, const uint8_t *pixels, int line_size, int h){\
+static inline void FUNCC(OPNAME ## _pixels8)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h){\
int i;\
for(i=0; i<h; i++){\
OP(*((pixel4*)(block )), AV_RN4P(pixels ));\
diff --git a/libavcodec/snow.c b/libavcodec/snow.c
index 643747d8b3..7a5c1c04ca 100644
--- a/libavcodec/snow.c
+++ b/libavcodec/snow.c
@@ -378,7 +378,7 @@ void ff_snow_pred_block(SnowContext *s, uint8_t *dst, uint8_t *tmp, int stride,
}
#define mca(dx,dy,b_w)\
-static void mc_block_hpel ## dx ## dy ## b_w(uint8_t *dst, const uint8_t *src, int stride, int h){\
+static void mc_block_hpel ## dx ## dy ## b_w(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h){\
av_assert2(h==b_w);\
mc_block(NULL, dst, src-(HTAPS_MAX/2-1)-(HTAPS_MAX/2-1)*stride, stride, b_w, b_w, dx, dy);\
}
diff --git a/libavcodec/vc1dsp.h b/libavcodec/vc1dsp.h
index 901e46abc9..1d4c813528 100644
--- a/libavcodec/vc1dsp.h
+++ b/libavcodec/vc1dsp.h
@@ -30,6 +30,8 @@
#include "dsputil.h"
+typedef void (*vc1op_pixels_func)(uint8_t *block/*align width (8 or 16)*/, const uint8_t *pixels/*align 1*/, int line_size, int h);
+
typedef struct VC1DSPContext {
/* vc1 functions */
void (*vc1_inv_trans_8x8)(int16_t *b);
@@ -54,8 +56,8 @@ typedef struct VC1DSPContext {
/* put 8x8 block with bicubic interpolation and quarterpel precision
* last argument is actually round value instead of height
*/
- op_pixels_func put_vc1_mspel_pixels_tab[16];
- op_pixels_func avg_vc1_mspel_pixels_tab[16];
+ vc1op_pixels_func put_vc1_mspel_pixels_tab[16];
+ vc1op_pixels_func avg_vc1_mspel_pixels_tab[16];
/* This is really one func used in VC-1 decoding */
h264_chroma_mc_func put_no_rnd_vc1_chroma_pixels_tab[3];
diff --git a/libavcodec/x86/dsputil_mmx.c b/libavcodec/x86/dsputil_mmx.c
index 271d2b3818..0db4143d98 100644
--- a/libavcodec/x86/dsputil_mmx.c
+++ b/libavcodec/x86/dsputil_mmx.c
@@ -468,7 +468,7 @@ void ff_add_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels,
}
static void put_pixels8_mmx(uint8_t *block, const uint8_t *pixels,
- int line_size, int h)
+ ptrdiff_t line_size, int h)
{
__asm__ volatile (
"lea (%3, %3), %%"REG_a" \n\t"
@@ -495,7 +495,7 @@ static void put_pixels8_mmx(uint8_t *block, const uint8_t *pixels,
}
static void put_pixels16_mmx(uint8_t *block, const uint8_t *pixels,
- int line_size, int h)
+ ptrdiff_t line_size, int h)
{
__asm__ volatile (
"lea (%3, %3), %%"REG_a" \n\t"