2011-01-30 15:06:46 +00:00
|
|
|
/*
|
|
|
|
* Format Conversion Utils
|
|
|
|
* Copyright (c) 2000, 2001 Fabrice Bellard
|
|
|
|
* Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
|
|
|
|
*
|
2013-04-10 17:26:49 +00:00
|
|
|
* MMX optimization by Nick Kurshev <nickols_k@mail.ru>
|
|
|
|
*
|
2011-03-18 17:35:10 +00:00
|
|
|
* This file is part of Libav.
|
2011-01-30 15:06:46 +00:00
|
|
|
*
|
2011-03-18 17:35:10 +00:00
|
|
|
* Libav is free software; you can redistribute it and/or
|
2011-01-30 15:06:46 +00: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.
|
|
|
|
*
|
2011-03-18 17:35:10 +00:00
|
|
|
* Libav is distributed in the hope that it will be useful,
|
2011-01-30 15:06:46 +00: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
|
2011-03-18 17:35:10 +00:00
|
|
|
* License along with Libav; if not, write to the Free Software
|
2011-01-30 15:06:46 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
*/
|
|
|
|
|
2013-02-01 09:31:59 +00:00
|
|
|
#include "libavutil/attributes.h"
|
2011-01-30 15:06:46 +00:00
|
|
|
#include "libavutil/cpu.h"
|
2012-08-08 12:51:52 +00:00
|
|
|
#include "libavutil/x86/asm.h"
|
2012-08-29 17:01:05 +00:00
|
|
|
#include "libavutil/x86/cpu.h"
|
2011-01-30 15:06:46 +00:00
|
|
|
#include "libavcodec/fmtconvert.h"
|
|
|
|
|
2011-10-09 23:12:09 +00:00
|
|
|
#if HAVE_YASM
|
2011-01-30 15:06:46 +00:00
|
|
|
|
2012-12-27 21:33:51 +00:00
|
|
|
void ff_int32_to_float_fmul_scalar_sse (float *dst, const int32_t *src, float mul, int len);
|
|
|
|
void ff_int32_to_float_fmul_scalar_sse2(float *dst, const int32_t *src, float mul, int len);
|
2011-10-10 03:52:03 +00:00
|
|
|
|
2012-08-29 13:05:53 +00:00
|
|
|
#endif /* HAVE_YASM */
|
2011-04-24 21:50:17 +00:00
|
|
|
|
2013-02-01 09:31:59 +00:00
|
|
|
av_cold void ff_fmt_convert_init_x86(FmtConvertContext *c, AVCodecContext *avctx)
|
2011-01-30 15:06:46 +00:00
|
|
|
{
|
2012-01-30 08:39:16 +00:00
|
|
|
#if HAVE_YASM
|
2013-07-17 18:19:24 +00:00
|
|
|
int cpu_flags = av_get_cpu_flags();
|
2011-01-30 15:06:46 +00:00
|
|
|
|
2013-08-20 13:32:00 +00:00
|
|
|
if (EXTERNAL_SSE(cpu_flags)) {
|
|
|
|
c->int32_to_float_fmul_scalar = ff_int32_to_float_fmul_scalar_sse;
|
|
|
|
}
|
|
|
|
if (EXTERNAL_SSE2(cpu_flags)) {
|
|
|
|
c->int32_to_float_fmul_scalar = ff_int32_to_float_fmul_scalar_sse2;
|
|
|
|
}
|
2012-08-29 13:05:53 +00:00
|
|
|
#endif /* HAVE_YASM */
|
2011-01-30 15:06:46 +00:00
|
|
|
}
|