From patchwork Thu Jun 23 07:24:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Jan_Ekstr=C3=B6m?= X-Patchwork-Id: 36384 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:1a22:b0:84:42e0:ad30 with SMTP id cj34csp3301316pzb; Thu, 23 Jun 2022 00:24:39 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sQb5aPkNeT++CfFJLX+BOxlAN4P5WbXtIVlwmI/ky/dedljCv9qUZvOSBHp9WydErMGsbV X-Received: by 2002:a17:907:3e91:b0:711:ea5e:2d4 with SMTP id hs17-20020a1709073e9100b00711ea5e02d4mr6779643ejc.52.1655969078971; Thu, 23 Jun 2022 00:24:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655969078; cv=none; d=google.com; s=arc-20160816; b=xtmdO6qqZqmnQXiC/wVpm49u2LYT3vbuXFqrpjbd7IBy/xtjKUroSu/4lkLt3jPnsn iVAx0/FUByp94kKrahGUFeuIePEF/qA/dDDeHmoUupiOS0Aft/rkP5eNfb9Qkmug+jub i/0q3B3Rw8IvDVhTCUsqLtHcgHGFFXzLT53g2PL5jsmCBNk5F89PIT21sHDOzHYXAHRU bcNdjqnqgSyvlkpIkN7sYe4yAsI7niaTZ1UQdgLY2gQoFiukzQUQt8n6ARAjxQzJpNE1 R1hyonnRV55GekOSAs9OHED4pg0kSwtOCCdOHSN4r2I2bSx6c3wqfd4Q2Aa9xzeofEQ9 58+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=ehTt8IIZfIT8ecI+E3cUNphuLBPL0p+DQzkLcvNodY4=; b=a9pEraO1/xJZJBy6f9ThsAOsuwmFjoTaZxrc4uDKYtXpui3wk4USAN6tiEjablMtvp FS0eICjhP3ja9+K40IZ5K8KWNC8dimA1Bbdu4Yr6RGdqmz6ObLkgFg1km3OvIjiawX3l UptYm/sFABKGOYNekmQrvXzjKD4f7GDxaYbJUtSn5hqpbgO/cLzJaKyZIPDcLn3mtKEm 4KyfoI4+ZCjkeennprCpzavB6Iv2/QNpvEGZ3rZN3vADrkEU57XQfHRLcqlfygsC6hMB VcN8hIvxX8aZLGE6ek2uBaYzOXFw68tUGE7vA0MYj6eWMzm8yuwXu4o6vnoeFq8e+LS/ tiDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=WGdMgl7J; 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=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id gt11-20020a1709072d8b00b0070560397963si422200ejc.233.2022.06.23.00.24.38; Thu, 23 Jun 2022 00:24:38 -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=@gmail.com header.s=20210112 header.b=WGdMgl7J; 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=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id F352668B6D1; Thu, 23 Jun 2022 10:24:23 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 36FA768B610 for ; Thu, 23 Jun 2022 10:24:16 +0300 (EEST) Received: by mail-lf1-f52.google.com with SMTP id a13so21952365lfr.10 for ; Thu, 23 Jun 2022 00:24:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=MBgWY8MNwEms86OI0H2jLoltmmviCags1Ep62MVQRkM=; b=WGdMgl7JdyzPYNKLhvGtKGw5Hko/itlItkd9SYaaeG1q4/DEecyz7Xvo/HapzWa20g lXLcwGDXo+dnw+b/8HmmPyrxWzM1So3VwcvzFoJD/v4Sx1IfeckgDLWbBQ72PYYzl6jy +exGulgsjaulOiMPlFKfFh9lRfcAqDs/wL5MkBxtWH7OK5Bp4tWi+g14s2u4IvDhnIZW kgQPpdW+FPeKtFJOs265lxT1jGptbFrsS3Ajais17JeqLzkmL6VxjmX4Jtj/S4gidXA1 z9C//2gYR4yvrXH8oKjWWTrp5ZXrTXcB73ibx6Ct81AuVcPfUDC8GIzB3q9kBx4k5ctu cGqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=MBgWY8MNwEms86OI0H2jLoltmmviCags1Ep62MVQRkM=; b=cCz9eRKYyur2HMuGSesZ7BAvQ2HejoLIxYAj48T1f19w9ig6LqXqBopuxAlJfPwXw+ OhVFfFqcYhcjHbWINI73S4VFt/kf5fyNALle+WGd6NmO4yNILkHkjwRWn7Aw6R/rqaF1 oeNMrx9f9Z/qtEN3HpTYcoIo9JwKboBm96yKOtQmKMmRalkXP+ih5gnXAiZs8LaHkLSN VHUmzQbo15Yq6PDiCpzMuXl1nypZzPpKg8imMuH50KUWjmNEictpjCSAnVP+B1r04ZXU n5DX177KV+k3hPTXR79TAOnIv5ILucaW28AAHySBI1NNGVHJYj8hpUhhlCKkdL4Rm4Cx 6Gxw== X-Gm-Message-State: AJIora/CHkbyFRsylTXuCuX+XqiSmzLs3GSPOkFnqxXLzbNKdt/VbJTP JOGo9C6VqR2Gz0c5roFlcI++Ic8oWoc= X-Received: by 2002:a05:6512:31d3:b0:479:478e:2628 with SMTP id j19-20020a05651231d300b00479478e2628mr4761444lfe.153.1655969055520; Thu, 23 Jun 2022 00:24:15 -0700 (PDT) Received: from localhost.localdomain (91-153-198-187.elisa-laajakaista.fi. [91.153.198.187]) by smtp.gmail.com with ESMTPSA id a15-20020a056512200f00b0047f8ec3ca4esm732843lfb.87.2022.06.23.00.24.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jun 2022 00:24:14 -0700 (PDT) From: =?utf-8?q?Jan_Ekstr=C3=B6m?= To: ffmpeg-devel@ffmpeg.org Date: Thu, 23 Jun 2022 10:24:02 +0300 Message-Id: <20220623072408.38977-2-jeebjp@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220623072408.38977-1-jeebjp@gmail.com> References: <20220623072408.38977-1-jeebjp@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v4 1/7] avcodec: make AC-3 bit rate table available in a separate header X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 2NKjE8t0rPt4 From: Jan Ekström This makes it possible to include it from libavformat Signed-off-by: Jan Ekström --- libavcodec/Makefile | 8 +++++--- libavcodec/ac3_bitrate_tab.c | 22 ++++++++++++++++++++++ libavcodec/ac3_bitrate_tab.h | 33 +++++++++++++++++++++++++++++++++ libavcodec/ac3tab.c | 6 ------ 4 files changed, 60 insertions(+), 9 deletions(-) create mode 100644 libavcodec/ac3_bitrate_tab.c create mode 100644 libavcodec/ac3_bitrate_tab.h diff --git a/libavcodec/Makefile b/libavcodec/Makefile index 3b8f7b5e01..10697d31f7 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -190,8 +190,9 @@ OBJS-$(CONFIG_AC3_DECODER) += ac3dec_float.o ac3dec_data.o ac3.o \ OBJS-$(CONFIG_AC3_FIXED_DECODER) += ac3dec_fixed.o ac3dec_data.o ac3.o \ kbdwin.o ac3tab.o ac3_channel_layout_tab.o OBJS-$(CONFIG_AC3_ENCODER) += ac3enc_float.o ac3enc.o ac3tab.o \ - ac3.o kbdwin.o -OBJS-$(CONFIG_AC3_FIXED_ENCODER) += ac3enc_fixed.o ac3enc.o ac3tab.o ac3.o kbdwin.o + ac3.o kbdwin.o ac3_bitrate_tab.o +OBJS-$(CONFIG_AC3_FIXED_ENCODER) += ac3enc_fixed.o ac3enc.o ac3tab.o \ + ac3.o kbdwin.o ac3_bitrate_tab.o OBJS-$(CONFIG_AC3_MF_ENCODER) += mfenc.o mf_utils.o OBJS-$(CONFIG_ACELP_KELVIN_DECODER) += g729dec.o lsp.o celp_math.o celp_filters.o acelp_filters.o acelp_pitch_delay.o acelp_vectors.o g729postfilter.o OBJS-$(CONFIG_AGM_DECODER) += agm.o @@ -1110,7 +1111,8 @@ OBJS-$(CONFIG_LIBZVBI_TELETEXT_DECODER) += libzvbi-teletextdec.o ass.o OBJS-$(CONFIG_AAC_LATM_PARSER) += latm_parser.o OBJS-$(CONFIG_AAC_PARSER) += aac_parser.o aac_ac3_parser.o OBJS-$(CONFIG_AC3_PARSER) += aac_ac3_parser.o ac3tab.o \ - ac3_channel_layout_tab.o + ac3_channel_layout_tab.o \ + ac3_bitrate_tab.o OBJS-$(CONFIG_ADX_PARSER) += adx_parser.o adx.o OBJS-$(CONFIG_AMR_PARSER) += amr_parser.o OBJS-$(CONFIG_AV1_PARSER) += av1_parser.o diff --git a/libavcodec/ac3_bitrate_tab.c b/libavcodec/ac3_bitrate_tab.c new file mode 100644 index 0000000000..9ae8794a4c --- /dev/null +++ b/libavcodec/ac3_bitrate_tab.c @@ -0,0 +1,22 @@ +/* + * AC-3 bit rate table + * copyright (c) 2001 Fabrice Bellard + * + * 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 + */ + +#include "ac3_bitrate_tab.h" diff --git a/libavcodec/ac3_bitrate_tab.h b/libavcodec/ac3_bitrate_tab.h new file mode 100644 index 0000000000..44fc5f59ec --- /dev/null +++ b/libavcodec/ac3_bitrate_tab.h @@ -0,0 +1,33 @@ +/* + * AC-3 bit rate table + * copyright (c) 2001 Fabrice Bellard + * + * 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_AC3_BITRATE_TAB_H +#define AVCODEC_AC3_BITRATE_TAB_H + +#include + +/* possible bitrates */ +const uint16_t ff_ac3_bitrate_tab[19] = { + 32, 40, 48, 56, 64, 80, 96, 112, 128, + 160, 192, 224, 256, 320, 384, 448, 512, 576, 640 +}; + +#endif diff --git a/libavcodec/ac3tab.c b/libavcodec/ac3tab.c index 48c89a8ba0..75865fd7d2 100644 --- a/libavcodec/ac3tab.c +++ b/libavcodec/ac3tab.c @@ -94,12 +94,6 @@ const uint8_t ff_ac3_dec_channel_map[8][2][6] = { /* possible frequencies */ const int ff_ac3_sample_rate_tab[] = { 48000, 44100, 32000, 0 }; -/* possible bitrates */ -const uint16_t ff_ac3_bitrate_tab[19] = { - 32, 40, 48, 56, 64, 80, 96, 112, 128, - 160, 192, 224, 256, 320, 384, 448, 512, 576, 640 -}; - /** * Table of bin locations for rematrixing bands * reference: Section 7.5.2 Rematrixing : Frequency Band Definitions