Commit e07fa300 authored by Clément Bœsch's avatar Clément Bœsch

Merge commit 'de452e50'

* commit 'de452e50':
  pixblockdsp: Change type of stride parameters to ptrdiff_t
Merged-by: 's avatarClément Bœsch <u@pkh.me>
parents ce818d90 de452e50
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#include "asm.h" #include "asm.h"
static void get_pixels_mvi(int16_t *restrict block, static void get_pixels_mvi(int16_t *restrict block,
const uint8_t *restrict pixels, ptrdiff_t line_size) const uint8_t *restrict pixels, ptrdiff_t stride)
{ {
int h = 8; int h = 8;
...@@ -34,13 +34,14 @@ static void get_pixels_mvi(int16_t *restrict block, ...@@ -34,13 +34,14 @@ static void get_pixels_mvi(int16_t *restrict block,
stq(unpkbw(p), block); stq(unpkbw(p), block);
stq(unpkbw(p >> 32), block + 4); stq(unpkbw(p >> 32), block + 4);
pixels += line_size; pixels += stride;
block += 8; block += 8;
} while (--h); } while (--h);
} }
static void diff_pixels_mvi(int16_t *block, const uint8_t *s1, const uint8_t *s2, static void diff_pixels_mvi(int16_t *block, const uint8_t *s1, const uint8_t *s2,
int stride) { ptrdiff_t stride)
{
int h = 8; int h = 8;
uint64_t mask = 0x4040; uint64_t mask = 0x4040;
......
...@@ -24,9 +24,10 @@ ...@@ -24,9 +24,10 @@
#include "libavcodec/avcodec.h" #include "libavcodec/avcodec.h"
#include "libavcodec/pixblockdsp.h" #include "libavcodec/pixblockdsp.h"
void ff_get_pixels_armv6(int16_t *block, const uint8_t *pixels, ptrdiff_t stride); void ff_get_pixels_armv6(int16_t *block, const uint8_t *pixels,
ptrdiff_t stride);
void ff_diff_pixels_armv6(int16_t *block, const uint8_t *s1, void ff_diff_pixels_armv6(int16_t *block, const uint8_t *s1,
const uint8_t *s2, int stride); const uint8_t *s2, ptrdiff_t stride);
av_cold void ff_pixblockdsp_init_arm(PixblockDSPContext *c, av_cold void ff_pixblockdsp_init_arm(PixblockDSPContext *c,
AVCodecContext *avctx, AVCodecContext *avctx,
......
...@@ -45,7 +45,7 @@ typedef struct DVVideoContext { ...@@ -45,7 +45,7 @@ typedef struct DVVideoContext {
uint8_t dv_zigzag[2][64]; uint8_t dv_zigzag[2][64];
void (*get_pixels)(int16_t *block, const uint8_t *pixels, ptrdiff_t line_size); void (*get_pixels)(int16_t *block, const uint8_t *pixels, ptrdiff_t linesize);
void (*fdct[2])(int16_t *block); void (*fdct[2])(int16_t *block);
void (*idct_put[2])(uint8_t *dest, int line_size, int16_t *block); void (*idct_put[2])(uint8_t *dest, int line_size, int16_t *block);
me_cmp_func ildct_cmp; me_cmp_func ildct_cmp;
......
...@@ -204,7 +204,7 @@ static av_always_inline PutBitContext *dv_encode_ac(EncBlockInfo *bi, ...@@ -204,7 +204,7 @@ static av_always_inline PutBitContext *dv_encode_ac(EncBlockInfo *bi,
} }
static av_always_inline int dv_guess_dct_mode(DVVideoContext *s, uint8_t *data, static av_always_inline int dv_guess_dct_mode(DVVideoContext *s, uint8_t *data,
int linesize) ptrdiff_t linesize)
{ {
if (s->avctx->flags & AV_CODEC_FLAG_INTERLACED_DCT) { if (s->avctx->flags & AV_CODEC_FLAG_INTERLACED_DCT) {
int ps = s->ildct_cmp(NULL, data, NULL, linesize, 8) - 400; int ps = s->ildct_cmp(NULL, data, NULL, linesize, 8) - 400;
...@@ -241,8 +241,8 @@ static const int dv_weight_248[64] = { ...@@ -241,8 +241,8 @@ static const int dv_weight_248[64] = {
}; };
static av_always_inline int dv_init_enc_block(EncBlockInfo *bi, uint8_t *data, static av_always_inline int dv_init_enc_block(EncBlockInfo *bi, uint8_t *data,
int linesize, DVVideoContext *s, ptrdiff_t linesize,
int bias) DVVideoContext *s, int bias)
{ {
const int *weight; const int *weight;
const uint8_t *zigzag_scan; const uint8_t *zigzag_scan;
...@@ -420,7 +420,8 @@ static int dv_encode_video_segment(AVCodecContext *avctx, void *arg) ...@@ -420,7 +420,8 @@ static int dv_encode_video_segment(AVCodecContext *avctx, void *arg)
DVVideoContext *s = avctx->priv_data; DVVideoContext *s = avctx->priv_data;
DVwork_chunk *work_chunk = arg; DVwork_chunk *work_chunk = arg;
int mb_index, i, j; int mb_index, i, j;
int mb_x, mb_y, c_offset, linesize, y_stride; int mb_x, mb_y, c_offset;
ptrdiff_t linesize, y_stride;
uint8_t *y_ptr; uint8_t *y_ptr;
uint8_t *dif; uint8_t *dif;
LOCAL_ALIGNED_8(uint8_t, scratch, [128]); LOCAL_ALIGNED_8(uint8_t, scratch, [128]);
......
...@@ -25,15 +25,15 @@ ...@@ -25,15 +25,15 @@
#include "../mpegvideo.h" #include "../mpegvideo.h"
void ff_diff_pixels_msa(int16_t *av_restrict block, const uint8_t *src1, void ff_diff_pixels_msa(int16_t *av_restrict block, const uint8_t *src1,
const uint8_t *src2, int stride); const uint8_t *src2, ptrdiff_t stride);
void ff_get_pixels_16_msa(int16_t *restrict dst, const uint8_t *src, void ff_get_pixels_16_msa(int16_t *restrict dst, const uint8_t *src,
ptrdiff_t stride); ptrdiff_t stride);
void ff_get_pixels_8_msa(int16_t *restrict dst, const uint8_t *src, void ff_get_pixels_8_msa(int16_t *restrict dst, const uint8_t *src,
ptrdiff_t stride); ptrdiff_t stride);
void ff_get_pixels_8_mmi(int16_t *av_restrict block, const uint8_t *pixels, void ff_get_pixels_8_mmi(int16_t *av_restrict block, const uint8_t *pixels,
ptrdiff_t line_size); ptrdiff_t stride);
void ff_diff_pixels_mmi(int16_t *av_restrict block, const uint8_t *src1, void ff_diff_pixels_mmi(int16_t *av_restrict block, const uint8_t *src1,
const uint8_t *src2, int stride); const uint8_t *src2, ptrdiff_t stride);
#endif // #ifndef AVCODEC_MIPS_PIXBLOCKDSP_MIPS_H #endif // #ifndef AVCODEC_MIPS_PIXBLOCKDSP_MIPS_H
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#include "libavutil/mips/mmiutils.h" #include "libavutil/mips/mmiutils.h"
void ff_get_pixels_8_mmi(int16_t *av_restrict block, const uint8_t *pixels, void ff_get_pixels_8_mmi(int16_t *av_restrict block, const uint8_t *pixels,
ptrdiff_t line_size) ptrdiff_t stride)
{ {
double ftmp[7]; double ftmp[7];
DECLARE_VAR_ALL64; DECLARE_VAR_ALL64;
...@@ -36,7 +36,7 @@ void ff_get_pixels_8_mmi(int16_t *av_restrict block, const uint8_t *pixels, ...@@ -36,7 +36,7 @@ void ff_get_pixels_8_mmi(int16_t *av_restrict block, const uint8_t *pixels,
"xor %[ftmp0], %[ftmp0], %[ftmp0] \n\t" "xor %[ftmp0], %[ftmp0], %[ftmp0] \n\t"
MMI_LDC1(%[ftmp1], %[pixels], 0x00) MMI_LDC1(%[ftmp1], %[pixels], 0x00)
MMI_LDXC1(%[ftmp2], %[pixels], %[line_size], 0x00) MMI_LDXC1(%[ftmp2], %[pixels], %[stride], 0x00)
"punpcklbh %[ftmp3], %[ftmp1], %[ftmp0] \n\t" "punpcklbh %[ftmp3], %[ftmp1], %[ftmp0] \n\t"
"punpckhbh %[ftmp4], %[ftmp1], %[ftmp0] \n\t" "punpckhbh %[ftmp4], %[ftmp1], %[ftmp0] \n\t"
"punpcklbh %[ftmp5], %[ftmp2], %[ftmp0] \n\t" "punpcklbh %[ftmp5], %[ftmp2], %[ftmp0] \n\t"
...@@ -45,10 +45,10 @@ void ff_get_pixels_8_mmi(int16_t *av_restrict block, const uint8_t *pixels, ...@@ -45,10 +45,10 @@ void ff_get_pixels_8_mmi(int16_t *av_restrict block, const uint8_t *pixels,
MMI_SDC1(%[ftmp4], %[block], 0x08) MMI_SDC1(%[ftmp4], %[block], 0x08)
MMI_SDC1(%[ftmp5], %[block], 0x10) MMI_SDC1(%[ftmp5], %[block], 0x10)
MMI_SDC1(%[ftmp6], %[block], 0x18) MMI_SDC1(%[ftmp6], %[block], 0x18)
PTR_ADDU "%[pixels], %[pixels], %[line_size_x2] \n\t" PTR_ADDU "%[pixels], %[pixels], %[stride_x2] \n\t"
MMI_LDC1(%[ftmp1], %[pixels], 0x00) MMI_LDC1(%[ftmp1], %[pixels], 0x00)
MMI_LDXC1(%[ftmp2], %[pixels], %[line_size], 0x00) MMI_LDXC1(%[ftmp2], %[pixels], %[stride], 0x00)
"punpcklbh %[ftmp3], %[ftmp1], %[ftmp0] \n\t" "punpcklbh %[ftmp3], %[ftmp1], %[ftmp0] \n\t"
"punpckhbh %[ftmp4], %[ftmp1], %[ftmp0] \n\t" "punpckhbh %[ftmp4], %[ftmp1], %[ftmp0] \n\t"
"punpcklbh %[ftmp5], %[ftmp2], %[ftmp0] \n\t" "punpcklbh %[ftmp5], %[ftmp2], %[ftmp0] \n\t"
...@@ -57,10 +57,10 @@ void ff_get_pixels_8_mmi(int16_t *av_restrict block, const uint8_t *pixels, ...@@ -57,10 +57,10 @@ void ff_get_pixels_8_mmi(int16_t *av_restrict block, const uint8_t *pixels,
MMI_SDC1(%[ftmp4], %[block], 0x28) MMI_SDC1(%[ftmp4], %[block], 0x28)
MMI_SDC1(%[ftmp5], %[block], 0x30) MMI_SDC1(%[ftmp5], %[block], 0x30)
MMI_SDC1(%[ftmp6], %[block], 0x38) MMI_SDC1(%[ftmp6], %[block], 0x38)
PTR_ADDU "%[pixels], %[pixels], %[line_size_x2] \n\t" PTR_ADDU "%[pixels], %[pixels], %[stride_x2] \n\t"
MMI_LDC1(%[ftmp1], %[pixels], 0x00) MMI_LDC1(%[ftmp1], %[pixels], 0x00)
MMI_LDXC1(%[ftmp2], %[pixels], %[line_size], 0x00) MMI_LDXC1(%[ftmp2], %[pixels], %[stride], 0x00)
"punpcklbh %[ftmp3], %[ftmp1], %[ftmp0] \n\t" "punpcklbh %[ftmp3], %[ftmp1], %[ftmp0] \n\t"
"punpckhbh %[ftmp4], %[ftmp1], %[ftmp0] \n\t" "punpckhbh %[ftmp4], %[ftmp1], %[ftmp0] \n\t"
"punpcklbh %[ftmp5], %[ftmp2], %[ftmp0] \n\t" "punpcklbh %[ftmp5], %[ftmp2], %[ftmp0] \n\t"
...@@ -69,10 +69,10 @@ void ff_get_pixels_8_mmi(int16_t *av_restrict block, const uint8_t *pixels, ...@@ -69,10 +69,10 @@ void ff_get_pixels_8_mmi(int16_t *av_restrict block, const uint8_t *pixels,
MMI_SDC1(%[ftmp4], %[block], 0x48) MMI_SDC1(%[ftmp4], %[block], 0x48)
MMI_SDC1(%[ftmp5], %[block], 0x50) MMI_SDC1(%[ftmp5], %[block], 0x50)
MMI_SDC1(%[ftmp6], %[block], 0x58) MMI_SDC1(%[ftmp6], %[block], 0x58)
PTR_ADDU "%[pixels], %[pixels], %[line_size_x2] \n\t" PTR_ADDU "%[pixels], %[pixels], %[stride_x2] \n\t"
MMI_LDC1(%[ftmp1], %[pixels], 0x00) MMI_LDC1(%[ftmp1], %[pixels], 0x00)
MMI_LDXC1(%[ftmp2], %[pixels], %[line_size], 0x00) MMI_LDXC1(%[ftmp2], %[pixels], %[stride], 0x00)
"punpcklbh %[ftmp3], %[ftmp1], %[ftmp0] \n\t" "punpcklbh %[ftmp3], %[ftmp1], %[ftmp0] \n\t"
"punpckhbh %[ftmp4], %[ftmp1], %[ftmp0] \n\t" "punpckhbh %[ftmp4], %[ftmp1], %[ftmp0] \n\t"
"punpcklbh %[ftmp5], %[ftmp2], %[ftmp0] \n\t" "punpcklbh %[ftmp5], %[ftmp2], %[ftmp0] \n\t"
...@@ -88,14 +88,14 @@ void ff_get_pixels_8_mmi(int16_t *av_restrict block, const uint8_t *pixels, ...@@ -88,14 +88,14 @@ void ff_get_pixels_8_mmi(int16_t *av_restrict block, const uint8_t *pixels,
RESTRICT_ASM_ALL64 RESTRICT_ASM_ALL64
RESTRICT_ASM_ADDRT RESTRICT_ASM_ADDRT
[pixels]"+&r"(pixels) [pixels]"+&r"(pixels)
: [block]"r"((mips_reg)block), [line_size]"r"((mips_reg)line_size), : [block]"r"((mips_reg)block), [stride]"r"((mips_reg)stride),
[line_size_x2]"r"((mips_reg)(line_size<<1)) [stride_x2]"r"((mips_reg)(stride<<1))
: "memory" : "memory"
); );
} }
void ff_diff_pixels_mmi(int16_t *av_restrict block, const uint8_t *src1, void ff_diff_pixels_mmi(int16_t *av_restrict block, const uint8_t *src1,
const uint8_t *src2, int stride) const uint8_t *src2, ptrdiff_t stride)
{ {
double ftmp[5]; double ftmp[5];
mips_reg tmp[1]; mips_reg tmp[1];
......
...@@ -137,7 +137,7 @@ void ff_get_pixels_8_msa(int16_t *av_restrict dest, const uint8_t *src, ...@@ -137,7 +137,7 @@ void ff_get_pixels_8_msa(int16_t *av_restrict dest, const uint8_t *src,
} }
void ff_diff_pixels_msa(int16_t *av_restrict block, const uint8_t *src1, void ff_diff_pixels_msa(int16_t *av_restrict block, const uint8_t *src1,
const uint8_t *src2, int stride) const uint8_t *src2, ptrdiff_t stride)
{ {
diff_pixels_msa(block, src1, src2, stride); diff_pixels_msa(block, src1, src2, stride);
} }
...@@ -25,20 +25,20 @@ ...@@ -25,20 +25,20 @@
#include "pixblockdsp.h" #include "pixblockdsp.h"
static void get_pixels_16_c(int16_t *av_restrict block, const uint8_t *pixels, static void get_pixels_16_c(int16_t *av_restrict block, const uint8_t *pixels,
ptrdiff_t line_size) ptrdiff_t stride)
{ {
AV_COPY128U(block + 0 * 8, pixels + 0 * line_size); AV_COPY128U(block + 0 * 8, pixels + 0 * stride);
AV_COPY128U(block + 1 * 8, pixels + 1 * line_size); AV_COPY128U(block + 1 * 8, pixels + 1 * stride);
AV_COPY128U(block + 2 * 8, pixels + 2 * line_size); AV_COPY128U(block + 2 * 8, pixels + 2 * stride);
AV_COPY128U(block + 3 * 8, pixels + 3 * line_size); AV_COPY128U(block + 3 * 8, pixels + 3 * stride);
AV_COPY128U(block + 4 * 8, pixels + 4 * line_size); AV_COPY128U(block + 4 * 8, pixels + 4 * stride);
AV_COPY128U(block + 5 * 8, pixels + 5 * line_size); AV_COPY128U(block + 5 * 8, pixels + 5 * stride);
AV_COPY128U(block + 6 * 8, pixels + 6 * line_size); AV_COPY128U(block + 6 * 8, pixels + 6 * stride);
AV_COPY128U(block + 7 * 8, pixels + 7 * line_size); AV_COPY128U(block + 7 * 8, pixels + 7 * stride);
} }
static void get_pixels_8_c(int16_t *av_restrict block, const uint8_t *pixels, static void get_pixels_8_c(int16_t *av_restrict block, const uint8_t *pixels,
ptrdiff_t line_size) ptrdiff_t stride)
{ {
int i; int i;
...@@ -52,13 +52,13 @@ static void get_pixels_8_c(int16_t *av_restrict block, const uint8_t *pixels, ...@@ -52,13 +52,13 @@ static void get_pixels_8_c(int16_t *av_restrict block, const uint8_t *pixels,
block[5] = pixels[5]; block[5] = pixels[5];
block[6] = pixels[6]; block[6] = pixels[6];
block[7] = pixels[7]; block[7] = pixels[7];
pixels += line_size; pixels += stride;
block += 8; block += 8;
} }
} }
static void diff_pixels_c(int16_t *av_restrict block, const uint8_t *s1, static void diff_pixels_c(int16_t *av_restrict block, const uint8_t *s1,
const uint8_t *s2, int stride) const uint8_t *s2, ptrdiff_t stride)
{ {
int i; int i;
......
...@@ -26,11 +26,11 @@ ...@@ -26,11 +26,11 @@
typedef struct PixblockDSPContext { typedef struct PixblockDSPContext {
void (*get_pixels)(int16_t *block /* align 16 */, void (*get_pixels)(int16_t *block /* align 16 */,
const uint8_t *pixels /* align 8 */, const uint8_t *pixels /* align 8 */,
ptrdiff_t line_size); ptrdiff_t stride);
void (*diff_pixels)(int16_t *block /* align 16 */, void (*diff_pixels)(int16_t *block /* align 16 */,
const uint8_t *s1 /* align 8 */, const uint8_t *s1 /* align 8 */,
const uint8_t *s2 /* align 8 */, const uint8_t *s2 /* align 8 */,
int stride); ptrdiff_t stride);
} PixblockDSPContext; } PixblockDSPContext;
void ff_pixblockdsp_init(PixblockDSPContext *c, AVCodecContext *avctx); void ff_pixblockdsp_init(PixblockDSPContext *c, AVCodecContext *avctx);
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
#if HAVE_VSX #if HAVE_VSX
static void get_pixels_altivec(int16_t *restrict block, const uint8_t *pixels, static void get_pixels_altivec(int16_t *restrict block, const uint8_t *pixels,
ptrdiff_t line_size) ptrdiff_t stride)
{ {
int i; int i;
vector unsigned char perm = vector unsigned char perm =
...@@ -59,12 +59,12 @@ static void get_pixels_altivec(int16_t *restrict block, const uint8_t *pixels, ...@@ -59,12 +59,12 @@ static void get_pixels_altivec(int16_t *restrict block, const uint8_t *pixels,
// Save the data to the block, we assume the block is 16-byte aligned. // Save the data to the block, we assume the block is 16-byte aligned.
vec_vsx_st(shorts, i * 16, (vector signed short *) block); vec_vsx_st(shorts, i * 16, (vector signed short *) block);
pixels += line_size; pixels += stride;
} }
} }
#else #else
static void get_pixels_altivec(int16_t *restrict block, const uint8_t *pixels, static void get_pixels_altivec(int16_t *restrict block, const uint8_t *pixels,
ptrdiff_t line_size) ptrdiff_t stride)
{ {
int i; int i;
const vec_u8 zero = (const vec_u8)vec_splat_u8(0); const vec_u8 zero = (const vec_u8)vec_splat_u8(0);
...@@ -84,7 +84,7 @@ static void get_pixels_altivec(int16_t *restrict block, const uint8_t *pixels, ...@@ -84,7 +84,7 @@ static void get_pixels_altivec(int16_t *restrict block, const uint8_t *pixels,
// Save the data to the block, we assume the block is 16-byte aligned. // Save the data to the block, we assume the block is 16-byte aligned.
vec_st(shorts, i * 16, (vec_s16 *)block); vec_st(shorts, i * 16, (vec_s16 *)block);
pixels += line_size; pixels += stride;
} }
} }
...@@ -92,7 +92,7 @@ static void get_pixels_altivec(int16_t *restrict block, const uint8_t *pixels, ...@@ -92,7 +92,7 @@ static void get_pixels_altivec(int16_t *restrict block, const uint8_t *pixels,
#if HAVE_VSX #if HAVE_VSX
static void diff_pixels_altivec(int16_t *restrict block, const uint8_t *s1, static void diff_pixels_altivec(int16_t *restrict block, const uint8_t *s1,
const uint8_t *s2, int stride) const uint8_t *s2, ptrdiff_t stride)
{ {
int i; int i;
const vector unsigned char zero = const vector unsigned char zero =
...@@ -154,7 +154,7 @@ static void diff_pixels_altivec(int16_t *restrict block, const uint8_t *s1, ...@@ -154,7 +154,7 @@ static void diff_pixels_altivec(int16_t *restrict block, const uint8_t *s1,
} }
#else #else
static void diff_pixels_altivec(int16_t *restrict block, const uint8_t *s1, static void diff_pixels_altivec(int16_t *restrict block, const uint8_t *s1,
const uint8_t *s2, int stride) const uint8_t *s2, ptrdiff_t stride)
{ {
int i; int i;
vec_u8 perm; vec_u8 perm;
...@@ -233,7 +233,7 @@ static void diff_pixels_altivec(int16_t *restrict block, const uint8_t *s1, ...@@ -233,7 +233,7 @@ static void diff_pixels_altivec(int16_t *restrict block, const uint8_t *s1,
#if HAVE_VSX #if HAVE_VSX
static void get_pixels_vsx(int16_t *restrict block, const uint8_t *pixels, static void get_pixels_vsx(int16_t *restrict block, const uint8_t *pixels,
ptrdiff_t line_size) ptrdiff_t stride)
{ {
int i; int i;
for (i = 0; i < 8; i++) { for (i = 0; i < 8; i++) {
...@@ -241,12 +241,12 @@ static void get_pixels_vsx(int16_t *restrict block, const uint8_t *pixels, ...@@ -241,12 +241,12 @@ static void get_pixels_vsx(int16_t *restrict block, const uint8_t *pixels,
vec_vsx_st(shorts, i * 16, block); vec_vsx_st(shorts, i * 16, block);
pixels += line_size; pixels += stride;
} }
} }
static void diff_pixels_vsx(int16_t *restrict block, const uint8_t *s1, static void diff_pixels_vsx(int16_t *restrict block, const uint8_t *s1,
const uint8_t *s2, int stride) const uint8_t *s2, ptrdiff_t stride)
{ {
int i; int i;
vec_s16 shorts1, shorts2; vec_s16 shorts1, shorts2;
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
SECTION .text SECTION .text
INIT_MMX mmx INIT_MMX mmx
; void ff_get_pixels_mmx(int16_t *block, const uint8_t *pixels, ptrdiff_t line_size) ; void ff_get_pixels_mmx(int16_t *block, const uint8_t *pixels, ptrdiff_t stride)
cglobal get_pixels, 3,4 cglobal get_pixels, 3,4
add r0, 128 add r0, 128
mov r3, -128 mov r3, -128
...@@ -81,10 +81,9 @@ cglobal get_pixels, 3, 4, 5 ...@@ -81,10 +81,9 @@ cglobal get_pixels, 3, 4, 5
RET RET
; void ff_diff_pixels_mmx(int16_t *block, const uint8_t *s1, const uint8_t *s2, ; void ff_diff_pixels_mmx(int16_t *block, const uint8_t *s1, const uint8_t *s2,
; int stride); ; ptrdiff_t stride);
%macro DIFF_PIXELS 0 %macro DIFF_PIXELS 0
cglobal diff_pixels, 4,5,5 cglobal diff_pixels, 4,5,5
movsxdifnidn r3, r3d
pxor m4, m4 pxor m4, m4
add r0, 128 add r0, 128
mov r4, -128 mov r4, -128
......
...@@ -23,12 +23,12 @@ ...@@ -23,12 +23,12 @@
#include "libavutil/x86/cpu.h" #include "libavutil/x86/cpu.h"
#include "libavcodec/pixblockdsp.h" #include "libavcodec/pixblockdsp.h"
void ff_get_pixels_mmx(int16_t *block, const uint8_t *pixels, ptrdiff_t line_size); void ff_get_pixels_mmx(int16_t *block, const uint8_t *pixels, ptrdiff_t stride);
void ff_get_pixels_sse2(int16_t *block, const uint8_t *pixels, ptrdiff_t line_size); void ff_get_pixels_sse2(int16_t *block, const uint8_t *pixels, ptrdiff_t stride);
void ff_diff_pixels_mmx(int16_t *block, const uint8_t *s1, const uint8_t *s2, void ff_diff_pixels_mmx(int16_t *block, const uint8_t *s1, const uint8_t *s2,
int stride); ptrdiff_t stride);
void ff_diff_pixels_sse2(int16_t *block, const uint8_t *s1, const uint8_t *s2, void ff_diff_pixels_sse2(int16_t *block, const uint8_t *s1, const uint8_t *s2,
int stride); ptrdiff_t stride);
av_cold void ff_pixblockdsp_init_x86(PixblockDSPContext *c, av_cold void ff_pixblockdsp_init_x86(PixblockDSPContext *c,
AVCodecContext *avctx, AVCodecContext *avctx,
......
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
#define check_diff_pixels(type) \ #define check_diff_pixels(type) \
do { \ do { \
int i; \ int i; \
declare_func_emms(AV_CPU_FLAG_MMX, void, int16_t *av_restrict block, const uint8_t *s1, const uint8_t *s2, int stride); \ declare_func_emms(AV_CPU_FLAG_MMX, void, int16_t *av_restrict block, const uint8_t *s1, const uint8_t *s2, ptrdiff_t stride); \
\ \
for (i = 0; i < BUF_UNITS; i++) { \ for (i = 0; i < BUF_UNITS; i++) { \
int src_offset = i * 64 * sizeof(type) + 8 * i; /* Test various alignments */ \ int src_offset = i * 64 * sizeof(type) + 8 * i; /* Test various alignments */ \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment