2013-05-08 02:45:39 +03:00
|
|
|
/*
|
2013-05-14 11:55:28 +03:00
|
|
|
* Copyright (c) 2000, 2001 Fabrice Bellard
|
|
|
|
* Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
|
2013-05-08 02:45:39 +03:00
|
|
|
*
|
2013-05-14 11:55:28 +03:00
|
|
|
* This file is part of FFmpeg.
|
|
|
|
*
|
|
|
|
* FFmpeg is free software; you can redistribute it and/or
|
2013-05-08 02:45:39 +03:00
|
|
|
* 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.
|
|
|
|
*
|
2013-05-14 11:55:28 +03:00
|
|
|
* FFmpeg is distributed in the hope that it will be useful,
|
2013-05-08 02:45:39 +03:00
|
|
|
* 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
|
2013-05-14 11:55:28 +03:00
|
|
|
* License along with FFmpeg; if not, write to the Free Software
|
2013-05-08 02:45:39 +03:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
#include "libavutil/attributes.h"
|
|
|
|
#include "libavutil/cpu.h"
|
2013-08-20 15:46:58 +03:00
|
|
|
#include "libavutil/x86/cpu.h"
|
2014-01-29 15:07:57 +03:00
|
|
|
#include "libavcodec/avcodec.h"
|
2013-05-08 02:45:39 +03:00
|
|
|
#include "libavcodec/dsputil.h"
|
2013-05-08 02:52:57 +03:00
|
|
|
#include "dsputil_x86.h"
|
2014-01-23 19:25:16 +03:00
|
|
|
|
2013-05-08 02:45:39 +03:00
|
|
|
static av_cold void dsputil_init_mmx(DSPContext *c, AVCodecContext *avctx,
|
2013-12-30 14:09:03 +03:00
|
|
|
int cpu_flags, unsigned high_bit_depth)
|
2013-05-08 02:45:39 +03:00
|
|
|
{
|
|
|
|
#if HAVE_MMX_INLINE
|
|
|
|
if (!high_bit_depth) {
|
|
|
|
c->draw_edges = ff_draw_edges_mmx;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* HAVE_MMX_INLINE */
|
|
|
|
}
|
|
|
|
|
2013-12-30 14:09:03 +03:00
|
|
|
av_cold void ff_dsputil_init_x86(DSPContext *c, AVCodecContext *avctx,
|
|
|
|
unsigned high_bit_depth)
|
2013-05-08 02:45:39 +03:00
|
|
|
{
|
2013-07-17 21:19:24 +03:00
|
|
|
int cpu_flags = av_get_cpu_flags();
|
2013-05-08 02:45:39 +03:00
|
|
|
|
2014-06-06 04:01:46 +03:00
|
|
|
if (X86_MMX(cpu_flags))
|
2013-12-30 14:09:03 +03:00
|
|
|
dsputil_init_mmx(c, avctx, cpu_flags, high_bit_depth);
|
2013-05-08 02:45:39 +03:00
|
|
|
|
|
|
|
if (CONFIG_ENCODERS)
|
2013-12-30 14:09:03 +03:00
|
|
|
ff_dsputilenc_init_mmx(c, avctx, high_bit_depth);
|
2013-05-08 02:45:39 +03:00
|
|
|
}
|