Merge commit '92f8e06ecb431a427ea13d794e5a6bc927a034d2'
* commit '92f8e06ecb431a427ea13d794e5a6bc927a034d2': x86: dsputil hpeldsp: Move shared template functions into separate object Conflicts: libavcodec/x86/Makefile Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
2f9ef60c97
@ -39,13 +39,15 @@ MMX-OBJS-$(CONFIG_DSPUTIL) += x86/dsputil_mmx.o \
|
|||||||
x86/fpel_mmx.o \
|
x86/fpel_mmx.o \
|
||||||
x86/idct_mmx_xvid.o \
|
x86/idct_mmx_xvid.o \
|
||||||
x86/idct_sse2_xvid.o \
|
x86/idct_sse2_xvid.o \
|
||||||
|
x86/rnd_mmx.o \
|
||||||
x86/simple_idct.o \
|
x86/simple_idct.o \
|
||||||
|
|
||||||
MMX-OBJS-$(CONFIG_ENCODERS) += x86/dsputilenc_mmx.o \
|
MMX-OBJS-$(CONFIG_ENCODERS) += x86/dsputilenc_mmx.o \
|
||||||
x86/motion_est.o
|
x86/motion_est.o
|
||||||
MMX-OBJS-$(CONFIG_DIRAC_DECODER) += x86/dirac_dwt.o
|
MMX-OBJS-$(CONFIG_DIRAC_DECODER) += x86/dirac_dwt.o
|
||||||
MMX-OBJS-$(CONFIG_HPELDSP) += x86/fpel_mmx.o \
|
MMX-OBJS-$(CONFIG_HPELDSP) += x86/fpel_mmx.o \
|
||||||
x86/hpeldsp_mmx.o
|
x86/hpeldsp_mmx.o \
|
||||||
|
x86/rnd_mmx.o
|
||||||
MMX-OBJS-$(CONFIG_SNOW_DECODER) += x86/snowdsp.o
|
MMX-OBJS-$(CONFIG_SNOW_DECODER) += x86/snowdsp.o
|
||||||
MMX-OBJS-$(CONFIG_SNOW_ENCODER) += x86/snowdsp.o
|
MMX-OBJS-$(CONFIG_SNOW_ENCODER) += x86/snowdsp.o
|
||||||
MMX-OBJS-$(CONFIG_VC1_DECODER) += x86/vc1dsp_mmx.o
|
MMX-OBJS-$(CONFIG_VC1_DECODER) += x86/vc1dsp_mmx.o
|
||||||
|
@ -101,21 +101,6 @@ void ff_put_no_rnd_mpeg4_qpel8_v_lowpass_mmxext(uint8_t *dst, uint8_t *src,
|
|||||||
|
|
||||||
#if HAVE_INLINE_ASM
|
#if HAVE_INLINE_ASM
|
||||||
|
|
||||||
/***********************************/
|
|
||||||
/* MMX rounding */
|
|
||||||
|
|
||||||
#define DEF(x, y) x ## _ ## y ## _mmx
|
|
||||||
#define SET_RND MOVQ_WTWO
|
|
||||||
#define PAVGBP(a, b, c, d, e, f) PAVGBP_MMX(a, b, c, d, e, f)
|
|
||||||
#define PAVGB(a, b, c, e) PAVGB_MMX(a, b, c, e)
|
|
||||||
|
|
||||||
#include "rnd_template.c"
|
|
||||||
|
|
||||||
#undef DEF
|
|
||||||
#undef SET_RND
|
|
||||||
#undef PAVGBP
|
|
||||||
#undef PAVGB
|
|
||||||
|
|
||||||
/***********************************/
|
/***********************************/
|
||||||
/* standard MMX */
|
/* standard MMX */
|
||||||
|
|
||||||
@ -898,19 +883,19 @@ QPEL_OP(put_no_rnd_, ff_pw_15, _no_rnd_, mmxext)
|
|||||||
#if HAVE_INLINE_ASM
|
#if HAVE_INLINE_ASM
|
||||||
void ff_put_rv40_qpel8_mc33_mmx(uint8_t *dst, uint8_t *src, ptrdiff_t stride)
|
void ff_put_rv40_qpel8_mc33_mmx(uint8_t *dst, uint8_t *src, ptrdiff_t stride)
|
||||||
{
|
{
|
||||||
put_pixels8_xy2_mmx(dst, src, stride, 8);
|
ff_put_pixels8_xy2_mmx(dst, src, stride, 8);
|
||||||
}
|
}
|
||||||
void ff_put_rv40_qpel16_mc33_mmx(uint8_t *dst, uint8_t *src, ptrdiff_t stride)
|
void ff_put_rv40_qpel16_mc33_mmx(uint8_t *dst, uint8_t *src, ptrdiff_t stride)
|
||||||
{
|
{
|
||||||
put_pixels16_xy2_mmx(dst, src, stride, 16);
|
ff_put_pixels16_xy2_mmx(dst, src, stride, 16);
|
||||||
}
|
}
|
||||||
void ff_avg_rv40_qpel8_mc33_mmx(uint8_t *dst, uint8_t *src, ptrdiff_t stride)
|
void ff_avg_rv40_qpel8_mc33_mmx(uint8_t *dst, uint8_t *src, ptrdiff_t stride)
|
||||||
{
|
{
|
||||||
avg_pixels8_xy2_mmx(dst, src, stride, 8);
|
ff_avg_pixels8_xy2_mmx(dst, src, stride, 8);
|
||||||
}
|
}
|
||||||
void ff_avg_rv40_qpel16_mc33_mmx(uint8_t *dst, uint8_t *src, ptrdiff_t stride)
|
void ff_avg_rv40_qpel16_mc33_mmx(uint8_t *dst, uint8_t *src, ptrdiff_t stride)
|
||||||
{
|
{
|
||||||
avg_pixels16_xy2_mmx(dst, src, stride, 16);
|
ff_avg_pixels16_xy2_mmx(dst, src, stride, 16);
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef void emulated_edge_mc_func(uint8_t *dst, const uint8_t *src,
|
typedef void emulated_edge_mc_func(uint8_t *dst, const uint8_t *src,
|
||||||
|
@ -176,6 +176,16 @@ void ff_put_pixels16_sse2(uint8_t *block, const uint8_t *pixels,
|
|||||||
void ff_avg_pixels8_x2_mmx(uint8_t *block, const uint8_t *pixels,
|
void ff_avg_pixels8_x2_mmx(uint8_t *block, const uint8_t *pixels,
|
||||||
ptrdiff_t line_size, int h);
|
ptrdiff_t line_size, int h);
|
||||||
|
|
||||||
|
void ff_avg_pixels8_xy2_mmx(uint8_t *block, const uint8_t *pixels,
|
||||||
|
ptrdiff_t line_size, int h);
|
||||||
|
void ff_avg_pixels16_xy2_mmx(uint8_t *block, const uint8_t *pixels,
|
||||||
|
ptrdiff_t line_size, int h);
|
||||||
|
|
||||||
|
void ff_put_pixels8_xy2_mmx(uint8_t *block, const uint8_t *pixels,
|
||||||
|
ptrdiff_t line_size, int h);
|
||||||
|
void ff_put_pixels16_xy2_mmx(uint8_t *block, const uint8_t *pixels,
|
||||||
|
ptrdiff_t line_size, int h);
|
||||||
|
|
||||||
void ff_put_rv40_qpel8_mc33_mmx(uint8_t *block, uint8_t *pixels, ptrdiff_t stride);
|
void ff_put_rv40_qpel8_mc33_mmx(uint8_t *block, uint8_t *pixels, ptrdiff_t stride);
|
||||||
void ff_put_rv40_qpel16_mc33_mmx(uint8_t *block, uint8_t *pixels, ptrdiff_t stride);
|
void ff_put_rv40_qpel16_mc33_mmx(uint8_t *block, uint8_t *pixels, ptrdiff_t stride);
|
||||||
void ff_avg_rv40_qpel8_mc33_mmx(uint8_t *block, uint8_t *pixels, ptrdiff_t stride);
|
void ff_avg_rv40_qpel8_mc33_mmx(uint8_t *block, uint8_t *pixels, ptrdiff_t stride);
|
||||||
|
@ -77,8 +77,12 @@ void ff_avg_pixels8_xy2_3dnow(uint8_t *block, const uint8_t *pixels,
|
|||||||
#define avg_pixels8_mmx ff_avg_pixels8_mmx
|
#define avg_pixels8_mmx ff_avg_pixels8_mmx
|
||||||
#define avg_pixels8_x2_mmx ff_avg_pixels8_x2_mmx
|
#define avg_pixels8_x2_mmx ff_avg_pixels8_x2_mmx
|
||||||
#define avg_pixels16_mmx ff_avg_pixels16_mmx
|
#define avg_pixels16_mmx ff_avg_pixels16_mmx
|
||||||
|
#define avg_pixels8_xy2_mmx ff_avg_pixels8_xy2_mmx
|
||||||
|
#define avg_pixels16_xy2_mmx ff_avg_pixels16_xy2_mmx
|
||||||
#define put_pixels8_mmx ff_put_pixels8_mmx
|
#define put_pixels8_mmx ff_put_pixels8_mmx
|
||||||
#define put_pixels16_mmx ff_put_pixels16_mmx
|
#define put_pixels16_mmx ff_put_pixels16_mmx
|
||||||
|
#define put_pixels8_xy2_mmx ff_put_pixels8_xy2_mmx
|
||||||
|
#define put_pixels16_xy2_mmx ff_put_pixels16_xy2_mmx
|
||||||
#define avg_no_rnd_pixels16_mmx ff_avg_pixels16_mmx
|
#define avg_no_rnd_pixels16_mmx ff_avg_pixels16_mmx
|
||||||
#define put_no_rnd_pixels8_mmx ff_put_pixels8_mmx
|
#define put_no_rnd_pixels8_mmx ff_put_pixels8_mmx
|
||||||
#define put_no_rnd_pixels16_mmx ff_put_pixels16_mmx
|
#define put_no_rnd_pixels16_mmx ff_put_pixels16_mmx
|
||||||
@ -91,13 +95,16 @@ void ff_avg_pixels8_xy2_3dnow(uint8_t *block, const uint8_t *pixels,
|
|||||||
#define SET_RND MOVQ_WONE
|
#define SET_RND MOVQ_WONE
|
||||||
#define PAVGBP(a, b, c, d, e, f) PAVGBP_MMX_NO_RND(a, b, c, d, e, f)
|
#define PAVGBP(a, b, c, d, e, f) PAVGBP_MMX_NO_RND(a, b, c, d, e, f)
|
||||||
#define PAVGB(a, b, c, e) PAVGB_MMX_NO_RND(a, b, c, e)
|
#define PAVGB(a, b, c, e) PAVGB_MMX_NO_RND(a, b, c, e)
|
||||||
|
#define STATIC static
|
||||||
|
|
||||||
|
#include "rnd_template.c"
|
||||||
#include "hpeldsp_rnd_template.c"
|
#include "hpeldsp_rnd_template.c"
|
||||||
|
|
||||||
#undef DEF
|
#undef DEF
|
||||||
#undef SET_RND
|
#undef SET_RND
|
||||||
#undef PAVGBP
|
#undef PAVGBP
|
||||||
#undef PAVGB
|
#undef PAVGB
|
||||||
|
#undef STATIC
|
||||||
/***********************************/
|
/***********************************/
|
||||||
/* MMX rounding */
|
/* MMX rounding */
|
||||||
|
|
||||||
|
@ -24,8 +24,6 @@
|
|||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "rnd_template.c"
|
|
||||||
|
|
||||||
// put_pixels
|
// put_pixels
|
||||||
static void DEF(put, pixels8_x2)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
|
static void DEF(put, pixels8_x2)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
|
||||||
{
|
{
|
||||||
|
32
libavcodec/x86/rnd_mmx.c
Normal file
32
libavcodec/x86/rnd_mmx.c
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of FFmpeg.
|
||||||
|
*
|
||||||
|
* FFmpeg is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2.1 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* FFmpeg is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with FFmpeg; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
#include "dsputil_mmx.h"
|
||||||
|
|
||||||
|
#if HAVE_INLINE_ASM
|
||||||
|
|
||||||
|
#define DEF(x, y) ff_ ## x ## _ ## y ## _mmx
|
||||||
|
#define SET_RND MOVQ_WTWO
|
||||||
|
#define PAVGBP(a, b, c, d, e, f) PAVGBP_MMX(a, b, c, d, e, f)
|
||||||
|
#define PAVGB(a, b, c, e) PAVGB_MMX(a, b, c, e)
|
||||||
|
#define STATIC
|
||||||
|
|
||||||
|
#include "rnd_template.c"
|
||||||
|
|
||||||
|
#endif /* HAVE_INLINE_ASM */
|
@ -24,8 +24,12 @@
|
|||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <stddef.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
// put_pixels
|
// put_pixels
|
||||||
static void DEF(put, pixels8_xy2)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
|
STATIC void DEF(put, pixels8_xy2)(uint8_t *block, const uint8_t *pixels,
|
||||||
|
ptrdiff_t line_size, int h)
|
||||||
{
|
{
|
||||||
MOVQ_ZERO(mm7);
|
MOVQ_ZERO(mm7);
|
||||||
SET_RND(mm6); // =2 for rnd and =1 for no_rnd version
|
SET_RND(mm6); // =2 for rnd and =1 for no_rnd version
|
||||||
@ -93,7 +97,8 @@ static void DEF(put, pixels8_xy2)(uint8_t *block, const uint8_t *pixels, ptrdiff
|
|||||||
|
|
||||||
// avg_pixels
|
// avg_pixels
|
||||||
// this routine is 'slightly' suboptimal but mostly unused
|
// this routine is 'slightly' suboptimal but mostly unused
|
||||||
static void DEF(avg, pixels8_xy2)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
|
STATIC void DEF(avg, pixels8_xy2)(uint8_t *block, const uint8_t *pixels,
|
||||||
|
ptrdiff_t line_size, int h)
|
||||||
{
|
{
|
||||||
MOVQ_ZERO(mm7);
|
MOVQ_ZERO(mm7);
|
||||||
SET_RND(mm6); // =2 for rnd and =1 for no_rnd version
|
SET_RND(mm6); // =2 for rnd and =1 for no_rnd version
|
||||||
@ -168,12 +173,16 @@ static void DEF(avg, pixels8_xy2)(uint8_t *block, const uint8_t *pixels, ptrdiff
|
|||||||
}
|
}
|
||||||
|
|
||||||
//FIXME optimize
|
//FIXME optimize
|
||||||
static void DEF(put, pixels16_xy2)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h){
|
STATIC void DEF(put, pixels16_xy2)(uint8_t *block, const uint8_t *pixels,
|
||||||
|
ptrdiff_t line_size, int h)
|
||||||
|
{
|
||||||
DEF(put, pixels8_xy2)(block , pixels , line_size, h);
|
DEF(put, pixels8_xy2)(block , pixels , line_size, h);
|
||||||
DEF(put, pixels8_xy2)(block+8, pixels+8, line_size, h);
|
DEF(put, pixels8_xy2)(block+8, pixels+8, line_size, h);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void DEF(avg, pixels16_xy2)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h){
|
STATIC void DEF(avg, pixels16_xy2)(uint8_t *block, const uint8_t *pixels,
|
||||||
|
ptrdiff_t line_size, int h)
|
||||||
|
{
|
||||||
DEF(avg, pixels8_xy2)(block , pixels , line_size, h);
|
DEF(avg, pixels8_xy2)(block , pixels , line_size, h);
|
||||||
DEF(avg, pixels8_xy2)(block+8, pixels+8, line_size, h);
|
DEF(avg, pixels8_xy2)(block+8, pixels+8, line_size, h);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user