Merge commit '6892df9294d93322d43255ada299507465bc93c8'

* commit '6892df9294d93322d43255ada299507465bc93c8':
  vp3: Change type of stride parameters to ptrdiff_t

Merged-by: Clément Bœsch <u@pkh.me>
This commit is contained in:
Clément Bœsch 2017-03-19 18:41:26 +01:00
commit 6a42a54b9d
6 changed files with 27 additions and 39 deletions

View File

@ -23,9 +23,9 @@
#include "libavutil/arm/cpu.h"
#include "libavcodec/vp3dsp.h"
void ff_vp3_idct_put_neon(uint8_t *dest, int line_size, int16_t *data);
void ff_vp3_idct_add_neon(uint8_t *dest, int line_size, int16_t *data);
void ff_vp3_idct_dc_add_neon(uint8_t *dest, int line_size, int16_t *data);
void ff_vp3_idct_put_neon(uint8_t *dest, ptrdiff_t stride, int16_t *data);
void ff_vp3_idct_add_neon(uint8_t *dest, ptrdiff_t stride, int16_t *data);
void ff_vp3_idct_dc_add_neon(uint8_t *dest, ptrdiff_t stride, int16_t *data);
void ff_vp3_v_loop_filter_neon(uint8_t *, int, int *);
void ff_vp3_h_loop_filter_neon(uint8_t *, int, int *);

View File

