From 1a6ee9b2880c67db25737a6317f09cbbac441c83 Mon Sep 17 00:00:00 2001
From: Ivan Kalvachev <ikalvachev@gmail.com>
Date: Thu, 27 Jul 2017 14:21:33 +0300
Subject: [PATCH 2/6] Build opus dsp for encoder and decoder.
---
libavcodec/opus_pvq.c | 2 +-
libavcodec/x86/Makefile | 1 +
libavcodec/x86/opus_dsp_init.c | 2 ++
3 files changed, 4 insertions(+), 1 deletion(-)
@@ -947,7 +947,7 @@ int av_cold ff_celt_pvq_init(CeltPVQ **pvq)
s->encode_band = pvq_encode_band;
s->band_cost = pvq_band_cost;
- if (ARCH_X86 && CONFIG_OPUS_ENCODER)
+ if (ARCH_X86)
ff_opus_dsp_init_x86(s);
*pvq = s;
@@ -52,6 +52,7 @@ OBJS-$(CONFIG_APNG_DECODER) += x86/pngdsp_init.o
OBJS-$(CONFIG_CAVS_DECODER) += x86/cavsdsp.o
OBJS-$(CONFIG_DCA_DECODER) += x86/dcadsp_init.o x86/synth_filter_init.o
OBJS-$(CONFIG_DNXHD_ENCODER) += x86/dnxhdenc_init.o
+OBJS-$(CONFIG_OPUS_DECODER) += x86/opus_dsp_init.o
OBJS-$(CONFIG_OPUS_ENCODER) += x86/opus_dsp_init.o
OBJS-$(CONFIG_HEVC_DECODER) += x86/hevcdsp_init.o
OBJS-$(CONFIG_JPEG2000_DECODER) += x86/jpeg2000dsp_init.o
@@ -32,6 +32,7 @@ av_cold void ff_opus_dsp_init_x86(CeltPVQ *s)
{
int cpu_flags = av_get_cpu_flags();
+#if CONFIG_OPUS_ENCODER
if (EXTERNAL_SSE2(cpu_flags))
s->pvq_search = ff_pvq_search_sse2;
@@ -40,4 +41,5 @@ av_cold void ff_opus_dsp_init_x86(CeltPVQ *s)
if (EXTERNAL_AVX(cpu_flags))
s->pvq_search = ff_pvq_search_avx;
+#endif
}
--
2.13.2