From patchwork Mon Oct 3 22:32:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 38542 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp1570509pzh; Mon, 3 Oct 2022 15:32:20 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7YI6MlmbWLkHdwMicgDtcCJsZHxexb6Veol6eEVTnvk/AM/LU5Ce1jj/5s/I8FG9LCLc8x X-Received: by 2002:a05:6402:35c1:b0:451:e1aa:e66e with SMTP id z1-20020a05640235c100b00451e1aae66emr19799997edc.275.1664836340120; Mon, 03 Oct 2022 15:32:20 -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 z15-20020a05640235cf00b00450bda7e40bsi9886735edc.29.2022.10.03.15.32.19; Mon, 03 Oct 2022 15:32:20 -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=tw6+q8ue; 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 C38B168BBF5; Tue, 4 Oct 2022 01:32:15 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05olkn2097.outbound.protection.outlook.com [40.92.89.97]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9354868BA2F for ; Tue, 4 Oct 2022 01:32:09 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Paw9yxWAYzj7y+wuRRc2W1N0gjdjXm8Tb0I+6afm/08URNrhF+6jP3/uVdLa3sdAZ6yuns8m55xVuVCp3rkHvZ5VFAhFdAuNbXTPoSosdYbqloKoZZPcQjY7I5BodsLGUGsOVUSxx8aRxorGEh3xbFk6pgx9QihPk33TCbOZw/lIA8fAcZNcmDEu3ZyIdSE3lsaB9Vf7crRcTQq/cgQj/Ze0OuNuOvFbnQxOb97DM/UZdRovSAUj9avubcrezsMvJzfvgdqgf6LKa3KNYi6CQFKf7n61s7ofR4kfvV89QV9rsm09/NMfwHWc7KbNRHUmrG5FEHrInFiRspEgBm4SFw== 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=QG+WhZtgph1nkzbfiSS/DOHe1FLzFGP9ISNBfwAhY6k=; b=m1I3/0sCPv3FKYd9Gk7SR8FhrdycfAWf9zaziqYW1Y/uUhir+z2mini+3WAm3Uu2DyaxemwupGauhNFfM+8Tf0u7VXbFgzk5eiHs3oUE7BN0nuStQIWZxXSkTZp/5FoXCZtwMpDwgLStoZjygyfM7avcwoqbH52KDFl9b227eQx7LVqKt9nJgU7TOxN0bxu4YblUtc0bNQHA34v0Dp9ZjEpZE898B3NUNFBE9XhF+OOv5r2aZWjrDh0FjmuWZox+rCUzhK2CknkZm+9H/xvtJqe5f8Bc9nljbj5E53Tgng3XLcHSjEfXfQpS5tvE6V/lcxEHcI7QEi8uUzxQLMuoMA== 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=QG+WhZtgph1nkzbfiSS/DOHe1FLzFGP9ISNBfwAhY6k=; b=tw6+q8ueaoRmsav9upLUf0kY2hjcqqwYPmzFZKRVhxIS3rq+5h2cK94HUJx4Qj0AWo7rHJQh9LckW0nDe82L2VTSmuRMTkQ1Z1aspNFX+KcC52wdglX2ag2Y28yYOudnh5SVIptRdkopAN3NXSSkcNaW1fXISRr5JsnYS0lZEuNBOVaX2uFo06YIczKqeIuP5Sz0WNVG4B7V7sa4Y0fzegpuYbW3eyWaSGnqiJVxv+LwDOhAYqHHgCFdVxF8Beo6XfsEVB8Tx5sRs4CDQKdc0fAZpcUhpr+1hfB56Srf31mpc5Ou+EA/ba35a9z7C6Qjx3KY0fdh1kStq8IjokFWww== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by AS4P250MB0461.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:4b0::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.28; Mon, 3 Oct 2022 22:32:07 +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.5676.023; Mon, 3 Oct 2022 22:32:07 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 4 Oct 2022 00:32:00 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 X-TMN: [swgo28ebCtDym2olSVKNQx+bqBa8GlxJThBN6SltiYM=] X-ClientProxiedBy: ZR2P278CA0024.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:46::13) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <20221003223208.1706007-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|AS4P250MB0461:EE_ X-MS-Office365-Filtering-Correlation-Id: 6063b51a-ee33-46dc-8239-08daa58f1ad9 X-MS-Exchange-SLBlob-MailProps: V85gaVfRD4/g5cw7fGTKyBiHm0TAeLuI+lJ5E4AbnQ95bOj5d5RfHsUioBD3CO46gWHiap0o5hMlocpL8BgK1+s99HtRG9pwVWFbRn4HQVduR2ur3OIt3S6bN6Q5OdsKUTyX8gZEamm0UpebhH6EAn85hT/FLuFVfAS8sNZeI/F0axGXuEPM8DldqsXimiB30wtr4h+/EqDqTaTmtDmbDf13yMjmRTd2f1xDh1gHLe8t6oiRq3jGbIwMgA07wV9rQgqtbKTlmO3km6EgUIlxrD+crbfiipGpAFkiFwjf0Eu9zd8X4493oMI4phC2IH6Xp1mf7HqIU7VYfeTbB3oTrQ5Km/nCoBZvvAhXE0zysU4TwdOXh+92BaIm3nB12TuhvwQBpGt1ibDMLnJpRkFQ/35KujL4ab+QM+DD4qBvvxzWZdpnCzFYBEUOW12oftU2rnbIz62TQ7Qk15SVT5K5VxcsedKnZp4WY9CoiKws7yVkh7oCJy7cxBnrsf14WseQ8DAY+XD7q2VDVE/k5R53ARTobNXG3y1t9GJnydCvbyaipdH4SK9ONe519+3Z28ozScvvBBDhufkv3DMj5mcirMu3cDfkNbeLyV/NpUgFaN9MgnG5/0+Avx+wrBDWs+07JllFx8cFjOyrQmkCrmTQST12TiGKwUfiFV0t29nFe1bddPscnV5oZ4vjAb5VV1v547OcJOhthZfo6t0Tn83SH+tQqDk3oQ0ptod1bKExAXzUgA415MA3Fmhm9/HYUrQGMoMn3brHq+753mjVo0BhjcprwRJPoKogf6zZVnyX4tOmhIaSZy52L0LJc+kSMuSfEEvK9v3c4MtnJUbYtcbZcQ== X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: S9wD2REy5ZXLpZTY8A9YhekGxdOoU3WvZvHoz3tTq5rG32CL4BFEeLw18PPrnIGKO0e9Wga5xAgaDo1r7chqzLbXBtG8lAVQNSDpiZRSomwh365FuyesxiM3+v4lenhvkDpHO2RHRhD3AqO6fJhgv3kNuSMkxg20bJHEZSZMb/er/Ug2wRieidm/LWo5sW/rvgqIvAggq2xeke5w97/OTGhuUCeCRPZq69s68f65Gh3iELfJ8gaVjCIdNwJIs9n1nOxpyor6jjZqp1MEx/JRLGxmyR72tMQrbuBu0aKrRsMev3GLdYl0d1hsTXE/QCBlH6jR9x9KTAsYs4YoQxTNZbSYIsR3GJeHoTqnhjvUI4orIHeXnsiN8wxCAlLAe3nMXZzUWhV5nvGZ5Vr+yNQw2dzmXcI1f+qlDUdQxAb00Tr8yR9HwX2cd4U+12IwUEpKGcAeybTotJUbg28kaYbWRGU9PJWJs9YMbwHXSfeSS9Nb7mkENC8/dYzv9LQJbu3z9GTiaj7mjv7/HCvdk0TbDwzrBYP6eD4hV2lUFb6w/J04bOKPjlzakH4vybH7pNIP7GyuPciXBMgAaY6ik4wCoK4TMlaZDXjn7osBpJhSqm1hnRKzL8J9ffEwDgP55f6cRBUgRTpMFOiBns/Am3Ue97KwSueGZbGxVerxkMgxt0H/LcKJl0xqY2IIM9jwI/5P X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: YzP8/k7lFiJZsA6nD8VVgFCPARd2yEUr5Nb6knCJ3gv8ezF/7SWmnMF1MH37XFnelg7i66LbvZyi9+WhFI5WZfo3BLiTxmVnvfrAiEQof3U7snhOIg1TQRlgEnYX8S5NLNneoKMAL5JE4kPkPfdlv9PX4IPxrx6Ct8xWa1mZgz2WNAErx3GjJCd1eD528T9FmIPP13W0yAtWL/P+vno5xDP7P9cdYXrmectOL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c341YE= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6063b51a-ee33-46dc-8239-08daa58f1ad9 X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2022 22:32:07.8370 (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: AS4P250MB0461 Subject: [FFmpeg-devel] [PATCH 1/9] avutil/attributes_internal: Add visibility pragma 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: iPhVi3hu2VeN GCC 4.0 not only added a visibility attribute, but also a pragma to set it for a whole region of code.* This commit exposes this via macros. *: See https://gcc.gnu.org/gcc-4.0/changes.html Signed-off-by: Andreas Rheinhardt --- libavutil/attributes_internal.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libavutil/attributes_internal.h b/libavutil/attributes_internal.h index 9d3d10b63e..c81e9b8204 100644 --- a/libavutil/attributes_internal.h +++ b/libavutil/attributes_internal.h @@ -23,8 +23,12 @@ #if (AV_GCC_VERSION_AT_LEAST(4,0) || defined(__clang__)) && (defined(__ELF__) || defined(__MACH__)) # define attribute_visibility_hidden __attribute__((visibility("hidden"))) +# define FF_VISIBILITY_PUSH_HIDDEN _Pragma("GCC visibility push(hidden)") +# define FF_VISIBILITY_POP_HIDDEN _Pragma("GCC visibility pop") #else # define attribute_visibility_hidden +# define FF_VISIBILITY_START_HIDDEN +# define FF_VISIBILITY_END_HIDDEN #endif #endif /* AVUTIL_ATTRIBUTES_INTERNAL_H */ From patchwork Mon Oct 3 22:44:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 38543 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp1575189pzh; Mon, 3 Oct 2022 15:45:18 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6k94nkfh7rkmKS0ON32GSbXy73QksbPnmJpPXVw5wI21NkoKp+NftbOAKZ5xFN0pKtcdk4 X-Received: by 2002:a17:907:6d8c:b0:781:e30f:3218 with SMTP id sb12-20020a1709076d8c00b00781e30f3218mr16948569ejc.430.1664837118595; Mon, 03 Oct 2022 15:45:18 -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 hz5-20020a1709072ce500b007707e4ce2ebsi8476562ejc.234.2022.10.03.15.45.17; Mon, 03 Oct 2022 15:45:18 -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=tsYAEp95; 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 0268368BBFC; Tue, 4 Oct 2022 01:45:15 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03olkn2035.outbound.protection.outlook.com [40.92.58.35]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 08D3168BA58 for ; Tue, 4 Oct 2022 01:45:08 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DCqleG6JfiTDOPdfnjuI4Dd+pp88ONrfzm6s0gYnN724yuX5M+E9OoNTh0T/+u3IrAsbFZhxu66tR8cJK3TXcqpNpS7wgdD0WdAiVLZmNZkJYQNpZSI72wc1hIdTct/lVx1vz2SH1CdtKQniOPSAymLhTbsDkeQskckdmNxiIJuBetiDCF78EsAW7xSpVioaVXqO/mfXD3ltHFkPJ5sN7l1uAlRxl+3fmhgZXCdehIRuDX1atFtE1UOLXzHlzz90dHIBa3qvKK90WGDU0ajnaw92Ws2iEOeYX447ENQBYy+B+JVAWMI83ZuIz3pxMTl1zD/B9uqUe+BsXtgh5yXvmw== 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=9A9RwuwZ80Ko9woyHet6AHx7T88PvO3F4ve7oN63tBs=; b=nqytXu/0X2Kavlx9kJoHh1PKLzcPjjbRj0HMF1WM7Z2px58FRhkQYcVLdcEaoIQmhTQYmYgEirZH0tDsO1UHPkCwz1mk0LXLa2bfyHtzXeSIHyBJ/iGPUwHXkoqeACFauv8Fqz7zHY/ZAhW+mfjQssgbpcVhfC0nRZ6bFRBFi4hOE7z5dKlL3RP36ebogLrmeosg+xQbSiq7nZYxmZ4lVD/8tnbuBC5uXYwu/1filcLZgB+9g6UoT2C9f5akfVoWgTXuIAKcNBZoXb8pQss7k1pIjQglXD+D2f4UhxEvn9EowXca0FqZdbqGKpPqvbj+s+HLPA5yt47kTQaGNVjmCw== 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=9A9RwuwZ80Ko9woyHet6AHx7T88PvO3F4ve7oN63tBs=; b=tsYAEp95FNhA2hWvd+bk4FfZ0GeVA9opv4pGdX/a1FUYEEj6JFaw0by5Zn0/ZI+6sxy0b4wzQHUaB0hkoTXhkMgWGBgb71g964eKdXCug5g4prVKSHNed5fj/IWP052WsecCzVZcMo3WCebf/QqN41/kr6uEsdu4xnopEHa0+oBKDKJncdvBTZ94T5lX6oLUR/5R4RpaHBh7Bqfix+DkSCp4N+iupZXEP7jFCdK/GqVHA3ujNzDIajnEmcyM2CCCIukjWvKgqFkA6UDMTqFQuC3Srp/IGU3GH1P+GThxRODaqQtZvxhFItPDclL3LsYMW8yIA1Bu0t3G7o765sJR3Q== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by PAXP250MB0470.EURP250.PROD.OUTLOOK.COM (2603:10a6:102:283::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.23; Mon, 3 Oct 2022 22:45:06 +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.5676.023; Mon, 3 Oct 2022 22:45:06 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 4 Oct 2022 00:44:58 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [M5jTOKFPv5ntK6fWk3UXgVnn77WMWdDSy5fj70Bceno=] X-ClientProxiedBy: ZR0P278CA0056.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:21::7) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <20221003224505.1846824-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|PAXP250MB0470:EE_ X-MS-Office365-Filtering-Correlation-Id: 979a25eb-d2a5-420d-c858-08daa590eae0 X-MS-Exchange-SLBlob-MailProps: AZnQBsB9Xmpi4YQjBH3ret4WDK5HTi62G71uWh/5pIGGyqd23vwRX7DFK2X7OpieJ9xWYXdzhLbVNj/UCxv6MksEfa1dy+OEPwxJmWHQMAVfi2E0QvD3gDdc5KInKZNvdkRz0fU7mPUP5a+O0wPlSst/xxKCeCYigzXZhpU+yWX3YFghsJcuXYgcKVxyusts893vKup2vV801yR26Nkv+Lm8daNa45TWDQT4MzoaRP1dotL86xRGxRpkwzO3/CpJkoamii3BrYjZZsM0OVz2qVlU2VP76i4YTnp1UmcCVzBKHiI041aJ2fKoZrFMdfDh8XLQBlmsbeFTEIevs2aAAWhtJ+miTAlYF/LvVn4UpJb+h3zmwTiZO18zYB4VDj5lkENlJ74Nrh9aSbELbP2DLhi84kCGMq7VnSYtGKj9FLkVbW36q8ghpJFvnM2cKHRUtgiBkSDec9YLqTF0yUJHiwXPgn0Led9NLNiQrx8+pVjJXyFGaDKANbMYFHcFL9OpKvVA47/c24N9jf4PBz/ZQbGcjJBtpnb/2Q/W9arlszBJT4fA9doWihxLOD6jiJjA0RtQw5F/CKkXpd1hW4qJd7L3u0XAE1mu4078HhzQC3tm/WnX8iiZz4GYTn3qEPyGLCR8ttObDYfc5aYLG93mCqJhTaT1mOPRkh7Ih4qiiSLHZCGgzP/7HukuAdoxaAClbLqCz7dwOMtW9suDi4Y4ANL23eNbqNNpTenV+lYoxU++8DZDf+qdsPy5UMK4Tim89kaDkjLSL+o= X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: q7O2QPOVbWA0/4dCAgJjr6zIYoLQUAmMzXP6IxrocesdfYxuehwLb1Evvowif91KyaxIoEjnHJA1tcatZw5v65lBhUxBbVIbGxk/GKHGT30JaALDdmoQXW61+ModwWERghSHQlHzk0iuSJ5zK0zAHngTOG2uHphDuLrqgZQ4NOONMXNWYg9vdqQm2Kgb14z/dQssn8nrk+9rSURVvBk/JQF5DovEfFiqVkuIfujjfjESs0ukUnfjwBuFfnKyIhtM5AZnU0SuLraOnmhUcpF1KAVvBvuTDG3zCLC6DSqQBxEMxgmSvGSvUxQRkCs1sMF7PeJ/XesC/qsZi9aYKfkvIdFztHz/LGn4S+40hN4g7B/aARNpuMdOrv8eFvTB1hOij6A0Revd9k3SWe8sfALFI0tKFJXIPij5pnv1VDWO+ksQ8N88Uuqt/Tud1Q9cqYHyR2JQUVP6c1jIJDPAy+hRPbf/lcjUJUbrQzhykYcQHj5gM882LJiLfxCFMlRYz5ptQJ4P3/2BUfRLnDqG2oVUrbbWZC1mF4m+LS0Xlq5rpLfCyY4x+dai5JaGwrWkyr3nNsMHZUOqnkRA3sKxrKbIDbmgTf+aDPrEhfKhMCsMAepX0dnM8gKGe6T3tKXF3uPH95r0H1WzrvFFIeSEKp1tsvjlSZXeBKQDS1rsXZR3FoymDTELcKuw/XfL4MW6ZX1z X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: D4diMFrs7zBiCj5MgTcniPULjPFtOy/gwm5qHhGn9+q+6RfMplb+jMNgMp2oSQWbbnNLp0iKKaM6Hkyv2cczZwAfJpucSD4Es6IClMwTdHMF+5IQtgHeDWCwVyMsp5YsHOE59PEcbwGEH80H77c+AwHEyJL/1k3TKzyj5EEc9myfffpneCHFAIP7Fo7jeZEz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LLErW/3SRcbwoeCrFjM5HBzBKxRMK997otHI14XnJW1ESlFI6bEodR7c= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 979a25eb-d2a5-420d-c858-08daa590eae0 X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2022 22:45:06.2850 (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: PAXP250MB0470 Subject: [FFmpeg-devel] [PATCH 2/9] avcodec/opustab: Avoid indirection to access ff_celt_window 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: xkUo5DHbL9YT Currently, it is accessed via a pointer (ff_celt_window) exported from opustab.h which points inside a static array (ff_celt_window_padded) in opustab.h. Instead export ff_celt_window_padded directly and make opustab.h a static const pointer pointing inside ff_celt_window_padded. Also mark all the declarations in opustab.h as hidden, so that the compiler knows that ff_celt_window has a fixed offset from the code even when compiling position-independent code. Signed-off-by: Andreas Rheinhardt --- libavcodec/opusenc.c | 4 ++-- libavcodec/opustab.c | 4 +--- libavcodec/opustab.h | 8 +++++++- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/libavcodec/opusenc.c b/libavcodec/opusenc.c index 58e3f5fa38..06f71876eb 100644 --- a/libavcodec/opusenc.c +++ b/libavcodec/opusenc.c @@ -203,7 +203,7 @@ static void celt_frame_mdct(OpusEncContext *s, CeltFrame *f) float *src2 = &b->samples[CELT_OVERLAP*t]; s->dsp->vector_fmul(win, src1, ff_celt_window, 128); s->dsp->vector_fmul_reverse(&win[CELT_OVERLAP], src2, - ff_celt_window - 8, 128); + ff_celt_window_padded, 128); src1 = src2; s->tx_fn[0](s->tx[0], b->coeffs + t, win, sizeof(float)*f->blocks); } @@ -224,7 +224,7 @@ static void celt_frame_mdct(OpusEncContext *s, CeltFrame *f) /* Samples, windowed */ s->dsp->vector_fmul_reverse(temp, b->samples + rwin, - ff_celt_window - 8, 128); + ff_celt_window_padded, 128); memcpy(win + lap_dst + blk_len, temp, CELT_OVERLAP*sizeof(float)); s->tx_fn[f->size](s->tx[f->size], b->coeffs, win, sizeof(float)); diff --git a/libavcodec/opustab.c b/libavcodec/opustab.c index b23ca4feac..2a57511177 100644 --- a/libavcodec/opustab.c +++ b/libavcodec/opustab.c @@ -1101,7 +1101,7 @@ const float ff_celt_postfilter_taps[3][3] = { { 0.7998046875f, 0.1000976562f, 0.0 } }; -DECLARE_ALIGNED(32, static const float, ff_celt_window_padded)[136] = { +DECLARE_ALIGNED(32, const float, ff_celt_window_padded)[136] = { 0.00000000f, 0.00000000f, 0.00000000f, 0.00000000f, 0.00000000f, 0.00000000f, 0.00000000f, 0.00000000f, 6.7286966e-05f, 0.00060551348f, 0.0016815970f, 0.0032947962f, 0.0054439943f, @@ -1132,8 +1132,6 @@ DECLARE_ALIGNED(32, static const float, ff_celt_window_padded)[136] = { 1.00000000f, 1.00000000f, 1.00000000f, }; -const float *const ff_celt_window = &ff_celt_window_padded[8]; - /* square of the window, used for the postfilter */ const float ff_celt_window2[120] = { 4.5275357e-09f, 3.66647e-07f, 2.82777e-06f, 1.08557e-05f, 2.96371e-05f, 6.60594e-05f, diff --git a/libavcodec/opustab.h b/libavcodec/opustab.h index 16011db758..9c9f1b9d98 100644 --- a/libavcodec/opustab.h +++ b/libavcodec/opustab.h @@ -25,6 +25,9 @@ #include +#include "libavutil/attributes_internal.h" + +FF_VISIBILITY_PUSH_HIDDEN extern const uint8_t ff_celt_band_end[]; extern const uint8_t ff_opus_default_coupled_streams[]; @@ -154,8 +157,11 @@ extern const uint16_t ff_celt_qn_exp2[]; extern const float ff_celt_postfilter_taps[3][3]; extern const float ff_celt_window2[120]; -extern const float *const ff_celt_window; + +extern const float ff_celt_window_padded[]; +static const float *const ff_celt_window = &ff_celt_window_padded[8]; extern const uint32_t * const ff_celt_pvq_u_row[15]; +FF_VISIBILITY_POP_HIDDEN #endif /* AVCODEC_OPUSTAB_H */ From patchwork Mon Oct 3 22:44:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 38544 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp1575222pzh; Mon, 3 Oct 2022 15:45:26 -0700 (PDT) X-Google-Smtp-Source: AMsMyM75E86Ocv7GdmhZze01L3ARgow5pt1xzKMQkx5Eh7wiIK/FEEsiPBwq8eY7YGN/8eY1U8ts X-Received: by 2002:a17:907:160d:b0:782:9631:c198 with SMTP id hb13-20020a170907160d00b007829631c198mr16626254ejc.520.1664837126736; Mon, 03 Oct 2022 15:45:26 -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 hh4-20020a170906a94400b0073d710fec77si9092948ejb.251.2022.10.03.15.45.26; Mon, 03 Oct 2022 15:45:26 -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=G7nJEAra; 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 131DA68BBFE; Tue, 4 Oct 2022 01:45:21 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03olkn2035.outbound.protection.outlook.com [40.92.58.35]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3B7F968BB4E for ; Tue, 4 Oct 2022 01:45:14 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nvfBUmo2v092j3A8zCGV9nFSvE+xz5Gnfl+MLRtzJuqqsVWqQxjISxswn1wFVe6bNH2Q/fyivriWNRwTuknXFeDSh0aGgBS4elme/PasahOD6wPax1ZadD04HKRGMhiugeL/olcwnNaEPwkYy18O3L4Fe/us70MTWxlYTaHXh4SGBYqFyMaVhtmnw9XzWhpNc1WYqq2AbXzGA1MkrXXl+WiGlXBeLSHJ62QMHumccfZkjeQ44m6bCwE2NdAv2ApTY2t0zqUPF4s5/2lFKjU7CkoIE6v8Gnt9cnLqSHiEexmaTN0O+7eL/p22YFIu7er3kxO2puc02xdgow0x7adUiQ== 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=qhgJxHcAs9hUyMc/8DNrthRxTXayahTbrhIrigZFbXE=; b=H2SlhFJ+4JsbNi0/LSdeLk/qVPP8u8U1j9X196UOUoegDMTLOeWTqceqRUvRipOkYDYOXGCHOumPeCMj5bP8nlJLDLRVzmS0ZKaSSGltNWUQzOOkSvoeDB1Mp99fn6s5Lk59C9YKKKO1l0NGFjHSR/+Dt2YHRBrFiUuYFp/qt7jikPB5VZWy+udVew9jNyaqP2mnQ+I7+pDHPGCDDTbFk4N7NpwgizxynQyJ4OUjk4g1CIiiNEINqVBXJ8eJZDfnMP9NK5QFuw6BzL6beSYGDGde6BlQNiBkRKsk99Ie6sCWnPVpW/r4gIWs9iM7o5ekfcxLXBk8pKXGkN1XuFtsvg== 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=qhgJxHcAs9hUyMc/8DNrthRxTXayahTbrhIrigZFbXE=; b=G7nJEAraNWp/xOr6YrSogBihV+dTZaryrGRI72veKGwHPFSJvVcxW4jd1nEQyt1g5SaK8a4l57lvijFnltPjTqJOUtiZh75IcrvYOGOau90G/LISsqZuLM+N1ZM5AkC3L/dvvutxHeROZprvVdRy18hYeInltGUkiruqpLt3uGbCugPLAb8MFQzJf1nQUKtkJeyIePOFdAJoTut6XJ1RaM6c/RSKiCo7uNms4jY2EaQIANGL0JkhQlJ5G+NUT9pjTggOQ5Jj8RyAyAop0yIFVLH3L9wnwkUKpOMhe485xynGdD/P2vfLv1kQ5l+r4PELrHvls9ooeFb32fLix60/ug== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by PAXP250MB0470.EURP250.PROD.OUTLOOK.COM (2603:10a6:102:283::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.23; Mon, 3 Oct 2022 22:45:11 +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.5676.023; Mon, 3 Oct 2022 22:45:11 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 4 Oct 2022 00:44:59 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [xkZJH+i9NGcqswaZwv7T2Xf0NDiSFEVVzNVyzqLqlA8=] X-ClientProxiedBy: ZR0P278CA0056.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:21::7) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <20221003224505.1846824-2-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|PAXP250MB0470:EE_ X-MS-Office365-Filtering-Correlation-Id: 0d1069d5-04b1-4cc3-04f8-08daa590edd7 X-MS-Exchange-SLBlob-MailProps: ZILSnhm0P3lA05FefvWS45JiO4vgSAs16MqCQq99TBZHNqt6FpMv3Prirw94xb6fp+Q4xdwlTXP8awJyo4+mIq+Hi1E3HpBLaeZfUBAKQCNnh69x7zAxW4vy/EyH5yLy9ywQBQ2RrfTrhMY56shgvYJxvO+UcSNoflDS+1b7ZAgbhtPE4fz1PyKeJcMrFLA0IOrtm4GaMqBUYtzZ517gm9kmSIRxE+wAdEnjsT9q5VPh4mePOQtBuVLYRi/2kG1B8O6BKGwyQBHJurQ1/h0nVtLnKQ+O+26P//QmbmjYnh6I4s5T9Y4btxGMLLkuY8JiB9QLAPr531OmS9Rb72wfcvs/usBI47xltd/lhTDveJ7oJS3uvT+TuCUreAB6/QgYHNfLkX1OjMrUGYENnZfN3jG6beoS6AKJA3Bt6oKPPIhDYYFvwjHB16TEUKGaAHhLPX919sp1ykGIahiYQECAcLbOVBlm2ZpZzonUN1MXjx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Ev+5OuB8DsxVmjaky/DXvaCV0fU+tNonbGR+u0hjP35cbiUhhekwMr5SBfbB1pQAhYtg8An9mLq3FxTIy1E1P4Dqd7p1puqAWo5c6H0OaXgYV0ICnqrZYt7KHNyW8z3M95QT76Poakry0l8yEEF1rVqc09bWT5FiDk+flayS3BLr0gYbSmCOblvBVco0XObFZ1yAjYqTX2WFcyMte0gzU1XdPUcbjtQnTLMvJ5LAuygFhkFMvdgbqZJFaqVfi1BZbWQOYGe3sQYc9bXS68OoVYUbY= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0d1069d5-04b1-4cc3-04f8-08daa590edd7 X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2022 22:45:11.2385 (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: PAXP250MB0470 Subject: [FFmpeg-devel] [PATCH 3/9] avcodec/opus: Move OpusStreamContext to its only user 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: E6slmbQ6jncb Namely opusdec.c. Signed-off-by: Andreas Rheinhardt --- libavcodec/opus.h | 52 +------------------------------------------- libavcodec/opusdec.c | 47 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 51 deletions(-) diff --git a/libavcodec/opus.h b/libavcodec/opus.h index b73949a811..264128f09e 100644 --- a/libavcodec/opus.h +++ b/libavcodec/opus.h @@ -25,12 +25,7 @@ #include -#include "libavutil/audio_fifo.h" #include "libavutil/float_dsp.h" -#include "libavutil/frame.h" -#include "libavutil/mem_internal.h" - -#include "libswresample/swresample.h" #include "avcodec.h" #include "opus_rc.h" @@ -98,51 +93,6 @@ typedef struct OpusPacket { enum OpusBandwidth bandwidth; /**< bandwidth */ } OpusPacket; -typedef struct OpusStreamContext { - AVCodecContext *avctx; - int output_channels; - - /* number of decoded samples for this stream */ - int decoded_samples; - /* current output buffers for this stream */ - float *out[2]; - int out_size; - /* Buffer with samples from this stream for synchronizing - * the streams when they have different resampling delays */ - AVAudioFifo *sync_buffer; - - OpusRangeCoder rc; - OpusRangeCoder redundancy_rc; - SilkContext *silk; - CeltFrame *celt; - AVFloatDSPContext *fdsp; - - float silk_buf[2][960]; - float *silk_output[2]; - DECLARE_ALIGNED(32, float, celt_buf)[2][960]; - float *celt_output[2]; - - DECLARE_ALIGNED(32, float, redundancy_buf)[2][960]; - float *redundancy_output[2]; - - /* buffers for the next samples to be decoded */ - float *cur_out[2]; - int remaining_out_size; - - float *out_dummy; - int out_dummy_allocated_size; - - SwrContext *swr; - AVAudioFifo *celt_delay; - int silk_samplerate; - /* number of samples we still want to get from the resampler */ - int delayed_samples; - - OpusPacket packet; - - int redundancy_idx; -} OpusStreamContext; - // a mapping between an opus stream and an output channel typedef struct ChannelMap { int stream_idx; @@ -161,7 +111,7 @@ typedef struct ChannelMap { typedef struct OpusContext { AVClass *av_class; - OpusStreamContext *streams; + struct OpusStreamContext *streams; int apply_phase_inv; int nb_streams; diff --git a/libavcodec/opusdec.c b/libavcodec/opusdec.c index d255486d06..87a86b6b47 100644 --- a/libavcodec/opusdec.c +++ b/libavcodec/opusdec.c @@ -38,6 +38,8 @@ #include "libavutil/attributes.h" #include "libavutil/audio_fifo.h" #include "libavutil/channel_layout.h" +#include "libavutil/frame.h" +#include "libavutil/mem_internal.h" #include "libavutil/opt.h" #include "libswresample/swresample.h" @@ -63,6 +65,51 @@ static const int silk_resample_delay[] = { 4, 8, 11, 11, 11 }; +typedef struct OpusStreamContext { + AVCodecContext *avctx; + int output_channels; + + /* number of decoded samples for this stream */ + int decoded_samples; + /* current output buffers for this stream */ + float *out[2]; + int out_size; + /* Buffer with samples from this stream for synchronizing + * the streams when they have different resampling delays */ + AVAudioFifo *sync_buffer; + + OpusRangeCoder rc; + OpusRangeCoder redundancy_rc; + SilkContext *silk; + CeltFrame *celt; + AVFloatDSPContext *fdsp; + + float silk_buf[2][960]; + float *silk_output[2]; + DECLARE_ALIGNED(32, float, celt_buf)[2][960]; + float *celt_output[2]; + + DECLARE_ALIGNED(32, float, redundancy_buf)[2][960]; + float *redundancy_output[2]; + + /* buffers for the next samples to be decoded */ + float *cur_out[2]; + int remaining_out_size; + + float *out_dummy; + int out_dummy_allocated_size; + + SwrContext *swr; + AVAudioFifo *celt_delay; + int silk_samplerate; + /* number of samples we still want to get from the resampler */ + int delayed_samples; + + OpusPacket packet; + + int redundancy_idx; +} OpusStreamContext; + static int get_silk_samplerate(int config) { if (config < 4) From patchwork Mon Oct 3 22:45:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 38545 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp1575599pzh; Mon, 3 Oct 2022 15:46:36 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7SSjZdx8khOROlEb896uGi9v0eVzGvrWXuALg5fND66XJEdycMEoZHsSpcOOPe4RyK3fYD X-Received: by 2002:a17:907:75dc:b0:783:9c71:5e20 with SMTP id jl28-20020a17090775dc00b007839c715e20mr17007162ejc.125.1664837195874; Mon, 03 Oct 2022 15:46:35 -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 qw40-20020a1709066a2800b0078bdc4ee034si3496262ejc.701.2022.10.03.15.46.35; Mon, 03 Oct 2022 15:46:35 -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=MMptekdD; 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 528B168B61C; Tue, 4 Oct 2022 01:46:33 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03olkn2083.outbound.protection.outlook.com [40.92.58.83]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5317C68B61C for ; Tue, 4 Oct 2022 01:46:27 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mFGLV33nVaR5roEUYggYZpRA0eU2GBaklTYz8JE/yJS0vH1lr4DT6v2GnxDHUgKIoUCDHIDEET+5UobkH80aRL71T0zpMYIgtE5kr3NrOqMIGvnxzlAU2cKxX3WtvtJckLakhQqSv+EtJloSDxy1ymT+gqCroHbfqExovNdGDiRRYPvYoyczlJU9/KTpgaH6SGNM1OlnyVQYNpStLC8i0U//a2kBl80AcETU9q/IPP9h0NKyuV1WSYMiKszd1DIkaxFpXKUHOUzx2/bsxXDZpR1krAS5DChdcL/jeQdd479+2KjF2i/gg5/Vci8CKB+tx5HzNwJEzfQDPOrjOVDvIg== 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=eRScGwHQT1eIYeD6GuQRAirwO2IyJlNSNK0xo0ZnfAk=; b=KNltQqp+Mvtz+Q/bmTbeGRBvKL3coGvw/3T0eHf96vJIAtCUg1ZKsL0+SYENBofyuxReRrjZmmWx/XIGVt6I5o2+9qSjX6JIy+JY0OSXepdtg+HAVfu/PDd5+CTMNuuylL9BOPENc1jxeghgiy6gpPEb9DFrTV3yNlU5J9aqLtEib2brNCBEtwlXHqCgAeXX29U13VsS9IofxgAE0lEHlnZUlm+CDA5VggFGzVz9sk14hl7v9B9abl3LEi42iZItvVy3f82aLGr8El1XhAvFfWtzJabSGAefvOFUK/GchMfVn2G339LwHUai5XSTaKUV6JAjKpnqQbFXLN781yV4Ug== 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=eRScGwHQT1eIYeD6GuQRAirwO2IyJlNSNK0xo0ZnfAk=; b=MMptekdD+0/9cdsfJKGXovYcU5Q0pcu/M5bgDQSJ4TOpBaJspVo4MgQb6hTXO6+BWtT3wh1V7OYlV4j4KBZK70FvdTebyHczx+FQ5RwRQ0NE7vkedl+SllkkDYYcGgzRh1nouA6IjOLYu2OYzkuea7utfPbfhG1MULeQzb2oQc0CP8CEZuAtQu17FRR9Kq+j1XSQWT8NK9oQ6pKZ35NcP/EUUArO56OAvFX6cHIKX9xUIugzdCIrqt95/qdXye0S3hoYoKEBE3DYYSyZeI0t9eEuxpH8JpmDXFunvHyxQlmt7RTEKI8PrDqNJxFypPjon6Yc+OUG55kkfFSSuEt3mA== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by PAXP250MB0470.EURP250.PROD.OUTLOOK.COM (2603:10a6:102:283::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.23; Mon, 3 Oct 2022 22:46:25 +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.5676.023; Mon, 3 Oct 2022 22:46:25 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 4 Oct 2022 00:45:00 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [hlyRQAOBqc70Wgchg2x5KmyQfDUjDpZTmy0rV0PUpV8=] X-ClientProxiedBy: ZR0P278CA0056.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:21::7) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <20221003224505.1846824-3-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|PAXP250MB0470:EE_ X-MS-Office365-Filtering-Correlation-Id: ef0414c4-7b42-4683-9d12-08daa59119c0 X-MS-Exchange-SLBlob-MailProps: EgT5Wr3QDKyycDCnlURLUH4o9GEGbtto7uzK3cPCVLVelpng+9wKtmGAco8qePmhNjSMEd7UWyxzPzPmfoaIYBD28xLRPspeoGa/njsUPmMwzzZwGkjqQJl5pfAOhsIOJaD2S9yXeN6SgbOgObPaMRAcG7MUjyTAMORqfQCmWoevakD01tNQxYb822QgIQVJ0LZP1mDD3IpSXNuawQ23tr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j0DCbl7Cu+LQhO1gQjuGPYMx0uRTy91K8zx7tpGEIRhk+Y0sBPOTQqaluwng7AZLiLomOAjtQLjE6lPMyFwN4pMznqB78ubxyOwwriWWVrp5bWSkhZYQaCCxrm88sFBaoywDywqn+XEb8+Yp6UkrFI65kB+IJOeDmNprCpgA0KiAyx/b+7FTR2E9pmFXzDTFA9vAtzYCrFIx6ajPXvqVaSC57mZ0B469CXdlZYRonAGA3d9XBXEDdvbkAk0lSlYDwngsvRoZLX5o2oyMpKj+ma5oZcYx5vPZTRAmc7n60uMDGC0nV7cSyWJRDaYGs3R+3Mjy2RgF4EKDOvoWeBrmFV3PzNdaEGm5M2FsjOyJ5hdnrV/CsNUmVjIS7stRGs+TomVilm2XqEbCJnpwBVQSX847AYoiOl/7I5OsNOPp7g4cMUqruJMHEbI3kX1E3j/vXiaSD/mzx1Df2et2S0zyElW03N5O5D6kbDAm8HHGZhdesyiemQPGTYPaARVg= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: ef0414c4-7b42-4683-9d12-08daa59119c0 X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2022 22:46:24.9897 (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: PAXP250MB0470 Subject: [FFmpeg-devel] [PATCH 4/9] avcodec/opus: Move stuff shared by decoder and parser to a new file 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: UPJ6e99K6nj8 opus.h (which is used by all the Opus code) currently includes several structures only used by the parser and the decoder; several elements of OpusContext are even only used by the decoder. This commit therefore moves the part of OpusContext that is shared between these two components (and used by ff_opus_parse_extradata()) out into a new structure and moves all the other accompanying structures and functions to a new header, opus_parse.h; the functions itself are also moved to a new file, opus_parse.c. (This also allows to remove several spurious dependencies of the Opus parser and encoder.) Signed-off-by: Andreas Rheinhardt --- libavcodec/Makefile | 8 +- libavcodec/opus.c | 442 ------------------------------------ libavcodec/opus.h | 54 ----- libavcodec/opus_parse.c | 469 +++++++++++++++++++++++++++++++++++++++ libavcodec/opus_parse.h | 77 +++++++ libavcodec/opus_parser.c | 13 +- libavcodec/opusdec.c | 59 +++-- 7 files changed, 594 insertions(+), 528 deletions(-) create mode 100644 libavcodec/opus_parse.c create mode 100644 libavcodec/opus_parse.h diff --git a/libavcodec/Makefile b/libavcodec/Makefile index 1946930c20..10a9c47ea3 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -556,9 +556,9 @@ OBJS-$(CONFIG_NUV_DECODER) += nuv.o rtjpeg.o OBJS-$(CONFIG_ON2AVC_DECODER) += on2avc.o on2avcdata.o OBJS-$(CONFIG_OPUS_DECODER) += opusdec.o opus.o opus_celt.o opus_rc.o \ opus_pvq.o opus_silk.o opustab.o vorbis_data.o \ - opusdsp.o + opusdsp.o opus_parse.o OBJS-$(CONFIG_OPUS_ENCODER) += opusenc.o opus.o opus_rc.o opustab.o opus_pvq.o \ - opusenc_psy.o vorbis_data.o + opusenc_psy.o OBJS-$(CONFIG_PAF_AUDIO_DECODER) += pafaudio.o OBJS-$(CONFIG_PAF_VIDEO_DECODER) += pafvideo.o OBJS-$(CONFIG_PAM_DECODER) += pnmdec.o pnm.o @@ -1156,8 +1156,8 @@ OBJS-$(CONFIG_MPEG4VIDEO_PARSER) += mpeg4video_parser.o h263.o \ OBJS-$(CONFIG_MPEGAUDIO_PARSER) += mpegaudio_parser.o OBJS-$(CONFIG_MPEGVIDEO_PARSER) += mpegvideo_parser.o \ mpeg12.o mpeg12data.o -OBJS-$(CONFIG_OPUS_PARSER) += opus_parser.o opus.o opustab.o \ - opus_rc.o vorbis_data.o +OBJS-$(CONFIG_OPUS_PARSER) += opus_parser.o opus_parse.o \ + vorbis_data.o OBJS-$(CONFIG_PNG_PARSER) += png_parser.o OBJS-$(CONFIG_PNM_PARSER) += pnm_parser.o pnm.o OBJS-$(CONFIG_QOI_PARSER) += qoi_parser.o diff --git a/libavcodec/opus.c b/libavcodec/opus.c index b91f57dec3..791e25c488 100644 --- a/libavcodec/opus.c +++ b/libavcodec/opus.c @@ -19,452 +19,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -/** - * @file - * Opus decoder/parser shared code - */ - #include -#include "libavutil/channel_layout.h" -#include "libavutil/error.h" -#include "libavutil/ffmath.h" - #include "opus_celt.h" #include "opustab.h" -#include "internal.h" -#include "vorbis_data.h" - -static const uint16_t opus_frame_duration[32] = { - 480, 960, 1920, 2880, - 480, 960, 1920, 2880, - 480, 960, 1920, 2880, - 480, 960, - 480, 960, - 120, 240, 480, 960, - 120, 240, 480, 960, - 120, 240, 480, 960, - 120, 240, 480, 960, -}; - -/** - * Read a 1- or 2-byte frame length - */ -static inline int xiph_lacing_16bit(const uint8_t **ptr, const uint8_t *end) -{ - int val; - - if (*ptr >= end) - return AVERROR_INVALIDDATA; - val = *(*ptr)++; - if (val >= 252) { - if (*ptr >= end) - return AVERROR_INVALIDDATA; - val += 4 * *(*ptr)++; - } - return val; -} - -/** - * Read a multi-byte length (used for code 3 packet padding size) - */ -static inline int xiph_lacing_full(const uint8_t **ptr, const uint8_t *end) -{ - int val = 0; - int next; - - while (1) { - if (*ptr >= end || val > INT_MAX - 254) - return AVERROR_INVALIDDATA; - next = *(*ptr)++; - val += next; - if (next < 255) - break; - else - val--; - } - return val; -} - -/** - * Parse Opus packet info from raw packet data - */ -int ff_opus_parse_packet(OpusPacket *pkt, const uint8_t *buf, int buf_size, - int self_delimiting) -{ - const uint8_t *ptr = buf; - const uint8_t *end = buf + buf_size; - int padding = 0; - int frame_bytes, i; - - if (buf_size < 1) - goto fail; - - /* TOC byte */ - i = *ptr++; - pkt->code = (i ) & 0x3; - pkt->stereo = (i >> 2) & 0x1; - pkt->config = (i >> 3) & 0x1F; - - /* code 2 and code 3 packets have at least 1 byte after the TOC */ - if (pkt->code >= 2 && buf_size < 2) - goto fail; - - switch (pkt->code) { - case 0: - /* 1 frame */ - pkt->frame_count = 1; - pkt->vbr = 0; - - if (self_delimiting) { - int len = xiph_lacing_16bit(&ptr, end); - if (len < 0 || len > end - ptr) - goto fail; - end = ptr + len; - buf_size = end - buf; - } - - frame_bytes = end - ptr; - if (frame_bytes > MAX_FRAME_SIZE) - goto fail; - pkt->frame_offset[0] = ptr - buf; - pkt->frame_size[0] = frame_bytes; - break; - case 1: - /* 2 frames, equal size */ - pkt->frame_count = 2; - pkt->vbr = 0; - - if (self_delimiting) { - int len = xiph_lacing_16bit(&ptr, end); - if (len < 0 || 2 * len > end - ptr) - goto fail; - end = ptr + 2 * len; - buf_size = end - buf; - } - - frame_bytes = end - ptr; - if (frame_bytes & 1 || frame_bytes >> 1 > MAX_FRAME_SIZE) - goto fail; - pkt->frame_offset[0] = ptr - buf; - pkt->frame_size[0] = frame_bytes >> 1; - pkt->frame_offset[1] = pkt->frame_offset[0] + pkt->frame_size[0]; - pkt->frame_size[1] = frame_bytes >> 1; - break; - case 2: - /* 2 frames, different sizes */ - pkt->frame_count = 2; - pkt->vbr = 1; - - /* read 1st frame size */ - frame_bytes = xiph_lacing_16bit(&ptr, end); - if (frame_bytes < 0) - goto fail; - - if (self_delimiting) { - int len = xiph_lacing_16bit(&ptr, end); - if (len < 0 || len + frame_bytes > end - ptr) - goto fail; - end = ptr + frame_bytes + len; - buf_size = end - buf; - } - - pkt->frame_offset[0] = ptr - buf; - pkt->frame_size[0] = frame_bytes; - - /* calculate 2nd frame size */ - frame_bytes = end - ptr - pkt->frame_size[0]; - if (frame_bytes < 0 || frame_bytes > MAX_FRAME_SIZE) - goto fail; - pkt->frame_offset[1] = pkt->frame_offset[0] + pkt->frame_size[0]; - pkt->frame_size[1] = frame_bytes; - break; - case 3: - /* 1 to 48 frames, can be different sizes */ - i = *ptr++; - pkt->frame_count = (i ) & 0x3F; - padding = (i >> 6) & 0x01; - pkt->vbr = (i >> 7) & 0x01; - - if (pkt->frame_count == 0 || pkt->frame_count > MAX_FRAMES) - goto fail; - - /* read padding size */ - if (padding) { - padding = xiph_lacing_full(&ptr, end); - if (padding < 0) - goto fail; - } - - /* read frame sizes */ - if (pkt->vbr) { - /* for VBR, all frames except the final one have their size coded - in the bitstream. the last frame size is implicit. */ - int total_bytes = 0; - for (i = 0; i < pkt->frame_count - 1; i++) { - frame_bytes = xiph_lacing_16bit(&ptr, end); - if (frame_bytes < 0) - goto fail; - pkt->frame_size[i] = frame_bytes; - total_bytes += frame_bytes; - } - - if (self_delimiting) { - int len = xiph_lacing_16bit(&ptr, end); - if (len < 0 || len + total_bytes + padding > end - ptr) - goto fail; - end = ptr + total_bytes + len + padding; - buf_size = end - buf; - } - - frame_bytes = end - ptr - padding; - if (total_bytes > frame_bytes) - goto fail; - pkt->frame_offset[0] = ptr - buf; - for (i = 1; i < pkt->frame_count; i++) - pkt->frame_offset[i] = pkt->frame_offset[i-1] + pkt->frame_size[i-1]; - pkt->frame_size[pkt->frame_count-1] = frame_bytes - total_bytes; - } else { - /* for CBR, the remaining packet bytes are divided evenly between - the frames */ - if (self_delimiting) { - frame_bytes = xiph_lacing_16bit(&ptr, end); - if (frame_bytes < 0 || pkt->frame_count * frame_bytes + padding > end - ptr) - goto fail; - end = ptr + pkt->frame_count * frame_bytes + padding; - buf_size = end - buf; - } else { - frame_bytes = end - ptr - padding; - if (frame_bytes % pkt->frame_count || - frame_bytes / pkt->frame_count > MAX_FRAME_SIZE) - goto fail; - frame_bytes /= pkt->frame_count; - } - - pkt->frame_offset[0] = ptr - buf; - pkt->frame_size[0] = frame_bytes; - for (i = 1; i < pkt->frame_count; i++) { - pkt->frame_offset[i] = pkt->frame_offset[i-1] + pkt->frame_size[i-1]; - pkt->frame_size[i] = frame_bytes; - } - } - } - - pkt->packet_size = buf_size; - pkt->data_size = pkt->packet_size - padding; - - /* total packet duration cannot be larger than 120ms */ - pkt->frame_duration = opus_frame_duration[pkt->config]; - if (pkt->frame_duration * pkt->frame_count > MAX_PACKET_DUR) - goto fail; - - /* set mode and bandwidth */ - if (pkt->config < 12) { - pkt->mode = OPUS_MODE_SILK; - pkt->bandwidth = pkt->config >> 2; - } else if (pkt->config < 16) { - pkt->mode = OPUS_MODE_HYBRID; - pkt->bandwidth = OPUS_BANDWIDTH_SUPERWIDEBAND + (pkt->config >= 14); - } else { - pkt->mode = OPUS_MODE_CELT; - pkt->bandwidth = (pkt->config - 16) >> 2; - /* skip medium band */ - if (pkt->bandwidth) - pkt->bandwidth++; - } - - return 0; - -fail: - memset(pkt, 0, sizeof(*pkt)); - return AVERROR_INVALIDDATA; -} - -static int channel_reorder_vorbis(int nb_channels, int channel_idx) -{ - return ff_vorbis_channel_layout_offsets[nb_channels - 1][channel_idx]; -} - -static int channel_reorder_unknown(int nb_channels, int channel_idx) -{ - return channel_idx; -} - -av_cold int ff_opus_parse_extradata(AVCodecContext *avctx, - OpusContext *s) -{ - static const uint8_t default_channel_map[2] = { 0, 1 }; - - int (*channel_reorder)(int, int) = channel_reorder_unknown; - int channels = avctx->ch_layout.nb_channels; - - const uint8_t *extradata, *channel_map; - int extradata_size; - int version, map_type, streams, stereo_streams, i, j, ret; - AVChannelLayout layout = { 0 }; - - if (!avctx->extradata) { - if (channels > 2) { - av_log(avctx, AV_LOG_ERROR, - "Multichannel configuration without extradata.\n"); - return AVERROR(EINVAL); - } - extradata = opus_default_extradata; - extradata_size = sizeof(opus_default_extradata); - } else { - extradata = avctx->extradata; - extradata_size = avctx->extradata_size; - } - - if (extradata_size < 19) { - av_log(avctx, AV_LOG_ERROR, "Invalid extradata size: %d\n", - extradata_size); - return AVERROR_INVALIDDATA; - } - - version = extradata[8]; - if (version > 15) { - avpriv_request_sample(avctx, "Extradata version %d", version); - return AVERROR_PATCHWELCOME; - } - - avctx->delay = AV_RL16(extradata + 10); - if (avctx->internal) - avctx->internal->skip_samples = avctx->delay; - - channels = avctx->extradata ? extradata[9] : (channels == 1) ? 1 : 2; - if (!channels) { - av_log(avctx, AV_LOG_ERROR, "Zero channel count specified in the extradata\n"); - return AVERROR_INVALIDDATA; - } - - s->gain_i = AV_RL16(extradata + 16); - if (s->gain_i) - s->gain = ff_exp10(s->gain_i / (20.0 * 256)); - - map_type = extradata[18]; - if (!map_type) { - if (channels > 2) { - av_log(avctx, AV_LOG_ERROR, - "Channel mapping 0 is only specified for up to 2 channels\n"); - ret = AVERROR_INVALIDDATA; - goto fail; - } - layout = (channels == 1) ? (AVChannelLayout)AV_CHANNEL_LAYOUT_MONO : - (AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO; - streams = 1; - stereo_streams = channels - 1; - channel_map = default_channel_map; - } else if (map_type == 1 || map_type == 2 || map_type == 255) { - if (extradata_size < 21 + channels) { - av_log(avctx, AV_LOG_ERROR, "Invalid extradata size: %d\n", - extradata_size); - ret = AVERROR_INVALIDDATA; - goto fail; - } - - streams = extradata[19]; - stereo_streams = extradata[20]; - if (!streams || stereo_streams > streams || - streams + stereo_streams > 255) { - av_log(avctx, AV_LOG_ERROR, - "Invalid stream/stereo stream count: %d/%d\n", streams, stereo_streams); - ret = AVERROR_INVALIDDATA; - goto fail; - } - - if (map_type == 1) { - if (channels > 8) { - av_log(avctx, AV_LOG_ERROR, - "Channel mapping 1 is only specified for up to 8 channels\n"); - ret = AVERROR_INVALIDDATA; - goto fail; - } - av_channel_layout_copy(&layout, &ff_vorbis_ch_layouts[channels - 1]); - channel_reorder = channel_reorder_vorbis; - } else if (map_type == 2) { - int ambisonic_order = ff_sqrt(channels) - 1; - if (channels != ((ambisonic_order + 1) * (ambisonic_order + 1)) && - channels != ((ambisonic_order + 1) * (ambisonic_order + 1) + 2)) { - av_log(avctx, AV_LOG_ERROR, - "Channel mapping 2 is only specified for channel counts" - " which can be written as (n + 1)^2 or (n + 1)^2 + 2" - " for nonnegative integer n\n"); - ret = AVERROR_INVALIDDATA; - goto fail; - } - if (channels > 227) { - av_log(avctx, AV_LOG_ERROR, "Too many channels\n"); - ret = AVERROR_INVALIDDATA; - goto fail; - } - - layout.order = AV_CHANNEL_ORDER_AMBISONIC; - layout.nb_channels = channels; - if (channels != ((ambisonic_order + 1) * (ambisonic_order + 1))) - layout.u.mask = AV_CH_LAYOUT_STEREO; - } else { - layout.order = AV_CHANNEL_ORDER_UNSPEC; - layout.nb_channels = channels; - } - - channel_map = extradata + 21; - } else { - avpriv_request_sample(avctx, "Mapping type %d", map_type); - return AVERROR_PATCHWELCOME; - } - - s->channel_maps = av_calloc(channels, sizeof(*s->channel_maps)); - if (!s->channel_maps) { - ret = AVERROR(ENOMEM); - goto fail; - } - - for (i = 0; i < channels; i++) { - ChannelMap *map = &s->channel_maps[i]; - uint8_t idx = channel_map[channel_reorder(channels, i)]; - - if (idx == 255) { - map->silence = 1; - continue; - } else if (idx >= streams + stereo_streams) { - av_log(avctx, AV_LOG_ERROR, - "Invalid channel map for output channel %d: %d\n", i, idx); - av_freep(&s->channel_maps); - ret = AVERROR_INVALIDDATA; - goto fail; - } - - /* check that we did not see this index yet */ - map->copy = 0; - for (j = 0; j < i; j++) - if (channel_map[channel_reorder(channels, j)] == idx) { - map->copy = 1; - map->copy_idx = j; - break; - } - - if (idx < 2 * stereo_streams) { - map->stream_idx = idx / 2; - map->channel_idx = idx & 1; - } else { - map->stream_idx = idx - stereo_streams; - map->channel_idx = 0; - } - } - - ret = av_channel_layout_copy(&avctx->ch_layout, &layout); - if (ret < 0) - goto fail; - - s->nb_streams = streams; - s->nb_stereo_streams = stereo_streams; - - return 0; -fail: - av_channel_layout_uninit(&layout); - return ret; -} void ff_celt_quant_bands(CeltFrame *f, OpusRangeCoder *rc) { diff --git a/libavcodec/opus.h b/libavcodec/opus.h index 264128f09e..c88bb89dde 100644 --- a/libavcodec/opus.h +++ b/libavcodec/opus.h @@ -25,8 +25,6 @@ #include -#include "libavutil/float_dsp.h" - #include "avcodec.h" #include "opus_rc.h" @@ -77,58 +75,6 @@ typedef struct SilkContext SilkContext; typedef struct CeltFrame CeltFrame; -typedef struct OpusPacket { - int packet_size; /**< packet size */ - int data_size; /**< size of the useful data -- packet size - padding */ - int code; /**< packet code: specifies the frame layout */ - int stereo; /**< whether this packet is mono or stereo */ - int vbr; /**< vbr flag */ - int config; /**< configuration: tells the audio mode, - ** bandwidth, and frame duration */ - int frame_count; /**< frame count */ - int frame_offset[MAX_FRAMES]; /**< frame offsets */ - int frame_size[MAX_FRAMES]; /**< frame sizes */ - int frame_duration; /**< frame duration, in samples @ 48kHz */ - enum OpusMode mode; /**< mode */ - enum OpusBandwidth bandwidth; /**< bandwidth */ -} OpusPacket; - -// a mapping between an opus stream and an output channel -typedef struct ChannelMap { - int stream_idx; - int channel_idx; - - // when a single decoded channel is mapped to multiple output channels, we - // write to the first output directly and copy from it to the others - // this field is set to 1 for those copied output channels - int copy; - // this is the index of the output channel to copy from - int copy_idx; - - // this channel is silent - int silence; -} ChannelMap; - -typedef struct OpusContext { - AVClass *av_class; - struct OpusStreamContext *streams; - int apply_phase_inv; - - int nb_streams; - int nb_stereo_streams; - - AVFloatDSPContext *fdsp; - int16_t gain_i; - float gain; - - ChannelMap *channel_maps; -} OpusContext; - -int ff_opus_parse_packet(OpusPacket *pkt, const uint8_t *buf, int buf_size, - int self_delimited); - -int ff_opus_parse_extradata(AVCodecContext *avctx, OpusContext *s); - int ff_silk_init(AVCodecContext *avctx, SilkContext **ps, int output_channels); void ff_silk_free(SilkContext **ps); void ff_silk_flush(SilkContext *s); diff --git a/libavcodec/opus_parse.c b/libavcodec/opus_parse.c new file mode 100644 index 0000000000..39765c5b79 --- /dev/null +++ b/libavcodec/opus_parse.c @@ -0,0 +1,469 @@ +/* + * Copyright (c) 2012 Andrew D'Addesio + * Copyright (c) 2013-2014 Mozilla Corporation + * + * 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 + * Opus decoder/parser shared code + */ + +#include "libavutil/attributes.h" +#include "libavutil/channel_layout.h" +#include "libavutil/error.h" +#include "libavutil/intreadwrite.h" +#include "libavutil/log.h" +#include "libavutil/mem.h" + +#include "avcodec.h" +#include "internal.h" +#include "mathops.h" +#include "opus.h" +#include "opus_parse.h" +#include "vorbis_data.h" + +static const uint16_t opus_frame_duration[32] = { + 480, 960, 1920, 2880, + 480, 960, 1920, 2880, + 480, 960, 1920, 2880, + 480, 960, + 480, 960, + 120, 240, 480, 960, + 120, 240, 480, 960, + 120, 240, 480, 960, + 120, 240, 480, 960, +}; + +/** + * Read a 1- or 2-byte frame length + */ +static inline int xiph_lacing_16bit(const uint8_t **ptr, const uint8_t *end) +{ + int val; + + if (*ptr >= end) + return AVERROR_INVALIDDATA; + val = *(*ptr)++; + if (val >= 252) { + if (*ptr >= end) + return AVERROR_INVALIDDATA; + val += 4 * *(*ptr)++; + } + return val; +} + +/** + * Read a multi-byte length (used for code 3 packet padding size) + */ +static inline int xiph_lacing_full(const uint8_t **ptr, const uint8_t *end) +{ + int val = 0; + int next; + + while (1) { + if (*ptr >= end || val > INT_MAX - 254) + return AVERROR_INVALIDDATA; + next = *(*ptr)++; + val += next; + if (next < 255) + break; + else + val--; + } + return val; +} + +/** + * Parse Opus packet info from raw packet data + */ +int ff_opus_parse_packet(OpusPacket *pkt, const uint8_t *buf, int buf_size, + int self_delimiting) +{ + const uint8_t *ptr = buf; + const uint8_t *end = buf + buf_size; + int padding = 0; + int frame_bytes, i; + + if (buf_size < 1) + goto fail; + + /* TOC byte */ + i = *ptr++; + pkt->code = (i ) & 0x3; + pkt->stereo = (i >> 2) & 0x1; + pkt->config = (i >> 3) & 0x1F; + + /* code 2 and code 3 packets have at least 1 byte after the TOC */ + if (pkt->code >= 2 && buf_size < 2) + goto fail; + + switch (pkt->code) { + case 0: + /* 1 frame */ + pkt->frame_count = 1; + pkt->vbr = 0; + + if (self_delimiting) { + int len = xiph_lacing_16bit(&ptr, end); + if (len < 0 || len > end - ptr) + goto fail; + end = ptr + len; + buf_size = end - buf; + } + + frame_bytes = end - ptr; + if (frame_bytes > MAX_FRAME_SIZE) + goto fail; + pkt->frame_offset[0] = ptr - buf; + pkt->frame_size[0] = frame_bytes; + break; + case 1: + /* 2 frames, equal size */ + pkt->frame_count = 2; + pkt->vbr = 0; + + if (self_delimiting) { + int len = xiph_lacing_16bit(&ptr, end); + if (len < 0 || 2 * len > end - ptr) + goto fail; + end = ptr + 2 * len; + buf_size = end - buf; + } + + frame_bytes = end - ptr; + if (frame_bytes & 1 || frame_bytes >> 1 > MAX_FRAME_SIZE) + goto fail; + pkt->frame_offset[0] = ptr - buf; + pkt->frame_size[0] = frame_bytes >> 1; + pkt->frame_offset[1] = pkt->frame_offset[0] + pkt->frame_size[0]; + pkt->frame_size[1] = frame_bytes >> 1; + break; + case 2: + /* 2 frames, different sizes */ + pkt->frame_count = 2; + pkt->vbr = 1; + + /* read 1st frame size */ + frame_bytes = xiph_lacing_16bit(&ptr, end); + if (frame_bytes < 0) + goto fail; + + if (self_delimiting) { + int len = xiph_lacing_16bit(&ptr, end); + if (len < 0 || len + frame_bytes > end - ptr) + goto fail; + end = ptr + frame_bytes + len; + buf_size = end - buf; + } + + pkt->frame_offset[0] = ptr - buf; + pkt->frame_size[0] = frame_bytes; + + /* calculate 2nd frame size */ + frame_bytes = end - ptr - pkt->frame_size[0]; + if (frame_bytes < 0 || frame_bytes > MAX_FRAME_SIZE) + goto fail; + pkt->frame_offset[1] = pkt->frame_offset[0] + pkt->frame_size[0]; + pkt->frame_size[1] = frame_bytes; + break; + case 3: + /* 1 to 48 frames, can be different sizes */ + i = *ptr++; + pkt->frame_count = (i ) & 0x3F; + padding = (i >> 6) & 0x01; + pkt->vbr = (i >> 7) & 0x01; + + if (pkt->frame_count == 0 || pkt->frame_count > MAX_FRAMES) + goto fail; + + /* read padding size */ + if (padding) { + padding = xiph_lacing_full(&ptr, end); + if (padding < 0) + goto fail; + } + + /* read frame sizes */ + if (pkt->vbr) { + /* for VBR, all frames except the final one have their size coded + in the bitstream. the last frame size is implicit. */ + int total_bytes = 0; + for (i = 0; i < pkt->frame_count - 1; i++) { + frame_bytes = xiph_lacing_16bit(&ptr, end); + if (frame_bytes < 0) + goto fail; + pkt->frame_size[i] = frame_bytes; + total_bytes += frame_bytes; + } + + if (self_delimiting) { + int len = xiph_lacing_16bit(&ptr, end); + if (len < 0 || len + total_bytes + padding > end - ptr) + goto fail; + end = ptr + total_bytes + len + padding; + buf_size = end - buf; + } + + frame_bytes = end - ptr - padding; + if (total_bytes > frame_bytes) + goto fail; + pkt->frame_offset[0] = ptr - buf; + for (i = 1; i < pkt->frame_count; i++) + pkt->frame_offset[i] = pkt->frame_offset[i-1] + pkt->frame_size[i-1]; + pkt->frame_size[pkt->frame_count-1] = frame_bytes - total_bytes; + } else { + /* for CBR, the remaining packet bytes are divided evenly between + the frames */ + if (self_delimiting) { + frame_bytes = xiph_lacing_16bit(&ptr, end); + if (frame_bytes < 0 || pkt->frame_count * frame_bytes + padding > end - ptr) + goto fail; + end = ptr + pkt->frame_count * frame_bytes + padding; + buf_size = end - buf; + } else { + frame_bytes = end - ptr - padding; + if (frame_bytes % pkt->frame_count || + frame_bytes / pkt->frame_count > MAX_FRAME_SIZE) + goto fail; + frame_bytes /= pkt->frame_count; + } + + pkt->frame_offset[0] = ptr - buf; + pkt->frame_size[0] = frame_bytes; + for (i = 1; i < pkt->frame_count; i++) { + pkt->frame_offset[i] = pkt->frame_offset[i-1] + pkt->frame_size[i-1]; + pkt->frame_size[i] = frame_bytes; + } + } + } + + pkt->packet_size = buf_size; + pkt->data_size = pkt->packet_size - padding; + + /* total packet duration cannot be larger than 120ms */ + pkt->frame_duration = opus_frame_duration[pkt->config]; + if (pkt->frame_duration * pkt->frame_count > MAX_PACKET_DUR) + goto fail; + + /* set mode and bandwidth */ + if (pkt->config < 12) { + pkt->mode = OPUS_MODE_SILK; + pkt->bandwidth = pkt->config >> 2; + } else if (pkt->config < 16) { + pkt->mode = OPUS_MODE_HYBRID; + pkt->bandwidth = OPUS_BANDWIDTH_SUPERWIDEBAND + (pkt->config >= 14); + } else { + pkt->mode = OPUS_MODE_CELT; + pkt->bandwidth = (pkt->config - 16) >> 2; + /* skip medium band */ + if (pkt->bandwidth) + pkt->bandwidth++; + } + + return 0; + +fail: + memset(pkt, 0, sizeof(*pkt)); + return AVERROR_INVALIDDATA; +} + +static int channel_reorder_vorbis(int nb_channels, int channel_idx) +{ + return ff_vorbis_channel_layout_offsets[nb_channels - 1][channel_idx]; +} + +static int channel_reorder_unknown(int nb_channels, int channel_idx) +{ + return channel_idx; +} + +av_cold int ff_opus_parse_extradata(AVCodecContext *avctx, + OpusParseContext *s) +{ + static const uint8_t default_channel_map[2] = { 0, 1 }; + + int (*channel_reorder)(int, int) = channel_reorder_unknown; + int channels = avctx->ch_layout.nb_channels; + + const uint8_t *extradata, *channel_map; + int extradata_size; + int version, map_type, streams, stereo_streams, i, j, ret; + AVChannelLayout layout = { 0 }; + + if (!avctx->extradata) { + if (channels > 2) { + av_log(avctx, AV_LOG_ERROR, + "Multichannel configuration without extradata.\n"); + return AVERROR(EINVAL); + } + extradata = opus_default_extradata; + extradata_size = sizeof(opus_default_extradata); + } else { + extradata = avctx->extradata; + extradata_size = avctx->extradata_size; + } + + if (extradata_size < 19) { + av_log(avctx, AV_LOG_ERROR, "Invalid extradata size: %d\n", + extradata_size); + return AVERROR_INVALIDDATA; + } + + version = extradata[8]; + if (version > 15) { + avpriv_request_sample(avctx, "Extradata version %d", version); + return AVERROR_PATCHWELCOME; + } + + avctx->delay = AV_RL16(extradata + 10); + if (avctx->internal) + avctx->internal->skip_samples = avctx->delay; + + channels = avctx->extradata ? extradata[9] : (channels == 1) ? 1 : 2; + if (!channels) { + av_log(avctx, AV_LOG_ERROR, "Zero channel count specified in the extradata\n"); + return AVERROR_INVALIDDATA; + } + + s->gain_i = AV_RL16(extradata + 16); + + map_type = extradata[18]; + if (!map_type) { + if (channels > 2) { + av_log(avctx, AV_LOG_ERROR, + "Channel mapping 0 is only specified for up to 2 channels\n"); + ret = AVERROR_INVALIDDATA; + goto fail; + } + layout = (channels == 1) ? (AVChannelLayout)AV_CHANNEL_LAYOUT_MONO : + (AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO; + streams = 1; + stereo_streams = channels - 1; + channel_map = default_channel_map; + } else if (map_type == 1 || map_type == 2 || map_type == 255) { + if (extradata_size < 21 + channels) { + av_log(avctx, AV_LOG_ERROR, "Invalid extradata size: %d\n", + extradata_size); + ret = AVERROR_INVALIDDATA; + goto fail; + } + + streams = extradata[19]; + stereo_streams = extradata[20]; + if (!streams || stereo_streams > streams || + streams + stereo_streams > 255) { + av_log(avctx, AV_LOG_ERROR, + "Invalid stream/stereo stream count: %d/%d\n", streams, stereo_streams); + ret = AVERROR_INVALIDDATA; + goto fail; + } + + if (map_type == 1) { + if (channels > 8) { + av_log(avctx, AV_LOG_ERROR, + "Channel mapping 1 is only specified for up to 8 channels\n"); + ret = AVERROR_INVALIDDATA; + goto fail; + } + av_channel_layout_copy(&layout, &ff_vorbis_ch_layouts[channels - 1]); + channel_reorder = channel_reorder_vorbis; + } else if (map_type == 2) { + int ambisonic_order = ff_sqrt(channels) - 1; + if (channels != ((ambisonic_order + 1) * (ambisonic_order + 1)) && + channels != ((ambisonic_order + 1) * (ambisonic_order + 1) + 2)) { + av_log(avctx, AV_LOG_ERROR, + "Channel mapping 2 is only specified for channel counts" + " which can be written as (n + 1)^2 or (n + 1)^2 + 2" + " for nonnegative integer n\n"); + ret = AVERROR_INVALIDDATA; + goto fail; + } + if (channels > 227) { + av_log(avctx, AV_LOG_ERROR, "Too many channels\n"); + ret = AVERROR_INVALIDDATA; + goto fail; + } + + layout.order = AV_CHANNEL_ORDER_AMBISONIC; + layout.nb_channels = channels; + if (channels != ((ambisonic_order + 1) * (ambisonic_order + 1))) + layout.u.mask = AV_CH_LAYOUT_STEREO; + } else { + layout.order = AV_CHANNEL_ORDER_UNSPEC; + layout.nb_channels = channels; + } + + channel_map = extradata + 21; + } else { + avpriv_request_sample(avctx, "Mapping type %d", map_type); + return AVERROR_PATCHWELCOME; + } + + s->channel_maps = av_calloc(channels, sizeof(*s->channel_maps)); + if (!s->channel_maps) { + ret = AVERROR(ENOMEM); + goto fail; + } + + for (i = 0; i < channels; i++) { + ChannelMap *map = &s->channel_maps[i]; + uint8_t idx = channel_map[channel_reorder(channels, i)]; + + if (idx == 255) { + map->silence = 1; + continue; + } else if (idx >= streams + stereo_streams) { + av_log(avctx, AV_LOG_ERROR, + "Invalid channel map for output channel %d: %d\n", i, idx); + av_freep(&s->channel_maps); + ret = AVERROR_INVALIDDATA; + goto fail; + } + + /* check that we did not see this index yet */ + map->copy = 0; + for (j = 0; j < i; j++) + if (channel_map[channel_reorder(channels, j)] == idx) { + map->copy = 1; + map->copy_idx = j; + break; + } + + if (idx < 2 * stereo_streams) { + map->stream_idx = idx / 2; + map->channel_idx = idx & 1; + } else { + map->stream_idx = idx - stereo_streams; + map->channel_idx = 0; + } + } + + ret = av_channel_layout_copy(&avctx->ch_layout, &layout); + if (ret < 0) + goto fail; + + s->nb_streams = streams; + s->nb_stereo_streams = stereo_streams; + + return 0; +fail: + av_channel_layout_uninit(&layout); + return ret; +} + diff --git a/libavcodec/opus_parse.h b/libavcodec/opus_parse.h new file mode 100644 index 0000000000..8e5c6a880c --- /dev/null +++ b/libavcodec/opus_parse.h @@ -0,0 +1,77 @@ +/* + * Opus decoder/parser common functions and structures + * Copyright (c) 2012 Andrew D'Addesio + * Copyright (c) 2013-2014 Mozilla Corporation + * + * 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_OPUS_PARSE_H +#define AVCODEC_OPUS_PARSE_H + +#include + +#include "avcodec.h" +#include "opus.h" + +typedef struct OpusPacket { + int packet_size; /**< packet size */ + int data_size; /**< size of the useful data -- packet size - padding */ + int code; /**< packet code: specifies the frame layout */ + int stereo; /**< whether this packet is mono or stereo */ + int vbr; /**< vbr flag */ + int config; /**< configuration: tells the audio mode, + ** bandwidth, and frame duration */ + int frame_count; /**< frame count */ + int frame_offset[MAX_FRAMES]; /**< frame offsets */ + int frame_size[MAX_FRAMES]; /**< frame sizes */ + int frame_duration; /**< frame duration, in samples @ 48kHz */ + enum OpusMode mode; /**< mode */ + enum OpusBandwidth bandwidth; /**< bandwidth */ +} OpusPacket; + +// a mapping between an opus stream and an output channel +typedef struct ChannelMap { + int stream_idx; + int channel_idx; + + // when a single decoded channel is mapped to multiple output channels, we + // write to the first output directly and copy from it to the others + // this field is set to 1 for those copied output channels + int copy; + // this is the index of the output channel to copy from + int copy_idx; + + // this channel is silent + int silence; +} ChannelMap; + +typedef struct OpusParseContext { + int nb_streams; + int nb_stereo_streams; + + int16_t gain_i; + + ChannelMap *channel_maps; +} OpusParseContext; + +int ff_opus_parse_packet(OpusPacket *pkt, const uint8_t *buf, int buf_size, + int self_delimited); + +int ff_opus_parse_extradata(AVCodecContext *avctx, OpusParseContext *s); + +#endif /* AVCODEC_OPUS_PARSE_H */ diff --git a/libavcodec/opus_parser.c b/libavcodec/opus_parser.c index 726c010f67..e6df34abab 100644 --- a/libavcodec/opus_parser.c +++ b/libavcodec/opus_parser.c @@ -28,15 +28,16 @@ #include "avcodec.h" #include "bytestream.h" #include "opus.h" +#include "opus_parse.h" #include "parser.h" -typedef struct OpusParseContext { +typedef struct OpusParserContext { ParseContext pc; - OpusContext ctx; + OpusParseContext ctx; OpusPacket pkt; int extradata_parsed; int ts_framing; -} OpusParseContext; +} OpusParserContext; static const uint8_t *parse_opus_ts_header(const uint8_t *start, int *payload_len, int buf_len) { @@ -83,7 +84,7 @@ static const uint8_t *parse_opus_ts_header(const uint8_t *start, int *payload_le static int opus_find_frame_end(AVCodecParserContext *ctx, AVCodecContext *avctx, const uint8_t *buf, int buf_size, int *header_len) { - OpusParseContext *s = ctx->priv_data; + OpusParserContext *s = ctx->priv_data; ParseContext *pc = &s->pc; int ret, start_found, i = 0, payload_len = 0; const uint8_t *payload; @@ -166,7 +167,7 @@ static int opus_parse(AVCodecParserContext *ctx, AVCodecContext *avctx, const uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size) { - OpusParseContext *s = ctx->priv_data; + OpusParserContext *s = ctx->priv_data; ParseContext *pc = &s->pc; int next, header_len; @@ -192,7 +193,7 @@ static int opus_parse(AVCodecParserContext *ctx, AVCodecContext *avctx, const AVCodecParser ff_opus_parser = { .codec_ids = { AV_CODEC_ID_OPUS }, - .priv_data_size = sizeof(OpusParseContext), + .priv_data_size = sizeof(OpusParserContext), .parser_parse = opus_parse, .parser_close = ff_parse_close }; diff --git a/libavcodec/opusdec.c b/libavcodec/opusdec.c index 87a86b6b47..e26ca0b2c3 100644 --- a/libavcodec/opusdec.c +++ b/libavcodec/opusdec.c @@ -38,6 +38,8 @@ #include "libavutil/attributes.h" #include "libavutil/audio_fifo.h" #include "libavutil/channel_layout.h" +#include "libavutil/ffmath.h" +#include "libavutil/float_dsp.h" #include "libavutil/frame.h" #include "libavutil/mem_internal.h" #include "libavutil/opt.h" @@ -50,6 +52,7 @@ #include "opus.h" #include "opustab.h" #include "opus_celt.h" +#include "opus_parse.h" static const uint16_t silk_frame_duration_ms[16] = { 10, 20, 40, 60, @@ -110,6 +113,18 @@ typedef struct OpusStreamContext { int redundancy_idx; } OpusStreamContext; +typedef struct OpusContext { + AVClass *av_class; + + struct OpusStreamContext *streams; + int apply_phase_inv; + + AVFloatDSPContext *fdsp; + float gain; + + OpusParseContext p; +} OpusContext; + static int get_silk_samplerate(int config) { if (config < 4) @@ -469,7 +484,7 @@ static int opus_decode_packet(AVCodecContext *avctx, AVFrame *frame, int i, ret; /* calculate the number of delayed samples */ - for (i = 0; i < c->nb_streams; i++) { + for (int i = 0; i < c->p.nb_streams; i++) { OpusStreamContext *s = &c->streams[i]; s->out[0] = s->out[1] = NULL; @@ -480,7 +495,7 @@ static int opus_decode_packet(AVCodecContext *avctx, AVFrame *frame, /* decode the header of the first sub-packet to find out the sample count */ if (buf) { OpusPacket *pkt = &c->streams[0].packet; - ret = ff_opus_parse_packet(pkt, buf, buf_size, c->nb_streams > 1); + ret = ff_opus_parse_packet(pkt, buf, buf_size, c->p.nb_streams > 1); if (ret < 0) { av_log(avctx, AV_LOG_ERROR, "Error parsing the packet header.\n"); return ret; @@ -504,13 +519,13 @@ static int opus_decode_packet(AVCodecContext *avctx, AVFrame *frame, frame->nb_samples = 0; for (i = 0; i < avctx->ch_layout.nb_channels; i++) { - ChannelMap *map = &c->channel_maps[i]; + ChannelMap *map = &c->p.channel_maps[i]; if (!map->copy) c->streams[map->stream_idx].out[map->channel_idx] = (float*)frame->extended_data[i]; } /* read the data from the sync buffers */ - for (i = 0; i < c->nb_streams; i++) { + for (int i = 0; i < c->p.nb_streams; i++) { OpusStreamContext *s = &c->streams[i]; float **out = s->out; int sync_size = av_audio_fifo_size(s->sync_buffer); @@ -542,11 +557,11 @@ static int opus_decode_packet(AVCodecContext *avctx, AVFrame *frame, } /* decode each sub-packet */ - for (i = 0; i < c->nb_streams; i++) { + for (int i = 0; i < c->p.nb_streams; i++) { OpusStreamContext *s = &c->streams[i]; if (i && buf) { - ret = ff_opus_parse_packet(&s->packet, buf, buf_size, i != c->nb_streams - 1); + ret = ff_opus_parse_packet(&s->packet, buf, buf_size, i != c->p.nb_streams - 1); if (ret < 0) { av_log(avctx, AV_LOG_ERROR, "Error parsing the packet header.\n"); return ret; @@ -572,7 +587,7 @@ static int opus_decode_packet(AVCodecContext *avctx, AVFrame *frame, } /* buffer the extra samples */ - for (i = 0; i < c->nb_streams; i++) { + for (int i = 0; i < c->p.nb_streams; i++) { OpusStreamContext *s = &c->streams[i]; int buffer_samples = s->decoded_samples - decoded_samples; if (buffer_samples) { @@ -587,7 +602,7 @@ static int opus_decode_packet(AVCodecContext *avctx, AVFrame *frame, } for (i = 0; i < avctx->ch_layout.nb_channels; i++) { - ChannelMap *map = &c->channel_maps[i]; + ChannelMap *map = &c->p.channel_maps[i]; /* handle copied channels */ if (map->copy) { @@ -598,7 +613,7 @@ static int opus_decode_packet(AVCodecContext *avctx, AVFrame *frame, memset(frame->extended_data[i], 0, frame->linesize[0]); } - if (c->gain_i && decoded_samples > 0) { + if (c->p.gain_i && decoded_samples > 0) { c->fdsp->vector_fmul_scalar((float*)frame->extended_data[i], (float*)frame->extended_data[i], c->gain, FFALIGN(decoded_samples, 8)); @@ -614,9 +629,8 @@ static int opus_decode_packet(AVCodecContext *avctx, AVFrame *frame, static av_cold void opus_decode_flush(AVCodecContext *ctx) { OpusContext *c = ctx->priv_data; - int i; - for (i = 0; i < c->nb_streams; i++) { + for (int i = 0; i < c->p.nb_streams; i++) { OpusStreamContext *s = &c->streams[i]; memset(&s->packet, 0, sizeof(s->packet)); @@ -635,9 +649,8 @@ static av_cold void opus_decode_flush(AVCodecContext *ctx) static av_cold int opus_decode_close(AVCodecContext *avctx) { OpusContext *c = avctx->priv_data; - int i; - for (i = 0; i < c->nb_streams; i++) { + for (int i = 0; i < c->p.nb_streams; i++) { OpusStreamContext *s = &c->streams[i]; ff_silk_free(&s->silk); @@ -653,9 +666,9 @@ static av_cold int opus_decode_close(AVCodecContext *avctx) av_freep(&c->streams); - c->nb_streams = 0; + c->p.nb_streams = 0; - av_freep(&c->channel_maps); + av_freep(&c->p.channel_maps); av_freep(&c->fdsp); return 0; @@ -664,7 +677,7 @@ static av_cold int opus_decode_close(AVCodecContext *avctx) static av_cold int opus_decode_init(AVCodecContext *avctx) { OpusContext *c = avctx->priv_data; - int ret, i, j; + int ret; avctx->sample_fmt = AV_SAMPLE_FMT_FLTP; avctx->sample_rate = 48000; @@ -674,26 +687,28 @@ static av_cold int opus_decode_init(AVCodecContext *avctx) return AVERROR(ENOMEM); /* find out the channel configuration */ - ret = ff_opus_parse_extradata(avctx, c); + ret = ff_opus_parse_extradata(avctx, &c->p); if (ret < 0) return ret; + if (c->p.gain_i) + c->gain = ff_exp10(c->p.gain_i / (20.0 * 256)); /* allocate and init each independent decoder */ - c->streams = av_calloc(c->nb_streams, sizeof(*c->streams)); + c->streams = av_calloc(c->p.nb_streams, sizeof(*c->streams)); if (!c->streams) { - c->nb_streams = 0; + c->p.nb_streams = 0; return AVERROR(ENOMEM); } - for (i = 0; i < c->nb_streams; i++) { + for (int i = 0; i < c->p.nb_streams; i++) { OpusStreamContext *s = &c->streams[i]; AVChannelLayout layout; - s->output_channels = (i < c->nb_stereo_streams) ? 2 : 1; + s->output_channels = (i < c->p.nb_stereo_streams) ? 2 : 1; s->avctx = avctx; - for (j = 0; j < s->output_channels; j++) { + for (int j = 0; j < s->output_channels; j++) { s->silk_output[j] = s->silk_buf[j]; s->celt_output[j] = s->celt_buf[j]; s->redundancy_output[j] = s->redundancy_buf[j]; From patchwork Mon Oct 3 22:45:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 38546 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp1575679pzh; Mon, 3 Oct 2022 15:46:46 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5sQmdyWSY7PBIV7p4YGSiQE25PH+aJQRqJQml032EHYREh9sGVYHqMsm17fPHJ/synyRyj X-Received: by 2002:aa7:d556:0:b0:451:f7e6:5121 with SMTP id u22-20020aa7d556000000b00451f7e65121mr20864059edr.188.1664837206084; Mon, 03 Oct 2022 15:46: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 xi10-20020a170906daca00b0078cee73346fsi1734918ejb.664.2022.10.03.15.46.45; Mon, 03 Oct 2022 15:46: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=cIVMHWCc; 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 7130D68BB4E; Tue, 4 Oct 2022 01:46:43 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03olkn2011.outbound.protection.outlook.com [40.92.58.11]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A7CDC68BBFC for ; Tue, 4 Oct 2022 01:46:36 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jrE8QlR++Kh2ttxMp54P5/hPajreGXOcOi/tfZ9g4tnQypVqdQniPusvItfLgDpsWzDIaRvAY8dBxk+5+e7rnhD5y4aWZO+ijnBalCF3FeJtT2riCcxne7otELNfWjgDN4/p8hM1anDP6T6FkT8yygX5IXIMHrR27Eb3kejlJGvIFAvmaBzoEdWKKHGp7dXfjMBmsmUu7MBrcE22YbH7kYSQ2HrHr66FFvisYnUE/sbqptL1bhvXyeXQ1h7X4nc+HQsgp30VztSvaAaBgrQxH8QQkGjOX1zyr8Z2LNh0xI84KxXQ8tQn6PPIA91Dz8w8/MC78eesURB0F0Ts6Gx1wg== 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=FJ/XHEEUm0SSA6ByFirMMoLPPTXfpni0DLSGnTAqRGY=; b=WDQ/Zbl7EzVlPiB59BOngDy+zXenOmxZ+V8R4Sbbj/D5xkqOVvo3O0WqLXOPWJ/+SnEvDpXWOVnKBLlYSCKjUzwqS5TThmkbesAIepxgWgMqschA4xcY106uN94EC363ONmSM8MHHby2Vi8PH1Ne1iT7s7a+XCMHqR+t7cWUKinsQGwgdoaubR36tKBJi3IhUAtud8nB4t3WBKdqwMfmvpWORoUCnQnDhJTDwvY+YjN8eRbMekDfMLCnTWsayZ4QfQWkx4Vr7OIkIfAe89E1Sb5XtKGqH8iFcMLCGQ4wIoOQazgH6CwF82U59a4iI7O9pK/3mwDM8BsPQ/4z0a8jew== 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=FJ/XHEEUm0SSA6ByFirMMoLPPTXfpni0DLSGnTAqRGY=; b=cIVMHWCcL0xFPxgQs5rUgUUF2I7ZHp/QeEWvqZSJNEv25k06zJHIAvqEEFnF1ixjx6wxJNVgVUv8iE1KrvvoCmQN95MNDcMfcievY4ReUgnhTxPEitSDUNwqERli/YyzxGqsqnPPJypTxh1nS/afVzXqjjqPgRui53OAsysLz6A8bt9v4Buh9Nxz6Hs33YAHcrPCnoos9KEpkbGj8xWk/gJnEU0QG5gZSvvhnlZOX29dFpQqpb4f+wJmTC9OyIWbRi0bA19RB7UdNJfHrks8aYSlqZvXkZDUAD5opMZar31P47Zp3GrISmxG3zAmSUPdGdFPbaAyj0Jhk8wjErouAA== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by PAXP250MB0470.EURP250.PROD.OUTLOOK.COM (2603:10a6:102:283::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.23; Mon, 3 Oct 2022 22:46:35 +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.5676.023; Mon, 3 Oct 2022 22:46:35 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 4 Oct 2022 00:45:01 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [h0SfQ3uaWkLSZBXhYbQU9KE9y2XyqBkwutYF4POvnAE=] X-ClientProxiedBy: ZR0P278CA0056.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:21::7) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <20221003224505.1846824-4-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|PAXP250MB0470:EE_ X-MS-Office365-Filtering-Correlation-Id: 929b6527-e41d-4f41-d8a8-08daa5911fed X-MS-Exchange-SLBlob-MailProps: EgT5Wr3QDKyycDCnlURLUH4o9GEGbttoqQzgET2zkErdVu/O0w0U9Uj6kv7cUouIMyHV7ociw+Ho2UfpKkM9UlhgjIXyp36QkOOYAFFmnnW7OF5Xp+nNRw2+Ks5N+c7J+86vHIv9tTOCs5JZ7X33/pQ+KU7h3vZOGEVHO93o/EsLR+qi8iF1F5nMsDu3KXmghMsbxuVOK+z8Soi7NCAWR27BsLAlv+IYmljjzwL2N13iT5AlZ1NuX740iXEDXxiTZECNls1LN1BRthsa107JYgASooL3kwLfGVf40LVh1e9iRNzninB568nIGTwIJxYpaVrvIpjQOqfwCogJ0MyQqW7doND03OzWP9ClQFMRvCt8PHuKyOkEUPVVwtd6YTxB73NH2CRGN/wHa8MxQwM+iOpZgT3KphHUTI3/QtaKrFs7GvINM7nxQvxuake7LCsUdun6TLLkAFNcZItOcyfavDhSB9SFRDb1bUCSBrYn2TtBBnQk1hrZT67mqOc7VdePRr6pi5Ipar4ckyMaMRxXiTt9NUqMDW4gKyopKLce8ED9MeHBqy1bONHD/p4mOnSguxd2q4dffcG+7nT+MCX5krHO+oQmuyINlsjBB2FsgjARPG4iKBl9dTGReatIUO+JR2yNoe1BzV1B8qB6uCS2l5z5FvQ7l0SK0g7jye1MkyfeQU38k3AgHCNJhL/4bhVC/wanRYOhZCk3bTAUvJgQPvjXxzzv6P8LZayn/68AAr0= X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2SAHJG+5/FiDBIhNL3FjFkkIVxCLZ+w+B+zboxgm+UB2fKaU4awSVKh9rQGdWrHm8SSKWjmfzFB3WzgI0BhOGfWJJwbv1d+KKeCvcl6k/vRPckd2So2tdnw0uuIyii1zBsf4fyocvhs13VMSZjlL0j43bsiT8zBhxLhZ2mVv7+DNmquvRdA8qUQ0+5ULhzjXBl2McE+HYrQBsvnJKDZ3r/4Eh638RRXH/g+tOxt7j+t+5gMoOohCARq2xrT9gNZHszSKXswspeM4+nQi05/pcoEqEpvlj9YvPKELeAqW+lM5G/9uPamzZF9jxUrBiYQV0JKurbhfJJUTNLT9On3HIGoWys4frQ5MSAUgf/8TYfycn74ofNnusvVAhNXe/cUzRqYnH18bcVXvlBk027Dsjxbrfnn5nfIKvZbPyO4x7gSEV5w/D35pNnBpTv9qoT9EAXVehy8n3WhOGcEmNZWPjlp2WqSBsv++5y3C5u5RaERVBwLCm29EtCVTS5gnURUn+71jUDJmjSQAZxTUy//mMjKdZc35hIbSr3+Vlu/2kHljWEZ8CBJeu67RWNvlnMtMWldwH3H1SmL1MMajAIWN4XCelJHw8GBZLufoYQKCREO7FcXsEJbwUfGd1oGs6Zl2KzZ+BmQvYNuq/71CTaCjAW/n0Zxd61LNLT5ej3qXhisArYv8ON7brxwLW1V7tovs X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: +rjntScc7nm7Cxs9ViuTPNbN8otTfgb1y/VEJey8d+QzpmnVJGEmg1sdkHNwo7MfU2M2zF1U2DIFxnOrvsvwh95oKsH8F5gF2Q1j0NdAERUQvweMzmXyYgSRAxB+WRCfo5p6BOMKkkegXMkyoQsc2MP39LgJsUg/qDTqGd1iwwKNo7/c2eO2vtcm3mT4Jnk/V+/ih2Yn36XEWAC0F9DAYN5YmCHL25wNMcmYnD0aiS76UQZVgZz0FSUvApcl1c10U+yO36Fyl0p0xTISVQWtuRsmQbmt3aUpZsC5/DuSXbCKmg/VBbSSvRdth4dEEhdPRfW1GVjQqKek85PwKx81H+LSB6hgJeMUxVXk90pu+EjcW5X0KE3I1y3AhSiIDtGOk6ki/slbf/X6y7K3pgls22WHl7zpB0rLdxfgiCxmyX0uRpNs4geHyLmyPaQV02J9rq0GkmAsDPS+hR57fsk/9XvVVLOqvK/1Bx7f8W97dimNYr+kRMusQaz2tf1T0QfmpTIqVdd+HRcSlX5aLkY8D8S8C8AKTvLmedU8LkXZl5AVi2nSisdWA0OLkbfpVGkUFexvIY4SxEWL8lCn4a23UvwBT97Fdt/LZpeqUyBRGI4DpisXwItuAKPwdWcGH/e2qzDmamRIaMFlRTKPXtF75EBmVpFj/feJydHellvv0nlSVjbtDLHW2vxgfK2acL1OMPulens96g2IEXjko4RhLC0De1a/PWH3NsGmulJxw68uxqVOMELmFAEIVeuO96UvWWq4z+e9fHdtJARjs7k1GpF8Tds3Wzk1vm+0KAdPihwDV4N554HJzdBav0iW48upgD/XLUYpdlCKFLM/BT2ll5Bdiullo5JbaWi6fBZXQG69Va/D0JBTOt/PO4BCQqCN6YjKoSRt9txh/GmjGn3o6Tvp0N8tZOnkH3BG2pLeTC25dq9MvOY1XVENqeReZpXyKNAxBAJK35YjUYwBqEE1zApNCOtddWzZSUegLd5H07UCcuon1BBSiKXcMtiiE6sDzyvfxIgDt+t62PuHlRmDGhfUoD147PckrnhOriXhdyc62Vn0yBKv38McQHAbS8acjmF5V9c/q/IIEQw6i27XxblfqFE4vfKINhzLV3k7WIIst+bzQIaEqiZopBped702g+6Eqxp+mzYjisfUigIjryvwTHctqFvz9JvMSfwbIj+8vGMYPh3fUkzNm71PDEcL2REiJNfAZ4eZbzyNGk7bCNxE5TG3t8rgPb+YpbV0KKicxDuUKf5KUVqxSdfyTzEnIbDaGZ0Zh91PXEYFwaChXRDX2sN5Fxdb9630ARvHkPY= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 929b6527-e41d-4f41-d8a8-08daa5911fed X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2022 22:46:35.2899 (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: PAXP250MB0470 Subject: [FFmpeg-devel] [PATCH 5/9] avcodec/opus_celt: Break cyclic inlusion of opus_celt.h<->opus_pvq.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: ax9n7hbax8yx Simply don't include opus_pvq.h in opus_celt.h: The latter only uses pointers to CeltPVQ. Signed-off-by: Andreas Rheinhardt --- libavcodec/opus.c | 1 + libavcodec/opus_celt.h | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/opus.c b/libavcodec/opus.c index 791e25c488..a24c38be52 100644 --- a/libavcodec/opus.c +++ b/libavcodec/opus.c @@ -22,6 +22,7 @@ #include #include "opus_celt.h" +#include "opus_pvq.h" #include "opustab.h" void ff_celt_quant_bands(CeltFrame *f, OpusRangeCoder *rc) diff --git a/libavcodec/opus_celt.h b/libavcodec/opus_celt.h index 291a544298..19cf617652 100644 --- a/libavcodec/opus_celt.h +++ b/libavcodec/opus_celt.h @@ -27,7 +27,6 @@ #include #include "opus.h" -#include "opus_pvq.h" #include "opusdsp.h" #include "libavutil/float_dsp.h" From patchwork Mon Oct 3 22:45:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 38547 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp1575770pzh; Mon, 3 Oct 2022 15:46:55 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6vK9z0ObDe+0X4zoQCW/+oB64MLbe/RSeIMN6MwZd8LDq4q+PH2yHo+hMtBKSY7dHRrOy7 X-Received: by 2002:a17:907:a04b:b0:78c:ffac:4bee with SMTP id gz11-20020a170907a04b00b0078cffac4beemr1633870ejc.631.1664837215105; Mon, 03 Oct 2022 15:46:55 -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 ho7-20020a1709070e8700b0077751bae5absi11480911ejc.534.2022.10.03.15.46.54; Mon, 03 Oct 2022 15:46:55 -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=gflzo7tk; 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 7B17568BC11; Tue, 4 Oct 2022 01:46:52 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03olkn2054.outbound.protection.outlook.com [40.92.58.54]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7301C68BBFD for ; Tue, 4 Oct 2022 01:46:51 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HxV109hceXD9dSYZYqoXtP7wAcNLkUcUiiVV4ZUxk28NXaat2aN31uNhSe9CJwBL27tjTCha7x/JVXVVOoJDqbSiBBMZ8ZGwKYZoT3Wq3lzshb5U/2Oc6ZOrUsO7AyeMpqxYN3ISbAT5ttSNC7T84CfVTqFxwR+BE8K7pjKsCHAuCBREB3QJ24BGg7PtTvqZjz0OcoXU66pA7VwfYWFWWOjd7SWnqksV4FuD5EhvGeXQhiywZx1vCyflIjpueHUs24NVWjvZoOGIX8j0B35axGz6i6iDX5Gdi8HNfC6trjFdyLDIAqtsy/qfPvYp51v6QYcZiZRoDOz6TlT9QKMHtw== 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=byZ8fdHlT8YQ6pmn5zXSTJtYVWtYk4nWUf0GkczY7H4=; b=H/LBXSjJWjrP2z0f7YRq+Ss9bfqQcmwrx0gRQAOrdpg+mHJqyaGGnkcdkzMVfnfPLH/lT1zd/wNPwL/HGwFrnCPKNKWDMvJjnurGW9O7WYsKXcHDTAzkJGQdI2bX8teotfU7/xEmU1ugtdjJASp1ReSjnZ12C70cdZSiNWIllIMCnoNfd8TkT5KhXyR9EBwRCGkjLMtS1Jz3v4BftLrXvU9sxDIp9bJCxBeWZA6HfGCmy6sAY2mtrQHxxwDesjf+9qi8v94bvC+JCjmTnIY9uq6h1425OM5Bx8WiuOR6BpEtNA0UUl9BZEl7RXi3rf74YrGQ6ddDLBQ5rCinO9wdxA== 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=byZ8fdHlT8YQ6pmn5zXSTJtYVWtYk4nWUf0GkczY7H4=; b=gflzo7tkE6wspsaZqM0mp7FGLr+56h+5vLwwRXrJMf5BEUVmOO7J7RlVYl9C8t8hqydLWtB1/Ytl3mg3yvwTym5I3hmzu+6i7VKl4EYRoqFfmpWCzDRdF9u9LIIGpUTkPrkmyfDXr0y0WbZfc94gmu6Fqdfrvwf78cNHLh60Dl5/c781+hlLH1SyqcTqVoduInusxGoTp7OO/xT9VJTr4ohq4+m+kriMS7Hlgfn4d7nwzsTdRi+YPM5ex4so9i91ixOTwvmmF2CT2q/HZhFJYrtobFdAP/Ifab8d+x9NWtw9OCbrtP03iyS/j07eEVBHPyAk6U2clI0iF59pyPuhoA== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by PAXP250MB0470.EURP250.PROD.OUTLOOK.COM (2603:10a6:102:283::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.23; Mon, 3 Oct 2022 22:46:49 +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.5676.023; Mon, 3 Oct 2022 22:46:49 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 4 Oct 2022 00:45:02 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [3NgspnpXdrMUzr1GD8PitISWZ+eaoIn6novkZlBKYsA=] X-ClientProxiedBy: ZR0P278CA0056.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:21::7) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <20221003224505.1846824-5-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|PAXP250MB0470:EE_ X-MS-Office365-Filtering-Correlation-Id: 155ffd8a-3073-4afe-3f62-08daa5912898 X-MS-Exchange-SLBlob-MailProps: ZILSnhm0P3lA05FefvWS45JiO4vgSAs1yT/casyrJzAIXO2CPp+ZPL1FtMm3xqXBh2Eal/R8/LKE8YrJYzVPLURmyJLjfD2/meOmNLLQOunmWWshkdst+asDPOWwpuQaVn80t9d1JzJOjpTzT8XQZnqK86ER92vmHK6rFLyoAQQKmBsM6eBq6oUcoin/bJxijqlPGI73Fqke1kPUEWnvL4d6Fvg9aB2DA2wf0vdWkO6QSGs13jbOCAj7wL8+nomGx14QrMPa9QQuThe6tdHUq7KgSuE2Krf2nCrgfYfqXzAwsy24fCyI6/omgl2hkakyFaVWLfkZDw5/h6GNU4hoW/hKDN460F59eEYzc9yFYe5+IUpMDikGUBtAkb6MLjraMgo5E7NcpIngdXo1guWDH8bZS0QWAGHoaVse+CQwZGrWIy2nn7rIUP94Mr37ZCdIy35fOTzmKWt2aUj61dIyl/LY1wJvJCWV9ndhKlyWMl6hKwCagBhQwe8say3CUuaA04Nt1RN38sw0bvBK+zAbxrMicVcBc/rp35pbf6YDP9RpRIHYKgEPSow4GANeCWOLNQjsdFM9oFuN0sxw2X4rAejpZnF1WiqaFkEq8hK1C3+2cmQTZrV5RUexeqLWOQVI87toAMwjw9FCRVNxAdLgUJGyXum3jYp0JIViHua1WfaZEyF+42icmHwYPyZn9XRI7XUDtXEQNtmGMex2ObSXZ4R/8rksRYc9M/thkTrKRxdZ8x8JHig3TGT27U7SB0aOkQFuPz1oZQdZbkGl3R+VAnQr9lY46PDO X-Microsoft-Ant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MS-Exchange-CrossTenant-Network-Message-Id: 155ffd8a-3073-4afe-3f62-08daa5912898 X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2022 22:46:49.8140 (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: PAXP250MB0470 Subject: [FFmpeg-devel] [PATCH 6/9] avcodec/opus_celt, opus_pvq: Move CeltPVQ typedef to opus_pvq.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: nbZRJcfpF7un It is more natural that way. Signed-off-by: Andreas Rheinhardt --- libavcodec/opus_celt.h | 4 +--- libavcodec/opus_pvq.h | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/libavcodec/opus_celt.h b/libavcodec/opus_celt.h index 19cf617652..c812b6645c 100644 --- a/libavcodec/opus_celt.h +++ b/libavcodec/opus_celt.h @@ -44,8 +44,6 @@ #define CELT_POSTFILTER_MINPERIOD 15 #define CELT_ENERGY_SILENCE (-28.0f) -typedef struct CeltPVQ CeltPVQ; - enum CeltSpread { CELT_SPREAD_NONE, CELT_SPREAD_LIGHT, @@ -96,7 +94,7 @@ struct CeltFrame { av_tx_fn tx_fn[4]; AVFloatDSPContext *dsp; CeltBlock block[2]; - CeltPVQ *pvq; + struct CeltPVQ *pvq; OpusDSP opusdsp; int channels; int output_channels; diff --git a/libavcodec/opus_pvq.h b/libavcodec/opus_pvq.h index b30407f5ab..b71bc49034 100644 --- a/libavcodec/opus_pvq.h +++ b/libavcodec/opus_pvq.h @@ -34,13 +34,13 @@ float *lowband_out, int level, float gain, \ float *lowband_scratch, int fill) -struct CeltPVQ { +typedef struct CeltPVQ { DECLARE_ALIGNED(32, int, qcoeff )[256]; DECLARE_ALIGNED(32, float, hadamard_tmp)[256]; float (*pvq_search)(float *X, int *y, int K, int N); QUANT_FN(*quant_band); -}; +} CeltPVQ; void ff_celt_pvq_init_x86(struct CeltPVQ *s); From patchwork Mon Oct 3 22:45:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 38548 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp1575849pzh; Mon, 3 Oct 2022 15:47:05 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4V93HjkhpQKAC8bJn/kNS45aO1xuwT3hqQWNP3Vf7DWjUOH0sdjuQiMb7Fvgsra23ZzrGj X-Received: by 2002:a17:907:6d89:b0:783:5465:908 with SMTP id sb9-20020a1709076d8900b0078354650908mr17505221ejc.26.1664837225374; Mon, 03 Oct 2022 15:47:05 -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 e28-20020a50d4dc000000b0045945eed10asi908515edj.5.2022.10.03.15.47.05; Mon, 03 Oct 2022 15:47:05 -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=AGdTslRL; 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 CB65C68BC19; Tue, 4 Oct 2022 01:47:02 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03olkn2088.outbound.protection.outlook.com [40.92.58.88]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E760968B2D8 for ; Tue, 4 Oct 2022 01:47:00 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=I40je719IWyAdFQKHeo44ZxtVhMoAVNlXrQ/e8gO68zEvTThchWsBxjrZ7hQBk5vMERvHPjvbIHnFfgUQ9U5wbFOkCDUwbK9J+Cn/cgGGoeQr6I3igkkRE3fvD7AoFmmQF9VVEmD38ZK3n7oweTeH2O1v+tZ2kFDAVvblm7RCc3tkfnH3+Cm4Jv979uJ77yeuXvW3/pM+NDiHz5XbYVtlzkLmieaBAIgKhW/kLrqtyoYPcghVrWOgtcDXyhzEc7KZmAFuo8yHMowEO+KEloqLjNvOA4DbSxzcJs4Eiz0snLMmDyJmVcCsy7Wu7NCNpHj2shkCqmik/3antDU/A5fMQ== 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=upzwN/t7LY8z8fkZsf4ATkgbGegFdg2ESZb9InAxMDE=; b=C+I8l0SgsP0OFSYQSIvdFV/avxvpNtevISv3g5pbJMWGotLu1XXwNiqcQqLAPM1IUMvWxR0tBlbQRcnh3JkSuqYbzTKyc7woFDSBX68FbmMN3M2Cg2n/PICNYlXAqK/pG+0mgqef7cM8fnYq7bFgRGnnuOKmS9+NS/UoquTloBtjXZsYME3yqvt4nck3Vy2iKUKCi6RVNyEArvguF7yjJWeR7veHTyiRylMZ3OBbT4zZNarDLnFjsqRSfDbaHA9wL/Mhv54De6bNrjF1/PNBJfgv7YVa5llFI7NK8iUpMnXvfcCs7zvxVJCYcJVQMF44sKejxJIYr92861nJr/Xi7Q== 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=upzwN/t7LY8z8fkZsf4ATkgbGegFdg2ESZb9InAxMDE=; b=AGdTslRLt14f9pVzwirhcsGHOgckc11Pib31OZOZ3dwl+kk1Z2Do9rnpFij2ejpImponERAUdHd0SOoW2TYBjBjeFkyd/lPeX4Kc1Bq7rrszEKuYpvdG0Vz007CKsYWHlI03Fp9K7huZC6TdJOAzxfIpTLwEKBeVv5xlrVI2OK5kLKuxjZTPJX/6eAK0WAvbOWUq4RK7+cIQP5wrpJnpkufvZIWOA7eAj2LEPfziCU6Yp4Py5pZV4AxpnVQbKsIdwiI907XUsEgpHG67sis0/XYzKgA5tJ0U4I60BSQfcBCHytiCbol5oXZxi1kFZyR8ECvGSaqwnF9mpmHKLXRw+g== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by PAXP250MB0470.EURP250.PROD.OUTLOOK.COM (2603:10a6:102:283::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.23; Mon, 3 Oct 2022 22:46:59 +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.5676.023; Mon, 3 Oct 2022 22:46:59 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 4 Oct 2022 00:45:03 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [HZ6SdTezHtFNIF3MZCPqlnNz3SbBhSrai5W/A7iVit0=] X-ClientProxiedBy: ZR0P278CA0056.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:21::7) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <20221003224505.1846824-6-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|PAXP250MB0470:EE_ X-MS-Office365-Filtering-Correlation-Id: 4c915435-7f84-4f2a-4420-08daa5912e4e X-MS-Exchange-SLBlob-MailProps: feAVlmA1hHXgXBGESH14SR3yJncyDS0I2Y6CfamvfrzUU1uLdofYWm4pi+iiJZJ8R++v6jPwOfFw6OAH8+/ooZjtz/mnLvOYCyllfgDygQKiisd81fojOEPnS+68k+crByKaHb15yLqhQKSFbs7l13HOtX+4ImEp3gqXTDrmiCIB+NCKgegQCYC/QA3GZuQOJ6vRuKTScCGJb7LXwRislwBPCeW/JgUMBlo7D12Yf+zLb+2wJ/fDvpiN12Tr6ukO8kprUyweNT+gdSBDc59skRG5MCvWsVPxvsNiH7x+GvNdHhIm22IQ+KE4SdQjIO+TfscyOi8FW2F/w+SpzliQ8nHv/XJ+ECRO1BxYPeDw10Uu3Oz6STPMfbPYGlApYnqxGDqdkEe6VvEoXT/t+zg6/u/8A9BNnM3fHMLyTOkvMxhkmZVzTlt/kh54S0Tt47kGE/i32V9/R2AymKX8BPFUUYJ1eyxbXytQrIIRm51/2MIO3+DbrhvjZrGMZnVYkpol73Rz80HwTfrI7g+g3wNiHZnLmRlvb0YTWEiuu+DsD+P5iqAbLqEGEqU5BzWerK3oths6oNLn8OoiikMRO2C/VN1B6MbGdf7PE0C8+BWYX7czVG8auuHjzn0i9hXPpDIvML+73krxs9r7hqbv5XDAPU41QRt1axyQxzRIKJ/hUMt1lm4Wy1CPaQJrujJuGtvtCgBmQifk6VUfmTVej+umJA== X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Ee7lHOrWM4bAfSg2h53Z4oEpU+Vk+UCgcc/WS2jFYI37BZo7QixvDolwLZ3qAcpSQ1TTLiODctNNdfvJGcoZrRNySxcrt5vCmvUFoKig65FRpWFxKeStuCWcgBukjB7BB9F93dS7dkZPqWpysVa6QtY0k+cH4tvD5zJTUDB76C++DIsgfeTAMDeJk0zv/HO/qUE4wRn8dde6UFfNjcQy/ebukYON+FNWV0dKmQd5PcK7oLdoztQ4QngKpZ3QWY16UUUBPpaqFyy51IZ9in1vySTqVl/0ssuY5zPFvW7mwo3uo/LaqDKBmAvE3j/mgBmAPhG4lC7wbFpn/TY/cqJtwAzWFl68MbSdzkF2AonnLwXbd8VRxz8ion/48BeGpZmpFHwbA3xa/ScV2BsHPELxDdte4597yny3aE8l2tN35S5s+LpxWzH4jXIzdPGJgCWAe0uIr7Ok4+//eFu07RUzI6WR916bYsAl72Yz7LPVz/HCMAnVTEF9rPoR07PQkFuv9Jb9J3MxdC2m78GnWGeOZJndPeAarVoaWcLz4u06GryWhj1V7WCRedtTfHo3gMjoTj2KoD1cMi5nt45Q1CWwERlOsem5RemNDU2Z8zAL+UCoyBAshl47/NZrhnMfxeiq52pvfq5APhEei5kAQmYpA5b9aWwvG7W/b6B2qu75PR5glRVhpZWxF7x54XSG4o6i X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: atOpFeHylSMDpBTXwcsZT5/rO+CyyZqZb1JeBWq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K6f3UVG+as/FohL58C3/9AM8kmpES6BDCbnq4xgugD82lTycIUzFFjWb3emx9IUD+smu0Uo8Y/DpeUWOJe4rjjssbw8U4GQuy3BN7Spji2a0p7TSXwNUx0Nw4pitNv8FKFRYhwzs/uhzJjrcsPpKO+AuDqXBfv+gkwo87vPhjg9x5xlH4trXjhdeerPwlMM5loP+S8BOG8/HpxSL/UTKkLvRo= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4c915435-7f84-4f2a-4420-08daa5912e4e X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2022 22:46:59.3631 (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: PAXP250MB0470 Subject: [FFmpeg-devel] [PATCH 7/9] avcodec/opus: Move remaining celt declarations to opus_celt.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: oOozUMybgMhQ Signed-off-by: Andreas Rheinhardt --- libavcodec/opus.h | 8 -------- libavcodec/opus_celt.h | 11 +++++++++-- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/libavcodec/opus.h b/libavcodec/opus.h index c88bb89dde..023bc9daa1 100644 --- a/libavcodec/opus.h +++ b/libavcodec/opus.h @@ -73,8 +73,6 @@ enum OpusBandwidth { typedef struct SilkContext SilkContext; -typedef struct CeltFrame CeltFrame; - int ff_silk_init(AVCodecContext *avctx, SilkContext **ps, int output_channels); void ff_silk_free(SilkContext **ps); void ff_silk_flush(SilkContext *s); @@ -88,10 +86,4 @@ int ff_silk_decode_superframe(SilkContext *s, OpusRangeCoder *rc, enum OpusBandwidth bandwidth, int coded_channels, int duration_ms); -/* Encode or decode CELT bands */ -void ff_celt_quant_bands(CeltFrame *f, OpusRangeCoder *rc); - -/* Encode or decode CELT bitallocation */ -void ff_celt_bitalloc(CeltFrame *f, OpusRangeCoder *rc, int encode); - #endif /* AVCODEC_OPUS_H */ diff --git a/libavcodec/opus_celt.h b/libavcodec/opus_celt.h index c812b6645c..8d92b86b07 100644 --- a/libavcodec/opus_celt.h +++ b/libavcodec/opus_celt.h @@ -28,6 +28,7 @@ #include "opus.h" #include "opusdsp.h" +#include "opus_rc.h" #include "libavutil/float_dsp.h" #include "libavutil/libm.h" @@ -87,7 +88,7 @@ typedef struct CeltBlock { float emph_coeff; } CeltBlock; -struct CeltFrame { +typedef struct CeltFrame { // constant values that do not change during context lifetime AVCodecContext *avctx; AVTXContext *tx[4]; @@ -136,7 +137,7 @@ struct CeltFrame { int fine_priority[CELT_MAX_BANDS]; int pulses [CELT_MAX_BANDS]; int tf_change [CELT_MAX_BANDS]; -}; +} CeltFrame; /* LCG for noise generation */ static av_always_inline uint32_t celt_rng(CeltFrame *f) @@ -167,4 +168,10 @@ void ff_celt_flush(CeltFrame *f); int ff_celt_decode_frame(CeltFrame *f, OpusRangeCoder *rc, float **output, int coded_channels, int frame_size, int startband, int endband); +/* Encode or decode CELT bands */ +void ff_celt_quant_bands(CeltFrame *f, OpusRangeCoder *rc); + +/* Encode or decode CELT bitallocation */ +void ff_celt_bitalloc(CeltFrame *f, OpusRangeCoder *rc, int encode); + #endif /* AVCODEC_OPUS_CELT_H */ From patchwork Mon Oct 3 22:45:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 38549 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp1575919pzh; Mon, 3 Oct 2022 15:47:15 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7Stp1XVCV2xPEV6eKsWYxp6qky0g0YpU3FpAeXwJK/DjTittSXHWtffA0IJ4OIKzcumm62 X-Received: by 2002:a05:6402:4503:b0:457:e6ac:9785 with SMTP id ez3-20020a056402450300b00457e6ac9785mr20579772edb.416.1664837235146; Mon, 03 Oct 2022 15:47:15 -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 w7-20020a05640234c700b0045157918d66si10679342edc.355.2022.10.03.15.47.14; Mon, 03 Oct 2022 15:47:15 -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=COEtFQlm; 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 DFF9068BC25; Tue, 4 Oct 2022 01:47:11 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03olkn2036.outbound.protection.outlook.com [40.92.58.36]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D480A68BC07 for ; Tue, 4 Oct 2022 01:47:09 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=J7lNmx1Y9VViEqIZ18Mi5bYfcXOEWGvZhWhXRaXvULVI9F57zk6CwCuRYcEXadLF+6/sEu4vgX2KlRgmOi24DIpd5kk95E2/CAongbn2XKuafa/WyROg7FOOnFszE700eKz/0DETPMSkCiujYZCrD+AHAD9AMjdc4ZhvhijJ3q0I8ePKIXHcePKAQvDnC+jhhmuj+bMAZTlgNEHleAgCv8GiNZdxqeeHXqXnaZmAibNlGeLUZzXneWF4fbo0oNx0ily2sd16o7Tn7JEW0CMVOfSRlZvBfd2+Mm+n9tnES7lVAgYrO84NvuDQMCgrdKToWpyxBNvhHSycVbDGxRTTmw== 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=H/GV9daLFBoQtsREodOw1javlIxqecLKUo1sPZXQ/84=; b=EVuIEjR5zc0tPvNZfYByWxEQucXzH9IidXbmkgMAQEuqwEN436jUDd8wveiWU9bNZerK6+tSNeUosjSD4gyCpYYNyZuY54Qmt86VI9TYNKWc2w7dZoFhOLUGwQO32jUO4uRzWm8ecVX7xuV0JVRyYr+LjWvyLISAbH/TubdnkJoQK5Pj/YIR+PVj44QtK1P4CFiQzjH/ETAxLyn7pnPk5JkDylS/pvrVecX06KoA028j+CPYIMwYVKvZtsKGGVNtwk3qvTzehT/ntJ/UHCFX42U0nfp01O/GmB0HhrS7oy2sOSgZHK3PO5ClOJJjOJtBTjqYiQFe2muZ/cp61NM8kA== 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=H/GV9daLFBoQtsREodOw1javlIxqecLKUo1sPZXQ/84=; b=COEtFQlm40HwOTph+xHZZP64QTDiV+l3NM6S5lGHJcNmvogTXoppCmZ+flL1HXZ504aBHZLLynZ0k9u8lJMrZjMcMWiT4JKRqR/OFZ6Xw3ncPwEatNitxbUduTD4dbkEmWjlPBmhPAF5syyw9PX/h83mxyO0I3ne50i90iB/yA0vQMPTrvX+HW46NkwYZZhCof1OjMfNBR++gwOS6HN49LNuCmQyQe0Ermj1MY9gmUEWa2oLCKP/cc+s2Ub8ciPsKly/S/AnFwlaYftBFhPE8caFe/xlFKHUvokqfIaxW6Y0qG2FaxNwVm0FEO8dX94w7Doj/4zZGcDT3H0KifMQ6A== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by PAXP250MB0470.EURP250.PROD.OUTLOOK.COM (2603:10a6:102:283::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.23; Mon, 3 Oct 2022 22:47:06 +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.5676.023; Mon, 3 Oct 2022 22:47:06 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 4 Oct 2022 00:45:04 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [i0JG8b+3Bemlt0JKtdULIeLBMXwPef6PTD6LxQLl/MA=] X-ClientProxiedBy: ZR0P278CA0056.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:21::7) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <20221003224505.1846824-7-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|PAXP250MB0470:EE_ X-MS-Office365-Filtering-Correlation-Id: 6b2e3274-4301-46c2-9b59-08daa5913284 X-MS-Exchange-SLBlob-MailProps: feAVlmA1hHXgXBGESH14SR3yJncyDS0I/b3vIW3FxkHf29efWIropvwa+FY7ofSEeLQG5rwYhJlUUKKaDhfni6LvU4xiM9l/1cC4ORjOTjhv5DUU97M+TS+pVnOzt+qTIE/3YxwzjjVvdoaMFcS+yTt9mSPQ6yxqnIKJLB+AN5mDKrAlz92pw1FUEG6f73R8+CXHhTVqKrl2zD51tK7D5Kly/4rUmRFhLTM9AUxBtPGqoj1yJJYse7FTW+Go0LZSH3lI39250bY4f6+FkAYfGYJi3FVnAMMGKtaa2+gBhKWoePrMABaF3o5WH4P8RpvrVbB+F64HmOxri6VAi85kvJZaWXGodz9h+x2NDtFdI01eh9//xn7tx1khFo1m61EH7qUjwaL/GHq6b51GHS/KEwMeoTH/14uaQobpIHTBHIpyxrAY0/3J2TAqnqLneF3Zq2HAxLZGbt/C+JKPg1RIeL/AO3DxRcxWwA6nHxpYeRXXdXclxINFIBrbXdAGTHYjYqsxbqdVi6A0e+glb3lm7PLOlvNAQHHhF2Nylr5hqFauEdPQZfApbu3MAeDnhQmzBnWgjDP8W05WxHClF7X5mfnkzYVq8Sq5ZEaISplPOzn9+TfFzbAoc4x2nW2658TFXj0RlxTQlszPHeMfkDWXz9vV8HQzegc7zA33EXXFnUf7AvJX3qoK1giNCd/+cncOoroUSQ7vy/v429rVZSvFgQ== X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cBc4r4HMovS5O+K/Kp07FWqJ4VsBSCjxfI06/nv1oEKty0oI64BKUyVqOzzIVWep96eCEZrDB5YwKYJFQRYdTJETJCK2zatFUZ3AwZCjc/tJsMVbChPTG5U310PIttu7L36mpv0QzwnIhyVLr0rWa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DCveR8Kzpga6q+56UCqlmfvi5eB/f1aVjU1V0U+8Ol1TBjris0aGxEGuVk6DR0a4RknP/QKc9Ee0NYsNvn00Dp3KP8f+FJa0UnJK3f33dP1mJFjQmirpZzPrGc58dJyyNcvDod7NGdNNTJarVqd8avlScLjCEOjKMRYzlmEe4MW40TdJDLVcQpEs9hn4xRPHENqgYT5fW6ny558jlH9yoKko0vB9Ep1ob43sLEYKV9fY4LV1vQEjYCKcPc277U4SnoQao9XEmmS1Tt/gtU4ULTM2LsS8aYplYuuOJRp3EOAIea8Owa//HdeSh5iKwJSlSK2e40sYXdq1KFKkn5jxXaEiw2Cleze5824jykF3S9IFHubZrvEkzInIXHWQN/QDb4hvWzHsSbdJ+qpqB2W+TPLKNRGOooImGO5A5HQlOxMAFZfseQUOO9PCaxaNq/vKEljg+VSgZkcNNrct0EefH06GzhPhQh18gtkufIQTfx0HNCVr5fgLUPWePQ7XUoOyy5XlqK3iWDSgClORES0VPp6C5h+iMv46w/miw1Fuwk3IYoBJoySitG9AMlDRlNR6ROTTdO1tx//HDBnli4RatFDOaSxma7JkgR/uTAa+9JEckCg4QskKB1vTHK7f4AD4JuCK41B8IOeQwQQVDl4qtZPSjtasGFoHeFCoiWma9mqttQlT8/YYIYWnvW/TciScWo4E00Sx/9+pELz52Fyyx1IviJk5IQBhOJYlBPQlzo/TdVqOrt4oRUBK1I9cSS79hGkFv1+XcNImKyeg8VJZHaGSjOrrkipImIYFm+NKl4Jc4HgyQpGfF7DtZoVtMtLviCR2A5ePiDmW2AGSUpoVoCnXgo5Q= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6b2e3274-4301-46c2-9b59-08daa5913284 X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2022 22:47:06.4300 (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: PAXP250MB0470 Subject: [FFmpeg-devel] [PATCH 8/9] avcodec/opus: Move defines to better places 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: KNL+J3a1axiG Move ROUND_MUL* macros to their only users and the Celt macros to opus_celt.h. Also improve the other headers a bit while at it. Signed-off-by: Andreas Rheinhardt --- libavcodec/opus.h | 9 --------- libavcodec/opus_celt.c | 2 ++ libavcodec/opus_celt.h | 10 ++++++++-- libavcodec/opus_pvq.c | 5 +++++ libavcodec/opus_silk.c | 3 +++ libavcodec/opusenc.c | 2 ++ libavcodec/opusenc.h | 3 ++- libavcodec/opusenc_psy.c | 5 ++++- libavcodec/opusenc_psy.h | 2 +- 9 files changed, 27 insertions(+), 14 deletions(-) diff --git a/libavcodec/opus.h b/libavcodec/opus.h index 023bc9daa1..283d9d9f7a 100644 --- a/libavcodec/opus.h +++ b/libavcodec/opus.h @@ -32,18 +32,9 @@ #define MAX_FRAMES 48 #define MAX_PACKET_DUR 5760 -#define CELT_SHORT_BLOCKSIZE 120 -#define CELT_OVERLAP CELT_SHORT_BLOCKSIZE -#define CELT_MAX_LOG_BLOCKS 3 -#define CELT_MAX_FRAME_SIZE (CELT_SHORT_BLOCKSIZE * (1 << CELT_MAX_LOG_BLOCKS)) -#define CELT_MAX_BANDS 21 - #define SILK_HISTORY 322 #define SILK_MAX_LPC 16 -#define ROUND_MULL(a,b,s) (((MUL64(a, b) >> ((s) - 1)) + 1) >> 1) -#define ROUND_MUL16(a,b) ((MUL16(a, b) + 16384) >> 15) - #define OPUS_TS_HEADER 0x7FE0 // 0x3ff (11 bits) #define OPUS_TS_MASK 0xFFE0 // top 11 bits diff --git a/libavcodec/opus_celt.c b/libavcodec/opus_celt.c index f1fb88a56d..c2904cc9e0 100644 --- a/libavcodec/opus_celt.c +++ b/libavcodec/opus_celt.c @@ -25,6 +25,8 @@ * Opus CELT decoder */ +#include + #include "opus_celt.h" #include "opustab.h" #include "opus_pvq.h" diff --git a/libavcodec/opus_celt.h b/libavcodec/opus_celt.h index 8d92b86b07..3aa96244e1 100644 --- a/libavcodec/opus_celt.h +++ b/libavcodec/opus_celt.h @@ -24,9 +24,9 @@ #ifndef AVCODEC_OPUS_CELT_H #define AVCODEC_OPUS_CELT_H -#include +#include -#include "opus.h" +#include "avcodec.h" #include "opusdsp.h" #include "opus_rc.h" @@ -35,6 +35,12 @@ #include "libavutil/mem_internal.h" #include "libavutil/tx.h" +#define CELT_SHORT_BLOCKSIZE 120 +#define CELT_OVERLAP CELT_SHORT_BLOCKSIZE +#define CELT_MAX_LOG_BLOCKS 3 +#define CELT_MAX_FRAME_SIZE (CELT_SHORT_BLOCKSIZE * (1 << CELT_MAX_LOG_BLOCKS)) +#define CELT_MAX_BANDS 21 + #define CELT_VECTORS 11 #define CELT_ALLOC_STEPS 6 #define CELT_FINE_OFFSET 21 diff --git a/libavcodec/opus_pvq.c b/libavcodec/opus_pvq.c index a4e44b7a14..79101847af 100644 --- a/libavcodec/opus_pvq.c +++ b/libavcodec/opus_pvq.c @@ -23,11 +23,16 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include + #include "config_components.h" +#include "mathops.h" #include "opustab.h" #include "opus_pvq.h" +#define ROUND_MUL16(a,b) ((MUL16(a, b) + 16384) >> 15) + #define CELT_PVQ_U(n, k) (ff_celt_pvq_u_row[FFMIN(n, k)][FFMAX(n, k)]) #define CELT_PVQ_V(n, k) (CELT_PVQ_U(n, k) + CELT_PVQ_U(n, (k) + 1)) diff --git a/libavcodec/opus_silk.c b/libavcodec/opus_silk.c index f9d67f4fb3..fd1e83659c 100644 --- a/libavcodec/opus_silk.c +++ b/libavcodec/opus_silk.c @@ -26,9 +26,12 @@ #include +#include "mathops.h" #include "opus.h" #include "opustab.h" +#define ROUND_MULL(a,b,s) (((MUL64(a, b) >> ((s) - 1)) + 1) >> 1) + typedef struct SilkFrame { int coded; int log_gain; diff --git a/libavcodec/opusenc.c b/libavcodec/opusenc.c index 06f71876eb..d082b86056 100644 --- a/libavcodec/opusenc.c +++ b/libavcodec/opusenc.c @@ -19,6 +19,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include + #include "encode.h" #include "opusenc.h" #include "opus_pvq.h" diff --git a/libavcodec/opusenc.h b/libavcodec/opusenc.h index 32d23deead..4d691d6a7d 100644 --- a/libavcodec/opusenc.h +++ b/libavcodec/opusenc.h @@ -22,7 +22,8 @@ #ifndef AVCODEC_OPUSENC_H #define AVCODEC_OPUSENC_H -#include "opus_celt.h" +#include "libavutil/intmath.h" +#include "opus.h" /* Determines the maximum delay the psychoacoustic system will use for lookahead */ #define FF_BUFQUEUE_SIZE 145 diff --git a/libavcodec/opusenc_psy.c b/libavcodec/opusenc_psy.c index 3bff57d347..9b11651dbe 100644 --- a/libavcodec/opusenc_psy.c +++ b/libavcodec/opusenc_psy.c @@ -19,10 +19,13 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include + #include "opusenc_psy.h" +#include "opus_celt.h" #include "opus_pvq.h" #include "opustab.h" -#include "libavutil/qsort.h" +#include "libavfilter/window_func.h" static float pvq_band_cost(CeltPVQ *pvq, CeltFrame *f, OpusRangeCoder *rc, int band, float *bits, float lambda) diff --git a/libavcodec/opusenc_psy.h b/libavcodec/opusenc_psy.h index 0a7cdb6f2c..67e96b2fa5 100644 --- a/libavcodec/opusenc_psy.h +++ b/libavcodec/opusenc_psy.h @@ -26,8 +26,8 @@ #include "libavutil/mem_internal.h" #include "opusenc.h" +#include "opus_celt.h" #include "opusenc_utils.h" -#include "libavfilter/window_func.h" /* Each step is 2.5ms */ typedef struct OpusPsyStep { From patchwork Mon Oct 3 22:45:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 38550 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp1575985pzh; Mon, 3 Oct 2022 15:47:23 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6tNYqIsDr00+TpBmE7Cxkvtu7UEEYTxjJ4ndJo/JhwLu0v5TFKqPpqM4XvsHZZuGQzC7GC X-Received: by 2002:a05:6402:190f:b0:452:d6ba:a150 with SMTP id e15-20020a056402190f00b00452d6baa150mr20478846edz.126.1664837242980; Mon, 03 Oct 2022 15:47:22 -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 u4-20020a50eac4000000b0045154775089si8697501edp.625.2022.10.03.15.47.22; Mon, 03 Oct 2022 15:47:22 -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=ZsCjTidp; 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 1E63968BC2F; Tue, 4 Oct 2022 01:47:13 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03olkn2036.outbound.protection.outlook.com [40.92.58.36]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 182E968BC07 for ; Tue, 4 Oct 2022 01:47:10 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QeHH8/avFFeZHis6gG2yvOTi1woWGg1BONnvJ8I3k3AtPqjSYdfURJ5gDwgXKJf1E9NW7Tnk03OSwlJW2GnjsOqEFezQTMHgONoePG4WcVEfmAdcMcCHNALTNre2TmypIhP6bK7vBETMntq8IIHxrasMnwOmP5n4roKlkXCUi053Ekusjd5QzJRDtRYgzytPrPS7HnpaV2q0zFZLEl7IXxCb3GJx6ZfBuB9HSH2+SNf6+vSBPKR4EthauvDz+qwOC5fxsyln2g3ypPehTErmPgUwXrl9chkLuTT9YX27vhP+7jV2xQL4oEOBkTRU/fJx4aCFVWIKwS6H1vBzJUXEXw== 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=KkM6hNk8K5pGQjV9F9mMXIIUUR7ciLotMn4e7tYZiFg=; b=amNyRyjnTOqGNxlfT3iIcbfDRaLUmp9hGIsEIcu5D4P1tI4319TdPCMiplQgyGWX80Wxvo2vybS87H2ZJdUXChJMzRGRhDw3Uo+93V9x8JQm7ArfeAIlLpV4xcvEgNP0RdaDhM9YXN/U/d8q3lbcK0yupER9QURNbTR44UTqfw/rN0voL8GT6X4S9hejWGhBkpov793VDmoTdZWJQOTojsi0d9csE1LzQTUuuMG8e/yUuzVPEgwV0K45KyxSuL8JuMT63ummZZ3oxGLijcMgbsgrl0PXgho8h5q+pW13yF0G2Jq+VDDQja7+h3VNIJU8Ai/fwE7VxQaD5iGBUnHRaw== 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=KkM6hNk8K5pGQjV9F9mMXIIUUR7ciLotMn4e7tYZiFg=; b=ZsCjTidp98Vd4fry4oMF/WTZrOKaSp9v93smJ/c+KxOpCnkYgIR9P1v+V0gF7jd1gjP92OLvcpZBL930BmAAbYG8vuUpb04Q4NM9yT6d5TWDhXSGfoUa22Zp4MLSdPCQoUkJtsX6KDfbum3o1Ov/OPEj9tWR6O1rjxZOff7ipjgOTyPgZSBguAJgRbDvqwH0IQqsN/lKdqBc89S9YMW7dtIU6GHtp9c/TDMxiUSzOiwzceiO+89JSuBABFGcukRnOfXYXZ+WFfmEGlBgy4i1LyUU+NOOMBM6/I+x5Fo3MctqxNDvKiXH1qzp83hCTZSvwy16jhUAqW33kM+/64CBaQ== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by PAXP250MB0470.EURP250.PROD.OUTLOOK.COM (2603:10a6:102:283::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.23; Mon, 3 Oct 2022 22:47:08 +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.5676.023; Mon, 3 Oct 2022 22:47:08 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 4 Oct 2022 00:45:05 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [4R2uXVppTfbukj3zRP384mockHW6WSMzPd0C6c7JqUQ=] X-ClientProxiedBy: ZR0P278CA0056.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:21::7) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <20221003224505.1846824-8-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|PAXP250MB0470:EE_ X-MS-Office365-Filtering-Correlation-Id: acafd0e5-8c24-4fea-9a98-08daa591331a X-MS-Exchange-SLBlob-MailProps: AZnQBsB9Xmpi4YQjBH3ret4WDK5HTi62pMFsuxwuzHuy6x0vEvxQzzpdBBJ7Kb/FGtB9kTgvIXNVhBzlJIePQ4H56tZYuE2azczcE74SN4NPQhQeJOWxntoIlEHP/21qe2ISdKe4Se9vRtMo8y3jtzPFB/w7o5ZFI4UgJKC/kxZGbixrfBHiRYzpMb15qrxrNT32Zkt3gaOHeO0VjU5NgD+ndVTr8KDuhM4TjkZKFWQ72wkfEt97LGVrrEFm+8gSRK3K0tAsdB1tQdhn7dVLzER540aw5w63o8udl5GNBwXkT4gt8Bf+03W57hCXwUixLSTwx7I0S4FKq3vwCDmAxjlXnxVWS8S39mkpmVhO+ole7a/eaV/GKV5BMheowpHbTRucdA83zNwBlzI+mEu963I9vharjBcR2FZZnLK2Besp8cJqiFUicnJG6ZUXB4QoSVa0tWSDYqDfQXfJebe3TCKqvVBVmY9YkisPxoU8o+kbPnq46Mn8CeBnPKFR/OX0Q6ks1TISkBdpJTKXCZX0ff4PQt0B5v+oBdfMite5nV37METByc+8tXyLp1J9FF/OVF//hz/wIpD14Sjnsjq56c2zVQvDQsyAHitte3mnTkYQBo36L/U6d9iAk9v4+XfejUANZLT56HGhnKcxdUs8Y/4f28wAPYf8mt/AnK4dXl7GMjPoYpAiVpyiZEJWLHctciN6jCxZyTyUOVajJGTDt9WSYwnY1bAO6MRHYUINJB+qsVpzJnXjOoNhGICqcwJR0WI8ETe9B/4= X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Y741TlOyT9WpsF1L1pGs3c8hsRp483O99ecEM3TwktayZQPufEAmYv3kAbbWG+o/8K367cHt5uY0cVF8VeWdL9C8EuR9vjqNWFDlnLngAn7Wgu3/5MjZB8gZue63Eur70UEyLYetSRkqCi05/M51QQcQjjLmpsmpQkkXeq3EDZAN1EIru3KsSKXjdr6vJ2VQm8kka3FBMENmJQTdg/+JSNZF4LZbtT3mYq2SdOBkYfQ+kkOZdKS6Km79EVw4f4VXnKY+OxJIU1nS2qOmSBcVYA52L/IpnxCUyYg9lwchluLfLcvuwVPuIC3dVX7gQ5msvEJgPo4A8E6YcxywcbrkuR1+vWQx3o35mYHxiM7pS1XX6qeLqQyzRWiqtzqk81xwIgJHNrcxFLCTN6bwCoaijsq1//ast9tnS7d460PBWT87SxBucYF0+oMeB3u7GLtpe0p0oRhZY7Wcyn0kN9hUTVGukWdlrscWlYdZHqF3ysF/Oh1FnXFCc3knezSw3QeNzCwU9wgRWOt+AHO0gGQ/F/RzPEEnoK6kILEVEwhW3TGGDkiCUTde2GxUtQGyWIsuiWIyoP1C7KvYO3RFF8IFBJyn4h4Fy15bJK0zPAbaUytL9+zZPHypVHdSXqCDC/chOoVpHs9BtRsct2gsOq5PjqhTuTvTK972BGvrPrUAqfkH5P5luiZo65BRRRfxHEqo X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Z/+ODrsNt4LUJEfDZVsclutL0jfloGcDLZUfjkFBh0iwSVyuiZisdqBuaax+I846TJsZEOYU6ReqisJcQG2HVY+0TFi+jhntOW8bgK6p8Dh3PbYLy/hNPTDm0TQzyA6qXfvyJTxNXEgRvkJPaAXS+YyALjgXa0HKI6R45ooNOJu4Cb9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tecnJql52+TPx1SYV47RJXSe9BpJ54ae6N7G92LUwjCkpQHz1mfjzqDBOpaa12Gs= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: acafd0e5-8c24-4fea-9a98-08daa591331a X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2022 22:47:07.4287 (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: PAXP250MB0470 Subject: [FFmpeg-devel] [PATCH 9/9] avcodec/opus: Move Silk declarations to a new header, opus_silk.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: FSO6zUFH2vUu Signed-off-by: Andreas Rheinhardt --- libavcodec/opus.h | 21 ----------------- libavcodec/opus_silk.c | 2 ++ libavcodec/opus_silk.h | 48 ++++++++++++++++++++++++++++++++++++++ libavcodec/opusdec.c | 2 ++ libavcodec/opusenc_utils.h | 3 +++ 5 files changed, 55 insertions(+), 21 deletions(-) create mode 100644 libavcodec/opus_silk.h diff --git a/libavcodec/opus.h b/libavcodec/opus.h index 283d9d9f7a..80d685d47c 100644 --- a/libavcodec/opus.h +++ b/libavcodec/opus.h @@ -25,16 +25,10 @@ #include -#include "avcodec.h" -#include "opus_rc.h" - #define MAX_FRAME_SIZE 1275 #define MAX_FRAMES 48 #define MAX_PACKET_DUR 5760 -#define SILK_HISTORY 322 -#define SILK_MAX_LPC 16 - #define OPUS_TS_HEADER 0x7FE0 // 0x3ff (11 bits) #define OPUS_TS_MASK 0xFFE0 // top 11 bits @@ -62,19 +56,4 @@ enum OpusBandwidth { OPUS_BANDWITH_NB }; -typedef struct SilkContext SilkContext; - -int ff_silk_init(AVCodecContext *avctx, SilkContext **ps, int output_channels); -void ff_silk_free(SilkContext **ps); -void ff_silk_flush(SilkContext *s); - -/** - * Decode the LP layer of one Opus frame (which may correspond to several SILK - * frames). - */ -int ff_silk_decode_superframe(SilkContext *s, OpusRangeCoder *rc, - float *output[2], - enum OpusBandwidth bandwidth, int coded_channels, - int duration_ms); - #endif /* AVCODEC_OPUS_H */ diff --git a/libavcodec/opus_silk.c b/libavcodec/opus_silk.c index fd1e83659c..cf8b16acff 100644 --- a/libavcodec/opus_silk.c +++ b/libavcodec/opus_silk.c @@ -28,6 +28,8 @@ #include "mathops.h" #include "opus.h" +#include "opus_rc.h" +#include "opus_silk.h" #include "opustab.h" #define ROUND_MULL(a,b,s) (((MUL64(a, b) >> ((s) - 1)) + 1) >> 1) diff --git a/libavcodec/opus_silk.h b/libavcodec/opus_silk.h new file mode 100644 index 0000000000..6552c166a4 --- /dev/null +++ b/libavcodec/opus_silk.h @@ -0,0 +1,48 @@ +/* + * Opus Silk functions/definitions + * Copyright (c) 2012 Andrew D'Addesio + * Copyright (c) 2013-2014 Mozilla Corporation + * + * 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_OPUS_SILK_H +#define AVCODEC_OPUS_SILK_H + +#include "avcodec.h" +#include "opus.h" +#include "opus_rc.h" + +#define SILK_HISTORY 322 +#define SILK_MAX_LPC 16 + +typedef struct SilkContext SilkContext; + +int ff_silk_init(AVCodecContext *avctx, SilkContext **ps, int output_channels); +void ff_silk_free(SilkContext **ps); +void ff_silk_flush(SilkContext *s); + +/** + * Decode the LP layer of one Opus frame (which may correspond to several SILK + * frames). + */ +int ff_silk_decode_superframe(SilkContext *s, OpusRangeCoder *rc, + float *output[2], + enum OpusBandwidth bandwidth, int coded_channels, + int duration_ms); + +#endif /* AVCODEC_OPUS_SILK_H */ diff --git a/libavcodec/opusdec.c b/libavcodec/opusdec.c index e26ca0b2c3..c5f06e0600 100644 --- a/libavcodec/opusdec.c +++ b/libavcodec/opusdec.c @@ -53,6 +53,8 @@ #include "opustab.h" #include "opus_celt.h" #include "opus_parse.h" +#include "opus_rc.h" +#include "opus_silk.h" static const uint16_t silk_frame_duration_ms[16] = { 10, 20, 40, 60, diff --git a/libavcodec/opusenc_utils.h b/libavcodec/opusenc_utils.h index be82e13767..c76295979a 100644 --- a/libavcodec/opusenc_utils.h +++ b/libavcodec/opusenc_utils.h @@ -22,6 +22,9 @@ #ifndef AVCODEC_OPUSENC_UTILS_H #define AVCODEC_OPUSENC_UTILS_H +#include +#include + #include "opus.h" typedef struct FFBesselFilter { From patchwork Tue Oct 4 11:09:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 38551 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:4d9:b0:9c:f4b:4e41 with SMTP id 25csp58665pzd; Tue, 4 Oct 2022 04:10:00 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4dPADECB0iXazdJ6qMbgAIHZaS1GEqmjsZiNZiXiq18PeJjN60m3bbQjz0BrgDOo5+B2Dy X-Received: by 2002:a05:6402:1cc3:b0:458:211d:cbe5 with SMTP id ds3-20020a0564021cc300b00458211dcbe5mr24009807edb.221.1664881799924; Tue, 04 Oct 2022 04:09:59 -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 b15-20020a1709063f8f00b0073d9c29892csi9665879ejj.939.2022.10.04.04.09.59; Tue, 04 Oct 2022 04:09:59 -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=UOiSz66z; 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 85A9668A6B5; Tue, 4 Oct 2022 14:09:56 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05olkn2025.outbound.protection.outlook.com [40.92.89.25]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3E15D68BAD5 for ; Tue, 4 Oct 2022 14:09:50 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OOyGIpTImEg43vr4QFDL0BmL2/iVjUmBlxgqgDACOqoiCRWqNhYvRNS4apTBPr2UVPKTNX9liXuOgy/zcBei/zOL/0L7rKrRuaEyOhBFPMjSvMaoe8O1IHYKkyOuaK6dhvjSuo/5znQqYLLXAuVVwBDu6xSbaykIjxQEKL3K9+c4y9TNXZEHw49PGlrJ3P9B5gzGKqUZ3UY1a8u1GnZVnyRI82EWHChctzFSHZK836SIlFU9wYPvAsXluGRT2jPN3/QW24bryGZ3Bo3KuFZVupLF25koTf2/nzTEicYe/0AeBCB7wPQRi2LSRFd+ba/nBhOxPzeFRFH+uJzh5LNa3Q== 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=hG+t4avCj+oFHCeiagft425Fskmkp2f014imGsi5fsA=; b=gnR7IAvNu9rOhD9PnbTtYCYai7IQrKfQbLotpCnFl4vjnvNJzHvH+zSiMpFDSsIv/o1EspfqS3KpjDo65vjqiZD4U7ZQ6gJVklroQsDXjdUQ7+pjUVY4l8+0kGjlgE/ycOw/FeToRLliifwKWSiheYsSAvnIYG3KWaHug4JgbFt0TYThI8yj4vjXCABB0Zo3gIuLouMEZUnnVdNX0mWO6mNbpUr3iBguIBVufmMkVXJ6BfK+kGaNhC6UxvyJ4gEguiyXWsa6NtfPdV2KABoGAA8+jdV5MMjhSgj2qZ0uqrZ++/AVDGEztj9ZkP0OyvzJZQ+7+yDa93IH063ZI+pQJg== 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=hG+t4avCj+oFHCeiagft425Fskmkp2f014imGsi5fsA=; b=UOiSz66zwJA2HMBEvEaLZz4WrxxQQ/x+PBRBzN1i6hCoPw84bGpvj+6FI/9/L0NsZX9ZPYaV0S2sznMmEOc6p3ykeCuIv+EKO3OtZqs8c0hAHk8tgX7PedWZl+2mrnHlQom5e7grYPdLfhXdGQzvwD+lWKR/1qAY1sE/Tj4zcIbev3SpPDob0b4j2hyUaAahYaDSEq9zxQiA8kB8ILzGHM0c3vwRHNY0CU3g3HAT1Y5dqhwvmyNCZksD9T+B+l6ri9aDcvCTth/NdvEB0g+E+QlVbd56MHPBS2rD9BhfHVuTlob5jLQ4oElVPwdrU7ujjoK+Jo4miz2NjH6SFwodew== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by DU2P250MB0048.EURP250.PROD.OUTLOOK.COM (2603:10a6:10:23b::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.31; Tue, 4 Oct 2022 11:09:48 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::85ac:1b92:90f:dc18]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::85ac:1b92:90f:dc18%4]) with mapi id 15.20.5676.028; Tue, 4 Oct 2022 11:09:48 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 4 Oct 2022 13:09:48 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [iUkB8zUDm5kxxTnbhGRSplGneP8MITRFdSlbTc8ZyuY=] X-ClientProxiedBy: ZR0P278CA0099.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:23::14) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20221004110948.1857567-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|DU2P250MB0048:EE_ X-MS-Office365-Filtering-Correlation-Id: 3bf9c1e5-594a-495a-9554-08daa5f8f36f X-MS-Exchange-SLBlob-MailProps: EgT5Wr3QDKyq92yo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zuA0fP3VUDvVmrNIk/OIRghHYpRwMQgx020EgxrjHTQDdrBrCkScVQ5IBNMRmzOLeaqf5PdVJ2EBQDJZXkqRd6b4MoURIJ7aRkSQCMzOehF8q355qE1oaGHdUt8th3PZgC33KC/dFc3ncQc4UPicw+is7xI0oYDR8gdrsjdQ+9/KhvbDecVeJ+HZc5fr+Dsr5q4mE8Y4RmQQBTnMbIhF2Gw65Saa8mUUEYe/4HR/4W+d2qqbKy3nx+ojroLJohEijVyg7j6pNpqWBMruw4mQYYP7KBGh5dMd5c8slGnLWot7B4eXiQpjdM8W564b5PRkXllhu1bmB2i99r7TNSd6zUZN/pRShjcID+65zASLlR57gkLQAUNhksjqVYZG4ze2UKEsCDN+i4UUWO9ZHgFgSAFpMT4aTHZqAxE/xQfCJFzLde8x0ajjDot5sDZk0DK5iuZzFRjrRGFfpghRNFVRmJO7M0KnEQfxmlYE1oQOQTroOKAimvaWuPzTvfF6cP69GKSVeryMXFj6XoEh3Gjc2zksOcQx0MzB2KVnluM1CTX4MHqKJwD/tPpmDglzjEkox+sq2n6GIRVsg8f6R1Gmq3G/pOj7vAMsJrCMhq9VJPZz0yLcPl/lHOX7ACIrXIWvX30ImKkZZJ1Zq6SuJoraiSuKVfZBYxnVUFhFW4Bx/ZZ4wUGZILzJepgZV2eLDKUg7eRWBpWw1GXGUqD13LFBVFH X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3bf9c1e5-594a-495a-9554-08daa5f8f36f X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2022 11:09:48.3806 (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: DU2P250MB0048 Subject: [FFmpeg-devel] [PATCH 10/10] avcodec/opus, opus_celt: Fix header descriptions 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: JQQzwJdbGasA Signed-off-by: Andreas Rheinhardt --- libavcodec/opus.h | 2 +- libavcodec/opus_celt.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/opus.h b/libavcodec/opus.h index 80d685d47c..4d061cf5f8 100644 --- a/libavcodec/opus.h +++ b/libavcodec/opus.h @@ -1,5 +1,5 @@ /* - * Opus decoder/demuxer common functions + * Opus common header * Copyright (c) 2012 Andrew D'Addesio * Copyright (c) 2013-2014 Mozilla Corporation * diff --git a/libavcodec/opus_celt.h b/libavcodec/opus_celt.h index 3aa96244e1..2dbb79be6c 100644 --- a/libavcodec/opus_celt.h +++ b/libavcodec/opus_celt.h @@ -1,5 +1,5 @@ /* - * Opus decoder/demuxer common functions + * Opus decoder/encoder CELT functions * Copyright (c) 2012 Andrew D'Addesio * Copyright (c) 2013-2014 Mozilla Corporation * Copyright (c) 2016 Rostislav Pehlivanov