From patchwork Mon Jul 24 11:59:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 42942 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:be1d:b0:130:ccc6:6c4b with SMTP id ge29csp1864300pzb; Mon, 24 Jul 2023 04:59:06 -0700 (PDT) X-Google-Smtp-Source: APBJJlF1Sgs4F8CSgbgDYthYBPhaB8WT3mNfMYvvr90n6xlWcX9VQpfQkqzrQTzBVKqEt7nm/yH7 X-Received: by 2002:a05:6402:645:b0:522:2111:105d with SMTP id u5-20020a056402064500b005222111105dmr4676316edx.20.1690199946664; Mon, 24 Jul 2023 04:59:06 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id x11-20020aa7dacb000000b005221eb5d3fasi3022500eds.4.2023.07.24.04.59.05; Mon, 24 Jul 2023 04:59:06 -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=@outlook.com header.s=selector1 header.b=Wb9QTwXG; arc=fail (body hash mismatch); 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=NONE sp=QUARANTINE dis=NONE) header.from=outlook.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2BCF068C5FB; Mon, 24 Jul 2023 14:59:02 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04olkn2097.outbound.protection.outlook.com [40.92.75.97]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 23FE468C6D4 for ; Mon, 24 Jul 2023 14:58:55 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VJt9KsPza1ExGFwILpKWoRoqerPUgHt1NrFWyDTm7Z+Nm6ojiUIb+TvED59F2r0zNMuoVVdDEhPPoRx4Ec5+9sbtrK0tZPO0hTsCGMVgrX8gly2VPxK8tlw+NBQRSCNNSQgiO1V2wS7mYNiK371dnTmHvByTkrJukp4i9ZS4iskqL3Szkha2k8bRszg4tsD0/2+cSBdKwgHiT4FgWKNj/yXK3c8AnpyxzWOBnKdoq7zQhJeA+rk2yVmY2GlMyqQywQUjuyoYMYd9IEA72lsM5XCfsWJGs1fRUl0LBUBhAc9Rc6vk5axrpmjPMKGqbKX1KM6k9Ul7RnhIUWSXl9LL6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=88kZUwgmK7QzfLfoOzUUynYBIgGktW7qY+naIgYlzIg=; b=dqiWxiNc0lrvqQmcUq9b2uXDh34gU8bRUQJpQeCSKoyG+0kvSgf/3VZeLswMJsP8fg39lTSXOmiJ8iqFhf+oUGsz5qU5dFzqwLYHBKEKY2K3L/DOOejsccFmxxJt2GezW5bLFUvr8K+lhy3rPS9+eOtiVlzrleSA5goYIJft6z190Q6bsV/iUIVm4K/iSaRn7G5eYknRENNQq2ysJDap2HZYICKmwJ85tg5D6Pg4oiHd6ndQkYRKUNk4JE3WyjdAvXaG6g8Lgh8Y24Td/iQqENEX470qVYIhWfkHi3RSe+3pde3T3WqMEzFjW+znWyftATJbmf/p16w/3Z23N+RAXg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=88kZUwgmK7QzfLfoOzUUynYBIgGktW7qY+naIgYlzIg=; b=Wb9QTwXGVprWaz/HXzFjQz9MJBaWLSU6A20t9phQNQDCmyDGUHUtNF5CPrOhy1vpo4HEpG8zJQ2cBVY7pn6edzHXRpm5TzYeqjW1TCG9C2UVGrjlwnMABXpb36S+DQ6gx4o0LrJtqtsXqdZnGC64WIjSfDweo6Y4FopRywLIUQoO/MvRZL/P67oApAj8XUKa6FqqUMmbByF3uyUYRQYHAGhn+SmUk/a+OStB7lq9+UCjkLFQRnwzyhkRopLotbNFBqMqWvlXmr8R0R77WvDxsYR9mCRA4YNbSpXKpzHovXJoc703C/JGEhM+EQi+jtOCpkcU24pSi/k5NXiGVnam9A== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by PR3P250MB0180.EURP250.PROD.OUTLOOK.COM (2603:10a6:102:17b::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.31; Mon, 24 Jul 2023 11:58:52 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::5e01:aea5:d3a8:cafa]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::5e01:aea5:d3a8:cafa%3]) with mapi id 15.20.6609.032; Mon, 24 Jul 2023 11:58:52 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 24 Jul 2023 13:59:55 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 X-TMN: [uSBUjRbwE8/1/bwuMwmjVp/J9Gp3oc6l] X-ClientProxiedBy: ZR0P278CA0029.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:1c::16) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20230724115955.2184655-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|PR3P250MB0180:EE_ X-MS-Office365-Filtering-Correlation-Id: 32e6cdd2-642d-4934-a1e5-08db8c3d58ff X-MS-Exchange-SLBlob-MailProps: znQPCv1HvwXgXfJ2W+C50K2eqjzEqNqYR4O1e53dxEcVyokL0lm8DfdwjNf0e5o9RLmaK2yCdyGvpl6EHz0q9bZUP2TFPQakNv/JmTpkkhhrlpQjkQsL7VuZvNIz0UuQWRbHhyCyA0XY36aXUtTT9s4MfrElnjsoVMCaS43D4Qri55d2KH/aNIfMZoPuGc7LYV8FllqtuunkZb/asCsulYd8KF/rBwA7WNXrT0HLflWfz89JVrWgvLtUl8O1xUnfT4OOuRtdau3c7CxFsaDmkS6Dsd2ogGwVLX4dMVSl4CAipGjjoq07ap+abYU/ZhAu6pudUSI2PnWoVi1IiZvzq5IC/+g5dcPCIeaQD0Z5jaiK4LyLu87dVLtkQ06poMPDhYKhUQNinpQdjkw0TIYYQe3l6YgAkRk9yuf76Mun+glegY0FTwVqttmQ9fPlzMAFBJJkKzlsVes9V8JeIsXBiYGL36K7lv2gifYiumuJ+JwzsWujyPrAIGM+qVch5OjUjB0b7Hr2VZU+WxIYq7HW4qhwcJ11r6a29H7UG67N7NaEpTpl+XNolDf62OnyKnNmcGqIQYyYwbLPur/Si0azA3xuwWgejsr+WLKKri8dIUuSBgypqVyeRyqG6LnmNvKCN30kWsl2mZpQMUMZqJdDNfsCESLeZSCWb4FTrDWsPsxWEe3hKoOXiXwMk0MNoqn3hSojkZpvFxcOOBRxA4TU0UPj6mHdihmqiJcHddpZzRoKTITEqC8YVKBKb007jyJ8OE7IHnmksYI= X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Kh4c+RjOIKc3GsHVbL7oeF+FxS+2ZzWIea4weDJFN5YbCFHJ5WCjeoL5fz+cywb3GqlIh5T1N20TPa/qva/IuohTLndiqS8bRqjNDXHUW0F4/UofFs1QHs7jI12TMuzeabK5awLe66fCayHkNXDEDUk/Zxh3+LVKQm5h85DV7Kz5p151RCwKwvEfuOiCcOKodlb59nC5/XzZFtc9dQTPSIoUeAXcd9Xqr1aETX8HjCYs1cHPEJs1DLaWOHR/5BIX0Tn0jn9iec6+YBAYeLo09febi01f0IpWoJkz4++k2dxAx86sn78eyRt8RV8yWWICxMpPX0fYSfbNuWUmRVZnnHMsRYgHhWeuGLraOmlZBLNuxmwM5Qv526Dee1hKLl2YjDdwcPMgKcH75TVI5aNi8itDxt9Eg2UeLcn8Xl79NbhFe0hKXHqTGUbdyIRSwOGtjx5Gnlugg/yoE4MZAnRpDGtZ4NZPFdB9H82/zWhsMnRUVdUYmb8hWPphBQ9mKMApPNpHQaPFYScvCaK6oMKJFYtlOhGgy9wOYrBZ0ScvKRPlkgg31BxRcwIYxuH/teqEAr88Rogz05JA5HWjGYyrJ7v7rLJbM8349V3tOX+oDSf8/uhmjnEgooAi1IYHzno8 X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: PmwvWGdTyEpjeWBkpDxVaHY2iCrdj9P2Rq5oZjbTTPGmZptV+DP7xYVpqPTWfw50lLAeLyLUo81RXMbhHaHT6ibJLRyPRLwNh40nwq8m0Ydj96UKN2IuK99tRiIWaIAFage6bqpxxv4i6C0f9ZZKuM+/azrYRr6rjHPIUxTb4iTcg1YSTF+XglcgdhpvlDvLyqbM9Tae0G1r4NXALnP9prRW1dHUvkgnMHAOefXUA2dtv8+Vzw6aCJBCBs5niJRtsnJ2gyvlE6+TYGtY1wEpEYHlryIGOilHKd63XOl6BiK/8faSC4UJdHqExBe71Q9emSzSVTujxm13WhfGzVb46HY53WYqjHzIghJfT6Ko8jyJow88slEOSOSui+aUAJx8ASrCkDitVmA0x8+FquqrE6hg0mNuOGLKcWpSJ4WXM6/+Iann14YQ3z65EC+MGviSXUt3UcaUdiu+Ss5C0UtE3K/07qXSGyjG+dMpmldsBE0Z0ut/OkWsHYcIVCuglvDuMGljmbTjBh8h7rLxTD6G0Jc/4WFElHHXBmpoT182FB9mWgkpzxXHgBfEDuP1hUPlaJgANd4ek1mXWvc10qGTJrjoulZ0TpzvSdOec4DEoQDvedQIrSyxmxoWlgHhxlDyf0KEHpYfsVQyC/xVTVAo4cYVHBY5xh8qEpBFUSM5WMsUDlYQmPsUk6GmORyVbKjwO4C3dnMFcyQkY6PBgLFFy24zkmO/KRgLT0uW7VGpxqHyXRUiqhvm39he6qzC5C172rEA0Ru2hS0b2xM8ZBlIXiLG6LfPu9J0NZfTYuASMDK3IjeQEmD8Jtfn0Au1FyeWxeHo00RUfdhSddJm9cXTBQ59B+wxoOF8DEeHdpHHYTyrhCvQnTxYCWW/cTF+n1skITu+XsvxQYpfXOCBGrkVkK+UAG108Agdrab73INBRrCpZBUmP8FwhobjRnvuz/rDoZp11MobzROolRuI3bXGfID/ySgLQvNCSs3ZrkPy7BLz418PA3f3l30hSoNjSGVa4lIt8t3OWXRfXDtdztpbprvPD5z7MX8pqvPlGgEZ6n0cMiUG3XMfXRiYXI+4/jdIwBUvqSwWBYAa3z9CrZhGkALXssRa9mZXtuwlO1ROvVmowfob2swGubUCBlJni1H5wjTLENlLg87ELY7BZcPfugirwrfpXRcFvMVKx3ZQSi/q/AAGi960dLbhewilIDj/7R7iRHV6IFiCUg0omLO6WQ1vI2wqN8aA025ABD/LgXo2s8j7uAsxq12oO8hsLPcy X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 32e6cdd2-642d-4934-a1e5-08db8c3d58ff X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2023 11:58:52.0391 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3P250MB0180 Subject: [FFmpeg-devel] [PATCH] avcodec/(fft|mdct)_fixed_32: Remove fixed-point FFT/MDCT 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: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: rkksLaJ+/46K These are no longer used as they have been replaced by avutil/tx. Yet they are still compiled for all builds and included by default in the resulting DSO for shared builds (they are discarded for shared builds). This commit stops doing so. This saves 8KiB in .rodata, about 43KiB in .bss and more than 2KiB in .text for shared builds. (The floating point FFT is still used by AVFFT and can therefore not be removed for now; it is also used implicitly by mpadsp and wmavoice.) Signed-off-by: Andreas Rheinhardt --- doc/mips.txt | 6 - libavcodec/Makefile | 7 +- libavcodec/dct.h | 2 +- libavcodec/fft-internal.h | 16 -- libavcodec/fft.h | 22 -- libavcodec/fft_fixed_32.c | 51 ----- libavcodec/fft_init_table.c | 344 ------------------------------ libavcodec/fft_template.c | 173 +-------------- libavcodec/mdct_fixed_32.c | 51 ----- libavcodec/mdct_template.c | 9 - libavcodec/mips/fft_mips.c | 5 +- libavcodec/{ => mips}/fft_table.h | 43 +++- libavcodec/rdft.h | 2 +- libavcodec/tests/.gitignore | 1 - libavcodec/tests/avfft.c | 1 - libavcodec/tests/fft-fixed32.c | 21 -- libavcodec/tests/fft.c | 28 --- tests/fate/fft.mak | 23 +- 18 files changed, 46 insertions(+), 759 deletions(-) delete mode 100644 libavcodec/fft_fixed_32.c delete mode 100644 libavcodec/fft_init_table.c delete mode 100644 libavcodec/mdct_fixed_32.c rename libavcodec/{ => mips}/fft_table.h (73%) delete mode 100644 libavcodec/tests/fft-fixed32.c diff --git a/doc/mips.txt b/doc/mips.txt index a84e89ae79..8604f7999d 100644 --- a/doc/mips.txt +++ b/doc/mips.txt @@ -48,11 +48,6 @@ Files that have MIPS copyright notice in them: float_dsp_mips.c libm_mips.h softfloat_tables.h -* libavcodec/ - fft_fixed_32.c - fft_init_table.c - fft_table.h - mdct_fixed_32.c * libavcodec/mips/ aacdec_fixed.c aacsbr_fixed.c @@ -72,7 +67,6 @@ Files that have MIPS copyright notice in them: dsputil_mips.c fft_mips.c fft_table.h - fft_init_table.c fmtconvert_mips.c iirfilter_mips.c mpegaudiodsp_mips_fixed.c diff --git a/libavcodec/Makefile b/libavcodec/Makefile index 1b0226c089..9101ab73b4 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -91,8 +91,7 @@ OBJS-$(CONFIG_FAANDCT) += faandct.o OBJS-$(CONFIG_FAANIDCT) += faanidct.o OBJS-$(CONFIG_FDCTDSP) += fdctdsp.o jfdctfst.o jfdctint.o FFT-OBJS-$(CONFIG_HARDCODED_TABLES) += cos_tables.o -OBJS-$(CONFIG_FFT) += avfft.o fft_float.o fft_fixed_32.o \ - fft_init_table.o $(FFT-OBJS-yes) +OBJS-$(CONFIG_FFT) += avfft.o fft_float.o $(FFT-OBJS-yes) OBJS-$(CONFIG_FMTCONVERT) += fmtconvert.o OBJS-$(CONFIG_GOLOMB) += golomb.o OBJS-$(CONFIG_H263DSP) += h263dsp.o @@ -125,7 +124,7 @@ OBJS-$(CONFIG_LLVIDENCDSP) += lossless_videoencdsp.o OBJS-$(CONFIG_LPC) += lpc.o OBJS-$(CONFIG_LSP) += lsp.o OBJS-$(CONFIG_LZF) += lzf.o -OBJS-$(CONFIG_MDCT) += mdct_float.o mdct_fixed_32.o +OBJS-$(CONFIG_MDCT) += mdct_float.o OBJS-$(CONFIG_ME_CMP) += me_cmp.o OBJS-$(CONFIG_MEDIACODEC) += mediacodecdec_common.o mediacodec_surface.o mediacodec_wrapper.o mediacodec_sw_buffer.o OBJS-$(CONFIG_MPEG_ER) += mpeg_er.o @@ -1320,7 +1319,7 @@ TESTPROGS = avcodec \ TESTPROGS-$(CONFIG_CABAC) += cabac TESTPROGS-$(CONFIG_DCT) += avfft -TESTPROGS-$(CONFIG_FFT) += fft fft-fixed32 +TESTPROGS-$(CONFIG_FFT) += fft TESTPROGS-$(CONFIG_GOLOMB) += golomb TESTPROGS-$(CONFIG_IDCTDSP) += dct TESTPROGS-$(CONFIG_IIRFILTER) += iirfilter diff --git a/libavcodec/dct.h b/libavcodec/dct.h index 0a03e256d1..041e8169ce 100644 --- a/libavcodec/dct.h +++ b/libavcodec/dct.h @@ -21,7 +21,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#if !defined(AVCODEC_DCT_H) && (!defined(FFT_FLOAT) || FFT_FLOAT) +#ifndef AVCODEC_DCT_H #define AVCODEC_DCT_H #include diff --git a/libavcodec/fft-internal.h b/libavcodec/fft-internal.h index d89a3e38ca..3b07da7aa2 100644 --- a/libavcodec/fft-internal.h +++ b/libavcodec/fft-internal.h @@ -22,8 +22,6 @@ #include "libavutil/mathematics.h" #include "fft.h" -#if FFT_FLOAT - #define FIX15(v) (v) #define sqrthalf (float)M_SQRT1_2 @@ -37,20 +35,6 @@ (dim) = (are) * (bim) + (aim) * (bre); \ } while (0) -#else /* FFT_FLOAT */ - -#define CMUL(dre, dim, are, aim, bre, bim) do { \ - int64_t accu; \ - (accu) = (int64_t)(bre) * (are); \ - (accu) -= (int64_t)(bim) * (aim); \ - (dre) = (int)(((accu) + 0x40000000) >> 31); \ - (accu) = (int64_t)(bre) * (aim); \ - (accu) += (int64_t)(bim) * (are); \ - (dim) = (int)(((accu) + 0x40000000) >> 31); \ - } while (0) - -#endif /* FFT_FLOAT */ - #define ff_imdct_calc_c FFT_NAME(ff_imdct_calc_c) #define ff_imdct_half_c FFT_NAME(ff_imdct_half_c) #define ff_mdct_calc_c FFT_NAME(ff_mdct_calc_c) diff --git a/libavcodec/fft.h b/libavcodec/fft.h index d46e5a3f0b..8a0e6aa48f 100644 --- a/libavcodec/fft.h +++ b/libavcodec/fft.h @@ -22,40 +22,18 @@ #ifndef AVCODEC_FFT_H #define AVCODEC_FFT_H -#ifndef FFT_FLOAT -#define FFT_FLOAT 1 -#endif - #include #include "config.h" #include "libavutil/attributes_internal.h" #include "libavutil/mem_internal.h" -#if FFT_FLOAT - #include "avfft.h" #define FFT_NAME(x) x typedef float FFTDouble; -#else - -#define Q31(x) (int)((x)*2147483648.0 + 0.5) -#define FFT_NAME(x) x ## _fixed_32 - -typedef int32_t FFTSample; - -typedef struct FFTComplex { - FFTSample re, im; -} FFTComplex; - -typedef int FFTDouble; -typedef struct FFTContext FFTContext; - -#endif /* FFT_FLOAT */ - typedef struct FFTDComplex { FFTDouble re, im; } FFTDComplex; diff --git a/libavcodec/fft_fixed_32.c b/libavcodec/fft_fixed_32.c deleted file mode 100644 index e18dc83891..0000000000 --- a/libavcodec/fft_fixed_32.c +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2012 - * MIPS Technologies, Inc., California. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the MIPS Technologies, Inc., nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE MIPS TECHNOLOGIES, INC. ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE MIPS TECHNOLOGIES, INC. BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * Authors: Stanislav Ocovaj (socovaj@mips.com) - * Goran Cordasic (goran@mips.com) - * Djordje Pesut (djordje@mips.com) - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#define FFT_FLOAT 0 -#include "fft_template.c" diff --git a/libavcodec/fft_init_table.c b/libavcodec/fft_init_table.c deleted file mode 100644 index 83e35ffb7c..0000000000 --- a/libavcodec/fft_init_table.c +++ /dev/null @@ -1,344 +0,0 @@ -/* - * Copyright (c) 2012 - * MIPS Technologies, Inc., California. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the MIPS Technologies, Inc., nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE MIPS TECHNOLOGIES, INC. ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE MIPS TECHNOLOGIES, INC. BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * Authors: Stanislav Ocovaj (socovaj@mips.com) - * Goran Cordasic (goran@mips.com) - * Djordje Pesut (djordje@mips.com) - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -/** - * @file - * definitions and initialization of LUT table for FFT - */ -#include "libavutil/thread.h" - -#include "libavcodec/fft_table.h" - -const int32_t ff_w_tab_sr[MAX_FFT_SIZE/(4*16)] = { -2147483647, 2147483016, 2147481121, 2147477963, 2147473542, 2147467857, 2147460908, 2147452697, -2147443222, 2147432484, 2147420483, 2147407218, 2147392690, 2147376899, 2147359845, 2147341527, -2147321946, 2147301102, 2147278995, 2147255625, 2147230991, 2147205094, 2147177934, 2147149511, -2147119825, 2147088876, 2147056664, 2147023188, 2146988450, 2146952448, 2146915184, 2146876656, -2146836866, 2146795813, 2146753497, 2146709917, 2146665076, 2146618971, 2146571603, 2146522973, -2146473080, 2146421924, 2146369505, 2146315824, 2146260881, 2146204674, 2146147205, 2146088474, -2146028480, 2145967224, 2145904705, 2145840924, 2145775880, 2145709574, 2145642006, 2145573176, -2145503083, 2145431729, 2145359112, 2145285233, 2145210092, 2145133690, 2145056025, 2144977098, -2144896910, 2144815460, 2144732748, 2144648774, 2144563539, 2144477042, 2144389283, 2144300264, -2144209982, 2144118439, 2144025635, 2143931570, 2143836244, 2143739656, 2143641807, 2143542697, -2143442326, 2143340694, 2143237802, 2143133648, 2143028234, 2142921559, 2142813624, 2142704427, -2142593971, 2142482254, 2142369276, 2142255039, 2142139541, 2142022783, 2141904764, 2141785486, -2141664948, 2141543150, 2141420092, 2141295774, 2141170197, 2141043360, 2140915264, 2140785908, -2140655293, 2140523418, 2140390284, 2140255892, 2140120240, 2139983329, 2139845159, 2139705730, -2139565043, 2139423097, 2139279892, 2139135429, 2138989708, 2138842728, 2138694490, 2138544994, -2138394240, 2138242228, 2138088958, 2137934430, 2137778644, 2137621601, 2137463301, 2137303743, -2137142927, 2136980855, 2136817525, 2136652938, 2136487095, 2136319994, 2136151637, 2135982023, -2135811153, 2135639026, 2135465642, 2135291003, 2135115107, 2134937956, 2134759548, 2134579885, -2134398966, 2134216791, 2134033361, 2133848675, 2133662734, 2133475538, 2133287087, 2133097381, -2132906420, 2132714204, 2132520734, 2132326009, 2132130030, 2131932796, 2131734309, 2131534567, -2131333572, 2131131322, 2130927819, 2130723062, 2130517052, 2130309789, 2130101272, 2129891502, -2129680480, 2129468204, 2129254676, 2129039895, 2128823862, 2128606576, 2128388038, 2128168248, -2127947206, 2127724913, 2127501367, 2127276570, 2127050522, 2126823222, 2126594672, 2126364870, -2126133817, 2125901514, 2125667960, 2125433155, 2125197100, 2124959795, 2124721240, 2124481435, -2124240380, 2123998076, 2123754522, 2123509718, 2123263666, 2123016364, 2122767814, 2122518015, -2122266967, 2122014670, 2121761126, 2121506333, 2121250292, 2120993003, 2120734467, 2120474683, -2120213651, 2119951372, 2119687847, 2119423074, 2119157054, 2118889788, 2118621275, 2118351516, -2118080511, 2117808259, 2117534762, 2117260020, 2116984031, 2116706797, 2116428319, 2116148595, -2115867626, 2115585412, 2115301954, 2115017252, 2114731305, 2114444114, 2114155680, 2113866001, -2113575080, 2113282914, 2112989506, 2112694855, 2112398960, 2112101824, 2111803444, 2111503822, -2111202959, 2110900853, 2110597505, 2110292916, 2109987085, 2109680013, 2109371700, 2109062146, -2108751352, 2108439317, 2108126041, 2107811526, 2107495770, 2107178775, 2106860540, 2106541065, -2106220352, 2105898399, 2105575208, 2105250778, 2104925109, 2104598202, 2104270057, 2103940674, -2103610054, 2103278196, 2102945101, 2102610768, 2102275199, 2101938393, 2101600350, 2101261071, -2100920556, 2100578805, 2100235819, 2099891596, 2099546139, 2099199446, 2098851519, 2098502357, -2098151960, 2097800329, 2097447464, 2097093365, 2096738032, 2096381466, 2096023667, 2095664635, -2095304370, 2094942872, 2094580142, 2094216179, 2093850985, 2093484559, 2093116901, 2092748012, -2092377892, 2092006541, 2091633960, 2091260147, 2090885105, 2090508833, 2090131331, 2089752599, -2089372638, 2088991448, 2088609029, 2088225381, 2087840505, 2087454400, 2087067068, 2086678508, -2086288720, 2085897705, 2085505463, 2085111994, 2084717298, 2084321376, 2083924228, 2083525854, -2083126254, 2082725429, 2082323379, 2081920103, 2081515603, 2081109879, 2080702930, 2080294757, -2079885360, 2079474740, 2079062896, 2078649830, 2078235540, 2077820028, 2077403294, 2076985338, -2076566160, 2076145760, 2075724139, 2075301296, 2074877233, 2074451950, 2074025446, 2073597721, -2073168777, 2072738614, 2072307231, 2071874629, 2071440808, 2071005769, 2070569511, 2070132035, -2069693342, 2069253430, 2068812302, 2068369957, 2067926394, 2067481616, 2067035621, 2066588410, -2066139983, 2065690341, 2065239484, 2064787411, 2064334124, 2063879623, 2063423908, 2062966978, -2062508835, 2062049479, 2061588910, 2061127128, 2060664133, 2060199927, 2059734508, 2059267877, -2058800036, 2058330983, 2057860719, 2057389244, 2056916560, 2056442665, 2055967560, 2055491246, -2055013723, 2054534991, 2054055050, 2053573901, 2053091544, 2052607979, 2052123207, 2051637227, -2051150040, 2050661647, 2050172048, 2049681242, 2049189231, 2048696014, 2048201592, 2047705965, -2047209133, 2046711097, 2046211857, 2045711414, 2045209767, 2044706916, 2044202863, 2043697608, -2043191150, 2042683490, 2042174628, 2041664565, 2041153301, 2040640837, 2040127172, 2039612306, -2039096241, 2038578976, 2038060512, 2037540850, 2037019988, 2036497928, 2035974670, 2035450215, -2034924562, 2034397712, 2033869665, 2033340422, 2032809982, 2032278347, 2031745516, 2031211490, -2030676269, 2030139853, 2029602243, 2029063439, 2028523442, 2027982251, 2027439867, 2026896291, -2026351522, 2025805561, 2025258408, 2024710064, 2024160529, 2023609803, 2023057887, 2022504780, -2021950484, 2021394998, 2020838323, 2020280460, 2019721407, 2019161167, 2018599739, 2018037123, -2017473321, 2016908331, 2016342155, 2015774793, 2015206245, 2014636511, 2014065592, 2013493489, -2012920201, 2012345729, 2011770073, 2011193233, 2010615210, 2010036005, 2009455617, 2008874047, -2008291295, 2007707362, 2007122248, 2006535953, 2005948478, 2005359822, 2004769987, 2004178973, -2003586779, 2002993407, 2002398857, 2001803128, 2001206222, 2000608139, 2000008879, 1999408442, -1998806829, 1998204040, 1997600076, 1996994937, 1996388622, 1995781134, 1995172471, 1994562635, -1993951625, 1993339442, 1992726087, 1992111559, 1991495860, 1990878989, 1990260946, 1989641733, -1989021350, 1988399796, 1987777073, 1987153180, 1986528118, 1985901888, 1985274489, 1984645923, -1984016189, 1983385288, 1982753220, 1982119985, 1981485585, 1980850019, 1980213288, 1979575392, -1978936331, 1978296106, 1977654717, 1977012165, 1976368450, 1975723572, 1975077532, 1974430331, -1973781967, 1973132443, 1972481757, 1971829912, 1971176906, 1970522741, 1969867417, 1969210933, -1968553292, 1967894492, 1967234535, 1966573420, 1965911148, 1965247720, 1964583136, 1963917396, -1963250501, 1962582451, 1961913246, 1961242888, 1960571375, 1959898709, 1959224890, 1958549919, -1957873796, 1957196520, 1956518093, 1955838516, 1955157788, 1954475909, 1953792881, 1953108703, -1952423377, 1951736902, 1951049279, 1950360508, 1949670589, 1948979524, 1948287312, 1947593954, -1946899451, 1946203802, 1945507008, 1944809070, 1944109987, 1943409761, 1942708392, 1942005880, -1941302225, 1940597428, 1939891490, 1939184411, 1938476190, 1937766830, 1937056329, 1936344689, -1935631910, 1934917992, 1934202936, 1933486742, 1932769411, 1932050943, 1931331338, 1930610597, -1929888720, 1929165708, 1928441561, 1927716279, 1926989864, 1926262315, 1925533633, 1924803818, -1924072871, 1923340791, 1922607581, 1921873239, 1921137767, 1920401165, 1919663432, 1918924571, -1918184581, 1917443462, 1916701216, 1915957841, 1915213340, 1914467712, 1913720958, 1912973078, -1912224073, 1911473942, 1910722688, 1909970309, 1909216806, 1908462181, 1907706433, 1906949562, -1906191570, 1905432457, 1904672222, 1903910867, 1903148392, 1902384797, 1901620084, 1900854251, -1900087301, 1899319232, 1898550047, 1897779744, 1897008325, 1896235790, 1895462140, 1894687374, -1893911494, 1893134500, 1892356392, 1891577171, 1890796837, 1890015391, 1889232832, 1888449163, -1887664383, 1886878492, 1886091491, 1885303381, 1884514161, 1883723833, 1882932397, 1882139853, -1881346202, 1880551444, 1879755580, 1878958610, 1878160535, 1877361354, 1876561070, 1875759681, -1874957189, 1874153594, 1873348897, 1872543097, 1871736196, 1870928194, 1870119091, 1869308888, -1868497586, 1867685184, 1866871683, 1866057085, 1865241388, 1864424594, 1863606704, 1862787717, -1861967634, 1861146456, 1860324183, 1859500816, 1858676355, 1857850800, 1857024153, 1856196413, -1855367581, 1854537657, 1853706643, 1852874538, 1852041343, 1851207059, 1850371686, 1849535224, -1848697674, 1847859036, 1847019312, 1846178501, 1845336604, 1844493621, 1843649553, 1842804401, -1841958164, 1841110844, 1840262441, 1839412956, 1838562388, 1837710739, 1836858008, 1836004197, -1835149306, 1834293336, 1833436286, 1832578158, 1831718951, 1830858668, 1829997307, 1829134869, -1828271356, 1827406767, 1826541103, 1825674364, 1824806552, 1823937666, 1823067707, 1822196675, -1821324572, 1820451397, 1819577151, 1818701835, 1817825449, 1816947994, 1816069469, 1815189877, -1814309216, 1813427489, 1812544694, 1811660833, 1810775906, 1809889915, 1809002858, 1808114737, -1807225553, 1806335305, 1805443995, 1804551623, 1803658189, 1802763694, 1801868139, 1800971523, -1800073849, 1799175115, 1798275323, 1797374472, 1796472565, 1795569601, 1794665580, 1793760504, -1792854372, 1791947186, 1791038946, 1790129652, 1789219305, 1788307905, 1787395453, 1786481950, -1785567396, 1784651792, 1783735137, 1782817434, 1781898681, 1780978881, 1780058032, 1779136137, -1778213194, 1777289206, 1776364172, 1775438094, 1774510970, 1773582803, 1772653593, 1771723340, -1770792044, 1769859707, 1768926328, 1767991909, 1767056450, 1766119952, 1765182414, 1764243838, -1763304224, 1762363573, 1761421885, 1760479161, 1759535401, 1758590607, 1757644777, 1756697914, -1755750017, 1754801087, 1753851126, 1752900132, 1751948107, 1750995052, 1750040966, 1749085851, -1748129707, 1747172535, 1746214334, 1745255107, 1744294853, 1743333573, 1742371267, 1741407936, -1740443581, 1739478202, 1738511799, 1737544374, 1736575927, 1735606458, 1734635968, 1733664458, -1732691928, 1731718378, 1730743810, 1729768224, 1728791620, 1727813999, 1726835361, 1725855708, -1724875040, 1723893357, 1722910659, 1721926948, 1720942225, 1719956488, 1718969740, 1717981981, -1716993211, 1716003431, 1715012642, 1714020844, 1713028037, 1712034223, 1711039401, 1710043573, -1709046739, 1708048900, 1707050055, 1706050207, 1705049355, 1704047500, 1703044642, 1702040783, -1701035922, 1700030061, 1699023199, 1698015339, 1697006479, 1695996621, 1694985765, 1693973912, -1692961062, 1691947217, 1690932376, 1689916541, 1688899711, 1687881888, 1686863072, 1685843263, -1684822463, 1683800672, 1682777890, 1681754118, 1680729357, 1679703608, 1678676870, 1677649144, -1676620432, 1675590733, 1674560049, 1673528379, 1672495725, 1671462087, 1670427466, 1669391862, -1668355276, 1667317709, 1666279161, 1665239632, 1664199124, 1663157637, 1662115172, 1661071729, -1660027308, 1658981911, 1657935539, 1656888190, 1655839867, 1654790570, 1653740300, 1652689057, -1651636841, 1650583654, 1649529496, 1648474367, 1647418269, 1646361202, 1645303166, 1644244162, -1643184191, 1642123253, 1641061349, 1639998480, 1638934646, 1637869848, 1636804087, 1635737362, -1634669676, 1633601027, 1632531418, 1631460848, 1630389319, 1629316830, 1628243383, 1627168978, -1626093616, 1625017297, 1623940023, 1622861793, 1621782608, 1620702469, 1619621377, 1618539332, -1617456335, 1616372386, 1615287487, 1614201637, 1613114838, 1612027089, 1610938393, 1609848749, -1608758157, 1607666620, 1606574136, 1605480708, 1604386335, 1603291018, 1602194758, 1601097555, -1599999411, 1598900325, 1597800299, 1596699333, 1595597428, 1594494583, 1593390801, 1592286082, -1591180426, 1590073833, 1588966306, 1587857843, 1586748447, 1585638117, 1584526854, 1583414660, -1582301533, 1581187476, 1580072489, 1578956572, 1577839726, 1576721952, 1575603251, 1574483623, -1573363068, 1572241588, 1571119183, 1569995854, 1568871601, 1567746425, 1566620327, 1565493307, -1564365367, 1563236506, 1562106725, 1560976026, 1559844408, 1558711873, 1557578421, 1556444052, -1555308768, 1554172569, 1553035455, 1551897428, 1550758488, 1549618636, 1548477872, 1547336197, -1546193612, 1545050118, 1543905714, 1542760402, 1541614183, 1540467057, 1539319024, 1538170087, -1537020244, 1535869497, 1534717846, 1533565293, 1532411837, 1531257480, 1530102222, 1528946064, -1527789007, 1526631051, 1525472197, 1524312445, 1523151797, 1521990252, 1520827813, 1519664478, -1518500250, 1517335128, 1516169114, 1515002208, 1513834411, 1512665723, 1511496145, 1510325678, -1509154322, 1507982079, 1506808949, 1505634932, 1504460029, 1503284242, 1502107570, 1500930014, -1499751576, 1498572255, 1497392053, 1496210969, 1495029006, 1493846163, 1492662441, 1491477842, -1490292364, 1489106011, 1487918781, 1486730675, 1485541696, 1484351842, 1483161115, 1481969516, -1480777044, 1479583702, 1478389489, 1477194407, 1475998456, 1474801636, 1473603949, 1472405394, -1471205974, 1470005688, 1468804538, 1467602523, 1466399645, 1465195904, 1463991302, 1462785838, -1461579514, 1460372329, 1459164286, 1457955385, 1456745625, 1455535009, 1454323536, 1453111208, -1451898025, 1450683988, 1449469098, 1448253355, 1447036760, 1445819314, 1444601017, 1443381870, -1442161874, 1440941030, 1439719338, 1438496799, 1437273414, 1436049184, 1434824109, 1433598189, -1432371426, 1431143821, 1429915374, 1428686085, 1427455956, 1426224988, 1424993180, 1423760534, -1422527051, 1421292730, 1420057574, 1418821582, 1417584755, 1416347095, 1415108601, 1413869275, -1412629117, 1411388129, 1410146309, 1408903661, 1407660183, 1406415878, 1405170745, 1403924785, -1402678000, 1401430389, 1400181954, 1398932695, 1397682613, 1396431709, 1395179984, 1393927438, -1392674072, 1391419886, 1390164882, 1388909060, 1387652422, 1386394966, 1385136696, 1383877610, -1382617710, 1381356997, 1380095472, 1378833134, 1377569986, 1376306026, 1375041258, 1373775680, -1372509294, 1371242101, 1369974101, 1368705296, 1367435685, 1366165269, 1364894050, 1363622028, -1362349204, 1361075579, 1359801152, 1358525926, 1357249901, 1355973077, 1354695455, 1353417037, -1352137822, 1350857812, 1349577007, 1348295409, 1347013017, 1345729833, 1344445857, 1343161090, -1341875533, 1340589187, 1339302052, 1338014129, 1336725419, 1335435923, 1334145641, 1332854574, -1331562723, 1330270089, 1328976672, 1327682474, 1326387494, 1325091734, 1323795195, 1322497877, -1321199781, 1319900907, 1318601257, 1317300832, 1315999631, 1314697657, 1313394909, 1312091388, -1310787095, 1309482032, 1308176198, 1306869594, 1305562222, 1304254082, 1302945174, 1301635500, -1300325060, 1299013855, 1297701886, 1296389154, 1295075659, 1293761402, 1292446384, 1291130606, -1289814068, 1288496772, 1287178717, 1285859905, 1284540337, 1283220013, 1281898935, 1280577102, -1279254516, 1277931177, 1276607086, 1275282245, 1273956653, 1272630312, 1271303222, 1269975384, -1268646800, 1267317469, 1265987392, 1264656571, 1263325005, 1261992697, 1260659646, 1259325853, -1257991320, 1256656047, 1255320034, 1253983283, 1252645794, 1251307568, 1249968606, 1248628909, -1247288478, 1245947312, 1244605414, 1243262783, 1241919421, 1240575329, 1239230506, 1237884955, -1236538675, 1235191668, 1233843935, 1232495475, 1231146291, 1229796382, 1228445750, 1227094395, -1225742318, 1224389521, 1223036002, 1221681765, 1220326809, 1218971135, 1217614743, 1216257636, -1214899813, 1213541275, 1212182024, 1210822059, 1209461382, 1208099993, 1206737894, 1205375085, -1204011567, 1202647340, 1201282407, 1199916766, 1198550419, 1197183368, 1195815612, 1194447153, -1193077991, 1191708127, 1190337562, 1188966297, 1187594332, 1186221669, 1184848308, 1183474250, -1182099496, 1180724046, 1179347902, 1177971064, 1176593533, 1175215310, 1173836395, 1172456790, -1171076495, 1169695512, 1168313840, 1166931481, 1165548435, 1164164704, 1162780288, 1161395188, -1160009405, 1158622939, 1157235792, 1155847964, 1154459456, 1153070269, 1151680403, 1150289860, -1148898640, 1147506745, 1146114174, 1144720929, 1143327011, 1141932420, 1140537158, 1139141224, -1137744621, 1136347348, 1134949406, 1133550797, 1132151521, 1130751579, 1129350972, 1127949701, -1126547765, 1125145168, 1123741908, 1122337987, 1120933406, 1119528166, 1118122267, 1116715710, -1115308496, 1113900627, 1112492101, 1111082922, 1109673089, 1108262603, 1106851465, 1105439676, -1104027237, 1102614148, 1101200410, 1099786025, 1098370993, 1096955314, 1095538991, 1094122023, -1092704411, 1091286156, 1089867259, 1088447722, 1087027544, 1085606726, 1084185270, 1082763176, -1081340445, 1079917078, 1078493076, 1077068439, 1075643169, 1074217266, 1072790730, 1071363564, -1069935768, 1068507342, 1067078288, 1065648605, 1064218296, 1062787361, 1061355801, 1059923616, -1058490808, 1057057377, 1055623324, 1054188651, 1052753357, 1051317443, 1049880912, 1048443763, -1047005996, 1045567615, 1044128617, 1042689006, 1041248781, 1039807944, 1038366495, 1036924436, -1035481766, 1034038487, 1032594600, 1031150105, 1029705004, 1028259297, 1026812985, 1025366069, -1023918550, 1022470428, 1021021705, 1019572382, 1018122458, 1016671936, 1015220816, 1013769098, -1012316784, 1010863875, 1009410370, 1007956272, 1006501581, 1005046298, 1003590424, 1002133959, -1000676905, 999219262, 997761031, 996302214, 994842810, 993382821, 991922248, 990461091, -988999351, 987537030, 986074127, 984610645, 983146583, 981681943, 980216726, 978750932, -977284562, 975817617, 974350098, 972882006, 971413342, 969944106, 968474300, 967003923, -965532978, 964061465, 962589385, 961116739, 959643527, 958169751, 956695411, 955220508, -953745043, 952269017, 950792431, 949315286, 947837582, 946359321, 944880503, 943401129, -941921200, 940440717, 938959681, 937478092, 935995952, 934513261, 933030021, 931546231, -930061894, 928577010, 927091579, 925605603, 924119082, 922632018, 921144411, 919656262, -918167572, 916678342, 915188572, 913698265, 912207419, 910716038, 909224120, 907731667, -906238681, 904745161, 903251110, 901756526, 900261413, 898765769, 897269597, 895772898, -894275671, 892777918, 891279640, 889780838, 888281512, 886781663, 885281293, 883780402, -882278992, 880777062, 879274614, 877771649, 876268167, 874764170, 873259659, 871754633, -870249095, 868743045, 867236484, 865729413, 864221832, 862713743, 861205147, 859696043, -858186435, 856676321, 855165703, 853654582, 852142959, 850630835, 849118210, 847605086, -846091463, 844577343, 843062726, 841547612, 840032004, 838515901, 836999305, 835482217, -833964638, 832446567, 830928007, 829408958, 827889422, 826369398, 824848888, 823327893, -821806413, 820284450, 818762005, 817239078, 815715670, 814191782, 812667415, 811142571, -809617249, 808091450, 806565177, 805038429, 803511207, 801983513, 800455346, 798926709, -797397602, 795868026, 794337982, 792807470, 791276492, 789745049, 788213141, 786680769, -785147934, 783614638, 782080880, 780546663, 779011986, 777476851, 775941259, 774405210, -772868706, 771331747, 769794334, 768256469, 766718151, 765179382, 763640164, 762100496, -760560380, 759019816, 757478806, 755937350, 754395449, 752853105, 751310318, 749767089, -748223418, 746679308, 745134758, 743589770, 742044345, 740498483, 738952186, 737405453, -735858287, 734310688, 732762657, 731214195, 729665303, 728115982, 726566232, 725016055, -723465451, 721914422, 720362968, 718811090, 717258790, 715706067, 714152924, 712599360, -711045377, 709490976, 707936158, 706380923, 704825272, 703269207, 701712728, 700155836, -698598533, 697040818, 695482694, 693924160, 692365218, 690805869, 689246113, 687685952, -686125387, 684564417, 683003045, 681441272, 679879097, 678316522, 676753549, 675190177, -673626408, 672062243, 670497682, 668932727, 667367379, 665801638, 664235505, 662668981, -661102068, 659534766, 657967075, 656398998, 654830535, 653261686, 651692453, 650122837, -648552838, 646982457, 645411696, 643840556, 642269036, 640697139, 639124865, 637552215, -635979190, 634405791, 632832018, 631257873, 629683357, 628108471, 626533215, 624957590, -623381598, 621805239, 620228514, 618651424, 617073971, 615496154, 613917975, 612339436, -610760536, 609181276, 607601658, 606021683, 604441352, 602860664, 601279623, 599698227, -598116479, 596534378, 594951927, 593369126, 591785976, 590202477, 588618632, 587034440, -585449903, 583865021, 582279796, 580694229, 579108320, 577522070, 575935480, 574348552, -572761285, 571173682, 569585743, 567997469, 566408860, 564819919, 563230645, 561641039, -560051104, 558460839, 556870245, 555279324, 553688076, 552096502, 550504604, 548912382, -547319836, 545726969, 544133781, 542540273, 540946445, 539352300, 537757837, 536163058, -534567963, 532972554, 531376831, 529780796, 528184449, 526587791, 524990824, 523393547, -521795963, 520198072, 518599875, 517001373, 515402566, 513803457, 512204045, 510604332, -509004318, 507404005, 505803394, 504202485, 502601279, 500999778, 499397982, 497795892, -496193509, 494590835, 492987869, 491384614, 489781069, 488177236, 486573117, 484968710, -483364019, 481759043, 480153784, 478548243, 476942419, 475336316, 473729932, 472123270, -470516330, 468909114, 467301622, 465693854, 464085813, 462477499, 460868912, 459260055, -457650927, 456041530, 454431865, 452821933, 451211734, 449601270, 447990541, 446379549, -444768294, 443156777, 441545000, 439932963, 438320667, 436708113, 435095303, 433482236, -431868915, 430255339, 428641511, 427027430, 425413098, 423798515, 422183684, 420568604, -418953276, 417337703, 415721883, 414105819, 412489512, 410872962, 409256170, 407639137, -406021865, 404404353, 402786604, 401168618, 399550396, 397931939, 396313247, 394694323, -393075166, 391455778, 389836160, 388216313, 386596237, 384975934, 383355404, 381734649, -380113669, 378492466, 376871039, 375249392, 373627523, 372005435, 370383128, 368760603, -367137861, 365514903, 363891730, 362268343, 360644742, 359020930, 357396906, 355772673, -354148230, 352523578, 350898719, 349273654, 347648383, 346022908, 344397230, 342771348, -341145265, 339518981, 337892498, 336265816, 334638936, 333011859, 331384586, 329757119, -328129457, 326501602, 324873555, 323245317, 321616889, 319988272, 318359466, 316730474, -315101295, 313471930, 311842381, 310212649, 308582734, 306952638, 305322361, 303691904, -302061269, 300430456, 298799466, 297168301, 295536961, 293905447, 292273760, 290641901, -289009871, 287377671, 285745302, 284112765, 282480061, 280847190, 279214155, 277580955, -275947592, 274314066, 272680379, 271046532, 269412525, 267778360, 266144038, 264509558, -262874923, 261240134, 259605191, 257970095, 256334847, 254699448, 253063900, 251428203, -249792358, 248156366, 246520228, 244883945, 243247518, 241610947, 239974235, 238337382, -236700388, 235063255, 233425984, 231788575, 230151030, 228513350, 226875535, 225237587, -223599506, 221961294, 220322951, 218684479, 217045878, 215407149, 213768293, 212129312, -210490206, 208850976, 207211624, 205572149, 203932553, 202292838, 200653003, 199013051, -197372981, 195732795, 194092495, 192452080, 190811551, 189170911, 187530159, 185889297, -184248325, 182607245, 180966058, 179324764, 177683365, 176041861, 174400254, 172758544, -171116733, 169474820, 167832808, 166190698, 164548489, 162906184, 161263783, 159621287, -157978697, 156336015, 154693240, 153050374, 151407418, 149764374, 148121241, 146478021, -144834714, 143191323, 141547847, 139904288, 138260647, 136616925, 134973122, 133329239, -131685278, 130041240, 128397125, 126752935, 125108670, 123464332, 121819921, 120175438, -118530885, 116886262, 115241570, 113596810, 111951983, 110307091, 108662134, 107017112, -105372028, 103726882, 102081675, 100436408, 98791081, 97145697, 95500255, 93854758, - 92209205, 90563597, 88917937, 87272224, 85626460, 83980645, 82334782, 80688869, - 79042909, 77396903, 75750851, 74104755, 72458615, 70812432, 69166208, 67519943, - 65873638, 64227295, 62580914, 60934496, 59288042, 57641553, 55995030, 54348475, - 52701887, 51055268, 49408620, 47761942, 46115236, 44468503, 42821744, 41174960, - 39528151, 37881320, 36234466, 34587590, 32940695, 31293780, 29646846, 27999895, - 26352928, 24705945, 23058947, 21411936, 19764913, 18117878, 16470832, 14823776, - 13176712, 11529640, 9882561, 8235476, 6588387, 4941294, 3294197, 1647099 -}; - -uint16_t ff_fft_offsets_lut[21845]; - -static void fft_lut_init(uint16_t *table, int off, int size, int *index) -{ - if (size < 16) { - table[*index] = off >> 2; - (*index)++; - } - else { - fft_lut_init(table, off, size >> 1, index); - fft_lut_init(table, off + (size >> 1), size >> 2, index); - fft_lut_init(table, off + 3 * (size >> 2), size >> 2, index); - } -} - -static void fft_lut_init_start(void) -{ - int n = 0; - - fft_lut_init(ff_fft_offsets_lut, 0, 1 << 17, &n); -} - -void ff_fft_lut_init(void) -{ - static AVOnce init_once = AV_ONCE_INIT; - - ff_thread_once(&init_once, fft_lut_init_start); -} diff --git a/libavcodec/fft_template.c b/libavcodec/fft_template.c index f2742a3ae8..3ed8d5491c 100644 --- a/libavcodec/fft_template.c +++ b/libavcodec/fft_template.c @@ -33,10 +33,6 @@ #include "fft.h" #include "fft-internal.h" -#if !FFT_FLOAT -#include "fft_table.h" -#else /* !FFT_FLOAT */ - /* cos(2*pi*x/n) for 0<=x<=n/4, followed by its reverse */ #if !CONFIG_HARDCODED_TABLES COSTABLE(16); @@ -136,8 +132,6 @@ COSTABLE_CONST FFTSample * const FFT_NAME(ff_cos_tabs)[] = { FFT_NAME(ff_cos_131072), }; -#endif /* FFT_FLOAT */ - static void fft_permute_c(FFTContext *s, FFTComplex *z); static void fft_calc_c(FFTContext *s, FFTComplex *z); @@ -226,7 +220,6 @@ av_cold int ff_fft_init(FFTContext *s, int nbits, int inverse) s->mdct_calc = ff_mdct_calc_c; #endif -#if FFT_FLOAT #if ARCH_AARCH64 ff_fft_init_aarch64(s); #elif ARCH_ARM @@ -242,12 +235,9 @@ av_cold int ff_fft_init(FFTContext *s, int nbits, int inverse) for(j=4; j<=nbits; j++) { ff_init_ff_cos_tabs(j); } -#else /* FFT_FLOAT */ - ff_fft_lut_init(); -#endif - if (ARCH_X86 && FFT_FLOAT && s->fft_permutation == FF_FFT_PERM_AVX) { + if (ARCH_X86 && s->fft_permutation == FF_FFT_PERM_AVX) { fft_perm_avx(s); } else { #define PROCESS_FFT_PERM_SWAP_LSBS(num) do {\ @@ -317,166 +307,6 @@ av_cold void ff_fft_end(FFTContext *s) av_freep(&s->tmp_buf); } -#if !FFT_FLOAT - -static void fft_calc_c(FFTContext *s, FFTComplex *z) { - - int nbits, i, n, num_transforms, offset, step; - int n4, n2, n34; - unsigned tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7, tmp8; - FFTComplex *tmpz; - const int fft_size = (1 << s->nbits); - int64_t accu; - - num_transforms = (0x2aab >> (16 - s->nbits)) | 1; - - for (n=0; n> 1) | 1; - - for (n=0; n> 31); - accu = (int64_t)Q31(M_SQRT1_2)*(int)(tmp3 - tmp4); - tmp7 = (int32_t)((accu + 0x40000000) >> 31); - accu = (int64_t)Q31(M_SQRT1_2)*(int)(tmp2 - tmp1); - tmp6 = (int32_t)((accu + 0x40000000) >> 31); - accu = (int64_t)Q31(M_SQRT1_2)*(int)(tmp3 + tmp4); - tmp8 = (int32_t)((accu + 0x40000000) >> 31); - tmp1 = tmp5 + tmp7; - tmp3 = tmp5 - tmp7; - tmp2 = tmp6 + tmp8; - tmp4 = tmp6 - tmp8; - - tmpz[5].re = tmpz[1].re - tmp1; - tmpz[1].re = tmpz[1].re + tmp1; - tmpz[5].im = tmpz[1].im - tmp2; - tmpz[1].im = tmpz[1].im + tmp2; - tmpz[7].re = tmpz[3].re - tmp4; - tmpz[3].re = tmpz[3].re + tmp4; - tmpz[7].im = tmpz[3].im + tmp3; - tmpz[3].im = tmpz[3].im - tmp3; - } - - step = 1 << ((MAX_LOG2_NFFT-4) - 4); - n4 = 4; - - for (nbits=4; nbits<=s->nbits; nbits++){ - n2 = 2*n4; - n34 = 3*n4; - num_transforms = (num_transforms >> 1) | 1; - - for (n=0; n> 31); - accu = (int64_t)w_re*tmpz[ n2+i].im; - accu -= (int64_t)w_im*tmpz[ n2+i].re; - tmp2 = (int32_t)((accu + 0x40000000) >> 31); - accu = (int64_t)w_re*tmpz[n34+i].re; - accu -= (int64_t)w_im*tmpz[n34+i].im; - tmp3 = (int32_t)((accu + 0x40000000) >> 31); - accu = (int64_t)w_re*tmpz[n34+i].im; - accu += (int64_t)w_im*tmpz[n34+i].re; - tmp4 = (int32_t)((accu + 0x40000000) >> 31); - - tmp5 = tmp1 + tmp3; - tmp1 = tmp1 - tmp3; - tmp6 = tmp2 + tmp4; - tmp2 = tmp2 - tmp4; - - tmpz[ n2+i].re = tmpz[ i].re - tmp5; - tmpz[ i].re = tmpz[ i].re + tmp5; - tmpz[ n2+i].im = tmpz[ i].im - tmp6; - tmpz[ i].im = tmpz[ i].im + tmp6; - tmpz[n34+i].re = tmpz[n4+i].re - tmp2; - tmpz[ n4+i].re = tmpz[n4+i].re + tmp2; - tmpz[n34+i].im = tmpz[n4+i].im + tmp1; - tmpz[ n4+i].im = tmpz[n4+i].im - tmp1; - - w_re_ptr += step; - w_im_ptr -= step; - } - } - step >>= 1; - n4 <<= 1; - } -} - -#else /* !FFT_FLOAT */ - #define BUTTERFLIES(a0,a1,a2,a3) {\ BF(t3, t5, t5, t1);\ BF(a2.re, a0.re, a0.re, t5);\ @@ -625,4 +455,3 @@ static void fft_calc_c(FFTContext *s, FFTComplex *z) { fft_dispatch[s->nbits-2](z); } -#endif /* !FFT_FLOAT */ diff --git a/libavcodec/mdct_fixed_32.c b/libavcodec/mdct_fixed_32.c deleted file mode 100644 index eaa6355e67..0000000000 --- a/libavcodec/mdct_fixed_32.c +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2012 - * MIPS Technologies, Inc., California. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the MIPS Technologies, Inc., nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE MIPS TECHNOLOGIES, INC. ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE MIPS TECHNOLOGIES, INC. BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * Authors: Stanislav Ocovaj (socovaj@mips.com) - * Goran Cordasic (goran@mips.com) - * Djordje Pesut (djordje@mips.com) - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#define FFT_FLOAT 0 -#include "mdct_template.c" diff --git a/libavcodec/mdct_template.c b/libavcodec/mdct_template.c index a854ad2700..312aa264e5 100644 --- a/libavcodec/mdct_template.c +++ b/libavcodec/mdct_template.c @@ -32,11 +32,7 @@ * MDCT/IMDCT transforms. */ -#if FFT_FLOAT # define RSCALE(x, y) ((x) + (y)) -#else -# define RSCALE(x, y) ((int)((x) + (unsigned)(y) + 32) >> 6) -#endif /** * init MDCT or IMDCT computation. @@ -78,13 +74,8 @@ av_cold int ff_mdct_init(FFTContext *s, int nbits, int inverse, double scale) scale = sqrt(fabs(scale)); for(i=0;itcos[i*tstep] = lrint(-cos(alpha) * 2147483648.0); - s->tsin[i*tstep] = lrint(-sin(alpha) * 2147483648.0); -#else s->tcos[i*tstep] = FIX15(-cos(alpha) * scale); s->tsin[i*tstep] = FIX15(-sin(alpha) * scale); -#endif } return 0; fail: diff --git a/libavcodec/mips/fft_mips.c b/libavcodec/mips/fft_mips.c index bf91fc316c..d7781ec6de 100644 --- a/libavcodec/mips/fft_mips.c +++ b/libavcodec/mips/fft_mips.c @@ -50,13 +50,16 @@ #include "config.h" #include "libavutil/attributes.h" #include "libavcodec/fft.h" -#include "libavcodec/fft_table.h" +#include "fft_table.h" #include "libavutil/mips/asmdefs.h" /** * FFT transform */ +#define MAX_LOG2_NFFT 17 //!< Specifies maximum allowed fft size +#define MAX_FFT_SIZE (1 << MAX_LOG2_NFFT) + #if HAVE_INLINE_ASM #if !HAVE_MIPS32R6 && !HAVE_MIPS64R6 static void ff_fft_calc_mips(FFTContext *s, FFTComplex *z) diff --git a/libavcodec/fft_table.h b/libavcodec/mips/fft_table.h similarity index 73% rename from libavcodec/fft_table.h rename to libavcodec/mips/fft_table.h index 09df49f2b8..8bb8793f61 100644 --- a/libavcodec/fft_table.h +++ b/libavcodec/mips/fft_table.h @@ -49,18 +49,41 @@ /** * @file - * definitions and tables for FFT + * definitions and initialization of LUT table for FFT */ -#ifndef AVCODEC_FFT_TABLE_H -#define AVCODEC_FFT_TABLE_H +#ifndef AVCODEC_MIPS_FFT_TABLE_H +#define AVCODEC_MIPS_FFT_TABLE_H -#include "libavcodec/fft.h" +#include +#include "libavutil/thread.h" -#define MAX_LOG2_NFFT 17 //!< Specifies maximum allowed fft size -#define MAX_FFT_SIZE (1 << MAX_LOG2_NFFT) +static uint16_t ff_fft_offsets_lut[21845]; -extern const int32_t ff_w_tab_sr[]; -extern uint16_t ff_fft_offsets_lut[]; -void ff_fft_lut_init(void); +static void fft_lut_init(uint16_t *table, int off, int size, int *index) +{ + if (size < 16) { + table[*index] = off >> 2; + (*index)++; + } + else { + fft_lut_init(table, off, size >> 1, index); + fft_lut_init(table, off + (size >> 1), size >> 2, index); + fft_lut_init(table, off + 3 * (size >> 2), size >> 2, index); + } +} -#endif /* AVCODEC_FFT_TABLE_H */ +static void fft_lut_init_start(void) +{ + int n = 0; + + fft_lut_init(ff_fft_offsets_lut, 0, 1 << 17, &n); +} + +static inline void ff_fft_lut_init(void) +{ + static AVOnce init_once = AV_ONCE_INIT; + + ff_thread_once(&init_once, fft_lut_init_start); +} + +#endif /* AVCODEC_MIPS_FFT_TABLE_H */ diff --git a/libavcodec/rdft.h b/libavcodec/rdft.h index ffafca7f24..9c3991f338 100644 --- a/libavcodec/rdft.h +++ b/libavcodec/rdft.h @@ -19,7 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#if !defined(AVCODEC_RDFT_H) && (!defined(FFT_FLOAT) || FFT_FLOAT) +#ifndef AVCODEC_RDFT_H #define AVCODEC_RDFT_H #include "config.h" diff --git a/libavcodec/tests/.gitignore b/libavcodec/tests/.gitignore index 2acfc4e804..1d1f78855f 100644 --- a/libavcodec/tests/.gitignore +++ b/libavcodec/tests/.gitignore @@ -6,7 +6,6 @@ /codec_desc /dct /fft -/fft-fixed32 /golomb /h264_levels /h265_levels diff --git a/libavcodec/tests/avfft.c b/libavcodec/tests/avfft.c index 22aa99abca..dc3f19e9f3 100644 --- a/libavcodec/tests/avfft.c +++ b/libavcodec/tests/avfft.c @@ -21,5 +21,4 @@ */ #define AVFFT 1 -#define FFT_FLOAT 1 #include "fft.c" diff --git a/libavcodec/tests/fft-fixed32.c b/libavcodec/tests/fft-fixed32.c deleted file mode 100644 index 3c50bf1dc1..0000000000 --- a/libavcodec/tests/fft-fixed32.c +++ /dev/null @@ -1,21 +0,0 @@ -/* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#define FFT_FLOAT 0 -#define AVFFT 0 -#include "fft.c" diff --git a/libavcodec/tests/fft.c b/libavcodec/tests/fft.c index 163f3e89c4..1f7c2ce93a 100644 --- a/libavcodec/tests/fft.c +++ b/libavcodec/tests/fft.c @@ -50,10 +50,8 @@ #include "libavcodec/fft.h" #endif -#if FFT_FLOAT #include "libavcodec/dct.h" #include "libavcodec/rdft.h" -#endif /* reference fft */ @@ -65,15 +63,9 @@ pim += (MUL16(are, bim) + MUL16(bre, aim)); \ } -#if FFT_FLOAT || AVFFT #define RANGE 1.0 #define REF_SCALE(x, bits) (x) #define FMT "%10.6f" -#else -#define RANGE 8388608 -#define REF_SCALE(x, bits) (x) -#define FMT "%6d" -#endif static struct { float re, im; @@ -158,7 +150,6 @@ static void mdct_ref(FFTSample *output, FFTSample *input, int nbits) } #endif /* CONFIG_MDCT */ -#if FFT_FLOAT #if CONFIG_DCT static void idct_ref(FFTSample *output, FFTSample *input, int nbits) { @@ -190,7 +181,6 @@ static void dct_ref(FFTSample *output, FFTSample *input, int nbits) } } #endif /* CONFIG_DCT */ -#endif /* FFT_FLOAT */ static FFTSample frandom(AVLFG *prng) { @@ -291,7 +281,6 @@ static inline void fft_end(FFTContext *s) #endif } -#if FFT_FLOAT static inline void rdft_init(RDFTContext **r, int nbits, enum RDFTransformType trans) { #if AVFFT @@ -345,7 +334,6 @@ static inline void dct_end(DCTContext *d) ff_dct_end(d); #endif } -#endif /* FFT_FLOAT */ static void help(void) { @@ -378,10 +366,8 @@ int main(int argc, char **argv) FFTSample *tab2; enum tf_transform transform = TRANSFORM_FFT; FFTContext *m, *s; -#if FFT_FLOAT RDFTContext *r; DCTContext *d; -#endif /* FFT_FLOAT */ int it, i, err = 1; int do_speed = 0, do_inverse = 0; int fft_nbits = 9, fft_size; @@ -391,9 +377,6 @@ int main(int argc, char **argv) #if !AVFFT s = av_mallocz(sizeof(*s)); m = av_mallocz(sizeof(*m)); -#endif - -#if !AVFFT && FFT_FLOAT r = av_mallocz(sizeof(*r)); d = av_mallocz(sizeof(*d)); #endif @@ -471,7 +454,6 @@ int main(int argc, char **argv) if ((err = fft_ref_init(fft_nbits, do_inverse)) < 0) goto cleanup; break; -#if FFT_FLOAT # if CONFIG_RDFT case TRANSFORM_RDFT: if (do_inverse) @@ -492,7 +474,6 @@ int main(int argc, char **argv) dct_init(&d, fft_nbits, do_inverse ? DCT_III : DCT_II); break; # endif /* CONFIG_DCT */ -#endif /* FFT_FLOAT */ default: av_log(NULL, AV_LOG_ERROR, "Requested transform not supported\n"); goto cleanup; @@ -531,7 +512,6 @@ int main(int argc, char **argv) fft_ref(tab_ref, tab1, fft_nbits); err = check_diff(&tab_ref->re, &tab->re, fft_size * 2, 1.0); break; -#if FFT_FLOAT #if CONFIG_RDFT case TRANSFORM_RDFT: { @@ -578,7 +558,6 @@ int main(int argc, char **argv) err = check_diff(&tab_ref->re, &tab->re, fft_size, 1.0); break; #endif /* CONFIG_DCT */ -#endif /* FFT_FLOAT */ } /* do a speed test */ @@ -606,7 +585,6 @@ int main(int argc, char **argv) memcpy(tab, tab1, fft_size * sizeof(FFTComplex)); fft_calc(s, tab); break; -#if FFT_FLOAT case TRANSFORM_RDFT: memcpy(tab2, tab1, fft_size * sizeof(FFTSample)); rdft_calc(r, tab2); @@ -615,7 +593,6 @@ int main(int argc, char **argv) memcpy(tab2, tab1, fft_size * sizeof(FFTSample)); dct_calc(d, tab2); break; -#endif /* FFT_FLOAT */ } } duration = av_gettime_relative() - time_start; @@ -639,7 +616,6 @@ int main(int argc, char **argv) case TRANSFORM_FFT: fft_end(s); break; -#if FFT_FLOAT # if CONFIG_RDFT case TRANSFORM_RDFT: rdft_end(r); @@ -650,7 +626,6 @@ int main(int argc, char **argv) dct_end(d); break; # endif /* CONFIG_DCT */ -#endif /* FFT_FLOAT */ } cleanup: @@ -663,9 +638,6 @@ cleanup: #if !AVFFT av_free(s); av_free(m); -#endif - -#if !AVFFT && FFT_FLOAT av_free(r); av_free(d); #endif diff --git a/tests/fate/fft.mak b/tests/fate/fft.mak index 76701dcce6..a5e7a974a6 100644 --- a/tests/fate/fft.mak +++ b/tests/fate/fft.mak @@ -28,23 +28,6 @@ $(FATE_FFT_ALL): CMD = run libavcodec/tests/fft$(EXESUF) $(CPUFLAGS:%=-c%) $(ARG $(FATE_FFT_ALL): CMP = null -define DEF_FFT_FIXED32 -FATE_FFT_FIXED32 += fate-fft-fixed32-$(1) fate-ifft-fixed32-$(1) \ - fate-mdct-fixed32-$(1) fate-imdct-fixed32-$(1) - -fate-fft-fixed32-$(1): ARGS = -n$(1) -fate-ifft-fixed32-$(1): ARGS = -n$(1) -i -#fate-mdct-fixed32-$(1): ARGS = -n$(1) -m -fate-imdct-fixed32-$(1): ARGS = -n$(1) -m -i -endef - -$(foreach N, 4 5 6 7 8 9 10 11 12, $(eval $(call DEF_FFT_FIXED32,$(N)))) - -fate-fft-fixed32: $(FATE_FFT_FIXED32) -$(FATE_FFT_FIXED32): libavcodec/tests/fft-fixed32$(EXESUF) -$(FATE_FFT_FIXED32): CMD = run libavcodec/tests/fft-fixed32$(EXESUF) $(CPUFLAGS:%=-c%) $(ARGS) -$(FATE_FFT_FIXED32): CMP = null - define DEF_AV_FFT FATE_AV_DCT-$(CONFIG_DCT) += fate-av-dct1d-$(1) fate-av-idct1d-$(1) FATE_AV_FFT-$(CONFIG_FFT) += fate-av-fft-$(1) fate-av-ifft-$(1) @@ -75,9 +58,9 @@ $(FATE_AV_FFT_ALL): CMD = run libavcodec/tests/avfft$(EXESUF) $(CPUFLAGS:%=-c%) $(FATE_AV_FFT_ALL): CMP = null fate-dct: fate-dct-float -fate-fft: fate-fft-float fate-fft-fixed32 +fate-fft: fate-fft-float fate-mdct: fate-mdct-float fate-rdft: fate-rdft-float -FATE-$(call ALLYES, AVCODEC FFT MDCT) += $(FATE_FFT_ALL) $(FATE_FFT_FIXED32) $(FATE_AV_FFT_ALL) -fate-fft-all: $(FATE_FFT_ALL) $(FATE_FFT_FIXED32) $(FATE_AV_FFT_ALL) +FATE-$(call ALLYES, AVCODEC FFT MDCT) += $(FATE_FFT_ALL) $(FATE_AV_FFT_ALL) +fate-fft-all: $(FATE_FFT_ALL) $(FATE_AV_FFT_ALL) From patchwork Mon Jul 24 13:17:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 42943 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:be1d:b0:130:ccc6:6c4b with SMTP id ge29csp1914255pzb; Mon, 24 Jul 2023 06:17:07 -0700 (PDT) X-Google-Smtp-Source: APBJJlEv4sZeAzvxZ8i6GA1sW+NRSCxNaMBqmhu7ZM0AlTNJYD3MZ5Gy1Kgzs588Y8G6iGL7M7o0 X-Received: by 2002:a17:906:3095:b0:989:450:e585 with SMTP id 21-20020a170906309500b009890450e585mr8514049ejv.45.1690204626833; Mon, 24 Jul 2023 06:17:06 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id j23-20020a170906095700b00993690d17a2si6608773ejd.5.2023.07.24.06.17.05; Mon, 24 Jul 2023 06:17:06 -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=@outlook.com header.s=selector1 header.b=KJCfQezp; arc=fail (body hash mismatch); 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=NONE sp=QUARANTINE dis=NONE) header.from=outlook.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E674A68C76D; Mon, 24 Jul 2023 16:17:01 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05olkn2098.outbound.protection.outlook.com [40.92.91.98]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5E8AB68C5F7 for ; Mon, 24 Jul 2023 16:16:54 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JqFyF8lMvf/8g7IwO46JQVHcUs3kdcYCf6izlEdeRH4R0a0QxRW1qyIBztzF8H48HzFEb5CJ9oGX6wowk1W6getAS2dY76EUrbLxLLuS8RLjMK9R0AaebV5taBusaLYSYxgXBN8gc5Z0VpCnn02AFURy6PVsuhSpDdz0ED1oBZjsBtyCBA+xxugMmt9O8Bom9m0rXRW4/J0UI/uQF1OWCCwUKnludb+TLuL+4rEIxPrQ9c9HAw3xpPn2VoTWDb99MHuIB7l2Ietp3pAg9IZEO0x/Ahu6nTYqDYALcYeZSUIf6+b4MXx6CpPwi4pKn94fw+JtPsyHuW7i9jmAgCHH9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=HMO5a7vKUBHCWfR4PFFyNmLTxQubDL+LH2bjKsEkw88=; b=ZqDXijhxyZL1yt3HBiU2kwZP99tYaKGNszBD3ZYtcMlcQB0Px0qiDTEXfuLU3hBLkwSd+Q4kJ8sTPnjn8tgPsJOpmg3Luw/uRtvc28tYh/yDKiuQNxtDipa7LkPRM4+V31zlErXMPcK1MiaYCSmdvFar/pGOhZPog2pUsmbDvaoKpkDeZ9rB3BRaVIIveVwHDd04mi+AB0cCoBvMFCJwElxF73vnnpQ2nUN5N9US3UyJgwD0H2x6UFJ9oEtWjlGAMxgh9McsqB4XqeVk1vf2gv5JufL1r086HLv6WhLEzMaZT3gwnQSp8q1VWv/h+2x4bCL6rlVYDBOKTUQ/6WLPzg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HMO5a7vKUBHCWfR4PFFyNmLTxQubDL+LH2bjKsEkw88=; b=KJCfQezp+OsAEYCW/JhtOulfQUDFTzObrqvt1VFR6Rx0LfUoVZOaTSFWzmjxu6zjsnolVsPG8Lf/OWgNmjjIbdkdvHW877tugohL1fH53XPfiDZ6qtu164lfFp4/f2TlHmbrOiVqXeKw8GkCElkeP/g9AWM3Q45zG63Z3SJ9SHw0PROXBJH9JlOCI0vMKFFIKRta/IiwLhZu/bgR1eaAPtZjMAG9cpr6bFhVv9bTCrHm/FtBhgV0xXs9HOP936u+hERQ+Hfx2rP/yOk0HTvA4EnsHPaSca5km9K0sVP5ULO2AS/3R8IldrS6ysWGLK2/FtelWP9/MgjI4OfDP07eaQ== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by DU2P250MB0173.EURP250.PROD.OUTLOOK.COM (2603:10a6:10:27c::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.32; Mon, 24 Jul 2023 13:16:52 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::5e01:aea5:d3a8:cafa]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::5e01:aea5:d3a8:cafa%3]) with mapi id 15.20.6609.032; Mon, 24 Jul 2023 13:16:52 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 24 Jul 2023 15:17:37 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [K8y0nMY2OKlsAoP+nSfsM5m6MJoD8qp/] X-ClientProxiedBy: ZR2P278CA0002.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:50::7) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20230724131738.2191337-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|DU2P250MB0173:EE_ X-MS-Office365-Filtering-Correlation-Id: 1fc66df2-46c5-4e06-754c-08db8c483ec6 X-MS-Exchange-SLBlob-MailProps: Vs63Iqe4sQklqWC7ylRS4aEZ0Gw5Ix+DkUw/m+6g54jkdg99moIXWqaXBXJXn7BxJWOUPpUfhwPY//uWOq2FuCdfQI1mWlUEkHgvunsSDu9SbmnUZ2xWjvhiNuvk5AAgI7YFqMiaM/XjR7fLqqU502QZcnQm+LxIQ0a1rmk4LuoI9yI75+VXMUsU1Qs7SHstElA0HJVcv3tXg/Z+ZLB87ytPtlOLayXbBN4t326LYMY73yAY+pESfixP8RyxPZsKcOXLO89VdLN4ay0j4+Gmp/+0Sb+90y3q/PFdCGz8uOUZ7029tZFwVh7X5w5cPMXwrM2j+ODQauusbwgOObljQQwvvQxIIXwdRn707bEtaS6optMgn2IX1MZxGGm6ZzyEsxccRpY7VLBqCyV3s+bG/UcWECiDZ34C57q73S2VpqLabSDY6jVvVypxH08ZwEyjFb4oNCzMzf4DYKayW9mNZpb051PPUkWM87F2Lhpl+gH9uZmja5p6YM8LGh+82F97W/m6FwkL4f1wOpzhazggIvHUUqStF80xgpAGOPWoVZ8VBiEjlhFRLUEm8O98Ha8OeOnptXydRwe+V/8kiutLiPodWgutbwv+sL63fogD2QPNy+LXft2l4spQXIeDuawrKE2N5spj6BjQ3GioPKFVinhEcJziriGkpOOjVVjDGMbBuIDqt643HNpg3mnAImFefSI2XbDkH3CNoS5gX/mMyzNRL9hadBsz031Z1LP7MLk= X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: U4Rv2xUXUae847qQVwwkbfJV7ZxkVglkDOzehXiRXbOSeQZfgwQR40wYJb06t8D99KfmtYs91MpSVw42oMieGqrBjBy87K5xHNlIndFEKSwJbic+v1V6UlYZM2cJZXYknX6LQ7nOHkENVAZ0v5Q2aS2VKErDeMbtyg+V0k+oIiMGt/f2uHJp7yFR5dMZ3YTcZdD69HINpl7sIrqpEQLvmHCu6Hg7UF8rs5J5/ocR4L9urx6RyPxYa46+mzPLpf9aiTR7k7cIIMvVW4BZPpHccwYbWwLyq1QYd0slGzaxxUK7uyMEQlwvdf8ngwZ8aOK2sTG2WBFlNnY3SZVMDjW/vRLhl+VDd9M88l5zxIDURNOPIYyEj7tsUYbY4cPAagQ//V/mfwQzj/s0sr3ccC+WpM/IVOzFtdo0D/9uTzhKBGu0IHokpEyX3e8eI8IngE1J/MONTXBc1/E19C+EW25rJ8VeAjC8blZBQ41VAtOHu86zNSiFxcQLH1nyZDfBLUgjhp6AQvPNdf6ShuO+U7v7R495813HydKZXmpwoS7zqDwPrvodqoO1qtA9EQKrBNubG0yQyJDN8i2FUlBnzsrje8tfNKwGhMSJ1iCj1QKSnHGPNvqfPoaK7HRc5C8ELJIe X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: rGB1dsrZCtWch12Y6t6fPlV62eR5rC4ekGFGUhvSloDa20WughkwTZJW01b0egAEzew8pNjGPlH02/KHK2gjy87XHMpQCpvdWjOEE3PwxUynShhJx6kU+H+fDo2HbrToZ0cOh0GeNsXhUHQRjMXaebt7TQo5I6XiER591DBUCYV5EgCKIikIQ1wT57mA6sW8cg89vfdRuHXtU5DmNmEDTaEcbrUd6TKMNGt89VUSRhWuEGfA9AAffqST+YDGUUymJUKmH3RMtlovWO6Z4tCSjZW2nHM+FTeuJPZ48ni1Uk63J2uEwmTfskNCdmwUhr9ireNrnmdenWrnPXK2JCw1NmAzI28h12Dc1C0rpJWbkWj/1ZWzD9+jgfvepuBCBOXUOZ0IPx+Dp5oOoEQMjfSOEkS078VxRTTjeBZnvEIqyhn1Jwz0rWyGAqBjUdhR+De8SC4STekXhPwS8BcD+KIBY7ukJrIbjOwE1pjuwzLzVdCcOIkOXL6dpoksdPKxMja8lhuPvGtj9jUNvbq7SPlH7yjRfKFm1n2WJuHHXxdw9DzboZgwpBhxSo0esytCpEFAd60qFrw0iVnpx0SVHZnytxcMPG9iUoP5iHOMbwooxrUpDxCuH4sAjAT3cAmKB5yde5QIr2Qw7xLFyfYImBpcXSc6/mwWF6fHJg0akWBN+SUeZWfKLPpUZxQgEpuq2x+YCqNSYTwJ0474TZjowj5WJ8G0TTnZ6VpeUk6JLPxESxegmsHdIvRBqBPm5nXiOp7cqplk+fm6pvV/HOuQLgtZ+HVt4HlRWIZVZIToX1HgmIjLqUDoE9QbPAbCMPk555ksJ6Px7qmonnDhTyj4yu21YToJOGjN3kWBRAauTiuiwuGhm8Rs7G0/n5lbXXBcEBZR86MiVOZeMdlLioas1hyHlXiT6rZXwCd5TTM7u/HDqa12av/fAqQ4XCUaeGn0gEJIMENu9K97wr8CBhqoJA4FWgICOnXYqOlhTFyxSnCzDjXTCQfPuVZ9jYEMBl6ookt7UXN8/I3Ws7ZdNKvUncIlfUvOyJJU47A/Ukk9JRZi89WElqLt23xNuTNfQr3e8FYmgF0b3g+WmZ1/8ptR1YDpFPnHLB471jkqRK0vjJpkU9gI8bPTD6yj4Cm6BuLKvwAblEt4ZkT+pV3+fa/9Yazdl9kGl23OQZre79XEuJwq9NOYxHhTSm+PllzMA/h8jMYiFcsrvjdAi8+iziErhgqiQ9wj7no4m15dZt7pmqAANvFrFj8UV3zJ9DbZKvBm4ay9 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1fc66df2-46c5-4e06-754c-08db8c483ec6 X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2023 13:16:52.4018 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2P250MB0173 Subject: [FFmpeg-devel] [PATCH 2/3] avcodec/dct: Move fdct function declarations to fdctdsp.h 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: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: uzvPdcB4ahSI It is the more proper place for them given that this is the only API using them. Signed-off-by: Andreas Rheinhardt --- libavcodec/asvenc.c | 1 - libavcodec/dct.h | 7 ------- libavcodec/fdctdsp.c | 1 - libavcodec/fdctdsp.h | 7 +++++++ libavcodec/jfdctfst.c | 2 +- libavcodec/jfdctint_template.c | 2 +- libavcodec/mpegvideo_enc.c | 1 - libavcodec/tests/dct.c | 1 + 8 files changed, 10 insertions(+), 12 deletions(-) diff --git a/libavcodec/asvenc.c b/libavcodec/asvenc.c index 4a14bcf8fa..50da46738c 100644 --- a/libavcodec/asvenc.c +++ b/libavcodec/asvenc.c @@ -33,7 +33,6 @@ #include "asv.h" #include "avcodec.h" #include "codec_internal.h" -#include "dct.h" #include "encode.h" #include "fdctdsp.h" #include "mpeg12data.h" diff --git a/libavcodec/dct.h b/libavcodec/dct.h index 041e8169ce..05bff51580 100644 --- a/libavcodec/dct.h +++ b/libavcodec/dct.h @@ -52,13 +52,6 @@ void ff_dct_end (DCTContext *s); void ff_dct_init_x86(DCTContext *s); -void ff_fdct_ifast(int16_t *data); -void ff_fdct_ifast248(int16_t *data); -void ff_jpeg_fdct_islow_8(int16_t *data); -void ff_jpeg_fdct_islow_10(int16_t *data); -void ff_fdct248_islow_8(int16_t *data); -void ff_fdct248_islow_10(int16_t *data); - void ff_j_rev_dct(int16_t *data); void ff_j_rev_dct4(int16_t *data); void ff_j_rev_dct2(int16_t *data); diff --git a/libavcodec/fdctdsp.c b/libavcodec/fdctdsp.c index 5306c9d047..f8ba17426c 100644 --- a/libavcodec/fdctdsp.c +++ b/libavcodec/fdctdsp.c @@ -18,7 +18,6 @@ #include "libavutil/attributes.h" #include "avcodec.h" -#include "dct.h" #include "faandct.h" #include "fdctdsp.h" #include "config.h" diff --git a/libavcodec/fdctdsp.h b/libavcodec/fdctdsp.h index 3e1f683b9e..82edf8b3bb 100644 --- a/libavcodec/fdctdsp.h +++ b/libavcodec/fdctdsp.h @@ -34,4 +34,11 @@ void ff_fdctdsp_init_ppc(FDCTDSPContext *c, AVCodecContext *avctx, void ff_fdctdsp_init_x86(FDCTDSPContext *c, AVCodecContext *avctx, unsigned high_bit_depth); +void ff_fdct_ifast(int16_t *data); +void ff_fdct_ifast248(int16_t *data); +void ff_jpeg_fdct_islow_8(int16_t *data); +void ff_jpeg_fdct_islow_10(int16_t *data); +void ff_fdct248_islow_8(int16_t *data); +void ff_fdct248_islow_10(int16_t *data); + #endif /* AVCODEC_FDCTDSP_H */ diff --git a/libavcodec/jfdctfst.c b/libavcodec/jfdctfst.c index 805e05808c..946b12f379 100644 --- a/libavcodec/jfdctfst.c +++ b/libavcodec/jfdctfst.c @@ -68,7 +68,7 @@ #include #include "libavutil/attributes.h" -#include "dct.h" +#include "fdctdsp.h" #define DCTSIZE 8 #define GLOBAL(x) x diff --git a/libavcodec/jfdctint_template.c b/libavcodec/jfdctint_template.c index 67fb77b5e1..ca17300c32 100644 --- a/libavcodec/jfdctint_template.c +++ b/libavcodec/jfdctint_template.c @@ -60,7 +60,7 @@ */ #include "libavutil/common.h" -#include "dct.h" +#include "fdctdsp.h" #include "bit_depth_template.c" diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index 9bdf5dbe07..64e66ae958 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -43,7 +43,6 @@ #include "libavutil/opt.h" #include "libavutil/thread.h" #include "avcodec.h" -#include "dct.h" #include "encode.h" #include "idctdsp.h" #include "mpeg12codecs.h" diff --git a/libavcodec/tests/dct.c b/libavcodec/tests/dct.c index c847af2f11..e8d0b8dd1d 100644 --- a/libavcodec/tests/dct.c +++ b/libavcodec/tests/dct.c @@ -43,6 +43,7 @@ #include "libavutil/time.h" #include "libavcodec/dct.h" +#include "libavcodec/fdctdsp.h" #include "libavcodec/idctdsp.h" #include "libavcodec/simple_idct.h" #include "libavcodec/xvididct.h" From patchwork Mon Jul 24 13:17:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 42944 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:be1d:b0:130:ccc6:6c4b with SMTP id ge29csp1914362pzb; Mon, 24 Jul 2023 06:17:14 -0700 (PDT) X-Google-Smtp-Source: APBJJlGNgp86+/UKO77rQWJm8fWToAyvFcr0S/HAzXRcrm0zFlE/sc/Nhoi16WtWABA9dTuShIlu X-Received: by 2002:a05:6402:417:b0:522:1a03:d72e with SMTP id q23-20020a056402041700b005221a03d72emr6292928edv.25.1690204634691; Mon, 24 Jul 2023 06:17:14 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id y12-20020aa7c24c000000b005222b230f04si1760539edo.218.2023.07.24.06.17.14; Mon, 24 Jul 2023 06:17:14 -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=@outlook.com header.s=selector1 header.b=f+L2x4ka; arc=fail (body hash mismatch); 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=NONE sp=QUARANTINE dis=NONE) header.from=outlook.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0F0AC68C77E; Mon, 24 Jul 2023 16:17:06 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05olkn2098.outbound.protection.outlook.com [40.92.91.98]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7AAC468C6DD for ; Mon, 24 Jul 2023 16:16:59 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j4zyULqGBfQ+0UEexWG8z3l/ncf662rX7G+NItVRNlR8WfOM6DOWYCsUavhwFc8xda0c2VK6PEBhPACxzfTZnZ7Brc0bf9WkKF306IKt7tylWxLjEJR8lRx6ajT5M4rukr+DAStuqXUBVQvNBRCXFTKTq8eHtD13narhCGlH0YXcDrii6iUW+PAu/y27YYzbFkjcou54epDi0pyXfRSMJ/V6wt8Tn6k6a4jwiZo2aZvSpO96TSG7Ei4CpKyhZl/ENwLmuBhWTT5aZwIMy5uUzVs5MNf38ZHA3O/CJhMQj8BDGgnHYam8Q0rjrpPS+pd+yL/Aq7rKOTL7sk4EqHRNQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=pT5MhFfg4/SEoW79iFpmp6oZY9arOWP9/AyPOKo4iB0=; b=iP8Zt9PP4LMOEas63Ws0gUadrVz59dqe1Xtv/LUm7vCcErFeywZ/PVsRdI77PYgRd/06/sKsHlK0frDVlNCOvGgMY82bE95MFyoSEFN+x25H6gGeXgiCyqT6ZeNGN7OjwYMJtbZVGhJcIFik47iI+SfC+NZ/USiNJX9nkWd0B/NSE5ux5uaXxNGv2xrS8EdflfN/VYm44ctDRP8T/qQnZnC0Ufu9aROR9wRv4euM611hGOYqdpCL08qY8lfRqQBGu1Zae81BVyAKgUYEHxGenkYIdoC9USsLlGO7fE9MZxrtHe+E59MQ622TcwJC64nADNSJ19IaqJ6WKD8YOrWGbw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pT5MhFfg4/SEoW79iFpmp6oZY9arOWP9/AyPOKo4iB0=; b=f+L2x4kav3e90AbjeLb6L6Wsvr7Qisq1ACmMgowht2i+nS2ZczOMIF+usCvDbvCinfvZnex+HrESdGu9YYuv5ij4Y3sNpF44QfiOUYLhwAKfXLqbfFsfEKVJiUJ9uFzQEO2K+d5YDIizUvhHYmmZSM3+21e7CbNkDU56mKgCRtzA8iq44cmpNmuF5z+XVHJZulxIxuP0jYsCjf0riXkvouqdESOm4WebGjc2bZZHxp7Zk0mSoHttgyaPkUjQ4YtRw8YpQ4NBb1xaYBjDPC2JqnzrMd2Id4Y0qIDgN7RlWXqLXFh+iRO/2OoO+h+vrylTifsMr79OUj7QF6XqQKPyMg== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by DU2P250MB0173.EURP250.PROD.OUTLOOK.COM (2603:10a6:10:27c::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.32; Mon, 24 Jul 2023 13:16:57 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::5e01:aea5:d3a8:cafa]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::5e01:aea5:d3a8:cafa%3]) with mapi id 15.20.6609.032; Mon, 24 Jul 2023 13:16:57 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 24 Jul 2023 15:17:38 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [vBsdG6Kxja8/MaNEhKohpRDCwsITx5Oj] X-ClientProxiedBy: ZR2P278CA0002.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:50::7) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20230724131738.2191337-2-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|DU2P250MB0173:EE_ X-MS-Office365-Filtering-Correlation-Id: 1c41cf17-9352-41e0-17ec-08db8c4841d9 X-MS-Exchange-SLBlob-MailProps: EgT5Wr3QDKyCz4BW4wGZZ5JFDqixqFm9vv2KL+pkNY5DGk64Vc6p+Zc66ESqBFqahYm4yN5x2zei+pu11MU7kWOt8k0ZMVcyVr+tHTuEGSBomi3LbPT76RaqRSF3Bzyl24JNOoJYXhfLrJfkjKis3R+5QpFaPw92PyAKYzxKju1mlMReqPkQ2tA6lZqk6neC38jlWL5EeGUwEB8yYipA/R06AkHd+N2HZo8BffFMXfPRGKmfuNusQG68/fbwyWmxtJdPsxxhk/+Ye17ElngDf3JQjmoKeszJAbVHAiphGcfjfxWoPwyVsbYOdPqVOixxbnB+goaZ5YXWWWIa+68zvzBaoBxmiOexRH0jlie0JvdFRksbl0ZNfc5/JAVIoWkF6k9FRf+85RSjq2Aor1jM9eA0Sz8CybYUvdnYi7aZQys3tHYjpXxErkDUMvD5DUrWnnKYvLmV/fMU/RcQFye6L6ddxGrz4ovW65srO+taGIGvC1UG0+SyHk+drq+0ZXPJp7CKrZSEZzyVrWcEO2KzrKEDrwYwWq3OWynJz3h7fXWdpWInGMV2/1JvfPlyXFQk/34HENNAqls4PfLOyDhaqgb3VNpZGppvXJeR+pIvZul5BuxLyBJUH2pk1cL1bj/VmuOyuFowiTaGy9mIRoDea87HPY41tv0wXvVVtAioT76OxpbCP4dGp/K67wBUQZ2m1JSarZ3FHCZZB0WV/lmZFxvkbDHahCvjH0hKG7SDADw= X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JLfPW4bBgiA5gCXIQvxGBLiWW59fJzA3OmYGZPx01sPQqvOXmKG5vOa0aWuJF9XCZJvnKWBF6ZPEjZHhBOwjrlLsWLQCBrFvBTmCdW5WOqs/3DrY0UN4rcq5mqpmfJf4aC++qtx9WCCEvNgFud/wu8h3K13y482qnI25fFlEL0wb2lOLs0Ua2VPW3BxtzZcnV3IBBCWSaLTp3rjCWrCjtjN6Z0E7k8HW+lGV10rIAGgS9PRJ0PvqFuyT43iK6hEO0nczaSskGPlh0eCmIT3aV8nat/BCk52WsMl8JKihiOpNJveUjUzOhssQA5A9f0YPWPMYoecESJLRblieOTzsnLpPUO3Ddd/pey09ioRo4bqK6njWZQnzId2e+p/HQrHv8of3LLAb2YI/iKyCnnLg3VLpKy9ZNdzJlHKocmyksy7IBYINulKM8a1/l/CnK/wbcqEDZT8/liDMfJuRGk2tvUXVHvB0loFcXb0d1OeSnTC/7cVwUQB4D0fHDXtMmjlBrb9yyazZZUu8mI7R6fAXSC2sQmjj4XWHnG4t5JV2VqBN8/w851jDTU9FJ+mCwHUV2QK8xHCOAzi6GGofhL80Wq/zr6JeQ5v+m7QGg2FCZJe306XWBMjFN/5cYRzvHcQV X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 65TaYZBt8Forz+4HmszxQwZxRAlEw3GjhOTU/UOq8of2onvX1fYCKiZAHpg7FgRoKvujWwoZD5o7yR3fIMH8BsG2Gd+kvKN8vnJcbpcZW88eLC1/wAyOEqQmgaRl3mIv+kNyQ4yjfJJw/fjxQeIyhqBdgBOete/WV98CGf7XBP3n8J37LT/+uOrRjjFqLYPQ6PYZu9tqWAmjjVoUIIfvZ6kKnKEZxp7pXkH5MOdzDo3DYBn8skn2hZ0+cLgWnd2z1NeKFEx9VVW/CnCz0+hN98j3FJy318E1EBrOspffVxxM6gIVGXbor/WYykp2laORoadoa5c3cNuCsCZQYcx8v5SVrNpcJhjt41lhhjs8fVrKrLAFHcp2nJSKLZR/nBiUXIFJXaV+B4tsX91PU64HEZpPZivGkUhjexjgBXmU49Dsa8pgMVuPrhG+pZvan5mWI7B/LQ6If2ipfLnyIYraFPK7SRqLeenUtQszgnfaKhuf1adDtTh8zYa79GZZRg66DX/x0RQNx+qB0IfRzUyFzbSAUtiUqb2wpdT3hDVsOmUkFmMSYo12J8eLZfflyKwBs1F9Eu1W8bw4f7wAjvWuD3PHLgm9Gj40yqEIzV15/ZfLeb8ZMwVKICdD0mtAGxJ4PMdy9dMPU5756YmJpPT1w4/OqwIUOb4dz6CBebJK8mkVWrq4JgggCtWTzMdiVtoYHV02fZbwRFFTa4bM8zIl//KqMZqA9wk4/QcZcDaqjiw49mjZj5V5r5MIvF4oMWndBS8C6SOn/DDRXtK0wk0YzsBe7Dzn+fTGYNkZbSWgcFp0lHOW4mvuYrDNPgG57MDrSypNBCPCDQ9YlHd4WETKKT21CSv9JNs9/7hPnyOjByI63AajNJapSHCkTW12VJbrHt2CP0z1LVQn6ztCU3EgFuWKCi3ANJKfcD3bSih8MC2x0DbyCUi/TQ54fcuVqcUFRnXE1jTLLog9Mbqp6Gtl66W9uWvDKQdsUUmE/mtCpSd80SE4st2ixP8/rYsEUJNrAg75U3nRocFG5/vAxQVWBLXFnAlc0xdoj7IqfeD78wVbT27AK2luwi4tHsDpx/dNNs6T30lG9KuW+JjmNilAOHb+XLIktMJOLbTt1fgXVO3Rh+is0T1zL4opiom10s0vG2LENf072uYiIu8hGLFybO9bj6oiyOr/iOAAlCn2GS949ITvI0HVYWO8hN/cTryOrpv4dkS6Lj9I8q3+JboXPNcljw9BHFIl/PZarJT849PLobokUvM0ov14hlDN5K0L X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1c41cf17-9352-41e0-17ec-08db8c4841d9 X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2023 13:16:57.5503 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2P250MB0173 Subject: [FFmpeg-devel] [PATCH 3/3] avcodec/fdctdsp: Mark functions as hidden 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: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: jgGTrVvv5+wd Pointers to these functions are used in comparisons. Currently the compiler has to presume the worst for these, namely that the functions are from another DSO and therefore loads their addresses from the GOT (which also entails a relocation entry that is processed at runtime, regardless of whether the code using them is run or not). This changes if these functions are declared as hidden. Signed-off-by: Andreas Rheinhardt --- libavcodec/fdctdsp.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavcodec/fdctdsp.h b/libavcodec/fdctdsp.h index 82edf8b3bb..9dc375322f 100644 --- a/libavcodec/fdctdsp.h +++ b/libavcodec/fdctdsp.h @@ -21,6 +21,7 @@ #include +#include "libavutil/attributes_internal.h" #include "avcodec.h" typedef struct FDCTDSPContext { @@ -28,6 +29,7 @@ typedef struct FDCTDSPContext { void (*fdct248)(int16_t *block /* align 16 */); } FDCTDSPContext; +FF_VISIBILITY_PUSH_HIDDEN void ff_fdctdsp_init(FDCTDSPContext *c, AVCodecContext *avctx); void ff_fdctdsp_init_ppc(FDCTDSPContext *c, AVCodecContext *avctx, unsigned high_bit_depth); @@ -40,5 +42,6 @@ void ff_jpeg_fdct_islow_8(int16_t *data); void ff_jpeg_fdct_islow_10(int16_t *data); void ff_fdct248_islow_8(int16_t *data); void ff_fdct248_islow_10(int16_t *data); +FF_VISIBILITY_POP_HIDDEN #endif /* AVCODEC_FDCTDSP_H */