From 82bb3048013201c0095d2853d4623633d912252f Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Fri, 20 Dec 2013 15:44:16 +0100 Subject: [PATCH] dsputil: Use correct type in me_cmp_func function pointer --- libavcodec/arm/dsputil_init_armv6.c | 11 +++--- libavcodec/bfin/dsputil_init.c | 23 +++++++------ libavcodec/dsputil.c | 67 +++++++++++++++++-------------------- libavcodec/dsputil.h | 3 +- libavcodec/motion_est.c | 4 ++- libavcodec/ppc/dsputil_altivec.c | 21 ++++++------ libavcodec/x86/dsputilenc.asm | 7 ++-- libavcodec/x86/dsputilenc_mmx.c | 30 ++++++++--------- libavcodec/x86/motion_est.c | 20 ++++++----- 9 files changed, 95 insertions(+), 91 deletions(-) diff --git a/libavcodec/arm/dsputil_init_armv6.c b/libavcodec/arm/dsputil_init_armv6.c index d385e78..2b1002b 100644 --- a/libavcodec/arm/dsputil_init_armv6.c +++ b/libavcodec/arm/dsputil_init_armv6.c @@ -23,6 +23,7 @@ #include "libavutil/attributes.h" #include "libavcodec/avcodec.h" #include "libavcodec/dsputil.h" +#include "libavcodec/mpegvideo.h" #include "dsputil_arm.h" void ff_simple_idct_armv6(int16_t *data); @@ -36,17 +37,17 @@ void ff_get_pixels_armv6(int16_t *block, const uint8_t *pixels, int stride); void ff_diff_pixels_armv6(int16_t *block, const uint8_t *s1, const uint8_t *s2, int stride); -int ff_pix_abs16_armv6(void *s, uint8_t *blk1, uint8_t *blk2, +int ff_pix_abs16_armv6(MpegEncContext *s, uint8_t *blk1, uint8_t *blk2, int line_size, int h); -int ff_pix_abs16_x2_armv6(void *s, uint8_t *blk1, uint8_t *blk2, +int ff_pix_abs16_x2_armv6(MpegEncContext *s, uint8_t *blk1, uint8_t *blk2, int line_size, int h); -int ff_pix_abs16_y2_armv6(void *s, uint8_t *blk1, uint8_t *blk2, +int ff_pix_abs16_y2_armv6(MpegEncContext *s, uint8_t *blk1, uint8_t *blk2, int line_size, int h); -int ff_pix_abs8_armv6(void *s, uint8_t *blk1, uint8_t *blk2, +int ff_pix_abs8_armv6(MpegEncContext *s, uint8_t *blk1, uint8_t *blk2, int line_size, int h); -int ff_sse16_armv6(void *s, uint8_t *blk1, uint8_t *blk2, +int ff_sse16_armv6(MpegEncContext *s, uint8_t *blk1, uint8_t *blk2, int line_size, int h); int ff_pix_norm1_armv6(uint8_t *pix, int line_size); diff --git a/libavcodec/bfin/dsputil_init.c b/libavcodec/bfin/dsputil_init.c index 751d54a..537f729 100644 --- a/libavcodec/bfin/dsputil_init.c +++ b/libavcodec/bfin/dsputil_init.c @@ -28,6 +28,7 @@ #include "libavutil/bfin/attributes.h" #include "libavcodec/avcodec.h" #include "libavcodec/dsputil.h" +#include "libavcodec/mpegvideo.h" void ff_bfin_idct(int16_t *block) attribute_l1_text; void ff_bfin_fdct(int16_t *block) attribute_l1_text; @@ -50,11 +51,11 @@ int ff_bfin_z_sad8x8(uint8_t *blk1, uint8_t *blk2, int dsz, int ff_bfin_z_sad16x16(uint8_t *blk1, uint8_t *blk2, int dsz, int line_size, int h) attribute_l1_text; -int ff_bfin_sse4(void *v, uint8_t *pix1, uint8_t *pix2, +int ff_bfin_sse4(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) attribute_l1_text; -int ff_bfin_sse8(void *v, uint8_t *pix1, uint8_t *pix2, +int ff_bfin_sse8(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) attribute_l1_text; -int ff_bfin_sse16(void *v, uint8_t *pix1, uint8_t *pix2, +int ff_bfin_sse16(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) attribute_l1_text; static void bfin_idct_add(uint8_t *dest, int line_size, int16_t *block) @@ -81,7 +82,7 @@ static void bfin_clear_blocks(int16_t *blocks) ::"a" (blocks) : "P0", "I0", "R0"); } -static int bfin_pix_abs16(void *c, uint8_t *blk1, uint8_t *blk2, +static int bfin_pix_abs16(MpegEncContext *c, uint8_t *blk1, uint8_t *blk2, int line_size, int h) { return ff_bfin_z_sad16x16(blk1, blk2, line_size, line_size, h); @@ -89,48 +90,48 @@ static int bfin_pix_abs16(void *c, uint8_t *blk1, uint8_t *blk2, static uint8_t vtmp_blk[256] attribute_l1_data_b; -static int bfin_pix_abs16_x2(void *c, uint8_t *blk1, uint8_t *blk2, +static int bfin_pix_abs16_x2(MpegEncContext *c, uint8_t *blk1, uint8_t *blk2, int line_size, int h) { ff_bfin_put_pixels16uc(vtmp_blk, blk2, blk2 + 1, 16, line_size, h); return ff_bfin_z_sad16x16(blk1, vtmp_blk, line_size, 16, h); } -static int bfin_pix_abs16_y2(void *c, uint8_t *blk1, uint8_t *blk2, +static int bfin_pix_abs16_y2(MpegEncContext *c, uint8_t *blk1, uint8_t *blk2, int line_size, int h) { ff_bfin_put_pixels16uc(vtmp_blk, blk2, blk2 + line_size, 16, line_size, h); return ff_bfin_z_sad16x16(blk1, vtmp_blk, line_size, 16, h); } -static int bfin_pix_abs16_xy2(void *c, uint8_t *blk1, uint8_t *blk2, +static int bfin_pix_abs16_xy2(MpegEncContext *c, uint8_t *blk1, uint8_t *blk2, int line_size, int h) { ff_bfin_z_put_pixels16_xy2(vtmp_blk, blk2, 16, line_size, h); return ff_bfin_z_sad16x16(blk1, vtmp_blk, line_size, 16, h); } -static int bfin_pix_abs8(void *c, uint8_t *blk1, uint8_t *blk2, +static int bfin_pix_abs8(MpegEncContext *c, uint8_t *blk1, uint8_t *blk2, int line_size, int h) { return ff_bfin_z_sad8x8(blk1, blk2, line_size, line_size, h); } -static int bfin_pix_abs8_x2(void *c, uint8_t *blk1, uint8_t *blk2, +static int bfin_pix_abs8_x2(MpegEncContext *c, uint8_t *blk1, uint8_t *blk2, int line_size, int h) { ff_bfin_put_pixels8uc(vtmp_blk, blk2, blk2 + 1, 8, line_size, h); return ff_bfin_z_sad8x8(blk1, vtmp_blk, line_size, 8, h); } -static int bfin_pix_abs8_y2(void *c, uint8_t *blk1, uint8_t *blk2, +static int bfin_pix_abs8_y2(MpegEncContext *c, uint8_t *blk1, uint8_t *blk2, int line_size, int h) { ff_bfin_put_pixels8uc(vtmp_blk, blk2, blk2 + line_size, 8, line_size, h); return ff_bfin_z_sad8x8(blk1, vtmp_blk, line_size, 8, h); } -static int bfin_pix_abs8_xy2(void *c, uint8_t *blk1, uint8_t *blk2, +static int bfin_pix_abs8_xy2(MpegEncContext *c, uint8_t *blk1, uint8_t *blk2, int line_size, int h) { ff_bfin_z_put_pixels8_xy2(vtmp_blk, blk2, 8, line_size, h); diff --git a/libavcodec/dsputil.c b/libavcodec/dsputil.c index 76f20e0..9fe6f0b 100644 --- a/libavcodec/dsputil.c +++ b/libavcodec/dsputil.c @@ -252,7 +252,8 @@ static void bswap16_buf(uint16_t *dst, const uint16_t *src, int len) *dst++ = av_bswap16(*src++); } -static int sse4_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) +static int sse4_c(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, + int line_size, int h) { int s = 0, i; uint32_t *sq = ff_square_tab + 256; @@ -268,7 +269,8 @@ static int sse4_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) return s; } -static int sse8_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) +static int sse8_c(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, + int line_size, int h) { int s = 0, i; uint32_t *sq = ff_square_tab + 256; @@ -288,7 +290,8 @@ static int sse8_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) return s; } -static int sse16_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) +static int sse16_c(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, + int line_size, int h) { int s = 0, i; uint32_t *sq = ff_square_tab + 256; @@ -1633,7 +1636,7 @@ static void put_mspel8_mc22_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride) wmv2_mspel8_v_lowpass(dst, halfH + 8, stride, 8, 8); } -static inline int pix_abs16_c(void *v, uint8_t *pix1, uint8_t *pix2, +static inline int pix_abs16_c(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) { int s = 0, i; @@ -1661,7 +1664,7 @@ static inline int pix_abs16_c(void *v, uint8_t *pix1, uint8_t *pix2, return s; } -static int pix_abs16_x2_c(void *v, uint8_t *pix1, uint8_t *pix2, +static int pix_abs16_x2_c(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) { int s = 0, i; @@ -1689,7 +1692,7 @@ static int pix_abs16_x2_c(void *v, uint8_t *pix1, uint8_t *pix2, return s; } -static int pix_abs16_y2_c(void *v, uint8_t *pix1, uint8_t *pix2, +static int pix_abs16_y2_c(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) { int s = 0, i; @@ -1719,7 +1722,7 @@ static int pix_abs16_y2_c(void *v, uint8_t *pix1, uint8_t *pix2, return s; } -static int pix_abs16_xy2_c(void *v, uint8_t *pix1, uint8_t *pix2, +static int pix_abs16_xy2_c(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) { int s = 0, i; @@ -1749,7 +1752,7 @@ static int pix_abs16_xy2_c(void *v, uint8_t *pix1, uint8_t *pix2, return s; } -static inline int pix_abs8_c(void *v, uint8_t *pix1, uint8_t *pix2, +static inline int pix_abs8_c(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) { int s = 0, i; @@ -1769,7 +1772,7 @@ static inline int pix_abs8_c(void *v, uint8_t *pix1, uint8_t *pix2, return s; } -static int pix_abs8_x2_c(void *v, uint8_t *pix1, uint8_t *pix2, +static int pix_abs8_x2_c(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) { int s = 0, i; @@ -1789,7 +1792,7 @@ static int pix_abs8_x2_c(void *v, uint8_t *pix1, uint8_t *pix2, return s; } -static int pix_abs8_y2_c(void *v, uint8_t *pix1, uint8_t *pix2, +static int pix_abs8_y2_c(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) { int s = 0, i; @@ -1811,7 +1814,7 @@ static int pix_abs8_y2_c(void *v, uint8_t *pix1, uint8_t *pix2, return s; } -static int pix_abs8_xy2_c(void *v, uint8_t *pix1, uint8_t *pix2, +static int pix_abs8_xy2_c(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) { int s = 0, i; @@ -1833,9 +1836,8 @@ static int pix_abs8_xy2_c(void *v, uint8_t *pix1, uint8_t *pix2, return s; } -static int nsse16_c(void *v, uint8_t *s1, uint8_t *s2, int stride, int h) +static int nsse16_c(MpegEncContext *c, uint8_t *s1, uint8_t *s2, int stride, int h) { - MpegEncContext *c = v; int score1 = 0, score2 = 0, x, y; for (y = 0; y < h; y++) { @@ -1858,9 +1860,8 @@ static int nsse16_c(void *v, uint8_t *s1, uint8_t *s2, int stride, int h) return score1 + FFABS(score2) * 8; } -static int nsse8_c(void *v, uint8_t *s1, uint8_t *s2, int stride, int h) +static int nsse8_c(MpegEncContext *c, uint8_t *s1, uint8_t *s2, int stride, int h) { - MpegEncContext *c = v; int score1 = 0, score2 = 0, x, y; for (y = 0; y < h; y++) { @@ -1912,7 +1913,8 @@ static void add_8x8basis_c(int16_t rem[64], int16_t basis[64], int scale) (BASIS_SHIFT - RECON_SHIFT); } -static int zero_cmp(void *s, uint8_t *a, uint8_t *b, int stride, int h) +static int zero_cmp(MpegEncContext *s, uint8_t *a, uint8_t *b, + int stride, int h) { return 0; } @@ -2128,7 +2130,7 @@ static void add_hfyu_left_prediction_bgr32_c(uint8_t *dst, const uint8_t *src, #define BUTTERFLYA(x, y) (FFABS((x) + (y)) + FFABS((x) - (y))) -static int hadamard8_diff8x8_c(/* MpegEncContext */ void *s, uint8_t *dst, +static int hadamard8_diff8x8_c(MpegEncContext *s, uint8_t *dst, uint8_t *src, int stride, int h) { int i, temp[64], sum = 0; @@ -2180,7 +2182,7 @@ static int hadamard8_diff8x8_c(/* MpegEncContext */ void *s, uint8_t *dst, return sum; } -static int hadamard8_intra8x8_c(/* MpegEncContext */ void *s, uint8_t *src, +static int hadamard8_intra8x8_c(MpegEncContext *s, uint8_t *src, uint8_t *dummy, int stride, int h) { int i, temp[64], sum = 0; @@ -2232,10 +2234,9 @@ static int hadamard8_intra8x8_c(/* MpegEncContext */ void *s, uint8_t *src, return sum; } -static int dct_sad8x8_c(/* MpegEncContext */ void *c, uint8_t *src1, +static int dct_sad8x8_c(MpegEncContext *s, uint8_t *src1, uint8_t *src2, int stride, int h) { - MpegEncContext *const s = (MpegEncContext *) c; LOCAL_ALIGNED_16(int16_t, temp, [64]); assert(h == 8); @@ -2274,10 +2275,9 @@ static int dct_sad8x8_c(/* MpegEncContext */ void *c, uint8_t *src1, DST(7, (a4 >> 2) - a7); \ } -static int dct264_sad8x8_c(/* MpegEncContext */ void *c, uint8_t *src1, +static int dct264_sad8x8_c(MpegEncContext *s, uint8_t *src1, uint8_t *src2, int stride, int h) { - MpegEncContext *const s = (MpegEncContext *) c; int16_t dct[8][8]; int i, sum = 0; @@ -2300,10 +2300,9 @@ static int dct264_sad8x8_c(/* MpegEncContext */ void *c, uint8_t *src1, } #endif -static int dct_max8x8_c(/* MpegEncContext */ void *c, uint8_t *src1, +static int dct_max8x8_c(MpegEncContext *s, uint8_t *src1, uint8_t *src2, int stride, int h) { - MpegEncContext *const s = (MpegEncContext *) c; LOCAL_ALIGNED_16(int16_t, temp, [64]); int sum = 0, i; @@ -2318,10 +2317,9 @@ static int dct_max8x8_c(/* MpegEncContext */ void *c, uint8_t *src1, return sum; } -static int quant_psnr8x8_c(/* MpegEncContext */ void *c, uint8_t *src1, +static int quant_psnr8x8_c(MpegEncContext *s, uint8_t *src1, uint8_t *src2, int stride, int h) { - MpegEncContext *const s = c; LOCAL_ALIGNED_16(int16_t, temp, [64 * 2]); int16_t *const bak = temp + 64; int sum = 0, i; @@ -2344,10 +2342,9 @@ static int quant_psnr8x8_c(/* MpegEncContext */ void *c, uint8_t *src1, return sum; } -static int rd8x8_c(/* MpegEncContext */ void *c, uint8_t *src1, uint8_t *src2, +static int rd8x8_c(MpegEncContext *s, uint8_t *src1, uint8_t *src2, int stride, int h) { - MpegEncContext *const s = (MpegEncContext *) c; const uint8_t *scantable = s->intra_scantable.permutated; LOCAL_ALIGNED_16(int16_t, temp, [64]); LOCAL_ALIGNED_16(uint8_t, lsrc1, [64]); @@ -2422,10 +2419,9 @@ static int rd8x8_c(/* MpegEncContext */ void *c, uint8_t *src1, uint8_t *src2, return distortion + ((bits * s->qscale * s->qscale * 109 + 64) >> 7); } -static int bit8x8_c(/* MpegEncContext */ void *c, uint8_t *src1, uint8_t *src2, +static int bit8x8_c(MpegEncContext *s, uint8_t *src1, uint8_t *src2, int stride, int h) { - MpegEncContext *const s = (MpegEncContext *) c; const uint8_t *scantable = s->intra_scantable.permutated; LOCAL_ALIGNED_16(int16_t, temp, [64]); int i, last, run, bits, level, start_i; @@ -2485,7 +2481,7 @@ static int bit8x8_c(/* MpegEncContext */ void *c, uint8_t *src1, uint8_t *src2, } #define VSAD_INTRA(size) \ -static int vsad_intra ## size ## _c(/* MpegEncContext */ void *c, \ +static int vsad_intra ## size ## _c(MpegEncContext *c, \ uint8_t *s, uint8_t *dummy, \ int stride, int h) \ { \ @@ -2506,7 +2502,7 @@ static int vsad_intra ## size ## _c(/* MpegEncContext */ void *c, \ VSAD_INTRA(8) VSAD_INTRA(16) -static int vsad16_c(/* MpegEncContext */ void *c, uint8_t *s1, uint8_t *s2, +static int vsad16_c(MpegEncContext *c, uint8_t *s1, uint8_t *s2, int stride, int h) { int score = 0, x, y; @@ -2523,7 +2519,7 @@ static int vsad16_c(/* MpegEncContext */ void *c, uint8_t *s1, uint8_t *s2, #define SQ(a) ((a) * (a)) #define VSSE_INTRA(size) \ -static int vsse_intra ## size ## _c(/* MpegEncContext */ void *c, \ +static int vsse_intra ## size ## _c(MpegEncContext *c, \ uint8_t *s, uint8_t *dummy, \ int stride, int h) \ { \ @@ -2544,7 +2540,7 @@ static int vsse_intra ## size ## _c(/* MpegEncContext */ void *c, \ VSSE_INTRA(8) VSSE_INTRA(16) -static int vsse16_c(/* MpegEncContext */ void *c, uint8_t *s1, uint8_t *s2, +static int vsse16_c(MpegEncContext *c, uint8_t *s1, uint8_t *s2, int stride, int h) { int score = 0, x, y; @@ -2570,8 +2566,7 @@ static int ssd_int8_vs_int16_c(const int8_t *pix1, const int16_t *pix2, } #define WRAPPER8_16_SQ(name8, name16) \ -static int name16(void /*MpegEncContext*/ *s, \ - uint8_t *dst, uint8_t *src, \ +static int name16(MpegEncContext *s, uint8_t *dst, uint8_t *src, \ int stride, int h) \ { \ int score = 0; \ diff --git a/libavcodec/dsputil.h b/libavcodec/dsputil.h index f8ac5ef..10479f9 100644 --- a/libavcodec/dsputil.h +++ b/libavcodec/dsputil.h @@ -108,12 +108,13 @@ DEF_OLD_QPEL(qpel8_mc32_old_c) DEF_OLD_QPEL(qpel8_mc13_old_c) DEF_OLD_QPEL(qpel8_mc33_old_c) +struct MpegEncContext; /* Motion estimation: * h is limited to { width / 2, width, 2 * width }, * but never larger than 16 and never smaller than 2. * Although currently h < 4 is not used as functions with * width < 8 are neither used nor implemented. */ -typedef int (*me_cmp_func)(void /* MpegEncContext */ *s, +typedef int (*me_cmp_func)(struct MpegEncContext *c, uint8_t *blk1 /* align width (8 or 16) */, uint8_t *blk2 /* align 1 */, int line_size, int h); diff --git a/libavcodec/motion_est.c b/libavcodec/motion_est.c index 08c0eba..8b597e8 100644 --- a/libavcodec/motion_est.c +++ b/libavcodec/motion_est.c @@ -286,7 +286,9 @@ static int cmp_qpel(MpegEncContext *s, const int x, const int y, const int subx, #include "motion_est_template.c" -static int zero_cmp(void *s, uint8_t *a, uint8_t *b, int stride, int h){ +static int zero_cmp(MpegEncContext *s, uint8_t *a, uint8_t *b, + int stride, int h) +{ return 0; } diff --git a/libavcodec/ppc/dsputil_altivec.c b/libavcodec/ppc/dsputil_altivec.c index a2291fb..6d64583 100644 --- a/libavcodec/ppc/dsputil_altivec.c +++ b/libavcodec/ppc/dsputil_altivec.c @@ -30,9 +30,10 @@ #include "libavutil/ppc/util_altivec.h" #include "libavcodec/avcodec.h" #include "libavcodec/dsputil.h" +#include "libavcodec/mpegvideo.h" #include "dsputil_altivec.h" -static int sad16_x2_altivec(void *v, uint8_t *pix1, uint8_t *pix2, +static int sad16_x2_altivec(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) { int i, s = 0; @@ -74,7 +75,7 @@ static int sad16_x2_altivec(void *v, uint8_t *pix1, uint8_t *pix2, return s; } -static int sad16_y2_altivec(void *v, uint8_t *pix1, uint8_t *pix2, +static int sad16_y2_altivec(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) { int i, s = 0; @@ -128,7 +129,7 @@ static int sad16_y2_altivec(void *v, uint8_t *pix1, uint8_t *pix2, return s; } -static int sad16_xy2_altivec(void *v, uint8_t *pix1, uint8_t *pix2, +static int sad16_xy2_altivec(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) { int i, s = 0; @@ -223,7 +224,7 @@ static int sad16_xy2_altivec(void *v, uint8_t *pix1, uint8_t *pix2, return s; } -static int sad16_altivec(void *v, uint8_t *pix1, uint8_t *pix2, +static int sad16_altivec(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) { int i, s; @@ -260,7 +261,7 @@ static int sad16_altivec(void *v, uint8_t *pix1, uint8_t *pix2, return s; } -static int sad8_altivec(void *v, uint8_t *pix1, uint8_t *pix2, +static int sad8_altivec(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) { int i, s; @@ -337,7 +338,7 @@ static int pix_norm1_altivec(uint8_t *pix, int line_size) /* Sum of Squared Errors for an 8x8 block, AltiVec-enhanced. * It's the sad8_altivec code above w/ squaring added. */ -static int sse8_altivec(void *v, uint8_t *pix1, uint8_t *pix2, +static int sse8_altivec(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) { int i, s; @@ -389,7 +390,7 @@ static int sse8_altivec(void *v, uint8_t *pix1, uint8_t *pix2, /* Sum of Squared Errors for a 16x16 block, AltiVec-enhanced. * It's the sad16_altivec code above w/ squaring added. */ -static int sse16_altivec(void *v, uint8_t *pix1, uint8_t *pix2, +static int sse16_altivec(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) { int i, s; @@ -587,7 +588,7 @@ static void add_bytes_altivec(uint8_t *dst, uint8_t *src, int w) dst[i] = src[i]; } -static int hadamard8_diff8x8_altivec(/* MpegEncContext */ void *s, uint8_t *dst, +static int hadamard8_diff8x8_altivec(MpegEncContext *s, uint8_t *dst, uint8_t *src, int stride, int h) { int sum; @@ -716,7 +717,7 @@ static int hadamard8_diff8x8_altivec(/* MpegEncContext */ void *s, uint8_t *dst, * On the 970, the hand-made RA is still a win (around 690 vs. around 780), * but xlc goes to around 660 on the regular C code... */ -static int hadamard8_diff16x8_altivec(/* MpegEncContext */ void *s, uint8_t *dst, +static int hadamard8_diff16x8_altivec(MpegEncContext *s, uint8_t *dst, uint8_t *src, int stride, int h) { int sum; @@ -913,7 +914,7 @@ static int hadamard8_diff16x8_altivec(/* MpegEncContext */ void *s, uint8_t *dst return sum; } -static int hadamard8_diff16_altivec(/* MpegEncContext */ void *s, uint8_t *dst, +static int hadamard8_diff16_altivec(MpegEncContext *s, uint8_t *dst, uint8_t *src, int stride, int h) { int score = hadamard8_diff16x8_altivec(s, dst, src, stride, 8); diff --git a/libavcodec/x86/dsputilenc.asm b/libavcodec/x86/dsputilenc.asm index 2790a88..f676ba6 100644 --- a/libavcodec/x86/dsputilenc.asm +++ b/libavcodec/x86/dsputilenc.asm @@ -209,8 +209,8 @@ hadamard8x8_diff %+ SUFFIX: hadamard8_16_wrapper %1, 3 %elif cpuflag(mmx) ALIGN 16 -; int ff_hadamard8_diff_ ## cpu(void *s, uint8_t *src1, uint8_t *src2, -; int stride, int h) +; int ff_hadamard8_diff_ ## cpu(MpegEncContext *s, uint8_t *src1, +; uint8_t *src2, int stride, int h) ; r0 = void *s = unused, int h = unused (always 8) ; note how r1, r2 and r3 are not clobbered in this function, so 16x16 ; can simply call this 2x2x (and that's why we access rsp+gprsize @@ -275,7 +275,8 @@ INIT_XMM ssse3 HADAMARD8_DIFF 9 INIT_XMM sse2 -; int ff_sse16_sse2(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h); +; int ff_sse16_sse2(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, +; int line_size, int h); cglobal sse16, 5, 5, 8 shr r4d, 1 pxor m0, m0 ; mm0 = 0 diff --git a/libavcodec/x86/dsputilenc_mmx.c b/libavcodec/x86/dsputilenc_mmx.c index 99f094e..705a7d1 100644 --- a/libavcodec/x86/dsputilenc_mmx.c +++ b/libavcodec/x86/dsputilenc_mmx.c @@ -41,7 +41,8 @@ int ff_pix_norm1_mmx(uint8_t *pix, int line_size); #if HAVE_INLINE_ASM -static int sse8_mmx(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) +static int sse8_mmx(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, + int line_size, int h) { int tmp; @@ -105,7 +106,7 @@ static int sse8_mmx(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) return tmp; } -static int sse16_mmx(void *v, uint8_t *pix1, uint8_t *pix2, +static int sse16_mmx(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) { int tmp; @@ -414,10 +415,9 @@ static int hf_noise16_mmx(uint8_t *pix1, int line_size, int h) return tmp + hf_noise8_mmx(pix + 8, line_size, h); } -static int nsse16_mmx(void *p, uint8_t *pix1, uint8_t *pix2, +static int nsse16_mmx(MpegEncContext *c, uint8_t *pix1, uint8_t *pix2, int line_size, int h) { - MpegEncContext *c = p; int score1, score2; if (c) @@ -433,10 +433,9 @@ static int nsse16_mmx(void *p, uint8_t *pix1, uint8_t *pix2, return score1 + FFABS(score2) * 8; } -static int nsse8_mmx(void *p, uint8_t *pix1, uint8_t *pix2, +static int nsse8_mmx(MpegEncContext *c, uint8_t *pix1, uint8_t *pix2, int line_size, int h) { - MpegEncContext *c = p; int score1 = sse8_mmx(c, pix1, pix2, line_size, h); int score2 = hf_noise8_mmx(pix1, line_size, h) - hf_noise8_mmx(pix2, line_size, h); @@ -447,7 +446,7 @@ static int nsse8_mmx(void *p, uint8_t *pix1, uint8_t *pix2, return score1 + FFABS(score2) * 8; } -static int vsad_intra16_mmx(void *v, uint8_t *pix, uint8_t *dummy, +static int vsad_intra16_mmx(MpegEncContext *v, uint8_t *pix, uint8_t *dummy, int line_size, int h) { int tmp; @@ -511,7 +510,7 @@ static int vsad_intra16_mmx(void *v, uint8_t *pix, uint8_t *dummy, } #undef SUM -static int vsad_intra16_mmxext(void *v, uint8_t *pix, uint8_t *dummy, +static int vsad_intra16_mmxext(MpegEncContext *v, uint8_t *pix, uint8_t *dummy, int line_size, int h) { int tmp; @@ -554,7 +553,7 @@ static int vsad_intra16_mmxext(void *v, uint8_t *pix, uint8_t *dummy, } #undef SUM -static int vsad16_mmx(void *v, uint8_t *pix1, uint8_t *pix2, +static int vsad16_mmx(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) { int tmp; @@ -635,7 +634,7 @@ static int vsad16_mmx(void *v, uint8_t *pix1, uint8_t *pix2, } #undef SUM -static int vsad16_mmxext(void *v, uint8_t *pix1, uint8_t *pix2, +static int vsad16_mmxext(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) { int tmp; @@ -973,13 +972,14 @@ static int ssd_int8_vs_int16_mmx(const int8_t *pix1, const int16_t *pix2, #endif /* HAVE_INLINE_ASM */ -int ff_sse16_sse2(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h); +int ff_sse16_sse2(MpegEncContext *v, uint8_t *pix1, uint8_t *pix2, + int line_size, int h); #define hadamard_func(cpu) \ -int ff_hadamard8_diff_ ## cpu(void *s, uint8_t *src1, uint8_t *src2, \ - int stride, int h); \ -int ff_hadamard8_diff16_ ## cpu(void *s, uint8_t *src1, uint8_t *src2, \ - int stride, int h); + int ff_hadamard8_diff_ ## cpu(MpegEncContext *s, uint8_t *src1, \ + uint8_t *src2, int stride, int h); \ + int ff_hadamard8_diff16_ ## cpu(MpegEncContext *s, uint8_t *src1, \ + uint8_t *src2, int stride, int h); hadamard_func(mmx) hadamard_func(mmxext) diff --git a/libavcodec/x86/motion_est.c b/libavcodec/x86/motion_est.c index d126012..2b34a28 100644 --- a/libavcodec/x86/motion_est.c +++ b/libavcodec/x86/motion_est.c @@ -27,6 +27,7 @@ #include "libavutil/mem.h" #include "libavutil/x86/asm.h" #include "libavutil/x86/cpu.h" +#include "libavcodec/mpegvideo.h" #include "dsputil_x86.h" #if HAVE_INLINE_ASM @@ -94,7 +95,8 @@ static inline void sad8_1_mmxext(uint8_t *blk1, uint8_t *blk2, : "r" ((x86_reg) stride)); } -static int sad16_sse2(void *v, uint8_t *blk2, uint8_t *blk1, int stride, int h) +static int sad16_sse2(MpegEncContext *v, uint8_t *blk2, uint8_t *blk1, + int stride, int h) { int ret; __asm__ volatile ( @@ -323,7 +325,7 @@ static inline void sad8_y2a_mmx(uint8_t *blk1, uint8_t *blk2, int stride, int h) } #define PIX_SAD(suf) \ -static int sad8_ ## suf(void *v, uint8_t *blk2, \ +static int sad8_ ## suf(MpegEncContext *v, uint8_t *blk2, \ uint8_t *blk1, int stride, int h) \ { \ assert(h == 8); \ @@ -337,7 +339,7 @@ static int sad8_ ## suf(void *v, uint8_t *blk2, \ return sum_ ## suf(); \ } \ \ -static int sad8_x2_ ## suf(void *v, uint8_t *blk2, \ +static int sad8_x2_ ## suf(MpegEncContext *v, uint8_t *blk2, \ uint8_t *blk1, int stride, int h) \ { \ assert(h == 8); \ @@ -352,7 +354,7 @@ static int sad8_x2_ ## suf(void *v, uint8_t *blk2, \ return sum_ ## suf(); \ } \ \ -static int sad8_y2_ ## suf(void *v, uint8_t *blk2, \ +static int sad8_y2_ ## suf(MpegEncContext *v, uint8_t *blk2, \ uint8_t *blk1, int stride, int h) \ { \ assert(h == 8); \ @@ -367,7 +369,7 @@ static int sad8_y2_ ## suf(void *v, uint8_t *blk2, \ return sum_ ## suf(); \ } \ \ -static int sad8_xy2_ ## suf(void *v, uint8_t *blk2, \ +static int sad8_xy2_ ## suf(MpegEncContext *v, uint8_t *blk2, \ uint8_t *blk1, int stride, int h) \ { \ assert(h == 8); \ @@ -381,7 +383,7 @@ static int sad8_xy2_ ## suf(void *v, uint8_t *blk2, \ return sum_ ## suf(); \ } \ \ -static int sad16_ ## suf(void *v, uint8_t *blk2, \ +static int sad16_ ## suf(MpegEncContext *v, uint8_t *blk2, \ uint8_t *blk1, int stride, int h) \ { \ __asm__ volatile ( \ @@ -395,7 +397,7 @@ static int sad16_ ## suf(void *v, uint8_t *blk2, \ return sum_ ## suf(); \ } \ \ -static int sad16_x2_ ## suf(void *v, uint8_t *blk2, \ +static int sad16_x2_ ## suf(MpegEncContext *v, uint8_t *blk2, \ uint8_t *blk1, int stride, int h) \ { \ __asm__ volatile ( \ @@ -410,7 +412,7 @@ static int sad16_x2_ ## suf(void *v, uint8_t *blk2, \ return sum_ ## suf(); \ } \ \ -static int sad16_y2_ ## suf(void *v, uint8_t *blk2, \ +static int sad16_y2_ ## suf(MpegEncContext *v, uint8_t *blk2, \ uint8_t *blk1, int stride, int h) \ { \ __asm__ volatile ( \ @@ -425,7 +427,7 @@ static int sad16_y2_ ## suf(void *v, uint8_t *blk2, \ return sum_ ## suf(); \ } \ \ -static int sad16_xy2_ ## suf(void *v, uint8_t *blk2, \ +static int sad16_xy2_ ## suf(MpegEncContext *v, uint8_t *blk2, \ uint8_t *blk1, int stride, int h) \ { \ __asm__ volatile ( \ -- 2.7.4