2013-12-29 04:32:16 +03:00
|
|
|
/*
|
2014-05-30 01:59:15 +03:00
|
|
|
* This file is part of FFmpeg.
|
2013-12-29 04:32:16 +03:00
|
|
|
*
|
2014-05-30 01:59:15 +03:00
|
|
|
* FFmpeg is free software; you can redistribute it and/or
|
2013-12-29 04:32:16 +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.
|
|
|
|
*
|
2014-05-30 01:59:15 +03:00
|
|
|
* FFmpeg is distributed in the hope that it will be useful,
|
2013-12-29 04:32:16 +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
|
2014-05-30 01:59:15 +03:00
|
|
|
* License along with FFmpeg; if not, write to the Free Software
|
2013-12-29 04:32:16 +03:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "libavutil/attributes.h"
|
|
|
|
#include "libavutil/cpu.h"
|
|
|
|
#include "libavutil/x86/cpu.h"
|
2014-05-30 17:28:49 +03:00
|
|
|
#include "libavcodec/lossless_audiodsp.h"
|
2013-12-29 04:32:16 +03:00
|
|
|
|
|
|
|
int32_t ff_scalarproduct_and_madd_int16_sse2(int16_t *v1, const int16_t *v2,
|
|
|
|
const int16_t *v3,
|
|
|
|
int order, int mul);
|
|
|
|
int32_t ff_scalarproduct_and_madd_int16_ssse3(int16_t *v1, const int16_t *v2,
|
|
|
|
const int16_t *v3,
|
|
|
|
int order, int mul);
|
|
|
|
|
2016-05-01 15:33:46 +02:00
|
|
|
int32_t ff_scalarproduct_and_madd_int32_sse4(int16_t *v1, const int32_t *v2,
|
|
|
|
const int16_t *v3,
|
|
|
|
int order, int mul);
|
|
|
|
|
2014-05-30 17:28:49 +03:00
|
|
|
av_cold void ff_llauddsp_init_x86(LLAudDSPContext *c)
|
2013-12-29 04:32:16 +03:00
|
|
|
{
|
2016-10-08 16:18:33 +02:00
|
|
|
#if HAVE_X86ASM
|
2013-12-29 04:32:16 +03:00
|
|
|
int cpu_flags = av_get_cpu_flags();
|
|
|
|
|
|
|
|
if (EXTERNAL_SSE2(cpu_flags))
|
2015-02-07 11:20:10 +02:00
|
|
|
c->scalarproduct_and_madd_int16 = ff_scalarproduct_and_madd_int16_sse2;
|
2013-12-29 04:32:16 +03:00
|
|
|
|
|
|
|
if (EXTERNAL_SSSE3(cpu_flags) &&
|
|
|
|
!(cpu_flags & (AV_CPU_FLAG_SSE42 | AV_CPU_FLAG_3DNOW))) // cachesplit
|
2015-02-07 11:20:10 +02:00
|
|
|
c->scalarproduct_and_madd_int16 = ff_scalarproduct_and_madd_int16_ssse3;
|
2016-05-01 15:33:46 +02:00
|
|
|
|
|
|
|
if (EXTERNAL_SSE4(cpu_flags))
|
|
|
|
c->scalarproduct_and_madd_int32 = ff_scalarproduct_and_madd_int32_sse4;
|
2015-02-06 08:46:43 +02:00
|
|
|
#endif
|
2013-12-29 04:32:16 +03:00
|
|
|
}
|