aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2017-03-22 18:27:53 -0300
committerJames Almer <jamrial@gmail.com>2017-03-22 18:38:35 -0300
commit30cadfe071ad353b60144d235a347a57ada7998c (patch)
tree1e997160f0efac4296986f8b9cacb2386b3f16b8 /libavcodec
parent9560766a6164ed362e7f274242a024fe7b71d154 (diff)
downloadffmpeg-30cadfe071ad353b60144d235a347a57ada7998c.tar.gz
avcodec/lossless_videodsp: use ptrdiff_t for length parameters
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/lossless_videodsp.c8
-rw-r--r--libavcodec/lossless_videodsp.h11
-rw-r--r--libavcodec/ppc/lossless_videodsp_altivec.c2
-rw-r--r--libavcodec/x86/lossless_videodsp_init.c18
4 files changed, 21 insertions, 18 deletions
diff --git a/libavcodec/lossless_videodsp.c b/libavcodec/lossless_videodsp.c
index 1de288b246..b5b96e6129 100644
--- a/libavcodec/lossless_videodsp.c
+++ b/libavcodec/lossless_videodsp.c
@@ -25,7 +25,7 @@
#define pb_7f (~0UL / 255 * 0x7f)
#define pb_80 (~0UL / 255 * 0x80)
-static void add_bytes_c(uint8_t *dst, uint8_t *src, intptr_t w)
+static void add_bytes_c(uint8_t *dst, uint8_t *src, ptrdiff_t w)
{
long i;
@@ -39,7 +39,7 @@ static void add_bytes_c(uint8_t *dst, uint8_t *src, intptr_t w)
}
static void add_median_pred_c(uint8_t *dst, const uint8_t *src1,
- const uint8_t *diff, intptr_t w,
+ const uint8_t *diff, ptrdiff_t w,
int *left, int *left_top)
{
int i;
@@ -58,7 +58,7 @@ static void add_median_pred_c(uint8_t *dst, const uint8_t *src1,
*left_top = lt;
}
-static int add_left_pred_c(uint8_t *dst, const uint8_t *src, intptr_t w,
+static int add_left_pred_c(uint8_t *dst, const uint8_t *src, ptrdiff_t w,
int acc)
{
int i;
@@ -79,7 +79,7 @@ static int add_left_pred_c(uint8_t *dst, const uint8_t *src, intptr_t w,
return acc;
}
-static int add_left_pred_int16_c(uint16_t *dst, const uint16_t *src, unsigned mask, int w, unsigned acc){
+static int add_left_pred_int16_c(uint16_t *dst, const uint16_t *src, unsigned mask, ptrdiff_t w, unsigned acc){
int i;
for(i=0; i<w-1; i++){
diff --git a/libavcodec/lossless_videodsp.h b/libavcodec/lossless_videodsp.h
index 32f3fba860..cecf0fe1e5 100644
--- a/libavcodec/lossless_videodsp.h
+++ b/libavcodec/lossless_videodsp.h
@@ -22,20 +22,23 @@
#ifndef AVCODEC_LOSSLESS_VIDEODSP_H
#define AVCODEC_LOSSLESS_VIDEODSP_H
+#include <stdint.h>
+#include <stddef.h>
+
#include "avcodec.h"
#include "libavutil/cpu.h"
typedef struct LLVidDSPContext {
void (*add_bytes)(uint8_t *dst /* align 16 */, uint8_t *src /* align 16 */,
- intptr_t w);
+ ptrdiff_t w);
void (*add_median_pred)(uint8_t *dst, const uint8_t *top,
- const uint8_t *diff, intptr_t w,
+ const uint8_t *diff, ptrdiff_t w,
int *left, int *left_top);
int (*add_left_pred)(uint8_t *dst, const uint8_t *src,
- intptr_t w, int left);
+ ptrdiff_t w, int left);
int (*add_left_pred_int16)(uint16_t *dst, const uint16_t *src,
- unsigned mask, int w, unsigned left);
+ unsigned mask, ptrdiff_t w, unsigned left);
} LLVidDSPContext;
void ff_llviddsp_init(LLVidDSPContext *llviddsp);
diff --git a/libavcodec/ppc/lossless_videodsp_altivec.c b/libavcodec/ppc/lossless_videodsp_altivec.c
index c388dc33af..16dd99f8d7 100644
--- a/libavcodec/ppc/lossless_videodsp_altivec.c
+++ b/libavcodec/ppc/lossless_videodsp_altivec.c
@@ -33,7 +33,7 @@
#include "libavcodec/lossless_videodsp.h"
#if HAVE_ALTIVEC
-static void add_bytes_altivec(uint8_t *dst, uint8_t *src, intptr_t w)
+static void add_bytes_altivec(uint8_t *dst, uint8_t *src, ptrdiff_t w)
{
register int i;
register vector unsigned char vdst, vsrc;
diff --git a/libavcodec/x86/lossless_videodsp_init.c b/libavcodec/x86/lossless_videodsp_init.c
index 8d583447dc..21bbd12bd2 100644
--- a/libavcodec/x86/lossless_videodsp_init.c
+++ b/libavcodec/x86/lossless_videodsp_init.c
@@ -23,27 +23,27 @@
#include "../lossless_videodsp.h"
#include "libavutil/x86/cpu.h"
-void ff_add_bytes_mmx(uint8_t *dst, uint8_t *src, intptr_t w);
-void ff_add_bytes_sse2(uint8_t *dst, uint8_t *src, intptr_t w);
+void ff_add_bytes_mmx(uint8_t *dst, uint8_t *src, ptrdiff_t w);
+void ff_add_bytes_sse2(uint8_t *dst, uint8_t *src, ptrdiff_t w);
void ff_add_median_pred_mmxext(uint8_t *dst, const uint8_t *top,
- const uint8_t *diff, intptr_t w,
+ const uint8_t *diff, ptrdiff_t w,
int *left, int *left_top);
void ff_add_median_pred_sse2(uint8_t *dst, const uint8_t *top,
- const uint8_t *diff, intptr_t w,
+ const uint8_t *diff, ptrdiff_t w,
int *left, int *left_top);
int ff_add_left_pred_ssse3(uint8_t *dst, const uint8_t *src,
- intptr_t w, int left);
+ ptrdiff_t w, int left);
int ff_add_left_pred_unaligned_ssse3(uint8_t *dst, const uint8_t *src,
- intptr_t w, int left);
+ ptrdiff_t w, int left);
-int ff_add_left_pred_int16_ssse3(uint16_t *dst, const uint16_t *src, unsigned mask, int w, unsigned acc);
-int ff_add_left_pred_int16_sse4(uint16_t *dst, const uint16_t *src, unsigned mask, int w, unsigned acc);
+int ff_add_left_pred_int16_ssse3(uint16_t *dst, const uint16_t *src, unsigned mask, ptrdiff_t w, unsigned acc);
+int ff_add_left_pred_int16_sse4(uint16_t *dst, const uint16_t *src, unsigned mask, ptrdiff_t w, unsigned acc);
#if HAVE_INLINE_ASM && HAVE_7REGS && ARCH_X86_32
static void add_median_pred_cmov(uint8_t *dst, const uint8_t *top,
- const uint8_t *diff, intptr_t w,
+ const uint8_t *diff, ptrdiff_t w,
int *left, int *left_top)
{
x86_reg w2 = -w;