[FFmpeg-devel,2/5] celt_pvq_init: only build when CONFIG_OPUS_ENCODER is enabled

Submitted by Lynne on March 16, 2019, 4:28 p.m.

Details

Message ID La6KPhu--3-1@lynne.ee
State New
Headers show

Commit Message

Lynne March 16, 2019, 4:28 p.m.
The entire function was defined away before.

Patch hide | download patch | download mbox

From c547198da31bd748d5f9c9eddbe6bf3b1831fdfc Mon Sep 17 00:00:00 2001
From: Lynne <dev@lynne.ee>
Date: Fri, 15 Mar 2019 14:32:08 +0000
Subject: [PATCH 2/5] celt_pvq_init: only build when CONFIG_OPUS_ENCODER is
 enabled

The entire function was defined away before.
---
 libavcodec/opus_pvq.c          | 2 +-
 libavcodec/x86/Makefile        | 1 -
 libavcodec/x86/celt_pvq_init.c | 2 --
 3 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/libavcodec/opus_pvq.c b/libavcodec/opus_pvq.c
index c3119a03f1..9c21d67298 100644
--- a/libavcodec/opus_pvq.c
+++ b/libavcodec/opus_pvq.c
@@ -903,7 +903,7 @@  int av_cold ff_celt_pvq_init(CeltPVQ **pvq, int encode)
     s->pvq_search = ppp_pvq_search_c;
     s->quant_band = encode ? pvq_encode_band : pvq_decode_band;
 
-    if (ARCH_X86)
+    if (CONFIG_OPUS_ENCODER && ARCH_X86)
         ff_celt_pvq_init_x86(s);
 
     *pvq = s;
diff --git a/libavcodec/x86/Makefile b/libavcodec/x86/Makefile
index 3bfba94ec2..2697431781 100644
--- a/libavcodec/x86/Makefile
+++ b/libavcodec/x86/Makefile
@@ -53,7 +53,6 @@  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_EXR_DECODER)             += x86/exrdsp_init.o
-OBJS-$(CONFIG_OPUS_DECODER)            += x86/celt_pvq_init.o
 OBJS-$(CONFIG_OPUS_ENCODER)            += x86/celt_pvq_init.o
 OBJS-$(CONFIG_HEVC_DECODER)            += x86/hevcdsp_init.o
 OBJS-$(CONFIG_JPEG2000_DECODER)        += x86/jpeg2000dsp_init.o
diff --git a/libavcodec/x86/celt_pvq_init.c b/libavcodec/x86/celt_pvq_init.c
index 3890a9cb9f..13724c3561 100644
--- a/libavcodec/x86/celt_pvq_init.c
+++ b/libavcodec/x86/celt_pvq_init.c
@@ -32,7 +32,6 @@  av_cold void ff_celt_pvq_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_approx_sse2;
 
@@ -41,5 +40,4 @@  av_cold void ff_celt_pvq_init_x86(CeltPVQ *s)
 
     if (EXTERNAL_AVX_FAST(cpu_flags))
         s->pvq_search = ff_pvq_search_exact_avx;
-#endif
 }
-- 
2.21.0