Commit e98bac82 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '82bb3048'

* commit '82bb3048':
  dsputil: Use correct type in me_cmp_func function pointer
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 011d83de 82bb3048
......@@ -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);
......
......@@ -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);
......
This diff is collapsed.
......@@ -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);
......
......@@ -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;
}
......
......@@ -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);
......
......@@ -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
......
......@@ -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)
......
......@@ -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 ( \
......
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