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