[FFmpeg-cvslog] Merge commit '6892df9294d93322d43255ada299507465bc93c8'
Clément Bœsch
git at videolan.org
Sun Mar 19 19:43:28 EET 2017
ffmpeg | branch: master | Clément Bœsch <u at pkh.me> | Sun Mar 19 18:41:26 2017 +0100| [6a42a54b9de41d5eb1b246409e280c85194ed6ff] | committer: Clément Bœsch
Merge commit '6892df9294d93322d43255ada299507465bc93c8'
* commit '6892df9294d93322d43255ada299507465bc93c8':
vp3: Change type of stride parameters to ptrdiff_t
Merged-by: Clément Bœsch <u at pkh.me>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6a42a54b9de41d5eb1b246409e280c85194ed6ff
---
libavcodec/arm/vp3dsp_init_arm.c | 6 +++---
libavcodec/ppc/vp3dsp_altivec.c | 4 ++--
libavcodec/vp3dsp.c | 20 ++++++++++----------
libavcodec/vp3dsp.h | 10 +++++-----
libavcodec/x86/vp3dsp.asm | 11 -----------
libavcodec/x86/vp3dsp_init.c | 15 +++++++--------
6 files changed, 27 insertions(+), 39 deletions(-)
diff --git a/libavcodec/arm/vp3dsp_init_arm.c b/libavcodec/arm/vp3dsp_init_arm.c
index d924636..65ea53f 100644
--- a/libavcodec/arm/vp3dsp_init_arm.c
+++ b/libavcodec/arm/vp3dsp_init_arm.c
@@ -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 *);
diff --git a/libavcodec/ppc/vp3dsp_altivec.c b/libavcodec/ppc/vp3dsp_altivec.c
index 4a367b6..d2231d0 100644
--- a/libavcodec/ppc/vp3dsp_altivec.c
+++ b/libavcodec/ppc/vp3dsp_altivec.c
@@ -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;
diff --git a/libavcodec/vp3dsp.c b/libavcodec/vp3dsp.c
index 4b6c838..fdaa292 100644
--- a/libavcodec/vp3dsp.c
+++ b/libavcodec/vp3dsp.c
@@ -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;
diff --git a/libavcodec/vp3dsp.h b/libavcodec/vp3dsp.h
index b95adae..2fdad16 100644
--- a/libavcodec/vp3dsp.h
+++ b/libavcodec/vp3dsp.h
@@ -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);
diff --git a/libavcodec/x86/vp3dsp.asm b/libavcodec/x86/vp3dsp.asm
index d457cd7..d88d5a1 100644
--- a/libavcodec/x86/vp3dsp.asm
+++ b/libavcodec/x86/vp3dsp.asm
@@ -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]
diff --git a/libavcodec/x86/vp3dsp_init.c b/libavcodec/x86/vp3dsp_init.c
index 2ece9ab..1ba9576 100644
--- a/libavcodec/x86/vp3dsp_init.c
+++ b/libavcodec/x86/vp3dsp_init.c
@@ -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,
======================================================================
diff --cc libavcodec/vp3dsp.c
index 4b6c838,459441e..fdaa292
--- a/libavcodec/vp3dsp.c
+++ b/libavcodec/vp3dsp.c
@@@ -41,9 -42,9 +41,9 @@@
#define xC6S2 25080
#define xC7S1 12785
-#define M(a, b) (((a) * (b)) >> 16)
+#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;
diff --cc libavcodec/x86/vp3dsp_init.c
index 2ece9ab,043e10f..1ba9576
--- a/libavcodec/x86/vp3dsp_init.c
+++ b/libavcodec/x86/vp3dsp_init.c
@@@ -25,25 -23,21 +25,24 @@@
#include "libavutil/x86/cpu.h"
#include "libavcodec/avcodec.h"
#include "libavcodec/vp3dsp.h"
-#include "config.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,
+ const uint8_t *b, ptrdiff_t stride,
+ int h);
+
av_cold void ff_vp3dsp_init_x86(VP3DSPContext *c, int flags)
{
int cpu_flags = av_get_cpu_flags();
More information about the ffmpeg-cvslog
mailing list