mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-02 03:06:28 +02:00
Merge commit '78fa0bd0f7067868943c0899907e313414492426'
* commit '78fa0bd0f7067868943c0899907e313414492426': x86: cavs: Put mmx-specific code into its own init function Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
f84e373797
@ -31,7 +31,7 @@
|
||||
#include "dsputil_mmx.h"
|
||||
#include "config.h"
|
||||
|
||||
#if (HAVE_MMXEXT_INLINE || HAVE_AMD3DNOW_INLINE)
|
||||
#if HAVE_MMX_INLINE
|
||||
|
||||
/* in/out: mma=mma+mmb, mmb=mmb-mma */
|
||||
#define SUMSUB_BA( a, b ) \
|
||||
@ -187,6 +187,10 @@ static void cavs_idct8_add_mmx(uint8_t *dst, int16_t *block, int stride)
|
||||
ff_add_pixels_clamped_mmx(b2, dst, stride);
|
||||
}
|
||||
|
||||
#endif /* HAVE_MMX_INLINE */
|
||||
|
||||
#if (HAVE_MMXEXT_INLINE || HAVE_AMD3DNOW_INLINE)
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* motion compensation
|
||||
@ -441,6 +445,20 @@ static void ff_ ## OPNAME ## cavs_qpel ## SIZE ## _mc03_ ## MMX(uint8_t *dst, ui
|
||||
|
||||
#endif /* (HAVE_MMXEXT_INLINE || HAVE_AMD3DNOW_INLINE) */
|
||||
|
||||
#if HAVE_MMX_INLINE
|
||||
static av_cold void cavsdsp_init_mmx(CAVSDSPContext *c,
|
||||
AVCodecContext *avctx)
|
||||
{
|
||||
c->put_cavs_qpel_pixels_tab[0][0] = ff_put_cavs_qpel16_mc00_mmx;
|
||||
c->put_cavs_qpel_pixels_tab[1][0] = ff_put_cavs_qpel8_mc00_mmx;
|
||||
c->avg_cavs_qpel_pixels_tab[0][0] = ff_avg_cavs_qpel16_mc00_mmx;
|
||||
c->avg_cavs_qpel_pixels_tab[1][0] = ff_avg_cavs_qpel8_mc00_mmx;
|
||||
|
||||
c->cavs_idct8_add = cavs_idct8_add_mmx;
|
||||
c->idct_perm = FF_TRANSPOSE_IDCT_PERM;
|
||||
}
|
||||
#endif /* HAVE_MMX_INLINE */
|
||||
|
||||
#if HAVE_MMXEXT_INLINE
|
||||
QPEL_CAVS(put_, PUT_OP, mmxext)
|
||||
QPEL_CAVS(avg_, AVG_MMXEXT_OP, mmxext)
|
||||
@ -454,7 +472,6 @@ static av_cold void ff_cavsdsp_init_mmxext(CAVSDSPContext *c,
|
||||
AVCodecContext *avctx)
|
||||
{
|
||||
#define dspfunc(PFX, IDX, NUM) \
|
||||
c->PFX ## _pixels_tab[IDX][ 0] = ff_ ## PFX ## NUM ## _mc00_mmxext; \
|
||||
c->PFX ## _pixels_tab[IDX][ 2] = ff_ ## PFX ## NUM ## _mc20_mmxext; \
|
||||
c->PFX ## _pixels_tab[IDX][ 4] = ff_ ## PFX ## NUM ## _mc01_mmxext; \
|
||||
c->PFX ## _pixels_tab[IDX][ 8] = ff_ ## PFX ## NUM ## _mc02_mmxext; \
|
||||
@ -465,8 +482,6 @@ static av_cold void ff_cavsdsp_init_mmxext(CAVSDSPContext *c,
|
||||
dspfunc(avg_cavs_qpel, 0, 16);
|
||||
dspfunc(avg_cavs_qpel, 1, 8);
|
||||
#undef dspfunc
|
||||
c->cavs_idct8_add = cavs_idct8_add_mmx;
|
||||
c->idct_perm = FF_TRANSPOSE_IDCT_PERM;
|
||||
}
|
||||
#endif /* HAVE_MMXEXT_INLINE */
|
||||
|
||||
@ -483,7 +498,6 @@ static av_cold void ff_cavsdsp_init_3dnow(CAVSDSPContext *c,
|
||||
AVCodecContext *avctx)
|
||||
{
|
||||
#define dspfunc(PFX, IDX, NUM) \
|
||||
c->PFX ## _pixels_tab[IDX][ 0] = ff_ ## PFX ## NUM ## _mc00_mmxext; \
|
||||
c->PFX ## _pixels_tab[IDX][ 2] = ff_ ## PFX ## NUM ## _mc20_3dnow; \
|
||||
c->PFX ## _pixels_tab[IDX][ 4] = ff_ ## PFX ## NUM ## _mc01_3dnow; \
|
||||
c->PFX ## _pixels_tab[IDX][ 8] = ff_ ## PFX ## NUM ## _mc02_3dnow; \
|
||||
@ -494,15 +508,17 @@ static av_cold void ff_cavsdsp_init_3dnow(CAVSDSPContext *c,
|
||||
dspfunc(avg_cavs_qpel, 0, 16);
|
||||
dspfunc(avg_cavs_qpel, 1, 8);
|
||||
#undef dspfunc
|
||||
c->cavs_idct8_add = cavs_idct8_add_mmx;
|
||||
c->idct_perm = FF_TRANSPOSE_IDCT_PERM;
|
||||
}
|
||||
#endif /* HAVE_AMD3DNOW_INLINE */
|
||||
|
||||
av_cold void ff_cavsdsp_init_x86(CAVSDSPContext *c, AVCodecContext *avctx)
|
||||
{
|
||||
#if HAVE_MMX_INLINE
|
||||
int mm_flags = av_get_cpu_flags();
|
||||
|
||||
if (mm_flags & AV_CPU_FLAG_MMX)
|
||||
cavsdsp_init_mmx(c, avctx);
|
||||
#endif /* HAVE_MMX_INLINE */
|
||||
#if HAVE_MMXEXT_INLINE
|
||||
if (mm_flags & AV_CPU_FLAG_MMXEXT) ff_cavsdsp_init_mmxext(c, avctx);
|
||||
#endif /* HAVE_MMXEXT_INLINE */
|
||||
|
@ -1211,22 +1211,22 @@ static void gmc_mmx(uint8_t *dst, uint8_t *src,
|
||||
#endif
|
||||
|
||||
/* CAVS-specific */
|
||||
void ff_put_cavs_qpel8_mc00_mmxext(uint8_t *dst, uint8_t *src, ptrdiff_t stride)
|
||||
void ff_put_cavs_qpel8_mc00_mmx(uint8_t *dst, uint8_t *src, ptrdiff_t stride)
|
||||
{
|
||||
put_pixels8_mmx(dst, src, stride, 8);
|
||||
}
|
||||
|
||||
void ff_avg_cavs_qpel8_mc00_mmxext(uint8_t *dst, uint8_t *src, ptrdiff_t stride)
|
||||
void ff_avg_cavs_qpel8_mc00_mmx(uint8_t *dst, uint8_t *src, ptrdiff_t stride)
|
||||
{
|
||||
avg_pixels8_mmx(dst, src, stride, 8);
|
||||
}
|
||||
|
||||
void ff_put_cavs_qpel16_mc00_mmxext(uint8_t *dst, uint8_t *src, ptrdiff_t stride)
|
||||
void ff_put_cavs_qpel16_mc00_mmx(uint8_t *dst, uint8_t *src, ptrdiff_t stride)
|
||||
{
|
||||
put_pixels16_mmx(dst, src, stride, 16);
|
||||
}
|
||||
|
||||
void ff_avg_cavs_qpel16_mc00_mmxext(uint8_t *dst, uint8_t *src, ptrdiff_t stride)
|
||||
void ff_avg_cavs_qpel16_mc00_mmx(uint8_t *dst, uint8_t *src, ptrdiff_t stride)
|
||||
{
|
||||
avg_pixels16_mmx(dst, src, stride, 16);
|
||||
}
|
||||
|
@ -88,10 +88,10 @@ void ff_avg_pixels16_sse2(uint8_t *block, const uint8_t *pixels,
|
||||
void ff_put_pixels16_sse2(uint8_t *block, const uint8_t *pixels,
|
||||
ptrdiff_t line_size, int h);
|
||||
|
||||
void ff_put_cavs_qpel8_mc00_mmxext(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_cavs_qpel8_mc00_mmxext(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_cavs_qpel16_mc00_mmxext(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_cavs_qpel16_mc00_mmxext(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_cavs_qpel8_mc00_mmx(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_cavs_qpel8_mc00_mmx(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_cavs_qpel16_mc00_mmx(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_cavs_qpel16_mc00_mmx(uint8_t *dst, uint8_t *src, ptrdiff_t stride);
|
||||
|
||||
void ff_put_vc1_mspel_mc00_mmx(uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int rnd);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user