Merge commit '82bb3048013201c0095d2853d4623633d912252f'

* commit '82bb3048013201c0095d2853d4623633d912252f':
  dsputil: Use correct type in me_cmp_func function pointer

Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2014-03-20 22:26:58 +01:00
commit e98bac82e5
9 changed files with 95 additions and 91 deletions

View File

@ -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);

View File

@ -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);

View File

@ -254,7 +254,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;
@ -270,7 +271,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;
@ -290,7 +292,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;
@ -1742,7 +1745,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;
@ -1770,7 +1773,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;
@ -1798,7 +1801,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;
@ -1828,7 +1831,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;
@ -1858,7 +1861,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;
@ -1878,7 +1881,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;
@ -1898,7 +1901,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;
@ -1920,7 +1923,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;
@ -1942,9 +1945,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++) {
@ -1967,9 +1969,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++) {
@ -2021,7 +2022,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;
}
@ -2245,7 +2247,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;
@ -2297,7 +2299,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;
@ -2349,10 +2351,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]);
av_assert2(h == 8);
@ -2391,10 +2392,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;
@ -2417,10 +2417,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;
@ -2435,10 +2434,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;
@ -2461,10 +2459,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]);
@ -2539,10 +2536,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;
@ -2602,7 +2598,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) \
{ \
@ -2623,7 +2619,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;
@ -2640,7 +2636,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) \
{ \
@ -2661,7 +2657,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;
@ -2687,8 +2683,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; \

View File

@ -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);

View File

@ -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;
}

View File

@ -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);

View File

@ -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

View File

@ -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;
@ -974,13 +973,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)

View File

@ -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 (
@ -325,7 +327,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) \
{ \
av_assert2(h == 8); \
@ -339,7 +341,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) \
{ \
av_assert2(h == 8); \
@ -354,7 +356,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) \
{ \
av_assert2(h == 8); \
@ -369,7 +371,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) \
{ \
av_assert2(h == 8); \
@ -383,7 +385,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 ( \
@ -397,7 +399,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 ( \
@ -412,7 +414,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 ( \
@ -427,7 +429,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 ( \