mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
avcodec/lossless_videodsp: use ptrdiff_t for length parameters
Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
parent
9560766a61
commit
30cadfe071
@ -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++){
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -41,7 +41,7 @@ static void check_add_bytes(LLVidDSPContext c, int width)
|
||||
uint8_t *src1 = av_mallocz(width);
|
||||
uint8_t *dst0 = av_mallocz(width);
|
||||
uint8_t *dst1 = av_mallocz(width);
|
||||
declare_func_emms(AV_CPU_FLAG_MMX, void, uint8_t *dst, uint8_t *src, int w);
|
||||
declare_func_emms(AV_CPU_FLAG_MMX, void, uint8_t *dst, uint8_t *src, ptrdiff_t w);
|
||||
|
||||
if (!src0 || !src1 || !dst0 || !dst1)
|
||||
fail();
|
||||
|
Loading…
Reference in New Issue
Block a user