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-01-30 17:06:46 +02:00
|
|
|
* 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
|
|
|
|
*/
|
|
|
|
|
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);
|
2014-09-27 02:46:41 +03:00
|
|
|
void ff_int32_to_float_fmul_array8_sse (FmtConvertContext *c, float *dst, const int32_t *src,
|
|
|
|
const float *mul, int len);
|
|
|
|
void ff_int32_to_float_fmul_array8_sse2(FmtConvertContext *c, float *dst, const int32_t *src,
|
|
|
|
const float *mul, int len);
|
2011-01-30 17:06:46 +02: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;
|
2014-09-27 02:46:41 +03:00
|
|
|
c->int32_to_float_fmul_array8 = ff_int32_to_float_fmul_array8_sse;
|
2013-08-20 16:32:00 +03:00
|
|
|
}
|
|
|
|
if (EXTERNAL_SSE2(cpu_flags)) {
|
|
|
|
c->int32_to_float_fmul_scalar = ff_int32_to_float_fmul_scalar_sse2;
|
2014-09-27 02:46:41 +03:00
|
|
|
c->int32_to_float_fmul_array8 = ff_int32_to_float_fmul_array8_sse2;
|
2013-08-20 16:32:00 +03:00
|
|
|
}
|
2012-08-29 16:05:53 +03:00
|
|
|
#endif /* HAVE_YASM */
|
2011-01-30 17:06:46 +02:00
|
|
|
}
|