@ -119,7 +119,7 @@ static inline vec_s16 M16(vec_s16 a, vec_s16 C)
#define ADD8(a) vec_add(a, eight)
#define SHIFT4(a) vec_sra(a, four)
static void vp3_idct_put_altivec(uint8_t *dst, int stride, int16_t block[64])
static void vp3_idct_put_altivec(uint8_t *dst, ptrdiff_t stride, int16_t block[64])
{
vec_u8 t;
IDCT_START
@ -148,7 +148,7 @@ static void vp3_idct_put_altivec(uint8_t *dst, int stride, int16_t block[64])
memset(block, 0, sizeof(*block) * 64);
}
static void vp3_idct_add_altivec(uint8_t *dst, int stride, int16_t block[64])
static void vp3_idct_add_altivec(uint8_t *dst, ptrdiff_t stride, int16_t block[64])
{
LOAD_ZERO;
vec_u8 t, vdst;

View File

@ -43,7 +43,7 @@
#define M(a, b) ((int)((SUINT)(a) * (b)) >> 16)
static av_always_inline void idct(uint8_t *dst, int stride,
static av_always_inline void idct(uint8_t *dst, ptrdiff_t stride,
int16_t *input, int type)
{
int16_t *ip = input;
@ -194,21 +194,21 @@ static av_always_inline void idct(uint8_t *dst, int stride,
}
}
static void vp3_idct_put_c(uint8_t *dest /* align 8 */, int line_size,
static void vp3_idct_put_c(uint8_t *dest /* align 8 */, ptrdiff_t stride,
int16_t *block /* align 16 */)
{
idct(dest, line_size, block, 1);
idct(dest, stride, block, 1);
memset(block, 0, sizeof(*block) * 64);
}
static void vp3_idct_add_c(uint8_t *dest /* align 8 */, int line_size,
static void vp3_idct_add_c(uint8_t *dest /* align 8 */, ptrdiff_t stride,
int16_t *block /* align 16 */)
{
idct(dest, line_size, block, 2);
idct(dest, stride, block, 2);
memset(block, 0, sizeof(*block) * 64);
}
static void vp3_idct_dc_add_c(uint8_t *dest /* align 8 */, int line_size,
static void vp3_idct_dc_add_c(uint8_t *dest /* align 8 */, ptrdiff_t stride,
int16_t *block /* align 16 */)
{
int i, dc = (block[0] + 15) >> 5;
@ -222,17 +222,17 @@ static void vp3_idct_dc_add_c(uint8_t *dest /* align 8 */, int line_size,
dest[5] = av_clip_uint8(dest[5] + dc);
dest[6] = av_clip_uint8(dest[6] + dc);
dest[7] = av_clip_uint8(dest[7] + dc);
dest += line_size;
dest += stride;
}
block[0] = 0;
}
static void vp3_v_loop_filter_c(uint8_t *first_pixel, int stride,
static void vp3_v_loop_filter_c(uint8_t *first_pixel, ptrdiff_t stride,
int *bounding_values)
{
unsigned char *end;
int filter_value;
const int nstride = -stride;
const ptrdiff_t nstride = -stride;
for (end = first_pixel + 8; first_pixel < end; first_pixel++) {
filter_value = (first_pixel[2 * nstride] - first_pixel[stride]) +
@ -244,7 +244,7 @@ static void vp3_v_loop_filter_c(uint8_t *first_pixel, int stride,
}
}
static void vp3_h_loop_filter_c(uint8_t *first_pixel, int stride,
static void vp3_h_loop_filter_c(uint8_t *first_pixel, ptrdiff_t stride,
int *bounding_values)
{
unsigned char *end;

View File

@ -38,11 +38,11 @@ typedef struct VP3DSPContext {
const uint8_t *b,
ptrdiff_t stride, int h);
void (*idct_put)(uint8_t *dest, int line_size, int16_t *block);
void (*idct_add)(uint8_t *dest, int line_size, int16_t *block);
void (*idct_dc_add)(uint8_t *dest, int line_size, int16_t *block);
void (*v_loop_filter)(uint8_t *src, int stride, int *bounding_values);
void (*h_loop_filter)(uint8_t *src, int stride, int *bounding_values);
void (*idct_put)(uint8_t *dest, ptrdiff_t stride, int16_t *block);
void (*idct_add)(uint8_t *dest, ptrdiff_t stride, int16_t *block);
void (*idct_dc_add)(uint8_t *dest, ptrdiff_t stride, int16_t *block);
void (*v_loop_filter)(uint8_t *src, ptrdiff_t stride, int *bounding_values);
void (*h_loop_filter)(uint8_t *src, ptrdiff_t stride, int *bounding_values);
} VP3DSPContext;
void ff_vp3dsp_init(VP3DSPContext *c, int flags);

View File

@ -105,9 +105,6 @@ SECTION .text
INIT_MMX mmxext
cglobal vp3_v_loop_filter, 3, 4
%if ARCH_X86_64
movsxd r1, r1d
%endif
mov r3, r1
neg r1
movq m6, [r0+r1*2]
@ -122,9 +119,6 @@ cglobal vp3_v_loop_filter, 3, 4
RET
cglobal vp3_h_loop_filter, 3, 4
%if ARCH_X86_64
movsxd r1, r1d
%endif
lea r3, [r1*3]
movd m6, [r0 -2]
@ -569,7 +563,6 @@ cglobal put_vp_no_rnd_pixels8_l2, 5, 6, 0, dst, src1, src2, stride, h, stride3
cglobal vp3_idct_put, 3, 4, 9
VP3_IDCT r2
movsxdifnidn r1, r1d
mova m4, [pb_80]
lea r3, [r1*3]
%assign %%i 0
@ -626,7 +619,6 @@ cglobal vp3_idct_put, 3, 4, 9
cglobal vp3_idct_add, 3, 4, 9
VP3_IDCT r2
movsxdifnidn r1, r1d
lea r3, [r1*3]
pxor m4, m4
%if mmsize == 16
@ -733,9 +725,6 @@ vp3_idct_funcs
INIT_MMX mmxext
cglobal vp3_idct_dc_add, 3, 4
%if ARCH_X86_64
movsxd r1, r1d
%endif
movsx r3, word [r2]
mov word [r2], 0
lea r2, [r1*3]

View File

@ -26,18 +26,17 @@
#include "libavcodec/avcodec.h"
#include "libavcodec/vp3dsp.h"
void ff_vp3_idct_put_mmx(uint8_t *dest, int line_size, int16_t *block);
void ff_vp3_idct_add_mmx(uint8_t *dest, int line_size, int16_t *block);
void ff_vp3_idct_put_mmx(uint8_t *dest, ptrdiff_t stride, int16_t *block);
void ff_vp3_idct_add_mmx(uint8_t *dest, ptrdiff_t stride, int16_t *block);
void ff_vp3_idct_put_sse2(uint8_t *dest, int line_size, int16_t *block);
void ff_vp3_idct_add_sse2(uint8_t *dest, int line_size, int16_t *block);
void ff_vp3_idct_put_sse2(uint8_t *dest, ptrdiff_t stride, int16_t *block);
void ff_vp3_idct_add_sse2(uint8_t *dest, ptrdiff_t stride, int16_t *block);
void ff_vp3_idct_dc_add_mmxext(uint8_t *dest, int line_size,
int16_t *block);
void ff_vp3_idct_dc_add_mmxext(uint8_t *dest, ptrdiff_t stride, int16_t *block);
void ff_vp3_v_loop_filter_mmxext(uint8_t *src, int stride,
void ff_vp3_v_loop_filter_mmxext(uint8_t *src, ptrdiff_t stride,
int *bounding_values);
void ff_vp3_h_loop_filter_mmxext(uint8_t *src, int stride,
void ff_vp3_h_loop_filter_mmxext(uint8_t *src, ptrdiff_t stride,
int *bounding_values);
void ff_put_vp_no_rnd_pixels8_l2_mmx(uint8_t *dst, const uint8_t *a,