From patchwork Thu Sep 29 21:34:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 38468 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp1273288pzh; Thu, 29 Sep 2022 14:34:46 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5kbfkJ/sZ9qkYlI88hDYjcthuRXIPkwu9cyGwxFrPIXic6x1ukh80Mx8FBtL7y+SuddyhG X-Received: by 2002:a05:6402:401d:b0:458:5a42:986 with SMTP id d29-20020a056402401d00b004585a420986mr2562533eda.404.1664487286031; Thu, 29 Sep 2022 14:34:46 -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 e2-20020a50ec82000000b0044875bb5c8esi475128edr.488.2022.09.29.14.34.45; Thu, 29 Sep 2022 14:34:46 -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=URxhdZfu; 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 B2AE868BB08; Fri, 30 Sep 2022 00:34:42 +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-oln040092075050.outbound.protection.outlook.com [40.92.75.50]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 966E568B844 for ; Fri, 30 Sep 2022 00:34:35 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DTB3ROiUnqVdgQYcXMGbbOa/Jw7MwrpRxabtg68zINA+KwdGzrybheNsJyZOR3bf9JNw4VFu4bSOaYmYa9yH9hC6bMdbKdjn9MsV4Y7q/hcQVVHw9O5f3uKBFF72xJ9RGfDLE+CxxfbOvmlAXIRj2FgOY30aDS8D1tW/TGxkiFAlO+jR5PhLVGO8QOh/0uqfVTZu1rfXpfb479asKkyzPu4+BTT7ptwRDc+YXD/bnsFZ4TciVp8xlJTMnaG+KdSlGNuzD1zaMstvChnMVTwwl2ptxlhjibAyW5w2PB6KREJn3C9M1/5pTE+vdDwV6S8/toIzcIk7eMj0BBDuDlASSA== 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=P66HrhyRZdEMgLQSUzI/DnQA7cspozl2IFGls3/b14g=; b=Jk6XGpdNy6ySTvO64tmeFr7eacYiw2q9R6m1eW7uaPa1xcppJCwR9bMptZPvydOMj8VN1uE/K/5/hMSzk4dGbTkup9wS0iK5rB2R7flhCIA6zLKyklIs8QVhfu7rsxillTUzeiIZjo2bwti1P91UDbiY7vkUhpiRQgMjW0BqGURo5dcLQY+V3/ZOVnCFJH618T3XVh/Ps/40hGWB/thH8fVgXo6VIohFeErw0HXmqzbmoB6JMVFKuXlarNYuDqtE7B1GaDOSWD1JfvcezLJeqCToRYnuciXptMRgHV8kxOOTzBXWXO8u4+zSSXuKfRu+mPFMozBClfMIL6HX7I+bOQ== 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=P66HrhyRZdEMgLQSUzI/DnQA7cspozl2IFGls3/b14g=; b=URxhdZfuddSTFveG/Ln2l2gQL65oo+q9RvoWXecvV2hq4tZBxBTKUkaZ1y7aV5NUu0YqpUwIprf5hLw4ZCbOujeeccRaUCtVpxyKBpK8JUiTVMa4y4FQe2oaEurGtMILhcj4qNqkC22USsP3RkWURxnyBo8jNR+6K4axifpn1E39n6i8J34rPApFJB8x7hQhe5FxBCdkLLNHyy5UHma7fTJwWTDb5COoMrFvmhYA2O4kEapZrSf6bEbVBtIzI18T4KepxLNOUaCgVvxQonPBEHQpMfom0oZX9f6Y9RrO3hxeClCjN33LSi4YT1TR4zgY9sMAgk9b5AYDKGuhOo5O1A== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by PR3P250MB0321.EURP250.PROD.OUTLOOK.COM (2603:10a6:102:17c::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.20; Thu, 29 Sep 2022 21:34:34 +0000 Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::68bd:2fc7:ac52:38f8]) by GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::68bd:2fc7:ac52:38f8%9]) with mapi id 15.20.5654.025; Thu, 29 Sep 2022 21:34:34 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Thu, 29 Sep 2022 23:34:33 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 X-TMN: [c4r8KBLSuUzoP5adBp2LpWMBQRrTs+/tiTcLj3XnfGI=] X-ClientProxiedBy: FR0P281CA0121.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:97::19) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <20220929213433.2178576-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|PR3P250MB0321:EE_ X-MS-Office365-Filtering-Correlation-Id: 2e9f4788-c56f-46db-5d91-08daa2626695 X-MS-Exchange-SLBlob-MailProps: feAVlmA1hHUYfmrWLv2phry98IHlB7fCoRAQhBiJljG2heoDg+ugmCQuZnhygaSe8GVVjxOniOsoELKs4hCEsim/5sxgs7wvNFTbTlb5sLFvwTnSkLKUSzr/owWOOSR5wNrfWKwf4LvSsbwAbxldPnXuEdU5yVr3H8UyI0I+7bVbnvsf8Scir13MUFa2fIhAtYZMMLyEiPMznM6ZtZtTVx6D7WgokehIVM7AA2ke4Hwr29BpsjZQoxp0Cxt0uYF7bniuIaNA2DH5z2S2xXFvBf3ag/mhBiaTP2Zt4MLlF//OXv4j5mgpJCa6ib1dOlTVHoSkbXYN1NvWuHKuGluK0z/VYaLyOiGsgiSRSCpv9zQ+6nxptyG9hAbUWmFktK189Q+9XRKQwU5diMO/pq9BrmdRt4P3r1cTmeUsjf/muhHbnbvAZeFQUIGnW/nqqmd5HiVY/lmr4MLsZ++7XKYZCndRSF+JsPiAy9y3EQ43N5q9Dh60LMW0zTPU/eI7lCl9Zb+uUgcb9nIQL4/vZ9Jc8Qk+Me9dhhUU04Rs9VLCQFWMjK1rYjoZoE3b002a1DNKeQRcEM8BEQiRDRAhnJQ6+23UIbN7e9EdrtOm9eZpo5f8FXfMx6UIEQyzgTLYw1fTKUvUnjbY/+J0W/PpbpcQjXzKkoVHXelze4sVWRWUBnkLJYYEyscQrNNXEsm73KMHo7ExVwnJnYbKZe7d2k+6eA== X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: b3I4A2FZtwRJUwYXRGwEvs/E8YL7LCZnXuOdgStlXNxZ91M1dHwPhf8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+Ju02CqRXbefpH3xEndldNo6kiyECfPRfJUp8Jm9SW57CKKvzrp2HOZIZo2RMkssftoikSA3PC0Qo1vCcsoKork0vunQ1txSZe+lFdyNKqAAsjWIvO3tDxd8RdCs7NS5ohdTGplOlUFW+pV3AQtVXdNdnlquvHFG2D+w+QzFb5qgWxIk8g/py89YciRvaXQHX6hmTmy5nUz0bVL+d0rwxSLU4OL+Dhr6RnglSZ2tNVOJtVe5tHFoGdIHwi5ShnHtguxmzlsd8U89RfBDilBbTMg04KvEFIjXrD8vg+mfqphhVn5MVTjLTBXIXzg5lgnb9Hk6ddSxeASY9a7Ts7+xduTaFoYuVXY+faygNIVhP8TlgtbisdX04c0Q5yRo/prZntUM2e1i9fyY7D7cG+JR9vNj459g41nRyMZQvwQIDcKPUZw3xOz5R0ff2E6T3B/6Rwp0bB8xyLjkVA5NbWieOHvkShJNr+HHowC76ylR3jbOXCmwLdgXB81QKe/8SHzmEkS1iUZOYjuL1XLeFsfCJmUOGWuuGwX2MHXaLM6Llu81K412R/mAQygRCUrdIplu8ibqHfDW6srDmgtJw6POZoN6nDBrzQmrJ+BxzL7K1cmDcGUJfjZPdDfnRNS7yreM0yfrfd95wutKGuYXwG8O3c95fwdaHfC0lCF0tGto9ZDFZkA4tFhzORkneSaMyUwvQLlRL6WnHXG+7L2ER5DRPbLRj0NwtWWLIZJX/7mhb1wg3GxuwRc1ucEVK6sZCnjajCJCW/kkYMuiC+fA3J+pvouq4VTybaZ4+8Rj4tUKODA8o6uvIcGQnzP/gQSUtj5vm52tZCYAHVNaVii7DEztnjaWAJNpjh9yQyKilr3dWsn2A1L9LMMdetvQEvU6wVkCPN0fOrIQ44ffZ6yTMwY= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2e9f4788-c56f-46db-5d91-08daa2626695 X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2022 21:34:33.9937 (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: PR3P250MB0321 Subject: [FFmpeg-devel] [PATCH] avcodec/vorbis: Split data declarations out into new header 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: p0T7HwZbWgND vorbis.h currently contains stuff only used by the native Vorbis codecs and some Vorbis tables, which are also used by Opus and libvorbis. Therefore split the data out into a header of its own. Signed-off-by: Andreas Rheinhardt --- libavcodec/libopusdec.c | 2 +- libavcodec/libopusenc.c | 2 +- libavcodec/libvorbisenc.c | 1 - libavcodec/opus.c | 2 +- libavcodec/vorbis.c | 1 + libavcodec/vorbis.h | 10 ++-------- libavcodec/vorbis_data.c | 2 +- libavcodec/vorbis_data.h | 34 ++++++++++++++++++++++++++++++++++ libavcodec/vorbisdec.c | 1 + libavcodec/vorbisenc.c | 1 + 10 files changed, 43 insertions(+), 13 deletions(-) create mode 100644 libavcodec/vorbis_data.h diff --git a/libavcodec/libopusdec.c b/libavcodec/libopusdec.c index 31a04dfbeb..9b9a610343 100644 --- a/libavcodec/libopusdec.c +++ b/libavcodec/libopusdec.c @@ -31,9 +31,9 @@ #include "codec_internal.h" #include "decode.h" #include "internal.h" -#include "vorbis.h" #include "mathops.h" #include "libopus.h" +#include "vorbis_data.h" struct libopus_context { AVClass *class; diff --git a/libavcodec/libopusenc.c b/libavcodec/libopusenc.c index 81e765403f..75bc491c9e 100644 --- a/libavcodec/libopusenc.c +++ b/libavcodec/libopusenc.c @@ -29,8 +29,8 @@ #include "codec_internal.h" #include "encode.h" #include "libopus.h" -#include "vorbis.h" #include "audio_frame_queue.h" +#include "vorbis_data.h" typedef struct LibopusEncOpts { int vbr; diff --git a/libavcodec/libvorbisenc.c b/libavcodec/libvorbisenc.c index f78a88bbcd..6331cf0d79 100644 --- a/libavcodec/libvorbisenc.c +++ b/libavcodec/libvorbisenc.c @@ -29,7 +29,6 @@ #include "codec_internal.h" #include "encode.h" #include "version.h" -#include "vorbis.h" #include "vorbis_parser.h" diff --git a/libavcodec/opus.c b/libavcodec/opus.c index 3540206347..b91f57dec3 100644 --- a/libavcodec/opus.c +++ b/libavcodec/opus.c @@ -33,7 +33,7 @@ #include "opus_celt.h" #include "opustab.h" #include "internal.h" -#include "vorbis.h" +#include "vorbis_data.h" static const uint16_t opus_frame_duration[32] = { 480, 960, 1920, 2880, diff --git a/libavcodec/vorbis.c b/libavcodec/vorbis.c index cca2aa7c63..d0b660b44a 100644 --- a/libavcodec/vorbis.c +++ b/libavcodec/vorbis.c @@ -30,6 +30,7 @@ #include "avcodec.h" #include "vorbis.h" +#include "vorbis_data.h" /* Helper functions */ diff --git a/libavcodec/vorbis.h b/libavcodec/vorbis.h index 0dd109dd2e..aa1ec5719d 100644 --- a/libavcodec/vorbis.h +++ b/libavcodec/vorbis.h @@ -21,15 +21,9 @@ #ifndef AVCODEC_VORBIS_H #define AVCODEC_VORBIS_H -#include "avcodec.h" +#include -extern const float ff_vorbis_floor1_inverse_db_table[256]; -extern const float * const ff_vorbis_vwin[8]; -extern const uint8_t ff_vorbis_channel_layout_offsets[8][8]; -#if FF_API_OLD_CHANNEL_LAYOUT -extern const uint64_t ff_vorbis_channel_layouts[9]; -#endif -extern const AVChannelLayout ff_vorbis_ch_layouts[9]; +#include "avcodec.h" typedef struct vorbis_floor1_entry { uint16_t x; diff --git a/libavcodec/vorbis_data.c b/libavcodec/vorbis_data.c index 4f4ea03f15..1ebe146d8f 100644 --- a/libavcodec/vorbis_data.c +++ b/libavcodec/vorbis_data.c @@ -21,7 +21,7 @@ #include "libavutil/channel_layout.h" #include "libavutil/mem_internal.h" -#include "vorbis.h" +#include "vorbis_data.h" const uint8_t ff_vorbis_channel_layout_offsets[8][8] = { { 0 }, diff --git a/libavcodec/vorbis_data.h b/libavcodec/vorbis_data.h new file mode 100644 index 0000000000..0fe19e509f --- /dev/null +++ b/libavcodec/vorbis_data.h @@ -0,0 +1,34 @@ +/* + * 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 + */ + +#ifndef AVCODEC_VORBIS_DATA_H +#define AVCODEC_VORBIS_DATA_H + +#include + +#include "libavutil/channel_layout.h" + +extern const float ff_vorbis_floor1_inverse_db_table[256]; +extern const float * const ff_vorbis_vwin[8]; +extern const uint8_t ff_vorbis_channel_layout_offsets[8][8]; +#if FF_API_OLD_CHANNEL_LAYOUT +extern const uint64_t ff_vorbis_channel_layouts[9]; +#endif +extern const AVChannelLayout ff_vorbis_ch_layouts[9]; + +#endif /* AVCODEC_VORBIS_DATA_H */ diff --git a/libavcodec/vorbisdec.c b/libavcodec/vorbisdec.c index 4a85500c10..715a7f7d03 100644 --- a/libavcodec/vorbisdec.c +++ b/libavcodec/vorbisdec.c @@ -40,6 +40,7 @@ #include "get_bits.h" #include "vorbis.h" #include "vorbisdsp.h" +#include "vorbis_data.h" #include "xiph.h" #define V_NB_BITS 8 diff --git a/libavcodec/vorbisenc.c b/libavcodec/vorbisenc.c index b33d758e44..dcafe7d591 100644 --- a/libavcodec/vorbisenc.c +++ b/libavcodec/vorbisenc.c @@ -33,6 +33,7 @@ #include "fft.h" #include "mathops.h" #include "vorbis.h" +#include "vorbis_data.h" #include "vorbis_enc_data.h" #include "audio_frame_queue.h"