From patchwork Tue Nov 1 21:59:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "L. E. Segovia" X-Patchwork-Id: 39104 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:999a:b0:a4:2148:650a with SMTP id ve26csp430147pzb; Tue, 1 Nov 2022 15:00:20 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5FQTFTVS/j6dyfHKdR/YoKkGoEdagq3A1bHD3+aKsA7j1vd82+gYjW3u5un7q9yKguk2Vt X-Received: by 2002:a17:907:608f:b0:78e:1b60:60e2 with SMTP id ht15-20020a170907608f00b0078e1b6060e2mr20785807ejc.382.1667340019967; Tue, 01 Nov 2022 15:00:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667340019; cv=none; d=google.com; s=arc-20160816; b=GDCRyMo5JUy1fs36Xf1HkXi1BHt1f1X3nwfdmAPAUxQ1SoZZUm4T6iJQMg63UZN1PU hqjaVO1jEZw2VMHRiwHLqVsdrGIrKnUX+L4nBxGLrLewslwI9Swa76MbE4mvsPdUymtw Qd6wVxlO0UbuESxMITy4mRn3E6eCT3RLWAU11WF/aBOnmwD5/C1Tf1IqYVk9aqgFMW5N 7CrTo2IdfYN2/Rk7TZhXvoxZZr3ykVMytLADz/OhVN56aS2NLl7Gri0xMEL1KBgJzDuU MbTtEFOpCYJlT5XeVh09yviiggjBxSTUNuscKgBT36oZIxuaLlH1VMM0vtRZmWUCn1PS 0flA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=nvbxwUqDCBEoElz6BmpalBKZV3N+PJRQIT037ainGls=; b=SeRk92kXvHCGhvx/yd9TWooZcrh+ntd1koBPHxbuhS90N++j5V1aChFLU4BPGGMQe6 lAIkETUw5OwK/YYsCKGkF60KfNNpJYMU28bdgZIQmOLR6Vs3doYf2YrQczFaLxx9dkiW k+zDeTKehKkIlRiJ2gv9OcLUTYO4TG+KnDyQw0P+pLdGTJVHybwrKgi4Gjk0Onf5JiH3 oy2POMq5t/39e0LONEN4qT+HdyP0h99ZWkEZXBwSRBAgT5BfPhhwU7w/onW2MgjyOoi5 xZagE/+JLIPRVgLtVyLLspnGdhPUyobvx2XqPIg9HlBgT7bxHWopHjGg1RrJeG6n+hO/ LMtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@amyspark.me header.s=gm1 header.b=eSfUOcGU; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amyspark.me Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id sd26-20020a1709076e1a00b0078db6f56d51si12096547ejc.808.2022.11.01.15.00.19; Tue, 01 Nov 2022 15:00:19 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@amyspark.me header.s=gm1 header.b=eSfUOcGU; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amyspark.me Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8BC1A68BE73; Wed, 2 Nov 2022 00:00:12 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay11.mail.gandi.net (relay11.mail.gandi.net [217.70.178.231]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 20DDD68BBF4 for ; Wed, 2 Nov 2022 00:00:05 +0200 (EET) Received: (Authenticated sender: amy@amyspark.me) by mail.gandi.net (Postfix) with ESMTPSA id F3EA1100006; Tue, 1 Nov 2022 21:59:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amyspark.me; s=gm1; t=1667340004; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ILavzyDoZzXeZS+kEVA5/iqkkzIbZCBPxO2YDLDrzV0=; b=eSfUOcGUJp4nHA7O37geFygad+HKSwrVulh06l2WSS5iKRDT+yneKDYyPZasYIGP2+0YCK w7QD5pYf4MmYO/fYrh6abxWsZsQoPHEM0mgOdrm+SdCzT1QGlJodZ9hxcpQDSwOfEqvTmf oDKY09cdcFRkC5NkRN1QZGRUipMJBk92nKrJQF/C6FQnieBi68RsHTGk8QUqmn+6T+mp26 Auo2JltTP1VkXSid6reTwZwg3W5wImEtZX4fIzlsoNZSp/RE442LNsn0n3TM4CVsqu/ArB fRatFWyTBKbxmEOaioePO7NK06Bm7cmKCVlgWKegV+UkHDc4rSL6Y3kV5rGA0Q== From: "L. E. Segovia" To: ffmpeg-devel@ffmpeg.org Date: Tue, 1 Nov 2022 21:59:33 +0000 Message-Id: <06138cd36b600db9865a573cd95cd9e33129a103.1667325395.git.amy@amyspark.me> X-Mailer: git-send-email 2.38.1 In-Reply-To: References: MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/4] all: Replace if (ARCH_FOO) checks by #if ARCH_FOO, part 2 X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Nirbheek Chauhan , Halla Rempt , =?utf-8?q?Tim-Philipp_M=C3=BCller?= Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: j34anABoNlg+ Continuation of 40e6575aa3eed64cd32bf28c00ae57edc5acb25a Co-authored-by: Nirbheek Chauhan Signed-off-by: L. E. Segovia --- libavcodec/x86/dcadsp_init.c | 2 + libavcodec/x86/fdctdsp_init.c | 2 + libavcodec/x86/flacdsp_init.c | 8 +- libavcodec/x86/hevcdsp_init.c | 463 ++++++++++++++------------- libavcodec/x86/idctdsp_init.c | 9 +- libavcodec/x86/mlpdsp_init.c | 6 +- libavcodec/x86/vc1dsp_init.c | 6 +- libavfilter/x86/colorspacedsp_init.c | 4 +- libavfilter/x86/vf_atadenoise_init.c | 6 +- libavfilter/x86/vf_ssim_init.c | 6 +- libavfilter/x86/vf_w3fdif_init.c | 4 +- 11 files changed, 272 insertions(+), 244 deletions(-) diff --git a/libavcodec/x86/dcadsp_init.c b/libavcodec/x86/dcadsp_init.c index 0c78dd1c9e..3c125f33fd 100644 --- a/libavcodec/x86/dcadsp_init.c +++ b/libavcodec/x86/dcadsp_init.c @@ -36,6 +36,7 @@ av_cold void ff_dcadsp_init_x86(DCADSPContext *s) { int cpu_flags = av_get_cpu_flags(); +#if ARCH_X86_32 if (EXTERNAL_SSE2(cpu_flags)) s->lfe_fir_float[0] = ff_lfe_fir0_float_sse2; if (EXTERNAL_SSE3(cpu_flags)) @@ -46,4 +47,5 @@ av_cold void ff_dcadsp_init_x86(DCADSPContext *s) } if (EXTERNAL_FMA3(cpu_flags)) s->lfe_fir_float[0] = ff_lfe_fir0_float_fma3; +#endif } diff --git a/libavcodec/x86/fdctdsp_init.c b/libavcodec/x86/fdctdsp_init.c index 92a842433d..4a874a640d 100644 --- a/libavcodec/x86/fdctdsp_init.c +++ b/libavcodec/x86/fdctdsp_init.c @@ -31,8 +31,10 @@ av_cold void ff_fdctdsp_init_x86(FDCTDSPContext *c, AVCodecContext *avctx, if (!high_bit_depth) { if ((dct_algo == FF_DCT_AUTO || dct_algo == FF_DCT_MMX)) { +#if HAVE_INLINE_SSE2 if (INLINE_SSE2(cpu_flags)) c->fdct = ff_fdct_sse2; +#endif } } } diff --git a/libavcodec/x86/flacdsp_init.c b/libavcodec/x86/flacdsp_init.c index 87daed7005..49e67ee2b0 100644 --- a/libavcodec/x86/flacdsp_init.c +++ b/libavcodec/x86/flacdsp_init.c @@ -97,15 +97,19 @@ av_cold void ff_flacdsp_init_x86(FLACDSPContext *c, enum AVSampleFormat fmt, int } if (EXTERNAL_AVX(cpu_flags)) { if (fmt == AV_SAMPLE_FMT_S16) { - if (ARCH_X86_64 && channels == 8) +#if ARCH_X86_64 + if (channels == 8) c->decorrelate[0] = ff_flac_decorrelate_indep8_16_avx; +#endif } else if (fmt == AV_SAMPLE_FMT_S32) { if (channels == 4) c->decorrelate[0] = ff_flac_decorrelate_indep4_32_avx; else if (channels == 6) c->decorrelate[0] = ff_flac_decorrelate_indep6_32_avx; - else if (ARCH_X86_64 && channels == 8) +#if ARCH_X86_64 + else if (channels == 8) c->decorrelate[0] = ff_flac_decorrelate_indep8_32_avx; +#endif } } if (EXTERNAL_XOP(cpu_flags)) { diff --git a/libavcodec/x86/hevcdsp_init.c b/libavcodec/x86/hevcdsp_init.c index 6f45e5e0db..c7060085a2 100644 --- a/libavcodec/x86/hevcdsp_init.c +++ b/libavcodec/x86/hevcdsp_init.c @@ -710,13 +710,13 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth) if (EXTERNAL_SSE2(cpu_flags)) { c->hevc_v_loop_filter_chroma = ff_hevc_v_loop_filter_chroma_8_sse2; c->hevc_h_loop_filter_chroma = ff_hevc_h_loop_filter_chroma_8_sse2; - if (ARCH_X86_64) { - c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_8_sse2; - c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_8_sse2; +#if ARCH_X86_64 + c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_8_sse2; + c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_8_sse2; - c->idct[2] = ff_hevc_idct_16x16_8_sse2; - c->idct[3] = ff_hevc_idct_32x32_8_sse2; - } + c->idct[2] = ff_hevc_idct_16x16_8_sse2; + c->idct[3] = ff_hevc_idct_32x32_8_sse2; +#endif SAO_BAND_INIT(8, sse2); c->idct_dc[1] = ff_hevc_idct_8x8_dc_8_sse2; @@ -731,14 +731,14 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth) c->add_residual[3] = ff_hevc_add_residual_32_8_sse2; } if (EXTERNAL_SSSE3(cpu_flags)) { - if(ARCH_X86_64) { - c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_8_ssse3; - c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_8_ssse3; - } +#if ARCH_X86_64 + c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_8_ssse3; + c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_8_ssse3; +#endif SAO_EDGE_INIT(8, ssse3); } - if (EXTERNAL_SSE4(cpu_flags) && ARCH_X86_64) { - +#if ARCH_X86_64 + if (EXTERNAL_SSE4(cpu_flags)) { EPEL_LINKS(c->put_hevc_epel, 0, 0, pel_pixels, 8, sse4); EPEL_LINKS(c->put_hevc_epel, 0, 1, epel_h, 8, sse4); EPEL_LINKS(c->put_hevc_epel, 1, 0, epel_v, 8, sse4); @@ -749,16 +749,17 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth) QPEL_LINKS(c->put_hevc_qpel, 1, 0, qpel_v, 8, sse4); QPEL_LINKS(c->put_hevc_qpel, 1, 1, qpel_hv, 8, sse4); } +#endif if (EXTERNAL_AVX(cpu_flags)) { c->hevc_v_loop_filter_chroma = ff_hevc_v_loop_filter_chroma_8_avx; c->hevc_h_loop_filter_chroma = ff_hevc_h_loop_filter_chroma_8_avx; - if (ARCH_X86_64) { - c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_8_avx; - c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_8_avx; +#if ARCH_X86_64 + c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_8_avx; + c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_8_avx; - c->idct[2] = ff_hevc_idct_16x16_8_avx; - c->idct[3] = ff_hevc_idct_32x32_8_avx; - } + c->idct[2] = ff_hevc_idct_16x16_8_avx; + c->idct[3] = ff_hevc_idct_32x32_8_avx; +#endif SAO_BAND_INIT(8, avx); c->idct[0] = ff_hevc_idct_4x4_8_avx; @@ -775,91 +776,91 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth) if (EXTERNAL_AVX2_FAST(cpu_flags)) { c->idct_dc[2] = ff_hevc_idct_16x16_dc_8_avx2; c->idct_dc[3] = ff_hevc_idct_32x32_dc_8_avx2; - if (ARCH_X86_64) { - c->put_hevc_epel[7][0][0] = ff_hevc_put_hevc_pel_pixels32_8_avx2; - c->put_hevc_epel[8][0][0] = ff_hevc_put_hevc_pel_pixels48_8_avx2; - c->put_hevc_epel[9][0][0] = ff_hevc_put_hevc_pel_pixels64_8_avx2; +#if ARCH_X86_64 + c->put_hevc_epel[7][0][0] = ff_hevc_put_hevc_pel_pixels32_8_avx2; + c->put_hevc_epel[8][0][0] = ff_hevc_put_hevc_pel_pixels48_8_avx2; + c->put_hevc_epel[9][0][0] = ff_hevc_put_hevc_pel_pixels64_8_avx2; - c->put_hevc_qpel[7][0][0] = ff_hevc_put_hevc_pel_pixels32_8_avx2; - c->put_hevc_qpel[8][0][0] = ff_hevc_put_hevc_pel_pixels48_8_avx2; - c->put_hevc_qpel[9][0][0] = ff_hevc_put_hevc_pel_pixels64_8_avx2; + c->put_hevc_qpel[7][0][0] = ff_hevc_put_hevc_pel_pixels32_8_avx2; + c->put_hevc_qpel[8][0][0] = ff_hevc_put_hevc_pel_pixels48_8_avx2; + c->put_hevc_qpel[9][0][0] = ff_hevc_put_hevc_pel_pixels64_8_avx2; - c->put_hevc_epel_uni[7][0][0] = ff_hevc_put_hevc_uni_pel_pixels32_8_avx2; - c->put_hevc_epel_uni[8][0][0] = ff_hevc_put_hevc_uni_pel_pixels48_8_avx2; - c->put_hevc_epel_uni[9][0][0] = ff_hevc_put_hevc_uni_pel_pixels64_8_avx2; + c->put_hevc_epel_uni[7][0][0] = ff_hevc_put_hevc_uni_pel_pixels32_8_avx2; + c->put_hevc_epel_uni[8][0][0] = ff_hevc_put_hevc_uni_pel_pixels48_8_avx2; + c->put_hevc_epel_uni[9][0][0] = ff_hevc_put_hevc_uni_pel_pixels64_8_avx2; - c->put_hevc_qpel_uni[7][0][0] = ff_hevc_put_hevc_uni_pel_pixels32_8_avx2; - c->put_hevc_qpel_uni[8][0][0] = ff_hevc_put_hevc_uni_pel_pixels48_8_avx2; - c->put_hevc_qpel_uni[9][0][0] = ff_hevc_put_hevc_uni_pel_pixels64_8_avx2; + c->put_hevc_qpel_uni[7][0][0] = ff_hevc_put_hevc_uni_pel_pixels32_8_avx2; + c->put_hevc_qpel_uni[8][0][0] = ff_hevc_put_hevc_uni_pel_pixels48_8_avx2; + c->put_hevc_qpel_uni[9][0][0] = ff_hevc_put_hevc_uni_pel_pixels64_8_avx2; - c->put_hevc_qpel_bi[7][0][0] = ff_hevc_put_hevc_bi_pel_pixels32_8_avx2; - c->put_hevc_qpel_bi[8][0][0] = ff_hevc_put_hevc_bi_pel_pixels48_8_avx2; - c->put_hevc_qpel_bi[9][0][0] = ff_hevc_put_hevc_bi_pel_pixels64_8_avx2; + c->put_hevc_qpel_bi[7][0][0] = ff_hevc_put_hevc_bi_pel_pixels32_8_avx2; + c->put_hevc_qpel_bi[8][0][0] = ff_hevc_put_hevc_bi_pel_pixels48_8_avx2; + c->put_hevc_qpel_bi[9][0][0] = ff_hevc_put_hevc_bi_pel_pixels64_8_avx2; - c->put_hevc_epel_bi[7][0][0] = ff_hevc_put_hevc_bi_pel_pixels32_8_avx2; - c->put_hevc_epel_bi[8][0][0] = ff_hevc_put_hevc_bi_pel_pixels48_8_avx2; - c->put_hevc_epel_bi[9][0][0] = ff_hevc_put_hevc_bi_pel_pixels64_8_avx2; + c->put_hevc_epel_bi[7][0][0] = ff_hevc_put_hevc_bi_pel_pixels32_8_avx2; + c->put_hevc_epel_bi[8][0][0] = ff_hevc_put_hevc_bi_pel_pixels48_8_avx2; + c->put_hevc_epel_bi[9][0][0] = ff_hevc_put_hevc_bi_pel_pixels64_8_avx2; - c->put_hevc_epel[7][0][1] = ff_hevc_put_hevc_epel_h32_8_avx2; - c->put_hevc_epel[8][0][1] = ff_hevc_put_hevc_epel_h48_8_avx2; - c->put_hevc_epel[9][0][1] = ff_hevc_put_hevc_epel_h64_8_avx2; + c->put_hevc_epel[7][0][1] = ff_hevc_put_hevc_epel_h32_8_avx2; + c->put_hevc_epel[8][0][1] = ff_hevc_put_hevc_epel_h48_8_avx2; + c->put_hevc_epel[9][0][1] = ff_hevc_put_hevc_epel_h64_8_avx2; - c->put_hevc_epel_uni[7][0][1] = ff_hevc_put_hevc_uni_epel_h32_8_avx2; - c->put_hevc_epel_uni[8][0][1] = ff_hevc_put_hevc_uni_epel_h48_8_avx2; - c->put_hevc_epel_uni[9][0][1] = ff_hevc_put_hevc_uni_epel_h64_8_avx2; + c->put_hevc_epel_uni[7][0][1] = ff_hevc_put_hevc_uni_epel_h32_8_avx2; + c->put_hevc_epel_uni[8][0][1] = ff_hevc_put_hevc_uni_epel_h48_8_avx2; + c->put_hevc_epel_uni[9][0][1] = ff_hevc_put_hevc_uni_epel_h64_8_avx2; - c->put_hevc_epel_bi[7][0][1] = ff_hevc_put_hevc_bi_epel_h32_8_avx2; - c->put_hevc_epel_bi[8][0][1] = ff_hevc_put_hevc_bi_epel_h48_8_avx2; - c->put_hevc_epel_bi[9][0][1] = ff_hevc_put_hevc_bi_epel_h64_8_avx2; + c->put_hevc_epel_bi[7][0][1] = ff_hevc_put_hevc_bi_epel_h32_8_avx2; + c->put_hevc_epel_bi[8][0][1] = ff_hevc_put_hevc_bi_epel_h48_8_avx2; + c->put_hevc_epel_bi[9][0][1] = ff_hevc_put_hevc_bi_epel_h64_8_avx2; - c->put_hevc_epel[7][1][0] = ff_hevc_put_hevc_epel_v32_8_avx2; - c->put_hevc_epel[8][1][0] = ff_hevc_put_hevc_epel_v48_8_avx2; - c->put_hevc_epel[9][1][0] = ff_hevc_put_hevc_epel_v64_8_avx2; + c->put_hevc_epel[7][1][0] = ff_hevc_put_hevc_epel_v32_8_avx2; + c->put_hevc_epel[8][1][0] = ff_hevc_put_hevc_epel_v48_8_avx2; + c->put_hevc_epel[9][1][0] = ff_hevc_put_hevc_epel_v64_8_avx2; - c->put_hevc_epel_uni[7][1][0] = ff_hevc_put_hevc_uni_epel_v32_8_avx2; - c->put_hevc_epel_uni[8][1][0] = ff_hevc_put_hevc_uni_epel_v48_8_avx2; - c->put_hevc_epel_uni[9][1][0] = ff_hevc_put_hevc_uni_epel_v64_8_avx2; + c->put_hevc_epel_uni[7][1][0] = ff_hevc_put_hevc_uni_epel_v32_8_avx2; + c->put_hevc_epel_uni[8][1][0] = ff_hevc_put_hevc_uni_epel_v48_8_avx2; + c->put_hevc_epel_uni[9][1][0] = ff_hevc_put_hevc_uni_epel_v64_8_avx2; - c->put_hevc_epel_bi[7][1][0] = ff_hevc_put_hevc_bi_epel_v32_8_avx2; - c->put_hevc_epel_bi[8][1][0] = ff_hevc_put_hevc_bi_epel_v48_8_avx2; - c->put_hevc_epel_bi[9][1][0] = ff_hevc_put_hevc_bi_epel_v64_8_avx2; + c->put_hevc_epel_bi[7][1][0] = ff_hevc_put_hevc_bi_epel_v32_8_avx2; + c->put_hevc_epel_bi[8][1][0] = ff_hevc_put_hevc_bi_epel_v48_8_avx2; + c->put_hevc_epel_bi[9][1][0] = ff_hevc_put_hevc_bi_epel_v64_8_avx2; - c->put_hevc_epel[7][1][1] = ff_hevc_put_hevc_epel_hv32_8_avx2; - c->put_hevc_epel[8][1][1] = ff_hevc_put_hevc_epel_hv48_8_avx2; - c->put_hevc_epel[9][1][1] = ff_hevc_put_hevc_epel_hv64_8_avx2; + c->put_hevc_epel[7][1][1] = ff_hevc_put_hevc_epel_hv32_8_avx2; + c->put_hevc_epel[8][1][1] = ff_hevc_put_hevc_epel_hv48_8_avx2; + c->put_hevc_epel[9][1][1] = ff_hevc_put_hevc_epel_hv64_8_avx2; - c->put_hevc_epel_uni[7][1][1] = ff_hevc_put_hevc_uni_epel_hv32_8_avx2; - c->put_hevc_epel_uni[8][1][1] = ff_hevc_put_hevc_uni_epel_hv48_8_avx2; - c->put_hevc_epel_uni[9][1][1] = ff_hevc_put_hevc_uni_epel_hv64_8_avx2; + c->put_hevc_epel_uni[7][1][1] = ff_hevc_put_hevc_uni_epel_hv32_8_avx2; + c->put_hevc_epel_uni[8][1][1] = ff_hevc_put_hevc_uni_epel_hv48_8_avx2; + c->put_hevc_epel_uni[9][1][1] = ff_hevc_put_hevc_uni_epel_hv64_8_avx2; - c->put_hevc_epel_bi[7][1][1] = ff_hevc_put_hevc_bi_epel_hv32_8_avx2; - c->put_hevc_epel_bi[8][1][1] = ff_hevc_put_hevc_bi_epel_hv48_8_avx2; - c->put_hevc_epel_bi[9][1][1] = ff_hevc_put_hevc_bi_epel_hv64_8_avx2; + c->put_hevc_epel_bi[7][1][1] = ff_hevc_put_hevc_bi_epel_hv32_8_avx2; + c->put_hevc_epel_bi[8][1][1] = ff_hevc_put_hevc_bi_epel_hv48_8_avx2; + c->put_hevc_epel_bi[9][1][1] = ff_hevc_put_hevc_bi_epel_hv64_8_avx2; - c->put_hevc_qpel[7][0][1] = ff_hevc_put_hevc_qpel_h32_8_avx2; - c->put_hevc_qpel[8][0][1] = ff_hevc_put_hevc_qpel_h48_8_avx2; - c->put_hevc_qpel[9][0][1] = ff_hevc_put_hevc_qpel_h64_8_avx2; + c->put_hevc_qpel[7][0][1] = ff_hevc_put_hevc_qpel_h32_8_avx2; + c->put_hevc_qpel[8][0][1] = ff_hevc_put_hevc_qpel_h48_8_avx2; + c->put_hevc_qpel[9][0][1] = ff_hevc_put_hevc_qpel_h64_8_avx2; - c->put_hevc_qpel[7][1][0] = ff_hevc_put_hevc_qpel_v32_8_avx2; - c->put_hevc_qpel[8][1][0] = ff_hevc_put_hevc_qpel_v48_8_avx2; - c->put_hevc_qpel[9][1][0] = ff_hevc_put_hevc_qpel_v64_8_avx2; + c->put_hevc_qpel[7][1][0] = ff_hevc_put_hevc_qpel_v32_8_avx2; + c->put_hevc_qpel[8][1][0] = ff_hevc_put_hevc_qpel_v48_8_avx2; + c->put_hevc_qpel[9][1][0] = ff_hevc_put_hevc_qpel_v64_8_avx2; - c->put_hevc_qpel_uni[7][0][1] = ff_hevc_put_hevc_uni_qpel_h32_8_avx2; - c->put_hevc_qpel_uni[8][0][1] = ff_hevc_put_hevc_uni_qpel_h48_8_avx2; - c->put_hevc_qpel_uni[9][0][1] = ff_hevc_put_hevc_uni_qpel_h64_8_avx2; + c->put_hevc_qpel_uni[7][0][1] = ff_hevc_put_hevc_uni_qpel_h32_8_avx2; + c->put_hevc_qpel_uni[8][0][1] = ff_hevc_put_hevc_uni_qpel_h48_8_avx2; + c->put_hevc_qpel_uni[9][0][1] = ff_hevc_put_hevc_uni_qpel_h64_8_avx2; - c->put_hevc_qpel_uni[7][1][0] = ff_hevc_put_hevc_uni_qpel_v32_8_avx2; - c->put_hevc_qpel_uni[8][1][0] = ff_hevc_put_hevc_uni_qpel_v48_8_avx2; - c->put_hevc_qpel_uni[9][1][0] = ff_hevc_put_hevc_uni_qpel_v64_8_avx2; + c->put_hevc_qpel_uni[7][1][0] = ff_hevc_put_hevc_uni_qpel_v32_8_avx2; + c->put_hevc_qpel_uni[8][1][0] = ff_hevc_put_hevc_uni_qpel_v48_8_avx2; + c->put_hevc_qpel_uni[9][1][0] = ff_hevc_put_hevc_uni_qpel_v64_8_avx2; - c->put_hevc_qpel_bi[7][0][1] = ff_hevc_put_hevc_bi_qpel_h32_8_avx2; - c->put_hevc_qpel_bi[8][0][1] = ff_hevc_put_hevc_bi_qpel_h48_8_avx2; - c->put_hevc_qpel_bi[9][0][1] = ff_hevc_put_hevc_bi_qpel_h64_8_avx2; + c->put_hevc_qpel_bi[7][0][1] = ff_hevc_put_hevc_bi_qpel_h32_8_avx2; + c->put_hevc_qpel_bi[8][0][1] = ff_hevc_put_hevc_bi_qpel_h48_8_avx2; + c->put_hevc_qpel_bi[9][0][1] = ff_hevc_put_hevc_bi_qpel_h64_8_avx2; - c->put_hevc_qpel_bi[7][1][0] = ff_hevc_put_hevc_bi_qpel_v32_8_avx2; - c->put_hevc_qpel_bi[8][1][0] = ff_hevc_put_hevc_bi_qpel_v48_8_avx2; - c->put_hevc_qpel_bi[9][1][0] = ff_hevc_put_hevc_bi_qpel_v64_8_avx2; - } + c->put_hevc_qpel_bi[7][1][0] = ff_hevc_put_hevc_bi_qpel_v32_8_avx2; + c->put_hevc_qpel_bi[8][1][0] = ff_hevc_put_hevc_bi_qpel_v48_8_avx2; + c->put_hevc_qpel_bi[9][1][0] = ff_hevc_put_hevc_bi_qpel_v64_8_avx2; +#endif SAO_BAND_INIT(8, avx2); c->sao_edge_filter[2] = ff_hevc_sao_edge_filter_32_8_avx2; @@ -884,13 +885,13 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth) if (EXTERNAL_SSE2(cpu_flags)) { c->hevc_v_loop_filter_chroma = ff_hevc_v_loop_filter_chroma_10_sse2; c->hevc_h_loop_filter_chroma = ff_hevc_h_loop_filter_chroma_10_sse2; - if (ARCH_X86_64) { - c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_10_sse2; - c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_10_sse2; +#if ARCH_X86_64 + c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_10_sse2; + c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_10_sse2; - c->idct[2] = ff_hevc_idct_16x16_10_sse2; - c->idct[3] = ff_hevc_idct_32x32_10_sse2; - } + c->idct[2] = ff_hevc_idct_16x16_10_sse2; + c->idct[3] = ff_hevc_idct_32x32_10_sse2; +#endif SAO_BAND_INIT(10, sse2); SAO_EDGE_INIT(10, sse2); @@ -905,11 +906,12 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth) c->add_residual[2] = ff_hevc_add_residual_16_10_sse2; c->add_residual[3] = ff_hevc_add_residual_32_10_sse2; } - if (EXTERNAL_SSSE3(cpu_flags) && ARCH_X86_64) { +#if ARCH_X86_64 + if (EXTERNAL_SSSE3(cpu_flags)) { c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_10_ssse3; c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_10_ssse3; } - if (EXTERNAL_SSE4(cpu_flags) && ARCH_X86_64) { + if (EXTERNAL_SSE4(cpu_flags)) { EPEL_LINKS(c->put_hevc_epel, 0, 0, pel_pixels, 10, sse4); EPEL_LINKS(c->put_hevc_epel, 0, 1, epel_h, 10, sse4); EPEL_LINKS(c->put_hevc_epel, 1, 0, epel_v, 10, sse4); @@ -920,16 +922,17 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth) QPEL_LINKS(c->put_hevc_qpel, 1, 0, qpel_v, 10, sse4); QPEL_LINKS(c->put_hevc_qpel, 1, 1, qpel_hv, 10, sse4); } +#endif if (EXTERNAL_AVX(cpu_flags)) { c->hevc_v_loop_filter_chroma = ff_hevc_v_loop_filter_chroma_10_avx; c->hevc_h_loop_filter_chroma = ff_hevc_h_loop_filter_chroma_10_avx; - if (ARCH_X86_64) { - c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_10_avx; - c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_10_avx; +#if ARCH_X86_64 + c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_10_avx; + c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_10_avx; - c->idct[2] = ff_hevc_idct_16x16_10_avx; - c->idct[3] = ff_hevc_idct_32x32_10_avx; - } + c->idct[2] = ff_hevc_idct_16x16_10_avx; + c->idct[3] = ff_hevc_idct_32x32_10_avx; +#endif c->idct[0] = ff_hevc_idct_4x4_10_avx; c->idct[1] = ff_hevc_idct_8x8_10_avx; @@ -942,150 +945,150 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth) if (EXTERNAL_AVX2_FAST(cpu_flags)) { c->idct_dc[2] = ff_hevc_idct_16x16_dc_10_avx2; c->idct_dc[3] = ff_hevc_idct_32x32_dc_10_avx2; - if (ARCH_X86_64) { - c->put_hevc_epel[5][0][0] = ff_hevc_put_hevc_pel_pixels16_10_avx2; - c->put_hevc_epel[6][0][0] = ff_hevc_put_hevc_pel_pixels24_10_avx2; - c->put_hevc_epel[7][0][0] = ff_hevc_put_hevc_pel_pixels32_10_avx2; - c->put_hevc_epel[8][0][0] = ff_hevc_put_hevc_pel_pixels48_10_avx2; - c->put_hevc_epel[9][0][0] = ff_hevc_put_hevc_pel_pixels64_10_avx2; +#if ARCH_X86_64 + c->put_hevc_epel[5][0][0] = ff_hevc_put_hevc_pel_pixels16_10_avx2; + c->put_hevc_epel[6][0][0] = ff_hevc_put_hevc_pel_pixels24_10_avx2; + c->put_hevc_epel[7][0][0] = ff_hevc_put_hevc_pel_pixels32_10_avx2; + c->put_hevc_epel[8][0][0] = ff_hevc_put_hevc_pel_pixels48_10_avx2; + c->put_hevc_epel[9][0][0] = ff_hevc_put_hevc_pel_pixels64_10_avx2; - c->put_hevc_qpel[5][0][0] = ff_hevc_put_hevc_pel_pixels16_10_avx2; - c->put_hevc_qpel[6][0][0] = ff_hevc_put_hevc_pel_pixels24_10_avx2; - c->put_hevc_qpel[7][0][0] = ff_hevc_put_hevc_pel_pixels32_10_avx2; - c->put_hevc_qpel[8][0][0] = ff_hevc_put_hevc_pel_pixels48_10_avx2; - c->put_hevc_qpel[9][0][0] = ff_hevc_put_hevc_pel_pixels64_10_avx2; + c->put_hevc_qpel[5][0][0] = ff_hevc_put_hevc_pel_pixels16_10_avx2; + c->put_hevc_qpel[6][0][0] = ff_hevc_put_hevc_pel_pixels24_10_avx2; + c->put_hevc_qpel[7][0][0] = ff_hevc_put_hevc_pel_pixels32_10_avx2; + c->put_hevc_qpel[8][0][0] = ff_hevc_put_hevc_pel_pixels48_10_avx2; + c->put_hevc_qpel[9][0][0] = ff_hevc_put_hevc_pel_pixels64_10_avx2; - c->put_hevc_epel_uni[5][0][0] = ff_hevc_put_hevc_uni_pel_pixels32_8_avx2; - c->put_hevc_epel_uni[6][0][0] = ff_hevc_put_hevc_uni_pel_pixels48_8_avx2; - c->put_hevc_epel_uni[7][0][0] = ff_hevc_put_hevc_uni_pel_pixels64_8_avx2; - c->put_hevc_epel_uni[8][0][0] = ff_hevc_put_hevc_uni_pel_pixels96_8_avx2; - c->put_hevc_epel_uni[9][0][0] = ff_hevc_put_hevc_uni_pel_pixels128_8_avx2; + c->put_hevc_epel_uni[5][0][0] = ff_hevc_put_hevc_uni_pel_pixels32_8_avx2; + c->put_hevc_epel_uni[6][0][0] = ff_hevc_put_hevc_uni_pel_pixels48_8_avx2; + c->put_hevc_epel_uni[7][0][0] = ff_hevc_put_hevc_uni_pel_pixels64_8_avx2; + c->put_hevc_epel_uni[8][0][0] = ff_hevc_put_hevc_uni_pel_pixels96_8_avx2; + c->put_hevc_epel_uni[9][0][0] = ff_hevc_put_hevc_uni_pel_pixels128_8_avx2; - c->put_hevc_qpel_uni[5][0][0] = ff_hevc_put_hevc_uni_pel_pixels32_8_avx2; - c->put_hevc_qpel_uni[6][0][0] = ff_hevc_put_hevc_uni_pel_pixels48_8_avx2; - c->put_hevc_qpel_uni[7][0][0] = ff_hevc_put_hevc_uni_pel_pixels64_8_avx2; - c->put_hevc_qpel_uni[8][0][0] = ff_hevc_put_hevc_uni_pel_pixels96_8_avx2; - c->put_hevc_qpel_uni[9][0][0] = ff_hevc_put_hevc_uni_pel_pixels128_8_avx2; + c->put_hevc_qpel_uni[5][0][0] = ff_hevc_put_hevc_uni_pel_pixels32_8_avx2; + c->put_hevc_qpel_uni[6][0][0] = ff_hevc_put_hevc_uni_pel_pixels48_8_avx2; + c->put_hevc_qpel_uni[7][0][0] = ff_hevc_put_hevc_uni_pel_pixels64_8_avx2; + c->put_hevc_qpel_uni[8][0][0] = ff_hevc_put_hevc_uni_pel_pixels96_8_avx2; + c->put_hevc_qpel_uni[9][0][0] = ff_hevc_put_hevc_uni_pel_pixels128_8_avx2; - c->put_hevc_epel_bi[5][0][0] = ff_hevc_put_hevc_bi_pel_pixels16_10_avx2; - c->put_hevc_epel_bi[6][0][0] = ff_hevc_put_hevc_bi_pel_pixels24_10_avx2; - c->put_hevc_epel_bi[7][0][0] = ff_hevc_put_hevc_bi_pel_pixels32_10_avx2; - c->put_hevc_epel_bi[8][0][0] = ff_hevc_put_hevc_bi_pel_pixels48_10_avx2; - c->put_hevc_epel_bi[9][0][0] = ff_hevc_put_hevc_bi_pel_pixels64_10_avx2; - c->put_hevc_qpel_bi[5][0][0] = ff_hevc_put_hevc_bi_pel_pixels16_10_avx2; - c->put_hevc_qpel_bi[6][0][0] = ff_hevc_put_hevc_bi_pel_pixels24_10_avx2; - c->put_hevc_qpel_bi[7][0][0] = ff_hevc_put_hevc_bi_pel_pixels32_10_avx2; - c->put_hevc_qpel_bi[8][0][0] = ff_hevc_put_hevc_bi_pel_pixels48_10_avx2; - c->put_hevc_qpel_bi[9][0][0] = ff_hevc_put_hevc_bi_pel_pixels64_10_avx2; + c->put_hevc_epel_bi[5][0][0] = ff_hevc_put_hevc_bi_pel_pixels16_10_avx2; + c->put_hevc_epel_bi[6][0][0] = ff_hevc_put_hevc_bi_pel_pixels24_10_avx2; + c->put_hevc_epel_bi[7][0][0] = ff_hevc_put_hevc_bi_pel_pixels32_10_avx2; + c->put_hevc_epel_bi[8][0][0] = ff_hevc_put_hevc_bi_pel_pixels48_10_avx2; + c->put_hevc_epel_bi[9][0][0] = ff_hevc_put_hevc_bi_pel_pixels64_10_avx2; + c->put_hevc_qpel_bi[5][0][0] = ff_hevc_put_hevc_bi_pel_pixels16_10_avx2; + c->put_hevc_qpel_bi[6][0][0] = ff_hevc_put_hevc_bi_pel_pixels24_10_avx2; + c->put_hevc_qpel_bi[7][0][0] = ff_hevc_put_hevc_bi_pel_pixels32_10_avx2; + c->put_hevc_qpel_bi[8][0][0] = ff_hevc_put_hevc_bi_pel_pixels48_10_avx2; + c->put_hevc_qpel_bi[9][0][0] = ff_hevc_put_hevc_bi_pel_pixels64_10_avx2; - c->put_hevc_epel[5][0][1] = ff_hevc_put_hevc_epel_h16_10_avx2; - c->put_hevc_epel[6][0][1] = ff_hevc_put_hevc_epel_h24_10_avx2; - c->put_hevc_epel[7][0][1] = ff_hevc_put_hevc_epel_h32_10_avx2; - c->put_hevc_epel[8][0][1] = ff_hevc_put_hevc_epel_h48_10_avx2; - c->put_hevc_epel[9][0][1] = ff_hevc_put_hevc_epel_h64_10_avx2; + c->put_hevc_epel[5][0][1] = ff_hevc_put_hevc_epel_h16_10_avx2; + c->put_hevc_epel[6][0][1] = ff_hevc_put_hevc_epel_h24_10_avx2; + c->put_hevc_epel[7][0][1] = ff_hevc_put_hevc_epel_h32_10_avx2; + c->put_hevc_epel[8][0][1] = ff_hevc_put_hevc_epel_h48_10_avx2; + c->put_hevc_epel[9][0][1] = ff_hevc_put_hevc_epel_h64_10_avx2; - c->put_hevc_epel_uni[5][0][1] = ff_hevc_put_hevc_uni_epel_h16_10_avx2; - c->put_hevc_epel_uni[6][0][1] = ff_hevc_put_hevc_uni_epel_h24_10_avx2; - c->put_hevc_epel_uni[7][0][1] = ff_hevc_put_hevc_uni_epel_h32_10_avx2; - c->put_hevc_epel_uni[8][0][1] = ff_hevc_put_hevc_uni_epel_h48_10_avx2; - c->put_hevc_epel_uni[9][0][1] = ff_hevc_put_hevc_uni_epel_h64_10_avx2; + c->put_hevc_epel_uni[5][0][1] = ff_hevc_put_hevc_uni_epel_h16_10_avx2; + c->put_hevc_epel_uni[6][0][1] = ff_hevc_put_hevc_uni_epel_h24_10_avx2; + c->put_hevc_epel_uni[7][0][1] = ff_hevc_put_hevc_uni_epel_h32_10_avx2; + c->put_hevc_epel_uni[8][0][1] = ff_hevc_put_hevc_uni_epel_h48_10_avx2; + c->put_hevc_epel_uni[9][0][1] = ff_hevc_put_hevc_uni_epel_h64_10_avx2; - c->put_hevc_epel_bi[5][0][1] = ff_hevc_put_hevc_bi_epel_h16_10_avx2; - c->put_hevc_epel_bi[6][0][1] = ff_hevc_put_hevc_bi_epel_h24_10_avx2; - c->put_hevc_epel_bi[7][0][1] = ff_hevc_put_hevc_bi_epel_h32_10_avx2; - c->put_hevc_epel_bi[8][0][1] = ff_hevc_put_hevc_bi_epel_h48_10_avx2; - c->put_hevc_epel_bi[9][0][1] = ff_hevc_put_hevc_bi_epel_h64_10_avx2; + c->put_hevc_epel_bi[5][0][1] = ff_hevc_put_hevc_bi_epel_h16_10_avx2; + c->put_hevc_epel_bi[6][0][1] = ff_hevc_put_hevc_bi_epel_h24_10_avx2; + c->put_hevc_epel_bi[7][0][1] = ff_hevc_put_hevc_bi_epel_h32_10_avx2; + c->put_hevc_epel_bi[8][0][1] = ff_hevc_put_hevc_bi_epel_h48_10_avx2; + c->put_hevc_epel_bi[9][0][1] = ff_hevc_put_hevc_bi_epel_h64_10_avx2; - c->put_hevc_epel[5][1][0] = ff_hevc_put_hevc_epel_v16_10_avx2; - c->put_hevc_epel[6][1][0] = ff_hevc_put_hevc_epel_v24_10_avx2; - c->put_hevc_epel[7][1][0] = ff_hevc_put_hevc_epel_v32_10_avx2; - c->put_hevc_epel[8][1][0] = ff_hevc_put_hevc_epel_v48_10_avx2; - c->put_hevc_epel[9][1][0] = ff_hevc_put_hevc_epel_v64_10_avx2; + c->put_hevc_epel[5][1][0] = ff_hevc_put_hevc_epel_v16_10_avx2; + c->put_hevc_epel[6][1][0] = ff_hevc_put_hevc_epel_v24_10_avx2; + c->put_hevc_epel[7][1][0] = ff_hevc_put_hevc_epel_v32_10_avx2; + c->put_hevc_epel[8][1][0] = ff_hevc_put_hevc_epel_v48_10_avx2; + c->put_hevc_epel[9][1][0] = ff_hevc_put_hevc_epel_v64_10_avx2; - c->put_hevc_epel_uni[5][1][0] = ff_hevc_put_hevc_uni_epel_v16_10_avx2; - c->put_hevc_epel_uni[6][1][0] = ff_hevc_put_hevc_uni_epel_v24_10_avx2; - c->put_hevc_epel_uni[7][1][0] = ff_hevc_put_hevc_uni_epel_v32_10_avx2; - c->put_hevc_epel_uni[8][1][0] = ff_hevc_put_hevc_uni_epel_v48_10_avx2; - c->put_hevc_epel_uni[9][1][0] = ff_hevc_put_hevc_uni_epel_v64_10_avx2; + c->put_hevc_epel_uni[5][1][0] = ff_hevc_put_hevc_uni_epel_v16_10_avx2; + c->put_hevc_epel_uni[6][1][0] = ff_hevc_put_hevc_uni_epel_v24_10_avx2; + c->put_hevc_epel_uni[7][1][0] = ff_hevc_put_hevc_uni_epel_v32_10_avx2; + c->put_hevc_epel_uni[8][1][0] = ff_hevc_put_hevc_uni_epel_v48_10_avx2; + c->put_hevc_epel_uni[9][1][0] = ff_hevc_put_hevc_uni_epel_v64_10_avx2; - c->put_hevc_epel_bi[5][1][0] = ff_hevc_put_hevc_bi_epel_v16_10_avx2; - c->put_hevc_epel_bi[6][1][0] = ff_hevc_put_hevc_bi_epel_v24_10_avx2; - c->put_hevc_epel_bi[7][1][0] = ff_hevc_put_hevc_bi_epel_v32_10_avx2; - c->put_hevc_epel_bi[8][1][0] = ff_hevc_put_hevc_bi_epel_v48_10_avx2; - c->put_hevc_epel_bi[9][1][0] = ff_hevc_put_hevc_bi_epel_v64_10_avx2; + c->put_hevc_epel_bi[5][1][0] = ff_hevc_put_hevc_bi_epel_v16_10_avx2; + c->put_hevc_epel_bi[6][1][0] = ff_hevc_put_hevc_bi_epel_v24_10_avx2; + c->put_hevc_epel_bi[7][1][0] = ff_hevc_put_hevc_bi_epel_v32_10_avx2; + c->put_hevc_epel_bi[8][1][0] = ff_hevc_put_hevc_bi_epel_v48_10_avx2; + c->put_hevc_epel_bi[9][1][0] = ff_hevc_put_hevc_bi_epel_v64_10_avx2; - c->put_hevc_epel[5][1][1] = ff_hevc_put_hevc_epel_hv16_10_avx2; - c->put_hevc_epel[6][1][1] = ff_hevc_put_hevc_epel_hv24_10_avx2; - c->put_hevc_epel[7][1][1] = ff_hevc_put_hevc_epel_hv32_10_avx2; - c->put_hevc_epel[8][1][1] = ff_hevc_put_hevc_epel_hv48_10_avx2; - c->put_hevc_epel[9][1][1] = ff_hevc_put_hevc_epel_hv64_10_avx2; + c->put_hevc_epel[5][1][1] = ff_hevc_put_hevc_epel_hv16_10_avx2; + c->put_hevc_epel[6][1][1] = ff_hevc_put_hevc_epel_hv24_10_avx2; + c->put_hevc_epel[7][1][1] = ff_hevc_put_hevc_epel_hv32_10_avx2; + c->put_hevc_epel[8][1][1] = ff_hevc_put_hevc_epel_hv48_10_avx2; + c->put_hevc_epel[9][1][1] = ff_hevc_put_hevc_epel_hv64_10_avx2; - c->put_hevc_epel_uni[5][1][1] = ff_hevc_put_hevc_uni_epel_hv16_10_avx2; - c->put_hevc_epel_uni[6][1][1] = ff_hevc_put_hevc_uni_epel_hv24_10_avx2; - c->put_hevc_epel_uni[7][1][1] = ff_hevc_put_hevc_uni_epel_hv32_10_avx2; - c->put_hevc_epel_uni[8][1][1] = ff_hevc_put_hevc_uni_epel_hv48_10_avx2; - c->put_hevc_epel_uni[9][1][1] = ff_hevc_put_hevc_uni_epel_hv64_10_avx2; + c->put_hevc_epel_uni[5][1][1] = ff_hevc_put_hevc_uni_epel_hv16_10_avx2; + c->put_hevc_epel_uni[6][1][1] = ff_hevc_put_hevc_uni_epel_hv24_10_avx2; + c->put_hevc_epel_uni[7][1][1] = ff_hevc_put_hevc_uni_epel_hv32_10_avx2; + c->put_hevc_epel_uni[8][1][1] = ff_hevc_put_hevc_uni_epel_hv48_10_avx2; + c->put_hevc_epel_uni[9][1][1] = ff_hevc_put_hevc_uni_epel_hv64_10_avx2; - c->put_hevc_epel_bi[5][1][1] = ff_hevc_put_hevc_bi_epel_hv16_10_avx2; - c->put_hevc_epel_bi[6][1][1] = ff_hevc_put_hevc_bi_epel_hv24_10_avx2; - c->put_hevc_epel_bi[7][1][1] = ff_hevc_put_hevc_bi_epel_hv32_10_avx2; - c->put_hevc_epel_bi[8][1][1] = ff_hevc_put_hevc_bi_epel_hv48_10_avx2; - c->put_hevc_epel_bi[9][1][1] = ff_hevc_put_hevc_bi_epel_hv64_10_avx2; + c->put_hevc_epel_bi[5][1][1] = ff_hevc_put_hevc_bi_epel_hv16_10_avx2; + c->put_hevc_epel_bi[6][1][1] = ff_hevc_put_hevc_bi_epel_hv24_10_avx2; + c->put_hevc_epel_bi[7][1][1] = ff_hevc_put_hevc_bi_epel_hv32_10_avx2; + c->put_hevc_epel_bi[8][1][1] = ff_hevc_put_hevc_bi_epel_hv48_10_avx2; + c->put_hevc_epel_bi[9][1][1] = ff_hevc_put_hevc_bi_epel_hv64_10_avx2; - c->put_hevc_qpel[5][0][1] = ff_hevc_put_hevc_qpel_h16_10_avx2; - c->put_hevc_qpel[6][0][1] = ff_hevc_put_hevc_qpel_h24_10_avx2; - c->put_hevc_qpel[7][0][1] = ff_hevc_put_hevc_qpel_h32_10_avx2; - c->put_hevc_qpel[8][0][1] = ff_hevc_put_hevc_qpel_h48_10_avx2; - c->put_hevc_qpel[9][0][1] = ff_hevc_put_hevc_qpel_h64_10_avx2; + c->put_hevc_qpel[5][0][1] = ff_hevc_put_hevc_qpel_h16_10_avx2; + c->put_hevc_qpel[6][0][1] = ff_hevc_put_hevc_qpel_h24_10_avx2; + c->put_hevc_qpel[7][0][1] = ff_hevc_put_hevc_qpel_h32_10_avx2; + c->put_hevc_qpel[8][0][1] = ff_hevc_put_hevc_qpel_h48_10_avx2; + c->put_hevc_qpel[9][0][1] = ff_hevc_put_hevc_qpel_h64_10_avx2; - c->put_hevc_qpel_uni[5][0][1] = ff_hevc_put_hevc_uni_qpel_h16_10_avx2; - c->put_hevc_qpel_uni[6][0][1] = ff_hevc_put_hevc_uni_qpel_h24_10_avx2; - c->put_hevc_qpel_uni[7][0][1] = ff_hevc_put_hevc_uni_qpel_h32_10_avx2; - c->put_hevc_qpel_uni[8][0][1] = ff_hevc_put_hevc_uni_qpel_h48_10_avx2; - c->put_hevc_qpel_uni[9][0][1] = ff_hevc_put_hevc_uni_qpel_h64_10_avx2; + c->put_hevc_qpel_uni[5][0][1] = ff_hevc_put_hevc_uni_qpel_h16_10_avx2; + c->put_hevc_qpel_uni[6][0][1] = ff_hevc_put_hevc_uni_qpel_h24_10_avx2; + c->put_hevc_qpel_uni[7][0][1] = ff_hevc_put_hevc_uni_qpel_h32_10_avx2; + c->put_hevc_qpel_uni[8][0][1] = ff_hevc_put_hevc_uni_qpel_h48_10_avx2; + c->put_hevc_qpel_uni[9][0][1] = ff_hevc_put_hevc_uni_qpel_h64_10_avx2; - c->put_hevc_qpel_bi[5][0][1] = ff_hevc_put_hevc_bi_qpel_h16_10_avx2; - c->put_hevc_qpel_bi[6][0][1] = ff_hevc_put_hevc_bi_qpel_h24_10_avx2; - c->put_hevc_qpel_bi[7][0][1] = ff_hevc_put_hevc_bi_qpel_h32_10_avx2; - c->put_hevc_qpel_bi[8][0][1] = ff_hevc_put_hevc_bi_qpel_h48_10_avx2; - c->put_hevc_qpel_bi[9][0][1] = ff_hevc_put_hevc_bi_qpel_h64_10_avx2; + c->put_hevc_qpel_bi[5][0][1] = ff_hevc_put_hevc_bi_qpel_h16_10_avx2; + c->put_hevc_qpel_bi[6][0][1] = ff_hevc_put_hevc_bi_qpel_h24_10_avx2; + c->put_hevc_qpel_bi[7][0][1] = ff_hevc_put_hevc_bi_qpel_h32_10_avx2; + c->put_hevc_qpel_bi[8][0][1] = ff_hevc_put_hevc_bi_qpel_h48_10_avx2; + c->put_hevc_qpel_bi[9][0][1] = ff_hevc_put_hevc_bi_qpel_h64_10_avx2; - c->put_hevc_qpel[5][1][0] = ff_hevc_put_hevc_qpel_v16_10_avx2; - c->put_hevc_qpel[6][1][0] = ff_hevc_put_hevc_qpel_v24_10_avx2; - c->put_hevc_qpel[7][1][0] = ff_hevc_put_hevc_qpel_v32_10_avx2; - c->put_hevc_qpel[8][1][0] = ff_hevc_put_hevc_qpel_v48_10_avx2; - c->put_hevc_qpel[9][1][0] = ff_hevc_put_hevc_qpel_v64_10_avx2; + c->put_hevc_qpel[5][1][0] = ff_hevc_put_hevc_qpel_v16_10_avx2; + c->put_hevc_qpel[6][1][0] = ff_hevc_put_hevc_qpel_v24_10_avx2; + c->put_hevc_qpel[7][1][0] = ff_hevc_put_hevc_qpel_v32_10_avx2; + c->put_hevc_qpel[8][1][0] = ff_hevc_put_hevc_qpel_v48_10_avx2; + c->put_hevc_qpel[9][1][0] = ff_hevc_put_hevc_qpel_v64_10_avx2; - c->put_hevc_qpel_uni[5][1][0] = ff_hevc_put_hevc_uni_qpel_v16_10_avx2; - c->put_hevc_qpel_uni[6][1][0] = ff_hevc_put_hevc_uni_qpel_v24_10_avx2; - c->put_hevc_qpel_uni[7][1][0] = ff_hevc_put_hevc_uni_qpel_v32_10_avx2; - c->put_hevc_qpel_uni[8][1][0] = ff_hevc_put_hevc_uni_qpel_v48_10_avx2; - c->put_hevc_qpel_uni[9][1][0] = ff_hevc_put_hevc_uni_qpel_v64_10_avx2; + c->put_hevc_qpel_uni[5][1][0] = ff_hevc_put_hevc_uni_qpel_v16_10_avx2; + c->put_hevc_qpel_uni[6][1][0] = ff_hevc_put_hevc_uni_qpel_v24_10_avx2; + c->put_hevc_qpel_uni[7][1][0] = ff_hevc_put_hevc_uni_qpel_v32_10_avx2; + c->put_hevc_qpel_uni[8][1][0] = ff_hevc_put_hevc_uni_qpel_v48_10_avx2; + c->put_hevc_qpel_uni[9][1][0] = ff_hevc_put_hevc_uni_qpel_v64_10_avx2; - c->put_hevc_qpel_bi[5][1][0] = ff_hevc_put_hevc_bi_qpel_v16_10_avx2; - c->put_hevc_qpel_bi[6][1][0] = ff_hevc_put_hevc_bi_qpel_v24_10_avx2; - c->put_hevc_qpel_bi[7][1][0] = ff_hevc_put_hevc_bi_qpel_v32_10_avx2; - c->put_hevc_qpel_bi[8][1][0] = ff_hevc_put_hevc_bi_qpel_v48_10_avx2; - c->put_hevc_qpel_bi[9][1][0] = ff_hevc_put_hevc_bi_qpel_v64_10_avx2; + c->put_hevc_qpel_bi[5][1][0] = ff_hevc_put_hevc_bi_qpel_v16_10_avx2; + c->put_hevc_qpel_bi[6][1][0] = ff_hevc_put_hevc_bi_qpel_v24_10_avx2; + c->put_hevc_qpel_bi[7][1][0] = ff_hevc_put_hevc_bi_qpel_v32_10_avx2; + c->put_hevc_qpel_bi[8][1][0] = ff_hevc_put_hevc_bi_qpel_v48_10_avx2; + c->put_hevc_qpel_bi[9][1][0] = ff_hevc_put_hevc_bi_qpel_v64_10_avx2; - c->put_hevc_qpel[5][1][1] = ff_hevc_put_hevc_qpel_hv16_10_avx2; - c->put_hevc_qpel[6][1][1] = ff_hevc_put_hevc_qpel_hv24_10_avx2; - c->put_hevc_qpel[7][1][1] = ff_hevc_put_hevc_qpel_hv32_10_avx2; - c->put_hevc_qpel[8][1][1] = ff_hevc_put_hevc_qpel_hv48_10_avx2; - c->put_hevc_qpel[9][1][1] = ff_hevc_put_hevc_qpel_hv64_10_avx2; + c->put_hevc_qpel[5][1][1] = ff_hevc_put_hevc_qpel_hv16_10_avx2; + c->put_hevc_qpel[6][1][1] = ff_hevc_put_hevc_qpel_hv24_10_avx2; + c->put_hevc_qpel[7][1][1] = ff_hevc_put_hevc_qpel_hv32_10_avx2; + c->put_hevc_qpel[8][1][1] = ff_hevc_put_hevc_qpel_hv48_10_avx2; + c->put_hevc_qpel[9][1][1] = ff_hevc_put_hevc_qpel_hv64_10_avx2; - c->put_hevc_qpel_uni[5][1][1] = ff_hevc_put_hevc_uni_qpel_hv16_10_avx2; - c->put_hevc_qpel_uni[6][1][1] = ff_hevc_put_hevc_uni_qpel_hv24_10_avx2; - c->put_hevc_qpel_uni[7][1][1] = ff_hevc_put_hevc_uni_qpel_hv32_10_avx2; - c->put_hevc_qpel_uni[8][1][1] = ff_hevc_put_hevc_uni_qpel_hv48_10_avx2; - c->put_hevc_qpel_uni[9][1][1] = ff_hevc_put_hevc_uni_qpel_hv64_10_avx2; + c->put_hevc_qpel_uni[5][1][1] = ff_hevc_put_hevc_uni_qpel_hv16_10_avx2; + c->put_hevc_qpel_uni[6][1][1] = ff_hevc_put_hevc_uni_qpel_hv24_10_avx2; + c->put_hevc_qpel_uni[7][1][1] = ff_hevc_put_hevc_uni_qpel_hv32_10_avx2; + c->put_hevc_qpel_uni[8][1][1] = ff_hevc_put_hevc_uni_qpel_hv48_10_avx2; + c->put_hevc_qpel_uni[9][1][1] = ff_hevc_put_hevc_uni_qpel_hv64_10_avx2; - c->put_hevc_qpel_bi[5][1][1] = ff_hevc_put_hevc_bi_qpel_hv16_10_avx2; - c->put_hevc_qpel_bi[6][1][1] = ff_hevc_put_hevc_bi_qpel_hv24_10_avx2; - c->put_hevc_qpel_bi[7][1][1] = ff_hevc_put_hevc_bi_qpel_hv32_10_avx2; - c->put_hevc_qpel_bi[8][1][1] = ff_hevc_put_hevc_bi_qpel_hv48_10_avx2; - c->put_hevc_qpel_bi[9][1][1] = ff_hevc_put_hevc_bi_qpel_hv64_10_avx2; - } + c->put_hevc_qpel_bi[5][1][1] = ff_hevc_put_hevc_bi_qpel_hv16_10_avx2; + c->put_hevc_qpel_bi[6][1][1] = ff_hevc_put_hevc_bi_qpel_hv24_10_avx2; + c->put_hevc_qpel_bi[7][1][1] = ff_hevc_put_hevc_bi_qpel_hv32_10_avx2; + c->put_hevc_qpel_bi[8][1][1] = ff_hevc_put_hevc_bi_qpel_hv48_10_avx2; + c->put_hevc_qpel_bi[9][1][1] = ff_hevc_put_hevc_bi_qpel_hv64_10_avx2; +#endif SAO_BAND_INIT(10, avx2); SAO_EDGE_INIT(10, avx2); @@ -1099,10 +1102,10 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth) if (EXTERNAL_SSE2(cpu_flags)) { c->hevc_v_loop_filter_chroma = ff_hevc_v_loop_filter_chroma_12_sse2; c->hevc_h_loop_filter_chroma = ff_hevc_h_loop_filter_chroma_12_sse2; - if (ARCH_X86_64) { - c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_12_sse2; - c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_12_sse2; - } +#if ARCH_X86_64 + c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_12_sse2; + c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_12_sse2; +#endif SAO_BAND_INIT(12, sse2); SAO_EDGE_INIT(12, sse2); @@ -1110,11 +1113,12 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth) c->idct_dc[2] = ff_hevc_idct_16x16_dc_12_sse2; c->idct_dc[3] = ff_hevc_idct_32x32_dc_12_sse2; } - if (EXTERNAL_SSSE3(cpu_flags) && ARCH_X86_64) { +#if ARCH_X86_64 + if (EXTERNAL_SSSE3(cpu_flags)) { c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_12_ssse3; c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_12_ssse3; } - if (EXTERNAL_SSE4(cpu_flags) && ARCH_X86_64) { + if (EXTERNAL_SSE4(cpu_flags)) { EPEL_LINKS(c->put_hevc_epel, 0, 0, pel_pixels, 12, sse4); EPEL_LINKS(c->put_hevc_epel, 0, 1, epel_h, 12, sse4); EPEL_LINKS(c->put_hevc_epel, 1, 0, epel_v, 12, sse4); @@ -1125,13 +1129,14 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth) QPEL_LINKS(c->put_hevc_qpel, 1, 0, qpel_v, 12, sse4); QPEL_LINKS(c->put_hevc_qpel, 1, 1, qpel_hv, 12, sse4); } +#endif if (EXTERNAL_AVX(cpu_flags)) { c->hevc_v_loop_filter_chroma = ff_hevc_v_loop_filter_chroma_12_avx; c->hevc_h_loop_filter_chroma = ff_hevc_h_loop_filter_chroma_12_avx; - if (ARCH_X86_64) { - c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_12_avx; - c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_12_avx; - } +#if ARCH_X86_64 + c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_12_avx; + c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_12_avx; +#endif SAO_BAND_INIT(12, avx); } if (EXTERNAL_AVX2(cpu_flags)) { diff --git a/libavcodec/x86/idctdsp_init.c b/libavcodec/x86/idctdsp_init.c index f28a1ad744..4ade52a880 100644 --- a/libavcodec/x86/idctdsp_init.c +++ b/libavcodec/x86/idctdsp_init.c @@ -92,8 +92,8 @@ av_cold void ff_idctdsp_init_x86(IDCTDSPContext *c, AVCodecContext *avctx, } #endif - if (ARCH_X86_64 && - !high_bit_depth && +#if ARCH_X86_64 + if (!high_bit_depth && avctx->lowres == 0 && (avctx->idct_algo == FF_IDCT_AUTO || avctx->idct_algo == FF_IDCT_SIMPLEAUTO || @@ -104,9 +104,11 @@ av_cold void ff_idctdsp_init_x86(IDCTDSPContext *c, AVCodecContext *avctx, c->idct_add = ff_simple_idct8_add_sse2; c->perm_type = FF_IDCT_PERM_TRANSPOSE; } +#endif } - if (ARCH_X86_64 && avctx->lowres == 0) { +#if ARCH_X86_64 + if (avctx->lowres == 0) { if (EXTERNAL_AVX(cpu_flags) && !high_bit_depth && (avctx->idct_algo == FF_IDCT_AUTO || @@ -156,4 +158,5 @@ av_cold void ff_idctdsp_init_x86(IDCTDSPContext *c, AVCodecContext *avctx, } } } +#endif } diff --git a/libavcodec/x86/mlpdsp_init.c b/libavcodec/x86/mlpdsp_init.c index 950f996832..333a685f47 100644 --- a/libavcodec/x86/mlpdsp_init.c +++ b/libavcodec/x86/mlpdsp_init.c @@ -200,8 +200,10 @@ av_cold void ff_mlpdsp_init_x86(MLPDSPContext *c) if (INLINE_MMX(cpu_flags)) c->mlp_filter_channel = mlp_filter_channel_x86; #endif - if (ARCH_X86_64 && EXTERNAL_SSE4(cpu_flags)) +#if ARCH_X86_64 + if (EXTERNAL_SSE4(cpu_flags)) c->mlp_rematrix_channel = ff_mlp_rematrix_channel_sse4; - if (ARCH_X86_64 && EXTERNAL_AVX2_FAST(cpu_flags) && cpu_flags & AV_CPU_FLAG_BMI2) + if (EXTERNAL_AVX2_FAST(cpu_flags) && cpu_flags & AV_CPU_FLAG_BMI2) c->mlp_rematrix_channel = ff_mlp_rematrix_channel_avx2_bmi2; +#endif } diff --git a/libavcodec/x86/vc1dsp_init.c b/libavcodec/x86/vc1dsp_init.c index 90b2f3624e..bc63933e83 100644 --- a/libavcodec/x86/vc1dsp_init.c +++ b/libavcodec/x86/vc1dsp_init.c @@ -102,13 +102,15 @@ av_cold void ff_vc1dsp_init_x86(VC1DSPContext *dsp) { int cpu_flags = av_get_cpu_flags(); - if (HAVE_6REGS && INLINE_MMX(cpu_flags)) +#if HAVE_6REGS + if (INLINE_MMX(cpu_flags)) if (EXTERNAL_MMX(cpu_flags)) ff_vc1dsp_init_mmx(dsp); - if (HAVE_6REGS && INLINE_MMXEXT(cpu_flags)) + if (INLINE_MMXEXT(cpu_flags)) if (EXTERNAL_MMXEXT(cpu_flags)) ff_vc1dsp_init_mmxext(dsp); +#endif #define ASSIGN_LF4(EXT) \ dsp->vc1_v_loop_filter4 = ff_vc1_v_loop_filter4_ ## EXT; \ diff --git a/libavfilter/x86/colorspacedsp_init.c b/libavfilter/x86/colorspacedsp_init.c index b5006ac295..f01db4baf4 100644 --- a/libavfilter/x86/colorspacedsp_init.c +++ b/libavfilter/x86/colorspacedsp_init.c @@ -80,7 +80,8 @@ void ff_colorspacedsp_x86_init(ColorSpaceDSPContext *dsp) { int cpu_flags = av_get_cpu_flags(); - if (ARCH_X86_64 && EXTERNAL_SSE2(cpu_flags)) { +#if ARCH_X86_64 + if (EXTERNAL_SSE2(cpu_flags)) { #define assign_yuv2yuv_fns(ss) \ dsp->yuv2yuv[BPP_8 ][BPP_8 ][SS_##ss] = ff_yuv2yuv_##ss##p8to8_sse2; \ dsp->yuv2yuv[BPP_8 ][BPP_10][SS_##ss] = ff_yuv2yuv_##ss##p8to10_sse2; \ @@ -116,4 +117,5 @@ void ff_colorspacedsp_x86_init(ColorSpaceDSPContext *dsp) dsp->multiply3x3 = ff_multiply3x3_sse2; } +#endif } diff --git a/libavfilter/x86/vf_atadenoise_init.c b/libavfilter/x86/vf_atadenoise_init.c index e7a653f191..eb621e172c 100644 --- a/libavfilter/x86/vf_atadenoise_init.c +++ b/libavfilter/x86/vf_atadenoise_init.c @@ -39,12 +39,14 @@ av_cold void ff_atadenoise_init_x86(ATADenoiseDSPContext *dsp, int depth, int al int cpu_flags = av_get_cpu_flags(); for (int p = 0; p < 4; p++) { - if (ARCH_X86_64 && EXTERNAL_SSE4(cpu_flags) && depth <= 8 && algorithm == PARALLEL && sigma[p] == INT16_MAX) { +#if ARCH_X86_64 + if (EXTERNAL_SSE4(cpu_flags) && depth <= 8 && algorithm == PARALLEL && sigma[p] == INT16_MAX) { dsp->filter_row[p] = ff_atadenoise_filter_row8_sse4; } - if (ARCH_X86_64 && EXTERNAL_SSE4(cpu_flags) && depth <= 8 && algorithm == SERIAL && sigma[p] == INT16_MAX) { + if (EXTERNAL_SSE4(cpu_flags) && depth <= 8 && algorithm == SERIAL && sigma[p] == INT16_MAX) { dsp->filter_row[p] = ff_atadenoise_filter_row8_serial_sse4; } +#endif } } diff --git a/libavfilter/x86/vf_ssim_init.c b/libavfilter/x86/vf_ssim_init.c index cbaa20ef16..ddc91f791a 100644 --- a/libavfilter/x86/vf_ssim_init.c +++ b/libavfilter/x86/vf_ssim_init.c @@ -34,8 +34,10 @@ void ff_ssim_init_x86(SSIMDSPContext *dsp) { int cpu_flags = av_get_cpu_flags(); - if (ARCH_X86_64 && EXTERNAL_SSSE3(cpu_flags)) - dsp->ssim_4x4_line = ff_ssim_4x4_line_ssse3; +#if ARCH_X86_64 + if (EXTERNAL_SSSE3(cpu_flags)) + dsp->ssim_4x4_line = ff_ssim_4x4_line_ssse3; +#endif if (EXTERNAL_SSE4(cpu_flags)) dsp->ssim_end_line = ff_ssim_end_line_sse4; if (EXTERNAL_XOP(cpu_flags)) diff --git a/libavfilter/x86/vf_w3fdif_init.c b/libavfilter/x86/vf_w3fdif_init.c index 16202fba76..6d677d651d 100644 --- a/libavfilter/x86/vf_w3fdif_init.c +++ b/libavfilter/x86/vf_w3fdif_init.c @@ -56,7 +56,9 @@ av_cold void ff_w3fdif_init_x86(W3FDIFDSPContext *dsp, int depth) dsp->filter_scale = ff_w3fdif_scale_sse2; } - if (ARCH_X86_64 && EXTERNAL_SSE2(cpu_flags) && depth <= 8) { +#if ARCH_X86_64 + if (EXTERNAL_SSE2(cpu_flags) && depth <= 8) { dsp->filter_complex_high = ff_w3fdif_complex_high_sse2; } +#endif } From patchwork Tue Nov 1 21:59:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "L. E. Segovia" X-Patchwork-Id: 39105 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:999a:b0:a4:2148:650a with SMTP id ve26csp430258pzb; Tue, 1 Nov 2022 15:00:30 -0700 (PDT) X-Google-Smtp-Source: AMsMyM66VVUAupBXcV5YdNrnq0MNYGO6z8upsMIkVvAM6z9ZySTq1Fgbe/uXl6+MgvhkpoumfEzm X-Received: by 2002:a17:906:db03:b0:741:337e:3600 with SMTP id xj3-20020a170906db0300b00741337e3600mr20986813ejb.343.1667340030384; Tue, 01 Nov 2022 15:00:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667340030; cv=none; d=google.com; s=arc-20160816; b=xEWPQeeL0RNJVD4bQ95Dzy2fou8Ynjo2cDDqXz02s4tyu4sBmnLz9sv3nzeOu1D/TO aiNaDVr//by8erkih8hHQYGG4YUXdLPOq2/TYhMqb4FIFM69iqr7V/ksT2vXy1dNDMeL +bD/8sq8tK2vWSeBW7QcF5X7lFQ6nlp1uzWf5hND6Ofnb2pkBNChv11G0aTbxzqQ4rHt sohnxejtzm3ADQwCmXGwS20InNRyNX3bAfr6lx3pX3N06KYK039rYlrArFfowj7HWS23 HVdDkOdP42xVHVMMcfzf+vL8yJwBiP7VlKkPY6XLK+hgLbSj8cYEpiWG+m3o9dSVjOkb mibA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=sTyhK9H5qIHuUSeoX9OJlAIUK8I3OFAkwowl4IhA3xA=; b=Y+qb1t1Z73NSnq4pyeL6XcFGOgfUlNC/efz9O52gBtws6EtNEiqa+TTJEAMbhHFcpk 18voGMrwCzen4cZDnvrslszOomlOUhuhgVrB32vi029iqcOnfosObVf6aEiL7N764pvj 93OM511/y5U5GFePE5Bu9hphZHVuNWUI90AfEJ/qizLoXsaFT6qUlB7vtsZ9YMaJBqhO tz8m0R+Q4q2vhq3bSqBu8xUFOyn3aTITsBB6Mp/x9W7bLrbjLX4kpY66C6zG9oGdRfEB p7ZYe0CaVe6bHSCx3nvTa+AnHi8vHh0vF9FKWIbbRmVo5HJIxQkGq6efXmh1oMXA19Lv Wowg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@amyspark.me header.s=gm1 header.b=MRarz76k; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amyspark.me Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id w16-20020a056402269000b0046363151bd1si10533658edd.615.2022.11.01.15.00.29; Tue, 01 Nov 2022 15:00:30 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@amyspark.me header.s=gm1 header.b=MRarz76k; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amyspark.me Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id EE5CA689965; Wed, 2 Nov 2022 00:00:16 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay11.mail.gandi.net (relay11.mail.gandi.net [217.70.178.231]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5338268BE7A for ; Wed, 2 Nov 2022 00:00:10 +0200 (EET) Received: (Authenticated sender: amy@amyspark.me) by mail.gandi.net (Postfix) with ESMTPSA id AFE3910000A; Tue, 1 Nov 2022 22:00:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amyspark.me; s=gm1; t=1667340009; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=K1N752fPJ9Eo4xvBt/9Ncot4gTlczqNBPhHcqahKfks=; b=MRarz76kn15oFGyyxg17xLjXgbzQuVTh7Jx2yn/gyrbxER/ZRhd9S/IIeV8vJF+r+vfgPK c//GYgm+VIlGiM+6Y/b/Squp8FbjWZGYQ/U0d+hf7nFGx20k0/QC2DvUZCC8pOVkQbRqd8 xZay7uwtMisxWgJy2kQTsk1dUFJY4/lQiw+VZeC3doio8Q2bkyS/tK2/XZVv6+6UPR9pw2 y3n0CQI81zShHCRxa1g4P2eBkz3W/bSuVPdHOvVPBSGyeIIRTRW+2ZIzpaMhl56vAbZDQW KCuK45pbGQR/WjPTv2SThoWV6hqNDnyQJcLrqWuigSQVs2OHZb/2Pj5CJd3B1A== From: "L. E. Segovia" To: ffmpeg-devel@ffmpeg.org Date: Tue, 1 Nov 2022 21:59:34 +0000 Message-Id: X-Mailer: git-send-email 2.38.1 In-Reply-To: References: MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/4] all: Replace if (CONFIG_FOO) checks by #if CONFIG_FOO X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Nirbheek Chauhan , Halla Rempt , =?utf-8?q?Tim-Philipp_M=C3=BCller?= Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: Njw5qvrccf+l Continuation of e42aaaf92a4b0c88d60acc12df64c81d0887c26f Signed-off-by: L. E. Segovia --- fftools/ffprobe.c | 22 ++++++++++++++++++---- fftools/opt_common.c | 18 +++++++++++++++++- libavformat/rtmpproto.c | 24 ++++++++++++++++++------ 3 files changed, 53 insertions(+), 11 deletions(-) diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c index 9b7e82fd8c..c16c68ee92 100644 --- a/fftools/ffprobe.c +++ b/fftools/ffprobe.c @@ -3519,8 +3519,7 @@ static void ffprobe_show_program_version(WriterContext *w) } #define SHOW_LIB_VERSION(libname, LIBNAME) \ - do { \ - if (CONFIG_##LIBNAME) { \ + { \ unsigned int version = libname##_version(); \ writer_print_section_header(w, SECTION_ID_LIBRARY_VERSION); \ print_str("name", "lib" #libname); \ @@ -3530,20 +3529,35 @@ static void ffprobe_show_program_version(WriterContext *w) print_int("version", version); \ print_str("ident", LIB##LIBNAME##_IDENT); \ writer_print_section_footer(w); \ - } \ - } while (0) + } static void ffprobe_show_library_versions(WriterContext *w) { writer_print_section_header(w, SECTION_ID_LIBRARY_VERSIONS); +#if CONFIG_AVUTIL SHOW_LIB_VERSION(avutil, AVUTIL); +#endif +#if CONFIG_AVCODEC SHOW_LIB_VERSION(avcodec, AVCODEC); +#endif +#if CONFIG_AVFORMAT SHOW_LIB_VERSION(avformat, AVFORMAT); +#endif +#if CONFIG_AVDEVICE SHOW_LIB_VERSION(avdevice, AVDEVICE); +#endif +#if CONFIG_AVFILTER SHOW_LIB_VERSION(avfilter, AVFILTER); +#endif +#if CONFIG_SWSCALE SHOW_LIB_VERSION(swscale, SWSCALE); +#endif +#if CONFIG_SWRESAMPLE SHOW_LIB_VERSION(swresample, SWRESAMPLE); +#endif +#if CONFIG_POSTPROC SHOW_LIB_VERSION(postproc, POSTPROC); +#endif writer_print_section_footer(w); } diff --git a/fftools/opt_common.c b/fftools/opt_common.c index 8a06df82df..243eb4e3a1 100644 --- a/fftools/opt_common.c +++ b/fftools/opt_common.c @@ -154,7 +154,7 @@ static int warned_cfg = 0; #define SHOW_COPYRIGHT 8 #define PRINT_LIB_INFO(libname, LIBNAME, flags, level) \ - if (CONFIG_##LIBNAME) { \ + { \ const char *indent = flags & INDENT? " " : ""; \ if (flags & SHOW_VERSION) { \ unsigned int version = libname##_version(); \ @@ -184,14 +184,30 @@ static int warned_cfg = 0; static void print_all_libs_info(int flags, int level) { +#if CONFIG_AVUTIL PRINT_LIB_INFO(avutil, AVUTIL, flags, level); +#endif +#if CONFIG_AVCODEC PRINT_LIB_INFO(avcodec, AVCODEC, flags, level); +#endif +#if CONFIG_AVFORMAT PRINT_LIB_INFO(avformat, AVFORMAT, flags, level); +#endif +#if CONFIG_AVDEVICE PRINT_LIB_INFO(avdevice, AVDEVICE, flags, level); +#endif +#if CONFIG_AVFILTER PRINT_LIB_INFO(avfilter, AVFILTER, flags, level); +#endif +#if CONFIG_SWSCALE PRINT_LIB_INFO(swscale, SWSCALE, flags, level); +#endif +#if CONFIG_SWRESAMPLE PRINT_LIB_INFO(swresample, SWRESAMPLE, flags, level); +#endif +#if CONFIG_POSTPROC PRINT_LIB_INFO(postproc, POSTPROC, flags, level); +#endif } static void print_program_info(int flags, int level) diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c index f0ef223f05..6d84fcf34f 100644 --- a/libavformat/rtmpproto.c +++ b/libavformat/rtmpproto.c @@ -1222,7 +1222,8 @@ static int rtmp_handshake(URLContext *s, RTMPContext *rt) for (i = 9; i <= RTMP_HANDSHAKE_PACKET_SIZE; i++) tosend[i] = av_lfg_get(&rnd) >> 24; - if (CONFIG_FFRTMPCRYPT_PROTOCOL && rt->encrypted) { +#if CONFIG_FFRTMPCRYPT_PROTOCOL + if (rt->encrypted) { /* When the client wants to use RTMPE, we have to change the command * byte to 0x06 which means to use encrypted data and we have to set * the flash version to at least 9.0.115.0. */ @@ -1237,6 +1238,7 @@ static int rtmp_handshake(URLContext *s, RTMPContext *rt) if ((ret = ff_rtmpe_gen_pub_key(rt->stream, tosend + 1)) < 0) return ret; } +#endif client_pos = rtmp_handshake_imprint_with_digest(tosend + 1, rt->encrypted); if (client_pos < 0) @@ -1300,7 +1302,8 @@ static int rtmp_handshake(URLContext *s, RTMPContext *rt) if (ret < 0) return ret; - if (CONFIG_FFRTMPCRYPT_PROTOCOL && rt->encrypted) { +#if CONFIG_FFRTMPCRYPT_PROTOCOL + if (rt->encrypted) { /* Compute the shared secret key sent by the server and initialize * the RC4 encryption. */ if ((ret = ff_rtmpe_compute_secret_key(rt->stream, serverdata + 1, @@ -1310,6 +1313,7 @@ static int rtmp_handshake(URLContext *s, RTMPContext *rt) /* Encrypt the signature received by the server. */ ff_rtmpe_encrypt_sig(rt->stream, signature, digest, serverdata[0]); } +#endif if (memcmp(signature, clientdata + RTMP_HANDSHAKE_PACKET_SIZE - 32, 32)) { av_log(s, AV_LOG_ERROR, "Signature mismatch\n"); @@ -1330,25 +1334,30 @@ static int rtmp_handshake(URLContext *s, RTMPContext *rt) if (ret < 0) return ret; - if (CONFIG_FFRTMPCRYPT_PROTOCOL && rt->encrypted) { +#if CONFIG_FFRTMPCRYPT_PROTOCOL + if (rt->encrypted) { /* Encrypt the signature to be send to the server. */ ff_rtmpe_encrypt_sig(rt->stream, tosend + RTMP_HANDSHAKE_PACKET_SIZE - 32, digest, serverdata[0]); } +#endif // write reply back to the server if ((ret = ffurl_write(rt->stream, tosend, RTMP_HANDSHAKE_PACKET_SIZE)) < 0) return ret; - if (CONFIG_FFRTMPCRYPT_PROTOCOL && rt->encrypted) { +#if CONFIG_FFRTMPCRYPT_PROTOCOL + if (rt->encrypted) { /* Set RC4 keys for encryption and update the keystreams. */ if ((ret = ff_rtmpe_update_keystream(rt->stream)) < 0) return ret; } +#endif } else { - if (CONFIG_FFRTMPCRYPT_PROTOCOL && rt->encrypted) { +#if CONFIG_FFRTMPCRYPT_PROTOCOL + if (rt->encrypted) { /* Compute the shared secret key sent by the server and initialize * the RC4 encryption. */ if ((ret = ff_rtmpe_compute_secret_key(rt->stream, serverdata + 1, @@ -1361,16 +1370,19 @@ static int rtmp_handshake(URLContext *s, RTMPContext *rt) serverdata[0]); } } +#endif if ((ret = ffurl_write(rt->stream, serverdata + 1, RTMP_HANDSHAKE_PACKET_SIZE)) < 0) return ret; - if (CONFIG_FFRTMPCRYPT_PROTOCOL && rt->encrypted) { +#if CONFIG_FFRTMPCRYPT_PROTOCOL + if (rt->encrypted) { /* Set RC4 keys for encryption and update the keystreams. */ if ((ret = ff_rtmpe_update_keystream(rt->stream)) < 0) return ret; } +#endif } return 0; From patchwork Tue Nov 1 21:59:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "L. E. Segovia" X-Patchwork-Id: 39106 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:999a:b0:a4:2148:650a with SMTP id ve26csp430333pzb; Tue, 1 Nov 2022 15:00:40 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7N/9Y5vqv5oHpsM5NQ4hhVbvI/Fu7otjUU5m3Z6mmfWIq8P6Eo7IISD0E364ks9Dj92IcL X-Received: by 2002:aa7:d91a:0:b0:462:d2f6:26c6 with SMTP id a26-20020aa7d91a000000b00462d2f626c6mr21615713edr.180.1667340040465; Tue, 01 Nov 2022 15:00:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667340040; cv=none; d=google.com; s=arc-20160816; b=JgiZ73BV1LtPP/dRPc2RzRwx+4pIdDuPLMAdzDKUDlEutIBx5swh/Kf427qwjdZfdF eY8XsMs55Fp/IvfQIch36a5p9UCDzGpsC6OSeYYo8pMQmI45AAdbDRKoNNLtw/BTSPeD AVgloHYd0cPlQgvx/Rss993rGY1Aoi1Pt/WMsgmrP1i1JsHPMrMLW9Vf+J6K+G0t3QPS Yw0t7C/d6/6Y8BDoyJLztBYrBr+khVhFY2Qoo7CK2PelwFT/EVxlIr1ASAkR1CnbuzhL Vf6wNi5dVoT2eg/LZL/bTDnL14exgDcozqhMKKfX/QKCShXmJ51rPKnu22WesizjF5u1 IcTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=rfaluzS9Z0l9H3Azv31+3eP61w8r59qfJfxbbWtz2Dw=; b=zRwkWDwYQAHucjy/CVTI+lnbiyFZVNUKpjxB782H/bqnFKkN1rSumVTUTdWPiMYdPp winHoITS8FZknrj2McUtc7QGZT0Z4xT7GPeWTWPHEzkWAoXWqsGzbhMz0+kwottBJkN2 IY6hKkUNsZg65M1+6aVt8slcDwGB6SlBu5lUPNvitFnBKBFvPEtRCA2AqDPIR+1/Mvfd 7TB1VAcIVDCSIet5/No+nIM1iYTvQ1R87gd776VvHLx/qdQ3q0e+WS69zMn8kwnzJlhJ fxey6yDK6o8STKH8M+Kjz+iqUm5O9jNsL10wxbtsJXvPfU16CS3TlgO98cN9op4kLugg fKUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@amyspark.me header.s=gm1 header.b=XRB7SKKW; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amyspark.me Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id wg9-20020a17090705c900b0078e1206d934si13618385ejb.162.2022.11.01.15.00.39; Tue, 01 Nov 2022 15:00:40 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@amyspark.me header.s=gm1 header.b=XRB7SKKW; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amyspark.me Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id DE74C68BE81; Wed, 2 Nov 2022 00:00:21 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay11.mail.gandi.net (relay11.mail.gandi.net [217.70.178.231]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D326F68B856 for ; Wed, 2 Nov 2022 00:00:14 +0200 (EET) Received: (Authenticated sender: amy@amyspark.me) by mail.gandi.net (Postfix) with ESMTPSA id D8C59100006; Tue, 1 Nov 2022 22:00:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amyspark.me; s=gm1; t=1667340014; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UTvndHRTxnHumnIRfLPgHrRcGaKD2fLiJZ95T1ZQaHg=; b=XRB7SKKWf04b+cWqQf8ETUzsKSm/dr4SSd5Ps5hC6B69U7NU6b0QpLhuYa4YusECn0BJW6 0VxBOg0xNwoELU+zMk5EaWBljOz5C4bLNgzQT5W0zqnSUemBFLb2yEDBTEztPajuuxBP2J ufiSjXo4cL2tibGK7vQqEi/PCEygVPkSYupiVEgTtH3IoQmTl+d6xusvb64w+ff12ocWH0 a95OHr5/4sxEUsX2ccrHimTPfm4/22I3bqYz3pzPZ94VtQQKVnoo7/khT30WXF+44U3O19 LrY5vxF/JICQ4olPStG6GbXeWtp0fcauaNidmQJc4rO17wXS9S1vIutcY2DZQQ== From: "L. E. Segovia" To: ffmpeg-devel@ffmpeg.org Date: Tue, 1 Nov 2022 21:59:35 +0000 Message-Id: X-Mailer: git-send-email 2.38.1 In-Reply-To: References: MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 3/4] all: Guard if (INLINE*) checks with #if HAVE_INLINE_ASM X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Nirbheek Chauhan , Halla Rempt , =?utf-8?q?Tim-Philipp_M=C3=BCller?= Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 3nxtZZUWVI/v Continuation of 40e6575aa3eed64cd32bf28c00ae57edc5acb25a Signed-off-by: L. E. Segovia --- libavcodec/x86/vc1dsp_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/x86/vc1dsp_init.c b/libavcodec/x86/vc1dsp_init.c index bc63933e83..65fc28ea35 100644 --- a/libavcodec/x86/vc1dsp_init.c +++ b/libavcodec/x86/vc1dsp_init.c @@ -102,7 +102,7 @@ av_cold void ff_vc1dsp_init_x86(VC1DSPContext *dsp) { int cpu_flags = av_get_cpu_flags(); -#if HAVE_6REGS +#if HAVE_6REGS && HAVE_INLINE_ASM if (INLINE_MMX(cpu_flags)) if (EXTERNAL_MMX(cpu_flags)) ff_vc1dsp_init_mmx(dsp); From patchwork Tue Nov 1 21:59:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "L. E. Segovia" X-Patchwork-Id: 39107 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:999a:b0:a4:2148:650a with SMTP id ve26csp430440pzb; Tue, 1 Nov 2022 15:00:50 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4qMOsMb9MmZqW54SZwPDU3SzE3UZxenIKe8sywmQZZC2A0zlGGV57Bp9TmW/+/w+DPJ//9 X-Received: by 2002:a17:907:971c:b0:7ad:7d51:8c10 with SMTP id jg28-20020a170907971c00b007ad7d518c10mr20794250ejc.473.1667340050362; Tue, 01 Nov 2022 15:00:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667340050; cv=none; d=google.com; s=arc-20160816; b=aNmvxtzrMhncPJf0GRj1ueRyP28Md6jXivCcur6ipthg8DcI4O5ePUbtPM8TU/0Wpz lgc3N94t2GSxSatp1Er3ldfhexWUXamMYd2J4+IkidhWJWipIDgysK2aV9jXuuUj3XbK KpY3TOy7lrBjn9KI0l6Iahl7HQv54O/6AnQtaHga7prhkMeUlgAJEycsnO9KS4lSG+yp xO51b/quCZaqasnQzLxhhPKbc+uehK1Xqxjyqi9pk/I0d37wHYIz2V77XPlUecK+jEb+ hJVF2vjj9HyhviI171eRLrtJJvhMEw77X5kz+1WOzsPxkbaGC9uUlP30BaGum8xKxYAw 7LpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=ncgIV9jrV6xdLwbs9vN/cYCaH56dLNSiAlkdNpR4I18=; b=ZrJeeQ6F2FSK25EVv9baFMCh1fW8wFS+7Hv83slJNIGb+kE8yiOEfyWdrzWctcc4aW qvk5X7eGrJKAcTqTvyr9Q5QhQOv0DvQBYmDaQlon6+0KomQatONPz3sOfaxsBe86HfQS L1SKBzcF97Kr5Ek2KKqMohik1ImGQQOduuG69iPrlnk8sCLx0V55J57qqlQJgWwkSZbV PNB606VrF+q0i1yE8pp+MKjH1BcCmJrGa6yHy5XkPHXo1Ob7hw+COKqrhF+wOXSsl3e9 tlK24bFW21F1QNWibAbt3iU8rSnwUqlsDxw42rgHI/s/XsdzQc+5ZFmKg2Hia26w5A2w hG1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@amyspark.me header.s=gm1 header.b=P+2PyQX+; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amyspark.me Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id h22-20020aa7cdd6000000b004589ea2d983si11005562edw.287.2022.11.01.15.00.49; Tue, 01 Nov 2022 15:00:50 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@amyspark.me header.s=gm1 header.b=P+2PyQX+; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amyspark.me Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E368868BE8D; Wed, 2 Nov 2022 00:00:25 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay11.mail.gandi.net (relay11.mail.gandi.net [217.70.178.231]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8BC2F68BE6D for ; Wed, 2 Nov 2022 00:00:19 +0200 (EET) Received: (Authenticated sender: amy@amyspark.me) by mail.gandi.net (Postfix) with ESMTPSA id F2E80100004; Tue, 1 Nov 2022 22:00:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amyspark.me; s=gm1; t=1667340019; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HcBhytB/HTXxgl8TNMMiEcxqpCyDg9t++nhC6tJy+RE=; b=P+2PyQX+QL9i7F/Yz7tkmPX1AT0JuB2FQjyfxbcmJcTb8aUO9h23Nh/5OrmBqNsLnCqjUp DoMYNCmps3+EgtYYZ5SMgyNSGlwPkFbTpNVPDE8qejKuI1DJwY+y0W3OW6Qx+ISwCU9LH8 4Kz7PtAgLqfE3fQuF5YW8CQYS2PL/Kk5Un5+i4KYyl/5mF1Cy5IboZoTYrllqdUahZQ1wp LWQrsTIXn3cNLXdtk1XOoxvMZS1zgin6JuIqubnA8EccHlZAT1177xqpNztnQO4HL3LQnq 9YuNA9o21n19x9z1wJS5VOE7/PWlqlPVaYCIrYdBgZtawSC0tVwYqLiNfCrm+g== From: "L. E. Segovia" To: ffmpeg-devel@ffmpeg.org Date: Tue, 1 Nov 2022 21:59:36 +0000 Message-Id: X-Mailer: git-send-email 2.38.1 In-Reply-To: References: MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 4/4] all: Guard if (EXTERNAL*) checks with #if HAVE_X86ASM X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Nirbheek Chauhan , Halla Rempt , =?utf-8?q?Tim-Philipp_M=C3=BCller?= Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: xb04AeNF5bZN Continuation of 40e6575aa3eed64cd32bf28c00ae57edc5acb25a Signed-off-by: L. E. Segovia --- libavcodec/x86/aacencdsp_init.c | 2 ++ libavcodec/x86/aacpsdsp_init.c | 2 ++ libavcodec/x86/ac3dsp_init.c | 4 ++++ libavcodec/x86/audiodsp_init.c | 2 ++ libavcodec/x86/bswapdsp_init.c | 2 ++ libavcodec/x86/cavsdsp.c | 2 ++ libavcodec/x86/celt_pvq_init.c | 2 ++ libavcodec/x86/cfhddsp_init.c | 2 ++ libavcodec/x86/cfhdencdsp_init.c | 2 ++ libavcodec/x86/dcadsp_init.c | 2 ++ libavcodec/x86/dct_init.c | 2 ++ libavcodec/x86/dnxhdenc_init.c | 2 ++ libavcodec/x86/exrdsp_init.c | 2 ++ libavcodec/x86/fft_init.c | 2 ++ libavcodec/x86/g722dsp_init.c | 2 ++ libavcodec/x86/h263dsp_init.c | 2 ++ libavcodec/x86/h264_intrapred_init.c | 2 ++ libavcodec/x86/h264chroma_init.c | 2 ++ libavcodec/x86/hevcdsp_init.c | 2 ++ libavcodec/x86/hpeldsp_init.c | 2 ++ libavcodec/x86/hpeldsp_vp3_init.c | 2 ++ libavcodec/x86/huffyuvdsp_init.c | 2 ++ libavcodec/x86/huffyuvencdsp_init.c | 2 ++ libavcodec/x86/idctdsp_init.c | 2 ++ libavcodec/x86/jpeg2000dsp_init.c | 2 ++ libavcodec/x86/lossless_videodsp_init.c | 2 ++ libavcodec/x86/lossless_videoencdsp_init.c | 2 ++ libavcodec/x86/mdct15_init.c | 2 ++ libavcodec/x86/me_cmp_init.c | 2 ++ libavcodec/x86/mlpdsp_init.c | 2 ++ libavcodec/x86/mpegvideoencdsp_init.c | 2 ++ libavcodec/x86/opusdsp_init.c | 2 ++ libavcodec/x86/pixblockdsp_init.c | 2 ++ libavcodec/x86/pngdsp_init.c | 2 ++ libavcodec/x86/proresdsp_init.c | 2 ++ libavcodec/x86/rv34dsp_init.c | 2 ++ libavcodec/x86/sbcdsp_init.c | 2 ++ libavcodec/x86/sbrdsp_init.c | 2 ++ libavcodec/x86/svq1enc_init.c | 2 ++ libavcodec/x86/utvideodsp_init.c | 2 ++ libavcodec/x86/v210enc_init.c | 2 ++ libavcodec/x86/vorbisdsp_init.c | 2 ++ libavcodec/x86/vp3dsp_init.c | 2 ++ libavcodec/x86/vp6dsp_init.c | 2 ++ libavfilter/x86/af_afir_init.c | 2 ++ libavfilter/x86/af_anlmdn_init.c | 2 ++ libavfilter/x86/af_volume_init.c | 2 ++ libavfilter/x86/avf_showcqt_init.c | 2 ++ libavfilter/x86/colorspacedsp_init.c | 2 ++ libavfilter/x86/vf_atadenoise_init.c | 2 ++ libavfilter/x86/vf_blend_init.c | 2 ++ libavfilter/x86/vf_bwdif_init.c | 2 ++ libavfilter/x86/vf_convolution_init.c | 2 ++ libavfilter/x86/vf_framerate_init.c | 2 ++ libavfilter/x86/vf_fspp_init.c | 2 ++ libavfilter/x86/vf_gblur_init.c | 2 ++ libavfilter/x86/vf_hflip_init.c | 2 ++ libavfilter/x86/vf_limiter_init.c | 2 ++ libavfilter/x86/vf_maskedclamp_init.c | 2 ++ libavfilter/x86/vf_maskedmerge_init.c | 2 ++ libavfilter/x86/vf_overlay_init.c | 2 ++ libavfilter/x86/vf_pp7_init.c | 2 ++ libavfilter/x86/vf_psnr_init.c | 2 ++ libavfilter/x86/vf_removegrain_init.c | 2 ++ libavfilter/x86/vf_ssim_init.c | 2 ++ libavfilter/x86/vf_stereo3d_init.c | 2 ++ libavfilter/x86/vf_threshold_init.c | 2 ++ libavfilter/x86/vf_tinterlace_init.c | 2 ++ libavfilter/x86/vf_transpose_init.c | 2 ++ libavfilter/x86/vf_v360_init.c | 2 ++ libavfilter/x86/vf_w3fdif_init.c | 2 ++ libavfilter/x86/vf_yadif_init.c | 2 ++ libavutil/x86/fixed_dsp_init.c | 2 ++ libavutil/x86/float_dsp_init.c | 2 ++ libavutil/x86/imgutils_init.c | 2 ++ libavutil/x86/lls_init.c | 2 ++ libavutil/x86/pixelutils_init.c | 2 ++ libswresample/x86/audio_convert_init.c | 2 ++ libswresample/x86/resample_init.c | 6 ++++++ libswscale/x86/rgb2rgb.c | 2 ++ libswscale/x86/swscale.c | 2 ++ 81 files changed, 168 insertions(+) diff --git a/libavcodec/x86/aacencdsp_init.c b/libavcodec/x86/aacencdsp_init.c index 049a2417d9..7dca1d481b 100644 --- a/libavcodec/x86/aacencdsp_init.c +++ b/libavcodec/x86/aacencdsp_init.c @@ -34,6 +34,7 @@ void ff_aac_quantize_bands_sse2(int *out, const float *in, const float *scaled, av_cold void ff_aac_dsp_init_x86(AACEncContext *s) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE(cpu_flags)) @@ -41,4 +42,5 @@ av_cold void ff_aac_dsp_init_x86(AACEncContext *s) if (EXTERNAL_SSE2(cpu_flags)) s->quant_bands = ff_aac_quantize_bands_sse2; +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/aacpsdsp_init.c b/libavcodec/x86/aacpsdsp_init.c index 0b0ee07db4..44d64f5340 100644 --- a/libavcodec/x86/aacpsdsp_init.c +++ b/libavcodec/x86/aacpsdsp_init.c @@ -51,6 +51,7 @@ void ff_ps_hybrid_analysis_ileave_sse(float (*out)[32][2], float L[2][38][64], av_cold void ff_psdsp_init_x86(PSDSPContext *s) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE(cpu_flags)) { @@ -71,4 +72,5 @@ av_cold void ff_psdsp_init_x86(PSDSPContext *s) if (EXTERNAL_FMA3(cpu_flags)) { s->hybrid_analysis = ff_ps_hybrid_analysis_fma3; } +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/ac3dsp_init.c b/libavcodec/x86/ac3dsp_init.c index 43b3b4ac85..76a8c0547d 100644 --- a/libavcodec/x86/ac3dsp_init.c +++ b/libavcodec/x86/ac3dsp_init.c @@ -35,6 +35,7 @@ void ff_ac3_extract_exponents_ssse3(uint8_t *exp, int32_t *coef, int nb_coefs); av_cold void ff_ac3dsp_init_x86(AC3DSPContext *c) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE2(cpu_flags)) { @@ -48,6 +49,7 @@ av_cold void ff_ac3dsp_init_x86(AC3DSPContext *c) if (!(cpu_flags & AV_CPU_FLAG_ATOM)) c->extract_exponents = ff_ac3_extract_exponents_ssse3; } +#endif /* HAVE_X86ASM */ } #define DOWNMIX_FUNC_OPT(ch, opt) \ @@ -68,6 +70,7 @@ DOWNMIX_FUNCS(fma3) void ff_ac3dsp_set_downmix_x86(AC3DSPContext *c) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); #define SET_DOWNMIX(ch, suf, SUF) \ @@ -91,4 +94,5 @@ void ff_ac3dsp_set_downmix_x86(AC3DSPContext *c) SET_DOWNMIX_ALL(avx, AVX) SET_DOWNMIX_ALL(fma3, FMA3) } +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/audiodsp_init.c b/libavcodec/x86/audiodsp_init.c index 68aa3b2129..c5f410678e 100644 --- a/libavcodec/x86/audiodsp_init.c +++ b/libavcodec/x86/audiodsp_init.c @@ -41,6 +41,7 @@ void ff_vector_clipf_sse(float *dst, const float *src, av_cold void ff_audiodsp_init_x86(AudioDSPContext *c) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE(cpu_flags)) @@ -59,4 +60,5 @@ av_cold void ff_audiodsp_init_x86(AudioDSPContext *c) if (EXTERNAL_AVX2_FAST(cpu_flags)) c->scalarproduct_int16 = ff_scalarproduct_int16_avx2; +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/bswapdsp_init.c b/libavcodec/x86/bswapdsp_init.c index 877bab1a2c..08551f6487 100644 --- a/libavcodec/x86/bswapdsp_init.c +++ b/libavcodec/x86/bswapdsp_init.c @@ -29,6 +29,7 @@ void ff_bswap32_buf_avx2(uint32_t *dst, const uint32_t *src, int w); av_cold void ff_bswapdsp_init_x86(BswapDSPContext *c) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE2(cpu_flags)) @@ -37,4 +38,5 @@ av_cold void ff_bswapdsp_init_x86(BswapDSPContext *c) c->bswap_buf = ff_bswap32_buf_ssse3; if (EXTERNAL_AVX2_FAST(cpu_flags)) c->bswap_buf = ff_bswap32_buf_avx2; +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/cavsdsp.c b/libavcodec/x86/cavsdsp.c index 4ad977a034..ad755e7321 100644 --- a/libavcodec/x86/cavsdsp.c +++ b/libavcodec/x86/cavsdsp.c @@ -383,6 +383,7 @@ av_cold void ff_cavsdsp_init_x86(CAVSDSPContext *c) DSPFUNC(avg, 1, 8, mmxext); } #endif +#if HAVE_X86ASM #if HAVE_MMX_EXTERNAL if (EXTERNAL_MMXEXT(cpu_flags)) { c->avg_cavs_qpel_pixels_tab[1][0] = avg_cavs_qpel8_mc00_mmxext; @@ -397,4 +398,5 @@ av_cold void ff_cavsdsp_init_x86(CAVSDSPContext *c) c->idct_perm = FF_IDCT_PERM_TRANSPOSE; } #endif +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/celt_pvq_init.c b/libavcodec/x86/celt_pvq_init.c index 5a0669e6f2..b88a2f6225 100644 --- a/libavcodec/x86/celt_pvq_init.c +++ b/libavcodec/x86/celt_pvq_init.c @@ -31,6 +31,7 @@ extern float ff_pvq_search_exact_avx (float *X, int *y, int K, int N); av_cold void ff_celt_pvq_init_x86(CeltPVQ *s) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE2(cpu_flags)) @@ -41,4 +42,5 @@ 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 /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/cfhddsp_init.c b/libavcodec/x86/cfhddsp_init.c index c5d89561ae..a773c365c1 100644 --- a/libavcodec/x86/cfhddsp_init.c +++ b/libavcodec/x86/cfhddsp_init.c @@ -40,6 +40,7 @@ void ff_cfhd_horiz_filter_clip12_sse2(int16_t *output, const int16_t *low, const av_cold void ff_cfhddsp_init_x86(CFHDDSPContext *c, int depth, int bayer) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE2(cpu_flags)) { @@ -50,4 +51,5 @@ av_cold void ff_cfhddsp_init_x86(CFHDDSPContext *c, int depth, int bayer) if (depth == 12 && !bayer) c->horiz_filter_clip = ff_cfhd_horiz_filter_clip12_sse2; } +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/cfhdencdsp_init.c b/libavcodec/x86/cfhdencdsp_init.c index 5cea39a80a..79b2f10bf7 100644 --- a/libavcodec/x86/cfhdencdsp_init.c +++ b/libavcodec/x86/cfhdencdsp_init.c @@ -38,6 +38,7 @@ void ff_cfhdenc_vert_filter_sse2(const int16_t *input, int16_t *low, int16_t *hi av_cold void ff_cfhdencdsp_init_x86(CFHDEncDSPContext *c) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); #if ARCH_X86_64 @@ -46,4 +47,5 @@ av_cold void ff_cfhdencdsp_init_x86(CFHDEncDSPContext *c) c->vert_filter = ff_cfhdenc_vert_filter_sse2; } #endif +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/dcadsp_init.c b/libavcodec/x86/dcadsp_init.c index 3c125f33fd..0475841a40 100644 --- a/libavcodec/x86/dcadsp_init.c +++ b/libavcodec/x86/dcadsp_init.c @@ -34,6 +34,7 @@ LFE_FIR_FLOAT_FUNC(fma3) av_cold void ff_dcadsp_init_x86(DCADSPContext *s) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); #if ARCH_X86_32 @@ -48,4 +49,5 @@ av_cold void ff_dcadsp_init_x86(DCADSPContext *s) if (EXTERNAL_FMA3(cpu_flags)) s->lfe_fir_float[0] = ff_lfe_fir0_float_fma3; #endif +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/dct_init.c b/libavcodec/x86/dct_init.c index d0e4b34dd3..6756e1e12d 100644 --- a/libavcodec/x86/dct_init.c +++ b/libavcodec/x86/dct_init.c @@ -27,10 +27,12 @@ void ff_dct32_float_avx(FFTSample *out, const FFTSample *in); av_cold void ff_dct_init_x86(DCTContext *s) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE2(cpu_flags)) s->dct32 = ff_dct32_float_sse2; if (EXTERNAL_AVX_FAST(cpu_flags)) s->dct32 = ff_dct32_float_avx; +#endif } diff --git a/libavcodec/x86/dnxhdenc_init.c b/libavcodec/x86/dnxhdenc_init.c index fd6f15005a..612b70ad7a 100644 --- a/libavcodec/x86/dnxhdenc_init.c +++ b/libavcodec/x86/dnxhdenc_init.c @@ -30,8 +30,10 @@ void ff_get_pixels_8x4_sym_sse2(int16_t *block, const uint8_t *pixels, av_cold void ff_dnxhdenc_init_x86(DNXHDEncContext *ctx) { +#if HAVE_X86ASM if (EXTERNAL_SSE2(av_get_cpu_flags())) { if (ctx->cid_table->bit_depth == 8) ctx->get_pixels_8x4_sym = ff_get_pixels_8x4_sym_sse2; } +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/exrdsp_init.c b/libavcodec/x86/exrdsp_init.c index 63b3480d8f..f9696d7a91 100644 --- a/libavcodec/x86/exrdsp_init.c +++ b/libavcodec/x86/exrdsp_init.c @@ -34,6 +34,7 @@ void ff_predictor_avx2(uint8_t *src, ptrdiff_t size); av_cold void ff_exrdsp_init_x86(ExrDSPContext *dsp) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE2(cpu_flags)) { @@ -49,4 +50,5 @@ av_cold void ff_exrdsp_init_x86(ExrDSPContext *dsp) dsp->reorder_pixels = ff_reorder_pixels_avx2; dsp->predictor = ff_predictor_avx2; } +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/fft_init.c b/libavcodec/x86/fft_init.c index df79d57dc7..065e231edb 100644 --- a/libavcodec/x86/fft_init.c +++ b/libavcodec/x86/fft_init.c @@ -26,6 +26,7 @@ av_cold void ff_fft_init_x86(FFTContext *s) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (s->nbits > 16) @@ -44,4 +45,5 @@ av_cold void ff_fft_init_x86(FFTContext *s) s->fft_calc = ff_fft_calc_avx; s->fft_permutation = FF_FFT_PERM_AVX; } +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/g722dsp_init.c b/libavcodec/x86/g722dsp_init.c index 614695193b..700269d62a 100644 --- a/libavcodec/x86/g722dsp_init.c +++ b/libavcodec/x86/g722dsp_init.c @@ -28,8 +28,10 @@ void ff_g722_apply_qmf_sse2(const int16_t *prev_samples, int xout[2]); av_cold void ff_g722dsp_init_x86(G722DSPContext *dsp) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE2(cpu_flags)) dsp->apply_qmf = ff_g722_apply_qmf_sse2; +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/h263dsp_init.c b/libavcodec/x86/h263dsp_init.c index ab81063233..57ec1640e3 100644 --- a/libavcodec/x86/h263dsp_init.c +++ b/libavcodec/x86/h263dsp_init.c @@ -30,10 +30,12 @@ void ff_h263_v_loop_filter_mmx(uint8_t *src, int stride, int qscale); av_cold void ff_h263dsp_init_x86(H263DSPContext *c) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_MMX(cpu_flags)) { c->h263_h_loop_filter = ff_h263_h_loop_filter_mmx; c->h263_v_loop_filter = ff_h263_v_loop_filter_mmx; } +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/h264_intrapred_init.c b/libavcodec/x86/h264_intrapred_init.c index ee46927a24..5518961784 100644 --- a/libavcodec/x86/h264_intrapred_init.c +++ b/libavcodec/x86/h264_intrapred_init.c @@ -160,6 +160,7 @@ av_cold void ff_h264_pred_init_x86(H264PredContext *h, int codec_id, const int bit_depth, const int chroma_format_idc) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (bit_depth == 8) { @@ -333,4 +334,5 @@ av_cold void ff_h264_pred_init_x86(H264PredContext *h, int codec_id, h->pred8x8l[HOR_UP_PRED ] = ff_pred8x8l_horizontal_up_10_avx; } } +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/h264chroma_init.c b/libavcodec/x86/h264chroma_init.c index 34934b6ad0..57d92ad107 100644 --- a/libavcodec/x86/h264chroma_init.c +++ b/libavcodec/x86/h264chroma_init.c @@ -65,6 +65,7 @@ CHROMA_MC(avg, 8, 10, avx) av_cold void ff_h264chroma_init_x86(H264ChromaContext *c, int bit_depth) { +#if HAVE_X86ASM int high_bit_depth = bit_depth > 8; int cpu_flags = av_get_cpu_flags(); @@ -105,4 +106,5 @@ av_cold void ff_h264chroma_init_x86(H264ChromaContext *c, int bit_depth) c->put_h264_chroma_pixels_tab[0] = ff_put_h264_chroma_mc8_10_avx; c->avg_h264_chroma_pixels_tab[0] = ff_avg_h264_chroma_mc8_10_avx; } +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/hevcdsp_init.c b/libavcodec/x86/hevcdsp_init.c index c7060085a2..29c11246ae 100644 --- a/libavcodec/x86/hevcdsp_init.c +++ b/libavcodec/x86/hevcdsp_init.c @@ -699,6 +699,7 @@ SAO_EDGE_FILTER_FUNCS(12, avx2) void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (bit_depth == 8) { @@ -1150,4 +1151,5 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth) SAO_EDGE_INIT(12, avx2); } } +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/hpeldsp_init.c b/libavcodec/x86/hpeldsp_init.c index 09c48c341e..d8f4e45849 100644 --- a/libavcodec/x86/hpeldsp_init.c +++ b/libavcodec/x86/hpeldsp_init.c @@ -224,6 +224,7 @@ av_cold void ff_hpeldsp_init_x86(HpelDSPContext *c, int flags) { int cpu_flags = av_get_cpu_flags(); +#if HAVE_X86ASM if (INLINE_MMX(cpu_flags)) hpeldsp_init_mmx(c, flags); @@ -235,6 +236,7 @@ av_cold void ff_hpeldsp_init_x86(HpelDSPContext *c, int flags) if (EXTERNAL_SSSE3(cpu_flags)) hpeldsp_init_ssse3(c, flags); +#endif if (CONFIG_VP3_DECODER) ff_hpeldsp_vp3_init_x86(c, cpu_flags, flags); diff --git a/libavcodec/x86/hpeldsp_vp3_init.c b/libavcodec/x86/hpeldsp_vp3_init.c index 1dbd1ba6f9..3dd6c45afa 100644 --- a/libavcodec/x86/hpeldsp_vp3_init.c +++ b/libavcodec/x86/hpeldsp_vp3_init.c @@ -34,10 +34,12 @@ void ff_put_no_rnd_pixels8_y2_exact_mmxext(uint8_t *block, av_cold void ff_hpeldsp_vp3_init_x86(HpelDSPContext *c, int cpu_flags, int flags) { +#if HAVE_X86ASM if (EXTERNAL_MMXEXT(cpu_flags)) { if (flags & AV_CODEC_FLAG_BITEXACT) { c->put_no_rnd_pixels_tab[1][1] = ff_put_no_rnd_pixels8_x2_exact_mmxext; c->put_no_rnd_pixels_tab[1][2] = ff_put_no_rnd_pixels8_y2_exact_mmxext; } } +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/huffyuvdsp_init.c b/libavcodec/x86/huffyuvdsp_init.c index 239d3ca313..445137da87 100644 --- a/libavcodec/x86/huffyuvdsp_init.c +++ b/libavcodec/x86/huffyuvdsp_init.c @@ -35,6 +35,7 @@ void ff_add_hfyu_median_pred_int16_mmxext(uint16_t *dst, const uint16_t *top, co av_cold void ff_huffyuvdsp_init_x86(HuffYUVDSPContext *c, enum AVPixelFormat pix_fmt) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(pix_fmt); @@ -50,4 +51,5 @@ av_cold void ff_huffyuvdsp_init_x86(HuffYUVDSPContext *c, enum AVPixelFormat pix if (EXTERNAL_AVX2_FAST(cpu_flags)) { c->add_int16 = ff_add_int16_avx2; } +#endif } diff --git a/libavcodec/x86/huffyuvencdsp_init.c b/libavcodec/x86/huffyuvencdsp_init.c index c9c33b75b4..35d18a040c 100644 --- a/libavcodec/x86/huffyuvencdsp_init.c +++ b/libavcodec/x86/huffyuvencdsp_init.c @@ -37,6 +37,7 @@ void ff_sub_hfyu_median_pred_int16_mmxext(uint16_t *dst, const uint16_t *src1, c av_cold void ff_huffyuvencdsp_init_x86(HuffYUVEncDSPContext *c, enum AVPixelFormat pix_fmt) { +#if HAVE_X86ASM av_unused int cpu_flags = av_get_cpu_flags(); const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(pix_fmt); @@ -51,4 +52,5 @@ av_cold void ff_huffyuvencdsp_init_x86(HuffYUVEncDSPContext *c, enum AVPixelForm if (EXTERNAL_AVX2_FAST(cpu_flags)) { c->diff_int16 = ff_diff_int16_avx2; } +#endif } diff --git a/libavcodec/x86/idctdsp_init.c b/libavcodec/x86/idctdsp_init.c index 4ade52a880..3f74da85cd 100644 --- a/libavcodec/x86/idctdsp_init.c +++ b/libavcodec/x86/idctdsp_init.c @@ -61,6 +61,7 @@ av_cold int ff_init_scantable_permutation_x86(uint8_t *idct_permutation, av_cold void ff_idctdsp_init_x86(IDCTDSPContext *c, AVCodecContext *avctx, unsigned high_bit_depth) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); #if ARCH_X86_32 @@ -159,4 +160,5 @@ av_cold void ff_idctdsp_init_x86(IDCTDSPContext *c, AVCodecContext *avctx, } } #endif +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/jpeg2000dsp_init.c b/libavcodec/x86/jpeg2000dsp_init.c index 7310a1d0e1..0256be8046 100644 --- a/libavcodec/x86/jpeg2000dsp_init.c +++ b/libavcodec/x86/jpeg2000dsp_init.c @@ -33,6 +33,7 @@ void ff_rct_int_avx2 (void *src0, void *src1, void *src2, int csize); av_cold void ff_jpeg2000dsp_init_x86(Jpeg2000DSPContext *c) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE(cpu_flags)) { c->mct_decode[FF_DWT97] = ff_ict_float_sse; @@ -57,4 +58,5 @@ av_cold void ff_jpeg2000dsp_init_x86(Jpeg2000DSPContext *c) if (EXTERNAL_AVX2_FAST(cpu_flags)) { c->mct_decode[FF_DWT53] = ff_rct_int_avx2; } +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/lossless_videodsp_init.c b/libavcodec/x86/lossless_videodsp_init.c index 5690cacaad..720cf98389 100644 --- a/libavcodec/x86/lossless_videodsp_init.c +++ b/libavcodec/x86/lossless_videodsp_init.c @@ -46,6 +46,7 @@ void ff_llviddsp_init_x86(LLVidDSPContext *c) { int cpu_flags = av_get_cpu_flags(); +#if HAVE_X86ASM if (EXTERNAL_SSE2(cpu_flags)) { c->add_bytes = ff_add_bytes_sse2; c->add_median_pred = ff_add_median_pred_sse2; @@ -67,4 +68,5 @@ void ff_llviddsp_init_x86(LLVidDSPContext *c) c->add_left_pred = ff_add_left_pred_unaligned_avx2; c->add_gradient_pred = ff_add_gradient_pred_avx2; } +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/lossless_videoencdsp_init.c b/libavcodec/x86/lossless_videoencdsp_init.c index 22a4014ef1..26cfcbb4b2 100644 --- a/libavcodec/x86/lossless_videoencdsp_init.c +++ b/libavcodec/x86/lossless_videoencdsp_init.c @@ -91,6 +91,7 @@ av_cold void ff_llvidencdsp_init_x86(LLVidEncDSPContext *c) } #endif /* HAVE_INLINE_ASM */ +#if HAVE_X86ASM if (EXTERNAL_SSE2(cpu_flags)) { c->diff_bytes = ff_diff_bytes_sse2; } @@ -102,4 +103,5 @@ av_cold void ff_llvidencdsp_init_x86(LLVidEncDSPContext *c) if (EXTERNAL_AVX2_FAST(cpu_flags)) { c->diff_bytes = ff_diff_bytes_avx2; } +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/mdct15_init.c b/libavcodec/x86/mdct15_init.c index ea7301e1e7..25653013a5 100644 --- a/libavcodec/x86/mdct15_init.c +++ b/libavcodec/x86/mdct15_init.c @@ -84,6 +84,7 @@ static void perm_twiddles(MDCT15Context *s) av_cold void ff_mdct15_init_x86(MDCT15Context *s) { int adjust_twiddles = 0; +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE3(cpu_flags)) @@ -98,6 +99,7 @@ av_cold void ff_mdct15_init_x86(MDCT15Context *s) if (EXTERNAL_AVX2_FAST(cpu_flags)) s->postreindex = ff_mdct15_postreindex_avx2; #endif +#endif /* HAVE_X86ASM */ if (adjust_twiddles) perm_twiddles(s); diff --git a/libavcodec/x86/me_cmp_init.c b/libavcodec/x86/me_cmp_init.c index bc1051c27e..527fdff4a9 100644 --- a/libavcodec/x86/me_cmp_init.c +++ b/libavcodec/x86/me_cmp_init.c @@ -242,6 +242,7 @@ av_cold void ff_me_cmp_init_x86(MECmpContext *c, AVCodecContext *avctx) #endif /* HAVE_INLINE_ASM */ +#if HAVE_X86ASM if (EXTERNAL_MMX(cpu_flags)) { c->sse[1] = ff_sse8_mmx; #if HAVE_X86ASM @@ -307,4 +308,5 @@ av_cold void ff_me_cmp_init_x86(MECmpContext *c, AVCodecContext *avctx) c->hadamard8_diff[1] = ff_hadamard8_diff_ssse3; #endif } +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/mlpdsp_init.c b/libavcodec/x86/mlpdsp_init.c index 333a685f47..f7eca8cb76 100644 --- a/libavcodec/x86/mlpdsp_init.c +++ b/libavcodec/x86/mlpdsp_init.c @@ -200,10 +200,12 @@ av_cold void ff_mlpdsp_init_x86(MLPDSPContext *c) if (INLINE_MMX(cpu_flags)) c->mlp_filter_channel = mlp_filter_channel_x86; #endif +#if HAVE_X86ASM #if ARCH_X86_64 if (EXTERNAL_SSE4(cpu_flags)) c->mlp_rematrix_channel = ff_mlp_rematrix_channel_sse4; if (EXTERNAL_AVX2_FAST(cpu_flags) && cpu_flags & AV_CPU_FLAG_BMI2) c->mlp_rematrix_channel = ff_mlp_rematrix_channel_avx2_bmi2; #endif +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/mpegvideoencdsp_init.c b/libavcodec/x86/mpegvideoencdsp_init.c index ec174b15aa..82f9df4cba 100644 --- a/libavcodec/x86/mpegvideoencdsp_init.c +++ b/libavcodec/x86/mpegvideoencdsp_init.c @@ -216,6 +216,7 @@ av_cold void ff_mpegvideoencdsp_init_x86(MpegvideoEncDSPContext *c, { int cpu_flags = av_get_cpu_flags(); +#if HAVE_X86ASM if (EXTERNAL_SSE2(cpu_flags)) { c->pix_sum = ff_pix_sum16_sse2; c->pix_norm1 = ff_pix_norm1_sse2; @@ -224,6 +225,7 @@ av_cold void ff_mpegvideoencdsp_init_x86(MpegvideoEncDSPContext *c, if (EXTERNAL_XOP(cpu_flags)) { c->pix_sum = ff_pix_sum16_xop; } +#endif /* HAVE_X86ASM */ #if HAVE_INLINE_ASM diff --git a/libavcodec/x86/opusdsp_init.c b/libavcodec/x86/opusdsp_init.c index 582fbb4f0c..4598657116 100644 --- a/libavcodec/x86/opusdsp_init.c +++ b/libavcodec/x86/opusdsp_init.c @@ -27,10 +27,12 @@ float ff_opus_deemphasis_fma3(float *out, float *in, float coeff, int len); av_cold void ff_opus_dsp_init_x86(OpusDSP *ctx) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_FMA3(cpu_flags)) { ctx->postfilter = ff_opus_postfilter_fma3; ctx->deemphasis = ff_opus_deemphasis_fma3; } +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/pixblockdsp_init.c b/libavcodec/x86/pixblockdsp_init.c index 51f2a0033a..9d3aac4c74 100644 --- a/libavcodec/x86/pixblockdsp_init.c +++ b/libavcodec/x86/pixblockdsp_init.c @@ -31,6 +31,7 @@ av_cold void ff_pixblockdsp_init_x86(PixblockDSPContext *c, AVCodecContext *avctx, unsigned high_bit_depth) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE2(cpu_flags)) { @@ -41,4 +42,5 @@ av_cold void ff_pixblockdsp_init_x86(PixblockDSPContext *c, c->diff_pixels_unaligned = c->diff_pixels = ff_diff_pixels_sse2; } +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/pngdsp_init.c b/libavcodec/x86/pngdsp_init.c index e2cd5effe3..c6562f7abb 100644 --- a/libavcodec/x86/pngdsp_init.c +++ b/libavcodec/x86/pngdsp_init.c @@ -33,6 +33,7 @@ void ff_add_bytes_l2_sse2(uint8_t *dst, uint8_t *src1, av_cold void ff_pngdsp_init_x86(PNGDSPContext *dsp) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_MMXEXT(cpu_flags)) @@ -41,4 +42,5 @@ av_cold void ff_pngdsp_init_x86(PNGDSPContext *dsp) dsp->add_bytes_l2 = ff_add_bytes_l2_sse2; if (EXTERNAL_SSSE3(cpu_flags)) dsp->add_paeth_prediction = ff_add_png_paeth_prediction_ssse3; +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/proresdsp_init.c b/libavcodec/x86/proresdsp_init.c index bde79ab8c0..01e5e67236 100644 --- a/libavcodec/x86/proresdsp_init.c +++ b/libavcodec/x86/proresdsp_init.c @@ -32,6 +32,7 @@ void ff_prores_idct_put_10_avx (uint16_t *dst, ptrdiff_t linesize, av_cold void ff_proresdsp_init_x86(ProresDSPContext *dsp, AVCodecContext *avctx) { +#if HAVE_X86ASM #if ARCH_X86_64 int cpu_flags = av_get_cpu_flags(); @@ -47,4 +48,5 @@ av_cold void ff_proresdsp_init_x86(ProresDSPContext *dsp, AVCodecContext *avctx) } } #endif /* ARCH_X86_64 */ +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/rv34dsp_init.c b/libavcodec/x86/rv34dsp_init.c index caa5c2d653..f76bef39e1 100644 --- a/libavcodec/x86/rv34dsp_init.c +++ b/libavcodec/x86/rv34dsp_init.c @@ -32,6 +32,7 @@ void ff_rv34_idct_add_mmxext(uint8_t *dst, ptrdiff_t stride, int16_t *block); av_cold void ff_rv34dsp_init_x86(RV34DSPContext* c) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_MMXEXT(cpu_flags)) { @@ -42,4 +43,5 @@ av_cold void ff_rv34dsp_init_x86(RV34DSPContext* c) c->rv34_idct_dc_add = ff_rv34_idct_dc_add_sse2; if (EXTERNAL_SSE4(cpu_flags)) c->rv34_idct_dc_add = ff_rv34_idct_dc_add_sse4; +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/sbcdsp_init.c b/libavcodec/x86/sbcdsp_init.c index 7416a86ac6..79914cc565 100644 --- a/libavcodec/x86/sbcdsp_init.c +++ b/libavcodec/x86/sbcdsp_init.c @@ -42,6 +42,7 @@ void ff_sbc_calc_scalefactors_mmx(int32_t sb_sample_f[16][2][8], av_cold void ff_sbcdsp_init_x86(SBCDSPContext *s) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_MMX(cpu_flags)) { @@ -49,4 +50,5 @@ av_cold void ff_sbcdsp_init_x86(SBCDSPContext *s) s->sbc_analyze_8 = ff_sbc_analyze_8_mmx; s->sbc_calc_scalefactors = ff_sbc_calc_scalefactors_mmx; } +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/sbrdsp_init.c b/libavcodec/x86/sbrdsp_init.c index 999f681220..d70ffa0d6c 100644 --- a/libavcodec/x86/sbrdsp_init.c +++ b/libavcodec/x86/sbrdsp_init.c @@ -57,6 +57,7 @@ void ff_sbr_autocorrelate_sse3(const float x[40][2], float phi[3][2][2]); av_cold void ff_sbrdsp_init_x86(SBRDSPContext *s) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE(cpu_flags)) { @@ -82,4 +83,5 @@ av_cold void ff_sbrdsp_init_x86(SBRDSPContext *s) if (EXTERNAL_SSE3(cpu_flags)) { s->autocorrelate = ff_sbr_autocorrelate_sse3; } +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/svq1enc_init.c b/libavcodec/x86/svq1enc_init.c index daf573beba..c016811822 100644 --- a/libavcodec/x86/svq1enc_init.c +++ b/libavcodec/x86/svq1enc_init.c @@ -29,9 +29,11 @@ int ff_ssd_int8_vs_int16_sse2(const int8_t *pix1, const int16_t *pix2, av_cold void ff_svq1enc_init_x86(SVQ1EncDSPContext *c) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE2(cpu_flags)) { c->ssd_int8_vs_int16 = ff_ssd_int8_vs_int16_sse2; } +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/utvideodsp_init.c b/libavcodec/x86/utvideodsp_init.c index 2b436c6c5c..e81f6bf3c0 100644 --- a/libavcodec/x86/utvideodsp_init.c +++ b/libavcodec/x86/utvideodsp_init.c @@ -41,6 +41,7 @@ void ff_restore_rgb_planes10_avx2(uint16_t *src_r, uint16_t *src_g, uint16_t *sr av_cold void ff_utvideodsp_init_x86(UTVideoDSPContext *c) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE2(cpu_flags)) { @@ -51,4 +52,5 @@ av_cold void ff_utvideodsp_init_x86(UTVideoDSPContext *c) c->restore_rgb_planes = ff_restore_rgb_planes_avx2; c->restore_rgb_planes10 = ff_restore_rgb_planes10_avx2; } +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/v210enc_init.c b/libavcodec/x86/v210enc_init.c index 13a351dd1d..542bfe8b8a 100644 --- a/libavcodec/x86/v210enc_init.c +++ b/libavcodec/x86/v210enc_init.c @@ -36,6 +36,7 @@ void ff_v210_planar_pack_10_avx2(const uint16_t *y, const uint16_t *u, av_cold void ff_v210enc_init_x86(V210EncContext *s) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSSE3(cpu_flags)) { @@ -52,4 +53,5 @@ av_cold void ff_v210enc_init_x86(V210EncContext *s) s->sample_factor_10 = 2; s->pack_line_10 = ff_v210_planar_pack_10_avx2; } +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/vorbisdsp_init.c b/libavcodec/x86/vorbisdsp_init.c index 08a3bb2965..067b92e2a4 100644 --- a/libavcodec/x86/vorbisdsp_init.c +++ b/libavcodec/x86/vorbisdsp_init.c @@ -29,8 +29,10 @@ void ff_vorbis_inverse_coupling_sse(float *mag, float *ang, av_cold void ff_vorbisdsp_init_x86(VorbisDSPContext *dsp) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE(cpu_flags)) dsp->vorbis_inverse_coupling = ff_vorbis_inverse_coupling_sse; +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/vp3dsp_init.c b/libavcodec/x86/vp3dsp_init.c index f54fa57b3e..7d69956d22 100644 --- a/libavcodec/x86/vp3dsp_init.c +++ b/libavcodec/x86/vp3dsp_init.c @@ -42,6 +42,7 @@ void ff_put_vp_no_rnd_pixels8_l2_mmx(uint8_t *dst, const uint8_t *a, av_cold void ff_vp3dsp_init_x86(VP3DSPContext *c, int flags) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_MMX(cpu_flags)) { @@ -61,4 +62,5 @@ av_cold void ff_vp3dsp_init_x86(VP3DSPContext *c, int flags) c->idct_put = ff_vp3_idct_put_sse2; c->idct_add = ff_vp3_idct_add_sse2; } +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/vp6dsp_init.c b/libavcodec/x86/vp6dsp_init.c index 83d45ec36c..6a3bf36bae 100644 --- a/libavcodec/x86/vp6dsp_init.c +++ b/libavcodec/x86/vp6dsp_init.c @@ -30,9 +30,11 @@ void ff_vp6_filter_diag4_sse2(uint8_t *dst, uint8_t *src, ptrdiff_t stride, av_cold void ff_vp6dsp_init_x86(VP56DSPContext *c) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE2(cpu_flags)) { c->vp6_filter_diag4 = ff_vp6_filter_diag4_sse2; } +#endif /* HAVE_X86ASM */ } diff --git a/libavfilter/x86/af_afir_init.c b/libavfilter/x86/af_afir_init.c index e53817b9c0..3561d9fe3f 100644 --- a/libavfilter/x86/af_afir_init.c +++ b/libavfilter/x86/af_afir_init.c @@ -29,6 +29,7 @@ void ff_fcmul_add_avx(float *sum, const float *t, const float *c, av_cold void ff_afir_init_x86(AudioFIRDSPContext *s) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE3(cpu_flags)) { @@ -37,4 +38,5 @@ av_cold void ff_afir_init_x86(AudioFIRDSPContext *s) if (EXTERNAL_AVX_FAST(cpu_flags)) { s->fcmul_add = ff_fcmul_add_avx; } +#endif /* HAVE_X86ASM */ } diff --git a/libavfilter/x86/af_anlmdn_init.c b/libavfilter/x86/af_anlmdn_init.c index 30eff6f644..047d88b795 100644 --- a/libavfilter/x86/af_anlmdn_init.c +++ b/libavfilter/x86/af_anlmdn_init.c @@ -27,9 +27,11 @@ float ff_compute_distance_ssd_sse(const float *f1, const float *f2, av_cold void ff_anlmdn_init_x86(AudioNLMDNDSPContext *s) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE(cpu_flags)) { s->compute_distance_ssd = ff_compute_distance_ssd_sse; } +#endif /* HAVE_X86ASM */ } diff --git a/libavfilter/x86/af_volume_init.c b/libavfilter/x86/af_volume_init.c index 88f5a9679a..28cfbe1ce1 100644 --- a/libavfilter/x86/af_volume_init.c +++ b/libavfilter/x86/af_volume_init.c @@ -35,6 +35,7 @@ void ff_scale_samples_s32_avx(uint8_t *dst, const uint8_t *src, int len, av_cold void ff_volume_init_x86(VolumeContext *vol) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); enum AVSampleFormat sample_fmt = av_get_packed_sample_fmt(vol->sample_fmt); @@ -57,4 +58,5 @@ av_cold void ff_volume_init_x86(VolumeContext *vol) vol->samples_align = 8; } } +#endif /* HAVE_X86ASM */ } diff --git a/libavfilter/x86/avf_showcqt_init.c b/libavfilter/x86/avf_showcqt_init.c index 2320b30239..1a5534a12e 100644 --- a/libavfilter/x86/avf_showcqt_init.c +++ b/libavfilter/x86/avf_showcqt_init.c @@ -46,6 +46,7 @@ static void permute_coeffs_01452367(float *v, int len) av_cold void ff_showcqt_init_x86(ShowCQTContext *s) { +#if HAVE_X86ASM int cpuflags = av_get_cpu_flags(); #define SELECT_CQT_CALC(type, TYPE, align, perm) \ @@ -60,4 +61,5 @@ if (EXTERNAL_##TYPE(cpuflags)) { \ SELECT_CQT_CALC(fma4, FMA4, 4, 0); // using xmm SELECT_CQT_CALC(avx, AVX_FAST, 8, 01452367); SELECT_CQT_CALC(fma3, FMA3_FAST, 8, 01452367); +#endif /* HAVE_X86ASM */ } diff --git a/libavfilter/x86/colorspacedsp_init.c b/libavfilter/x86/colorspacedsp_init.c index f01db4baf4..66c25cb361 100644 --- a/libavfilter/x86/colorspacedsp_init.c +++ b/libavfilter/x86/colorspacedsp_init.c @@ -78,6 +78,7 @@ void ff_multiply3x3_sse2(int16_t *data[3], ptrdiff_t stride, int w, int h, void ff_colorspacedsp_x86_init(ColorSpaceDSPContext *dsp) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); #if ARCH_X86_64 @@ -118,4 +119,5 @@ void ff_colorspacedsp_x86_init(ColorSpaceDSPContext *dsp) dsp->multiply3x3 = ff_multiply3x3_sse2; } #endif +#endif /* HAVE_X86ASM */ } diff --git a/libavfilter/x86/vf_atadenoise_init.c b/libavfilter/x86/vf_atadenoise_init.c index eb621e172c..8ec98f1a82 100644 --- a/libavfilter/x86/vf_atadenoise_init.c +++ b/libavfilter/x86/vf_atadenoise_init.c @@ -36,6 +36,7 @@ void ff_atadenoise_filter_row8_serial_sse4(const uint8_t *src, uint8_t *dst, av_cold void ff_atadenoise_init_x86(ATADenoiseDSPContext *dsp, int depth, int algorithm, const float *sigma) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); for (int p = 0; p < 4; p++) { @@ -49,4 +50,5 @@ av_cold void ff_atadenoise_init_x86(ATADenoiseDSPContext *dsp, int depth, int al } #endif } +#endif /* HAVE_X86ASM */ } diff --git a/libavfilter/x86/vf_blend_init.c b/libavfilter/x86/vf_blend_init.c index c326c43362..6d57bf7eac 100644 --- a/libavfilter/x86/vf_blend_init.c +++ b/libavfilter/x86/vf_blend_init.c @@ -102,6 +102,7 @@ BLEND_FUNC(xor_16, avx2) av_cold void ff_blend_init_x86(FilterParams *param, int depth) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (depth == 8) { @@ -200,4 +201,5 @@ av_cold void ff_blend_init_x86(FilterParams *param, int depth) } #endif /* ARCH_X86_64 */ } +#endif /* HAVE_X86ASM */ } diff --git a/libavfilter/x86/vf_bwdif_init.c b/libavfilter/x86/vf_bwdif_init.c index e24e5cd9b1..ec0ee6af85 100644 --- a/libavfilter/x86/vf_bwdif_init.c +++ b/libavfilter/x86/vf_bwdif_init.c @@ -44,6 +44,7 @@ void ff_bwdif_filter_line_12bit_ssse3(void *dst, void *prev, void *cur, void *ne av_cold void ff_bwdif_init_x86(BWDIFContext *bwdif) { +#if HAVE_X86ASM YADIFContext *yadif = &bwdif->yadif; int cpu_flags = av_get_cpu_flags(); int bit_depth = (!yadif->csp) ? 8 : yadif->csp->comp[0].depth; @@ -59,4 +60,5 @@ av_cold void ff_bwdif_init_x86(BWDIFContext *bwdif) if (EXTERNAL_SSSE3(cpu_flags)) bwdif->filter_line = ff_bwdif_filter_line_12bit_ssse3; } +#endif /* HAVE_X86ASM */ } diff --git a/libavfilter/x86/vf_convolution_init.c b/libavfilter/x86/vf_convolution_init.c index b78a47d02b..fc9cd49de7 100644 --- a/libavfilter/x86/vf_convolution_init.c +++ b/libavfilter/x86/vf_convolution_init.c @@ -31,6 +31,7 @@ void ff_filter_3x3_sse4(uint8_t *dst, int width, av_cold void ff_convolution_init_x86(ConvolutionContext *s) { +#if HAVE_X86ASM #if ARCH_X86_64 int i; int cpu_flags = av_get_cpu_flags(); @@ -43,4 +44,5 @@ av_cold void ff_convolution_init_x86(ConvolutionContext *s) } } #endif +#endif /* HAVE_X86ASM */ } diff --git a/libavfilter/x86/vf_framerate_init.c b/libavfilter/x86/vf_framerate_init.c index 9d40faf0a4..b4a9dc574d 100644 --- a/libavfilter/x86/vf_framerate_init.c +++ b/libavfilter/x86/vf_framerate_init.c @@ -27,6 +27,7 @@ void ff_blend_frames16_avx2(BLEND_FUNC_PARAMS); void ff_framerate_init_x86(FrameRateContext *s) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (s->bitdepth == 8) { if (EXTERNAL_AVX2_FAST(cpu_flags)) @@ -39,4 +40,5 @@ void ff_framerate_init_x86(FrameRateContext *s) else if (EXTERNAL_SSE4(cpu_flags)) s->blend = ff_blend_frames16_sse4; } +#endif /* HAVE_X86ASM */ } diff --git a/libavfilter/x86/vf_fspp_init.c b/libavfilter/x86/vf_fspp_init.c index 8e00317cb7..3618b70dc3 100644 --- a/libavfilter/x86/vf_fspp_init.c +++ b/libavfilter/x86/vf_fspp_init.c @@ -36,6 +36,7 @@ void ff_row_fdct_mmx(int16_t *data, const uint8_t *pixels, ptrdiff_t line_size, av_cold void ff_fspp_init_x86(FSPPContext *s) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_MMX(cpu_flags)) { @@ -46,4 +47,5 @@ av_cold void ff_fspp_init_x86(FSPPContext *s) s->row_idct = ff_row_idct_mmx; s->row_fdct = ff_row_fdct_mmx; } +#endif /* HAVE_X86ASM */ } diff --git a/libavfilter/x86/vf_gblur_init.c b/libavfilter/x86/vf_gblur_init.c index b47f6fbffb..01e1b82131 100644 --- a/libavfilter/x86/vf_gblur_init.c +++ b/libavfilter/x86/vf_gblur_init.c @@ -39,6 +39,7 @@ void ff_verti_slice_avx512(float *buffer, int width, int height, int column_begi av_cold void ff_gblur_init_x86(GBlurContext *s) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE(cpu_flags)) { @@ -70,4 +71,5 @@ av_cold void ff_gblur_init_x86(GBlurContext *s) } } #endif +#endif /* HAVE_X86ASM */ } diff --git a/libavfilter/x86/vf_hflip_init.c b/libavfilter/x86/vf_hflip_init.c index 0ac399b0d4..743b368ee9 100644 --- a/libavfilter/x86/vf_hflip_init.c +++ b/libavfilter/x86/vf_hflip_init.c @@ -30,6 +30,7 @@ void ff_hflip_short_avx2(const uint8_t *src, uint8_t *dst, int w); av_cold void ff_hflip_init_x86(FlipContext *s, int step[4], int nb_planes) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); int i; @@ -50,4 +51,5 @@ av_cold void ff_hflip_init_x86(FlipContext *s, int step[4], int nb_planes) } } } +#endif /* HAVE_X86ASM */ } diff --git a/libavfilter/x86/vf_limiter_init.c b/libavfilter/x86/vf_limiter_init.c index 07c733dc21..2c26f90f0f 100644 --- a/libavfilter/x86/vf_limiter_init.c +++ b/libavfilter/x86/vf_limiter_init.c @@ -29,6 +29,7 @@ void ff_limiter_16bit_sse4(const uint8_t *src, uint8_t *dst, void ff_limiter_init_x86(LimiterDSPContext *dsp, int bpp) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE2(cpu_flags)) { @@ -41,4 +42,5 @@ void ff_limiter_init_x86(LimiterDSPContext *dsp, int bpp) dsp->limiter = ff_limiter_16bit_sse4; } } +#endif /* HAVE_X86ASM */ } diff --git a/libavfilter/x86/vf_maskedclamp_init.c b/libavfilter/x86/vf_maskedclamp_init.c index 2a5388abac..94217cf485 100644 --- a/libavfilter/x86/vf_maskedclamp_init.c +++ b/libavfilter/x86/vf_maskedclamp_init.c @@ -34,6 +34,7 @@ void ff_maskedclamp16_sse4(const uint8_t *bsrc, uint8_t *dst, av_cold void ff_maskedclamp_init_x86(MaskedClampDSPContext *dsp, int depth) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE2(cpu_flags) && depth <= 8) { @@ -43,4 +44,5 @@ av_cold void ff_maskedclamp_init_x86(MaskedClampDSPContext *dsp, int depth) if (EXTERNAL_SSE4(cpu_flags) && depth > 8) { dsp->maskedclamp = ff_maskedclamp16_sse4; } +#endif /* HAVE_X86ASM */ } diff --git a/libavfilter/x86/vf_maskedmerge_init.c b/libavfilter/x86/vf_maskedmerge_init.c index 73ab888083..2eee4a36c2 100644 --- a/libavfilter/x86/vf_maskedmerge_init.c +++ b/libavfilter/x86/vf_maskedmerge_init.c @@ -32,9 +32,11 @@ void ff_maskedmerge8_sse2(const uint8_t *bsrc, const uint8_t *osrc, av_cold void ff_maskedmerge_init_x86(MaskedMergeContext *s) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE2(cpu_flags) && s->depth == 8) { s->maskedmerge = ff_maskedmerge8_sse2; } +#endif /* HAVE_X86ASM */ } diff --git a/libavfilter/x86/vf_overlay_init.c b/libavfilter/x86/vf_overlay_init.c index d4218b18f6..9f7d9c4909 100644 --- a/libavfilter/x86/vf_overlay_init.c +++ b/libavfilter/x86/vf_overlay_init.c @@ -35,6 +35,7 @@ int ff_overlay_row_22_sse4(uint8_t *d, uint8_t *da, uint8_t *s, uint8_t *a, av_cold void ff_overlay_init_x86(OverlayContext *s, int format, int pix_format, int alpha_format, int main_has_alpha) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE4(cpu_flags) && @@ -62,4 +63,5 @@ av_cold void ff_overlay_init_x86(OverlayContext *s, int format, int pix_format, s->blend_row[1] = ff_overlay_row_22_sse4; s->blend_row[2] = ff_overlay_row_22_sse4; } +#endif /* HAVE_X86ASM */ } diff --git a/libavfilter/x86/vf_pp7_init.c b/libavfilter/x86/vf_pp7_init.c index 165b0dd5d0..ed5ab82794 100644 --- a/libavfilter/x86/vf_pp7_init.c +++ b/libavfilter/x86/vf_pp7_init.c @@ -27,8 +27,10 @@ void ff_pp7_dctB_mmx(int16_t *dst, int16_t *src); av_cold void ff_pp7_init_x86(PP7Context *p) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_MMX(cpu_flags)) p->dctB = ff_pp7_dctB_mmx; +#endif /* HAVE_X86ASM */ } diff --git a/libavfilter/x86/vf_psnr_init.c b/libavfilter/x86/vf_psnr_init.c index c387812204..82be86d923 100644 --- a/libavfilter/x86/vf_psnr_init.c +++ b/libavfilter/x86/vf_psnr_init.c @@ -27,6 +27,7 @@ uint64_t ff_sse_line_16bit_sse2(const uint8_t *buf, const uint8_t *ref, int w); void ff_psnr_init_x86(PSNRDSPContext *dsp, int bpp) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE2(cpu_flags)) { @@ -36,4 +37,5 @@ void ff_psnr_init_x86(PSNRDSPContext *dsp, int bpp) dsp->sse_line = ff_sse_line_16bit_sse2; } } +#endif /* HAVE_X86ASM */ } diff --git a/libavfilter/x86/vf_removegrain_init.c b/libavfilter/x86/vf_removegrain_init.c index 07314b3244..ff5f4771d2 100644 --- a/libavfilter/x86/vf_removegrain_init.c +++ b/libavfilter/x86/vf_removegrain_init.c @@ -49,6 +49,7 @@ void ff_rg_fl_mode_24_sse2(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int pix av_cold void ff_removegrain_init_x86(RemoveGrainContext *rg) { +#if HAVE_X86ASM #if CONFIG_GPL int cpu_flags = av_get_cpu_flags(); int i; @@ -85,4 +86,5 @@ av_cold void ff_removegrain_init_x86(RemoveGrainContext *rg) } } #endif /* CONFIG_GPL */ +#endif /* HAVE_X86ASM */ } diff --git a/libavfilter/x86/vf_ssim_init.c b/libavfilter/x86/vf_ssim_init.c index ddc91f791a..b5c55bd875 100644 --- a/libavfilter/x86/vf_ssim_init.c +++ b/libavfilter/x86/vf_ssim_init.c @@ -32,6 +32,7 @@ double ff_ssim_end_line_sse4(const int (*sum0)[4], const int (*sum1)[4], int w); void ff_ssim_init_x86(SSIMDSPContext *dsp) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); #if ARCH_X86_64 @@ -42,4 +43,5 @@ void ff_ssim_init_x86(SSIMDSPContext *dsp) dsp->ssim_end_line = ff_ssim_end_line_sse4; if (EXTERNAL_XOP(cpu_flags)) dsp->ssim_4x4_line = ff_ssim_4x4_line_xop; +#endif /* HAVE_X86ASM */ } diff --git a/libavfilter/x86/vf_stereo3d_init.c b/libavfilter/x86/vf_stereo3d_init.c index da160a89a0..abd682ee80 100644 --- a/libavfilter/x86/vf_stereo3d_init.c +++ b/libavfilter/x86/vf_stereo3d_init.c @@ -29,9 +29,11 @@ void ff_anaglyph_sse4(uint8_t *dst, uint8_t *lsrc, uint8_t *rsrc, void ff_stereo3d_init_x86(Stereo3DDSPContext *dsp) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE4(cpu_flags)) { dsp->anaglyph = ff_anaglyph_sse4; } +#endif /* HAVE_X86ASM */ } diff --git a/libavfilter/x86/vf_threshold_init.c b/libavfilter/x86/vf_threshold_init.c index 8e42296791..151a94f429 100644 --- a/libavfilter/x86/vf_threshold_init.c +++ b/libavfilter/x86/vf_threshold_init.c @@ -39,6 +39,7 @@ THRESHOLD_FUNC(16, avx2) av_cold void ff_threshold_init_x86(ThresholdContext *s) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (s->depth == 8) { @@ -56,4 +57,5 @@ av_cold void ff_threshold_init_x86(ThresholdContext *s) s->threshold = ff_threshold16_avx2; } } +#endif /* HAVE_X86ASM */ } diff --git a/libavfilter/x86/vf_tinterlace_init.c b/libavfilter/x86/vf_tinterlace_init.c index 1c25a2bb7a..c30a3247a2 100644 --- a/libavfilter/x86/vf_tinterlace_init.c +++ b/libavfilter/x86/vf_tinterlace_init.c @@ -56,6 +56,7 @@ void ff_lowpass_line_complex_12_sse2(uint8_t *dstp, ptrdiff_t linesize, av_cold void ff_tinterlace_init_x86(TInterlaceContext *s) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (s->csp->comp[0].depth > 8) { @@ -89,4 +90,5 @@ av_cold void ff_tinterlace_init_x86(TInterlaceContext *s) } } } +#endif /* HAVE_X86ASM */ } diff --git a/libavfilter/x86/vf_transpose_init.c b/libavfilter/x86/vf_transpose_init.c index 95c56eab73..7db2e66258 100644 --- a/libavfilter/x86/vf_transpose_init.c +++ b/libavfilter/x86/vf_transpose_init.c @@ -36,6 +36,7 @@ void ff_transpose_8x8_16_sse2(uint8_t *src, av_cold void ff_transpose_init_x86(TransVtable *v, int pixstep) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE2(cpu_flags) && pixstep == 1) { @@ -45,4 +46,5 @@ av_cold void ff_transpose_init_x86(TransVtable *v, int pixstep) if (EXTERNAL_SSE2(cpu_flags) && pixstep == 2) { v->transpose_8x8 = ff_transpose_8x8_16_sse2; } +#endif /* HAVE_X86ASM */ } diff --git a/libavfilter/x86/vf_v360_init.c b/libavfilter/x86/vf_v360_init.c index 2b2b06dd40..6b1b3811aa 100644 --- a/libavfilter/x86/vf_v360_init.c +++ b/libavfilter/x86/vf_v360_init.c @@ -43,6 +43,7 @@ void ff_remap2_16bit_line_avx2(uint8_t *dst, int width, const uint8_t *src, ptrd av_cold void ff_v360_init_x86(V360Context *s, int depth) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_AVX2_FAST(cpu_flags) && s->interp == NEAREST && depth <= 8) @@ -68,4 +69,5 @@ av_cold void ff_v360_init_x86(V360Context *s, int depth) s->interp == MITCHELL) && depth <= 8) s->remap_line = ff_remap4_8bit_line_avx2; #endif +#endif /* HAVE_X86ASM */ } diff --git a/libavfilter/x86/vf_w3fdif_init.c b/libavfilter/x86/vf_w3fdif_init.c index 6d677d651d..d023ef7a49 100644 --- a/libavfilter/x86/vf_w3fdif_init.c +++ b/libavfilter/x86/vf_w3fdif_init.c @@ -47,6 +47,7 @@ void ff_w3fdif_scale_sse2(uint8_t *out_pixel, const int32_t *work_pixel, av_cold void ff_w3fdif_init_x86(W3FDIFDSPContext *dsp, int depth) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE2(cpu_flags) && depth <= 8) { @@ -61,4 +62,5 @@ av_cold void ff_w3fdif_init_x86(W3FDIFDSPContext *dsp, int depth) dsp->filter_complex_high = ff_w3fdif_complex_high_sse2; } #endif +#endif /* HAVE_X86ASM */ } diff --git a/libavfilter/x86/vf_yadif_init.c b/libavfilter/x86/vf_yadif_init.c index 257c3f9199..54917fa104 100644 --- a/libavfilter/x86/vf_yadif_init.c +++ b/libavfilter/x86/vf_yadif_init.c @@ -49,6 +49,7 @@ void ff_yadif_filter_line_10bit_ssse3(void *dst, void *prev, void *cur, av_cold void ff_yadif_init_x86(YADIFContext *yadif) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); int bit_depth = (!yadif->csp) ? 8 : yadif->csp->comp[0].depth; @@ -71,4 +72,5 @@ av_cold void ff_yadif_init_x86(YADIFContext *yadif) if (EXTERNAL_SSSE3(cpu_flags)) yadif->filter_line = ff_yadif_filter_line_ssse3; } +#endif /* HAVE_X86ASM */ } diff --git a/libavutil/x86/fixed_dsp_init.c b/libavutil/x86/fixed_dsp_init.c index d3f4b2e325..eb84027dbf 100644 --- a/libavutil/x86/fixed_dsp_init.c +++ b/libavutil/x86/fixed_dsp_init.c @@ -27,9 +27,11 @@ void ff_butterflies_fixed_sse2(int *av_restrict src0, int *av_restrict src1, int av_cold void ff_fixed_dsp_init_x86(AVFixedDSPContext *fdsp) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE2(cpu_flags)) { fdsp->butterflies_fixed = ff_butterflies_fixed_sse2; } +#endif /* HAVE_X86ASM */ } diff --git a/libavutil/x86/float_dsp_init.c b/libavutil/x86/float_dsp_init.c index ad6b506259..7495c0b9a8 100644 --- a/libavutil/x86/float_dsp_init.c +++ b/libavutil/x86/float_dsp_init.c @@ -80,6 +80,7 @@ void ff_butterflies_float_sse(float *av_restrict src0, float *av_restrict src1, av_cold void ff_float_dsp_init_x86(AVFloatDSPContext *fdsp) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE(cpu_flags)) { @@ -115,4 +116,5 @@ av_cold void ff_float_dsp_init_x86(AVFloatDSPContext *fdsp) fdsp->vector_dmac_scalar = ff_vector_dmac_scalar_fma3; fdsp->scalarproduct_float = ff_scalarproduct_float_fma3; } +#endif /* HAVE_X86ASM */ } diff --git a/libavutil/x86/imgutils_init.c b/libavutil/x86/imgutils_init.c index 91a16cf594..feac5d6fc7 100644 --- a/libavutil/x86/imgutils_init.c +++ b/libavutil/x86/imgutils_init.c @@ -34,6 +34,7 @@ int ff_image_copy_plane_uc_from_x86(uint8_t *dst, ptrdiff_t dst_linesize, const uint8_t *src, ptrdiff_t src_linesize, ptrdiff_t bytewidth, int height) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); ptrdiff_t bw_aligned = FFALIGN(bytewidth, 64); @@ -42,6 +43,7 @@ int ff_image_copy_plane_uc_from_x86(uint8_t *dst, ptrdiff_t dst_linesize, ff_image_copy_plane_uc_from_sse4(dst, dst_linesize, src, src_linesize, bw_aligned, height); else +#endif /* HAVE_X86ASM */ return AVERROR(ENOSYS); return 0; diff --git a/libavutil/x86/lls_init.c b/libavutil/x86/lls_init.c index c786376915..67470185da 100644 --- a/libavutil/x86/lls_init.c +++ b/libavutil/x86/lls_init.c @@ -31,6 +31,7 @@ double ff_evaluate_lls_sse2(LLSModel *m, const double *var, int order); av_cold void ff_init_lls_x86(LLSModel *m) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE2(cpu_flags)) { m->update_lls = ff_update_lls_sse2; @@ -43,4 +44,5 @@ av_cold void ff_init_lls_x86(LLSModel *m) if (EXTERNAL_FMA3_FAST(cpu_flags)) { m->update_lls = ff_update_lls_fma3; } +#endif /* HAVE_X86ASM */ } diff --git a/libavutil/x86/pixelutils_init.c b/libavutil/x86/pixelutils_init.c index c3c0662414..a2f842041d 100644 --- a/libavutil/x86/pixelutils_init.c +++ b/libavutil/x86/pixelutils_init.c @@ -47,6 +47,7 @@ int ff_pixelutils_sad_u_32x32_avx2(const uint8_t *src1, ptrdiff_t stride1, void ff_pixelutils_sad_init_x86(av_pixelutils_sad_fn *sad, int aligned) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); // The best way to use SSE2 would be to do 2 SADs in parallel, @@ -82,4 +83,5 @@ void ff_pixelutils_sad_init_x86(av_pixelutils_sad_fn *sad, int aligned) case 2: sad[4] = ff_pixelutils_sad_a_32x32_avx2; break; // src1 aligned, src2 aligned } } +#endif /* HAVE_X86ASM */ } diff --git a/libswresample/x86/audio_convert_init.c b/libswresample/x86/audio_convert_init.c index f6d36f9ca6..d9eb43e1d5 100644 --- a/libswresample/x86/audio_convert_init.c +++ b/libswresample/x86/audio_convert_init.c @@ -52,6 +52,7 @@ av_cold void swri_audio_convert_init_x86(struct AudioConvert *ac, ac->simd_f = ff_int32_to_int16_a_ ## cap;\ } +#if HAVE_X86ASM MULTI_CAPS_FUNC(SSE2, sse2) if(EXTERNAL_SSE(mm_flags)) { @@ -172,4 +173,5 @@ MULTI_CAPS_FUNC(SSE2, sse2) if( out_fmt == AV_SAMPLE_FMT_S32 && in_fmt == AV_SAMPLE_FMT_FLT || out_fmt == AV_SAMPLE_FMT_S32P && in_fmt == AV_SAMPLE_FMT_FLTP) ac->simd_f = ff_float_to_int32_a_avx2; } +#endif /* HAVE_X86ASM */ } diff --git a/libswresample/x86/resample_init.c b/libswresample/x86/resample_init.c index d13ccd4833..4eebf5d6f9 100644 --- a/libswresample/x86/resample_init.c +++ b/libswresample/x86/resample_init.c @@ -51,6 +51,7 @@ av_cold void swri_resample_dsp_x86_init(ResampleContext *c) switch(c->format){ case AV_SAMPLE_FMT_S16P: +#if HAVE_X86ASM if (EXTERNAL_SSE2(mm_flags)) { c->dsp.resample_linear = ff_resample_linear_int16_sse2; c->dsp.resample_common = ff_resample_common_int16_sse2; @@ -59,8 +60,10 @@ av_cold void swri_resample_dsp_x86_init(ResampleContext *c) c->dsp.resample_linear = ff_resample_linear_int16_xop; c->dsp.resample_common = ff_resample_common_int16_xop; } +#endif /* HAVE_X86ASM */ break; case AV_SAMPLE_FMT_FLTP: +#if HAVE_X86ASM if (EXTERNAL_SSE(mm_flags)) { c->dsp.resample_linear = ff_resample_linear_float_sse; c->dsp.resample_common = ff_resample_common_float_sse; @@ -77,8 +80,10 @@ av_cold void swri_resample_dsp_x86_init(ResampleContext *c) c->dsp.resample_linear = ff_resample_linear_float_fma4; c->dsp.resample_common = ff_resample_common_float_fma4; } +#endif /* HAVE_X86ASM */ break; case AV_SAMPLE_FMT_DBLP: +#if HAVE_X86ASM if (EXTERNAL_SSE2(mm_flags)) { c->dsp.resample_linear = ff_resample_linear_double_sse2; c->dsp.resample_common = ff_resample_common_double_sse2; @@ -91,6 +96,7 @@ av_cold void swri_resample_dsp_x86_init(ResampleContext *c) c->dsp.resample_linear = ff_resample_linear_double_fma3; c->dsp.resample_common = ff_resample_common_double_fma3; } +#endif /* HAVE_X86ASM */ break; } } diff --git a/libswscale/x86/rgb2rgb.c b/libswscale/x86/rgb2rgb.c index b325e5dbd5..e39f327bf2 100644 --- a/libswscale/x86/rgb2rgb.c +++ b/libswscale/x86/rgb2rgb.c @@ -151,6 +151,7 @@ av_cold void rgb2rgb_init_x86(void) rgb2rgb_init_avx(); #endif /* HAVE_INLINE_ASM */ +#if HAVE_X86ASM if (EXTERNAL_MMXEXT(cpu_flags)) { shuffle_bytes_2103 = ff_shuffle_bytes_2103_mmxext; } @@ -178,4 +179,5 @@ av_cold void rgb2rgb_init_x86(void) uyvytoyuv422 = ff_uyvytoyuv422_avx; } #endif +#endif /* HAVE_X86ASM */ } diff --git a/libswscale/x86/swscale.c b/libswscale/x86/swscale.c index ff16398988..0a14262916 100644 --- a/libswscale/x86/swscale.c +++ b/libswscale/x86/swscale.c @@ -529,6 +529,7 @@ switch(c->dstBpc){ \ else ASSIGN_SCALE_FUNC2(hscalefn, X8, opt1, opt2); \ break; \ } +#if HAVE_X86ASM if (EXTERNAL_SSE2(cpu_flags)) { ASSIGN_SSE_SCALE_FUNC(c->hyScale, c->hLumFilterSize, sse2, sse2); ASSIGN_SSE_SCALE_FUNC(c->hcScale, c->hChrFilterSize, sse2, sse2); @@ -805,4 +806,5 @@ switch(c->dstBpc){ \ } #endif +#endif /* HAVE_X86ASM */ } From patchwork Thu Nov 3 15:30:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "L. E. Segovia" X-Patchwork-Id: 39149 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:999a:b0:a4:2148:650a with SMTP id ve26csp614819pzb; Thu, 3 Nov 2022 08:31:24 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6k52inNFKFHwIT/sON2g6ZA82F+mH82Xx9BcrFLdIR/iJ/lbjBghwV57xCIV6oZGTwSGIA X-Received: by 2002:a17:907:a0c7:b0:7ad:dc65:bf8e with SMTP id hw7-20020a170907a0c700b007addc65bf8emr19031604ejc.133.1667489484672; Thu, 03 Nov 2022 08:31:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667489484; cv=none; d=google.com; s=arc-20160816; b=r/+BqXvgIXIqZ5sKsPJqnEMs4dtFOjuUH6yhOmdmxPKwQY26eUXIGVpNtU4TgUWB3r yGQTpuyGpu9q8ctsuPeFQIjnoZms39JM2GJ9OdHqMPGE8765zcze3eTN+XjRZNW4Dnnm V/YFQqC7DZJaDAgvI5UUbyQPYvaQ2Rajo6c7VWtLJGvQthv/fT7tp4IO3RLZWEpvknZz W3X0jpPW9+u9bzY8VMW3vNY+Ohs/hWwg1A2P67/Kp8qTi8On27ysl22oTdhJq3aq7Ep/ 2yyXJBNAhNdPQGm+UWOXZxTzyMqccpWqtKEvUBbedlNVvCP+Y5TklbgWyV4kpsPGKYRV JowQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=JEOSA1XFfdpO4VppVWNCx5Ogpykm/qJ66z2pp3vAidA=; b=swFoSXoqQcothUYScBEgsDxQ42xFABBjEAd8TmVs56V3nkM3IZKjQna0psz9scHDm2 Ar6ObZKu+rAR8OcldGQ6gOjFXLgAIsfYoAnV0H5Pt1HiflQrf3BLVYhOzTJqYr20YaGs rkJmaiX6fBjgb2J7hdU43LABGc/JFAj+t0q1eSw0WJfh0JhymKZfbm3epuNLAn7Iz5Kc UKVXP4o7fm8ofo0yxApFYsraULcI93Ut+JqJ3OlOvdUYMo3qDSvqXX7WZ9WEw53u00Pr 0bFPM/sZM7cuPsaU8MFIJVXFhxh5X9/sFTcnaA44+sBkgBYGyzYuqV/bGzLUYB8KmCYT HfJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@amyspark.me header.s=gm1 header.b=cHJ1CLBz; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amyspark.me Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id b9-20020a056402084900b00458ff6921e6si2110894edz.79.2022.11.03.08.31.23; Thu, 03 Nov 2022 08:31:24 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@amyspark.me header.s=gm1 header.b=cHJ1CLBz; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amyspark.me Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A6F1768BFB8; Thu, 3 Nov 2022 17:30:48 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 610DF68BFBA for ; Thu, 3 Nov 2022 17:30:47 +0200 (EET) Received: (Authenticated sender: amy@amyspark.me) by mail.gandi.net (Postfix) with ESMTPSA id 98637240013; Thu, 3 Nov 2022 15:30:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amyspark.me; s=gm1; t=1667489446; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TERa2xfdrh9rf5zbj50B+myj8v72XRSYexLlN5MkLSw=; b=cHJ1CLBzrs0mai6FEeT2ZleL0zhx9Rn5bE7PF/g12/qgP/DNaD5U6UfnQ0mHJonD01bGrT Spwc5zSYfAYWI90KFihoBnc/bt4c3ZqKm/bSN533cyhxA5taASMxt0mRZGCX3fosOowbcp LgsA84cxIBUtL407de5wevpFj4Z8ZPVWKWQA8pLyS0si/quCo8xSa5B80WfaWK1d6TDYkR RJNDMhwE6sx2Drb/e61kHB92xIlkFdrXPyszj5MW761IKpUTI/3Iy1xK/1bKb/Pg0mMDJD R8gkQR7mLBPDQhV2lEOTZOVrQgz665Y/b1ATZtKmnnhyrnNPrXciT6ff8auTWA== From: "L. E. Segovia" To: ffmpeg-devel@ffmpeg.org Date: Thu, 3 Nov 2022 15:30:14 +0000 Message-Id: <20221103153014.66226-6-amy@amyspark.me> X-Mailer: git-send-email 2.38.1 In-Reply-To: References: MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 5/5] all: Guard if (EXTERNAL*) checks with #if HAVE_X86ASM X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Nirbheek Chauhan , Halla Rempt , =?utf-8?q?Tim-Philipp_M=C3=BCller?= Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: ez5L8nMjNGWh Continuation of 40e6575aa3eed64cd32bf28c00ae57edc5acb25a Signed-off-by: L. E. Segovia --- libavcodec/x86/aacencdsp_init.c | 2 ++ libavcodec/x86/aacpsdsp_init.c | 2 ++ libavcodec/x86/ac3dsp_init.c | 4 ++++ libavcodec/x86/audiodsp_init.c | 2 ++ libavcodec/x86/bswapdsp_init.c | 2 ++ libavcodec/x86/cavsdsp.c | 2 ++ libavcodec/x86/celt_pvq_init.c | 2 ++ libavcodec/x86/cfhddsp_init.c | 2 ++ libavcodec/x86/cfhdencdsp_init.c | 2 ++ libavcodec/x86/dcadsp_init.c | 2 ++ libavcodec/x86/dct_init.c | 2 ++ libavcodec/x86/dnxhdenc_init.c | 2 ++ libavcodec/x86/exrdsp_init.c | 2 ++ libavcodec/x86/fft_init.c | 2 ++ libavcodec/x86/g722dsp_init.c | 2 ++ libavcodec/x86/h263dsp_init.c | 2 ++ libavcodec/x86/h264_intrapred_init.c | 2 ++ libavcodec/x86/h264chroma_init.c | 2 ++ libavcodec/x86/hevcdsp_init.c | 2 ++ libavcodec/x86/hpeldsp_init.c | 2 ++ libavcodec/x86/hpeldsp_vp3_init.c | 2 ++ libavcodec/x86/huffyuvdsp_init.c | 2 ++ libavcodec/x86/huffyuvencdsp_init.c | 2 ++ libavcodec/x86/idctdsp_init.c | 2 ++ libavcodec/x86/jpeg2000dsp_init.c | 2 ++ libavcodec/x86/lossless_videodsp_init.c | 2 ++ libavcodec/x86/lossless_videoencdsp_init.c | 2 ++ libavcodec/x86/mdct15_init.c | 2 ++ libavcodec/x86/me_cmp_init.c | 2 ++ libavcodec/x86/mlpdsp_init.c | 2 +- libavcodec/x86/mpegvideoencdsp_init.c | 2 ++ libavcodec/x86/opusdsp_init.c | 2 ++ libavcodec/x86/pixblockdsp_init.c | 2 ++ libavcodec/x86/pngdsp_init.c | 2 ++ libavcodec/x86/proresdsp_init.c | 2 ++ libavcodec/x86/rv34dsp_init.c | 2 ++ libavcodec/x86/sbcdsp_init.c | 2 ++ libavcodec/x86/sbrdsp_init.c | 2 ++ libavcodec/x86/svq1enc_init.c | 2 ++ libavcodec/x86/utvideodsp_init.c | 2 ++ libavcodec/x86/v210enc_init.c | 2 ++ libavcodec/x86/vc1dsp_init.c | 2 +- libavcodec/x86/vorbisdsp_init.c | 2 ++ libavcodec/x86/vp3dsp_init.c | 2 ++ libavcodec/x86/vp6dsp_init.c | 2 ++ libavfilter/x86/af_afir_init.c | 2 ++ libavfilter/x86/af_anlmdn_init.c | 2 ++ libavfilter/x86/af_volume_init.c | 2 ++ libavfilter/x86/avf_showcqt_init.c | 2 ++ libavfilter/x86/colorspacedsp_init.c | 2 ++ libavfilter/x86/vf_atadenoise_init.c | 2 ++ libavfilter/x86/vf_blend_init.c | 2 ++ libavfilter/x86/vf_bwdif_init.c | 2 ++ libavfilter/x86/vf_convolution_init.c | 2 +- libavfilter/x86/vf_framerate_init.c | 2 ++ libavfilter/x86/vf_fspp_init.c | 2 ++ libavfilter/x86/vf_gblur_init.c | 2 ++ libavfilter/x86/vf_hflip_init.c | 2 ++ libavfilter/x86/vf_limiter_init.c | 2 ++ libavfilter/x86/vf_maskedclamp_init.c | 2 ++ libavfilter/x86/vf_maskedmerge_init.c | 2 ++ libavfilter/x86/vf_overlay_init.c | 2 ++ libavfilter/x86/vf_pp7_init.c | 2 ++ libavfilter/x86/vf_psnr_init.c | 2 ++ libavfilter/x86/vf_removegrain_init.c | 2 ++ libavfilter/x86/vf_ssim_init.c | 2 ++ libavfilter/x86/vf_stereo3d_init.c | 2 ++ libavfilter/x86/vf_threshold_init.c | 2 ++ libavfilter/x86/vf_tinterlace_init.c | 2 ++ libavfilter/x86/vf_transpose_init.c | 2 ++ libavfilter/x86/vf_v360_init.c | 2 ++ libavfilter/x86/vf_w3fdif_init.c | 2 ++ libavfilter/x86/vf_yadif_init.c | 2 ++ libavutil/x86/fixed_dsp_init.c | 2 ++ libavutil/x86/float_dsp_init.c | 2 ++ libavutil/x86/imgutils_init.c | 2 ++ libavutil/x86/lls_init.c | 2 ++ libavutil/x86/pixelutils_init.c | 2 ++ libswresample/x86/audio_convert_init.c | 2 ++ libswresample/x86/resample_init.c | 6 ++++++ libswscale/x86/rgb2rgb.c | 2 ++ libswscale/x86/swscale.c | 2 ++ 82 files changed, 167 insertions(+), 3 deletions(-) diff --git a/libavcodec/x86/aacencdsp_init.c b/libavcodec/x86/aacencdsp_init.c index 049a2417d9..7dca1d481b 100644 --- a/libavcodec/x86/aacencdsp_init.c +++ b/libavcodec/x86/aacencdsp_init.c @@ -34,6 +34,7 @@ void ff_aac_quantize_bands_sse2(int *out, const float *in, const float *scaled, av_cold void ff_aac_dsp_init_x86(AACEncContext *s) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE(cpu_flags)) @@ -41,4 +42,5 @@ av_cold void ff_aac_dsp_init_x86(AACEncContext *s) if (EXTERNAL_SSE2(cpu_flags)) s->quant_bands = ff_aac_quantize_bands_sse2; +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/aacpsdsp_init.c b/libavcodec/x86/aacpsdsp_init.c index 0b0ee07db4..44d64f5340 100644 --- a/libavcodec/x86/aacpsdsp_init.c +++ b/libavcodec/x86/aacpsdsp_init.c @@ -51,6 +51,7 @@ void ff_ps_hybrid_analysis_ileave_sse(float (*out)[32][2], float L[2][38][64], av_cold void ff_psdsp_init_x86(PSDSPContext *s) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE(cpu_flags)) { @@ -71,4 +72,5 @@ av_cold void ff_psdsp_init_x86(PSDSPContext *s) if (EXTERNAL_FMA3(cpu_flags)) { s->hybrid_analysis = ff_ps_hybrid_analysis_fma3; } +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/ac3dsp_init.c b/libavcodec/x86/ac3dsp_init.c index 43b3b4ac85..76a8c0547d 100644 --- a/libavcodec/x86/ac3dsp_init.c +++ b/libavcodec/x86/ac3dsp_init.c @@ -35,6 +35,7 @@ void ff_ac3_extract_exponents_ssse3(uint8_t *exp, int32_t *coef, int nb_coefs); av_cold void ff_ac3dsp_init_x86(AC3DSPContext *c) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE2(cpu_flags)) { @@ -48,6 +49,7 @@ av_cold void ff_ac3dsp_init_x86(AC3DSPContext *c) if (!(cpu_flags & AV_CPU_FLAG_ATOM)) c->extract_exponents = ff_ac3_extract_exponents_ssse3; } +#endif /* HAVE_X86ASM */ } #define DOWNMIX_FUNC_OPT(ch, opt) \ @@ -68,6 +70,7 @@ DOWNMIX_FUNCS(fma3) void ff_ac3dsp_set_downmix_x86(AC3DSPContext *c) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); #define SET_DOWNMIX(ch, suf, SUF) \ @@ -91,4 +94,5 @@ void ff_ac3dsp_set_downmix_x86(AC3DSPContext *c) SET_DOWNMIX_ALL(avx, AVX) SET_DOWNMIX_ALL(fma3, FMA3) } +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/audiodsp_init.c b/libavcodec/x86/audiodsp_init.c index 68aa3b2129..c5f410678e 100644 --- a/libavcodec/x86/audiodsp_init.c +++ b/libavcodec/x86/audiodsp_init.c @@ -41,6 +41,7 @@ void ff_vector_clipf_sse(float *dst, const float *src, av_cold void ff_audiodsp_init_x86(AudioDSPContext *c) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE(cpu_flags)) @@ -59,4 +60,5 @@ av_cold void ff_audiodsp_init_x86(AudioDSPContext *c) if (EXTERNAL_AVX2_FAST(cpu_flags)) c->scalarproduct_int16 = ff_scalarproduct_int16_avx2; +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/bswapdsp_init.c b/libavcodec/x86/bswapdsp_init.c index 877bab1a2c..08551f6487 100644 --- a/libavcodec/x86/bswapdsp_init.c +++ b/libavcodec/x86/bswapdsp_init.c @@ -29,6 +29,7 @@ void ff_bswap32_buf_avx2(uint32_t *dst, const uint32_t *src, int w); av_cold void ff_bswapdsp_init_x86(BswapDSPContext *c) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE2(cpu_flags)) @@ -37,4 +38,5 @@ av_cold void ff_bswapdsp_init_x86(BswapDSPContext *c) c->bswap_buf = ff_bswap32_buf_ssse3; if (EXTERNAL_AVX2_FAST(cpu_flags)) c->bswap_buf = ff_bswap32_buf_avx2; +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/cavsdsp.c b/libavcodec/x86/cavsdsp.c index 4ad977a034..ad755e7321 100644 --- a/libavcodec/x86/cavsdsp.c +++ b/libavcodec/x86/cavsdsp.c @@ -383,6 +383,7 @@ av_cold void ff_cavsdsp_init_x86(CAVSDSPContext *c) DSPFUNC(avg, 1, 8, mmxext); } #endif +#if HAVE_X86ASM #if HAVE_MMX_EXTERNAL if (EXTERNAL_MMXEXT(cpu_flags)) { c->avg_cavs_qpel_pixels_tab[1][0] = avg_cavs_qpel8_mc00_mmxext; @@ -397,4 +398,5 @@ av_cold void ff_cavsdsp_init_x86(CAVSDSPContext *c) c->idct_perm = FF_IDCT_PERM_TRANSPOSE; } #endif +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/celt_pvq_init.c b/libavcodec/x86/celt_pvq_init.c index 5a0669e6f2..b88a2f6225 100644 --- a/libavcodec/x86/celt_pvq_init.c +++ b/libavcodec/x86/celt_pvq_init.c @@ -31,6 +31,7 @@ extern float ff_pvq_search_exact_avx (float *X, int *y, int K, int N); av_cold void ff_celt_pvq_init_x86(CeltPVQ *s) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE2(cpu_flags)) @@ -41,4 +42,5 @@ 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 /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/cfhddsp_init.c b/libavcodec/x86/cfhddsp_init.c index c5d89561ae..a773c365c1 100644 --- a/libavcodec/x86/cfhddsp_init.c +++ b/libavcodec/x86/cfhddsp_init.c @@ -40,6 +40,7 @@ void ff_cfhd_horiz_filter_clip12_sse2(int16_t *output, const int16_t *low, const av_cold void ff_cfhddsp_init_x86(CFHDDSPContext *c, int depth, int bayer) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE2(cpu_flags)) { @@ -50,4 +51,5 @@ av_cold void ff_cfhddsp_init_x86(CFHDDSPContext *c, int depth, int bayer) if (depth == 12 && !bayer) c->horiz_filter_clip = ff_cfhd_horiz_filter_clip12_sse2; } +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/cfhdencdsp_init.c b/libavcodec/x86/cfhdencdsp_init.c index 5cea39a80a..79b2f10bf7 100644 --- a/libavcodec/x86/cfhdencdsp_init.c +++ b/libavcodec/x86/cfhdencdsp_init.c @@ -38,6 +38,7 @@ void ff_cfhdenc_vert_filter_sse2(const int16_t *input, int16_t *low, int16_t *hi av_cold void ff_cfhdencdsp_init_x86(CFHDEncDSPContext *c) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); #if ARCH_X86_64 @@ -46,4 +47,5 @@ av_cold void ff_cfhdencdsp_init_x86(CFHDEncDSPContext *c) c->vert_filter = ff_cfhdenc_vert_filter_sse2; } #endif +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/dcadsp_init.c b/libavcodec/x86/dcadsp_init.c index 0c78dd1c9e..b407679f6a 100644 --- a/libavcodec/x86/dcadsp_init.c +++ b/libavcodec/x86/dcadsp_init.c @@ -34,6 +34,7 @@ LFE_FIR_FLOAT_FUNC(fma3) av_cold void ff_dcadsp_init_x86(DCADSPContext *s) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE2(cpu_flags)) @@ -46,4 +47,5 @@ av_cold void ff_dcadsp_init_x86(DCADSPContext *s) } if (EXTERNAL_FMA3(cpu_flags)) s->lfe_fir_float[0] = ff_lfe_fir0_float_fma3; +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/dct_init.c b/libavcodec/x86/dct_init.c index d0e4b34dd3..6756e1e12d 100644 --- a/libavcodec/x86/dct_init.c +++ b/libavcodec/x86/dct_init.c @@ -27,10 +27,12 @@ void ff_dct32_float_avx(FFTSample *out, const FFTSample *in); av_cold void ff_dct_init_x86(DCTContext *s) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE2(cpu_flags)) s->dct32 = ff_dct32_float_sse2; if (EXTERNAL_AVX_FAST(cpu_flags)) s->dct32 = ff_dct32_float_avx; +#endif } diff --git a/libavcodec/x86/dnxhdenc_init.c b/libavcodec/x86/dnxhdenc_init.c index fd6f15005a..612b70ad7a 100644 --- a/libavcodec/x86/dnxhdenc_init.c +++ b/libavcodec/x86/dnxhdenc_init.c @@ -30,8 +30,10 @@ void ff_get_pixels_8x4_sym_sse2(int16_t *block, const uint8_t *pixels, av_cold void ff_dnxhdenc_init_x86(DNXHDEncContext *ctx) { +#if HAVE_X86ASM if (EXTERNAL_SSE2(av_get_cpu_flags())) { if (ctx->cid_table->bit_depth == 8) ctx->get_pixels_8x4_sym = ff_get_pixels_8x4_sym_sse2; } +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/exrdsp_init.c b/libavcodec/x86/exrdsp_init.c index 63b3480d8f..f9696d7a91 100644 --- a/libavcodec/x86/exrdsp_init.c +++ b/libavcodec/x86/exrdsp_init.c @@ -34,6 +34,7 @@ void ff_predictor_avx2(uint8_t *src, ptrdiff_t size); av_cold void ff_exrdsp_init_x86(ExrDSPContext *dsp) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE2(cpu_flags)) { @@ -49,4 +50,5 @@ av_cold void ff_exrdsp_init_x86(ExrDSPContext *dsp) dsp->reorder_pixels = ff_reorder_pixels_avx2; dsp->predictor = ff_predictor_avx2; } +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/fft_init.c b/libavcodec/x86/fft_init.c index df79d57dc7..065e231edb 100644 --- a/libavcodec/x86/fft_init.c +++ b/libavcodec/x86/fft_init.c @@ -26,6 +26,7 @@ av_cold void ff_fft_init_x86(FFTContext *s) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (s->nbits > 16) @@ -44,4 +45,5 @@ av_cold void ff_fft_init_x86(FFTContext *s) s->fft_calc = ff_fft_calc_avx; s->fft_permutation = FF_FFT_PERM_AVX; } +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/g722dsp_init.c b/libavcodec/x86/g722dsp_init.c index 614695193b..700269d62a 100644 --- a/libavcodec/x86/g722dsp_init.c +++ b/libavcodec/x86/g722dsp_init.c @@ -28,8 +28,10 @@ void ff_g722_apply_qmf_sse2(const int16_t *prev_samples, int xout[2]); av_cold void ff_g722dsp_init_x86(G722DSPContext *dsp) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE2(cpu_flags)) dsp->apply_qmf = ff_g722_apply_qmf_sse2; +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/h263dsp_init.c b/libavcodec/x86/h263dsp_init.c index ab81063233..57ec1640e3 100644 --- a/libavcodec/x86/h263dsp_init.c +++ b/libavcodec/x86/h263dsp_init.c @@ -30,10 +30,12 @@ void ff_h263_v_loop_filter_mmx(uint8_t *src, int stride, int qscale); av_cold void ff_h263dsp_init_x86(H263DSPContext *c) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_MMX(cpu_flags)) { c->h263_h_loop_filter = ff_h263_h_loop_filter_mmx; c->h263_v_loop_filter = ff_h263_v_loop_filter_mmx; } +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/h264_intrapred_init.c b/libavcodec/x86/h264_intrapred_init.c index ee46927a24..5518961784 100644 --- a/libavcodec/x86/h264_intrapred_init.c +++ b/libavcodec/x86/h264_intrapred_init.c @@ -160,6 +160,7 @@ av_cold void ff_h264_pred_init_x86(H264PredContext *h, int codec_id, const int bit_depth, const int chroma_format_idc) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (bit_depth == 8) { @@ -333,4 +334,5 @@ av_cold void ff_h264_pred_init_x86(H264PredContext *h, int codec_id, h->pred8x8l[HOR_UP_PRED ] = ff_pred8x8l_horizontal_up_10_avx; } } +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/h264chroma_init.c b/libavcodec/x86/h264chroma_init.c index 34934b6ad0..57d92ad107 100644 --- a/libavcodec/x86/h264chroma_init.c +++ b/libavcodec/x86/h264chroma_init.c @@ -65,6 +65,7 @@ CHROMA_MC(avg, 8, 10, avx) av_cold void ff_h264chroma_init_x86(H264ChromaContext *c, int bit_depth) { +#if HAVE_X86ASM int high_bit_depth = bit_depth > 8; int cpu_flags = av_get_cpu_flags(); @@ -105,4 +106,5 @@ av_cold void ff_h264chroma_init_x86(H264ChromaContext *c, int bit_depth) c->put_h264_chroma_pixels_tab[0] = ff_put_h264_chroma_mc8_10_avx; c->avg_h264_chroma_pixels_tab[0] = ff_avg_h264_chroma_mc8_10_avx; } +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/hevcdsp_init.c b/libavcodec/x86/hevcdsp_init.c index c7060085a2..29c11246ae 100644 --- a/libavcodec/x86/hevcdsp_init.c +++ b/libavcodec/x86/hevcdsp_init.c @@ -699,6 +699,7 @@ SAO_EDGE_FILTER_FUNCS(12, avx2) void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (bit_depth == 8) { @@ -1150,4 +1151,5 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth) SAO_EDGE_INIT(12, avx2); } } +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/hpeldsp_init.c b/libavcodec/x86/hpeldsp_init.c index 6bde5a3893..99a1ab7310 100644 --- a/libavcodec/x86/hpeldsp_init.c +++ b/libavcodec/x86/hpeldsp_init.c @@ -229,6 +229,7 @@ av_cold void ff_hpeldsp_init_x86(HpelDSPContext *c, int flags) hpeldsp_init_mmx(c, flags); #endif +#if HAVE_X86ASM if (EXTERNAL_MMXEXT(cpu_flags)) hpeldsp_init_mmxext(c, flags); @@ -237,6 +238,7 @@ av_cold void ff_hpeldsp_init_x86(HpelDSPContext *c, int flags) if (EXTERNAL_SSSE3(cpu_flags)) hpeldsp_init_ssse3(c, flags); +#endif if (CONFIG_VP3_DECODER) ff_hpeldsp_vp3_init_x86(c, cpu_flags, flags); diff --git a/libavcodec/x86/hpeldsp_vp3_init.c b/libavcodec/x86/hpeldsp_vp3_init.c index 1dbd1ba6f9..3dd6c45afa 100644 --- a/libavcodec/x86/hpeldsp_vp3_init.c +++ b/libavcodec/x86/hpeldsp_vp3_init.c @@ -34,10 +34,12 @@ void ff_put_no_rnd_pixels8_y2_exact_mmxext(uint8_t *block, av_cold void ff_hpeldsp_vp3_init_x86(HpelDSPContext *c, int cpu_flags, int flags) { +#if HAVE_X86ASM if (EXTERNAL_MMXEXT(cpu_flags)) { if (flags & AV_CODEC_FLAG_BITEXACT) { c->put_no_rnd_pixels_tab[1][1] = ff_put_no_rnd_pixels8_x2_exact_mmxext; c->put_no_rnd_pixels_tab[1][2] = ff_put_no_rnd_pixels8_y2_exact_mmxext; } } +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/huffyuvdsp_init.c b/libavcodec/x86/huffyuvdsp_init.c index 239d3ca313..445137da87 100644 --- a/libavcodec/x86/huffyuvdsp_init.c +++ b/libavcodec/x86/huffyuvdsp_init.c @@ -35,6 +35,7 @@ void ff_add_hfyu_median_pred_int16_mmxext(uint16_t *dst, const uint16_t *top, co av_cold void ff_huffyuvdsp_init_x86(HuffYUVDSPContext *c, enum AVPixelFormat pix_fmt) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(pix_fmt); @@ -50,4 +51,5 @@ av_cold void ff_huffyuvdsp_init_x86(HuffYUVDSPContext *c, enum AVPixelFormat pix if (EXTERNAL_AVX2_FAST(cpu_flags)) { c->add_int16 = ff_add_int16_avx2; } +#endif } diff --git a/libavcodec/x86/huffyuvencdsp_init.c b/libavcodec/x86/huffyuvencdsp_init.c index c9c33b75b4..35d18a040c 100644 --- a/libavcodec/x86/huffyuvencdsp_init.c +++ b/libavcodec/x86/huffyuvencdsp_init.c @@ -37,6 +37,7 @@ void ff_sub_hfyu_median_pred_int16_mmxext(uint16_t *dst, const uint16_t *src1, c av_cold void ff_huffyuvencdsp_init_x86(HuffYUVEncDSPContext *c, enum AVPixelFormat pix_fmt) { +#if HAVE_X86ASM av_unused int cpu_flags = av_get_cpu_flags(); const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(pix_fmt); @@ -51,4 +52,5 @@ av_cold void ff_huffyuvencdsp_init_x86(HuffYUVEncDSPContext *c, enum AVPixelForm if (EXTERNAL_AVX2_FAST(cpu_flags)) { c->diff_int16 = ff_diff_int16_avx2; } +#endif } diff --git a/libavcodec/x86/idctdsp_init.c b/libavcodec/x86/idctdsp_init.c index 4ade52a880..3f74da85cd 100644 --- a/libavcodec/x86/idctdsp_init.c +++ b/libavcodec/x86/idctdsp_init.c @@ -61,6 +61,7 @@ av_cold int ff_init_scantable_permutation_x86(uint8_t *idct_permutation, av_cold void ff_idctdsp_init_x86(IDCTDSPContext *c, AVCodecContext *avctx, unsigned high_bit_depth) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); #if ARCH_X86_32 @@ -159,4 +160,5 @@ av_cold void ff_idctdsp_init_x86(IDCTDSPContext *c, AVCodecContext *avctx, } } #endif +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/jpeg2000dsp_init.c b/libavcodec/x86/jpeg2000dsp_init.c index 7310a1d0e1..0256be8046 100644 --- a/libavcodec/x86/jpeg2000dsp_init.c +++ b/libavcodec/x86/jpeg2000dsp_init.c @@ -33,6 +33,7 @@ void ff_rct_int_avx2 (void *src0, void *src1, void *src2, int csize); av_cold void ff_jpeg2000dsp_init_x86(Jpeg2000DSPContext *c) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE(cpu_flags)) { c->mct_decode[FF_DWT97] = ff_ict_float_sse; @@ -57,4 +58,5 @@ av_cold void ff_jpeg2000dsp_init_x86(Jpeg2000DSPContext *c) if (EXTERNAL_AVX2_FAST(cpu_flags)) { c->mct_decode[FF_DWT53] = ff_rct_int_avx2; } +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/lossless_videodsp_init.c b/libavcodec/x86/lossless_videodsp_init.c index 5690cacaad..720cf98389 100644 --- a/libavcodec/x86/lossless_videodsp_init.c +++ b/libavcodec/x86/lossless_videodsp_init.c @@ -46,6 +46,7 @@ void ff_llviddsp_init_x86(LLVidDSPContext *c) { int cpu_flags = av_get_cpu_flags(); +#if HAVE_X86ASM if (EXTERNAL_SSE2(cpu_flags)) { c->add_bytes = ff_add_bytes_sse2; c->add_median_pred = ff_add_median_pred_sse2; @@ -67,4 +68,5 @@ void ff_llviddsp_init_x86(LLVidDSPContext *c) c->add_left_pred = ff_add_left_pred_unaligned_avx2; c->add_gradient_pred = ff_add_gradient_pred_avx2; } +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/lossless_videoencdsp_init.c b/libavcodec/x86/lossless_videoencdsp_init.c index 22a4014ef1..26cfcbb4b2 100644 --- a/libavcodec/x86/lossless_videoencdsp_init.c +++ b/libavcodec/x86/lossless_videoencdsp_init.c @@ -91,6 +91,7 @@ av_cold void ff_llvidencdsp_init_x86(LLVidEncDSPContext *c) } #endif /* HAVE_INLINE_ASM */ +#if HAVE_X86ASM if (EXTERNAL_SSE2(cpu_flags)) { c->diff_bytes = ff_diff_bytes_sse2; } @@ -102,4 +103,5 @@ av_cold void ff_llvidencdsp_init_x86(LLVidEncDSPContext *c) if (EXTERNAL_AVX2_FAST(cpu_flags)) { c->diff_bytes = ff_diff_bytes_avx2; } +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/mdct15_init.c b/libavcodec/x86/mdct15_init.c index ea7301e1e7..25653013a5 100644 --- a/libavcodec/x86/mdct15_init.c +++ b/libavcodec/x86/mdct15_init.c @@ -84,6 +84,7 @@ static void perm_twiddles(MDCT15Context *s) av_cold void ff_mdct15_init_x86(MDCT15Context *s) { int adjust_twiddles = 0; +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE3(cpu_flags)) @@ -98,6 +99,7 @@ av_cold void ff_mdct15_init_x86(MDCT15Context *s) if (EXTERNAL_AVX2_FAST(cpu_flags)) s->postreindex = ff_mdct15_postreindex_avx2; #endif +#endif /* HAVE_X86ASM */ if (adjust_twiddles) perm_twiddles(s); diff --git a/libavcodec/x86/me_cmp_init.c b/libavcodec/x86/me_cmp_init.c index bc1051c27e..527fdff4a9 100644 --- a/libavcodec/x86/me_cmp_init.c +++ b/libavcodec/x86/me_cmp_init.c @@ -242,6 +242,7 @@ av_cold void ff_me_cmp_init_x86(MECmpContext *c, AVCodecContext *avctx) #endif /* HAVE_INLINE_ASM */ +#if HAVE_X86ASM if (EXTERNAL_MMX(cpu_flags)) { c->sse[1] = ff_sse8_mmx; #if HAVE_X86ASM @@ -307,4 +308,5 @@ av_cold void ff_me_cmp_init_x86(MECmpContext *c, AVCodecContext *avctx) c->hadamard8_diff[1] = ff_hadamard8_diff_ssse3; #endif } +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/mlpdsp_init.c b/libavcodec/x86/mlpdsp_init.c index 333a685f47..4843e1abdb 100644 --- a/libavcodec/x86/mlpdsp_init.c +++ b/libavcodec/x86/mlpdsp_init.c @@ -200,7 +200,7 @@ av_cold void ff_mlpdsp_init_x86(MLPDSPContext *c) if (INLINE_MMX(cpu_flags)) c->mlp_filter_channel = mlp_filter_channel_x86; #endif -#if ARCH_X86_64 +#if ARCH_X86_64 && HAVE_X86ASM if (EXTERNAL_SSE4(cpu_flags)) c->mlp_rematrix_channel = ff_mlp_rematrix_channel_sse4; if (EXTERNAL_AVX2_FAST(cpu_flags) && cpu_flags & AV_CPU_FLAG_BMI2) diff --git a/libavcodec/x86/mpegvideoencdsp_init.c b/libavcodec/x86/mpegvideoencdsp_init.c index ec174b15aa..82f9df4cba 100644 --- a/libavcodec/x86/mpegvideoencdsp_init.c +++ b/libavcodec/x86/mpegvideoencdsp_init.c @@ -216,6 +216,7 @@ av_cold void ff_mpegvideoencdsp_init_x86(MpegvideoEncDSPContext *c, { int cpu_flags = av_get_cpu_flags(); +#if HAVE_X86ASM if (EXTERNAL_SSE2(cpu_flags)) { c->pix_sum = ff_pix_sum16_sse2; c->pix_norm1 = ff_pix_norm1_sse2; @@ -224,6 +225,7 @@ av_cold void ff_mpegvideoencdsp_init_x86(MpegvideoEncDSPContext *c, if (EXTERNAL_XOP(cpu_flags)) { c->pix_sum = ff_pix_sum16_xop; } +#endif /* HAVE_X86ASM */ #if HAVE_INLINE_ASM diff --git a/libavcodec/x86/opusdsp_init.c b/libavcodec/x86/opusdsp_init.c index 582fbb4f0c..4598657116 100644 --- a/libavcodec/x86/opusdsp_init.c +++ b/libavcodec/x86/opusdsp_init.c @@ -27,10 +27,12 @@ float ff_opus_deemphasis_fma3(float *out, float *in, float coeff, int len); av_cold void ff_opus_dsp_init_x86(OpusDSP *ctx) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_FMA3(cpu_flags)) { ctx->postfilter = ff_opus_postfilter_fma3; ctx->deemphasis = ff_opus_deemphasis_fma3; } +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/pixblockdsp_init.c b/libavcodec/x86/pixblockdsp_init.c index 51f2a0033a..9d3aac4c74 100644 --- a/libavcodec/x86/pixblockdsp_init.c +++ b/libavcodec/x86/pixblockdsp_init.c @@ -31,6 +31,7 @@ av_cold void ff_pixblockdsp_init_x86(PixblockDSPContext *c, AVCodecContext *avctx, unsigned high_bit_depth) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE2(cpu_flags)) { @@ -41,4 +42,5 @@ av_cold void ff_pixblockdsp_init_x86(PixblockDSPContext *c, c->diff_pixels_unaligned = c->diff_pixels = ff_diff_pixels_sse2; } +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/pngdsp_init.c b/libavcodec/x86/pngdsp_init.c index e2cd5effe3..c6562f7abb 100644 --- a/libavcodec/x86/pngdsp_init.c +++ b/libavcodec/x86/pngdsp_init.c @@ -33,6 +33,7 @@ void ff_add_bytes_l2_sse2(uint8_t *dst, uint8_t *src1, av_cold void ff_pngdsp_init_x86(PNGDSPContext *dsp) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_MMXEXT(cpu_flags)) @@ -41,4 +42,5 @@ av_cold void ff_pngdsp_init_x86(PNGDSPContext *dsp) dsp->add_bytes_l2 = ff_add_bytes_l2_sse2; if (EXTERNAL_SSSE3(cpu_flags)) dsp->add_paeth_prediction = ff_add_png_paeth_prediction_ssse3; +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/proresdsp_init.c b/libavcodec/x86/proresdsp_init.c index bde79ab8c0..01e5e67236 100644 --- a/libavcodec/x86/proresdsp_init.c +++ b/libavcodec/x86/proresdsp_init.c @@ -32,6 +32,7 @@ void ff_prores_idct_put_10_avx (uint16_t *dst, ptrdiff_t linesize, av_cold void ff_proresdsp_init_x86(ProresDSPContext *dsp, AVCodecContext *avctx) { +#if HAVE_X86ASM #if ARCH_X86_64 int cpu_flags = av_get_cpu_flags(); @@ -47,4 +48,5 @@ av_cold void ff_proresdsp_init_x86(ProresDSPContext *dsp, AVCodecContext *avctx) } } #endif /* ARCH_X86_64 */ +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/rv34dsp_init.c b/libavcodec/x86/rv34dsp_init.c index caa5c2d653..f76bef39e1 100644 --- a/libavcodec/x86/rv34dsp_init.c +++ b/libavcodec/x86/rv34dsp_init.c @@ -32,6 +32,7 @@ void ff_rv34_idct_add_mmxext(uint8_t *dst, ptrdiff_t stride, int16_t *block); av_cold void ff_rv34dsp_init_x86(RV34DSPContext* c) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_MMXEXT(cpu_flags)) { @@ -42,4 +43,5 @@ av_cold void ff_rv34dsp_init_x86(RV34DSPContext* c) c->rv34_idct_dc_add = ff_rv34_idct_dc_add_sse2; if (EXTERNAL_SSE4(cpu_flags)) c->rv34_idct_dc_add = ff_rv34_idct_dc_add_sse4; +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/sbcdsp_init.c b/libavcodec/x86/sbcdsp_init.c index 7416a86ac6..79914cc565 100644 --- a/libavcodec/x86/sbcdsp_init.c +++ b/libavcodec/x86/sbcdsp_init.c @@ -42,6 +42,7 @@ void ff_sbc_calc_scalefactors_mmx(int32_t sb_sample_f[16][2][8], av_cold void ff_sbcdsp_init_x86(SBCDSPContext *s) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_MMX(cpu_flags)) { @@ -49,4 +50,5 @@ av_cold void ff_sbcdsp_init_x86(SBCDSPContext *s) s->sbc_analyze_8 = ff_sbc_analyze_8_mmx; s->sbc_calc_scalefactors = ff_sbc_calc_scalefactors_mmx; } +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/sbrdsp_init.c b/libavcodec/x86/sbrdsp_init.c index 999f681220..d70ffa0d6c 100644 --- a/libavcodec/x86/sbrdsp_init.c +++ b/libavcodec/x86/sbrdsp_init.c @@ -57,6 +57,7 @@ void ff_sbr_autocorrelate_sse3(const float x[40][2], float phi[3][2][2]); av_cold void ff_sbrdsp_init_x86(SBRDSPContext *s) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE(cpu_flags)) { @@ -82,4 +83,5 @@ av_cold void ff_sbrdsp_init_x86(SBRDSPContext *s) if (EXTERNAL_SSE3(cpu_flags)) { s->autocorrelate = ff_sbr_autocorrelate_sse3; } +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/svq1enc_init.c b/libavcodec/x86/svq1enc_init.c index daf573beba..c016811822 100644 --- a/libavcodec/x86/svq1enc_init.c +++ b/libavcodec/x86/svq1enc_init.c @@ -29,9 +29,11 @@ int ff_ssd_int8_vs_int16_sse2(const int8_t *pix1, const int16_t *pix2, av_cold void ff_svq1enc_init_x86(SVQ1EncDSPContext *c) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE2(cpu_flags)) { c->ssd_int8_vs_int16 = ff_ssd_int8_vs_int16_sse2; } +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/utvideodsp_init.c b/libavcodec/x86/utvideodsp_init.c index 2b436c6c5c..e81f6bf3c0 100644 --- a/libavcodec/x86/utvideodsp_init.c +++ b/libavcodec/x86/utvideodsp_init.c @@ -41,6 +41,7 @@ void ff_restore_rgb_planes10_avx2(uint16_t *src_r, uint16_t *src_g, uint16_t *sr av_cold void ff_utvideodsp_init_x86(UTVideoDSPContext *c) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE2(cpu_flags)) { @@ -51,4 +52,5 @@ av_cold void ff_utvideodsp_init_x86(UTVideoDSPContext *c) c->restore_rgb_planes = ff_restore_rgb_planes_avx2; c->restore_rgb_planes10 = ff_restore_rgb_planes10_avx2; } +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/v210enc_init.c b/libavcodec/x86/v210enc_init.c index 13a351dd1d..542bfe8b8a 100644 --- a/libavcodec/x86/v210enc_init.c +++ b/libavcodec/x86/v210enc_init.c @@ -36,6 +36,7 @@ void ff_v210_planar_pack_10_avx2(const uint16_t *y, const uint16_t *u, av_cold void ff_v210enc_init_x86(V210EncContext *s) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSSE3(cpu_flags)) { @@ -52,4 +53,5 @@ av_cold void ff_v210enc_init_x86(V210EncContext *s) s->sample_factor_10 = 2; s->pack_line_10 = ff_v210_planar_pack_10_avx2; } +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/vc1dsp_init.c b/libavcodec/x86/vc1dsp_init.c index 65fc28ea35..ea6c0fa0fe 100644 --- a/libavcodec/x86/vc1dsp_init.c +++ b/libavcodec/x86/vc1dsp_init.c @@ -102,7 +102,7 @@ av_cold void ff_vc1dsp_init_x86(VC1DSPContext *dsp) { int cpu_flags = av_get_cpu_flags(); -#if HAVE_6REGS && HAVE_INLINE_ASM +#if HAVE_6REGS && HAVE_INLINE_ASM && HAVE_X86ASM if (INLINE_MMX(cpu_flags)) if (EXTERNAL_MMX(cpu_flags)) ff_vc1dsp_init_mmx(dsp); diff --git a/libavcodec/x86/vorbisdsp_init.c b/libavcodec/x86/vorbisdsp_init.c index 08a3bb2965..067b92e2a4 100644 --- a/libavcodec/x86/vorbisdsp_init.c +++ b/libavcodec/x86/vorbisdsp_init.c @@ -29,8 +29,10 @@ void ff_vorbis_inverse_coupling_sse(float *mag, float *ang, av_cold void ff_vorbisdsp_init_x86(VorbisDSPContext *dsp) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE(cpu_flags)) dsp->vorbis_inverse_coupling = ff_vorbis_inverse_coupling_sse; +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/vp3dsp_init.c b/libavcodec/x86/vp3dsp_init.c index f54fa57b3e..7d69956d22 100644 --- a/libavcodec/x86/vp3dsp_init.c +++ b/libavcodec/x86/vp3dsp_init.c @@ -42,6 +42,7 @@ void ff_put_vp_no_rnd_pixels8_l2_mmx(uint8_t *dst, const uint8_t *a, av_cold void ff_vp3dsp_init_x86(VP3DSPContext *c, int flags) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_MMX(cpu_flags)) { @@ -61,4 +62,5 @@ av_cold void ff_vp3dsp_init_x86(VP3DSPContext *c, int flags) c->idct_put = ff_vp3_idct_put_sse2; c->idct_add = ff_vp3_idct_add_sse2; } +#endif /* HAVE_X86ASM */ } diff --git a/libavcodec/x86/vp6dsp_init.c b/libavcodec/x86/vp6dsp_init.c index 83d45ec36c..6a3bf36bae 100644 --- a/libavcodec/x86/vp6dsp_init.c +++ b/libavcodec/x86/vp6dsp_init.c @@ -30,9 +30,11 @@ void ff_vp6_filter_diag4_sse2(uint8_t *dst, uint8_t *src, ptrdiff_t stride, av_cold void ff_vp6dsp_init_x86(VP56DSPContext *c) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE2(cpu_flags)) { c->vp6_filter_diag4 = ff_vp6_filter_diag4_sse2; } +#endif /* HAVE_X86ASM */ } diff --git a/libavfilter/x86/af_afir_init.c b/libavfilter/x86/af_afir_init.c index e53817b9c0..3561d9fe3f 100644 --- a/libavfilter/x86/af_afir_init.c +++ b/libavfilter/x86/af_afir_init.c @@ -29,6 +29,7 @@ void ff_fcmul_add_avx(float *sum, const float *t, const float *c, av_cold void ff_afir_init_x86(AudioFIRDSPContext *s) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE3(cpu_flags)) { @@ -37,4 +38,5 @@ av_cold void ff_afir_init_x86(AudioFIRDSPContext *s) if (EXTERNAL_AVX_FAST(cpu_flags)) { s->fcmul_add = ff_fcmul_add_avx; } +#endif /* HAVE_X86ASM */ } diff --git a/libavfilter/x86/af_anlmdn_init.c b/libavfilter/x86/af_anlmdn_init.c index 30eff6f644..047d88b795 100644 --- a/libavfilter/x86/af_anlmdn_init.c +++ b/libavfilter/x86/af_anlmdn_init.c @@ -27,9 +27,11 @@ float ff_compute_distance_ssd_sse(const float *f1, const float *f2, av_cold void ff_anlmdn_init_x86(AudioNLMDNDSPContext *s) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE(cpu_flags)) { s->compute_distance_ssd = ff_compute_distance_ssd_sse; } +#endif /* HAVE_X86ASM */ } diff --git a/libavfilter/x86/af_volume_init.c b/libavfilter/x86/af_volume_init.c index 88f5a9679a..28cfbe1ce1 100644 --- a/libavfilter/x86/af_volume_init.c +++ b/libavfilter/x86/af_volume_init.c @@ -35,6 +35,7 @@ void ff_scale_samples_s32_avx(uint8_t *dst, const uint8_t *src, int len, av_cold void ff_volume_init_x86(VolumeContext *vol) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); enum AVSampleFormat sample_fmt = av_get_packed_sample_fmt(vol->sample_fmt); @@ -57,4 +58,5 @@ av_cold void ff_volume_init_x86(VolumeContext *vol) vol->samples_align = 8; } } +#endif /* HAVE_X86ASM */ } diff --git a/libavfilter/x86/avf_showcqt_init.c b/libavfilter/x86/avf_showcqt_init.c index 2320b30239..1a5534a12e 100644 --- a/libavfilter/x86/avf_showcqt_init.c +++ b/libavfilter/x86/avf_showcqt_init.c @@ -46,6 +46,7 @@ static void permute_coeffs_01452367(float *v, int len) av_cold void ff_showcqt_init_x86(ShowCQTContext *s) { +#if HAVE_X86ASM int cpuflags = av_get_cpu_flags(); #define SELECT_CQT_CALC(type, TYPE, align, perm) \ @@ -60,4 +61,5 @@ if (EXTERNAL_##TYPE(cpuflags)) { \ SELECT_CQT_CALC(fma4, FMA4, 4, 0); // using xmm SELECT_CQT_CALC(avx, AVX_FAST, 8, 01452367); SELECT_CQT_CALC(fma3, FMA3_FAST, 8, 01452367); +#endif /* HAVE_X86ASM */ } diff --git a/libavfilter/x86/colorspacedsp_init.c b/libavfilter/x86/colorspacedsp_init.c index f01db4baf4..66c25cb361 100644 --- a/libavfilter/x86/colorspacedsp_init.c +++ b/libavfilter/x86/colorspacedsp_init.c @@ -78,6 +78,7 @@ void ff_multiply3x3_sse2(int16_t *data[3], ptrdiff_t stride, int w, int h, void ff_colorspacedsp_x86_init(ColorSpaceDSPContext *dsp) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); #if ARCH_X86_64 @@ -118,4 +119,5 @@ void ff_colorspacedsp_x86_init(ColorSpaceDSPContext *dsp) dsp->multiply3x3 = ff_multiply3x3_sse2; } #endif +#endif /* HAVE_X86ASM */ } diff --git a/libavfilter/x86/vf_atadenoise_init.c b/libavfilter/x86/vf_atadenoise_init.c index eb621e172c..8ec98f1a82 100644 --- a/libavfilter/x86/vf_atadenoise_init.c +++ b/libavfilter/x86/vf_atadenoise_init.c @@ -36,6 +36,7 @@ void ff_atadenoise_filter_row8_serial_sse4(const uint8_t *src, uint8_t *dst, av_cold void ff_atadenoise_init_x86(ATADenoiseDSPContext *dsp, int depth, int algorithm, const float *sigma) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); for (int p = 0; p < 4; p++) { @@ -49,4 +50,5 @@ av_cold void ff_atadenoise_init_x86(ATADenoiseDSPContext *dsp, int depth, int al } #endif } +#endif /* HAVE_X86ASM */ } diff --git a/libavfilter/x86/vf_blend_init.c b/libavfilter/x86/vf_blend_init.c index c326c43362..6d57bf7eac 100644 --- a/libavfilter/x86/vf_blend_init.c +++ b/libavfilter/x86/vf_blend_init.c @@ -102,6 +102,7 @@ BLEND_FUNC(xor_16, avx2) av_cold void ff_blend_init_x86(FilterParams *param, int depth) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (depth == 8) { @@ -200,4 +201,5 @@ av_cold void ff_blend_init_x86(FilterParams *param, int depth) } #endif /* ARCH_X86_64 */ } +#endif /* HAVE_X86ASM */ } diff --git a/libavfilter/x86/vf_bwdif_init.c b/libavfilter/x86/vf_bwdif_init.c index e24e5cd9b1..ec0ee6af85 100644 --- a/libavfilter/x86/vf_bwdif_init.c +++ b/libavfilter/x86/vf_bwdif_init.c @@ -44,6 +44,7 @@ void ff_bwdif_filter_line_12bit_ssse3(void *dst, void *prev, void *cur, void *ne av_cold void ff_bwdif_init_x86(BWDIFContext *bwdif) { +#if HAVE_X86ASM YADIFContext *yadif = &bwdif->yadif; int cpu_flags = av_get_cpu_flags(); int bit_depth = (!yadif->csp) ? 8 : yadif->csp->comp[0].depth; @@ -59,4 +60,5 @@ av_cold void ff_bwdif_init_x86(BWDIFContext *bwdif) if (EXTERNAL_SSSE3(cpu_flags)) bwdif->filter_line = ff_bwdif_filter_line_12bit_ssse3; } +#endif /* HAVE_X86ASM */ } diff --git a/libavfilter/x86/vf_convolution_init.c b/libavfilter/x86/vf_convolution_init.c index b78a47d02b..105c223366 100644 --- a/libavfilter/x86/vf_convolution_init.c +++ b/libavfilter/x86/vf_convolution_init.c @@ -31,7 +31,7 @@ void ff_filter_3x3_sse4(uint8_t *dst, int width, av_cold void ff_convolution_init_x86(ConvolutionContext *s) { -#if ARCH_X86_64 +#if ARCH_X86_64 && HAVE_X86ASM int i; int cpu_flags = av_get_cpu_flags(); for (i = 0; i < 4; i++) { diff --git a/libavfilter/x86/vf_framerate_init.c b/libavfilter/x86/vf_framerate_init.c index 9d40faf0a4..b4a9dc574d 100644 --- a/libavfilter/x86/vf_framerate_init.c +++ b/libavfilter/x86/vf_framerate_init.c @@ -27,6 +27,7 @@ void ff_blend_frames16_avx2(BLEND_FUNC_PARAMS); void ff_framerate_init_x86(FrameRateContext *s) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (s->bitdepth == 8) { if (EXTERNAL_AVX2_FAST(cpu_flags)) @@ -39,4 +40,5 @@ void ff_framerate_init_x86(FrameRateContext *s) else if (EXTERNAL_SSE4(cpu_flags)) s->blend = ff_blend_frames16_sse4; } +#endif /* HAVE_X86ASM */ } diff --git a/libavfilter/x86/vf_fspp_init.c b/libavfilter/x86/vf_fspp_init.c index 8e00317cb7..3618b70dc3 100644 --- a/libavfilter/x86/vf_fspp_init.c +++ b/libavfilter/x86/vf_fspp_init.c @@ -36,6 +36,7 @@ void ff_row_fdct_mmx(int16_t *data, const uint8_t *pixels, ptrdiff_t line_size, av_cold void ff_fspp_init_x86(FSPPContext *s) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_MMX(cpu_flags)) { @@ -46,4 +47,5 @@ av_cold void ff_fspp_init_x86(FSPPContext *s) s->row_idct = ff_row_idct_mmx; s->row_fdct = ff_row_fdct_mmx; } +#endif /* HAVE_X86ASM */ } diff --git a/libavfilter/x86/vf_gblur_init.c b/libavfilter/x86/vf_gblur_init.c index b47f6fbffb..01e1b82131 100644 --- a/libavfilter/x86/vf_gblur_init.c +++ b/libavfilter/x86/vf_gblur_init.c @@ -39,6 +39,7 @@ void ff_verti_slice_avx512(float *buffer, int width, int height, int column_begi av_cold void ff_gblur_init_x86(GBlurContext *s) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE(cpu_flags)) { @@ -70,4 +71,5 @@ av_cold void ff_gblur_init_x86(GBlurContext *s) } } #endif +#endif /* HAVE_X86ASM */ } diff --git a/libavfilter/x86/vf_hflip_init.c b/libavfilter/x86/vf_hflip_init.c index 0ac399b0d4..743b368ee9 100644 --- a/libavfilter/x86/vf_hflip_init.c +++ b/libavfilter/x86/vf_hflip_init.c @@ -30,6 +30,7 @@ void ff_hflip_short_avx2(const uint8_t *src, uint8_t *dst, int w); av_cold void ff_hflip_init_x86(FlipContext *s, int step[4], int nb_planes) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); int i; @@ -50,4 +51,5 @@ av_cold void ff_hflip_init_x86(FlipContext *s, int step[4], int nb_planes) } } } +#endif /* HAVE_X86ASM */ } diff --git a/libavfilter/x86/vf_limiter_init.c b/libavfilter/x86/vf_limiter_init.c index 07c733dc21..2c26f90f0f 100644 --- a/libavfilter/x86/vf_limiter_init.c +++ b/libavfilter/x86/vf_limiter_init.c @@ -29,6 +29,7 @@ void ff_limiter_16bit_sse4(const uint8_t *src, uint8_t *dst, void ff_limiter_init_x86(LimiterDSPContext *dsp, int bpp) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE2(cpu_flags)) { @@ -41,4 +42,5 @@ void ff_limiter_init_x86(LimiterDSPContext *dsp, int bpp) dsp->limiter = ff_limiter_16bit_sse4; } } +#endif /* HAVE_X86ASM */ } diff --git a/libavfilter/x86/vf_maskedclamp_init.c b/libavfilter/x86/vf_maskedclamp_init.c index 2a5388abac..94217cf485 100644 --- a/libavfilter/x86/vf_maskedclamp_init.c +++ b/libavfilter/x86/vf_maskedclamp_init.c @@ -34,6 +34,7 @@ void ff_maskedclamp16_sse4(const uint8_t *bsrc, uint8_t *dst, av_cold void ff_maskedclamp_init_x86(MaskedClampDSPContext *dsp, int depth) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE2(cpu_flags) && depth <= 8) { @@ -43,4 +44,5 @@ av_cold void ff_maskedclamp_init_x86(MaskedClampDSPContext *dsp, int depth) if (EXTERNAL_SSE4(cpu_flags) && depth > 8) { dsp->maskedclamp = ff_maskedclamp16_sse4; } +#endif /* HAVE_X86ASM */ } diff --git a/libavfilter/x86/vf_maskedmerge_init.c b/libavfilter/x86/vf_maskedmerge_init.c index 73ab888083..2eee4a36c2 100644 --- a/libavfilter/x86/vf_maskedmerge_init.c +++ b/libavfilter/x86/vf_maskedmerge_init.c @@ -32,9 +32,11 @@ void ff_maskedmerge8_sse2(const uint8_t *bsrc, const uint8_t *osrc, av_cold void ff_maskedmerge_init_x86(MaskedMergeContext *s) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE2(cpu_flags) && s->depth == 8) { s->maskedmerge = ff_maskedmerge8_sse2; } +#endif /* HAVE_X86ASM */ } diff --git a/libavfilter/x86/vf_overlay_init.c b/libavfilter/x86/vf_overlay_init.c index d4218b18f6..9f7d9c4909 100644 --- a/libavfilter/x86/vf_overlay_init.c +++ b/libavfilter/x86/vf_overlay_init.c @@ -35,6 +35,7 @@ int ff_overlay_row_22_sse4(uint8_t *d, uint8_t *da, uint8_t *s, uint8_t *a, av_cold void ff_overlay_init_x86(OverlayContext *s, int format, int pix_format, int alpha_format, int main_has_alpha) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE4(cpu_flags) && @@ -62,4 +63,5 @@ av_cold void ff_overlay_init_x86(OverlayContext *s, int format, int pix_format, s->blend_row[1] = ff_overlay_row_22_sse4; s->blend_row[2] = ff_overlay_row_22_sse4; } +#endif /* HAVE_X86ASM */ } diff --git a/libavfilter/x86/vf_pp7_init.c b/libavfilter/x86/vf_pp7_init.c index 165b0dd5d0..ed5ab82794 100644 --- a/libavfilter/x86/vf_pp7_init.c +++ b/libavfilter/x86/vf_pp7_init.c @@ -27,8 +27,10 @@ void ff_pp7_dctB_mmx(int16_t *dst, int16_t *src); av_cold void ff_pp7_init_x86(PP7Context *p) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_MMX(cpu_flags)) p->dctB = ff_pp7_dctB_mmx; +#endif /* HAVE_X86ASM */ } diff --git a/libavfilter/x86/vf_psnr_init.c b/libavfilter/x86/vf_psnr_init.c index c387812204..82be86d923 100644 --- a/libavfilter/x86/vf_psnr_init.c +++ b/libavfilter/x86/vf_psnr_init.c @@ -27,6 +27,7 @@ uint64_t ff_sse_line_16bit_sse2(const uint8_t *buf, const uint8_t *ref, int w); void ff_psnr_init_x86(PSNRDSPContext *dsp, int bpp) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE2(cpu_flags)) { @@ -36,4 +37,5 @@ void ff_psnr_init_x86(PSNRDSPContext *dsp, int bpp) dsp->sse_line = ff_sse_line_16bit_sse2; } } +#endif /* HAVE_X86ASM */ } diff --git a/libavfilter/x86/vf_removegrain_init.c b/libavfilter/x86/vf_removegrain_init.c index 07314b3244..ff5f4771d2 100644 --- a/libavfilter/x86/vf_removegrain_init.c +++ b/libavfilter/x86/vf_removegrain_init.c @@ -49,6 +49,7 @@ void ff_rg_fl_mode_24_sse2(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int pix av_cold void ff_removegrain_init_x86(RemoveGrainContext *rg) { +#if HAVE_X86ASM #if CONFIG_GPL int cpu_flags = av_get_cpu_flags(); int i; @@ -85,4 +86,5 @@ av_cold void ff_removegrain_init_x86(RemoveGrainContext *rg) } } #endif /* CONFIG_GPL */ +#endif /* HAVE_X86ASM */ } diff --git a/libavfilter/x86/vf_ssim_init.c b/libavfilter/x86/vf_ssim_init.c index 6f2305430c..ef39247056 100644 --- a/libavfilter/x86/vf_ssim_init.c +++ b/libavfilter/x86/vf_ssim_init.c @@ -32,6 +32,7 @@ double ff_ssim_end_line_sse4(const int (*sum0)[4], const int (*sum1)[4], int w); void ff_ssim_init_x86(SSIMDSPContext *dsp) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); #if ARCH_X86_64 @@ -42,4 +43,5 @@ void ff_ssim_init_x86(SSIMDSPContext *dsp) dsp->ssim_end_line = ff_ssim_end_line_sse4; if (EXTERNAL_XOP(cpu_flags)) dsp->ssim_4x4_line = ff_ssim_4x4_line_xop; +#endif /* HAVE_X86ASM */ } diff --git a/libavfilter/x86/vf_stereo3d_init.c b/libavfilter/x86/vf_stereo3d_init.c index da160a89a0..abd682ee80 100644 --- a/libavfilter/x86/vf_stereo3d_init.c +++ b/libavfilter/x86/vf_stereo3d_init.c @@ -29,9 +29,11 @@ void ff_anaglyph_sse4(uint8_t *dst, uint8_t *lsrc, uint8_t *rsrc, void ff_stereo3d_init_x86(Stereo3DDSPContext *dsp) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE4(cpu_flags)) { dsp->anaglyph = ff_anaglyph_sse4; } +#endif /* HAVE_X86ASM */ } diff --git a/libavfilter/x86/vf_threshold_init.c b/libavfilter/x86/vf_threshold_init.c index 8e42296791..151a94f429 100644 --- a/libavfilter/x86/vf_threshold_init.c +++ b/libavfilter/x86/vf_threshold_init.c @@ -39,6 +39,7 @@ THRESHOLD_FUNC(16, avx2) av_cold void ff_threshold_init_x86(ThresholdContext *s) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (s->depth == 8) { @@ -56,4 +57,5 @@ av_cold void ff_threshold_init_x86(ThresholdContext *s) s->threshold = ff_threshold16_avx2; } } +#endif /* HAVE_X86ASM */ } diff --git a/libavfilter/x86/vf_tinterlace_init.c b/libavfilter/x86/vf_tinterlace_init.c index 1c25a2bb7a..c30a3247a2 100644 --- a/libavfilter/x86/vf_tinterlace_init.c +++ b/libavfilter/x86/vf_tinterlace_init.c @@ -56,6 +56,7 @@ void ff_lowpass_line_complex_12_sse2(uint8_t *dstp, ptrdiff_t linesize, av_cold void ff_tinterlace_init_x86(TInterlaceContext *s) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (s->csp->comp[0].depth > 8) { @@ -89,4 +90,5 @@ av_cold void ff_tinterlace_init_x86(TInterlaceContext *s) } } } +#endif /* HAVE_X86ASM */ } diff --git a/libavfilter/x86/vf_transpose_init.c b/libavfilter/x86/vf_transpose_init.c index 95c56eab73..7db2e66258 100644 --- a/libavfilter/x86/vf_transpose_init.c +++ b/libavfilter/x86/vf_transpose_init.c @@ -36,6 +36,7 @@ void ff_transpose_8x8_16_sse2(uint8_t *src, av_cold void ff_transpose_init_x86(TransVtable *v, int pixstep) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE2(cpu_flags) && pixstep == 1) { @@ -45,4 +46,5 @@ av_cold void ff_transpose_init_x86(TransVtable *v, int pixstep) if (EXTERNAL_SSE2(cpu_flags) && pixstep == 2) { v->transpose_8x8 = ff_transpose_8x8_16_sse2; } +#endif /* HAVE_X86ASM */ } diff --git a/libavfilter/x86/vf_v360_init.c b/libavfilter/x86/vf_v360_init.c index 2b2b06dd40..6b1b3811aa 100644 --- a/libavfilter/x86/vf_v360_init.c +++ b/libavfilter/x86/vf_v360_init.c @@ -43,6 +43,7 @@ void ff_remap2_16bit_line_avx2(uint8_t *dst, int width, const uint8_t *src, ptrd av_cold void ff_v360_init_x86(V360Context *s, int depth) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_AVX2_FAST(cpu_flags) && s->interp == NEAREST && depth <= 8) @@ -68,4 +69,5 @@ av_cold void ff_v360_init_x86(V360Context *s, int depth) s->interp == MITCHELL) && depth <= 8) s->remap_line = ff_remap4_8bit_line_avx2; #endif +#endif /* HAVE_X86ASM */ } diff --git a/libavfilter/x86/vf_w3fdif_init.c b/libavfilter/x86/vf_w3fdif_init.c index 6d677d651d..d023ef7a49 100644 --- a/libavfilter/x86/vf_w3fdif_init.c +++ b/libavfilter/x86/vf_w3fdif_init.c @@ -47,6 +47,7 @@ void ff_w3fdif_scale_sse2(uint8_t *out_pixel, const int32_t *work_pixel, av_cold void ff_w3fdif_init_x86(W3FDIFDSPContext *dsp, int depth) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE2(cpu_flags) && depth <= 8) { @@ -61,4 +62,5 @@ av_cold void ff_w3fdif_init_x86(W3FDIFDSPContext *dsp, int depth) dsp->filter_complex_high = ff_w3fdif_complex_high_sse2; } #endif +#endif /* HAVE_X86ASM */ } diff --git a/libavfilter/x86/vf_yadif_init.c b/libavfilter/x86/vf_yadif_init.c index 257c3f9199..54917fa104 100644 --- a/libavfilter/x86/vf_yadif_init.c +++ b/libavfilter/x86/vf_yadif_init.c @@ -49,6 +49,7 @@ void ff_yadif_filter_line_10bit_ssse3(void *dst, void *prev, void *cur, av_cold void ff_yadif_init_x86(YADIFContext *yadif) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); int bit_depth = (!yadif->csp) ? 8 : yadif->csp->comp[0].depth; @@ -71,4 +72,5 @@ av_cold void ff_yadif_init_x86(YADIFContext *yadif) if (EXTERNAL_SSSE3(cpu_flags)) yadif->filter_line = ff_yadif_filter_line_ssse3; } +#endif /* HAVE_X86ASM */ } diff --git a/libavutil/x86/fixed_dsp_init.c b/libavutil/x86/fixed_dsp_init.c index d3f4b2e325..eb84027dbf 100644 --- a/libavutil/x86/fixed_dsp_init.c +++ b/libavutil/x86/fixed_dsp_init.c @@ -27,9 +27,11 @@ void ff_butterflies_fixed_sse2(int *av_restrict src0, int *av_restrict src1, int av_cold void ff_fixed_dsp_init_x86(AVFixedDSPContext *fdsp) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE2(cpu_flags)) { fdsp->butterflies_fixed = ff_butterflies_fixed_sse2; } +#endif /* HAVE_X86ASM */ } diff --git a/libavutil/x86/float_dsp_init.c b/libavutil/x86/float_dsp_init.c index ad6b506259..7495c0b9a8 100644 --- a/libavutil/x86/float_dsp_init.c +++ b/libavutil/x86/float_dsp_init.c @@ -80,6 +80,7 @@ void ff_butterflies_float_sse(float *av_restrict src0, float *av_restrict src1, av_cold void ff_float_dsp_init_x86(AVFloatDSPContext *fdsp) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE(cpu_flags)) { @@ -115,4 +116,5 @@ av_cold void ff_float_dsp_init_x86(AVFloatDSPContext *fdsp) fdsp->vector_dmac_scalar = ff_vector_dmac_scalar_fma3; fdsp->scalarproduct_float = ff_scalarproduct_float_fma3; } +#endif /* HAVE_X86ASM */ } diff --git a/libavutil/x86/imgutils_init.c b/libavutil/x86/imgutils_init.c index 91a16cf594..feac5d6fc7 100644 --- a/libavutil/x86/imgutils_init.c +++ b/libavutil/x86/imgutils_init.c @@ -34,6 +34,7 @@ int ff_image_copy_plane_uc_from_x86(uint8_t *dst, ptrdiff_t dst_linesize, const uint8_t *src, ptrdiff_t src_linesize, ptrdiff_t bytewidth, int height) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); ptrdiff_t bw_aligned = FFALIGN(bytewidth, 64); @@ -42,6 +43,7 @@ int ff_image_copy_plane_uc_from_x86(uint8_t *dst, ptrdiff_t dst_linesize, ff_image_copy_plane_uc_from_sse4(dst, dst_linesize, src, src_linesize, bw_aligned, height); else +#endif /* HAVE_X86ASM */ return AVERROR(ENOSYS); return 0; diff --git a/libavutil/x86/lls_init.c b/libavutil/x86/lls_init.c index c786376915..67470185da 100644 --- a/libavutil/x86/lls_init.c +++ b/libavutil/x86/lls_init.c @@ -31,6 +31,7 @@ double ff_evaluate_lls_sse2(LLSModel *m, const double *var, int order); av_cold void ff_init_lls_x86(LLSModel *m) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE2(cpu_flags)) { m->update_lls = ff_update_lls_sse2; @@ -43,4 +44,5 @@ av_cold void ff_init_lls_x86(LLSModel *m) if (EXTERNAL_FMA3_FAST(cpu_flags)) { m->update_lls = ff_update_lls_fma3; } +#endif /* HAVE_X86ASM */ } diff --git a/libavutil/x86/pixelutils_init.c b/libavutil/x86/pixelutils_init.c index c3c0662414..a2f842041d 100644 --- a/libavutil/x86/pixelutils_init.c +++ b/libavutil/x86/pixelutils_init.c @@ -47,6 +47,7 @@ int ff_pixelutils_sad_u_32x32_avx2(const uint8_t *src1, ptrdiff_t stride1, void ff_pixelutils_sad_init_x86(av_pixelutils_sad_fn *sad, int aligned) { +#if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); // The best way to use SSE2 would be to do 2 SADs in parallel, @@ -82,4 +83,5 @@ void ff_pixelutils_sad_init_x86(av_pixelutils_sad_fn *sad, int aligned) case 2: sad[4] = ff_pixelutils_sad_a_32x32_avx2; break; // src1 aligned, src2 aligned } } +#endif /* HAVE_X86ASM */ } diff --git a/libswresample/x86/audio_convert_init.c b/libswresample/x86/audio_convert_init.c index f6d36f9ca6..d9eb43e1d5 100644 --- a/libswresample/x86/audio_convert_init.c +++ b/libswresample/x86/audio_convert_init.c @@ -52,6 +52,7 @@ av_cold void swri_audio_convert_init_x86(struct AudioConvert *ac, ac->simd_f = ff_int32_to_int16_a_ ## cap;\ } +#if HAVE_X86ASM MULTI_CAPS_FUNC(SSE2, sse2) if(EXTERNAL_SSE(mm_flags)) { @@ -172,4 +173,5 @@ MULTI_CAPS_FUNC(SSE2, sse2) if( out_fmt == AV_SAMPLE_FMT_S32 && in_fmt == AV_SAMPLE_FMT_FLT || out_fmt == AV_SAMPLE_FMT_S32P && in_fmt == AV_SAMPLE_FMT_FLTP) ac->simd_f = ff_float_to_int32_a_avx2; } +#endif /* HAVE_X86ASM */ } diff --git a/libswresample/x86/resample_init.c b/libswresample/x86/resample_init.c index d13ccd4833..4eebf5d6f9 100644 --- a/libswresample/x86/resample_init.c +++ b/libswresample/x86/resample_init.c @@ -51,6 +51,7 @@ av_cold void swri_resample_dsp_x86_init(ResampleContext *c) switch(c->format){ case AV_SAMPLE_FMT_S16P: +#if HAVE_X86ASM if (EXTERNAL_SSE2(mm_flags)) { c->dsp.resample_linear = ff_resample_linear_int16_sse2; c->dsp.resample_common = ff_resample_common_int16_sse2; @@ -59,8 +60,10 @@ av_cold void swri_resample_dsp_x86_init(ResampleContext *c) c->dsp.resample_linear = ff_resample_linear_int16_xop; c->dsp.resample_common = ff_resample_common_int16_xop; } +#endif /* HAVE_X86ASM */ break; case AV_SAMPLE_FMT_FLTP: +#if HAVE_X86ASM if (EXTERNAL_SSE(mm_flags)) { c->dsp.resample_linear = ff_resample_linear_float_sse; c->dsp.resample_common = ff_resample_common_float_sse; @@ -77,8 +80,10 @@ av_cold void swri_resample_dsp_x86_init(ResampleContext *c) c->dsp.resample_linear = ff_resample_linear_float_fma4; c->dsp.resample_common = ff_resample_common_float_fma4; } +#endif /* HAVE_X86ASM */ break; case AV_SAMPLE_FMT_DBLP: +#if HAVE_X86ASM if (EXTERNAL_SSE2(mm_flags)) { c->dsp.resample_linear = ff_resample_linear_double_sse2; c->dsp.resample_common = ff_resample_common_double_sse2; @@ -91,6 +96,7 @@ av_cold void swri_resample_dsp_x86_init(ResampleContext *c) c->dsp.resample_linear = ff_resample_linear_double_fma3; c->dsp.resample_common = ff_resample_common_double_fma3; } +#endif /* HAVE_X86ASM */ break; } } diff --git a/libswscale/x86/rgb2rgb.c b/libswscale/x86/rgb2rgb.c index b325e5dbd5..e39f327bf2 100644 --- a/libswscale/x86/rgb2rgb.c +++ b/libswscale/x86/rgb2rgb.c @@ -151,6 +151,7 @@ av_cold void rgb2rgb_init_x86(void) rgb2rgb_init_avx(); #endif /* HAVE_INLINE_ASM */ +#if HAVE_X86ASM if (EXTERNAL_MMXEXT(cpu_flags)) { shuffle_bytes_2103 = ff_shuffle_bytes_2103_mmxext; } @@ -178,4 +179,5 @@ av_cold void rgb2rgb_init_x86(void) uyvytoyuv422 = ff_uyvytoyuv422_avx; } #endif +#endif /* HAVE_X86ASM */ } diff --git a/libswscale/x86/swscale.c b/libswscale/x86/swscale.c index ff16398988..0a14262916 100644 --- a/libswscale/x86/swscale.c +++ b/libswscale/x86/swscale.c @@ -529,6 +529,7 @@ switch(c->dstBpc){ \ else ASSIGN_SCALE_FUNC2(hscalefn, X8, opt1, opt2); \ break; \ } +#if HAVE_X86ASM if (EXTERNAL_SSE2(cpu_flags)) { ASSIGN_SSE_SCALE_FUNC(c->hyScale, c->hLumFilterSize, sse2, sse2); ASSIGN_SSE_SCALE_FUNC(c->hcScale, c->hChrFilterSize, sse2, sse2); @@ -805,4 +806,5 @@ switch(c->dstBpc){ \ } #endif +#endif /* HAVE_X86ASM */ }