From patchwork Mon Aug 2 15:39:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 29194 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:6c0f:0:0:0:0:0 with SMTP id a15csp1679221ioh; Mon, 2 Aug 2021 08:39:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwsehjbZW45Umn5ht4A6BTQQRI1muPe8f8kU35aOwj62cXO/rH2VOotl/xRvJw+bG0zIcDj X-Received: by 2002:a17:906:190c:: with SMTP id a12mr16361104eje.141.1627918785647; Mon, 02 Aug 2021 08:39:45 -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 l21si3707070edw.175.2021.08.02.08.39.45; Mon, 02 Aug 2021 08:39:45 -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=NL9kwnKX; 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 6952168081D; Mon, 2 Aug 2021 18:39:36 +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-oln040092075039.outbound.protection.outlook.com [40.92.75.39]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5A30568081D for ; Mon, 2 Aug 2021 18:39:29 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=R+nVcbhF1hYfriaX66UEsK4QyGJ3cipv+UCRpR8N5V/UifF6im3mSUCDBaszGmAo1M5BVfMXvjAOc8kLN0Qh9+6vY5NJMBOr9/xHMc+k5YKhUcSs8fi7wywwEhozGQ9yJmyHHjfUYEkgwf7ZVCw+1dvcWaGFpX4TH1rc4GLUCTvo52M56UTwVgHbx3HhizHyGUaVzww7XF87SDpD8GDI0N2FjTiK42UQ8OUV91YOFdO6S266XABxvGDtI8JIGxDjTK35Mb31axJPKuL7O6kaxFC5azCUoB0dfVsmWvBFz9n/acWH4b8IJtONdFdVFD+3X1iPx2qoFVWT/6vbf2JCXw== 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-SenderADCheck; bh=ZmveClcCxZHMMfvczFSa4OsMZ4DFCYjdOjHzLwD6tbw=; b=oHRvfoXetrjDrDZab6PUwsyg83LA2Q62P6qYf6YpMTX9nKzm95+Q+QjMBbgLQs+SVkN8mSu9QKRD59uY8IYUCN5FiPCeMZ1dI65syCdE03AzlGOThxqSLwKWpkJMXWCpHTQA/yCbuu2DBOiAs92PucUOYg1vaV7LqhBfwB0zjj5yyCGfEaj4BdGWozituHtqMQZER4J/C+H5ii1pvd2UWkkmTzkybxd2HM8kOJTX0f0S2sMUjEBbKzuHpNFSNW7Yrv6WJdeUDvZDtVhBbycAMafcMfkdSbdwPI8y3OQgVRlzTsf+zXn5zoiTaK4QBgAdYMWqAsIAegXJw5mM0Ctawg== 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=ZmveClcCxZHMMfvczFSa4OsMZ4DFCYjdOjHzLwD6tbw=; b=NL9kwnKXihRZPTFSMqUKtqyJrVD0G/Tg1vUzsNnYr6uZUXf6aEko04ObPzlAsGHGk7wAilHi7E+9kpWKAQVfGACN1HKxty8lhHRUjB89QxFyWMWBAyydjrs3v7WQQxr/a4TvQfKGzeq7x44aTQtOCr+Mj55s6gMUPBbQR9LMpIILwZVt5Qde37AlrGcsSZMOz/tTQFxPvQvQmW2Z1ZA4QLw9qRvI7tYaHOTtmona0amvGEIRk9eIiTlSCf55vDKWa1tUZwv5xkdI+s29ibH67OlqININ8SBo2b7WUeUMlVWuYtVaCWvVfiH3PHu8jlG3UxlDsVJ5lknTVbKT7EBHpQ== Received: from AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) by AM5PR03MB3089.eurprd03.prod.outlook.com (2603:10a6:206:1a::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.18; Mon, 2 Aug 2021 15:39:28 +0000 Received: from AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::c9b2:14f8:d555:6f2d]) by AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::c9b2:14f8:d555:6f2d%8]) with mapi id 15.20.4373.026; Mon, 2 Aug 2021 15:39:28 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 2 Aug 2021 17:39:08 +0200 Message-ID: X-Mailer: git-send-email 2.30.2 In-Reply-To: References: X-TMN: [r95UF98fhUWC9PaxrJyOht0x3HwCsNV7] X-ClientProxiedBy: PR3P193CA0056.EURP193.PROD.OUTLOOK.COM (2603:10a6:102:51::31) To AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) X-Microsoft-Original-Message-ID: <20210802153915.1234499-2-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from sblaptop.fritz.box (188.192.94.230) by PR3P193CA0056.EURP193.PROD.OUTLOOK.COM (2603:10a6:102:51::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.31 via Frontend Transport; Mon, 2 Aug 2021 15:39:27 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7d7bac02-2856-4f4e-4127-08d955cbb673 X-MS-Exchange-SLBlob-MailProps: gjx25WM8ZNUytrrqT4o9623wQ4EiyPTq7KZdV3bkGyLa7I+pbo7xpLHGwwbru8t8rZJ6s7Dbzjd3rnYNa50X0/xvs4BdMufr8oRY0nmKOGtLGLxq95Ox0RHpo3K1V4suZLv4YEJOJNO01E2x/qaERuqDfJBTek1s9df2/RawGR0iUf0L1cdVkdYzY9xSY4Cai7f/QnwhsudaTZtYN+F44L4uuEZj8YpdYKvyG3mj6XCPq10PM7fDHMX31C1KEc5lnr/k3g6Y4Avrcew90IivbFeU8UnFRv77rl2rEWaiHkzC/RxjpOibQJ80ChNLSsD8fww5avaIx5XuEHcKTzuXy3zB1+dSYqHgDpyZWCLuaSnZ4aH/71+Kx77KgFvbpmxmkYp2vQ64a+eNBv7Xei1Wv1+OTiAZeuov7iNeiioP2mtUPcai7V2MibR8Ew9BH8USss0ES8+dNIhL2VJDuEnj07D/Bo/YdVeNuYQFH1gUpBZzQnb9TfrcxCU//+oooo+KAzDGtG1DaQvvZVSLNWdAXND04tJYmvLs7dlCYUmAHeTC73bsGpKTbFCPZ61A6f4OERkoJdWCr/dxf+wbkvaSXQNNwV4GmumAtNmOB0tLuyDGmXK4GPhgZqcKDIZiJ4vY8ZvM0faQv0zWzjah62QKjdhkW8gPNcnfw8pBG4vPerRY6u6LmcDVbBUwPqMPuIJ51X7bWV3qsmP8bDNMGn4HQaTdkZai0sEDzg2PzckV4bg= X-MS-TrafficTypeDiagnostic: AM5PR03MB3089: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BzDs+A+m5SMoHULAMh4qPbaylKuagfc5+dCxGGKyPDoEkH6rSoNub93VzP2A176T6+LBN/5hQWvf81jBcigvQalE3Qxf6Y8W6B2hDPNHAK3I1Wedg2qcpTgZ+ei9sqkkB00E23LmVhWAhhWqadiuqQWzXMHcyDwfn64ORwnh3/40zr2gzbLsDEm2JjLmMN7Q8LcD35O7RQniiV4fwpVcG3pcPJJAVbhUW1pRoTAQjfYv/ps66JpCn2ll3EjMGrDsIeYvhhuoGo4/92tPlsUOOF8onH209W9BCzSgd+d/n8CkiOgnbZVIYijhXvbmRYDPv5YL2Hm/Zejq38xpWN0I6nC+TrHkEC5z2W2brXCpeDQapquWsOwNZOg5Q4cJwoxcPAMtHBvCxQDk/kBhkQ9vCZ+93gXv+Kmh6l03OvtRsQk3VczQyxQgczuBvFcay+1j X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: VxodQeWVkRitWqTeZSY9rkhtLwDhsMwo9uplIdJOieO9vHIw9POwWRR/AqZB/2BSvRg9Q0BsGZZb7NiHUJZ+11pozREoRFjq+948lOC/wHnXFbf+lLF0CwPrzk/kUEE0RgsPGevH+E5+HOSK7ldCqQ== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7d7bac02-2856-4f4e-4127-08d955cbb673 X-MS-Exchange-CrossTenant-AuthSource: AM7PR03MB6660.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Aug 2021 15:39:27.9634 (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: AM5PR03MB3089 Subject: [FFmpeg-devel] [PATCH 03/10] avcodec: Remove the FFT_FIXED_32 define 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: wU2Bx7X4R+nt Since the removal of the 16-bit FFT said define is unnecessary as FFT_FIXED_32 is always !FFT_FLOAT. But one wouldn't believe it when looking at the code. Signed-off-by: Andreas Rheinhardt --- libavcodec/aac_defines.h | 2 -- libavcodec/aacdec.c | 1 - libavcodec/aacdec_fixed.c | 1 - libavcodec/ac3dec_fixed.c | 1 - libavcodec/ac3enc_fixed.c | 1 - libavcodec/dcaenc.c | 1 - libavcodec/fft-internal.h | 4 ---- libavcodec/fft.h | 8 -------- libavcodec/fft_fixed_32.c | 1 - libavcodec/fft_float.c | 1 - libavcodec/fft_template.c | 20 +++++++++----------- libavcodec/mdct_fixed_32.c | 1 - libavcodec/mdct_float.c | 1 - libavcodec/mdct_template.c | 6 +----- libavcodec/tests/fft-fixed32.c | 1 - libavcodec/tests/fft.c | 6 +----- 16 files changed, 11 insertions(+), 45 deletions(-) diff --git a/libavcodec/aac_defines.h b/libavcodec/aac_defines.h index e94475ac54..a3c680b65c 100644 --- a/libavcodec/aac_defines.h +++ b/libavcodec/aac_defines.h @@ -30,7 +30,6 @@ #include "libavutil/softfloat.h" #define FFT_FLOAT 0 -#define FFT_FIXED_32 1 #define AAC_RENAME(x) x ## _fixed #define AAC_RENAME_32(x) x ## _fixed_32 @@ -80,7 +79,6 @@ typedef int AAC_SIGNE; #else #define FFT_FLOAT 1 -#define FFT_FIXED_32 0 #define AAC_RENAME(x) x #define AAC_RENAME_32(x) x diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c index 3ce5330c06..4dfb38ac83 100644 --- a/libavcodec/aacdec.c +++ b/libavcodec/aacdec.c @@ -33,7 +33,6 @@ */ #define FFT_FLOAT 1 -#define FFT_FIXED_32 0 #define USE_FIXED 0 #include "libavutil/float_dsp.h" diff --git a/libavcodec/aacdec_fixed.c b/libavcodec/aacdec_fixed.c index 00257a5478..cad2fd6adc 100644 --- a/libavcodec/aacdec_fixed.c +++ b/libavcodec/aacdec_fixed.c @@ -59,7 +59,6 @@ */ #define FFT_FLOAT 0 -#define FFT_FIXED_32 1 #define USE_FIXED 1 #include "libavutil/fixed_dsp.h" diff --git a/libavcodec/ac3dec_fixed.c b/libavcodec/ac3dec_fixed.c index f6c2810ce5..8645952621 100644 --- a/libavcodec/ac3dec_fixed.c +++ b/libavcodec/ac3dec_fixed.c @@ -49,7 +49,6 @@ #define FFT_FLOAT 0 #define USE_FIXED 1 -#define FFT_FIXED_32 1 #include "ac3dec.h" diff --git a/libavcodec/ac3enc_fixed.c b/libavcodec/ac3enc_fixed.c index c7632d78e1..80aa98c691 100644 --- a/libavcodec/ac3enc_fixed.c +++ b/libavcodec/ac3enc_fixed.c @@ -28,7 +28,6 @@ #define AC3ENC_FLOAT 0 #define FFT_FLOAT 0 -#define FFT_FIXED_32 1 #include "internal.h" #include "audiodsp.h" #include "ac3enc.h" diff --git a/libavcodec/dcaenc.c b/libavcodec/dcaenc.c index 71a76bc356..884ac896d3 100644 --- a/libavcodec/dcaenc.c +++ b/libavcodec/dcaenc.c @@ -22,7 +22,6 @@ */ #define FFT_FLOAT 0 -#define FFT_FIXED_32 1 #include "libavutil/avassert.h" #include "libavutil/channel_layout.h" diff --git a/libavcodec/fft-internal.h b/libavcodec/fft-internal.h index cd809578ce..b0d8d80efd 100644 --- a/libavcodec/fft-internal.h +++ b/libavcodec/fft-internal.h @@ -36,8 +36,6 @@ #else /* FFT_FLOAT */ -#if FFT_FIXED_32 - #define CMUL(dre, dim, are, aim, bre, bim) do { \ int64_t accu; \ (accu) = (int64_t)(bre) * (are); \ @@ -48,8 +46,6 @@ (dim) = (int)(((accu) + 0x40000000) >> 31); \ } while (0) -#endif /* FFT_FIXED_32 */ - #endif /* FFT_FLOAT */ #define ff_imdct_calc_c FFT_NAME(ff_imdct_calc_c) diff --git a/libavcodec/fft.h b/libavcodec/fft.h index e03ca01abf..706c9d07f5 100644 --- a/libavcodec/fft.h +++ b/libavcodec/fft.h @@ -26,10 +26,6 @@ #define FFT_FLOAT 1 #endif -#ifndef FFT_FIXED_32 -#define FFT_FIXED_32 0 -#endif - #include #include "config.h" @@ -45,15 +41,11 @@ typedef float FFTDouble; #else -#if FFT_FIXED_32 - #define Q31(x) (int)((x)*2147483648.0 + 0.5) #define FFT_NAME(x) x ## _fixed_32 typedef int32_t FFTSample; -#endif /* FFT_FIXED_32 */ - typedef struct FFTComplex { FFTSample re, im; } FFTComplex; diff --git a/libavcodec/fft_fixed_32.c b/libavcodec/fft_fixed_32.c index fbdbf847e2..e18dc83891 100644 --- a/libavcodec/fft_fixed_32.c +++ b/libavcodec/fft_fixed_32.c @@ -48,5 +48,4 @@ */ #define FFT_FLOAT 0 -#define FFT_FIXED_32 1 #include "fft_template.c" diff --git a/libavcodec/fft_float.c b/libavcodec/fft_float.c index 73cc98d0d4..a9fd01978d 100644 --- a/libavcodec/fft_float.c +++ b/libavcodec/fft_float.c @@ -17,5 +17,4 @@ */ #define FFT_FLOAT 1 -#define FFT_FIXED_32 0 #include "fft_template.c" diff --git a/libavcodec/fft_template.c b/libavcodec/fft_template.c index 3012372a74..0bd64192cd 100644 --- a/libavcodec/fft_template.c +++ b/libavcodec/fft_template.c @@ -33,9 +33,9 @@ #include "fft.h" #include "fft-internal.h" -#if FFT_FIXED_32 +#if !FFT_FLOAT #include "fft_table.h" -#else /* FFT_FIXED_32 */ +#else /* !FFT_FLOAT */ /* cos(2*pi*x/n) for 0<=x<=n/4, followed by its reverse */ #if !CONFIG_HARDCODED_TABLES @@ -136,7 +136,7 @@ COSTABLE_CONST FFTSample * const FFT_NAME(ff_cos_tabs)[] = { FFT_NAME(ff_cos_131072), }; -#endif /* FFT_FIXED_32 */ +#endif /* FFT_FLOAT */ static void fft_permute_c(FFTContext *s, FFTComplex *z); static void fft_calc_c(FFTContext *s, FFTComplex *z); @@ -226,20 +226,18 @@ av_cold int ff_fft_init(FFTContext *s, int nbits, int inverse) s->mdct_calc = ff_mdct_calc_c; #endif -#if FFT_FIXED_32 - ff_fft_lut_init(); -#else /* FFT_FIXED_32 */ #if FFT_FLOAT if (ARCH_AARCH64) ff_fft_init_aarch64(s); if (ARCH_ARM) ff_fft_init_arm(s); if (ARCH_PPC) ff_fft_init_ppc(s); if (ARCH_X86) ff_fft_init_x86(s); if (HAVE_MIPSFPU) ff_fft_init_mips(s); -#endif for(j=4; j<=nbits; j++) { ff_init_ff_cos_tabs(j); } -#endif /* FFT_FIXED_32 */ +#else /* FFT_FLOAT */ + ff_fft_lut_init(); +#endif if (ARCH_X86 && FFT_FLOAT && s->fft_permutation == FF_FFT_PERM_AVX) { @@ -312,7 +310,7 @@ av_cold void ff_fft_end(FFTContext *s) av_freep(&s->tmp_buf); } -#if FFT_FIXED_32 +#if !FFT_FLOAT static void fft_calc_c(FFTContext *s, FFTComplex *z) { @@ -470,7 +468,7 @@ static void fft_calc_c(FFTContext *s, FFTComplex *z) { } } -#else /* FFT_FIXED_32 */ +#else /* !FFT_FLOAT */ #define BUTTERFLIES(a0,a1,a2,a3) {\ BF(t3, t5, t5, t1);\ @@ -620,4 +618,4 @@ static void fft_calc_c(FFTContext *s, FFTComplex *z) { fft_dispatch[s->nbits-2](z); } -#endif /* FFT_FIXED_32 */ +#endif /* !FFT_FLOAT */ diff --git a/libavcodec/mdct_fixed_32.c b/libavcodec/mdct_fixed_32.c index 5a34dfe760..eaa6355e67 100644 --- a/libavcodec/mdct_fixed_32.c +++ b/libavcodec/mdct_fixed_32.c @@ -48,5 +48,4 @@ */ #define FFT_FLOAT 0 -#define FFT_FIXED_32 1 #include "mdct_template.c" diff --git a/libavcodec/mdct_float.c b/libavcodec/mdct_float.c index cff2d211c4..3d3d3a5548 100644 --- a/libavcodec/mdct_float.c +++ b/libavcodec/mdct_float.c @@ -17,5 +17,4 @@ */ #define FFT_FLOAT 1 -#define FFT_FIXED_32 0 #include "mdct_template.c" diff --git a/libavcodec/mdct_template.c b/libavcodec/mdct_template.c index e0ad9f1e53..a854ad2700 100644 --- a/libavcodec/mdct_template.c +++ b/libavcodec/mdct_template.c @@ -35,11 +35,7 @@ #if FFT_FLOAT # define RSCALE(x, y) ((x) + (y)) #else -#if FFT_FIXED_32 # define RSCALE(x, y) ((int)((x) + (unsigned)(y) + 32) >> 6) -#else /* FFT_FIXED_32 */ -# define RSCALE(x, y) ((int)((x) + (unsigned)(y)) >> 1) -#endif /* FFT_FIXED_32 */ #endif /** @@ -82,7 +78,7 @@ 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 diff --git a/libavcodec/tests/fft-fixed32.c b/libavcodec/tests/fft-fixed32.c index 9fadd8a59c..3c50bf1dc1 100644 --- a/libavcodec/tests/fft-fixed32.c +++ b/libavcodec/tests/fft-fixed32.c @@ -17,6 +17,5 @@ */ #define FFT_FLOAT 0 -#define FFT_FIXED_32 1 #define AVFFT 0 #include "fft.c" diff --git a/libavcodec/tests/fft.c b/libavcodec/tests/fft.c index 83f2ff2a08..9a5e5bd1c0 100644 --- a/libavcodec/tests/fft.c +++ b/libavcodec/tests/fft.c @@ -68,14 +68,10 @@ #define RANGE 1.0 #define REF_SCALE(x, bits) (x) #define FMT "%10.6f" -#elif FFT_FIXED_32 +#else #define RANGE 8388608 #define REF_SCALE(x, bits) (x) #define FMT "%6d" -#else -#define RANGE 16384 -#define REF_SCALE(x, bits) ((x) / (1 << (bits))) -#define FMT "%6d" #endif static struct {